aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/Kconfig11
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c26
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c31
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c31
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c31
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537.c31
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c31
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c32
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c32
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c30
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c31
-rw-r--r--arch/blackfin/mach-common/Makefile5
-rw-r--r--arch/blackfin/mach-common/dpmc.c137
-rw-r--r--arch/blackfin/mach-common/dpmc_modes.S (renamed from arch/blackfin/mach-common/dpmc.S)27
14 files changed, 459 insertions, 27 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 7f1ab802537f..c8def1cf1758 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -967,6 +967,17 @@ menu "CPU Frequency scaling"
967 967
968source "drivers/cpufreq/Kconfig" 968source "drivers/cpufreq/Kconfig"
969 969
970config CPU_VOLTAGE
971 bool "CPU Voltage scaling"
972 depends on EXPERIMENTAL
973 depends on CPU_FREQ
974 default n
975 help
976 Say Y here if you want CPU voltage scaling according to the CPU frequency.
977 This option violates the PLL BYPASS recommendation in the Blackfin Processor
978 manuals. There is a theoretical risk that during VDDINT transitions
979 the PLL may unlock.
980
970endmenu 981endmenu
971 982
972source "net/Kconfig" 983source "net/Kconfig"
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 583d53811f03..90dd0869edc9 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -50,6 +50,7 @@
50#include <asm/reboot.h> 50#include <asm/reboot.h>
51#include <asm/nand.h> 51#include <asm/nand.h>
52#include <asm/portmux.h> 52#include <asm/portmux.h>
53#include <asm/dpmc.h>
53#include <linux/spi/ad7877.h> 54#include <linux/spi/ad7877.h>
54 55
55/* 56/*
@@ -839,7 +840,32 @@ static struct platform_device bfin_gpios_device = {
839 .resource = &bfin_gpios_resources, 840 .resource = &bfin_gpios_resources,
840}; 841};
841 842
843static const unsigned int cclk_vlev_datasheet[] =
844{
845 VRPAIR(VLEV_100, 400000000),
846 VRPAIR(VLEV_105, 426000000),
847 VRPAIR(VLEV_110, 500000000),
848 VRPAIR(VLEV_115, 533000000),
849 VRPAIR(VLEV_120, 600000000),
850};
851
852static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
853 .tuple_tab = cclk_vlev_datasheet,
854 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
855 .vr_settling_time = 25 /* us */,
856};
857
858static struct platform_device bfin_dpmc = {
859 .name = "bfin dpmc",
860 .dev = {
861 .platform_data = &bfin_dmpc_vreg_data,
862 },
863};
864
842static struct platform_device *stamp_devices[] __initdata = { 865static struct platform_device *stamp_devices[] __initdata = {
866
867 &bfin_dpmc,
868
843#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 869#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
844 &bf5xx_nand_device, 870 &bf5xx_nand_device,
845#endif 871#endif
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index a03149c72681..170ab57ef6e7 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -39,6 +39,7 @@
39#include <asm/dma.h> 39#include <asm/dma.h>
40#include <asm/bfin5xx_spi.h> 40#include <asm/bfin5xx_spi.h>
41#include <asm/portmux.h> 41#include <asm/portmux.h>
42#include <asm/dpmc.h>
42 43
43/* 44/*
44 * Name the Board for the /proc/cpuinfo 45 * Name the Board for the /proc/cpuinfo
@@ -341,7 +342,37 @@ static struct platform_device bfin_pata_device = {
341}; 342};
342#endif 343#endif
343 344
345static const unsigned int cclk_vlev_datasheet[] =
346{
347 VRPAIR(VLEV_085, 250000000),
348 VRPAIR(VLEV_090, 376000000),
349 VRPAIR(VLEV_095, 426000000),
350 VRPAIR(VLEV_100, 426000000),
351 VRPAIR(VLEV_105, 476000000),
352 VRPAIR(VLEV_110, 476000000),
353 VRPAIR(VLEV_115, 476000000),
354 VRPAIR(VLEV_120, 600000000),
355 VRPAIR(VLEV_125, 600000000),
356 VRPAIR(VLEV_130, 600000000),
357};
358
359static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
360 .tuple_tab = cclk_vlev_datasheet,
361 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
362 .vr_settling_time = 25 /* us */,
363};
364
365static struct platform_device bfin_dpmc = {
366 .name = "bfin dpmc",
367 .dev = {
368 .platform_data = &bfin_dmpc_vreg_data,
369 },
370};
371
344static struct platform_device *cm_bf533_devices[] __initdata = { 372static struct platform_device *cm_bf533_devices[] __initdata = {
373
374 &bfin_dpmc,
375
345#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 376#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
346 &bfin_uart_device, 377 &bfin_uart_device,
347#endif 378#endif
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 08a7943949ae..9d28415163ea 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -42,6 +42,7 @@
42#include <asm/dma.h> 42#include <asm/dma.h>
43#include <asm/bfin5xx_spi.h> 43#include <asm/bfin5xx_spi.h>
44#include <asm/portmux.h> 44#include <asm/portmux.h>
45#include <asm/dpmc.h>
45 46
46/* 47/*
47 * Name the Board for the /proc/cpuinfo 48 * Name the Board for the /proc/cpuinfo
@@ -350,7 +351,37 @@ static struct platform_device i2c_gpio_device = {
350}; 351};
351#endif 352#endif
352 353
354static const unsigned int cclk_vlev_datasheet[] =
355{
356 VRPAIR(VLEV_085, 250000000),
357 VRPAIR(VLEV_090, 376000000),
358 VRPAIR(VLEV_095, 426000000),
359 VRPAIR(VLEV_100, 426000000),
360 VRPAIR(VLEV_105, 476000000),
361 VRPAIR(VLEV_110, 476000000),
362 VRPAIR(VLEV_115, 476000000),
363 VRPAIR(VLEV_120, 600000000),
364 VRPAIR(VLEV_125, 600000000),
365 VRPAIR(VLEV_130, 600000000),
366};
367
368static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
369 .tuple_tab = cclk_vlev_datasheet,
370 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
371 .vr_settling_time = 25 /* us */,
372};
373
374static struct platform_device bfin_dpmc = {
375 .name = "bfin dpmc",
376 .dev = {
377 .platform_data = &bfin_dmpc_vreg_data,
378 },
379};
380
353static struct platform_device *ezkit_devices[] __initdata = { 381static struct platform_device *ezkit_devices[] __initdata = {
382
383 &bfin_dpmc,
384
354#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 385#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
355 &smc91x_device, 386 &smc91x_device,
356#endif 387#endif
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 024f418ae543..7fd35fb32fd5 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -45,6 +45,7 @@
45#include <asm/bfin5xx_spi.h> 45#include <asm/bfin5xx_spi.h>
46#include <asm/reboot.h> 46#include <asm/reboot.h>
47#include <asm/portmux.h> 47#include <asm/portmux.h>
48#include <asm/dpmc.h>
48 49
49/* 50/*
50 * Name the Board for the /proc/cpuinfo 51 * Name the Board for the /proc/cpuinfo
@@ -516,7 +517,37 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
516}; 517};
517#endif 518#endif
518 519
520static const unsigned int cclk_vlev_datasheet[] =
521{
522 VRPAIR(VLEV_085, 250000000),
523 VRPAIR(VLEV_090, 376000000),
524 VRPAIR(VLEV_095, 426000000),
525 VRPAIR(VLEV_100, 426000000),
526 VRPAIR(VLEV_105, 476000000),
527 VRPAIR(VLEV_110, 476000000),
528 VRPAIR(VLEV_115, 476000000),
529 VRPAIR(VLEV_120, 600000000),
530 VRPAIR(VLEV_125, 600000000),
531 VRPAIR(VLEV_130, 600000000),
532};
533
534static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
535 .tuple_tab = cclk_vlev_datasheet,
536 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
537 .vr_settling_time = 25 /* us */,
538};
539
540static struct platform_device bfin_dpmc = {
541 .name = "bfin dpmc",
542 .dev = {
543 .platform_data = &bfin_dmpc_vreg_data,
544 },
545};
546
519static struct platform_device *stamp_devices[] __initdata = { 547static struct platform_device *stamp_devices[] __initdata = {
548
549 &bfin_dpmc,
550
520#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 551#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
521 &rtc_device, 552 &rtc_device,
522#endif 553#endif
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c
index d8a23cd9b9ed..706e1a574f09 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c
@@ -41,6 +41,7 @@
41#include <asm/dma.h> 41#include <asm/dma.h>
42#include <asm/bfin5xx_spi.h> 42#include <asm/bfin5xx_spi.h>
43#include <asm/portmux.h> 43#include <asm/portmux.h>
44#include <asm/dpmc.h>
44 45
45/* 46/*
46 * Name the Board for the /proc/cpuinfo 47 * Name the Board for the /proc/cpuinfo
@@ -428,7 +429,37 @@ static struct platform_device bfin_pata_device = {
428}; 429};
429#endif 430#endif
430 431
432static const unsigned int cclk_vlev_datasheet[] =
433{
434 VRPAIR(VLEV_085, 250000000),
435 VRPAIR(VLEV_090, 376000000),
436 VRPAIR(VLEV_095, 426000000),
437 VRPAIR(VLEV_100, 426000000),
438 VRPAIR(VLEV_105, 476000000),
439 VRPAIR(VLEV_110, 476000000),
440 VRPAIR(VLEV_115, 476000000),
441 VRPAIR(VLEV_120, 500000000),
442 VRPAIR(VLEV_125, 533000000),
443 VRPAIR(VLEV_130, 600000000),
444};
445
446static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
447 .tuple_tab = cclk_vlev_datasheet,
448 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
449 .vr_settling_time = 25 /* us */,
450};
451
452static struct platform_device bfin_dpmc = {
453 .name = "bfin dpmc",
454 .dev = {
455 .platform_data = &bfin_dmpc_vreg_data,
456 },
457};
458
431static struct platform_device *cm_bf537_devices[] __initdata = { 459static struct platform_device *cm_bf537_devices[] __initdata = {
460
461 &bfin_dpmc,
462
432#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 463#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
433 &hitachi_fb_device, 464 &hitachi_fb_device,
434#endif 465#endif
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index d3727b7c2d7d..9a756d1f3d73 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -47,6 +47,7 @@
47#include <asm/bfin5xx_spi.h> 47#include <asm/bfin5xx_spi.h>
48#include <asm/reboot.h> 48#include <asm/reboot.h>
49#include <asm/portmux.h> 49#include <asm/portmux.h>
50#include <asm/dpmc.h>
50#include <linux/spi/ad7877.h> 51#include <linux/spi/ad7877.h>
51 52
52/* 53/*
@@ -817,7 +818,37 @@ static struct platform_device bfin_pata_device = {
817}; 818};
818#endif 819#endif
819 820
821static const unsigned int cclk_vlev_datasheet[] =
822{
823 VRPAIR(VLEV_085, 250000000),
824 VRPAIR(VLEV_090, 376000000),
825 VRPAIR(VLEV_095, 426000000),
826 VRPAIR(VLEV_100, 426000000),
827 VRPAIR(VLEV_105, 476000000),
828 VRPAIR(VLEV_110, 476000000),
829 VRPAIR(VLEV_115, 476000000),
830 VRPAIR(VLEV_120, 500000000),
831 VRPAIR(VLEV_125, 533000000),
832 VRPAIR(VLEV_130, 600000000),
833};
834
835static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
836 .tuple_tab = cclk_vlev_datasheet,
837 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
838 .vr_settling_time = 25 /* us */,
839};
840
841static struct platform_device bfin_dpmc = {
842 .name = "bfin dpmc",
843 .dev = {
844 .platform_data = &bfin_dmpc_vreg_data,
845 },
846};
847
820static struct platform_device *stamp_devices[] __initdata = { 848static struct platform_device *stamp_devices[] __initdata = {
849
850 &bfin_dpmc,
851
821#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 852#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
822 &bfin_pcmcia_cf_device, 853 &bfin_pcmcia_cf_device,
823#endif 854#endif
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index e3e8479fffb5..40504eeadec9 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -44,6 +44,7 @@
44#include <asm/nand.h> 44#include <asm/nand.h>
45#include <asm/portmux.h> 45#include <asm/portmux.h>
46#include <asm/mach/bf54x_keys.h> 46#include <asm/mach/bf54x_keys.h>
47#include <asm/dpmc.h>
47#include <linux/input.h> 48#include <linux/input.h>
48#include <linux/spi/ad7877.h> 49#include <linux/spi/ad7877.h>
49 50
@@ -590,7 +591,38 @@ static struct platform_device bfin_device_gpiokeys = {
590}; 591};
591#endif 592#endif
592 593
594static const unsigned int cclk_vlev_datasheet[] =
595{
596/*
597 * Internal VLEV BF54XSBBC1533
598 ****temporarily using these values until data sheet is updated
599 */
600 VRPAIR(VLEV_085, 150000000),
601 VRPAIR(VLEV_090, 250000000),
602 VRPAIR(VLEV_110, 276000000),
603 VRPAIR(VLEV_115, 301000000),
604 VRPAIR(VLEV_120, 525000000),
605 VRPAIR(VLEV_125, 550000000),
606 VRPAIR(VLEV_130, 600000000),
607};
608
609static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
610 .tuple_tab = cclk_vlev_datasheet,
611 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
612 .vr_settling_time = 25 /* us */,
613};
614
615static struct platform_device bfin_dpmc = {
616 .name = "bfin dpmc",
617 .dev = {
618 .platform_data = &bfin_dmpc_vreg_data,
619 },
620};
621
593static struct platform_device *cm_bf548_devices[] __initdata = { 622static struct platform_device *cm_bf548_devices[] __initdata = {
623
624 &bfin_dpmc,
625
594#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 626#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
595 &rtc_device, 627 &rtc_device,
596#endif 628#endif
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index b00f68ac6bc9..d1682bb37509 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -46,6 +46,7 @@
46#include <asm/dma.h> 46#include <asm/dma.h>
47#include <asm/gpio.h> 47#include <asm/gpio.h>
48#include <asm/nand.h> 48#include <asm/nand.h>
49#include <asm/dpmc.h>
49#include <asm/portmux.h> 50#include <asm/portmux.h>
50#include <asm/mach/bf54x_keys.h> 51#include <asm/mach/bf54x_keys.h>
51#include <linux/input.h> 52#include <linux/input.h>
@@ -689,7 +690,38 @@ static struct platform_device bfin_gpios_device = {
689 .resource = &bfin_gpios_resources, 690 .resource = &bfin_gpios_resources,
690}; 691};
691 692
693static const unsigned int cclk_vlev_datasheet[] =
694{
695/*
696 * Internal VLEV BF54XSBBC1533
697 ****temporarily using these values until data sheet is updated
698 */
699 VRPAIR(VLEV_085, 150000000),
700 VRPAIR(VLEV_090, 250000000),
701 VRPAIR(VLEV_110, 276000000),
702 VRPAIR(VLEV_115, 301000000),
703 VRPAIR(VLEV_120, 525000000),
704 VRPAIR(VLEV_125, 550000000),
705 VRPAIR(VLEV_130, 600000000),
706};
707
708static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
709 .tuple_tab = cclk_vlev_datasheet,
710 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
711 .vr_settling_time = 25 /* us */,
712};
713
714static struct platform_device bfin_dpmc = {
715 .name = "bfin dpmc",
716 .dev = {
717 .platform_data = &bfin_dmpc_vreg_data,
718 },
719};
720
692static struct platform_device *ezkit_devices[] __initdata = { 721static struct platform_device *ezkit_devices[] __initdata = {
722
723 &bfin_dpmc,
724
693#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 725#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
694 &rtc_device, 726 &rtc_device,
695#endif 727#endif
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index 9fd580952fd8..4075dafcbc80 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -39,6 +39,7 @@
39#include <asm/dma.h> 39#include <asm/dma.h>
40#include <asm/bfin5xx_spi.h> 40#include <asm/bfin5xx_spi.h>
41#include <asm/portmux.h> 41#include <asm/portmux.h>
42#include <asm/dpmc.h>
42 43
43/* 44/*
44 * Name the Board for the /proc/cpuinfo 45 * Name the Board for the /proc/cpuinfo
@@ -339,8 +340,37 @@ static struct platform_device bfin_pata_device = {
339}; 340};
340#endif 341#endif
341 342
343static const unsigned int cclk_vlev_datasheet[] =
344{
345 VRPAIR(VLEV_085, 250000000),
346 VRPAIR(VLEV_090, 300000000),
347 VRPAIR(VLEV_095, 313000000),
348 VRPAIR(VLEV_100, 350000000),
349 VRPAIR(VLEV_105, 400000000),
350 VRPAIR(VLEV_110, 444000000),
351 VRPAIR(VLEV_115, 450000000),
352 VRPAIR(VLEV_120, 475000000),
353 VRPAIR(VLEV_125, 500000000),
354 VRPAIR(VLEV_130, 600000000),
355};
356
357static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
358 .tuple_tab = cclk_vlev_datasheet,
359 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
360 .vr_settling_time = 25 /* us */,
361};
362
363static struct platform_device bfin_dpmc = {
364 .name = "bfin dpmc",
365 .dev = {
366 .platform_data = &bfin_dmpc_vreg_data,
367 },
368};
369
342static struct platform_device *cm_bf561_devices[] __initdata = { 370static struct platform_device *cm_bf561_devices[] __initdata = {
343 371
372 &bfin_dpmc,
373
344#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 374#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE)
345 &hitachi_fb_device, 375 &hitachi_fb_device,
346#endif 376#endif
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 0d74b7d99209..61d8f7648b24 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -39,6 +39,7 @@
39#include <asm/dma.h> 39#include <asm/dma.h>
40#include <asm/bfin5xx_spi.h> 40#include <asm/bfin5xx_spi.h>
41#include <asm/portmux.h> 41#include <asm/portmux.h>
42#include <asm/dpmc.h>
42 43
43/* 44/*
44 * Name the Board for the /proc/cpuinfo 45 * Name the Board for the /proc/cpuinfo
@@ -443,7 +444,37 @@ static struct platform_device i2c_gpio_device = {
443}; 444};
444#endif 445#endif
445 446
447static const unsigned int cclk_vlev_datasheet[] =
448{
449 VRPAIR(VLEV_085, 250000000),
450 VRPAIR(VLEV_090, 300000000),
451 VRPAIR(VLEV_095, 313000000),
452 VRPAIR(VLEV_100, 350000000),
453 VRPAIR(VLEV_105, 400000000),
454 VRPAIR(VLEV_110, 444000000),
455 VRPAIR(VLEV_115, 450000000),
456 VRPAIR(VLEV_120, 475000000),
457 VRPAIR(VLEV_125, 500000000),
458 VRPAIR(VLEV_130, 600000000),
459};
460
461static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
462 .tuple_tab = cclk_vlev_datasheet,
463 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
464 .vr_settling_time = 25 /* us */,
465};
466
467static struct platform_device bfin_dpmc = {
468 .name = "bfin dpmc",
469 .dev = {
470 .platform_data = &bfin_dmpc_vreg_data,
471 },
472};
473
446static struct platform_device *ezkit_devices[] __initdata = { 474static struct platform_device *ezkit_devices[] __initdata = {
475
476 &bfin_dpmc,
477
447#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 478#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
448 &smc91x_device, 479 &smc91x_device,
449#endif 480#endif
diff --git a/arch/blackfin/mach-common/Makefile b/arch/blackfin/mach-common/Makefile
index 393081e9b680..422bfee34adc 100644
--- a/arch/blackfin/mach-common/Makefile
+++ b/arch/blackfin/mach-common/Makefile
@@ -6,5 +6,6 @@ obj-y := \
6 cache.o cacheinit.o entry.o \ 6 cache.o cacheinit.o entry.o \
7 interrupt.o lock.o irqpanic.o arch_checks.o ints-priority.o 7 interrupt.o lock.o irqpanic.o arch_checks.o ints-priority.o
8 8
9obj-$(CONFIG_PM) += pm.o dpmc.o 9obj-$(CONFIG_PM) += pm.o dpmc_modes.o
10obj-$(CONFIG_CPU_FREQ) += cpufreq.o 10obj-$(CONFIG_CPU_FREQ) += cpufreq.o
11obj-$(CONFIG_CPU_VOLTAGE) += dpmc.o
diff --git a/arch/blackfin/mach-common/dpmc.c b/arch/blackfin/mach-common/dpmc.c
new file mode 100644
index 000000000000..02c7efd1bcf4
--- /dev/null
+++ b/arch/blackfin/mach-common/dpmc.c
@@ -0,0 +1,137 @@
1/*
2 * Copyright 2008 Analog Devices Inc.
3 *
4 * Licensed under the GPL-2 or later.
5 */
6
7#include <linux/cdev.h>
8#include <linux/device.h>
9#include <linux/errno.h>
10#include <linux/fs.h>
11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/platform_device.h>
14#include <linux/types.h>
15#include <linux/cpufreq.h>
16
17#include <asm/delay.h>
18#include <asm/dpmc.h>
19
20#define DRIVER_NAME "bfin dpmc"
21
22#define dprintk(msg...) \
23 cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, DRIVER_NAME, msg)
24
25struct bfin_dpmc_platform_data *pdata;
26
27/**
28 * bfin_set_vlev - Update VLEV field in VR_CTL Reg.
29 * Avoid BYPASS sequence
30 */
31static void bfin_set_vlev(unsigned int vlev)
32{
33 unsigned pll_lcnt;
34
35 pll_lcnt = bfin_read_PLL_LOCKCNT();
36
37 bfin_write_PLL_LOCKCNT(1);
38 bfin_write_VR_CTL((bfin_read_VR_CTL() & ~VLEV) | vlev);
39 bfin_write_PLL_LOCKCNT(pll_lcnt);
40}
41
42/**
43 * bfin_get_vlev - Get CPU specific VLEV from platform device data
44 */
45static unsigned int bfin_get_vlev(unsigned int freq)
46{
47 int i;
48
49 if (!pdata)
50 goto err_out;
51
52 freq >>= 16;
53
54 for (i = 0; i < pdata->tabsize; i++)
55 if (freq <= (pdata->tuple_tab[i] & 0xFFFF))
56 return pdata->tuple_tab[i] >> 16;
57
58err_out:
59 printk(KERN_WARNING "DPMC: No suitable CCLK VDDINT voltage pair found\n");
60 return VLEV_120;
61}
62
63#ifdef CONFIG_CPU_FREQ
64static int
65vreg_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data)
66{
67 struct cpufreq_freqs *freq = data;
68
69 if (val == CPUFREQ_PRECHANGE && freq->old < freq->new) {
70 bfin_set_vlev(bfin_get_vlev(freq->new));
71 udelay(pdata->vr_settling_time); /* Wait until Volatge settled */
72
73 } else if (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)
74 bfin_set_vlev(bfin_get_vlev(freq->new));
75
76 return 0;
77}
78
79static struct notifier_block vreg_cpufreq_notifier_block = {
80 .notifier_call = vreg_cpufreq_notifier
81};
82#endif /* CONFIG_CPU_FREQ */
83
84/**
85 * bfin_dpmc_probe -
86 *
87 */
88static int __devinit bfin_dpmc_probe(struct platform_device *pdev)
89{
90 if (pdev->dev.platform_data)
91 pdata = pdev->dev.platform_data;
92 else
93 return -EINVAL;
94
95 return cpufreq_register_notifier(&vreg_cpufreq_notifier_block,
96 CPUFREQ_TRANSITION_NOTIFIER);
97}
98
99/**
100 * bfin_dpmc_remove -
101 */
102static int __devexit bfin_dpmc_remove(struct platform_device *pdev)
103{
104 pdata = NULL;
105 return cpufreq_unregister_notifier(&vreg_cpufreq_notifier_block,
106 CPUFREQ_TRANSITION_NOTIFIER);
107}
108
109struct platform_driver bfin_dpmc_device_driver = {
110 .probe = bfin_dpmc_probe,
111 .remove = __devexit_p(bfin_dpmc_remove),
112 .driver = {
113 .name = DRIVER_NAME,
114 }
115};
116
117/**
118 * bfin_dpmc_init - Init driver
119 */
120static int __init bfin_dpmc_init(void)
121{
122 return platform_driver_register(&bfin_dpmc_device_driver);
123}
124module_init(bfin_dpmc_init);
125
126/**
127 * bfin_dpmc_exit - break down driver
128 */
129static void __exit bfin_dpmc_exit(void)
130{
131 platform_driver_unregister(&bfin_dpmc_device_driver);
132}
133module_exit(bfin_dpmc_exit);
134
135MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
136MODULE_DESCRIPTION("cpu power management driver for Blackfin");
137MODULE_LICENSE("GPL");
diff --git a/arch/blackfin/mach-common/dpmc.S b/arch/blackfin/mach-common/dpmc_modes.S
index 9d45aa3265b1..b7981d31c392 100644
--- a/arch/blackfin/mach-common/dpmc.S
+++ b/arch/blackfin/mach-common/dpmc_modes.S
@@ -1,30 +1,7 @@
1/* 1/*
2 * File: arch/blackfin/mach-common/dpmc.S 2 * Copyright 2004-2008 Analog Devices Inc.
3 * Based on:
4 * Author: LG Soft India
5 * 3 *
6 * Created: ? 4 * Licensed under the GPL-2 or later.
7 * Description: Watchdog Timer APIs
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 5 */
29 6
30#include <linux/linkage.h> 7#include <linux/linkage.h>