aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/clock_data.c17
-rw-r--r--arch/arm/mach-omap2/Makefile48
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c3
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c3
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c5
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c3
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c3
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c4
-rw-r--r--arch/arm/mach-omap2/board-apollon.c3
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c3
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c3
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c5
-rw-r--r--arch/arm/mach-omap2/board-generic.c3
-rw-r--r--arch/arm/mach-omap2/board-h4.c3
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c4
-rw-r--r--arch/arm/mach-omap2/board-igep0030.c4
-rw-r--r--arch/arm/mach-omap2/board-ldp.c3
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c3
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c5
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c3
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c3
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c5
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c3
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c5
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c3
-rw-r--r--arch/arm/mach-omap2/board-overo.c5
-rw-r--r--arch/arm/mach-omap2/board-rm680.c3
-rw-r--r--arch/arm/mach-omap2/board-rx51.c3
-rw-r--r--arch/arm/mach-omap2/board-zoom.c9
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_apll.c12
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpllcore.c10
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_osc.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_sys.c2
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c14
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c1
-rw-r--r--arch/arm/mach-omap2/clock.c6
-rw-r--r--arch/arm/mach-omap2/clock.h1
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c6
-rw-r--r--arch/arm/mach-omap2/clock2430.c2
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c6
-rw-r--r--arch/arm/mach-omap2/clock34xx.c2
-rw-r--r--arch/arm/mach-omap2/clock3517.c2
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c6
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c218
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c674
-rw-r--r--arch/arm/mach-omap2/clockdomain.c220
-rw-r--r--arch/arm/mach-omap2/clockdomain.h (renamed from arch/arm/plat-omap/include/plat/clockdomain.h)40
-rw-r--r--arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c (renamed from arch/arm/mach-omap2/clockdomains.h)109
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c (renamed from arch/arm/mach-omap2/clockdomains44xx.h)169
-rw-r--r--arch/arm/mach-omap2/cm-regbits-24xx.h7
-rw-r--r--arch/arm/mach-omap2/cm-regbits-34xx.h13
-rw-r--r--arch/arm/mach-omap2/cm-regbits-44xx.h3
-rw-r--r--arch/arm/mach-omap2/cm.c68
-rw-r--r--arch/arm/mach-omap2/cm.h137
-rw-r--r--arch/arm/mach-omap2/cm1_44xx.h261
-rw-r--r--arch/arm/mach-omap2/cm2_44xx.h508
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c471
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h147
-rw-r--r--arch/arm/mach-omap2/cm44xx.c52
-rw-r--r--arch/arm/mach-omap2/cm44xx.h668
-rw-r--r--arch/arm/mach-omap2/cm4xxx.c62
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c214
-rw-r--r--arch/arm/mach-omap2/cminst44xx.h31
-rw-r--r--arch/arm/mach-omap2/control.c111
-rw-r--r--arch/arm/mach-omap2/control.h2
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c4
-rw-r--r--arch/arm/mach-omap2/devices.c64
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c57
-rw-r--r--arch/arm/mach-omap2/dsp.c23
-rw-r--r--arch/arm/mach-omap2/io.c76
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c469
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c20
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c1271
-rw-r--r--arch/arm/mach-omap2/pm-debug.c21
-rw-r--r--arch/arm/mach-omap2/pm.c40
-rw-r--r--arch/arm/mach-omap2/pm.h2
-rw-r--r--arch/arm/mach-omap2/pm24xx.c204
-rw-r--r--arch/arm/mach-omap2/pm34xx.c170
-rw-r--r--arch/arm/mach-omap2/pm44xx.c2
-rw-r--r--arch/arm/mach-omap2/powerdomain-common.c110
-rw-r--r--arch/arm/mach-omap2/powerdomain.c441
-rw-r--r--arch/arm/mach-omap2/powerdomain.h (renamed from arch/arm/plat-omap/include/plat/powerdomain.h)84
-rw-r--r--arch/arm/mach-omap2/powerdomain2xxx_3xxx.c242
-rw-r--r--arch/arm/mach-omap2/powerdomain44xx.c225
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c (renamed from arch/arm/mach-omap2/powerdomains.h)84
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h22
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c (renamed from arch/arm/mach-omap2/powerdomains24xx.h)48
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c (renamed from arch/arm/mach-omap2/powerdomains34xx.h)48
-rw-r--r--arch/arm/mach-omap2/powerdomains44xx_data.c (renamed from arch/arm/mach-omap2/powerdomains44xx.h)92
-rw-r--r--arch/arm/mach-omap2/prcm-common.h85
-rw-r--r--arch/arm/mach-omap2/prcm.c556
-rw-r--r--arch/arm/mach-omap2/prcm44xx.h42
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.c45
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.h104
-rw-r--r--arch/arm/mach-omap2/prm-regbits-24xx.h2
-rw-r--r--arch/arm/mach-omap2/prm-regbits-34xx.h8
-rw-r--r--arch/arm/mach-omap2/prm-regbits-44xx.h2
-rw-r--r--arch/arm/mach-omap2/prm.h369
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c64
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.h367
-rw-r--r--arch/arm/mach-omap2/prm44xx.c81
-rw-r--r--arch/arm/mach-omap2/prm44xx.h766
-rw-r--r--arch/arm/mach-omap2/prminst44xx.c66
-rw-r--r--arch/arm/mach-omap2/prminst44xx.h25
-rw-r--r--arch/arm/mach-omap2/scrm44xx.h175
-rw-r--r--arch/arm/mach-omap2/sdrc.c2
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c6
-rw-r--r--arch/arm/mach-omap2/serial.c14
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S4
-rw-r--r--arch/arm/mach-omap2/sram242x.S10
-rw-r--r--arch/arm/mach-omap2/sram243x.S10
-rw-r--r--arch/arm/mach-omap2/sram34xx.S8
-rw-r--r--arch/arm/mach-omap2/wd_timer.c54
-rw-r--r--arch/arm/mach-omap2/wd_timer.h17
-rw-r--r--arch/arm/plat-omap/gpio.c5
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev_omap.h20
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h16
-rw-r--r--arch/arm/plat-omap/include/plat/common.h2
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h2
-rw-r--r--arch/arm/plat-omap/include/plat/io.h5
-rw-r--r--arch/arm/plat-omap/include/plat/omap-pm.h8
-rw-r--r--arch/arm/plat-omap/include/plat/omap_device.h1
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h55
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h20
-rw-r--r--arch/arm/plat-omap/mcbsp.c10
-rw-r--r--arch/arm/plat-omap/omap-pm-noop.c67
-rw-r--r--arch/arm/plat-omap/omap_device.c28
-rw-r--r--arch/arm/plat-omap/sram.c5
130 files changed, 6939 insertions, 4442 deletions
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index 12fee24181b2..92400b9eb69f 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -823,12 +823,10 @@ int __init omap1_clk_init(void)
823 crystal_type = info->system_clock_type; 823 crystal_type = info->system_clock_type;
824 } 824 }
825 825
826#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 826 if (cpu_is_omap7xx())
827 ck_ref.rate = 13000000; 827 ck_ref.rate = 13000000;
828#elif defined(CONFIG_ARCH_OMAP16XX) 828 if (cpu_is_omap16xx() && crystal_type == 2)
829 if (crystal_type == 2)
830 ck_ref.rate = 19200000; 829 ck_ref.rate = 19200000;
831#endif
832 830
833 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: " 831 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: "
834 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL), 832 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),
@@ -883,10 +881,11 @@ int __init omap1_clk_init(void)
883 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, 881 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
884 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); 882 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
885 883
886#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE) 884 if (machine_is_omap_perseus2() || machine_is_omap_fsample()) {
887 /* Select slicer output as OMAP input clock */ 885 /* Select slicer output as OMAP input clock */
888 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, OMAP7XX_PCC_UPLD_CTRL); 886 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1,
889#endif 887 OMAP7XX_PCC_UPLD_CTRL);
888 }
890 889
891 /* Amstrad Delta wants BCLK high when inactive */ 890 /* Amstrad Delta wants BCLK high when inactive */
892 if (machine_is_ams_delta()) 891 if (machine_is_ams_delta())
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1b699d3c6cb8..1fce382a90a9 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,19 +4,17 @@
4 4
5# Common support 5# Common support
6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \ 6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
7 common.o gpio.o dma.o 7 common.o gpio.o dma.o wd_timer.o
8 8
9omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o 9omap-2-3-common = irq.o sdrc.o
10hwmod-common = omap_hwmod.o \ 10hwmod-common = omap_hwmod.o \
11 omap_hwmod_common_data.o 11 omap_hwmod_common_data.o
12prcm-common = prcm.o powerdomain.o
13clock-common = clock.o clock_common_data.o \ 12clock-common = clock.o clock_common_data.o \
14 clockdomain.o clkt_dpll.o \ 13 clkt_dpll.o clkt_clksel.o
15 clkt_clksel.o
16 14
17obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) 15obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(hwmod-common)
18obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) 16obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(hwmod-common)
19obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) prm44xx.o $(hwmod-common) 17obj-$(CONFIG_ARCH_OMAP4) += prm44xx.o $(hwmod-common)
20 18
21obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 19obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
22 20
@@ -74,10 +72,36 @@ endif
74endif 72endif
75 73
76# PRCM 74# PRCM
77obj-$(CONFIG_ARCH_OMAP2) += cm.o 75obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
78obj-$(CONFIG_ARCH_OMAP3) += cm.o 76obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o
79obj-$(CONFIG_ARCH_OMAP4) += cm4xxx.o 77# XXX The presence of cm2xxx_3xxx.o on the line below is temporary and
80 78# will be removed once the OMAP4 part of the codebase is converted to
79# use OMAP4-specific PRCM functions.
80obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \
81 cm44xx.o prcm_mpu44xx.o \
82 prminst44xx.o
83
84# OMAP powerdomain framework
85powerdomain-common += powerdomain.o powerdomain-common.o
86obj-$(CONFIG_ARCH_OMAP2) += $(powerdomain-common) \
87 powerdomain2xxx_3xxx.o \
88 powerdomains2xxx_data.o \
89 powerdomains2xxx_3xxx_data.o
90obj-$(CONFIG_ARCH_OMAP3) += $(powerdomain-common) \
91 powerdomain2xxx_3xxx.o \
92 powerdomains3xxx_data.o \
93 powerdomains2xxx_3xxx_data.o
94obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \
95 powerdomain44xx.o \
96 powerdomains44xx_data.o
97
98# PRCM clockdomain control
99obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
100 clockdomains2xxx_3xxx_data.o
101obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \
102 clockdomains2xxx_3xxx_data.o
103obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \
104 clockdomains44xx_data.o
81# Clock framework 105# Clock framework
82obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ 106obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \
83 clkt2xxx_sys.o \ 107 clkt2xxx_sys.o \
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index e9eee5f0e6d3..e0661777f599 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -143,7 +143,8 @@ static void __init omap_2430sdp_init_irq(void)
143{ 143{
144 omap_board_config = sdp2430_config; 144 omap_board_config = sdp2430_config;
145 omap_board_config_size = ARRAY_SIZE(sdp2430_config); 145 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
146 omap2_init_common_hw(NULL, NULL); 146 omap2_init_common_infrastructure();
147 omap2_init_common_devices(NULL, NULL);
147 omap_init_irq(); 148 omap_init_irq();
148} 149}
149 150
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 869fb133c207..3b39ef1a680a 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -326,7 +326,8 @@ static void __init omap_3430sdp_init_irq(void)
326 omap_board_config = sdp3430_config; 326 omap_board_config = sdp3430_config;
327 omap_board_config_size = ARRAY_SIZE(sdp3430_config); 327 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
328 omap3_pm_init_cpuidle(omap3_cpuidle_params_table); 328 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
329 omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL); 329 omap2_init_common_infrastructure();
330 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
330 omap_init_irq(); 331 omap_init_irq();
331} 332}
332 333
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index a8d35ba7781e..5d41dbe059a3 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -73,8 +73,9 @@ static void __init omap_sdp_init_irq(void)
73{ 73{
74 omap_board_config = sdp_config; 74 omap_board_config = sdp_config;
75 omap_board_config_size = ARRAY_SIZE(sdp_config); 75 omap_board_config_size = ARRAY_SIZE(sdp_config);
76 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params, 76 omap2_init_common_infrastructure();
77 h8mbx00u0mer0em_sdrc_params); 77 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
78 h8mbx00u0mer0em_sdrc_params);
78 omap_init_irq(); 79 omap_init_irq();
79} 80}
80 81
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 33b1f7319c17..1cb208b6e626 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -242,7 +242,8 @@ static void __init omap_4430sdp_init_irq(void)
242{ 242{
243 omap_board_config = sdp4430_config; 243 omap_board_config = sdp4430_config;
244 omap_board_config_size = ARRAY_SIZE(sdp4430_config); 244 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
245 omap2_init_common_hw(NULL, NULL); 245 omap2_init_common_infrastructure();
246 omap2_init_common_devices(NULL, NULL);
246#ifdef CONFIG_OMAP_32K_TIMER 247#ifdef CONFIG_OMAP_32K_TIMER
247 omap2_gp_clockevent_set_gptimer(1); 248 omap2_gp_clockevent_set_gptimer(1);
248#endif 249#endif
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 8ba404770e75..781ed2558e12 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -47,7 +47,8 @@ static void __init am3517_crane_init_irq(void)
47 omap_board_config = am3517_crane_config; 47 omap_board_config = am3517_crane_config;
48 omap_board_config_size = ARRAY_SIZE(am3517_crane_config); 48 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
49 49
50 omap2_init_common_hw(NULL, NULL); 50 omap2_init_common_infrastructure();
51 omap2_init_common_devices(NULL, NULL);
51 omap_init_irq(); 52 omap_init_irq();
52} 53}
53 54
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 86867138f1e4..bc1562648020 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -389,8 +389,8 @@ static void __init am3517_evm_init_irq(void)
389{ 389{
390 omap_board_config = am3517_evm_config; 390 omap_board_config = am3517_evm_config;
391 omap_board_config_size = ARRAY_SIZE(am3517_evm_config); 391 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
392 392 omap2_init_common_infrastructure();
393 omap2_init_common_hw(NULL, NULL); 393 omap2_init_common_devices(NULL, NULL);
394 omap_init_irq(); 394 omap_init_irq();
395} 395}
396 396
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 200cb386340b..9f55b68687f7 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -278,7 +278,8 @@ static void __init omap_apollon_init_irq(void)
278{ 278{
279 omap_board_config = apollon_config; 279 omap_board_config = apollon_config;
280 omap_board_config_size = ARRAY_SIZE(apollon_config); 280 omap_board_config_size = ARRAY_SIZE(apollon_config);
281 omap2_init_common_hw(NULL, NULL); 281 omap2_init_common_infrastructure();
282 omap2_init_common_devices(NULL, NULL);
282 omap_init_irq(); 283 omap_init_irq();
283} 284}
284 285
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 22c55d13a4e3..486a3de5f401 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -677,7 +677,8 @@ static void __init cm_t35_init_irq(void)
677 omap_board_config = cm_t35_config; 677 omap_board_config = cm_t35_config;
678 omap_board_config_size = ARRAY_SIZE(cm_t35_config); 678 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
679 679
680 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 680 omap2_init_common_infrastructure();
681 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
681 mt46h32m32lf6_sdrc_params); 682 mt46h32m32lf6_sdrc_params);
682 omap_init_irq(); 683 omap_init_irq();
683} 684}
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 7ee23dab84fe..5b0c77732dfc 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -248,7 +248,8 @@ static void __init cm_t3517_init_irq(void)
248 omap_board_config = cm_t3517_config; 248 omap_board_config = cm_t3517_config;
249 omap_board_config_size = ARRAY_SIZE(cm_t3517_config); 249 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
250 250
251 omap2_init_common_hw(NULL, NULL); 251 omap2_init_common_infrastructure();
252 omap2_init_common_devices(NULL, NULL);
252 omap_init_irq(); 253 omap_init_irq();
253} 254}
254 255
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 7392c67ce109..451e7ff08b18 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -444,8 +444,9 @@ static struct platform_device keys_gpio = {
444 444
445static void __init devkit8000_init_irq(void) 445static void __init devkit8000_init_irq(void)
446{ 446{
447 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 447 omap2_init_common_infrastructure();
448 mt46h32m32lf6_sdrc_params); 448 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
449 mt46h32m32lf6_sdrc_params);
449 omap_init_irq(); 450 omap_init_irq();
450#ifdef CONFIG_OMAP_32K_TIMER 451#ifdef CONFIG_OMAP_32K_TIMER
451 omap2_gp_clockevent_set_gptimer(12); 452 omap2_gp_clockevent_set_gptimer(12);
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index b1c2c9a11c38..0e3d81e09f89 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -37,7 +37,8 @@ static void __init omap_generic_init_irq(void)
37{ 37{
38 omap_board_config = generic_config; 38 omap_board_config = generic_config;
39 omap_board_config_size = ARRAY_SIZE(generic_config); 39 omap_board_config_size = ARRAY_SIZE(generic_config);
40 omap2_init_common_hw(NULL, NULL); 40 omap2_init_common_infrastructure();
41 omap2_init_common_devices(NULL, NULL);
41 omap_init_irq(); 42 omap_init_irq();
42} 43}
43 44
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index b386a403c379..25cc9dad4b02 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -294,7 +294,8 @@ static void __init omap_h4_init_irq(void)
294{ 294{
295 omap_board_config = h4_config; 295 omap_board_config = h4_config;
296 omap_board_config_size = ARRAY_SIZE(h4_config); 296 omap_board_config_size = ARRAY_SIZE(h4_config);
297 omap2_init_common_hw(NULL, NULL); 297 omap2_init_common_infrastructure();
298 omap2_init_common_devices(NULL, NULL);
298 omap_init_irq(); 299 omap_init_irq();
299 h4_init_flash(); 300 h4_init_flash();
300} 301}
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index c5bd537553c2..0afa3011db0f 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -520,7 +520,9 @@ static struct platform_device *igep2_devices[] __initdata = {
520 520
521static void __init igep2_init_irq(void) 521static void __init igep2_init_irq(void)
522{ 522{
523 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); 523 omap2_init_common_infrastructure();
524 omap2_init_common_devices(m65kxxxxam_sdrc_params,
525 m65kxxxxam_sdrc_params);
524 omap_init_irq(); 526 omap_init_irq();
525} 527}
526 528
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 886f193a8415..bcccd68f1856 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -289,7 +289,9 @@ static struct twl4030_usb_data igep3_twl4030_usb_data = {
289 289
290static void __init igep3_init_irq(void) 290static void __init igep3_init_irq(void)
291{ 291{
292 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); 292 omap2_init_common_infrastructure();
293 omap2_init_common_devices(m65kxxxxam_sdrc_params,
294 m65kxxxxam_sdrc_params);
293 omap_init_irq(); 295 omap_init_irq();
294} 296}
295 297
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 7455b0aadf86..e5dc74875f9d 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -292,7 +292,8 @@ static void __init omap_ldp_init_irq(void)
292{ 292{
293 omap_board_config = ldp_config; 293 omap_board_config = ldp_config;
294 omap_board_config_size = ARRAY_SIZE(ldp_config); 294 omap_board_config_size = ARRAY_SIZE(ldp_config);
295 omap2_init_common_hw(NULL, NULL); 295 omap2_init_common_infrastructure();
296 omap2_init_common_devices(NULL, NULL);
296 omap_init_irq(); 297 omap_init_irq();
297} 298}
298 299
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index d4ce96316e3b..43af70ec771e 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -631,7 +631,8 @@ static void __init n8x0_map_io(void)
631 631
632static void __init n8x0_init_irq(void) 632static void __init n8x0_init_irq(void)
633{ 633{
634 omap2_init_common_hw(NULL, NULL); 634 omap2_init_common_infrastructure();
635 omap2_init_common_devices(NULL, NULL);
635 omap_init_irq(); 636 omap_init_irq();
636} 637}
637 638
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index f1a8edefa42f..6c127605942f 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -484,8 +484,9 @@ static struct platform_device keys_gpio = {
484 484
485static void __init omap3_beagle_init_irq(void) 485static void __init omap3_beagle_init_irq(void)
486{ 486{
487 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 487 omap2_init_common_infrastructure();
488 mt46h32m32lf6_sdrc_params); 488 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
489 mt46h32m32lf6_sdrc_params);
489 omap_init_irq(); 490 omap_init_irq();
490#ifdef CONFIG_OMAP_32K_TIMER 491#ifdef CONFIG_OMAP_32K_TIMER
491 omap2_gp_clockevent_set_gptimer(12); 492 omap2_gp_clockevent_set_gptimer(12);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 21ffc5c587a1..3de8d9b8ec76 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -623,7 +623,8 @@ static void __init omap3_evm_init_irq(void)
623{ 623{
624 omap_board_config = omap3_evm_config; 624 omap_board_config = omap3_evm_config;
625 omap_board_config_size = ARRAY_SIZE(omap3_evm_config); 625 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
626 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); 626 omap2_init_common_infrastructure();
627 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
627 omap_init_irq(); 628 omap_init_irq();
628} 629}
629 630
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index cfd618d3bda8..15e4b08e99ba 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -197,7 +197,8 @@ static inline void __init board_smsc911x_init(void)
197 197
198static void __init omap3logic_init_irq(void) 198static void __init omap3logic_init_irq(void)
199{ 199{
200 omap2_init_common_hw(NULL, NULL); 200 omap2_init_common_infrastructure();
201 omap2_init_common_devices(NULL, NULL);
201 omap_init_irq(); 202 omap_init_irq();
202} 203}
203 204
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index e64bcb66d1ab..d457b5961f47 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -636,8 +636,9 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
636 636
637static void __init omap3pandora_init_irq(void) 637static void __init omap3pandora_init_irq(void)
638{ 638{
639 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 639 omap2_init_common_infrastructure();
640 mt46h32m32lf6_sdrc_params); 640 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
641 mt46h32m32lf6_sdrc_params);
641 omap_init_irq(); 642 omap_init_irq();
642} 643}
643 644
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 1af344b872bc..9df9d9367608 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -584,7 +584,8 @@ static void __init omap3_stalker_init_irq(void)
584{ 584{
585 omap_board_config = omap3_stalker_config; 585 omap_board_config = omap3_stalker_config;
586 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); 586 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
587 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); 587 omap2_init_common_infrastructure();
588 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
588 omap_init_irq(); 589 omap_init_irq();
589#ifdef CONFIG_OMAP_32K_TIMER 590#ifdef CONFIG_OMAP_32K_TIMER
590 omap2_gp_clockevent_set_gptimer(12); 591 omap2_gp_clockevent_set_gptimer(12);
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index baa72c507d4c..db1f74fe6c4f 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -420,8 +420,9 @@ static void __init omap3_touchbook_init_irq(void)
420 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 420 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
421 omap_board_config = omap3_touchbook_config; 421 omap_board_config = omap3_touchbook_config;
422 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); 422 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
423 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 423 omap2_init_common_infrastructure();
424 mt46h32m32lf6_sdrc_params); 424 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
425 mt46h32m32lf6_sdrc_params);
425 omap_init_irq(); 426 omap_init_irq();
426#ifdef CONFIG_OMAP_32K_TIMER 427#ifdef CONFIG_OMAP_32K_TIMER
427 omap2_gp_clockevent_set_gptimer(12); 428 omap2_gp_clockevent_set_gptimer(12);
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index d4a9aa41e877..b43e3ff9adec 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -77,7 +77,8 @@ static struct platform_device *panda_devices[] __initdata = {
77 77
78static void __init omap4_panda_init_irq(void) 78static void __init omap4_panda_init_irq(void)
79{ 79{
80 omap2_init_common_hw(NULL, NULL); 80 omap2_init_common_infrastructure();
81 omap2_init_common_devices(NULL, NULL);
81 gic_init_irq(); 82 gic_init_irq();
82} 83}
83 84
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index b75bdcd47117..cb26e5d8268d 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -413,8 +413,9 @@ static void __init overo_init_irq(void)
413{ 413{
414 omap_board_config = overo_config; 414 omap_board_config = overo_config;
415 omap_board_config_size = ARRAY_SIZE(overo_config); 415 omap_board_config_size = ARRAY_SIZE(overo_config);
416 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 416 omap2_init_common_infrastructure();
417 mt46h32m32lf6_sdrc_params); 417 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
418 mt46h32m32lf6_sdrc_params);
418 omap_init_irq(); 419 omap_init_irq();
419} 420}
420 421
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 8da65bd6ff8d..cb77be7ac44f 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -145,8 +145,9 @@ static void __init rm680_init_irq(void)
145{ 145{
146 struct omap_sdrc_params *sdrc_params; 146 struct omap_sdrc_params *sdrc_params;
147 147
148 omap2_init_common_infrastructure();
148 sdrc_params = nokia_get_sdram_timings(); 149 sdrc_params = nokia_get_sdram_timings();
149 omap2_init_common_hw(sdrc_params, sdrc_params); 150 omap2_init_common_devices(sdrc_params, sdrc_params);
150 omap_init_irq(); 151 omap_init_irq();
151} 152}
152 153
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 7362c91ddd76..f53fc551c58f 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -105,8 +105,9 @@ static void __init rx51_init_irq(void)
105 omap_board_config = rx51_config; 105 omap_board_config = rx51_config;
106 omap_board_config_size = ARRAY_SIZE(rx51_config); 106 omap_board_config_size = ARRAY_SIZE(rx51_config);
107 omap3_pm_init_cpuidle(rx51_cpuidle_params); 107 omap3_pm_init_cpuidle(rx51_cpuidle_params);
108 omap2_init_common_infrastructure();
108 sdrc_params = nokia_get_sdram_timings(); 109 sdrc_params = nokia_get_sdram_timings();
109 omap2_init_common_hw(sdrc_params, sdrc_params); 110 omap2_init_common_devices(sdrc_params, sdrc_params);
110 omap_init_irq(); 111 omap_init_irq();
111} 112}
112 113
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 0dff9deaa896..e041c537ea37 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -35,12 +35,13 @@
35 35
36static void __init omap_zoom_init_irq(void) 36static void __init omap_zoom_init_irq(void)
37{ 37{
38 omap2_init_common_infrastructure();
38 if (machine_is_omap_zoom2()) 39 if (machine_is_omap_zoom2())
39 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 40 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
40 mt46h32m32lf6_sdrc_params); 41 mt46h32m32lf6_sdrc_params);
41 else if (machine_is_omap_zoom3()) 42 else if (machine_is_omap_zoom3())
42 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params, 43 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
43 h8mbx00u0mer0em_sdrc_params); 44 h8mbx00u0mer0em_sdrc_params);
44 45
45 omap_init_irq(); 46 omap_init_irq();
46} 47}
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c
index 66e01acfd585..f51cffd1fc53 100644
--- a/arch/arm/mach-omap2/clkt2xxx_apll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_apll.c
@@ -26,7 +26,7 @@
26 26
27#include "clock.h" 27#include "clock.h"
28#include "clock2xxx.h" 28#include "clock2xxx.h"
29#include "cm.h" 29#include "cm2xxx_3xxx.h"
30#include "cm-regbits-24xx.h" 30#include "cm-regbits-24xx.h"
31 31
32/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ 32/* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */
@@ -49,14 +49,14 @@ static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask)
49 49
50 apll_mask = EN_APLL_LOCKED << clk->enable_bit; 50 apll_mask = EN_APLL_LOCKED << clk->enable_bit;
51 51
52 cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); 52 cval = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
53 53
54 if ((cval & apll_mask) == apll_mask) 54 if ((cval & apll_mask) == apll_mask)
55 return 0; /* apll already enabled */ 55 return 0; /* apll already enabled */
56 56
57 cval &= ~apll_mask; 57 cval &= ~apll_mask;
58 cval |= apll_mask; 58 cval |= apll_mask;
59 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 59 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
60 60
61 omap2_cm_wait_idlest(cm_idlest_pll, status_mask, 61 omap2_cm_wait_idlest(cm_idlest_pll, status_mask,
62 OMAP24XX_CM_IDLEST_VAL, clk->name); 62 OMAP24XX_CM_IDLEST_VAL, clk->name);
@@ -83,9 +83,9 @@ static void omap2_clk_apll_disable(struct clk *clk)
83{ 83{
84 u32 cval; 84 u32 cval;
85 85
86 cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); 86 cval = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
87 cval &= ~(EN_APLL_LOCKED << clk->enable_bit); 87 cval &= ~(EN_APLL_LOCKED << clk->enable_bit);
88 cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); 88 omap2_cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN);
89} 89}
90 90
91/* Public data */ 91/* Public data */
@@ -106,7 +106,7 @@ u32 omap2xxx_get_apll_clkin(void)
106{ 106{
107 u32 aplls, srate = 0; 107 u32 aplls, srate = 0;
108 108
109 aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); 109 aplls = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
110 aplls &= OMAP24XX_APLLS_CLKIN_MASK; 110 aplls &= OMAP24XX_APLLS_CLKIN_MASK;
111 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; 111 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT;
112 112
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
index 019048434f13..4ae439222085 100644
--- a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
+++ b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c
@@ -32,7 +32,7 @@
32#include "clock.h" 32#include "clock.h"
33#include "clock2xxx.h" 33#include "clock2xxx.h"
34#include "opp2xxx.h" 34#include "opp2xxx.h"
35#include "cm.h" 35#include "cm2xxx_3xxx.h"
36#include "cm-regbits-24xx.h" 36#include "cm-regbits-24xx.h"
37 37
38/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ 38/* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */
@@ -54,7 +54,7 @@ unsigned long omap2xxx_clk_get_core_rate(struct clk *clk)
54 54
55 core_clk = omap2_get_dpll_rate(clk); 55 core_clk = omap2_get_dpll_rate(clk);
56 56
57 v = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 57 v = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
58 v &= OMAP24XX_CORE_CLK_SRC_MASK; 58 v &= OMAP24XX_CORE_CLK_SRC_MASK;
59 59
60 if (v == CORE_CLK_SRC_32K) 60 if (v == CORE_CLK_SRC_32K)
@@ -73,7 +73,7 @@ static long omap2_dpllcore_round_rate(unsigned long target_rate)
73{ 73{
74 u32 high, low, core_clk_src; 74 u32 high, low, core_clk_src;
75 75
76 core_clk_src = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 76 core_clk_src = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
77 core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK; 77 core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK;
78 78
79 if (core_clk_src == CORE_CLK_SRC_DPLL) { /* DPLL clockout */ 79 if (core_clk_src == CORE_CLK_SRC_DPLL) { /* DPLL clockout */
@@ -111,7 +111,7 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
111 const struct dpll_data *dd; 111 const struct dpll_data *dd;
112 112
113 cur_rate = omap2xxx_clk_get_core_rate(dclk); 113 cur_rate = omap2xxx_clk_get_core_rate(dclk);
114 mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 114 mult = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
115 mult &= OMAP24XX_CORE_CLK_SRC_MASK; 115 mult &= OMAP24XX_CORE_CLK_SRC_MASK;
116 116
117 if ((rate == (cur_rate / 2)) && (mult == 2)) { 117 if ((rate == (cur_rate / 2)) && (mult == 2)) {
@@ -136,7 +136,7 @@ int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate)
136 tmpset.cm_clksel1_pll &= ~(dd->mult_mask | 136 tmpset.cm_clksel1_pll &= ~(dd->mult_mask |
137 dd->div1_mask); 137 dd->div1_mask);
138 div = ((curr_prcm_set->xtal_speed / 1000000) - 1); 138 div = ((curr_prcm_set->xtal_speed / 1000000) - 1);
139 tmpset.cm_clksel2_pll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); 139 tmpset.cm_clksel2_pll = omap2_cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
140 tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK; 140 tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK;
141 if (rate > low) { 141 if (rate > low) {
142 tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2; 142 tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2;
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c
index 2167be84a5bc..df7b80506483 100644
--- a/arch/arm/mach-omap2/clkt2xxx_osc.c
+++ b/arch/arm/mach-omap2/clkt2xxx_osc.c
@@ -27,7 +27,7 @@
27 27
28#include "clock.h" 28#include "clock.h"
29#include "clock2xxx.h" 29#include "clock2xxx.h"
30#include "prm.h" 30#include "prm2xxx_3xxx.h"
31#include "prm-regbits-24xx.h" 31#include "prm-regbits-24xx.h"
32 32
33static int omap2_enable_osc_ck(struct clk *clk) 33static int omap2_enable_osc_ck(struct clk *clk)
diff --git a/arch/arm/mach-omap2/clkt2xxx_sys.c b/arch/arm/mach-omap2/clkt2xxx_sys.c
index 822b5a79f457..8693cfdac49a 100644
--- a/arch/arm/mach-omap2/clkt2xxx_sys.c
+++ b/arch/arm/mach-omap2/clkt2xxx_sys.c
@@ -26,7 +26,7 @@
26 26
27#include "clock.h" 27#include "clock.h"
28#include "clock2xxx.h" 28#include "clock2xxx.h"
29#include "prm.h" 29#include "prm2xxx_3xxx.h"
30#include "prm-regbits-24xx.h" 30#include "prm-regbits-24xx.h"
31 31
32void __iomem *prcm_clksrc_ctrl; 32void __iomem *prcm_clksrc_ctrl;
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
index aef62918aaf0..39f9d5a58d0c 100644
--- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
+++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c
@@ -40,7 +40,7 @@
40#include "clock.h" 40#include "clock.h"
41#include "clock2xxx.h" 41#include "clock2xxx.h"
42#include "opp2xxx.h" 42#include "opp2xxx.h"
43#include "cm.h" 43#include "cm2xxx_3xxx.h"
44#include "cm-regbits-24xx.h" 44#include "cm-regbits-24xx.h"
45 45
46const struct prcm_config *curr_prcm_set; 46const struct prcm_config *curr_prcm_set;
@@ -133,21 +133,21 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
133 done_rate = CORE_CLK_SRC_DPLL; 133 done_rate = CORE_CLK_SRC_DPLL;
134 134
135 /* MPU divider */ 135 /* MPU divider */
136 cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL); 136 omap2_cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL);
137 137
138 /* dsp + iva1 div(2420), iva2.1(2430) */ 138 /* dsp + iva1 div(2420), iva2.1(2430) */
139 cm_write_mod_reg(prcm->cm_clksel_dsp, 139 omap2_cm_write_mod_reg(prcm->cm_clksel_dsp,
140 OMAP24XX_DSP_MOD, CM_CLKSEL); 140 OMAP24XX_DSP_MOD, CM_CLKSEL);
141 141
142 cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL); 142 omap2_cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL);
143 143
144 /* Major subsystem dividers */ 144 /* Major subsystem dividers */
145 tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; 145 tmp = omap2_cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK;
146 cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, 146 omap2_cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD,
147 CM_CLKSEL1); 147 CM_CLKSEL1);
148 148
149 if (cpu_is_omap2430()) 149 if (cpu_is_omap2430())
150 cm_write_mod_reg(prcm->cm_clksel_mdm, 150 omap2_cm_write_mod_reg(prcm->cm_clksel_mdm,
151 OMAP2430_MDM_MOD, CM_CLKSEL); 151 OMAP2430_MDM_MOD, CM_CLKSEL);
152 152
153 /* x2 to enter omap2xxx_sdrc_init_params() */ 153 /* x2 to enter omap2xxx_sdrc_init_params() */
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index 6ce512e902c6..337392c3f549 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -24,7 +24,6 @@
24#include <plat/clock.h> 24#include <plat/clock.h>
25 25
26#include "clock.h" 26#include "clock.h"
27#include "cm.h"
28#include "cm-regbits-24xx.h" 27#include "cm-regbits-24xx.h"
29#include "cm-regbits-34xx.h" 28#include "cm-regbits-34xx.h"
30 29
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index b5babf5440e4..2a2f15213add 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -24,14 +24,12 @@
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25 25
26#include <plat/clock.h> 26#include <plat/clock.h>
27#include <plat/clockdomain.h> 27#include "clockdomain.h"
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <plat/prcm.h> 29#include <plat/prcm.h>
30 30
31#include "clock.h" 31#include "clock.h"
32#include "prm.h" 32#include "cm2xxx_3xxx.h"
33#include "prm-regbits-24xx.h"
34#include "cm.h"
35#include "cm-regbits-24xx.h" 33#include "cm-regbits-24xx.h"
36#include "cm-regbits-34xx.h" 34#include "cm-regbits-34xx.h"
37 35
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index a535c7a2a62a..896584e3c4ab 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -49,7 +49,6 @@
49 49
50/* DPLL Type and DCO Selection Flags */ 50/* DPLL Type and DCO Selection Flags */
51#define DPLL_J_TYPE 0x1 51#define DPLL_J_TYPE 0x1
52#define DPLL_NO_DCO_SEL 0x2
53 52
54int omap2_clk_enable(struct clk *clk); 53int omap2_clk_enable(struct clk *clk);
55void omap2_clk_disable(struct clk *clk); 54void omap2_clk_disable(struct clk *clk);
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index ed61ac2c6f7b..ed1295f5046e 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -22,8 +22,8 @@
22#include "clock.h" 22#include "clock.h"
23#include "clock2xxx.h" 23#include "clock2xxx.h"
24#include "opp2xxx.h" 24#include "opp2xxx.h"
25#include "prm.h" 25#include "cm2xxx_3xxx.h"
26#include "cm.h" 26#include "prm2xxx_3xxx.h"
27#include "prm-regbits-24xx.h" 27#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
29#include "sdrc.h" 29#include "sdrc.h"
@@ -812,7 +812,7 @@ static struct clk dss2_fck = { /* Alt clk used in power management */
812 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), 812 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
813 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK, 813 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
814 .clksel = dss2_fck_clksel, 814 .clksel = dss2_fck_clksel,
815 .recalc = &followparent_recalc, 815 .recalc = &omap2_clksel_recalc,
816}; 816};
817 817
818static struct clk dss_54m_fck = { /* Alt clk used in power management */ 818static struct clk dss_54m_fck = { /* Alt clk used in power management */
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c
index 44d0cccc51a9..d87bc9cb2a36 100644
--- a/arch/arm/mach-omap2/clock2430.c
+++ b/arch/arm/mach-omap2/clock2430.c
@@ -25,7 +25,7 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock2xxx.h" 27#include "clock2xxx.h"
28#include "cm.h" 28#include "cm2xxx_3xxx.h"
29#include "cm-regbits-24xx.h" 29#include "cm-regbits-24xx.h"
30 30
31/** 31/**
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index 1bded4e07489..38341a71c6f8 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -22,8 +22,8 @@
22#include "clock.h" 22#include "clock.h"
23#include "clock2xxx.h" 23#include "clock2xxx.h"
24#include "opp2xxx.h" 24#include "opp2xxx.h"
25#include "prm.h" 25#include "cm2xxx_3xxx.h"
26#include "cm.h" 26#include "prm2xxx_3xxx.h"
27#include "prm-regbits-24xx.h" 27#include "prm-regbits-24xx.h"
28#include "cm-regbits-24xx.h" 28#include "cm-regbits-24xx.h"
29#include "sdrc.h" 29#include "sdrc.h"
@@ -800,7 +800,7 @@ static struct clk dss2_fck = { /* Alt clk used in power management */
800 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), 800 .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1),
801 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK, 801 .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK,
802 .clksel = dss2_fck_clksel, 802 .clksel = dss2_fck_clksel,
803 .recalc = &followparent_recalc, 803 .recalc = &omap2_clksel_recalc,
804}; 804};
805 805
806static struct clk dss_54m_fck = { /* Alt clk used in power management */ 806static struct clk dss_54m_fck = { /* Alt clk used in power management */
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 6febd5f11e85..287abc480924 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -25,7 +25,7 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock34xx.h" 27#include "clock34xx.h"
28#include "cm.h" 28#include "cm2xxx_3xxx.h"
29#include "cm-regbits-34xx.h" 29#include "cm-regbits-34xx.h"
30 30
31/** 31/**
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c
index b496a9305e1c..74116a3cf099 100644
--- a/arch/arm/mach-omap2/clock3517.c
+++ b/arch/arm/mach-omap2/clock3517.c
@@ -25,7 +25,7 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock3517.h" 27#include "clock3517.h"
28#include "cm.h" 28#include "cm2xxx_3xxx.h"
29#include "cm-regbits-34xx.h" 29#include "cm-regbits-34xx.h"
30 30
31/* 31/*
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index a447c4d2c28a..e9f66b6dec18 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -25,9 +25,9 @@
25 25
26#include "clock.h" 26#include "clock.h"
27#include "clock3xxx.h" 27#include "clock3xxx.h"
28#include "prm.h" 28#include "prm2xxx_3xxx.h"
29#include "prm-regbits-34xx.h" 29#include "prm-regbits-34xx.h"
30#include "cm.h" 30#include "cm2xxx_3xxx.h"
31#include "cm-regbits-34xx.h" 31#include "cm-regbits-34xx.h"
32 32
33/* 33/*
@@ -94,7 +94,7 @@ static int __init omap3xxx_clk_arch_init(void)
94 94
95 ret = omap2_clk_switch_mpurate_at_boot("dpll1_ck"); 95 ret = omap2_clk_switch_mpurate_at_boot("dpll1_ck");
96 if (!ret) 96 if (!ret)
97 omap2_clk_print_new_rates("osc_sys_ck", "arm_fck", "core_ck"); 97 omap2_clk_print_new_rates("osc_sys_ck", "core_ck", "arm_fck");
98 98
99 return ret; 99 return ret;
100} 100}
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index ee8aa39269f3..9ab817e6c300 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -28,9 +28,9 @@
28#include "clock36xx.h" 28#include "clock36xx.h"
29#include "clock3517.h" 29#include "clock3517.h"
30 30
31#include "cm.h" 31#include "cm2xxx_3xxx.h"
32#include "cm-regbits-34xx.h" 32#include "cm-regbits-34xx.h"
33#include "prm.h" 33#include "prm2xxx_3xxx.h"
34#include "prm-regbits-34xx.h" 34#include "prm-regbits-34xx.h"
35#include "control.h" 35#include "control.h"
36 36
@@ -120,7 +120,7 @@ static const struct clksel_rate osc_sys_13m_rates[] = {
120}; 120};
121 121
122static const struct clksel_rate osc_sys_16_8m_rates[] = { 122static const struct clksel_rate osc_sys_16_8m_rates[] = {
123 { .div = 1, .val = 5, .flags = RATE_IN_3430ES2PLUS }, 123 { .div = 1, .val = 5, .flags = RATE_IN_3430ES2PLUS_36XX },
124 { .div = 0 } 124 { .div = 0 }
125}; 125};
126 126
@@ -452,35 +452,35 @@ static struct clk dpll3_x2_ck = {
452static const struct clksel_rate div31_dpll3_rates[] = { 452static const struct clksel_rate div31_dpll3_rates[] = {
453 { .div = 1, .val = 1, .flags = RATE_IN_3XXX }, 453 { .div = 1, .val = 1, .flags = RATE_IN_3XXX },
454 { .div = 2, .val = 2, .flags = RATE_IN_3XXX }, 454 { .div = 2, .val = 2, .flags = RATE_IN_3XXX },
455 { .div = 3, .val = 3, .flags = RATE_IN_3430ES2PLUS }, 455 { .div = 3, .val = 3, .flags = RATE_IN_3430ES2PLUS_36XX },
456 { .div = 4, .val = 4, .flags = RATE_IN_3430ES2PLUS }, 456 { .div = 4, .val = 4, .flags = RATE_IN_3430ES2PLUS_36XX },
457 { .div = 5, .val = 5, .flags = RATE_IN_3430ES2PLUS }, 457 { .div = 5, .val = 5, .flags = RATE_IN_3430ES2PLUS_36XX },
458 { .div = 6, .val = 6, .flags = RATE_IN_3430ES2PLUS }, 458 { .div = 6, .val = 6, .flags = RATE_IN_3430ES2PLUS_36XX },
459 { .div = 7, .val = 7, .flags = RATE_IN_3430ES2PLUS }, 459 { .div = 7, .val = 7, .flags = RATE_IN_3430ES2PLUS_36XX },
460 { .div = 8, .val = 8, .flags = RATE_IN_3430ES2PLUS }, 460 { .div = 8, .val = 8, .flags = RATE_IN_3430ES2PLUS_36XX },
461 { .div = 9, .val = 9, .flags = RATE_IN_3430ES2PLUS }, 461 { .div = 9, .val = 9, .flags = RATE_IN_3430ES2PLUS_36XX },
462 { .div = 10, .val = 10, .flags = RATE_IN_3430ES2PLUS }, 462 { .div = 10, .val = 10, .flags = RATE_IN_3430ES2PLUS_36XX },
463 { .div = 11, .val = 11, .flags = RATE_IN_3430ES2PLUS }, 463 { .div = 11, .val = 11, .flags = RATE_IN_3430ES2PLUS_36XX },
464 { .div = 12, .val = 12, .flags = RATE_IN_3430ES2PLUS }, 464 { .div = 12, .val = 12, .flags = RATE_IN_3430ES2PLUS_36XX },
465 { .div = 13, .val = 13, .flags = RATE_IN_3430ES2PLUS }, 465 { .div = 13, .val = 13, .flags = RATE_IN_3430ES2PLUS_36XX },
466 { .div = 14, .val = 14, .flags = RATE_IN_3430ES2PLUS }, 466 { .div = 14, .val = 14, .flags = RATE_IN_3430ES2PLUS_36XX },
467 { .div = 15, .val = 15, .flags = RATE_IN_3430ES2PLUS }, 467 { .div = 15, .val = 15, .flags = RATE_IN_3430ES2PLUS_36XX },
468 { .div = 16, .val = 16, .flags = RATE_IN_3430ES2PLUS }, 468 { .div = 16, .val = 16, .flags = RATE_IN_3430ES2PLUS_36XX },
469 { .div = 17, .val = 17, .flags = RATE_IN_3430ES2PLUS }, 469 { .div = 17, .val = 17, .flags = RATE_IN_3430ES2PLUS_36XX },
470 { .div = 18, .val = 18, .flags = RATE_IN_3430ES2PLUS }, 470 { .div = 18, .val = 18, .flags = RATE_IN_3430ES2PLUS_36XX },
471 { .div = 19, .val = 19, .flags = RATE_IN_3430ES2PLUS }, 471 { .div = 19, .val = 19, .flags = RATE_IN_3430ES2PLUS_36XX },
472 { .div = 20, .val = 20, .flags = RATE_IN_3430ES2PLUS }, 472 { .div = 20, .val = 20, .flags = RATE_IN_3430ES2PLUS_36XX },
473 { .div = 21, .val = 21, .flags = RATE_IN_3430ES2PLUS }, 473 { .div = 21, .val = 21, .flags = RATE_IN_3430ES2PLUS_36XX },
474 { .div = 22, .val = 22, .flags = RATE_IN_3430ES2PLUS }, 474 { .div = 22, .val = 22, .flags = RATE_IN_3430ES2PLUS_36XX },
475 { .div = 23, .val = 23, .flags = RATE_IN_3430ES2PLUS }, 475 { .div = 23, .val = 23, .flags = RATE_IN_3430ES2PLUS_36XX },
476 { .div = 24, .val = 24, .flags = RATE_IN_3430ES2PLUS }, 476 { .div = 24, .val = 24, .flags = RATE_IN_3430ES2PLUS_36XX },
477 { .div = 25, .val = 25, .flags = RATE_IN_3430ES2PLUS }, 477 { .div = 25, .val = 25, .flags = RATE_IN_3430ES2PLUS_36XX },
478 { .div = 26, .val = 26, .flags = RATE_IN_3430ES2PLUS }, 478 { .div = 26, .val = 26, .flags = RATE_IN_3430ES2PLUS_36XX },
479 { .div = 27, .val = 27, .flags = RATE_IN_3430ES2PLUS }, 479 { .div = 27, .val = 27, .flags = RATE_IN_3430ES2PLUS_36XX },
480 { .div = 28, .val = 28, .flags = RATE_IN_3430ES2PLUS }, 480 { .div = 28, .val = 28, .flags = RATE_IN_3430ES2PLUS_36XX },
481 { .div = 29, .val = 29, .flags = RATE_IN_3430ES2PLUS }, 481 { .div = 29, .val = 29, .flags = RATE_IN_3430ES2PLUS_36XX },
482 { .div = 30, .val = 30, .flags = RATE_IN_3430ES2PLUS }, 482 { .div = 30, .val = 30, .flags = RATE_IN_3430ES2PLUS_36XX },
483 { .div = 31, .val = 31, .flags = RATE_IN_3430ES2PLUS }, 483 { .div = 31, .val = 31, .flags = RATE_IN_3430ES2PLUS_36XX },
484 { .div = 0 }, 484 { .div = 0 },
485}; 485};
486 486
@@ -602,6 +602,8 @@ static struct dpll_data dpll4_dd_3630 __initdata = {
602 .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK, 602 .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK,
603 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), 603 .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST),
604 .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK, 604 .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK,
605 .dco_mask = OMAP3630_PERIPH_DPLL_DCO_SEL_MASK,
606 .sddiv_mask = OMAP3630_PERIPH_DPLL_SD_DIV_MASK,
605 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, 607 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT,
606 .min_divider = 1, 608 .min_divider = 1,
607 .max_divider = OMAP3_MAX_DPLL_DIV, 609 .max_divider = OMAP3_MAX_DPLL_DIV,
@@ -1558,6 +1560,7 @@ static struct clk mcspi4_fck = {
1558 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1560 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1559 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, 1561 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
1560 .recalc = &followparent_recalc, 1562 .recalc = &followparent_recalc,
1563 .clkdm_name = "core_l4_clkdm",
1561}; 1564};
1562 1565
1563static struct clk mcspi3_fck = { 1566static struct clk mcspi3_fck = {
@@ -1567,6 +1570,7 @@ static struct clk mcspi3_fck = {
1567 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1570 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1568 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, 1571 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
1569 .recalc = &followparent_recalc, 1572 .recalc = &followparent_recalc,
1573 .clkdm_name = "core_l4_clkdm",
1570}; 1574};
1571 1575
1572static struct clk mcspi2_fck = { 1576static struct clk mcspi2_fck = {
@@ -1576,6 +1580,7 @@ static struct clk mcspi2_fck = {
1576 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1580 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1577 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, 1581 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
1578 .recalc = &followparent_recalc, 1582 .recalc = &followparent_recalc,
1583 .clkdm_name = "core_l4_clkdm",
1579}; 1584};
1580 1585
1581static struct clk mcspi1_fck = { 1586static struct clk mcspi1_fck = {
@@ -1585,6 +1590,7 @@ static struct clk mcspi1_fck = {
1585 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1590 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1586 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, 1591 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
1587 .recalc = &followparent_recalc, 1592 .recalc = &followparent_recalc,
1593 .clkdm_name = "core_l4_clkdm",
1588}; 1594};
1589 1595
1590static struct clk uart2_fck = { 1596static struct clk uart2_fck = {
@@ -3044,6 +3050,7 @@ static struct clk sr1_fck = {
3044 .parent = &sys_ck, 3050 .parent = &sys_ck,
3045 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 3051 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
3046 .enable_bit = OMAP3430_EN_SR1_SHIFT, 3052 .enable_bit = OMAP3430_EN_SR1_SHIFT,
3053 .clkdm_name = "wkup_clkdm",
3047 .recalc = &followparent_recalc, 3054 .recalc = &followparent_recalc,
3048}; 3055};
3049 3056
@@ -3054,6 +3061,7 @@ static struct clk sr2_fck = {
3054 .parent = &sys_ck, 3061 .parent = &sys_ck,
3055 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), 3062 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN),
3056 .enable_bit = OMAP3430_EN_SR2_SHIFT, 3063 .enable_bit = OMAP3430_EN_SR2_SHIFT,
3064 .clkdm_name = "wkup_clkdm",
3057 .recalc = &followparent_recalc, 3065 .recalc = &followparent_recalc,
3058}; 3066};
3059 3067
@@ -3201,7 +3209,7 @@ static struct omap_clk omap3xxx_clks[] = {
3201 CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX), 3209 CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX),
3202 CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_3XXX), 3210 CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_3XXX),
3203 CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_3XXX), 3211 CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_3XXX),
3204 CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2 | CK_AM35XX), 3212 CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3205 CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_3XXX), 3213 CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_3XXX),
3206 CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_3XXX), 3214 CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_3XXX),
3207 CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX), 3215 CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX),
@@ -3218,8 +3226,8 @@ static struct omap_clk omap3xxx_clks[] = {
3218 CLK(NULL, "dpll1_ck", &dpll1_ck, CK_3XXX), 3226 CLK(NULL, "dpll1_ck", &dpll1_ck, CK_3XXX),
3219 CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_3XXX), 3227 CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_3XXX),
3220 CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_3XXX), 3228 CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_3XXX),
3221 CLK(NULL, "dpll2_ck", &dpll2_ck, CK_343X), 3229 CLK(NULL, "dpll2_ck", &dpll2_ck, CK_34XX | CK_36XX),
3222 CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_343X), 3230 CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_34XX | CK_36XX),
3223 CLK(NULL, "dpll3_ck", &dpll3_ck, CK_3XXX), 3231 CLK(NULL, "dpll3_ck", &dpll3_ck, CK_3XXX),
3224 CLK(NULL, "core_ck", &core_ck, CK_3XXX), 3232 CLK(NULL, "core_ck", &core_ck, CK_3XXX),
3225 CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_3XXX), 3233 CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_3XXX),
@@ -3248,8 +3256,8 @@ static struct omap_clk omap3xxx_clks[] = {
3248 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX), 3256 CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX),
3249 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX), 3257 CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX),
3250 CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX), 3258 CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX),
3251 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2 | CK_AM35XX), 3259 CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3252 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2 | CK_AM35XX), 3260 CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3253 CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_3XXX), 3261 CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_3XXX),
3254 CLK(NULL, "sys_clkout2", &sys_clkout2, CK_3XXX), 3262 CLK(NULL, "sys_clkout2", &sys_clkout2, CK_3XXX),
3255 CLK(NULL, "corex2_fck", &corex2_fck, CK_3XXX), 3263 CLK(NULL, "corex2_fck", &corex2_fck, CK_3XXX),
@@ -3257,8 +3265,8 @@ static struct omap_clk omap3xxx_clks[] = {
3257 CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX), 3265 CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX),
3258 CLK(NULL, "arm_fck", &arm_fck, CK_3XXX), 3266 CLK(NULL, "arm_fck", &arm_fck, CK_3XXX),
3259 CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX), 3267 CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX),
3260 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X), 3268 CLK(NULL, "dpll2_fck", &dpll2_fck, CK_34XX | CK_36XX),
3261 CLK(NULL, "iva2_ck", &iva2_ck, CK_343X), 3269 CLK(NULL, "iva2_ck", &iva2_ck, CK_34XX | CK_36XX),
3262 CLK(NULL, "l3_ick", &l3_ick, CK_3XXX), 3270 CLK(NULL, "l3_ick", &l3_ick, CK_3XXX),
3263 CLK(NULL, "l4_ick", &l4_ick, CK_3XXX), 3271 CLK(NULL, "l4_ick", &l4_ick, CK_3XXX),
3264 CLK(NULL, "rm_ick", &rm_ick, CK_3XXX), 3272 CLK(NULL, "rm_ick", &rm_ick, CK_3XXX),
@@ -3267,23 +3275,23 @@ static struct omap_clk omap3xxx_clks[] = {
3267 CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1), 3275 CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1),
3268 CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1), 3276 CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1),
3269 CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1), 3277 CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1),
3270 CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2 | CK_3517), 3278 CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2PLUS | CK_3517 | CK_36XX),
3271 CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2 | CK_3517), 3279 CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2PLUS | CK_3517 | CK_36XX),
3272 CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), 3280 CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1),
3273 CLK(NULL, "modem_fck", &modem_fck, CK_343X), 3281 CLK(NULL, "modem_fck", &modem_fck, CK_34XX | CK_36XX),
3274 CLK(NULL, "sad2d_ick", &sad2d_ick, CK_343X), 3282 CLK(NULL, "sad2d_ick", &sad2d_ick, CK_34XX | CK_36XX),
3275 CLK(NULL, "mad2d_ick", &mad2d_ick, CK_343X), 3283 CLK(NULL, "mad2d_ick", &mad2d_ick, CK_34XX | CK_36XX),
3276 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_3XXX), 3284 CLK(NULL, "gpt10_fck", &gpt10_fck, CK_3XXX),
3277 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_3XXX), 3285 CLK(NULL, "gpt11_fck", &gpt11_fck, CK_3XXX),
3278 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2 | CK_AM35XX), 3286 CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3279 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2 | CK_AM35XX), 3287 CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3280 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2 | CK_AM35XX), 3288 CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3281 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), 3289 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
3282 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), 3290 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
3283 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3291 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
3284 CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2 | CK_AM35XX), 3292 CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3285 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX), 3293 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX),
3286 CLK(NULL, "mspro_fck", &mspro_fck, CK_343X), 3294 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX),
3287 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX), 3295 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX),
3288 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), 3296 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX),
3289 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), 3297 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX),
@@ -3301,26 +3309,26 @@ static struct omap_clk omap3xxx_clks[] = {
3301 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX), 3309 CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX),
3302 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX), 3310 CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX),
3303 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1), 3311 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1),
3304 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2), 3312 CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
3305 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), 3313 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1),
3306 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2), 3314 CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2PLUS | CK_36XX),
3307 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX), 3315 CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX),
3308 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), 3316 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1),
3309 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2), 3317 CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
3310 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX), 3318 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX),
3311 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX), 3319 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX),
3312 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X), 3320 CLK(NULL, "security_l3_ick", &security_l3_ick, CK_34XX | CK_36XX),
3313 CLK(NULL, "pka_ick", &pka_ick, CK_343X), 3321 CLK(NULL, "pka_ick", &pka_ick, CK_34XX | CK_36XX),
3314 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), 3322 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
3315 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX), 3323 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3316 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), 3324 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3317 CLK(NULL, "icr_ick", &icr_ick, CK_343X), 3325 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
3318 CLK("omap-aes", "ick", &aes2_ick, CK_343X), 3326 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
3319 CLK("omap-sham", "ick", &sha12_ick, CK_343X), 3327 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX),
3320 CLK(NULL, "des2_ick", &des2_ick, CK_343X), 3328 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX),
3321 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), 3329 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX),
3322 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), 3330 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX),
3323 CLK(NULL, "mspro_ick", &mspro_ick, CK_343X), 3331 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX),
3324 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), 3332 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX),
3325 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), 3333 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX),
3326 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX), 3334 CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX),
@@ -3336,37 +3344,37 @@ static struct omap_clk omap3xxx_clks[] = {
3336 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX), 3344 CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX),
3337 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX), 3345 CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX),
3338 CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1), 3346 CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1),
3339 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_343X), 3347 CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_34XX | CK_36XX),
3340 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX), 3348 CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX),
3341 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_343X), 3349 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_34XX | CK_36XX),
3342 CLK(NULL, "ssi_ick", &ssi_ick_3430es1, CK_3430ES1), 3350 CLK(NULL, "ssi_ick", &ssi_ick_3430es1, CK_3430ES1),
3343 CLK(NULL, "ssi_ick", &ssi_ick_3430es2, CK_3430ES2), 3351 CLK(NULL, "ssi_ick", &ssi_ick_3430es2, CK_3430ES2PLUS | CK_36XX),
3344 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_3430ES1), 3352 CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_3430ES1),
3345 CLK(NULL, "security_l4_ick2", &security_l4_ick2, CK_343X), 3353 CLK(NULL, "security_l4_ick2", &security_l4_ick2, CK_34XX | CK_36XX),
3346 CLK(NULL, "aes1_ick", &aes1_ick, CK_343X), 3354 CLK(NULL, "aes1_ick", &aes1_ick, CK_34XX | CK_36XX),
3347 CLK("omap_rng", "ick", &rng_ick, CK_343X), 3355 CLK("omap_rng", "ick", &rng_ick, CK_34XX | CK_36XX),
3348 CLK(NULL, "sha11_ick", &sha11_ick, CK_343X), 3356 CLK(NULL, "sha11_ick", &sha11_ick, CK_34XX | CK_36XX),
3349 CLK(NULL, "des1_ick", &des1_ick, CK_343X), 3357 CLK(NULL, "des1_ick", &des1_ick, CK_34XX | CK_36XX),
3350 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1), 3358 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1),
3351 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2 | CK_AM35XX), 3359 CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3352 CLK("omapdss", "tv_fck", &dss_tv_fck, CK_3XXX), 3360 CLK("omapdss", "tv_fck", &dss_tv_fck, CK_3XXX),
3353 CLK("omapdss", "video_fck", &dss_96m_fck, CK_3XXX), 3361 CLK("omapdss", "video_fck", &dss_96m_fck, CK_3XXX),
3354 CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_3XXX), 3362 CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_3XXX),
3355 CLK("omapdss", "ick", &dss_ick_3430es1, CK_3430ES1), 3363 CLK("omapdss", "ick", &dss_ick_3430es1, CK_3430ES1),
3356 CLK("omapdss", "ick", &dss_ick_3430es2, CK_3430ES2 | CK_AM35XX), 3364 CLK("omapdss", "ick", &dss_ick_3430es2, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3357 CLK(NULL, "cam_mclk", &cam_mclk, CK_343X), 3365 CLK(NULL, "cam_mclk", &cam_mclk, CK_34XX | CK_36XX),
3358 CLK(NULL, "cam_ick", &cam_ick, CK_343X), 3366 CLK(NULL, "cam_ick", &cam_ick, CK_34XX | CK_36XX),
3359 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X), 3367 CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_34XX | CK_36XX),
3360 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2 | CK_AM35XX), 3368 CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3361 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2 | CK_AM35XX), 3369 CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3362 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2 | CK_AM35XX), 3370 CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3363 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2), 3371 CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2PLUS | CK_36XX),
3364 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), 3372 CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX),
3365 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), 3373 CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX),
3366 CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_3XXX), 3374 CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_3XXX),
3367 CLK("omap_wdt", "fck", &wdt2_fck, CK_3XXX), 3375 CLK("omap_wdt", "fck", &wdt2_fck, CK_3XXX),
3368 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_343X), 3376 CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_34XX | CK_36XX),
3369 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2), 3377 CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2PLUS | CK_36XX),
3370 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX), 3378 CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX),
3371 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX), 3379 CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX),
3372 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX), 3380 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX),
@@ -3424,9 +3432,9 @@ static struct omap_clk omap3xxx_clks[] = {
3424 CLK(NULL, "atclk_fck", &atclk_fck, CK_3XXX), 3432 CLK(NULL, "atclk_fck", &atclk_fck, CK_3XXX),
3425 CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_3XXX), 3433 CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_3XXX),
3426 CLK(NULL, "traceclk_fck", &traceclk_fck, CK_3XXX), 3434 CLK(NULL, "traceclk_fck", &traceclk_fck, CK_3XXX),
3427 CLK(NULL, "sr1_fck", &sr1_fck, CK_343X), 3435 CLK(NULL, "sr1_fck", &sr1_fck, CK_34XX | CK_36XX),
3428 CLK(NULL, "sr2_fck", &sr2_fck, CK_343X), 3436 CLK(NULL, "sr2_fck", &sr2_fck, CK_34XX | CK_36XX),
3429 CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_343X), 3437 CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_34XX | CK_36XX),
3430 CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_3XXX), 3438 CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_3XXX),
3431 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_3XXX), 3439 CLK(NULL, "gpt12_fck", &gpt12_fck, CK_3XXX),
3432 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_3XXX), 3440 CLK(NULL, "wdt1_fck", &wdt1_fck, CK_3XXX),
@@ -3447,38 +3455,37 @@ static struct omap_clk omap3xxx_clks[] = {
3447int __init omap3xxx_clk_init(void) 3455int __init omap3xxx_clk_init(void)
3448{ 3456{
3449 struct omap_clk *c; 3457 struct omap_clk *c;
3450 u32 cpu_clkflg = CK_3XXX; 3458 u32 cpu_clkflg = 0;
3451 3459
3452 if (cpu_is_omap3517()) { 3460 if (cpu_is_omap3517()) {
3453 cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS; 3461 cpu_mask = RATE_IN_34XX;
3454 cpu_clkflg |= CK_3517; 3462 cpu_clkflg = CK_3517;
3455 } else if (cpu_is_omap3505()) { 3463 } else if (cpu_is_omap3505()) {
3456 cpu_mask = RATE_IN_3XXX | RATE_IN_3430ES2PLUS; 3464 cpu_mask = RATE_IN_34XX;
3457 cpu_clkflg |= CK_3505; 3465 cpu_clkflg = CK_3505;
3466 } else if (cpu_is_omap3630()) {
3467 cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
3468 cpu_clkflg = CK_36XX;
3458 } else if (cpu_is_omap34xx()) { 3469 } else if (cpu_is_omap34xx()) {
3459 cpu_mask = RATE_IN_3XXX;
3460 cpu_clkflg |= CK_343X;
3461
3462 /*
3463 * Update this if there are further clock changes between ES2
3464 * and production parts
3465 */
3466 if (omap_rev() == OMAP3430_REV_ES1_0) { 3470 if (omap_rev() == OMAP3430_REV_ES1_0) {
3467 /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */ 3471 cpu_mask = RATE_IN_3430ES1;
3468 cpu_clkflg |= CK_3430ES1; 3472 cpu_clkflg = CK_3430ES1;
3469 } else { 3473 } else {
3470 cpu_mask |= RATE_IN_3430ES2PLUS; 3474 /*
3471 cpu_clkflg |= CK_3430ES2; 3475 * Assume that anything that we haven't matched yet
3476 * has 3430ES2-type clocks.
3477 */
3478 cpu_mask = RATE_IN_3430ES2PLUS;
3479 cpu_clkflg = CK_3430ES2PLUS;
3472 } 3480 }
3481 } else {
3482 WARN(1, "clock: could not identify OMAP3 variant\n");
3473 } 3483 }
3474 3484
3475 if (omap3_has_192mhz_clk()) 3485 if (omap3_has_192mhz_clk())
3476 omap_96m_alwon_fck = omap_96m_alwon_fck_3630; 3486 omap_96m_alwon_fck = omap_96m_alwon_fck_3630;
3477 3487
3478 if (cpu_is_omap3630()) { 3488 if (cpu_is_omap3630()) {
3479 cpu_mask |= RATE_IN_36XX;
3480 cpu_clkflg |= CK_36XX;
3481
3482 /* 3489 /*
3483 * XXX This type of dynamic rewriting of the clock tree is 3490 * XXX This type of dynamic rewriting of the clock tree is
3484 * deprecated and should be revised soon. 3491 * deprecated and should be revised soon.
@@ -3525,10 +3532,9 @@ int __init omap3xxx_clk_init(void)
3525 3532
3526 recalculate_root_clocks(); 3533 recalculate_root_clocks();
3527 3534
3528 printk(KERN_INFO "Clocking rate (Crystal/Core/MPU): " 3535 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
3529 "%ld.%01ld/%ld/%ld MHz\n", 3536 (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10,
3530 (osc_sys_ck.rate / 1000000), (osc_sys_ck.rate / 100000) % 10, 3537 (core_ck.rate / 1000000), (arm_fck.rate / 1000000));
3531 (core_ck.rate / 1000000), (arm_fck.rate / 1000000));
3532 3538
3533 /* 3539 /*
3534 * Only enable those clocks we will need, let the drivers 3540 * Only enable those clocks we will need, let the drivers
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 217cce489738..c426adccad06 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -30,11 +30,18 @@
30 30
31#include "clock.h" 31#include "clock.h"
32#include "clock44xx.h" 32#include "clock44xx.h"
33#include "cm.h" 33#include "cm1_44xx.h"
34#include "cm2_44xx.h"
34#include "cm-regbits-44xx.h" 35#include "cm-regbits-44xx.h"
35#include "prm.h" 36#include "prm44xx.h"
37#include "prm44xx.h"
36#include "prm-regbits-44xx.h" 38#include "prm-regbits-44xx.h"
37#include "control.h" 39#include "control.h"
40#include "scrm44xx.h"
41
42/* OMAP4 modulemode control */
43#define OMAP4430_MODULEMODE_HWCTRL 0
44#define OMAP4430_MODULEMODE_SWCTRL 1
38 45
39/* Root clocks */ 46/* Root clocks */
40 47
@@ -47,7 +54,9 @@ static struct clk extalt_clkin_ck = {
47static struct clk pad_clks_ck = { 54static struct clk pad_clks_ck = {
48 .name = "pad_clks_ck", 55 .name = "pad_clks_ck",
49 .rate = 12000000, 56 .rate = 12000000,
50 .ops = &clkops_null, 57 .ops = &clkops_omap2_dflt,
58 .enable_reg = OMAP4430_CM_CLKSEL_ABE,
59 .enable_bit = OMAP4430_PAD_CLKS_GATE_SHIFT,
51}; 60};
52 61
53static struct clk pad_slimbus_core_clks_ck = { 62static struct clk pad_slimbus_core_clks_ck = {
@@ -65,7 +74,9 @@ static struct clk secure_32k_clk_src_ck = {
65static struct clk slimbus_clk = { 74static struct clk slimbus_clk = {
66 .name = "slimbus_clk", 75 .name = "slimbus_clk",
67 .rate = 12000000, 76 .rate = 12000000,
68 .ops = &clkops_null, 77 .ops = &clkops_omap2_dflt,
78 .enable_reg = OMAP4430_CM_CLKSEL_ABE,
79 .enable_bit = OMAP4430_SLIMBUS_CLK_GATE_SHIFT,
69}; 80};
70 81
71static struct clk sys_32k_ck = { 82static struct clk sys_32k_ck = {
@@ -265,18 +276,71 @@ static struct clk dpll_abe_ck = {
265 .set_rate = &omap3_noncore_dpll_set_rate, 276 .set_rate = &omap3_noncore_dpll_set_rate,
266}; 277};
267 278
279static struct clk dpll_abe_x2_ck = {
280 .name = "dpll_abe_x2_ck",
281 .parent = &dpll_abe_ck,
282 .ops = &clkops_null,
283 .recalc = &omap3_clkoutx2_recalc,
284};
285
286static const struct clksel_rate div31_1to31_rates[] = {
287 { .div = 1, .val = 1, .flags = RATE_IN_4430 },
288 { .div = 2, .val = 2, .flags = RATE_IN_4430 },
289 { .div = 3, .val = 3, .flags = RATE_IN_4430 },
290 { .div = 4, .val = 4, .flags = RATE_IN_4430 },
291 { .div = 5, .val = 5, .flags = RATE_IN_4430 },
292 { .div = 6, .val = 6, .flags = RATE_IN_4430 },
293 { .div = 7, .val = 7, .flags = RATE_IN_4430 },
294 { .div = 8, .val = 8, .flags = RATE_IN_4430 },
295 { .div = 9, .val = 9, .flags = RATE_IN_4430 },
296 { .div = 10, .val = 10, .flags = RATE_IN_4430 },
297 { .div = 11, .val = 11, .flags = RATE_IN_4430 },
298 { .div = 12, .val = 12, .flags = RATE_IN_4430 },
299 { .div = 13, .val = 13, .flags = RATE_IN_4430 },
300 { .div = 14, .val = 14, .flags = RATE_IN_4430 },
301 { .div = 15, .val = 15, .flags = RATE_IN_4430 },
302 { .div = 16, .val = 16, .flags = RATE_IN_4430 },
303 { .div = 17, .val = 17, .flags = RATE_IN_4430 },
304 { .div = 18, .val = 18, .flags = RATE_IN_4430 },
305 { .div = 19, .val = 19, .flags = RATE_IN_4430 },
306 { .div = 20, .val = 20, .flags = RATE_IN_4430 },
307 { .div = 21, .val = 21, .flags = RATE_IN_4430 },
308 { .div = 22, .val = 22, .flags = RATE_IN_4430 },
309 { .div = 23, .val = 23, .flags = RATE_IN_4430 },
310 { .div = 24, .val = 24, .flags = RATE_IN_4430 },
311 { .div = 25, .val = 25, .flags = RATE_IN_4430 },
312 { .div = 26, .val = 26, .flags = RATE_IN_4430 },
313 { .div = 27, .val = 27, .flags = RATE_IN_4430 },
314 { .div = 28, .val = 28, .flags = RATE_IN_4430 },
315 { .div = 29, .val = 29, .flags = RATE_IN_4430 },
316 { .div = 30, .val = 30, .flags = RATE_IN_4430 },
317 { .div = 31, .val = 31, .flags = RATE_IN_4430 },
318 { .div = 0 },
319};
320
321static const struct clksel dpll_abe_m2x2_div[] = {
322 { .parent = &dpll_abe_x2_ck, .rates = div31_1to31_rates },
323 { .parent = NULL },
324};
325
268static struct clk dpll_abe_m2x2_ck = { 326static struct clk dpll_abe_m2x2_ck = {
269 .name = "dpll_abe_m2x2_ck", 327 .name = "dpll_abe_m2x2_ck",
270 .parent = &dpll_abe_ck, 328 .parent = &dpll_abe_x2_ck,
329 .clksel = dpll_abe_m2x2_div,
330 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
331 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
271 .ops = &clkops_null, 332 .ops = &clkops_null,
272 .recalc = &followparent_recalc, 333 .recalc = &omap2_clksel_recalc,
334 .round_rate = &omap2_clksel_round_rate,
335 .set_rate = &omap2_clksel_set_rate,
273}; 336};
274 337
275static struct clk abe_24m_fclk = { 338static struct clk abe_24m_fclk = {
276 .name = "abe_24m_fclk", 339 .name = "abe_24m_fclk",
277 .parent = &dpll_abe_m2x2_ck, 340 .parent = &dpll_abe_m2x2_ck,
278 .ops = &clkops_null, 341 .ops = &clkops_null,
279 .recalc = &followparent_recalc, 342 .fixed_div = 8,
343 .recalc = &omap_fixed_divisor_recalc,
280}; 344};
281 345
282static const struct clksel_rate div3_1to4_rates[] = { 346static const struct clksel_rate div3_1to4_rates[] = {
@@ -326,50 +390,10 @@ static struct clk aess_fclk = {
326 .set_rate = &omap2_clksel_set_rate, 390 .set_rate = &omap2_clksel_set_rate,
327}; 391};
328 392
329static const struct clksel_rate div31_1to31_rates[] = { 393static struct clk dpll_abe_m3x2_ck = {
330 { .div = 1, .val = 1, .flags = RATE_IN_4430 }, 394 .name = "dpll_abe_m3x2_ck",
331 { .div = 2, .val = 2, .flags = RATE_IN_4430 }, 395 .parent = &dpll_abe_x2_ck,
332 { .div = 3, .val = 3, .flags = RATE_IN_4430 }, 396 .clksel = dpll_abe_m2x2_div,
333 { .div = 4, .val = 4, .flags = RATE_IN_4430 },
334 { .div = 5, .val = 5, .flags = RATE_IN_4430 },
335 { .div = 6, .val = 6, .flags = RATE_IN_4430 },
336 { .div = 7, .val = 7, .flags = RATE_IN_4430 },
337 { .div = 8, .val = 8, .flags = RATE_IN_4430 },
338 { .div = 9, .val = 9, .flags = RATE_IN_4430 },
339 { .div = 10, .val = 10, .flags = RATE_IN_4430 },
340 { .div = 11, .val = 11, .flags = RATE_IN_4430 },
341 { .div = 12, .val = 12, .flags = RATE_IN_4430 },
342 { .div = 13, .val = 13, .flags = RATE_IN_4430 },
343 { .div = 14, .val = 14, .flags = RATE_IN_4430 },
344 { .div = 15, .val = 15, .flags = RATE_IN_4430 },
345 { .div = 16, .val = 16, .flags = RATE_IN_4430 },
346 { .div = 17, .val = 17, .flags = RATE_IN_4430 },
347 { .div = 18, .val = 18, .flags = RATE_IN_4430 },
348 { .div = 19, .val = 19, .flags = RATE_IN_4430 },
349 { .div = 20, .val = 20, .flags = RATE_IN_4430 },
350 { .div = 21, .val = 21, .flags = RATE_IN_4430 },
351 { .div = 22, .val = 22, .flags = RATE_IN_4430 },
352 { .div = 23, .val = 23, .flags = RATE_IN_4430 },
353 { .div = 24, .val = 24, .flags = RATE_IN_4430 },
354 { .div = 25, .val = 25, .flags = RATE_IN_4430 },
355 { .div = 26, .val = 26, .flags = RATE_IN_4430 },
356 { .div = 27, .val = 27, .flags = RATE_IN_4430 },
357 { .div = 28, .val = 28, .flags = RATE_IN_4430 },
358 { .div = 29, .val = 29, .flags = RATE_IN_4430 },
359 { .div = 30, .val = 30, .flags = RATE_IN_4430 },
360 { .div = 31, .val = 31, .flags = RATE_IN_4430 },
361 { .div = 0 },
362};
363
364static const struct clksel dpll_abe_m3_div[] = {
365 { .parent = &dpll_abe_ck, .rates = div31_1to31_rates },
366 { .parent = NULL },
367};
368
369static struct clk dpll_abe_m3_ck = {
370 .name = "dpll_abe_m3_ck",
371 .parent = &dpll_abe_ck,
372 .clksel = dpll_abe_m3_div,
373 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, 397 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE,
374 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 398 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
375 .ops = &clkops_null, 399 .ops = &clkops_null,
@@ -380,7 +404,7 @@ static struct clk dpll_abe_m3_ck = {
380 404
381static const struct clksel core_hsd_byp_clk_mux_sel[] = { 405static const struct clksel core_hsd_byp_clk_mux_sel[] = {
382 { .parent = &sys_clkin_ck, .rates = div_1_0_rates }, 406 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
383 { .parent = &dpll_abe_m3_ck, .rates = div_1_1_rates }, 407 { .parent = &dpll_abe_m3x2_ck, .rates = div_1_1_rates },
384 { .parent = NULL }, 408 { .parent = NULL },
385}; 409};
386 410
@@ -424,15 +448,22 @@ static struct clk dpll_core_ck = {
424 .recalc = &omap3_dpll_recalc, 448 .recalc = &omap3_dpll_recalc,
425}; 449};
426 450
427static const struct clksel dpll_core_m6_div[] = { 451static struct clk dpll_core_x2_ck = {
428 { .parent = &dpll_core_ck, .rates = div31_1to31_rates }, 452 .name = "dpll_core_x2_ck",
453 .parent = &dpll_core_ck,
454 .ops = &clkops_null,
455 .recalc = &omap3_clkoutx2_recalc,
456};
457
458static const struct clksel dpll_core_m6x2_div[] = {
459 { .parent = &dpll_core_x2_ck, .rates = div31_1to31_rates },
429 { .parent = NULL }, 460 { .parent = NULL },
430}; 461};
431 462
432static struct clk dpll_core_m6_ck = { 463static struct clk dpll_core_m6x2_ck = {
433 .name = "dpll_core_m6_ck", 464 .name = "dpll_core_m6x2_ck",
434 .parent = &dpll_core_ck, 465 .parent = &dpll_core_x2_ck,
435 .clksel = dpll_core_m6_div, 466 .clksel = dpll_core_m6x2_div,
436 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, 467 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE,
437 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 468 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
438 .ops = &clkops_null, 469 .ops = &clkops_null,
@@ -443,7 +474,7 @@ static struct clk dpll_core_m6_ck = {
443 474
444static const struct clksel dbgclk_mux_sel[] = { 475static const struct clksel dbgclk_mux_sel[] = {
445 { .parent = &sys_clkin_ck, .rates = div_1_0_rates }, 476 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
446 { .parent = &dpll_core_m6_ck, .rates = div_1_1_rates }, 477 { .parent = &dpll_core_m6x2_ck, .rates = div_1_1_rates },
447 { .parent = NULL }, 478 { .parent = NULL },
448}; 479};
449 480
@@ -454,10 +485,15 @@ static struct clk dbgclk_mux_ck = {
454 .recalc = &followparent_recalc, 485 .recalc = &followparent_recalc,
455}; 486};
456 487
488static const struct clksel dpll_core_m2_div[] = {
489 { .parent = &dpll_core_ck, .rates = div31_1to31_rates },
490 { .parent = NULL },
491};
492
457static struct clk dpll_core_m2_ck = { 493static struct clk dpll_core_m2_ck = {
458 .name = "dpll_core_m2_ck", 494 .name = "dpll_core_m2_ck",
459 .parent = &dpll_core_ck, 495 .parent = &dpll_core_ck,
460 .clksel = dpll_core_m6_div, 496 .clksel = dpll_core_m2_div,
461 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, 497 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE,
462 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 498 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
463 .ops = &clkops_null, 499 .ops = &clkops_null,
@@ -470,13 +506,14 @@ static struct clk ddrphy_ck = {
470 .name = "ddrphy_ck", 506 .name = "ddrphy_ck",
471 .parent = &dpll_core_m2_ck, 507 .parent = &dpll_core_m2_ck,
472 .ops = &clkops_null, 508 .ops = &clkops_null,
473 .recalc = &followparent_recalc, 509 .fixed_div = 2,
510 .recalc = &omap_fixed_divisor_recalc,
474}; 511};
475 512
476static struct clk dpll_core_m5_ck = { 513static struct clk dpll_core_m5x2_ck = {
477 .name = "dpll_core_m5_ck", 514 .name = "dpll_core_m5x2_ck",
478 .parent = &dpll_core_ck, 515 .parent = &dpll_core_x2_ck,
479 .clksel = dpll_core_m6_div, 516 .clksel = dpll_core_m6x2_div,
480 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, 517 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE,
481 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 518 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
482 .ops = &clkops_null, 519 .ops = &clkops_null,
@@ -486,13 +523,13 @@ static struct clk dpll_core_m5_ck = {
486}; 523};
487 524
488static const struct clksel div_core_div[] = { 525static const struct clksel div_core_div[] = {
489 { .parent = &dpll_core_m5_ck, .rates = div2_1to2_rates }, 526 { .parent = &dpll_core_m5x2_ck, .rates = div2_1to2_rates },
490 { .parent = NULL }, 527 { .parent = NULL },
491}; 528};
492 529
493static struct clk div_core_ck = { 530static struct clk div_core_ck = {
494 .name = "div_core_ck", 531 .name = "div_core_ck",
495 .parent = &dpll_core_m5_ck, 532 .parent = &dpll_core_m5x2_ck,
496 .clksel = div_core_div, 533 .clksel = div_core_div,
497 .clksel_reg = OMAP4430_CM_CLKSEL_CORE, 534 .clksel_reg = OMAP4430_CM_CLKSEL_CORE,
498 .clksel_mask = OMAP4430_CLKSEL_CORE_MASK, 535 .clksel_mask = OMAP4430_CLKSEL_CORE_MASK,
@@ -511,13 +548,13 @@ static const struct clksel_rate div4_1to8_rates[] = {
511}; 548};
512 549
513static const struct clksel div_iva_hs_clk_div[] = { 550static const struct clksel div_iva_hs_clk_div[] = {
514 { .parent = &dpll_core_m5_ck, .rates = div4_1to8_rates }, 551 { .parent = &dpll_core_m5x2_ck, .rates = div4_1to8_rates },
515 { .parent = NULL }, 552 { .parent = NULL },
516}; 553};
517 554
518static struct clk div_iva_hs_clk = { 555static struct clk div_iva_hs_clk = {
519 .name = "div_iva_hs_clk", 556 .name = "div_iva_hs_clk",
520 .parent = &dpll_core_m5_ck, 557 .parent = &dpll_core_m5x2_ck,
521 .clksel = div_iva_hs_clk_div, 558 .clksel = div_iva_hs_clk_div,
522 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_IVA, 559 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_IVA,
523 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK, 560 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK,
@@ -529,7 +566,7 @@ static struct clk div_iva_hs_clk = {
529 566
530static struct clk div_mpu_hs_clk = { 567static struct clk div_mpu_hs_clk = {
531 .name = "div_mpu_hs_clk", 568 .name = "div_mpu_hs_clk",
532 .parent = &dpll_core_m5_ck, 569 .parent = &dpll_core_m5x2_ck,
533 .clksel = div_iva_hs_clk_div, 570 .clksel = div_iva_hs_clk_div,
534 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_MPU, 571 .clksel_reg = OMAP4430_CM_BYPCLK_DPLL_MPU,
535 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK, 572 .clksel_mask = OMAP4430_CLKSEL_0_1_MASK,
@@ -539,10 +576,10 @@ static struct clk div_mpu_hs_clk = {
539 .set_rate = &omap2_clksel_set_rate, 576 .set_rate = &omap2_clksel_set_rate,
540}; 577};
541 578
542static struct clk dpll_core_m4_ck = { 579static struct clk dpll_core_m4x2_ck = {
543 .name = "dpll_core_m4_ck", 580 .name = "dpll_core_m4x2_ck",
544 .parent = &dpll_core_ck, 581 .parent = &dpll_core_x2_ck,
545 .clksel = dpll_core_m6_div, 582 .clksel = dpll_core_m6x2_div,
546 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, 583 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE,
547 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 584 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
548 .ops = &clkops_null, 585 .ops = &clkops_null,
@@ -553,15 +590,21 @@ static struct clk dpll_core_m4_ck = {
553 590
554static struct clk dll_clk_div_ck = { 591static struct clk dll_clk_div_ck = {
555 .name = "dll_clk_div_ck", 592 .name = "dll_clk_div_ck",
556 .parent = &dpll_core_m4_ck, 593 .parent = &dpll_core_m4x2_ck,
557 .ops = &clkops_null, 594 .ops = &clkops_null,
558 .recalc = &followparent_recalc, 595 .fixed_div = 2,
596 .recalc = &omap_fixed_divisor_recalc,
597};
598
599static const struct clksel dpll_abe_m2_div[] = {
600 { .parent = &dpll_abe_ck, .rates = div31_1to31_rates },
601 { .parent = NULL },
559}; 602};
560 603
561static struct clk dpll_abe_m2_ck = { 604static struct clk dpll_abe_m2_ck = {
562 .name = "dpll_abe_m2_ck", 605 .name = "dpll_abe_m2_ck",
563 .parent = &dpll_abe_ck, 606 .parent = &dpll_abe_ck,
564 .clksel = dpll_abe_m3_div, 607 .clksel = dpll_abe_m2_div,
565 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, 608 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
566 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 609 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
567 .ops = &clkops_null, 610 .ops = &clkops_null,
@@ -570,22 +613,24 @@ static struct clk dpll_abe_m2_ck = {
570 .set_rate = &omap2_clksel_set_rate, 613 .set_rate = &omap2_clksel_set_rate,
571}; 614};
572 615
573static struct clk dpll_core_m3_ck = { 616static struct clk dpll_core_m3x2_ck = {
574 .name = "dpll_core_m3_ck", 617 .name = "dpll_core_m3x2_ck",
575 .parent = &dpll_core_ck, 618 .parent = &dpll_core_x2_ck,
576 .clksel = dpll_core_m6_div, 619 .clksel = dpll_core_m6x2_div,
577 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_CORE, 620 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_CORE,
578 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 621 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
579 .ops = &clkops_null, 622 .ops = &clkops_omap2_dflt,
623 .enable_reg = OMAP4430_CM_DIV_M3_DPLL_CORE,
624 .enable_bit = OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT,
580 .recalc = &omap2_clksel_recalc, 625 .recalc = &omap2_clksel_recalc,
581 .round_rate = &omap2_clksel_round_rate, 626 .round_rate = &omap2_clksel_round_rate,
582 .set_rate = &omap2_clksel_set_rate, 627 .set_rate = &omap2_clksel_set_rate,
583}; 628};
584 629
585static struct clk dpll_core_m7_ck = { 630static struct clk dpll_core_m7x2_ck = {
586 .name = "dpll_core_m7_ck", 631 .name = "dpll_core_m7x2_ck",
587 .parent = &dpll_core_ck, 632 .parent = &dpll_core_x2_ck,
588 .clksel = dpll_core_m6_div, 633 .clksel = dpll_core_m6x2_div,
589 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, 634 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE,
590 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 635 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
591 .ops = &clkops_null, 636 .ops = &clkops_null,
@@ -603,8 +648,12 @@ static const struct clksel iva_hsd_byp_clk_mux_sel[] = {
603static struct clk iva_hsd_byp_clk_mux_ck = { 648static struct clk iva_hsd_byp_clk_mux_ck = {
604 .name = "iva_hsd_byp_clk_mux_ck", 649 .name = "iva_hsd_byp_clk_mux_ck",
605 .parent = &sys_clkin_ck, 650 .parent = &sys_clkin_ck,
651 .clksel = iva_hsd_byp_clk_mux_sel,
652 .init = &omap2_init_clksel_parent,
653 .clksel_reg = OMAP4430_CM_CLKSEL_DPLL_IVA,
654 .clksel_mask = OMAP4430_DPLL_BYP_CLKSEL_MASK,
606 .ops = &clkops_null, 655 .ops = &clkops_null,
607 .recalc = &followparent_recalc, 656 .recalc = &omap2_clksel_recalc,
608}; 657};
609 658
610/* DPLL_IVA */ 659/* DPLL_IVA */
@@ -638,15 +687,22 @@ static struct clk dpll_iva_ck = {
638 .set_rate = &omap3_noncore_dpll_set_rate, 687 .set_rate = &omap3_noncore_dpll_set_rate,
639}; 688};
640 689
641static const struct clksel dpll_iva_m4_div[] = { 690static struct clk dpll_iva_x2_ck = {
642 { .parent = &dpll_iva_ck, .rates = div31_1to31_rates }, 691 .name = "dpll_iva_x2_ck",
692 .parent = &dpll_iva_ck,
693 .ops = &clkops_null,
694 .recalc = &omap3_clkoutx2_recalc,
695};
696
697static const struct clksel dpll_iva_m4x2_div[] = {
698 { .parent = &dpll_iva_x2_ck, .rates = div31_1to31_rates },
643 { .parent = NULL }, 699 { .parent = NULL },
644}; 700};
645 701
646static struct clk dpll_iva_m4_ck = { 702static struct clk dpll_iva_m4x2_ck = {
647 .name = "dpll_iva_m4_ck", 703 .name = "dpll_iva_m4x2_ck",
648 .parent = &dpll_iva_ck, 704 .parent = &dpll_iva_x2_ck,
649 .clksel = dpll_iva_m4_div, 705 .clksel = dpll_iva_m4x2_div,
650 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, 706 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA,
651 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 707 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
652 .ops = &clkops_null, 708 .ops = &clkops_null,
@@ -655,10 +711,10 @@ static struct clk dpll_iva_m4_ck = {
655 .set_rate = &omap2_clksel_set_rate, 711 .set_rate = &omap2_clksel_set_rate,
656}; 712};
657 713
658static struct clk dpll_iva_m5_ck = { 714static struct clk dpll_iva_m5x2_ck = {
659 .name = "dpll_iva_m5_ck", 715 .name = "dpll_iva_m5x2_ck",
660 .parent = &dpll_iva_ck, 716 .parent = &dpll_iva_x2_ck,
661 .clksel = dpll_iva_m4_div, 717 .clksel = dpll_iva_m4x2_div,
662 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, 718 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA,
663 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 719 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
664 .ops = &clkops_null, 720 .ops = &clkops_null,
@@ -717,9 +773,10 @@ static struct clk dpll_mpu_m2_ck = {
717 773
718static struct clk per_hs_clk_div_ck = { 774static struct clk per_hs_clk_div_ck = {
719 .name = "per_hs_clk_div_ck", 775 .name = "per_hs_clk_div_ck",
720 .parent = &dpll_abe_m3_ck, 776 .parent = &dpll_abe_m3x2_ck,
721 .ops = &clkops_null, 777 .ops = &clkops_null,
722 .recalc = &followparent_recalc, 778 .fixed_div = 2,
779 .recalc = &omap_fixed_divisor_recalc,
723}; 780};
724 781
725static const struct clksel per_hsd_byp_clk_mux_sel[] = { 782static const struct clksel per_hsd_byp_clk_mux_sel[] = {
@@ -787,29 +844,48 @@ static struct clk dpll_per_m2_ck = {
787 .set_rate = &omap2_clksel_set_rate, 844 .set_rate = &omap2_clksel_set_rate,
788}; 845};
789 846
847static struct clk dpll_per_x2_ck = {
848 .name = "dpll_per_x2_ck",
849 .parent = &dpll_per_ck,
850 .ops = &clkops_null,
851 .recalc = &omap3_clkoutx2_recalc,
852};
853
854static const struct clksel dpll_per_m2x2_div[] = {
855 { .parent = &dpll_per_x2_ck, .rates = div31_1to31_rates },
856 { .parent = NULL },
857};
858
790static struct clk dpll_per_m2x2_ck = { 859static struct clk dpll_per_m2x2_ck = {
791 .name = "dpll_per_m2x2_ck", 860 .name = "dpll_per_m2x2_ck",
792 .parent = &dpll_per_ck, 861 .parent = &dpll_per_x2_ck,
862 .clksel = dpll_per_m2x2_div,
863 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
864 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
793 .ops = &clkops_null, 865 .ops = &clkops_null,
794 .recalc = &followparent_recalc, 866 .recalc = &omap2_clksel_recalc,
867 .round_rate = &omap2_clksel_round_rate,
868 .set_rate = &omap2_clksel_set_rate,
795}; 869};
796 870
797static struct clk dpll_per_m3_ck = { 871static struct clk dpll_per_m3x2_ck = {
798 .name = "dpll_per_m3_ck", 872 .name = "dpll_per_m3x2_ck",
799 .parent = &dpll_per_ck, 873 .parent = &dpll_per_x2_ck,
800 .clksel = dpll_per_m2_div, 874 .clksel = dpll_per_m2x2_div,
801 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_PER, 875 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_PER,
802 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 876 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
803 .ops = &clkops_null, 877 .ops = &clkops_omap2_dflt,
878 .enable_reg = OMAP4430_CM_DIV_M3_DPLL_PER,
879 .enable_bit = OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT,
804 .recalc = &omap2_clksel_recalc, 880 .recalc = &omap2_clksel_recalc,
805 .round_rate = &omap2_clksel_round_rate, 881 .round_rate = &omap2_clksel_round_rate,
806 .set_rate = &omap2_clksel_set_rate, 882 .set_rate = &omap2_clksel_set_rate,
807}; 883};
808 884
809static struct clk dpll_per_m4_ck = { 885static struct clk dpll_per_m4x2_ck = {
810 .name = "dpll_per_m4_ck", 886 .name = "dpll_per_m4x2_ck",
811 .parent = &dpll_per_ck, 887 .parent = &dpll_per_x2_ck,
812 .clksel = dpll_per_m2_div, 888 .clksel = dpll_per_m2x2_div,
813 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, 889 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER,
814 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 890 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
815 .ops = &clkops_null, 891 .ops = &clkops_null,
@@ -818,10 +894,10 @@ static struct clk dpll_per_m4_ck = {
818 .set_rate = &omap2_clksel_set_rate, 894 .set_rate = &omap2_clksel_set_rate,
819}; 895};
820 896
821static struct clk dpll_per_m5_ck = { 897static struct clk dpll_per_m5x2_ck = {
822 .name = "dpll_per_m5_ck", 898 .name = "dpll_per_m5x2_ck",
823 .parent = &dpll_per_ck, 899 .parent = &dpll_per_x2_ck,
824 .clksel = dpll_per_m2_div, 900 .clksel = dpll_per_m2x2_div,
825 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, 901 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER,
826 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 902 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
827 .ops = &clkops_null, 903 .ops = &clkops_null,
@@ -830,10 +906,10 @@ static struct clk dpll_per_m5_ck = {
830 .set_rate = &omap2_clksel_set_rate, 906 .set_rate = &omap2_clksel_set_rate,
831}; 907};
832 908
833static struct clk dpll_per_m6_ck = { 909static struct clk dpll_per_m6x2_ck = {
834 .name = "dpll_per_m6_ck", 910 .name = "dpll_per_m6x2_ck",
835 .parent = &dpll_per_ck, 911 .parent = &dpll_per_x2_ck,
836 .clksel = dpll_per_m2_div, 912 .clksel = dpll_per_m2x2_div,
837 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, 913 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER,
838 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 914 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
839 .ops = &clkops_null, 915 .ops = &clkops_null,
@@ -842,10 +918,10 @@ static struct clk dpll_per_m6_ck = {
842 .set_rate = &omap2_clksel_set_rate, 918 .set_rate = &omap2_clksel_set_rate,
843}; 919};
844 920
845static struct clk dpll_per_m7_ck = { 921static struct clk dpll_per_m7x2_ck = {
846 .name = "dpll_per_m7_ck", 922 .name = "dpll_per_m7x2_ck",
847 .parent = &dpll_per_ck, 923 .parent = &dpll_per_x2_ck,
848 .clksel = dpll_per_m2_div, 924 .clksel = dpll_per_m2x2_div,
849 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, 925 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER,
850 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 926 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
851 .ops = &clkops_null, 927 .ops = &clkops_null,
@@ -868,6 +944,7 @@ static struct dpll_data dpll_unipro_dd = {
868 .enable_mask = OMAP4430_DPLL_EN_MASK, 944 .enable_mask = OMAP4430_DPLL_EN_MASK,
869 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, 945 .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
870 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, 946 .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
947 .sddiv_mask = OMAP4430_DPLL_SD_DIV_MASK,
871 .max_multiplier = OMAP4430_MAX_DPLL_MULT, 948 .max_multiplier = OMAP4430_MAX_DPLL_MULT,
872 .max_divider = OMAP4430_MAX_DPLL_DIV, 949 .max_divider = OMAP4430_MAX_DPLL_DIV,
873 .min_divider = 1, 950 .min_divider = 1,
@@ -885,14 +962,21 @@ static struct clk dpll_unipro_ck = {
885 .set_rate = &omap3_noncore_dpll_set_rate, 962 .set_rate = &omap3_noncore_dpll_set_rate,
886}; 963};
887 964
965static struct clk dpll_unipro_x2_ck = {
966 .name = "dpll_unipro_x2_ck",
967 .parent = &dpll_unipro_ck,
968 .ops = &clkops_null,
969 .recalc = &omap3_clkoutx2_recalc,
970};
971
888static const struct clksel dpll_unipro_m2x2_div[] = { 972static const struct clksel dpll_unipro_m2x2_div[] = {
889 { .parent = &dpll_unipro_ck, .rates = div31_1to31_rates }, 973 { .parent = &dpll_unipro_x2_ck, .rates = div31_1to31_rates },
890 { .parent = NULL }, 974 { .parent = NULL },
891}; 975};
892 976
893static struct clk dpll_unipro_m2x2_ck = { 977static struct clk dpll_unipro_m2x2_ck = {
894 .name = "dpll_unipro_m2x2_ck", 978 .name = "dpll_unipro_m2x2_ck",
895 .parent = &dpll_unipro_ck, 979 .parent = &dpll_unipro_x2_ck,
896 .clksel = dpll_unipro_m2x2_div, 980 .clksel = dpll_unipro_m2x2_div,
897 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, 981 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO,
898 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 982 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
@@ -904,16 +988,17 @@ static struct clk dpll_unipro_m2x2_ck = {
904 988
905static struct clk usb_hs_clk_div_ck = { 989static struct clk usb_hs_clk_div_ck = {
906 .name = "usb_hs_clk_div_ck", 990 .name = "usb_hs_clk_div_ck",
907 .parent = &dpll_abe_m3_ck, 991 .parent = &dpll_abe_m3x2_ck,
908 .ops = &clkops_null, 992 .ops = &clkops_null,
909 .recalc = &followparent_recalc, 993 .fixed_div = 3,
994 .recalc = &omap_fixed_divisor_recalc,
910}; 995};
911 996
912/* DPLL_USB */ 997/* DPLL_USB */
913static struct dpll_data dpll_usb_dd = { 998static struct dpll_data dpll_usb_dd = {
914 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB, 999 .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB,
915 .clk_bypass = &usb_hs_clk_div_ck, 1000 .clk_bypass = &usb_hs_clk_div_ck,
916 .flags = DPLL_J_TYPE | DPLL_NO_DCO_SEL, 1001 .flags = DPLL_J_TYPE,
917 .clk_ref = &sys_clkin_ck, 1002 .clk_ref = &sys_clkin_ck,
918 .control_reg = OMAP4430_CM_CLKMODE_DPLL_USB, 1003 .control_reg = OMAP4430_CM_CLKMODE_DPLL_USB,
919 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), 1004 .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED),
@@ -967,7 +1052,7 @@ static struct clk dpll_usb_m2_ck = {
967 1052
968static const struct clksel ducati_clk_mux_sel[] = { 1053static const struct clksel ducati_clk_mux_sel[] = {
969 { .parent = &div_core_ck, .rates = div_1_0_rates }, 1054 { .parent = &div_core_ck, .rates = div_1_0_rates },
970 { .parent = &dpll_per_m6_ck, .rates = div_1_1_rates }, 1055 { .parent = &dpll_per_m6x2_ck, .rates = div_1_1_rates },
971 { .parent = NULL }, 1056 { .parent = NULL },
972}; 1057};
973 1058
@@ -986,21 +1071,24 @@ static struct clk func_12m_fclk = {
986 .name = "func_12m_fclk", 1071 .name = "func_12m_fclk",
987 .parent = &dpll_per_m2x2_ck, 1072 .parent = &dpll_per_m2x2_ck,
988 .ops = &clkops_null, 1073 .ops = &clkops_null,
989 .recalc = &followparent_recalc, 1074 .fixed_div = 16,
1075 .recalc = &omap_fixed_divisor_recalc,
990}; 1076};
991 1077
992static struct clk func_24m_clk = { 1078static struct clk func_24m_clk = {
993 .name = "func_24m_clk", 1079 .name = "func_24m_clk",
994 .parent = &dpll_per_m2_ck, 1080 .parent = &dpll_per_m2_ck,
995 .ops = &clkops_null, 1081 .ops = &clkops_null,
996 .recalc = &followparent_recalc, 1082 .fixed_div = 4,
1083 .recalc = &omap_fixed_divisor_recalc,
997}; 1084};
998 1085
999static struct clk func_24mc_fclk = { 1086static struct clk func_24mc_fclk = {
1000 .name = "func_24mc_fclk", 1087 .name = "func_24mc_fclk",
1001 .parent = &dpll_per_m2x2_ck, 1088 .parent = &dpll_per_m2x2_ck,
1002 .ops = &clkops_null, 1089 .ops = &clkops_null,
1003 .recalc = &followparent_recalc, 1090 .fixed_div = 8,
1091 .recalc = &omap_fixed_divisor_recalc,
1004}; 1092};
1005 1093
1006static const struct clksel_rate div2_4to8_rates[] = { 1094static const struct clksel_rate div2_4to8_rates[] = {
@@ -1030,7 +1118,8 @@ static struct clk func_48mc_fclk = {
1030 .name = "func_48mc_fclk", 1118 .name = "func_48mc_fclk",
1031 .parent = &dpll_per_m2x2_ck, 1119 .parent = &dpll_per_m2x2_ck,
1032 .ops = &clkops_null, 1120 .ops = &clkops_null,
1033 .recalc = &followparent_recalc, 1121 .fixed_div = 4,
1122 .recalc = &omap_fixed_divisor_recalc,
1034}; 1123};
1035 1124
1036static const struct clksel_rate div2_2to4_rates[] = { 1125static const struct clksel_rate div2_2to4_rates[] = {
@@ -1040,13 +1129,13 @@ static const struct clksel_rate div2_2to4_rates[] = {
1040}; 1129};
1041 1130
1042static const struct clksel func_64m_fclk_div[] = { 1131static const struct clksel func_64m_fclk_div[] = {
1043 { .parent = &dpll_per_m4_ck, .rates = div2_2to4_rates }, 1132 { .parent = &dpll_per_m4x2_ck, .rates = div2_2to4_rates },
1044 { .parent = NULL }, 1133 { .parent = NULL },
1045}; 1134};
1046 1135
1047static struct clk func_64m_fclk = { 1136static struct clk func_64m_fclk = {
1048 .name = "func_64m_fclk", 1137 .name = "func_64m_fclk",
1049 .parent = &dpll_per_m4_ck, 1138 .parent = &dpll_per_m4x2_ck,
1050 .clksel = func_64m_fclk_div, 1139 .clksel = func_64m_fclk_div,
1051 .clksel_reg = OMAP4430_CM_SCALE_FCLK, 1140 .clksel_reg = OMAP4430_CM_SCALE_FCLK,
1052 .clksel_mask = OMAP4430_SCALE_FCLK_MASK, 1141 .clksel_mask = OMAP4430_SCALE_FCLK_MASK,
@@ -1147,7 +1236,8 @@ static struct clk lp_clk_div_ck = {
1147 .name = "lp_clk_div_ck", 1236 .name = "lp_clk_div_ck",
1148 .parent = &dpll_abe_m2x2_ck, 1237 .parent = &dpll_abe_m2x2_ck,
1149 .ops = &clkops_null, 1238 .ops = &clkops_null,
1150 .recalc = &followparent_recalc, 1239 .fixed_div = 16,
1240 .recalc = &omap_fixed_divisor_recalc,
1151}; 1241};
1152 1242
1153static const struct clksel l4_wkup_clk_mux_sel[] = { 1243static const struct clksel l4_wkup_clk_mux_sel[] = {
@@ -1215,12 +1305,13 @@ static struct clk per_abe_24m_fclk = {
1215 .name = "per_abe_24m_fclk", 1305 .name = "per_abe_24m_fclk",
1216 .parent = &dpll_abe_m2_ck, 1306 .parent = &dpll_abe_m2_ck,
1217 .ops = &clkops_null, 1307 .ops = &clkops_null,
1218 .recalc = &followparent_recalc, 1308 .fixed_div = 4,
1309 .recalc = &omap_fixed_divisor_recalc,
1219}; 1310};
1220 1311
1221static const struct clksel pmd_stm_clock_mux_sel[] = { 1312static const struct clksel pmd_stm_clock_mux_sel[] = {
1222 { .parent = &sys_clkin_ck, .rates = div_1_0_rates }, 1313 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
1223 { .parent = &dpll_core_m6_ck, .rates = div_1_1_rates }, 1314 { .parent = &dpll_core_m6x2_ck, .rates = div_1_1_rates },
1224 { .parent = &tie_low_clock_ck, .rates = div_1_2_rates }, 1315 { .parent = &tie_low_clock_ck, .rates = div_1_2_rates },
1225 { .parent = NULL }, 1316 { .parent = NULL },
1226}; 1317};
@@ -1354,7 +1445,7 @@ static struct clk dsp_fck = {
1354 .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, 1445 .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL,
1355 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1446 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1356 .clkdm_name = "tesla_clkdm", 1447 .clkdm_name = "tesla_clkdm",
1357 .parent = &dpll_iva_m4_ck, 1448 .parent = &dpll_iva_m4x2_ck,
1358 .recalc = &followparent_recalc, 1449 .recalc = &followparent_recalc,
1359}; 1450};
1360 1451
@@ -1384,7 +1475,7 @@ static struct clk dss_dss_clk = {
1384 .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, 1475 .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1385 .enable_bit = OMAP4430_OPTFCLKEN_DSSCLK_SHIFT, 1476 .enable_bit = OMAP4430_OPTFCLKEN_DSSCLK_SHIFT,
1386 .clkdm_name = "l3_dss_clkdm", 1477 .clkdm_name = "l3_dss_clkdm",
1387 .parent = &dpll_per_m5_ck, 1478 .parent = &dpll_per_m5x2_ck,
1388 .recalc = &followparent_recalc, 1479 .recalc = &followparent_recalc,
1389}; 1480};
1390 1481
@@ -1441,14 +1532,14 @@ static struct clk emif2_fck = {
1441}; 1532};
1442 1533
1443static const struct clksel fdif_fclk_div[] = { 1534static const struct clksel fdif_fclk_div[] = {
1444 { .parent = &dpll_per_m4_ck, .rates = div3_1to4_rates }, 1535 { .parent = &dpll_per_m4x2_ck, .rates = div3_1to4_rates },
1445 { .parent = NULL }, 1536 { .parent = NULL },
1446}; 1537};
1447 1538
1448/* Merged fdif_fclk into fdif */ 1539/* Merged fdif_fclk into fdif */
1449static struct clk fdif_fck = { 1540static struct clk fdif_fck = {
1450 .name = "fdif_fck", 1541 .name = "fdif_fck",
1451 .parent = &dpll_per_m4_ck, 1542 .parent = &dpll_per_m4x2_ck,
1452 .clksel = fdif_fclk_div, 1543 .clksel = fdif_fclk_div,
1453 .clksel_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL, 1544 .clksel_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL,
1454 .clksel_mask = OMAP4430_CLKSEL_FCLK_MASK, 1545 .clksel_mask = OMAP4430_CLKSEL_FCLK_MASK,
@@ -1602,15 +1693,15 @@ static struct clk gpmc_ick = {
1602}; 1693};
1603 1694
1604static const struct clksel sgx_clk_mux_sel[] = { 1695static const struct clksel sgx_clk_mux_sel[] = {
1605 { .parent = &dpll_core_m7_ck, .rates = div_1_0_rates }, 1696 { .parent = &dpll_core_m7x2_ck, .rates = div_1_0_rates },
1606 { .parent = &dpll_per_m7_ck, .rates = div_1_1_rates }, 1697 { .parent = &dpll_per_m7x2_ck, .rates = div_1_1_rates },
1607 { .parent = NULL }, 1698 { .parent = NULL },
1608}; 1699};
1609 1700
1610/* Merged sgx_clk_mux into gpu */ 1701/* Merged sgx_clk_mux into gpu */
1611static struct clk gpu_fck = { 1702static struct clk gpu_fck = {
1612 .name = "gpu_fck", 1703 .name = "gpu_fck",
1613 .parent = &dpll_core_m7_ck, 1704 .parent = &dpll_core_m7x2_ck,
1614 .clksel = sgx_clk_mux_sel, 1705 .clksel = sgx_clk_mux_sel,
1615 .init = &omap2_init_clksel_parent, 1706 .init = &omap2_init_clksel_parent,
1616 .clksel_reg = OMAP4430_CM_GFX_GFX_CLKCTRL, 1707 .clksel_reg = OMAP4430_CM_GFX_GFX_CLKCTRL,
@@ -1729,7 +1820,7 @@ static struct clk iva_fck = {
1729 .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL, 1820 .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL,
1730 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1821 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1731 .clkdm_name = "ivahd_clkdm", 1822 .clkdm_name = "ivahd_clkdm",
1732 .parent = &dpll_iva_m5_ck, 1823 .parent = &dpll_iva_m5x2_ck,
1733 .recalc = &followparent_recalc, 1824 .recalc = &followparent_recalc,
1734}; 1825};
1735 1826
@@ -1749,6 +1840,7 @@ static struct clk l3_instr_ick = {
1749 .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL, 1840 .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL,
1750 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1841 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1751 .clkdm_name = "l3_instr_clkdm", 1842 .clkdm_name = "l3_instr_clkdm",
1843 .flags = ENABLE_ON_INIT,
1752 .parent = &l3_div_ck, 1844 .parent = &l3_div_ck,
1753 .recalc = &followparent_recalc, 1845 .recalc = &followparent_recalc,
1754}; 1846};
@@ -1759,6 +1851,7 @@ static struct clk l3_main_3_ick = {
1759 .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL, 1851 .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL,
1760 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1852 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1761 .clkdm_name = "l3_instr_clkdm", 1853 .clkdm_name = "l3_instr_clkdm",
1854 .flags = ENABLE_ON_INIT,
1762 .parent = &l3_div_ck, 1855 .parent = &l3_div_ck,
1763 .recalc = &followparent_recalc, 1856 .recalc = &followparent_recalc,
1764}; 1857};
@@ -2063,6 +2156,7 @@ static struct clk ocp_wp_noc_ick = {
2063 .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL, 2156 .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL,
2064 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 2157 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
2065 .clkdm_name = "l3_instr_clkdm", 2158 .clkdm_name = "l3_instr_clkdm",
2159 .flags = ENABLE_ON_INIT,
2066 .parent = &l3_div_ck, 2160 .parent = &l3_div_ck,
2067 .recalc = &followparent_recalc, 2161 .recalc = &followparent_recalc,
2068}; 2162};
@@ -2093,7 +2187,7 @@ static struct clk sl2if_ick = {
2093 .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL, 2187 .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL,
2094 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 2188 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
2095 .clkdm_name = "ivahd_clkdm", 2189 .clkdm_name = "ivahd_clkdm",
2096 .parent = &dpll_iva_m5_ck, 2190 .parent = &dpll_iva_m5x2_ck,
2097 .recalc = &followparent_recalc, 2191 .recalc = &followparent_recalc,
2098}; 2192};
2099 2193
@@ -2438,36 +2532,6 @@ static struct clk usb_host_fs_fck = {
2438 .recalc = &followparent_recalc, 2532 .recalc = &followparent_recalc,
2439}; 2533};
2440 2534
2441static struct clk usb_host_hs_utmi_p3_clk = {
2442 .name = "usb_host_hs_utmi_p3_clk",
2443 .ops = &clkops_omap2_dflt,
2444 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2445 .enable_bit = OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT,
2446 .clkdm_name = "l3_init_clkdm",
2447 .parent = &init_60m_fclk,
2448 .recalc = &followparent_recalc,
2449};
2450
2451static struct clk usb_host_hs_hsic60m_p1_clk = {
2452 .name = "usb_host_hs_hsic60m_p1_clk",
2453 .ops = &clkops_omap2_dflt,
2454 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2455 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT,
2456 .clkdm_name = "l3_init_clkdm",
2457 .parent = &init_60m_fclk,
2458 .recalc = &followparent_recalc,
2459};
2460
2461static struct clk usb_host_hs_hsic60m_p2_clk = {
2462 .name = "usb_host_hs_hsic60m_p2_clk",
2463 .ops = &clkops_omap2_dflt,
2464 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2465 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT,
2466 .clkdm_name = "l3_init_clkdm",
2467 .parent = &init_60m_fclk,
2468 .recalc = &followparent_recalc,
2469};
2470
2471static const struct clksel utmi_p1_gfclk_sel[] = { 2535static const struct clksel utmi_p1_gfclk_sel[] = {
2472 { .parent = &init_60m_fclk, .rates = div_1_0_rates }, 2536 { .parent = &init_60m_fclk, .rates = div_1_0_rates },
2473 { .parent = &xclk60mhsp1_ck, .rates = div_1_1_rates }, 2537 { .parent = &xclk60mhsp1_ck, .rates = div_1_1_rates },
@@ -2522,6 +2586,16 @@ static struct clk usb_host_hs_utmi_p2_clk = {
2522 .recalc = &followparent_recalc, 2586 .recalc = &followparent_recalc,
2523}; 2587};
2524 2588
2589static struct clk usb_host_hs_utmi_p3_clk = {
2590 .name = "usb_host_hs_utmi_p3_clk",
2591 .ops = &clkops_omap2_dflt,
2592 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2593 .enable_bit = OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT,
2594 .clkdm_name = "l3_init_clkdm",
2595 .parent = &init_60m_fclk,
2596 .recalc = &followparent_recalc,
2597};
2598
2525static struct clk usb_host_hs_hsic480m_p1_clk = { 2599static struct clk usb_host_hs_hsic480m_p1_clk = {
2526 .name = "usb_host_hs_hsic480m_p1_clk", 2600 .name = "usb_host_hs_hsic480m_p1_clk",
2527 .ops = &clkops_omap2_dflt, 2601 .ops = &clkops_omap2_dflt,
@@ -2532,6 +2606,26 @@ static struct clk usb_host_hs_hsic480m_p1_clk = {
2532 .recalc = &followparent_recalc, 2606 .recalc = &followparent_recalc,
2533}; 2607};
2534 2608
2609static struct clk usb_host_hs_hsic60m_p1_clk = {
2610 .name = "usb_host_hs_hsic60m_p1_clk",
2611 .ops = &clkops_omap2_dflt,
2612 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2613 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT,
2614 .clkdm_name = "l3_init_clkdm",
2615 .parent = &init_60m_fclk,
2616 .recalc = &followparent_recalc,
2617};
2618
2619static struct clk usb_host_hs_hsic60m_p2_clk = {
2620 .name = "usb_host_hs_hsic60m_p2_clk",
2621 .ops = &clkops_omap2_dflt,
2622 .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL,
2623 .enable_bit = OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT,
2624 .clkdm_name = "l3_init_clkdm",
2625 .parent = &init_60m_fclk,
2626 .recalc = &followparent_recalc,
2627};
2628
2535static struct clk usb_host_hs_hsic480m_p2_clk = { 2629static struct clk usb_host_hs_hsic480m_p2_clk = {
2536 .name = "usb_host_hs_hsic480m_p2_clk", 2630 .name = "usb_host_hs_hsic480m_p2_clk",
2537 .ops = &clkops_omap2_dflt, 2631 .ops = &clkops_omap2_dflt,
@@ -2656,13 +2750,13 @@ static const struct clksel_rate div2_14to18_rates[] = {
2656}; 2750};
2657 2751
2658static const struct clksel usim_fclk_div[] = { 2752static const struct clksel usim_fclk_div[] = {
2659 { .parent = &dpll_per_m4_ck, .rates = div2_14to18_rates }, 2753 { .parent = &dpll_per_m4x2_ck, .rates = div2_14to18_rates },
2660 { .parent = NULL }, 2754 { .parent = NULL },
2661}; 2755};
2662 2756
2663static struct clk usim_ck = { 2757static struct clk usim_ck = {
2664 .name = "usim_ck", 2758 .name = "usim_ck",
2665 .parent = &dpll_per_m4_ck, 2759 .parent = &dpll_per_m4x2_ck,
2666 .clksel = usim_fclk_div, 2760 .clksel = usim_fclk_div,
2667 .clksel_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, 2761 .clksel_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL,
2668 .clksel_mask = OMAP4430_CLKSEL_DIV_MASK, 2762 .clksel_mask = OMAP4430_CLKSEL_DIV_MASK,
@@ -2747,6 +2841,168 @@ static struct clk trace_clk_div_ck = {
2747 .set_rate = &omap2_clksel_set_rate, 2841 .set_rate = &omap2_clksel_set_rate,
2748}; 2842};
2749 2843
2844/* SCRM aux clk nodes */
2845
2846static const struct clksel auxclk_sel[] = {
2847 { .parent = &sys_clkin_ck, .rates = div_1_0_rates },
2848 { .parent = &dpll_core_m3x2_ck, .rates = div_1_1_rates },
2849 { .parent = &dpll_per_m3x2_ck, .rates = div_1_2_rates },
2850 { .parent = NULL },
2851};
2852
2853static struct clk auxclk0_ck = {
2854 .name = "auxclk0_ck",
2855 .parent = &sys_clkin_ck,
2856 .init = &omap2_init_clksel_parent,
2857 .ops = &clkops_omap2_dflt,
2858 .clksel = auxclk_sel,
2859 .clksel_reg = OMAP4_SCRM_AUXCLK0,
2860 .clksel_mask = OMAP4_SRCSELECT_MASK,
2861 .recalc = &omap2_clksel_recalc,
2862 .enable_reg = OMAP4_SCRM_AUXCLK0,
2863 .enable_bit = OMAP4_ENABLE_SHIFT,
2864};
2865
2866static struct clk auxclk1_ck = {
2867 .name = "auxclk1_ck",
2868 .parent = &sys_clkin_ck,
2869 .init = &omap2_init_clksel_parent,
2870 .ops = &clkops_omap2_dflt,
2871 .clksel = auxclk_sel,
2872 .clksel_reg = OMAP4_SCRM_AUXCLK1,
2873 .clksel_mask = OMAP4_SRCSELECT_MASK,
2874 .recalc = &omap2_clksel_recalc,
2875 .enable_reg = OMAP4_SCRM_AUXCLK1,
2876 .enable_bit = OMAP4_ENABLE_SHIFT,
2877};
2878
2879static struct clk auxclk2_ck = {
2880 .name = "auxclk2_ck",
2881 .parent = &sys_clkin_ck,
2882 .init = &omap2_init_clksel_parent,
2883 .ops = &clkops_omap2_dflt,
2884 .clksel = auxclk_sel,
2885 .clksel_reg = OMAP4_SCRM_AUXCLK2,
2886 .clksel_mask = OMAP4_SRCSELECT_MASK,
2887 .recalc = &omap2_clksel_recalc,
2888 .enable_reg = OMAP4_SCRM_AUXCLK2,
2889 .enable_bit = OMAP4_ENABLE_SHIFT,
2890};
2891static struct clk auxclk3_ck = {
2892 .name = "auxclk3_ck",
2893 .parent = &sys_clkin_ck,
2894 .init = &omap2_init_clksel_parent,
2895 .ops = &clkops_omap2_dflt,
2896 .clksel = auxclk_sel,
2897 .clksel_reg = OMAP4_SCRM_AUXCLK3,
2898 .clksel_mask = OMAP4_SRCSELECT_MASK,
2899 .recalc = &omap2_clksel_recalc,
2900 .enable_reg = OMAP4_SCRM_AUXCLK3,
2901 .enable_bit = OMAP4_ENABLE_SHIFT,
2902};
2903
2904static struct clk auxclk4_ck = {
2905 .name = "auxclk4_ck",
2906 .parent = &sys_clkin_ck,
2907 .init = &omap2_init_clksel_parent,
2908 .ops = &clkops_omap2_dflt,
2909 .clksel = auxclk_sel,
2910 .clksel_reg = OMAP4_SCRM_AUXCLK4,
2911 .clksel_mask = OMAP4_SRCSELECT_MASK,
2912 .recalc = &omap2_clksel_recalc,
2913 .enable_reg = OMAP4_SCRM_AUXCLK4,
2914 .enable_bit = OMAP4_ENABLE_SHIFT,
2915};
2916
2917static struct clk auxclk5_ck = {
2918 .name = "auxclk5_ck",
2919 .parent = &sys_clkin_ck,
2920 .init = &omap2_init_clksel_parent,
2921 .ops = &clkops_omap2_dflt,
2922 .clksel = auxclk_sel,
2923 .clksel_reg = OMAP4_SCRM_AUXCLK5,
2924 .clksel_mask = OMAP4_SRCSELECT_MASK,
2925 .recalc = &omap2_clksel_recalc,
2926 .enable_reg = OMAP4_SCRM_AUXCLK5,
2927 .enable_bit = OMAP4_ENABLE_SHIFT,
2928};
2929
2930static const struct clksel auxclkreq_sel[] = {
2931 { .parent = &auxclk0_ck, .rates = div_1_0_rates },
2932 { .parent = &auxclk1_ck, .rates = div_1_1_rates },
2933 { .parent = &auxclk2_ck, .rates = div_1_2_rates },
2934 { .parent = &auxclk3_ck, .rates = div_1_3_rates },
2935 { .parent = &auxclk4_ck, .rates = div_1_4_rates },
2936 { .parent = &auxclk5_ck, .rates = div_1_5_rates },
2937 { .parent = NULL },
2938};
2939
2940static struct clk auxclkreq0_ck = {
2941 .name = "auxclkreq0_ck",
2942 .parent = &auxclk0_ck,
2943 .init = &omap2_init_clksel_parent,
2944 .ops = &clkops_null,
2945 .clksel = auxclkreq_sel,
2946 .clksel_reg = OMAP4_SCRM_AUXCLKREQ0,
2947 .clksel_mask = OMAP4_MAPPING_MASK,
2948 .recalc = &omap2_clksel_recalc,
2949};
2950
2951static struct clk auxclkreq1_ck = {
2952 .name = "auxclkreq1_ck",
2953 .parent = &auxclk1_ck,
2954 .init = &omap2_init_clksel_parent,
2955 .ops = &clkops_null,
2956 .clksel = auxclkreq_sel,
2957 .clksel_reg = OMAP4_SCRM_AUXCLKREQ1,
2958 .clksel_mask = OMAP4_MAPPING_MASK,
2959 .recalc = &omap2_clksel_recalc,
2960};
2961
2962static struct clk auxclkreq2_ck = {
2963 .name = "auxclkreq2_ck",
2964 .parent = &auxclk2_ck,
2965 .init = &omap2_init_clksel_parent,
2966 .ops = &clkops_null,
2967 .clksel = auxclkreq_sel,
2968 .clksel_reg = OMAP4_SCRM_AUXCLKREQ2,
2969 .clksel_mask = OMAP4_MAPPING_MASK,
2970 .recalc = &omap2_clksel_recalc,
2971};
2972
2973static struct clk auxclkreq3_ck = {
2974 .name = "auxclkreq3_ck",
2975 .parent = &auxclk3_ck,
2976 .init = &omap2_init_clksel_parent,
2977 .ops = &clkops_null,
2978 .clksel = auxclkreq_sel,
2979 .clksel_reg = OMAP4_SCRM_AUXCLKREQ3,
2980 .clksel_mask = OMAP4_MAPPING_MASK,
2981 .recalc = &omap2_clksel_recalc,
2982};
2983
2984static struct clk auxclkreq4_ck = {
2985 .name = "auxclkreq4_ck",
2986 .parent = &auxclk4_ck,
2987 .init = &omap2_init_clksel_parent,
2988 .ops = &clkops_null,
2989 .clksel = auxclkreq_sel,
2990 .clksel_reg = OMAP4_SCRM_AUXCLKREQ4,
2991 .clksel_mask = OMAP4_MAPPING_MASK,
2992 .recalc = &omap2_clksel_recalc,
2993};
2994
2995static struct clk auxclkreq5_ck = {
2996 .name = "auxclkreq5_ck",
2997 .parent = &auxclk5_ck,
2998 .init = &omap2_init_clksel_parent,
2999 .ops = &clkops_null,
3000 .clksel = auxclkreq_sel,
3001 .clksel_reg = OMAP4_SCRM_AUXCLKREQ5,
3002 .clksel_mask = OMAP4_MAPPING_MASK,
3003 .recalc = &omap2_clksel_recalc,
3004};
3005
2750/* 3006/*
2751 * clkdev 3007 * clkdev
2752 */ 3008 */
@@ -2774,43 +3030,48 @@ static struct omap_clk omap44xx_clks[] = {
2774 CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck, CK_443X), 3030 CLK(NULL, "abe_dpll_bypass_clk_mux_ck", &abe_dpll_bypass_clk_mux_ck, CK_443X),
2775 CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck, CK_443X), 3031 CLK(NULL, "abe_dpll_refclk_mux_ck", &abe_dpll_refclk_mux_ck, CK_443X),
2776 CLK(NULL, "dpll_abe_ck", &dpll_abe_ck, CK_443X), 3032 CLK(NULL, "dpll_abe_ck", &dpll_abe_ck, CK_443X),
3033 CLK(NULL, "dpll_abe_x2_ck", &dpll_abe_x2_ck, CK_443X),
2777 CLK(NULL, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, CK_443X), 3034 CLK(NULL, "dpll_abe_m2x2_ck", &dpll_abe_m2x2_ck, CK_443X),
2778 CLK(NULL, "abe_24m_fclk", &abe_24m_fclk, CK_443X), 3035 CLK(NULL, "abe_24m_fclk", &abe_24m_fclk, CK_443X),
2779 CLK(NULL, "abe_clk", &abe_clk, CK_443X), 3036 CLK(NULL, "abe_clk", &abe_clk, CK_443X),
2780 CLK(NULL, "aess_fclk", &aess_fclk, CK_443X), 3037 CLK(NULL, "aess_fclk", &aess_fclk, CK_443X),
2781 CLK(NULL, "dpll_abe_m3_ck", &dpll_abe_m3_ck, CK_443X), 3038 CLK(NULL, "dpll_abe_m3x2_ck", &dpll_abe_m3x2_ck, CK_443X),
2782 CLK(NULL, "core_hsd_byp_clk_mux_ck", &core_hsd_byp_clk_mux_ck, CK_443X), 3039 CLK(NULL, "core_hsd_byp_clk_mux_ck", &core_hsd_byp_clk_mux_ck, CK_443X),
2783 CLK(NULL, "dpll_core_ck", &dpll_core_ck, CK_443X), 3040 CLK(NULL, "dpll_core_ck", &dpll_core_ck, CK_443X),
2784 CLK(NULL, "dpll_core_m6_ck", &dpll_core_m6_ck, CK_443X), 3041 CLK(NULL, "dpll_core_x2_ck", &dpll_core_x2_ck, CK_443X),
3042 CLK(NULL, "dpll_core_m6x2_ck", &dpll_core_m6x2_ck, CK_443X),
2785 CLK(NULL, "dbgclk_mux_ck", &dbgclk_mux_ck, CK_443X), 3043 CLK(NULL, "dbgclk_mux_ck", &dbgclk_mux_ck, CK_443X),
2786 CLK(NULL, "dpll_core_m2_ck", &dpll_core_m2_ck, CK_443X), 3044 CLK(NULL, "dpll_core_m2_ck", &dpll_core_m2_ck, CK_443X),
2787 CLK(NULL, "ddrphy_ck", &ddrphy_ck, CK_443X), 3045 CLK(NULL, "ddrphy_ck", &ddrphy_ck, CK_443X),
2788 CLK(NULL, "dpll_core_m5_ck", &dpll_core_m5_ck, CK_443X), 3046 CLK(NULL, "dpll_core_m5x2_ck", &dpll_core_m5x2_ck, CK_443X),
2789 CLK(NULL, "div_core_ck", &div_core_ck, CK_443X), 3047 CLK(NULL, "div_core_ck", &div_core_ck, CK_443X),
2790 CLK(NULL, "div_iva_hs_clk", &div_iva_hs_clk, CK_443X), 3048 CLK(NULL, "div_iva_hs_clk", &div_iva_hs_clk, CK_443X),
2791 CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X), 3049 CLK(NULL, "div_mpu_hs_clk", &div_mpu_hs_clk, CK_443X),
2792 CLK(NULL, "dpll_core_m4_ck", &dpll_core_m4_ck, CK_443X), 3050 CLK(NULL, "dpll_core_m4x2_ck", &dpll_core_m4x2_ck, CK_443X),
2793 CLK(NULL, "dll_clk_div_ck", &dll_clk_div_ck, CK_443X), 3051 CLK(NULL, "dll_clk_div_ck", &dll_clk_div_ck, CK_443X),
2794 CLK(NULL, "dpll_abe_m2_ck", &dpll_abe_m2_ck, CK_443X), 3052 CLK(NULL, "dpll_abe_m2_ck", &dpll_abe_m2_ck, CK_443X),
2795 CLK(NULL, "dpll_core_m3_ck", &dpll_core_m3_ck, CK_443X), 3053 CLK(NULL, "dpll_core_m3x2_ck", &dpll_core_m3x2_ck, CK_443X),
2796 CLK(NULL, "dpll_core_m7_ck", &dpll_core_m7_ck, CK_443X), 3054 CLK(NULL, "dpll_core_m7x2_ck", &dpll_core_m7x2_ck, CK_443X),
2797 CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck, CK_443X), 3055 CLK(NULL, "iva_hsd_byp_clk_mux_ck", &iva_hsd_byp_clk_mux_ck, CK_443X),
2798 CLK(NULL, "dpll_iva_ck", &dpll_iva_ck, CK_443X), 3056 CLK(NULL, "dpll_iva_ck", &dpll_iva_ck, CK_443X),
2799 CLK(NULL, "dpll_iva_m4_ck", &dpll_iva_m4_ck, CK_443X), 3057 CLK(NULL, "dpll_iva_x2_ck", &dpll_iva_x2_ck, CK_443X),
2800 CLK(NULL, "dpll_iva_m5_ck", &dpll_iva_m5_ck, CK_443X), 3058 CLK(NULL, "dpll_iva_m4x2_ck", &dpll_iva_m4x2_ck, CK_443X),
3059 CLK(NULL, "dpll_iva_m5x2_ck", &dpll_iva_m5x2_ck, CK_443X),
2801 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_443X), 3060 CLK(NULL, "dpll_mpu_ck", &dpll_mpu_ck, CK_443X),
2802 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_443X), 3061 CLK(NULL, "dpll_mpu_m2_ck", &dpll_mpu_m2_ck, CK_443X),
2803 CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X), 3062 CLK(NULL, "per_hs_clk_div_ck", &per_hs_clk_div_ck, CK_443X),
2804 CLK(NULL, "per_hsd_byp_clk_mux_ck", &per_hsd_byp_clk_mux_ck, CK_443X), 3063 CLK(NULL, "per_hsd_byp_clk_mux_ck", &per_hsd_byp_clk_mux_ck, CK_443X),
2805 CLK(NULL, "dpll_per_ck", &dpll_per_ck, CK_443X), 3064 CLK(NULL, "dpll_per_ck", &dpll_per_ck, CK_443X),
2806 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck, CK_443X), 3065 CLK(NULL, "dpll_per_m2_ck", &dpll_per_m2_ck, CK_443X),
3066 CLK(NULL, "dpll_per_x2_ck", &dpll_per_x2_ck, CK_443X),
2807 CLK(NULL, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, CK_443X), 3067 CLK(NULL, "dpll_per_m2x2_ck", &dpll_per_m2x2_ck, CK_443X),
2808 CLK(NULL, "dpll_per_m3_ck", &dpll_per_m3_ck, CK_443X), 3068 CLK(NULL, "dpll_per_m3x2_ck", &dpll_per_m3x2_ck, CK_443X),
2809 CLK(NULL, "dpll_per_m4_ck", &dpll_per_m4_ck, CK_443X), 3069 CLK(NULL, "dpll_per_m4x2_ck", &dpll_per_m4x2_ck, CK_443X),
2810 CLK(NULL, "dpll_per_m5_ck", &dpll_per_m5_ck, CK_443X), 3070 CLK(NULL, "dpll_per_m5x2_ck", &dpll_per_m5x2_ck, CK_443X),
2811 CLK(NULL, "dpll_per_m6_ck", &dpll_per_m6_ck, CK_443X), 3071 CLK(NULL, "dpll_per_m6x2_ck", &dpll_per_m6x2_ck, CK_443X),
2812 CLK(NULL, "dpll_per_m7_ck", &dpll_per_m7_ck, CK_443X), 3072 CLK(NULL, "dpll_per_m7x2_ck", &dpll_per_m7x2_ck, CK_443X),
2813 CLK(NULL, "dpll_unipro_ck", &dpll_unipro_ck, CK_443X), 3073 CLK(NULL, "dpll_unipro_ck", &dpll_unipro_ck, CK_443X),
3074 CLK(NULL, "dpll_unipro_x2_ck", &dpll_unipro_x2_ck, CK_443X),
2814 CLK(NULL, "dpll_unipro_m2x2_ck", &dpll_unipro_m2x2_ck, CK_443X), 3075 CLK(NULL, "dpll_unipro_m2x2_ck", &dpll_unipro_m2x2_ck, CK_443X),
2815 CLK(NULL, "usb_hs_clk_div_ck", &usb_hs_clk_div_ck, CK_443X), 3076 CLK(NULL, "usb_hs_clk_div_ck", &usb_hs_clk_div_ck, CK_443X),
2816 CLK(NULL, "dpll_usb_ck", &dpll_usb_ck, CK_443X), 3077 CLK(NULL, "dpll_usb_ck", &dpll_usb_ck, CK_443X),
@@ -2856,17 +3117,17 @@ static struct omap_clk omap44xx_clks[] = {
2856 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X), 3117 CLK(NULL, "emif2_fck", &emif2_fck, CK_443X),
2857 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X), 3118 CLK(NULL, "fdif_fck", &fdif_fck, CK_443X),
2858 CLK(NULL, "fpka_fck", &fpka_fck, CK_443X), 3119 CLK(NULL, "fpka_fck", &fpka_fck, CK_443X),
2859 CLK(NULL, "gpio1_dbck", &gpio1_dbclk, CK_443X), 3120 CLK(NULL, "gpio1_dbclk", &gpio1_dbclk, CK_443X),
2860 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_443X), 3121 CLK(NULL, "gpio1_ick", &gpio1_ick, CK_443X),
2861 CLK(NULL, "gpio2_dbck", &gpio2_dbclk, CK_443X), 3122 CLK(NULL, "gpio2_dbclk", &gpio2_dbclk, CK_443X),
2862 CLK(NULL, "gpio2_ick", &gpio2_ick, CK_443X), 3123 CLK(NULL, "gpio2_ick", &gpio2_ick, CK_443X),
2863 CLK(NULL, "gpio3_dbck", &gpio3_dbclk, CK_443X), 3124 CLK(NULL, "gpio3_dbclk", &gpio3_dbclk, CK_443X),
2864 CLK(NULL, "gpio3_ick", &gpio3_ick, CK_443X), 3125 CLK(NULL, "gpio3_ick", &gpio3_ick, CK_443X),
2865 CLK(NULL, "gpio4_dbck", &gpio4_dbclk, CK_443X), 3126 CLK(NULL, "gpio4_dbclk", &gpio4_dbclk, CK_443X),
2866 CLK(NULL, "gpio4_ick", &gpio4_ick, CK_443X), 3127 CLK(NULL, "gpio4_ick", &gpio4_ick, CK_443X),
2867 CLK(NULL, "gpio5_dbck", &gpio5_dbclk, CK_443X), 3128 CLK(NULL, "gpio5_dbclk", &gpio5_dbclk, CK_443X),
2868 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_443X), 3129 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_443X),
2869 CLK(NULL, "gpio6_dbck", &gpio6_dbclk, CK_443X), 3130 CLK(NULL, "gpio6_dbclk", &gpio6_dbclk, CK_443X),
2870 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X), 3131 CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X),
2871 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X), 3132 CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X),
2872 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X), 3133 CLK(NULL, "gpu_fck", &gpu_fck, CK_443X),
@@ -2937,14 +3198,14 @@ static struct omap_clk omap44xx_clks[] = {
2937 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), 3198 CLK(NULL, "uart3_fck", &uart3_fck, CK_443X),
2938 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), 3199 CLK(NULL, "uart4_fck", &uart4_fck, CK_443X),
2939 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X), 3200 CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X),
2940 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X),
2941 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X),
2942 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
2943 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X), 3201 CLK(NULL, "utmi_p1_gfclk", &utmi_p1_gfclk, CK_443X),
2944 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X), 3202 CLK(NULL, "usb_host_hs_utmi_p1_clk", &usb_host_hs_utmi_p1_clk, CK_443X),
2945 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X), 3203 CLK(NULL, "utmi_p2_gfclk", &utmi_p2_gfclk, CK_443X),
2946 CLK(NULL, "usb_host_hs_utmi_p2_clk", &usb_host_hs_utmi_p2_clk, CK_443X), 3204 CLK(NULL, "usb_host_hs_utmi_p2_clk", &usb_host_hs_utmi_p2_clk, CK_443X),
3205 CLK(NULL, "usb_host_hs_utmi_p3_clk", &usb_host_hs_utmi_p3_clk, CK_443X),
2947 CLK(NULL, "usb_host_hs_hsic480m_p1_clk", &usb_host_hs_hsic480m_p1_clk, CK_443X), 3206 CLK(NULL, "usb_host_hs_hsic480m_p1_clk", &usb_host_hs_hsic480m_p1_clk, CK_443X),
3207 CLK(NULL, "usb_host_hs_hsic60m_p1_clk", &usb_host_hs_hsic60m_p1_clk, CK_443X),
3208 CLK(NULL, "usb_host_hs_hsic60m_p2_clk", &usb_host_hs_hsic60m_p2_clk, CK_443X),
2948 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X), 3209 CLK(NULL, "usb_host_hs_hsic480m_p2_clk", &usb_host_hs_hsic480m_p2_clk, CK_443X),
2949 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X), 3210 CLK(NULL, "usb_host_hs_func48mclk", &usb_host_hs_func48mclk, CK_443X),
2950 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X), 3211 CLK(NULL, "usb_host_hs_fck", &usb_host_hs_fck, CK_443X),
@@ -2960,6 +3221,7 @@ static struct omap_clk omap44xx_clks[] = {
2960 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), 3221 CLK(NULL, "usim_fclk", &usim_fclk, CK_443X),
2961 CLK(NULL, "usim_fck", &usim_fck, CK_443X), 3222 CLK(NULL, "usim_fck", &usim_fck, CK_443X),
2962 CLK("omap_wdt", "fck", &wd_timer2_fck, CK_443X), 3223 CLK("omap_wdt", "fck", &wd_timer2_fck, CK_443X),
3224 CLK(NULL, "mailboxes_ick", &dummy_ck, CK_443X),
2963 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X), 3225 CLK(NULL, "wd_timer3_fck", &wd_timer3_fck, CK_443X),
2964 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X), 3226 CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X),
2965 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X), 3227 CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X),
@@ -2997,6 +3259,18 @@ static struct omap_clk omap44xx_clks[] = {
2997 CLK(NULL, "uart3_ick", &dummy_ck, CK_443X), 3259 CLK(NULL, "uart3_ick", &dummy_ck, CK_443X),
2998 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X), 3260 CLK(NULL, "uart4_ick", &dummy_ck, CK_443X),
2999 CLK("omap_wdt", "ick", &dummy_ck, CK_443X), 3261 CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
3262 CLK(NULL, "auxclk0_ck", &auxclk0_ck, CK_443X),
3263 CLK(NULL, "auxclk1_ck", &auxclk1_ck, CK_443X),
3264 CLK(NULL, "auxclk2_ck", &auxclk2_ck, CK_443X),
3265 CLK(NULL, "auxclk3_ck", &auxclk3_ck, CK_443X),
3266 CLK(NULL, "auxclk4_ck", &auxclk4_ck, CK_443X),
3267 CLK(NULL, "auxclk5_ck", &auxclk5_ck, CK_443X),
3268 CLK(NULL, "auxclkreq0_ck", &auxclkreq0_ck, CK_443X),
3269 CLK(NULL, "auxclkreq1_ck", &auxclkreq1_ck, CK_443X),
3270 CLK(NULL, "auxclkreq2_ck", &auxclkreq2_ck, CK_443X),
3271 CLK(NULL, "auxclkreq3_ck", &auxclkreq3_ck, CK_443X),
3272 CLK(NULL, "auxclkreq4_ck", &auxclkreq4_ck, CK_443X),
3273 CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck, CK_443X),
3000}; 3274};
3001 3275
3002int __init omap4xxx_clk_init(void) 3276int __init omap4xxx_clk_init(void)
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 6fb61b1a0d46..e20b98636ab4 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -13,7 +13,6 @@
13 */ 13 */
14#undef DEBUG 14#undef DEBUG
15 15
16#include <linux/module.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
18#include <linux/device.h> 17#include <linux/device.h>
19#include <linux/list.h> 18#include <linux/list.h>
@@ -27,13 +26,16 @@
27 26
28#include <linux/bitops.h> 27#include <linux/bitops.h>
29 28
30#include "prm.h" 29#include "prm2xxx_3xxx.h"
31#include "prm-regbits-24xx.h" 30#include "prm-regbits-24xx.h"
32#include "cm.h" 31#include "cm2xxx_3xxx.h"
32#include "cm-regbits-24xx.h"
33#include "cminst44xx.h"
34#include "prcm44xx.h"
33 35
34#include <plat/clock.h> 36#include <plat/clock.h>
35#include <plat/powerdomain.h> 37#include "powerdomain.h"
36#include <plat/clockdomain.h> 38#include "clockdomain.h"
37#include <plat/prcm.h> 39#include <plat/prcm.h>
38 40
39/* clkdm_list contains all registered struct clockdomains */ 41/* clkdm_list contains all registered struct clockdomains */
@@ -141,6 +143,9 @@ static struct clkdm_dep *_clkdm_deps_lookup(struct clockdomain *clkdm,
141 * clockdomain is in hardware-supervised mode. Meant to be called 143 * clockdomain is in hardware-supervised mode. Meant to be called
142 * once at clockdomain layer initialization, since these should remain 144 * once at clockdomain layer initialization, since these should remain
143 * fixed for a particular architecture. No return value. 145 * fixed for a particular architecture. No return value.
146 *
147 * XXX autodeps are deprecated and should be removed at the earliest
148 * opportunity
144 */ 149 */
145static void _autodep_lookup(struct clkdm_autodep *autodep) 150static void _autodep_lookup(struct clkdm_autodep *autodep)
146{ 151{
@@ -168,6 +173,9 @@ static void _autodep_lookup(struct clkdm_autodep *autodep)
168 * Add the "autodep" sleep & wakeup dependencies to clockdomain 'clkdm' 173 * Add the "autodep" sleep & wakeup dependencies to clockdomain 'clkdm'
169 * in hardware-supervised mode. Meant to be called from clock framework 174 * in hardware-supervised mode. Meant to be called from clock framework
170 * when a clock inside clockdomain 'clkdm' is enabled. No return value. 175 * when a clock inside clockdomain 'clkdm' is enabled. No return value.
176 *
177 * XXX autodeps are deprecated and should be removed at the earliest
178 * opportunity
171 */ 179 */
172static void _clkdm_add_autodeps(struct clockdomain *clkdm) 180static void _clkdm_add_autodeps(struct clockdomain *clkdm)
173{ 181{
@@ -199,6 +207,9 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm)
199 * Remove the "autodep" sleep & wakeup dependencies from clockdomain 'clkdm' 207 * Remove the "autodep" sleep & wakeup dependencies from clockdomain 'clkdm'
200 * in hardware-supervised mode. Meant to be called from clock framework 208 * in hardware-supervised mode. Meant to be called from clock framework
201 * when a clock inside clockdomain 'clkdm' is disabled. No return value. 209 * when a clock inside clockdomain 'clkdm' is disabled. No return value.
210 *
211 * XXX autodeps are deprecated and should be removed at the earliest
212 * opportunity
202 */ 213 */
203static void _clkdm_del_autodeps(struct clockdomain *clkdm) 214static void _clkdm_del_autodeps(struct clockdomain *clkdm)
204{ 215{
@@ -223,39 +234,56 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
223 } 234 }
224} 235}
225 236
226/* 237/**
227 * _omap2_clkdm_set_hwsup - set the hwsup idle transition bit 238 * _enable_hwsup - place a clockdomain into hardware-supervised idle
228 * @clkdm: struct clockdomain * 239 * @clkdm: struct clockdomain *
229 * @enable: int 0 to disable, 1 to enable
230 * 240 *
231 * Internal helper for actually switching the bit that controls hwsup 241 * Place the clockdomain into hardware-supervised idle mode. No return
232 * idle transitions for clkdm. 242 * value.
243 *
244 * XXX Should this return an error if the clockdomain does not support
245 * hardware-supervised idle mode?
233 */ 246 */
234static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable) 247static void _enable_hwsup(struct clockdomain *clkdm)
235{ 248{
236 u32 bits, v; 249 if (cpu_is_omap24xx())
237 250 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
238 if (cpu_is_omap24xx()) { 251 clkdm->clktrctrl_mask);
239 if (enable) 252 else if (cpu_is_omap34xx())
240 bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; 253 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
241 else 254 clkdm->clktrctrl_mask);
242 bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; 255 else if (cpu_is_omap44xx())
243 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 256 return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
244 if (enable) 257 clkdm->cm_inst,
245 bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; 258 clkdm->clkdm_offs);
246 else 259 else
247 bits = OMAP34XX_CLKSTCTRL_DISABLE_AUTO;
248 } else {
249 BUG(); 260 BUG();
250 } 261}
251
252 bits = bits << __ffs(clkdm->clktrctrl_mask);
253
254 v = __raw_readl(clkdm->clkstctrl_reg);
255 v &= ~(clkdm->clktrctrl_mask);
256 v |= bits;
257 __raw_writel(v, clkdm->clkstctrl_reg);
258 262
263/**
264 * _disable_hwsup - place a clockdomain into software-supervised idle
265 * @clkdm: struct clockdomain *
266 *
267 * Place the clockdomain @clkdm into software-supervised idle mode.
268 * No return value.
269 *
270 * XXX Should this return an error if the clockdomain does not support
271 * software-supervised idle mode?
272 */
273static void _disable_hwsup(struct clockdomain *clkdm)
274{
275 if (cpu_is_omap24xx())
276 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
277 clkdm->clktrctrl_mask);
278 else if (cpu_is_omap34xx())
279 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
280 clkdm->clktrctrl_mask);
281 else if (cpu_is_omap44xx())
282 return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition,
283 clkdm->cm_inst,
284 clkdm->clkdm_offs);
285 else
286 BUG();
259} 287}
260 288
261/* Public functions */ 289/* Public functions */
@@ -409,7 +437,7 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
409 pr_debug("clockdomain: hardware will wake up %s when %s wakes " 437 pr_debug("clockdomain: hardware will wake up %s when %s wakes "
410 "up\n", clkdm1->name, clkdm2->name); 438 "up\n", clkdm1->name, clkdm2->name);
411 439
412 prm_set_mod_reg_bits((1 << clkdm2->dep_bit), 440 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
413 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); 441 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
414 } 442 }
415 443
@@ -444,7 +472,7 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
444 pr_debug("clockdomain: hardware will no longer wake up %s " 472 pr_debug("clockdomain: hardware will no longer wake up %s "
445 "after %s wakes up\n", clkdm1->name, clkdm2->name); 473 "after %s wakes up\n", clkdm1->name, clkdm2->name);
446 474
447 prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 475 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
448 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); 476 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
449 } 477 }
450 478
@@ -480,7 +508,7 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
480 } 508 }
481 509
482 /* XXX It's faster to return the atomic wkdep_usecount */ 510 /* XXX It's faster to return the atomic wkdep_usecount */
483 return prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP, 511 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP,
484 (1 << clkdm2->dep_bit)); 512 (1 << clkdm2->dep_bit));
485} 513}
486 514
@@ -514,7 +542,7 @@ int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
514 atomic_set(&cd->wkdep_usecount, 0); 542 atomic_set(&cd->wkdep_usecount, 0);
515 } 543 }
516 544
517 prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP); 545 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP);
518 546
519 return 0; 547 return 0;
520} 548}
@@ -553,7 +581,7 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
553 pr_debug("clockdomain: will prevent %s from sleeping if %s " 581 pr_debug("clockdomain: will prevent %s from sleeping if %s "
554 "is active\n", clkdm1->name, clkdm2->name); 582 "is active\n", clkdm1->name, clkdm2->name);
555 583
556 cm_set_mod_reg_bits((1 << clkdm2->dep_bit), 584 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
557 clkdm1->pwrdm.ptr->prcm_offs, 585 clkdm1->pwrdm.ptr->prcm_offs,
558 OMAP3430_CM_SLEEPDEP); 586 OMAP3430_CM_SLEEPDEP);
559 } 587 }
@@ -596,7 +624,7 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
596 "sleeping if %s is active\n", clkdm1->name, 624 "sleeping if %s is active\n", clkdm1->name,
597 clkdm2->name); 625 clkdm2->name);
598 626
599 cm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 627 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
600 clkdm1->pwrdm.ptr->prcm_offs, 628 clkdm1->pwrdm.ptr->prcm_offs,
601 OMAP3430_CM_SLEEPDEP); 629 OMAP3430_CM_SLEEPDEP);
602 } 630 }
@@ -639,7 +667,7 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
639 } 667 }
640 668
641 /* XXX It's faster to return the atomic sleepdep_usecount */ 669 /* XXX It's faster to return the atomic sleepdep_usecount */
642 return prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, 670 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
643 OMAP3430_CM_SLEEPDEP, 671 OMAP3430_CM_SLEEPDEP,
644 (1 << clkdm2->dep_bit)); 672 (1 << clkdm2->dep_bit));
645} 673}
@@ -677,35 +705,13 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
677 atomic_set(&cd->sleepdep_usecount, 0); 705 atomic_set(&cd->sleepdep_usecount, 0);
678 } 706 }
679 707
680 prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, 708 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
681 OMAP3430_CM_SLEEPDEP); 709 OMAP3430_CM_SLEEPDEP);
682 710
683 return 0; 711 return 0;
684} 712}
685 713
686/** 714/**
687 * omap2_clkdm_clktrctrl_read - read the clkdm's current state transition mode
688 * @clkdm: struct clkdm * of a clockdomain
689 *
690 * Return the clockdomain @clkdm current state transition mode from the
691 * corresponding domain CM_CLKSTCTRL register. Returns -EINVAL if @clkdm
692 * is NULL or the current mode upon success.
693 */
694static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm)
695{
696 u32 v;
697
698 if (!clkdm)
699 return -EINVAL;
700
701 v = __raw_readl(clkdm->clkstctrl_reg);
702 v &= clkdm->clktrctrl_mask;
703 v >>= __ffs(clkdm->clktrctrl_mask);
704
705 return v;
706}
707
708/**
709 * omap2_clkdm_sleep - force clockdomain sleep transition 715 * omap2_clkdm_sleep - force clockdomain sleep transition
710 * @clkdm: struct clockdomain * 716 * @clkdm: struct clockdomain *
711 * 717 *
@@ -729,18 +735,19 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
729 735
730 if (cpu_is_omap24xx()) { 736 if (cpu_is_omap24xx()) {
731 737
732 cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, 738 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
733 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); 739 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
734 740
735 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 741 } else if (cpu_is_omap34xx()) {
742
743 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
744 clkdm->clktrctrl_mask);
736 745
737 u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << 746 } else if (cpu_is_omap44xx()) {
738 __ffs(clkdm->clktrctrl_mask));
739 747
740 u32 v = __raw_readl(clkdm->clkstctrl_reg); 748 omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition,
741 v &= ~(clkdm->clktrctrl_mask); 749 clkdm->cm_inst,
742 v |= bits; 750 clkdm->clkdm_offs);
743 __raw_writel(v, clkdm->clkstctrl_reg);
744 751
745 } else { 752 } else {
746 BUG(); 753 BUG();
@@ -773,18 +780,19 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
773 780
774 if (cpu_is_omap24xx()) { 781 if (cpu_is_omap24xx()) {
775 782
776 cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, 783 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
777 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); 784 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
778 785
779 } else if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 786 } else if (cpu_is_omap34xx()) {
780 787
781 u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << 788 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
782 __ffs(clkdm->clktrctrl_mask)); 789 clkdm->clktrctrl_mask);
783 790
784 u32 v = __raw_readl(clkdm->clkstctrl_reg); 791 } else if (cpu_is_omap44xx()) {
785 v &= ~(clkdm->clktrctrl_mask); 792
786 v |= bits; 793 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
787 __raw_writel(v, clkdm->clkstctrl_reg); 794 clkdm->cm_inst,
795 clkdm->clkdm_offs);
788 796
789 } else { 797 } else {
790 BUG(); 798 BUG();
@@ -829,7 +837,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
829 _clkdm_add_autodeps(clkdm); 837 _clkdm_add_autodeps(clkdm);
830 } 838 }
831 839
832 _omap2_clkdm_set_hwsup(clkdm, 1); 840 _enable_hwsup(clkdm);
833 841
834 pwrdm_clkdm_state_switch(clkdm); 842 pwrdm_clkdm_state_switch(clkdm);
835} 843}
@@ -857,7 +865,7 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
857 pr_debug("clockdomain: disabling automatic idle transitions for %s\n", 865 pr_debug("clockdomain: disabling automatic idle transitions for %s\n",
858 clkdm->name); 866 clkdm->name);
859 867
860 _omap2_clkdm_set_hwsup(clkdm, 0); 868 _disable_hwsup(clkdm);
861 869
862 /* 870 /*
863 * XXX This should be removed once TI adds wakeup/sleep 871 * XXX This should be removed once TI adds wakeup/sleep
@@ -891,7 +899,7 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
891 */ 899 */
892int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) 900int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
893{ 901{
894 int v; 902 bool hwsup = false;
895 903
896 /* 904 /*
897 * XXX Rewrite this code to maintain a list of enabled 905 * XXX Rewrite this code to maintain a list of enabled
@@ -909,17 +917,27 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
909 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, 917 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name,
910 clk->name); 918 clk->name);
911 919
912 if (!clkdm->clkstctrl_reg) 920 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
913 return 0;
914 921
915 v = omap2_clkdm_clktrctrl_read(clkdm); 922 if (!clkdm->clktrctrl_mask)
923 return 0;
916 924
917 if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || 925 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
918 (cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) { 926 clkdm->clktrctrl_mask);
927
928 } else if (cpu_is_omap44xx()) {
929
930 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
931 clkdm->cm_inst,
932 clkdm->clkdm_offs);
933
934 }
935
936 if (hwsup) {
919 /* Disable HW transitions when we are changing deps */ 937 /* Disable HW transitions when we are changing deps */
920 _omap2_clkdm_set_hwsup(clkdm, 0); 938 _disable_hwsup(clkdm);
921 _clkdm_add_autodeps(clkdm); 939 _clkdm_add_autodeps(clkdm);
922 _omap2_clkdm_set_hwsup(clkdm, 1); 940 _enable_hwsup(clkdm);
923 } else { 941 } else {
924 omap2_clkdm_wakeup(clkdm); 942 omap2_clkdm_wakeup(clkdm);
925 } 943 }
@@ -946,7 +964,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
946 */ 964 */
947int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) 965int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
948{ 966{
949 int v; 967 bool hwsup = false;
950 968
951 /* 969 /*
952 * XXX Rewrite this code to maintain a list of enabled 970 * XXX Rewrite this code to maintain a list of enabled
@@ -971,17 +989,27 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
971 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, 989 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name,
972 clk->name); 990 clk->name);
973 991
974 if (!clkdm->clkstctrl_reg) 992 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
975 return 0;
976 993
977 v = omap2_clkdm_clktrctrl_read(clkdm); 994 if (!clkdm->clktrctrl_mask)
995 return 0;
996
997 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
998 clkdm->clktrctrl_mask);
999
1000 } else if (cpu_is_omap44xx()) {
1001
1002 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
1003 clkdm->cm_inst,
1004 clkdm->clkdm_offs);
1005
1006 }
978 1007
979 if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || 1008 if (hwsup) {
980 (cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO)) {
981 /* Disable HW transitions when we are changing deps */ 1009 /* Disable HW transitions when we are changing deps */
982 _omap2_clkdm_set_hwsup(clkdm, 0); 1010 _disable_hwsup(clkdm);
983 _clkdm_del_autodeps(clkdm); 1011 _clkdm_del_autodeps(clkdm);
984 _omap2_clkdm_set_hwsup(clkdm, 1); 1012 _enable_hwsup(clkdm);
985 } else { 1013 } else {
986 omap2_clkdm_sleep(clkdm); 1014 omap2_clkdm_sleep(clkdm);
987 } 1015 }
diff --git a/arch/arm/plat-omap/include/plat/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index ba0a6c07c0fe..de3faa20b46b 100644
--- a/arch/arm/plat-omap/include/plat/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -4,19 +4,21 @@
4 * OMAP2/3 clockdomain framework functions 4 * OMAP2/3 clockdomain framework functions
5 * 5 *
6 * Copyright (C) 2008 Texas Instruments, Inc. 6 * Copyright (C) 2008 Texas Instruments, Inc.
7 * Copyright (C) 2008-2009 Nokia Corporation 7 * Copyright (C) 2008-2010 Nokia Corporation
8 * 8 *
9 * Written by Paul Walmsley 9 * Paul Walmsley
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
14 */ 14 */
15 15
16#ifndef __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 16#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H
17#define __ASM_ARM_ARCH_OMAP_CLOCKDOMAIN_H 17#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAIN_H
18 18
19#include <plat/powerdomain.h> 19#include <linux/init.h>
20
21#include "powerdomain.h"
20#include <plat/clock.h> 22#include <plat/clock.h>
21#include <plat/cpu.h> 23#include <plat/cpu.h>
22 24
@@ -30,16 +32,6 @@
30#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) 32#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
31#define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP) 33#define CLKDM_CAN_HWSUP_SWSUP (CLKDM_CAN_SWSUP | CLKDM_CAN_HWSUP)
32 34
33/* OMAP24XX CM_CLKSTCTRL_*.AUTOSTATE_* register bit values */
34#define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0
35#define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1
36
37/* OMAP3XXX CM_CLKSTCTRL_*.CLKTRCTRL_* register bit values */
38#define OMAP34XX_CLKSTCTRL_DISABLE_AUTO 0x0
39#define OMAP34XX_CLKSTCTRL_FORCE_SLEEP 0x1
40#define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2
41#define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3
42
43/** 35/**
44 * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode 36 * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode
45 * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only 37 * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only
@@ -90,11 +82,20 @@ struct clkdm_dep {
90 * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg 82 * @clktrctrl_mask: CLKTRCTRL/AUTOSTATE field mask in CM_CLKSTCTRL reg
91 * @flags: Clockdomain capability flags 83 * @flags: Clockdomain capability flags
92 * @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit 84 * @dep_bit: Bit shift of this clockdomain's PM_WKDEP/CM_SLEEPDEP bit
85 * @prcm_partition: (OMAP4 only) PRCM partition ID for this clkdm's registers
86 * @cm_inst: (OMAP4 only) CM instance register offset
87 * @clkdm_offs: (OMAP4 only) CM clockdomain register offset
93 * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up 88 * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up
94 * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact 89 * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact
95 * @omap_chip: OMAP chip types that this clockdomain is valid on 90 * @omap_chip: OMAP chip types that this clockdomain is valid on
96 * @usecount: Usecount tracking 91 * @usecount: Usecount tracking
97 * @node: list_head to link all clockdomains together 92 * @node: list_head to link all clockdomains together
93 *
94 * @prcm_partition should be a macro from mach-omap2/prcm44xx.h (OMAP4 only)
95 * @cm_inst should be a macro ending in _INST from the OMAP4 CM instance
96 * definitions (OMAP4 only)
97 * @clkdm_offs should be a macro ending in _CDOFFS from the OMAP4 CM instance
98 * definitions (OMAP4 only)
98 */ 99 */
99struct clockdomain { 100struct clockdomain {
100 const char *name; 101 const char *name;
@@ -102,10 +103,14 @@ struct clockdomain {
102 const char *name; 103 const char *name;
103 struct powerdomain *ptr; 104 struct powerdomain *ptr;
104 } pwrdm; 105 } pwrdm;
105 void __iomem *clkstctrl_reg; 106#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
106 const u16 clktrctrl_mask; 107 const u16 clktrctrl_mask;
108#endif
107 const u8 flags; 109 const u8 flags;
108 const u8 dep_bit; 110 const u8 dep_bit;
111 const u8 prcm_partition;
112 const s16 cm_inst;
113 const u16 clkdm_offs;
109 struct clkdm_dep *wkdep_srcs; 114 struct clkdm_dep *wkdep_srcs;
110 struct clkdm_dep *sleepdep_srcs; 115 struct clkdm_dep *sleepdep_srcs;
111 const struct omap_chip_id omap_chip; 116 const struct omap_chip_id omap_chip;
@@ -138,4 +143,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm);
138int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); 143int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
139int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); 144int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
140 145
146extern void __init omap2_clockdomains_init(void);
147extern void __init omap44xx_clockdomains_init(void);
148
141#endif 149#endif
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
index 8fc19ff2cd89..e4a7133ea3b3 100644
--- a/arch/arm/mach-omap2/clockdomains.h
+++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2008-2009 Texas Instruments, Inc. 4 * Copyright (C) 2008-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation 5 * Copyright (C) 2008-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley and Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
9 * This file contains clockdomains and clockdomain wakeup/sleep 9 * This file contains clockdomains and clockdomain wakeup/sleep
10 * dependencies for the OMAP2/3 chips. Some notes: 10 * dependencies for the OMAP2/3 chips. Some notes:
@@ -32,12 +32,17 @@
32 * from the Power domain framework 32 * from the Power domain framework
33 */ 33 */
34 34
35#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 35#include <linux/kernel.h>
36#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H 36#include <linux/io.h>
37 37
38#include <plat/clockdomain.h> 38#include "clockdomain.h"
39#include "cm.h" 39#include "prm2xxx_3xxx.h"
40#include "prm.h" 40#include "cm2xxx_3xxx.h"
41#include "cm-regbits-24xx.h"
42#include "cm-regbits-34xx.h"
43#include "cm-regbits-44xx.h"
44#include "prm-regbits-24xx.h"
45#include "prm-regbits-34xx.h"
41 46
42/* 47/*
43 * Clockdomain dependencies for wkdeps/sleepdeps 48 * Clockdomain dependencies for wkdeps/sleepdeps
@@ -84,8 +89,6 @@ static struct clkdm_dep gfx_sgx_wkdeps[] = {
84 89
85/* 24XX-specific possible dependencies */ 90/* 24XX-specific possible dependencies */
86 91
87#ifdef CONFIG_ARCH_OMAP2
88
89/* Wakeup dependency source arrays */ 92/* Wakeup dependency source arrays */
90 93
91/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ 94/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
@@ -165,8 +168,6 @@ static struct clkdm_dep core_24xx_wkdeps[] = {
165 { NULL }, 168 { NULL },
166}; 169};
167 170
168#endif
169
170 171
171/* 2430-specific possible wakeup dependencies */ 172/* 2430-specific possible wakeup dependencies */
172 173
@@ -425,8 +426,6 @@ static struct clkdm_dep gfx_sgx_sleepdeps[] = {
425 * sys_clkout/sys_clkout2. 426 * sys_clkout/sys_clkout2.
426 */ 427 */
427 428
428#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
429
430/* This is an implicit clockdomain - it is never defined as such in TRM */ 429/* This is an implicit clockdomain - it is never defined as such in TRM */
431static struct clockdomain wkup_clkdm = { 430static struct clockdomain wkup_clkdm = {
432 .name = "wkup_clkdm", 431 .name = "wkup_clkdm",
@@ -447,8 +446,6 @@ static struct clockdomain cm_clkdm = {
447 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 446 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
448}; 447};
449 448
450#endif
451
452/* 449/*
453 * 2420-only clockdomains 450 * 2420-only clockdomains
454 */ 451 */
@@ -459,7 +456,6 @@ static struct clockdomain mpu_2420_clkdm = {
459 .name = "mpu_clkdm", 456 .name = "mpu_clkdm",
460 .pwrdm = { .name = "mpu_pwrdm" }, 457 .pwrdm = { .name = "mpu_pwrdm" },
461 .flags = CLKDM_CAN_HWSUP, 458 .flags = CLKDM_CAN_HWSUP,
462 .clkstctrl_reg = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
463 .wkdep_srcs = mpu_24xx_wkdeps, 459 .wkdep_srcs = mpu_24xx_wkdeps,
464 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 460 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
465 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 461 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -469,8 +465,6 @@ static struct clockdomain iva1_2420_clkdm = {
469 .name = "iva1_clkdm", 465 .name = "iva1_clkdm",
470 .pwrdm = { .name = "dsp_pwrdm" }, 466 .pwrdm = { .name = "dsp_pwrdm" },
471 .flags = CLKDM_CAN_HWSUP_SWSUP, 467 .flags = CLKDM_CAN_HWSUP_SWSUP,
472 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
473 OMAP2_CM_CLKSTCTRL),
474 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, 468 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
475 .wkdep_srcs = dsp_24xx_wkdeps, 469 .wkdep_srcs = dsp_24xx_wkdeps,
476 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, 470 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
@@ -481,8 +475,6 @@ static struct clockdomain dsp_2420_clkdm = {
481 .name = "dsp_clkdm", 475 .name = "dsp_clkdm",
482 .pwrdm = { .name = "dsp_pwrdm" }, 476 .pwrdm = { .name = "dsp_pwrdm" },
483 .flags = CLKDM_CAN_HWSUP_SWSUP, 477 .flags = CLKDM_CAN_HWSUP_SWSUP,
484 .clkstctrl_reg = OMAP2420_CM_REGADDR(OMAP24XX_DSP_MOD,
485 OMAP2_CM_CLKSTCTRL),
486 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, 478 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
487 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 479 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
488}; 480};
@@ -491,7 +483,6 @@ static struct clockdomain gfx_2420_clkdm = {
491 .name = "gfx_clkdm", 483 .name = "gfx_clkdm",
492 .pwrdm = { .name = "gfx_pwrdm" }, 484 .pwrdm = { .name = "gfx_pwrdm" },
493 .flags = CLKDM_CAN_HWSUP_SWSUP, 485 .flags = CLKDM_CAN_HWSUP_SWSUP,
494 .clkstctrl_reg = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
495 .wkdep_srcs = gfx_sgx_wkdeps, 486 .wkdep_srcs = gfx_sgx_wkdeps,
496 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 487 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
497 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 488 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -501,7 +492,6 @@ static struct clockdomain core_l3_2420_clkdm = {
501 .name = "core_l3_clkdm", 492 .name = "core_l3_clkdm",
502 .pwrdm = { .name = "core_pwrdm" }, 493 .pwrdm = { .name = "core_pwrdm" },
503 .flags = CLKDM_CAN_HWSUP, 494 .flags = CLKDM_CAN_HWSUP,
504 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
505 .wkdep_srcs = core_24xx_wkdeps, 495 .wkdep_srcs = core_24xx_wkdeps,
506 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 496 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
507 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 497 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -511,7 +501,6 @@ static struct clockdomain core_l4_2420_clkdm = {
511 .name = "core_l4_clkdm", 501 .name = "core_l4_clkdm",
512 .pwrdm = { .name = "core_pwrdm" }, 502 .pwrdm = { .name = "core_pwrdm" },
513 .flags = CLKDM_CAN_HWSUP, 503 .flags = CLKDM_CAN_HWSUP,
514 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
515 .wkdep_srcs = core_24xx_wkdeps, 504 .wkdep_srcs = core_24xx_wkdeps,
516 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 505 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 506 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
@@ -521,7 +510,6 @@ static struct clockdomain dss_2420_clkdm = {
521 .name = "dss_clkdm", 510 .name = "dss_clkdm",
522 .pwrdm = { .name = "core_pwrdm" }, 511 .pwrdm = { .name = "core_pwrdm" },
523 .flags = CLKDM_CAN_HWSUP, 512 .flags = CLKDM_CAN_HWSUP,
524 .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
525 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, 513 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
526 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 514 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
527}; 515};
@@ -539,8 +527,6 @@ static struct clockdomain mpu_2430_clkdm = {
539 .name = "mpu_clkdm", 527 .name = "mpu_clkdm",
540 .pwrdm = { .name = "mpu_pwrdm" }, 528 .pwrdm = { .name = "mpu_pwrdm" },
541 .flags = CLKDM_CAN_HWSUP_SWSUP, 529 .flags = CLKDM_CAN_HWSUP_SWSUP,
542 .clkstctrl_reg = OMAP2430_CM_REGADDR(MPU_MOD,
543 OMAP2_CM_CLKSTCTRL),
544 .wkdep_srcs = mpu_24xx_wkdeps, 530 .wkdep_srcs = mpu_24xx_wkdeps,
545 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, 531 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
546 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 532 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
@@ -551,8 +537,6 @@ static struct clockdomain mdm_clkdm = {
551 .name = "mdm_clkdm", 537 .name = "mdm_clkdm",
552 .pwrdm = { .name = "mdm_pwrdm" }, 538 .pwrdm = { .name = "mdm_pwrdm" },
553 .flags = CLKDM_CAN_HWSUP_SWSUP, 539 .flags = CLKDM_CAN_HWSUP_SWSUP,
554 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP2430_MDM_MOD,
555 OMAP2_CM_CLKSTCTRL),
556 .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT, 540 .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
557 .wkdep_srcs = mdm_2430_wkdeps, 541 .wkdep_srcs = mdm_2430_wkdeps,
558 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, 542 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
@@ -563,8 +547,6 @@ static struct clockdomain dsp_2430_clkdm = {
563 .name = "dsp_clkdm", 547 .name = "dsp_clkdm",
564 .pwrdm = { .name = "dsp_pwrdm" }, 548 .pwrdm = { .name = "dsp_pwrdm" },
565 .flags = CLKDM_CAN_HWSUP_SWSUP, 549 .flags = CLKDM_CAN_HWSUP_SWSUP,
566 .clkstctrl_reg = OMAP2430_CM_REGADDR(OMAP24XX_DSP_MOD,
567 OMAP2_CM_CLKSTCTRL),
568 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, 550 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
569 .wkdep_srcs = dsp_24xx_wkdeps, 551 .wkdep_srcs = dsp_24xx_wkdeps,
570 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, 552 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
@@ -575,7 +557,6 @@ static struct clockdomain gfx_2430_clkdm = {
575 .name = "gfx_clkdm", 557 .name = "gfx_clkdm",
576 .pwrdm = { .name = "gfx_pwrdm" }, 558 .pwrdm = { .name = "gfx_pwrdm" },
577 .flags = CLKDM_CAN_HWSUP_SWSUP, 559 .flags = CLKDM_CAN_HWSUP_SWSUP,
578 .clkstctrl_reg = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
579 .wkdep_srcs = gfx_sgx_wkdeps, 560 .wkdep_srcs = gfx_sgx_wkdeps,
580 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, 561 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
581 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 562 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
@@ -590,7 +571,6 @@ static struct clockdomain core_l3_2430_clkdm = {
590 .name = "core_l3_clkdm", 571 .name = "core_l3_clkdm",
591 .pwrdm = { .name = "core_pwrdm" }, 572 .pwrdm = { .name = "core_pwrdm" },
592 .flags = CLKDM_CAN_HWSUP, 573 .flags = CLKDM_CAN_HWSUP,
593 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
594 .dep_bit = OMAP24XX_EN_CORE_SHIFT, 574 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
595 .wkdep_srcs = core_24xx_wkdeps, 575 .wkdep_srcs = core_24xx_wkdeps,
596 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, 576 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
@@ -606,7 +586,6 @@ static struct clockdomain core_l4_2430_clkdm = {
606 .name = "core_l4_clkdm", 586 .name = "core_l4_clkdm",
607 .pwrdm = { .name = "core_pwrdm" }, 587 .pwrdm = { .name = "core_pwrdm" },
608 .flags = CLKDM_CAN_HWSUP, 588 .flags = CLKDM_CAN_HWSUP,
609 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
610 .dep_bit = OMAP24XX_EN_CORE_SHIFT, 589 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
611 .wkdep_srcs = core_24xx_wkdeps, 590 .wkdep_srcs = core_24xx_wkdeps,
612 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, 591 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
@@ -617,7 +596,6 @@ static struct clockdomain dss_2430_clkdm = {
617 .name = "dss_clkdm", 596 .name = "dss_clkdm",
618 .pwrdm = { .name = "core_pwrdm" }, 597 .pwrdm = { .name = "core_pwrdm" },
619 .flags = CLKDM_CAN_HWSUP, 598 .flags = CLKDM_CAN_HWSUP,
620 .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
621 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, 599 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
622 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 600 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
623}; 601};
@@ -635,7 +613,6 @@ static struct clockdomain mpu_3xxx_clkdm = {
635 .name = "mpu_clkdm", 613 .name = "mpu_clkdm",
636 .pwrdm = { .name = "mpu_pwrdm" }, 614 .pwrdm = { .name = "mpu_pwrdm" },
637 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, 615 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
638 .clkstctrl_reg = OMAP34XX_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL),
639 .dep_bit = OMAP3430_EN_MPU_SHIFT, 616 .dep_bit = OMAP3430_EN_MPU_SHIFT,
640 .wkdep_srcs = mpu_3xxx_wkdeps, 617 .wkdep_srcs = mpu_3xxx_wkdeps,
641 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, 618 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
@@ -646,8 +623,6 @@ static struct clockdomain neon_clkdm = {
646 .name = "neon_clkdm", 623 .name = "neon_clkdm",
647 .pwrdm = { .name = "neon_pwrdm" }, 624 .pwrdm = { .name = "neon_pwrdm" },
648 .flags = CLKDM_CAN_HWSUP_SWSUP, 625 .flags = CLKDM_CAN_HWSUP_SWSUP,
649 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD,
650 OMAP2_CM_CLKSTCTRL),
651 .wkdep_srcs = neon_wkdeps, 626 .wkdep_srcs = neon_wkdeps,
652 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, 627 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
653 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 628 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -657,8 +632,6 @@ static struct clockdomain iva2_clkdm = {
657 .name = "iva2_clkdm", 632 .name = "iva2_clkdm",
658 .pwrdm = { .name = "iva2_pwrdm" }, 633 .pwrdm = { .name = "iva2_pwrdm" },
659 .flags = CLKDM_CAN_HWSUP_SWSUP, 634 .flags = CLKDM_CAN_HWSUP_SWSUP,
660 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_IVA2_MOD,
661 OMAP2_CM_CLKSTCTRL),
662 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, 635 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
663 .wkdep_srcs = iva2_wkdeps, 636 .wkdep_srcs = iva2_wkdeps,
664 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, 637 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
@@ -669,7 +642,6 @@ static struct clockdomain gfx_3430es1_clkdm = {
669 .name = "gfx_clkdm", 642 .name = "gfx_clkdm",
670 .pwrdm = { .name = "gfx_pwrdm" }, 643 .pwrdm = { .name = "gfx_pwrdm" },
671 .flags = CLKDM_CAN_HWSUP_SWSUP, 644 .flags = CLKDM_CAN_HWSUP_SWSUP,
672 .clkstctrl_reg = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL),
673 .wkdep_srcs = gfx_sgx_wkdeps, 645 .wkdep_srcs = gfx_sgx_wkdeps,
674 .sleepdep_srcs = gfx_sgx_sleepdeps, 646 .sleepdep_srcs = gfx_sgx_sleepdeps,
675 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, 647 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
@@ -680,8 +652,6 @@ static struct clockdomain sgx_clkdm = {
680 .name = "sgx_clkdm", 652 .name = "sgx_clkdm",
681 .pwrdm = { .name = "sgx_pwrdm" }, 653 .pwrdm = { .name = "sgx_pwrdm" },
682 .flags = CLKDM_CAN_HWSUP_SWSUP, 654 .flags = CLKDM_CAN_HWSUP_SWSUP,
683 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD,
684 OMAP2_CM_CLKSTCTRL),
685 .wkdep_srcs = gfx_sgx_wkdeps, 655 .wkdep_srcs = gfx_sgx_wkdeps,
686 .sleepdep_srcs = gfx_sgx_sleepdeps, 656 .sleepdep_srcs = gfx_sgx_sleepdeps,
687 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, 657 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
@@ -699,7 +669,6 @@ static struct clockdomain d2d_clkdm = {
699 .name = "d2d_clkdm", 669 .name = "d2d_clkdm",
700 .pwrdm = { .name = "core_pwrdm" }, 670 .pwrdm = { .name = "core_pwrdm" },
701 .flags = CLKDM_CAN_HWSUP_SWSUP, 671 .flags = CLKDM_CAN_HWSUP_SWSUP,
702 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
703 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, 672 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
704 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 673 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
705}; 674};
@@ -713,7 +682,6 @@ static struct clockdomain core_l3_3xxx_clkdm = {
713 .name = "core_l3_clkdm", 682 .name = "core_l3_clkdm",
714 .pwrdm = { .name = "core_pwrdm" }, 683 .pwrdm = { .name = "core_pwrdm" },
715 .flags = CLKDM_CAN_HWSUP, 684 .flags = CLKDM_CAN_HWSUP,
716 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
717 .dep_bit = OMAP3430_EN_CORE_SHIFT, 685 .dep_bit = OMAP3430_EN_CORE_SHIFT,
718 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, 686 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
719 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 687 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -728,7 +696,6 @@ static struct clockdomain core_l4_3xxx_clkdm = {
728 .name = "core_l4_clkdm", 696 .name = "core_l4_clkdm",
729 .pwrdm = { .name = "core_pwrdm" }, 697 .pwrdm = { .name = "core_pwrdm" },
730 .flags = CLKDM_CAN_HWSUP, 698 .flags = CLKDM_CAN_HWSUP,
731 .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL),
732 .dep_bit = OMAP3430_EN_CORE_SHIFT, 699 .dep_bit = OMAP3430_EN_CORE_SHIFT,
733 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, 700 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
734 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 701 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -739,8 +706,6 @@ static struct clockdomain dss_3xxx_clkdm = {
739 .name = "dss_clkdm", 706 .name = "dss_clkdm",
740 .pwrdm = { .name = "dss_pwrdm" }, 707 .pwrdm = { .name = "dss_pwrdm" },
741 .flags = CLKDM_CAN_HWSUP_SWSUP, 708 .flags = CLKDM_CAN_HWSUP_SWSUP,
742 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_DSS_MOD,
743 OMAP2_CM_CLKSTCTRL),
744 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT, 709 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
745 .wkdep_srcs = dss_wkdeps, 710 .wkdep_srcs = dss_wkdeps,
746 .sleepdep_srcs = dss_sleepdeps, 711 .sleepdep_srcs = dss_sleepdeps,
@@ -752,8 +717,6 @@ static struct clockdomain cam_clkdm = {
752 .name = "cam_clkdm", 717 .name = "cam_clkdm",
753 .pwrdm = { .name = "cam_pwrdm" }, 718 .pwrdm = { .name = "cam_pwrdm" },
754 .flags = CLKDM_CAN_HWSUP_SWSUP, 719 .flags = CLKDM_CAN_HWSUP_SWSUP,
755 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD,
756 OMAP2_CM_CLKSTCTRL),
757 .wkdep_srcs = cam_wkdeps, 720 .wkdep_srcs = cam_wkdeps,
758 .sleepdep_srcs = cam_sleepdeps, 721 .sleepdep_srcs = cam_sleepdeps,
759 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, 722 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
@@ -764,8 +727,6 @@ static struct clockdomain usbhost_clkdm = {
764 .name = "usbhost_clkdm", 727 .name = "usbhost_clkdm",
765 .pwrdm = { .name = "usbhost_pwrdm" }, 728 .pwrdm = { .name = "usbhost_pwrdm" },
766 .flags = CLKDM_CAN_HWSUP_SWSUP, 729 .flags = CLKDM_CAN_HWSUP_SWSUP,
767 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD,
768 OMAP2_CM_CLKSTCTRL),
769 .wkdep_srcs = usbhost_wkdeps, 730 .wkdep_srcs = usbhost_wkdeps,
770 .sleepdep_srcs = usbhost_sleepdeps, 731 .sleepdep_srcs = usbhost_sleepdeps,
771 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, 732 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
@@ -776,8 +737,6 @@ static struct clockdomain per_clkdm = {
776 .name = "per_clkdm", 737 .name = "per_clkdm",
777 .pwrdm = { .name = "per_pwrdm" }, 738 .pwrdm = { .name = "per_pwrdm" },
778 .flags = CLKDM_CAN_HWSUP_SWSUP, 739 .flags = CLKDM_CAN_HWSUP_SWSUP,
779 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_PER_MOD,
780 OMAP2_CM_CLKSTCTRL),
781 .dep_bit = OMAP3430_EN_PER_SHIFT, 740 .dep_bit = OMAP3430_EN_PER_SHIFT,
782 .wkdep_srcs = per_wkdeps, 741 .wkdep_srcs = per_wkdeps,
783 .sleepdep_srcs = per_sleepdeps, 742 .sleepdep_srcs = per_sleepdeps,
@@ -793,8 +752,6 @@ static struct clockdomain emu_clkdm = {
793 .name = "emu_clkdm", 752 .name = "emu_clkdm",
794 .pwrdm = { .name = "emu_pwrdm" }, 753 .pwrdm = { .name = "emu_pwrdm" },
795 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, 754 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP,
796 .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_EMU_MOD,
797 OMAP2_CM_CLKSTCTRL),
798 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, 755 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
799 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 756 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
800}; 757};
@@ -831,8 +788,6 @@ static struct clockdomain dpll5_clkdm = {
831 788
832#endif /* CONFIG_ARCH_OMAP3 */ 789#endif /* CONFIG_ARCH_OMAP3 */
833 790
834#include "clockdomains44xx.h"
835
836/* 791/*
837 * Clockdomain hwsup dependencies (OMAP3 only) 792 * Clockdomain hwsup dependencies (OMAP3 only)
838 */ 793 */
@@ -851,17 +806,10 @@ static struct clkdm_autodep clkdm_autodeps[] = {
851 } 806 }
852}; 807};
853 808
854/* 809static struct clockdomain *clockdomains_omap2[] __initdata = {
855 * List of clockdomain pointers per platform
856 */
857
858static struct clockdomain *clockdomains_omap[] = {
859
860#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
861 &wkup_clkdm, 810 &wkup_clkdm,
862 &cm_clkdm, 811 &cm_clkdm,
863 &prm_clkdm, 812 &prm_clkdm,
864#endif
865 813
866#ifdef CONFIG_ARCH_OMAP2420 814#ifdef CONFIG_ARCH_OMAP2420
867 &mpu_2420_clkdm, 815 &mpu_2420_clkdm,
@@ -903,35 +851,10 @@ static struct clockdomain *clockdomains_omap[] = {
903 &dpll4_clkdm, 851 &dpll4_clkdm,
904 &dpll5_clkdm, 852 &dpll5_clkdm,
905#endif 853#endif
906
907#ifdef CONFIG_ARCH_OMAP4
908 &l4_cefuse_44xx_clkdm,
909 &l4_cfg_44xx_clkdm,
910 &tesla_44xx_clkdm,
911 &l3_gfx_44xx_clkdm,
912 &ivahd_44xx_clkdm,
913 &l4_secure_44xx_clkdm,
914 &l4_per_44xx_clkdm,
915 &abe_44xx_clkdm,
916 &l3_instr_44xx_clkdm,
917 &l3_init_44xx_clkdm,
918 &mpuss_44xx_clkdm,
919 &mpu0_44xx_clkdm,
920 &mpu1_44xx_clkdm,
921 &l3_emif_44xx_clkdm,
922 &l4_ao_44xx_clkdm,
923 &ducati_44xx_clkdm,
924 &l3_2_44xx_clkdm,
925 &l3_1_44xx_clkdm,
926 &l3_d2d_44xx_clkdm,
927 &iss_44xx_clkdm,
928 &l3_dss_44xx_clkdm,
929 &l4_wkup_44xx_clkdm,
930 &emu_sys_44xx_clkdm,
931 &l3_dma_44xx_clkdm,
932#endif
933
934 NULL, 854 NULL,
935}; 855};
936 856
937#endif 857void __init omap2_clockdomains_init(void)
858{
859 clkdm_init(clockdomains_omap2, clkdm_autodeps);
860}
diff --git a/arch/arm/mach-omap2/clockdomains44xx.h b/arch/arm/mach-omap2/clockdomains44xx_data.c
index 7e5ba0f67925..51920fc7fc52 100644
--- a/arch/arm/mach-omap2/clockdomains44xx.h
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -23,18 +23,27 @@
23 * -> Populate the Sleep/Wakeup dependencies for the domains 23 * -> Populate the Sleep/Wakeup dependencies for the domains
24 */ 24 */
25 25
26#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H 26#include <linux/kernel.h>
27#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H 27#include <linux/io.h>
28 28
29#include <plat/clockdomain.h> 29#include "clockdomain.h"
30#include "cm1_44xx.h"
31#include "cm2_44xx.h"
32
33#include "cm1_44xx.h"
34#include "cm2_44xx.h"
35#include "cm-regbits-44xx.h"
36#include "prm44xx.h"
37#include "prcm44xx.h"
38#include "prcm_mpu44xx.h"
30 39
31#if defined(CONFIG_ARCH_OMAP4)
32 40
33static struct clockdomain l4_cefuse_44xx_clkdm = { 41static struct clockdomain l4_cefuse_44xx_clkdm = {
34 .name = "l4_cefuse_clkdm", 42 .name = "l4_cefuse_clkdm",
35 .pwrdm = { .name = "cefuse_pwrdm" }, 43 .pwrdm = { .name = "cefuse_pwrdm" },
36 .clkstctrl_reg = OMAP4430_CM_CEFUSE_CLKSTCTRL, 44 .prcm_partition = OMAP4430_CM2_PARTITION,
37 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 45 .cm_inst = OMAP4430_CM2_CEFUSE_INST,
46 .clkdm_offs = OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS,
38 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 47 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
39 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 48 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
40}; 49};
@@ -42,8 +51,9 @@ static struct clockdomain l4_cefuse_44xx_clkdm = {
42static struct clockdomain l4_cfg_44xx_clkdm = { 51static struct clockdomain l4_cfg_44xx_clkdm = {
43 .name = "l4_cfg_clkdm", 52 .name = "l4_cfg_clkdm",
44 .pwrdm = { .name = "core_pwrdm" }, 53 .pwrdm = { .name = "core_pwrdm" },
45 .clkstctrl_reg = OMAP4430_CM_L4CFG_CLKSTCTRL, 54 .prcm_partition = OMAP4430_CM2_PARTITION,
46 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 55 .cm_inst = OMAP4430_CM2_CORE_INST,
56 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS,
47 .flags = CLKDM_CAN_HWSUP, 57 .flags = CLKDM_CAN_HWSUP,
48 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 58 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
49}; 59};
@@ -51,8 +61,9 @@ static struct clockdomain l4_cfg_44xx_clkdm = {
51static struct clockdomain tesla_44xx_clkdm = { 61static struct clockdomain tesla_44xx_clkdm = {
52 .name = "tesla_clkdm", 62 .name = "tesla_clkdm",
53 .pwrdm = { .name = "tesla_pwrdm" }, 63 .pwrdm = { .name = "tesla_pwrdm" },
54 .clkstctrl_reg = OMAP4430_CM_TESLA_CLKSTCTRL, 64 .prcm_partition = OMAP4430_CM1_PARTITION,
55 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 65 .cm_inst = OMAP4430_CM1_TESLA_INST,
66 .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS,
56 .flags = CLKDM_CAN_HWSUP_SWSUP, 67 .flags = CLKDM_CAN_HWSUP_SWSUP,
57 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 68 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
58}; 69};
@@ -60,8 +71,9 @@ static struct clockdomain tesla_44xx_clkdm = {
60static struct clockdomain l3_gfx_44xx_clkdm = { 71static struct clockdomain l3_gfx_44xx_clkdm = {
61 .name = "l3_gfx_clkdm", 72 .name = "l3_gfx_clkdm",
62 .pwrdm = { .name = "gfx_pwrdm" }, 73 .pwrdm = { .name = "gfx_pwrdm" },
63 .clkstctrl_reg = OMAP4430_CM_GFX_CLKSTCTRL, 74 .prcm_partition = OMAP4430_CM2_PARTITION,
64 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 75 .cm_inst = OMAP4430_CM2_GFX_INST,
76 .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS,
65 .flags = CLKDM_CAN_HWSUP_SWSUP, 77 .flags = CLKDM_CAN_HWSUP_SWSUP,
66 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
67}; 79};
@@ -69,8 +81,9 @@ static struct clockdomain l3_gfx_44xx_clkdm = {
69static struct clockdomain ivahd_44xx_clkdm = { 81static struct clockdomain ivahd_44xx_clkdm = {
70 .name = "ivahd_clkdm", 82 .name = "ivahd_clkdm",
71 .pwrdm = { .name = "ivahd_pwrdm" }, 83 .pwrdm = { .name = "ivahd_pwrdm" },
72 .clkstctrl_reg = OMAP4430_CM_IVAHD_CLKSTCTRL, 84 .prcm_partition = OMAP4430_CM2_PARTITION,
73 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 85 .cm_inst = OMAP4430_CM2_IVAHD_INST,
86 .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS,
74 .flags = CLKDM_CAN_HWSUP_SWSUP, 87 .flags = CLKDM_CAN_HWSUP_SWSUP,
75 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
76}; 89};
@@ -78,8 +91,9 @@ static struct clockdomain ivahd_44xx_clkdm = {
78static struct clockdomain l4_secure_44xx_clkdm = { 91static struct clockdomain l4_secure_44xx_clkdm = {
79 .name = "l4_secure_clkdm", 92 .name = "l4_secure_clkdm",
80 .pwrdm = { .name = "l4per_pwrdm" }, 93 .pwrdm = { .name = "l4per_pwrdm" },
81 .clkstctrl_reg = OMAP4430_CM_L4SEC_CLKSTCTRL, 94 .prcm_partition = OMAP4430_CM2_PARTITION,
82 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 95 .cm_inst = OMAP4430_CM2_L4PER_INST,
96 .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS,
83 .flags = CLKDM_CAN_HWSUP_SWSUP, 97 .flags = CLKDM_CAN_HWSUP_SWSUP,
84 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 98 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
85}; 99};
@@ -87,8 +101,9 @@ static struct clockdomain l4_secure_44xx_clkdm = {
87static struct clockdomain l4_per_44xx_clkdm = { 101static struct clockdomain l4_per_44xx_clkdm = {
88 .name = "l4_per_clkdm", 102 .name = "l4_per_clkdm",
89 .pwrdm = { .name = "l4per_pwrdm" }, 103 .pwrdm = { .name = "l4per_pwrdm" },
90 .clkstctrl_reg = OMAP4430_CM_L4PER_CLKSTCTRL, 104 .prcm_partition = OMAP4430_CM2_PARTITION,
91 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 105 .cm_inst = OMAP4430_CM2_L4PER_INST,
106 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS,
92 .flags = CLKDM_CAN_HWSUP_SWSUP, 107 .flags = CLKDM_CAN_HWSUP_SWSUP,
93 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 108 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
94}; 109};
@@ -96,8 +111,9 @@ static struct clockdomain l4_per_44xx_clkdm = {
96static struct clockdomain abe_44xx_clkdm = { 111static struct clockdomain abe_44xx_clkdm = {
97 .name = "abe_clkdm", 112 .name = "abe_clkdm",
98 .pwrdm = { .name = "abe_pwrdm" }, 113 .pwrdm = { .name = "abe_pwrdm" },
99 .clkstctrl_reg = OMAP4430_CM1_ABE_CLKSTCTRL, 114 .prcm_partition = OMAP4430_CM1_PARTITION,
100 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 115 .cm_inst = OMAP4430_CM1_ABE_INST,
116 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS,
101 .flags = CLKDM_CAN_HWSUP_SWSUP, 117 .flags = CLKDM_CAN_HWSUP_SWSUP,
102 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 118 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
103}; 119};
@@ -105,16 +121,18 @@ static struct clockdomain abe_44xx_clkdm = {
105static struct clockdomain l3_instr_44xx_clkdm = { 121static struct clockdomain l3_instr_44xx_clkdm = {
106 .name = "l3_instr_clkdm", 122 .name = "l3_instr_clkdm",
107 .pwrdm = { .name = "core_pwrdm" }, 123 .pwrdm = { .name = "core_pwrdm" },
108 .clkstctrl_reg = OMAP4430_CM_L3INSTR_CLKSTCTRL, 124 .prcm_partition = OMAP4430_CM2_PARTITION,
109 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 125 .cm_inst = OMAP4430_CM2_CORE_INST,
126 .clkdm_offs = OMAP4430_CM2_CORE_L3INSTR_CDOFFS,
110 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 127 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
111}; 128};
112 129
113static struct clockdomain l3_init_44xx_clkdm = { 130static struct clockdomain l3_init_44xx_clkdm = {
114 .name = "l3_init_clkdm", 131 .name = "l3_init_clkdm",
115 .pwrdm = { .name = "l3init_pwrdm" }, 132 .pwrdm = { .name = "l3init_pwrdm" },
116 .clkstctrl_reg = OMAP4430_CM_L3INIT_CLKSTCTRL, 133 .prcm_partition = OMAP4430_CM2_PARTITION,
117 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 134 .cm_inst = OMAP4430_CM2_L3INIT_INST,
135 .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS,
118 .flags = CLKDM_CAN_HWSUP_SWSUP, 136 .flags = CLKDM_CAN_HWSUP_SWSUP,
119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
120}; 138};
@@ -122,8 +140,9 @@ static struct clockdomain l3_init_44xx_clkdm = {
122static struct clockdomain mpuss_44xx_clkdm = { 140static struct clockdomain mpuss_44xx_clkdm = {
123 .name = "mpuss_clkdm", 141 .name = "mpuss_clkdm",
124 .pwrdm = { .name = "mpu_pwrdm" }, 142 .pwrdm = { .name = "mpu_pwrdm" },
125 .clkstctrl_reg = OMAP4430_CM_MPU_CLKSTCTRL, 143 .prcm_partition = OMAP4430_CM1_PARTITION,
126 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 144 .cm_inst = OMAP4430_CM1_MPU_INST,
145 .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS,
127 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 146 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 147 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
129}; 148};
@@ -131,8 +150,9 @@ static struct clockdomain mpuss_44xx_clkdm = {
131static struct clockdomain mpu0_44xx_clkdm = { 150static struct clockdomain mpu0_44xx_clkdm = {
132 .name = "mpu0_clkdm", 151 .name = "mpu0_clkdm",
133 .pwrdm = { .name = "cpu0_pwrdm" }, 152 .pwrdm = { .name = "cpu0_pwrdm" },
134 .clkstctrl_reg = OMAP4430_CM_CPU0_CLKSTCTRL, 153 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
135 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 154 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST,
155 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS,
136 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 156 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 157 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
138}; 158};
@@ -140,8 +160,9 @@ static struct clockdomain mpu0_44xx_clkdm = {
140static struct clockdomain mpu1_44xx_clkdm = { 160static struct clockdomain mpu1_44xx_clkdm = {
141 .name = "mpu1_clkdm", 161 .name = "mpu1_clkdm",
142 .pwrdm = { .name = "cpu1_pwrdm" }, 162 .pwrdm = { .name = "cpu1_pwrdm" },
143 .clkstctrl_reg = OMAP4430_CM_CPU1_CLKSTCTRL, 163 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
144 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 164 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST,
165 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS,
145 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 166 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
146 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 167 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
147}; 168};
@@ -149,8 +170,9 @@ static struct clockdomain mpu1_44xx_clkdm = {
149static struct clockdomain l3_emif_44xx_clkdm = { 170static struct clockdomain l3_emif_44xx_clkdm = {
150 .name = "l3_emif_clkdm", 171 .name = "l3_emif_clkdm",
151 .pwrdm = { .name = "core_pwrdm" }, 172 .pwrdm = { .name = "core_pwrdm" },
152 .clkstctrl_reg = OMAP4430_CM_MEMIF_CLKSTCTRL, 173 .prcm_partition = OMAP4430_CM2_PARTITION,
153 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 174 .cm_inst = OMAP4430_CM2_CORE_INST,
175 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS,
154 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 176 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
155 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 177 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
156}; 178};
@@ -158,8 +180,9 @@ static struct clockdomain l3_emif_44xx_clkdm = {
158static struct clockdomain l4_ao_44xx_clkdm = { 180static struct clockdomain l4_ao_44xx_clkdm = {
159 .name = "l4_ao_clkdm", 181 .name = "l4_ao_clkdm",
160 .pwrdm = { .name = "always_on_core_pwrdm" }, 182 .pwrdm = { .name = "always_on_core_pwrdm" },
161 .clkstctrl_reg = OMAP4430_CM_ALWON_CLKSTCTRL, 183 .prcm_partition = OMAP4430_CM2_PARTITION,
162 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 184 .cm_inst = OMAP4430_CM2_ALWAYS_ON_INST,
185 .clkdm_offs = OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS,
163 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 186 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 187 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
165}; 188};
@@ -167,8 +190,9 @@ static struct clockdomain l4_ao_44xx_clkdm = {
167static struct clockdomain ducati_44xx_clkdm = { 190static struct clockdomain ducati_44xx_clkdm = {
168 .name = "ducati_clkdm", 191 .name = "ducati_clkdm",
169 .pwrdm = { .name = "core_pwrdm" }, 192 .pwrdm = { .name = "core_pwrdm" },
170 .clkstctrl_reg = OMAP4430_CM_DUCATI_CLKSTCTRL, 193 .prcm_partition = OMAP4430_CM2_PARTITION,
171 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 194 .cm_inst = OMAP4430_CM2_CORE_INST,
195 .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS,
172 .flags = CLKDM_CAN_HWSUP_SWSUP, 196 .flags = CLKDM_CAN_HWSUP_SWSUP,
173 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 197 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
174}; 198};
@@ -176,8 +200,9 @@ static struct clockdomain ducati_44xx_clkdm = {
176static struct clockdomain l3_2_44xx_clkdm = { 200static struct clockdomain l3_2_44xx_clkdm = {
177 .name = "l3_2_clkdm", 201 .name = "l3_2_clkdm",
178 .pwrdm = { .name = "core_pwrdm" }, 202 .pwrdm = { .name = "core_pwrdm" },
179 .clkstctrl_reg = OMAP4430_CM_L3_2_CLKSTCTRL, 203 .prcm_partition = OMAP4430_CM2_PARTITION,
180 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 204 .cm_inst = OMAP4430_CM2_CORE_INST,
205 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS,
181 .flags = CLKDM_CAN_HWSUP, 206 .flags = CLKDM_CAN_HWSUP,
182 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
183}; 208};
@@ -185,8 +210,9 @@ static struct clockdomain l3_2_44xx_clkdm = {
185static struct clockdomain l3_1_44xx_clkdm = { 210static struct clockdomain l3_1_44xx_clkdm = {
186 .name = "l3_1_clkdm", 211 .name = "l3_1_clkdm",
187 .pwrdm = { .name = "core_pwrdm" }, 212 .pwrdm = { .name = "core_pwrdm" },
188 .clkstctrl_reg = OMAP4430_CM_L3_1_CLKSTCTRL, 213 .prcm_partition = OMAP4430_CM2_PARTITION,
189 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 214 .cm_inst = OMAP4430_CM2_CORE_INST,
215 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS,
190 .flags = CLKDM_CAN_HWSUP, 216 .flags = CLKDM_CAN_HWSUP,
191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 217 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
192}; 218};
@@ -194,8 +220,9 @@ static struct clockdomain l3_1_44xx_clkdm = {
194static struct clockdomain l3_d2d_44xx_clkdm = { 220static struct clockdomain l3_d2d_44xx_clkdm = {
195 .name = "l3_d2d_clkdm", 221 .name = "l3_d2d_clkdm",
196 .pwrdm = { .name = "core_pwrdm" }, 222 .pwrdm = { .name = "core_pwrdm" },
197 .clkstctrl_reg = OMAP4430_CM_D2D_CLKSTCTRL, 223 .prcm_partition = OMAP4430_CM2_PARTITION,
198 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 224 .cm_inst = OMAP4430_CM2_CORE_INST,
225 .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS,
199 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 226 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
201}; 228};
@@ -203,8 +230,9 @@ static struct clockdomain l3_d2d_44xx_clkdm = {
203static struct clockdomain iss_44xx_clkdm = { 230static struct clockdomain iss_44xx_clkdm = {
204 .name = "iss_clkdm", 231 .name = "iss_clkdm",
205 .pwrdm = { .name = "cam_pwrdm" }, 232 .pwrdm = { .name = "cam_pwrdm" },
206 .clkstctrl_reg = OMAP4430_CM_CAM_CLKSTCTRL, 233 .prcm_partition = OMAP4430_CM2_PARTITION,
207 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 234 .cm_inst = OMAP4430_CM2_CAM_INST,
235 .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS,
208 .flags = CLKDM_CAN_HWSUP_SWSUP, 236 .flags = CLKDM_CAN_HWSUP_SWSUP,
209 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 237 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
210}; 238};
@@ -212,8 +240,9 @@ static struct clockdomain iss_44xx_clkdm = {
212static struct clockdomain l3_dss_44xx_clkdm = { 240static struct clockdomain l3_dss_44xx_clkdm = {
213 .name = "l3_dss_clkdm", 241 .name = "l3_dss_clkdm",
214 .pwrdm = { .name = "dss_pwrdm" }, 242 .pwrdm = { .name = "dss_pwrdm" },
215 .clkstctrl_reg = OMAP4430_CM_DSS_CLKSTCTRL, 243 .prcm_partition = OMAP4430_CM2_PARTITION,
216 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 244 .cm_inst = OMAP4430_CM2_DSS_INST,
245 .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS,
217 .flags = CLKDM_CAN_HWSUP_SWSUP, 246 .flags = CLKDM_CAN_HWSUP_SWSUP,
218 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 247 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
219}; 248};
@@ -221,8 +250,9 @@ static struct clockdomain l3_dss_44xx_clkdm = {
221static struct clockdomain l4_wkup_44xx_clkdm = { 250static struct clockdomain l4_wkup_44xx_clkdm = {
222 .name = "l4_wkup_clkdm", 251 .name = "l4_wkup_clkdm",
223 .pwrdm = { .name = "wkup_pwrdm" }, 252 .pwrdm = { .name = "wkup_pwrdm" },
224 .clkstctrl_reg = OMAP4430_CM_WKUP_CLKSTCTRL, 253 .prcm_partition = OMAP4430_PRM_PARTITION,
225 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 254 .cm_inst = OMAP4430_PRM_WKUP_CM_INST,
255 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS,
226 .flags = CLKDM_CAN_HWSUP, 256 .flags = CLKDM_CAN_HWSUP,
227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 257 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
228}; 258};
@@ -230,8 +260,9 @@ static struct clockdomain l4_wkup_44xx_clkdm = {
230static struct clockdomain emu_sys_44xx_clkdm = { 260static struct clockdomain emu_sys_44xx_clkdm = {
231 .name = "emu_sys_clkdm", 261 .name = "emu_sys_clkdm",
232 .pwrdm = { .name = "emu_pwrdm" }, 262 .pwrdm = { .name = "emu_pwrdm" },
233 .clkstctrl_reg = OMAP4430_CM_EMU_CLKSTCTRL, 263 .prcm_partition = OMAP4430_PRM_PARTITION,
234 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 264 .cm_inst = OMAP4430_PRM_EMU_CM_INST,
265 .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS,
235 .flags = CLKDM_CAN_HWSUP, 266 .flags = CLKDM_CAN_HWSUP,
236 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 267 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
237}; 268};
@@ -239,12 +270,42 @@ static struct clockdomain emu_sys_44xx_clkdm = {
239static struct clockdomain l3_dma_44xx_clkdm = { 270static struct clockdomain l3_dma_44xx_clkdm = {
240 .name = "l3_dma_clkdm", 271 .name = "l3_dma_clkdm",
241 .pwrdm = { .name = "core_pwrdm" }, 272 .pwrdm = { .name = "core_pwrdm" },
242 .clkstctrl_reg = OMAP4430_CM_SDMA_CLKSTCTRL, 273 .prcm_partition = OMAP4430_CM2_PARTITION,
243 .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, 274 .cm_inst = OMAP4430_CM2_CORE_INST,
275 .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS,
244 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 276 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
245 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 277 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
246}; 278};
247 279
248#endif 280static struct clockdomain *clockdomains_omap44xx[] __initdata = {
281 &l4_cefuse_44xx_clkdm,
282 &l4_cfg_44xx_clkdm,
283 &tesla_44xx_clkdm,
284 &l3_gfx_44xx_clkdm,
285 &ivahd_44xx_clkdm,
286 &l4_secure_44xx_clkdm,
287 &l4_per_44xx_clkdm,
288 &abe_44xx_clkdm,
289 &l3_instr_44xx_clkdm,
290 &l3_init_44xx_clkdm,
291 &mpuss_44xx_clkdm,
292 &mpu0_44xx_clkdm,
293 &mpu1_44xx_clkdm,
294 &l3_emif_44xx_clkdm,
295 &l4_ao_44xx_clkdm,
296 &ducati_44xx_clkdm,
297 &l3_2_44xx_clkdm,
298 &l3_1_44xx_clkdm,
299 &l3_d2d_44xx_clkdm,
300 &iss_44xx_clkdm,
301 &l3_dss_44xx_clkdm,
302 &l4_wkup_44xx_clkdm,
303 &emu_sys_44xx_clkdm,
304 &l3_dma_44xx_clkdm,
305 NULL,
306};
249 307
250#endif 308void __init omap44xx_clockdomains_init(void)
309{
310 clkdm_init(clockdomains_omap44xx, NULL);
311}
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h
index 9a106c04c4a0..d70660e82fe6 100644
--- a/arch/arm/mach-omap2/cm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-24xx.h
@@ -14,8 +14,6 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#include "cm.h"
18
19/* Bits shared between registers */ 17/* Bits shared between registers */
20 18
21/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */ 19/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
@@ -436,4 +434,9 @@
436#define OMAP2430_AUTOSTATE_MDM_SHIFT 0 434#define OMAP2430_AUTOSTATE_MDM_SHIFT 0
437#define OMAP2430_AUTOSTATE_MDM_MASK (1 << 0) 435#define OMAP2430_AUTOSTATE_MDM_MASK (1 << 0)
438 436
437/* OMAP24XX CM_CLKSTCTRL_*.AUTOSTATE_* register bit values */
438#define OMAP24XX_CLKSTCTRL_DISABLE_AUTO 0x0
439#define OMAP24XX_CLKSTCTRL_ENABLE_AUTO 0x1
440
441
439#endif 442#endif
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h
index 4f959a7d881c..b91275908f33 100644
--- a/arch/arm/mach-omap2/cm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-34xx.h
@@ -14,8 +14,6 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#include "cm.h"
18
19/* Bits shared between registers */ 17/* Bits shared between registers */
20 18
21/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */ 19/* CM_FCLKEN1_CORE and CM_ICLKEN1_CORE shared bits */
@@ -800,4 +798,15 @@
800#define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT 0 798#define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT 0
801#define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK (1 << 0) 799#define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK (1 << 0)
802 800
801/*
802 *
803 */
804
805/* OMAP3XXX CM_CLKSTCTRL_*.CLKTRCTRL_* register bit values */
806#define OMAP34XX_CLKSTCTRL_DISABLE_AUTO 0x0
807#define OMAP34XX_CLKSTCTRL_FORCE_SLEEP 0x1
808#define OMAP34XX_CLKSTCTRL_FORCE_WAKEUP 0x2
809#define OMAP34XX_CLKSTCTRL_ENABLE_AUTO 0x3
810
811
803#endif 812#endif
diff --git a/arch/arm/mach-omap2/cm-regbits-44xx.h b/arch/arm/mach-omap2/cm-regbits-44xx.h
index 0b72be433776..9d47a05b17b4 100644
--- a/arch/arm/mach-omap2/cm-regbits-44xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-44xx.h
@@ -22,9 +22,6 @@
22#ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H 22#ifndef __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
23#define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H 23#define __ARCH_ARM_MACH_OMAP2_CM_REGBITS_44XX_H
24 24
25#include "cm.h"
26
27
28/* 25/*
29 * Used by CM_L3_1_DYNAMICDEP, CM_L3_1_DYNAMICDEP_RESTORE, CM_MPU_DYNAMICDEP, 26 * Used by CM_L3_1_DYNAMICDEP, CM_L3_1_DYNAMICDEP_RESTORE, CM_MPU_DYNAMICDEP,
30 * CM_TESLA_DYNAMICDEP 27 * CM_TESLA_DYNAMICDEP
diff --git a/arch/arm/mach-omap2/cm.c b/arch/arm/mach-omap2/cm.c
deleted file mode 100644
index 721c3b66740a..000000000000
--- a/arch/arm/mach-omap2/cm.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * OMAP2/3 CM module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/delay.h>
16#include <linux/spinlock.h>
17#include <linux/list.h>
18#include <linux/errno.h>
19#include <linux/err.h>
20#include <linux/io.h>
21
22#include <asm/atomic.h>
23
24#include <plat/common.h>
25
26#include "cm.h"
27#include "cm-regbits-24xx.h"
28#include "cm-regbits-34xx.h"
29
30static const u8 cm_idlest_offs[] = {
31 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
32};
33
34/**
35 * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby
36 * @prcm_mod: PRCM module offset
37 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
38 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check
39 *
40 * XXX document
41 */
42int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
43{
44 int ena = 0, i = 0;
45 u8 cm_idlest_reg;
46 u32 mask;
47
48 if (!idlest_id || (idlest_id > ARRAY_SIZE(cm_idlest_offs)))
49 return -EINVAL;
50
51 cm_idlest_reg = cm_idlest_offs[idlest_id - 1];
52
53 mask = 1 << idlest_shift;
54
55 if (cpu_is_omap24xx())
56 ena = mask;
57 else if (cpu_is_omap34xx())
58 ena = 0;
59 else
60 BUG();
61
62 /* XXX should be OMAP2 CM */
63 omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
64 MAX_MODULE_READY_TIME, i);
65
66 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
67}
68
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h
index a02ca30423dc..a7bc096bd407 100644
--- a/arch/arm/mach-omap2/cm.h
+++ b/arch/arm/mach-omap2/cm.h
@@ -1,8 +1,5 @@
1#ifndef __ARCH_ASM_MACH_OMAP2_CM_H
2#define __ARCH_ASM_MACH_OMAP2_CM_H
3
4/* 1/*
5 * OMAP2/3 Clock Management (CM) register definitions 2 * OMAP2+ Clock Management prototypes
6 * 3 *
7 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
8 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2009 Nokia Corporation
@@ -13,136 +10,8 @@
13 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
15 */ 12 */
16 13#ifndef __ARCH_ASM_MACH_OMAP2_CM_H
17#include "prcm-common.h" 14#define __ARCH_ASM_MACH_OMAP2_CM_H
18
19#define OMAP2420_CM_REGADDR(module, reg) \
20 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
21#define OMAP2430_CM_REGADDR(module, reg) \
22 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
23#define OMAP34XX_CM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
25#define OMAP44XX_CM1_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (module) + (reg))
27#define OMAP44XX_CM2_REGADDR(module, reg) \
28 OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE + (module) + (reg))
29
30#include "cm44xx.h"
31
32/*
33 * Architecture-specific global CM registers
34 * Use cm_{read,write}_reg() with these registers.
35 * These registers appear once per CM module.
36 */
37
38#define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
39#define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
40#define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
41
42#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
43#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
44
45/*
46 * Module specific CM registers from CM_BASE + domain offset
47 * Use cm_{read,write}_mod_reg() with these registers.
48 * These register offsets generally appear in more than one PRCM submodule.
49 */
50
51/* Common between 24xx and 34xx */
52
53#define CM_FCLKEN 0x0000
54#define CM_FCLKEN1 CM_FCLKEN
55#define CM_CLKEN CM_FCLKEN
56#define CM_ICLKEN 0x0010
57#define CM_ICLKEN1 CM_ICLKEN
58#define CM_ICLKEN2 0x0014
59#define CM_ICLKEN3 0x0018
60#define CM_IDLEST 0x0020
61#define CM_IDLEST1 CM_IDLEST
62#define CM_IDLEST2 0x0024
63#define CM_AUTOIDLE 0x0030
64#define CM_AUTOIDLE1 CM_AUTOIDLE
65#define CM_AUTOIDLE2 0x0034
66#define CM_AUTOIDLE3 0x0038
67#define CM_CLKSEL 0x0040
68#define CM_CLKSEL1 CM_CLKSEL
69#define CM_CLKSEL2 0x0044
70#define OMAP2_CM_CLKSTCTRL 0x0048
71#define OMAP4_CM_CLKSTCTRL 0x0000
72
73
74/* Architecture-specific registers */
75
76#define OMAP24XX_CM_FCLKEN2 0x0004
77#define OMAP24XX_CM_ICLKEN4 0x001c
78#define OMAP24XX_CM_AUTOIDLE4 0x003c
79
80#define OMAP2430_CM_IDLEST3 0x0028
81
82#define OMAP3430_CM_CLKEN_PLL 0x0004
83#define OMAP3430ES2_CM_CLKEN2 0x0004
84#define OMAP3430ES2_CM_FCLKEN3 0x0008
85#define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
86#define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
87#define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
88#define OMAP3430_CM_CLKSEL1 CM_CLKSEL
89#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
90#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
91#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
92#define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
93#define OMAP3430_CM_CLKSTST 0x004c
94#define OMAP3430ES2_CM_CLKSEL4 0x004c
95#define OMAP3430ES2_CM_CLKSEL5 0x0050
96#define OMAP3430_CM_CLKSEL2_EMU 0x0050
97#define OMAP3430_CM_CLKSEL3_EMU 0x0054
98
99/* CM2.CEFUSE_CM2 register offsets */
100
101/* OMAP4 modulemode control */
102#define OMAP4430_MODULEMODE_HWCTRL 0
103#define OMAP4430_MODULEMODE_SWCTRL 1
104
105/* Clock management domain register get/set */
106
107#ifndef __ASSEMBLER__
108
109extern u32 cm_read_mod_reg(s16 module, u16 idx);
110extern void cm_write_mod_reg(u32 val, s16 module, u16 idx);
111extern u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
112
113extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id,
114 u8 idlest_shift);
115extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
116
117static inline u32 cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
118{
119 return cm_rmw_mod_reg_bits(bits, bits, module, idx);
120}
121
122static inline u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
123{
124 return cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
125}
126
127#endif
128
129/* CM register bits shared between 24XX and 3430 */
130
131/* CM_CLKSEL_GFX */
132#define OMAP_CLKSEL_GFX_SHIFT 0
133#define OMAP_CLKSEL_GFX_MASK (0x7 << 0)
134
135/* CM_ICLKEN_GFX */
136#define OMAP_EN_GFX_SHIFT 0
137#define OMAP_EN_GFX_MASK (1 << 0)
138
139/* CM_IDLEST_GFX */
140#define OMAP_ST_GFX_MASK (1 << 0)
141
142
143/* CM_IDLEST indicator */
144#define OMAP24XX_CM_IDLEST_VAL 0
145#define OMAP34XX_CM_IDLEST_VAL 1
146 15
147/* 16/*
148 * MAX_MODULE_READY_TIME: max duration in microseconds to wait for the 17 * MAX_MODULE_READY_TIME: max duration in microseconds to wait for the
diff --git a/arch/arm/mach-omap2/cm1_44xx.h b/arch/arm/mach-omap2/cm1_44xx.h
new file mode 100644
index 000000000000..e2d7a56b2ad6
--- /dev/null
+++ b/arch/arm/mach-omap2/cm1_44xx.h
@@ -0,0 +1,261 @@
1/*
2 * OMAP44xx CM1 instance offset macros
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 *
21 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
23 */
24
25#ifndef __ARCH_ARM_MACH_OMAP2_CM1_44XX_H
26#define __ARCH_ARM_MACH_OMAP2_CM1_44XX_H
27
28/* CM1 base address */
29#define OMAP4430_CM1_BASE 0x4a004000
30
31#define OMAP44XX_CM1_REGADDR(inst, reg) \
32 OMAP2_L4_IO_ADDRESS(OMAP4430_CM1_BASE + (inst) + (reg))
33
34/* CM1 instances */
35#define OMAP4430_CM1_OCP_SOCKET_INST 0x0000
36#define OMAP4430_CM1_CKGEN_INST 0x0100
37#define OMAP4430_CM1_MPU_INST 0x0300
38#define OMAP4430_CM1_TESLA_INST 0x0400
39#define OMAP4430_CM1_ABE_INST 0x0500
40#define OMAP4430_CM1_RESTORE_INST 0x0e00
41#define OMAP4430_CM1_INSTR_INST 0x0f00
42
43/* CM1 clockdomain register offsets (from instance start) */
44#define OMAP4430_CM1_ABE_ABE_CDOFFS 0x0000
45#define OMAP4430_CM1_MPU_MPU_CDOFFS 0x0000
46#define OMAP4430_CM1_TESLA_TESLA_CDOFFS 0x0000
47
48/* CM1 */
49
50/* CM1.OCP_SOCKET_CM1 register offsets */
51#define OMAP4_REVISION_CM1_OFFSET 0x0000
52#define OMAP4430_REVISION_CM1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_INST, 0x0000)
53#define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET 0x0040
54#define OMAP4430_CM_CM1_PROFILING_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_INST, 0x0040)
55
56/* CM1.CKGEN_CM1 register offsets */
57#define OMAP4_CM_CLKSEL_CORE_OFFSET 0x0000
58#define OMAP4430_CM_CLKSEL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0000)
59#define OMAP4_CM_CLKSEL_ABE_OFFSET 0x0008
60#define OMAP4430_CM_CLKSEL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0008)
61#define OMAP4_CM_DLL_CTRL_OFFSET 0x0010
62#define OMAP4430_CM_DLL_CTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0010)
63#define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET 0x0020
64#define OMAP4430_CM_CLKMODE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0020)
65#define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET 0x0024
66#define OMAP4430_CM_IDLEST_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0024)
67#define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET 0x0028
68#define OMAP4430_CM_AUTOIDLE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0028)
69#define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET 0x002c
70#define OMAP4430_CM_CLKSEL_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x002c)
71#define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET 0x0030
72#define OMAP4430_CM_DIV_M2_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0030)
73#define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET 0x0034
74#define OMAP4430_CM_DIV_M3_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0034)
75#define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET 0x0038
76#define OMAP4430_CM_DIV_M4_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0038)
77#define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET 0x003c
78#define OMAP4430_CM_DIV_M5_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x003c)
79#define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET 0x0040
80#define OMAP4430_CM_DIV_M6_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0040)
81#define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET 0x0044
82#define OMAP4430_CM_DIV_M7_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0044)
83#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET 0x0048
84#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0048)
85#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_CORE_OFFSET 0x004c
86#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x004c)
87#define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET 0x0050
88#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0050)
89#define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET 0x0060
90#define OMAP4430_CM_CLKMODE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0060)
91#define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET 0x0064
92#define OMAP4430_CM_IDLEST_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0064)
93#define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET 0x0068
94#define OMAP4430_CM_AUTOIDLE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0068)
95#define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET 0x006c
96#define OMAP4430_CM_CLKSEL_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x006c)
97#define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET 0x0070
98#define OMAP4430_CM_DIV_M2_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0070)
99#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET 0x0088
100#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0088)
101#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_MPU_OFFSET 0x008c
102#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x008c)
103#define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET 0x009c
104#define OMAP4430_CM_BYPCLK_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x009c)
105#define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET 0x00a0
106#define OMAP4430_CM_CLKMODE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a0)
107#define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET 0x00a4
108#define OMAP4430_CM_IDLEST_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a4)
109#define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET 0x00a8
110#define OMAP4430_CM_AUTOIDLE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00a8)
111#define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET 0x00ac
112#define OMAP4430_CM_CLKSEL_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00ac)
113#define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET 0x00b8
114#define OMAP4430_CM_DIV_M4_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00b8)
115#define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET 0x00bc
116#define OMAP4430_CM_DIV_M5_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00bc)
117#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET 0x00c8
118#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00c8)
119#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_IVA_OFFSET 0x00cc
120#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00cc)
121#define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET 0x00dc
122#define OMAP4430_CM_BYPCLK_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00dc)
123#define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET 0x00e0
124#define OMAP4430_CM_CLKMODE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e0)
125#define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET 0x00e4
126#define OMAP4430_CM_IDLEST_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e4)
127#define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET 0x00e8
128#define OMAP4430_CM_AUTOIDLE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00e8)
129#define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET 0x00ec
130#define OMAP4430_CM_CLKSEL_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00ec)
131#define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET 0x00f0
132#define OMAP4430_CM_DIV_M2_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00f0)
133#define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET 0x00f4
134#define OMAP4430_CM_DIV_M3_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x00f4)
135#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET 0x0108
136#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0108)
137#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_ABE_OFFSET 0x010c
138#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x010c)
139#define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET 0x0120
140#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0120)
141#define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET 0x0124
142#define OMAP4430_CM_IDLEST_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0124)
143#define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET 0x0128
144#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0128)
145#define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET 0x012c
146#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x012c)
147#define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET 0x0130
148#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0130)
149#define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET 0x0138
150#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0138)
151#define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET 0x013c
152#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x013c)
153#define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET 0x0140
154#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0140)
155#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET 0x0148
156#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0148)
157#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_DDRPHY_OFFSET 0x014c
158#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x014c)
159#define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET 0x0160
160#define OMAP4430_CM_SHADOW_FREQ_CONFIG1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0160)
161#define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET 0x0164
162#define OMAP4430_CM_SHADOW_FREQ_CONFIG2 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0164)
163#define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET 0x0170
164#define OMAP4430_CM_DYN_DEP_PRESCAL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0170)
165#define OMAP4_CM_RESTORE_ST_OFFSET 0x0180
166#define OMAP4430_CM_RESTORE_ST OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_INST, 0x0180)
167
168/* CM1.MPU_CM1 register offsets */
169#define OMAP4_CM_MPU_CLKSTCTRL_OFFSET 0x0000
170#define OMAP4430_CM_MPU_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0000)
171#define OMAP4_CM_MPU_STATICDEP_OFFSET 0x0004
172#define OMAP4430_CM_MPU_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0004)
173#define OMAP4_CM_MPU_DYNAMICDEP_OFFSET 0x0008
174#define OMAP4430_CM_MPU_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0008)
175#define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET 0x0020
176#define OMAP4430_CM_MPU_MPU_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_INST, 0x0020)
177
178/* CM1.TESLA_CM1 register offsets */
179#define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET 0x0000
180#define OMAP4430_CM_TESLA_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0000)
181#define OMAP4_CM_TESLA_STATICDEP_OFFSET 0x0004
182#define OMAP4430_CM_TESLA_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0004)
183#define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET 0x0008
184#define OMAP4430_CM_TESLA_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0008)
185#define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET 0x0020
186#define OMAP4430_CM_TESLA_TESLA_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_INST, 0x0020)
187
188/* CM1.ABE_CM1 register offsets */
189#define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET 0x0000
190#define OMAP4430_CM1_ABE_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0000)
191#define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET 0x0020
192#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0020)
193#define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET 0x0028
194#define OMAP4430_CM1_ABE_AESS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0028)
195#define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET 0x0030
196#define OMAP4430_CM1_ABE_PDM_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0030)
197#define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET 0x0038
198#define OMAP4430_CM1_ABE_DMIC_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0038)
199#define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET 0x0040
200#define OMAP4430_CM1_ABE_MCASP_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0040)
201#define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET 0x0048
202#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0048)
203#define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET 0x0050
204#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0050)
205#define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET 0x0058
206#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0058)
207#define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET 0x0060
208#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0060)
209#define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET 0x0068
210#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0068)
211#define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET 0x0070
212#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0070)
213#define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET 0x0078
214#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0078)
215#define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET 0x0080
216#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0080)
217#define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET 0x0088
218#define OMAP4430_CM1_ABE_WDT3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_INST, 0x0088)
219
220/* CM1.RESTORE_CM1 register offsets */
221#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET 0x0000
222#define OMAP4430_CM_CLKSEL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0000)
223#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET 0x0004
224#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0004)
225#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET 0x0008
226#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0008)
227#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET 0x000c
228#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x000c)
229#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET 0x0010
230#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0010)
231#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET 0x0014
232#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0014)
233#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET 0x0018
234#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0018)
235#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET 0x001c
236#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x001c)
237#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET 0x0020
238#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0020)
239#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_CORE_RESTORE_OFFSET 0x0024
240#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0024)
241#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET 0x0028
242#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0028)
243#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET 0x002c
244#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x002c)
245#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET 0x0030
246#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0030)
247#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET 0x0034
248#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0034)
249#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET 0x0038
250#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0038)
251#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET 0x003c
252#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x003c)
253#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET 0x0040
254#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_INST, 0x0040)
255
256/* Function prototypes */
257extern u32 omap4_cm1_read_inst_reg(s16 inst, u16 idx);
258extern void omap4_cm1_write_inst_reg(u32 val, s16 inst, u16 idx);
259extern u32 omap4_cm1_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
260
261#endif
diff --git a/arch/arm/mach-omap2/cm2_44xx.h b/arch/arm/mach-omap2/cm2_44xx.h
new file mode 100644
index 000000000000..aa4745044065
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2_44xx.h
@@ -0,0 +1,508 @@
1/*
2 * OMAP44xx CM2 instance offset macros
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 *
21 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
23 */
24
25#ifndef __ARCH_ARM_MACH_OMAP2_CM2_44XX_H
26#define __ARCH_ARM_MACH_OMAP2_CM2_44XX_H
27
28/* CM2 base address */
29#define OMAP4430_CM2_BASE 0x4a008000
30
31#define OMAP44XX_CM2_REGADDR(inst, reg) \
32 OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE + (inst) + (reg))
33
34/* CM2 instances */
35#define OMAP4430_CM2_OCP_SOCKET_INST 0x0000
36#define OMAP4430_CM2_CKGEN_INST 0x0100
37#define OMAP4430_CM2_ALWAYS_ON_INST 0x0600
38#define OMAP4430_CM2_CORE_INST 0x0700
39#define OMAP4430_CM2_IVAHD_INST 0x0f00
40#define OMAP4430_CM2_CAM_INST 0x1000
41#define OMAP4430_CM2_DSS_INST 0x1100
42#define OMAP4430_CM2_GFX_INST 0x1200
43#define OMAP4430_CM2_L3INIT_INST 0x1300
44#define OMAP4430_CM2_L4PER_INST 0x1400
45#define OMAP4430_CM2_CEFUSE_INST 0x1600
46#define OMAP4430_CM2_RESTORE_INST 0x1e00
47#define OMAP4430_CM2_INSTR_INST 0x1f00
48
49/* CM2 clockdomain register offsets (from instance start) */
50#define OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS 0x0000
51#define OMAP4430_CM2_CORE_L3_1_CDOFFS 0x0000
52#define OMAP4430_CM2_CORE_L3_2_CDOFFS 0x0100
53#define OMAP4430_CM2_CORE_DUCATI_CDOFFS 0x0200
54#define OMAP4430_CM2_CORE_SDMA_CDOFFS 0x0300
55#define OMAP4430_CM2_CORE_MEMIF_CDOFFS 0x0400
56#define OMAP4430_CM2_CORE_D2D_CDOFFS 0x0500
57#define OMAP4430_CM2_CORE_L4CFG_CDOFFS 0x0600
58#define OMAP4430_CM2_CORE_L3INSTR_CDOFFS 0x0700
59#define OMAP4430_CM2_IVAHD_IVAHD_CDOFFS 0x0000
60#define OMAP4430_CM2_CAM_CAM_CDOFFS 0x0000
61#define OMAP4430_CM2_DSS_DSS_CDOFFS 0x0000
62#define OMAP4430_CM2_GFX_GFX_CDOFFS 0x0000
63#define OMAP4430_CM2_L3INIT_L3INIT_CDOFFS 0x0000
64#define OMAP4430_CM2_L4PER_L4PER_CDOFFS 0x0000
65#define OMAP4430_CM2_L4PER_L4SEC_CDOFFS 0x0180
66#define OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS 0x0000
67
68
69/* CM2 */
70
71/* CM2.OCP_SOCKET_CM2 register offsets */
72#define OMAP4_REVISION_CM2_OFFSET 0x0000
73#define OMAP4430_REVISION_CM2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_INST, 0x0000)
74#define OMAP4_CM_CM2_PROFILING_CLKCTRL_OFFSET 0x0040
75#define OMAP4430_CM_CM2_PROFILING_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_INST, 0x0040)
76
77/* CM2.CKGEN_CM2 register offsets */
78#define OMAP4_CM_CLKSEL_DUCATI_ISS_ROOT_OFFSET 0x0000
79#define OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0000)
80#define OMAP4_CM_CLKSEL_USB_60MHZ_OFFSET 0x0004
81#define OMAP4430_CM_CLKSEL_USB_60MHZ OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0004)
82#define OMAP4_CM_SCALE_FCLK_OFFSET 0x0008
83#define OMAP4430_CM_SCALE_FCLK OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0008)
84#define OMAP4_CM_CORE_DVFS_PERF1_OFFSET 0x0010
85#define OMAP4430_CM_CORE_DVFS_PERF1 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0010)
86#define OMAP4_CM_CORE_DVFS_PERF2_OFFSET 0x0014
87#define OMAP4430_CM_CORE_DVFS_PERF2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0014)
88#define OMAP4_CM_CORE_DVFS_PERF3_OFFSET 0x0018
89#define OMAP4430_CM_CORE_DVFS_PERF3 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0018)
90#define OMAP4_CM_CORE_DVFS_PERF4_OFFSET 0x001c
91#define OMAP4430_CM_CORE_DVFS_PERF4 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x001c)
92#define OMAP4_CM_CORE_DVFS_CURRENT_OFFSET 0x0024
93#define OMAP4430_CM_CORE_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0024)
94#define OMAP4_CM_IVA_DVFS_PERF_TESLA_OFFSET 0x0028
95#define OMAP4430_CM_IVA_DVFS_PERF_TESLA OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0028)
96#define OMAP4_CM_IVA_DVFS_PERF_IVAHD_OFFSET 0x002c
97#define OMAP4430_CM_IVA_DVFS_PERF_IVAHD OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x002c)
98#define OMAP4_CM_IVA_DVFS_PERF_ABE_OFFSET 0x0030
99#define OMAP4430_CM_IVA_DVFS_PERF_ABE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0030)
100#define OMAP4_CM_IVA_DVFS_CURRENT_OFFSET 0x0038
101#define OMAP4430_CM_IVA_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0038)
102#define OMAP4_CM_CLKMODE_DPLL_PER_OFFSET 0x0040
103#define OMAP4430_CM_CLKMODE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0040)
104#define OMAP4_CM_IDLEST_DPLL_PER_OFFSET 0x0044
105#define OMAP4430_CM_IDLEST_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0044)
106#define OMAP4_CM_AUTOIDLE_DPLL_PER_OFFSET 0x0048
107#define OMAP4430_CM_AUTOIDLE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0048)
108#define OMAP4_CM_CLKSEL_DPLL_PER_OFFSET 0x004c
109#define OMAP4430_CM_CLKSEL_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x004c)
110#define OMAP4_CM_DIV_M2_DPLL_PER_OFFSET 0x0050
111#define OMAP4430_CM_DIV_M2_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0050)
112#define OMAP4_CM_DIV_M3_DPLL_PER_OFFSET 0x0054
113#define OMAP4430_CM_DIV_M3_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0054)
114#define OMAP4_CM_DIV_M4_DPLL_PER_OFFSET 0x0058
115#define OMAP4430_CM_DIV_M4_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0058)
116#define OMAP4_CM_DIV_M5_DPLL_PER_OFFSET 0x005c
117#define OMAP4430_CM_DIV_M5_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x005c)
118#define OMAP4_CM_DIV_M6_DPLL_PER_OFFSET 0x0060
119#define OMAP4430_CM_DIV_M6_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0060)
120#define OMAP4_CM_DIV_M7_DPLL_PER_OFFSET 0x0064
121#define OMAP4430_CM_DIV_M7_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0064)
122#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_PER_OFFSET 0x0068
123#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0068)
124#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_PER_OFFSET 0x006c
125#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x006c)
126#define OMAP4_CM_CLKMODE_DPLL_USB_OFFSET 0x0080
127#define OMAP4430_CM_CLKMODE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0080)
128#define OMAP4_CM_IDLEST_DPLL_USB_OFFSET 0x0084
129#define OMAP4430_CM_IDLEST_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0084)
130#define OMAP4_CM_AUTOIDLE_DPLL_USB_OFFSET 0x0088
131#define OMAP4430_CM_AUTOIDLE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0088)
132#define OMAP4_CM_CLKSEL_DPLL_USB_OFFSET 0x008c
133#define OMAP4430_CM_CLKSEL_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x008c)
134#define OMAP4_CM_DIV_M2_DPLL_USB_OFFSET 0x0090
135#define OMAP4430_CM_DIV_M2_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x0090)
136#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_USB_OFFSET 0x00a8
137#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00a8)
138#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_USB_OFFSET 0x00ac
139#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00ac)
140#define OMAP4_CM_CLKDCOLDO_DPLL_USB_OFFSET 0x00b4
141#define OMAP4430_CM_CLKDCOLDO_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00b4)
142#define OMAP4_CM_CLKMODE_DPLL_UNIPRO_OFFSET 0x00c0
143#define OMAP4430_CM_CLKMODE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00c0)
144#define OMAP4_CM_IDLEST_DPLL_UNIPRO_OFFSET 0x00c4
145#define OMAP4430_CM_IDLEST_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00c4)
146#define OMAP4_CM_AUTOIDLE_DPLL_UNIPRO_OFFSET 0x00c8
147#define OMAP4430_CM_AUTOIDLE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00c8)
148#define OMAP4_CM_CLKSEL_DPLL_UNIPRO_OFFSET 0x00cc
149#define OMAP4430_CM_CLKSEL_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00cc)
150#define OMAP4_CM_DIV_M2_DPLL_UNIPRO_OFFSET 0x00d0
151#define OMAP4430_CM_DIV_M2_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00d0)
152#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_UNIPRO_OFFSET 0x00e8
153#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00e8)
154#define OMAP4_CM_SSC_INSTFREQDIV_DPLL_UNIPRO_OFFSET 0x00ec
155#define OMAP4430_CM_SSC_INSTFREQDIV_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_INST, 0x00ec)
156
157/* CM2.ALWAYS_ON_CM2 register offsets */
158#define OMAP4_CM_ALWON_CLKSTCTRL_OFFSET 0x0000
159#define OMAP4430_CM_ALWON_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0000)
160#define OMAP4_CM_ALWON_MDMINTC_CLKCTRL_OFFSET 0x0020
161#define OMAP4430_CM_ALWON_MDMINTC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0020)
162#define OMAP4_CM_ALWON_SR_MPU_CLKCTRL_OFFSET 0x0028
163#define OMAP4430_CM_ALWON_SR_MPU_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0028)
164#define OMAP4_CM_ALWON_SR_IVA_CLKCTRL_OFFSET 0x0030
165#define OMAP4430_CM_ALWON_SR_IVA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0030)
166#define OMAP4_CM_ALWON_SR_CORE_CLKCTRL_OFFSET 0x0038
167#define OMAP4430_CM_ALWON_SR_CORE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0038)
168#define OMAP4_CM_ALWON_USBPHY_CLKCTRL_OFFSET 0x0040
169#define OMAP4430_CM_ALWON_USBPHY_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_INST, 0x0040)
170
171/* CM2.CORE_CM2 register offsets */
172#define OMAP4_CM_L3_1_CLKSTCTRL_OFFSET 0x0000
173#define OMAP4430_CM_L3_1_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0000)
174#define OMAP4_CM_L3_1_DYNAMICDEP_OFFSET 0x0008
175#define OMAP4430_CM_L3_1_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0008)
176#define OMAP4_CM_L3_1_L3_1_CLKCTRL_OFFSET 0x0020
177#define OMAP4430_CM_L3_1_L3_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0020)
178#define OMAP4_CM_L3_2_CLKSTCTRL_OFFSET 0x0100
179#define OMAP4430_CM_L3_2_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0100)
180#define OMAP4_CM_L3_2_DYNAMICDEP_OFFSET 0x0108
181#define OMAP4430_CM_L3_2_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0108)
182#define OMAP4_CM_L3_2_L3_2_CLKCTRL_OFFSET 0x0120
183#define OMAP4430_CM_L3_2_L3_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0120)
184#define OMAP4_CM_L3_2_GPMC_CLKCTRL_OFFSET 0x0128
185#define OMAP4430_CM_L3_2_GPMC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0128)
186#define OMAP4_CM_L3_2_OCMC_RAM_CLKCTRL_OFFSET 0x0130
187#define OMAP4430_CM_L3_2_OCMC_RAM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0130)
188#define OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET 0x0200
189#define OMAP4430_CM_DUCATI_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0200)
190#define OMAP4_CM_DUCATI_STATICDEP_OFFSET 0x0204
191#define OMAP4430_CM_DUCATI_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0204)
192#define OMAP4_CM_DUCATI_DYNAMICDEP_OFFSET 0x0208
193#define OMAP4430_CM_DUCATI_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0208)
194#define OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET 0x0220
195#define OMAP4430_CM_DUCATI_DUCATI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0220)
196#define OMAP4_CM_SDMA_CLKSTCTRL_OFFSET 0x0300
197#define OMAP4430_CM_SDMA_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0300)
198#define OMAP4_CM_SDMA_STATICDEP_OFFSET 0x0304
199#define OMAP4430_CM_SDMA_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0304)
200#define OMAP4_CM_SDMA_DYNAMICDEP_OFFSET 0x0308
201#define OMAP4430_CM_SDMA_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0308)
202#define OMAP4_CM_SDMA_SDMA_CLKCTRL_OFFSET 0x0320
203#define OMAP4430_CM_SDMA_SDMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0320)
204#define OMAP4_CM_MEMIF_CLKSTCTRL_OFFSET 0x0400
205#define OMAP4430_CM_MEMIF_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0400)
206#define OMAP4_CM_MEMIF_DMM_CLKCTRL_OFFSET 0x0420
207#define OMAP4430_CM_MEMIF_DMM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0420)
208#define OMAP4_CM_MEMIF_EMIF_FW_CLKCTRL_OFFSET 0x0428
209#define OMAP4430_CM_MEMIF_EMIF_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0428)
210#define OMAP4_CM_MEMIF_EMIF_1_CLKCTRL_OFFSET 0x0430
211#define OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0430)
212#define OMAP4_CM_MEMIF_EMIF_2_CLKCTRL_OFFSET 0x0438
213#define OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0438)
214#define OMAP4_CM_MEMIF_DLL_CLKCTRL_OFFSET 0x0440
215#define OMAP4430_CM_MEMIF_DLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0440)
216#define OMAP4_CM_MEMIF_EMIF_H1_CLKCTRL_OFFSET 0x0450
217#define OMAP4430_CM_MEMIF_EMIF_H1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0450)
218#define OMAP4_CM_MEMIF_EMIF_H2_CLKCTRL_OFFSET 0x0458
219#define OMAP4430_CM_MEMIF_EMIF_H2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0458)
220#define OMAP4_CM_MEMIF_DLL_H_CLKCTRL_OFFSET 0x0460
221#define OMAP4430_CM_MEMIF_DLL_H_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0460)
222#define OMAP4_CM_D2D_CLKSTCTRL_OFFSET 0x0500
223#define OMAP4430_CM_D2D_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0500)
224#define OMAP4_CM_D2D_STATICDEP_OFFSET 0x0504
225#define OMAP4430_CM_D2D_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0504)
226#define OMAP4_CM_D2D_DYNAMICDEP_OFFSET 0x0508
227#define OMAP4430_CM_D2D_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0508)
228#define OMAP4_CM_D2D_SAD2D_CLKCTRL_OFFSET 0x0520
229#define OMAP4430_CM_D2D_SAD2D_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0520)
230#define OMAP4_CM_D2D_INSTEM_ICR_CLKCTRL_OFFSET 0x0528
231#define OMAP4430_CM_D2D_INSTEM_ICR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0528)
232#define OMAP4_CM_D2D_SAD2D_FW_CLKCTRL_OFFSET 0x0530
233#define OMAP4430_CM_D2D_SAD2D_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0530)
234#define OMAP4_CM_L4CFG_CLKSTCTRL_OFFSET 0x0600
235#define OMAP4430_CM_L4CFG_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0600)
236#define OMAP4_CM_L4CFG_DYNAMICDEP_OFFSET 0x0608
237#define OMAP4430_CM_L4CFG_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0608)
238#define OMAP4_CM_L4CFG_L4_CFG_CLKCTRL_OFFSET 0x0620
239#define OMAP4430_CM_L4CFG_L4_CFG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0620)
240#define OMAP4_CM_L4CFG_HW_SEM_CLKCTRL_OFFSET 0x0628
241#define OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0628)
242#define OMAP4_CM_L4CFG_MAILBOX_CLKCTRL_OFFSET 0x0630
243#define OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0630)
244#define OMAP4_CM_L4CFG_SAR_ROM_CLKCTRL_OFFSET 0x0638
245#define OMAP4430_CM_L4CFG_SAR_ROM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0638)
246#define OMAP4_CM_L3INSTR_CLKSTCTRL_OFFSET 0x0700
247#define OMAP4430_CM_L3INSTR_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0700)
248#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_OFFSET 0x0720
249#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0720)
250#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_OFFSET 0x0728
251#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0728)
252#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_OFFSET 0x0740
253#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_INST, 0x0740)
254
255/* CM2.IVAHD_CM2 register offsets */
256#define OMAP4_CM_IVAHD_CLKSTCTRL_OFFSET 0x0000
257#define OMAP4430_CM_IVAHD_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0000)
258#define OMAP4_CM_IVAHD_STATICDEP_OFFSET 0x0004
259#define OMAP4430_CM_IVAHD_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0004)
260#define OMAP4_CM_IVAHD_DYNAMICDEP_OFFSET 0x0008
261#define OMAP4430_CM_IVAHD_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0008)
262#define OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET 0x0020
263#define OMAP4430_CM_IVAHD_IVAHD_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0020)
264#define OMAP4_CM_IVAHD_SL2_CLKCTRL_OFFSET 0x0028
265#define OMAP4430_CM_IVAHD_SL2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_INST, 0x0028)
266
267/* CM2.CAM_CM2 register offsets */
268#define OMAP4_CM_CAM_CLKSTCTRL_OFFSET 0x0000
269#define OMAP4430_CM_CAM_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0000)
270#define OMAP4_CM_CAM_STATICDEP_OFFSET 0x0004
271#define OMAP4430_CM_CAM_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0004)
272#define OMAP4_CM_CAM_DYNAMICDEP_OFFSET 0x0008
273#define OMAP4430_CM_CAM_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0008)
274#define OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET 0x0020
275#define OMAP4430_CM_CAM_ISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0020)
276#define OMAP4_CM_CAM_FDIF_CLKCTRL_OFFSET 0x0028
277#define OMAP4430_CM_CAM_FDIF_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_INST, 0x0028)
278
279/* CM2.DSS_CM2 register offsets */
280#define OMAP4_CM_DSS_CLKSTCTRL_OFFSET 0x0000
281#define OMAP4430_CM_DSS_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0000)
282#define OMAP4_CM_DSS_STATICDEP_OFFSET 0x0004
283#define OMAP4430_CM_DSS_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0004)
284#define OMAP4_CM_DSS_DYNAMICDEP_OFFSET 0x0008
285#define OMAP4430_CM_DSS_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0008)
286#define OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET 0x0020
287#define OMAP4430_CM_DSS_DSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0020)
288#define OMAP4_CM_DSS_DEISS_CLKCTRL_OFFSET 0x0028
289#define OMAP4430_CM_DSS_DEISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_INST, 0x0028)
290
291/* CM2.GFX_CM2 register offsets */
292#define OMAP4_CM_GFX_CLKSTCTRL_OFFSET 0x0000
293#define OMAP4430_CM_GFX_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0000)
294#define OMAP4_CM_GFX_STATICDEP_OFFSET 0x0004
295#define OMAP4430_CM_GFX_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0004)
296#define OMAP4_CM_GFX_DYNAMICDEP_OFFSET 0x0008
297#define OMAP4430_CM_GFX_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0008)
298#define OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET 0x0020
299#define OMAP4430_CM_GFX_GFX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_INST, 0x0020)
300
301/* CM2.L3INIT_CM2 register offsets */
302#define OMAP4_CM_L3INIT_CLKSTCTRL_OFFSET 0x0000
303#define OMAP4430_CM_L3INIT_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0000)
304#define OMAP4_CM_L3INIT_STATICDEP_OFFSET 0x0004
305#define OMAP4430_CM_L3INIT_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0004)
306#define OMAP4_CM_L3INIT_DYNAMICDEP_OFFSET 0x0008
307#define OMAP4430_CM_L3INIT_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0008)
308#define OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET 0x0028
309#define OMAP4430_CM_L3INIT_MMC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0028)
310#define OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET 0x0030
311#define OMAP4430_CM_L3INIT_MMC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0030)
312#define OMAP4_CM_L3INIT_HSI_CLKCTRL_OFFSET 0x0038
313#define OMAP4430_CM_L3INIT_HSI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0038)
314#define OMAP4_CM_L3INIT_UNIPRO1_CLKCTRL_OFFSET 0x0040
315#define OMAP4430_CM_L3INIT_UNIPRO1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0040)
316#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET 0x0058
317#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0058)
318#define OMAP4_CM_L3INIT_USB_OTG_CLKCTRL_OFFSET 0x0060
319#define OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0060)
320#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET 0x0068
321#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0068)
322#define OMAP4_CM_L3INIT_P1500_CLKCTRL_OFFSET 0x0078
323#define OMAP4430_CM_L3INIT_P1500_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0078)
324#define OMAP4_CM_L3INIT_EMAC_CLKCTRL_OFFSET 0x0080
325#define OMAP4430_CM_L3INIT_EMAC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0080)
326#define OMAP4_CM_L3INIT_SATA_CLKCTRL_OFFSET 0x0088
327#define OMAP4430_CM_L3INIT_SATA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0088)
328#define OMAP4_CM_L3INIT_TPPSS_CLKCTRL_OFFSET 0x0090
329#define OMAP4430_CM_L3INIT_TPPSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0090)
330#define OMAP4_CM_L3INIT_PCIESS_CLKCTRL_OFFSET 0x0098
331#define OMAP4430_CM_L3INIT_PCIESS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x0098)
332#define OMAP4_CM_L3INIT_CCPTX_CLKCTRL_OFFSET 0x00a8
333#define OMAP4430_CM_L3INIT_CCPTX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00a8)
334#define OMAP4_CM_L3INIT_XHPI_CLKCTRL_OFFSET 0x00c0
335#define OMAP4430_CM_L3INIT_XHPI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00c0)
336#define OMAP4_CM_L3INIT_MMC6_CLKCTRL_OFFSET 0x00c8
337#define OMAP4430_CM_L3INIT_MMC6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00c8)
338#define OMAP4_CM_L3INIT_USB_HOST_FS_CLKCTRL_OFFSET 0x00d0
339#define OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00d0)
340#define OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET 0x00e0
341#define OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_INST, 0x00e0)
342
343/* CM2.L4PER_CM2 register offsets */
344#define OMAP4_CM_L4PER_CLKSTCTRL_OFFSET 0x0000
345#define OMAP4430_CM_L4PER_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0000)
346#define OMAP4_CM_L4PER_DYNAMICDEP_OFFSET 0x0008
347#define OMAP4430_CM_L4PER_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0008)
348#define OMAP4_CM_L4PER_ADC_CLKCTRL_OFFSET 0x0020
349#define OMAP4430_CM_L4PER_ADC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0020)
350#define OMAP4_CM_L4PER_DMTIMER10_CLKCTRL_OFFSET 0x0028
351#define OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0028)
352#define OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET 0x0030
353#define OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0030)
354#define OMAP4_CM_L4PER_DMTIMER2_CLKCTRL_OFFSET 0x0038
355#define OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0038)
356#define OMAP4_CM_L4PER_DMTIMER3_CLKCTRL_OFFSET 0x0040
357#define OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0040)
358#define OMAP4_CM_L4PER_DMTIMER4_CLKCTRL_OFFSET 0x0048
359#define OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0048)
360#define OMAP4_CM_L4PER_DMTIMER9_CLKCTRL_OFFSET 0x0050
361#define OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0050)
362#define OMAP4_CM_L4PER_ELM_CLKCTRL_OFFSET 0x0058
363#define OMAP4430_CM_L4PER_ELM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0058)
364#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET 0x0060
365#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0060)
366#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET 0x0068
367#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0068)
368#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET 0x0070
369#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0070)
370#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET 0x0078
371#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0078)
372#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET 0x0080
373#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0080)
374#define OMAP4_CM_L4PER_HDQ1W_CLKCTRL_OFFSET 0x0088
375#define OMAP4430_CM_L4PER_HDQ1W_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0088)
376#define OMAP4_CM_L4PER_HECC1_CLKCTRL_OFFSET 0x0090
377#define OMAP4430_CM_L4PER_HECC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0090)
378#define OMAP4_CM_L4PER_HECC2_CLKCTRL_OFFSET 0x0098
379#define OMAP4430_CM_L4PER_HECC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0098)
380#define OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET 0x00a0
381#define OMAP4430_CM_L4PER_I2C1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00a0)
382#define OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET 0x00a8
383#define OMAP4430_CM_L4PER_I2C2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00a8)
384#define OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET 0x00b0
385#define OMAP4430_CM_L4PER_I2C3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00b0)
386#define OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET 0x00b8
387#define OMAP4430_CM_L4PER_I2C4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00b8)
388#define OMAP4_CM_L4PER_L4PER_CLKCTRL_OFFSET 0x00c0
389#define OMAP4430_CM_L4PER_L4PER_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00c0)
390#define OMAP4_CM_L4PER_MCASP2_CLKCTRL_OFFSET 0x00d0
391#define OMAP4430_CM_L4PER_MCASP2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00d0)
392#define OMAP4_CM_L4PER_MCASP3_CLKCTRL_OFFSET 0x00d8
393#define OMAP4430_CM_L4PER_MCASP3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00d8)
394#define OMAP4_CM_L4PER_MCBSP4_CLKCTRL_OFFSET 0x00e0
395#define OMAP4430_CM_L4PER_MCBSP4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00e0)
396#define OMAP4_CM_L4PER_MGATE_CLKCTRL_OFFSET 0x00e8
397#define OMAP4430_CM_L4PER_MGATE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00e8)
398#define OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET 0x00f0
399#define OMAP4430_CM_L4PER_MCSPI1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00f0)
400#define OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET 0x00f8
401#define OMAP4430_CM_L4PER_MCSPI2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x00f8)
402#define OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET 0x0100
403#define OMAP4430_CM_L4PER_MCSPI3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0100)
404#define OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET 0x0108
405#define OMAP4430_CM_L4PER_MCSPI4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0108)
406#define OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET 0x0120
407#define OMAP4430_CM_L4PER_MMCSD3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0120)
408#define OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET 0x0128
409#define OMAP4430_CM_L4PER_MMCSD4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0128)
410#define OMAP4_CM_L4PER_MSPROHG_CLKCTRL_OFFSET 0x0130
411#define OMAP4430_CM_L4PER_MSPROHG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0130)
412#define OMAP4_CM_L4PER_SLIMBUS2_CLKCTRL_OFFSET 0x0138
413#define OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0138)
414#define OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET 0x0140
415#define OMAP4430_CM_L4PER_UART1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0140)
416#define OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET 0x0148
417#define OMAP4430_CM_L4PER_UART2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0148)
418#define OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET 0x0150
419#define OMAP4430_CM_L4PER_UART3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0150)
420#define OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET 0x0158
421#define OMAP4430_CM_L4PER_UART4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0158)
422#define OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET 0x0160
423#define OMAP4430_CM_L4PER_MMCSD5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0160)
424#define OMAP4_CM_L4PER_I2C5_CLKCTRL_OFFSET 0x0168
425#define OMAP4430_CM_L4PER_I2C5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0168)
426#define OMAP4_CM_L4SEC_CLKSTCTRL_OFFSET 0x0180
427#define OMAP4430_CM_L4SEC_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0180)
428#define OMAP4_CM_L4SEC_STATICDEP_OFFSET 0x0184
429#define OMAP4430_CM_L4SEC_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0184)
430#define OMAP4_CM_L4SEC_DYNAMICDEP_OFFSET 0x0188
431#define OMAP4430_CM_L4SEC_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x0188)
432#define OMAP4_CM_L4SEC_AES1_CLKCTRL_OFFSET 0x01a0
433#define OMAP4430_CM_L4SEC_AES1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01a0)
434#define OMAP4_CM_L4SEC_AES2_CLKCTRL_OFFSET 0x01a8
435#define OMAP4430_CM_L4SEC_AES2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01a8)
436#define OMAP4_CM_L4SEC_DES3DES_CLKCTRL_OFFSET 0x01b0
437#define OMAP4430_CM_L4SEC_DES3DES_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01b0)
438#define OMAP4_CM_L4SEC_PKAEIP29_CLKCTRL_OFFSET 0x01b8
439#define OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01b8)
440#define OMAP4_CM_L4SEC_RNG_CLKCTRL_OFFSET 0x01c0
441#define OMAP4430_CM_L4SEC_RNG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01c0)
442#define OMAP4_CM_L4SEC_SHA2MD51_CLKCTRL_OFFSET 0x01c8
443#define OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01c8)
444#define OMAP4_CM_L4SEC_CRYPTODMA_CLKCTRL_OFFSET 0x01d8
445#define OMAP4430_CM_L4SEC_CRYPTODMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_INST, 0x01d8)
446
447/* CM2.CEFUSE_CM2 register offsets */
448#define OMAP4_CM_CEFUSE_CLKSTCTRL_OFFSET 0x0000
449#define OMAP4430_CM_CEFUSE_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_INST, 0x0000)
450#define OMAP4_CM_CEFUSE_CEFUSE_CLKCTRL_OFFSET 0x0020
451#define OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_INST, 0x0020)
452
453/* CM2.RESTORE_CM2 register offsets */
454#define OMAP4_CM_L3_1_CLKSTCTRL_RESTORE_OFFSET 0x0000
455#define OMAP4430_CM_L3_1_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0000)
456#define OMAP4_CM_L3_2_CLKSTCTRL_RESTORE_OFFSET 0x0004
457#define OMAP4430_CM_L3_2_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0004)
458#define OMAP4_CM_L4CFG_CLKSTCTRL_RESTORE_OFFSET 0x0008
459#define OMAP4430_CM_L4CFG_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0008)
460#define OMAP4_CM_MEMIF_CLKSTCTRL_RESTORE_OFFSET 0x000c
461#define OMAP4430_CM_MEMIF_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x000c)
462#define OMAP4_CM_L4PER_CLKSTCTRL_RESTORE_OFFSET 0x0010
463#define OMAP4430_CM_L4PER_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0010)
464#define OMAP4_CM_L3INIT_CLKSTCTRL_RESTORE_OFFSET 0x0014
465#define OMAP4430_CM_L3INIT_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0014)
466#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_RESTORE_OFFSET 0x0018
467#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0018)
468#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE_OFFSET 0x001c
469#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x001c)
470#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE_OFFSET 0x0020
471#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0020)
472#define OMAP4_CM_CM2_PROFILING_CLKCTRL_RESTORE_OFFSET 0x0024
473#define OMAP4430_CM_CM2_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0024)
474#define OMAP4_CM_D2D_STATICDEP_RESTORE_OFFSET 0x0028
475#define OMAP4430_CM_D2D_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0028)
476#define OMAP4_CM_L3_1_DYNAMICDEP_RESTORE_OFFSET 0x002c
477#define OMAP4430_CM_L3_1_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x002c)
478#define OMAP4_CM_L3_2_DYNAMICDEP_RESTORE_OFFSET 0x0030
479#define OMAP4430_CM_L3_2_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0030)
480#define OMAP4_CM_D2D_DYNAMICDEP_RESTORE_OFFSET 0x0034
481#define OMAP4430_CM_D2D_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0034)
482#define OMAP4_CM_L4CFG_DYNAMICDEP_RESTORE_OFFSET 0x0038
483#define OMAP4430_CM_L4CFG_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0038)
484#define OMAP4_CM_L4PER_DYNAMICDEP_RESTORE_OFFSET 0x003c
485#define OMAP4430_CM_L4PER_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x003c)
486#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_RESTORE_OFFSET 0x0040
487#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0040)
488#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_RESTORE_OFFSET 0x0044
489#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0044)
490#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_RESTORE_OFFSET 0x0048
491#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0048)
492#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_RESTORE_OFFSET 0x004c
493#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x004c)
494#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_RESTORE_OFFSET 0x0050
495#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0050)
496#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE_OFFSET 0x0054
497#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0054)
498#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE_OFFSET 0x0058
499#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x0058)
500#define OMAP4_CM_SDMA_STATICDEP_RESTORE_OFFSET 0x005c
501#define OMAP4430_CM_SDMA_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_INST, 0x005c)
502
503/* Function prototypes */
504extern u32 omap4_cm2_read_inst_reg(s16 inst, u16 idx);
505extern void omap4_cm2_write_inst_reg(u32 val, s16 inst, u16 idx);
506extern u32 omap4_cm2_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
507
508#endif
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
new file mode 100644
index 000000000000..96954aa48671
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -0,0 +1,471 @@
1/*
2 * OMAP2/3 CM module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/delay.h>
15#include <linux/spinlock.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/io.h>
20
21#include <plat/common.h>
22
23#include "cm.h"
24#include "cm2xxx_3xxx.h"
25#include "cm-regbits-24xx.h"
26#include "cm-regbits-34xx.h"
27
28static const u8 cm_idlest_offs[] = {
29 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
30};
31
32u32 omap2_cm_read_mod_reg(s16 module, u16 idx)
33{
34 return __raw_readl(cm_base + module + idx);
35}
36
37void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx)
38{
39 __raw_writel(val, cm_base + module + idx);
40}
41
42/* Read-modify-write a register in a CM module. Caller must lock */
43u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
44{
45 u32 v;
46
47 v = omap2_cm_read_mod_reg(module, idx);
48 v &= ~mask;
49 v |= bits;
50 omap2_cm_write_mod_reg(v, module, idx);
51
52 return v;
53}
54
55u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
56{
57 return omap2_cm_rmw_mod_reg_bits(bits, bits, module, idx);
58}
59
60u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
61{
62 return omap2_cm_rmw_mod_reg_bits(bits, 0x0, module, idx);
63}
64
65/*
66 *
67 */
68
69static void _write_clktrctrl(u8 c, s16 module, u32 mask)
70{
71 u32 v;
72
73 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL);
74 v &= ~mask;
75 v |= c << __ffs(mask);
76 omap2_cm_write_mod_reg(v, module, OMAP2_CM_CLKSTCTRL);
77}
78
79bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask)
80{
81 u32 v;
82 bool ret = 0;
83
84 BUG_ON(!cpu_is_omap24xx() && !cpu_is_omap34xx());
85
86 v = omap2_cm_read_mod_reg(module, OMAP2_CM_CLKSTCTRL);
87 v &= mask;
88 v >>= __ffs(mask);
89
90 if (cpu_is_omap24xx())
91 ret = (v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
92 else
93 ret = (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? 1 : 0;
94
95 return ret;
96}
97
98void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask)
99{
100 _write_clktrctrl(OMAP24XX_CLKSTCTRL_ENABLE_AUTO, module, mask);
101}
102
103void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask)
104{
105 _write_clktrctrl(OMAP24XX_CLKSTCTRL_DISABLE_AUTO, module, mask);
106}
107
108void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask)
109{
110 _write_clktrctrl(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, module, mask);
111}
112
113void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask)
114{
115 _write_clktrctrl(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, module, mask);
116}
117
118void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask)
119{
120 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, module, mask);
121}
122
123void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask)
124{
125 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask);
126}
127
128
129/*
130 *
131 */
132
133/**
134 * omap2_cm_wait_idlest_ready - wait for a module to leave idle or standby
135 * @prcm_mod: PRCM module offset
136 * @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
137 * @idlest_shift: shift of the bit in the CM_IDLEST* register to check
138 *
139 * XXX document
140 */
141int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
142{
143 int ena = 0, i = 0;
144 u8 cm_idlest_reg;
145 u32 mask;
146
147 if (!idlest_id || (idlest_id > ARRAY_SIZE(cm_idlest_offs)))
148 return -EINVAL;
149
150 cm_idlest_reg = cm_idlest_offs[idlest_id - 1];
151
152 mask = 1 << idlest_shift;
153
154 if (cpu_is_omap24xx())
155 ena = mask;
156 else if (cpu_is_omap34xx())
157 ena = 0;
158 else
159 BUG();
160
161 omap_test_timeout(((omap2_cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
162 MAX_MODULE_READY_TIME, i);
163
164 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
165}
166
167/*
168 * Context save/restore code - OMAP3 only
169 */
170#ifdef CONFIG_ARCH_OMAP3
171struct omap3_cm_regs {
172 u32 iva2_cm_clksel1;
173 u32 iva2_cm_clksel2;
174 u32 cm_sysconfig;
175 u32 sgx_cm_clksel;
176 u32 dss_cm_clksel;
177 u32 cam_cm_clksel;
178 u32 per_cm_clksel;
179 u32 emu_cm_clksel;
180 u32 emu_cm_clkstctrl;
181 u32 pll_cm_autoidle2;
182 u32 pll_cm_clksel4;
183 u32 pll_cm_clksel5;
184 u32 pll_cm_clken2;
185 u32 cm_polctrl;
186 u32 iva2_cm_fclken;
187 u32 iva2_cm_clken_pll;
188 u32 core_cm_fclken1;
189 u32 core_cm_fclken3;
190 u32 sgx_cm_fclken;
191 u32 wkup_cm_fclken;
192 u32 dss_cm_fclken;
193 u32 cam_cm_fclken;
194 u32 per_cm_fclken;
195 u32 usbhost_cm_fclken;
196 u32 core_cm_iclken1;
197 u32 core_cm_iclken2;
198 u32 core_cm_iclken3;
199 u32 sgx_cm_iclken;
200 u32 wkup_cm_iclken;
201 u32 dss_cm_iclken;
202 u32 cam_cm_iclken;
203 u32 per_cm_iclken;
204 u32 usbhost_cm_iclken;
205 u32 iva2_cm_autoidle2;
206 u32 mpu_cm_autoidle2;
207 u32 iva2_cm_clkstctrl;
208 u32 mpu_cm_clkstctrl;
209 u32 core_cm_clkstctrl;
210 u32 sgx_cm_clkstctrl;
211 u32 dss_cm_clkstctrl;
212 u32 cam_cm_clkstctrl;
213 u32 per_cm_clkstctrl;
214 u32 neon_cm_clkstctrl;
215 u32 usbhost_cm_clkstctrl;
216 u32 core_cm_autoidle1;
217 u32 core_cm_autoidle2;
218 u32 core_cm_autoidle3;
219 u32 wkup_cm_autoidle;
220 u32 dss_cm_autoidle;
221 u32 cam_cm_autoidle;
222 u32 per_cm_autoidle;
223 u32 usbhost_cm_autoidle;
224 u32 sgx_cm_sleepdep;
225 u32 dss_cm_sleepdep;
226 u32 cam_cm_sleepdep;
227 u32 per_cm_sleepdep;
228 u32 usbhost_cm_sleepdep;
229 u32 cm_clkout_ctrl;
230};
231
232static struct omap3_cm_regs cm_context;
233
234void omap3_cm_save_context(void)
235{
236 cm_context.iva2_cm_clksel1 =
237 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
238 cm_context.iva2_cm_clksel2 =
239 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL2);
240 cm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG);
241 cm_context.sgx_cm_clksel =
242 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL);
243 cm_context.dss_cm_clksel =
244 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL);
245 cm_context.cam_cm_clksel =
246 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSEL);
247 cm_context.per_cm_clksel =
248 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSEL);
249 cm_context.emu_cm_clksel =
250 omap2_cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
251 cm_context.emu_cm_clkstctrl =
252 omap2_cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL);
253 cm_context.pll_cm_autoidle2 =
254 omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
255 cm_context.pll_cm_clksel4 =
256 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4);
257 cm_context.pll_cm_clksel5 =
258 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5);
259 cm_context.pll_cm_clken2 =
260 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2);
261 cm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL);
262 cm_context.iva2_cm_fclken =
263 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_FCLKEN);
264 cm_context.iva2_cm_clken_pll =
265 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKEN_PLL);
266 cm_context.core_cm_fclken1 =
267 omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
268 cm_context.core_cm_fclken3 =
269 omap2_cm_read_mod_reg(CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
270 cm_context.sgx_cm_fclken =
271 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_FCLKEN);
272 cm_context.wkup_cm_fclken =
273 omap2_cm_read_mod_reg(WKUP_MOD, CM_FCLKEN);
274 cm_context.dss_cm_fclken =
275 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_FCLKEN);
276 cm_context.cam_cm_fclken =
277 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_FCLKEN);
278 cm_context.per_cm_fclken =
279 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_FCLKEN);
280 cm_context.usbhost_cm_fclken =
281 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
282 cm_context.core_cm_iclken1 =
283 omap2_cm_read_mod_reg(CORE_MOD, CM_ICLKEN1);
284 cm_context.core_cm_iclken2 =
285 omap2_cm_read_mod_reg(CORE_MOD, CM_ICLKEN2);
286 cm_context.core_cm_iclken3 =
287 omap2_cm_read_mod_reg(CORE_MOD, CM_ICLKEN3);
288 cm_context.sgx_cm_iclken =
289 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_ICLKEN);
290 cm_context.wkup_cm_iclken =
291 omap2_cm_read_mod_reg(WKUP_MOD, CM_ICLKEN);
292 cm_context.dss_cm_iclken =
293 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_ICLKEN);
294 cm_context.cam_cm_iclken =
295 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_ICLKEN);
296 cm_context.per_cm_iclken =
297 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_ICLKEN);
298 cm_context.usbhost_cm_iclken =
299 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
300 cm_context.iva2_cm_autoidle2 =
301 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
302 cm_context.mpu_cm_autoidle2 =
303 omap2_cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
304 cm_context.iva2_cm_clkstctrl =
305 omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
306 cm_context.mpu_cm_clkstctrl =
307 omap2_cm_read_mod_reg(MPU_MOD, OMAP2_CM_CLKSTCTRL);
308 cm_context.core_cm_clkstctrl =
309 omap2_cm_read_mod_reg(CORE_MOD, OMAP2_CM_CLKSTCTRL);
310 cm_context.sgx_cm_clkstctrl =
311 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD, OMAP2_CM_CLKSTCTRL);
312 cm_context.dss_cm_clkstctrl =
313 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP2_CM_CLKSTCTRL);
314 cm_context.cam_cm_clkstctrl =
315 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP2_CM_CLKSTCTRL);
316 cm_context.per_cm_clkstctrl =
317 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, OMAP2_CM_CLKSTCTRL);
318 cm_context.neon_cm_clkstctrl =
319 omap2_cm_read_mod_reg(OMAP3430_NEON_MOD, OMAP2_CM_CLKSTCTRL);
320 cm_context.usbhost_cm_clkstctrl =
321 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
322 OMAP2_CM_CLKSTCTRL);
323 cm_context.core_cm_autoidle1 =
324 omap2_cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1);
325 cm_context.core_cm_autoidle2 =
326 omap2_cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE2);
327 cm_context.core_cm_autoidle3 =
328 omap2_cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE3);
329 cm_context.wkup_cm_autoidle =
330 omap2_cm_read_mod_reg(WKUP_MOD, CM_AUTOIDLE);
331 cm_context.dss_cm_autoidle =
332 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, CM_AUTOIDLE);
333 cm_context.cam_cm_autoidle =
334 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, CM_AUTOIDLE);
335 cm_context.per_cm_autoidle =
336 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
337 cm_context.usbhost_cm_autoidle =
338 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
339 cm_context.sgx_cm_sleepdep =
340 omap2_cm_read_mod_reg(OMAP3430ES2_SGX_MOD,
341 OMAP3430_CM_SLEEPDEP);
342 cm_context.dss_cm_sleepdep =
343 omap2_cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP3430_CM_SLEEPDEP);
344 cm_context.cam_cm_sleepdep =
345 omap2_cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP3430_CM_SLEEPDEP);
346 cm_context.per_cm_sleepdep =
347 omap2_cm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_CM_SLEEPDEP);
348 cm_context.usbhost_cm_sleepdep =
349 omap2_cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
350 OMAP3430_CM_SLEEPDEP);
351 cm_context.cm_clkout_ctrl =
352 omap2_cm_read_mod_reg(OMAP3430_CCR_MOD,
353 OMAP3_CM_CLKOUT_CTRL_OFFSET);
354}
355
356void omap3_cm_restore_context(void)
357{
358 omap2_cm_write_mod_reg(cm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
359 CM_CLKSEL1);
360 omap2_cm_write_mod_reg(cm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,
361 CM_CLKSEL2);
362 __raw_writel(cm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG);
363 omap2_cm_write_mod_reg(cm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD,
364 CM_CLKSEL);
365 omap2_cm_write_mod_reg(cm_context.dss_cm_clksel, OMAP3430_DSS_MOD,
366 CM_CLKSEL);
367 omap2_cm_write_mod_reg(cm_context.cam_cm_clksel, OMAP3430_CAM_MOD,
368 CM_CLKSEL);
369 omap2_cm_write_mod_reg(cm_context.per_cm_clksel, OMAP3430_PER_MOD,
370 CM_CLKSEL);
371 omap2_cm_write_mod_reg(cm_context.emu_cm_clksel, OMAP3430_EMU_MOD,
372 CM_CLKSEL1);
373 omap2_cm_write_mod_reg(cm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
374 OMAP2_CM_CLKSTCTRL);
375 omap2_cm_write_mod_reg(cm_context.pll_cm_autoidle2, PLL_MOD,
376 CM_AUTOIDLE2);
377 omap2_cm_write_mod_reg(cm_context.pll_cm_clksel4, PLL_MOD,
378 OMAP3430ES2_CM_CLKSEL4);
379 omap2_cm_write_mod_reg(cm_context.pll_cm_clksel5, PLL_MOD,
380 OMAP3430ES2_CM_CLKSEL5);
381 omap2_cm_write_mod_reg(cm_context.pll_cm_clken2, PLL_MOD,
382 OMAP3430ES2_CM_CLKEN2);
383 __raw_writel(cm_context.cm_polctrl, OMAP3430_CM_POLCTRL);
384 omap2_cm_write_mod_reg(cm_context.iva2_cm_fclken, OMAP3430_IVA2_MOD,
385 CM_FCLKEN);
386 omap2_cm_write_mod_reg(cm_context.iva2_cm_clken_pll, OMAP3430_IVA2_MOD,
387 OMAP3430_CM_CLKEN_PLL);
388 omap2_cm_write_mod_reg(cm_context.core_cm_fclken1, CORE_MOD,
389 CM_FCLKEN1);
390 omap2_cm_write_mod_reg(cm_context.core_cm_fclken3, CORE_MOD,
391 OMAP3430ES2_CM_FCLKEN3);
392 omap2_cm_write_mod_reg(cm_context.sgx_cm_fclken, OMAP3430ES2_SGX_MOD,
393 CM_FCLKEN);
394 omap2_cm_write_mod_reg(cm_context.wkup_cm_fclken, WKUP_MOD, CM_FCLKEN);
395 omap2_cm_write_mod_reg(cm_context.dss_cm_fclken, OMAP3430_DSS_MOD,
396 CM_FCLKEN);
397 omap2_cm_write_mod_reg(cm_context.cam_cm_fclken, OMAP3430_CAM_MOD,
398 CM_FCLKEN);
399 omap2_cm_write_mod_reg(cm_context.per_cm_fclken, OMAP3430_PER_MOD,
400 CM_FCLKEN);
401 omap2_cm_write_mod_reg(cm_context.usbhost_cm_fclken,
402 OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
403 omap2_cm_write_mod_reg(cm_context.core_cm_iclken1, CORE_MOD,
404 CM_ICLKEN1);
405 omap2_cm_write_mod_reg(cm_context.core_cm_iclken2, CORE_MOD,
406 CM_ICLKEN2);
407 omap2_cm_write_mod_reg(cm_context.core_cm_iclken3, CORE_MOD,
408 CM_ICLKEN3);
409 omap2_cm_write_mod_reg(cm_context.sgx_cm_iclken, OMAP3430ES2_SGX_MOD,
410 CM_ICLKEN);
411 omap2_cm_write_mod_reg(cm_context.wkup_cm_iclken, WKUP_MOD, CM_ICLKEN);
412 omap2_cm_write_mod_reg(cm_context.dss_cm_iclken, OMAP3430_DSS_MOD,
413 CM_ICLKEN);
414 omap2_cm_write_mod_reg(cm_context.cam_cm_iclken, OMAP3430_CAM_MOD,
415 CM_ICLKEN);
416 omap2_cm_write_mod_reg(cm_context.per_cm_iclken, OMAP3430_PER_MOD,
417 CM_ICLKEN);
418 omap2_cm_write_mod_reg(cm_context.usbhost_cm_iclken,
419 OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
420 omap2_cm_write_mod_reg(cm_context.iva2_cm_autoidle2, OMAP3430_IVA2_MOD,
421 CM_AUTOIDLE2);
422 omap2_cm_write_mod_reg(cm_context.mpu_cm_autoidle2, MPU_MOD,
423 CM_AUTOIDLE2);
424 omap2_cm_write_mod_reg(cm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
425 OMAP2_CM_CLKSTCTRL);
426 omap2_cm_write_mod_reg(cm_context.mpu_cm_clkstctrl, MPU_MOD,
427 OMAP2_CM_CLKSTCTRL);
428 omap2_cm_write_mod_reg(cm_context.core_cm_clkstctrl, CORE_MOD,
429 OMAP2_CM_CLKSTCTRL);
430 omap2_cm_write_mod_reg(cm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD,
431 OMAP2_CM_CLKSTCTRL);
432 omap2_cm_write_mod_reg(cm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD,
433 OMAP2_CM_CLKSTCTRL);
434 omap2_cm_write_mod_reg(cm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD,
435 OMAP2_CM_CLKSTCTRL);
436 omap2_cm_write_mod_reg(cm_context.per_cm_clkstctrl, OMAP3430_PER_MOD,
437 OMAP2_CM_CLKSTCTRL);
438 omap2_cm_write_mod_reg(cm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD,
439 OMAP2_CM_CLKSTCTRL);
440 omap2_cm_write_mod_reg(cm_context.usbhost_cm_clkstctrl,
441 OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL);
442 omap2_cm_write_mod_reg(cm_context.core_cm_autoidle1, CORE_MOD,
443 CM_AUTOIDLE1);
444 omap2_cm_write_mod_reg(cm_context.core_cm_autoidle2, CORE_MOD,
445 CM_AUTOIDLE2);
446 omap2_cm_write_mod_reg(cm_context.core_cm_autoidle3, CORE_MOD,
447 CM_AUTOIDLE3);
448 omap2_cm_write_mod_reg(cm_context.wkup_cm_autoidle, WKUP_MOD,
449 CM_AUTOIDLE);
450 omap2_cm_write_mod_reg(cm_context.dss_cm_autoidle, OMAP3430_DSS_MOD,
451 CM_AUTOIDLE);
452 omap2_cm_write_mod_reg(cm_context.cam_cm_autoidle, OMAP3430_CAM_MOD,
453 CM_AUTOIDLE);
454 omap2_cm_write_mod_reg(cm_context.per_cm_autoidle, OMAP3430_PER_MOD,
455 CM_AUTOIDLE);
456 omap2_cm_write_mod_reg(cm_context.usbhost_cm_autoidle,
457 OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
458 omap2_cm_write_mod_reg(cm_context.sgx_cm_sleepdep, OMAP3430ES2_SGX_MOD,
459 OMAP3430_CM_SLEEPDEP);
460 omap2_cm_write_mod_reg(cm_context.dss_cm_sleepdep, OMAP3430_DSS_MOD,
461 OMAP3430_CM_SLEEPDEP);
462 omap2_cm_write_mod_reg(cm_context.cam_cm_sleepdep, OMAP3430_CAM_MOD,
463 OMAP3430_CM_SLEEPDEP);
464 omap2_cm_write_mod_reg(cm_context.per_cm_sleepdep, OMAP3430_PER_MOD,
465 OMAP3430_CM_SLEEPDEP);
466 omap2_cm_write_mod_reg(cm_context.usbhost_cm_sleepdep,
467 OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
468 omap2_cm_write_mod_reg(cm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD,
469 OMAP3_CM_CLKOUT_CTRL_OFFSET);
470}
471#endif
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
new file mode 100644
index 000000000000..5e9ea5bd60b9
--- /dev/null
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -0,0 +1,147 @@
1/*
2 * OMAP2/3 Clock Management (CM) register definitions
3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation
6 * Paul Walmsley
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * The CM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The CM modules/instances on OMAP4 are quite different, so
14 * they are handled in a separate file.
15 */
16#ifndef __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
17#define __ARCH_ASM_MACH_OMAP2_CM2XXX_3XXX_H
18
19#include "prcm-common.h"
20
21#define OMAP2420_CM_REGADDR(module, reg) \
22 OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
23#define OMAP2430_CM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE + (module) + (reg))
25#define OMAP34XX_CM_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE + (module) + (reg))
27
28
29/*
30 * OMAP3-specific global CM registers
31 * Use cm_{read,write}_reg() with these registers.
32 * These registers appear once per CM module.
33 */
34
35#define OMAP3430_CM_REVISION OMAP34XX_CM_REGADDR(OCP_MOD, 0x0000)
36#define OMAP3430_CM_SYSCONFIG OMAP34XX_CM_REGADDR(OCP_MOD, 0x0010)
37#define OMAP3430_CM_POLCTRL OMAP34XX_CM_REGADDR(OCP_MOD, 0x009c)
38
39#define OMAP3_CM_CLKOUT_CTRL_OFFSET 0x0070
40#define OMAP3430_CM_CLKOUT_CTRL OMAP_CM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
41
42/*
43 * Module specific CM register offsets from CM_BASE + domain offset
44 * Use cm_{read,write}_mod_reg() with these registers.
45 * These register offsets generally appear in more than one PRCM submodule.
46 */
47
48/* Common between OMAP2 and OMAP3 */
49
50#define CM_FCLKEN 0x0000
51#define CM_FCLKEN1 CM_FCLKEN
52#define CM_CLKEN CM_FCLKEN
53#define CM_ICLKEN 0x0010
54#define CM_ICLKEN1 CM_ICLKEN
55#define CM_ICLKEN2 0x0014
56#define CM_ICLKEN3 0x0018
57#define CM_IDLEST 0x0020
58#define CM_IDLEST1 CM_IDLEST
59#define CM_IDLEST2 0x0024
60#define CM_AUTOIDLE 0x0030
61#define CM_AUTOIDLE1 CM_AUTOIDLE
62#define CM_AUTOIDLE2 0x0034
63#define CM_AUTOIDLE3 0x0038
64#define CM_CLKSEL 0x0040
65#define CM_CLKSEL1 CM_CLKSEL
66#define CM_CLKSEL2 0x0044
67#define OMAP2_CM_CLKSTCTRL 0x0048
68
69/* OMAP2-specific register offsets */
70
71#define OMAP24XX_CM_FCLKEN2 0x0004
72#define OMAP24XX_CM_ICLKEN4 0x001c
73#define OMAP24XX_CM_AUTOIDLE4 0x003c
74
75#define OMAP2430_CM_IDLEST3 0x0028
76
77/* OMAP3-specific register offsets */
78
79#define OMAP3430_CM_CLKEN_PLL 0x0004
80#define OMAP3430ES2_CM_CLKEN2 0x0004
81#define OMAP3430ES2_CM_FCLKEN3 0x0008
82#define OMAP3430_CM_IDLEST_PLL CM_IDLEST2
83#define OMAP3430_CM_AUTOIDLE_PLL CM_AUTOIDLE2
84#define OMAP3430ES2_CM_AUTOIDLE2_PLL CM_AUTOIDLE2
85#define OMAP3430_CM_CLKSEL1 CM_CLKSEL
86#define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL
87#define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2
88#define OMAP3430_CM_SLEEPDEP CM_CLKSEL2
89#define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL
90#define OMAP3430_CM_CLKSTST 0x004c
91#define OMAP3430ES2_CM_CLKSEL4 0x004c
92#define OMAP3430ES2_CM_CLKSEL5 0x0050
93#define OMAP3430_CM_CLKSEL2_EMU 0x0050
94#define OMAP3430_CM_CLKSEL3_EMU 0x0054
95
96
97/* CM_IDLEST bit field values to indicate deasserted IdleReq */
98
99#define OMAP24XX_CM_IDLEST_VAL 0
100#define OMAP34XX_CM_IDLEST_VAL 1
101
102
103/* Clock management domain register get/set */
104
105#ifndef __ASSEMBLER__
106
107extern u32 omap2_cm_read_mod_reg(s16 module, u16 idx);
108extern void omap2_cm_write_mod_reg(u32 val, s16 module, u16 idx);
109extern u32 omap2_cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
110
111extern int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id,
112 u8 idlest_shift);
113extern u32 omap2_cm_set_mod_reg_bits(u32 bits, s16 module, s16 idx);
114extern u32 omap2_cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx);
115
116extern bool omap2_cm_is_clkdm_in_hwsup(s16 module, u32 mask);
117extern void omap2xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask);
118extern void omap2xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
119
120extern void omap3xxx_cm_clkdm_enable_hwsup(s16 module, u32 mask);
121extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
122extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
123extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
124
125#endif
126
127/* CM register bits shared between 24XX and 3430 */
128
129/* CM_CLKSEL_GFX */
130#define OMAP_CLKSEL_GFX_SHIFT 0
131#define OMAP_CLKSEL_GFX_MASK (0x7 << 0)
132
133/* CM_ICLKEN_GFX */
134#define OMAP_EN_GFX_SHIFT 0
135#define OMAP_EN_GFX_MASK (1 << 0)
136
137/* CM_IDLEST_GFX */
138#define OMAP_ST_GFX_MASK (1 << 0)
139
140
141/* Function prototypes */
142# ifndef __ASSEMBLER__
143extern void omap3_cm_save_context(void);
144extern void omap3_cm_restore_context(void);
145# endif
146
147#endif
diff --git a/arch/arm/mach-omap2/cm44xx.c b/arch/arm/mach-omap2/cm44xx.c
new file mode 100644
index 000000000000..e96f53ea01a1
--- /dev/null
+++ b/arch/arm/mach-omap2/cm44xx.c
@@ -0,0 +1,52 @@
1/*
2 * OMAP4 CM1, CM2 module low-level functions
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * These functions are intended to be used only by the cminst44xx.c file.
12 * XXX Perhaps we should just move them there and make them static.
13 */
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/io.h>
20
21#include <plat/common.h>
22
23#include "cm.h"
24#include "cm1_44xx.h"
25#include "cm2_44xx.h"
26#include "cm-regbits-44xx.h"
27
28/* CM1 hardware module low-level functions */
29
30/* Read a register in CM1 */
31u32 omap4_cm1_read_inst_reg(s16 inst, u16 reg)
32{
33 return __raw_readl(OMAP44XX_CM1_REGADDR(inst, reg));
34}
35
36/* Write into a register in CM1 */
37void omap4_cm1_write_inst_reg(u32 val, s16 inst, u16 reg)
38{
39 __raw_writel(val, OMAP44XX_CM1_REGADDR(inst, reg));
40}
41
42/* Read a register in CM2 */
43u32 omap4_cm2_read_inst_reg(s16 inst, u16 reg)
44{
45 return __raw_readl(OMAP44XX_CM2_REGADDR(inst, reg));
46}
47
48/* Write into a register in CM2 */
49void omap4_cm2_write_inst_reg(u32 val, s16 inst, u16 reg)
50{
51 __raw_writel(val, OMAP44XX_CM2_REGADDR(inst, reg));
52}
diff --git a/arch/arm/mach-omap2/cm44xx.h b/arch/arm/mach-omap2/cm44xx.h
index 3c35a87cb90c..48fc3f426fbd 100644
--- a/arch/arm/mach-omap2/cm44xx.h
+++ b/arch/arm/mach-omap2/cm44xx.h
@@ -1,667 +1,31 @@
1/* 1/*
2 * OMAP44xx CM1 & CM2 instance offset macros 2 * OMAP4 Clock Management (CM) definitions
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation 5 * Copyright (C) 2007-2009 Nokia Corporation
6 * 6 *
7 * Paul Walmsley (paul@pwsan.com) 7 * Written by Paul Walmsley
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
16 * 8 *
17 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * OMAP4 has two separate CM blocks, CM1 and CM2. This file contains
14 * macros and function prototypes that are applicable to both.
20 */ 15 */
16#ifndef __ARCH_ASM_MACH_OMAP2_CM44XX_H
17#define __ARCH_ASM_MACH_OMAP2_CM44XX_H
21 18
22#ifndef __ARCH_ARM_MACH_OMAP2_CM44XX_H
23#define __ARCH_ARM_MACH_OMAP2_CM44XX_H
24
25
26/* CM1 */
27
28/* CM1.OCP_SOCKET_CM1 register offsets */
29#define OMAP4_REVISION_CM1_OFFSET 0x0000
30#define OMAP4430_REVISION_CM1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0000)
31#define OMAP4_CM_CM1_PROFILING_CLKCTRL_OFFSET 0x0040
32#define OMAP4430_CM_CM1_PROFILING_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_OCP_SOCKET_MOD, 0x0040)
33
34/* CM1.CKGEN_CM1 register offsets */
35#define OMAP4_CM_CLKSEL_CORE_OFFSET 0x0000
36#define OMAP4430_CM_CLKSEL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0000)
37#define OMAP4_CM_CLKSEL_ABE_OFFSET 0x0008
38#define OMAP4430_CM_CLKSEL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0008)
39#define OMAP4_CM_DLL_CTRL_OFFSET 0x0010
40#define OMAP4430_CM_DLL_CTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0010)
41#define OMAP4_CM_CLKMODE_DPLL_CORE_OFFSET 0x0020
42#define OMAP4430_CM_CLKMODE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0020)
43#define OMAP4_CM_IDLEST_DPLL_CORE_OFFSET 0x0024
44#define OMAP4430_CM_IDLEST_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0024)
45#define OMAP4_CM_AUTOIDLE_DPLL_CORE_OFFSET 0x0028
46#define OMAP4430_CM_AUTOIDLE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0028)
47#define OMAP4_CM_CLKSEL_DPLL_CORE_OFFSET 0x002c
48#define OMAP4430_CM_CLKSEL_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x002c)
49#define OMAP4_CM_DIV_M2_DPLL_CORE_OFFSET 0x0030
50#define OMAP4430_CM_DIV_M2_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0030)
51#define OMAP4_CM_DIV_M3_DPLL_CORE_OFFSET 0x0034
52#define OMAP4430_CM_DIV_M3_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0034)
53#define OMAP4_CM_DIV_M4_DPLL_CORE_OFFSET 0x0038
54#define OMAP4430_CM_DIV_M4_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0038)
55#define OMAP4_CM_DIV_M5_DPLL_CORE_OFFSET 0x003c
56#define OMAP4430_CM_DIV_M5_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x003c)
57#define OMAP4_CM_DIV_M6_DPLL_CORE_OFFSET 0x0040
58#define OMAP4430_CM_DIV_M6_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0040)
59#define OMAP4_CM_DIV_M7_DPLL_CORE_OFFSET 0x0044
60#define OMAP4430_CM_DIV_M7_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0044)
61#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_OFFSET 0x0048
62#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0048)
63#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_OFFSET 0x004c
64#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x004c)
65#define OMAP4_CM_EMU_OVERRIDE_DPLL_CORE_OFFSET 0x0050
66#define OMAP4430_CM_EMU_OVERRIDE_DPLL_CORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0050)
67#define OMAP4_CM_CLKMODE_DPLL_MPU_OFFSET 0x0060
68#define OMAP4430_CM_CLKMODE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0060)
69#define OMAP4_CM_IDLEST_DPLL_MPU_OFFSET 0x0064
70#define OMAP4430_CM_IDLEST_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0064)
71#define OMAP4_CM_AUTOIDLE_DPLL_MPU_OFFSET 0x0068
72#define OMAP4430_CM_AUTOIDLE_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0068)
73#define OMAP4_CM_CLKSEL_DPLL_MPU_OFFSET 0x006c
74#define OMAP4430_CM_CLKSEL_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x006c)
75#define OMAP4_CM_DIV_M2_DPLL_MPU_OFFSET 0x0070
76#define OMAP4430_CM_DIV_M2_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0070)
77#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_MPU_OFFSET 0x0088
78#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0088)
79#define OMAP4_CM_SSC_MODFREQDIV_DPLL_MPU_OFFSET 0x008c
80#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x008c)
81#define OMAP4_CM_BYPCLK_DPLL_MPU_OFFSET 0x009c
82#define OMAP4430_CM_BYPCLK_DPLL_MPU OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x009c)
83#define OMAP4_CM_CLKMODE_DPLL_IVA_OFFSET 0x00a0
84#define OMAP4430_CM_CLKMODE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a0)
85#define OMAP4_CM_IDLEST_DPLL_IVA_OFFSET 0x00a4
86#define OMAP4430_CM_IDLEST_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a4)
87#define OMAP4_CM_AUTOIDLE_DPLL_IVA_OFFSET 0x00a8
88#define OMAP4430_CM_AUTOIDLE_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00a8)
89#define OMAP4_CM_CLKSEL_DPLL_IVA_OFFSET 0x00ac
90#define OMAP4430_CM_CLKSEL_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ac)
91#define OMAP4_CM_DIV_M4_DPLL_IVA_OFFSET 0x00b8
92#define OMAP4430_CM_DIV_M4_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00b8)
93#define OMAP4_CM_DIV_M5_DPLL_IVA_OFFSET 0x00bc
94#define OMAP4430_CM_DIV_M5_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00bc)
95#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_IVA_OFFSET 0x00c8
96#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00c8)
97#define OMAP4_CM_SSC_MODFREQDIV_DPLL_IVA_OFFSET 0x00cc
98#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00cc)
99#define OMAP4_CM_BYPCLK_DPLL_IVA_OFFSET 0x00dc
100#define OMAP4430_CM_BYPCLK_DPLL_IVA OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00dc)
101#define OMAP4_CM_CLKMODE_DPLL_ABE_OFFSET 0x00e0
102#define OMAP4430_CM_CLKMODE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e0)
103#define OMAP4_CM_IDLEST_DPLL_ABE_OFFSET 0x00e4
104#define OMAP4430_CM_IDLEST_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e4)
105#define OMAP4_CM_AUTOIDLE_DPLL_ABE_OFFSET 0x00e8
106#define OMAP4430_CM_AUTOIDLE_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00e8)
107#define OMAP4_CM_CLKSEL_DPLL_ABE_OFFSET 0x00ec
108#define OMAP4430_CM_CLKSEL_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00ec)
109#define OMAP4_CM_DIV_M2_DPLL_ABE_OFFSET 0x00f0
110#define OMAP4430_CM_DIV_M2_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f0)
111#define OMAP4_CM_DIV_M3_DPLL_ABE_OFFSET 0x00f4
112#define OMAP4430_CM_DIV_M3_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x00f4)
113#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_ABE_OFFSET 0x0108
114#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0108)
115#define OMAP4_CM_SSC_MODFREQDIV_DPLL_ABE_OFFSET 0x010c
116#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_ABE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x010c)
117#define OMAP4_CM_CLKMODE_DPLL_DDRPHY_OFFSET 0x0120
118#define OMAP4430_CM_CLKMODE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0120)
119#define OMAP4_CM_IDLEST_DPLL_DDRPHY_OFFSET 0x0124
120#define OMAP4430_CM_IDLEST_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0124)
121#define OMAP4_CM_AUTOIDLE_DPLL_DDRPHY_OFFSET 0x0128
122#define OMAP4430_CM_AUTOIDLE_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0128)
123#define OMAP4_CM_CLKSEL_DPLL_DDRPHY_OFFSET 0x012c
124#define OMAP4430_CM_CLKSEL_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x012c)
125#define OMAP4_CM_DIV_M2_DPLL_DDRPHY_OFFSET 0x0130
126#define OMAP4430_CM_DIV_M2_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0130)
127#define OMAP4_CM_DIV_M4_DPLL_DDRPHY_OFFSET 0x0138
128#define OMAP4430_CM_DIV_M4_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0138)
129#define OMAP4_CM_DIV_M5_DPLL_DDRPHY_OFFSET 0x013c
130#define OMAP4430_CM_DIV_M5_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x013c)
131#define OMAP4_CM_DIV_M6_DPLL_DDRPHY_OFFSET 0x0140
132#define OMAP4430_CM_DIV_M6_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0140)
133#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_DDRPHY_OFFSET 0x0148
134#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0148)
135#define OMAP4_CM_SSC_MODFREQDIV_DPLL_DDRPHY_OFFSET 0x014c
136#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_DDRPHY OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x014c)
137#define OMAP4_CM_SHADOW_FREQ_CONFIG1_OFFSET 0x0160
138#define OMAP4430_CM_SHADOW_FREQ_CONFIG1 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0160)
139#define OMAP4_CM_SHADOW_FREQ_CONFIG2_OFFSET 0x0164
140#define OMAP4430_CM_SHADOW_FREQ_CONFIG2 OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0164)
141#define OMAP4_CM_DYN_DEP_PRESCAL_OFFSET 0x0170
142#define OMAP4430_CM_DYN_DEP_PRESCAL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0170)
143#define OMAP4_CM_RESTORE_ST_OFFSET 0x0180
144#define OMAP4430_CM_RESTORE_ST OMAP44XX_CM1_REGADDR(OMAP4430_CM1_CKGEN_MOD, 0x0180)
145
146/* CM1.MPU_CM1 register offsets */
147#define OMAP4_CM_MPU_CLKSTCTRL_OFFSET 0x0000
148#define OMAP4430_CM_MPU_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0000)
149#define OMAP4_CM_MPU_STATICDEP_OFFSET 0x0004
150#define OMAP4430_CM_MPU_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0004)
151#define OMAP4_CM_MPU_DYNAMICDEP_OFFSET 0x0008
152#define OMAP4430_CM_MPU_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0008)
153#define OMAP4_CM_MPU_MPU_CLKCTRL_OFFSET 0x0020
154#define OMAP4430_CM_MPU_MPU_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_MPU_MOD, 0x0020)
155
156/* CM1.TESLA_CM1 register offsets */
157#define OMAP4_CM_TESLA_CLKSTCTRL_OFFSET 0x0000
158#define OMAP4430_CM_TESLA_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0000)
159#define OMAP4_CM_TESLA_STATICDEP_OFFSET 0x0004
160#define OMAP4430_CM_TESLA_STATICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0004)
161#define OMAP4_CM_TESLA_DYNAMICDEP_OFFSET 0x0008
162#define OMAP4430_CM_TESLA_DYNAMICDEP OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0008)
163#define OMAP4_CM_TESLA_TESLA_CLKCTRL_OFFSET 0x0020
164#define OMAP4430_CM_TESLA_TESLA_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_TESLA_MOD, 0x0020)
165
166/* CM1.ABE_CM1 register offsets */
167#define OMAP4_CM1_ABE_CLKSTCTRL_OFFSET 0x0000
168#define OMAP4430_CM1_ABE_CLKSTCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0000)
169#define OMAP4_CM1_ABE_L4ABE_CLKCTRL_OFFSET 0x0020
170#define OMAP4430_CM1_ABE_L4ABE_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0020)
171#define OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET 0x0028
172#define OMAP4430_CM1_ABE_AESS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0028)
173#define OMAP4_CM1_ABE_PDM_CLKCTRL_OFFSET 0x0030
174#define OMAP4430_CM1_ABE_PDM_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0030)
175#define OMAP4_CM1_ABE_DMIC_CLKCTRL_OFFSET 0x0038
176#define OMAP4430_CM1_ABE_DMIC_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0038)
177#define OMAP4_CM1_ABE_MCASP_CLKCTRL_OFFSET 0x0040
178#define OMAP4430_CM1_ABE_MCASP_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0040)
179#define OMAP4_CM1_ABE_MCBSP1_CLKCTRL_OFFSET 0x0048
180#define OMAP4430_CM1_ABE_MCBSP1_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0048)
181#define OMAP4_CM1_ABE_MCBSP2_CLKCTRL_OFFSET 0x0050
182#define OMAP4430_CM1_ABE_MCBSP2_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0050)
183#define OMAP4_CM1_ABE_MCBSP3_CLKCTRL_OFFSET 0x0058
184#define OMAP4430_CM1_ABE_MCBSP3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0058)
185#define OMAP4_CM1_ABE_SLIMBUS_CLKCTRL_OFFSET 0x0060
186#define OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0060)
187#define OMAP4_CM1_ABE_TIMER5_CLKCTRL_OFFSET 0x0068
188#define OMAP4430_CM1_ABE_TIMER5_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0068)
189#define OMAP4_CM1_ABE_TIMER6_CLKCTRL_OFFSET 0x0070
190#define OMAP4430_CM1_ABE_TIMER6_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0070)
191#define OMAP4_CM1_ABE_TIMER7_CLKCTRL_OFFSET 0x0078
192#define OMAP4430_CM1_ABE_TIMER7_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0078)
193#define OMAP4_CM1_ABE_TIMER8_CLKCTRL_OFFSET 0x0080
194#define OMAP4430_CM1_ABE_TIMER8_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0080)
195#define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET 0x0088
196#define OMAP4430_CM1_ABE_WDT3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088)
197
198/* CM1.RESTORE_CM1 register offsets */
199#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET 0x0000
200#define OMAP4430_CM_CLKSEL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0000)
201#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET 0x0004
202#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004)
203#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET 0x0008
204#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008)
205#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET 0x000c
206#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c)
207#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET 0x0010
208#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010)
209#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET 0x0014
210#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014)
211#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET 0x0018
212#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018)
213#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET 0x001c
214#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c)
215#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET 0x0020
216#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020)
217#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET 0x0024
218#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024)
219#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET 0x0028
220#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028)
221#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET 0x002c
222#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c)
223#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET 0x0030
224#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030)
225#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET 0x0034
226#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034)
227#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET 0x0038
228#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038)
229#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET 0x003c
230#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c)
231#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET 0x0040
232#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040)
233
234/* CM2 */
235
236/* CM2.OCP_SOCKET_CM2 register offsets */
237#define OMAP4_REVISION_CM2_OFFSET 0x0000
238#define OMAP4430_REVISION_CM2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_MOD, 0x0000)
239#define OMAP4_CM_CM2_PROFILING_CLKCTRL_OFFSET 0x0040
240#define OMAP4430_CM_CM2_PROFILING_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_OCP_SOCKET_MOD, 0x0040)
241
242/* CM2.CKGEN_CM2 register offsets */
243#define OMAP4_CM_CLKSEL_DUCATI_ISS_ROOT_OFFSET 0x0000
244#define OMAP4430_CM_CLKSEL_DUCATI_ISS_ROOT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0000)
245#define OMAP4_CM_CLKSEL_USB_60MHZ_OFFSET 0x0004
246#define OMAP4430_CM_CLKSEL_USB_60MHZ OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0004)
247#define OMAP4_CM_SCALE_FCLK_OFFSET 0x0008
248#define OMAP4430_CM_SCALE_FCLK OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0008)
249#define OMAP4_CM_CORE_DVFS_PERF1_OFFSET 0x0010
250#define OMAP4430_CM_CORE_DVFS_PERF1 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0010)
251#define OMAP4_CM_CORE_DVFS_PERF2_OFFSET 0x0014
252#define OMAP4430_CM_CORE_DVFS_PERF2 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0014)
253#define OMAP4_CM_CORE_DVFS_PERF3_OFFSET 0x0018
254#define OMAP4430_CM_CORE_DVFS_PERF3 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0018)
255#define OMAP4_CM_CORE_DVFS_PERF4_OFFSET 0x001c
256#define OMAP4430_CM_CORE_DVFS_PERF4 OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x001c)
257#define OMAP4_CM_CORE_DVFS_CURRENT_OFFSET 0x0024
258#define OMAP4430_CM_CORE_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0024)
259#define OMAP4_CM_IVA_DVFS_PERF_TESLA_OFFSET 0x0028
260#define OMAP4430_CM_IVA_DVFS_PERF_TESLA OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0028)
261#define OMAP4_CM_IVA_DVFS_PERF_IVAHD_OFFSET 0x002c
262#define OMAP4430_CM_IVA_DVFS_PERF_IVAHD OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x002c)
263#define OMAP4_CM_IVA_DVFS_PERF_ABE_OFFSET 0x0030
264#define OMAP4430_CM_IVA_DVFS_PERF_ABE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0030)
265#define OMAP4_CM_IVA_DVFS_CURRENT_OFFSET 0x0038
266#define OMAP4430_CM_IVA_DVFS_CURRENT OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0038)
267#define OMAP4_CM_CLKMODE_DPLL_PER_OFFSET 0x0040
268#define OMAP4430_CM_CLKMODE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0040)
269#define OMAP4_CM_IDLEST_DPLL_PER_OFFSET 0x0044
270#define OMAP4430_CM_IDLEST_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0044)
271#define OMAP4_CM_AUTOIDLE_DPLL_PER_OFFSET 0x0048
272#define OMAP4430_CM_AUTOIDLE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0048)
273#define OMAP4_CM_CLKSEL_DPLL_PER_OFFSET 0x004c
274#define OMAP4430_CM_CLKSEL_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x004c)
275#define OMAP4_CM_DIV_M2_DPLL_PER_OFFSET 0x0050
276#define OMAP4430_CM_DIV_M2_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0050)
277#define OMAP4_CM_DIV_M3_DPLL_PER_OFFSET 0x0054
278#define OMAP4430_CM_DIV_M3_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0054)
279#define OMAP4_CM_DIV_M4_DPLL_PER_OFFSET 0x0058
280#define OMAP4430_CM_DIV_M4_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0058)
281#define OMAP4_CM_DIV_M5_DPLL_PER_OFFSET 0x005c
282#define OMAP4430_CM_DIV_M5_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x005c)
283#define OMAP4_CM_DIV_M6_DPLL_PER_OFFSET 0x0060
284#define OMAP4430_CM_DIV_M6_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0060)
285#define OMAP4_CM_DIV_M7_DPLL_PER_OFFSET 0x0064
286#define OMAP4430_CM_DIV_M7_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0064)
287#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_PER_OFFSET 0x0068
288#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0068)
289#define OMAP4_CM_SSC_MODFREQDIV_DPLL_PER_OFFSET 0x006c
290#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x006c)
291#define OMAP4_CM_CLKMODE_DPLL_USB_OFFSET 0x0080
292#define OMAP4430_CM_CLKMODE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0080)
293#define OMAP4_CM_IDLEST_DPLL_USB_OFFSET 0x0084
294#define OMAP4430_CM_IDLEST_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0084)
295#define OMAP4_CM_AUTOIDLE_DPLL_USB_OFFSET 0x0088
296#define OMAP4430_CM_AUTOIDLE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0088)
297#define OMAP4_CM_CLKSEL_DPLL_USB_OFFSET 0x008c
298#define OMAP4430_CM_CLKSEL_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x008c)
299#define OMAP4_CM_DIV_M2_DPLL_USB_OFFSET 0x0090
300#define OMAP4430_CM_DIV_M2_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0090)
301#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_USB_OFFSET 0x00a8
302#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00a8)
303#define OMAP4_CM_SSC_MODFREQDIV_DPLL_USB_OFFSET 0x00ac
304#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00ac)
305#define OMAP4_CM_CLKDCOLDO_DPLL_USB_OFFSET 0x00b4
306#define OMAP4430_CM_CLKDCOLDO_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00b4)
307#define OMAP4_CM_CLKMODE_DPLL_UNIPRO_OFFSET 0x00c0
308#define OMAP4430_CM_CLKMODE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c0)
309#define OMAP4_CM_IDLEST_DPLL_UNIPRO_OFFSET 0x00c4
310#define OMAP4430_CM_IDLEST_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c4)
311#define OMAP4_CM_AUTOIDLE_DPLL_UNIPRO_OFFSET 0x00c8
312#define OMAP4430_CM_AUTOIDLE_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00c8)
313#define OMAP4_CM_CLKSEL_DPLL_UNIPRO_OFFSET 0x00cc
314#define OMAP4430_CM_CLKSEL_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00cc)
315#define OMAP4_CM_DIV_M2_DPLL_UNIPRO_OFFSET 0x00d0
316#define OMAP4430_CM_DIV_M2_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00d0)
317#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_UNIPRO_OFFSET 0x00e8
318#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00e8)
319#define OMAP4_CM_SSC_MODFREQDIV_DPLL_UNIPRO_OFFSET 0x00ec
320#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_UNIPRO OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x00ec)
321
322/* CM2.ALWAYS_ON_CM2 register offsets */
323#define OMAP4_CM_ALWON_CLKSTCTRL_OFFSET 0x0000
324#define OMAP4430_CM_ALWON_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0000)
325#define OMAP4_CM_ALWON_MDMINTC_CLKCTRL_OFFSET 0x0020
326#define OMAP4430_CM_ALWON_MDMINTC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0020)
327#define OMAP4_CM_ALWON_SR_MPU_CLKCTRL_OFFSET 0x0028
328#define OMAP4430_CM_ALWON_SR_MPU_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0028)
329#define OMAP4_CM_ALWON_SR_IVA_CLKCTRL_OFFSET 0x0030
330#define OMAP4430_CM_ALWON_SR_IVA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0030)
331#define OMAP4_CM_ALWON_SR_CORE_CLKCTRL_OFFSET 0x0038
332#define OMAP4430_CM_ALWON_SR_CORE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0038)
333#define OMAP4_CM_ALWON_USBPHY_CLKCTRL_OFFSET 0x0040
334#define OMAP4430_CM_ALWON_USBPHY_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_ALWAYS_ON_MOD, 0x0040)
335
336/* CM2.CORE_CM2 register offsets */
337#define OMAP4_CM_L3_1_CLKSTCTRL_OFFSET 0x0000
338#define OMAP4430_CM_L3_1_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0000)
339#define OMAP4_CM_L3_1_DYNAMICDEP_OFFSET 0x0008
340#define OMAP4430_CM_L3_1_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0008)
341#define OMAP4_CM_L3_1_L3_1_CLKCTRL_OFFSET 0x0020
342#define OMAP4430_CM_L3_1_L3_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0020)
343#define OMAP4_CM_L3_2_CLKSTCTRL_OFFSET 0x0100
344#define OMAP4430_CM_L3_2_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0100)
345#define OMAP4_CM_L3_2_DYNAMICDEP_OFFSET 0x0108
346#define OMAP4430_CM_L3_2_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0108)
347#define OMAP4_CM_L3_2_L3_2_CLKCTRL_OFFSET 0x0120
348#define OMAP4430_CM_L3_2_L3_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0120)
349#define OMAP4_CM_L3_2_GPMC_CLKCTRL_OFFSET 0x0128
350#define OMAP4430_CM_L3_2_GPMC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0128)
351#define OMAP4_CM_L3_2_OCMC_RAM_CLKCTRL_OFFSET 0x0130
352#define OMAP4430_CM_L3_2_OCMC_RAM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0130)
353#define OMAP4_CM_DUCATI_CLKSTCTRL_OFFSET 0x0200
354#define OMAP4430_CM_DUCATI_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0200)
355#define OMAP4_CM_DUCATI_STATICDEP_OFFSET 0x0204
356#define OMAP4430_CM_DUCATI_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0204)
357#define OMAP4_CM_DUCATI_DYNAMICDEP_OFFSET 0x0208
358#define OMAP4430_CM_DUCATI_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0208)
359#define OMAP4_CM_DUCATI_DUCATI_CLKCTRL_OFFSET 0x0220
360#define OMAP4430_CM_DUCATI_DUCATI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0220)
361#define OMAP4_CM_SDMA_CLKSTCTRL_OFFSET 0x0300
362#define OMAP4430_CM_SDMA_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0300)
363#define OMAP4_CM_SDMA_STATICDEP_OFFSET 0x0304
364#define OMAP4430_CM_SDMA_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0304)
365#define OMAP4_CM_SDMA_DYNAMICDEP_OFFSET 0x0308
366#define OMAP4430_CM_SDMA_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0308)
367#define OMAP4_CM_SDMA_SDMA_CLKCTRL_OFFSET 0x0320
368#define OMAP4430_CM_SDMA_SDMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0320)
369#define OMAP4_CM_MEMIF_CLKSTCTRL_OFFSET 0x0400
370#define OMAP4430_CM_MEMIF_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0400)
371#define OMAP4_CM_MEMIF_DMM_CLKCTRL_OFFSET 0x0420
372#define OMAP4430_CM_MEMIF_DMM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0420)
373#define OMAP4_CM_MEMIF_EMIF_FW_CLKCTRL_OFFSET 0x0428
374#define OMAP4430_CM_MEMIF_EMIF_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0428)
375#define OMAP4_CM_MEMIF_EMIF_1_CLKCTRL_OFFSET 0x0430
376#define OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0430)
377#define OMAP4_CM_MEMIF_EMIF_2_CLKCTRL_OFFSET 0x0438
378#define OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0438)
379#define OMAP4_CM_MEMIF_DLL_CLKCTRL_OFFSET 0x0440
380#define OMAP4430_CM_MEMIF_DLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0440)
381#define OMAP4_CM_MEMIF_EMIF_H1_CLKCTRL_OFFSET 0x0450
382#define OMAP4430_CM_MEMIF_EMIF_H1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0450)
383#define OMAP4_CM_MEMIF_EMIF_H2_CLKCTRL_OFFSET 0x0458
384#define OMAP4430_CM_MEMIF_EMIF_H2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0458)
385#define OMAP4_CM_MEMIF_DLL_H_CLKCTRL_OFFSET 0x0460
386#define OMAP4430_CM_MEMIF_DLL_H_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0460)
387#define OMAP4_CM_D2D_CLKSTCTRL_OFFSET 0x0500
388#define OMAP4430_CM_D2D_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0500)
389#define OMAP4_CM_D2D_STATICDEP_OFFSET 0x0504
390#define OMAP4430_CM_D2D_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0504)
391#define OMAP4_CM_D2D_DYNAMICDEP_OFFSET 0x0508
392#define OMAP4430_CM_D2D_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0508)
393#define OMAP4_CM_D2D_SAD2D_CLKCTRL_OFFSET 0x0520
394#define OMAP4430_CM_D2D_SAD2D_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0520)
395#define OMAP4_CM_D2D_MODEM_ICR_CLKCTRL_OFFSET 0x0528
396#define OMAP4430_CM_D2D_MODEM_ICR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0528)
397#define OMAP4_CM_D2D_SAD2D_FW_CLKCTRL_OFFSET 0x0530
398#define OMAP4430_CM_D2D_SAD2D_FW_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0530)
399#define OMAP4_CM_L4CFG_CLKSTCTRL_OFFSET 0x0600
400#define OMAP4430_CM_L4CFG_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0600)
401#define OMAP4_CM_L4CFG_DYNAMICDEP_OFFSET 0x0608
402#define OMAP4430_CM_L4CFG_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0608)
403#define OMAP4_CM_L4CFG_L4_CFG_CLKCTRL_OFFSET 0x0620
404#define OMAP4430_CM_L4CFG_L4_CFG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0620)
405#define OMAP4_CM_L4CFG_HW_SEM_CLKCTRL_OFFSET 0x0628
406#define OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0628)
407#define OMAP4_CM_L4CFG_MAILBOX_CLKCTRL_OFFSET 0x0630
408#define OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0630)
409#define OMAP4_CM_L4CFG_SAR_ROM_CLKCTRL_OFFSET 0x0638
410#define OMAP4430_CM_L4CFG_SAR_ROM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0638)
411#define OMAP4_CM_L3INSTR_CLKSTCTRL_OFFSET 0x0700
412#define OMAP4430_CM_L3INSTR_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0700)
413#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_OFFSET 0x0720
414#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0720)
415#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_OFFSET 0x0728
416#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0728)
417#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_OFFSET 0x0740
418#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CORE_MOD, 0x0740)
419
420/* CM2.IVAHD_CM2 register offsets */
421#define OMAP4_CM_IVAHD_CLKSTCTRL_OFFSET 0x0000
422#define OMAP4430_CM_IVAHD_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0000)
423#define OMAP4_CM_IVAHD_STATICDEP_OFFSET 0x0004
424#define OMAP4430_CM_IVAHD_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0004)
425#define OMAP4_CM_IVAHD_DYNAMICDEP_OFFSET 0x0008
426#define OMAP4430_CM_IVAHD_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0008)
427#define OMAP4_CM_IVAHD_IVAHD_CLKCTRL_OFFSET 0x0020
428#define OMAP4430_CM_IVAHD_IVAHD_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0020)
429#define OMAP4_CM_IVAHD_SL2_CLKCTRL_OFFSET 0x0028
430#define OMAP4430_CM_IVAHD_SL2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_IVAHD_MOD, 0x0028)
431
432/* CM2.CAM_CM2 register offsets */
433#define OMAP4_CM_CAM_CLKSTCTRL_OFFSET 0x0000
434#define OMAP4430_CM_CAM_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0000)
435#define OMAP4_CM_CAM_STATICDEP_OFFSET 0x0004
436#define OMAP4430_CM_CAM_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0004)
437#define OMAP4_CM_CAM_DYNAMICDEP_OFFSET 0x0008
438#define OMAP4430_CM_CAM_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0008)
439#define OMAP4_CM_CAM_ISS_CLKCTRL_OFFSET 0x0020
440#define OMAP4430_CM_CAM_ISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0020)
441#define OMAP4_CM_CAM_FDIF_CLKCTRL_OFFSET 0x0028
442#define OMAP4430_CM_CAM_FDIF_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CAM_MOD, 0x0028)
443
444/* CM2.DSS_CM2 register offsets */
445#define OMAP4_CM_DSS_CLKSTCTRL_OFFSET 0x0000
446#define OMAP4430_CM_DSS_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0000)
447#define OMAP4_CM_DSS_STATICDEP_OFFSET 0x0004
448#define OMAP4430_CM_DSS_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0004)
449#define OMAP4_CM_DSS_DYNAMICDEP_OFFSET 0x0008
450#define OMAP4430_CM_DSS_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0008)
451#define OMAP4_CM_DSS_DSS_CLKCTRL_OFFSET 0x0020
452#define OMAP4430_CM_DSS_DSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0020)
453#define OMAP4_CM_DSS_DEISS_CLKCTRL_OFFSET 0x0028
454#define OMAP4430_CM_DSS_DEISS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_DSS_MOD, 0x0028)
455 19
456/* CM2.GFX_CM2 register offsets */ 20#include "prcm-common.h"
457#define OMAP4_CM_GFX_CLKSTCTRL_OFFSET 0x0000 21#include "cm.h"
458#define OMAP4430_CM_GFX_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0000)
459#define OMAP4_CM_GFX_STATICDEP_OFFSET 0x0004
460#define OMAP4430_CM_GFX_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0004)
461#define OMAP4_CM_GFX_DYNAMICDEP_OFFSET 0x0008
462#define OMAP4430_CM_GFX_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0008)
463#define OMAP4_CM_GFX_GFX_CLKCTRL_OFFSET 0x0020
464#define OMAP4430_CM_GFX_GFX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_GFX_MOD, 0x0020)
465 22
466/* CM2.L3INIT_CM2 register offsets */ 23#define OMAP4_CM_CLKSTCTRL 0x0000
467#define OMAP4_CM_L3INIT_CLKSTCTRL_OFFSET 0x0000
468#define OMAP4430_CM_L3INIT_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0000)
469#define OMAP4_CM_L3INIT_STATICDEP_OFFSET 0x0004
470#define OMAP4430_CM_L3INIT_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0004)
471#define OMAP4_CM_L3INIT_DYNAMICDEP_OFFSET 0x0008
472#define OMAP4430_CM_L3INIT_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0008)
473#define OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET 0x0028
474#define OMAP4430_CM_L3INIT_MMC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0028)
475#define OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET 0x0030
476#define OMAP4430_CM_L3INIT_MMC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0030)
477#define OMAP4_CM_L3INIT_HSI_CLKCTRL_OFFSET 0x0038
478#define OMAP4430_CM_L3INIT_HSI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0038)
479#define OMAP4_CM_L3INIT_UNIPRO1_CLKCTRL_OFFSET 0x0040
480#define OMAP4430_CM_L3INIT_UNIPRO1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0040)
481#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET 0x0058
482#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0058)
483#define OMAP4_CM_L3INIT_USB_OTG_CLKCTRL_OFFSET 0x0060
484#define OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0060)
485#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET 0x0068
486#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0068)
487#define OMAP4_CM_L3INIT_P1500_CLKCTRL_OFFSET 0x0078
488#define OMAP4430_CM_L3INIT_P1500_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0078)
489#define OMAP4_CM_L3INIT_EMAC_CLKCTRL_OFFSET 0x0080
490#define OMAP4430_CM_L3INIT_EMAC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0080)
491#define OMAP4_CM_L3INIT_SATA_CLKCTRL_OFFSET 0x0088
492#define OMAP4430_CM_L3INIT_SATA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0088)
493#define OMAP4_CM_L3INIT_TPPSS_CLKCTRL_OFFSET 0x0090
494#define OMAP4430_CM_L3INIT_TPPSS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0090)
495#define OMAP4_CM_L3INIT_PCIESS_CLKCTRL_OFFSET 0x0098
496#define OMAP4430_CM_L3INIT_PCIESS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x0098)
497#define OMAP4_CM_L3INIT_CCPTX_CLKCTRL_OFFSET 0x00a8
498#define OMAP4430_CM_L3INIT_CCPTX_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00a8)
499#define OMAP4_CM_L3INIT_XHPI_CLKCTRL_OFFSET 0x00c0
500#define OMAP4430_CM_L3INIT_XHPI_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00c0)
501#define OMAP4_CM_L3INIT_MMC6_CLKCTRL_OFFSET 0x00c8
502#define OMAP4430_CM_L3INIT_MMC6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00c8)
503#define OMAP4_CM_L3INIT_USB_HOST_FS_CLKCTRL_OFFSET 0x00d0
504#define OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00d0)
505#define OMAP4_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL_OFFSET 0x00e0
506#define OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L3INIT_MOD, 0x00e0)
507 24
508/* CM2.L4PER_CM2 register offsets */ 25/* Function prototypes */
509#define OMAP4_CM_L4PER_CLKSTCTRL_OFFSET 0x0000 26# ifndef __ASSEMBLER__
510#define OMAP4430_CM_L4PER_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0000)
511#define OMAP4_CM_L4PER_DYNAMICDEP_OFFSET 0x0008
512#define OMAP4430_CM_L4PER_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0008)
513#define OMAP4_CM_L4PER_ADC_CLKCTRL_OFFSET 0x0020
514#define OMAP4430_CM_L4PER_ADC_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0020)
515#define OMAP4_CM_L4PER_DMTIMER10_CLKCTRL_OFFSET 0x0028
516#define OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0028)
517#define OMAP4_CM_L4PER_DMTIMER11_CLKCTRL_OFFSET 0x0030
518#define OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0030)
519#define OMAP4_CM_L4PER_DMTIMER2_CLKCTRL_OFFSET 0x0038
520#define OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0038)
521#define OMAP4_CM_L4PER_DMTIMER3_CLKCTRL_OFFSET 0x0040
522#define OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0040)
523#define OMAP4_CM_L4PER_DMTIMER4_CLKCTRL_OFFSET 0x0048
524#define OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0048)
525#define OMAP4_CM_L4PER_DMTIMER9_CLKCTRL_OFFSET 0x0050
526#define OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0050)
527#define OMAP4_CM_L4PER_ELM_CLKCTRL_OFFSET 0x0058
528#define OMAP4430_CM_L4PER_ELM_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0058)
529#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET 0x0060
530#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0060)
531#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET 0x0068
532#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0068)
533#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET 0x0070
534#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0070)
535#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET 0x0078
536#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0078)
537#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET 0x0080
538#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0080)
539#define OMAP4_CM_L4PER_HDQ1W_CLKCTRL_OFFSET 0x0088
540#define OMAP4430_CM_L4PER_HDQ1W_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0088)
541#define OMAP4_CM_L4PER_HECC1_CLKCTRL_OFFSET 0x0090
542#define OMAP4430_CM_L4PER_HECC1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0090)
543#define OMAP4_CM_L4PER_HECC2_CLKCTRL_OFFSET 0x0098
544#define OMAP4430_CM_L4PER_HECC2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0098)
545#define OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET 0x00a0
546#define OMAP4430_CM_L4PER_I2C1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00a0)
547#define OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET 0x00a8
548#define OMAP4430_CM_L4PER_I2C2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00a8)
549#define OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET 0x00b0
550#define OMAP4430_CM_L4PER_I2C3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00b0)
551#define OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET 0x00b8
552#define OMAP4430_CM_L4PER_I2C4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00b8)
553#define OMAP4_CM_L4PER_L4PER_CLKCTRL_OFFSET 0x00c0
554#define OMAP4430_CM_L4PER_L4PER_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00c0)
555#define OMAP4_CM_L4PER_MCASP2_CLKCTRL_OFFSET 0x00d0
556#define OMAP4430_CM_L4PER_MCASP2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00d0)
557#define OMAP4_CM_L4PER_MCASP3_CLKCTRL_OFFSET 0x00d8
558#define OMAP4430_CM_L4PER_MCASP3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00d8)
559#define OMAP4_CM_L4PER_MCBSP4_CLKCTRL_OFFSET 0x00e0
560#define OMAP4430_CM_L4PER_MCBSP4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00e0)
561#define OMAP4_CM_L4PER_MGATE_CLKCTRL_OFFSET 0x00e8
562#define OMAP4430_CM_L4PER_MGATE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00e8)
563#define OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET 0x00f0
564#define OMAP4430_CM_L4PER_MCSPI1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00f0)
565#define OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET 0x00f8
566#define OMAP4430_CM_L4PER_MCSPI2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x00f8)
567#define OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET 0x0100
568#define OMAP4430_CM_L4PER_MCSPI3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0100)
569#define OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET 0x0108
570#define OMAP4430_CM_L4PER_MCSPI4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0108)
571#define OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET 0x0120
572#define OMAP4430_CM_L4PER_MMCSD3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0120)
573#define OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET 0x0128
574#define OMAP4430_CM_L4PER_MMCSD4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0128)
575#define OMAP4_CM_L4PER_MSPROHG_CLKCTRL_OFFSET 0x0130
576#define OMAP4430_CM_L4PER_MSPROHG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0130)
577#define OMAP4_CM_L4PER_SLIMBUS2_CLKCTRL_OFFSET 0x0138
578#define OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0138)
579#define OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET 0x0140
580#define OMAP4430_CM_L4PER_UART1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0140)
581#define OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET 0x0148
582#define OMAP4430_CM_L4PER_UART2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0148)
583#define OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET 0x0150
584#define OMAP4430_CM_L4PER_UART3_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0150)
585#define OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET 0x0158
586#define OMAP4430_CM_L4PER_UART4_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0158)
587#define OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET 0x0160
588#define OMAP4430_CM_L4PER_MMCSD5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0160)
589#define OMAP4_CM_L4PER_I2C5_CLKCTRL_OFFSET 0x0168
590#define OMAP4430_CM_L4PER_I2C5_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0168)
591#define OMAP4_CM_L4SEC_CLKSTCTRL_OFFSET 0x0180
592#define OMAP4430_CM_L4SEC_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0180)
593#define OMAP4_CM_L4SEC_STATICDEP_OFFSET 0x0184
594#define OMAP4430_CM_L4SEC_STATICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0184)
595#define OMAP4_CM_L4SEC_DYNAMICDEP_OFFSET 0x0188
596#define OMAP4430_CM_L4SEC_DYNAMICDEP OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x0188)
597#define OMAP4_CM_L4SEC_AES1_CLKCTRL_OFFSET 0x01a0
598#define OMAP4430_CM_L4SEC_AES1_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01a0)
599#define OMAP4_CM_L4SEC_AES2_CLKCTRL_OFFSET 0x01a8
600#define OMAP4430_CM_L4SEC_AES2_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01a8)
601#define OMAP4_CM_L4SEC_DES3DES_CLKCTRL_OFFSET 0x01b0
602#define OMAP4430_CM_L4SEC_DES3DES_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01b0)
603#define OMAP4_CM_L4SEC_PKAEIP29_CLKCTRL_OFFSET 0x01b8
604#define OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01b8)
605#define OMAP4_CM_L4SEC_RNG_CLKCTRL_OFFSET 0x01c0
606#define OMAP4430_CM_L4SEC_RNG_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01c0)
607#define OMAP4_CM_L4SEC_SHA2MD51_CLKCTRL_OFFSET 0x01c8
608#define OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01c8)
609#define OMAP4_CM_L4SEC_CRYPTODMA_CLKCTRL_OFFSET 0x01d8
610#define OMAP4430_CM_L4SEC_CRYPTODMA_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_L4PER_MOD, 0x01d8)
611 27
612/* CM2.CEFUSE_CM2 register offsets */ 28extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
613#define OMAP4_CM_CEFUSE_CLKSTCTRL_OFFSET 0x0000
614#define OMAP4430_CM_CEFUSE_CLKSTCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_MOD, 0x0000)
615#define OMAP4_CM_CEFUSE_CEFUSE_CLKCTRL_OFFSET 0x0020
616#define OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CEFUSE_MOD, 0x0020)
617 29
618/* CM2.RESTORE_CM2 register offsets */ 30# endif
619#define OMAP4_CM_L3_1_CLKSTCTRL_RESTORE_OFFSET 0x0000
620#define OMAP4430_CM_L3_1_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0000)
621#define OMAP4_CM_L3_2_CLKSTCTRL_RESTORE_OFFSET 0x0004
622#define OMAP4430_CM_L3_2_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0004)
623#define OMAP4_CM_L4CFG_CLKSTCTRL_RESTORE_OFFSET 0x0008
624#define OMAP4430_CM_L4CFG_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0008)
625#define OMAP4_CM_MEMIF_CLKSTCTRL_RESTORE_OFFSET 0x000c
626#define OMAP4430_CM_MEMIF_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x000c)
627#define OMAP4_CM_L4PER_CLKSTCTRL_RESTORE_OFFSET 0x0010
628#define OMAP4430_CM_L4PER_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0010)
629#define OMAP4_CM_L3INIT_CLKSTCTRL_RESTORE_OFFSET 0x0014
630#define OMAP4430_CM_L3INIT_CLKSTCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0014)
631#define OMAP4_CM_L3INSTR_L3_3_CLKCTRL_RESTORE_OFFSET 0x0018
632#define OMAP4430_CM_L3INSTR_L3_3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0018)
633#define OMAP4_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE_OFFSET 0x001c
634#define OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x001c)
635#define OMAP4_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE_OFFSET 0x0020
636#define OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0020)
637#define OMAP4_CM_CM2_PROFILING_CLKCTRL_RESTORE_OFFSET 0x0024
638#define OMAP4430_CM_CM2_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0024)
639#define OMAP4_CM_D2D_STATICDEP_RESTORE_OFFSET 0x0028
640#define OMAP4430_CM_D2D_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0028)
641#define OMAP4_CM_L3_1_DYNAMICDEP_RESTORE_OFFSET 0x002c
642#define OMAP4430_CM_L3_1_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x002c)
643#define OMAP4_CM_L3_2_DYNAMICDEP_RESTORE_OFFSET 0x0030
644#define OMAP4430_CM_L3_2_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0030)
645#define OMAP4_CM_D2D_DYNAMICDEP_RESTORE_OFFSET 0x0034
646#define OMAP4430_CM_D2D_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0034)
647#define OMAP4_CM_L4CFG_DYNAMICDEP_RESTORE_OFFSET 0x0038
648#define OMAP4430_CM_L4CFG_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0038)
649#define OMAP4_CM_L4PER_DYNAMICDEP_RESTORE_OFFSET 0x003c
650#define OMAP4430_CM_L4PER_DYNAMICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x003c)
651#define OMAP4_CM_L4PER_GPIO2_CLKCTRL_RESTORE_OFFSET 0x0040
652#define OMAP4430_CM_L4PER_GPIO2_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0040)
653#define OMAP4_CM_L4PER_GPIO3_CLKCTRL_RESTORE_OFFSET 0x0044
654#define OMAP4430_CM_L4PER_GPIO3_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0044)
655#define OMAP4_CM_L4PER_GPIO4_CLKCTRL_RESTORE_OFFSET 0x0048
656#define OMAP4430_CM_L4PER_GPIO4_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0048)
657#define OMAP4_CM_L4PER_GPIO5_CLKCTRL_RESTORE_OFFSET 0x004c
658#define OMAP4430_CM_L4PER_GPIO5_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x004c)
659#define OMAP4_CM_L4PER_GPIO6_CLKCTRL_RESTORE_OFFSET 0x0050
660#define OMAP4430_CM_L4PER_GPIO6_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0050)
661#define OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE_OFFSET 0x0054
662#define OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0054)
663#define OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE_OFFSET 0x0058
664#define OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x0058)
665#define OMAP4_CM_SDMA_STATICDEP_RESTORE_OFFSET 0x005c
666#define OMAP4430_CM_SDMA_STATICDEP_RESTORE OMAP44XX_CM2_REGADDR(OMAP4430_CM2_RESTORE_MOD, 0x005c)
667#endif 31#endif
diff --git a/arch/arm/mach-omap2/cm4xxx.c b/arch/arm/mach-omap2/cm4xxx.c
deleted file mode 100644
index f8a660a1a4a6..000000000000
--- a/arch/arm/mach-omap2/cm4xxx.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * OMAP4 CM module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/module.h>
14#include <linux/types.h>
15#include <linux/delay.h>
16#include <linux/spinlock.h>
17#include <linux/list.h>
18#include <linux/errno.h>
19#include <linux/err.h>
20#include <linux/io.h>
21
22#include <asm/atomic.h>
23
24#include <plat/common.h>
25
26#include "cm.h"
27#include "cm-regbits-44xx.h"
28
29/**
30 * omap4_cm_wait_module_ready - wait for a module to be in 'func' state
31 * @clkctrl_reg: CLKCTRL module address
32 *
33 * Wait for the module IDLEST to be functional. If the idle state is in any
34 * the non functional state (trans, idle or disabled), module and thus the
35 * sysconfig cannot be accessed and will probably lead to an "imprecise
36 * external abort"
37 *
38 * Module idle state:
39 * 0x0 func: Module is fully functional, including OCP
40 * 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep
41 * abortion
42 * 0x2 idle: Module is in Idle mode (only OCP part). It is functional if
43 * using separate functional clock
44 * 0x3 disabled: Module is disabled and cannot be accessed
45 *
46 */
47int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
48{
49 int i = 0;
50
51 if (!clkctrl_reg)
52 return 0;
53
54 omap_test_timeout((
55 ((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
56 (((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
57 OMAP4430_IDLEST_SHIFT) == 0x2)),
58 MAX_MODULE_READY_TIME, i);
59
60 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
61}
62
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
new file mode 100644
index 000000000000..c04bbbea17a5
--- /dev/null
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -0,0 +1,214 @@
1/*
2 * OMAP4 CM instance functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This is needed since CM instances can be in the PRM, PRCM_MPU, CM1,
12 * or CM2 hardware modules. For example, the EMU_CM CM instance is in
13 * the PRM hardware module. What a mess...
14 */
15
16#include <linux/kernel.h>
17#include <linux/types.h>
18#include <linux/errno.h>
19#include <linux/err.h>
20#include <linux/io.h>
21
22#include <plat/common.h>
23
24#include "cm.h"
25#include "cm1_44xx.h"
26#include "cm2_44xx.h"
27#include "cm44xx.h"
28#include "cminst44xx.h"
29#include "cm-regbits-34xx.h"
30#include "cm-regbits-44xx.h"
31#include "prcm44xx.h"
32#include "prm44xx.h"
33#include "prcm_mpu44xx.h"
34
35static u32 _cm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
36 [OMAP4430_INVALID_PRCM_PARTITION] = 0,
37 [OMAP4430_PRM_PARTITION] = OMAP4430_PRM_BASE,
38 [OMAP4430_CM1_PARTITION] = OMAP4430_CM1_BASE,
39 [OMAP4430_CM2_PARTITION] = OMAP4430_CM2_BASE,
40 [OMAP4430_SCRM_PARTITION] = 0,
41 [OMAP4430_PRCM_MPU_PARTITION] = OMAP4430_PRCM_MPU_BASE,
42};
43
44/* Read a register in a CM instance */
45u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx)
46{
47 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
48 part == OMAP4430_INVALID_PRCM_PARTITION ||
49 !_cm_bases[part]);
50 return __raw_readl(OMAP2_L4_IO_ADDRESS(_cm_bases[part] + inst + idx));
51}
52
53/* Write into a register in a CM instance */
54void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx)
55{
56 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
57 part == OMAP4430_INVALID_PRCM_PARTITION ||
58 !_cm_bases[part]);
59 __raw_writel(val, OMAP2_L4_IO_ADDRESS(_cm_bases[part] + inst + idx));
60}
61
62/* Read-modify-write a register in CM1. Caller must lock */
63u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
64 s16 idx)
65{
66 u32 v;
67
68 v = omap4_cminst_read_inst_reg(part, inst, idx);
69 v &= ~mask;
70 v |= bits;
71 omap4_cminst_write_inst_reg(v, part, inst, idx);
72
73 return v;
74}
75
76/*
77 *
78 */
79
80/**
81 * _clktrctrl_write - write @c to a CM_CLKSTCTRL.CLKTRCTRL register bitfield
82 * @c: CLKTRCTRL register bitfield (LSB = bit 0, i.e., unshifted)
83 * @part: PRCM partition ID that the CM_CLKSTCTRL register exists in
84 * @inst: CM instance register offset (*_INST macro)
85 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
86 *
87 * @c must be the unshifted value for CLKTRCTRL - i.e., this function
88 * will handle the shift itself.
89 */
90static void _clktrctrl_write(u8 c, u8 part, s16 inst, u16 cdoffs)
91{
92 u32 v;
93
94 v = omap4_cminst_read_inst_reg(part, inst, cdoffs + OMAP4_CM_CLKSTCTRL);
95 v &= ~OMAP4430_CLKTRCTRL_MASK;
96 v |= c << OMAP4430_CLKTRCTRL_SHIFT;
97 omap4_cminst_write_inst_reg(v, part, inst, cdoffs + OMAP4_CM_CLKSTCTRL);
98}
99
100/**
101 * omap4_cminst_is_clkdm_in_hwsup - is a clockdomain in hwsup idle mode?
102 * @part: PRCM partition ID that the CM_CLKSTCTRL register exists in
103 * @inst: CM instance register offset (*_INST macro)
104 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
105 *
106 * Returns true if the clockdomain referred to by (@part, @inst, @cdoffs)
107 * is in hardware-supervised idle mode, or 0 otherwise.
108 */
109bool omap4_cminst_is_clkdm_in_hwsup(u8 part, s16 inst, u16 cdoffs)
110{
111 u32 v;
112
113 v = omap4_cminst_read_inst_reg(part, inst, cdoffs + OMAP4_CM_CLKSTCTRL);
114 v &= OMAP4430_CLKTRCTRL_MASK;
115 v >>= OMAP4430_CLKTRCTRL_SHIFT;
116
117 return (v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ? true : false;
118}
119
120/**
121 * omap4_cminst_clkdm_enable_hwsup - put a clockdomain in hwsup-idle mode
122 * @part: PRCM partition ID that the clockdomain registers exist in
123 * @inst: CM instance register offset (*_INST macro)
124 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
125 *
126 * Put a clockdomain referred to by (@part, @inst, @cdoffs) into
127 * hardware-supervised idle mode. No return value.
128 */
129void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs)
130{
131 _clktrctrl_write(OMAP34XX_CLKSTCTRL_ENABLE_AUTO, part, inst, cdoffs);
132}
133
134/**
135 * omap4_cminst_clkdm_disable_hwsup - put a clockdomain in swsup-idle mode
136 * @part: PRCM partition ID that the clockdomain registers exist in
137 * @inst: CM instance register offset (*_INST macro)
138 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
139 *
140 * Put a clockdomain referred to by (@part, @inst, @cdoffs) into
141 * software-supervised idle mode, i.e., controlled manually by the
142 * Linux OMAP clockdomain code. No return value.
143 */
144void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs)
145{
146 _clktrctrl_write(OMAP34XX_CLKSTCTRL_DISABLE_AUTO, part, inst, cdoffs);
147}
148
149/**
150 * omap4_cminst_clkdm_force_sleep - try to put a clockdomain into idle
151 * @part: PRCM partition ID that the clockdomain registers exist in
152 * @inst: CM instance register offset (*_INST macro)
153 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
154 *
155 * Put a clockdomain referred to by (@part, @inst, @cdoffs) into idle
156 * No return value.
157 */
158void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs)
159{
160 _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, part, inst, cdoffs);
161}
162
163/**
164 * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle
165 * @part: PRCM partition ID that the clockdomain registers exist in
166 * @inst: CM instance register offset (*_INST macro)
167 * @cdoffs: Clockdomain register offset (*_CDOFFS macro)
168 *
169 * Take a clockdomain referred to by (@part, @inst, @cdoffs) out of idle,
170 * waking it up. No return value.
171 */
172void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs)
173{
174 _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, part, inst, cdoffs);
175}
176
177/*
178 *
179 */
180
181/**
182 * omap4_cm_wait_module_ready - wait for a module to be in 'func' state
183 * @clkctrl_reg: CLKCTRL module address
184 *
185 * Wait for the module IDLEST to be functional. If the idle state is in any
186 * the non functional state (trans, idle or disabled), module and thus the
187 * sysconfig cannot be accessed and will probably lead to an "imprecise
188 * external abort"
189 *
190 * Module idle state:
191 * 0x0 func: Module is fully functional, including OCP
192 * 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep
193 * abortion
194 * 0x2 idle: Module is in Idle mode (only OCP part). It is functional if
195 * using separate functional clock
196 * 0x3 disabled: Module is disabled and cannot be accessed
197 *
198 */
199int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg)
200{
201 int i = 0;
202
203 if (!clkctrl_reg)
204 return 0;
205
206 omap_test_timeout((
207 ((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) == 0) ||
208 (((__raw_readl(clkctrl_reg) & OMAP4430_IDLEST_MASK) >>
209 OMAP4430_IDLEST_SHIFT) == 0x2)),
210 MAX_MODULE_READY_TIME, i);
211
212 return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
213}
214
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
new file mode 100644
index 000000000000..a6abd0a8cb82
--- /dev/null
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -0,0 +1,31 @@
1/*
2 * OMAP4 Clock Management (CM) function prototypes
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ARCH_ASM_MACH_OMAP2_CMINST44XX_H
12#define __ARCH_ASM_MACH_OMAP2_CMINST44XX_H
13
14extern bool omap4_cminst_is_clkdm_in_hwsup(u8 part, s16 inst, u16 cdoffs);
15extern void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs);
16extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs);
17extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs);
18extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs);
19
20/*
21 * In an ideal world, we would not export these low-level functions,
22 * but this will probably take some time to fix properly
23 */
24extern u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx);
25extern void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx);
26extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part,
27 s16 inst, s16 idx);
28
29extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
30
31#endif
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 0269bb055b69..695279419020 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -20,12 +20,16 @@
20 20
21#include "cm-regbits-34xx.h" 21#include "cm-regbits-34xx.h"
22#include "prm-regbits-34xx.h" 22#include "prm-regbits-34xx.h"
23#include "cm.h" 23#include "prm2xxx_3xxx.h"
24#include "prm.h" 24#include "cm2xxx_3xxx.h"
25#include "sdrc.h" 25#include "sdrc.h"
26#include "pm.h" 26#include "pm.h"
27#include "control.h" 27#include "control.h"
28 28
29/* Used by omap3_ctrl_save_padconf() */
30#define START_PADCONF_SAVE 0x2
31#define PADCONF_SAVE_DONE 0x1
32
29static void __iomem *omap2_ctrl_base; 33static void __iomem *omap2_ctrl_base;
30static void __iomem *omap4_ctrl_pad_base; 34static void __iomem *omap4_ctrl_pad_base;
31 35
@@ -134,6 +138,7 @@ struct omap3_control_regs {
134 u32 sramldo4; 138 u32 sramldo4;
135 u32 sramldo5; 139 u32 sramldo5;
136 u32 csi; 140 u32 csi;
141 u32 padconf_sys_nirq;
137}; 142};
138 143
139static struct omap3_control_regs control_context; 144static struct omap3_control_regs control_context;
@@ -209,6 +214,37 @@ void omap4_ctrl_pad_writel(u32 val, u16 offset)
209 __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset)); 214 __raw_writel(val, OMAP4_CTRL_PAD_REGADDR(offset));
210} 215}
211 216
217#ifdef CONFIG_ARCH_OMAP3
218
219/**
220 * omap3_ctrl_write_boot_mode - set scratchpad boot mode for the next boot
221 * @bootmode: 8-bit value to pass to some boot code
222 *
223 * Set the bootmode in the scratchpad RAM. This is used after the
224 * system restarts. Not sure what actually uses this - it may be the
225 * bootloader, rather than the boot ROM - contrary to the preserved
226 * comment below. No return value.
227 */
228void omap3_ctrl_write_boot_mode(u8 bootmode)
229{
230 u32 l;
231
232 l = ('B' << 24) | ('M' << 16) | bootmode;
233
234 /*
235 * Reserve the first word in scratchpad for communicating
236 * with the boot ROM. A pointer to a data structure
237 * describing the boot process can be stored there,
238 * cf. OMAP34xx TRM, Initialization / Software Booting
239 * Configuration.
240 *
241 * XXX This should use some omap_ctrl_writel()-type function
242 */
243 __raw_writel(l, OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD + 4));
244}
245
246#endif
247
212#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) 248#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
213/* 249/*
214 * Clears the scratchpad contents in case of cold boot- 250 * Clears the scratchpad contents in case of cold boot-
@@ -220,13 +256,13 @@ void omap3_clear_scratchpad_contents(void)
220 void __iomem *v_addr; 256 void __iomem *v_addr;
221 u32 offset = 0; 257 u32 offset = 0;
222 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM); 258 v_addr = OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM);
223 if (prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) & 259 if (omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP3_PRM_RSTST_OFFSET) &
224 OMAP3430_GLOBAL_COLD_RST_MASK) { 260 OMAP3430_GLOBAL_COLD_RST_MASK) {
225 for ( ; offset <= max_offset; offset += 0x4) 261 for ( ; offset <= max_offset; offset += 0x4)
226 __raw_writel(0x0, (v_addr + offset)); 262 __raw_writel(0x0, (v_addr + offset));
227 prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK, 263 omap2_prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK,
228 OMAP3430_GR_MOD, 264 OMAP3430_GR_MOD,
229 OMAP3_PRM_RSTST_OFFSET); 265 OMAP3_PRM_RSTST_OFFSET);
230 } 266 }
231} 267}
232 268
@@ -268,32 +304,34 @@ void omap3_save_scratchpad_contents(void)
268 scratchpad_contents.sdrc_block_offset = 0x64; 304 scratchpad_contents.sdrc_block_offset = 0x64;
269 305
270 /* Populate the PRCM block contents */ 306 /* Populate the PRCM block contents */
271 prcm_block_contents.prm_clksrc_ctrl = prm_read_mod_reg(OMAP3430_GR_MOD, 307 prcm_block_contents.prm_clksrc_ctrl =
272 OMAP3_PRM_CLKSRC_CTRL_OFFSET); 308 omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
273 prcm_block_contents.prm_clksel = prm_read_mod_reg(OMAP3430_CCR_MOD, 309 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
274 OMAP3_PRM_CLKSEL_OFFSET); 310 prcm_block_contents.prm_clksel =
311 omap2_prm_read_mod_reg(OMAP3430_CCR_MOD,
312 OMAP3_PRM_CLKSEL_OFFSET);
275 prcm_block_contents.cm_clksel_core = 313 prcm_block_contents.cm_clksel_core =
276 cm_read_mod_reg(CORE_MOD, CM_CLKSEL); 314 omap2_cm_read_mod_reg(CORE_MOD, CM_CLKSEL);
277 prcm_block_contents.cm_clksel_wkup = 315 prcm_block_contents.cm_clksel_wkup =
278 cm_read_mod_reg(WKUP_MOD, CM_CLKSEL); 316 omap2_cm_read_mod_reg(WKUP_MOD, CM_CLKSEL);
279 prcm_block_contents.cm_clken_pll = 317 prcm_block_contents.cm_clken_pll =
280 cm_read_mod_reg(PLL_MOD, CM_CLKEN); 318 omap2_cm_read_mod_reg(PLL_MOD, CM_CLKEN);
281 prcm_block_contents.cm_autoidle_pll = 319 prcm_block_contents.cm_autoidle_pll =
282 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_AUTOIDLE_PLL); 320 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_AUTOIDLE_PLL);
283 prcm_block_contents.cm_clksel1_pll = 321 prcm_block_contents.cm_clksel1_pll =
284 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL1_PLL); 322 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL1_PLL);
285 prcm_block_contents.cm_clksel2_pll = 323 prcm_block_contents.cm_clksel2_pll =
286 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL2_PLL); 324 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL2_PLL);
287 prcm_block_contents.cm_clksel3_pll = 325 prcm_block_contents.cm_clksel3_pll =
288 cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL3); 326 omap2_cm_read_mod_reg(PLL_MOD, OMAP3430_CM_CLKSEL3);
289 prcm_block_contents.cm_clken_pll_mpu = 327 prcm_block_contents.cm_clken_pll_mpu =
290 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKEN_PLL); 328 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKEN_PLL);
291 prcm_block_contents.cm_autoidle_pll_mpu = 329 prcm_block_contents.cm_autoidle_pll_mpu =
292 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL); 330 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_AUTOIDLE_PLL);
293 prcm_block_contents.cm_clksel1_pll_mpu = 331 prcm_block_contents.cm_clksel1_pll_mpu =
294 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL); 332 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL1_PLL);
295 prcm_block_contents.cm_clksel2_pll_mpu = 333 prcm_block_contents.cm_clksel2_pll_mpu =
296 cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL); 334 omap2_cm_read_mod_reg(MPU_MOD, OMAP3430_CM_CLKSEL2_PLL);
297 prcm_block_contents.prcm_block_size = 0x0; 335 prcm_block_contents.prcm_block_size = 0x0;
298 336
299 /* Populate the SDRC block contents */ 337 /* Populate the SDRC block contents */
@@ -426,6 +464,8 @@ void omap3_control_save_context(void)
426 control_context.sramldo4 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4); 464 control_context.sramldo4 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4);
427 control_context.sramldo5 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5); 465 control_context.sramldo5 = omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5);
428 control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI); 466 control_context.csi = omap_ctrl_readl(OMAP343X_CONTROL_CSI);
467 control_context.padconf_sys_nirq =
468 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
429 return; 469 return;
430} 470}
431 471
@@ -482,6 +522,8 @@ void omap3_control_restore_context(void)
482 omap_ctrl_writel(control_context.sramldo4, OMAP343X_CONTROL_SRAMLDO4); 522 omap_ctrl_writel(control_context.sramldo4, OMAP343X_CONTROL_SRAMLDO4);
483 omap_ctrl_writel(control_context.sramldo5, OMAP343X_CONTROL_SRAMLDO5); 523 omap_ctrl_writel(control_context.sramldo5, OMAP343X_CONTROL_SRAMLDO5);
484 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI); 524 omap_ctrl_writel(control_context.csi, OMAP343X_CONTROL_CSI);
525 omap_ctrl_writel(control_context.padconf_sys_nirq,
526 OMAP343X_CONTROL_PADCONF_SYSNIRQ);
485 return; 527 return;
486} 528}
487 529
@@ -492,4 +534,31 @@ void omap3630_ctrl_disable_rta(void)
492 omap_ctrl_writel(OMAP36XX_RTA_DISABLE, OMAP36XX_CONTROL_MEM_RTA_CTRL); 534 omap_ctrl_writel(OMAP36XX_RTA_DISABLE, OMAP36XX_CONTROL_MEM_RTA_CTRL);
493} 535}
494 536
537/**
538 * omap3_ctrl_save_padconf - save padconf registers to scratchpad RAM
539 *
540 * Tell the SCM to start saving the padconf registers, then wait for
541 * the process to complete. Returns 0 unconditionally, although it
542 * should also eventually be able to return -ETIMEDOUT, if the save
543 * does not complete.
544 *
545 * XXX This function is missing a timeout. What should it be?
546 */
547int omap3_ctrl_save_padconf(void)
548{
549 u32 cpo;
550
551 /* Save the padconf registers */
552 cpo = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
553 cpo |= START_PADCONF_SAVE;
554 omap_ctrl_writel(cpo, OMAP343X_CONTROL_PADCONF_OFF);
555
556 /* wait for the save to complete */
557 while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
558 & PADCONF_SAVE_DONE))
559 udelay(1);
560
561 return 0;
562}
563
495#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ 564#endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index ea20dc310522..208a670c826b 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -357,7 +357,9 @@ extern u32 *get_omap3630_restore_pointer(void);
357extern u32 omap3_arm_context[128]; 357extern u32 omap3_arm_context[128];
358extern void omap3_control_save_context(void); 358extern void omap3_control_save_context(void);
359extern void omap3_control_restore_context(void); 359extern void omap3_control_restore_context(void);
360extern void omap3_ctrl_write_boot_mode(u8 bootmode);
360extern void omap3630_ctrl_disable_rta(void); 361extern void omap3630_ctrl_disable_rta(void);
362extern int omap3_ctrl_save_padconf(void);
361#else 363#else
362#define omap_ctrl_base_get() 0 364#define omap_ctrl_base_get() 0
363#define omap_ctrl_readb(x) 0 365#define omap_ctrl_readb(x) 0
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 0fb619c52588..f3e043fe5eb8 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -27,8 +27,8 @@
27 27
28#include <plat/prcm.h> 28#include <plat/prcm.h>
29#include <plat/irqs.h> 29#include <plat/irqs.h>
30#include <plat/powerdomain.h> 30#include "powerdomain.h"
31#include <plat/clockdomain.h> 31#include "clockdomain.h"
32#include <plat/serial.h> 32#include <plat/serial.h>
33 33
34#include "pm.h" 34#include "pm.h"
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 1bca147ac91d..381f4eb92352 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -955,72 +955,12 @@ static inline void omap_init_vout(void) {}
955 955
956/*-------------------------------------------------------------------------*/ 956/*-------------------------------------------------------------------------*/
957 957
958/*
959 * Inorder to avoid any assumptions from bootloader regarding WDT
960 * settings, WDT module is reset during init. This enables the watchdog
961 * timer. Hence it is required to disable the watchdog after the WDT reset
962 * during init. Otherwise the system would reboot as per the default
963 * watchdog timer registers settings.
964 */
965#define OMAP_WDT_WPS (0x34)
966#define OMAP_WDT_SPR (0x48)
967
968static int omap2_disable_wdt(struct omap_hwmod *oh, void *unused)
969{
970 void __iomem *base;
971 int ret;
972
973 if (!oh) {
974 pr_err("%s: Could not look up wdtimer_hwmod\n", __func__);
975 return -EINVAL;
976 }
977
978 base = omap_hwmod_get_mpu_rt_va(oh);
979 if (!base) {
980 pr_err("%s: Could not get the base address for %s\n",
981 oh->name, __func__);
982 return -EINVAL;
983 }
984
985 /* Enable the clocks before accessing the WDT registers */
986 ret = omap_hwmod_enable(oh);
987 if (ret) {
988 pr_err("%s: Could not enable clocks for %s\n",
989 oh->name, __func__);
990 return ret;
991 }
992
993 /* sequence required to disable watchdog */
994 __raw_writel(0xAAAA, base + OMAP_WDT_SPR);
995 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
996 cpu_relax();
997
998 __raw_writel(0x5555, base + OMAP_WDT_SPR);
999 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
1000 cpu_relax();
1001
1002 ret = omap_hwmod_idle(oh);
1003 if (ret)
1004 pr_err("%s: Could not disable clocks for %s\n",
1005 oh->name, __func__);
1006
1007 return ret;
1008}
1009
1010static void __init omap_disable_wdt(void)
1011{
1012 if (cpu_class_is_omap2())
1013 omap_hwmod_for_each_by_class("wd_timer",
1014 omap2_disable_wdt, NULL);
1015 return;
1016}
1017
1018static int __init omap2_init_devices(void) 958static int __init omap2_init_devices(void)
1019{ 959{
1020 /* please keep these calls, and their implementations above, 960 /*
961 * please keep these calls, and their implementations above,
1021 * in alphabetical order so they're easier to sort through. 962 * in alphabetical order so they're easier to sort through.
1022 */ 963 */
1023 omap_disable_wdt();
1024 omap_hsmmc_reset(); 964 omap_hsmmc_reset();
1025 omap_init_audio(); 965 omap_init_audio();
1026 omap_init_camera(); 966 omap_init_camera();
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index ed8d330522f1..5df9f53e6d01 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -32,9 +32,7 @@
32#include <asm/clkdev.h> 32#include <asm/clkdev.h>
33 33
34#include "clock.h" 34#include "clock.h"
35#include "prm.h" 35#include "cm2xxx_3xxx.h"
36#include "prm-regbits-34xx.h"
37#include "cm.h"
38#include "cm-regbits-34xx.h" 36#include "cm-regbits-34xx.h"
39 37
40/* CM_AUTOIDLE_PLL*.AUTO_* bit values */ 38/* CM_AUTOIDLE_PLL*.AUTO_* bit values */
@@ -225,10 +223,9 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
225} 223}
226 224
227/** 225/**
228 * lookup_dco_sddiv - Set j-type DPLL4 compensation variables 226 * _lookup_dco - Lookup DCO used by j-type DPLL
229 * @clk: pointer to a DPLL struct clk 227 * @clk: pointer to a DPLL struct clk
230 * @dco: digital control oscillator selector 228 * @dco: digital control oscillator selector
231 * @sd_div: target sigma-delta divider
232 * @m: DPLL multiplier to set 229 * @m: DPLL multiplier to set
233 * @n: DPLL divider to set 230 * @n: DPLL divider to set
234 * 231 *
@@ -237,11 +234,9 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
237 * XXX This code is not needed for 3430/AM35xx; can it be optimized 234 * XXX This code is not needed for 3430/AM35xx; can it be optimized
238 * out in non-multi-OMAP builds for those chips? 235 * out in non-multi-OMAP builds for those chips?
239 */ 236 */
240static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m, 237static void _lookup_dco(struct clk *clk, u8 *dco, u16 m, u8 n)
241 u8 n)
242{ 238{
243 unsigned long fint, clkinp, sd; /* watch out for overflow */ 239 unsigned long fint, clkinp; /* watch out for overflow */
244 int mod1, mod2;
245 240
246 clkinp = clk->parent->rate; 241 clkinp = clk->parent->rate;
247 fint = (clkinp / n) * m; 242 fint = (clkinp / n) * m;
@@ -250,6 +245,27 @@ static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m,
250 *dco = 2; 245 *dco = 2;
251 else 246 else
252 *dco = 4; 247 *dco = 4;
248}
249
250/**
251 * _lookup_sddiv - Calculate sigma delta divider for j-type DPLL
252 * @clk: pointer to a DPLL struct clk
253 * @sd_div: target sigma-delta divider
254 * @m: DPLL multiplier to set
255 * @n: DPLL divider to set
256 *
257 * See 36xx TRM section 3.5.3.3.3.2 "Type B DPLL (Low-Jitter)"
258 *
259 * XXX This code is not needed for 3430/AM35xx; can it be optimized
260 * out in non-multi-OMAP builds for those chips?
261 */
262static void _lookup_sddiv(struct clk *clk, u8 *sd_div, u16 m, u8 n)
263{
264 unsigned long clkinp, sd; /* watch out for overflow */
265 int mod1, mod2;
266
267 clkinp = clk->parent->rate;
268
253 /* 269 /*
254 * target sigma-delta to near 250MHz 270 * target sigma-delta to near 250MHz
255 * sd = ceil[(m/(n+1)) * (clkinp_MHz / 250)] 271 * sd = ceil[(m/(n+1)) * (clkinp_MHz / 250)]
@@ -278,6 +294,7 @@ static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m,
278static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel) 294static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel)
279{ 295{
280 struct dpll_data *dd = clk->dpll_data; 296 struct dpll_data *dd = clk->dpll_data;
297 u8 dco, sd_div;
281 u32 v; 298 u32 v;
282 299
283 /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */ 300 /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */
@@ -300,18 +317,16 @@ static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel)
300 v |= m << __ffs(dd->mult_mask); 317 v |= m << __ffs(dd->mult_mask);
301 v |= (n - 1) << __ffs(dd->div1_mask); 318 v |= (n - 1) << __ffs(dd->div1_mask);
302 319
303 /* 320 /* Configure dco and sd_div for dplls that have these fields */
304 * XXX This code is not needed for 3430/AM35XX; can it be optimized 321 if (dd->dco_mask) {
305 * out in non-multi-OMAP builds for those chips? 322 _lookup_dco(clk, &dco, m, n);
306 */ 323 v &= ~(dd->dco_mask);
307 if ((dd->flags & DPLL_J_TYPE) && !(dd->flags & DPLL_NO_DCO_SEL)) { 324 v |= dco << __ffs(dd->dco_mask);
308 u8 dco, sd_div; 325 }
309 lookup_dco_sddiv(clk, &dco, &sd_div, m, n); 326 if (dd->sddiv_mask) {
310 /* XXX This probably will need revision for OMAP4 */ 327 _lookup_sddiv(clk, &sd_div, m, n);
311 v &= ~(OMAP3630_PERIPH_DPLL_DCO_SEL_MASK 328 v &= ~(dd->sddiv_mask);
312 | OMAP3630_PERIPH_DPLL_SD_DIV_MASK); 329 v |= sd_div << __ffs(dd->sddiv_mask);
313 v |= dco << __ffs(OMAP3630_PERIPH_DPLL_DCO_SEL_MASK);
314 v |= sd_div << __ffs(OMAP3630_PERIPH_DPLL_SD_DIV_MASK);
315 } 330 }
316 331
317 __raw_writel(v, dd->mult_div1_reg); 332 __raw_writel(v, dd->mult_div1_reg);
diff --git a/arch/arm/mach-omap2/dsp.c b/arch/arm/mach-omap2/dsp.c
index 6feeeae6c21b..911cd2e68d46 100644
--- a/arch/arm/mach-omap2/dsp.c
+++ b/arch/arm/mach-omap2/dsp.c
@@ -11,9 +11,16 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 */ 12 */
13 13
14/*
15 * XXX The function pointers to the PRM/CM functions are incorrect and
16 * should be removed. No device driver should be changing PRM/CM bits
17 * directly; that's a layering violation -- those bits are the responsibility
18 * of the OMAP PM core code.
19 */
20
14#include <linux/platform_device.h> 21#include <linux/platform_device.h>
15#include "prm.h" 22#include "cm2xxx_3xxx.h"
16#include "cm.h" 23#include "prm2xxx_3xxx.h"
17#ifdef CONFIG_BRIDGE_DVFS 24#ifdef CONFIG_BRIDGE_DVFS
18#include <plat/omap-pm.h> 25#include <plat/omap-pm.h>
19#endif 26#endif
@@ -31,12 +38,12 @@ static struct omap_dsp_platform_data omap_dsp_pdata __initdata = {
31 .cpu_set_freq = omap_pm_cpu_set_freq, 38 .cpu_set_freq = omap_pm_cpu_set_freq,
32 .cpu_get_freq = omap_pm_cpu_get_freq, 39 .cpu_get_freq = omap_pm_cpu_get_freq,
33#endif 40#endif
34 .dsp_prm_read = prm_read_mod_reg, 41 .dsp_prm_read = omap2_prm_read_mod_reg,
35 .dsp_prm_write = prm_write_mod_reg, 42 .dsp_prm_write = omap2_prm_write_mod_reg,
36 .dsp_prm_rmw_bits = prm_rmw_mod_reg_bits, 43 .dsp_prm_rmw_bits = omap2_prm_rmw_mod_reg_bits,
37 .dsp_cm_read = cm_read_mod_reg, 44 .dsp_cm_read = omap2_cm_read_mod_reg,
38 .dsp_cm_write = cm_write_mod_reg, 45 .dsp_cm_write = omap2_cm_write_mod_reg,
39 .dsp_cm_rmw_bits = cm_rmw_mod_reg_bits, 46 .dsp_cm_rmw_bits = omap2_cm_rmw_mod_reg_bits,
40}; 47};
41 48
42static int __init omap_dsp_init(void) 49static int __init omap_dsp_init(void)
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 5577ab2faad2..e66687b0b9de 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -39,12 +39,9 @@
39#include "io.h" 39#include "io.h"
40 40
41#include <plat/omap-pm.h> 41#include <plat/omap-pm.h>
42#include <plat/powerdomain.h> 42#include "powerdomain.h"
43#include "powerdomains.h"
44
45#include <plat/clockdomain.h>
46#include "clockdomains.h"
47 43
44#include "clockdomain.h"
48#include <plat/omap_hwmod.h> 45#include <plat/omap_hwmod.h>
49#include <plat/multi.h> 46#include <plat/multi.h>
50 47
@@ -312,6 +309,11 @@ static int __init _omap2_init_reprogram_sdrc(void)
312 return v; 309 return v;
313} 310}
314 311
312static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
313{
314 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
315}
316
315/* 317/*
316 * Initialize asm_irq_base for entry-macro.S 318 * Initialize asm_irq_base for entry-macro.S
317 */ 319 */
@@ -331,21 +333,55 @@ static inline void omap_irq_base_init(void)
331#endif 333#endif
332} 334}
333 335
334void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, 336void __init omap2_init_common_infrastructure(void)
335 struct omap_sdrc_params *sdrc_cs1)
336{ 337{
337 u8 skip_setup_idle = 0; 338 u8 postsetup_state;
338 339
339 pwrdm_init(powerdomains_omap); 340 if (cpu_is_omap242x()) {
340 clkdm_init(clockdomains_omap, clkdm_autodeps); 341 omap2xxx_powerdomains_init();
341 if (cpu_is_omap242x()) 342 omap2_clockdomains_init();
342 omap2420_hwmod_init(); 343 omap2420_hwmod_init();
343 else if (cpu_is_omap243x()) 344 } else if (cpu_is_omap243x()) {
345 omap2xxx_powerdomains_init();
346 omap2_clockdomains_init();
344 omap2430_hwmod_init(); 347 omap2430_hwmod_init();
345 else if (cpu_is_omap34xx()) 348 } else if (cpu_is_omap34xx()) {
349 omap3xxx_powerdomains_init();
350 omap2_clockdomains_init();
346 omap3xxx_hwmod_init(); 351 omap3xxx_hwmod_init();
347 else if (cpu_is_omap44xx()) 352 } else if (cpu_is_omap44xx()) {
353 omap44xx_powerdomains_init();
354 omap44xx_clockdomains_init();
348 omap44xx_hwmod_init(); 355 omap44xx_hwmod_init();
356 } else {
357 pr_err("Could not init hwmod data - unknown SoC\n");
358 }
359
360 /* Set the default postsetup state for all hwmods */
361#ifdef CONFIG_PM_RUNTIME
362 postsetup_state = _HWMOD_STATE_IDLE;
363#else
364 postsetup_state = _HWMOD_STATE_ENABLED;
365#endif
366 omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
367
368 /*
369 * Set the default postsetup state for unusual modules (like
370 * MPU WDT).
371 *
372 * The postsetup_state is not actually used until
373 * omap_hwmod_late_init(), so boards that desire full watchdog
374 * coverage of kernel initialization can reprogram the
375 * postsetup_state between the calls to
376 * omap2_init_common_infra() and omap2_init_common_devices().
377 *
378 * XXX ideally we could detect whether the MPU WDT was currently
379 * enabled here and make this conditional
380 */
381 postsetup_state = _HWMOD_STATE_DISABLED;
382 omap_hwmod_for_each_by_class("wd_timer",
383 _set_hwmod_postsetup_state,
384 &postsetup_state);
349 385
350 omap_pm_if_early_init(); 386 omap_pm_if_early_init();
351 387
@@ -358,14 +394,16 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
358 else if (cpu_is_omap44xx()) 394 else if (cpu_is_omap44xx())
359 omap4xxx_clk_init(); 395 omap4xxx_clk_init();
360 else 396 else
361 pr_err("Could not init clock framework - unknown CPU\n"); 397 pr_err("Could not init clock framework - unknown SoC\n");
398}
362 399
400void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
401 struct omap_sdrc_params *sdrc_cs1)
402{
363 omap_serial_early_init(); 403 omap_serial_early_init();
364 404
365#ifndef CONFIG_PM_RUNTIME 405 omap_hwmod_late_init();
366 skip_setup_idle = 1; 406
367#endif
368 omap_hwmod_late_init(skip_setup_idle);
369 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 407 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
370 omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 408 omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
371 _omap2_init_reprogram_sdrc(); 409 _omap2_init_reprogram_sdrc();
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 5a30658444d0..77a8be64cfae 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -135,17 +135,20 @@
135#include <linux/err.h> 135#include <linux/err.h>
136#include <linux/list.h> 136#include <linux/list.h>
137#include <linux/mutex.h> 137#include <linux/mutex.h>
138#include <linux/spinlock.h>
138 139
139#include <plat/common.h> 140#include <plat/common.h>
140#include <plat/cpu.h> 141#include <plat/cpu.h>
141#include <plat/clockdomain.h> 142#include "clockdomain.h"
142#include <plat/powerdomain.h> 143#include "powerdomain.h"
143#include <plat/clock.h> 144#include <plat/clock.h>
144#include <plat/omap_hwmod.h> 145#include <plat/omap_hwmod.h>
145#include <plat/prcm.h> 146#include <plat/prcm.h>
146 147
147#include "cm.h" 148#include "cm2xxx_3xxx.h"
148#include "prm.h" 149#include "cm44xx.h"
150#include "prm2xxx_3xxx.h"
151#include "prm44xx.h"
149 152
150/* Maximum microseconds to wait for OMAP module to softreset */ 153/* Maximum microseconds to wait for OMAP module to softreset */
151#define MAX_MODULE_SOFTRESET_WAIT 10000 154#define MAX_MODULE_SOFTRESET_WAIT 10000
@@ -156,8 +159,6 @@
156/* omap_hwmod_list contains all registered struct omap_hwmods */ 159/* omap_hwmod_list contains all registered struct omap_hwmods */
157static LIST_HEAD(omap_hwmod_list); 160static LIST_HEAD(omap_hwmod_list);
158 161
159static DEFINE_MUTEX(omap_hwmod_mutex);
160
161/* mpu_oh: used to add/remove MPU initiator from sleepdep list */ 162/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
162static struct omap_hwmod *mpu_oh; 163static struct omap_hwmod *mpu_oh;
163 164
@@ -209,10 +210,9 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh)
209 210
210 /* XXX ensure module interface clock is up */ 211 /* XXX ensure module interface clock is up */
211 212
212 if (oh->_sysc_cache != v) { 213 /* Module might have lost context, always update cache and register */
213 oh->_sysc_cache = v; 214 oh->_sysc_cache = v;
214 omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs); 215 omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
215 }
216} 216}
217 217
218/** 218/**
@@ -388,12 +388,13 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle,
388 * Allow the hardware module @oh to send wakeups. Returns -EINVAL 388 * Allow the hardware module @oh to send wakeups. Returns -EINVAL
389 * upon error or 0 upon success. 389 * upon error or 0 upon success.
390 */ 390 */
391static int _enable_wakeup(struct omap_hwmod *oh) 391static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
392{ 392{
393 u32 v, wakeup_mask; 393 u32 wakeup_mask;
394 394
395 if (!oh->class->sysc || 395 if (!oh->class->sysc ||
396 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 396 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
397 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)))
397 return -EINVAL; 398 return -EINVAL;
398 399
399 if (!oh->class->sysc->sysc_fields) { 400 if (!oh->class->sysc->sysc_fields) {
@@ -403,9 +404,10 @@ static int _enable_wakeup(struct omap_hwmod *oh)
403 404
404 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); 405 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift);
405 406
406 v = oh->_sysc_cache; 407 *v |= wakeup_mask;
407 v |= wakeup_mask; 408
408 _write_sysconfig(v, oh); 409 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
410 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v);
409 411
410 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 412 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
411 413
@@ -421,12 +423,13 @@ static int _enable_wakeup(struct omap_hwmod *oh)
421 * Prevent the hardware module @oh to send wakeups. Returns -EINVAL 423 * Prevent the hardware module @oh to send wakeups. Returns -EINVAL
422 * upon error or 0 upon success. 424 * upon error or 0 upon success.
423 */ 425 */
424static int _disable_wakeup(struct omap_hwmod *oh) 426static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
425{ 427{
426 u32 v, wakeup_mask; 428 u32 wakeup_mask;
427 429
428 if (!oh->class->sysc || 430 if (!oh->class->sysc ||
429 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 431 !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) ||
432 (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)))
430 return -EINVAL; 433 return -EINVAL;
431 434
432 if (!oh->class->sysc->sysc_fields) { 435 if (!oh->class->sysc->sysc_fields) {
@@ -436,9 +439,10 @@ static int _disable_wakeup(struct omap_hwmod *oh)
436 439
437 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); 440 wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift);
438 441
439 v = oh->_sysc_cache; 442 *v &= ~wakeup_mask;
440 v &= ~wakeup_mask; 443
441 _write_sysconfig(v, oh); 444 if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP)
445 _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v);
442 446
443 /* XXX test pwrdm_get_wken for this hwmod's subsystem */ 447 /* XXX test pwrdm_get_wken for this hwmod's subsystem */
444 448
@@ -675,7 +679,7 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
675 * Returns the array index of the OCP slave port that the MPU 679 * Returns the array index of the OCP slave port that the MPU
676 * addresses the device on, or -EINVAL upon error or not found. 680 * addresses the device on, or -EINVAL upon error or not found.
677 */ 681 */
678static int _find_mpu_port_index(struct omap_hwmod *oh) 682static int __init _find_mpu_port_index(struct omap_hwmod *oh)
679{ 683{
680 int i; 684 int i;
681 int found = 0; 685 int found = 0;
@@ -709,7 +713,7 @@ static int _find_mpu_port_index(struct omap_hwmod *oh)
709 * Return the virtual address of the base of the register target of 713 * Return the virtual address of the base of the register target of
710 * device @oh, or NULL on error. 714 * device @oh, or NULL on error.
711 */ 715 */
712static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index) 716static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
713{ 717{
714 struct omap_hwmod_ocp_if *os; 718 struct omap_hwmod_ocp_if *os;
715 struct omap_hwmod_addr_space *mem; 719 struct omap_hwmod_addr_space *mem;
@@ -786,11 +790,11 @@ static void _enable_sysc(struct omap_hwmod *oh)
786 (sf & SYSC_HAS_CLOCKACTIVITY)) 790 (sf & SYSC_HAS_CLOCKACTIVITY))
787 _set_clockactivity(oh, oh->class->sysc->clockact, &v); 791 _set_clockactivity(oh, oh->class->sysc->clockact, &v);
788 792
789 _write_sysconfig(v, oh);
790
791 /* If slave is in SMARTIDLE, also enable wakeup */ 793 /* If slave is in SMARTIDLE, also enable wakeup */
792 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE)) 794 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE))
793 _enable_wakeup(oh); 795 _enable_wakeup(oh, &v);
796
797 _write_sysconfig(v, oh);
794 798
795 /* 799 /*
796 * Set the autoidle bit only after setting the smartidle bit 800 * Set the autoidle bit only after setting the smartidle bit
@@ -836,6 +840,10 @@ static void _idle_sysc(struct omap_hwmod *oh)
836 _set_master_standbymode(oh, idlemode, &v); 840 _set_master_standbymode(oh, idlemode, &v);
837 } 841 }
838 842
843 /* If slave is in SMARTIDLE, also enable wakeup */
844 if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE))
845 _enable_wakeup(oh, &v);
846
839 _write_sysconfig(v, oh); 847 _write_sysconfig(v, oh);
840} 848}
841 849
@@ -874,7 +882,6 @@ static void _shutdown_sysc(struct omap_hwmod *oh)
874 * @name: find an omap_hwmod by name 882 * @name: find an omap_hwmod by name
875 * 883 *
876 * Return a pointer to an omap_hwmod by name, or NULL if not found. 884 * Return a pointer to an omap_hwmod by name, or NULL if not found.
877 * Caller must hold omap_hwmod_mutex.
878 */ 885 */
879static struct omap_hwmod *_lookup(const char *name) 886static struct omap_hwmod *_lookup(const char *name)
880{ 887{
@@ -1089,7 +1096,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1089} 1096}
1090 1097
1091/** 1098/**
1092 * _reset - reset an omap_hwmod 1099 * _ocp_softreset - reset an omap_hwmod via the OCP_SYSCONFIG bit
1093 * @oh: struct omap_hwmod * 1100 * @oh: struct omap_hwmod *
1094 * 1101 *
1095 * Resets an omap_hwmod @oh via the OCP_SYSCONFIG bit. hwmod must be 1102 * Resets an omap_hwmod @oh via the OCP_SYSCONFIG bit. hwmod must be
@@ -1098,12 +1105,13 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
1098 * the module did not reset in time, or 0 upon success. 1105 * the module did not reset in time, or 0 upon success.
1099 * 1106 *
1100 * In OMAP3 a specific SYSSTATUS register is used to get the reset status. 1107 * In OMAP3 a specific SYSSTATUS register is used to get the reset status.
1101 * Starting in OMAP4, some IPs does not have SYSSTATUS register and instead 1108 * Starting in OMAP4, some IPs do not have SYSSTATUS registers and instead
1102 * use the SYSCONFIG softreset bit to provide the status. 1109 * use the SYSCONFIG softreset bit to provide the status.
1103 * 1110 *
1104 * Note that some IP like McBSP does have a reset control but no reset status. 1111 * Note that some IP like McBSP do have reset control but don't have
1112 * reset status.
1105 */ 1113 */
1106static int _reset(struct omap_hwmod *oh) 1114static int _ocp_softreset(struct omap_hwmod *oh)
1107{ 1115{
1108 u32 v; 1116 u32 v;
1109 int c = 0; 1117 int c = 0;
@@ -1124,7 +1132,7 @@ static int _reset(struct omap_hwmod *oh)
1124 if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) 1132 if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET)
1125 _enable_optional_clocks(oh); 1133 _enable_optional_clocks(oh);
1126 1134
1127 pr_debug("omap_hwmod: %s: resetting\n", oh->name); 1135 pr_debug("omap_hwmod: %s: resetting via OCP SOFTRESET\n", oh->name);
1128 1136
1129 v = oh->_sysc_cache; 1137 v = oh->_sysc_cache;
1130 ret = _set_softreset(oh, &v); 1138 ret = _set_softreset(oh, &v);
@@ -1164,17 +1172,41 @@ dis_opt_clks:
1164} 1172}
1165 1173
1166/** 1174/**
1167 * _omap_hwmod_enable - enable an omap_hwmod 1175 * _reset - reset an omap_hwmod
1176 * @oh: struct omap_hwmod *
1177 *
1178 * Resets an omap_hwmod @oh. The default software reset mechanism for
1179 * most OMAP IP blocks is triggered via the OCP_SYSCONFIG.SOFTRESET
1180 * bit. However, some hwmods cannot be reset via this method: some
1181 * are not targets and therefore have no OCP header registers to
1182 * access; others (like the IVA) have idiosyncratic reset sequences.
1183 * So for these relatively rare cases, custom reset code can be
1184 * supplied in the struct omap_hwmod_class .reset function pointer.
1185 * Passes along the return value from either _reset() or the custom
1186 * reset function - these must return -EINVAL if the hwmod cannot be
1187 * reset this way or if the hwmod is in the wrong state, -ETIMEDOUT if
1188 * the module did not reset in time, or 0 upon success.
1189 */
1190static int _reset(struct omap_hwmod *oh)
1191{
1192 int ret;
1193
1194 pr_debug("omap_hwmod: %s: resetting\n", oh->name);
1195
1196 ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh);
1197
1198 return ret;
1199}
1200
1201/**
1202 * _enable - enable an omap_hwmod
1168 * @oh: struct omap_hwmod * 1203 * @oh: struct omap_hwmod *
1169 * 1204 *
1170 * Enables an omap_hwmod @oh such that the MPU can access the hwmod's 1205 * Enables an omap_hwmod @oh such that the MPU can access the hwmod's
1171 * register target. (This function has a full name -- 1206 * register target. Returns -EINVAL if the hwmod is in the wrong
1172 * _omap_hwmod_enable() rather than simply _enable() -- because it is 1207 * state or passes along the return value of _wait_target_ready().
1173 * currently required by the pm34xx.c idle loop.) Returns -EINVAL if
1174 * the hwmod is in the wrong state or passes along the return value of
1175 * _wait_target_ready().
1176 */ 1208 */
1177int _omap_hwmod_enable(struct omap_hwmod *oh) 1209static int _enable(struct omap_hwmod *oh)
1178{ 1210{
1179 int r; 1211 int r;
1180 1212
@@ -1213,6 +1245,7 @@ int _omap_hwmod_enable(struct omap_hwmod *oh)
1213 _enable_sysc(oh); 1245 _enable_sysc(oh);
1214 } 1246 }
1215 } else { 1247 } else {
1248 _disable_clocks(oh);
1216 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n", 1249 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n",
1217 oh->name, r); 1250 oh->name, r);
1218 } 1251 }
@@ -1221,16 +1254,14 @@ int _omap_hwmod_enable(struct omap_hwmod *oh)
1221} 1254}
1222 1255
1223/** 1256/**
1224 * _omap_hwmod_idle - idle an omap_hwmod 1257 * _idle - idle an omap_hwmod
1225 * @oh: struct omap_hwmod * 1258 * @oh: struct omap_hwmod *
1226 * 1259 *
1227 * Idles an omap_hwmod @oh. This should be called once the hwmod has 1260 * Idles an omap_hwmod @oh. This should be called once the hwmod has
1228 * no further work. (This function has a full name -- 1261 * no further work. Returns -EINVAL if the hwmod is in the wrong
1229 * _omap_hwmod_idle() rather than simply _idle() -- because it is 1262 * state or returns 0.
1230 * currently required by the pm34xx.c idle loop.) Returns -EINVAL if
1231 * the hwmod is in the wrong state or returns 0.
1232 */ 1263 */
1233int _omap_hwmod_idle(struct omap_hwmod *oh) 1264static int _idle(struct omap_hwmod *oh)
1234{ 1265{
1235 if (oh->_state != _HWMOD_STATE_ENABLED) { 1266 if (oh->_state != _HWMOD_STATE_ENABLED) {
1236 WARN(1, "omap_hwmod: %s: idle state can only be entered from " 1267 WARN(1, "omap_hwmod: %s: idle state can only be entered from "
@@ -1261,6 +1292,9 @@ int _omap_hwmod_idle(struct omap_hwmod *oh)
1261 */ 1292 */
1262static int _shutdown(struct omap_hwmod *oh) 1293static int _shutdown(struct omap_hwmod *oh)
1263{ 1294{
1295 int ret;
1296 u8 prev_state;
1297
1264 if (oh->_state != _HWMOD_STATE_IDLE && 1298 if (oh->_state != _HWMOD_STATE_IDLE &&
1265 oh->_state != _HWMOD_STATE_ENABLED) { 1299 oh->_state != _HWMOD_STATE_ENABLED) {
1266 WARN(1, "omap_hwmod: %s: disabled state can only be entered " 1300 WARN(1, "omap_hwmod: %s: disabled state can only be entered "
@@ -1270,6 +1304,18 @@ static int _shutdown(struct omap_hwmod *oh)
1270 1304
1271 pr_debug("omap_hwmod: %s: disabling\n", oh->name); 1305 pr_debug("omap_hwmod: %s: disabling\n", oh->name);
1272 1306
1307 if (oh->class->pre_shutdown) {
1308 prev_state = oh->_state;
1309 if (oh->_state == _HWMOD_STATE_IDLE)
1310 _enable(oh);
1311 ret = oh->class->pre_shutdown(oh);
1312 if (ret) {
1313 if (prev_state == _HWMOD_STATE_IDLE)
1314 _idle(oh);
1315 return ret;
1316 }
1317 }
1318
1273 if (oh->class->sysc) 1319 if (oh->class->sysc)
1274 _shutdown_sysc(oh); 1320 _shutdown_sysc(oh);
1275 1321
@@ -1298,23 +1344,15 @@ static int _shutdown(struct omap_hwmod *oh)
1298/** 1344/**
1299 * _setup - do initial configuration of omap_hwmod 1345 * _setup - do initial configuration of omap_hwmod
1300 * @oh: struct omap_hwmod * 1346 * @oh: struct omap_hwmod *
1301 * @skip_setup_idle_p: do not idle hwmods at the end of the fn if 1
1302 * 1347 *
1303 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh 1348 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh
1304 * OCP_SYSCONFIG register. @skip_setup_idle is intended to be used on 1349 * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the
1305 * a system that will not call omap_hwmod_enable() to enable devices 1350 * wrong state or returns 0.
1306 * (e.g., a system without PM runtime). Returns -EINVAL if the hwmod
1307 * is in the wrong state or returns 0.
1308 */ 1351 */
1309static int _setup(struct omap_hwmod *oh, void *data) 1352static int _setup(struct omap_hwmod *oh, void *data)
1310{ 1353{
1311 int i, r; 1354 int i, r;
1312 u8 skip_setup_idle; 1355 u8 postsetup_state;
1313
1314 if (!oh || !data)
1315 return -EINVAL;
1316
1317 skip_setup_idle = *(u8 *)data;
1318 1356
1319 /* Set iclk autoidle mode */ 1357 /* Set iclk autoidle mode */
1320 if (oh->slaves_cnt > 0) { 1358 if (oh->slaves_cnt > 0) {
@@ -1334,7 +1372,6 @@ static int _setup(struct omap_hwmod *oh, void *data)
1334 } 1372 }
1335 } 1373 }
1336 1374
1337 mutex_init(&oh->_mutex);
1338 oh->_state = _HWMOD_STATE_INITIALIZED; 1375 oh->_state = _HWMOD_STATE_INITIALIZED;
1339 1376
1340 /* 1377 /*
@@ -1347,7 +1384,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
1347 if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt == 1) 1384 if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt == 1)
1348 return 0; 1385 return 0;
1349 1386
1350 r = _omap_hwmod_enable(oh); 1387 r = _enable(oh);
1351 if (r) { 1388 if (r) {
1352 pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n", 1389 pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n",
1353 oh->name, oh->_state); 1390 oh->name, oh->_state);
@@ -1359,7 +1396,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
1359 1396
1360 /* 1397 /*
1361 * OCP_SYSCONFIG bits need to be reprogrammed after a softreset. 1398 * OCP_SYSCONFIG bits need to be reprogrammed after a softreset.
1362 * The _omap_hwmod_enable() function should be split to 1399 * The _enable() function should be split to
1363 * avoid the rewrite of the OCP_SYSCONFIG register. 1400 * avoid the rewrite of the OCP_SYSCONFIG register.
1364 */ 1401 */
1365 if (oh->class->sysc) { 1402 if (oh->class->sysc) {
@@ -1368,12 +1405,77 @@ static int _setup(struct omap_hwmod *oh, void *data)
1368 } 1405 }
1369 } 1406 }
1370 1407
1371 if (!(oh->flags & HWMOD_INIT_NO_IDLE) && !skip_setup_idle) 1408 postsetup_state = oh->_postsetup_state;
1372 _omap_hwmod_idle(oh); 1409 if (postsetup_state == _HWMOD_STATE_UNKNOWN)
1410 postsetup_state = _HWMOD_STATE_ENABLED;
1411
1412 /*
1413 * XXX HWMOD_INIT_NO_IDLE does not belong in hwmod data -
1414 * it should be set by the core code as a runtime flag during startup
1415 */
1416 if ((oh->flags & HWMOD_INIT_NO_IDLE) &&
1417 (postsetup_state == _HWMOD_STATE_IDLE))
1418 postsetup_state = _HWMOD_STATE_ENABLED;
1419
1420 if (postsetup_state == _HWMOD_STATE_IDLE)
1421 _idle(oh);
1422 else if (postsetup_state == _HWMOD_STATE_DISABLED)
1423 _shutdown(oh);
1424 else if (postsetup_state != _HWMOD_STATE_ENABLED)
1425 WARN(1, "hwmod: %s: unknown postsetup state %d! defaulting to enabled\n",
1426 oh->name, postsetup_state);
1373 1427
1374 return 0; 1428 return 0;
1375} 1429}
1376 1430
1431/**
1432 * _register - register a struct omap_hwmod
1433 * @oh: struct omap_hwmod *
1434 *
1435 * Registers the omap_hwmod @oh. Returns -EEXIST if an omap_hwmod
1436 * already has been registered by the same name; -EINVAL if the
1437 * omap_hwmod is in the wrong state, if @oh is NULL, if the
1438 * omap_hwmod's class field is NULL; if the omap_hwmod is missing a
1439 * name, or if the omap_hwmod's class is missing a name; or 0 upon
1440 * success.
1441 *
1442 * XXX The data should be copied into bootmem, so the original data
1443 * should be marked __initdata and freed after init. This would allow
1444 * unneeded omap_hwmods to be freed on multi-OMAP configurations. Note
1445 * that the copy process would be relatively complex due to the large number
1446 * of substructures.
1447 */
1448static int __init _register(struct omap_hwmod *oh)
1449{
1450 int ret, ms_id;
1451
1452 if (!oh || !oh->name || !oh->class || !oh->class->name ||
1453 (oh->_state != _HWMOD_STATE_UNKNOWN))
1454 return -EINVAL;
1455
1456 pr_debug("omap_hwmod: %s: registering\n", oh->name);
1457
1458 if (_lookup(oh->name))
1459 return -EEXIST;
1460
1461 ms_id = _find_mpu_port_index(oh);
1462 if (!IS_ERR_VALUE(ms_id)) {
1463 oh->_mpu_port_index = ms_id;
1464 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
1465 } else {
1466 oh->_int_flags |= _HWMOD_NO_MPU_PORT;
1467 }
1468
1469 list_add_tail(&oh->node, &omap_hwmod_list);
1470
1471 spin_lock_init(&oh->_lock);
1472
1473 oh->_state = _HWMOD_STATE_REGISTERED;
1474
1475 ret = 0;
1476
1477 return ret;
1478}
1377 1479
1378 1480
1379/* Public functions */ 1481/* Public functions */
@@ -1427,59 +1529,6 @@ int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode)
1427} 1529}
1428 1530
1429/** 1531/**
1430 * omap_hwmod_register - register a struct omap_hwmod
1431 * @oh: struct omap_hwmod *
1432 *
1433 * Registers the omap_hwmod @oh. Returns -EEXIST if an omap_hwmod
1434 * already has been registered by the same name; -EINVAL if the
1435 * omap_hwmod is in the wrong state, if @oh is NULL, if the
1436 * omap_hwmod's class field is NULL; if the omap_hwmod is missing a
1437 * name, or if the omap_hwmod's class is missing a name; or 0 upon
1438 * success.
1439 *
1440 * XXX The data should be copied into bootmem, so the original data
1441 * should be marked __initdata and freed after init. This would allow
1442 * unneeded omap_hwmods to be freed on multi-OMAP configurations. Note
1443 * that the copy process would be relatively complex due to the large number
1444 * of substructures.
1445 */
1446int omap_hwmod_register(struct omap_hwmod *oh)
1447{
1448 int ret, ms_id;
1449
1450 if (!oh || !oh->name || !oh->class || !oh->class->name ||
1451 (oh->_state != _HWMOD_STATE_UNKNOWN))
1452 return -EINVAL;
1453
1454 mutex_lock(&omap_hwmod_mutex);
1455
1456 pr_debug("omap_hwmod: %s: registering\n", oh->name);
1457
1458 if (_lookup(oh->name)) {
1459 ret = -EEXIST;
1460 goto ohr_unlock;
1461 }
1462
1463 ms_id = _find_mpu_port_index(oh);
1464 if (!IS_ERR_VALUE(ms_id)) {
1465 oh->_mpu_port_index = ms_id;
1466 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
1467 } else {
1468 oh->_int_flags |= _HWMOD_NO_MPU_PORT;
1469 }
1470
1471 list_add_tail(&oh->node, &omap_hwmod_list);
1472
1473 oh->_state = _HWMOD_STATE_REGISTERED;
1474
1475 ret = 0;
1476
1477ohr_unlock:
1478 mutex_unlock(&omap_hwmod_mutex);
1479 return ret;
1480}
1481
1482/**
1483 * omap_hwmod_lookup - look up a registered omap_hwmod by name 1532 * omap_hwmod_lookup - look up a registered omap_hwmod by name
1484 * @name: name of the omap_hwmod to look up 1533 * @name: name of the omap_hwmod to look up
1485 * 1534 *
@@ -1493,9 +1542,7 @@ struct omap_hwmod *omap_hwmod_lookup(const char *name)
1493 if (!name) 1542 if (!name)
1494 return NULL; 1543 return NULL;
1495 1544
1496 mutex_lock(&omap_hwmod_mutex);
1497 oh = _lookup(name); 1545 oh = _lookup(name);
1498 mutex_unlock(&omap_hwmod_mutex);
1499 1546
1500 return oh; 1547 return oh;
1501} 1548}
@@ -1521,13 +1568,11 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
1521 if (!fn) 1568 if (!fn)
1522 return -EINVAL; 1569 return -EINVAL;
1523 1570
1524 mutex_lock(&omap_hwmod_mutex);
1525 list_for_each_entry(temp_oh, &omap_hwmod_list, node) { 1571 list_for_each_entry(temp_oh, &omap_hwmod_list, node) {
1526 ret = (*fn)(temp_oh, data); 1572 ret = (*fn)(temp_oh, data);
1527 if (ret) 1573 if (ret)
1528 break; 1574 break;
1529 } 1575 }
1530 mutex_unlock(&omap_hwmod_mutex);
1531 1576
1532 return ret; 1577 return ret;
1533} 1578}
@@ -1542,7 +1587,7 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
1542 * listed in @ohs that are valid for this chip. Returns -EINVAL if 1587 * listed in @ohs that are valid for this chip. Returns -EINVAL if
1543 * omap_hwmod_init() has already been called or 0 otherwise. 1588 * omap_hwmod_init() has already been called or 0 otherwise.
1544 */ 1589 */
1545int omap_hwmod_init(struct omap_hwmod **ohs) 1590int __init omap_hwmod_init(struct omap_hwmod **ohs)
1546{ 1591{
1547 struct omap_hwmod *oh; 1592 struct omap_hwmod *oh;
1548 int r; 1593 int r;
@@ -1558,8 +1603,8 @@ int omap_hwmod_init(struct omap_hwmod **ohs)
1558 oh = *ohs; 1603 oh = *ohs;
1559 while (oh) { 1604 while (oh) {
1560 if (omap_chip_is(oh->omap_chip)) { 1605 if (omap_chip_is(oh->omap_chip)) {
1561 r = omap_hwmod_register(oh); 1606 r = _register(oh);
1562 WARN(r, "omap_hwmod: %s: omap_hwmod_register returned " 1607 WARN(r, "omap_hwmod: %s: _register returned "
1563 "%d\n", oh->name, r); 1608 "%d\n", oh->name, r);
1564 } 1609 }
1565 oh = *++ohs; 1610 oh = *++ohs;
@@ -1570,13 +1615,12 @@ int omap_hwmod_init(struct omap_hwmod **ohs)
1570 1615
1571/** 1616/**
1572 * omap_hwmod_late_init - do some post-clock framework initialization 1617 * omap_hwmod_late_init - do some post-clock framework initialization
1573 * @skip_setup_idle: if 1, do not idle hwmods in _setup()
1574 * 1618 *
1575 * Must be called after omap2_clk_init(). Resolves the struct clk names 1619 * Must be called after omap2_clk_init(). Resolves the struct clk names
1576 * to struct clk pointers for each registered omap_hwmod. Also calls 1620 * to struct clk pointers for each registered omap_hwmod. Also calls
1577 * _setup() on each hwmod. Returns 0. 1621 * _setup() on each hwmod. Returns 0.
1578 */ 1622 */
1579int omap_hwmod_late_init(u8 skip_setup_idle) 1623int omap_hwmod_late_init(void)
1580{ 1624{
1581 int r; 1625 int r;
1582 1626
@@ -1588,36 +1632,7 @@ int omap_hwmod_late_init(u8 skip_setup_idle)
1588 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", 1632 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n",
1589 MPU_INITIATOR_NAME); 1633 MPU_INITIATOR_NAME);
1590 1634
1591 if (skip_setup_idle) 1635 omap_hwmod_for_each(_setup, NULL);
1592 pr_debug("omap_hwmod: will leave hwmods enabled during setup\n");
1593
1594 omap_hwmod_for_each(_setup, &skip_setup_idle);
1595
1596 return 0;
1597}
1598
1599/**
1600 * omap_hwmod_unregister - unregister an omap_hwmod
1601 * @oh: struct omap_hwmod *
1602 *
1603 * Unregisters a previously-registered omap_hwmod @oh. There's probably
1604 * no use case for this, so it is likely to be removed in a later version.
1605 *
1606 * XXX Free all of the bootmem-allocated structures here when that is
1607 * implemented. Make it clear that core code is the only code that is
1608 * expected to unregister modules.
1609 */
1610int omap_hwmod_unregister(struct omap_hwmod *oh)
1611{
1612 if (!oh)
1613 return -EINVAL;
1614
1615 pr_debug("omap_hwmod: %s: unregistering\n", oh->name);
1616
1617 mutex_lock(&omap_hwmod_mutex);
1618 iounmap(oh->_mpu_rt_va);
1619 list_del(&oh->node);
1620 mutex_unlock(&omap_hwmod_mutex);
1621 1636
1622 return 0; 1637 return 0;
1623} 1638}
@@ -1632,18 +1647,18 @@ int omap_hwmod_unregister(struct omap_hwmod *oh)
1632int omap_hwmod_enable(struct omap_hwmod *oh) 1647int omap_hwmod_enable(struct omap_hwmod *oh)
1633{ 1648{
1634 int r; 1649 int r;
1650 unsigned long flags;
1635 1651
1636 if (!oh) 1652 if (!oh)
1637 return -EINVAL; 1653 return -EINVAL;
1638 1654
1639 mutex_lock(&oh->_mutex); 1655 spin_lock_irqsave(&oh->_lock, flags);
1640 r = _omap_hwmod_enable(oh); 1656 r = _enable(oh);
1641 mutex_unlock(&oh->_mutex); 1657 spin_unlock_irqrestore(&oh->_lock, flags);
1642 1658
1643 return r; 1659 return r;
1644} 1660}
1645 1661
1646
1647/** 1662/**
1648 * omap_hwmod_idle - idle an omap_hwmod 1663 * omap_hwmod_idle - idle an omap_hwmod
1649 * @oh: struct omap_hwmod * 1664 * @oh: struct omap_hwmod *
@@ -1653,12 +1668,14 @@ int omap_hwmod_enable(struct omap_hwmod *oh)
1653 */ 1668 */
1654int omap_hwmod_idle(struct omap_hwmod *oh) 1669int omap_hwmod_idle(struct omap_hwmod *oh)
1655{ 1670{
1671 unsigned long flags;
1672
1656 if (!oh) 1673 if (!oh)
1657 return -EINVAL; 1674 return -EINVAL;
1658 1675
1659 mutex_lock(&oh->_mutex); 1676 spin_lock_irqsave(&oh->_lock, flags);
1660 _omap_hwmod_idle(oh); 1677 _idle(oh);
1661 mutex_unlock(&oh->_mutex); 1678 spin_unlock_irqrestore(&oh->_lock, flags);
1662 1679
1663 return 0; 1680 return 0;
1664} 1681}
@@ -1673,12 +1690,14 @@ int omap_hwmod_idle(struct omap_hwmod *oh)
1673 */ 1690 */
1674int omap_hwmod_shutdown(struct omap_hwmod *oh) 1691int omap_hwmod_shutdown(struct omap_hwmod *oh)
1675{ 1692{
1693 unsigned long flags;
1694
1676 if (!oh) 1695 if (!oh)
1677 return -EINVAL; 1696 return -EINVAL;
1678 1697
1679 mutex_lock(&oh->_mutex); 1698 spin_lock_irqsave(&oh->_lock, flags);
1680 _shutdown(oh); 1699 _shutdown(oh);
1681 mutex_unlock(&oh->_mutex); 1700 spin_unlock_irqrestore(&oh->_lock, flags);
1682 1701
1683 return 0; 1702 return 0;
1684} 1703}
@@ -1691,9 +1710,11 @@ int omap_hwmod_shutdown(struct omap_hwmod *oh)
1691 */ 1710 */
1692int omap_hwmod_enable_clocks(struct omap_hwmod *oh) 1711int omap_hwmod_enable_clocks(struct omap_hwmod *oh)
1693{ 1712{
1694 mutex_lock(&oh->_mutex); 1713 unsigned long flags;
1714
1715 spin_lock_irqsave(&oh->_lock, flags);
1695 _enable_clocks(oh); 1716 _enable_clocks(oh);
1696 mutex_unlock(&oh->_mutex); 1717 spin_unlock_irqrestore(&oh->_lock, flags);
1697 1718
1698 return 0; 1719 return 0;
1699} 1720}
@@ -1706,9 +1727,11 @@ int omap_hwmod_enable_clocks(struct omap_hwmod *oh)
1706 */ 1727 */
1707int omap_hwmod_disable_clocks(struct omap_hwmod *oh) 1728int omap_hwmod_disable_clocks(struct omap_hwmod *oh)
1708{ 1729{
1709 mutex_lock(&oh->_mutex); 1730 unsigned long flags;
1731
1732 spin_lock_irqsave(&oh->_lock, flags);
1710 _disable_clocks(oh); 1733 _disable_clocks(oh);
1711 mutex_unlock(&oh->_mutex); 1734 spin_unlock_irqrestore(&oh->_lock, flags);
1712 1735
1713 return 0; 1736 return 0;
1714} 1737}
@@ -1752,13 +1775,14 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh)
1752int omap_hwmod_reset(struct omap_hwmod *oh) 1775int omap_hwmod_reset(struct omap_hwmod *oh)
1753{ 1776{
1754 int r; 1777 int r;
1778 unsigned long flags;
1755 1779
1756 if (!oh) 1780 if (!oh)
1757 return -EINVAL; 1781 return -EINVAL;
1758 1782
1759 mutex_lock(&oh->_mutex); 1783 spin_lock_irqsave(&oh->_lock, flags);
1760 r = _reset(oh); 1784 r = _reset(oh);
1761 mutex_unlock(&oh->_mutex); 1785 spin_unlock_irqrestore(&oh->_lock, flags);
1762 1786
1763 return r; 1787 return r;
1764} 1788}
@@ -1955,13 +1979,18 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
1955 */ 1979 */
1956int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) 1980int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
1957{ 1981{
1982 unsigned long flags;
1983 u32 v;
1984
1958 if (!oh->class->sysc || 1985 if (!oh->class->sysc ||
1959 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 1986 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
1960 return -EINVAL; 1987 return -EINVAL;
1961 1988
1962 mutex_lock(&oh->_mutex); 1989 spin_lock_irqsave(&oh->_lock, flags);
1963 _enable_wakeup(oh); 1990 v = oh->_sysc_cache;
1964 mutex_unlock(&oh->_mutex); 1991 _enable_wakeup(oh, &v);
1992 _write_sysconfig(v, oh);
1993 spin_unlock_irqrestore(&oh->_lock, flags);
1965 1994
1966 return 0; 1995 return 0;
1967} 1996}
@@ -1980,13 +2009,18 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
1980 */ 2009 */
1981int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) 2010int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
1982{ 2011{
2012 unsigned long flags;
2013 u32 v;
2014
1983 if (!oh->class->sysc || 2015 if (!oh->class->sysc ||
1984 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) 2016 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
1985 return -EINVAL; 2017 return -EINVAL;
1986 2018
1987 mutex_lock(&oh->_mutex); 2019 spin_lock_irqsave(&oh->_lock, flags);
1988 _disable_wakeup(oh); 2020 v = oh->_sysc_cache;
1989 mutex_unlock(&oh->_mutex); 2021 _disable_wakeup(oh, &v);
2022 _write_sysconfig(v, oh);
2023 spin_unlock_irqrestore(&oh->_lock, flags);
1990 2024
1991 return 0; 2025 return 0;
1992} 2026}
@@ -2006,13 +2040,14 @@ int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
2006int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name) 2040int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name)
2007{ 2041{
2008 int ret; 2042 int ret;
2043 unsigned long flags;
2009 2044
2010 if (!oh) 2045 if (!oh)
2011 return -EINVAL; 2046 return -EINVAL;
2012 2047
2013 mutex_lock(&oh->_mutex); 2048 spin_lock_irqsave(&oh->_lock, flags);
2014 ret = _assert_hardreset(oh, name); 2049 ret = _assert_hardreset(oh, name);
2015 mutex_unlock(&oh->_mutex); 2050 spin_unlock_irqrestore(&oh->_lock, flags);
2016 2051
2017 return ret; 2052 return ret;
2018} 2053}
@@ -2032,13 +2067,14 @@ int omap_hwmod_assert_hardreset(struct omap_hwmod *oh, const char *name)
2032int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name) 2067int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name)
2033{ 2068{
2034 int ret; 2069 int ret;
2070 unsigned long flags;
2035 2071
2036 if (!oh) 2072 if (!oh)
2037 return -EINVAL; 2073 return -EINVAL;
2038 2074
2039 mutex_lock(&oh->_mutex); 2075 spin_lock_irqsave(&oh->_lock, flags);
2040 ret = _deassert_hardreset(oh, name); 2076 ret = _deassert_hardreset(oh, name);
2041 mutex_unlock(&oh->_mutex); 2077 spin_unlock_irqrestore(&oh->_lock, flags);
2042 2078
2043 return ret; 2079 return ret;
2044} 2080}
@@ -2057,13 +2093,14 @@ int omap_hwmod_deassert_hardreset(struct omap_hwmod *oh, const char *name)
2057int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name) 2093int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
2058{ 2094{
2059 int ret; 2095 int ret;
2096 unsigned long flags;
2060 2097
2061 if (!oh) 2098 if (!oh)
2062 return -EINVAL; 2099 return -EINVAL;
2063 2100
2064 mutex_lock(&oh->_mutex); 2101 spin_lock_irqsave(&oh->_lock, flags);
2065 ret = _read_hardreset(oh, name); 2102 ret = _read_hardreset(oh, name);
2066 mutex_unlock(&oh->_mutex); 2103 spin_unlock_irqrestore(&oh->_lock, flags);
2067 2104
2068 return ret; 2105 return ret;
2069} 2106}
@@ -2075,9 +2112,8 @@ int omap_hwmod_read_hardreset(struct omap_hwmod *oh, const char *name)
2075 * @fn: callback function pointer to call for each hwmod in class @classname 2112 * @fn: callback function pointer to call for each hwmod in class @classname
2076 * @user: arbitrary context data to pass to the callback function 2113 * @user: arbitrary context data to pass to the callback function
2077 * 2114 *
2078 * For each omap_hwmod of class @classname, call @fn. Takes 2115 * For each omap_hwmod of class @classname, call @fn.
2079 * omap_hwmod_mutex to prevent the hwmod list from changing during the 2116 * If the callback function returns something other than
2080 * iteration. If the callback function returns something other than
2081 * zero, the iterator is terminated, and the callback function's return 2117 * zero, the iterator is terminated, and the callback function's return
2082 * value is passed back to the caller. Returns 0 upon success, -EINVAL 2118 * value is passed back to the caller. Returns 0 upon success, -EINVAL
2083 * if @classname or @fn are NULL, or passes back the error code from @fn. 2119 * if @classname or @fn are NULL, or passes back the error code from @fn.
@@ -2096,8 +2132,6 @@ int omap_hwmod_for_each_by_class(const char *classname,
2096 pr_debug("omap_hwmod: %s: looking for modules of class %s\n", 2132 pr_debug("omap_hwmod: %s: looking for modules of class %s\n",
2097 __func__, classname); 2133 __func__, classname);
2098 2134
2099 mutex_lock(&omap_hwmod_mutex);
2100
2101 list_for_each_entry(temp_oh, &omap_hwmod_list, node) { 2135 list_for_each_entry(temp_oh, &omap_hwmod_list, node) {
2102 if (!strcmp(temp_oh->class->name, classname)) { 2136 if (!strcmp(temp_oh->class->name, classname)) {
2103 pr_debug("omap_hwmod: %s: %s: calling callback fn\n", 2137 pr_debug("omap_hwmod: %s: %s: calling callback fn\n",
@@ -2108,8 +2142,6 @@ int omap_hwmod_for_each_by_class(const char *classname,
2108 } 2142 }
2109 } 2143 }
2110 2144
2111 mutex_unlock(&omap_hwmod_mutex);
2112
2113 if (ret) 2145 if (ret)
2114 pr_debug("omap_hwmod: %s: iterator terminated early: %d\n", 2146 pr_debug("omap_hwmod: %s: iterator terminated early: %d\n",
2115 __func__, ret); 2147 __func__, ret);
@@ -2117,3 +2149,64 @@ int omap_hwmod_for_each_by_class(const char *classname,
2117 return ret; 2149 return ret;
2118} 2150}
2119 2151
2152/**
2153 * omap_hwmod_set_postsetup_state - set the post-_setup() state for this hwmod
2154 * @oh: struct omap_hwmod *
2155 * @state: state that _setup() should leave the hwmod in
2156 *
2157 * Sets the hwmod state that @oh will enter at the end of _setup() (called by
2158 * omap_hwmod_late_init()). Only valid to call between calls to
2159 * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or
2160 * -EINVAL if there is a problem with the arguments or if the hwmod is
2161 * in the wrong state.
2162 */
2163int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
2164{
2165 int ret;
2166 unsigned long flags;
2167
2168 if (!oh)
2169 return -EINVAL;
2170
2171 if (state != _HWMOD_STATE_DISABLED &&
2172 state != _HWMOD_STATE_ENABLED &&
2173 state != _HWMOD_STATE_IDLE)
2174 return -EINVAL;
2175
2176 spin_lock_irqsave(&oh->_lock, flags);
2177
2178 if (oh->_state != _HWMOD_STATE_REGISTERED) {
2179 ret = -EINVAL;
2180 goto ohsps_unlock;
2181 }
2182
2183 oh->_postsetup_state = state;
2184 ret = 0;
2185
2186ohsps_unlock:
2187 spin_unlock_irqrestore(&oh->_lock, flags);
2188
2189 return ret;
2190}
2191
2192/**
2193 * omap_hwmod_get_context_loss_count - get lost context count
2194 * @oh: struct omap_hwmod *
2195 *
2196 * Query the powerdomain of of @oh to get the context loss
2197 * count for this device.
2198 *
2199 * Returns the context loss count of the powerdomain assocated with @oh
2200 * upon success, or zero if no powerdomain exists for @oh.
2201 */
2202u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
2203{
2204 struct powerdomain *pwrdm;
2205 int ret = 0;
2206
2207 pwrdm = omap_hwmod_get_pwrdm(oh);
2208 if (pwrdm)
2209 ret = pwrdm_get_context_loss_count(pwrdm);
2210
2211 return ret;
2212}
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 42606f6b0cdf..b85c630b64d6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -23,6 +23,7 @@
23 23
24#include "cm-regbits-24xx.h" 24#include "cm-regbits-24xx.h"
25#include "prm-regbits-24xx.h" 25#include "prm-regbits-24xx.h"
26#include "wd_timer.h"
26 27
27/* 28/*
28 * OMAP2420 hardware module integration data 29 * OMAP2420 hardware module integration data
@@ -312,8 +313,9 @@ static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
312}; 313};
313 314
314static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = { 315static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = {
315 .name = "wd_timer", 316 .name = "wd_timer",
316 .sysc = &omap2420_wd_timer_sysc, 317 .sysc = &omap2420_wd_timer_sysc,
318 .pre_shutdown = &omap2_wd_timer_disable
317}; 319};
318 320
319/* wd_timer2 */ 321/* wd_timer2 */
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 3315d241feef..8ecfbcde13ba 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -23,6 +23,7 @@
23 23
24#include "prm-regbits-24xx.h" 24#include "prm-regbits-24xx.h"
25#include "cm-regbits-24xx.h" 25#include "cm-regbits-24xx.h"
26#include "wd_timer.h"
26 27
27/* 28/*
28 * OMAP2430 hardware module integration data 29 * OMAP2430 hardware module integration data
@@ -311,8 +312,9 @@ static struct omap_hwmod_class_sysconfig omap2430_wd_timer_sysc = {
311}; 312};
312 313
313static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = { 314static struct omap_hwmod_class omap2430_wd_timer_hwmod_class = {
314 .name = "wd_timer", 315 .name = "wd_timer",
315 .sysc = &omap2430_wd_timer_sysc, 316 .sysc = &omap2430_wd_timer_sysc,
317 .pre_shutdown = &omap2_wd_timer_disable
316}; 318};
317 319
318/* wd_timer2 */ 320/* wd_timer2 */
@@ -481,12 +483,12 @@ static struct omap_hwmod_class i2c_class = {
481 .sysc = &i2c_sysc, 483 .sysc = &i2c_sysc,
482}; 484};
483 485
484/* I2C1 */ 486static struct omap_i2c_dev_attr i2c_dev_attr = {
485
486static struct omap_i2c_dev_attr i2c1_dev_attr = {
487 .fifo_depth = 8, /* bytes */ 487 .fifo_depth = 8, /* bytes */
488}; 488};
489 489
490/* I2C1 */
491
490static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = { 492static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
491 { .irq = INT_24XX_I2C1_IRQ, }, 493 { .irq = INT_24XX_I2C1_IRQ, },
492}; 494};
@@ -527,16 +529,12 @@ static struct omap_hwmod omap2430_i2c1_hwmod = {
527 .slaves = omap2430_i2c1_slaves, 529 .slaves = omap2430_i2c1_slaves,
528 .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves), 530 .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves),
529 .class = &i2c_class, 531 .class = &i2c_class,
530 .dev_attr = &i2c1_dev_attr, 532 .dev_attr = &i2c_dev_attr,
531 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 533 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
532}; 534};
533 535
534/* I2C2 */ 536/* I2C2 */
535 537
536static struct omap_i2c_dev_attr i2c2_dev_attr = {
537 .fifo_depth = 8, /* bytes */
538};
539
540static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = { 538static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
541 { .irq = INT_24XX_I2C2_IRQ, }, 539 { .irq = INT_24XX_I2C2_IRQ, },
542}; 540};
@@ -569,7 +567,7 @@ static struct omap_hwmod omap2430_i2c2_hwmod = {
569 .slaves = omap2430_i2c2_slaves, 567 .slaves = omap2430_i2c2_slaves,
570 .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves), 568 .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves),
571 .class = &i2c_class, 569 .class = &i2c_class,
572 .dev_attr = &i2c2_dev_attr, 570 .dev_attr = &i2c_dev_attr,
573 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 571 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
574}; 572};
575 573
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index d5acb63ba9e0..89a943e9459c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -26,6 +26,7 @@
26 26
27#include "prm-regbits-34xx.h" 27#include "prm-regbits-34xx.h"
28#include "cm-regbits-34xx.h" 28#include "cm-regbits-34xx.h"
29#include "wd_timer.h"
29 30
30/* 31/*
31 * OMAP3xxx hardware module integration data 32 * OMAP3xxx hardware module integration data
@@ -423,8 +424,9 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
423}; 424};
424 425
425static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = { 426static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = {
426 .name = "wd_timer", 427 .name = "wd_timer",
427 .sysc = &omap3xxx_wd_timer_sysc, 428 .sysc = &omap3xxx_wd_timer_sysc,
429 .pre_shutdown = &omap2_wd_timer_disable
428}; 430};
429 431
430/* wd_timer2 */ 432/* wd_timer2 */
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index f9778fba8322..c9c98ee81191 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -27,8 +27,11 @@
27 27
28#include "omap_hwmod_common_data.h" 28#include "omap_hwmod_common_data.h"
29 29
30#include "cm.h" 30#include "cm1_44xx.h"
31#include "cm2_44xx.h"
32#include "prm44xx.h"
31#include "prm-regbits-44xx.h" 33#include "prm-regbits-44xx.h"
34#include "wd_timer.h"
32 35
33/* Base offset for all OMAP4 interrupts external to MPUSS */ 36/* Base offset for all OMAP4 interrupts external to MPUSS */
34#define OMAP44XX_IRQ_GIC_START 32 37#define OMAP44XX_IRQ_GIC_START 32
@@ -39,7 +42,9 @@
39/* Backward references (IPs with Bus Master capability) */ 42/* Backward references (IPs with Bus Master capability) */
40static struct omap_hwmod omap44xx_dma_system_hwmod; 43static struct omap_hwmod omap44xx_dma_system_hwmod;
41static struct omap_hwmod omap44xx_dmm_hwmod; 44static struct omap_hwmod omap44xx_dmm_hwmod;
45static struct omap_hwmod omap44xx_dsp_hwmod;
42static struct omap_hwmod omap44xx_emif_fw_hwmod; 46static struct omap_hwmod omap44xx_emif_fw_hwmod;
47static struct omap_hwmod omap44xx_iva_hwmod;
43static struct omap_hwmod omap44xx_l3_instr_hwmod; 48static struct omap_hwmod omap44xx_l3_instr_hwmod;
44static struct omap_hwmod omap44xx_l3_main_1_hwmod; 49static struct omap_hwmod omap44xx_l3_main_1_hwmod;
45static struct omap_hwmod omap44xx_l3_main_2_hwmod; 50static struct omap_hwmod omap44xx_l3_main_2_hwmod;
@@ -70,7 +75,15 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_1__dmm = {
70 .master = &omap44xx_l3_main_1_hwmod, 75 .master = &omap44xx_l3_main_1_hwmod,
71 .slave = &omap44xx_dmm_hwmod, 76 .slave = &omap44xx_dmm_hwmod,
72 .clk = "l3_div_ck", 77 .clk = "l3_div_ck",
73 .user = OCP_USER_MPU | OCP_USER_SDMA, 78 .user = OCP_USER_SDMA,
79};
80
81static struct omap_hwmod_addr_space omap44xx_dmm_addrs[] = {
82 {
83 .pa_start = 0x4e000000,
84 .pa_end = 0x4e0007ff,
85 .flags = ADDR_TYPE_RT
86 },
74}; 87};
75 88
76/* mpu -> dmm */ 89/* mpu -> dmm */
@@ -78,7 +91,9 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__dmm = {
78 .master = &omap44xx_mpu_hwmod, 91 .master = &omap44xx_mpu_hwmod,
79 .slave = &omap44xx_dmm_hwmod, 92 .slave = &omap44xx_dmm_hwmod,
80 .clk = "l3_div_ck", 93 .clk = "l3_div_ck",
81 .user = OCP_USER_MPU | OCP_USER_SDMA, 94 .addr = omap44xx_dmm_addrs,
95 .addr_cnt = ARRAY_SIZE(omap44xx_dmm_addrs),
96 .user = OCP_USER_MPU,
82}; 97};
83 98
84/* dmm slave ports */ 99/* dmm slave ports */
@@ -118,12 +133,22 @@ static struct omap_hwmod_ocp_if omap44xx_dmm__emif_fw = {
118 .user = OCP_USER_MPU | OCP_USER_SDMA, 133 .user = OCP_USER_MPU | OCP_USER_SDMA,
119}; 134};
120 135
136static struct omap_hwmod_addr_space omap44xx_emif_fw_addrs[] = {
137 {
138 .pa_start = 0x4a20c000,
139 .pa_end = 0x4a20c0ff,
140 .flags = ADDR_TYPE_RT
141 },
142};
143
121/* l4_cfg -> emif_fw */ 144/* l4_cfg -> emif_fw */
122static struct omap_hwmod_ocp_if omap44xx_l4_cfg__emif_fw = { 145static struct omap_hwmod_ocp_if omap44xx_l4_cfg__emif_fw = {
123 .master = &omap44xx_l4_cfg_hwmod, 146 .master = &omap44xx_l4_cfg_hwmod,
124 .slave = &omap44xx_emif_fw_hwmod, 147 .slave = &omap44xx_emif_fw_hwmod,
125 .clk = "l4_div_ck", 148 .clk = "l4_div_ck",
126 .user = OCP_USER_MPU | OCP_USER_SDMA, 149 .addr = omap44xx_emif_fw_addrs,
150 .addr_cnt = ARRAY_SIZE(omap44xx_emif_fw_addrs),
151 .user = OCP_USER_MPU,
127}; 152};
128 153
129/* emif_fw slave ports */ 154/* emif_fw slave ports */
@@ -149,6 +174,14 @@ static struct omap_hwmod_class omap44xx_l3_hwmod_class = {
149}; 174};
150 175
151/* l3_instr interface data */ 176/* l3_instr interface data */
177/* iva -> l3_instr */
178static struct omap_hwmod_ocp_if omap44xx_iva__l3_instr = {
179 .master = &omap44xx_iva_hwmod,
180 .slave = &omap44xx_l3_instr_hwmod,
181 .clk = "l3_div_ck",
182 .user = OCP_USER_MPU | OCP_USER_SDMA,
183};
184
152/* l3_main_3 -> l3_instr */ 185/* l3_main_3 -> l3_instr */
153static struct omap_hwmod_ocp_if omap44xx_l3_main_3__l3_instr = { 186static struct omap_hwmod_ocp_if omap44xx_l3_main_3__l3_instr = {
154 .master = &omap44xx_l3_main_3_hwmod, 187 .master = &omap44xx_l3_main_3_hwmod,
@@ -159,6 +192,7 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_3__l3_instr = {
159 192
160/* l3_instr slave ports */ 193/* l3_instr slave ports */
161static struct omap_hwmod_ocp_if *omap44xx_l3_instr_slaves[] = { 194static struct omap_hwmod_ocp_if *omap44xx_l3_instr_slaves[] = {
195 &omap44xx_iva__l3_instr,
162 &omap44xx_l3_main_3__l3_instr, 196 &omap44xx_l3_main_3__l3_instr,
163}; 197};
164 198
@@ -170,6 +204,15 @@ static struct omap_hwmod omap44xx_l3_instr_hwmod = {
170 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 204 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
171}; 205};
172 206
207/* l3_main_1 interface data */
208/* dsp -> l3_main_1 */
209static struct omap_hwmod_ocp_if omap44xx_dsp__l3_main_1 = {
210 .master = &omap44xx_dsp_hwmod,
211 .slave = &omap44xx_l3_main_1_hwmod,
212 .clk = "l3_div_ck",
213 .user = OCP_USER_MPU | OCP_USER_SDMA,
214};
215
173/* l3_main_2 -> l3_main_1 */ 216/* l3_main_2 -> l3_main_1 */
174static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = { 217static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = {
175 .master = &omap44xx_l3_main_2_hwmod, 218 .master = &omap44xx_l3_main_2_hwmod,
@@ -196,6 +239,7 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = {
196 239
197/* l3_main_1 slave ports */ 240/* l3_main_1 slave ports */
198static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { 241static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = {
242 &omap44xx_dsp__l3_main_1,
199 &omap44xx_l3_main_2__l3_main_1, 243 &omap44xx_l3_main_2__l3_main_1,
200 &omap44xx_l4_cfg__l3_main_1, 244 &omap44xx_l4_cfg__l3_main_1,
201 &omap44xx_mpu__l3_main_1, 245 &omap44xx_mpu__l3_main_1,
@@ -210,6 +254,14 @@ static struct omap_hwmod omap44xx_l3_main_1_hwmod = {
210}; 254};
211 255
212/* l3_main_2 interface data */ 256/* l3_main_2 interface data */
257/* iva -> l3_main_2 */
258static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = {
259 .master = &omap44xx_iva_hwmod,
260 .slave = &omap44xx_l3_main_2_hwmod,
261 .clk = "l3_div_ck",
262 .user = OCP_USER_MPU | OCP_USER_SDMA,
263};
264
213/* l3_main_1 -> l3_main_2 */ 265/* l3_main_1 -> l3_main_2 */
214static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { 266static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = {
215 .master = &omap44xx_l3_main_1_hwmod, 267 .master = &omap44xx_l3_main_1_hwmod,
@@ -237,6 +289,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_2 = {
237/* l3_main_2 slave ports */ 289/* l3_main_2 slave ports */
238static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { 290static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = {
239 &omap44xx_dma_system__l3_main_2, 291 &omap44xx_dma_system__l3_main_2,
292 &omap44xx_iva__l3_main_2,
240 &omap44xx_l3_main_1__l3_main_2, 293 &omap44xx_l3_main_1__l3_main_2,
241 &omap44xx_l4_cfg__l3_main_2, 294 &omap44xx_l4_cfg__l3_main_2,
242}; 295};
@@ -298,6 +351,14 @@ static struct omap_hwmod_class omap44xx_l4_hwmod_class = {
298}; 351};
299 352
300/* l4_abe interface data */ 353/* l4_abe interface data */
354/* dsp -> l4_abe */
355static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = {
356 .master = &omap44xx_dsp_hwmod,
357 .slave = &omap44xx_l4_abe_hwmod,
358 .clk = "ocp_abe_iclk",
359 .user = OCP_USER_MPU | OCP_USER_SDMA,
360};
361
301/* l3_main_1 -> l4_abe */ 362/* l3_main_1 -> l4_abe */
302static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l4_abe = { 363static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l4_abe = {
303 .master = &omap44xx_l3_main_1_hwmod, 364 .master = &omap44xx_l3_main_1_hwmod,
@@ -316,6 +377,7 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l4_abe = {
316 377
317/* l4_abe slave ports */ 378/* l4_abe slave ports */
318static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = { 379static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = {
380 &omap44xx_dsp__l4_abe,
319 &omap44xx_l3_main_1__l4_abe, 381 &omap44xx_l3_main_1__l4_abe,
320 &omap44xx_mpu__l4_abe, 382 &omap44xx_mpu__l4_abe,
321}; 383};
@@ -395,6 +457,560 @@ static struct omap_hwmod omap44xx_l4_wkup_hwmod = {
395}; 457};
396 458
397/* 459/*
460 * 'mpu_bus' class
461 * instance(s): mpu_private
462 */
463static struct omap_hwmod_class omap44xx_mpu_bus_hwmod_class = {
464 .name = "mpu_bus",
465};
466
467/* mpu_private interface data */
468/* mpu -> mpu_private */
469static struct omap_hwmod_ocp_if omap44xx_mpu__mpu_private = {
470 .master = &omap44xx_mpu_hwmod,
471 .slave = &omap44xx_mpu_private_hwmod,
472 .clk = "l3_div_ck",
473 .user = OCP_USER_MPU | OCP_USER_SDMA,
474};
475
476/* mpu_private slave ports */
477static struct omap_hwmod_ocp_if *omap44xx_mpu_private_slaves[] = {
478 &omap44xx_mpu__mpu_private,
479};
480
481static struct omap_hwmod omap44xx_mpu_private_hwmod = {
482 .name = "mpu_private",
483 .class = &omap44xx_mpu_bus_hwmod_class,
484 .slaves = omap44xx_mpu_private_slaves,
485 .slaves_cnt = ARRAY_SIZE(omap44xx_mpu_private_slaves),
486 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
487};
488
489/*
490 * Modules omap_hwmod structures
491 *
492 * The following IPs are excluded for the moment because:
493 * - They do not need an explicit SW control using omap_hwmod API.
494 * - They still need to be validated with the driver
495 * properly adapted to omap_hwmod / omap_device
496 *
497 * aess
498 * bandgap
499 * c2c
500 * c2c_target_fw
501 * cm_core
502 * cm_core_aon
503 * counter_32k
504 * ctrl_module_core
505 * ctrl_module_pad_core
506 * ctrl_module_pad_wkup
507 * ctrl_module_wkup
508 * debugss
509 * dma_system
510 * dmic
511 * dss
512 * dss_dispc
513 * dss_dsi1
514 * dss_dsi2
515 * dss_hdmi
516 * dss_rfbi
517 * dss_venc
518 * efuse_ctrl_cust
519 * efuse_ctrl_std
520 * elm
521 * emif1
522 * emif2
523 * fdif
524 * gpmc
525 * gpu
526 * hdq1w
527 * hsi
528 * ipu
529 * iss
530 * kbd
531 * mailbox
532 * mcasp
533 * mcbsp1
534 * mcbsp2
535 * mcbsp3
536 * mcbsp4
537 * mcpdm
538 * mcspi1
539 * mcspi2
540 * mcspi3
541 * mcspi4
542 * mmc1
543 * mmc2
544 * mmc3
545 * mmc4
546 * mmc5
547 * mpu_c0
548 * mpu_c1
549 * ocmc_ram
550 * ocp2scp_usb_phy
551 * ocp_wp_noc
552 * prcm
553 * prcm_mpu
554 * prm
555 * scrm
556 * sl2if
557 * slimbus1
558 * slimbus2
559 * smartreflex_core
560 * smartreflex_iva
561 * smartreflex_mpu
562 * spinlock
563 * timer1
564 * timer10
565 * timer11
566 * timer2
567 * timer3
568 * timer4
569 * timer5
570 * timer6
571 * timer7
572 * timer8
573 * timer9
574 * usb_host_fs
575 * usb_host_hs
576 * usb_otg_hs
577 * usb_phy_cm
578 * usb_tll_hs
579 * usim
580 */
581
582/*
583 * 'dsp' class
584 * dsp sub-system
585 */
586
587static struct omap_hwmod_class omap44xx_dsp_hwmod_class = {
588 .name = "dsp",
589};
590
591/* dsp */
592static struct omap_hwmod_irq_info omap44xx_dsp_irqs[] = {
593 { .irq = 28 + OMAP44XX_IRQ_GIC_START },
594};
595
596static struct omap_hwmod_rst_info omap44xx_dsp_resets[] = {
597 { .name = "mmu_cache", .rst_shift = 1 },
598};
599
600static struct omap_hwmod_rst_info omap44xx_dsp_c0_resets[] = {
601 { .name = "dsp", .rst_shift = 0 },
602};
603
604/* dsp -> iva */
605static struct omap_hwmod_ocp_if omap44xx_dsp__iva = {
606 .master = &omap44xx_dsp_hwmod,
607 .slave = &omap44xx_iva_hwmod,
608 .clk = "dpll_iva_m5x2_ck",
609};
610
611/* dsp master ports */
612static struct omap_hwmod_ocp_if *omap44xx_dsp_masters[] = {
613 &omap44xx_dsp__l3_main_1,
614 &omap44xx_dsp__l4_abe,
615 &omap44xx_dsp__iva,
616};
617
618/* l4_cfg -> dsp */
619static struct omap_hwmod_ocp_if omap44xx_l4_cfg__dsp = {
620 .master = &omap44xx_l4_cfg_hwmod,
621 .slave = &omap44xx_dsp_hwmod,
622 .clk = "l4_div_ck",
623 .user = OCP_USER_MPU | OCP_USER_SDMA,
624};
625
626/* dsp slave ports */
627static struct omap_hwmod_ocp_if *omap44xx_dsp_slaves[] = {
628 &omap44xx_l4_cfg__dsp,
629};
630
631/* Pseudo hwmod for reset control purpose only */
632static struct omap_hwmod omap44xx_dsp_c0_hwmod = {
633 .name = "dsp_c0",
634 .class = &omap44xx_dsp_hwmod_class,
635 .flags = HWMOD_INIT_NO_RESET,
636 .rst_lines = omap44xx_dsp_c0_resets,
637 .rst_lines_cnt = ARRAY_SIZE(omap44xx_dsp_c0_resets),
638 .prcm = {
639 .omap4 = {
640 .rstctrl_reg = OMAP4430_RM_TESLA_RSTCTRL,
641 },
642 },
643 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
644};
645
646static struct omap_hwmod omap44xx_dsp_hwmod = {
647 .name = "dsp",
648 .class = &omap44xx_dsp_hwmod_class,
649 .mpu_irqs = omap44xx_dsp_irqs,
650 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dsp_irqs),
651 .rst_lines = omap44xx_dsp_resets,
652 .rst_lines_cnt = ARRAY_SIZE(omap44xx_dsp_resets),
653 .main_clk = "dsp_fck",
654 .prcm = {
655 .omap4 = {
656 .clkctrl_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL,
657 .rstctrl_reg = OMAP4430_RM_TESLA_RSTCTRL,
658 },
659 },
660 .slaves = omap44xx_dsp_slaves,
661 .slaves_cnt = ARRAY_SIZE(omap44xx_dsp_slaves),
662 .masters = omap44xx_dsp_masters,
663 .masters_cnt = ARRAY_SIZE(omap44xx_dsp_masters),
664 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
665};
666
667/*
668 * 'gpio' class
669 * general purpose io module
670 */
671
672static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = {
673 .rev_offs = 0x0000,
674 .sysc_offs = 0x0010,
675 .syss_offs = 0x0114,
676 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
677 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
678 SYSS_HAS_RESET_STATUS),
679 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
680 SIDLE_SMART_WKUP),
681 .sysc_fields = &omap_hwmod_sysc_type1,
682};
683
684static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
685 .name = "gpio",
686 .sysc = &omap44xx_gpio_sysc,
687 .rev = 2,
688};
689
690/* gpio dev_attr */
691static struct omap_gpio_dev_attr gpio_dev_attr = {
692 .bank_width = 32,
693 .dbck_flag = true,
694};
695
696/* gpio1 */
697static struct omap_hwmod omap44xx_gpio1_hwmod;
698static struct omap_hwmod_irq_info omap44xx_gpio1_irqs[] = {
699 { .irq = 29 + OMAP44XX_IRQ_GIC_START },
700};
701
702static struct omap_hwmod_addr_space omap44xx_gpio1_addrs[] = {
703 {
704 .pa_start = 0x4a310000,
705 .pa_end = 0x4a3101ff,
706 .flags = ADDR_TYPE_RT
707 },
708};
709
710/* l4_wkup -> gpio1 */
711static struct omap_hwmod_ocp_if omap44xx_l4_wkup__gpio1 = {
712 .master = &omap44xx_l4_wkup_hwmod,
713 .slave = &omap44xx_gpio1_hwmod,
714 .clk = "l4_wkup_clk_mux_ck",
715 .addr = omap44xx_gpio1_addrs,
716 .addr_cnt = ARRAY_SIZE(omap44xx_gpio1_addrs),
717 .user = OCP_USER_MPU | OCP_USER_SDMA,
718};
719
720/* gpio1 slave ports */
721static struct omap_hwmod_ocp_if *omap44xx_gpio1_slaves[] = {
722 &omap44xx_l4_wkup__gpio1,
723};
724
725static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
726 { .role = "dbclk", .clk = "gpio1_dbclk" },
727};
728
729static struct omap_hwmod omap44xx_gpio1_hwmod = {
730 .name = "gpio1",
731 .class = &omap44xx_gpio_hwmod_class,
732 .mpu_irqs = omap44xx_gpio1_irqs,
733 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio1_irqs),
734 .main_clk = "gpio1_ick",
735 .prcm = {
736 .omap4 = {
737 .clkctrl_reg = OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
738 },
739 },
740 .opt_clks = gpio1_opt_clks,
741 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
742 .dev_attr = &gpio_dev_attr,
743 .slaves = omap44xx_gpio1_slaves,
744 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves),
745 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
746};
747
748/* gpio2 */
749static struct omap_hwmod omap44xx_gpio2_hwmod;
750static struct omap_hwmod_irq_info omap44xx_gpio2_irqs[] = {
751 { .irq = 30 + OMAP44XX_IRQ_GIC_START },
752};
753
754static struct omap_hwmod_addr_space omap44xx_gpio2_addrs[] = {
755 {
756 .pa_start = 0x48055000,
757 .pa_end = 0x480551ff,
758 .flags = ADDR_TYPE_RT
759 },
760};
761
762/* l4_per -> gpio2 */
763static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio2 = {
764 .master = &omap44xx_l4_per_hwmod,
765 .slave = &omap44xx_gpio2_hwmod,
766 .clk = "l4_div_ck",
767 .addr = omap44xx_gpio2_addrs,
768 .addr_cnt = ARRAY_SIZE(omap44xx_gpio2_addrs),
769 .user = OCP_USER_MPU | OCP_USER_SDMA,
770};
771
772/* gpio2 slave ports */
773static struct omap_hwmod_ocp_if *omap44xx_gpio2_slaves[] = {
774 &omap44xx_l4_per__gpio2,
775};
776
777static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
778 { .role = "dbclk", .clk = "gpio2_dbclk" },
779};
780
781static struct omap_hwmod omap44xx_gpio2_hwmod = {
782 .name = "gpio2",
783 .class = &omap44xx_gpio_hwmod_class,
784 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
785 .mpu_irqs = omap44xx_gpio2_irqs,
786 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio2_irqs),
787 .main_clk = "gpio2_ick",
788 .prcm = {
789 .omap4 = {
790 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
791 },
792 },
793 .opt_clks = gpio2_opt_clks,
794 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
795 .dev_attr = &gpio_dev_attr,
796 .slaves = omap44xx_gpio2_slaves,
797 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves),
798 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
799};
800
801/* gpio3 */
802static struct omap_hwmod omap44xx_gpio3_hwmod;
803static struct omap_hwmod_irq_info omap44xx_gpio3_irqs[] = {
804 { .irq = 31 + OMAP44XX_IRQ_GIC_START },
805};
806
807static struct omap_hwmod_addr_space omap44xx_gpio3_addrs[] = {
808 {
809 .pa_start = 0x48057000,
810 .pa_end = 0x480571ff,
811 .flags = ADDR_TYPE_RT
812 },
813};
814
815/* l4_per -> gpio3 */
816static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio3 = {
817 .master = &omap44xx_l4_per_hwmod,
818 .slave = &omap44xx_gpio3_hwmod,
819 .clk = "l4_div_ck",
820 .addr = omap44xx_gpio3_addrs,
821 .addr_cnt = ARRAY_SIZE(omap44xx_gpio3_addrs),
822 .user = OCP_USER_MPU | OCP_USER_SDMA,
823};
824
825/* gpio3 slave ports */
826static struct omap_hwmod_ocp_if *omap44xx_gpio3_slaves[] = {
827 &omap44xx_l4_per__gpio3,
828};
829
830static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
831 { .role = "dbclk", .clk = "gpio3_dbclk" },
832};
833
834static struct omap_hwmod omap44xx_gpio3_hwmod = {
835 .name = "gpio3",
836 .class = &omap44xx_gpio_hwmod_class,
837 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
838 .mpu_irqs = omap44xx_gpio3_irqs,
839 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio3_irqs),
840 .main_clk = "gpio3_ick",
841 .prcm = {
842 .omap4 = {
843 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
844 },
845 },
846 .opt_clks = gpio3_opt_clks,
847 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
848 .dev_attr = &gpio_dev_attr,
849 .slaves = omap44xx_gpio3_slaves,
850 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves),
851 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
852};
853
854/* gpio4 */
855static struct omap_hwmod omap44xx_gpio4_hwmod;
856static struct omap_hwmod_irq_info omap44xx_gpio4_irqs[] = {
857 { .irq = 32 + OMAP44XX_IRQ_GIC_START },
858};
859
860static struct omap_hwmod_addr_space omap44xx_gpio4_addrs[] = {
861 {
862 .pa_start = 0x48059000,
863 .pa_end = 0x480591ff,
864 .flags = ADDR_TYPE_RT
865 },
866};
867
868/* l4_per -> gpio4 */
869static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio4 = {
870 .master = &omap44xx_l4_per_hwmod,
871 .slave = &omap44xx_gpio4_hwmod,
872 .clk = "l4_div_ck",
873 .addr = omap44xx_gpio4_addrs,
874 .addr_cnt = ARRAY_SIZE(omap44xx_gpio4_addrs),
875 .user = OCP_USER_MPU | OCP_USER_SDMA,
876};
877
878/* gpio4 slave ports */
879static struct omap_hwmod_ocp_if *omap44xx_gpio4_slaves[] = {
880 &omap44xx_l4_per__gpio4,
881};
882
883static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
884 { .role = "dbclk", .clk = "gpio4_dbclk" },
885};
886
887static struct omap_hwmod omap44xx_gpio4_hwmod = {
888 .name = "gpio4",
889 .class = &omap44xx_gpio_hwmod_class,
890 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
891 .mpu_irqs = omap44xx_gpio4_irqs,
892 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio4_irqs),
893 .main_clk = "gpio4_ick",
894 .prcm = {
895 .omap4 = {
896 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
897 },
898 },
899 .opt_clks = gpio4_opt_clks,
900 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
901 .dev_attr = &gpio_dev_attr,
902 .slaves = omap44xx_gpio4_slaves,
903 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves),
904 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
905};
906
907/* gpio5 */
908static struct omap_hwmod omap44xx_gpio5_hwmod;
909static struct omap_hwmod_irq_info omap44xx_gpio5_irqs[] = {
910 { .irq = 33 + OMAP44XX_IRQ_GIC_START },
911};
912
913static struct omap_hwmod_addr_space omap44xx_gpio5_addrs[] = {
914 {
915 .pa_start = 0x4805b000,
916 .pa_end = 0x4805b1ff,
917 .flags = ADDR_TYPE_RT
918 },
919};
920
921/* l4_per -> gpio5 */
922static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio5 = {
923 .master = &omap44xx_l4_per_hwmod,
924 .slave = &omap44xx_gpio5_hwmod,
925 .clk = "l4_div_ck",
926 .addr = omap44xx_gpio5_addrs,
927 .addr_cnt = ARRAY_SIZE(omap44xx_gpio5_addrs),
928 .user = OCP_USER_MPU | OCP_USER_SDMA,
929};
930
931/* gpio5 slave ports */
932static struct omap_hwmod_ocp_if *omap44xx_gpio5_slaves[] = {
933 &omap44xx_l4_per__gpio5,
934};
935
936static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
937 { .role = "dbclk", .clk = "gpio5_dbclk" },
938};
939
940static struct omap_hwmod omap44xx_gpio5_hwmod = {
941 .name = "gpio5",
942 .class = &omap44xx_gpio_hwmod_class,
943 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
944 .mpu_irqs = omap44xx_gpio5_irqs,
945 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio5_irqs),
946 .main_clk = "gpio5_ick",
947 .prcm = {
948 .omap4 = {
949 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO5_CLKCTRL,
950 },
951 },
952 .opt_clks = gpio5_opt_clks,
953 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
954 .dev_attr = &gpio_dev_attr,
955 .slaves = omap44xx_gpio5_slaves,
956 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves),
957 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
958};
959
960/* gpio6 */
961static struct omap_hwmod omap44xx_gpio6_hwmod;
962static struct omap_hwmod_irq_info omap44xx_gpio6_irqs[] = {
963 { .irq = 34 + OMAP44XX_IRQ_GIC_START },
964};
965
966static struct omap_hwmod_addr_space omap44xx_gpio6_addrs[] = {
967 {
968 .pa_start = 0x4805d000,
969 .pa_end = 0x4805d1ff,
970 .flags = ADDR_TYPE_RT
971 },
972};
973
974/* l4_per -> gpio6 */
975static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio6 = {
976 .master = &omap44xx_l4_per_hwmod,
977 .slave = &omap44xx_gpio6_hwmod,
978 .clk = "l4_div_ck",
979 .addr = omap44xx_gpio6_addrs,
980 .addr_cnt = ARRAY_SIZE(omap44xx_gpio6_addrs),
981 .user = OCP_USER_MPU | OCP_USER_SDMA,
982};
983
984/* gpio6 slave ports */
985static struct omap_hwmod_ocp_if *omap44xx_gpio6_slaves[] = {
986 &omap44xx_l4_per__gpio6,
987};
988
989static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
990 { .role = "dbclk", .clk = "gpio6_dbclk" },
991};
992
993static struct omap_hwmod omap44xx_gpio6_hwmod = {
994 .name = "gpio6",
995 .class = &omap44xx_gpio_hwmod_class,
996 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
997 .mpu_irqs = omap44xx_gpio6_irqs,
998 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio6_irqs),
999 .main_clk = "gpio6_ick",
1000 .prcm = {
1001 .omap4 = {
1002 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
1003 },
1004 },
1005 .opt_clks = gpio6_opt_clks,
1006 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
1007 .dev_attr = &gpio_dev_attr,
1008 .slaves = omap44xx_gpio6_slaves,
1009 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves),
1010 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1011};
1012
1013/*
398 * 'i2c' class 1014 * 'i2c' class
399 * multimaster high-speed i2c controller 1015 * multimaster high-speed i2c controller
400 */ 1016 */
@@ -402,10 +1018,11 @@ static struct omap_hwmod omap44xx_l4_wkup_hwmod = {
402static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = { 1018static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = {
403 .sysc_offs = 0x0010, 1019 .sysc_offs = 0x0010,
404 .syss_offs = 0x0090, 1020 .syss_offs = 0x0090,
405 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 1021 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
406 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SOFTRESET | 1022 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
407 SYSC_HAS_AUTOIDLE), 1023 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
408 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1024 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1025 SIDLE_SMART_WKUP),
409 .sysc_fields = &omap_hwmod_sysc_type1, 1026 .sysc_fields = &omap_hwmod_sysc_type1,
410}; 1027};
411 1028
@@ -627,32 +1244,111 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = {
627}; 1244};
628 1245
629/* 1246/*
630 * 'mpu_bus' class 1247 * 'iva' class
631 * instance(s): mpu_private 1248 * multi-standard video encoder/decoder hardware accelerator
632 */ 1249 */
633static struct omap_hwmod_class omap44xx_mpu_bus_hwmod_class = { 1250
634 .name = "mpu_bus", 1251static struct omap_hwmod_class omap44xx_iva_hwmod_class = {
1252 .name = "iva",
635}; 1253};
636 1254
637/* mpu_private interface data */ 1255/* iva */
638/* mpu -> mpu_private */ 1256static struct omap_hwmod_irq_info omap44xx_iva_irqs[] = {
639static struct omap_hwmod_ocp_if omap44xx_mpu__mpu_private = { 1257 { .name = "sync_1", .irq = 103 + OMAP44XX_IRQ_GIC_START },
640 .master = &omap44xx_mpu_hwmod, 1258 { .name = "sync_0", .irq = 104 + OMAP44XX_IRQ_GIC_START },
641 .slave = &omap44xx_mpu_private_hwmod, 1259 { .name = "mailbox_0", .irq = 107 + OMAP44XX_IRQ_GIC_START },
1260};
1261
1262static struct omap_hwmod_rst_info omap44xx_iva_resets[] = {
1263 { .name = "logic", .rst_shift = 2 },
1264};
1265
1266static struct omap_hwmod_rst_info omap44xx_iva_seq0_resets[] = {
1267 { .name = "seq0", .rst_shift = 0 },
1268};
1269
1270static struct omap_hwmod_rst_info omap44xx_iva_seq1_resets[] = {
1271 { .name = "seq1", .rst_shift = 1 },
1272};
1273
1274/* iva master ports */
1275static struct omap_hwmod_ocp_if *omap44xx_iva_masters[] = {
1276 &omap44xx_iva__l3_main_2,
1277 &omap44xx_iva__l3_instr,
1278};
1279
1280static struct omap_hwmod_addr_space omap44xx_iva_addrs[] = {
1281 {
1282 .pa_start = 0x5a000000,
1283 .pa_end = 0x5a07ffff,
1284 .flags = ADDR_TYPE_RT
1285 },
1286};
1287
1288/* l3_main_2 -> iva */
1289static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iva = {
1290 .master = &omap44xx_l3_main_2_hwmod,
1291 .slave = &omap44xx_iva_hwmod,
642 .clk = "l3_div_ck", 1292 .clk = "l3_div_ck",
643 .user = OCP_USER_MPU | OCP_USER_SDMA, 1293 .addr = omap44xx_iva_addrs,
1294 .addr_cnt = ARRAY_SIZE(omap44xx_iva_addrs),
1295 .user = OCP_USER_MPU,
644}; 1296};
645 1297
646/* mpu_private slave ports */ 1298/* iva slave ports */
647static struct omap_hwmod_ocp_if *omap44xx_mpu_private_slaves[] = { 1299static struct omap_hwmod_ocp_if *omap44xx_iva_slaves[] = {
648 &omap44xx_mpu__mpu_private, 1300 &omap44xx_dsp__iva,
1301 &omap44xx_l3_main_2__iva,
649}; 1302};
650 1303
651static struct omap_hwmod omap44xx_mpu_private_hwmod = { 1304/* Pseudo hwmod for reset control purpose only */
652 .name = "mpu_private", 1305static struct omap_hwmod omap44xx_iva_seq0_hwmod = {
653 .class = &omap44xx_mpu_bus_hwmod_class, 1306 .name = "iva_seq0",
654 .slaves = omap44xx_mpu_private_slaves, 1307 .class = &omap44xx_iva_hwmod_class,
655 .slaves_cnt = ARRAY_SIZE(omap44xx_mpu_private_slaves), 1308 .flags = HWMOD_INIT_NO_RESET,
1309 .rst_lines = omap44xx_iva_seq0_resets,
1310 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_seq0_resets),
1311 .prcm = {
1312 .omap4 = {
1313 .rstctrl_reg = OMAP4430_RM_IVAHD_RSTCTRL,
1314 },
1315 },
1316 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1317};
1318
1319/* Pseudo hwmod for reset control purpose only */
1320static struct omap_hwmod omap44xx_iva_seq1_hwmod = {
1321 .name = "iva_seq1",
1322 .class = &omap44xx_iva_hwmod_class,
1323 .flags = HWMOD_INIT_NO_RESET,
1324 .rst_lines = omap44xx_iva_seq1_resets,
1325 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_seq1_resets),
1326 .prcm = {
1327 .omap4 = {
1328 .rstctrl_reg = OMAP4430_RM_IVAHD_RSTCTRL,
1329 },
1330 },
1331 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1332};
1333
1334static struct omap_hwmod omap44xx_iva_hwmod = {
1335 .name = "iva",
1336 .class = &omap44xx_iva_hwmod_class,
1337 .mpu_irqs = omap44xx_iva_irqs,
1338 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_iva_irqs),
1339 .rst_lines = omap44xx_iva_resets,
1340 .rst_lines_cnt = ARRAY_SIZE(omap44xx_iva_resets),
1341 .main_clk = "iva_fck",
1342 .prcm = {
1343 .omap4 = {
1344 .clkctrl_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL,
1345 .rstctrl_reg = OMAP4430_RM_IVAHD_RSTCTRL,
1346 },
1347 },
1348 .slaves = omap44xx_iva_slaves,
1349 .slaves_cnt = ARRAY_SIZE(omap44xx_iva_slaves),
1350 .masters = omap44xx_iva_masters,
1351 .masters_cnt = ARRAY_SIZE(omap44xx_iva_masters),
656 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 1352 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
657}; 1353};
658 1354
@@ -697,22 +1393,6 @@ static struct omap_hwmod omap44xx_mpu_hwmod = {
697}; 1393};
698 1394
699/* 1395/*
700 * 'wd_timer' class
701 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
702 * overflow condition
703 */
704
705static struct omap_hwmod_class_sysconfig omap44xx_wd_timer_sysc = {
706 .rev_offs = 0x0000,
707 .sysc_offs = 0x0010,
708 .syss_offs = 0x0014,
709 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE |
710 SYSC_HAS_SOFTRESET),
711 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
712 .sysc_fields = &omap_hwmod_sysc_type1,
713};
714
715/*
716 * 'uart' class 1396 * 'uart' class
717 * universal asynchronous receiver/transmitter (uart) 1397 * universal asynchronous receiver/transmitter (uart)
718 */ 1398 */
@@ -721,31 +1401,14 @@ static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = {
721 .rev_offs = 0x0050, 1401 .rev_offs = 0x0050,
722 .sysc_offs = 0x0054, 1402 .sysc_offs = 0x0054,
723 .syss_offs = 0x0058, 1403 .syss_offs = 0x0058,
724 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 1404 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
725 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 1405 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
726 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1406 SYSS_HAS_RESET_STATUS),
1407 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1408 SIDLE_SMART_WKUP),
727 .sysc_fields = &omap_hwmod_sysc_type1, 1409 .sysc_fields = &omap_hwmod_sysc_type1,
728}; 1410};
729 1411
730static struct omap_hwmod_class omap44xx_wd_timer_hwmod_class = {
731 .name = "wd_timer",
732 .sysc = &omap44xx_wd_timer_sysc,
733};
734
735/* wd_timer2 */
736static struct omap_hwmod omap44xx_wd_timer2_hwmod;
737static struct omap_hwmod_irq_info omap44xx_wd_timer2_irqs[] = {
738 { .irq = 80 + OMAP44XX_IRQ_GIC_START },
739};
740
741static struct omap_hwmod_addr_space omap44xx_wd_timer2_addrs[] = {
742 {
743 .pa_start = 0x4a314000,
744 .pa_end = 0x4a31407f,
745 .flags = ADDR_TYPE_RT
746 },
747};
748
749static struct omap_hwmod_class omap44xx_uart_hwmod_class = { 1412static struct omap_hwmod_class omap44xx_uart_hwmod_class = {
750 .name = "uart", 1413 .name = "uart",
751 .sysc = &omap44xx_uart_sysc, 1414 .sysc = &omap44xx_uart_sysc,
@@ -822,51 +1485,6 @@ static struct omap_hwmod_addr_space omap44xx_uart2_addrs[] = {
822 }, 1485 },
823}; 1486};
824 1487
825/* l4_wkup -> wd_timer2 */
826static struct omap_hwmod_ocp_if omap44xx_l4_wkup__wd_timer2 = {
827 .master = &omap44xx_l4_wkup_hwmod,
828 .slave = &omap44xx_wd_timer2_hwmod,
829 .clk = "l4_wkup_clk_mux_ck",
830 .addr = omap44xx_wd_timer2_addrs,
831 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer2_addrs),
832 .user = OCP_USER_MPU | OCP_USER_SDMA,
833};
834
835/* wd_timer2 slave ports */
836static struct omap_hwmod_ocp_if *omap44xx_wd_timer2_slaves[] = {
837 &omap44xx_l4_wkup__wd_timer2,
838};
839
840static struct omap_hwmod omap44xx_wd_timer2_hwmod = {
841 .name = "wd_timer2",
842 .class = &omap44xx_wd_timer_hwmod_class,
843 .mpu_irqs = omap44xx_wd_timer2_irqs,
844 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer2_irqs),
845 .main_clk = "wd_timer2_fck",
846 .prcm = {
847 .omap4 = {
848 .clkctrl_reg = OMAP4430_CM_WKUP_WDT2_CLKCTRL,
849 },
850 },
851 .slaves = omap44xx_wd_timer2_slaves,
852 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves),
853 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
854};
855
856/* wd_timer3 */
857static struct omap_hwmod omap44xx_wd_timer3_hwmod;
858static struct omap_hwmod_irq_info omap44xx_wd_timer3_irqs[] = {
859 { .irq = 36 + OMAP44XX_IRQ_GIC_START },
860};
861
862static struct omap_hwmod_addr_space omap44xx_wd_timer3_addrs[] = {
863 {
864 .pa_start = 0x40130000,
865 .pa_end = 0x4013007f,
866 .flags = ADDR_TYPE_RT
867 },
868};
869
870/* l4_per -> uart2 */ 1488/* l4_per -> uart2 */
871static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = { 1489static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = {
872 .master = &omap44xx_l4_per_hwmod, 1490 .master = &omap44xx_l4_per_hwmod,
@@ -919,25 +1537,6 @@ static struct omap_hwmod_addr_space omap44xx_uart3_addrs[] = {
919 }, 1537 },
920}; 1538};
921 1539
922/* l4_abe -> wd_timer3 */
923static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3 = {
924 .master = &omap44xx_l4_abe_hwmod,
925 .slave = &omap44xx_wd_timer3_hwmod,
926 .clk = "ocp_abe_iclk",
927 .addr = omap44xx_wd_timer3_addrs,
928 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_addrs),
929 .user = OCP_USER_MPU,
930};
931
932/* l4_abe -> wd_timer3 (dma) */
933static struct omap_hwmod_addr_space omap44xx_wd_timer3_dma_addrs[] = {
934 {
935 .pa_start = 0x49030000,
936 .pa_end = 0x4903007f,
937 .flags = ADDR_TYPE_RT
938 },
939};
940
941/* l4_per -> uart3 */ 1540/* l4_per -> uart3 */
942static struct omap_hwmod_ocp_if omap44xx_l4_per__uart3 = { 1541static struct omap_hwmod_ocp_if omap44xx_l4_per__uart3 = {
943 .master = &omap44xx_l4_per_hwmod, 1542 .master = &omap44xx_l4_per_hwmod,
@@ -991,37 +1590,6 @@ static struct omap_hwmod_addr_space omap44xx_uart4_addrs[] = {
991 }, 1590 },
992}; 1591};
993 1592
994static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3_dma = {
995 .master = &omap44xx_l4_abe_hwmod,
996 .slave = &omap44xx_wd_timer3_hwmod,
997 .clk = "ocp_abe_iclk",
998 .addr = omap44xx_wd_timer3_dma_addrs,
999 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_dma_addrs),
1000 .user = OCP_USER_SDMA,
1001};
1002
1003/* wd_timer3 slave ports */
1004static struct omap_hwmod_ocp_if *omap44xx_wd_timer3_slaves[] = {
1005 &omap44xx_l4_abe__wd_timer3,
1006 &omap44xx_l4_abe__wd_timer3_dma,
1007};
1008
1009static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
1010 .name = "wd_timer3",
1011 .class = &omap44xx_wd_timer_hwmod_class,
1012 .mpu_irqs = omap44xx_wd_timer3_irqs,
1013 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer3_irqs),
1014 .main_clk = "wd_timer3_fck",
1015 .prcm = {
1016 .omap4 = {
1017 .clkctrl_reg = OMAP4430_CM1_ABE_WDT3_CLKCTRL,
1018 },
1019 },
1020 .slaves = omap44xx_wd_timer3_slaves,
1021 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves),
1022 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1023};
1024
1025/* l4_per -> uart4 */ 1593/* l4_per -> uart4 */
1026static struct omap_hwmod_ocp_if omap44xx_l4_per__uart4 = { 1594static struct omap_hwmod_ocp_if omap44xx_l4_per__uart4 = {
1027 .master = &omap44xx_l4_per_hwmod, 1595 .master = &omap44xx_l4_per_hwmod,
@@ -1056,337 +1624,137 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
1056}; 1624};
1057 1625
1058/* 1626/*
1059 * 'gpio' class 1627 * 'wd_timer' class
1060 * general purpose io module 1628 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
1629 * overflow condition
1061 */ 1630 */
1062 1631
1063static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = { 1632static struct omap_hwmod_class_sysconfig omap44xx_wd_timer_sysc = {
1064 .rev_offs = 0x0000, 1633 .rev_offs = 0x0000,
1065 .sysc_offs = 0x0010, 1634 .sysc_offs = 0x0010,
1066 .syss_offs = 0x0114, 1635 .syss_offs = 0x0014,
1067 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 1636 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SIDLEMODE |
1068 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), 1637 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1069 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), 1638 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1639 SIDLE_SMART_WKUP),
1070 .sysc_fields = &omap_hwmod_sysc_type1, 1640 .sysc_fields = &omap_hwmod_sysc_type1,
1071}; 1641};
1072 1642
1073static struct omap_hwmod_class omap44xx_gpio_hwmod_class = { 1643static struct omap_hwmod_class omap44xx_wd_timer_hwmod_class = {
1074 .name = "gpio", 1644 .name = "wd_timer",
1075 .sysc = &omap44xx_gpio_sysc, 1645 .sysc = &omap44xx_wd_timer_sysc,
1076 .rev = 2, 1646 .pre_shutdown = &omap2_wd_timer_disable
1077};
1078
1079/* gpio dev_attr */
1080static struct omap_gpio_dev_attr gpio_dev_attr = {
1081 .bank_width = 32,
1082 .dbck_flag = true,
1083}; 1647};
1084 1648
1085/* gpio1 */ 1649/* wd_timer2 */
1086static struct omap_hwmod omap44xx_gpio1_hwmod; 1650static struct omap_hwmod omap44xx_wd_timer2_hwmod;
1087static struct omap_hwmod_irq_info omap44xx_gpio1_irqs[] = { 1651static struct omap_hwmod_irq_info omap44xx_wd_timer2_irqs[] = {
1088 { .irq = 29 + OMAP44XX_IRQ_GIC_START }, 1652 { .irq = 80 + OMAP44XX_IRQ_GIC_START },
1089}; 1653};
1090 1654
1091static struct omap_hwmod_addr_space omap44xx_gpio1_addrs[] = { 1655static struct omap_hwmod_addr_space omap44xx_wd_timer2_addrs[] = {
1092 { 1656 {
1093 .pa_start = 0x4a310000, 1657 .pa_start = 0x4a314000,
1094 .pa_end = 0x4a3101ff, 1658 .pa_end = 0x4a31407f,
1095 .flags = ADDR_TYPE_RT 1659 .flags = ADDR_TYPE_RT
1096 }, 1660 },
1097}; 1661};
1098 1662
1099/* l4_wkup -> gpio1 */ 1663/* l4_wkup -> wd_timer2 */
1100static struct omap_hwmod_ocp_if omap44xx_l4_wkup__gpio1 = { 1664static struct omap_hwmod_ocp_if omap44xx_l4_wkup__wd_timer2 = {
1101 .master = &omap44xx_l4_wkup_hwmod, 1665 .master = &omap44xx_l4_wkup_hwmod,
1102 .slave = &omap44xx_gpio1_hwmod, 1666 .slave = &omap44xx_wd_timer2_hwmod,
1103 .addr = omap44xx_gpio1_addrs, 1667 .clk = "l4_wkup_clk_mux_ck",
1104 .addr_cnt = ARRAY_SIZE(omap44xx_gpio1_addrs), 1668 .addr = omap44xx_wd_timer2_addrs,
1105 .user = OCP_USER_MPU | OCP_USER_SDMA, 1669 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer2_addrs),
1106};
1107
1108/* gpio1 slave ports */
1109static struct omap_hwmod_ocp_if *omap44xx_gpio1_slaves[] = {
1110 &omap44xx_l4_wkup__gpio1,
1111};
1112
1113static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
1114 { .role = "dbclk", .clk = "sys_32k_ck" },
1115};
1116
1117static struct omap_hwmod omap44xx_gpio1_hwmod = {
1118 .name = "gpio1",
1119 .class = &omap44xx_gpio_hwmod_class,
1120 .mpu_irqs = omap44xx_gpio1_irqs,
1121 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio1_irqs),
1122 .main_clk = "gpio1_ick",
1123 .prcm = {
1124 .omap4 = {
1125 .clkctrl_reg = OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
1126 },
1127 },
1128 .opt_clks = gpio1_opt_clks,
1129 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
1130 .dev_attr = &gpio_dev_attr,
1131 .slaves = omap44xx_gpio1_slaves,
1132 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves),
1133 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1134};
1135
1136/* gpio2 */
1137static struct omap_hwmod omap44xx_gpio2_hwmod;
1138static struct omap_hwmod_irq_info omap44xx_gpio2_irqs[] = {
1139 { .irq = 30 + OMAP44XX_IRQ_GIC_START },
1140};
1141
1142static struct omap_hwmod_addr_space omap44xx_gpio2_addrs[] = {
1143 {
1144 .pa_start = 0x48055000,
1145 .pa_end = 0x480551ff,
1146 .flags = ADDR_TYPE_RT
1147 },
1148};
1149
1150/* l4_per -> gpio2 */
1151static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio2 = {
1152 .master = &omap44xx_l4_per_hwmod,
1153 .slave = &omap44xx_gpio2_hwmod,
1154 .addr = omap44xx_gpio2_addrs,
1155 .addr_cnt = ARRAY_SIZE(omap44xx_gpio2_addrs),
1156 .user = OCP_USER_MPU | OCP_USER_SDMA,
1157};
1158
1159/* gpio2 slave ports */
1160static struct omap_hwmod_ocp_if *omap44xx_gpio2_slaves[] = {
1161 &omap44xx_l4_per__gpio2,
1162};
1163
1164static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
1165 { .role = "dbclk", .clk = "sys_32k_ck" },
1166};
1167
1168static struct omap_hwmod omap44xx_gpio2_hwmod = {
1169 .name = "gpio2",
1170 .class = &omap44xx_gpio_hwmod_class,
1171 .mpu_irqs = omap44xx_gpio2_irqs,
1172 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio2_irqs),
1173 .main_clk = "gpio2_ick",
1174 .prcm = {
1175 .omap4 = {
1176 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
1177 },
1178 },
1179 .opt_clks = gpio2_opt_clks,
1180 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
1181 .dev_attr = &gpio_dev_attr,
1182 .slaves = omap44xx_gpio2_slaves,
1183 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves),
1184 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1185};
1186
1187/* gpio3 */
1188static struct omap_hwmod omap44xx_gpio3_hwmod;
1189static struct omap_hwmod_irq_info omap44xx_gpio3_irqs[] = {
1190 { .irq = 31 + OMAP44XX_IRQ_GIC_START },
1191};
1192
1193static struct omap_hwmod_addr_space omap44xx_gpio3_addrs[] = {
1194 {
1195 .pa_start = 0x48057000,
1196 .pa_end = 0x480571ff,
1197 .flags = ADDR_TYPE_RT
1198 },
1199};
1200
1201/* l4_per -> gpio3 */
1202static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio3 = {
1203 .master = &omap44xx_l4_per_hwmod,
1204 .slave = &omap44xx_gpio3_hwmod,
1205 .addr = omap44xx_gpio3_addrs,
1206 .addr_cnt = ARRAY_SIZE(omap44xx_gpio3_addrs),
1207 .user = OCP_USER_MPU | OCP_USER_SDMA, 1670 .user = OCP_USER_MPU | OCP_USER_SDMA,
1208}; 1671};
1209 1672
1210/* gpio3 slave ports */ 1673/* wd_timer2 slave ports */
1211static struct omap_hwmod_ocp_if *omap44xx_gpio3_slaves[] = { 1674static struct omap_hwmod_ocp_if *omap44xx_wd_timer2_slaves[] = {
1212 &omap44xx_l4_per__gpio3, 1675 &omap44xx_l4_wkup__wd_timer2,
1213};
1214
1215static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
1216 { .role = "dbclk", .clk = "sys_32k_ck" },
1217}; 1676};
1218 1677
1219static struct omap_hwmod omap44xx_gpio3_hwmod = { 1678static struct omap_hwmod omap44xx_wd_timer2_hwmod = {
1220 .name = "gpio3", 1679 .name = "wd_timer2",
1221 .class = &omap44xx_gpio_hwmod_class, 1680 .class = &omap44xx_wd_timer_hwmod_class,
1222 .mpu_irqs = omap44xx_gpio3_irqs, 1681 .mpu_irqs = omap44xx_wd_timer2_irqs,
1223 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio3_irqs), 1682 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer2_irqs),
1224 .main_clk = "gpio3_ick", 1683 .main_clk = "wd_timer2_fck",
1225 .prcm = { 1684 .prcm = {
1226 .omap4 = { 1685 .omap4 = {
1227 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO3_CLKCTRL, 1686 .clkctrl_reg = OMAP4430_CM_WKUP_WDT2_CLKCTRL,
1228 }, 1687 },
1229 }, 1688 },
1230 .opt_clks = gpio3_opt_clks, 1689 .slaves = omap44xx_wd_timer2_slaves,
1231 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 1690 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves),
1232 .dev_attr = &gpio_dev_attr,
1233 .slaves = omap44xx_gpio3_slaves,
1234 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves),
1235 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 1691 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1236}; 1692};
1237 1693
1238/* gpio4 */ 1694/* wd_timer3 */
1239static struct omap_hwmod omap44xx_gpio4_hwmod; 1695static struct omap_hwmod omap44xx_wd_timer3_hwmod;
1240static struct omap_hwmod_irq_info omap44xx_gpio4_irqs[] = { 1696static struct omap_hwmod_irq_info omap44xx_wd_timer3_irqs[] = {
1241 { .irq = 32 + OMAP44XX_IRQ_GIC_START }, 1697 { .irq = 36 + OMAP44XX_IRQ_GIC_START },
1242}; 1698};
1243 1699
1244static struct omap_hwmod_addr_space omap44xx_gpio4_addrs[] = { 1700static struct omap_hwmod_addr_space omap44xx_wd_timer3_addrs[] = {
1245 { 1701 {
1246 .pa_start = 0x48059000, 1702 .pa_start = 0x40130000,
1247 .pa_end = 0x480591ff, 1703 .pa_end = 0x4013007f,
1248 .flags = ADDR_TYPE_RT 1704 .flags = ADDR_TYPE_RT
1249 }, 1705 },
1250}; 1706};
1251 1707
1252/* l4_per -> gpio4 */ 1708/* l4_abe -> wd_timer3 */
1253static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio4 = { 1709static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3 = {
1254 .master = &omap44xx_l4_per_hwmod, 1710 .master = &omap44xx_l4_abe_hwmod,
1255 .slave = &omap44xx_gpio4_hwmod, 1711 .slave = &omap44xx_wd_timer3_hwmod,
1256 .addr = omap44xx_gpio4_addrs, 1712 .clk = "ocp_abe_iclk",
1257 .addr_cnt = ARRAY_SIZE(omap44xx_gpio4_addrs), 1713 .addr = omap44xx_wd_timer3_addrs,
1258 .user = OCP_USER_MPU | OCP_USER_SDMA, 1714 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_addrs),
1259}; 1715 .user = OCP_USER_MPU,
1260
1261/* gpio4 slave ports */
1262static struct omap_hwmod_ocp_if *omap44xx_gpio4_slaves[] = {
1263 &omap44xx_l4_per__gpio4,
1264};
1265
1266static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
1267 { .role = "dbclk", .clk = "sys_32k_ck" },
1268};
1269
1270static struct omap_hwmod omap44xx_gpio4_hwmod = {
1271 .name = "gpio4",
1272 .class = &omap44xx_gpio_hwmod_class,
1273 .mpu_irqs = omap44xx_gpio4_irqs,
1274 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio4_irqs),
1275 .main_clk = "gpio4_ick",
1276 .prcm = {
1277 .omap4 = {
1278 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
1279 },
1280 },
1281 .opt_clks = gpio4_opt_clks,
1282 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
1283 .dev_attr = &gpio_dev_attr,
1284 .slaves = omap44xx_gpio4_slaves,
1285 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves),
1286 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1287};
1288
1289/* gpio5 */
1290static struct omap_hwmod omap44xx_gpio5_hwmod;
1291static struct omap_hwmod_irq_info omap44xx_gpio5_irqs[] = {
1292 { .irq = 33 + OMAP44XX_IRQ_GIC_START },
1293}; 1716};
1294 1717
1295static struct omap_hwmod_addr_space omap44xx_gpio5_addrs[] = { 1718static struct omap_hwmod_addr_space omap44xx_wd_timer3_dma_addrs[] = {
1296 { 1719 {
1297 .pa_start = 0x4805b000, 1720 .pa_start = 0x49030000,
1298 .pa_end = 0x4805b1ff, 1721 .pa_end = 0x4903007f,
1299 .flags = ADDR_TYPE_RT 1722 .flags = ADDR_TYPE_RT
1300 }, 1723 },
1301}; 1724};
1302 1725
1303/* l4_per -> gpio5 */ 1726/* l4_abe -> wd_timer3 (dma) */
1304static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio5 = { 1727static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3_dma = {
1305 .master = &omap44xx_l4_per_hwmod, 1728 .master = &omap44xx_l4_abe_hwmod,
1306 .slave = &omap44xx_gpio5_hwmod, 1729 .slave = &omap44xx_wd_timer3_hwmod,
1307 .addr = omap44xx_gpio5_addrs, 1730 .clk = "ocp_abe_iclk",
1308 .addr_cnt = ARRAY_SIZE(omap44xx_gpio5_addrs), 1731 .addr = omap44xx_wd_timer3_dma_addrs,
1309 .user = OCP_USER_MPU | OCP_USER_SDMA, 1732 .addr_cnt = ARRAY_SIZE(omap44xx_wd_timer3_dma_addrs),
1310}; 1733 .user = OCP_USER_SDMA,
1311
1312/* gpio5 slave ports */
1313static struct omap_hwmod_ocp_if *omap44xx_gpio5_slaves[] = {
1314 &omap44xx_l4_per__gpio5,
1315}; 1734};
1316 1735
1317static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { 1736/* wd_timer3 slave ports */
1318 { .role = "dbclk", .clk = "sys_32k_ck" }, 1737static struct omap_hwmod_ocp_if *omap44xx_wd_timer3_slaves[] = {
1738 &omap44xx_l4_abe__wd_timer3,
1739 &omap44xx_l4_abe__wd_timer3_dma,
1319}; 1740};
1320 1741
1321static struct omap_hwmod omap44xx_gpio5_hwmod = { 1742static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
1322 .name = "gpio5", 1743 .name = "wd_timer3",
1323 .class = &omap44xx_gpio_hwmod_class, 1744 .class = &omap44xx_wd_timer_hwmod_class,
1324 .mpu_irqs = omap44xx_gpio5_irqs, 1745 .mpu_irqs = omap44xx_wd_timer3_irqs,
1325 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio5_irqs), 1746 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_wd_timer3_irqs),
1326 .main_clk = "gpio5_ick", 1747 .main_clk = "wd_timer3_fck",
1327 .prcm = { 1748 .prcm = {
1328 .omap4 = { 1749 .omap4 = {
1329 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO5_CLKCTRL, 1750 .clkctrl_reg = OMAP4430_CM1_ABE_WDT3_CLKCTRL,
1330 }, 1751 },
1331 }, 1752 },
1332 .opt_clks = gpio5_opt_clks, 1753 .slaves = omap44xx_wd_timer3_slaves,
1333 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 1754 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves),
1334 .dev_attr = &gpio_dev_attr,
1335 .slaves = omap44xx_gpio5_slaves,
1336 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves),
1337 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 1755 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1338}; 1756};
1339 1757
1340/* gpio6 */
1341static struct omap_hwmod omap44xx_gpio6_hwmod;
1342static struct omap_hwmod_irq_info omap44xx_gpio6_irqs[] = {
1343 { .irq = 34 + OMAP44XX_IRQ_GIC_START },
1344};
1345
1346static struct omap_hwmod_addr_space omap44xx_gpio6_addrs[] = {
1347 {
1348 .pa_start = 0x4805d000,
1349 .pa_end = 0x4805d1ff,
1350 .flags = ADDR_TYPE_RT
1351 },
1352};
1353
1354/* l4_per -> gpio6 */
1355static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio6 = {
1356 .master = &omap44xx_l4_per_hwmod,
1357 .slave = &omap44xx_gpio6_hwmod,
1358 .addr = omap44xx_gpio6_addrs,
1359 .addr_cnt = ARRAY_SIZE(omap44xx_gpio6_addrs),
1360 .user = OCP_USER_MPU | OCP_USER_SDMA,
1361};
1362
1363/* gpio6 slave ports */
1364static struct omap_hwmod_ocp_if *omap44xx_gpio6_slaves[] = {
1365 &omap44xx_l4_per__gpio6,
1366};
1367
1368static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
1369 { .role = "dbclk", .clk = "sys_32k_ck" },
1370};
1371
1372static struct omap_hwmod omap44xx_gpio6_hwmod = {
1373 .name = "gpio6",
1374 .class = &omap44xx_gpio_hwmod_class,
1375 .mpu_irqs = omap44xx_gpio6_irqs,
1376 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio6_irqs),
1377 .main_clk = "gpio6_ick",
1378 .prcm = {
1379 .omap4 = {
1380 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
1381 },
1382 },
1383 .opt_clks = gpio6_opt_clks,
1384 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
1385 .dev_attr = &gpio_dev_attr,
1386 .slaves = omap44xx_gpio6_slaves,
1387 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves),
1388 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1389};
1390 1758
1391/* 1759/*
1392 * 'dma' class 1760 * 'dma' class
@@ -1477,13 +1845,16 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = {
1477static __initdata struct omap_hwmod *omap44xx_hwmods[] = { 1845static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
1478 /* dmm class */ 1846 /* dmm class */
1479 &omap44xx_dmm_hwmod, 1847 &omap44xx_dmm_hwmod,
1848
1480 /* emif_fw class */ 1849 /* emif_fw class */
1481 &omap44xx_emif_fw_hwmod, 1850 &omap44xx_emif_fw_hwmod,
1851
1482 /* l3 class */ 1852 /* l3 class */
1483 &omap44xx_l3_instr_hwmod, 1853 &omap44xx_l3_instr_hwmod,
1484 &omap44xx_l3_main_1_hwmod, 1854 &omap44xx_l3_main_1_hwmod,
1485 &omap44xx_l3_main_2_hwmod, 1855 &omap44xx_l3_main_2_hwmod,
1486 &omap44xx_l3_main_3_hwmod, 1856 &omap44xx_l3_main_3_hwmod,
1857
1487 /* l4 class */ 1858 /* l4 class */
1488 &omap44xx_l4_abe_hwmod, 1859 &omap44xx_l4_abe_hwmod,
1489 &omap44xx_l4_cfg_hwmod, 1860 &omap44xx_l4_cfg_hwmod,
@@ -1493,14 +1864,13 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
1493 /* dma class */ 1864 /* dma class */
1494 &omap44xx_dma_system_hwmod, 1865 &omap44xx_dma_system_hwmod,
1495 1866
1496 /* i2c class */
1497 &omap44xx_i2c1_hwmod,
1498 &omap44xx_i2c2_hwmod,
1499 &omap44xx_i2c3_hwmod,
1500 &omap44xx_i2c4_hwmod,
1501 /* mpu_bus class */ 1867 /* mpu_bus class */
1502 &omap44xx_mpu_private_hwmod, 1868 &omap44xx_mpu_private_hwmod,
1503 1869
1870 /* dsp class */
1871 &omap44xx_dsp_hwmod,
1872 &omap44xx_dsp_c0_hwmod,
1873
1504 /* gpio class */ 1874 /* gpio class */
1505 &omap44xx_gpio1_hwmod, 1875 &omap44xx_gpio1_hwmod,
1506 &omap44xx_gpio2_hwmod, 1876 &omap44xx_gpio2_hwmod,
@@ -1509,17 +1879,30 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
1509 &omap44xx_gpio5_hwmod, 1879 &omap44xx_gpio5_hwmod,
1510 &omap44xx_gpio6_hwmod, 1880 &omap44xx_gpio6_hwmod,
1511 1881
1882 /* i2c class */
1883 &omap44xx_i2c1_hwmod,
1884 &omap44xx_i2c2_hwmod,
1885 &omap44xx_i2c3_hwmod,
1886 &omap44xx_i2c4_hwmod,
1887
1888 /* iva class */
1889 &omap44xx_iva_hwmod,
1890 &omap44xx_iva_seq0_hwmod,
1891 &omap44xx_iva_seq1_hwmod,
1892
1512 /* mpu class */ 1893 /* mpu class */
1513 &omap44xx_mpu_hwmod, 1894 &omap44xx_mpu_hwmod,
1514 /* wd_timer class */
1515 &omap44xx_wd_timer2_hwmod,
1516 &omap44xx_wd_timer3_hwmod,
1517 1895
1518 /* uart class */ 1896 /* uart class */
1519 &omap44xx_uart1_hwmod, 1897 &omap44xx_uart1_hwmod,
1520 &omap44xx_uart2_hwmod, 1898 &omap44xx_uart2_hwmod,
1521 &omap44xx_uart3_hwmod, 1899 &omap44xx_uart3_hwmod,
1522 &omap44xx_uart4_hwmod, 1900 &omap44xx_uart4_hwmod,
1901
1902 /* wd_timer class */
1903 &omap44xx_wd_timer2_hwmod,
1904 &omap44xx_wd_timer3_hwmod,
1905
1523 NULL, 1906 NULL,
1524}; 1907};
1525 1908
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index a8afb610c7d8..125f56591fb5 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -29,12 +29,13 @@
29 29
30#include <plat/clock.h> 30#include <plat/clock.h>
31#include <plat/board.h> 31#include <plat/board.h>
32#include <plat/powerdomain.h> 32#include "powerdomain.h"
33#include <plat/clockdomain.h> 33#include "clockdomain.h"
34#include <plat/dmtimer.h> 34#include <plat/dmtimer.h>
35#include <plat/omap-pm.h>
35 36
36#include "prm.h" 37#include "cm2xxx_3xxx.h"
37#include "cm.h" 38#include "prm2xxx_3xxx.h"
38#include "pm.h" 39#include "pm.h"
39 40
40int omap2_pm_debug; 41int omap2_pm_debug;
@@ -45,10 +46,10 @@ u32 wakeup_timer_milliseconds;
45 46
46#define DUMP_PRM_MOD_REG(mod, reg) \ 47#define DUMP_PRM_MOD_REG(mod, reg) \
47 regs[reg_count].name = #mod "." #reg; \ 48 regs[reg_count].name = #mod "." #reg; \
48 regs[reg_count++].val = prm_read_mod_reg(mod, reg) 49 regs[reg_count++].val = omap2_prm_read_mod_reg(mod, reg)
49#define DUMP_CM_MOD_REG(mod, reg) \ 50#define DUMP_CM_MOD_REG(mod, reg) \
50 regs[reg_count].name = #mod "." #reg; \ 51 regs[reg_count].name = #mod "." #reg; \
51 regs[reg_count++].val = cm_read_mod_reg(mod, reg) 52 regs[reg_count++].val = omap2_cm_read_mod_reg(mod, reg)
52#define DUMP_PRM_REG(reg) \ 53#define DUMP_PRM_REG(reg) \
53 regs[reg_count].name = #reg; \ 54 regs[reg_count].name = #reg; \
54 regs[reg_count++].val = __raw_readl(reg) 55 regs[reg_count++].val = __raw_readl(reg)
@@ -328,10 +329,10 @@ static void pm_dbg_regset_store(u32 *ptr)
328 for (j = pm_dbg_reg_modules[i].low; 329 for (j = pm_dbg_reg_modules[i].low;
329 j <= pm_dbg_reg_modules[i].high; j += 4) { 330 j <= pm_dbg_reg_modules[i].high; j += 4) {
330 if (pm_dbg_reg_modules[i].type == MOD_CM) 331 if (pm_dbg_reg_modules[i].type == MOD_CM)
331 val = cm_read_mod_reg( 332 val = omap2_cm_read_mod_reg(
332 pm_dbg_reg_modules[i].offset, j); 333 pm_dbg_reg_modules[i].offset, j);
333 else 334 else
334 val = prm_read_mod_reg( 335 val = omap2_prm_read_mod_reg(
335 pm_dbg_reg_modules[i].offset, j); 336 pm_dbg_reg_modules[i].offset, j);
336 *(ptr++) = val; 337 *(ptr++) = val;
337 } 338 }
@@ -581,6 +582,10 @@ static int option_set(void *data, u64 val)
581 *option = val; 582 *option = val;
582 583
583 if (option == &enable_off_mode) { 584 if (option == &enable_off_mode) {
585 if (val)
586 omap_pm_enable_off_mode();
587 else
588 omap_pm_disable_off_mode();
584 if (cpu_is_omap34xx()) 589 if (cpu_is_omap34xx())
585 omap3_pm_off_mode_enable(val); 590 omap3_pm_off_mode_enable(val);
586 } 591 }
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 6ec2ee12272a..9b1db592759f 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -18,8 +18,8 @@
18#include <plat/omap_device.h> 18#include <plat/omap_device.h>
19#include <plat/common.h> 19#include <plat/common.h>
20 20
21#include <plat/powerdomain.h> 21#include "powerdomain.h"
22#include <plat/clockdomain.h> 22#include "clockdomain.h"
23 23
24static struct omap_device_pm_latency *pm_lats; 24static struct omap_device_pm_latency *pm_lats;
25 25
@@ -89,10 +89,13 @@ static void omap2_init_processor_devices(void)
89 } 89 }
90} 90}
91 91
92/* Types of sleep_switch used in omap_set_pwrdm_state */
93#define FORCEWAKEUP_SWITCH 0
94#define LOWPOWERSTATE_SWITCH 1
95
92/* 96/*
93 * This sets pwrdm state (other than mpu & core. Currently only ON & 97 * This sets pwrdm state (other than mpu & core. Currently only ON &
94 * RET are supported. Function is assuming that clkdm doesn't have 98 * RET are supported.
95 * hw_sup mode enabled.
96 */ 99 */
97int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) 100int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
98{ 101{
@@ -114,9 +117,14 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
114 return ret; 117 return ret;
115 118
116 if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) { 119 if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) {
117 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); 120 if ((pwrdm_read_pwrst(pwrdm) > state) &&
118 sleep_switch = 1; 121 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
119 pwrdm_wait_transition(pwrdm); 122 sleep_switch = LOWPOWERSTATE_SWITCH;
123 } else {
124 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
125 pwrdm_wait_transition(pwrdm);
126 sleep_switch = FORCEWAKEUP_SWITCH;
127 }
120 } 128 }
121 129
122 ret = pwrdm_set_next_pwrst(pwrdm, state); 130 ret = pwrdm_set_next_pwrst(pwrdm, state);
@@ -126,12 +134,22 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
126 goto err; 134 goto err;
127 } 135 }
128 136
129 if (sleep_switch) { 137 switch (sleep_switch) {
130 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); 138 case FORCEWAKEUP_SWITCH:
131 pwrdm_wait_transition(pwrdm); 139 if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO)
132 pwrdm_state_switch(pwrdm); 140 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
141 else
142 omap2_clkdm_sleep(pwrdm->pwrdm_clkdms[0]);
143 break;
144 case LOWPOWERSTATE_SWITCH:
145 pwrdm_set_lowpwrstchange(pwrdm);
146 break;
147 default:
148 return ret;
133 } 149 }
134 150
151 pwrdm_wait_transition(pwrdm);
152 pwrdm_state_switch(pwrdm);
135err: 153err:
136 return ret; 154 return ret;
137} 155}
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 8b4f45eba1b5..482df7fc1585 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -11,7 +11,7 @@
11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H 11#ifndef __ARCH_ARM_MACH_OMAP2_PM_H
12#define __ARCH_ARM_MACH_OMAP2_PM_H 12#define __ARCH_ARM_MACH_OMAP2_PM_H
13 13
14#include <plat/powerdomain.h> 14#include "powerdomain.h"
15 15
16extern void *omap3_secure_ram_storage; 16extern void *omap3_secure_ram_storage;
17extern void omap3_pm_off_mode_enable(int); 17extern void omap3_pm_off_mode_enable(int);
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index aea7ced9a2ff..2844b84f8d46 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -42,16 +42,16 @@
42#include <plat/dma.h> 42#include <plat/dma.h>
43#include <plat/board.h> 43#include <plat/board.h>
44 44
45#include "prm.h" 45#include "prm2xxx_3xxx.h"
46#include "prm-regbits-24xx.h" 46#include "prm-regbits-24xx.h"
47#include "cm.h" 47#include "cm2xxx_3xxx.h"
48#include "cm-regbits-24xx.h" 48#include "cm-regbits-24xx.h"
49#include "sdrc.h" 49#include "sdrc.h"
50#include "pm.h" 50#include "pm.h"
51#include "control.h" 51#include "control.h"
52 52
53#include <plat/powerdomain.h> 53#include "powerdomain.h"
54#include <plat/clockdomain.h> 54#include "clockdomain.h"
55 55
56#ifdef CONFIG_SUSPEND 56#ifdef CONFIG_SUSPEND
57static suspend_state_t suspend_state = PM_SUSPEND_ON; 57static suspend_state_t suspend_state = PM_SUSPEND_ON;
@@ -79,8 +79,8 @@ static int omap2_fclks_active(void)
79{ 79{
80 u32 f1, f2; 80 u32 f1, f2;
81 81
82 f1 = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); 82 f1 = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
83 f2 = cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2); 83 f2 = omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
84 84
85 /* Ignore UART clocks. These are handled by UART core (serial.c) */ 85 /* Ignore UART clocks. These are handled by UART core (serial.c) */
86 f1 &= ~(OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_UART2_MASK); 86 f1 &= ~(OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_UART2_MASK);
@@ -105,9 +105,9 @@ static void omap2_enter_full_retention(void)
105 105
106 /* Clear old wake-up events */ 106 /* Clear old wake-up events */
107 /* REVISIT: These write to reserved bits? */ 107 /* REVISIT: These write to reserved bits? */
108 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1); 108 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
109 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); 109 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
110 prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); 110 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
111 111
112 /* 112 /*
113 * Set MPU powerdomain's next power state to RETENTION; 113 * Set MPU powerdomain's next power state to RETENTION;
@@ -120,7 +120,7 @@ static void omap2_enter_full_retention(void)
120 l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL; 120 l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL;
121 omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0); 121 omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0);
122 122
123 omap2_gpio_prepare_for_idle(PWRDM_POWER_RET); 123 omap2_gpio_prepare_for_idle(0);
124 124
125 if (omap2_pm_debug) { 125 if (omap2_pm_debug) {
126 omap2_pm_dump(0, 0, 0); 126 omap2_pm_dump(0, 0, 0);
@@ -167,30 +167,30 @@ no_sleep:
167 clk_enable(osc_ck); 167 clk_enable(osc_ck);
168 168
169 /* clear CORE wake-up events */ 169 /* clear CORE wake-up events */
170 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1); 170 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
171 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); 171 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
172 172
173 /* wakeup domain events - bit 1: GPT1, bit5 GPIO */ 173 /* wakeup domain events - bit 1: GPT1, bit5 GPIO */
174 prm_clear_mod_reg_bits(0x4 | 0x1, WKUP_MOD, PM_WKST); 174 omap2_prm_clear_mod_reg_bits(0x4 | 0x1, WKUP_MOD, PM_WKST);
175 175
176 /* MPU domain wake events */ 176 /* MPU domain wake events */
177 l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 177 l = omap2_prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
178 if (l & 0x01) 178 if (l & 0x01)
179 prm_write_mod_reg(0x01, OCP_MOD, 179 omap2_prm_write_mod_reg(0x01, OCP_MOD,
180 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 180 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
181 if (l & 0x20) 181 if (l & 0x20)
182 prm_write_mod_reg(0x20, OCP_MOD, 182 omap2_prm_write_mod_reg(0x20, OCP_MOD,
183 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 183 OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
184 184
185 /* Mask future PRCM-to-MPU interrupts */ 185 /* Mask future PRCM-to-MPU interrupts */
186 prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); 186 omap2_prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
187} 187}
188 188
189static int omap2_i2c_active(void) 189static int omap2_i2c_active(void)
190{ 190{
191 u32 l; 191 u32 l;
192 192
193 l = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); 193 l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
194 return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK); 194 return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK);
195} 195}
196 196
@@ -201,13 +201,13 @@ static int omap2_allow_mpu_retention(void)
201 u32 l; 201 u32 l;
202 202
203 /* Check for MMC, UART2, UART1, McSPI2, McSPI1 and DSS1. */ 203 /* Check for MMC, UART2, UART1, McSPI2, McSPI1 and DSS1. */
204 l = cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); 204 l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
205 if (l & (OMAP2420_EN_MMC_MASK | OMAP24XX_EN_UART2_MASK | 205 if (l & (OMAP2420_EN_MMC_MASK | OMAP24XX_EN_UART2_MASK |
206 OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_MCSPI2_MASK | 206 OMAP24XX_EN_UART1_MASK | OMAP24XX_EN_MCSPI2_MASK |
207 OMAP24XX_EN_MCSPI1_MASK | OMAP24XX_EN_DSS1_MASK)) 207 OMAP24XX_EN_MCSPI1_MASK | OMAP24XX_EN_DSS1_MASK))
208 return 0; 208 return 0;
209 /* Check for UART3. */ 209 /* Check for UART3. */
210 l = cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2); 210 l = omap2_cm_read_mod_reg(CORE_MOD, OMAP24XX_CM_FCLKEN2);
211 if (l & OMAP24XX_EN_UART3_MASK) 211 if (l & OMAP24XX_EN_UART3_MASK)
212 return 0; 212 return 0;
213 if (sti_console_enabled) 213 if (sti_console_enabled)
@@ -230,18 +230,18 @@ static void omap2_enter_mpu_retention(void)
230 * it is in retention mode. */ 230 * it is in retention mode. */
231 if (omap2_allow_mpu_retention()) { 231 if (omap2_allow_mpu_retention()) {
232 /* REVISIT: These write to reserved bits? */ 232 /* REVISIT: These write to reserved bits? */
233 prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1); 233 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, PM_WKST1);
234 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); 234 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2);
235 prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); 235 omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST);
236 236
237 /* Try to enter MPU retention */ 237 /* Try to enter MPU retention */
238 prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) | 238 omap2_prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) |
239 OMAP_LOGICRETSTATE_MASK, 239 OMAP_LOGICRETSTATE_MASK,
240 MPU_MOD, OMAP2_PM_PWSTCTRL); 240 MPU_MOD, OMAP2_PM_PWSTCTRL);
241 } else { 241 } else {
242 /* Block MPU retention */ 242 /* Block MPU retention */
243 243
244 prm_write_mod_reg(OMAP_LOGICRETSTATE_MASK, MPU_MOD, 244 omap2_prm_write_mod_reg(OMAP_LOGICRETSTATE_MASK, MPU_MOD,
245 OMAP2_PM_PWSTCTRL); 245 OMAP2_PM_PWSTCTRL);
246 only_idle = 1; 246 only_idle = 1;
247 } 247 }
@@ -310,9 +310,9 @@ static int omap2_pm_suspend(void)
310{ 310{
311 u32 wken_wkup, mir1; 311 u32 wken_wkup, mir1;
312 312
313 wken_wkup = prm_read_mod_reg(WKUP_MOD, PM_WKEN); 313 wken_wkup = omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN);
314 wken_wkup &= ~OMAP24XX_EN_GPT1_MASK; 314 wken_wkup &= ~OMAP24XX_EN_GPT1_MASK;
315 prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN); 315 omap2_prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN);
316 316
317 /* Mask GPT1 */ 317 /* Mask GPT1 */
318 mir1 = omap_readl(0x480fe0a4); 318 mir1 = omap_readl(0x480fe0a4);
@@ -322,7 +322,7 @@ static int omap2_pm_suspend(void)
322 omap2_enter_full_retention(); 322 omap2_enter_full_retention();
323 323
324 omap_writel(mir1, 0x480fe0a4); 324 omap_writel(mir1, 0x480fe0a4);
325 prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN); 325 omap2_prm_write_mod_reg(wken_wkup, WKUP_MOD, PM_WKEN);
326 326
327 return 0; 327 return 0;
328} 328}
@@ -376,7 +376,7 @@ static void __init prcm_setup_regs(void)
376 struct powerdomain *pwrdm; 376 struct powerdomain *pwrdm;
377 377
378 /* Enable autoidle */ 378 /* Enable autoidle */
379 prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, 379 omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD,
380 OMAP2_PRCM_SYSCONFIG_OFFSET); 380 OMAP2_PRCM_SYSCONFIG_OFFSET);
381 381
382 /* 382 /*
@@ -415,87 +415,87 @@ static void __init prcm_setup_regs(void)
415 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); 415 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm);
416 416
417 /* Enable clock autoidle for all domains */ 417 /* Enable clock autoidle for all domains */
418 cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK | 418 omap2_cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK |
419 OMAP24XX_AUTO_MAILBOXES_MASK | 419 OMAP24XX_AUTO_MAILBOXES_MASK |
420 OMAP24XX_AUTO_WDT4_MASK | 420 OMAP24XX_AUTO_WDT4_MASK |
421 OMAP2420_AUTO_WDT3_MASK | 421 OMAP2420_AUTO_WDT3_MASK |
422 OMAP24XX_AUTO_MSPRO_MASK | 422 OMAP24XX_AUTO_MSPRO_MASK |
423 OMAP2420_AUTO_MMC_MASK | 423 OMAP2420_AUTO_MMC_MASK |
424 OMAP24XX_AUTO_FAC_MASK | 424 OMAP24XX_AUTO_FAC_MASK |
425 OMAP2420_AUTO_EAC_MASK | 425 OMAP2420_AUTO_EAC_MASK |
426 OMAP24XX_AUTO_HDQ_MASK | 426 OMAP24XX_AUTO_HDQ_MASK |
427 OMAP24XX_AUTO_UART2_MASK | 427 OMAP24XX_AUTO_UART2_MASK |
428 OMAP24XX_AUTO_UART1_MASK | 428 OMAP24XX_AUTO_UART1_MASK |
429 OMAP24XX_AUTO_I2C2_MASK | 429 OMAP24XX_AUTO_I2C2_MASK |
430 OMAP24XX_AUTO_I2C1_MASK | 430 OMAP24XX_AUTO_I2C1_MASK |
431 OMAP24XX_AUTO_MCSPI2_MASK | 431 OMAP24XX_AUTO_MCSPI2_MASK |
432 OMAP24XX_AUTO_MCSPI1_MASK | 432 OMAP24XX_AUTO_MCSPI1_MASK |
433 OMAP24XX_AUTO_MCBSP2_MASK | 433 OMAP24XX_AUTO_MCBSP2_MASK |
434 OMAP24XX_AUTO_MCBSP1_MASK | 434 OMAP24XX_AUTO_MCBSP1_MASK |
435 OMAP24XX_AUTO_GPT12_MASK | 435 OMAP24XX_AUTO_GPT12_MASK |
436 OMAP24XX_AUTO_GPT11_MASK | 436 OMAP24XX_AUTO_GPT11_MASK |
437 OMAP24XX_AUTO_GPT10_MASK | 437 OMAP24XX_AUTO_GPT10_MASK |
438 OMAP24XX_AUTO_GPT9_MASK | 438 OMAP24XX_AUTO_GPT9_MASK |
439 OMAP24XX_AUTO_GPT8_MASK | 439 OMAP24XX_AUTO_GPT8_MASK |
440 OMAP24XX_AUTO_GPT7_MASK | 440 OMAP24XX_AUTO_GPT7_MASK |
441 OMAP24XX_AUTO_GPT6_MASK | 441 OMAP24XX_AUTO_GPT6_MASK |
442 OMAP24XX_AUTO_GPT5_MASK | 442 OMAP24XX_AUTO_GPT5_MASK |
443 OMAP24XX_AUTO_GPT4_MASK | 443 OMAP24XX_AUTO_GPT4_MASK |
444 OMAP24XX_AUTO_GPT3_MASK | 444 OMAP24XX_AUTO_GPT3_MASK |
445 OMAP24XX_AUTO_GPT2_MASK | 445 OMAP24XX_AUTO_GPT2_MASK |
446 OMAP2420_AUTO_VLYNQ_MASK | 446 OMAP2420_AUTO_VLYNQ_MASK |
447 OMAP24XX_AUTO_DSS_MASK, 447 OMAP24XX_AUTO_DSS_MASK,
448 CORE_MOD, CM_AUTOIDLE1); 448 CORE_MOD, CM_AUTOIDLE1);
449 cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK | 449 omap2_cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK |
450 OMAP24XX_AUTO_SSI_MASK | 450 OMAP24XX_AUTO_SSI_MASK |
451 OMAP24XX_AUTO_USB_MASK, 451 OMAP24XX_AUTO_USB_MASK,
452 CORE_MOD, CM_AUTOIDLE2); 452 CORE_MOD, CM_AUTOIDLE2);
453 cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK | 453 omap2_cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK |
454 OMAP24XX_AUTO_GPMC_MASK | 454 OMAP24XX_AUTO_GPMC_MASK |
455 OMAP24XX_AUTO_SDMA_MASK, 455 OMAP24XX_AUTO_SDMA_MASK,
456 CORE_MOD, CM_AUTOIDLE3); 456 CORE_MOD, CM_AUTOIDLE3);
457 cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK | 457 omap2_cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK |
458 OMAP24XX_AUTO_AES_MASK | 458 OMAP24XX_AUTO_AES_MASK |
459 OMAP24XX_AUTO_RNG_MASK | 459 OMAP24XX_AUTO_RNG_MASK |
460 OMAP24XX_AUTO_SHA_MASK | 460 OMAP24XX_AUTO_SHA_MASK |
461 OMAP24XX_AUTO_DES_MASK, 461 OMAP24XX_AUTO_DES_MASK,
462 CORE_MOD, OMAP24XX_CM_AUTOIDLE4); 462 CORE_MOD, OMAP24XX_CM_AUTOIDLE4);
463 463
464 cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD, 464 omap2_cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD,
465 CM_AUTOIDLE); 465 CM_AUTOIDLE);
466 466
467 /* Put DPLL and both APLLs into autoidle mode */ 467 /* Put DPLL and both APLLs into autoidle mode */
468 cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) | 468 omap2_cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) |
469 (0x03 << OMAP24XX_AUTO_96M_SHIFT) | 469 (0x03 << OMAP24XX_AUTO_96M_SHIFT) |
470 (0x03 << OMAP24XX_AUTO_54M_SHIFT), 470 (0x03 << OMAP24XX_AUTO_54M_SHIFT),
471 PLL_MOD, CM_AUTOIDLE); 471 PLL_MOD, CM_AUTOIDLE);
472 472
473 cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK | 473 omap2_cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK |
474 OMAP24XX_AUTO_WDT1_MASK | 474 OMAP24XX_AUTO_WDT1_MASK |
475 OMAP24XX_AUTO_MPU_WDT_MASK | 475 OMAP24XX_AUTO_MPU_WDT_MASK |
476 OMAP24XX_AUTO_GPIOS_MASK | 476 OMAP24XX_AUTO_GPIOS_MASK |
477 OMAP24XX_AUTO_32KSYNC_MASK | 477 OMAP24XX_AUTO_32KSYNC_MASK |
478 OMAP24XX_AUTO_GPT1_MASK, 478 OMAP24XX_AUTO_GPT1_MASK,
479 WKUP_MOD, CM_AUTOIDLE); 479 WKUP_MOD, CM_AUTOIDLE);
480 480
481 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk 481 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk
482 * stabilisation */ 482 * stabilisation */
483 prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, 483 omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
484 OMAP2_PRCM_CLKSSETUP_OFFSET); 484 OMAP2_PRCM_CLKSSETUP_OFFSET);
485 485
486 /* Configure automatic voltage transition */ 486 /* Configure automatic voltage transition */
487 prm_write_mod_reg(2 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, 487 omap2_prm_write_mod_reg(2 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
488 OMAP2_PRCM_VOLTSETUP_OFFSET); 488 OMAP2_PRCM_VOLTSETUP_OFFSET);
489 prm_write_mod_reg(OMAP24XX_AUTO_EXTVOLT_MASK | 489 omap2_prm_write_mod_reg(OMAP24XX_AUTO_EXTVOLT_MASK |
490 (0x1 << OMAP24XX_SETOFF_LEVEL_SHIFT) | 490 (0x1 << OMAP24XX_SETOFF_LEVEL_SHIFT) |
491 OMAP24XX_MEMRETCTRL_MASK | 491 OMAP24XX_MEMRETCTRL_MASK |
492 (0x1 << OMAP24XX_SETRET_LEVEL_SHIFT) | 492 (0x1 << OMAP24XX_SETRET_LEVEL_SHIFT) |
493 (0x0 << OMAP24XX_VOLT_LEVEL_SHIFT), 493 (0x0 << OMAP24XX_VOLT_LEVEL_SHIFT),
494 OMAP24XX_GR_MOD, OMAP2_PRCM_VOLTCTRL_OFFSET); 494 OMAP24XX_GR_MOD, OMAP2_PRCM_VOLTCTRL_OFFSET);
495 495
496 /* Enable wake-up events */ 496 /* Enable wake-up events */
497 prm_write_mod_reg(OMAP24XX_EN_GPIOS_MASK | OMAP24XX_EN_GPT1_MASK, 497 omap2_prm_write_mod_reg(OMAP24XX_EN_GPIOS_MASK | OMAP24XX_EN_GPT1_MASK,
498 WKUP_MOD, PM_WKEN); 498 WKUP_MOD, PM_WKEN);
499} 499}
500 500
501static int __init omap2_pm_init(void) 501static int __init omap2_pm_init(void)
@@ -506,7 +506,7 @@ static int __init omap2_pm_init(void)
506 return -ENODEV; 506 return -ENODEV;
507 507
508 printk(KERN_INFO "Power Management for OMAP2 initializing\n"); 508 printk(KERN_INFO "Power Management for OMAP2 initializing\n");
509 l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET); 509 l = omap2_prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET);
510 printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); 510 printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
511 511
512 /* Look up important powerdomains */ 512 /* Look up important powerdomains */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index c45b4fa1deeb..5b323f28da2d 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -31,8 +31,8 @@
31#include <linux/console.h> 31#include <linux/console.h>
32 32
33#include <plat/sram.h> 33#include <plat/sram.h>
34#include <plat/clockdomain.h> 34#include "clockdomain.h"
35#include <plat/powerdomain.h> 35#include "powerdomain.h"
36#include <plat/serial.h> 36#include <plat/serial.h>
37#include <plat/sdrc.h> 37#include <plat/sdrc.h>
38#include <plat/prcm.h> 38#include <plat/prcm.h>
@@ -41,11 +41,11 @@
41 41
42#include <asm/tlbflush.h> 42#include <asm/tlbflush.h>
43 43
44#include "cm.h" 44#include "cm2xxx_3xxx.h"
45#include "cm-regbits-34xx.h" 45#include "cm-regbits-34xx.h"
46#include "prm-regbits-34xx.h" 46#include "prm-regbits-34xx.h"
47 47
48#include "prm.h" 48#include "prm2xxx_3xxx.h"
49#include "pm.h" 49#include "pm.h"
50#include "sdrc.h" 50#include "sdrc.h"
51#include "control.h" 51#include "control.h"
@@ -105,12 +105,12 @@ static void omap3_enable_io_chain(void)
105 int timeout = 0; 105 int timeout = 0;
106 106
107 if (omap_rev() >= OMAP3430_REV_ES3_1) { 107 if (omap_rev() >= OMAP3430_REV_ES3_1) {
108 prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, 108 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
109 PM_WKEN); 109 PM_WKEN);
110 /* Do a readback to assure write has been done */ 110 /* Do a readback to assure write has been done */
111 prm_read_mod_reg(WKUP_MOD, PM_WKEN); 111 omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN);
112 112
113 while (!(prm_read_mod_reg(WKUP_MOD, PM_WKEN) & 113 while (!(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKEN) &
114 OMAP3430_ST_IO_CHAIN_MASK)) { 114 OMAP3430_ST_IO_CHAIN_MASK)) {
115 timeout++; 115 timeout++;
116 if (timeout > 1000) { 116 if (timeout > 1000) {
@@ -118,7 +118,7 @@ static void omap3_enable_io_chain(void)
118 "activation failed.\n"); 118 "activation failed.\n");
119 return; 119 return;
120 } 120 }
121 prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, 121 omap2_prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK,
122 WKUP_MOD, PM_WKEN); 122 WKUP_MOD, PM_WKEN);
123 } 123 }
124 } 124 }
@@ -127,22 +127,13 @@ static void omap3_enable_io_chain(void)
127static void omap3_disable_io_chain(void) 127static void omap3_disable_io_chain(void)
128{ 128{
129 if (omap_rev() >= OMAP3430_REV_ES3_1) 129 if (omap_rev() >= OMAP3430_REV_ES3_1)
130 prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, 130 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
131 PM_WKEN); 131 PM_WKEN);
132} 132}
133 133
134static void omap3_core_save_context(void) 134static void omap3_core_save_context(void)
135{ 135{
136 u32 control_padconf_off; 136 omap3_ctrl_save_padconf();
137
138 /* Save the padconf registers */
139 control_padconf_off = omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF);
140 control_padconf_off |= START_PADCONF_SAVE;
141 omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF);
142 /* wait for the save to complete */
143 while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
144 & PADCONF_SAVE_DONE))
145 udelay(1);
146 137
147 /* 138 /*
148 * Force write last pad into memory, as this can fail in some 139 * Force write last pad into memory, as this can fail in some
@@ -221,27 +212,27 @@ static int prcm_clear_mod_irqs(s16 module, u8 regs)
221 OMAP3430ES2_PM_MPUGRPSEL3 : OMAP3430_PM_MPUGRPSEL; 212 OMAP3430ES2_PM_MPUGRPSEL3 : OMAP3430_PM_MPUGRPSEL;
222 int c = 0; 213 int c = 0;
223 214
224 wkst = prm_read_mod_reg(module, wkst_off); 215 wkst = omap2_prm_read_mod_reg(module, wkst_off);
225 wkst &= prm_read_mod_reg(module, grpsel_off); 216 wkst &= omap2_prm_read_mod_reg(module, grpsel_off);
226 if (wkst) { 217 if (wkst) {
227 iclk = cm_read_mod_reg(module, iclk_off); 218 iclk = omap2_cm_read_mod_reg(module, iclk_off);
228 fclk = cm_read_mod_reg(module, fclk_off); 219 fclk = omap2_cm_read_mod_reg(module, fclk_off);
229 while (wkst) { 220 while (wkst) {
230 clken = wkst; 221 clken = wkst;
231 cm_set_mod_reg_bits(clken, module, iclk_off); 222 omap2_cm_set_mod_reg_bits(clken, module, iclk_off);
232 /* 223 /*
233 * For USBHOST, we don't know whether HOST1 or 224 * For USBHOST, we don't know whether HOST1 or
234 * HOST2 woke us up, so enable both f-clocks 225 * HOST2 woke us up, so enable both f-clocks
235 */ 226 */
236 if (module == OMAP3430ES2_USBHOST_MOD) 227 if (module == OMAP3430ES2_USBHOST_MOD)
237 clken |= 1 << OMAP3430ES2_EN_USBHOST2_SHIFT; 228 clken |= 1 << OMAP3430ES2_EN_USBHOST2_SHIFT;
238 cm_set_mod_reg_bits(clken, module, fclk_off); 229 omap2_cm_set_mod_reg_bits(clken, module, fclk_off);
239 prm_write_mod_reg(wkst, module, wkst_off); 230 omap2_prm_write_mod_reg(wkst, module, wkst_off);
240 wkst = prm_read_mod_reg(module, wkst_off); 231 wkst = omap2_prm_read_mod_reg(module, wkst_off);
241 c++; 232 c++;
242 } 233 }
243 cm_write_mod_reg(iclk, module, iclk_off); 234 omap2_cm_write_mod_reg(iclk, module, iclk_off);
244 cm_write_mod_reg(fclk, module, fclk_off); 235 omap2_cm_write_mod_reg(fclk, module, fclk_off);
245 } 236 }
246 237
247 return c; 238 return c;
@@ -284,9 +275,9 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
284 u32 irqenable_mpu, irqstatus_mpu; 275 u32 irqenable_mpu, irqstatus_mpu;
285 int c = 0; 276 int c = 0;
286 277
287 irqenable_mpu = prm_read_mod_reg(OCP_MOD, 278 irqenable_mpu = omap2_prm_read_mod_reg(OCP_MOD,
288 OMAP3_PRM_IRQENABLE_MPU_OFFSET); 279 OMAP3_PRM_IRQENABLE_MPU_OFFSET);
289 irqstatus_mpu = prm_read_mod_reg(OCP_MOD, 280 irqstatus_mpu = omap2_prm_read_mod_reg(OCP_MOD,
290 OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 281 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
291 irqstatus_mpu &= irqenable_mpu; 282 irqstatus_mpu &= irqenable_mpu;
292 283
@@ -307,10 +298,10 @@ static irqreturn_t prcm_interrupt_handler (int irq, void *dev_id)
307 "no code to handle it (%08x)\n", irqstatus_mpu); 298 "no code to handle it (%08x)\n", irqstatus_mpu);
308 } 299 }
309 300
310 prm_write_mod_reg(irqstatus_mpu, OCP_MOD, 301 omap2_prm_write_mod_reg(irqstatus_mpu, OCP_MOD,
311 OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 302 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
312 303
313 irqstatus_mpu = prm_read_mod_reg(OCP_MOD, 304 irqstatus_mpu = omap2_prm_read_mod_reg(OCP_MOD,
314 OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 305 OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
315 irqstatus_mpu &= irqenable_mpu; 306 irqstatus_mpu &= irqenable_mpu;
316 307
@@ -360,6 +351,7 @@ void omap_sram_idle(void)
360 int mpu_next_state = PWRDM_POWER_ON; 351 int mpu_next_state = PWRDM_POWER_ON;
361 int per_next_state = PWRDM_POWER_ON; 352 int per_next_state = PWRDM_POWER_ON;
362 int core_next_state = PWRDM_POWER_ON; 353 int core_next_state = PWRDM_POWER_ON;
354 int per_going_off;
363 int core_prev_state, per_prev_state; 355 int core_prev_state, per_prev_state;
364 u32 sdrc_pwr = 0; 356 u32 sdrc_pwr = 0;
365 357
@@ -398,7 +390,7 @@ void omap_sram_idle(void)
398 if (omap3_has_io_wakeup() && 390 if (omap3_has_io_wakeup() &&
399 (per_next_state < PWRDM_POWER_ON || 391 (per_next_state < PWRDM_POWER_ON ||
400 core_next_state < PWRDM_POWER_ON)) { 392 core_next_state < PWRDM_POWER_ON)) {
401 prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); 393 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN);
402 omap3_enable_io_chain(); 394 omap3_enable_io_chain();
403 } 395 }
404 396
@@ -411,9 +403,10 @@ void omap_sram_idle(void)
411 403
412 /* PER */ 404 /* PER */
413 if (per_next_state < PWRDM_POWER_ON) { 405 if (per_next_state < PWRDM_POWER_ON) {
406 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
414 omap_uart_prepare_idle(2); 407 omap_uart_prepare_idle(2);
415 omap_uart_prepare_idle(3); 408 omap_uart_prepare_idle(3);
416 omap2_gpio_prepare_for_idle(per_next_state); 409 omap2_gpio_prepare_for_idle(per_going_off);
417 if (per_next_state == PWRDM_POWER_OFF) 410 if (per_next_state == PWRDM_POWER_OFF)
418 omap3_per_save_context(); 411 omap3_per_save_context();
419 } 412 }
@@ -424,7 +417,7 @@ void omap_sram_idle(void)
424 omap_uart_prepare_idle(1); 417 omap_uart_prepare_idle(1);
425 if (core_next_state == PWRDM_POWER_OFF) { 418 if (core_next_state == PWRDM_POWER_OFF) {
426 omap3_core_save_context(); 419 omap3_core_save_context();
427 omap3_prcm_save_context(); 420 omap3_cm_save_context();
428 } 421 }
429 } 422 }
430 423
@@ -464,14 +457,14 @@ void omap_sram_idle(void)
464 core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm); 457 core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm);
465 if (core_prev_state == PWRDM_POWER_OFF) { 458 if (core_prev_state == PWRDM_POWER_OFF) {
466 omap3_core_restore_context(); 459 omap3_core_restore_context();
467 omap3_prcm_restore_context(); 460 omap3_cm_restore_context();
468 omap3_sram_restore_context(); 461 omap3_sram_restore_context();
469 omap2_sms_restore_context(); 462 omap2_sms_restore_context();
470 } 463 }
471 omap_uart_resume_idle(0); 464 omap_uart_resume_idle(0);
472 omap_uart_resume_idle(1); 465 omap_uart_resume_idle(1);
473 if (core_next_state == PWRDM_POWER_OFF) 466 if (core_next_state == PWRDM_POWER_OFF)
474 prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, 467 omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK,
475 OMAP3430_GR_MOD, 468 OMAP3430_GR_MOD,
476 OMAP3_PRM_VOLTCTRL_OFFSET); 469 OMAP3_PRM_VOLTCTRL_OFFSET);
477 } 470 }
@@ -495,7 +488,8 @@ console_still_active:
495 if (omap3_has_io_wakeup() && 488 if (omap3_has_io_wakeup() &&
496 (per_next_state < PWRDM_POWER_ON || 489 (per_next_state < PWRDM_POWER_ON ||
497 core_next_state < PWRDM_POWER_ON)) { 490 core_next_state < PWRDM_POWER_ON)) {
498 prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, PM_WKEN); 491 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD,
492 PM_WKEN);
499 omap3_disable_io_chain(); 493 omap3_disable_io_chain();
500 } 494 }
501 495
@@ -633,21 +627,21 @@ static struct platform_suspend_ops omap_pm_ops = {
633static void __init omap3_iva_idle(void) 627static void __init omap3_iva_idle(void)
634{ 628{
635 /* ensure IVA2 clock is disabled */ 629 /* ensure IVA2 clock is disabled */
636 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); 630 omap2_cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
637 631
638 /* if no clock activity, nothing else to do */ 632 /* if no clock activity, nothing else to do */
639 if (!(cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) & 633 if (!(omap2_cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_CM_CLKSTST) &
640 OMAP3430_CLKACTIVITY_IVA2_MASK)) 634 OMAP3430_CLKACTIVITY_IVA2_MASK))
641 return; 635 return;
642 636
643 /* Reset IVA2 */ 637 /* Reset IVA2 */
644 prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK | 638 omap2_prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK |
645 OMAP3430_RST2_IVA2_MASK | 639 OMAP3430_RST2_IVA2_MASK |
646 OMAP3430_RST3_IVA2_MASK, 640 OMAP3430_RST3_IVA2_MASK,
647 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); 641 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
648 642
649 /* Enable IVA2 clock */ 643 /* Enable IVA2 clock */
650 cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK, 644 omap2_cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK,
651 OMAP3430_IVA2_MOD, CM_FCLKEN); 645 OMAP3430_IVA2_MOD, CM_FCLKEN);
652 646
653 /* Set IVA2 boot mode to 'idle' */ 647 /* Set IVA2 boot mode to 'idle' */
@@ -655,13 +649,13 @@ static void __init omap3_iva_idle(void)
655 OMAP343X_CONTROL_IVA2_BOOTMOD); 649 OMAP343X_CONTROL_IVA2_BOOTMOD);
656 650
657 /* Un-reset IVA2 */ 651 /* Un-reset IVA2 */
658 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); 652 omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
659 653
660 /* Disable IVA2 clock */ 654 /* Disable IVA2 clock */
661 cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); 655 omap2_cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN);
662 656
663 /* Reset IVA2 */ 657 /* Reset IVA2 */
664 prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK | 658 omap2_prm_write_mod_reg(OMAP3430_RST1_IVA2_MASK |
665 OMAP3430_RST2_IVA2_MASK | 659 OMAP3430_RST2_IVA2_MASK |
666 OMAP3430_RST3_IVA2_MASK, 660 OMAP3430_RST3_IVA2_MASK,
667 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); 661 OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL);
@@ -685,10 +679,10 @@ static void __init omap3_d2d_idle(void)
685 omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK); 679 omap_ctrl_writew(padconf, OMAP3_PADCONF_SAD2D_IDLEACK);
686 680
687 /* reset modem */ 681 /* reset modem */
688 prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON_MASK | 682 omap2_prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON_MASK |
689 OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST_MASK, 683 OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST_MASK,
690 CORE_MOD, OMAP2_RM_RSTCTRL); 684 CORE_MOD, OMAP2_RM_RSTCTRL);
691 prm_write_mod_reg(0, CORE_MOD, OMAP2_RM_RSTCTRL); 685 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP2_RM_RSTCTRL);
692} 686}
693 687
694static void __init prcm_setup_regs(void) 688static void __init prcm_setup_regs(void)
@@ -703,23 +697,23 @@ static void __init prcm_setup_regs(void)
703 697
704 /* XXX Reset all wkdeps. This should be done when initializing 698 /* XXX Reset all wkdeps. This should be done when initializing
705 * powerdomains */ 699 * powerdomains */
706 prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP); 700 omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
707 prm_write_mod_reg(0, MPU_MOD, PM_WKDEP); 701 omap2_prm_write_mod_reg(0, MPU_MOD, PM_WKDEP);
708 prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP); 702 omap2_prm_write_mod_reg(0, OMAP3430_DSS_MOD, PM_WKDEP);
709 prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP); 703 omap2_prm_write_mod_reg(0, OMAP3430_NEON_MOD, PM_WKDEP);
710 prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP); 704 omap2_prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP);
711 prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP); 705 omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP);
712 if (omap_rev() > OMAP3430_REV_ES1_0) { 706 if (omap_rev() > OMAP3430_REV_ES1_0) {
713 prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP); 707 omap2_prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP);
714 prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP); 708 omap2_prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
715 } else 709 } else
716 prm_write_mod_reg(0, GFX_MOD, PM_WKDEP); 710 omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
717 711
718 /* 712 /*
719 * Enable interface clock autoidle for all modules. 713 * Enable interface clock autoidle for all modules.
720 * Note that in the long run this should be done by clockfw 714 * Note that in the long run this should be done by clockfw
721 */ 715 */
722 cm_write_mod_reg( 716 omap2_cm_write_mod_reg(
723 OMAP3430_AUTO_MODEM_MASK | 717 OMAP3430_AUTO_MODEM_MASK |
724 OMAP3430ES2_AUTO_MMC3_MASK | 718 OMAP3430ES2_AUTO_MMC3_MASK |
725 OMAP3430ES2_AUTO_ICR_MASK | 719 OMAP3430ES2_AUTO_ICR_MASK |
@@ -752,7 +746,7 @@ static void __init prcm_setup_regs(void)
752 OMAP3430_AUTO_SSI_MASK, 746 OMAP3430_AUTO_SSI_MASK,
753 CORE_MOD, CM_AUTOIDLE1); 747 CORE_MOD, CM_AUTOIDLE1);
754 748
755 cm_write_mod_reg( 749 omap2_cm_write_mod_reg(
756 OMAP3430_AUTO_PKA_MASK | 750 OMAP3430_AUTO_PKA_MASK |
757 OMAP3430_AUTO_AES1_MASK | 751 OMAP3430_AUTO_AES1_MASK |
758 OMAP3430_AUTO_RNG_MASK | 752 OMAP3430_AUTO_RNG_MASK |
@@ -761,13 +755,13 @@ static void __init prcm_setup_regs(void)
761 CORE_MOD, CM_AUTOIDLE2); 755 CORE_MOD, CM_AUTOIDLE2);
762 756
763 if (omap_rev() > OMAP3430_REV_ES1_0) { 757 if (omap_rev() > OMAP3430_REV_ES1_0) {
764 cm_write_mod_reg( 758 omap2_cm_write_mod_reg(
765 OMAP3430_AUTO_MAD2D_MASK | 759 OMAP3430_AUTO_MAD2D_MASK |
766 OMAP3430ES2_AUTO_USBTLL_MASK, 760 OMAP3430ES2_AUTO_USBTLL_MASK,
767 CORE_MOD, CM_AUTOIDLE3); 761 CORE_MOD, CM_AUTOIDLE3);
768 } 762 }
769 763
770 cm_write_mod_reg( 764 omap2_cm_write_mod_reg(
771 OMAP3430_AUTO_WDT2_MASK | 765 OMAP3430_AUTO_WDT2_MASK |
772 OMAP3430_AUTO_WDT1_MASK | 766 OMAP3430_AUTO_WDT1_MASK |
773 OMAP3430_AUTO_GPIO1_MASK | 767 OMAP3430_AUTO_GPIO1_MASK |
@@ -776,17 +770,17 @@ static void __init prcm_setup_regs(void)
776 OMAP3430_AUTO_GPT1_MASK, 770 OMAP3430_AUTO_GPT1_MASK,
777 WKUP_MOD, CM_AUTOIDLE); 771 WKUP_MOD, CM_AUTOIDLE);
778 772
779 cm_write_mod_reg( 773 omap2_cm_write_mod_reg(
780 OMAP3430_AUTO_DSS_MASK, 774 OMAP3430_AUTO_DSS_MASK,
781 OMAP3430_DSS_MOD, 775 OMAP3430_DSS_MOD,
782 CM_AUTOIDLE); 776 CM_AUTOIDLE);
783 777
784 cm_write_mod_reg( 778 omap2_cm_write_mod_reg(
785 OMAP3430_AUTO_CAM_MASK, 779 OMAP3430_AUTO_CAM_MASK,
786 OMAP3430_CAM_MOD, 780 OMAP3430_CAM_MOD,
787 CM_AUTOIDLE); 781 CM_AUTOIDLE);
788 782
789 cm_write_mod_reg( 783 omap2_cm_write_mod_reg(
790 omap3630_auto_uart4_mask | 784 omap3630_auto_uart4_mask |
791 OMAP3430_AUTO_GPIO6_MASK | 785 OMAP3430_AUTO_GPIO6_MASK |
792 OMAP3430_AUTO_GPIO5_MASK | 786 OMAP3430_AUTO_GPIO5_MASK |
@@ -810,7 +804,7 @@ static void __init prcm_setup_regs(void)
810 CM_AUTOIDLE); 804 CM_AUTOIDLE);
811 805
812 if (omap_rev() > OMAP3430_REV_ES1_0) { 806 if (omap_rev() > OMAP3430_REV_ES1_0) {
813 cm_write_mod_reg( 807 omap2_cm_write_mod_reg(
814 OMAP3430ES2_AUTO_USBHOST_MASK, 808 OMAP3430ES2_AUTO_USBHOST_MASK,
815 OMAP3430ES2_USBHOST_MOD, 809 OMAP3430ES2_USBHOST_MOD,
816 CM_AUTOIDLE); 810 CM_AUTOIDLE);
@@ -822,16 +816,16 @@ static void __init prcm_setup_regs(void)
822 * Set all plls to autoidle. This is needed until autoidle is 816 * Set all plls to autoidle. This is needed until autoidle is
823 * enabled by clockfw 817 * enabled by clockfw
824 */ 818 */
825 cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT, 819 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT,
826 OMAP3430_IVA2_MOD, CM_AUTOIDLE2); 820 OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
827 cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT, 821 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT,
828 MPU_MOD, 822 MPU_MOD,
829 CM_AUTOIDLE2); 823 CM_AUTOIDLE2);
830 cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) | 824 omap2_cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) |
831 (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT), 825 (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT),
832 PLL_MOD, 826 PLL_MOD,
833 CM_AUTOIDLE); 827 CM_AUTOIDLE);
834 cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT, 828 omap2_cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT,
835 PLL_MOD, 829 PLL_MOD,
836 CM_AUTOIDLE2); 830 CM_AUTOIDLE2);
837 831
@@ -840,31 +834,31 @@ static void __init prcm_setup_regs(void)
840 * sys_clkreq. In the long run clock framework should 834 * sys_clkreq. In the long run clock framework should
841 * take care of this. 835 * take care of this.
842 */ 836 */
843 prm_rmw_mod_reg_bits(OMAP_AUTOEXTCLKMODE_MASK, 837 omap2_prm_rmw_mod_reg_bits(OMAP_AUTOEXTCLKMODE_MASK,
844 1 << OMAP_AUTOEXTCLKMODE_SHIFT, 838 1 << OMAP_AUTOEXTCLKMODE_SHIFT,
845 OMAP3430_GR_MOD, 839 OMAP3430_GR_MOD,
846 OMAP3_PRM_CLKSRC_CTRL_OFFSET); 840 OMAP3_PRM_CLKSRC_CTRL_OFFSET);
847 841
848 /* setup wakup source */ 842 /* setup wakup source */
849 prm_write_mod_reg(OMAP3430_EN_IO_MASK | OMAP3430_EN_GPIO1_MASK | 843 omap2_prm_write_mod_reg(OMAP3430_EN_IO_MASK | OMAP3430_EN_GPIO1_MASK |
850 OMAP3430_EN_GPT1_MASK | OMAP3430_EN_GPT12_MASK, 844 OMAP3430_EN_GPT1_MASK | OMAP3430_EN_GPT12_MASK,
851 WKUP_MOD, PM_WKEN); 845 WKUP_MOD, PM_WKEN);
852 /* No need to write EN_IO, that is always enabled */ 846 /* No need to write EN_IO, that is always enabled */
853 prm_write_mod_reg(OMAP3430_GRPSEL_GPIO1_MASK | 847 omap2_prm_write_mod_reg(OMAP3430_GRPSEL_GPIO1_MASK |
854 OMAP3430_GRPSEL_GPT1_MASK | 848 OMAP3430_GRPSEL_GPT1_MASK |
855 OMAP3430_GRPSEL_GPT12_MASK, 849 OMAP3430_GRPSEL_GPT12_MASK,
856 WKUP_MOD, OMAP3430_PM_MPUGRPSEL); 850 WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
857 /* For some reason IO doesn't generate wakeup event even if 851 /* For some reason IO doesn't generate wakeup event even if
858 * it is selected to mpu wakeup goup */ 852 * it is selected to mpu wakeup goup */
859 prm_write_mod_reg(OMAP3430_IO_EN_MASK | OMAP3430_WKUP_EN_MASK, 853 omap2_prm_write_mod_reg(OMAP3430_IO_EN_MASK | OMAP3430_WKUP_EN_MASK,
860 OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); 854 OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
861 855
862 /* Enable PM_WKEN to support DSS LPR */ 856 /* Enable PM_WKEN to support DSS LPR */
863 prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS_MASK, 857 omap2_prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS_MASK,
864 OMAP3430_DSS_MOD, PM_WKEN); 858 OMAP3430_DSS_MOD, PM_WKEN);
865 859
866 /* Enable wakeups in PER */ 860 /* Enable wakeups in PER */
867 prm_write_mod_reg(omap3630_en_uart4_mask | 861 omap2_prm_write_mod_reg(omap3630_en_uart4_mask |
868 OMAP3430_EN_GPIO2_MASK | OMAP3430_EN_GPIO3_MASK | 862 OMAP3430_EN_GPIO2_MASK | OMAP3430_EN_GPIO3_MASK |
869 OMAP3430_EN_GPIO4_MASK | OMAP3430_EN_GPIO5_MASK | 863 OMAP3430_EN_GPIO4_MASK | OMAP3430_EN_GPIO5_MASK |
870 OMAP3430_EN_GPIO6_MASK | OMAP3430_EN_UART3_MASK | 864 OMAP3430_EN_GPIO6_MASK | OMAP3430_EN_UART3_MASK |
@@ -872,7 +866,7 @@ static void __init prcm_setup_regs(void)
872 OMAP3430_EN_MCBSP4_MASK, 866 OMAP3430_EN_MCBSP4_MASK,
873 OMAP3430_PER_MOD, PM_WKEN); 867 OMAP3430_PER_MOD, PM_WKEN);
874 /* and allow them to wake up MPU */ 868 /* and allow them to wake up MPU */
875 prm_write_mod_reg(omap3630_grpsel_uart4_mask | 869 omap2_prm_write_mod_reg(omap3630_grpsel_uart4_mask |
876 OMAP3430_GRPSEL_GPIO2_MASK | 870 OMAP3430_GRPSEL_GPIO2_MASK |
877 OMAP3430_GRPSEL_GPIO3_MASK | 871 OMAP3430_GRPSEL_GPIO3_MASK |
878 OMAP3430_GRPSEL_GPIO4_MASK | 872 OMAP3430_GRPSEL_GPIO4_MASK |
@@ -885,22 +879,22 @@ static void __init prcm_setup_regs(void)
885 OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL); 879 OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
886 880
887 /* Don't attach IVA interrupts */ 881 /* Don't attach IVA interrupts */
888 prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL); 882 omap2_prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
889 prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1); 883 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1);
890 prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3); 884 omap2_prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
891 prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL); 885 omap2_prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
892 886
893 /* Clear any pending 'reset' flags */ 887 /* Clear any pending 'reset' flags */
894 prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST); 888 omap2_prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST);
895 prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST); 889 omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST);
896 prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST); 890 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST);
897 prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST); 891 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST);
898 prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST); 892 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST);
899 prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST); 893 omap2_prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST);
900 prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, OMAP2_RM_RSTST); 894 omap2_prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, OMAP2_RM_RSTST);
901 895
902 /* Clear any pending PRCM interrupts */ 896 /* Clear any pending PRCM interrupts */
903 prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); 897 omap2_prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
904 898
905 omap3_iva_idle(); 899 omap3_iva_idle();
906 omap3_d2d_idle(); 900 omap3_d2d_idle();
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index 6aff9961e35d..e9f4862c4de4 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -16,7 +16,7 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18 18
19#include <plat/powerdomain.h> 19#include "powerdomain.h"
20#include <mach/omap4-common.h> 20#include <mach/omap4-common.h>
21 21
22struct power_state { 22struct power_state {
diff --git a/arch/arm/mach-omap2/powerdomain-common.c b/arch/arm/mach-omap2/powerdomain-common.c
new file mode 100644
index 000000000000..171fccd208c7
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomain-common.c
@@ -0,0 +1,110 @@
1/*
2 * linux/arch/arm/mach-omap2/powerdomain-common.c
3 * Contains common powerdomain framework functions
4 *
5 * Copyright (C) 2010 Texas Instruments, Inc.
6 * Copyright (C) 2010 Nokia Corporation
7 *
8 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/errno.h>
16#include <linux/kernel.h>
17#include "pm.h"
18#include "cm.h"
19#include "cm-regbits-34xx.h"
20#include "cm-regbits-44xx.h"
21#include "prm-regbits-34xx.h"
22#include "prm-regbits-44xx.h"
23
24/*
25 * OMAP3 and OMAP4 specific register bit initialisations
26 * Notice that the names here are not according to each power
27 * domain but the bit mapping used applies to all of them
28 */
29/* OMAP3 and OMAP4 Memory Onstate Masks (common across all power domains) */
30#define OMAP_MEM0_ONSTATE_MASK OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK
31#define OMAP_MEM1_ONSTATE_MASK OMAP3430_L1FLATMEMONSTATE_MASK
32#define OMAP_MEM2_ONSTATE_MASK OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK
33#define OMAP_MEM3_ONSTATE_MASK OMAP3430_L2FLATMEMONSTATE_MASK
34#define OMAP_MEM4_ONSTATE_MASK OMAP4430_OCP_NRET_BANK_ONSTATE_MASK
35
36/* OMAP3 and OMAP4 Memory Retstate Masks (common across all power domains) */
37#define OMAP_MEM0_RETSTATE_MASK OMAP3430_SHAREDL1CACHEFLATRETSTATE_MASK
38#define OMAP_MEM1_RETSTATE_MASK OMAP3430_L1FLATMEMRETSTATE_MASK
39#define OMAP_MEM2_RETSTATE_MASK OMAP3430_SHAREDL2CACHEFLATRETSTATE_MASK
40#define OMAP_MEM3_RETSTATE_MASK OMAP3430_L2FLATMEMRETSTATE_MASK
41#define OMAP_MEM4_RETSTATE_MASK OMAP4430_OCP_NRET_BANK_RETSTATE_MASK
42
43/* OMAP3 and OMAP4 Memory Status bits */
44#define OMAP_MEM0_STATEST_MASK OMAP3430_SHAREDL1CACHEFLATSTATEST_MASK
45#define OMAP_MEM1_STATEST_MASK OMAP3430_L1FLATMEMSTATEST_MASK
46#define OMAP_MEM2_STATEST_MASK OMAP3430_SHAREDL2CACHEFLATSTATEST_MASK
47#define OMAP_MEM3_STATEST_MASK OMAP3430_L2FLATMEMSTATEST_MASK
48#define OMAP_MEM4_STATEST_MASK OMAP4430_OCP_NRET_BANK_STATEST_MASK
49
50/* Common Internal functions used across OMAP rev's*/
51u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank)
52{
53 switch (bank) {
54 case 0:
55 return OMAP_MEM0_ONSTATE_MASK;
56 case 1:
57 return OMAP_MEM1_ONSTATE_MASK;
58 case 2:
59 return OMAP_MEM2_ONSTATE_MASK;
60 case 3:
61 return OMAP_MEM3_ONSTATE_MASK;
62 case 4:
63 return OMAP_MEM4_ONSTATE_MASK;
64 default:
65 WARN_ON(1); /* should never happen */
66 return -EEXIST;
67 }
68 return 0;
69}
70
71u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank)
72{
73 switch (bank) {
74 case 0:
75 return OMAP_MEM0_RETSTATE_MASK;
76 case 1:
77 return OMAP_MEM1_RETSTATE_MASK;
78 case 2:
79 return OMAP_MEM2_RETSTATE_MASK;
80 case 3:
81 return OMAP_MEM3_RETSTATE_MASK;
82 case 4:
83 return OMAP_MEM4_RETSTATE_MASK;
84 default:
85 WARN_ON(1); /* should never happen */
86 return -EEXIST;
87 }
88 return 0;
89}
90
91u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank)
92{
93 switch (bank) {
94 case 0:
95 return OMAP_MEM0_STATEST_MASK;
96 case 1:
97 return OMAP_MEM1_STATEST_MASK;
98 case 2:
99 return OMAP_MEM2_STATEST_MASK;
100 case 3:
101 return OMAP_MEM3_STATEST_MASK;
102 case 4:
103 return OMAP_MEM4_STATEST_MASK;
104 default:
105 WARN_ON(1); /* should never happen */
106 return -EEXIST;
107 }
108 return 0;
109}
110
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 6527ec30dc17..eaed0df16699 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -15,27 +15,19 @@
15#undef DEBUG 15#undef DEBUG
16 16
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/delay.h>
21#include <linux/spinlock.h>
22#include <linux/list.h> 19#include <linux/list.h>
23#include <linux/errno.h> 20#include <linux/errno.h>
24#include <linux/err.h> 21#include <linux/string.h>
25#include <linux/io.h> 22#include "cm2xxx_3xxx.h"
26 23#include "prcm44xx.h"
27#include <asm/atomic.h> 24#include "cm44xx.h"
28 25#include "prm2xxx_3xxx.h"
29#include "cm.h" 26#include "prm44xx.h"
30#include "cm-regbits-34xx.h"
31#include "cm-regbits-44xx.h"
32#include "prm.h"
33#include "prm-regbits-34xx.h"
34#include "prm-regbits-44xx.h"
35 27
36#include <plat/cpu.h> 28#include <plat/cpu.h>
37#include <plat/powerdomain.h> 29#include "powerdomain.h"
38#include <plat/clockdomain.h> 30#include "clockdomain.h"
39#include <plat/prcm.h> 31#include <plat/prcm.h>
40 32
41#include "pm.h" 33#include "pm.h"
@@ -45,41 +37,12 @@ enum {
45 PWRDM_STATE_PREV, 37 PWRDM_STATE_PREV,
46}; 38};
47 39
48/* Variable holding value of the CPU dependent PWRSTCTRL Register Offset */
49static u16 pwrstctrl_reg_offs;
50
51/* Variable holding value of the CPU dependent PWRSTST Register Offset */
52static u16 pwrstst_reg_offs;
53
54/* OMAP3 and OMAP4 specific register bit initialisations
55 * Notice that the names here are not according to each power
56 * domain but the bit mapping used applies to all of them
57 */
58
59/* OMAP3 and OMAP4 Memory Onstate Masks (common across all power domains) */
60#define OMAP_MEM0_ONSTATE_MASK OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK
61#define OMAP_MEM1_ONSTATE_MASK OMAP3430_L1FLATMEMONSTATE_MASK
62#define OMAP_MEM2_ONSTATE_MASK OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK
63#define OMAP_MEM3_ONSTATE_MASK OMAP3430_L2FLATMEMONSTATE_MASK
64#define OMAP_MEM4_ONSTATE_MASK OMAP4430_OCP_NRET_BANK_ONSTATE_MASK
65
66/* OMAP3 and OMAP4 Memory Retstate Masks (common across all power domains) */
67#define OMAP_MEM0_RETSTATE_MASK OMAP3430_SHAREDL1CACHEFLATRETSTATE_MASK
68#define OMAP_MEM1_RETSTATE_MASK OMAP3430_L1FLATMEMRETSTATE_MASK
69#define OMAP_MEM2_RETSTATE_MASK OMAP3430_SHAREDL2CACHEFLATRETSTATE_MASK
70#define OMAP_MEM3_RETSTATE_MASK OMAP3430_L2FLATMEMRETSTATE_MASK
71#define OMAP_MEM4_RETSTATE_MASK OMAP4430_OCP_NRET_BANK_RETSTATE_MASK
72
73/* OMAP3 and OMAP4 Memory Status bits */
74#define OMAP_MEM0_STATEST_MASK OMAP3430_SHAREDL1CACHEFLATSTATEST_MASK
75#define OMAP_MEM1_STATEST_MASK OMAP3430_L1FLATMEMSTATEST_MASK
76#define OMAP_MEM2_STATEST_MASK OMAP3430_SHAREDL2CACHEFLATSTATEST_MASK
77#define OMAP_MEM3_STATEST_MASK OMAP3430_L2FLATMEMSTATEST_MASK
78#define OMAP_MEM4_STATEST_MASK OMAP4430_OCP_NRET_BANK_STATEST_MASK
79 40
80/* pwrdm_list contains all registered struct powerdomains */ 41/* pwrdm_list contains all registered struct powerdomains */
81static LIST_HEAD(pwrdm_list); 42static LIST_HEAD(pwrdm_list);
82 43
44static struct pwrdm_ops *arch_pwrdm;
45
83/* Private functions */ 46/* Private functions */
84 47
85static struct powerdomain *_pwrdm_lookup(const char *name) 48static struct powerdomain *_pwrdm_lookup(const char *name)
@@ -110,12 +73,19 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
110{ 73{
111 int i; 74 int i;
112 75
113 if (!pwrdm) 76 if (!pwrdm || !pwrdm->name)
114 return -EINVAL; 77 return -EINVAL;
115 78
116 if (!omap_chip_is(pwrdm->omap_chip)) 79 if (!omap_chip_is(pwrdm->omap_chip))
117 return -EINVAL; 80 return -EINVAL;
118 81
82 if (cpu_is_omap44xx() &&
83 pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) {
84 pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n",
85 pwrdm->name);
86 return -EINVAL;
87 }
88
119 if (_pwrdm_lookup(pwrdm->name)) 89 if (_pwrdm_lookup(pwrdm->name))
120 return -EEXIST; 90 return -EEXIST;
121 91
@@ -211,6 +181,7 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
211/** 181/**
212 * pwrdm_init - set up the powerdomain layer 182 * pwrdm_init - set up the powerdomain layer
213 * @pwrdm_list: array of struct powerdomain pointers to register 183 * @pwrdm_list: array of struct powerdomain pointers to register
184 * @custom_funcs: func pointers for arch specfic implementations
214 * 185 *
215 * Loop through the array of powerdomains @pwrdm_list, registering all 186 * Loop through the array of powerdomains @pwrdm_list, registering all
216 * that are available on the current CPU. If pwrdm_list is supplied 187 * that are available on the current CPU. If pwrdm_list is supplied
@@ -218,21 +189,14 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
218 * registered. No return value. XXX pwrdm_list is not really a 189 * registered. No return value. XXX pwrdm_list is not really a
219 * "list"; it is an array. Rename appropriately. 190 * "list"; it is an array. Rename appropriately.
220 */ 191 */
221void pwrdm_init(struct powerdomain **pwrdm_list) 192void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs)
222{ 193{
223 struct powerdomain **p = NULL; 194 struct powerdomain **p = NULL;
224 195
225 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 196 if (!custom_funcs)
226 pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL; 197 WARN(1, "powerdomain: No custom pwrdm functions registered\n");
227 pwrstst_reg_offs = OMAP2_PM_PWSTST; 198 else
228 } else if (cpu_is_omap44xx()) { 199 arch_pwrdm = custom_funcs;
229 pwrstctrl_reg_offs = OMAP4_PM_PWSTCTRL;
230 pwrstst_reg_offs = OMAP4_PM_PWSTST;
231 } else {
232 printk(KERN_ERR "Power Domain struct not supported for " \
233 "this CPU\n");
234 return;
235 }
236 200
237 if (pwrdm_list) { 201 if (pwrdm_list) {
238 for (p = pwrdm_list; *p; p++) 202 for (p = pwrdm_list; *p; p++)
@@ -431,6 +395,8 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm)
431 */ 395 */
432int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) 396int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
433{ 397{
398 int ret = -EINVAL;
399
434 if (!pwrdm) 400 if (!pwrdm)
435 return -EINVAL; 401 return -EINVAL;
436 402
@@ -440,11 +406,10 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
440 pr_debug("powerdomain: setting next powerstate for %s to %0x\n", 406 pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
441 pwrdm->name, pwrst); 407 pwrdm->name, pwrst);
442 408
443 prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, 409 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst)
444 (pwrst << OMAP_POWERSTATE_SHIFT), 410 ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
445 pwrdm->prcm_offs, pwrstctrl_reg_offs);
446 411
447 return 0; 412 return ret;
448} 413}
449 414
450/** 415/**
@@ -457,11 +422,15 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
457 */ 422 */
458int pwrdm_read_next_pwrst(struct powerdomain *pwrdm) 423int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
459{ 424{
425 int ret = -EINVAL;
426
460 if (!pwrdm) 427 if (!pwrdm)
461 return -EINVAL; 428 return -EINVAL;
462 429
463 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 430 if (arch_pwrdm && arch_pwrdm->pwrdm_read_next_pwrst)
464 pwrstctrl_reg_offs, OMAP_POWERSTATE_MASK); 431 ret = arch_pwrdm->pwrdm_read_next_pwrst(pwrdm);
432
433 return ret;
465} 434}
466 435
467/** 436/**
@@ -474,11 +443,15 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
474 */ 443 */
475int pwrdm_read_pwrst(struct powerdomain *pwrdm) 444int pwrdm_read_pwrst(struct powerdomain *pwrdm)
476{ 445{
446 int ret = -EINVAL;
447
477 if (!pwrdm) 448 if (!pwrdm)
478 return -EINVAL; 449 return -EINVAL;
479 450
480 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 451 if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst)
481 pwrstst_reg_offs, OMAP_POWERSTATEST_MASK); 452 ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm);
453
454 return ret;
482} 455}
483 456
484/** 457/**
@@ -491,11 +464,15 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
491 */ 464 */
492int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) 465int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
493{ 466{
467 int ret = -EINVAL;
468
494 if (!pwrdm) 469 if (!pwrdm)
495 return -EINVAL; 470 return -EINVAL;
496 471
497 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST, 472 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_pwrst)
498 OMAP3430_LASTPOWERSTATEENTERED_MASK); 473 ret = arch_pwrdm->pwrdm_read_prev_pwrst(pwrdm);
474
475 return ret;
499} 476}
500 477
501/** 478/**
@@ -511,7 +488,7 @@ int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
511 */ 488 */
512int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) 489int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
513{ 490{
514 u32 v; 491 int ret = -EINVAL;
515 492
516 if (!pwrdm) 493 if (!pwrdm)
517 return -EINVAL; 494 return -EINVAL;
@@ -522,17 +499,10 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
522 pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n", 499 pr_debug("powerdomain: setting next logic powerstate for %s to %0x\n",
523 pwrdm->name, pwrst); 500 pwrdm->name, pwrst);
524 501
525 /* 502 if (arch_pwrdm && arch_pwrdm->pwrdm_set_logic_retst)
526 * The register bit names below may not correspond to the 503 ret = arch_pwrdm->pwrdm_set_logic_retst(pwrdm, pwrst);
527 * actual names of the bits in each powerdomain's register,
528 * but the type of value returned is the same for each
529 * powerdomain.
530 */
531 v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
532 prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
533 pwrdm->prcm_offs, pwrstctrl_reg_offs);
534 504
535 return 0; 505 return ret;
536} 506}
537 507
538/** 508/**
@@ -552,7 +522,7 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
552 */ 522 */
553int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) 523int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
554{ 524{
555 u32 m; 525 int ret = -EINVAL;
556 526
557 if (!pwrdm) 527 if (!pwrdm)
558 return -EINVAL; 528 return -EINVAL;
@@ -566,37 +536,10 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
566 pr_debug("powerdomain: setting next memory powerstate for domain %s " 536 pr_debug("powerdomain: setting next memory powerstate for domain %s "
567 "bank %0x while pwrdm-ON to %0x\n", pwrdm->name, bank, pwrst); 537 "bank %0x while pwrdm-ON to %0x\n", pwrdm->name, bank, pwrst);
568 538
569 /* 539 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_onst)
570 * The register bit names below may not correspond to the 540 ret = arch_pwrdm->pwrdm_set_mem_onst(pwrdm, bank, pwrst);
571 * actual names of the bits in each powerdomain's register,
572 * but the type of value returned is the same for each
573 * powerdomain.
574 */
575 switch (bank) {
576 case 0:
577 m = OMAP_MEM0_ONSTATE_MASK;
578 break;
579 case 1:
580 m = OMAP_MEM1_ONSTATE_MASK;
581 break;
582 case 2:
583 m = OMAP_MEM2_ONSTATE_MASK;
584 break;
585 case 3:
586 m = OMAP_MEM3_ONSTATE_MASK;
587 break;
588 case 4:
589 m = OMAP_MEM4_ONSTATE_MASK;
590 break;
591 default:
592 WARN_ON(1); /* should never happen */
593 return -EEXIST;
594 }
595 541
596 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), 542 return ret;
597 pwrdm->prcm_offs, pwrstctrl_reg_offs);
598
599 return 0;
600} 543}
601 544
602/** 545/**
@@ -617,7 +560,7 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
617 */ 560 */
618int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) 561int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
619{ 562{
620 u32 m; 563 int ret = -EINVAL;
621 564
622 if (!pwrdm) 565 if (!pwrdm)
623 return -EINVAL; 566 return -EINVAL;
@@ -631,37 +574,10 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
631 pr_debug("powerdomain: setting next memory powerstate for domain %s " 574 pr_debug("powerdomain: setting next memory powerstate for domain %s "
632 "bank %0x while pwrdm-RET to %0x\n", pwrdm->name, bank, pwrst); 575 "bank %0x while pwrdm-RET to %0x\n", pwrdm->name, bank, pwrst);
633 576
634 /* 577 if (arch_pwrdm && arch_pwrdm->pwrdm_set_mem_retst)
635 * The register bit names below may not correspond to the 578 ret = arch_pwrdm->pwrdm_set_mem_retst(pwrdm, bank, pwrst);
636 * actual names of the bits in each powerdomain's register,
637 * but the type of value returned is the same for each
638 * powerdomain.
639 */
640 switch (bank) {
641 case 0:
642 m = OMAP_MEM0_RETSTATE_MASK;
643 break;
644 case 1:
645 m = OMAP_MEM1_RETSTATE_MASK;
646 break;
647 case 2:
648 m = OMAP_MEM2_RETSTATE_MASK;
649 break;
650 case 3:
651 m = OMAP_MEM3_RETSTATE_MASK;
652 break;
653 case 4:
654 m = OMAP_MEM4_RETSTATE_MASK;
655 break;
656 default:
657 WARN_ON(1); /* should never happen */
658 return -EEXIST;
659 }
660
661 prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
662 pwrstctrl_reg_offs);
663 579
664 return 0; 580 return ret;
665} 581}
666 582
667/** 583/**
@@ -675,11 +591,15 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst)
675 */ 591 */
676int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) 592int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
677{ 593{
594 int ret = -EINVAL;
595
678 if (!pwrdm) 596 if (!pwrdm)
679 return -EINVAL; 597 return -EINVAL;
680 598
681 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstst_reg_offs, 599 if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_pwrst)
682 OMAP3430_LOGICSTATEST_MASK); 600 ret = arch_pwrdm->pwrdm_read_logic_pwrst(pwrdm);
601
602 return ret;
683} 603}
684 604
685/** 605/**
@@ -692,17 +612,15 @@ int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
692 */ 612 */
693int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm) 613int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
694{ 614{
615 int ret = -EINVAL;
616
695 if (!pwrdm) 617 if (!pwrdm)
696 return -EINVAL; 618 return -EINVAL;
697 619
698 /* 620 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_logic_pwrst)
699 * The register bit names below may not correspond to the 621 ret = arch_pwrdm->pwrdm_read_prev_logic_pwrst(pwrdm);
700 * actual names of the bits in each powerdomain's register, 622
701 * but the type of value returned is the same for each 623 return ret;
702 * powerdomain.
703 */
704 return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST,
705 OMAP3430_LASTLOGICSTATEENTERED_MASK);
706} 624}
707 625
708/** 626/**
@@ -715,17 +633,15 @@ int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
715 */ 633 */
716int pwrdm_read_logic_retst(struct powerdomain *pwrdm) 634int pwrdm_read_logic_retst(struct powerdomain *pwrdm)
717{ 635{
636 int ret = -EINVAL;
637
718 if (!pwrdm) 638 if (!pwrdm)
719 return -EINVAL; 639 return -EINVAL;
720 640
721 /* 641 if (arch_pwrdm && arch_pwrdm->pwrdm_read_logic_retst)
722 * The register bit names below may not correspond to the 642 ret = arch_pwrdm->pwrdm_read_logic_retst(pwrdm);
723 * actual names of the bits in each powerdomain's register, 643
724 * but the type of value returned is the same for each 644 return ret;
725 * powerdomain.
726 */
727 return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstctrl_reg_offs,
728 OMAP3430_LOGICSTATEST_MASK);
729} 645}
730 646
731/** 647/**
@@ -740,46 +656,21 @@ int pwrdm_read_logic_retst(struct powerdomain *pwrdm)
740 */ 656 */
741int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank) 657int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
742{ 658{
743 u32 m; 659 int ret = -EINVAL;
744 660
745 if (!pwrdm) 661 if (!pwrdm)
746 return -EINVAL; 662 return ret;
747 663
748 if (pwrdm->banks < (bank + 1)) 664 if (pwrdm->banks < (bank + 1))
749 return -EEXIST; 665 return ret;
750 666
751 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK) 667 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
752 bank = 1; 668 bank = 1;
753 669
754 /* 670 if (arch_pwrdm && arch_pwrdm->pwrdm_read_mem_pwrst)
755 * The register bit names below may not correspond to the 671 ret = arch_pwrdm->pwrdm_read_mem_pwrst(pwrdm, bank);
756 * actual names of the bits in each powerdomain's register,
757 * but the type of value returned is the same for each
758 * powerdomain.
759 */
760 switch (bank) {
761 case 0:
762 m = OMAP_MEM0_STATEST_MASK;
763 break;
764 case 1:
765 m = OMAP_MEM1_STATEST_MASK;
766 break;
767 case 2:
768 m = OMAP_MEM2_STATEST_MASK;
769 break;
770 case 3:
771 m = OMAP_MEM3_STATEST_MASK;
772 break;
773 case 4:
774 m = OMAP_MEM4_STATEST_MASK;
775 break;
776 default:
777 WARN_ON(1); /* should never happen */
778 return -EEXIST;
779 }
780 672
781 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 673 return ret;
782 pwrstst_reg_offs, m);
783} 674}
784 675
785/** 676/**
@@ -795,43 +686,21 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
795 */ 686 */
796int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank) 687int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
797{ 688{
798 u32 m; 689 int ret = -EINVAL;
799 690
800 if (!pwrdm) 691 if (!pwrdm)
801 return -EINVAL; 692 return ret;
802 693
803 if (pwrdm->banks < (bank + 1)) 694 if (pwrdm->banks < (bank + 1))
804 return -EEXIST; 695 return ret;
805 696
806 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK) 697 if (pwrdm->flags & PWRDM_HAS_MPU_QUIRK)
807 bank = 1; 698 bank = 1;
808 699
809 /* 700 if (arch_pwrdm && arch_pwrdm->pwrdm_read_prev_mem_pwrst)
810 * The register bit names below may not correspond to the 701 ret = arch_pwrdm->pwrdm_read_prev_mem_pwrst(pwrdm, bank);
811 * actual names of the bits in each powerdomain's register,
812 * but the type of value returned is the same for each
813 * powerdomain.
814 */
815 switch (bank) {
816 case 0:
817 m = OMAP3430_LASTMEM1STATEENTERED_MASK;
818 break;
819 case 1:
820 m = OMAP3430_LASTMEM2STATEENTERED_MASK;
821 break;
822 case 2:
823 m = OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK;
824 break;
825 case 3:
826 m = OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK;
827 break;
828 default:
829 WARN_ON(1); /* should never happen */
830 return -EEXIST;
831 }
832 702
833 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 703 return ret;
834 OMAP3430_PM_PREPWSTST, m);
835} 704}
836 705
837/** 706/**
@@ -846,43 +715,18 @@ int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
846 */ 715 */
847int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank) 716int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
848{ 717{
849 u32 m; 718 int ret = -EINVAL;
850 719
851 if (!pwrdm) 720 if (!pwrdm)
852 return -EINVAL; 721 return ret;
853 722
854 if (pwrdm->banks < (bank + 1)) 723 if (pwrdm->banks < (bank + 1))
855 return -EEXIST; 724 return ret;
856 725
857 /* 726 if (arch_pwrdm && arch_pwrdm->pwrdm_read_mem_retst)
858 * The register bit names below may not correspond to the 727 ret = arch_pwrdm->pwrdm_read_mem_retst(pwrdm, bank);
859 * actual names of the bits in each powerdomain's register,
860 * but the type of value returned is the same for each
861 * powerdomain.
862 */
863 switch (bank) {
864 case 0:
865 m = OMAP_MEM0_RETSTATE_MASK;
866 break;
867 case 1:
868 m = OMAP_MEM1_RETSTATE_MASK;
869 break;
870 case 2:
871 m = OMAP_MEM2_RETSTATE_MASK;
872 break;
873 case 3:
874 m = OMAP_MEM3_RETSTATE_MASK;
875 break;
876 case 4:
877 m = OMAP_MEM4_RETSTATE_MASK;
878 break;
879 default:
880 WARN_ON(1); /* should never happen */
881 return -EEXIST;
882 }
883 728
884 return prm_read_mod_bits_shift(pwrdm->prcm_offs, 729 return ret;
885 pwrstctrl_reg_offs, m);
886} 730}
887 731
888/** 732/**
@@ -896,8 +740,10 @@ int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
896 */ 740 */
897int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm) 741int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
898{ 742{
743 int ret = -EINVAL;
744
899 if (!pwrdm) 745 if (!pwrdm)
900 return -EINVAL; 746 return ret;
901 747
902 /* 748 /*
903 * XXX should get the powerdomain's current state here; 749 * XXX should get the powerdomain's current state here;
@@ -907,9 +753,10 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
907 pr_debug("powerdomain: clearing previous power state reg for %s\n", 753 pr_debug("powerdomain: clearing previous power state reg for %s\n",
908 pwrdm->name); 754 pwrdm->name);
909 755
910 prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST); 756 if (arch_pwrdm && arch_pwrdm->pwrdm_clear_all_prev_pwrst)
757 ret = arch_pwrdm->pwrdm_clear_all_prev_pwrst(pwrdm);
911 758
912 return 0; 759 return ret;
913} 760}
914 761
915/** 762/**
@@ -925,19 +772,21 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
925 */ 772 */
926int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) 773int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
927{ 774{
775 int ret = -EINVAL;
776
928 if (!pwrdm) 777 if (!pwrdm)
929 return -EINVAL; 778 return ret;
930 779
931 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) 780 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR))
932 return -EINVAL; 781 return ret;
933 782
934 pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n", 783 pr_debug("powerdomain: %s: setting SAVEANDRESTORE bit\n",
935 pwrdm->name); 784 pwrdm->name);
936 785
937 prm_rmw_mod_reg_bits(0, 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 786 if (arch_pwrdm && arch_pwrdm->pwrdm_enable_hdwr_sar)
938 pwrdm->prcm_offs, pwrstctrl_reg_offs); 787 ret = arch_pwrdm->pwrdm_enable_hdwr_sar(pwrdm);
939 788
940 return 0; 789 return ret;
941} 790}
942 791
943/** 792/**
@@ -953,19 +802,21 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
953 */ 802 */
954int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) 803int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
955{ 804{
805 int ret = -EINVAL;
806
956 if (!pwrdm) 807 if (!pwrdm)
957 return -EINVAL; 808 return ret;
958 809
959 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR)) 810 if (!(pwrdm->flags & PWRDM_HAS_HDWR_SAR))
960 return -EINVAL; 811 return ret;
961 812
962 pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n", 813 pr_debug("powerdomain: %s: clearing SAVEANDRESTORE bit\n",
963 pwrdm->name); 814 pwrdm->name);
964 815
965 prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 0, 816 if (arch_pwrdm && arch_pwrdm->pwrdm_disable_hdwr_sar)
966 pwrdm->prcm_offs, pwrstctrl_reg_offs); 817 ret = arch_pwrdm->pwrdm_disable_hdwr_sar(pwrdm);
967 818
968 return 0; 819 return ret;
969} 820}
970 821
971/** 822/**
@@ -992,6 +843,8 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm)
992 */ 843 */
993int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm) 844int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
994{ 845{
846 int ret = -EINVAL;
847
995 if (!pwrdm) 848 if (!pwrdm)
996 return -EINVAL; 849 return -EINVAL;
997 850
@@ -1001,11 +854,10 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
1001 pr_debug("powerdomain: %s: setting LOWPOWERSTATECHANGE bit\n", 854 pr_debug("powerdomain: %s: setting LOWPOWERSTATECHANGE bit\n",
1002 pwrdm->name); 855 pwrdm->name);
1003 856
1004 prm_rmw_mod_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK, 857 if (arch_pwrdm && arch_pwrdm->pwrdm_set_lowpwrstchange)
1005 (1 << OMAP4430_LOWPOWERSTATECHANGE_SHIFT), 858 ret = arch_pwrdm->pwrdm_set_lowpwrstchange(pwrdm);
1006 pwrdm->prcm_offs, pwrstctrl_reg_offs);
1007 859
1008 return 0; 860 return ret;
1009} 861}
1010 862
1011/** 863/**
@@ -1020,32 +872,15 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
1020 */ 872 */
1021int pwrdm_wait_transition(struct powerdomain *pwrdm) 873int pwrdm_wait_transition(struct powerdomain *pwrdm)
1022{ 874{
1023 u32 c = 0; 875 int ret = -EINVAL;
1024 876
1025 if (!pwrdm) 877 if (!pwrdm)
1026 return -EINVAL; 878 return -EINVAL;
1027 879
1028 /* 880 if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition)
1029 * REVISIT: pwrdm_wait_transition() may be better implemented 881 ret = arch_pwrdm->pwrdm_wait_transition(pwrdm);
1030 * via a callback and a periodic timer check -- how long do we expect
1031 * powerdomain transitions to take?
1032 */
1033
1034 /* XXX Is this udelay() value meaningful? */
1035 while ((prm_read_mod_reg(pwrdm->prcm_offs, pwrstst_reg_offs) &
1036 OMAP_INTRANSITION_MASK) &&
1037 (c++ < PWRDM_TRANSITION_BAILOUT))
1038 udelay(1);
1039
1040 if (c > PWRDM_TRANSITION_BAILOUT) {
1041 printk(KERN_ERR "powerdomain: waited too long for "
1042 "powerdomain %s to complete transition\n", pwrdm->name);
1043 return -EAGAIN;
1044 }
1045
1046 pr_debug("powerdomain: completed transition in %d loops\n", c);
1047 882
1048 return 0; 883 return ret;
1049} 884}
1050 885
1051int pwrdm_state_switch(struct powerdomain *pwrdm) 886int pwrdm_state_switch(struct powerdomain *pwrdm)
@@ -1075,3 +910,31 @@ int pwrdm_post_transition(void)
1075 return 0; 910 return 0;
1076} 911}
1077 912
913/**
914 * pwrdm_get_context_loss_count - get powerdomain's context loss count
915 * @pwrdm: struct powerdomain * to wait for
916 *
917 * Context loss count is the sum of powerdomain off-mode counter, the
918 * logic off counter and the per-bank memory off counter. Returns 0
919 * (and WARNs) upon error, otherwise, returns the context loss count.
920 */
921u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
922{
923 int i, count;
924
925 if (!pwrdm) {
926 WARN(1, "powerdomain: %s: pwrdm is null\n", __func__);
927 return 0;
928 }
929
930 count = pwrdm->state_counter[PWRDM_POWER_OFF];
931 count += pwrdm->ret_logic_off_counter;
932
933 for (i = 0; i < pwrdm->banks; i++)
934 count += pwrdm->ret_mem_off_counter[i];
935
936 pr_debug("powerdomain: %s: context loss count = %u\n",
937 pwrdm->name, count);
938
939 return count;
940}
diff --git a/arch/arm/plat-omap/include/plat/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index 9ca420dcd2f8..c66431edfeb7 100644
--- a/arch/arm/plat-omap/include/plat/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -1,27 +1,29 @@
1/* 1/*
2 * OMAP2/3 powerdomain control 2 * OMAP2/3/4 powerdomain control
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12 *
13 * XXX This should be moved to the mach-omap2/ directory at the earliest
14 * opportunity.
12 */ 15 */
13 16
14#ifndef ASM_ARM_ARCH_OMAP_POWERDOMAIN 17#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H
15#define ASM_ARM_ARCH_OMAP_POWERDOMAIN 18#define __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H
16 19
17#include <linux/types.h> 20#include <linux/types.h>
18#include <linux/list.h> 21#include <linux/list.h>
19 22
20#include <asm/atomic.h> 23#include <linux/atomic.h>
21 24
22#include <plat/cpu.h> 25#include <plat/cpu.h>
23 26
24
25/* Powerdomain basic power states */ 27/* Powerdomain basic power states */
26#define PWRDM_POWER_OFF 0x0 28#define PWRDM_POWER_OFF 0x0
27#define PWRDM_POWER_RET 0x1 29#define PWRDM_POWER_RET 0x1
@@ -81,6 +83,7 @@ struct powerdomain;
81 * @name: Powerdomain name 83 * @name: Powerdomain name
82 * @omap_chip: represents the OMAP chip types containing this pwrdm 84 * @omap_chip: represents the OMAP chip types containing this pwrdm
83 * @prcm_offs: the address offset from CM_BASE/PRM_BASE 85 * @prcm_offs: the address offset from CM_BASE/PRM_BASE
86 * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs
84 * @pwrsts: Possible powerdomain power states 87 * @pwrsts: Possible powerdomain power states
85 * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION 88 * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION
86 * @flags: Powerdomain flags 89 * @flags: Powerdomain flags
@@ -93,6 +96,8 @@ struct powerdomain;
93 * @state_counter: 96 * @state_counter:
94 * @timer: 97 * @timer:
95 * @state_timer: 98 * @state_timer:
99 *
100 * @prcm_partition possible values are defined in mach-omap2/prcm44xx.h.
96 */ 101 */
97struct powerdomain { 102struct powerdomain {
98 const char *name; 103 const char *name;
@@ -104,6 +109,7 @@ struct powerdomain {
104 const u8 banks; 109 const u8 banks;
105 const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS]; 110 const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS];
106 const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS]; 111 const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS];
112 const u8 prcm_partition;
107 struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; 113 struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS];
108 struct list_head node; 114 struct list_head node;
109 int state; 115 int state;
@@ -117,8 +123,50 @@ struct powerdomain {
117#endif 123#endif
118}; 124};
119 125
126/**
127 * struct pwrdm_ops - Arch specfic function implementations
128 * @pwrdm_set_next_pwrst: Set the target power state for a pd
129 * @pwrdm_read_next_pwrst: Read the target power state set for a pd
130 * @pwrdm_read_pwrst: Read the current power state of a pd
131 * @pwrdm_read_prev_pwrst: Read the prev power state entered by the pd
132 * @pwrdm_set_logic_retst: Set the logic state in RET for a pd
133 * @pwrdm_set_mem_onst: Set the Memory state in ON for a pd
134 * @pwrdm_set_mem_retst: Set the Memory state in RET for a pd
135 * @pwrdm_read_logic_pwrst: Read the current logic state of a pd
136 * @pwrdm_read_prev_logic_pwrst: Read the previous logic state entered by a pd
137 * @pwrdm_read_logic_retst: Read the logic state in RET for a pd
138 * @pwrdm_read_mem_pwrst: Read the current memory state of a pd
139 * @pwrdm_read_prev_mem_pwrst: Read the previous memory state entered by a pd
140 * @pwrdm_read_mem_retst: Read the memory state in RET for a pd
141 * @pwrdm_clear_all_prev_pwrst: Clear all previous power states logged for a pd
142 * @pwrdm_enable_hdwr_sar: Enable Hardware Save-Restore feature for the pd
143 * @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd
144 * @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep
145 * @pwrdm_wait_transition: Wait for a pd state transition to complete
146 */
147struct pwrdm_ops {
148 int (*pwrdm_set_next_pwrst)(struct powerdomain *pwrdm, u8 pwrst);
149 int (*pwrdm_read_next_pwrst)(struct powerdomain *pwrdm);
150 int (*pwrdm_read_pwrst)(struct powerdomain *pwrdm);
151 int (*pwrdm_read_prev_pwrst)(struct powerdomain *pwrdm);
152 int (*pwrdm_set_logic_retst)(struct powerdomain *pwrdm, u8 pwrst);
153 int (*pwrdm_set_mem_onst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst);
154 int (*pwrdm_set_mem_retst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst);
155 int (*pwrdm_read_logic_pwrst)(struct powerdomain *pwrdm);
156 int (*pwrdm_read_prev_logic_pwrst)(struct powerdomain *pwrdm);
157 int (*pwrdm_read_logic_retst)(struct powerdomain *pwrdm);
158 int (*pwrdm_read_mem_pwrst)(struct powerdomain *pwrdm, u8 bank);
159 int (*pwrdm_read_prev_mem_pwrst)(struct powerdomain *pwrdm, u8 bank);
160 int (*pwrdm_read_mem_retst)(struct powerdomain *pwrdm, u8 bank);
161 int (*pwrdm_clear_all_prev_pwrst)(struct powerdomain *pwrdm);
162 int (*pwrdm_enable_hdwr_sar)(struct powerdomain *pwrdm);
163 int (*pwrdm_disable_hdwr_sar)(struct powerdomain *pwrdm);
164 int (*pwrdm_set_lowpwrstchange)(struct powerdomain *pwrdm);
165 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm);
166};
120 167
121void pwrdm_init(struct powerdomain **pwrdm_list); 168void pwrdm_fw_init(void);
169void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs);
122 170
123struct powerdomain *pwrdm_lookup(const char *name); 171struct powerdomain *pwrdm_lookup(const char *name);
124 172
@@ -163,5 +211,23 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm);
163int pwrdm_pre_transition(void); 211int pwrdm_pre_transition(void);
164int pwrdm_post_transition(void); 212int pwrdm_post_transition(void);
165int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); 213int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
214u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
215
216extern void omap2xxx_powerdomains_init(void);
217extern void omap3xxx_powerdomains_init(void);
218extern void omap44xx_powerdomains_init(void);
219
220extern struct pwrdm_ops omap2_pwrdm_operations;
221extern struct pwrdm_ops omap3_pwrdm_operations;
222extern struct pwrdm_ops omap4_pwrdm_operations;
223
224/* Common Internal functions used across OMAP rev's */
225extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank);
226extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank);
227extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank);
228
229extern struct powerdomain wkup_omap2_pwrdm;
230extern struct powerdomain gfx_omap2_pwrdm;
231
166 232
167#endif 233#endif
diff --git a/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
new file mode 100644
index 000000000000..d5233890370c
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
@@ -0,0 +1,242 @@
1/*
2 * OMAP2 and OMAP3 powerdomain control
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation
6 *
7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/io.h>
16#include <linux/errno.h>
17#include <linux/delay.h>
18
19#include <plat/prcm.h>
20
21#include "powerdomain.h"
22#include "prm-regbits-34xx.h"
23#include "prm.h"
24#include "prm-regbits-24xx.h"
25#include "prm-regbits-34xx.h"
26
27
28/* Common functions across OMAP2 and OMAP3 */
29static int omap2_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
30{
31 omap2_prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK,
32 (pwrst << OMAP_POWERSTATE_SHIFT),
33 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
34 return 0;
35}
36
37static int omap2_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
38{
39 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
40 OMAP2_PM_PWSTCTRL,
41 OMAP_POWERSTATE_MASK);
42}
43
44static int omap2_pwrdm_read_pwrst(struct powerdomain *pwrdm)
45{
46 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
47 OMAP2_PM_PWSTST,
48 OMAP_POWERSTATEST_MASK);
49}
50
51static int omap2_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
52 u8 pwrst)
53{
54 u32 m;
55
56 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
57
58 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
59 OMAP2_PM_PWSTCTRL);
60
61 return 0;
62}
63
64static int omap2_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
65 u8 pwrst)
66{
67 u32 m;
68
69 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
70
71 omap2_prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs,
72 OMAP2_PM_PWSTCTRL);
73
74 return 0;
75}
76
77static int omap2_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
78{
79 u32 m;
80
81 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
82
83 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP2_PM_PWSTST,
84 m);
85}
86
87static int omap2_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
88{
89 u32 m;
90
91 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
92
93 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
94 OMAP2_PM_PWSTCTRL, m);
95}
96
97static int omap2_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
98{
99 u32 v;
100
101 v = pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE_MASK);
102 omap2_prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE_MASK, v,
103 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
104
105 return 0;
106}
107
108static int omap2_pwrdm_wait_transition(struct powerdomain *pwrdm)
109{
110 u32 c = 0;
111
112 /*
113 * REVISIT: pwrdm_wait_transition() may be better implemented
114 * via a callback and a periodic timer check -- how long do we expect
115 * powerdomain transitions to take?
116 */
117
118 /* XXX Is this udelay() value meaningful? */
119 while ((omap2_prm_read_mod_reg(pwrdm->prcm_offs, OMAP2_PM_PWSTST) &
120 OMAP_INTRANSITION_MASK) &&
121 (c++ < PWRDM_TRANSITION_BAILOUT))
122 udelay(1);
123
124 if (c > PWRDM_TRANSITION_BAILOUT) {
125 printk(KERN_ERR "powerdomain: waited too long for "
126 "powerdomain %s to complete transition\n", pwrdm->name);
127 return -EAGAIN;
128 }
129
130 pr_debug("powerdomain: completed transition in %d loops\n", c);
131
132 return 0;
133}
134
135/* Applicable only for OMAP3. Not supported on OMAP2 */
136static int omap3_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
137{
138 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
139 OMAP3430_PM_PREPWSTST,
140 OMAP3430_LASTPOWERSTATEENTERED_MASK);
141}
142
143static int omap3_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
144{
145 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
146 OMAP2_PM_PWSTST,
147 OMAP3430_LOGICSTATEST_MASK);
148}
149
150static int omap3_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
151{
152 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
153 OMAP2_PM_PWSTCTRL,
154 OMAP3430_LOGICSTATEST_MASK);
155}
156
157static int omap3_pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm)
158{
159 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
160 OMAP3430_PM_PREPWSTST,
161 OMAP3430_LASTLOGICSTATEENTERED_MASK);
162}
163
164static int omap3_get_mem_bank_lastmemst_mask(u8 bank)
165{
166 switch (bank) {
167 case 0:
168 return OMAP3430_LASTMEM1STATEENTERED_MASK;
169 case 1:
170 return OMAP3430_LASTMEM2STATEENTERED_MASK;
171 case 2:
172 return OMAP3430_LASTSHAREDL2CACHEFLATSTATEENTERED_MASK;
173 case 3:
174 return OMAP3430_LASTL2FLATMEMSTATEENTERED_MASK;
175 default:
176 WARN_ON(1); /* should never happen */
177 return -EEXIST;
178 }
179 return 0;
180}
181
182static int omap3_pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
183{
184 u32 m;
185
186 m = omap3_get_mem_bank_lastmemst_mask(bank);
187
188 return omap2_prm_read_mod_bits_shift(pwrdm->prcm_offs,
189 OMAP3430_PM_PREPWSTST, m);
190}
191
192static int omap3_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
193{
194 omap2_prm_write_mod_reg(0, pwrdm->prcm_offs, OMAP3430_PM_PREPWSTST);
195 return 0;
196}
197
198static int omap3_pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm)
199{
200 return omap2_prm_rmw_mod_reg_bits(0,
201 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
202 pwrdm->prcm_offs, OMAP2_PM_PWSTCTRL);
203}
204
205static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm)
206{
207 return omap2_prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT,
208 0, pwrdm->prcm_offs,
209 OMAP2_PM_PWSTCTRL);
210}
211
212struct pwrdm_ops omap2_pwrdm_operations = {
213 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
214 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
215 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
216 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
217 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
218 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
219 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
220 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
221 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
222};
223
224struct pwrdm_ops omap3_pwrdm_operations = {
225 .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst,
226 .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst,
227 .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst,
228 .pwrdm_read_prev_pwrst = omap3_pwrdm_read_prev_pwrst,
229 .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst,
230 .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst,
231 .pwrdm_read_logic_retst = omap3_pwrdm_read_logic_retst,
232 .pwrdm_read_prev_logic_pwrst = omap3_pwrdm_read_prev_logic_pwrst,
233 .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst,
234 .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
235 .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst,
236 .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst,
237 .pwrdm_read_prev_mem_pwrst = omap3_pwrdm_read_prev_mem_pwrst,
238 .pwrdm_clear_all_prev_pwrst = omap3_pwrdm_clear_all_prev_pwrst,
239 .pwrdm_enable_hdwr_sar = omap3_pwrdm_enable_hdwr_sar,
240 .pwrdm_disable_hdwr_sar = omap3_pwrdm_disable_hdwr_sar,
241 .pwrdm_wait_transition = omap2_pwrdm_wait_transition,
242};
diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c
new file mode 100644
index 000000000000..a7880af4b3d9
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomain44xx.c
@@ -0,0 +1,225 @@
1/*
2 * OMAP4 powerdomain control
3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation
6 *
7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/io.h>
16#include <linux/errno.h>
17#include <linux/delay.h>
18
19#include "powerdomain.h"
20#include <plat/prcm.h>
21#include "prm2xxx_3xxx.h"
22#include "prm44xx.h"
23#include "prminst44xx.h"
24#include "prm-regbits-44xx.h"
25
26static int omap4_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
27{
28 omap4_prminst_rmw_inst_reg_bits(OMAP_POWERSTATE_MASK,
29 (pwrst << OMAP_POWERSTATE_SHIFT),
30 pwrdm->prcm_partition,
31 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
32 return 0;
33}
34
35static int omap4_pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
36{
37 u32 v;
38
39 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
40 OMAP4_PM_PWSTCTRL);
41 v &= OMAP_POWERSTATE_MASK;
42 v >>= OMAP_POWERSTATE_SHIFT;
43
44 return v;
45}
46
47static int omap4_pwrdm_read_pwrst(struct powerdomain *pwrdm)
48{
49 u32 v;
50
51 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
52 OMAP4_PM_PWSTST);
53 v &= OMAP_POWERSTATEST_MASK;
54 v >>= OMAP_POWERSTATEST_SHIFT;
55
56 return v;
57}
58
59static int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
60{
61 u32 v;
62
63 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
64 OMAP4_PM_PWSTST);
65 v &= OMAP4430_LASTPOWERSTATEENTERED_MASK;
66 v >>= OMAP4430_LASTPOWERSTATEENTERED_SHIFT;
67
68 return v;
69}
70
71static int omap4_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
72{
73 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOWPOWERSTATECHANGE_MASK,
74 (1 << OMAP4430_LOWPOWERSTATECHANGE_SHIFT),
75 pwrdm->prcm_partition,
76 pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL);
77 return 0;
78}
79
80static int omap4_pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm)
81{
82 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LASTPOWERSTATEENTERED_MASK,
83 OMAP4430_LASTPOWERSTATEENTERED_MASK,
84 pwrdm->prcm_partition,
85 pwrdm->prcm_offs, OMAP4_PM_PWSTST);
86 return 0;
87}
88
89static int omap4_pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst)
90{
91 u32 v;
92
93 v = pwrst << __ffs(OMAP4430_LOGICRETSTATE_MASK);
94 omap4_prminst_rmw_inst_reg_bits(OMAP4430_LOGICRETSTATE_MASK, v,
95 pwrdm->prcm_partition, pwrdm->prcm_offs,
96 OMAP4_PM_PWSTCTRL);
97
98 return 0;
99}
100
101static int omap4_pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank,
102 u8 pwrst)
103{
104 u32 m;
105
106 m = omap2_pwrdm_get_mem_bank_onstate_mask(bank);
107
108 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
109 pwrdm->prcm_partition, pwrdm->prcm_offs,
110 OMAP4_PM_PWSTCTRL);
111
112 return 0;
113}
114
115static int omap4_pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank,
116 u8 pwrst)
117{
118 u32 m;
119
120 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
121
122 omap4_prminst_rmw_inst_reg_bits(m, (pwrst << __ffs(m)),
123 pwrdm->prcm_partition, pwrdm->prcm_offs,
124 OMAP4_PM_PWSTCTRL);
125
126 return 0;
127}
128
129static int omap4_pwrdm_read_logic_pwrst(struct powerdomain *pwrdm)
130{
131 u32 v;
132
133 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
134 OMAP4_PM_PWSTST);
135 v &= OMAP4430_LOGICSTATEST_MASK;
136 v >>= OMAP4430_LOGICSTATEST_SHIFT;
137
138 return v;
139}
140
141static int omap4_pwrdm_read_logic_retst(struct powerdomain *pwrdm)
142{
143 u32 v;
144
145 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
146 OMAP4_PM_PWSTCTRL);
147 v &= OMAP4430_LOGICRETSTATE_MASK;
148 v >>= OMAP4430_LOGICRETSTATE_SHIFT;
149
150 return v;
151}
152
153static int omap4_pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank)
154{
155 u32 m, v;
156
157 m = omap2_pwrdm_get_mem_bank_stst_mask(bank);
158
159 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
160 OMAP4_PM_PWSTST);
161 v &= m;
162 v >>= __ffs(m);
163
164 return v;
165}
166
167static int omap4_pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank)
168{
169 u32 m, v;
170
171 m = omap2_pwrdm_get_mem_bank_retst_mask(bank);
172
173 v = omap4_prminst_read_inst_reg(pwrdm->prcm_partition, pwrdm->prcm_offs,
174 OMAP4_PM_PWSTCTRL);
175 v &= m;
176 v >>= __ffs(m);
177
178 return v;
179}
180
181static int omap4_pwrdm_wait_transition(struct powerdomain *pwrdm)
182{
183 u32 c = 0;
184
185 /*
186 * REVISIT: pwrdm_wait_transition() may be better implemented
187 * via a callback and a periodic timer check -- how long do we expect
188 * powerdomain transitions to take?
189 */
190
191 /* XXX Is this udelay() value meaningful? */
192 while ((omap4_prminst_read_inst_reg(pwrdm->prcm_partition,
193 pwrdm->prcm_offs,
194 OMAP4_PM_PWSTST) &
195 OMAP_INTRANSITION_MASK) &&
196 (c++ < PWRDM_TRANSITION_BAILOUT))
197 udelay(1);
198
199 if (c > PWRDM_TRANSITION_BAILOUT) {
200 printk(KERN_ERR "powerdomain: waited too long for "
201 "powerdomain %s to complete transition\n", pwrdm->name);
202 return -EAGAIN;
203 }
204
205 pr_debug("powerdomain: completed transition in %d loops\n", c);
206
207 return 0;
208}
209
210struct pwrdm_ops omap4_pwrdm_operations = {
211 .pwrdm_set_next_pwrst = omap4_pwrdm_set_next_pwrst,
212 .pwrdm_read_next_pwrst = omap4_pwrdm_read_next_pwrst,
213 .pwrdm_read_pwrst = omap4_pwrdm_read_pwrst,
214 .pwrdm_read_prev_pwrst = omap4_pwrdm_read_prev_pwrst,
215 .pwrdm_set_lowpwrstchange = omap4_pwrdm_set_lowpwrstchange,
216 .pwrdm_clear_all_prev_pwrst = omap4_pwrdm_clear_all_prev_pwrst,
217 .pwrdm_set_logic_retst = omap4_pwrdm_set_logic_retst,
218 .pwrdm_read_logic_pwrst = omap4_pwrdm_read_logic_pwrst,
219 .pwrdm_read_logic_retst = omap4_pwrdm_read_logic_retst,
220 .pwrdm_read_mem_pwrst = omap4_pwrdm_read_mem_pwrst,
221 .pwrdm_read_mem_retst = omap4_pwrdm_read_mem_retst,
222 .pwrdm_set_mem_onst = omap4_pwrdm_set_mem_onst,
223 .pwrdm_set_mem_retst = omap4_pwrdm_set_mem_retst,
224 .pwrdm_wait_transition = omap4_pwrdm_wait_transition,
225};
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
index 105cbcaefd3b..5b4dd971320a 100644
--- a/arch/arm/mach-omap2/powerdomains.h
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
@@ -2,10 +2,9 @@
2 * OMAP2/3 common powerdomain definitions 2 * OMAP2/3 common powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley, Jouni Högander
8 * Debugging and integration fixes by Jouni Högander
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
@@ -18,9 +17,6 @@
18 * Clock Domain Framework 17 * Clock Domain Framework
19 */ 18 */
20 19
21#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS
22#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS
23
24/* 20/*
25 * This file contains all of the powerdomains that have some element 21 * This file contains all of the powerdomains that have some element
26 * of software control for the OMAP24xx and OMAP34xx chips. 22 * of software control for the OMAP24xx and OMAP34xx chips.
@@ -49,24 +45,18 @@
49 * address offset is different between the C55 and C64 DSPs. 45 * address offset is different between the C55 and C64 DSPs.
50 */ 46 */
51 47
52#include <plat/powerdomain.h> 48#include "powerdomain.h"
53 49
54#include "prcm-common.h" 50#include "prcm-common.h"
55#include "prm.h" 51#include "prm.h"
56#include "cm.h"
57#include "powerdomains24xx.h"
58#include "powerdomains34xx.h"
59#include "powerdomains44xx.h"
60 52
61/* OMAP2/3-common powerdomains */ 53/* OMAP2/3-common powerdomains */
62 54
63#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
64
65/* 55/*
66 * The GFX powerdomain is not present on 3430ES2, but currently we do not 56 * The GFX powerdomain is not present on 3430ES2, but currently we do not
67 * have a macro to filter it out at compile-time. 57 * have a macro to filter it out at compile-time.
68 */ 58 */
69static struct powerdomain gfx_omap2_pwrdm = { 59struct powerdomain gfx_omap2_pwrdm = {
70 .name = "gfx_pwrdm", 60 .name = "gfx_pwrdm",
71 .prcm_offs = GFX_MOD, 61 .prcm_offs = GFX_MOD,
72 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | 62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
@@ -82,72 +72,8 @@ static struct powerdomain gfx_omap2_pwrdm = {
82 }, 72 },
83}; 73};
84 74
85static struct powerdomain wkup_omap2_pwrdm = { 75struct powerdomain wkup_omap2_pwrdm = {
86 .name = "wkup_pwrdm", 76 .name = "wkup_pwrdm",
87 .prcm_offs = WKUP_MOD, 77 .prcm_offs = WKUP_MOD,
88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
89}; 79};
90
91#endif
92
93
94/* As powerdomains are added or removed above, this list must also be changed */
95static struct powerdomain *powerdomains_omap[] __initdata = {
96
97#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
98 &wkup_omap2_pwrdm,
99 &gfx_omap2_pwrdm,
100#endif
101
102#ifdef CONFIG_ARCH_OMAP2
103 &dsp_pwrdm,
104 &mpu_24xx_pwrdm,
105 &core_24xx_pwrdm,
106#endif
107
108#ifdef CONFIG_ARCH_OMAP2430
109 &mdm_pwrdm,
110#endif
111
112#ifdef CONFIG_ARCH_OMAP3
113 &iva2_pwrdm,
114 &mpu_3xxx_pwrdm,
115 &neon_pwrdm,
116 &core_3xxx_pre_es3_1_pwrdm,
117 &core_3xxx_es3_1_pwrdm,
118 &cam_pwrdm,
119 &dss_pwrdm,
120 &per_pwrdm,
121 &emu_pwrdm,
122 &sgx_pwrdm,
123 &usbhost_pwrdm,
124 &dpll1_pwrdm,
125 &dpll2_pwrdm,
126 &dpll3_pwrdm,
127 &dpll4_pwrdm,
128 &dpll5_pwrdm,
129#endif
130
131#ifdef CONFIG_ARCH_OMAP4
132 &core_44xx_pwrdm,
133 &gfx_44xx_pwrdm,
134 &abe_44xx_pwrdm,
135 &dss_44xx_pwrdm,
136 &tesla_44xx_pwrdm,
137 &wkup_44xx_pwrdm,
138 &cpu0_44xx_pwrdm,
139 &cpu1_44xx_pwrdm,
140 &emu_44xx_pwrdm,
141 &mpu_44xx_pwrdm,
142 &ivahd_44xx_pwrdm,
143 &cam_44xx_pwrdm,
144 &l3init_44xx_pwrdm,
145 &l4per_44xx_pwrdm,
146 &always_on_core_44xx_pwrdm,
147 &cefuse_44xx_pwrdm,
148#endif
149 NULL
150};
151
152
153#endif
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h
new file mode 100644
index 000000000000..fa311669d53d
--- /dev/null
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.h
@@ -0,0 +1,22 @@
1/*
2 * OMAP2/3 common powerdomains - prototypes
3 *
4 * Copyright (C) 2008 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Paul Walmsley
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAINS2XXX_3XXX_DATA_H
15#define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS2XXX_3XXX_DATA_H
16
17#include "powerdomain.h"
18
19extern struct powerdomain gfx_omap2_pwrdm;
20extern struct powerdomain wkup_omap2_pwrdm;
21
22#endif
diff --git a/arch/arm/mach-omap2/powerdomains24xx.h b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index 775093add9b6..9b1a33500577 100644
--- a/arch/arm/mach-omap2/powerdomains24xx.h
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -1,37 +1,28 @@
1/* 1/*
2 * OMAP24XX powerdomain definitions 2 * OMAP2XXX powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2009 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley, Jouni Högander
8 * Debugging and integration fixes by Jouni Högander
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
13 */ 12 */
14 13
15#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS24XX 14#include <linux/kernel.h>
16#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS24XX 15#include <linux/init.h>
17 16
18/* 17#include "powerdomain.h"
19 * N.B. If powerdomains are added or removed from this file, update 18#include "powerdomains2xxx_3xxx_data.h"
20 * the array in mach-omap2/powerdomains.h.
21 */
22
23#include <plat/powerdomain.h>
24 19
25#include "prcm-common.h" 20#include "prcm-common.h"
26#include "prm.h" 21#include "prm2xxx_3xxx.h"
27#include "prm-regbits-24xx.h" 22#include "prm-regbits-24xx.h"
28#include "cm.h"
29#include "cm-regbits-24xx.h"
30 23
31/* 24XX powerdomains and dependencies */ 24/* 24XX powerdomains and dependencies */
32 25
33#ifdef CONFIG_ARCH_OMAP2
34
35/* Powerdomains */ 26/* Powerdomains */
36 27
37static struct powerdomain dsp_pwrdm = { 28static struct powerdomain dsp_pwrdm = {
@@ -82,9 +73,6 @@ static struct powerdomain core_24xx_pwrdm = {
82 }, 73 },
83}; 74};
84 75
85#endif /* CONFIG_ARCH_OMAP2 */
86
87
88 76
89/* 77/*
90 * 2430-specific powerdomains 78 * 2430-specific powerdomains
@@ -111,5 +99,25 @@ static struct powerdomain mdm_pwrdm = {
111 99
112#endif /* CONFIG_ARCH_OMAP2430 */ 100#endif /* CONFIG_ARCH_OMAP2430 */
113 101
102/* As powerdomains are added or removed above, this list must also be changed */
103static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
114 104
105 &wkup_omap2_pwrdm,
106 &gfx_omap2_pwrdm,
107
108#ifdef CONFIG_ARCH_OMAP2
109 &dsp_pwrdm,
110 &mpu_24xx_pwrdm,
111 &core_24xx_pwrdm,
115#endif 112#endif
113
114#ifdef CONFIG_ARCH_OMAP2430
115 &mdm_pwrdm,
116#endif
117 NULL
118};
119
120void __init omap2xxx_powerdomains_init(void)
121{
122 pwrdm_init(powerdomains_omap2xxx, &omap2_pwrdm_operations);
123}
diff --git a/arch/arm/mach-omap2/powerdomains34xx.h b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index ce5c15bc41b8..e1bec562625b 100644
--- a/arch/arm/mach-omap2/powerdomains34xx.h
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -4,28 +4,23 @@
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2010 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Paul Walmsley, Jouni Högander
8 * Debugging and integration fixes by Jouni Högander
9 * 8 *
10 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
13 */ 12 */
14 13
15#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS34XX 14#include <linux/kernel.h>
16#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS34XX 15#include <linux/init.h>
17 16
18/* 17#include "powerdomain.h"
19 * N.B. If powerdomains are added or removed from this file, update 18#include "powerdomains2xxx_3xxx_data.h"
20 * the array in mach-omap2/powerdomains.h.
21 */
22
23#include <plat/powerdomain.h>
24 19
25#include "prcm-common.h" 20#include "prcm-common.h"
26#include "prm.h" 21#include "prm2xxx_3xxx.h"
27#include "prm-regbits-34xx.h" 22#include "prm-regbits-34xx.h"
28#include "cm.h" 23#include "cm2xxx_3xxx.h"
29#include "cm-regbits-34xx.h" 24#include "cm-regbits-34xx.h"
30 25
31/* 26/*
@@ -260,8 +255,33 @@ static struct powerdomain dpll5_pwrdm = {
260 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 255 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
261}; 256};
262 257
258/* As powerdomains are added or removed above, this list must also be changed */
259static struct powerdomain *powerdomains_omap3xxx[] __initdata = {
263 260
264#endif /* CONFIG_ARCH_OMAP3 */ 261 &wkup_omap2_pwrdm,
262 &gfx_omap2_pwrdm,
263 &iva2_pwrdm,
264 &mpu_3xxx_pwrdm,
265 &neon_pwrdm,
266 &core_3xxx_pre_es3_1_pwrdm,
267 &core_3xxx_es3_1_pwrdm,
268 &cam_pwrdm,
269 &dss_pwrdm,
270 &per_pwrdm,
271 &emu_pwrdm,
272 &sgx_pwrdm,
273 &usbhost_pwrdm,
274 &dpll1_pwrdm,
275 &dpll2_pwrdm,
276 &dpll3_pwrdm,
277 &dpll4_pwrdm,
278 &dpll5_pwrdm,
279#endif
280 NULL
281};
265 282
266 283
267#endif 284void __init omap3xxx_powerdomains_init(void)
285{
286 pwrdm_init(powerdomains_omap3xxx, &omap3_pwrdm_operations);
287}
diff --git a/arch/arm/mach-omap2/powerdomains44xx.h b/arch/arm/mach-omap2/powerdomains44xx_data.c
index 9c01b55d6102..26d7641076d7 100644
--- a/arch/arm/mach-omap2/powerdomains44xx.h
+++ b/arch/arm/mach-omap2/powerdomains44xx_data.c
@@ -19,23 +19,22 @@
19 * published by the Free Software Foundation. 19 * published by the Free Software Foundation.
20 */ 20 */
21 21
22#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H 22#include <linux/kernel.h>
23#define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H 23#include <linux/init.h>
24 24
25#include <plat/powerdomain.h> 25#include "powerdomain.h"
26 26
27#include "prcm-common.h" 27#include "prcm-common.h"
28#include "cm.h" 28#include "prcm44xx.h"
29#include "cm-regbits-44xx.h"
30#include "prm.h"
31#include "prm-regbits-44xx.h" 29#include "prm-regbits-44xx.h"
32 30#include "prm44xx.h"
33#if defined(CONFIG_ARCH_OMAP4) 31#include "prcm_mpu44xx.h"
34 32
35/* core_44xx_pwrdm: CORE power domain */ 33/* core_44xx_pwrdm: CORE power domain */
36static struct powerdomain core_44xx_pwrdm = { 34static struct powerdomain core_44xx_pwrdm = {
37 .name = "core_pwrdm", 35 .name = "core_pwrdm",
38 .prcm_offs = OMAP4430_PRM_CORE_MOD, 36 .prcm_offs = OMAP4430_PRM_CORE_INST,
37 .prcm_partition = OMAP4430_PRM_PARTITION,
39 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 38 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
40 .pwrsts = PWRSTS_RET_ON, 39 .pwrsts = PWRSTS_RET_ON,
41 .pwrsts_logic_ret = PWRSTS_OFF_RET, 40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -60,7 +59,8 @@ static struct powerdomain core_44xx_pwrdm = {
60/* gfx_44xx_pwrdm: 3D accelerator power domain */ 59/* gfx_44xx_pwrdm: 3D accelerator power domain */
61static struct powerdomain gfx_44xx_pwrdm = { 60static struct powerdomain gfx_44xx_pwrdm = {
62 .name = "gfx_pwrdm", 61 .name = "gfx_pwrdm",
63 .prcm_offs = OMAP4430_PRM_GFX_MOD, 62 .prcm_offs = OMAP4430_PRM_GFX_INST,
63 .prcm_partition = OMAP4430_PRM_PARTITION,
64 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 64 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
65 .pwrsts = PWRSTS_OFF_ON, 65 .pwrsts = PWRSTS_OFF_ON,
66 .banks = 1, 66 .banks = 1,
@@ -76,7 +76,8 @@ static struct powerdomain gfx_44xx_pwrdm = {
76/* abe_44xx_pwrdm: Audio back end power domain */ 76/* abe_44xx_pwrdm: Audio back end power domain */
77static struct powerdomain abe_44xx_pwrdm = { 77static struct powerdomain abe_44xx_pwrdm = {
78 .name = "abe_pwrdm", 78 .name = "abe_pwrdm",
79 .prcm_offs = OMAP4430_PRM_ABE_MOD, 79 .prcm_offs = OMAP4430_PRM_ABE_INST,
80 .prcm_partition = OMAP4430_PRM_PARTITION,
80 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
81 .pwrsts = PWRSTS_OFF_RET_ON, 82 .pwrsts = PWRSTS_OFF_RET_ON,
82 .pwrsts_logic_ret = PWRDM_POWER_OFF, 83 .pwrsts_logic_ret = PWRDM_POWER_OFF,
@@ -95,7 +96,8 @@ static struct powerdomain abe_44xx_pwrdm = {
95/* dss_44xx_pwrdm: Display subsystem power domain */ 96/* dss_44xx_pwrdm: Display subsystem power domain */
96static struct powerdomain dss_44xx_pwrdm = { 97static struct powerdomain dss_44xx_pwrdm = {
97 .name = "dss_pwrdm", 98 .name = "dss_pwrdm",
98 .prcm_offs = OMAP4430_PRM_DSS_MOD, 99 .prcm_offs = OMAP4430_PRM_DSS_INST,
100 .prcm_partition = OMAP4430_PRM_PARTITION,
99 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 101 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
100 .pwrsts = PWRSTS_OFF_RET_ON, 102 .pwrsts = PWRSTS_OFF_RET_ON,
101 .pwrsts_logic_ret = PWRSTS_OFF, 103 .pwrsts_logic_ret = PWRSTS_OFF,
@@ -112,7 +114,8 @@ static struct powerdomain dss_44xx_pwrdm = {
112/* tesla_44xx_pwrdm: Tesla processor power domain */ 114/* tesla_44xx_pwrdm: Tesla processor power domain */
113static struct powerdomain tesla_44xx_pwrdm = { 115static struct powerdomain tesla_44xx_pwrdm = {
114 .name = "tesla_pwrdm", 116 .name = "tesla_pwrdm",
115 .prcm_offs = OMAP4430_PRM_TESLA_MOD, 117 .prcm_offs = OMAP4430_PRM_TESLA_INST,
118 .prcm_partition = OMAP4430_PRM_PARTITION,
116 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
117 .pwrsts = PWRSTS_OFF_RET_ON, 120 .pwrsts = PWRSTS_OFF_RET_ON,
118 .pwrsts_logic_ret = PWRSTS_OFF_RET, 121 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -133,7 +136,8 @@ static struct powerdomain tesla_44xx_pwrdm = {
133/* wkup_44xx_pwrdm: Wake-up power domain */ 136/* wkup_44xx_pwrdm: Wake-up power domain */
134static struct powerdomain wkup_44xx_pwrdm = { 137static struct powerdomain wkup_44xx_pwrdm = {
135 .name = "wkup_pwrdm", 138 .name = "wkup_pwrdm",
136 .prcm_offs = OMAP4430_PRM_WKUP_MOD, 139 .prcm_offs = OMAP4430_PRM_WKUP_INST,
140 .prcm_partition = OMAP4430_PRM_PARTITION,
137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 141 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
138 .pwrsts = PWRSTS_ON, 142 .pwrsts = PWRSTS_ON,
139 .banks = 1, 143 .banks = 1,
@@ -148,7 +152,8 @@ static struct powerdomain wkup_44xx_pwrdm = {
148/* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */ 152/* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */
149static struct powerdomain cpu0_44xx_pwrdm = { 153static struct powerdomain cpu0_44xx_pwrdm = {
150 .name = "cpu0_pwrdm", 154 .name = "cpu0_pwrdm",
151 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_MOD, 155 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST,
156 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
152 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 157 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
153 .pwrsts = PWRSTS_OFF_RET_ON, 158 .pwrsts = PWRSTS_OFF_RET_ON,
154 .pwrsts_logic_ret = PWRSTS_OFF_RET, 159 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -164,7 +169,8 @@ static struct powerdomain cpu0_44xx_pwrdm = {
164/* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */ 169/* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */
165static struct powerdomain cpu1_44xx_pwrdm = { 170static struct powerdomain cpu1_44xx_pwrdm = {
166 .name = "cpu1_pwrdm", 171 .name = "cpu1_pwrdm",
167 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_MOD, 172 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST,
173 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
168 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 174 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
169 .pwrsts = PWRSTS_OFF_RET_ON, 175 .pwrsts = PWRSTS_OFF_RET_ON,
170 .pwrsts_logic_ret = PWRSTS_OFF_RET, 176 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -180,7 +186,8 @@ static struct powerdomain cpu1_44xx_pwrdm = {
180/* emu_44xx_pwrdm: Emulation power domain */ 186/* emu_44xx_pwrdm: Emulation power domain */
181static struct powerdomain emu_44xx_pwrdm = { 187static struct powerdomain emu_44xx_pwrdm = {
182 .name = "emu_pwrdm", 188 .name = "emu_pwrdm",
183 .prcm_offs = OMAP4430_PRM_EMU_MOD, 189 .prcm_offs = OMAP4430_PRM_EMU_INST,
190 .prcm_partition = OMAP4430_PRM_PARTITION,
184 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
185 .pwrsts = PWRSTS_OFF_ON, 192 .pwrsts = PWRSTS_OFF_ON,
186 .banks = 1, 193 .banks = 1,
@@ -195,7 +202,8 @@ static struct powerdomain emu_44xx_pwrdm = {
195/* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */ 202/* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */
196static struct powerdomain mpu_44xx_pwrdm = { 203static struct powerdomain mpu_44xx_pwrdm = {
197 .name = "mpu_pwrdm", 204 .name = "mpu_pwrdm",
198 .prcm_offs = OMAP4430_PRM_MPU_MOD, 205 .prcm_offs = OMAP4430_PRM_MPU_INST,
206 .prcm_partition = OMAP4430_PRM_PARTITION,
199 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
200 .pwrsts = PWRSTS_OFF_RET_ON, 208 .pwrsts = PWRSTS_OFF_RET_ON,
201 .pwrsts_logic_ret = PWRSTS_OFF_RET, 209 .pwrsts_logic_ret = PWRSTS_OFF_RET,
@@ -215,7 +223,8 @@ static struct powerdomain mpu_44xx_pwrdm = {
215/* ivahd_44xx_pwrdm: IVA-HD power domain */ 223/* ivahd_44xx_pwrdm: IVA-HD power domain */
216static struct powerdomain ivahd_44xx_pwrdm = { 224static struct powerdomain ivahd_44xx_pwrdm = {
217 .name = "ivahd_pwrdm", 225 .name = "ivahd_pwrdm",
218 .prcm_offs = OMAP4430_PRM_IVAHD_MOD, 226 .prcm_offs = OMAP4430_PRM_IVAHD_INST,
227 .prcm_partition = OMAP4430_PRM_PARTITION,
219 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
220 .pwrsts = PWRSTS_OFF_RET_ON, 229 .pwrsts = PWRSTS_OFF_RET_ON,
221 .pwrsts_logic_ret = PWRDM_POWER_OFF, 230 .pwrsts_logic_ret = PWRDM_POWER_OFF,
@@ -238,7 +247,8 @@ static struct powerdomain ivahd_44xx_pwrdm = {
238/* cam_44xx_pwrdm: Camera subsystem power domain */ 247/* cam_44xx_pwrdm: Camera subsystem power domain */
239static struct powerdomain cam_44xx_pwrdm = { 248static struct powerdomain cam_44xx_pwrdm = {
240 .name = "cam_pwrdm", 249 .name = "cam_pwrdm",
241 .prcm_offs = OMAP4430_PRM_CAM_MOD, 250 .prcm_offs = OMAP4430_PRM_CAM_INST,
251 .prcm_partition = OMAP4430_PRM_PARTITION,
242 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
243 .pwrsts = PWRSTS_OFF_ON, 253 .pwrsts = PWRSTS_OFF_ON,
244 .banks = 1, 254 .banks = 1,
@@ -254,9 +264,10 @@ static struct powerdomain cam_44xx_pwrdm = {
254/* l3init_44xx_pwrdm: L3 initators pheripherals power domain */ 264/* l3init_44xx_pwrdm: L3 initators pheripherals power domain */
255static struct powerdomain l3init_44xx_pwrdm = { 265static struct powerdomain l3init_44xx_pwrdm = {
256 .name = "l3init_pwrdm", 266 .name = "l3init_pwrdm",
257 .prcm_offs = OMAP4430_PRM_L3INIT_MOD, 267 .prcm_offs = OMAP4430_PRM_L3INIT_INST,
268 .prcm_partition = OMAP4430_PRM_PARTITION,
258 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 269 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
259 .pwrsts = PWRSTS_OFF_RET_ON, 270 .pwrsts = PWRSTS_RET_ON,
260 .pwrsts_logic_ret = PWRSTS_OFF_RET, 271 .pwrsts_logic_ret = PWRSTS_OFF_RET,
261 .banks = 1, 272 .banks = 1,
262 .pwrsts_mem_ret = { 273 .pwrsts_mem_ret = {
@@ -271,9 +282,10 @@ static struct powerdomain l3init_44xx_pwrdm = {
271/* l4per_44xx_pwrdm: Target peripherals power domain */ 282/* l4per_44xx_pwrdm: Target peripherals power domain */
272static struct powerdomain l4per_44xx_pwrdm = { 283static struct powerdomain l4per_44xx_pwrdm = {
273 .name = "l4per_pwrdm", 284 .name = "l4per_pwrdm",
274 .prcm_offs = OMAP4430_PRM_L4PER_MOD, 285 .prcm_offs = OMAP4430_PRM_L4PER_INST,
286 .prcm_partition = OMAP4430_PRM_PARTITION,
275 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 287 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
276 .pwrsts = PWRSTS_OFF_RET_ON, 288 .pwrsts = PWRSTS_RET_ON,
277 .pwrsts_logic_ret = PWRSTS_OFF_RET, 289 .pwrsts_logic_ret = PWRSTS_OFF_RET,
278 .banks = 2, 290 .banks = 2,
279 .pwrsts_mem_ret = { 291 .pwrsts_mem_ret = {
@@ -293,7 +305,8 @@ static struct powerdomain l4per_44xx_pwrdm = {
293 */ 305 */
294static struct powerdomain always_on_core_44xx_pwrdm = { 306static struct powerdomain always_on_core_44xx_pwrdm = {
295 .name = "always_on_core_pwrdm", 307 .name = "always_on_core_pwrdm",
296 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_MOD, 308 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST,
309 .prcm_partition = OMAP4430_PRM_PARTITION,
297 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
298 .pwrsts = PWRSTS_ON, 311 .pwrsts = PWRSTS_ON,
299}; 312};
@@ -301,7 +314,8 @@ static struct powerdomain always_on_core_44xx_pwrdm = {
301/* cefuse_44xx_pwrdm: Customer efuse controller power domain */ 314/* cefuse_44xx_pwrdm: Customer efuse controller power domain */
302static struct powerdomain cefuse_44xx_pwrdm = { 315static struct powerdomain cefuse_44xx_pwrdm = {
303 .name = "cefuse_pwrdm", 316 .name = "cefuse_pwrdm",
304 .prcm_offs = OMAP4430_PRM_CEFUSE_MOD, 317 .prcm_offs = OMAP4430_PRM_CEFUSE_INST,
318 .prcm_partition = OMAP4430_PRM_PARTITION,
305 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
306 .pwrsts = PWRSTS_OFF_ON, 320 .pwrsts = PWRSTS_OFF_ON,
307}; 321};
@@ -314,6 +328,28 @@ static struct powerdomain cefuse_44xx_pwrdm = {
314 * stdefuse 328 * stdefuse
315 */ 329 */
316 330
317#endif 331/* As powerdomains are added or removed above, this list must also be changed */
332static struct powerdomain *powerdomains_omap44xx[] __initdata = {
333 &core_44xx_pwrdm,
334 &gfx_44xx_pwrdm,
335 &abe_44xx_pwrdm,
336 &dss_44xx_pwrdm,
337 &tesla_44xx_pwrdm,
338 &wkup_44xx_pwrdm,
339 &cpu0_44xx_pwrdm,
340 &cpu1_44xx_pwrdm,
341 &emu_44xx_pwrdm,
342 &mpu_44xx_pwrdm,
343 &ivahd_44xx_pwrdm,
344 &cam_44xx_pwrdm,
345 &l3init_44xx_pwrdm,
346 &l4per_44xx_pwrdm,
347 &always_on_core_44xx_pwrdm,
348 &cefuse_44xx_pwrdm,
349 NULL
350};
318 351
319#endif 352void __init omap44xx_powerdomains_init(void)
353{
354 pwrdm_init(powerdomains_omap44xx, &omap4_pwrdm_operations);
355}
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index f81acee4738d..87486f559784 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -8,15 +8,12 @@
8 * Copyright (C) 2007-2009 Nokia Corporation 8 * Copyright (C) 2007-2009 Nokia Corporation
9 * 9 *
10 * Written by Paul Walmsley 10 * Written by Paul Walmsley
11 * OMAP4 defines in this file are automatically generated from the OMAP hardware
12 * databases.
13 * 11 *
14 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as 13 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
17 */ 15 */
18 16
19
20/* Module offsets from both CM_BASE & PRM_BASE */ 17/* Module offsets from both CM_BASE & PRM_BASE */
21 18
22/* 19/*
@@ -51,75 +48,6 @@
51#define OMAP3430_NEON_MOD 0xb00 48#define OMAP3430_NEON_MOD 0xb00
52#define OMAP3430ES2_USBHOST_MOD 0xc00 49#define OMAP3430ES2_USBHOST_MOD 0xc00
53 50
54#define BITS(n_bit) \
55 (((1 << n_bit) - 1) | (1 << n_bit))
56
57#define BITFIELD(l_bit, u_bit) \
58 (BITS(u_bit) & ~((BITS(l_bit)) >> 1))
59
60/* OMAP44XX specific module offsets */
61
62/* CM1 instances */
63
64#define OMAP4430_CM1_OCP_SOCKET_MOD 0x0000
65#define OMAP4430_CM1_CKGEN_MOD 0x0100
66#define OMAP4430_CM1_MPU_MOD 0x0300
67#define OMAP4430_CM1_TESLA_MOD 0x0400
68#define OMAP4430_CM1_ABE_MOD 0x0500
69#define OMAP4430_CM1_RESTORE_MOD 0x0e00
70#define OMAP4430_CM1_INSTR_MOD 0x0f00
71
72/* CM2 instances */
73
74#define OMAP4430_CM2_OCP_SOCKET_MOD 0x0000
75#define OMAP4430_CM2_CKGEN_MOD 0x0100
76#define OMAP4430_CM2_ALWAYS_ON_MOD 0x0600
77#define OMAP4430_CM2_CORE_MOD 0x0700
78#define OMAP4430_CM2_IVAHD_MOD 0x0f00
79#define OMAP4430_CM2_CAM_MOD 0x1000
80#define OMAP4430_CM2_DSS_MOD 0x1100
81#define OMAP4430_CM2_GFX_MOD 0x1200
82#define OMAP4430_CM2_L3INIT_MOD 0x1300
83#define OMAP4430_CM2_L4PER_MOD 0x1400
84#define OMAP4430_CM2_CEFUSE_MOD 0x1600
85#define OMAP4430_CM2_RESTORE_MOD 0x1e00
86#define OMAP4430_CM2_INSTR_MOD 0x1f00
87
88/* PRM instances */
89
90#define OMAP4430_PRM_OCP_SOCKET_MOD 0x0000
91#define OMAP4430_PRM_CKGEN_MOD 0x0100
92#define OMAP4430_PRM_MPU_MOD 0x0300
93#define OMAP4430_PRM_TESLA_MOD 0x0400
94#define OMAP4430_PRM_ABE_MOD 0x0500
95#define OMAP4430_PRM_ALWAYS_ON_MOD 0x0600
96#define OMAP4430_PRM_CORE_MOD 0x0700
97#define OMAP4430_PRM_IVAHD_MOD 0x0f00
98#define OMAP4430_PRM_CAM_MOD 0x1000
99#define OMAP4430_PRM_DSS_MOD 0x1100
100#define OMAP4430_PRM_GFX_MOD 0x1200
101#define OMAP4430_PRM_L3INIT_MOD 0x1300
102#define OMAP4430_PRM_L4PER_MOD 0x1400
103#define OMAP4430_PRM_CEFUSE_MOD 0x1600
104#define OMAP4430_PRM_WKUP_MOD 0x1700
105#define OMAP4430_PRM_WKUP_CM_MOD 0x1800
106#define OMAP4430_PRM_EMU_MOD 0x1900
107#define OMAP4430_PRM_EMU_CM_MOD 0x1a00
108#define OMAP4430_PRM_DEVICE_MOD 0x1b00
109#define OMAP4430_PRM_INSTR_MOD 0x1f00
110
111/* SCRM instances */
112
113#define OMAP4430_SCRM_SCRM_MOD 0x0000
114
115/* PRCM_MPU instances */
116
117#define OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD 0x0000
118#define OMAP4430_PRCM_MPU_DEVICE_PRM_MOD 0x0200
119#define OMAP4430_PRCM_MPU_CPU0_MOD 0x0400
120#define OMAP4430_PRCM_MPU_CPU1_MOD 0x0800
121
122
123/* 24XX register bits shared between CM & PRM registers */ 51/* 24XX register bits shared between CM & PRM registers */
124 52
125/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ 53/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
@@ -461,5 +389,18 @@
461#define OMAP3430_EN_CORE_SHIFT 0 389#define OMAP3430_EN_CORE_SHIFT 0
462#define OMAP3430_EN_CORE_MASK (1 << 0) 390#define OMAP3430_EN_CORE_MASK (1 << 0)
463 391
392
393/*
394 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
395 * submodule to exit hardreset
396 */
397#define MAX_MODULE_HARDRESET_WAIT 10000
398
399# ifndef __ASSEMBLER__
400extern void __iomem *prm_base;
401extern void __iomem *cm_base;
402extern void __iomem *cm2_base;
403# endif
404
464#endif 405#endif
465 406
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index a51846e3a6fa..679bcd28576e 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -17,7 +17,8 @@
17 * it under the terms of the GNU General Public License version 2 as 17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation. 18 * published by the Free Software Foundation.
19 */ 19 */
20#include <linux/module.h> 20
21#include <linux/kernel.h>
21#include <linux/init.h> 22#include <linux/init.h>
22#include <linux/clk.h> 23#include <linux/clk.h>
23#include <linux/io.h> 24#include <linux/io.h>
@@ -29,105 +30,27 @@
29 30
30#include "clock.h" 31#include "clock.h"
31#include "clock2xxx.h" 32#include "clock2xxx.h"
32#include "cm.h" 33#include "cm2xxx_3xxx.h"
33#include "prm.h" 34#include "prm2xxx_3xxx.h"
35#include "prm44xx.h"
36#include "prminst44xx.h"
34#include "prm-regbits-24xx.h" 37#include "prm-regbits-24xx.h"
35#include "prm-regbits-44xx.h" 38#include "prm-regbits-44xx.h"
36#include "control.h" 39#include "control.h"
37 40
38static void __iomem *prm_base; 41void __iomem *prm_base;
39static void __iomem *cm_base; 42void __iomem *cm_base;
40static void __iomem *cm2_base; 43void __iomem *cm2_base;
41 44
42#define MAX_MODULE_ENABLE_WAIT 100000 45#define MAX_MODULE_ENABLE_WAIT 100000
43 46
44struct omap3_prcm_regs {
45 u32 control_padconf_sys_nirq;
46 u32 iva2_cm_clksel1;
47 u32 iva2_cm_clksel2;
48 u32 cm_sysconfig;
49 u32 sgx_cm_clksel;
50 u32 dss_cm_clksel;
51 u32 cam_cm_clksel;
52 u32 per_cm_clksel;
53 u32 emu_cm_clksel;
54 u32 emu_cm_clkstctrl;
55 u32 pll_cm_autoidle2;
56 u32 pll_cm_clksel4;
57 u32 pll_cm_clksel5;
58 u32 pll_cm_clken2;
59 u32 cm_polctrl;
60 u32 iva2_cm_fclken;
61 u32 iva2_cm_clken_pll;
62 u32 core_cm_fclken1;
63 u32 core_cm_fclken3;
64 u32 sgx_cm_fclken;
65 u32 wkup_cm_fclken;
66 u32 dss_cm_fclken;
67 u32 cam_cm_fclken;
68 u32 per_cm_fclken;
69 u32 usbhost_cm_fclken;
70 u32 core_cm_iclken1;
71 u32 core_cm_iclken2;
72 u32 core_cm_iclken3;
73 u32 sgx_cm_iclken;
74 u32 wkup_cm_iclken;
75 u32 dss_cm_iclken;
76 u32 cam_cm_iclken;
77 u32 per_cm_iclken;
78 u32 usbhost_cm_iclken;
79 u32 iva2_cm_autiidle2;
80 u32 mpu_cm_autoidle2;
81 u32 iva2_cm_clkstctrl;
82 u32 mpu_cm_clkstctrl;
83 u32 core_cm_clkstctrl;
84 u32 sgx_cm_clkstctrl;
85 u32 dss_cm_clkstctrl;
86 u32 cam_cm_clkstctrl;
87 u32 per_cm_clkstctrl;
88 u32 neon_cm_clkstctrl;
89 u32 usbhost_cm_clkstctrl;
90 u32 core_cm_autoidle1;
91 u32 core_cm_autoidle2;
92 u32 core_cm_autoidle3;
93 u32 wkup_cm_autoidle;
94 u32 dss_cm_autoidle;
95 u32 cam_cm_autoidle;
96 u32 per_cm_autoidle;
97 u32 usbhost_cm_autoidle;
98 u32 sgx_cm_sleepdep;
99 u32 dss_cm_sleepdep;
100 u32 cam_cm_sleepdep;
101 u32 per_cm_sleepdep;
102 u32 usbhost_cm_sleepdep;
103 u32 cm_clkout_ctrl;
104 u32 prm_clkout_ctrl;
105 u32 sgx_pm_wkdep;
106 u32 dss_pm_wkdep;
107 u32 cam_pm_wkdep;
108 u32 per_pm_wkdep;
109 u32 neon_pm_wkdep;
110 u32 usbhost_pm_wkdep;
111 u32 core_pm_mpugrpsel1;
112 u32 iva2_pm_ivagrpsel1;
113 u32 core_pm_mpugrpsel3;
114 u32 core_pm_ivagrpsel3;
115 u32 wkup_pm_mpugrpsel;
116 u32 wkup_pm_ivagrpsel;
117 u32 per_pm_mpugrpsel;
118 u32 per_pm_ivagrpsel;
119 u32 wkup_pm_wken;
120};
121
122static struct omap3_prcm_regs prcm_context;
123
124u32 omap_prcm_get_reset_sources(void) 47u32 omap_prcm_get_reset_sources(void)
125{ 48{
126 /* XXX This presumably needs modification for 34XX */ 49 /* XXX This presumably needs modification for 34XX */
127 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 50 if (cpu_is_omap24xx() || cpu_is_omap34xx())
128 return prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f; 51 return omap2_prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;
129 if (cpu_is_omap44xx()) 52 if (cpu_is_omap44xx())
130 return prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f; 53 return omap2_prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f;
131 54
132 return 0; 55 return 0;
133} 56}
@@ -143,126 +66,46 @@ void omap_prcm_arch_reset(char mode, const char *cmd)
143 66
144 prcm_offs = WKUP_MOD; 67 prcm_offs = WKUP_MOD;
145 } else if (cpu_is_omap34xx()) { 68 } else if (cpu_is_omap34xx()) {
146 u32 l;
147
148 prcm_offs = OMAP3430_GR_MOD; 69 prcm_offs = OMAP3430_GR_MOD;
149 l = ('B' << 24) | ('M' << 16) | (cmd ? (u8)*cmd : 0); 70 omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
150 /* Reserve the first word in scratchpad for communicating 71 } else if (cpu_is_omap44xx()) {
151 * with the boot ROM. A pointer to a data structure 72 omap4_prm_global_warm_sw_reset(); /* never returns */
152 * describing the boot process can be stored there, 73 } else {
153 * cf. OMAP34xx TRM, Initialization / Software Booting
154 * Configuration. */
155 omap_writel(l, OMAP343X_SCRATCHPAD + 4);
156 } else if (cpu_is_omap44xx())
157 prcm_offs = OMAP4430_PRM_DEVICE_MOD;
158 else
159 WARN_ON(1); 74 WARN_ON(1);
75 }
160 76
161 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 77 /*
162 prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs, 78 * As per Errata i520, in some cases, user will not be able to
163 OMAP2_RM_RSTCTRL); 79 * access DDR memory after warm-reset.
164 if (cpu_is_omap44xx()) 80 * This situation occurs while the warm-reset happens during a read
165 prm_set_mod_reg_bits(OMAP4430_RST_GLOBAL_WARM_SW_MASK, 81 * access to DDR memory. In that particular condition, DDR memory
166 prcm_offs, OMAP4_RM_RSTCTRL); 82 * does not respond to a corrupted read command due to the warm
167} 83 * reset occurrence but SDRC is waiting for read completion.
168 84 * SDRC is not sensitive to the warm reset, but the interconnect is
169static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) 85 * reset on the fly, thus causing a misalignment between SDRC logic,
170{ 86 * interconnect logic and DDR memory state.
171 BUG_ON(!base); 87 * WORKAROUND:
172 return __raw_readl(base + module + reg); 88 * Steps to perform before a Warm reset is trigged:
173} 89 * 1. enable self-refresh on idle request
174 90 * 2. put SDRC in idle
175static inline void __omap_prcm_write(u32 value, void __iomem *base, 91 * 3. wait until SDRC goes to idle
176 s16 module, u16 reg) 92 * 4. generate SW reset (Global SW reset)
177{ 93 *
178 BUG_ON(!base); 94 * Steps to be performed after warm reset occurs (in bootloader):
179 __raw_writel(value, base + module + reg); 95 * if HW warm reset is the source, apply below steps before any
180} 96 * accesses to SDRAM:
181 97 * 1. Reset SMS and SDRC and wait till reset is complete
182/* Read a register in a PRM module */ 98 * 2. Re-initialize SMS, SDRC and memory
183u32 prm_read_mod_reg(s16 module, u16 idx) 99 *
184{ 100 * NOTE: Above work around is required only if arch reset is implemented
185 return __omap_prcm_read(prm_base, module, idx); 101 * using Global SW reset(GLOBAL_SW_RST). DPLL3 reset does not need
186} 102 * the WA since it resets SDRC as well as part of cold reset.
187 103 */
188/* Write into a register in a PRM module */ 104
189void prm_write_mod_reg(u32 val, s16 module, u16 idx) 105 /* XXX should be moved to some OMAP2/3 specific code */
190{ 106 omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, prcm_offs,
191 __omap_prcm_write(val, prm_base, module, idx); 107 OMAP2_RM_RSTCTRL);
192} 108 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */
193
194/* Read-modify-write a register in a PRM module. Caller must lock */
195u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
196{
197 u32 v;
198
199 v = prm_read_mod_reg(module, idx);
200 v &= ~mask;
201 v |= bits;
202 prm_write_mod_reg(v, module, idx);
203
204 return v;
205}
206
207/* Read a PRM register, AND it, and shift the result down to bit 0 */
208u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
209{
210 u32 v;
211
212 v = prm_read_mod_reg(domain, idx);
213 v &= mask;
214 v >>= __ffs(mask);
215
216 return v;
217}
218
219/* Read a PRM register, AND it, and shift the result down to bit 0 */
220u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask)
221{
222 u32 v;
223
224 v = __raw_readl(reg);
225 v &= mask;
226 v >>= __ffs(mask);
227
228 return v;
229}
230
231/* Read-modify-write a register in a PRM module. Caller must lock */
232u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg)
233{
234 u32 v;
235
236 v = __raw_readl(reg);
237 v &= ~mask;
238 v |= bits;
239 __raw_writel(v, reg);
240
241 return v;
242}
243/* Read a register in a CM module */
244u32 cm_read_mod_reg(s16 module, u16 idx)
245{
246 return __omap_prcm_read(cm_base, module, idx);
247}
248
249/* Write into a register in a CM module */
250void cm_write_mod_reg(u32 val, s16 module, u16 idx)
251{
252 __omap_prcm_write(val, cm_base, module, idx);
253}
254
255/* Read-modify-write a register in a CM module. Caller must lock */
256u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
257{
258 u32 v;
259
260 v = cm_read_mod_reg(module, idx);
261 v &= ~mask;
262 v |= bits;
263 cm_write_mod_reg(v, module, idx);
264
265 return v;
266} 109}
267 110
268/** 111/**
@@ -274,6 +117,9 @@ u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
274 * 117 *
275 * Returns 1 if the module indicated readiness in time, or 0 if it 118 * Returns 1 if the module indicated readiness in time, or 0 if it
276 * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds. 119 * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds.
120 *
121 * XXX This function is deprecated. It should be removed once the
122 * hwmod conversion is complete.
277 */ 123 */
278int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, 124int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
279 const char *name) 125 const char *name)
@@ -316,303 +162,3 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)
316 WARN_ON(!cm2_base); 162 WARN_ON(!cm2_base);
317 } 163 }
318} 164}
319
320#ifdef CONFIG_ARCH_OMAP3
321void omap3_prcm_save_context(void)
322{
323 prcm_context.control_padconf_sys_nirq =
324 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ);
325 prcm_context.iva2_cm_clksel1 =
326 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL1);
327 prcm_context.iva2_cm_clksel2 =
328 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSEL2);
329 prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG);
330 prcm_context.sgx_cm_clksel =
331 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL);
332 prcm_context.dss_cm_clksel =
333 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL);
334 prcm_context.cam_cm_clksel =
335 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSEL);
336 prcm_context.per_cm_clksel =
337 cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSEL);
338 prcm_context.emu_cm_clksel =
339 cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1);
340 prcm_context.emu_cm_clkstctrl =
341 cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL);
342 prcm_context.pll_cm_autoidle2 =
343 cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2);
344 prcm_context.pll_cm_clksel4 =
345 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4);
346 prcm_context.pll_cm_clksel5 =
347 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5);
348 prcm_context.pll_cm_clken2 =
349 cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2);
350 prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL);
351 prcm_context.iva2_cm_fclken =
352 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_FCLKEN);
353 prcm_context.iva2_cm_clken_pll = cm_read_mod_reg(OMAP3430_IVA2_MOD,
354 OMAP3430_CM_CLKEN_PLL);
355 prcm_context.core_cm_fclken1 =
356 cm_read_mod_reg(CORE_MOD, CM_FCLKEN1);
357 prcm_context.core_cm_fclken3 =
358 cm_read_mod_reg(CORE_MOD, OMAP3430ES2_CM_FCLKEN3);
359 prcm_context.sgx_cm_fclken =
360 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_FCLKEN);
361 prcm_context.wkup_cm_fclken =
362 cm_read_mod_reg(WKUP_MOD, CM_FCLKEN);
363 prcm_context.dss_cm_fclken =
364 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_FCLKEN);
365 prcm_context.cam_cm_fclken =
366 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_FCLKEN);
367 prcm_context.per_cm_fclken =
368 cm_read_mod_reg(OMAP3430_PER_MOD, CM_FCLKEN);
369 prcm_context.usbhost_cm_fclken =
370 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
371 prcm_context.core_cm_iclken1 =
372 cm_read_mod_reg(CORE_MOD, CM_ICLKEN1);
373 prcm_context.core_cm_iclken2 =
374 cm_read_mod_reg(CORE_MOD, CM_ICLKEN2);
375 prcm_context.core_cm_iclken3 =
376 cm_read_mod_reg(CORE_MOD, CM_ICLKEN3);
377 prcm_context.sgx_cm_iclken =
378 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_ICLKEN);
379 prcm_context.wkup_cm_iclken =
380 cm_read_mod_reg(WKUP_MOD, CM_ICLKEN);
381 prcm_context.dss_cm_iclken =
382 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_ICLKEN);
383 prcm_context.cam_cm_iclken =
384 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_ICLKEN);
385 prcm_context.per_cm_iclken =
386 cm_read_mod_reg(OMAP3430_PER_MOD, CM_ICLKEN);
387 prcm_context.usbhost_cm_iclken =
388 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
389 prcm_context.iva2_cm_autiidle2 =
390 cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
391 prcm_context.mpu_cm_autoidle2 =
392 cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2);
393 prcm_context.iva2_cm_clkstctrl =
394 cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL);
395 prcm_context.mpu_cm_clkstctrl =
396 cm_read_mod_reg(MPU_MOD, OMAP2_CM_CLKSTCTRL);
397 prcm_context.core_cm_clkstctrl =
398 cm_read_mod_reg(CORE_MOD, OMAP2_CM_CLKSTCTRL);
399 prcm_context.sgx_cm_clkstctrl =
400 cm_read_mod_reg(OMAP3430ES2_SGX_MOD,
401 OMAP2_CM_CLKSTCTRL);
402 prcm_context.dss_cm_clkstctrl =
403 cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP2_CM_CLKSTCTRL);
404 prcm_context.cam_cm_clkstctrl =
405 cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP2_CM_CLKSTCTRL);
406 prcm_context.per_cm_clkstctrl =
407 cm_read_mod_reg(OMAP3430_PER_MOD, OMAP2_CM_CLKSTCTRL);
408 prcm_context.neon_cm_clkstctrl =
409 cm_read_mod_reg(OMAP3430_NEON_MOD, OMAP2_CM_CLKSTCTRL);
410 prcm_context.usbhost_cm_clkstctrl =
411 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD,
412 OMAP2_CM_CLKSTCTRL);
413 prcm_context.core_cm_autoidle1 =
414 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1);
415 prcm_context.core_cm_autoidle2 =
416 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE2);
417 prcm_context.core_cm_autoidle3 =
418 cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE3);
419 prcm_context.wkup_cm_autoidle =
420 cm_read_mod_reg(WKUP_MOD, CM_AUTOIDLE);
421 prcm_context.dss_cm_autoidle =
422 cm_read_mod_reg(OMAP3430_DSS_MOD, CM_AUTOIDLE);
423 prcm_context.cam_cm_autoidle =
424 cm_read_mod_reg(OMAP3430_CAM_MOD, CM_AUTOIDLE);
425 prcm_context.per_cm_autoidle =
426 cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
427 prcm_context.usbhost_cm_autoidle =
428 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
429 prcm_context.sgx_cm_sleepdep =
430 cm_read_mod_reg(OMAP3430ES2_SGX_MOD, OMAP3430_CM_SLEEPDEP);
431 prcm_context.dss_cm_sleepdep =
432 cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP3430_CM_SLEEPDEP);
433 prcm_context.cam_cm_sleepdep =
434 cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP3430_CM_SLEEPDEP);
435 prcm_context.per_cm_sleepdep =
436 cm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_CM_SLEEPDEP);
437 prcm_context.usbhost_cm_sleepdep =
438 cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
439 prcm_context.cm_clkout_ctrl = cm_read_mod_reg(OMAP3430_CCR_MOD,
440 OMAP3_CM_CLKOUT_CTRL_OFFSET);
441 prcm_context.prm_clkout_ctrl = prm_read_mod_reg(OMAP3430_CCR_MOD,
442 OMAP3_PRM_CLKOUT_CTRL_OFFSET);
443 prcm_context.sgx_pm_wkdep =
444 prm_read_mod_reg(OMAP3430ES2_SGX_MOD, PM_WKDEP);
445 prcm_context.dss_pm_wkdep =
446 prm_read_mod_reg(OMAP3430_DSS_MOD, PM_WKDEP);
447 prcm_context.cam_pm_wkdep =
448 prm_read_mod_reg(OMAP3430_CAM_MOD, PM_WKDEP);
449 prcm_context.per_pm_wkdep =
450 prm_read_mod_reg(OMAP3430_PER_MOD, PM_WKDEP);
451 prcm_context.neon_pm_wkdep =
452 prm_read_mod_reg(OMAP3430_NEON_MOD, PM_WKDEP);
453 prcm_context.usbhost_pm_wkdep =
454 prm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
455 prcm_context.core_pm_mpugrpsel1 =
456 prm_read_mod_reg(CORE_MOD, OMAP3430_PM_MPUGRPSEL1);
457 prcm_context.iva2_pm_ivagrpsel1 =
458 prm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP3430_PM_IVAGRPSEL1);
459 prcm_context.core_pm_mpugrpsel3 =
460 prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_MPUGRPSEL3);
461 prcm_context.core_pm_ivagrpsel3 =
462 prm_read_mod_reg(CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3);
463 prcm_context.wkup_pm_mpugrpsel =
464 prm_read_mod_reg(WKUP_MOD, OMAP3430_PM_MPUGRPSEL);
465 prcm_context.wkup_pm_ivagrpsel =
466 prm_read_mod_reg(WKUP_MOD, OMAP3430_PM_IVAGRPSEL);
467 prcm_context.per_pm_mpugrpsel =
468 prm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL);
469 prcm_context.per_pm_ivagrpsel =
470 prm_read_mod_reg(OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL);
471 prcm_context.wkup_pm_wken = prm_read_mod_reg(WKUP_MOD, PM_WKEN);
472 return;
473}
474
475void omap3_prcm_restore_context(void)
476{
477 omap_ctrl_writel(prcm_context.control_padconf_sys_nirq,
478 OMAP343X_CONTROL_PADCONF_SYSNIRQ);
479 cm_write_mod_reg(prcm_context.iva2_cm_clksel1, OMAP3430_IVA2_MOD,
480 CM_CLKSEL1);
481 cm_write_mod_reg(prcm_context.iva2_cm_clksel2, OMAP3430_IVA2_MOD,
482 CM_CLKSEL2);
483 __raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG);
484 cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD,
485 CM_CLKSEL);
486 cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD,
487 CM_CLKSEL);
488 cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD,
489 CM_CLKSEL);
490 cm_write_mod_reg(prcm_context.per_cm_clksel, OMAP3430_PER_MOD,
491 CM_CLKSEL);
492 cm_write_mod_reg(prcm_context.emu_cm_clksel, OMAP3430_EMU_MOD,
493 CM_CLKSEL1);
494 cm_write_mod_reg(prcm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD,
495 OMAP2_CM_CLKSTCTRL);
496 cm_write_mod_reg(prcm_context.pll_cm_autoidle2, PLL_MOD,
497 CM_AUTOIDLE2);
498 cm_write_mod_reg(prcm_context.pll_cm_clksel4, PLL_MOD,
499 OMAP3430ES2_CM_CLKSEL4);
500 cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD,
501 OMAP3430ES2_CM_CLKSEL5);
502 cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD,
503 OMAP3430ES2_CM_CLKEN2);
504 __raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL);
505 cm_write_mod_reg(prcm_context.iva2_cm_fclken, OMAP3430_IVA2_MOD,
506 CM_FCLKEN);
507 cm_write_mod_reg(prcm_context.iva2_cm_clken_pll, OMAP3430_IVA2_MOD,
508 OMAP3430_CM_CLKEN_PLL);
509 cm_write_mod_reg(prcm_context.core_cm_fclken1, CORE_MOD, CM_FCLKEN1);
510 cm_write_mod_reg(prcm_context.core_cm_fclken3, CORE_MOD,
511 OMAP3430ES2_CM_FCLKEN3);
512 cm_write_mod_reg(prcm_context.sgx_cm_fclken, OMAP3430ES2_SGX_MOD,
513 CM_FCLKEN);
514 cm_write_mod_reg(prcm_context.wkup_cm_fclken, WKUP_MOD, CM_FCLKEN);
515 cm_write_mod_reg(prcm_context.dss_cm_fclken, OMAP3430_DSS_MOD,
516 CM_FCLKEN);
517 cm_write_mod_reg(prcm_context.cam_cm_fclken, OMAP3430_CAM_MOD,
518 CM_FCLKEN);
519 cm_write_mod_reg(prcm_context.per_cm_fclken, OMAP3430_PER_MOD,
520 CM_FCLKEN);
521 cm_write_mod_reg(prcm_context.usbhost_cm_fclken,
522 OMAP3430ES2_USBHOST_MOD, CM_FCLKEN);
523 cm_write_mod_reg(prcm_context.core_cm_iclken1, CORE_MOD, CM_ICLKEN1);
524 cm_write_mod_reg(prcm_context.core_cm_iclken2, CORE_MOD, CM_ICLKEN2);
525 cm_write_mod_reg(prcm_context.core_cm_iclken3, CORE_MOD, CM_ICLKEN3);
526 cm_write_mod_reg(prcm_context.sgx_cm_iclken, OMAP3430ES2_SGX_MOD,
527 CM_ICLKEN);
528 cm_write_mod_reg(prcm_context.wkup_cm_iclken, WKUP_MOD, CM_ICLKEN);
529 cm_write_mod_reg(prcm_context.dss_cm_iclken, OMAP3430_DSS_MOD,
530 CM_ICLKEN);
531 cm_write_mod_reg(prcm_context.cam_cm_iclken, OMAP3430_CAM_MOD,
532 CM_ICLKEN);
533 cm_write_mod_reg(prcm_context.per_cm_iclken, OMAP3430_PER_MOD,
534 CM_ICLKEN);
535 cm_write_mod_reg(prcm_context.usbhost_cm_iclken,
536 OMAP3430ES2_USBHOST_MOD, CM_ICLKEN);
537 cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD,
538 CM_AUTOIDLE2);
539 cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2);
540 cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD,
541 OMAP2_CM_CLKSTCTRL);
542 cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD,
543 OMAP2_CM_CLKSTCTRL);
544 cm_write_mod_reg(prcm_context.core_cm_clkstctrl, CORE_MOD,
545 OMAP2_CM_CLKSTCTRL);
546 cm_write_mod_reg(prcm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD,
547 OMAP2_CM_CLKSTCTRL);
548 cm_write_mod_reg(prcm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD,
549 OMAP2_CM_CLKSTCTRL);
550 cm_write_mod_reg(prcm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD,
551 OMAP2_CM_CLKSTCTRL);
552 cm_write_mod_reg(prcm_context.per_cm_clkstctrl, OMAP3430_PER_MOD,
553 OMAP2_CM_CLKSTCTRL);
554 cm_write_mod_reg(prcm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD,
555 OMAP2_CM_CLKSTCTRL);
556 cm_write_mod_reg(prcm_context.usbhost_cm_clkstctrl,
557 OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL);
558 cm_write_mod_reg(prcm_context.core_cm_autoidle1, CORE_MOD,
559 CM_AUTOIDLE1);
560 cm_write_mod_reg(prcm_context.core_cm_autoidle2, CORE_MOD,
561 CM_AUTOIDLE2);
562 cm_write_mod_reg(prcm_context.core_cm_autoidle3, CORE_MOD,
563 CM_AUTOIDLE3);
564 cm_write_mod_reg(prcm_context.wkup_cm_autoidle, WKUP_MOD, CM_AUTOIDLE);
565 cm_write_mod_reg(prcm_context.dss_cm_autoidle, OMAP3430_DSS_MOD,
566 CM_AUTOIDLE);
567 cm_write_mod_reg(prcm_context.cam_cm_autoidle, OMAP3430_CAM_MOD,
568 CM_AUTOIDLE);
569 cm_write_mod_reg(prcm_context.per_cm_autoidle, OMAP3430_PER_MOD,
570 CM_AUTOIDLE);
571 cm_write_mod_reg(prcm_context.usbhost_cm_autoidle,
572 OMAP3430ES2_USBHOST_MOD, CM_AUTOIDLE);
573 cm_write_mod_reg(prcm_context.sgx_cm_sleepdep, OMAP3430ES2_SGX_MOD,
574 OMAP3430_CM_SLEEPDEP);
575 cm_write_mod_reg(prcm_context.dss_cm_sleepdep, OMAP3430_DSS_MOD,
576 OMAP3430_CM_SLEEPDEP);
577 cm_write_mod_reg(prcm_context.cam_cm_sleepdep, OMAP3430_CAM_MOD,
578 OMAP3430_CM_SLEEPDEP);
579 cm_write_mod_reg(prcm_context.per_cm_sleepdep, OMAP3430_PER_MOD,
580 OMAP3430_CM_SLEEPDEP);
581 cm_write_mod_reg(prcm_context.usbhost_cm_sleepdep,
582 OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP);
583 cm_write_mod_reg(prcm_context.cm_clkout_ctrl, OMAP3430_CCR_MOD,
584 OMAP3_CM_CLKOUT_CTRL_OFFSET);
585 prm_write_mod_reg(prcm_context.prm_clkout_ctrl, OMAP3430_CCR_MOD,
586 OMAP3_PRM_CLKOUT_CTRL_OFFSET);
587 prm_write_mod_reg(prcm_context.sgx_pm_wkdep, OMAP3430ES2_SGX_MOD,
588 PM_WKDEP);
589 prm_write_mod_reg(prcm_context.dss_pm_wkdep, OMAP3430_DSS_MOD,
590 PM_WKDEP);
591 prm_write_mod_reg(prcm_context.cam_pm_wkdep, OMAP3430_CAM_MOD,
592 PM_WKDEP);
593 prm_write_mod_reg(prcm_context.per_pm_wkdep, OMAP3430_PER_MOD,
594 PM_WKDEP);
595 prm_write_mod_reg(prcm_context.neon_pm_wkdep, OMAP3430_NEON_MOD,
596 PM_WKDEP);
597 prm_write_mod_reg(prcm_context.usbhost_pm_wkdep,
598 OMAP3430ES2_USBHOST_MOD, PM_WKDEP);
599 prm_write_mod_reg(prcm_context.core_pm_mpugrpsel1, CORE_MOD,
600 OMAP3430_PM_MPUGRPSEL1);
601 prm_write_mod_reg(prcm_context.iva2_pm_ivagrpsel1, OMAP3430_IVA2_MOD,
602 OMAP3430_PM_IVAGRPSEL1);
603 prm_write_mod_reg(prcm_context.core_pm_mpugrpsel3, CORE_MOD,
604 OMAP3430ES2_PM_MPUGRPSEL3);
605 prm_write_mod_reg(prcm_context.core_pm_ivagrpsel3, CORE_MOD,
606 OMAP3430ES2_PM_IVAGRPSEL3);
607 prm_write_mod_reg(prcm_context.wkup_pm_mpugrpsel, WKUP_MOD,
608 OMAP3430_PM_MPUGRPSEL);
609 prm_write_mod_reg(prcm_context.wkup_pm_ivagrpsel, WKUP_MOD,
610 OMAP3430_PM_IVAGRPSEL);
611 prm_write_mod_reg(prcm_context.per_pm_mpugrpsel, OMAP3430_PER_MOD,
612 OMAP3430_PM_MPUGRPSEL);
613 prm_write_mod_reg(prcm_context.per_pm_ivagrpsel, OMAP3430_PER_MOD,
614 OMAP3430_PM_IVAGRPSEL);
615 prm_write_mod_reg(prcm_context.wkup_pm_wken, WKUP_MOD, PM_WKEN);
616 return;
617}
618#endif
diff --git a/arch/arm/mach-omap2/prcm44xx.h b/arch/arm/mach-omap2/prcm44xx.h
new file mode 100644
index 000000000000..7334ffb9d2c1
--- /dev/null
+++ b/arch/arm/mach-omap2/prcm44xx.h
@@ -0,0 +1,42 @@
1/*
2 * OMAP4 PRCM definitions
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation
6 *
7 * Paul Walmsley
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * This file contains macros and functions that are common to all of
14 * the PRM/CM/PRCM blocks on the OMAP4 devices: PRM, CM1, CM2,
15 * PRCM_MPU, SCRM
16 */
17
18#ifndef __ARCH_ARM_MACH_OMAP2_PRCM44XX_H
19#define __ARCH_ARM_MACH_OMAP2_PRCM44XX_H
20
21/*
22 * OMAP4 PRCM partition IDs
23 *
24 * The numbers and order are arbitrary, but 0 is reserved for the
25 * 'invalid' partition in case someone forgets to add a
26 * .prcm_partition field.
27 */
28#define OMAP4430_INVALID_PRCM_PARTITION 0
29#define OMAP4430_PRM_PARTITION 1
30#define OMAP4430_CM1_PARTITION 2
31#define OMAP4430_CM2_PARTITION 3
32#define OMAP4430_SCRM_PARTITION 4
33#define OMAP4430_PRCM_MPU_PARTITION 5
34
35/*
36 * OMAP4_MAX_PRCM_PARTITIONS: set to the highest value of the PRCM partition
37 * IDs, plus one
38 */
39#define OMAP4_MAX_PRCM_PARTITIONS 6
40
41
42#endif
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.c b/arch/arm/mach-omap2/prcm_mpu44xx.c
new file mode 100644
index 000000000000..171fe171a749
--- /dev/null
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.c
@@ -0,0 +1,45 @@
1/*
2 * OMAP4 PRCM_MPU module functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/io.h>
17
18#include <plat/common.h>
19
20#include "prcm_mpu44xx.h"
21#include "cm-regbits-44xx.h"
22
23/* PRCM_MPU low-level functions */
24
25u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 reg)
26{
27 return __raw_readl(OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
28}
29
30void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 reg)
31{
32 __raw_writel(val, OMAP44XX_PRCM_MPU_REGADDR(inst, reg));
33}
34
35u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
36{
37 u32 v;
38
39 v = omap4_prcm_mpu_read_inst_reg(inst, reg);
40 v &= ~mask;
41 v |= bits;
42 omap4_prcm_mpu_write_inst_reg(v, inst, reg);
43
44 return v;
45}
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h
new file mode 100644
index 000000000000..729a644ce852
--- /dev/null
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.h
@@ -0,0 +1,104 @@
1/*
2 * OMAP44xx PRCM MPU instance offset macros
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation
6 *
7 * Paul Walmsley (paul@pwsan.com)
8 * Rajendra Nayak (rnayak@ti.com)
9 * Benoit Cousson (b-cousson@ti.com)
10 *
11 * This file is automatically generated from the OMAP hardware databases.
12 * We respectfully ask that any modifications to this file be coordinated
13 * with the public linux-omap@vger.kernel.org mailing list and the
14 * authors above to ensure that the autogeneration scripts are kept
15 * up-to-date with the file contents.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 *
21 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
23 */
24
25#ifndef __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
26#define __ARCH_ARM_MACH_OMAP2_PRCM_MPU44XX_H
27
28#define OMAP4430_PRCM_MPU_BASE 0x48243000
29
30#define OMAP44XX_PRCM_MPU_REGADDR(inst, reg) \
31 OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE + (inst) + (reg))
32
33/* PRCM_MPU instances */
34
35#define OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_INST 0x0000
36#define OMAP4430_PRCM_MPU_DEVICE_PRM_INST 0x0200
37#define OMAP4430_PRCM_MPU_CPU0_INST 0x0400
38#define OMAP4430_PRCM_MPU_CPU1_INST 0x0800
39
40/* PRCM_MPU clockdomain register offsets (from instance start) */
41#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0000
42#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0000
43
44
45/*
46 * PRCM_MPU
47 *
48 * The PRCM_MPU is a local PRCM inside the MPU subsystem. For the PRCM (global)
49 * point of view the PRCM_MPU is a single entity. It shares the same
50 * programming model as the global PRCM and thus can be assimilate as two new
51 * MOD inside the PRCM
52 */
53
54/* PRCM_MPU.OCP_SOCKET_PRCM register offsets */
55#define OMAP4_REVISION_PRCM_OFFSET 0x0000
56#define OMAP4430_REVISION_PRCM OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_INST, 0x0000)
57
58/* PRCM_MPU.DEVICE_PRM register offsets */
59#define OMAP4_PRCM_MPU_PRM_RSTST_OFFSET 0x0000
60#define OMAP4430_PRCM_MPU_PRM_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_INST, 0x0000)
61#define OMAP4_PRCM_MPU_PRM_PSCON_COUNT_OFFSET 0x0004
62#define OMAP4430_PRCM_MPU_PRM_PSCON_COUNT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_INST, 0x0004)
63
64/* PRCM_MPU.CPU0 register offsets */
65#define OMAP4_PM_CPU0_PWRSTCTRL_OFFSET 0x0000
66#define OMAP4430_PM_CPU0_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0000)
67#define OMAP4_PM_CPU0_PWRSTST_OFFSET 0x0004
68#define OMAP4430_PM_CPU0_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0004)
69#define OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET 0x0008
70#define OMAP4430_RM_CPU0_CPU0_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0008)
71#define OMAP4_RM_CPU0_CPU0_RSTCTRL_OFFSET 0x000c
72#define OMAP4430_RM_CPU0_CPU0_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x000c)
73#define OMAP4_RM_CPU0_CPU0_RSTST_OFFSET 0x0010
74#define OMAP4430_RM_CPU0_CPU0_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0010)
75#define OMAP4_CM_CPU0_CPU0_CLKCTRL_OFFSET 0x0014
76#define OMAP4430_CM_CPU0_CPU0_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0014)
77#define OMAP4_CM_CPU0_CLKSTCTRL_OFFSET 0x0018
78#define OMAP4430_CM_CPU0_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_INST, 0x0018)
79
80/* PRCM_MPU.CPU1 register offsets */
81#define OMAP4_PM_CPU1_PWRSTCTRL_OFFSET 0x0000
82#define OMAP4430_PM_CPU1_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0000)
83#define OMAP4_PM_CPU1_PWRSTST_OFFSET 0x0004
84#define OMAP4430_PM_CPU1_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0004)
85#define OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET 0x0008
86#define OMAP4430_RM_CPU1_CPU1_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0008)
87#define OMAP4_RM_CPU1_CPU1_RSTCTRL_OFFSET 0x000c
88#define OMAP4430_RM_CPU1_CPU1_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x000c)
89#define OMAP4_RM_CPU1_CPU1_RSTST_OFFSET 0x0010
90#define OMAP4430_RM_CPU1_CPU1_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0010)
91#define OMAP4_CM_CPU1_CPU1_CLKCTRL_OFFSET 0x0014
92#define OMAP4430_CM_CPU1_CPU1_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0014)
93#define OMAP4_CM_CPU1_CLKSTCTRL_OFFSET 0x0018
94#define OMAP4430_CM_CPU1_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_INST, 0x0018)
95
96/* Function prototypes */
97# ifndef __ASSEMBLER__
98extern u32 omap4_prcm_mpu_read_inst_reg(s16 inst, u16 idx);
99extern void omap4_prcm_mpu_write_inst_reg(u32 val, s16 inst, u16 idx);
100extern u32 omap4_prcm_mpu_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst,
101 s16 idx);
102# endif
103
104#endif
diff --git a/arch/arm/mach-omap2/prm-regbits-24xx.h b/arch/arm/mach-omap2/prm-regbits-24xx.h
index 0b188ffa710e..6ac966103f34 100644
--- a/arch/arm/mach-omap2/prm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-24xx.h
@@ -14,7 +14,7 @@
14 * published by the Free Software Foundation. 14 * published by the Free Software Foundation.
15 */ 15 */
16 16
17#include "prm.h" 17#include "prm2xxx_3xxx.h"
18 18
19/* Bits shared between registers */ 19/* Bits shared between registers */
20 20
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h
index ec1a710db9ce..64c087af6a8b 100644
--- a/arch/arm/mach-omap2/prm-regbits-34xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-34xx.h
@@ -1,6 +1,3 @@
1#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
2#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
3
4/* 1/*
5 * OMAP3430 Power/Reset Management register bits 2 * OMAP3430 Power/Reset Management register bits
6 * 3 *
@@ -13,8 +10,11 @@
13 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
15 */ 12 */
13#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
14#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_34XX_H
15
16 16
17#include "prm.h" 17#include "prm2xxx_3xxx.h"
18 18
19/* Shared register bits */ 19/* Shared register bits */
20 20
diff --git a/arch/arm/mach-omap2/prm-regbits-44xx.h b/arch/arm/mach-omap2/prm-regbits-44xx.h
index 25b19b610177..6d2776f6fc08 100644
--- a/arch/arm/mach-omap2/prm-regbits-44xx.h
+++ b/arch/arm/mach-omap2/prm-regbits-44xx.h
@@ -22,8 +22,6 @@
22#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H 22#ifndef __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
23#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H 23#define __ARCH_ARM_MACH_OMAP2_PRM_REGBITS_44XX_H
24 24
25#include "prm.h"
26
27 25
28/* 26/*
29 * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, 27 * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP,
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 7be040b2fdab..39d562169d18 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -1,321 +1,20 @@
1#ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
2#define __ARCH_ARM_MACH_OMAP2_PRM_H
3
4/* 1/*
5 * OMAP2/3 Power/Reset Management (PRM) register definitions 2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions
6 * 3 *
7 * Copyright (C) 2007-2009 Texas Instruments, Inc. 4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
8 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
9 * 6 *
10 * Written by Paul Walmsley 7 * Paul Walmsley
11 * 8 *
12 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
15 */ 12 */
13#ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
14#define __ARCH_ARM_MACH_OMAP2_PRM_H
16 15
17#include "prcm-common.h" 16#include "prcm-common.h"
18 17
19#define OMAP2420_PRM_REGADDR(module, reg) \
20 OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
21#define OMAP2430_PRM_REGADDR(module, reg) \
22 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
23#define OMAP34XX_PRM_REGADDR(module, reg) \
24 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
25#define OMAP44XX_PRM_REGADDR(module, reg) \
26 OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (module) + (reg))
27#define OMAP44XX_PRCM_MPU_REGADDR(module, reg) \
28 OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE + (module) + (reg))
29
30#include "prm44xx.h"
31
32/*
33 * Architecture-specific global PRM registers
34 * Use __raw_{read,write}l() with these registers.
35 *
36 * With a few exceptions, these are the register names beginning with
37 * PRCM_* on 24xx, and PRM_* on 34xx. (The exceptions are the
38 * IRQSTATUS and IRQENABLE bits.)
39 *
40 */
41
42#define OMAP2_PRCM_REVISION_OFFSET 0x0000
43#define OMAP2420_PRCM_REVISION OMAP2420_PRM_REGADDR(OCP_MOD, 0x0000)
44#define OMAP2_PRCM_SYSCONFIG_OFFSET 0x0010
45#define OMAP2420_PRCM_SYSCONFIG OMAP2420_PRM_REGADDR(OCP_MOD, 0x0010)
46
47#define OMAP2_PRCM_IRQSTATUS_MPU_OFFSET 0x0018
48#define OMAP2420_PRCM_IRQSTATUS_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x0018)
49#define OMAP2_PRCM_IRQENABLE_MPU_OFFSET 0x001c
50#define OMAP2420_PRCM_IRQENABLE_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x001c)
51
52#define OMAP2_PRCM_VOLTCTRL_OFFSET 0x0050
53#define OMAP2420_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0050)
54#define OMAP2_PRCM_VOLTST_OFFSET 0x0054
55#define OMAP2420_PRCM_VOLTST OMAP2420_PRM_REGADDR(OCP_MOD, 0x0054)
56#define OMAP2_PRCM_CLKSRC_CTRL_OFFSET 0x0060
57#define OMAP2420_PRCM_CLKSRC_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0060)
58#define OMAP2_PRCM_CLKOUT_CTRL_OFFSET 0x0070
59#define OMAP2420_PRCM_CLKOUT_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0070)
60#define OMAP2_PRCM_CLKEMUL_CTRL_OFFSET 0x0078
61#define OMAP2420_PRCM_CLKEMUL_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0078)
62#define OMAP2_PRCM_CLKCFG_CTRL_OFFSET 0x0080
63#define OMAP2420_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0080)
64#define OMAP2_PRCM_CLKCFG_STATUS_OFFSET 0x0084
65#define OMAP2420_PRCM_CLKCFG_STATUS OMAP2420_PRM_REGADDR(OCP_MOD, 0x0084)
66#define OMAP2_PRCM_VOLTSETUP_OFFSET 0x0090
67#define OMAP2420_PRCM_VOLTSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0090)
68#define OMAP2_PRCM_CLKSSETUP_OFFSET 0x0094
69#define OMAP2420_PRCM_CLKSSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0094)
70#define OMAP2_PRCM_POLCTRL_OFFSET 0x0098
71#define OMAP2420_PRCM_POLCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0098)
72
73#define OMAP2430_PRCM_REVISION OMAP2430_PRM_REGADDR(OCP_MOD, 0x0000)
74#define OMAP2430_PRCM_SYSCONFIG OMAP2430_PRM_REGADDR(OCP_MOD, 0x0010)
75
76#define OMAP2430_PRCM_IRQSTATUS_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x0018)
77#define OMAP2430_PRCM_IRQENABLE_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x001c)
78
79#define OMAP2430_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0050)
80#define OMAP2430_PRCM_VOLTST OMAP2430_PRM_REGADDR(OCP_MOD, 0x0054)
81#define OMAP2430_PRCM_CLKSRC_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0060)
82#define OMAP2430_PRCM_CLKOUT_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0070)
83#define OMAP2430_PRCM_CLKEMUL_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0078)
84#define OMAP2430_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0080)
85#define OMAP2430_PRCM_CLKCFG_STATUS OMAP2430_PRM_REGADDR(OCP_MOD, 0x0084)
86#define OMAP2430_PRCM_VOLTSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0090)
87#define OMAP2430_PRCM_CLKSSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0094)
88#define OMAP2430_PRCM_POLCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0098)
89
90#define OMAP3_PRM_REVISION_OFFSET 0x0004
91#define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
92#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
93#define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
94
95#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
96#define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
97#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
98#define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
99
100
101#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
102#define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
103#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
104#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
105#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
106#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
107#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
108#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
109#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
110#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
111#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
112#define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
113#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
114#define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
115#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
116#define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
117#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
118#define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
119#define OMAP3_PRM_RSTTIME_OFFSET 0x0054
120#define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
121#define OMAP3_PRM_RSTST_OFFSET 0x0058
122#define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
123#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
124#define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
125#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
126#define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
127#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
128#define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
129#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
130#define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
131#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
132#define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
133#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
134#define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
135#define OMAP3_PRM_POLCTRL_OFFSET 0x009c
136#define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
137#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
138#define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
139#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
140#define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
141#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
142#define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
143#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
144#define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
145#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
146#define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
147#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
148#define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
149#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
150#define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
151#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
152#define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
153#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
154#define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
155#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
156#define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
157#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
158#define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
159#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
160#define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
161#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
162#define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
163
164#define OMAP3_PRM_CLKSEL_OFFSET 0x0040
165#define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
166#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
167#define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
168
169/*
170 * Module specific PRM registers from PRM_BASE + domain offset
171 *
172 * Use prm_{read,write}_mod_reg() with these registers.
173 *
174 * With a few exceptions, these are the register names beginning with
175 * {PM,RM}_* on both architectures. (The exceptions are the IRQSTATUS
176 * and IRQENABLE bits.)
177 *
178 */
179
180/* Registers appearing on both 24xx and 34xx */
181
182#define OMAP2_RM_RSTCTRL 0x0050
183#define OMAP2_RM_RSTTIME 0x0054
184#define OMAP2_RM_RSTST 0x0058
185#define OMAP2_PM_PWSTCTRL 0x00e0
186#define OMAP2_PM_PWSTST 0x00e4
187
188#define PM_WKEN 0x00a0
189#define PM_WKEN1 PM_WKEN
190#define PM_WKST 0x00b0
191#define PM_WKST1 PM_WKST
192#define PM_WKDEP 0x00c8
193#define PM_EVGENCTRL 0x00d4
194#define PM_EVGENONTIM 0x00d8
195#define PM_EVGENOFFTIM 0x00dc
196
197/* Omap2 specific registers */
198#define OMAP24XX_PM_WKEN2 0x00a4
199#define OMAP24XX_PM_WKST2 0x00b4
200
201#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
202#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
203#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
204#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
205
206/* Omap3 specific registers */
207#define OMAP3430ES2_PM_WKEN3 0x00f0
208#define OMAP3430ES2_PM_WKST3 0x00b8
209
210#define OMAP3430_PM_MPUGRPSEL 0x00a4
211#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
212#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
213
214#define OMAP3430_PM_IVAGRPSEL 0x00a8
215#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
216#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
217
218#define OMAP3430_PM_PREPWSTST 0x00e8
219
220#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
221#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
222
223/* Omap4 specific registers */
224#define OMAP4_RM_RSTCTRL 0x0000
225#define OMAP4_RM_RSTTIME 0x0004
226#define OMAP4_RM_RSTST 0x0008
227#define OMAP4_PM_PWSTCTRL 0x0000
228#define OMAP4_PM_PWSTST 0x0004
229
230
231#ifndef __ASSEMBLER__
232
233/* Power/reset management domain register get/set */
234extern u32 prm_read_mod_reg(s16 module, u16 idx);
235extern void prm_write_mod_reg(u32 val, s16 module, u16 idx);
236extern u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
237
238/* Read-modify-write bits in a PRM register (by domain) */
239static inline u32 prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
240{
241 return prm_rmw_mod_reg_bits(bits, bits, module, idx);
242}
243
244static inline u32 prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
245{
246 return prm_rmw_mod_reg_bits(bits, 0x0, module, idx);
247}
248
249/* These omap2_ PRM functions apply to both OMAP2 and 3 */
250int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
251int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
252int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift);
253
254int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift);
255int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift);
256int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
257
258#endif
259
260/*
261 * Bits common to specific registers
262 *
263 * The 3430 register and bit names are generally used,
264 * since they tend to make more sense
265 */
266
267/* PM_EVGENONTIM_MPU */
268/* Named PM_EVEGENONTIM_MPU on the 24XX */
269#define OMAP_ONTIMEVAL_SHIFT 0
270#define OMAP_ONTIMEVAL_MASK (0xffffffff << 0)
271
272/* PM_EVGENOFFTIM_MPU */
273/* Named PM_EVEGENOFFTIM_MPU on the 24XX */
274#define OMAP_OFFTIMEVAL_SHIFT 0
275#define OMAP_OFFTIMEVAL_MASK (0xffffffff << 0)
276
277/* PRM_CLKSETUP and PRCM_VOLTSETUP */
278/* Named PRCM_CLKSSETUP on the 24XX */
279#define OMAP_SETUP_TIME_SHIFT 0
280#define OMAP_SETUP_TIME_MASK (0xffff << 0)
281
282/* PRM_CLKSRC_CTRL */
283/* Named PRCM_CLKSRC_CTRL on the 24XX */
284#define OMAP_SYSCLKDIV_SHIFT 6
285#define OMAP_SYSCLKDIV_MASK (0x3 << 6)
286#define OMAP_AUTOEXTCLKMODE_SHIFT 3
287#define OMAP_AUTOEXTCLKMODE_MASK (0x3 << 3)
288#define OMAP_SYSCLKSEL_SHIFT 0
289#define OMAP_SYSCLKSEL_MASK (0x3 << 0)
290
291/* PM_EVGENCTRL_MPU */
292#define OMAP_OFFLOADMODE_SHIFT 3
293#define OMAP_OFFLOADMODE_MASK (0x3 << 3)
294#define OMAP_ONLOADMODE_SHIFT 1
295#define OMAP_ONLOADMODE_MASK (0x3 << 1)
296#define OMAP_ENABLE_MASK (1 << 0)
297
298/* PRM_RSTTIME */
299/* Named RM_RSTTIME_WKUP on the 24xx */
300#define OMAP_RSTTIME2_SHIFT 8
301#define OMAP_RSTTIME2_MASK (0x1f << 8)
302#define OMAP_RSTTIME1_SHIFT 0
303#define OMAP_RSTTIME1_MASK (0xff << 0)
304
305/* PRM_RSTCTRL */
306/* Named RM_RSTCTRL_WKUP on the 24xx */
307/* 2420 calls RST_DPLL3 'RST_DPLL' */
308#define OMAP_RST_DPLL3_MASK (1 << 2)
309#define OMAP_RST_GS_MASK (1 << 1)
310
311
312/*
313 * Bits common to module-shared registers
314 *
315 * Not all registers of a particular type support all of these bits -
316 * check TRM if you are unsure
317 */
318
319/* 18/*
320 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP 19 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP
321 * 20 *
@@ -341,59 +40,6 @@ int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
341#define OMAP_POWERSTATEST_MASK (0x3 << 0) 40#define OMAP_POWERSTATEST_MASK (0x3 << 0)
342 41
343/* 42/*
344 * 24XX: RM_RSTST_MPU and RM_RSTST_DSP - on 24XX, 'COREDOMAINWKUP_RST' is
345 * called 'COREWKUP_RST'
346 *
347 * 3430: RM_RSTST_IVA2, RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSS,
348 * RM_RSTST_CAM, RM_RSTST_PER, RM_RSTST_NEON
349 */
350#define OMAP_COREDOMAINWKUP_RST_MASK (1 << 3)
351
352/*
353 * 24XX: RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSP
354 *
355 * 2430: RM_RSTST_MDM
356 *
357 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
358 */
359#define OMAP_DOMAINWKUP_RST_MASK (1 << 2)
360
361/*
362 * 24XX: RM_RSTST_MPU, RM_RSTST_WKUP, RM_RSTST_DSP
363 * On 24XX, 'GLOBALWARM_RST' is called 'GLOBALWMPU_RST'.
364 *
365 * 2430: RM_RSTST_MDM
366 *
367 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
368 */
369#define OMAP_GLOBALWARM_RST_MASK (1 << 1)
370#define OMAP_GLOBALCOLD_RST_MASK (1 << 0)
371
372/*
373 * 24XX: PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_CORE, PM_WKDEP_DSP
374 * 2420 TRM sometimes uses "EN_WAKEUP" instead of "EN_WKUP"
375 *
376 * 2430: PM_WKDEP_MDM
377 *
378 * 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM,
379 * PM_WKDEP_PER
380 */
381#define OMAP_EN_WKUP_SHIFT 4
382#define OMAP_EN_WKUP_MASK (1 << 4)
383
384/*
385 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
386 * PM_PWSTCTRL_DSP
387 *
388 * 2430: PM_PWSTCTRL_MDM
389 *
390 * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
391 * PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
392 * PM_PWSTCTRL_NEON
393 */
394#define OMAP_LOGICRETSTATE_MASK (1 << 2)
395
396/*
397 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX, 43 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
398 * PM_PWSTCTRL_DSP, PM_PWSTST_MPU 44 * PM_PWSTCTRL_DSP, PM_PWSTST_MPU
399 * 45 *
@@ -407,11 +53,4 @@ int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
407#define OMAP_POWERSTATE_MASK (0x3 << 0) 53#define OMAP_POWERSTATE_MASK (0x3 << 0)
408 54
409 55
410/*
411 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
412 * submodule to exit hardreset
413 */
414#define MAX_MODULE_HARDRESET_WAIT 10000
415
416
417#endif 56#endif
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 421771eee450..ec0362574b5e 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -12,18 +12,65 @@
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/delay.h>
16#include <linux/errno.h> 15#include <linux/errno.h>
17#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h>
18 18
19#include <plat/common.h> 19#include <plat/common.h>
20#include <plat/cpu.h> 20#include <plat/cpu.h>
21#include <plat/prcm.h> 21#include <plat/prcm.h>
22 22
23#include "prm.h" 23#include "prm2xxx_3xxx.h"
24#include "cm2xxx_3xxx.h"
24#include "prm-regbits-24xx.h" 25#include "prm-regbits-24xx.h"
25#include "prm-regbits-34xx.h" 26#include "prm-regbits-34xx.h"
26 27
28u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
29{
30 return __raw_readl(prm_base + module + idx);
31}
32
33void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx)
34{
35 __raw_writel(val, prm_base + module + idx);
36}
37
38/* Read-modify-write a register in a PRM module. Caller must lock */
39u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx)
40{
41 u32 v;
42
43 v = omap2_prm_read_mod_reg(module, idx);
44 v &= ~mask;
45 v |= bits;
46 omap2_prm_write_mod_reg(v, module, idx);
47
48 return v;
49}
50
51/* Read a PRM register, AND it, and shift the result down to bit 0 */
52u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask)
53{
54 u32 v;
55
56 v = omap2_prm_read_mod_reg(domain, idx);
57 v &= mask;
58 v >>= __ffs(mask);
59
60 return v;
61}
62
63u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx)
64{
65 return omap2_prm_rmw_mod_reg_bits(bits, bits, module, idx);
66}
67
68u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
69{
70 return omap2_prm_rmw_mod_reg_bits(bits, 0x0, module, idx);
71}
72
73
27/** 74/**
28 * omap2_prm_is_hardreset_asserted - read the HW reset line state of 75 * omap2_prm_is_hardreset_asserted - read the HW reset line state of
29 * submodules contained in the hwmod module 76 * submodules contained in the hwmod module
@@ -39,7 +86,7 @@ int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift)
39 if (!(cpu_is_omap24xx() || cpu_is_omap34xx())) 86 if (!(cpu_is_omap24xx() || cpu_is_omap34xx()))
40 return -EINVAL; 87 return -EINVAL;
41 88
42 return prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, 89 return omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL,
43 (1 << shift)); 90 (1 << shift));
44} 91}
45 92
@@ -63,7 +110,7 @@ int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift)
63 return -EINVAL; 110 return -EINVAL;
64 111
65 mask = 1 << shift; 112 mask = 1 << shift;
66 prm_rmw_mod_reg_bits(mask, mask, prm_mod, OMAP2_RM_RSTCTRL); 113 omap2_prm_rmw_mod_reg_bits(mask, mask, prm_mod, OMAP2_RM_RSTCTRL);
67 114
68 return 0; 115 return 0;
69} 116}
@@ -93,18 +140,17 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift)
93 mask = 1 << shift; 140 mask = 1 << shift;
94 141
95 /* Check the current status to avoid de-asserting the line twice */ 142 /* Check the current status to avoid de-asserting the line twice */
96 if (prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0) 143 if (omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL, mask) == 0)
97 return -EEXIST; 144 return -EEXIST;
98 145
99 /* Clear the reset status by writing 1 to the status bit */ 146 /* Clear the reset status by writing 1 to the status bit */
100 prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST); 147 omap2_prm_rmw_mod_reg_bits(0xffffffff, mask, prm_mod, OMAP2_RM_RSTST);
101 /* de-assert the reset control line */ 148 /* de-assert the reset control line */
102 prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL); 149 omap2_prm_rmw_mod_reg_bits(mask, 0, prm_mod, OMAP2_RM_RSTCTRL);
103 /* wait the status to be set */ 150 /* wait the status to be set */
104 omap_test_timeout(prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST, 151 omap_test_timeout(omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTST,
105 mask), 152 mask),
106 MAX_MODULE_HARDRESET_WAIT, c); 153 MAX_MODULE_HARDRESET_WAIT, c);
107 154
108 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 155 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
109} 156}
110
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h
new file mode 100644
index 000000000000..53d44f6e3736
--- /dev/null
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
@@ -0,0 +1,367 @@
1/*
2 * OMAP2/3 Power/Reset Management (PRM) register definitions
3 *
4 * Copyright (C) 2007-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 * Paul Walmsley
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * The PRM hardware modules on the OMAP2/3 are quite similar to each
13 * other. The PRM on OMAP4 has a new register layout, and is handled
14 * in a separate file.
15 */
16#ifndef __ARCH_ARM_MACH_OMAP2_PRM2XXX_3XXX_H
17#define __ARCH_ARM_MACH_OMAP2_PRM2XXX_3XXX_H
18
19#include "prcm-common.h"
20#include "prm.h"
21
22#define OMAP2420_PRM_REGADDR(module, reg) \
23 OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
24#define OMAP2430_PRM_REGADDR(module, reg) \
25 OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE + (module) + (reg))
26#define OMAP34XX_PRM_REGADDR(module, reg) \
27 OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg))
28
29
30/*
31 * OMAP2-specific global PRM registers
32 * Use __raw_{read,write}l() with these registers.
33 *
34 * With a few exceptions, these are the register names beginning with
35 * PRCM_* on 24xx. (The exceptions are the IRQSTATUS and IRQENABLE
36 * bits.)
37 *
38 */
39
40#define OMAP2_PRCM_REVISION_OFFSET 0x0000
41#define OMAP2420_PRCM_REVISION OMAP2420_PRM_REGADDR(OCP_MOD, 0x0000)
42#define OMAP2_PRCM_SYSCONFIG_OFFSET 0x0010
43#define OMAP2420_PRCM_SYSCONFIG OMAP2420_PRM_REGADDR(OCP_MOD, 0x0010)
44
45#define OMAP2_PRCM_IRQSTATUS_MPU_OFFSET 0x0018
46#define OMAP2420_PRCM_IRQSTATUS_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x0018)
47#define OMAP2_PRCM_IRQENABLE_MPU_OFFSET 0x001c
48#define OMAP2420_PRCM_IRQENABLE_MPU OMAP2420_PRM_REGADDR(OCP_MOD, 0x001c)
49
50#define OMAP2_PRCM_VOLTCTRL_OFFSET 0x0050
51#define OMAP2420_PRCM_VOLTCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0050)
52#define OMAP2_PRCM_VOLTST_OFFSET 0x0054
53#define OMAP2420_PRCM_VOLTST OMAP2420_PRM_REGADDR(OCP_MOD, 0x0054)
54#define OMAP2_PRCM_CLKSRC_CTRL_OFFSET 0x0060
55#define OMAP2420_PRCM_CLKSRC_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0060)
56#define OMAP2_PRCM_CLKOUT_CTRL_OFFSET 0x0070
57#define OMAP2420_PRCM_CLKOUT_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0070)
58#define OMAP2_PRCM_CLKEMUL_CTRL_OFFSET 0x0078
59#define OMAP2420_PRCM_CLKEMUL_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0078)
60#define OMAP2_PRCM_CLKCFG_CTRL_OFFSET 0x0080
61#define OMAP2420_PRCM_CLKCFG_CTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0080)
62#define OMAP2_PRCM_CLKCFG_STATUS_OFFSET 0x0084
63#define OMAP2420_PRCM_CLKCFG_STATUS OMAP2420_PRM_REGADDR(OCP_MOD, 0x0084)
64#define OMAP2_PRCM_VOLTSETUP_OFFSET 0x0090
65#define OMAP2420_PRCM_VOLTSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0090)
66#define OMAP2_PRCM_CLKSSETUP_OFFSET 0x0094
67#define OMAP2420_PRCM_CLKSSETUP OMAP2420_PRM_REGADDR(OCP_MOD, 0x0094)
68#define OMAP2_PRCM_POLCTRL_OFFSET 0x0098
69#define OMAP2420_PRCM_POLCTRL OMAP2420_PRM_REGADDR(OCP_MOD, 0x0098)
70
71#define OMAP2430_PRCM_REVISION OMAP2430_PRM_REGADDR(OCP_MOD, 0x0000)
72#define OMAP2430_PRCM_SYSCONFIG OMAP2430_PRM_REGADDR(OCP_MOD, 0x0010)
73
74#define OMAP2430_PRCM_IRQSTATUS_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x0018)
75#define OMAP2430_PRCM_IRQENABLE_MPU OMAP2430_PRM_REGADDR(OCP_MOD, 0x001c)
76
77#define OMAP2430_PRCM_VOLTCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0050)
78#define OMAP2430_PRCM_VOLTST OMAP2430_PRM_REGADDR(OCP_MOD, 0x0054)
79#define OMAP2430_PRCM_CLKSRC_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0060)
80#define OMAP2430_PRCM_CLKOUT_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0070)
81#define OMAP2430_PRCM_CLKEMUL_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0078)
82#define OMAP2430_PRCM_CLKCFG_CTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0080)
83#define OMAP2430_PRCM_CLKCFG_STATUS OMAP2430_PRM_REGADDR(OCP_MOD, 0x0084)
84#define OMAP2430_PRCM_VOLTSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0090)
85#define OMAP2430_PRCM_CLKSSETUP OMAP2430_PRM_REGADDR(OCP_MOD, 0x0094)
86#define OMAP2430_PRCM_POLCTRL OMAP2430_PRM_REGADDR(OCP_MOD, 0x0098)
87
88/*
89 * OMAP3-specific global PRM registers
90 * Use __raw_{read,write}l() with these registers.
91 *
92 * With a few exceptions, these are the register names beginning with
93 * PRM_* on 34xx. (The exceptions are the IRQSTATUS and IRQENABLE
94 * bits.)
95 */
96
97#define OMAP3_PRM_REVISION_OFFSET 0x0004
98#define OMAP3430_PRM_REVISION OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0004)
99#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014
100#define OMAP3430_PRM_SYSCONFIG OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0014)
101
102#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018
103#define OMAP3430_PRM_IRQSTATUS_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x0018)
104#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c
105#define OMAP3430_PRM_IRQENABLE_MPU OMAP34XX_PRM_REGADDR(OCP_MOD, 0x001c)
106
107
108#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020
109#define OMAP3430_PRM_VC_SMPS_SA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0020)
110#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024
111#define OMAP3430_PRM_VC_SMPS_VOL_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0024)
112#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028
113#define OMAP3430_PRM_VC_SMPS_CMD_RA OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0028)
114#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c
115#define OMAP3430_PRM_VC_CMD_VAL_0 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x002c)
116#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030
117#define OMAP3430_PRM_VC_CMD_VAL_1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0030)
118#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034
119#define OMAP3430_PRM_VC_CH_CONF OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0034)
120#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038
121#define OMAP3430_PRM_VC_I2C_CFG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0038)
122#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c
123#define OMAP3430_PRM_VC_BYPASS_VAL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x003c)
124#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050
125#define OMAP3430_PRM_RSTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0050)
126#define OMAP3_PRM_RSTTIME_OFFSET 0x0054
127#define OMAP3430_PRM_RSTTIME OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0054)
128#define OMAP3_PRM_RSTST_OFFSET 0x0058
129#define OMAP3430_PRM_RSTST OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0058)
130#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060
131#define OMAP3430_PRM_VOLTCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0060)
132#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064
133#define OMAP3430_PRM_SRAM_PCHARGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0064)
134#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070
135#define OMAP3430_PRM_CLKSRC_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0070)
136#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090
137#define OMAP3430_PRM_VOLTSETUP1 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0090)
138#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094
139#define OMAP3430_PRM_VOLTOFFSET OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0094)
140#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098
141#define OMAP3430_PRM_CLKSETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x0098)
142#define OMAP3_PRM_POLCTRL_OFFSET 0x009c
143#define OMAP3430_PRM_POLCTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x009c)
144#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0
145#define OMAP3430_PRM_VOLTSETUP2 OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00a0)
146#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0
147#define OMAP3430_PRM_VP1_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b0)
148#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4
149#define OMAP3430_PRM_VP1_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b4)
150#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8
151#define OMAP3430_PRM_VP1_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00b8)
152#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc
153#define OMAP3430_PRM_VP1_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00bc)
154#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0
155#define OMAP3430_PRM_VP1_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c0)
156#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4
157#define OMAP3430_PRM_VP1_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00c4)
158#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0
159#define OMAP3430_PRM_VP2_CONFIG OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d0)
160#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4
161#define OMAP3430_PRM_VP2_VSTEPMIN OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d4)
162#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8
163#define OMAP3430_PRM_VP2_VSTEPMAX OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00d8)
164#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc
165#define OMAP3430_PRM_VP2_VLIMITTO OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00dc)
166#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0
167#define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0)
168#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4
169#define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4)
170
171#define OMAP3_PRM_CLKSEL_OFFSET 0x0040
172#define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040)
173#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070
174#define OMAP3430_PRM_CLKOUT_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0070)
175
176/*
177 * Module specific PRM register offsets from PRM_BASE + domain offset
178 *
179 * Use prm_{read,write}_mod_reg() with these registers.
180 *
181 * With a few exceptions, these are the register names beginning with
182 * {PM,RM}_* on both OMAP2/3 SoC families.. (The exceptions are the
183 * IRQSTATUS and IRQENABLE bits.)
184 */
185
186/* Register offsets appearing on both OMAP2 and OMAP3 */
187
188#define OMAP2_RM_RSTCTRL 0x0050
189#define OMAP2_RM_RSTTIME 0x0054
190#define OMAP2_RM_RSTST 0x0058
191#define OMAP2_PM_PWSTCTRL 0x00e0
192#define OMAP2_PM_PWSTST 0x00e4
193
194#define PM_WKEN 0x00a0
195#define PM_WKEN1 PM_WKEN
196#define PM_WKST 0x00b0
197#define PM_WKST1 PM_WKST
198#define PM_WKDEP 0x00c8
199#define PM_EVGENCTRL 0x00d4
200#define PM_EVGENONTIM 0x00d8
201#define PM_EVGENOFFTIM 0x00dc
202
203/* OMAP2xxx specific register offsets */
204#define OMAP24XX_PM_WKEN2 0x00a4
205#define OMAP24XX_PM_WKST2 0x00b4
206
207#define OMAP24XX_PRCM_IRQSTATUS_DSP 0x00f0 /* IVA mod */
208#define OMAP24XX_PRCM_IRQENABLE_DSP 0x00f4 /* IVA mod */
209#define OMAP24XX_PRCM_IRQSTATUS_IVA 0x00f8
210#define OMAP24XX_PRCM_IRQENABLE_IVA 0x00fc
211
212/* OMAP3 specific register offsets */
213#define OMAP3430ES2_PM_WKEN3 0x00f0
214#define OMAP3430ES2_PM_WKST3 0x00b8
215
216#define OMAP3430_PM_MPUGRPSEL 0x00a4
217#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL
218#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8
219
220#define OMAP3430_PM_IVAGRPSEL 0x00a8
221#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL
222#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4
223
224#define OMAP3430_PM_PREPWSTST 0x00e8
225
226#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8
227#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc
228
229
230#ifndef __ASSEMBLER__
231
232/* Power/reset management domain register get/set */
233extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx);
234extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx);
235extern u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
236extern u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx);
237extern u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx);
238extern u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
239
240/* These omap2_ PRM functions apply to both OMAP2 and 3 */
241extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift);
242extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift);
243extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 shift);
244
245#endif
246
247/*
248 * Bits common to specific registers
249 *
250 * The 3430 register and bit names are generally used,
251 * since they tend to make more sense
252 */
253
254/* PM_EVGENONTIM_MPU */
255/* Named PM_EVEGENONTIM_MPU on the 24XX */
256#define OMAP_ONTIMEVAL_SHIFT 0
257#define OMAP_ONTIMEVAL_MASK (0xffffffff << 0)
258
259/* PM_EVGENOFFTIM_MPU */
260/* Named PM_EVEGENOFFTIM_MPU on the 24XX */
261#define OMAP_OFFTIMEVAL_SHIFT 0
262#define OMAP_OFFTIMEVAL_MASK (0xffffffff << 0)
263
264/* PRM_CLKSETUP and PRCM_VOLTSETUP */
265/* Named PRCM_CLKSSETUP on the 24XX */
266#define OMAP_SETUP_TIME_SHIFT 0
267#define OMAP_SETUP_TIME_MASK (0xffff << 0)
268
269/* PRM_CLKSRC_CTRL */
270/* Named PRCM_CLKSRC_CTRL on the 24XX */
271#define OMAP_SYSCLKDIV_SHIFT 6
272#define OMAP_SYSCLKDIV_MASK (0x3 << 6)
273#define OMAP_AUTOEXTCLKMODE_SHIFT 3
274#define OMAP_AUTOEXTCLKMODE_MASK (0x3 << 3)
275#define OMAP_SYSCLKSEL_SHIFT 0
276#define OMAP_SYSCLKSEL_MASK (0x3 << 0)
277
278/* PM_EVGENCTRL_MPU */
279#define OMAP_OFFLOADMODE_SHIFT 3
280#define OMAP_OFFLOADMODE_MASK (0x3 << 3)
281#define OMAP_ONLOADMODE_SHIFT 1
282#define OMAP_ONLOADMODE_MASK (0x3 << 1)
283#define OMAP_ENABLE_MASK (1 << 0)
284
285/* PRM_RSTTIME */
286/* Named RM_RSTTIME_WKUP on the 24xx */
287#define OMAP_RSTTIME2_SHIFT 8
288#define OMAP_RSTTIME2_MASK (0x1f << 8)
289#define OMAP_RSTTIME1_SHIFT 0
290#define OMAP_RSTTIME1_MASK (0xff << 0)
291
292/* PRM_RSTCTRL */
293/* Named RM_RSTCTRL_WKUP on the 24xx */
294/* 2420 calls RST_DPLL3 'RST_DPLL' */
295#define OMAP_RST_DPLL3_MASK (1 << 2)
296#define OMAP_RST_GS_MASK (1 << 1)
297
298
299/*
300 * Bits common to module-shared registers
301 *
302 * Not all registers of a particular type support all of these bits -
303 * check TRM if you are unsure
304 */
305
306/*
307 * 24XX: RM_RSTST_MPU and RM_RSTST_DSP - on 24XX, 'COREDOMAINWKUP_RST' is
308 * called 'COREWKUP_RST'
309 *
310 * 3430: RM_RSTST_IVA2, RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSS,
311 * RM_RSTST_CAM, RM_RSTST_PER, RM_RSTST_NEON
312 */
313#define OMAP_COREDOMAINWKUP_RST_MASK (1 << 3)
314
315/*
316 * 24XX: RM_RSTST_MPU, RM_RSTST_GFX, RM_RSTST_DSP
317 *
318 * 2430: RM_RSTST_MDM
319 *
320 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
321 */
322#define OMAP_DOMAINWKUP_RST_MASK (1 << 2)
323
324/*
325 * 24XX: RM_RSTST_MPU, RM_RSTST_WKUP, RM_RSTST_DSP
326 * On 24XX, 'GLOBALWARM_RST' is called 'GLOBALWMPU_RST'.
327 *
328 * 2430: RM_RSTST_MDM
329 *
330 * 3430: RM_RSTST_CORE, RM_RSTST_EMU
331 */
332#define OMAP_GLOBALWARM_RST_MASK (1 << 1)
333#define OMAP_GLOBALCOLD_RST_MASK (1 << 0)
334
335/*
336 * 24XX: PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_CORE, PM_WKDEP_DSP
337 * 2420 TRM sometimes uses "EN_WAKEUP" instead of "EN_WKUP"
338 *
339 * 2430: PM_WKDEP_MDM
340 *
341 * 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM,
342 * PM_WKDEP_PER
343 */
344#define OMAP_EN_WKUP_SHIFT 4
345#define OMAP_EN_WKUP_MASK (1 << 4)
346
347/*
348 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
349 * PM_PWSTCTRL_DSP
350 *
351 * 2430: PM_PWSTCTRL_MDM
352 *
353 * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
354 * PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
355 * PM_PWSTCTRL_NEON
356 */
357#define OMAP_LOGICRETSTATE_MASK (1 << 2)
358
359
360/*
361 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
362 * submodule to exit hardreset
363 */
364#define MAX_MODULE_HARDRESET_WAIT 10000
365
366
367#endif
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index a1ff918d9bed..a2a04bfa9628 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -15,12 +15,13 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/io.h>
18 19
19#include <plat/common.h> 20#include <plat/common.h>
20#include <plat/cpu.h> 21#include <plat/cpu.h>
21#include <plat/prcm.h> 22#include <plat/prcm.h>
22 23
23#include "prm.h" 24#include "prm44xx.h"
24#include "prm-regbits-44xx.h" 25#include "prm-regbits-44xx.h"
25 26
26/* 27/*
@@ -29,6 +30,70 @@
29 */ 30 */
30#define OMAP4_RST_CTRL_ST_OFFSET 4 31#define OMAP4_RST_CTRL_ST_OFFSET 4
31 32
33/* PRM low-level functions */
34
35/* Read a register in a CM/PRM instance in the PRM module */
36u32 omap4_prm_read_inst_reg(s16 inst, u16 reg)
37{
38 return __raw_readl(OMAP44XX_PRM_REGADDR(inst, reg));
39}
40
41/* Write into a register in a CM/PRM instance in the PRM module */
42void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 reg)
43{
44 __raw_writel(val, OMAP44XX_PRM_REGADDR(inst, reg));
45}
46
47/* Read-modify-write a register in a PRM module. Caller must lock */
48u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg)
49{
50 u32 v;
51
52 v = omap4_prm_read_inst_reg(inst, reg);
53 v &= ~mask;
54 v |= bits;
55 omap4_prm_write_inst_reg(v, inst, reg);
56
57 return v;
58}
59
60/* Read a PRM register, AND it, and shift the result down to bit 0 */
61/* XXX deprecated */
62u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask)
63{
64 u32 v;
65
66 v = __raw_readl(reg);
67 v &= mask;
68 v >>= __ffs(mask);
69
70 return v;
71}
72
73/* Read-modify-write a register in a PRM module. Caller must lock */
74/* XXX deprecated */
75u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg)
76{
77 u32 v;
78
79 v = __raw_readl(reg);
80 v &= ~mask;
81 v |= bits;
82 __raw_writel(v, reg);
83
84 return v;
85}
86
87u32 omap4_prm_set_inst_reg_bits(u32 bits, s16 inst, s16 reg)
88{
89 return omap4_prm_rmw_inst_reg_bits(bits, bits, inst, reg);
90}
91
92u32 omap4_prm_clear_inst_reg_bits(u32 bits, s16 inst, s16 reg)
93{
94 return omap4_prm_rmw_inst_reg_bits(bits, 0x0, inst, reg);
95}
96
32/** 97/**
33 * omap4_prm_is_hardreset_asserted - read the HW reset line state of 98 * omap4_prm_is_hardreset_asserted - read the HW reset line state of
34 * submodules contained in the hwmod module 99 * submodules contained in the hwmod module
@@ -114,3 +179,17 @@ int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift)
114 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0; 179 return (c == MAX_MODULE_HARDRESET_WAIT) ? -EBUSY : 0;
115} 180}
116 181
182void omap4_prm_global_warm_sw_reset(void)
183{
184 u32 v;
185
186 v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
187 OMAP4_RM_RSTCTRL);
188 v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK;
189 omap4_prm_write_inst_reg(v, OMAP4430_PRM_DEVICE_INST,
190 OMAP4_RM_RSTCTRL);
191
192 /* OCP barrier */
193 v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
194 OMAP4_RM_RSTCTRL);
195}
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h
index 59839dbabd84..67a0d3feb3f6 100644
--- a/arch/arm/mach-omap2/prm44xx.h
+++ b/arch/arm/mach-omap2/prm44xx.h
@@ -17,736 +17,762 @@
17 * This program is free software; you can redistribute it and/or modify 17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as 18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation. 19 * published by the Free Software Foundation.
20 *
21 * XXX This file needs to be updated to align on one of "OMAP4", "OMAP44XX",
22 * or "OMAP4430".
20 */ 23 */
21 24
22#ifndef __ARCH_ARM_MACH_OMAP2_PRM44XX_H 25#ifndef __ARCH_ARM_MACH_OMAP2_PRM44XX_H
23#define __ARCH_ARM_MACH_OMAP2_PRM44XX_H 26#define __ARCH_ARM_MACH_OMAP2_PRM44XX_H
24 27
28#include "prcm-common.h"
29#include "prm.h"
30
31#define OMAP4430_PRM_BASE 0x4a306000
32
33#define OMAP44XX_PRM_REGADDR(inst, reg) \
34 OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (inst) + (reg))
35
36
37/* PRM instances */
38#define OMAP4430_PRM_OCP_SOCKET_INST 0x0000
39#define OMAP4430_PRM_CKGEN_INST 0x0100
40#define OMAP4430_PRM_MPU_INST 0x0300
41#define OMAP4430_PRM_TESLA_INST 0x0400
42#define OMAP4430_PRM_ABE_INST 0x0500
43#define OMAP4430_PRM_ALWAYS_ON_INST 0x0600
44#define OMAP4430_PRM_CORE_INST 0x0700
45#define OMAP4430_PRM_IVAHD_INST 0x0f00
46#define OMAP4430_PRM_CAM_INST 0x1000
47#define OMAP4430_PRM_DSS_INST 0x1100
48#define OMAP4430_PRM_GFX_INST 0x1200
49#define OMAP4430_PRM_L3INIT_INST 0x1300
50#define OMAP4430_PRM_L4PER_INST 0x1400
51#define OMAP4430_PRM_CEFUSE_INST 0x1600
52#define OMAP4430_PRM_WKUP_INST 0x1700
53#define OMAP4430_PRM_WKUP_CM_INST 0x1800
54#define OMAP4430_PRM_EMU_INST 0x1900
55#define OMAP4430_PRM_EMU_CM_INST 0x1a00
56#define OMAP4430_PRM_DEVICE_INST 0x1b00
57#define OMAP4430_PRM_INSTR_INST 0x1f00
58
59/* PRM clockdomain register offsets (from instance start) */
60#define OMAP4430_PRM_MPU_MPU_CDOFFS 0x0000
61#define OMAP4430_PRM_TESLA_TESLA_CDOFFS 0x0000
62#define OMAP4430_PRM_ABE_ABE_CDOFFS 0x0000
63#define OMAP4430_PRM_CORE_CORE_CDOFFS 0x0000
64#define OMAP4430_PRM_IVAHD_IVAHD_CDOFFS 0x0000
65#define OMAP4430_PRM_CAM_CAM_CDOFFS 0x0000
66#define OMAP4430_PRM_DSS_DSS_CDOFFS 0x0000
67#define OMAP4430_PRM_GFX_GFX_CDOFFS 0x0000
68#define OMAP4430_PRM_L3INIT_L3INIT_CDOFFS 0x0000
69#define OMAP4430_PRM_L4PER_L4PER_CDOFFS 0x0000
70#define OMAP4430_PRM_CEFUSE_CEFUSE_CDOFFS 0x0000
71#define OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS 0x0000
72#define OMAP4430_PRM_EMU_EMU_CDOFFS 0x0000
73#define OMAP4430_PRM_EMU_CM_EMU_CDOFFS 0x0000
74
75/* OMAP4 specific register offsets */
76#define OMAP4_RM_RSTCTRL 0x0000
77#define OMAP4_RM_RSTTIME 0x0004
78#define OMAP4_RM_RSTST 0x0008
79#define OMAP4_PM_PWSTCTRL 0x0000
80#define OMAP4_PM_PWSTST 0x0004
81
25 82
26/* PRM */ 83/* PRM */
27 84
28/* PRM.OCP_SOCKET_PRM register offsets */ 85/* PRM.OCP_SOCKET_PRM register offsets */
29#define OMAP4_REVISION_PRM_OFFSET 0x0000 86#define OMAP4_REVISION_PRM_OFFSET 0x0000
30#define OMAP4430_REVISION_PRM OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0000) 87#define OMAP4430_REVISION_PRM OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0000)
31#define OMAP4_PRM_IRQSTATUS_MPU_OFFSET 0x0010 88#define OMAP4_PRM_IRQSTATUS_MPU_OFFSET 0x0010
32#define OMAP4430_PRM_IRQSTATUS_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0010) 89#define OMAP4430_PRM_IRQSTATUS_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0010)
33#define OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET 0x0014 90#define OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET 0x0014
34#define OMAP4430_PRM_IRQSTATUS_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0014) 91#define OMAP4430_PRM_IRQSTATUS_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0014)
35#define OMAP4_PRM_IRQENABLE_MPU_OFFSET 0x0018 92#define OMAP4_PRM_IRQENABLE_MPU_OFFSET 0x0018
36#define OMAP4430_PRM_IRQENABLE_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0018) 93#define OMAP4430_PRM_IRQENABLE_MPU OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0018)
37#define OMAP4_PRM_IRQENABLE_MPU_2_OFFSET 0x001c 94#define OMAP4_PRM_IRQENABLE_MPU_2_OFFSET 0x001c
38#define OMAP4430_PRM_IRQENABLE_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x001c) 95#define OMAP4430_PRM_IRQENABLE_MPU_2 OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x001c)
39#define OMAP4_PRM_IRQSTATUS_DUCATI_OFFSET 0x0020 96#define OMAP4_PRM_IRQSTATUS_DUCATI_OFFSET 0x0020
40#define OMAP4430_PRM_IRQSTATUS_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0020) 97#define OMAP4430_PRM_IRQSTATUS_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0020)
41#define OMAP4_PRM_IRQENABLE_DUCATI_OFFSET 0x0028 98#define OMAP4_PRM_IRQENABLE_DUCATI_OFFSET 0x0028
42#define OMAP4430_PRM_IRQENABLE_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0028) 99#define OMAP4430_PRM_IRQENABLE_DUCATI OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0028)
43#define OMAP4_PRM_IRQSTATUS_TESLA_OFFSET 0x0030 100#define OMAP4_PRM_IRQSTATUS_TESLA_OFFSET 0x0030
44#define OMAP4430_PRM_IRQSTATUS_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0030) 101#define OMAP4430_PRM_IRQSTATUS_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0030)
45#define OMAP4_PRM_IRQENABLE_TESLA_OFFSET 0x0038 102#define OMAP4_PRM_IRQENABLE_TESLA_OFFSET 0x0038
46#define OMAP4430_PRM_IRQENABLE_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0038) 103#define OMAP4430_PRM_IRQENABLE_TESLA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0038)
47#define OMAP4_CM_PRM_PROFILING_CLKCTRL_OFFSET 0x0040 104#define OMAP4_CM_PRM_PROFILING_CLKCTRL_OFFSET 0x0040
48#define OMAP4430_CM_PRM_PROFILING_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_MOD, 0x0040) 105#define OMAP4430_CM_PRM_PROFILING_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_OCP_SOCKET_INST, 0x0040)
49 106
50/* PRM.CKGEN_PRM register offsets */ 107/* PRM.CKGEN_PRM register offsets */
51#define OMAP4_CM_ABE_DSS_SYS_CLKSEL_OFFSET 0x0000 108#define OMAP4_CM_ABE_DSS_SYS_CLKSEL_OFFSET 0x0000
52#define OMAP4430_CM_ABE_DSS_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x0000) 109#define OMAP4430_CM_ABE_DSS_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x0000)
53#define OMAP4_CM_L4_WKUP_CLKSEL_OFFSET 0x0008 110#define OMAP4_CM_L4_WKUP_CLKSEL_OFFSET 0x0008
54#define OMAP4430_CM_L4_WKUP_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x0008) 111#define OMAP4430_CM_L4_WKUP_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x0008)
55#define OMAP4_CM_ABE_PLL_REF_CLKSEL_OFFSET 0x000c 112#define OMAP4_CM_ABE_PLL_REF_CLKSEL_OFFSET 0x000c
56#define OMAP4430_CM_ABE_PLL_REF_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x000c) 113#define OMAP4430_CM_ABE_PLL_REF_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x000c)
57#define OMAP4_CM_SYS_CLKSEL_OFFSET 0x0010 114#define OMAP4_CM_SYS_CLKSEL_OFFSET 0x0010
58#define OMAP4430_CM_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_MOD, 0x0010) 115#define OMAP4430_CM_SYS_CLKSEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CKGEN_INST, 0x0010)
59 116
60/* PRM.MPU_PRM register offsets */ 117/* PRM.MPU_PRM register offsets */
61#define OMAP4_PM_MPU_PWRSTCTRL_OFFSET 0x0000 118#define OMAP4_PM_MPU_PWRSTCTRL_OFFSET 0x0000
62#define OMAP4430_PM_MPU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0000) 119#define OMAP4430_PM_MPU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0000)
63#define OMAP4_PM_MPU_PWRSTST_OFFSET 0x0004 120#define OMAP4_PM_MPU_PWRSTST_OFFSET 0x0004
64#define OMAP4430_PM_MPU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0004) 121#define OMAP4430_PM_MPU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0004)
65#define OMAP4_RM_MPU_RSTST_OFFSET 0x0014 122#define OMAP4_RM_MPU_RSTST_OFFSET 0x0014
66#define OMAP4430_RM_MPU_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0014) 123#define OMAP4430_RM_MPU_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0014)
67#define OMAP4_RM_MPU_MPU_CONTEXT_OFFSET 0x0024 124#define OMAP4_RM_MPU_MPU_CONTEXT_OFFSET 0x0024
68#define OMAP4430_RM_MPU_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_MOD, 0x0024) 125#define OMAP4430_RM_MPU_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_MPU_INST, 0x0024)
69 126
70/* PRM.TESLA_PRM register offsets */ 127/* PRM.TESLA_PRM register offsets */
71#define OMAP4_PM_TESLA_PWRSTCTRL_OFFSET 0x0000 128#define OMAP4_PM_TESLA_PWRSTCTRL_OFFSET 0x0000
72#define OMAP4430_PM_TESLA_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0000) 129#define OMAP4430_PM_TESLA_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0000)
73#define OMAP4_PM_TESLA_PWRSTST_OFFSET 0x0004 130#define OMAP4_PM_TESLA_PWRSTST_OFFSET 0x0004
74#define OMAP4430_PM_TESLA_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0004) 131#define OMAP4430_PM_TESLA_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0004)
75#define OMAP4_RM_TESLA_RSTCTRL_OFFSET 0x0010 132#define OMAP4_RM_TESLA_RSTCTRL_OFFSET 0x0010
76#define OMAP4430_RM_TESLA_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0010) 133#define OMAP4430_RM_TESLA_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0010)
77#define OMAP4_RM_TESLA_RSTST_OFFSET 0x0014 134#define OMAP4_RM_TESLA_RSTST_OFFSET 0x0014
78#define OMAP4430_RM_TESLA_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0014) 135#define OMAP4430_RM_TESLA_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0014)
79#define OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET 0x0024 136#define OMAP4_RM_TESLA_TESLA_CONTEXT_OFFSET 0x0024
80#define OMAP4430_RM_TESLA_TESLA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_MOD, 0x0024) 137#define OMAP4430_RM_TESLA_TESLA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_TESLA_INST, 0x0024)
81 138
82/* PRM.ABE_PRM register offsets */ 139/* PRM.ABE_PRM register offsets */
83#define OMAP4_PM_ABE_PWRSTCTRL_OFFSET 0x0000 140#define OMAP4_PM_ABE_PWRSTCTRL_OFFSET 0x0000
84#define OMAP4430_PM_ABE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0000) 141#define OMAP4430_PM_ABE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0000)
85#define OMAP4_PM_ABE_PWRSTST_OFFSET 0x0004 142#define OMAP4_PM_ABE_PWRSTST_OFFSET 0x0004
86#define OMAP4430_PM_ABE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0004) 143#define OMAP4430_PM_ABE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0004)
87#define OMAP4_RM_ABE_AESS_CONTEXT_OFFSET 0x002c 144#define OMAP4_RM_ABE_AESS_CONTEXT_OFFSET 0x002c
88#define OMAP4430_RM_ABE_AESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x002c) 145#define OMAP4430_RM_ABE_AESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x002c)
89#define OMAP4_PM_ABE_PDM_WKDEP_OFFSET 0x0030 146#define OMAP4_PM_ABE_PDM_WKDEP_OFFSET 0x0030
90#define OMAP4430_PM_ABE_PDM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0030) 147#define OMAP4430_PM_ABE_PDM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0030)
91#define OMAP4_RM_ABE_PDM_CONTEXT_OFFSET 0x0034 148#define OMAP4_RM_ABE_PDM_CONTEXT_OFFSET 0x0034
92#define OMAP4430_RM_ABE_PDM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0034) 149#define OMAP4430_RM_ABE_PDM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0034)
93#define OMAP4_PM_ABE_DMIC_WKDEP_OFFSET 0x0038 150#define OMAP4_PM_ABE_DMIC_WKDEP_OFFSET 0x0038
94#define OMAP4430_PM_ABE_DMIC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0038) 151#define OMAP4430_PM_ABE_DMIC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0038)
95#define OMAP4_RM_ABE_DMIC_CONTEXT_OFFSET 0x003c 152#define OMAP4_RM_ABE_DMIC_CONTEXT_OFFSET 0x003c
96#define OMAP4430_RM_ABE_DMIC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x003c) 153#define OMAP4430_RM_ABE_DMIC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x003c)
97#define OMAP4_PM_ABE_MCASP_WKDEP_OFFSET 0x0040 154#define OMAP4_PM_ABE_MCASP_WKDEP_OFFSET 0x0040
98#define OMAP4430_PM_ABE_MCASP_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0040) 155#define OMAP4430_PM_ABE_MCASP_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0040)
99#define OMAP4_RM_ABE_MCASP_CONTEXT_OFFSET 0x0044 156#define OMAP4_RM_ABE_MCASP_CONTEXT_OFFSET 0x0044
100#define OMAP4430_RM_ABE_MCASP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0044) 157#define OMAP4430_RM_ABE_MCASP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0044)
101#define OMAP4_PM_ABE_MCBSP1_WKDEP_OFFSET 0x0048 158#define OMAP4_PM_ABE_MCBSP1_WKDEP_OFFSET 0x0048
102#define OMAP4430_PM_ABE_MCBSP1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0048) 159#define OMAP4430_PM_ABE_MCBSP1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0048)
103#define OMAP4_RM_ABE_MCBSP1_CONTEXT_OFFSET 0x004c 160#define OMAP4_RM_ABE_MCBSP1_CONTEXT_OFFSET 0x004c
104#define OMAP4430_RM_ABE_MCBSP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x004c) 161#define OMAP4430_RM_ABE_MCBSP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x004c)
105#define OMAP4_PM_ABE_MCBSP2_WKDEP_OFFSET 0x0050 162#define OMAP4_PM_ABE_MCBSP2_WKDEP_OFFSET 0x0050
106#define OMAP4430_PM_ABE_MCBSP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0050) 163#define OMAP4430_PM_ABE_MCBSP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0050)
107#define OMAP4_RM_ABE_MCBSP2_CONTEXT_OFFSET 0x0054 164#define OMAP4_RM_ABE_MCBSP2_CONTEXT_OFFSET 0x0054
108#define OMAP4430_RM_ABE_MCBSP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0054) 165#define OMAP4430_RM_ABE_MCBSP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0054)
109#define OMAP4_PM_ABE_MCBSP3_WKDEP_OFFSET 0x0058 166#define OMAP4_PM_ABE_MCBSP3_WKDEP_OFFSET 0x0058
110#define OMAP4430_PM_ABE_MCBSP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0058) 167#define OMAP4430_PM_ABE_MCBSP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0058)
111#define OMAP4_RM_ABE_MCBSP3_CONTEXT_OFFSET 0x005c 168#define OMAP4_RM_ABE_MCBSP3_CONTEXT_OFFSET 0x005c
112#define OMAP4430_RM_ABE_MCBSP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x005c) 169#define OMAP4430_RM_ABE_MCBSP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x005c)
113#define OMAP4_PM_ABE_SLIMBUS_WKDEP_OFFSET 0x0060 170#define OMAP4_PM_ABE_SLIMBUS_WKDEP_OFFSET 0x0060
114#define OMAP4430_PM_ABE_SLIMBUS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0060) 171#define OMAP4430_PM_ABE_SLIMBUS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0060)
115#define OMAP4_RM_ABE_SLIMBUS_CONTEXT_OFFSET 0x0064 172#define OMAP4_RM_ABE_SLIMBUS_CONTEXT_OFFSET 0x0064
116#define OMAP4430_RM_ABE_SLIMBUS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0064) 173#define OMAP4430_RM_ABE_SLIMBUS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0064)
117#define OMAP4_PM_ABE_TIMER5_WKDEP_OFFSET 0x0068 174#define OMAP4_PM_ABE_TIMER5_WKDEP_OFFSET 0x0068
118#define OMAP4430_PM_ABE_TIMER5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0068) 175#define OMAP4430_PM_ABE_TIMER5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0068)
119#define OMAP4_RM_ABE_TIMER5_CONTEXT_OFFSET 0x006c 176#define OMAP4_RM_ABE_TIMER5_CONTEXT_OFFSET 0x006c
120#define OMAP4430_RM_ABE_TIMER5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x006c) 177#define OMAP4430_RM_ABE_TIMER5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x006c)
121#define OMAP4_PM_ABE_TIMER6_WKDEP_OFFSET 0x0070 178#define OMAP4_PM_ABE_TIMER6_WKDEP_OFFSET 0x0070
122#define OMAP4430_PM_ABE_TIMER6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0070) 179#define OMAP4430_PM_ABE_TIMER6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0070)
123#define OMAP4_RM_ABE_TIMER6_CONTEXT_OFFSET 0x0074 180#define OMAP4_RM_ABE_TIMER6_CONTEXT_OFFSET 0x0074
124#define OMAP4430_RM_ABE_TIMER6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0074) 181#define OMAP4430_RM_ABE_TIMER6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0074)
125#define OMAP4_PM_ABE_TIMER7_WKDEP_OFFSET 0x0078 182#define OMAP4_PM_ABE_TIMER7_WKDEP_OFFSET 0x0078
126#define OMAP4430_PM_ABE_TIMER7_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0078) 183#define OMAP4430_PM_ABE_TIMER7_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0078)
127#define OMAP4_RM_ABE_TIMER7_CONTEXT_OFFSET 0x007c 184#define OMAP4_RM_ABE_TIMER7_CONTEXT_OFFSET 0x007c
128#define OMAP4430_RM_ABE_TIMER7_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x007c) 185#define OMAP4430_RM_ABE_TIMER7_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x007c)
129#define OMAP4_PM_ABE_TIMER8_WKDEP_OFFSET 0x0080 186#define OMAP4_PM_ABE_TIMER8_WKDEP_OFFSET 0x0080
130#define OMAP4430_PM_ABE_TIMER8_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0080) 187#define OMAP4430_PM_ABE_TIMER8_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0080)
131#define OMAP4_RM_ABE_TIMER8_CONTEXT_OFFSET 0x0084 188#define OMAP4_RM_ABE_TIMER8_CONTEXT_OFFSET 0x0084
132#define OMAP4430_RM_ABE_TIMER8_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0084) 189#define OMAP4430_RM_ABE_TIMER8_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0084)
133#define OMAP4_PM_ABE_WDT3_WKDEP_OFFSET 0x0088 190#define OMAP4_PM_ABE_WDT3_WKDEP_OFFSET 0x0088
134#define OMAP4430_PM_ABE_WDT3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x0088) 191#define OMAP4430_PM_ABE_WDT3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x0088)
135#define OMAP4_RM_ABE_WDT3_CONTEXT_OFFSET 0x008c 192#define OMAP4_RM_ABE_WDT3_CONTEXT_OFFSET 0x008c
136#define OMAP4430_RM_ABE_WDT3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_MOD, 0x008c) 193#define OMAP4430_RM_ABE_WDT3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ABE_INST, 0x008c)
137 194
138/* PRM.ALWAYS_ON_PRM register offsets */ 195/* PRM.ALWAYS_ON_PRM register offsets */
139#define OMAP4_RM_ALWON_MDMINTC_CONTEXT_OFFSET 0x0024 196#define OMAP4_RM_ALWON_MDMINTC_CONTEXT_OFFSET 0x0024
140#define OMAP4430_RM_ALWON_MDMINTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0024) 197#define OMAP4430_RM_ALWON_MDMINTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0024)
141#define OMAP4_PM_ALWON_SR_MPU_WKDEP_OFFSET 0x0028 198#define OMAP4_PM_ALWON_SR_MPU_WKDEP_OFFSET 0x0028
142#define OMAP4430_PM_ALWON_SR_MPU_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0028) 199#define OMAP4430_PM_ALWON_SR_MPU_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0028)
143#define OMAP4_RM_ALWON_SR_MPU_CONTEXT_OFFSET 0x002c 200#define OMAP4_RM_ALWON_SR_MPU_CONTEXT_OFFSET 0x002c
144#define OMAP4430_RM_ALWON_SR_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x002c) 201#define OMAP4430_RM_ALWON_SR_MPU_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x002c)
145#define OMAP4_PM_ALWON_SR_IVA_WKDEP_OFFSET 0x0030 202#define OMAP4_PM_ALWON_SR_IVA_WKDEP_OFFSET 0x0030
146#define OMAP4430_PM_ALWON_SR_IVA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0030) 203#define OMAP4430_PM_ALWON_SR_IVA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0030)
147#define OMAP4_RM_ALWON_SR_IVA_CONTEXT_OFFSET 0x0034 204#define OMAP4_RM_ALWON_SR_IVA_CONTEXT_OFFSET 0x0034
148#define OMAP4430_RM_ALWON_SR_IVA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0034) 205#define OMAP4430_RM_ALWON_SR_IVA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0034)
149#define OMAP4_PM_ALWON_SR_CORE_WKDEP_OFFSET 0x0038 206#define OMAP4_PM_ALWON_SR_CORE_WKDEP_OFFSET 0x0038
150#define OMAP4430_PM_ALWON_SR_CORE_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x0038) 207#define OMAP4430_PM_ALWON_SR_CORE_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x0038)
151#define OMAP4_RM_ALWON_SR_CORE_CONTEXT_OFFSET 0x003c 208#define OMAP4_RM_ALWON_SR_CORE_CONTEXT_OFFSET 0x003c
152#define OMAP4430_RM_ALWON_SR_CORE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_MOD, 0x003c) 209#define OMAP4430_RM_ALWON_SR_CORE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_ALWAYS_ON_INST, 0x003c)
153 210
154/* PRM.CORE_PRM register offsets */ 211/* PRM.CORE_PRM register offsets */
155#define OMAP4_PM_CORE_PWRSTCTRL_OFFSET 0x0000 212#define OMAP4_PM_CORE_PWRSTCTRL_OFFSET 0x0000
156#define OMAP4430_PM_CORE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0000) 213#define OMAP4430_PM_CORE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0000)
157#define OMAP4_PM_CORE_PWRSTST_OFFSET 0x0004 214#define OMAP4_PM_CORE_PWRSTST_OFFSET 0x0004
158#define OMAP4430_PM_CORE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0004) 215#define OMAP4430_PM_CORE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0004)
159#define OMAP4_RM_L3_1_L3_1_CONTEXT_OFFSET 0x0024 216#define OMAP4_RM_L3_1_L3_1_CONTEXT_OFFSET 0x0024
160#define OMAP4430_RM_L3_1_L3_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0024) 217#define OMAP4430_RM_L3_1_L3_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0024)
161#define OMAP4_RM_L3_2_L3_2_CONTEXT_OFFSET 0x0124 218#define OMAP4_RM_L3_2_L3_2_CONTEXT_OFFSET 0x0124
162#define OMAP4430_RM_L3_2_L3_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0124) 219#define OMAP4430_RM_L3_2_L3_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0124)
163#define OMAP4_RM_L3_2_GPMC_CONTEXT_OFFSET 0x012c 220#define OMAP4_RM_L3_2_GPMC_CONTEXT_OFFSET 0x012c
164#define OMAP4430_RM_L3_2_GPMC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x012c) 221#define OMAP4430_RM_L3_2_GPMC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x012c)
165#define OMAP4_RM_L3_2_OCMC_RAM_CONTEXT_OFFSET 0x0134 222#define OMAP4_RM_L3_2_OCMC_RAM_CONTEXT_OFFSET 0x0134
166#define OMAP4430_RM_L3_2_OCMC_RAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0134) 223#define OMAP4430_RM_L3_2_OCMC_RAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0134)
167#define OMAP4_RM_DUCATI_RSTCTRL_OFFSET 0x0210 224#define OMAP4_RM_DUCATI_RSTCTRL_OFFSET 0x0210
168#define OMAP4430_RM_DUCATI_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0210) 225#define OMAP4430_RM_DUCATI_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0210)
169#define OMAP4_RM_DUCATI_RSTST_OFFSET 0x0214 226#define OMAP4_RM_DUCATI_RSTST_OFFSET 0x0214
170#define OMAP4430_RM_DUCATI_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0214) 227#define OMAP4430_RM_DUCATI_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0214)
171#define OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET 0x0224 228#define OMAP4_RM_DUCATI_DUCATI_CONTEXT_OFFSET 0x0224
172#define OMAP4430_RM_DUCATI_DUCATI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0224) 229#define OMAP4430_RM_DUCATI_DUCATI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0224)
173#define OMAP4_RM_SDMA_SDMA_CONTEXT_OFFSET 0x0324 230#define OMAP4_RM_SDMA_SDMA_CONTEXT_OFFSET 0x0324
174#define OMAP4430_RM_SDMA_SDMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0324) 231#define OMAP4430_RM_SDMA_SDMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0324)
175#define OMAP4_RM_MEMIF_DMM_CONTEXT_OFFSET 0x0424 232#define OMAP4_RM_MEMIF_DMM_CONTEXT_OFFSET 0x0424
176#define OMAP4430_RM_MEMIF_DMM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0424) 233#define OMAP4430_RM_MEMIF_DMM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0424)
177#define OMAP4_RM_MEMIF_EMIF_FW_CONTEXT_OFFSET 0x042c 234#define OMAP4_RM_MEMIF_EMIF_FW_CONTEXT_OFFSET 0x042c
178#define OMAP4430_RM_MEMIF_EMIF_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x042c) 235#define OMAP4430_RM_MEMIF_EMIF_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x042c)
179#define OMAP4_RM_MEMIF_EMIF_1_CONTEXT_OFFSET 0x0434 236#define OMAP4_RM_MEMIF_EMIF_1_CONTEXT_OFFSET 0x0434
180#define OMAP4430_RM_MEMIF_EMIF_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0434) 237#define OMAP4430_RM_MEMIF_EMIF_1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0434)
181#define OMAP4_RM_MEMIF_EMIF_2_CONTEXT_OFFSET 0x043c 238#define OMAP4_RM_MEMIF_EMIF_2_CONTEXT_OFFSET 0x043c
182#define OMAP4430_RM_MEMIF_EMIF_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x043c) 239#define OMAP4430_RM_MEMIF_EMIF_2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x043c)
183#define OMAP4_RM_MEMIF_DLL_CONTEXT_OFFSET 0x0444 240#define OMAP4_RM_MEMIF_DLL_CONTEXT_OFFSET 0x0444
184#define OMAP4430_RM_MEMIF_DLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0444) 241#define OMAP4430_RM_MEMIF_DLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0444)
185#define OMAP4_RM_MEMIF_EMIF_H1_CONTEXT_OFFSET 0x0454 242#define OMAP4_RM_MEMIF_EMIF_H1_CONTEXT_OFFSET 0x0454
186#define OMAP4430_RM_MEMIF_EMIF_H1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0454) 243#define OMAP4430_RM_MEMIF_EMIF_H1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0454)
187#define OMAP4_RM_MEMIF_EMIF_H2_CONTEXT_OFFSET 0x045c 244#define OMAP4_RM_MEMIF_EMIF_H2_CONTEXT_OFFSET 0x045c
188#define OMAP4430_RM_MEMIF_EMIF_H2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x045c) 245#define OMAP4430_RM_MEMIF_EMIF_H2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x045c)
189#define OMAP4_RM_MEMIF_DLL_H_CONTEXT_OFFSET 0x0464 246#define OMAP4_RM_MEMIF_DLL_H_CONTEXT_OFFSET 0x0464
190#define OMAP4430_RM_MEMIF_DLL_H_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0464) 247#define OMAP4430_RM_MEMIF_DLL_H_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0464)
191#define OMAP4_RM_D2D_SAD2D_CONTEXT_OFFSET 0x0524 248#define OMAP4_RM_D2D_SAD2D_CONTEXT_OFFSET 0x0524
192#define OMAP4430_RM_D2D_SAD2D_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0524) 249#define OMAP4430_RM_D2D_SAD2D_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0524)
193#define OMAP4_RM_D2D_MODEM_ICR_CONTEXT_OFFSET 0x052c 250#define OMAP4_RM_D2D_INSTEM_ICR_CONTEXT_OFFSET 0x052c
194#define OMAP4430_RM_D2D_MODEM_ICR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x052c) 251#define OMAP4430_RM_D2D_INSTEM_ICR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x052c)
195#define OMAP4_RM_D2D_SAD2D_FW_CONTEXT_OFFSET 0x0534 252#define OMAP4_RM_D2D_SAD2D_FW_CONTEXT_OFFSET 0x0534
196#define OMAP4430_RM_D2D_SAD2D_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0534) 253#define OMAP4430_RM_D2D_SAD2D_FW_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0534)
197#define OMAP4_RM_L4CFG_L4_CFG_CONTEXT_OFFSET 0x0624 254#define OMAP4_RM_L4CFG_L4_CFG_CONTEXT_OFFSET 0x0624
198#define OMAP4430_RM_L4CFG_L4_CFG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0624) 255#define OMAP4430_RM_L4CFG_L4_CFG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0624)
199#define OMAP4_RM_L4CFG_HW_SEM_CONTEXT_OFFSET 0x062c 256#define OMAP4_RM_L4CFG_HW_SEM_CONTEXT_OFFSET 0x062c
200#define OMAP4430_RM_L4CFG_HW_SEM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x062c) 257#define OMAP4430_RM_L4CFG_HW_SEM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x062c)
201#define OMAP4_RM_L4CFG_MAILBOX_CONTEXT_OFFSET 0x0634 258#define OMAP4_RM_L4CFG_MAILBOX_CONTEXT_OFFSET 0x0634
202#define OMAP4430_RM_L4CFG_MAILBOX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0634) 259#define OMAP4430_RM_L4CFG_MAILBOX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0634)
203#define OMAP4_RM_L4CFG_SAR_ROM_CONTEXT_OFFSET 0x063c 260#define OMAP4_RM_L4CFG_SAR_ROM_CONTEXT_OFFSET 0x063c
204#define OMAP4430_RM_L4CFG_SAR_ROM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x063c) 261#define OMAP4430_RM_L4CFG_SAR_ROM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x063c)
205#define OMAP4_RM_L3INSTR_L3_3_CONTEXT_OFFSET 0x0724 262#define OMAP4_RM_L3INSTR_L3_3_CONTEXT_OFFSET 0x0724
206#define OMAP4430_RM_L3INSTR_L3_3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0724) 263#define OMAP4430_RM_L3INSTR_L3_3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0724)
207#define OMAP4_RM_L3INSTR_L3_INSTR_CONTEXT_OFFSET 0x072c 264#define OMAP4_RM_L3INSTR_L3_INSTR_CONTEXT_OFFSET 0x072c
208#define OMAP4430_RM_L3INSTR_L3_INSTR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x072c) 265#define OMAP4430_RM_L3INSTR_L3_INSTR_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x072c)
209#define OMAP4_RM_L3INSTR_OCP_WP1_CONTEXT_OFFSET 0x0744 266#define OMAP4_RM_L3INSTR_OCP_WP1_CONTEXT_OFFSET 0x0744
210#define OMAP4430_RM_L3INSTR_OCP_WP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_MOD, 0x0744) 267#define OMAP4430_RM_L3INSTR_OCP_WP1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CORE_INST, 0x0744)
211 268
212/* PRM.IVAHD_PRM register offsets */ 269/* PRM.IVAHD_PRM register offsets */
213#define OMAP4_PM_IVAHD_PWRSTCTRL_OFFSET 0x0000 270#define OMAP4_PM_IVAHD_PWRSTCTRL_OFFSET 0x0000
214#define OMAP4430_PM_IVAHD_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0000) 271#define OMAP4430_PM_IVAHD_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0000)
215#define OMAP4_PM_IVAHD_PWRSTST_OFFSET 0x0004 272#define OMAP4_PM_IVAHD_PWRSTST_OFFSET 0x0004
216#define OMAP4430_PM_IVAHD_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0004) 273#define OMAP4430_PM_IVAHD_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0004)
217#define OMAP4_RM_IVAHD_RSTCTRL_OFFSET 0x0010 274#define OMAP4_RM_IVAHD_RSTCTRL_OFFSET 0x0010
218#define OMAP4430_RM_IVAHD_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0010) 275#define OMAP4430_RM_IVAHD_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0010)
219#define OMAP4_RM_IVAHD_RSTST_OFFSET 0x0014 276#define OMAP4_RM_IVAHD_RSTST_OFFSET 0x0014
220#define OMAP4430_RM_IVAHD_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0014) 277#define OMAP4430_RM_IVAHD_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0014)
221#define OMAP4_RM_IVAHD_IVAHD_CONTEXT_OFFSET 0x0024 278#define OMAP4_RM_IVAHD_IVAHD_CONTEXT_OFFSET 0x0024
222#define OMAP4430_RM_IVAHD_IVAHD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x0024) 279#define OMAP4430_RM_IVAHD_IVAHD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x0024)
223#define OMAP4_RM_IVAHD_SL2_CONTEXT_OFFSET 0x002c 280#define OMAP4_RM_IVAHD_SL2_CONTEXT_OFFSET 0x002c
224#define OMAP4430_RM_IVAHD_SL2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_MOD, 0x002c) 281#define OMAP4430_RM_IVAHD_SL2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_IVAHD_INST, 0x002c)
225 282
226/* PRM.CAM_PRM register offsets */ 283/* PRM.CAM_PRM register offsets */
227#define OMAP4_PM_CAM_PWRSTCTRL_OFFSET 0x0000 284#define OMAP4_PM_CAM_PWRSTCTRL_OFFSET 0x0000
228#define OMAP4430_PM_CAM_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x0000) 285#define OMAP4430_PM_CAM_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x0000)
229#define OMAP4_PM_CAM_PWRSTST_OFFSET 0x0004 286#define OMAP4_PM_CAM_PWRSTST_OFFSET 0x0004
230#define OMAP4430_PM_CAM_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x0004) 287#define OMAP4430_PM_CAM_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x0004)
231#define OMAP4_RM_CAM_ISS_CONTEXT_OFFSET 0x0024 288#define OMAP4_RM_CAM_ISS_CONTEXT_OFFSET 0x0024
232#define OMAP4430_RM_CAM_ISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x0024) 289#define OMAP4430_RM_CAM_ISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x0024)
233#define OMAP4_RM_CAM_FDIF_CONTEXT_OFFSET 0x002c 290#define OMAP4_RM_CAM_FDIF_CONTEXT_OFFSET 0x002c
234#define OMAP4430_RM_CAM_FDIF_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_MOD, 0x002c) 291#define OMAP4430_RM_CAM_FDIF_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CAM_INST, 0x002c)
235 292
236/* PRM.DSS_PRM register offsets */ 293/* PRM.DSS_PRM register offsets */
237#define OMAP4_PM_DSS_PWRSTCTRL_OFFSET 0x0000 294#define OMAP4_PM_DSS_PWRSTCTRL_OFFSET 0x0000
238#define OMAP4430_PM_DSS_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0000) 295#define OMAP4430_PM_DSS_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0000)
239#define OMAP4_PM_DSS_PWRSTST_OFFSET 0x0004 296#define OMAP4_PM_DSS_PWRSTST_OFFSET 0x0004
240#define OMAP4430_PM_DSS_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0004) 297#define OMAP4430_PM_DSS_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0004)
241#define OMAP4_PM_DSS_DSS_WKDEP_OFFSET 0x0020 298#define OMAP4_PM_DSS_DSS_WKDEP_OFFSET 0x0020
242#define OMAP4430_PM_DSS_DSS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0020) 299#define OMAP4430_PM_DSS_DSS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0020)
243#define OMAP4_RM_DSS_DSS_CONTEXT_OFFSET 0x0024 300#define OMAP4_RM_DSS_DSS_CONTEXT_OFFSET 0x0024
244#define OMAP4430_RM_DSS_DSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x0024) 301#define OMAP4430_RM_DSS_DSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x0024)
245#define OMAP4_RM_DSS_DEISS_CONTEXT_OFFSET 0x002c 302#define OMAP4_RM_DSS_DEISS_CONTEXT_OFFSET 0x002c
246#define OMAP4430_RM_DSS_DEISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_MOD, 0x002c) 303#define OMAP4430_RM_DSS_DEISS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DSS_INST, 0x002c)
247 304
248/* PRM.GFX_PRM register offsets */ 305/* PRM.GFX_PRM register offsets */
249#define OMAP4_PM_GFX_PWRSTCTRL_OFFSET 0x0000 306#define OMAP4_PM_GFX_PWRSTCTRL_OFFSET 0x0000
250#define OMAP4430_PM_GFX_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_MOD, 0x0000) 307#define OMAP4430_PM_GFX_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_INST, 0x0000)
251#define OMAP4_PM_GFX_PWRSTST_OFFSET 0x0004 308#define OMAP4_PM_GFX_PWRSTST_OFFSET 0x0004
252#define OMAP4430_PM_GFX_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_MOD, 0x0004) 309#define OMAP4430_PM_GFX_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_INST, 0x0004)
253#define OMAP4_RM_GFX_GFX_CONTEXT_OFFSET 0x0024 310#define OMAP4_RM_GFX_GFX_CONTEXT_OFFSET 0x0024
254#define OMAP4430_RM_GFX_GFX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_MOD, 0x0024) 311#define OMAP4430_RM_GFX_GFX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_GFX_INST, 0x0024)
255 312
256/* PRM.L3INIT_PRM register offsets */ 313/* PRM.L3INIT_PRM register offsets */
257#define OMAP4_PM_L3INIT_PWRSTCTRL_OFFSET 0x0000 314#define OMAP4_PM_L3INIT_PWRSTCTRL_OFFSET 0x0000
258#define OMAP4430_PM_L3INIT_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0000) 315#define OMAP4430_PM_L3INIT_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0000)
259#define OMAP4_PM_L3INIT_PWRSTST_OFFSET 0x0004 316#define OMAP4_PM_L3INIT_PWRSTST_OFFSET 0x0004
260#define OMAP4430_PM_L3INIT_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0004) 317#define OMAP4430_PM_L3INIT_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0004)
261#define OMAP4_PM_L3INIT_MMC1_WKDEP_OFFSET 0x0028 318#define OMAP4_PM_L3INIT_MMC1_WKDEP_OFFSET 0x0028
262#define OMAP4430_PM_L3INIT_MMC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0028) 319#define OMAP4430_PM_L3INIT_MMC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0028)
263#define OMAP4_RM_L3INIT_MMC1_CONTEXT_OFFSET 0x002c 320#define OMAP4_RM_L3INIT_MMC1_CONTEXT_OFFSET 0x002c
264#define OMAP4430_RM_L3INIT_MMC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x002c) 321#define OMAP4430_RM_L3INIT_MMC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x002c)
265#define OMAP4_PM_L3INIT_MMC2_WKDEP_OFFSET 0x0030 322#define OMAP4_PM_L3INIT_MMC2_WKDEP_OFFSET 0x0030
266#define OMAP4430_PM_L3INIT_MMC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0030) 323#define OMAP4430_PM_L3INIT_MMC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0030)
267#define OMAP4_RM_L3INIT_MMC2_CONTEXT_OFFSET 0x0034 324#define OMAP4_RM_L3INIT_MMC2_CONTEXT_OFFSET 0x0034
268#define OMAP4430_RM_L3INIT_MMC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0034) 325#define OMAP4430_RM_L3INIT_MMC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0034)
269#define OMAP4_PM_L3INIT_HSI_WKDEP_OFFSET 0x0038 326#define OMAP4_PM_L3INIT_HSI_WKDEP_OFFSET 0x0038
270#define OMAP4430_PM_L3INIT_HSI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0038) 327#define OMAP4430_PM_L3INIT_HSI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0038)
271#define OMAP4_RM_L3INIT_HSI_CONTEXT_OFFSET 0x003c 328#define OMAP4_RM_L3INIT_HSI_CONTEXT_OFFSET 0x003c
272#define OMAP4430_RM_L3INIT_HSI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x003c) 329#define OMAP4430_RM_L3INIT_HSI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x003c)
273#define OMAP4_PM_L3INIT_UNIPRO1_WKDEP_OFFSET 0x0040 330#define OMAP4_PM_L3INIT_UNIPRO1_WKDEP_OFFSET 0x0040
274#define OMAP4430_PM_L3INIT_UNIPRO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0040) 331#define OMAP4430_PM_L3INIT_UNIPRO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0040)
275#define OMAP4_RM_L3INIT_UNIPRO1_CONTEXT_OFFSET 0x0044 332#define OMAP4_RM_L3INIT_UNIPRO1_CONTEXT_OFFSET 0x0044
276#define OMAP4430_RM_L3INIT_UNIPRO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0044) 333#define OMAP4430_RM_L3INIT_UNIPRO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0044)
277#define OMAP4_PM_L3INIT_USB_HOST_WKDEP_OFFSET 0x0058 334#define OMAP4_PM_L3INIT_USB_HOST_WKDEP_OFFSET 0x0058
278#define OMAP4430_PM_L3INIT_USB_HOST_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0058) 335#define OMAP4430_PM_L3INIT_USB_HOST_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0058)
279#define OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET 0x005c 336#define OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET 0x005c
280#define OMAP4430_RM_L3INIT_USB_HOST_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x005c) 337#define OMAP4430_RM_L3INIT_USB_HOST_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x005c)
281#define OMAP4_PM_L3INIT_USB_OTG_WKDEP_OFFSET 0x0060 338#define OMAP4_PM_L3INIT_USB_OTG_WKDEP_OFFSET 0x0060
282#define OMAP4430_PM_L3INIT_USB_OTG_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0060) 339#define OMAP4430_PM_L3INIT_USB_OTG_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0060)
283#define OMAP4_RM_L3INIT_USB_OTG_CONTEXT_OFFSET 0x0064 340#define OMAP4_RM_L3INIT_USB_OTG_CONTEXT_OFFSET 0x0064
284#define OMAP4430_RM_L3INIT_USB_OTG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0064) 341#define OMAP4430_RM_L3INIT_USB_OTG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0064)
285#define OMAP4_PM_L3INIT_USB_TLL_WKDEP_OFFSET 0x0068 342#define OMAP4_PM_L3INIT_USB_TLL_WKDEP_OFFSET 0x0068
286#define OMAP4430_PM_L3INIT_USB_TLL_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0068) 343#define OMAP4430_PM_L3INIT_USB_TLL_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0068)
287#define OMAP4_RM_L3INIT_USB_TLL_CONTEXT_OFFSET 0x006c 344#define OMAP4_RM_L3INIT_USB_TLL_CONTEXT_OFFSET 0x006c
288#define OMAP4430_RM_L3INIT_USB_TLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x006c) 345#define OMAP4430_RM_L3INIT_USB_TLL_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x006c)
289#define OMAP4_RM_L3INIT_P1500_CONTEXT_OFFSET 0x007c 346#define OMAP4_RM_L3INIT_P1500_CONTEXT_OFFSET 0x007c
290#define OMAP4430_RM_L3INIT_P1500_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x007c) 347#define OMAP4430_RM_L3INIT_P1500_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x007c)
291#define OMAP4_RM_L3INIT_EMAC_CONTEXT_OFFSET 0x0084 348#define OMAP4_RM_L3INIT_EMAC_CONTEXT_OFFSET 0x0084
292#define OMAP4430_RM_L3INIT_EMAC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0084) 349#define OMAP4430_RM_L3INIT_EMAC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0084)
293#define OMAP4_PM_L3INIT_SATA_WKDEP_OFFSET 0x0088 350#define OMAP4_PM_L3INIT_SATA_WKDEP_OFFSET 0x0088
294#define OMAP4430_PM_L3INIT_SATA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0088) 351#define OMAP4430_PM_L3INIT_SATA_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0088)
295#define OMAP4_RM_L3INIT_SATA_CONTEXT_OFFSET 0x008c 352#define OMAP4_RM_L3INIT_SATA_CONTEXT_OFFSET 0x008c
296#define OMAP4430_RM_L3INIT_SATA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x008c) 353#define OMAP4430_RM_L3INIT_SATA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x008c)
297#define OMAP4_RM_L3INIT_TPPSS_CONTEXT_OFFSET 0x0094 354#define OMAP4_RM_L3INIT_TPPSS_CONTEXT_OFFSET 0x0094
298#define OMAP4430_RM_L3INIT_TPPSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0094) 355#define OMAP4430_RM_L3INIT_TPPSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0094)
299#define OMAP4_PM_L3INIT_PCIESS_WKDEP_OFFSET 0x0098 356#define OMAP4_PM_L3INIT_PCIESS_WKDEP_OFFSET 0x0098
300#define OMAP4430_PM_L3INIT_PCIESS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x0098) 357#define OMAP4430_PM_L3INIT_PCIESS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x0098)
301#define OMAP4_RM_L3INIT_PCIESS_CONTEXT_OFFSET 0x009c 358#define OMAP4_RM_L3INIT_PCIESS_CONTEXT_OFFSET 0x009c
302#define OMAP4430_RM_L3INIT_PCIESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x009c) 359#define OMAP4430_RM_L3INIT_PCIESS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x009c)
303#define OMAP4_RM_L3INIT_CCPTX_CONTEXT_OFFSET 0x00ac 360#define OMAP4_RM_L3INIT_CCPTX_CONTEXT_OFFSET 0x00ac
304#define OMAP4430_RM_L3INIT_CCPTX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00ac) 361#define OMAP4430_RM_L3INIT_CCPTX_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00ac)
305#define OMAP4_PM_L3INIT_XHPI_WKDEP_OFFSET 0x00c0 362#define OMAP4_PM_L3INIT_XHPI_WKDEP_OFFSET 0x00c0
306#define OMAP4430_PM_L3INIT_XHPI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00c0) 363#define OMAP4430_PM_L3INIT_XHPI_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00c0)
307#define OMAP4_RM_L3INIT_XHPI_CONTEXT_OFFSET 0x00c4 364#define OMAP4_RM_L3INIT_XHPI_CONTEXT_OFFSET 0x00c4
308#define OMAP4430_RM_L3INIT_XHPI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00c4) 365#define OMAP4430_RM_L3INIT_XHPI_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00c4)
309#define OMAP4_PM_L3INIT_MMC6_WKDEP_OFFSET 0x00c8 366#define OMAP4_PM_L3INIT_MMC6_WKDEP_OFFSET 0x00c8
310#define OMAP4430_PM_L3INIT_MMC6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00c8) 367#define OMAP4430_PM_L3INIT_MMC6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00c8)
311#define OMAP4_RM_L3INIT_MMC6_CONTEXT_OFFSET 0x00cc 368#define OMAP4_RM_L3INIT_MMC6_CONTEXT_OFFSET 0x00cc
312#define OMAP4430_RM_L3INIT_MMC6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00cc) 369#define OMAP4430_RM_L3INIT_MMC6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00cc)
313#define OMAP4_PM_L3INIT_USB_HOST_FS_WKDEP_OFFSET 0x00d0 370#define OMAP4_PM_L3INIT_USB_HOST_FS_WKDEP_OFFSET 0x00d0
314#define OMAP4430_PM_L3INIT_USB_HOST_FS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00d0) 371#define OMAP4430_PM_L3INIT_USB_HOST_FS_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00d0)
315#define OMAP4_RM_L3INIT_USB_HOST_FS_CONTEXT_OFFSET 0x00d4 372#define OMAP4_RM_L3INIT_USB_HOST_FS_CONTEXT_OFFSET 0x00d4
316#define OMAP4430_RM_L3INIT_USB_HOST_FS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00d4) 373#define OMAP4430_RM_L3INIT_USB_HOST_FS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00d4)
317#define OMAP4_RM_L3INIT_USBPHYOCP2SCP_CONTEXT_OFFSET 0x00e4 374#define OMAP4_RM_L3INIT_USBPHYOCP2SCP_CONTEXT_OFFSET 0x00e4
318#define OMAP4430_RM_L3INIT_USBPHYOCP2SCP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_MOD, 0x00e4) 375#define OMAP4430_RM_L3INIT_USBPHYOCP2SCP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L3INIT_INST, 0x00e4)
319 376
320/* PRM.L4PER_PRM register offsets */ 377/* PRM.L4PER_PRM register offsets */
321#define OMAP4_PM_L4PER_PWRSTCTRL_OFFSET 0x0000 378#define OMAP4_PM_L4PER_PWRSTCTRL_OFFSET 0x0000
322#define OMAP4430_PM_L4PER_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0000) 379#define OMAP4430_PM_L4PER_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0000)
323#define OMAP4_PM_L4PER_PWRSTST_OFFSET 0x0004 380#define OMAP4_PM_L4PER_PWRSTST_OFFSET 0x0004
324#define OMAP4430_PM_L4PER_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0004) 381#define OMAP4430_PM_L4PER_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0004)
325#define OMAP4_RM_L4PER_ADC_CONTEXT_OFFSET 0x0024 382#define OMAP4_RM_L4PER_ADC_CONTEXT_OFFSET 0x0024
326#define OMAP4430_RM_L4PER_ADC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0024) 383#define OMAP4430_RM_L4PER_ADC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0024)
327#define OMAP4_PM_L4PER_DMTIMER10_WKDEP_OFFSET 0x0028 384#define OMAP4_PM_L4PER_DMTIMER10_WKDEP_OFFSET 0x0028
328#define OMAP4430_PM_L4PER_DMTIMER10_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0028) 385#define OMAP4430_PM_L4PER_DMTIMER10_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0028)
329#define OMAP4_RM_L4PER_DMTIMER10_CONTEXT_OFFSET 0x002c 386#define OMAP4_RM_L4PER_DMTIMER10_CONTEXT_OFFSET 0x002c
330#define OMAP4430_RM_L4PER_DMTIMER10_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x002c) 387#define OMAP4430_RM_L4PER_DMTIMER10_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x002c)
331#define OMAP4_PM_L4PER_DMTIMER11_WKDEP_OFFSET 0x0030 388#define OMAP4_PM_L4PER_DMTIMER11_WKDEP_OFFSET 0x0030
332#define OMAP4430_PM_L4PER_DMTIMER11_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0030) 389#define OMAP4430_PM_L4PER_DMTIMER11_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0030)
333#define OMAP4_RM_L4PER_DMTIMER11_CONTEXT_OFFSET 0x0034 390#define OMAP4_RM_L4PER_DMTIMER11_CONTEXT_OFFSET 0x0034
334#define OMAP4430_RM_L4PER_DMTIMER11_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0034) 391#define OMAP4430_RM_L4PER_DMTIMER11_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0034)
335#define OMAP4_PM_L4PER_DMTIMER2_WKDEP_OFFSET 0x0038 392#define OMAP4_PM_L4PER_DMTIMER2_WKDEP_OFFSET 0x0038
336#define OMAP4430_PM_L4PER_DMTIMER2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0038) 393#define OMAP4430_PM_L4PER_DMTIMER2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0038)
337#define OMAP4_RM_L4PER_DMTIMER2_CONTEXT_OFFSET 0x003c 394#define OMAP4_RM_L4PER_DMTIMER2_CONTEXT_OFFSET 0x003c
338#define OMAP4430_RM_L4PER_DMTIMER2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x003c) 395#define OMAP4430_RM_L4PER_DMTIMER2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x003c)
339#define OMAP4_PM_L4PER_DMTIMER3_WKDEP_OFFSET 0x0040 396#define OMAP4_PM_L4PER_DMTIMER3_WKDEP_OFFSET 0x0040
340#define OMAP4430_PM_L4PER_DMTIMER3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0040) 397#define OMAP4430_PM_L4PER_DMTIMER3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0040)
341#define OMAP4_RM_L4PER_DMTIMER3_CONTEXT_OFFSET 0x0044 398#define OMAP4_RM_L4PER_DMTIMER3_CONTEXT_OFFSET 0x0044
342#define OMAP4430_RM_L4PER_DMTIMER3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0044) 399#define OMAP4430_RM_L4PER_DMTIMER3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0044)
343#define OMAP4_PM_L4PER_DMTIMER4_WKDEP_OFFSET 0x0048 400#define OMAP4_PM_L4PER_DMTIMER4_WKDEP_OFFSET 0x0048
344#define OMAP4430_PM_L4PER_DMTIMER4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0048) 401#define OMAP4430_PM_L4PER_DMTIMER4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0048)
345#define OMAP4_RM_L4PER_DMTIMER4_CONTEXT_OFFSET 0x004c 402#define OMAP4_RM_L4PER_DMTIMER4_CONTEXT_OFFSET 0x004c
346#define OMAP4430_RM_L4PER_DMTIMER4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x004c) 403#define OMAP4430_RM_L4PER_DMTIMER4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x004c)
347#define OMAP4_PM_L4PER_DMTIMER9_WKDEP_OFFSET 0x0050 404#define OMAP4_PM_L4PER_DMTIMER9_WKDEP_OFFSET 0x0050
348#define OMAP4430_PM_L4PER_DMTIMER9_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0050) 405#define OMAP4430_PM_L4PER_DMTIMER9_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0050)
349#define OMAP4_RM_L4PER_DMTIMER9_CONTEXT_OFFSET 0x0054 406#define OMAP4_RM_L4PER_DMTIMER9_CONTEXT_OFFSET 0x0054
350#define OMAP4430_RM_L4PER_DMTIMER9_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0054) 407#define OMAP4430_RM_L4PER_DMTIMER9_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0054)
351#define OMAP4_RM_L4PER_ELM_CONTEXT_OFFSET 0x005c 408#define OMAP4_RM_L4PER_ELM_CONTEXT_OFFSET 0x005c
352#define OMAP4430_RM_L4PER_ELM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x005c) 409#define OMAP4430_RM_L4PER_ELM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x005c)
353#define OMAP4_PM_L4PER_GPIO2_WKDEP_OFFSET 0x0060 410#define OMAP4_PM_L4PER_GPIO2_WKDEP_OFFSET 0x0060
354#define OMAP4430_PM_L4PER_GPIO2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0060) 411#define OMAP4430_PM_L4PER_GPIO2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0060)
355#define OMAP4_RM_L4PER_GPIO2_CONTEXT_OFFSET 0x0064 412#define OMAP4_RM_L4PER_GPIO2_CONTEXT_OFFSET 0x0064
356#define OMAP4430_RM_L4PER_GPIO2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0064) 413#define OMAP4430_RM_L4PER_GPIO2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0064)
357#define OMAP4_PM_L4PER_GPIO3_WKDEP_OFFSET 0x0068 414#define OMAP4_PM_L4PER_GPIO3_WKDEP_OFFSET 0x0068
358#define OMAP4430_PM_L4PER_GPIO3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0068) 415#define OMAP4430_PM_L4PER_GPIO3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0068)
359#define OMAP4_RM_L4PER_GPIO3_CONTEXT_OFFSET 0x006c 416#define OMAP4_RM_L4PER_GPIO3_CONTEXT_OFFSET 0x006c
360#define OMAP4430_RM_L4PER_GPIO3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x006c) 417#define OMAP4430_RM_L4PER_GPIO3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x006c)
361#define OMAP4_PM_L4PER_GPIO4_WKDEP_OFFSET 0x0070 418#define OMAP4_PM_L4PER_GPIO4_WKDEP_OFFSET 0x0070
362#define OMAP4430_PM_L4PER_GPIO4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0070) 419#define OMAP4430_PM_L4PER_GPIO4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0070)
363#define OMAP4_RM_L4PER_GPIO4_CONTEXT_OFFSET 0x0074 420#define OMAP4_RM_L4PER_GPIO4_CONTEXT_OFFSET 0x0074
364#define OMAP4430_RM_L4PER_GPIO4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0074) 421#define OMAP4430_RM_L4PER_GPIO4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0074)
365#define OMAP4_PM_L4PER_GPIO5_WKDEP_OFFSET 0x0078 422#define OMAP4_PM_L4PER_GPIO5_WKDEP_OFFSET 0x0078
366#define OMAP4430_PM_L4PER_GPIO5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0078) 423#define OMAP4430_PM_L4PER_GPIO5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0078)
367#define OMAP4_RM_L4PER_GPIO5_CONTEXT_OFFSET 0x007c 424#define OMAP4_RM_L4PER_GPIO5_CONTEXT_OFFSET 0x007c
368#define OMAP4430_RM_L4PER_GPIO5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x007c) 425#define OMAP4430_RM_L4PER_GPIO5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x007c)
369#define OMAP4_PM_L4PER_GPIO6_WKDEP_OFFSET 0x0080 426#define OMAP4_PM_L4PER_GPIO6_WKDEP_OFFSET 0x0080
370#define OMAP4430_PM_L4PER_GPIO6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0080) 427#define OMAP4430_PM_L4PER_GPIO6_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0080)
371#define OMAP4_RM_L4PER_GPIO6_CONTEXT_OFFSET 0x0084 428#define OMAP4_RM_L4PER_GPIO6_CONTEXT_OFFSET 0x0084
372#define OMAP4430_RM_L4PER_GPIO6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0084) 429#define OMAP4430_RM_L4PER_GPIO6_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0084)
373#define OMAP4_RM_L4PER_HDQ1W_CONTEXT_OFFSET 0x008c 430#define OMAP4_RM_L4PER_HDQ1W_CONTEXT_OFFSET 0x008c
374#define OMAP4430_RM_L4PER_HDQ1W_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x008c) 431#define OMAP4430_RM_L4PER_HDQ1W_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x008c)
375#define OMAP4_PM_L4PER_HECC1_WKDEP_OFFSET 0x0090 432#define OMAP4_PM_L4PER_HECC1_WKDEP_OFFSET 0x0090
376#define OMAP4430_PM_L4PER_HECC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0090) 433#define OMAP4430_PM_L4PER_HECC1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0090)
377#define OMAP4_RM_L4PER_HECC1_CONTEXT_OFFSET 0x0094 434#define OMAP4_RM_L4PER_HECC1_CONTEXT_OFFSET 0x0094
378#define OMAP4430_RM_L4PER_HECC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0094) 435#define OMAP4430_RM_L4PER_HECC1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0094)
379#define OMAP4_PM_L4PER_HECC2_WKDEP_OFFSET 0x0098 436#define OMAP4_PM_L4PER_HECC2_WKDEP_OFFSET 0x0098
380#define OMAP4430_PM_L4PER_HECC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0098) 437#define OMAP4430_PM_L4PER_HECC2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0098)
381#define OMAP4_RM_L4PER_HECC2_CONTEXT_OFFSET 0x009c 438#define OMAP4_RM_L4PER_HECC2_CONTEXT_OFFSET 0x009c
382#define OMAP4430_RM_L4PER_HECC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x009c) 439#define OMAP4430_RM_L4PER_HECC2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x009c)
383#define OMAP4_PM_L4PER_I2C1_WKDEP_OFFSET 0x00a0 440#define OMAP4_PM_L4PER_I2C1_WKDEP_OFFSET 0x00a0
384#define OMAP4430_PM_L4PER_I2C1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00a0) 441#define OMAP4430_PM_L4PER_I2C1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00a0)
385#define OMAP4_RM_L4PER_I2C1_CONTEXT_OFFSET 0x00a4 442#define OMAP4_RM_L4PER_I2C1_CONTEXT_OFFSET 0x00a4
386#define OMAP4430_RM_L4PER_I2C1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00a4) 443#define OMAP4430_RM_L4PER_I2C1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00a4)
387#define OMAP4_PM_L4PER_I2C2_WKDEP_OFFSET 0x00a8 444#define OMAP4_PM_L4PER_I2C2_WKDEP_OFFSET 0x00a8
388#define OMAP4430_PM_L4PER_I2C2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00a8) 445#define OMAP4430_PM_L4PER_I2C2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00a8)
389#define OMAP4_RM_L4PER_I2C2_CONTEXT_OFFSET 0x00ac 446#define OMAP4_RM_L4PER_I2C2_CONTEXT_OFFSET 0x00ac
390#define OMAP4430_RM_L4PER_I2C2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00ac) 447#define OMAP4430_RM_L4PER_I2C2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00ac)
391#define OMAP4_PM_L4PER_I2C3_WKDEP_OFFSET 0x00b0 448#define OMAP4_PM_L4PER_I2C3_WKDEP_OFFSET 0x00b0
392#define OMAP4430_PM_L4PER_I2C3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00b0) 449#define OMAP4430_PM_L4PER_I2C3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00b0)
393#define OMAP4_RM_L4PER_I2C3_CONTEXT_OFFSET 0x00b4 450#define OMAP4_RM_L4PER_I2C3_CONTEXT_OFFSET 0x00b4
394#define OMAP4430_RM_L4PER_I2C3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00b4) 451#define OMAP4430_RM_L4PER_I2C3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00b4)
395#define OMAP4_PM_L4PER_I2C4_WKDEP_OFFSET 0x00b8 452#define OMAP4_PM_L4PER_I2C4_WKDEP_OFFSET 0x00b8
396#define OMAP4430_PM_L4PER_I2C4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00b8) 453#define OMAP4430_PM_L4PER_I2C4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00b8)
397#define OMAP4_RM_L4PER_I2C4_CONTEXT_OFFSET 0x00bc 454#define OMAP4_RM_L4PER_I2C4_CONTEXT_OFFSET 0x00bc
398#define OMAP4430_RM_L4PER_I2C4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00bc) 455#define OMAP4430_RM_L4PER_I2C4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00bc)
399#define OMAP4_RM_L4PER_L4_PER_CONTEXT_OFFSET 0x00c0 456#define OMAP4_RM_L4PER_L4_PER_CONTEXT_OFFSET 0x00c0
400#define OMAP4430_RM_L4PER_L4_PER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00c0) 457#define OMAP4430_RM_L4PER_L4_PER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00c0)
401#define OMAP4_PM_L4PER_MCASP2_WKDEP_OFFSET 0x00d0 458#define OMAP4_PM_L4PER_MCASP2_WKDEP_OFFSET 0x00d0
402#define OMAP4430_PM_L4PER_MCASP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00d0) 459#define OMAP4430_PM_L4PER_MCASP2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00d0)
403#define OMAP4_RM_L4PER_MCASP2_CONTEXT_OFFSET 0x00d4 460#define OMAP4_RM_L4PER_MCASP2_CONTEXT_OFFSET 0x00d4
404#define OMAP4430_RM_L4PER_MCASP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00d4) 461#define OMAP4430_RM_L4PER_MCASP2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00d4)
405#define OMAP4_PM_L4PER_MCASP3_WKDEP_OFFSET 0x00d8 462#define OMAP4_PM_L4PER_MCASP3_WKDEP_OFFSET 0x00d8
406#define OMAP4430_PM_L4PER_MCASP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00d8) 463#define OMAP4430_PM_L4PER_MCASP3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00d8)
407#define OMAP4_RM_L4PER_MCASP3_CONTEXT_OFFSET 0x00dc 464#define OMAP4_RM_L4PER_MCASP3_CONTEXT_OFFSET 0x00dc
408#define OMAP4430_RM_L4PER_MCASP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00dc) 465#define OMAP4430_RM_L4PER_MCASP3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00dc)
409#define OMAP4_PM_L4PER_MCBSP4_WKDEP_OFFSET 0x00e0 466#define OMAP4_PM_L4PER_MCBSP4_WKDEP_OFFSET 0x00e0
410#define OMAP4430_PM_L4PER_MCBSP4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00e0) 467#define OMAP4430_PM_L4PER_MCBSP4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00e0)
411#define OMAP4_RM_L4PER_MCBSP4_CONTEXT_OFFSET 0x00e4 468#define OMAP4_RM_L4PER_MCBSP4_CONTEXT_OFFSET 0x00e4
412#define OMAP4430_RM_L4PER_MCBSP4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00e4) 469#define OMAP4430_RM_L4PER_MCBSP4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00e4)
413#define OMAP4_RM_L4PER_MGATE_CONTEXT_OFFSET 0x00ec 470#define OMAP4_RM_L4PER_MGATE_CONTEXT_OFFSET 0x00ec
414#define OMAP4430_RM_L4PER_MGATE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00ec) 471#define OMAP4430_RM_L4PER_MGATE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00ec)
415#define OMAP4_PM_L4PER_MCSPI1_WKDEP_OFFSET 0x00f0 472#define OMAP4_PM_L4PER_MCSPI1_WKDEP_OFFSET 0x00f0
416#define OMAP4430_PM_L4PER_MCSPI1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00f0) 473#define OMAP4430_PM_L4PER_MCSPI1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00f0)
417#define OMAP4_RM_L4PER_MCSPI1_CONTEXT_OFFSET 0x00f4 474#define OMAP4_RM_L4PER_MCSPI1_CONTEXT_OFFSET 0x00f4
418#define OMAP4430_RM_L4PER_MCSPI1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00f4) 475#define OMAP4430_RM_L4PER_MCSPI1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00f4)
419#define OMAP4_PM_L4PER_MCSPI2_WKDEP_OFFSET 0x00f8 476#define OMAP4_PM_L4PER_MCSPI2_WKDEP_OFFSET 0x00f8
420#define OMAP4430_PM_L4PER_MCSPI2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00f8) 477#define OMAP4430_PM_L4PER_MCSPI2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00f8)
421#define OMAP4_RM_L4PER_MCSPI2_CONTEXT_OFFSET 0x00fc 478#define OMAP4_RM_L4PER_MCSPI2_CONTEXT_OFFSET 0x00fc
422#define OMAP4430_RM_L4PER_MCSPI2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x00fc) 479#define OMAP4430_RM_L4PER_MCSPI2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x00fc)
423#define OMAP4_PM_L4PER_MCSPI3_WKDEP_OFFSET 0x0100 480#define OMAP4_PM_L4PER_MCSPI3_WKDEP_OFFSET 0x0100
424#define OMAP4430_PM_L4PER_MCSPI3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0100) 481#define OMAP4430_PM_L4PER_MCSPI3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0100)
425#define OMAP4_RM_L4PER_MCSPI3_CONTEXT_OFFSET 0x0104 482#define OMAP4_RM_L4PER_MCSPI3_CONTEXT_OFFSET 0x0104
426#define OMAP4430_RM_L4PER_MCSPI3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0104) 483#define OMAP4430_RM_L4PER_MCSPI3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0104)
427#define OMAP4_PM_L4PER_MCSPI4_WKDEP_OFFSET 0x0108 484#define OMAP4_PM_L4PER_MCSPI4_WKDEP_OFFSET 0x0108
428#define OMAP4430_PM_L4PER_MCSPI4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0108) 485#define OMAP4430_PM_L4PER_MCSPI4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0108)
429#define OMAP4_RM_L4PER_MCSPI4_CONTEXT_OFFSET 0x010c 486#define OMAP4_RM_L4PER_MCSPI4_CONTEXT_OFFSET 0x010c
430#define OMAP4430_RM_L4PER_MCSPI4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x010c) 487#define OMAP4430_RM_L4PER_MCSPI4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x010c)
431#define OMAP4_PM_L4PER_MMCSD3_WKDEP_OFFSET 0x0120 488#define OMAP4_PM_L4PER_MMCSD3_WKDEP_OFFSET 0x0120
432#define OMAP4430_PM_L4PER_MMCSD3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0120) 489#define OMAP4430_PM_L4PER_MMCSD3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0120)
433#define OMAP4_RM_L4PER_MMCSD3_CONTEXT_OFFSET 0x0124 490#define OMAP4_RM_L4PER_MMCSD3_CONTEXT_OFFSET 0x0124
434#define OMAP4430_RM_L4PER_MMCSD3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0124) 491#define OMAP4430_RM_L4PER_MMCSD3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0124)
435#define OMAP4_PM_L4PER_MMCSD4_WKDEP_OFFSET 0x0128 492#define OMAP4_PM_L4PER_MMCSD4_WKDEP_OFFSET 0x0128
436#define OMAP4430_PM_L4PER_MMCSD4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0128) 493#define OMAP4430_PM_L4PER_MMCSD4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0128)
437#define OMAP4_RM_L4PER_MMCSD4_CONTEXT_OFFSET 0x012c 494#define OMAP4_RM_L4PER_MMCSD4_CONTEXT_OFFSET 0x012c
438#define OMAP4430_RM_L4PER_MMCSD4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x012c) 495#define OMAP4430_RM_L4PER_MMCSD4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x012c)
439#define OMAP4_RM_L4PER_MSPROHG_CONTEXT_OFFSET 0x0134 496#define OMAP4_RM_L4PER_MSPROHG_CONTEXT_OFFSET 0x0134
440#define OMAP4430_RM_L4PER_MSPROHG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0134) 497#define OMAP4430_RM_L4PER_MSPROHG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0134)
441#define OMAP4_PM_L4PER_SLIMBUS2_WKDEP_OFFSET 0x0138 498#define OMAP4_PM_L4PER_SLIMBUS2_WKDEP_OFFSET 0x0138
442#define OMAP4430_PM_L4PER_SLIMBUS2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0138) 499#define OMAP4430_PM_L4PER_SLIMBUS2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0138)
443#define OMAP4_RM_L4PER_SLIMBUS2_CONTEXT_OFFSET 0x013c 500#define OMAP4_RM_L4PER_SLIMBUS2_CONTEXT_OFFSET 0x013c
444#define OMAP4430_RM_L4PER_SLIMBUS2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x013c) 501#define OMAP4430_RM_L4PER_SLIMBUS2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x013c)
445#define OMAP4_PM_L4PER_UART1_WKDEP_OFFSET 0x0140 502#define OMAP4_PM_L4PER_UART1_WKDEP_OFFSET 0x0140
446#define OMAP4430_PM_L4PER_UART1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0140) 503#define OMAP4430_PM_L4PER_UART1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0140)
447#define OMAP4_RM_L4PER_UART1_CONTEXT_OFFSET 0x0144 504#define OMAP4_RM_L4PER_UART1_CONTEXT_OFFSET 0x0144
448#define OMAP4430_RM_L4PER_UART1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0144) 505#define OMAP4430_RM_L4PER_UART1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0144)
449#define OMAP4_PM_L4PER_UART2_WKDEP_OFFSET 0x0148 506#define OMAP4_PM_L4PER_UART2_WKDEP_OFFSET 0x0148
450#define OMAP4430_PM_L4PER_UART2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0148) 507#define OMAP4430_PM_L4PER_UART2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0148)
451#define OMAP4_RM_L4PER_UART2_CONTEXT_OFFSET 0x014c 508#define OMAP4_RM_L4PER_UART2_CONTEXT_OFFSET 0x014c
452#define OMAP4430_RM_L4PER_UART2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x014c) 509#define OMAP4430_RM_L4PER_UART2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x014c)
453#define OMAP4_PM_L4PER_UART3_WKDEP_OFFSET 0x0150 510#define OMAP4_PM_L4PER_UART3_WKDEP_OFFSET 0x0150
454#define OMAP4430_PM_L4PER_UART3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0150) 511#define OMAP4430_PM_L4PER_UART3_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0150)
455#define OMAP4_RM_L4PER_UART3_CONTEXT_OFFSET 0x0154 512#define OMAP4_RM_L4PER_UART3_CONTEXT_OFFSET 0x0154
456#define OMAP4430_RM_L4PER_UART3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0154) 513#define OMAP4430_RM_L4PER_UART3_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0154)
457#define OMAP4_PM_L4PER_UART4_WKDEP_OFFSET 0x0158 514#define OMAP4_PM_L4PER_UART4_WKDEP_OFFSET 0x0158
458#define OMAP4430_PM_L4PER_UART4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0158) 515#define OMAP4430_PM_L4PER_UART4_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0158)
459#define OMAP4_RM_L4PER_UART4_CONTEXT_OFFSET 0x015c 516#define OMAP4_RM_L4PER_UART4_CONTEXT_OFFSET 0x015c
460#define OMAP4430_RM_L4PER_UART4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x015c) 517#define OMAP4430_RM_L4PER_UART4_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x015c)
461#define OMAP4_PM_L4PER_MMCSD5_WKDEP_OFFSET 0x0160 518#define OMAP4_PM_L4PER_MMCSD5_WKDEP_OFFSET 0x0160
462#define OMAP4430_PM_L4PER_MMCSD5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0160) 519#define OMAP4430_PM_L4PER_MMCSD5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0160)
463#define OMAP4_RM_L4PER_MMCSD5_CONTEXT_OFFSET 0x0164 520#define OMAP4_RM_L4PER_MMCSD5_CONTEXT_OFFSET 0x0164
464#define OMAP4430_RM_L4PER_MMCSD5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0164) 521#define OMAP4430_RM_L4PER_MMCSD5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0164)
465#define OMAP4_PM_L4PER_I2C5_WKDEP_OFFSET 0x0168 522#define OMAP4_PM_L4PER_I2C5_WKDEP_OFFSET 0x0168
466#define OMAP4430_PM_L4PER_I2C5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x0168) 523#define OMAP4430_PM_L4PER_I2C5_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x0168)
467#define OMAP4_RM_L4PER_I2C5_CONTEXT_OFFSET 0x016c 524#define OMAP4_RM_L4PER_I2C5_CONTEXT_OFFSET 0x016c
468#define OMAP4430_RM_L4PER_I2C5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x016c) 525#define OMAP4430_RM_L4PER_I2C5_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x016c)
469#define OMAP4_RM_L4SEC_AES1_CONTEXT_OFFSET 0x01a4 526#define OMAP4_RM_L4SEC_AES1_CONTEXT_OFFSET 0x01a4
470#define OMAP4430_RM_L4SEC_AES1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01a4) 527#define OMAP4430_RM_L4SEC_AES1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01a4)
471#define OMAP4_RM_L4SEC_AES2_CONTEXT_OFFSET 0x01ac 528#define OMAP4_RM_L4SEC_AES2_CONTEXT_OFFSET 0x01ac
472#define OMAP4430_RM_L4SEC_AES2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01ac) 529#define OMAP4430_RM_L4SEC_AES2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01ac)
473#define OMAP4_RM_L4SEC_DES3DES_CONTEXT_OFFSET 0x01b4 530#define OMAP4_RM_L4SEC_DES3DES_CONTEXT_OFFSET 0x01b4
474#define OMAP4430_RM_L4SEC_DES3DES_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01b4) 531#define OMAP4430_RM_L4SEC_DES3DES_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01b4)
475#define OMAP4_RM_L4SEC_PKAEIP29_CONTEXT_OFFSET 0x01bc 532#define OMAP4_RM_L4SEC_PKAEIP29_CONTEXT_OFFSET 0x01bc
476#define OMAP4430_RM_L4SEC_PKAEIP29_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01bc) 533#define OMAP4430_RM_L4SEC_PKAEIP29_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01bc)
477#define OMAP4_RM_L4SEC_RNG_CONTEXT_OFFSET 0x01c4 534#define OMAP4_RM_L4SEC_RNG_CONTEXT_OFFSET 0x01c4
478#define OMAP4430_RM_L4SEC_RNG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01c4) 535#define OMAP4430_RM_L4SEC_RNG_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01c4)
479#define OMAP4_RM_L4SEC_SHA2MD51_CONTEXT_OFFSET 0x01cc 536#define OMAP4_RM_L4SEC_SHA2MD51_CONTEXT_OFFSET 0x01cc
480#define OMAP4430_RM_L4SEC_SHA2MD51_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01cc) 537#define OMAP4430_RM_L4SEC_SHA2MD51_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01cc)
481#define OMAP4_RM_L4SEC_CRYPTODMA_CONTEXT_OFFSET 0x01dc 538#define OMAP4_RM_L4SEC_CRYPTODMA_CONTEXT_OFFSET 0x01dc
482#define OMAP4430_RM_L4SEC_CRYPTODMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_MOD, 0x01dc) 539#define OMAP4430_RM_L4SEC_CRYPTODMA_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_L4PER_INST, 0x01dc)
483 540
484/* PRM.CEFUSE_PRM register offsets */ 541/* PRM.CEFUSE_PRM register offsets */
485#define OMAP4_PM_CEFUSE_PWRSTCTRL_OFFSET 0x0000 542#define OMAP4_PM_CEFUSE_PWRSTCTRL_OFFSET 0x0000
486#define OMAP4430_PM_CEFUSE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_MOD, 0x0000) 543#define OMAP4430_PM_CEFUSE_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_INST, 0x0000)
487#define OMAP4_PM_CEFUSE_PWRSTST_OFFSET 0x0004 544#define OMAP4_PM_CEFUSE_PWRSTST_OFFSET 0x0004
488#define OMAP4430_PM_CEFUSE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_MOD, 0x0004) 545#define OMAP4430_PM_CEFUSE_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_INST, 0x0004)
489#define OMAP4_RM_CEFUSE_CEFUSE_CONTEXT_OFFSET 0x0024 546#define OMAP4_RM_CEFUSE_CEFUSE_CONTEXT_OFFSET 0x0024
490#define OMAP4430_RM_CEFUSE_CEFUSE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_MOD, 0x0024) 547#define OMAP4430_RM_CEFUSE_CEFUSE_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_CEFUSE_INST, 0x0024)
491 548
492/* PRM.WKUP_PRM register offsets */ 549/* PRM.WKUP_PRM register offsets */
493#define OMAP4_RM_WKUP_L4WKUP_CONTEXT_OFFSET 0x0024 550#define OMAP4_RM_WKUP_L4WKUP_CONTEXT_OFFSET 0x0024
494#define OMAP4430_RM_WKUP_L4WKUP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0024) 551#define OMAP4430_RM_WKUP_L4WKUP_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0024)
495#define OMAP4_RM_WKUP_WDT1_CONTEXT_OFFSET 0x002c 552#define OMAP4_RM_WKUP_WDT1_CONTEXT_OFFSET 0x002c
496#define OMAP4430_RM_WKUP_WDT1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x002c) 553#define OMAP4430_RM_WKUP_WDT1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x002c)
497#define OMAP4_PM_WKUP_WDT2_WKDEP_OFFSET 0x0030 554#define OMAP4_PM_WKUP_WDT2_WKDEP_OFFSET 0x0030
498#define OMAP4430_PM_WKUP_WDT2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0030) 555#define OMAP4430_PM_WKUP_WDT2_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0030)
499#define OMAP4_RM_WKUP_WDT2_CONTEXT_OFFSET 0x0034 556#define OMAP4_RM_WKUP_WDT2_CONTEXT_OFFSET 0x0034
500#define OMAP4430_RM_WKUP_WDT2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0034) 557#define OMAP4430_RM_WKUP_WDT2_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0034)
501#define OMAP4_PM_WKUP_GPIO1_WKDEP_OFFSET 0x0038 558#define OMAP4_PM_WKUP_GPIO1_WKDEP_OFFSET 0x0038
502#define OMAP4430_PM_WKUP_GPIO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0038) 559#define OMAP4430_PM_WKUP_GPIO1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0038)
503#define OMAP4_RM_WKUP_GPIO1_CONTEXT_OFFSET 0x003c 560#define OMAP4_RM_WKUP_GPIO1_CONTEXT_OFFSET 0x003c
504#define OMAP4430_RM_WKUP_GPIO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x003c) 561#define OMAP4430_RM_WKUP_GPIO1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x003c)
505#define OMAP4_PM_WKUP_TIMER1_WKDEP_OFFSET 0x0040 562#define OMAP4_PM_WKUP_TIMER1_WKDEP_OFFSET 0x0040
506#define OMAP4430_PM_WKUP_TIMER1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0040) 563#define OMAP4430_PM_WKUP_TIMER1_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0040)
507#define OMAP4_RM_WKUP_TIMER1_CONTEXT_OFFSET 0x0044 564#define OMAP4_RM_WKUP_TIMER1_CONTEXT_OFFSET 0x0044
508#define OMAP4430_RM_WKUP_TIMER1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0044) 565#define OMAP4430_RM_WKUP_TIMER1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0044)
509#define OMAP4_PM_WKUP_TIMER12_WKDEP_OFFSET 0x0048 566#define OMAP4_PM_WKUP_TIMER12_WKDEP_OFFSET 0x0048
510#define OMAP4430_PM_WKUP_TIMER12_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0048) 567#define OMAP4430_PM_WKUP_TIMER12_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0048)
511#define OMAP4_RM_WKUP_TIMER12_CONTEXT_OFFSET 0x004c 568#define OMAP4_RM_WKUP_TIMER12_CONTEXT_OFFSET 0x004c
512#define OMAP4430_RM_WKUP_TIMER12_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x004c) 569#define OMAP4430_RM_WKUP_TIMER12_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x004c)
513#define OMAP4_RM_WKUP_SYNCTIMER_CONTEXT_OFFSET 0x0054 570#define OMAP4_RM_WKUP_SYNCTIMER_CONTEXT_OFFSET 0x0054
514#define OMAP4430_RM_WKUP_SYNCTIMER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0054) 571#define OMAP4430_RM_WKUP_SYNCTIMER_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0054)
515#define OMAP4_PM_WKUP_USIM_WKDEP_OFFSET 0x0058 572#define OMAP4_PM_WKUP_USIM_WKDEP_OFFSET 0x0058
516#define OMAP4430_PM_WKUP_USIM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0058) 573#define OMAP4430_PM_WKUP_USIM_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0058)
517#define OMAP4_RM_WKUP_USIM_CONTEXT_OFFSET 0x005c 574#define OMAP4_RM_WKUP_USIM_CONTEXT_OFFSET 0x005c
518#define OMAP4430_RM_WKUP_USIM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x005c) 575#define OMAP4430_RM_WKUP_USIM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x005c)
519#define OMAP4_RM_WKUP_SARRAM_CONTEXT_OFFSET 0x0064 576#define OMAP4_RM_WKUP_SARRAM_CONTEXT_OFFSET 0x0064
520#define OMAP4430_RM_WKUP_SARRAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0064) 577#define OMAP4430_RM_WKUP_SARRAM_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0064)
521#define OMAP4_PM_WKUP_KEYBOARD_WKDEP_OFFSET 0x0078 578#define OMAP4_PM_WKUP_KEYBOARD_WKDEP_OFFSET 0x0078
522#define OMAP4430_PM_WKUP_KEYBOARD_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0078) 579#define OMAP4430_PM_WKUP_KEYBOARD_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0078)
523#define OMAP4_RM_WKUP_KEYBOARD_CONTEXT_OFFSET 0x007c 580#define OMAP4_RM_WKUP_KEYBOARD_CONTEXT_OFFSET 0x007c
524#define OMAP4430_RM_WKUP_KEYBOARD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x007c) 581#define OMAP4430_RM_WKUP_KEYBOARD_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x007c)
525#define OMAP4_PM_WKUP_RTC_WKDEP_OFFSET 0x0080 582#define OMAP4_PM_WKUP_RTC_WKDEP_OFFSET 0x0080
526#define OMAP4430_PM_WKUP_RTC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0080) 583#define OMAP4430_PM_WKUP_RTC_WKDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0080)
527#define OMAP4_RM_WKUP_RTC_CONTEXT_OFFSET 0x0084 584#define OMAP4_RM_WKUP_RTC_CONTEXT_OFFSET 0x0084
528#define OMAP4430_RM_WKUP_RTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_MOD, 0x0084) 585#define OMAP4430_RM_WKUP_RTC_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_INST, 0x0084)
529 586
530/* PRM.WKUP_CM register offsets */ 587/* PRM.WKUP_CM register offsets */
531#define OMAP4_CM_WKUP_CLKSTCTRL_OFFSET 0x0000 588#define OMAP4_CM_WKUP_CLKSTCTRL_OFFSET 0x0000
532#define OMAP4430_CM_WKUP_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0000) 589#define OMAP4430_CM_WKUP_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0000)
533#define OMAP4_CM_WKUP_L4WKUP_CLKCTRL_OFFSET 0x0020 590#define OMAP4_CM_WKUP_L4WKUP_CLKCTRL_OFFSET 0x0020
534#define OMAP4430_CM_WKUP_L4WKUP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0020) 591#define OMAP4430_CM_WKUP_L4WKUP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0020)
535#define OMAP4_CM_WKUP_WDT1_CLKCTRL_OFFSET 0x0028 592#define OMAP4_CM_WKUP_WDT1_CLKCTRL_OFFSET 0x0028
536#define OMAP4430_CM_WKUP_WDT1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0028) 593#define OMAP4430_CM_WKUP_WDT1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0028)
537#define OMAP4_CM_WKUP_WDT2_CLKCTRL_OFFSET 0x0030 594#define OMAP4_CM_WKUP_WDT2_CLKCTRL_OFFSET 0x0030
538#define OMAP4430_CM_WKUP_WDT2_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0030) 595#define OMAP4430_CM_WKUP_WDT2_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0030)
539#define OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET 0x0038 596#define OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET 0x0038
540#define OMAP4430_CM_WKUP_GPIO1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0038) 597#define OMAP4430_CM_WKUP_GPIO1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0038)
541#define OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET 0x0040 598#define OMAP4_CM_WKUP_TIMER1_CLKCTRL_OFFSET 0x0040
542#define OMAP4430_CM_WKUP_TIMER1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0040) 599#define OMAP4430_CM_WKUP_TIMER1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0040)
543#define OMAP4_CM_WKUP_TIMER12_CLKCTRL_OFFSET 0x0048 600#define OMAP4_CM_WKUP_TIMER12_CLKCTRL_OFFSET 0x0048
544#define OMAP4430_CM_WKUP_TIMER12_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0048) 601#define OMAP4430_CM_WKUP_TIMER12_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0048)
545#define OMAP4_CM_WKUP_SYNCTIMER_CLKCTRL_OFFSET 0x0050 602#define OMAP4_CM_WKUP_SYNCTIMER_CLKCTRL_OFFSET 0x0050
546#define OMAP4430_CM_WKUP_SYNCTIMER_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0050) 603#define OMAP4430_CM_WKUP_SYNCTIMER_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0050)
547#define OMAP4_CM_WKUP_USIM_CLKCTRL_OFFSET 0x0058 604#define OMAP4_CM_WKUP_USIM_CLKCTRL_OFFSET 0x0058
548#define OMAP4430_CM_WKUP_USIM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0058) 605#define OMAP4430_CM_WKUP_USIM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0058)
549#define OMAP4_CM_WKUP_SARRAM_CLKCTRL_OFFSET 0x0060 606#define OMAP4_CM_WKUP_SARRAM_CLKCTRL_OFFSET 0x0060
550#define OMAP4430_CM_WKUP_SARRAM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0060) 607#define OMAP4430_CM_WKUP_SARRAM_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0060)
551#define OMAP4_CM_WKUP_KEYBOARD_CLKCTRL_OFFSET 0x0078 608#define OMAP4_CM_WKUP_KEYBOARD_CLKCTRL_OFFSET 0x0078
552#define OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0078) 609#define OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0078)
553#define OMAP4_CM_WKUP_RTC_CLKCTRL_OFFSET 0x0080 610#define OMAP4_CM_WKUP_RTC_CLKCTRL_OFFSET 0x0080
554#define OMAP4430_CM_WKUP_RTC_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0080) 611#define OMAP4430_CM_WKUP_RTC_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0080)
555#define OMAP4_CM_WKUP_BANDGAP_CLKCTRL_OFFSET 0x0088 612#define OMAP4_CM_WKUP_BANDGAP_CLKCTRL_OFFSET 0x0088
556#define OMAP4430_CM_WKUP_BANDGAP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_MOD, 0x0088) 613#define OMAP4430_CM_WKUP_BANDGAP_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_WKUP_CM_INST, 0x0088)
557 614
558/* PRM.EMU_PRM register offsets */ 615/* PRM.EMU_PRM register offsets */
559#define OMAP4_PM_EMU_PWRSTCTRL_OFFSET 0x0000 616#define OMAP4_PM_EMU_PWRSTCTRL_OFFSET 0x0000
560#define OMAP4430_PM_EMU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_MOD, 0x0000) 617#define OMAP4430_PM_EMU_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_INST, 0x0000)
561#define OMAP4_PM_EMU_PWRSTST_OFFSET 0x0004 618#define OMAP4_PM_EMU_PWRSTST_OFFSET 0x0004
562#define OMAP4430_PM_EMU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_MOD, 0x0004) 619#define OMAP4430_PM_EMU_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_INST, 0x0004)
563#define OMAP4_RM_EMU_DEBUGSS_CONTEXT_OFFSET 0x0024 620#define OMAP4_RM_EMU_DEBUGSS_CONTEXT_OFFSET 0x0024
564#define OMAP4430_RM_EMU_DEBUGSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_MOD, 0x0024) 621#define OMAP4430_RM_EMU_DEBUGSS_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_INST, 0x0024)
565 622
566/* PRM.EMU_CM register offsets */ 623/* PRM.EMU_CM register offsets */
567#define OMAP4_CM_EMU_CLKSTCTRL_OFFSET 0x0000 624#define OMAP4_CM_EMU_CLKSTCTRL_OFFSET 0x0000
568#define OMAP4430_CM_EMU_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_MOD, 0x0000) 625#define OMAP4430_CM_EMU_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_INST, 0x0000)
569#define OMAP4_CM_EMU_DYNAMICDEP_OFFSET 0x0008 626#define OMAP4_CM_EMU_DYNAMICDEP_OFFSET 0x0008
570#define OMAP4430_CM_EMU_DYNAMICDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_MOD, 0x0008) 627#define OMAP4430_CM_EMU_DYNAMICDEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_INST, 0x0008)
571#define OMAP4_CM_EMU_DEBUGSS_CLKCTRL_OFFSET 0x0020 628#define OMAP4_CM_EMU_DEBUGSS_CLKCTRL_OFFSET 0x0020
572#define OMAP4430_CM_EMU_DEBUGSS_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_MOD, 0x0020) 629#define OMAP4430_CM_EMU_DEBUGSS_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_EMU_CM_INST, 0x0020)
573 630
574/* PRM.DEVICE_PRM register offsets */ 631/* PRM.DEVICE_PRM register offsets */
575#define OMAP4_PRM_RSTCTRL_OFFSET 0x0000 632#define OMAP4_PRM_RSTCTRL_OFFSET 0x0000
576#define OMAP4430_PRM_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0000) 633#define OMAP4430_PRM_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0000)
577#define OMAP4_PRM_RSTST_OFFSET 0x0004 634#define OMAP4_PRM_RSTST_OFFSET 0x0004
578#define OMAP4430_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0004) 635#define OMAP4430_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0004)
579#define OMAP4_PRM_RSTTIME_OFFSET 0x0008 636#define OMAP4_PRM_RSTTIME_OFFSET 0x0008
580#define OMAP4430_PRM_RSTTIME OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0008) 637#define OMAP4430_PRM_RSTTIME OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0008)
581#define OMAP4_PRM_CLKREQCTRL_OFFSET 0x000c 638#define OMAP4_PRM_CLKREQCTRL_OFFSET 0x000c
582#define OMAP4430_PRM_CLKREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x000c) 639#define OMAP4430_PRM_CLKREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x000c)
583#define OMAP4_PRM_VOLTCTRL_OFFSET 0x0010 640#define OMAP4_PRM_VOLTCTRL_OFFSET 0x0010
584#define OMAP4430_PRM_VOLTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0010) 641#define OMAP4430_PRM_VOLTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0010)
585#define OMAP4_PRM_PWRREQCTRL_OFFSET 0x0014 642#define OMAP4_PRM_PWRREQCTRL_OFFSET 0x0014
586#define OMAP4430_PRM_PWRREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0014) 643#define OMAP4430_PRM_PWRREQCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0014)
587#define OMAP4_PRM_PSCON_COUNT_OFFSET 0x0018 644#define OMAP4_PRM_PSCON_COUNT_OFFSET 0x0018
588#define OMAP4430_PRM_PSCON_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0018) 645#define OMAP4430_PRM_PSCON_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0018)
589#define OMAP4_PRM_IO_COUNT_OFFSET 0x001c 646#define OMAP4_PRM_IO_COUNT_OFFSET 0x001c
590#define OMAP4430_PRM_IO_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x001c) 647#define OMAP4430_PRM_IO_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x001c)
591#define OMAP4_PRM_IO_PMCTRL_OFFSET 0x0020 648#define OMAP4_PRM_IO_PMCTRL_OFFSET 0x0020
592#define OMAP4430_PRM_IO_PMCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0020) 649#define OMAP4430_PRM_IO_PMCTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0020)
593#define OMAP4_PRM_VOLTSETUP_WARMRESET_OFFSET 0x0024 650#define OMAP4_PRM_VOLTSETUP_WARMRESET_OFFSET 0x0024
594#define OMAP4430_PRM_VOLTSETUP_WARMRESET OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0024) 651#define OMAP4430_PRM_VOLTSETUP_WARMRESET OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0024)
595#define OMAP4_PRM_VOLTSETUP_CORE_OFF_OFFSET 0x0028 652#define OMAP4_PRM_VOLTSETUP_CORE_OFF_OFFSET 0x0028
596#define OMAP4430_PRM_VOLTSETUP_CORE_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0028) 653#define OMAP4430_PRM_VOLTSETUP_CORE_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0028)
597#define OMAP4_PRM_VOLTSETUP_MPU_OFF_OFFSET 0x002c 654#define OMAP4_PRM_VOLTSETUP_MPU_OFF_OFFSET 0x002c
598#define OMAP4430_PRM_VOLTSETUP_MPU_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x002c) 655#define OMAP4430_PRM_VOLTSETUP_MPU_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x002c)
599#define OMAP4_PRM_VOLTSETUP_IVA_OFF_OFFSET 0x0030 656#define OMAP4_PRM_VOLTSETUP_IVA_OFF_OFFSET 0x0030
600#define OMAP4430_PRM_VOLTSETUP_IVA_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0030) 657#define OMAP4430_PRM_VOLTSETUP_IVA_OFF OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0030)
601#define OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET 0x0034 658#define OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET 0x0034
602#define OMAP4430_PRM_VOLTSETUP_CORE_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0034) 659#define OMAP4430_PRM_VOLTSETUP_CORE_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0034)
603#define OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET 0x0038 660#define OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET 0x0038
604#define OMAP4430_PRM_VOLTSETUP_MPU_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0038) 661#define OMAP4430_PRM_VOLTSETUP_MPU_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0038)
605#define OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET 0x003c 662#define OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET 0x003c
606#define OMAP4430_PRM_VOLTSETUP_IVA_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x003c) 663#define OMAP4430_PRM_VOLTSETUP_IVA_RET_SLEEP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x003c)
607#define OMAP4_PRM_VP_CORE_CONFIG_OFFSET 0x0040 664#define OMAP4_PRM_VP_CORE_CONFIG_OFFSET 0x0040
608#define OMAP4430_PRM_VP_CORE_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0040) 665#define OMAP4430_PRM_VP_CORE_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0040)
609#define OMAP4_PRM_VP_CORE_STATUS_OFFSET 0x0044 666#define OMAP4_PRM_VP_CORE_STATUS_OFFSET 0x0044
610#define OMAP4430_PRM_VP_CORE_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0044) 667#define OMAP4430_PRM_VP_CORE_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0044)
611#define OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET 0x0048 668#define OMAP4_PRM_VP_CORE_VLIMITTO_OFFSET 0x0048
612#define OMAP4430_PRM_VP_CORE_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0048) 669#define OMAP4430_PRM_VP_CORE_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0048)
613#define OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET 0x004c 670#define OMAP4_PRM_VP_CORE_VOLTAGE_OFFSET 0x004c
614#define OMAP4430_PRM_VP_CORE_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x004c) 671#define OMAP4430_PRM_VP_CORE_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x004c)
615#define OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET 0x0050 672#define OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET 0x0050
616#define OMAP4430_PRM_VP_CORE_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0050) 673#define OMAP4430_PRM_VP_CORE_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0050)
617#define OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET 0x0054 674#define OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET 0x0054
618#define OMAP4430_PRM_VP_CORE_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0054) 675#define OMAP4430_PRM_VP_CORE_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0054)
619#define OMAP4_PRM_VP_MPU_CONFIG_OFFSET 0x0058 676#define OMAP4_PRM_VP_MPU_CONFIG_OFFSET 0x0058
620#define OMAP4430_PRM_VP_MPU_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0058) 677#define OMAP4430_PRM_VP_MPU_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0058)
621#define OMAP4_PRM_VP_MPU_STATUS_OFFSET 0x005c 678#define OMAP4_PRM_VP_MPU_STATUS_OFFSET 0x005c
622#define OMAP4430_PRM_VP_MPU_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x005c) 679#define OMAP4430_PRM_VP_MPU_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x005c)
623#define OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET 0x0060 680#define OMAP4_PRM_VP_MPU_VLIMITTO_OFFSET 0x0060
624#define OMAP4430_PRM_VP_MPU_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0060) 681#define OMAP4430_PRM_VP_MPU_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0060)
625#define OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET 0x0064 682#define OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET 0x0064
626#define OMAP4430_PRM_VP_MPU_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0064) 683#define OMAP4430_PRM_VP_MPU_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0064)
627#define OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET 0x0068 684#define OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET 0x0068
628#define OMAP4430_PRM_VP_MPU_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0068) 685#define OMAP4430_PRM_VP_MPU_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0068)
629#define OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET 0x006c 686#define OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET 0x006c
630#define OMAP4430_PRM_VP_MPU_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x006c) 687#define OMAP4430_PRM_VP_MPU_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x006c)
631#define OMAP4_PRM_VP_IVA_CONFIG_OFFSET 0x0070 688#define OMAP4_PRM_VP_IVA_CONFIG_OFFSET 0x0070
632#define OMAP4430_PRM_VP_IVA_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0070) 689#define OMAP4430_PRM_VP_IVA_CONFIG OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0070)
633#define OMAP4_PRM_VP_IVA_STATUS_OFFSET 0x0074 690#define OMAP4_PRM_VP_IVA_STATUS_OFFSET 0x0074
634#define OMAP4430_PRM_VP_IVA_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0074) 691#define OMAP4430_PRM_VP_IVA_STATUS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0074)
635#define OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET 0x0078 692#define OMAP4_PRM_VP_IVA_VLIMITTO_OFFSET 0x0078
636#define OMAP4430_PRM_VP_IVA_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0078) 693#define OMAP4430_PRM_VP_IVA_VLIMITTO OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0078)
637#define OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET 0x007c 694#define OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET 0x007c
638#define OMAP4430_PRM_VP_IVA_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x007c) 695#define OMAP4430_PRM_VP_IVA_VOLTAGE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x007c)
639#define OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET 0x0080 696#define OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET 0x0080
640#define OMAP4430_PRM_VP_IVA_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0080) 697#define OMAP4430_PRM_VP_IVA_VSTEPMAX OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0080)
641#define OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET 0x0084 698#define OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET 0x0084
642#define OMAP4430_PRM_VP_IVA_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0084) 699#define OMAP4430_PRM_VP_IVA_VSTEPMIN OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0084)
643#define OMAP4_PRM_VC_SMPS_SA_OFFSET 0x0088 700#define OMAP4_PRM_VC_SMPS_SA_OFFSET 0x0088
644#define OMAP4430_PRM_VC_SMPS_SA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0088) 701#define OMAP4430_PRM_VC_SMPS_SA OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0088)
645#define OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET 0x008c 702#define OMAP4_PRM_VC_VAL_SMPS_RA_VOL_OFFSET 0x008c
646#define OMAP4430_PRM_VC_VAL_SMPS_RA_VOL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x008c) 703#define OMAP4430_PRM_VC_VAL_SMPS_RA_VOL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x008c)
647#define OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET 0x0090 704#define OMAP4_PRM_VC_VAL_SMPS_RA_CMD_OFFSET 0x0090
648#define OMAP4430_PRM_VC_VAL_SMPS_RA_CMD OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0090) 705#define OMAP4430_PRM_VC_VAL_SMPS_RA_CMD OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0090)
649#define OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET 0x0094 706#define OMAP4_PRM_VC_VAL_CMD_VDD_CORE_L_OFFSET 0x0094
650#define OMAP4430_PRM_VC_VAL_CMD_VDD_CORE_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0094) 707#define OMAP4430_PRM_VC_VAL_CMD_VDD_CORE_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0094)
651#define OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET 0x0098 708#define OMAP4_PRM_VC_VAL_CMD_VDD_MPU_L_OFFSET 0x0098
652#define OMAP4430_PRM_VC_VAL_CMD_VDD_MPU_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x0098) 709#define OMAP4430_PRM_VC_VAL_CMD_VDD_MPU_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x0098)
653#define OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET 0x009c 710#define OMAP4_PRM_VC_VAL_CMD_VDD_IVA_L_OFFSET 0x009c
654#define OMAP4430_PRM_VC_VAL_CMD_VDD_IVA_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x009c) 711#define OMAP4430_PRM_VC_VAL_CMD_VDD_IVA_L OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x009c)
655#define OMAP4_PRM_VC_VAL_BYPASS_OFFSET 0x00a0 712#define OMAP4_PRM_VC_VAL_BYPASS_OFFSET 0x00a0
656#define OMAP4430_PRM_VC_VAL_BYPASS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00a0) 713#define OMAP4430_PRM_VC_VAL_BYPASS OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00a0)
657#define OMAP4_PRM_VC_CFG_CHANNEL_OFFSET 0x00a4 714#define OMAP4_PRM_VC_CFG_CHANNEL_OFFSET 0x00a4
658#define OMAP4430_PRM_VC_CFG_CHANNEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00a4) 715#define OMAP4430_PRM_VC_CFG_CHANNEL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00a4)
659#define OMAP4_PRM_VC_CFG_I2C_MODE_OFFSET 0x00a8 716#define OMAP4_PRM_VC_CFG_I2C_INSTE_OFFSET 0x00a8
660#define OMAP4430_PRM_VC_CFG_I2C_MODE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00a8) 717#define OMAP4430_PRM_VC_CFG_I2C_INSTE OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00a8)
661#define OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET 0x00ac 718#define OMAP4_PRM_VC_CFG_I2C_CLK_OFFSET 0x00ac
662#define OMAP4430_PRM_VC_CFG_I2C_CLK OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00ac) 719#define OMAP4430_PRM_VC_CFG_I2C_CLK OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00ac)
663#define OMAP4_PRM_SRAM_COUNT_OFFSET 0x00b0 720#define OMAP4_PRM_SRAM_COUNT_OFFSET 0x00b0
664#define OMAP4430_PRM_SRAM_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00b0) 721#define OMAP4430_PRM_SRAM_COUNT OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00b0)
665#define OMAP4_PRM_SRAM_WKUP_SETUP_OFFSET 0x00b4 722#define OMAP4_PRM_SRAM_WKUP_SETUP_OFFSET 0x00b4
666#define OMAP4430_PRM_SRAM_WKUP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00b4) 723#define OMAP4430_PRM_SRAM_WKUP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00b4)
667#define OMAP4_PRM_LDO_SRAM_CORE_SETUP_OFFSET 0x00b8 724#define OMAP4_PRM_LDO_SRAM_CORE_SETUP_OFFSET 0x00b8
668#define OMAP4430_PRM_LDO_SRAM_CORE_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00b8) 725#define OMAP4430_PRM_LDO_SRAM_CORE_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00b8)
669#define OMAP4_PRM_LDO_SRAM_CORE_CTRL_OFFSET 0x00bc 726#define OMAP4_PRM_LDO_SRAM_CORE_CTRL_OFFSET 0x00bc
670#define OMAP4430_PRM_LDO_SRAM_CORE_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00bc) 727#define OMAP4430_PRM_LDO_SRAM_CORE_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00bc)
671#define OMAP4_PRM_LDO_SRAM_MPU_SETUP_OFFSET 0x00c0 728#define OMAP4_PRM_LDO_SRAM_MPU_SETUP_OFFSET 0x00c0
672#define OMAP4430_PRM_LDO_SRAM_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00c0) 729#define OMAP4430_PRM_LDO_SRAM_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00c0)
673#define OMAP4_PRM_LDO_SRAM_MPU_CTRL_OFFSET 0x00c4 730#define OMAP4_PRM_LDO_SRAM_MPU_CTRL_OFFSET 0x00c4
674#define OMAP4430_PRM_LDO_SRAM_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00c4) 731#define OMAP4430_PRM_LDO_SRAM_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00c4)
675#define OMAP4_PRM_LDO_SRAM_IVA_SETUP_OFFSET 0x00c8 732#define OMAP4_PRM_LDO_SRAM_IVA_SETUP_OFFSET 0x00c8
676#define OMAP4430_PRM_LDO_SRAM_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00c8) 733#define OMAP4430_PRM_LDO_SRAM_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00c8)
677#define OMAP4_PRM_LDO_SRAM_IVA_CTRL_OFFSET 0x00cc 734#define OMAP4_PRM_LDO_SRAM_IVA_CTRL_OFFSET 0x00cc
678#define OMAP4430_PRM_LDO_SRAM_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00cc) 735#define OMAP4430_PRM_LDO_SRAM_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00cc)
679#define OMAP4_PRM_LDO_ABB_MPU_SETUP_OFFSET 0x00d0 736#define OMAP4_PRM_LDO_ABB_MPU_SETUP_OFFSET 0x00d0
680#define OMAP4430_PRM_LDO_ABB_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00d0) 737#define OMAP4430_PRM_LDO_ABB_MPU_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00d0)
681#define OMAP4_PRM_LDO_ABB_MPU_CTRL_OFFSET 0x00d4 738#define OMAP4_PRM_LDO_ABB_MPU_CTRL_OFFSET 0x00d4
682#define OMAP4430_PRM_LDO_ABB_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00d4) 739#define OMAP4430_PRM_LDO_ABB_MPU_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00d4)
683#define OMAP4_PRM_LDO_ABB_IVA_SETUP_OFFSET 0x00d8 740#define OMAP4_PRM_LDO_ABB_IVA_SETUP_OFFSET 0x00d8
684#define OMAP4430_PRM_LDO_ABB_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00d8) 741#define OMAP4430_PRM_LDO_ABB_IVA_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00d8)
685#define OMAP4_PRM_LDO_ABB_IVA_CTRL_OFFSET 0x00dc 742#define OMAP4_PRM_LDO_ABB_IVA_CTRL_OFFSET 0x00dc
686#define OMAP4430_PRM_LDO_ABB_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00dc) 743#define OMAP4430_PRM_LDO_ABB_IVA_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00dc)
687#define OMAP4_PRM_LDO_BANDGAP_SETUP_OFFSET 0x00e0 744#define OMAP4_PRM_LDO_BANDGAP_SETUP_OFFSET 0x00e0
688#define OMAP4430_PRM_LDO_BANDGAP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00e0) 745#define OMAP4430_PRM_LDO_BANDGAP_SETUP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00e0)
689#define OMAP4_PRM_DEVICE_OFF_CTRL_OFFSET 0x00e4 746#define OMAP4_PRM_DEVICE_OFF_CTRL_OFFSET 0x00e4
690#define OMAP4430_PRM_DEVICE_OFF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00e4) 747#define OMAP4430_PRM_DEVICE_OFF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00e4)
691#define OMAP4_PRM_PHASE1_CNDP_OFFSET 0x00e8 748#define OMAP4_PRM_PHASE1_CNDP_OFFSET 0x00e8
692#define OMAP4430_PRM_PHASE1_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00e8) 749#define OMAP4430_PRM_PHASE1_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00e8)
693#define OMAP4_PRM_PHASE2A_CNDP_OFFSET 0x00ec 750#define OMAP4_PRM_PHASE2A_CNDP_OFFSET 0x00ec
694#define OMAP4430_PRM_PHASE2A_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00ec) 751#define OMAP4430_PRM_PHASE2A_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00ec)
695#define OMAP4_PRM_PHASE2B_CNDP_OFFSET 0x00f0 752#define OMAP4_PRM_PHASE2B_CNDP_OFFSET 0x00f0
696#define OMAP4430_PRM_PHASE2B_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00f0) 753#define OMAP4430_PRM_PHASE2B_CNDP OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00f0)
697#define OMAP4_PRM_MODEM_IF_CTRL_OFFSET 0x00f4 754#define OMAP4_PRM_INSTEM_IF_CTRL_OFFSET 0x00f4
698#define OMAP4430_PRM_MODEM_IF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00f4) 755#define OMAP4430_PRM_INSTEM_IF_CTRL OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00f4)
699#define OMAP4_PRM_VC_ERRST_OFFSET 0x00f8 756#define OMAP4_PRM_VC_ERRST_OFFSET 0x00f8
700#define OMAP4430_PRM_VC_ERRST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_MOD, 0x00f8) 757#define OMAP4430_PRM_VC_ERRST OMAP44XX_PRM_REGADDR(OMAP4430_PRM_DEVICE_INST, 0x00f8)
701 758
702/* 759/* Function prototypes */
703 * PRCM_MPU 760# ifndef __ASSEMBLER__
704 * 761
705 * The PRCM_MPU is a local PRCM inside the MPU subsystem. For the PRCM (global) 762extern u32 omap4_prm_read_inst_reg(s16 inst, u16 idx);
706 * point of view the PRCM_MPU is a single entity. It shares the same 763extern void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 idx);
707 * programming model as the global PRCM and thus can be assimilate as two new 764extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx);
708 * MOD inside the PRCM 765extern u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
709 */ 766extern u32 omap4_prm_set_inst_reg_bits(u32 bits, s16 inst, s16 idx);
767extern u32 omap4_prm_clear_inst_reg_bits(u32 bits, s16 inst, s16 idx);
768extern u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
769
770extern int omap4_prm_is_hardreset_asserted(void __iomem *rstctrl_reg, u8 shift);
771extern int omap4_prm_assert_hardreset(void __iomem *rstctrl_reg, u8 shift);
772extern int omap4_prm_deassert_hardreset(void __iomem *rstctrl_reg, u8 shift);
773
774extern void omap4_prm_global_warm_sw_reset(void);
775
776# endif
710 777
711/* PRCM_MPU.OCP_SOCKET_PRCM register offsets */
712#define OMAP4_REVISION_PRCM_OFFSET 0x0000
713#define OMAP4430_REVISION_PRCM OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_OCP_SOCKET_PRCM_MOD, 0x0000)
714
715/* PRCM_MPU.DEVICE_PRM register offsets */
716#define OMAP4_PRCM_MPU_PRM_RSTST_OFFSET 0x0000
717#define OMAP4430_PRCM_MPU_PRM_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0000)
718#define OMAP4_PRCM_MPU_PRM_PSCON_COUNT_OFFSET 0x0004
719#define OMAP4430_PRCM_MPU_PRM_PSCON_COUNT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_DEVICE_PRM_MOD, 0x0004)
720
721/* PRCM_MPU.CPU0 register offsets */
722#define OMAP4_PM_CPU0_PWRSTCTRL_OFFSET 0x0000
723#define OMAP4430_PM_CPU0_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0000)
724#define OMAP4_PM_CPU0_PWRSTST_OFFSET 0x0004
725#define OMAP4430_PM_CPU0_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0004)
726#define OMAP4_RM_CPU0_CPU0_CONTEXT_OFFSET 0x0008
727#define OMAP4430_RM_CPU0_CPU0_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0008)
728#define OMAP4_RM_CPU0_CPU0_RSTCTRL_OFFSET 0x000c
729#define OMAP4430_RM_CPU0_CPU0_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x000c)
730#define OMAP4_RM_CPU0_CPU0_RSTST_OFFSET 0x0010
731#define OMAP4430_RM_CPU0_CPU0_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0010)
732#define OMAP4_CM_CPU0_CPU0_CLKCTRL_OFFSET 0x0014
733#define OMAP4430_CM_CPU0_CPU0_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0014)
734#define OMAP4_CM_CPU0_CLKSTCTRL_OFFSET 0x0018
735#define OMAP4430_CM_CPU0_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU0_MOD, 0x0018)
736
737/* PRCM_MPU.CPU1 register offsets */
738#define OMAP4_PM_CPU1_PWRSTCTRL_OFFSET 0x0000
739#define OMAP4430_PM_CPU1_PWRSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0000)
740#define OMAP4_PM_CPU1_PWRSTST_OFFSET 0x0004
741#define OMAP4430_PM_CPU1_PWRSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0004)
742#define OMAP4_RM_CPU1_CPU1_CONTEXT_OFFSET 0x0008
743#define OMAP4430_RM_CPU1_CPU1_CONTEXT OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0008)
744#define OMAP4_RM_CPU1_CPU1_RSTCTRL_OFFSET 0x000c
745#define OMAP4430_RM_CPU1_CPU1_RSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x000c)
746#define OMAP4_RM_CPU1_CPU1_RSTST_OFFSET 0x0010
747#define OMAP4430_RM_CPU1_CPU1_RSTST OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0010)
748#define OMAP4_CM_CPU1_CPU1_CLKCTRL_OFFSET 0x0014
749#define OMAP4430_CM_CPU1_CPU1_CLKCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0014)
750#define OMAP4_CM_CPU1_CLKSTCTRL_OFFSET 0x0018
751#define OMAP4430_CM_CPU1_CLKSTCTRL OMAP44XX_PRCM_MPU_REGADDR(OMAP4430_PRCM_MPU_CPU1_MOD, 0x0018)
752#endif 778#endif
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
new file mode 100644
index 000000000000..a30324297278
--- /dev/null
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -0,0 +1,66 @@
1/*
2 * OMAP4 PRM instance functions
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/types.h>
14#include <linux/errno.h>
15#include <linux/err.h>
16#include <linux/io.h>
17
18#include <plat/common.h>
19
20#include "prm44xx.h"
21#include "prminst44xx.h"
22#include "prm-regbits-44xx.h"
23#include "prcm44xx.h"
24#include "prcm_mpu44xx.h"
25
26static u32 _prm_bases[OMAP4_MAX_PRCM_PARTITIONS] = {
27 [OMAP4430_INVALID_PRCM_PARTITION] = 0,
28 [OMAP4430_PRM_PARTITION] = OMAP4430_PRM_BASE,
29 [OMAP4430_CM1_PARTITION] = 0,
30 [OMAP4430_CM2_PARTITION] = 0,
31 [OMAP4430_SCRM_PARTITION] = 0,
32 [OMAP4430_PRCM_MPU_PARTITION] = OMAP4430_PRCM_MPU_BASE,
33};
34
35/* Read a register in a PRM instance */
36u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx)
37{
38 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
39 part == OMAP4430_INVALID_PRCM_PARTITION ||
40 !_prm_bases[part]);
41 return __raw_readl(OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst +
42 idx));
43}
44
45/* Write into a register in a PRM instance */
46void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx)
47{
48 BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS ||
49 part == OMAP4430_INVALID_PRCM_PARTITION ||
50 !_prm_bases[part]);
51 __raw_writel(val, OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst + idx));
52}
53
54/* Read-modify-write a register in PRM. Caller must lock */
55u32 omap4_prminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
56 s16 idx)
57{
58 u32 v;
59
60 v = omap4_prminst_read_inst_reg(part, inst, idx);
61 v &= ~mask;
62 v |= bits;
63 omap4_prminst_write_inst_reg(v, part, inst, idx);
64
65 return v;
66}
diff --git a/arch/arm/mach-omap2/prminst44xx.h b/arch/arm/mach-omap2/prminst44xx.h
new file mode 100644
index 000000000000..02dd66ddda8b
--- /dev/null
+++ b/arch/arm/mach-omap2/prminst44xx.h
@@ -0,0 +1,25 @@
1/*
2 * OMAP4 Power/Reset Management (PRM) function prototypes
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef __ARCH_ASM_MACH_OMAP2_PRMINST44XX_H
12#define __ARCH_ASM_MACH_OMAP2_PRMINST44XX_H
13
14/*
15 * In an ideal world, we would not export these low-level functions,
16 * but this will probably take some time to fix properly
17 */
18extern u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx);
19extern void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx);
20extern u32 omap4_prminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part,
21 s16 inst, s16 idx);
22
23extern void omap4_prm_global_warm_sw_reset(void);
24
25#endif
diff --git a/arch/arm/mach-omap2/scrm44xx.h b/arch/arm/mach-omap2/scrm44xx.h
new file mode 100644
index 000000000000..701bf2d32949
--- /dev/null
+++ b/arch/arm/mach-omap2/scrm44xx.h
@@ -0,0 +1,175 @@
1/*
2 * OMAP44xx SCRM registers and bitfields
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc.
5 *
6 * Benoit Cousson (b-cousson@ti.com)
7 *
8 * This file is automatically generated from the OMAP hardware databases.
9 * We respectfully ask that any modifications to this file be coordinated
10 * with the public linux-omap@vger.kernel.org mailing list and the
11 * authors above to ensure that the autogeneration scripts are kept
12 * up-to-date with the file contents.
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 version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#ifndef __ARCH_ARM_MACH_OMAP2_SCRM_44XX_H
20#define __ARCH_ARM_MACH_OMAP2_SCRM_44XX_H
21
22#define OMAP4_SCRM_BASE 0x4a30a000
23
24#define OMAP44XX_SCRM_REGADDR(reg) \
25 OMAP2_L4_IO_ADDRESS(OMAP4_SCRM_BASE + (reg))
26
27/* Registers offset */
28#define OMAP4_SCRM_REVISION_SCRM_OFFSET 0x0000
29#define OMAP4_SCRM_REVISION_SCRM OMAP44XX_SCRM_REGADDR(0x0000)
30#define OMAP4_SCRM_CLKSETUPTIME_OFFSET 0x0100
31#define OMAP4_SCRM_CLKSETUPTIME OMAP44XX_SCRM_REGADDR(0x0100)
32#define OMAP4_SCRM_PMICSETUPTIME_OFFSET 0x0104
33#define OMAP4_SCRM_PMICSETUPTIME OMAP44XX_SCRM_REGADDR(0x0104)
34#define OMAP4_SCRM_ALTCLKSRC_OFFSET 0x0110
35#define OMAP4_SCRM_ALTCLKSRC OMAP44XX_SCRM_REGADDR(0x0110)
36#define OMAP4_SCRM_MODEMCLKM_OFFSET 0x0118
37#define OMAP4_SCRM_MODEMCLKM OMAP44XX_SCRM_REGADDR(0x0118)
38#define OMAP4_SCRM_D2DCLKM_OFFSET 0x011c
39#define OMAP4_SCRM_D2DCLKM OMAP44XX_SCRM_REGADDR(0x011c)
40#define OMAP4_SCRM_EXTCLKREQ_OFFSET 0x0200
41#define OMAP4_SCRM_EXTCLKREQ OMAP44XX_SCRM_REGADDR(0x0200)
42#define OMAP4_SCRM_ACCCLKREQ_OFFSET 0x0204
43#define OMAP4_SCRM_ACCCLKREQ OMAP44XX_SCRM_REGADDR(0x0204)
44#define OMAP4_SCRM_PWRREQ_OFFSET 0x0208
45#define OMAP4_SCRM_PWRREQ OMAP44XX_SCRM_REGADDR(0x0208)
46#define OMAP4_SCRM_AUXCLKREQ0_OFFSET 0x0210
47#define OMAP4_SCRM_AUXCLKREQ0 OMAP44XX_SCRM_REGADDR(0x0210)
48#define OMAP4_SCRM_AUXCLKREQ1_OFFSET 0x0214
49#define OMAP4_SCRM_AUXCLKREQ1 OMAP44XX_SCRM_REGADDR(0x0214)
50#define OMAP4_SCRM_AUXCLKREQ2_OFFSET 0x0218
51#define OMAP4_SCRM_AUXCLKREQ2 OMAP44XX_SCRM_REGADDR(0x0218)
52#define OMAP4_SCRM_AUXCLKREQ3_OFFSET 0x021c
53#define OMAP4_SCRM_AUXCLKREQ3 OMAP44XX_SCRM_REGADDR(0x021c)
54#define OMAP4_SCRM_AUXCLKREQ4_OFFSET 0x0220
55#define OMAP4_SCRM_AUXCLKREQ4 OMAP44XX_SCRM_REGADDR(0x0220)
56#define OMAP4_SCRM_AUXCLKREQ5_OFFSET 0x0224
57#define OMAP4_SCRM_AUXCLKREQ5 OMAP44XX_SCRM_REGADDR(0x0224)
58#define OMAP4_SCRM_D2DCLKREQ_OFFSET 0x0234
59#define OMAP4_SCRM_D2DCLKREQ OMAP44XX_SCRM_REGADDR(0x0234)
60#define OMAP4_SCRM_AUXCLK0_OFFSET 0x0310
61#define OMAP4_SCRM_AUXCLK0 OMAP44XX_SCRM_REGADDR(0x0310)
62#define OMAP4_SCRM_AUXCLK1_OFFSET 0x0314
63#define OMAP4_SCRM_AUXCLK1 OMAP44XX_SCRM_REGADDR(0x0314)
64#define OMAP4_SCRM_AUXCLK2_OFFSET 0x0318
65#define OMAP4_SCRM_AUXCLK2 OMAP44XX_SCRM_REGADDR(0x0318)
66#define OMAP4_SCRM_AUXCLK3_OFFSET 0x031c
67#define OMAP4_SCRM_AUXCLK3 OMAP44XX_SCRM_REGADDR(0x031c)
68#define OMAP4_SCRM_AUXCLK4_OFFSET 0x0320
69#define OMAP4_SCRM_AUXCLK4 OMAP44XX_SCRM_REGADDR(0x0320)
70#define OMAP4_SCRM_AUXCLK5_OFFSET 0x0324
71#define OMAP4_SCRM_AUXCLK5 OMAP44XX_SCRM_REGADDR(0x0324)
72#define OMAP4_SCRM_RSTTIME_OFFSET 0x0400
73#define OMAP4_SCRM_RSTTIME OMAP44XX_SCRM_REGADDR(0x0400)
74#define OMAP4_SCRM_MODEMRSTCTRL_OFFSET 0x0418
75#define OMAP4_SCRM_MODEMRSTCTRL OMAP44XX_SCRM_REGADDR(0x0418)
76#define OMAP4_SCRM_D2DRSTCTRL_OFFSET 0x041c
77#define OMAP4_SCRM_D2DRSTCTRL OMAP44XX_SCRM_REGADDR(0x041c)
78#define OMAP4_SCRM_EXTPWRONRSTCTRL_OFFSET 0x0420
79#define OMAP4_SCRM_EXTPWRONRSTCTRL OMAP44XX_SCRM_REGADDR(0x0420)
80#define OMAP4_SCRM_EXTWARMRSTST_OFFSET 0x0510
81#define OMAP4_SCRM_EXTWARMRSTST OMAP44XX_SCRM_REGADDR(0x0510)
82#define OMAP4_SCRM_APEWARMRSTST_OFFSET 0x0514
83#define OMAP4_SCRM_APEWARMRSTST OMAP44XX_SCRM_REGADDR(0x0514)
84#define OMAP4_SCRM_MODEMWARMRSTST_OFFSET 0x0518
85#define OMAP4_SCRM_MODEMWARMRSTST OMAP44XX_SCRM_REGADDR(0x0518)
86#define OMAP4_SCRM_D2DWARMRSTST_OFFSET 0x051c
87#define OMAP4_SCRM_D2DWARMRSTST OMAP44XX_SCRM_REGADDR(0x051c)
88
89/* Registers shifts and masks */
90
91/* REVISION_SCRM */
92#define OMAP4_REV_SHIFT 0
93#define OMAP4_REV_MASK (0xff << 0)
94
95/* CLKSETUPTIME */
96#define OMAP4_DOWNTIME_SHIFT 16
97#define OMAP4_DOWNTIME_MASK (0x3f << 16)
98#define OMAP4_SETUPTIME_SHIFT 0
99#define OMAP4_SETUPTIME_MASK (0xfff << 0)
100
101/* PMICSETUPTIME */
102#define OMAP4_WAKEUPTIME_SHIFT 16
103#define OMAP4_WAKEUPTIME_MASK (0x3f << 16)
104#define OMAP4_SLEEPTIME_SHIFT 0
105#define OMAP4_SLEEPTIME_MASK (0x3f << 0)
106
107/* ALTCLKSRC */
108#define OMAP4_ENABLE_EXT_SHIFT 3
109#define OMAP4_ENABLE_EXT_MASK (1 << 3)
110#define OMAP4_ENABLE_INT_SHIFT 2
111#define OMAP4_ENABLE_INT_MASK (1 << 2)
112#define OMAP4_ALTCLKSRC_MODE_SHIFT 0
113#define OMAP4_ALTCLKSRC_MODE_MASK (0x3 << 0)
114
115/* MODEMCLKM */
116#define OMAP4_CLK_32KHZ_SHIFT 0
117#define OMAP4_CLK_32KHZ_MASK (1 << 0)
118
119/* D2DCLKM */
120#define OMAP4_SYSCLK_SHIFT 1
121#define OMAP4_SYSCLK_MASK (1 << 1)
122
123/* EXTCLKREQ */
124#define OMAP4_POLARITY_SHIFT 0
125#define OMAP4_POLARITY_MASK (1 << 0)
126
127/* AUXCLKREQ0 */
128#define OMAP4_MAPPING_SHIFT 2
129#define OMAP4_MAPPING_MASK (0x7 << 2)
130#define OMAP4_ACCURACY_SHIFT 1
131#define OMAP4_ACCURACY_MASK (1 << 1)
132
133/* AUXCLK0 */
134#define OMAP4_CLKDIV_SHIFT 16
135#define OMAP4_CLKDIV_MASK (0xf << 16)
136#define OMAP4_DISABLECLK_SHIFT 9
137#define OMAP4_DISABLECLK_MASK (1 << 9)
138#define OMAP4_ENABLE_SHIFT 8
139#define OMAP4_ENABLE_MASK (1 << 8)
140#define OMAP4_SRCSELECT_SHIFT 1
141#define OMAP4_SRCSELECT_MASK (0x3 << 1)
142
143/* RSTTIME */
144#define OMAP4_RSTTIME_SHIFT 0
145#define OMAP4_RSTTIME_MASK (0xf << 0)
146
147/* MODEMRSTCTRL */
148#define OMAP4_WARMRST_SHIFT 1
149#define OMAP4_WARMRST_MASK (1 << 1)
150#define OMAP4_COLDRST_SHIFT 0
151#define OMAP4_COLDRST_MASK (1 << 0)
152
153/* EXTPWRONRSTCTRL */
154#define OMAP4_PWRONRST_SHIFT 1
155#define OMAP4_PWRONRST_MASK (1 << 1)
156#define OMAP4_ENABLE_EXTPWRONRSTCTRL_SHIFT 0
157#define OMAP4_ENABLE_EXTPWRONRSTCTRL_MASK (1 << 0)
158
159/* EXTWARMRSTST */
160#define OMAP4_EXTWARMRSTST_SHIFT 0
161#define OMAP4_EXTWARMRSTST_MASK (1 << 0)
162
163/* APEWARMRSTST */
164#define OMAP4_APEWARMRSTST_SHIFT 1
165#define OMAP4_APEWARMRSTST_MASK (1 << 1)
166
167/* MODEMWARMRSTST */
168#define OMAP4_MODEMWARMRSTST_SHIFT 2
169#define OMAP4_MODEMWARMRSTST_MASK (1 << 2)
170
171/* D2DWARMRSTST */
172#define OMAP4_D2DWARMRSTST_SHIFT 3
173#define OMAP4_D2DWARMRSTST_MASK (1 << 3)
174
175#endif
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 4c65f5628b39..da6f3a63b5d5 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -27,8 +27,6 @@
27#include <plat/clock.h> 27#include <plat/clock.h>
28#include <plat/sram.h> 28#include <plat/sram.h>
29 29
30#include "prm.h"
31
32#include <plat/sdrc.h> 30#include <plat/sdrc.h>
33#include "sdrc.h" 31#include "sdrc.h"
34 32
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 0f4d27aef44d..ccdb010f169d 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -28,7 +28,7 @@
28#include <plat/clock.h> 28#include <plat/clock.h>
29#include <plat/sram.h> 29#include <plat/sram.h>
30 30
31#include "prm.h" 31#include "prm2xxx_3xxx.h"
32#include "clock.h" 32#include "clock.h"
33#include <plat/sdrc.h> 33#include <plat/sdrc.h>
34#include "sdrc.h" 34#include "sdrc.h"
@@ -99,6 +99,10 @@ u32 omap2xxx_sdrc_reprogram(u32 level, u32 force)
99 m_type = omap2xxx_sdrc_get_type(); 99 m_type = omap2xxx_sdrc_get_type();
100 100
101 local_irq_save(flags); 101 local_irq_save(flags);
102 /*
103 * XXX These calls should be abstracted out through a
104 * prm2xxx.c function
105 */
102 if (cpu_is_omap2420()) 106 if (cpu_is_omap2420())
103 __raw_writel(0xffff, OMAP2420_PRCM_VOLTSETUP); 107 __raw_writel(0xffff, OMAP2420_PRCM_VOLTSETUP);
104 else 108 else
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 9dc077e2d8af..c8740ba4fba5 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -40,9 +40,9 @@
40#include <plat/omap_hwmod.h> 40#include <plat/omap_hwmod.h>
41#include <plat/omap_device.h> 41#include <plat/omap_device.h>
42 42
43#include "prm.h" 43#include "prm2xxx_3xxx.h"
44#include "pm.h" 44#include "pm.h"
45#include "cm.h" 45#include "cm2xxx_3xxx.h"
46#include "prm-regbits-34xx.h" 46#include "prm-regbits-34xx.h"
47#include "control.h" 47#include "control.h"
48 48
@@ -106,21 +106,16 @@ struct omap_uart_state {
106static LIST_HEAD(uart_list); 106static LIST_HEAD(uart_list);
107static u8 num_uarts; 107static u8 num_uarts;
108 108
109/*
110 * Since these idle/enable hooks are used in the idle path itself
111 * which has interrupts disabled, use the non-locking versions of
112 * the hwmod enable/disable functions.
113 */
114static int uart_idle_hwmod(struct omap_device *od) 109static int uart_idle_hwmod(struct omap_device *od)
115{ 110{
116 _omap_hwmod_idle(od->hwmods[0]); 111 omap_hwmod_idle(od->hwmods[0]);
117 112
118 return 0; 113 return 0;
119} 114}
120 115
121static int uart_enable_hwmod(struct omap_device *od) 116static int uart_enable_hwmod(struct omap_device *od)
122{ 117{
123 _omap_hwmod_enable(od->hwmods[0]); 118 omap_hwmod_enable(od->hwmods[0]);
124 119
125 return 0; 120 return 0;
126} 121}
@@ -495,6 +490,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
495 u32 wk_mask = 0; 490 u32 wk_mask = 0;
496 u32 padconf = 0; 491 u32 padconf = 0;
497 492
493 /* XXX These PRM accesses do not belong here */
498 uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1); 494 uart->wk_en = OMAP34XX_PRM_REGADDR(mod, PM_WKEN1);
499 uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1); 495 uart->wk_st = OMAP34XX_PRM_REGADDR(mod, PM_WKST1);
500 switch (uart->num) { 496 switch (uart->num) {
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index e3b5cd76c54c..98d8232808b8 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -27,8 +27,8 @@
27#include <plat/sram.h> 27#include <plat/sram.h>
28#include <mach/io.h> 28#include <mach/io.h>
29 29
30#include "cm.h" 30#include "cm2xxx_3xxx.h"
31#include "prm.h" 31#include "prm2xxx_3xxx.h"
32#include "sdrc.h" 32#include "sdrc.h"
33#include "control.h" 33#include "control.h"
34 34
diff --git a/arch/arm/mach-omap2/sram242x.S b/arch/arm/mach-omap2/sram242x.S
index 92e6e1a12af8..055310cc77de 100644
--- a/arch/arm/mach-omap2/sram242x.S
+++ b/arch/arm/mach-omap2/sram242x.S
@@ -21,14 +21,20 @@
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA 23 * MA 02111-1307 USA
24 *
25 * Richard Woodruff notes that any changes to this code must be carefully
26 * audited and tested to ensure that they don't cause a TLB miss while
27 * the SDRAM is inaccessible. Such a situation will crash the system
28 * since it will cause the ARM MMU to attempt to walk the page tables.
29 * These crashes may be intermittent.
24 */ 30 */
25#include <linux/linkage.h> 31#include <linux/linkage.h>
26#include <asm/assembler.h> 32#include <asm/assembler.h>
27#include <mach/io.h> 33#include <mach/io.h>
28#include <mach/hardware.h> 34#include <mach/hardware.h>
29 35
30#include "prm.h" 36#include "prm2xxx_3xxx.h"
31#include "cm.h" 37#include "cm2xxx_3xxx.h"
32#include "sdrc.h" 38#include "sdrc.h"
33 39
34 .text 40 .text
diff --git a/arch/arm/mach-omap2/sram243x.S b/arch/arm/mach-omap2/sram243x.S
index ab4973695c71..f9007580aea3 100644
--- a/arch/arm/mach-omap2/sram243x.S
+++ b/arch/arm/mach-omap2/sram243x.S
@@ -21,14 +21,20 @@
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 * MA 02111-1307 USA 23 * MA 02111-1307 USA
24 *
25 * Richard Woodruff notes that any changes to this code must be carefully
26 * audited and tested to ensure that they don't cause a TLB miss while
27 * the SDRAM is inaccessible. Such a situation will crash the system
28 * since it will cause the ARM MMU to attempt to walk the page tables.
29 * These crashes may be intermittent.
24 */ 30 */
25#include <linux/linkage.h> 31#include <linux/linkage.h>
26#include <asm/assembler.h> 32#include <asm/assembler.h>
27#include <mach/io.h> 33#include <mach/io.h>
28#include <mach/hardware.h> 34#include <mach/hardware.h>
29 35
30#include "prm.h" 36#include "prm2xxx_3xxx.h"
31#include "cm.h" 37#include "cm2xxx_3xxx.h"
32#include "sdrc.h" 38#include "sdrc.h"
33 39
34 .text 40 .text
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 3637274af5be..7f893a29d500 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -32,7 +32,7 @@
32#include <mach/io.h> 32#include <mach/io.h>
33 33
34#include "sdrc.h" 34#include "sdrc.h"
35#include "cm.h" 35#include "cm2xxx_3xxx.h"
36 36
37 .text 37 .text
38 38
@@ -104,6 +104,12 @@
104 * touching the SDRAM. Until that time, users who know that their use case 104 * touching the SDRAM. Until that time, users who know that their use case
105 * can satisfy the above requirement can enable the CONFIG_OMAP3_SDRC_AC_TIMING 105 * can satisfy the above requirement can enable the CONFIG_OMAP3_SDRC_AC_TIMING
106 * option. 106 * option.
107 *
108 * Richard Woodruff notes that any changes to this code must be carefully
109 * audited and tested to ensure that they don't cause a TLB miss while
110 * the SDRAM is inaccessible. Such a situation will crash the system
111 * since it will cause the ARM MMU to attempt to walk the page tables.
112 * These crashes may be intermittent.
107 */ 113 */
108ENTRY(omap3_sram_configure_core_dpll) 114ENTRY(omap3_sram_configure_core_dpll)
109 stmfd sp!, {r1-r12, lr} @ store regs to stack 115 stmfd sp!, {r1-r12, lr} @ store regs to stack
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
new file mode 100644
index 000000000000..b0c4907ab3ca
--- /dev/null
+++ b/arch/arm/mach-omap2/wd_timer.c
@@ -0,0 +1,54 @@
1/*
2 * OMAP2+ MPU WD_TIMER-specific code
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#include <linux/kernel.h>
11#include <linux/io.h>
12#include <linux/err.h>
13
14#include <plat/omap_hwmod.h>
15
16/*
17 * In order to avoid any assumptions from bootloader regarding WDT
18 * settings, WDT module is reset during init. This enables the watchdog
19 * timer. Hence it is required to disable the watchdog after the WDT reset
20 * during init. Otherwise the system would reboot as per the default
21 * watchdog timer registers settings.
22 */
23#define OMAP_WDT_WPS 0x34
24#define OMAP_WDT_SPR 0x48
25
26
27int omap2_wd_timer_disable(struct omap_hwmod *oh)
28{
29 void __iomem *base;
30
31 if (!oh) {
32 pr_err("%s: Could not look up wdtimer_hwmod\n", __func__);
33 return -EINVAL;
34 }
35
36 base = omap_hwmod_get_mpu_rt_va(oh);
37 if (!base) {
38 pr_err("%s: Could not get the base address for %s\n",
39 oh->name, __func__);
40 return -EINVAL;
41 }
42
43 /* sequence required to disable watchdog */
44 __raw_writel(0xAAAA, base + OMAP_WDT_SPR);
45 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
46 cpu_relax();
47
48 __raw_writel(0x5555, base + OMAP_WDT_SPR);
49 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
50 cpu_relax();
51
52 return 0;
53}
54
diff --git a/arch/arm/mach-omap2/wd_timer.h b/arch/arm/mach-omap2/wd_timer.h
new file mode 100644
index 000000000000..e0054a2d5505
--- /dev/null
+++ b/arch/arm/mach-omap2/wd_timer.h
@@ -0,0 +1,17 @@
1/*
2 * OMAP2+ MPU WD_TIMER-specific function prototypes
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#ifndef __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
11#define __ARCH_ARM_MACH_OMAP2_WD_TIMER_H
12
13#include <plat/omap_hwmod.h>
14
15extern int omap2_wd_timer_disable(struct omap_hwmod *oh);
16
17#endif
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 8d493b992e70..1f98e0b94847 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -29,7 +29,6 @@
29#include <mach/irqs.h> 29#include <mach/irqs.h>
30#include <mach/gpio.h> 30#include <mach/gpio.h>
31#include <asm/mach/irq.h> 31#include <asm/mach/irq.h>
32#include <plat/powerdomain.h>
33 32
34/* 33/*
35 * OMAP1510 GPIO registers 34 * OMAP1510 GPIO registers
@@ -1864,7 +1863,7 @@ static struct sys_device omap_gpio_device = {
1864 1863
1865static int workaround_enabled; 1864static int workaround_enabled;
1866 1865
1867void omap2_gpio_prepare_for_idle(int power_state) 1866void omap2_gpio_prepare_for_idle(int off_mode)
1868{ 1867{
1869 int i, c = 0; 1868 int i, c = 0;
1870 int min = 0; 1869 int min = 0;
@@ -1880,7 +1879,7 @@ void omap2_gpio_prepare_for_idle(int power_state)
1880 for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++) 1879 for (j = 0; j < hweight_long(bank->dbck_enable_mask); j++)
1881 clk_disable(bank->dbck); 1880 clk_disable(bank->dbck);
1882 1881
1883 if (power_state > PWRDM_POWER_OFF) 1882 if (!off_mode)
1884 continue; 1883 continue;
1885 1884
1886 /* If going to OFF, remove triggering for all 1885 /* If going to OFF, remove triggering for all
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index bb937f3fabed..b19774c9c112 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -31,18 +31,18 @@ struct omap_clk {
31#define CK_1510 (1 << 2) 31#define CK_1510 (1 << 2)
32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */ 32#define CK_16XX (1 << 3) /* 16xx, 17xx, 5912 */
33#define CK_242X (1 << 4) 33#define CK_242X (1 << 4)
34#define CK_243X (1 << 5) 34#define CK_243X (1 << 5) /* 243x, 253x */
35#define CK_3XXX (1 << 6) /* OMAP3 + AM3 common clocks*/ 35#define CK_3430ES1 (1 << 6) /* 34xxES1 only */
36#define CK_343X (1 << 7) /* OMAP34xx common clocks */ 36#define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */
37#define CK_3430ES1 (1 << 8) /* 34xxES1 only */ 37#define CK_3505 (1 << 8)
38#define CK_3430ES2 (1 << 9) /* 34xxES2, ES3, non-Sitara 35xx only */ 38#define CK_3517 (1 << 9)
39#define CK_3505 (1 << 10) 39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */
40#define CK_3517 (1 << 11) 40#define CK_443X (1 << 11)
41#define CK_36XX (1 << 12) /* OMAP36xx/37xx-specific clocks */
42#define CK_443X (1 << 13)
43 41
44#define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */
45 42
43#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
44#define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */
45#define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX)
46 46
47 47
48#endif 48#endif
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index fef4696dcf67..8eb0adab19ea 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -49,13 +49,18 @@ struct clkops {
49/* struct clksel_rate.flags possibilities */ 49/* struct clksel_rate.flags possibilities */
50#define RATE_IN_242X (1 << 0) 50#define RATE_IN_242X (1 << 0)
51#define RATE_IN_243X (1 << 1) 51#define RATE_IN_243X (1 << 1)
52#define RATE_IN_3XXX (1 << 2) /* rates common to all OMAP3 */ 52#define RATE_IN_3430ES1 (1 << 2) /* 3430ES1 rates only */
53#define RATE_IN_3430ES2 (1 << 3) /* 3430ES2 rates only */ 53#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
54#define RATE_IN_36XX (1 << 4) 54#define RATE_IN_36XX (1 << 4)
55#define RATE_IN_4430 (1 << 5) 55#define RATE_IN_4430 (1 << 5)
56 56
57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
58#define RATE_IN_3430ES2PLUS (RATE_IN_3430ES2 | RATE_IN_36XX) 58#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
59#define RATE_IN_3XXX (RATE_IN_34XX | RATE_IN_36XX)
60
61/* RATE_IN_3430ES2PLUS_36XX includes 34xx/35xx with ES >=2, and all 36xx/37xx */
62#define RATE_IN_3430ES2PLUS_36XX (RATE_IN_3430ES2PLUS | RATE_IN_36XX)
63
59 64
60/** 65/**
61 * struct clksel_rate - register bitfield values corresponding to clk divisors 66 * struct clksel_rate - register bitfield values corresponding to clk divisors
@@ -119,8 +124,7 @@ struct clksel {
119 * 124 *
120 * Possible values for @flags: 125 * Possible values for @flags:
121 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs) 126 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
122 * NO_DCO_SEL: don't program DCO (only for some J-type DPLLs) 127 *
123
124 * @freqsel_mask is only used on the OMAP34xx family and AM35xx. 128 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
125 * 129 *
126 * XXX Some DPLLs have multiple bypass inputs, so it's not technically 130 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
@@ -156,6 +160,8 @@ struct dpll_data {
156 u32 autoidle_mask; 160 u32 autoidle_mask;
157 u32 freqsel_mask; 161 u32 freqsel_mask;
158 u32 idlest_mask; 162 u32 idlest_mask;
163 u32 dco_mask;
164 u32 sddiv_mask;
159 u8 auto_recal_bit; 165 u8 auto_recal_bit;
160 u8 recal_en_bit; 166 u8 recal_en_bit;
161 u8 recal_st_bit; 167 u8 recal_st_bit;
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index a9d69a09920d..6b8088ec74af 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -27,6 +27,8 @@
27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H 27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
28#define __ARCH_ARM_MACH_OMAP_COMMON_H 28#define __ARCH_ARM_MACH_OMAP_COMMON_H
29 29
30#include <linux/delay.h>
31
30#include <plat/i2c.h> 32#include <plat/i2c.h>
31 33
32struct sys_timer; 34struct sys_timer;
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 41ff2f8943f0..d6f9fa0f62af 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -82,7 +82,7 @@ struct omap_gpio_platform_data {
82/* TODO: Analyze removing gpio_bank_count usage from driver code */ 82/* TODO: Analyze removing gpio_bank_count usage from driver code */
83extern int gpio_bank_count; 83extern int gpio_bank_count;
84 84
85extern void omap2_gpio_prepare_for_idle(int power_state); 85extern void omap2_gpio_prepare_for_idle(int off_mode);
86extern void omap2_gpio_resume_after_idle(void); 86extern void omap2_gpio_resume_after_idle(void);
87extern void omap_set_gpio_debounce(int gpio, int enable); 87extern void omap_set_gpio_debounce(int gpio, int enable);
88extern void omap_set_gpio_debounce_time(int gpio, int enable); 88extern void omap_set_gpio_debounce_time(int gpio, int enable);
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 204865f91d93..ef4106c13183 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -291,8 +291,9 @@ static inline void omap44xx_map_common_io(void)
291} 291}
292#endif 292#endif
293 293
294extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, 294extern void omap2_init_common_infrastructure(void);
295 struct omap_sdrc_params *sdrc_cs1); 295extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
296 struct omap_sdrc_params *sdrc_cs1);
296 297
297#define __arch_ioremap omap_ioremap 298#define __arch_ioremap omap_ioremap
298#define __arch_iounmap omap_iounmap 299#define __arch_iounmap omap_iounmap
diff --git a/arch/arm/plat-omap/include/plat/omap-pm.h b/arch/arm/plat-omap/include/plat/omap-pm.h
index 62c3fe918ab2..c0a752053039 100644
--- a/arch/arm/plat-omap/include/plat/omap-pm.h
+++ b/arch/arm/plat-omap/include/plat/omap-pm.h
@@ -19,8 +19,6 @@
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/opp.h> 20#include <linux/opp.h>
21 21
22#include "powerdomain.h"
23
24/* 22/*
25 * agent_id values for use with omap_pm_set_min_bus_tput(): 23 * agent_id values for use with omap_pm_set_min_bus_tput():
26 * 24 *
@@ -352,9 +350,11 @@ unsigned long omap_pm_cpu_get_freq(void);
352 * driver must restore device context. If the number of context losses 350 * driver must restore device context. If the number of context losses
353 * exceeds the maximum positive integer, the function will wrap to 0 and 351 * exceeds the maximum positive integer, the function will wrap to 0 and
354 * continue counting. Returns the number of context losses for this device, 352 * continue counting. Returns the number of context losses for this device,
355 * or -EINVAL upon error. 353 * or zero upon error.
356 */ 354 */
357int omap_pm_get_dev_context_loss_count(struct device *dev); 355u32 omap_pm_get_dev_context_loss_count(struct device *dev);
358 356
357void omap_pm_enable_off_mode(void);
358void omap_pm_disable_off_mode(void);
359 359
360#endif 360#endif
diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
index 28e2d1a78433..e4c349ff9fd8 100644
--- a/arch/arm/plat-omap/include/plat/omap_device.h
+++ b/arch/arm/plat-omap/include/plat/omap_device.h
@@ -107,6 +107,7 @@ void __iomem *omap_device_get_rt_va(struct omap_device *od);
107int omap_device_align_pm_lat(struct platform_device *pdev, 107int omap_device_align_pm_lat(struct platform_device *pdev,
108 u32 new_wakeup_lat_limit); 108 u32 new_wakeup_lat_limit);
109struct powerdomain *omap_device_get_pwrdm(struct omap_device *od); 109struct powerdomain *omap_device_get_pwrdm(struct omap_device *od);
110u32 omap_device_get_context_loss_count(struct platform_device *pdev);
110 111
111/* Other */ 112/* Other */
112 113
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 7eaa8edf3b14..2825b456da0e 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -23,7 +23,7 @@
23 * - add pinmuxing 23 * - add pinmuxing
24 * - init_conn_id_bit (CONNID_BIT_VECTOR) 24 * - init_conn_id_bit (CONNID_BIT_VECTOR)
25 * - implement default hwmod SMS/SDRC flags? 25 * - implement default hwmod SMS/SDRC flags?
26 * - remove unused fields 26 * - move Linux-specific data ("non-ROM data") out
27 * 27 *
28 */ 28 */
29#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H 29#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
@@ -32,7 +32,7 @@
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/list.h> 33#include <linux/list.h>
34#include <linux/ioport.h> 34#include <linux/ioport.h>
35#include <linux/mutex.h> 35#include <linux/spinlock.h>
36#include <plat/cpu.h> 36#include <plat/cpu.h>
37 37
38struct omap_device; 38struct omap_device;
@@ -76,6 +76,8 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
76#define HWMOD_IDLEMODE_FORCE (1 << 0) 76#define HWMOD_IDLEMODE_FORCE (1 << 0)
77#define HWMOD_IDLEMODE_NO (1 << 1) 77#define HWMOD_IDLEMODE_NO (1 << 1)
78#define HWMOD_IDLEMODE_SMART (1 << 2) 78#define HWMOD_IDLEMODE_SMART (1 << 2)
79/* Slave idle mode flag only */
80#define HWMOD_IDLEMODE_SMART_WKUP (1 << 3)
79 81
80/** 82/**
81 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod 83 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
@@ -159,7 +161,7 @@ struct omap_hwmod_omap2_firewall {
159 * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init. 161 * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
160 * ADDR_TYPE_RT: Address space contains module register target data. 162 * ADDR_TYPE_RT: Address space contains module register target data.
161 */ 163 */
162#define ADDR_MAP_ON_INIT (1 << 0) 164#define ADDR_MAP_ON_INIT (1 << 0) /* XXX does not belong */
163#define ADDR_TYPE_RT (1 << 1) 165#define ADDR_TYPE_RT (1 << 1)
164 166
165/** 167/**
@@ -200,8 +202,6 @@ struct omap_hwmod_addr_space {
200 * @fw: interface firewall data 202 * @fw: interface firewall data
201 * @addr_cnt: ARRAY_SIZE(@addr) 203 * @addr_cnt: ARRAY_SIZE(@addr)
202 * @width: OCP data width 204 * @width: OCP data width
203 * @thread_cnt: number of threads
204 * @max_burst_len: maximum burst length in @width sized words (0 if unlimited)
205 * @user: initiators using this interface (see OCP_USER_* macros above) 205 * @user: initiators using this interface (see OCP_USER_* macros above)
206 * @flags: OCP interface flags (see OCPIF_* macros above) 206 * @flags: OCP interface flags (see OCPIF_* macros above)
207 * 207 *
@@ -221,8 +221,6 @@ struct omap_hwmod_ocp_if {
221 } fw; 221 } fw;
222 u8 addr_cnt; 222 u8 addr_cnt;
223 u8 width; 223 u8 width;
224 u8 thread_cnt;
225 u8 max_burst_len;
226 u8 user; 224 u8 user;
227 u8 flags; 225 u8 flags;
228}; 226};
@@ -231,11 +229,12 @@ struct omap_hwmod_ocp_if {
231/* Macros for use in struct omap_hwmod_sysconfig */ 229/* Macros for use in struct omap_hwmod_sysconfig */
232 230
233/* Flags for use in omap_hwmod_sysconfig.idlemodes */ 231/* Flags for use in omap_hwmod_sysconfig.idlemodes */
234#define MASTER_STANDBY_SHIFT 2 232#define MASTER_STANDBY_SHIFT 4
235#define SLAVE_IDLE_SHIFT 0 233#define SLAVE_IDLE_SHIFT 0
236#define SIDLE_FORCE (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT) 234#define SIDLE_FORCE (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT)
237#define SIDLE_NO (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT) 235#define SIDLE_NO (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT)
238#define SIDLE_SMART (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT) 236#define SIDLE_SMART (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT)
237#define SIDLE_SMART_WKUP (HWMOD_IDLEMODE_SMART_WKUP << SLAVE_IDLE_SHIFT)
239#define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT) 238#define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
240#define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT) 239#define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
241#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT) 240#define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
@@ -357,14 +356,14 @@ struct omap_hwmod_omap4_prcm {
357 * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out 356 * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
358 * of standby, rather than relying on module smart-standby 357 * of standby, rather than relying on module smart-standby
359 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for 358 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
360 * SDRAM controller, etc. 359 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
361 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM 360 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
362 * controller, etc. 361 * controller, etc. XXX probably belongs outside the main hwmod file
363 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE) 362 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
364 * when module is enabled, rather than the default, which is to 363 * when module is enabled, rather than the default, which is to
365 * enable autoidle 364 * enable autoidle
366 * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup 365 * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
367 * HWMOD_NO_IDLEST : this module does not have idle status - this is the case 366 * HWMOD_NO_IDLEST: this module does not have idle status - this is the case
368 * only for few initiator modules on OMAP2 & 3. 367 * only for few initiator modules on OMAP2 & 3.
369 * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset. 368 * HWMOD_CONTROL_OPT_CLKS_IN_RESET: Enable all optional clocks during reset.
370 * This is needed for devices like DSS that require optional clocks enabled 369 * This is needed for devices like DSS that require optional clocks enabled
@@ -415,14 +414,31 @@ struct omap_hwmod_omap4_prcm {
415 * @name: name of the hwmod_class 414 * @name: name of the hwmod_class
416 * @sysc: device SYSCONFIG/SYSSTATUS register data 415 * @sysc: device SYSCONFIG/SYSSTATUS register data
417 * @rev: revision of the IP class 416 * @rev: revision of the IP class
417 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
418 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
418 * 419 *
419 * Represent the class of a OMAP hardware "modules" (e.g. timer, 420 * Represent the class of a OMAP hardware "modules" (e.g. timer,
420 * smartreflex, gpio, uart...) 421 * smartreflex, gpio, uart...)
422 *
423 * @pre_shutdown is a function that will be run immediately before
424 * hwmod clocks are disabled, etc. It is intended for use for hwmods
425 * like the MPU watchdog, which cannot be disabled with the standard
426 * omap_hwmod_shutdown(). The function should return 0 upon success,
427 * or some negative error upon failure. Returning an error will cause
428 * omap_hwmod_shutdown() to abort the device shutdown and return an
429 * error.
430 *
431 * If @reset is defined, then the function it points to will be
432 * executed in place of the standard hwmod _reset() code in
433 * mach-omap2/omap_hwmod.c. This is needed for IP blocks which have
434 * unusual reset sequences - usually processor IP blocks like the IVA.
421 */ 435 */
422struct omap_hwmod_class { 436struct omap_hwmod_class {
423 const char *name; 437 const char *name;
424 struct omap_hwmod_class_sysconfig *sysc; 438 struct omap_hwmod_class_sysconfig *sysc;
425 u32 rev; 439 u32 rev;
440 int (*pre_shutdown)(struct omap_hwmod *oh);
441 int (*reset)(struct omap_hwmod *oh);
426}; 442};
427 443
428/** 444/**
@@ -442,8 +458,6 @@ struct omap_hwmod_class {
442 * @_sysc_cache: internal-use hwmod flags 458 * @_sysc_cache: internal-use hwmod flags
443 * @_mpu_rt_va: cached register target start address (internal use) 459 * @_mpu_rt_va: cached register target start address (internal use)
444 * @_mpu_port_index: cached MPU register target slave ID (internal use) 460 * @_mpu_port_index: cached MPU register target slave ID (internal use)
445 * @msuspendmux_reg_id: CONTROL_MSUSPENDMUX register ID (1-6)
446 * @msuspendmux_shift: CONTROL_MSUSPENDMUX register bit shift
447 * @mpu_irqs_cnt: number of @mpu_irqs 461 * @mpu_irqs_cnt: number of @mpu_irqs
448 * @sdma_reqs_cnt: number of @sdma_reqs 462 * @sdma_reqs_cnt: number of @sdma_reqs
449 * @opt_clks_cnt: number of @opt_clks 463 * @opt_clks_cnt: number of @opt_clks
@@ -452,9 +466,10 @@ struct omap_hwmod_class {
452 * @response_lat: device OCP response latency (in interface clock cycles) 466 * @response_lat: device OCP response latency (in interface clock cycles)
453 * @_int_flags: internal-use hwmod flags 467 * @_int_flags: internal-use hwmod flags
454 * @_state: internal-use hwmod state 468 * @_state: internal-use hwmod state
469 * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
455 * @flags: hwmod flags (documented below) 470 * @flags: hwmod flags (documented below)
456 * @omap_chip: OMAP chips this hwmod is present on 471 * @omap_chip: OMAP chips this hwmod is present on
457 * @_mutex: mutex serializing operations on this hwmod 472 * @_lock: spinlock serializing operations on this hwmod
458 * @node: list node for hwmod list (internal use) 473 * @node: list node for hwmod list (internal use)
459 * 474 *
460 * @main_clk refers to this module's "main clock," which for our 475 * @main_clk refers to this module's "main clock," which for our
@@ -484,12 +499,10 @@ struct omap_hwmod {
484 void *dev_attr; 499 void *dev_attr;
485 u32 _sysc_cache; 500 u32 _sysc_cache;
486 void __iomem *_mpu_rt_va; 501 void __iomem *_mpu_rt_va;
487 struct mutex _mutex; 502 spinlock_t _lock;
488 struct list_head node; 503 struct list_head node;
489 u16 flags; 504 u16 flags;
490 u8 _mpu_port_index; 505 u8 _mpu_port_index;
491 u8 msuspendmux_reg_id;
492 u8 msuspendmux_shift;
493 u8 response_lat; 506 u8 response_lat;
494 u8 mpu_irqs_cnt; 507 u8 mpu_irqs_cnt;
495 u8 sdma_reqs_cnt; 508 u8 sdma_reqs_cnt;
@@ -500,16 +513,15 @@ struct omap_hwmod {
500 u8 hwmods_cnt; 513 u8 hwmods_cnt;
501 u8 _int_flags; 514 u8 _int_flags;
502 u8 _state; 515 u8 _state;
516 u8 _postsetup_state;
503 const struct omap_chip_id omap_chip; 517 const struct omap_chip_id omap_chip;
504}; 518};
505 519
506int omap_hwmod_init(struct omap_hwmod **ohs); 520int omap_hwmod_init(struct omap_hwmod **ohs);
507int omap_hwmod_register(struct omap_hwmod *oh);
508int omap_hwmod_unregister(struct omap_hwmod *oh);
509struct omap_hwmod *omap_hwmod_lookup(const char *name); 521struct omap_hwmod *omap_hwmod_lookup(const char *name);
510int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), 522int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
511 void *data); 523 void *data);
512int omap_hwmod_late_init(u8 skip_setup_idle); 524int omap_hwmod_late_init(void);
513 525
514int omap_hwmod_enable(struct omap_hwmod *oh); 526int omap_hwmod_enable(struct omap_hwmod *oh);
515int _omap_hwmod_enable(struct omap_hwmod *oh); 527int _omap_hwmod_enable(struct omap_hwmod *oh);
@@ -556,6 +568,9 @@ int omap_hwmod_for_each_by_class(const char *classname,
556 void *user), 568 void *user),
557 void *user); 569 void *user);
558 570
571int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
572u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
573
559/* 574/*
560 * Chip variant-specific hwmod init routines - XXX should be converted 575 * Chip variant-specific hwmod init routines - XXX should be converted
561 * to use initcalls once the initial boot ordering is straightened out 576 * to use initcalls once the initial boot ordering is straightened out
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
index ab77442e42ab..2fdf8c80d390 100644
--- a/arch/arm/plat-omap/include/plat/prcm.h
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -18,6 +18,10 @@
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 * XXX This file is deprecated. The PRCM is an OMAP2+-only subsystem,
23 * so this file doesn't belong in plat-omap/include/plat. Please
24 * do not add anything new to this file.
21 */ 25 */
22 26
23#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H 27#ifndef __ASM_ARM_ARCH_OMAP_PRCM_H
@@ -28,22 +32,6 @@ void omap_prcm_arch_reset(char mode, const char *cmd);
28int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, 32int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
29 const char *name); 33 const char *name);
30 34
31#define START_PADCONF_SAVE 0x2
32#define PADCONF_SAVE_DONE 0x1
33
34void omap3_prcm_save_context(void);
35void omap3_prcm_restore_context(void);
36
37u32 prm_read_mod_reg(s16 module, u16 idx);
38void prm_write_mod_reg(u32 val, s16 module, u16 idx);
39u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
40u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask);
41u32 omap4_prm_read_bits_shift(void __iomem *reg, u32 mask);
42u32 omap4_prm_rmw_reg_bits(u32 mask, u32 bits, void __iomem *reg);
43u32 cm_read_mod_reg(s16 module, u16 idx);
44void cm_write_mod_reg(u32 val, s16 module, u16 idx);
45u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx);
46
47#endif 35#endif
48 36
49 37
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index fdecd339d4f8..b5a6e178a7f9 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -28,6 +28,8 @@
28#include <plat/dma.h> 28#include <plat/dma.h>
29#include <plat/mcbsp.h> 29#include <plat/mcbsp.h>
30 30
31/* XXX These "sideways" includes are a sign that something is wrong */
32#include "../mach-omap2/cm2xxx_3xxx.h"
31#include "../mach-omap2/cm-regbits-34xx.h" 33#include "../mach-omap2/cm-regbits-34xx.h"
32 34
33struct omap_mcbsp **mcbsp_ptr; 35struct omap_mcbsp **mcbsp_ptr;
@@ -234,9 +236,9 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
234 * Sidetone uses McBSP ICLK - which must not idle when sidetones 236 * Sidetone uses McBSP ICLK - which must not idle when sidetones
235 * are enabled or sidetones start sounding ugly. 237 * are enabled or sidetones start sounding ugly.
236 */ 238 */
237 w = cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE); 239 w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
238 w &= ~(1 << (mcbsp->id - 2)); 240 w &= ~(1 << (mcbsp->id - 2));
239 cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE); 241 omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
240 242
241 /* Enable McBSP Sidetone */ 243 /* Enable McBSP Sidetone */
242 w = MCBSP_READ(mcbsp, SSELCR); 244 w = MCBSP_READ(mcbsp, SSELCR);
@@ -263,9 +265,9 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
263 w = MCBSP_READ(mcbsp, SSELCR); 265 w = MCBSP_READ(mcbsp, SSELCR);
264 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN)); 266 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
265 267
266 w = cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE); 268 w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
267 w |= 1 << (mcbsp->id - 2); 269 w |= 1 << (mcbsp->id - 2);
268 cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE); 270 omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
269} 271}
270 272
271static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir) 273static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index ca75abb18068..b0471bb2d47d 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -20,11 +20,14 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/cpufreq.h> 21#include <linux/cpufreq.h>
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/platform_device.h>
23 24
24/* Interface documentation is in mach/omap-pm.h */ 25/* Interface documentation is in mach/omap-pm.h */
25#include <plat/omap-pm.h> 26#include <plat/omap-pm.h>
27#include <plat/omap_device.h>
26 28
27#include <plat/powerdomain.h> 29static bool off_mode_enabled;
30static u32 dummy_context_loss_counter;
28 31
29/* 32/*
30 * Device-driver-originated constraints (via board-*.c files) 33 * Device-driver-originated constraints (via board-*.c files)
@@ -280,28 +283,66 @@ unsigned long omap_pm_cpu_get_freq(void)
280 return 0; 283 return 0;
281} 284}
282 285
286/**
287 * omap_pm_enable_off_mode - notify OMAP PM that off-mode is enabled
288 *
289 * Intended for use only by OMAP PM core code to notify this layer
290 * that off mode has been enabled.
291 */
292void omap_pm_enable_off_mode(void)
293{
294 off_mode_enabled = true;
295}
296
297/**
298 * omap_pm_disable_off_mode - notify OMAP PM that off-mode is disabled
299 *
300 * Intended for use only by OMAP PM core code to notify this layer
301 * that off mode has been disabled.
302 */
303void omap_pm_disable_off_mode(void)
304{
305 off_mode_enabled = false;
306}
307
283/* 308/*
284 * Device context loss tracking 309 * Device context loss tracking
285 */ 310 */
286 311
287int omap_pm_get_dev_context_loss_count(struct device *dev) 312#ifdef CONFIG_ARCH_OMAP2PLUS
313
314u32 omap_pm_get_dev_context_loss_count(struct device *dev)
288{ 315{
289 if (!dev) { 316 struct platform_device *pdev = to_platform_device(dev);
290 WARN_ON(1); 317 u32 count;
291 return -EINVAL; 318
292 }; 319 if (WARN_ON(!dev))
320 return 0;
321
322 if (dev->parent == &omap_device_parent) {
323 count = omap_device_get_context_loss_count(pdev);
324 } else {
325 WARN_ONCE(off_mode_enabled, "omap_pm: using dummy context loss counter; device %s should be converted to omap_device",
326 dev_name(dev));
327 if (off_mode_enabled)
328 dummy_context_loss_counter++;
329 count = dummy_context_loss_counter;
330 }
293 331
294 pr_debug("OMAP PM: returning context loss count for dev %s\n", 332 pr_debug("OMAP PM: context loss count for dev %s = %d\n",
295 dev_name(dev)); 333 dev_name(dev), count);
296 334
297 /* 335 return count;
298 * Map the device to the powerdomain. Return the powerdomain 336}
299 * off counter.
300 */
301 337
302 return 0; 338#else
339
340u32 omap_pm_get_dev_context_loss_count(struct device *dev)
341{
342 return dummy_context_loss_counter;
303} 343}
304 344
345#endif
305 346
306/* Should be called before clk framework init */ 347/* Should be called before clk framework init */
307int __init omap_pm_if_early_init(void) 348int __init omap_pm_if_early_init(void)
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index abe933cd8f09..57adb270767b 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -280,6 +280,34 @@ static void _add_optional_clock_alias(struct omap_device *od,
280/* Public functions for use by core code */ 280/* Public functions for use by core code */
281 281
282/** 282/**
283 * omap_device_get_context_loss_count - get lost context count
284 * @od: struct omap_device *
285 *
286 * Using the primary hwmod, query the context loss count for this
287 * device.
288 *
289 * Callers should consider context for this device lost any time this
290 * function returns a value different than the value the caller got
291 * the last time it called this function.
292 *
293 * If any hwmods exist for the omap_device assoiated with @pdev,
294 * return the context loss counter for that hwmod, otherwise return
295 * zero.
296 */
297u32 omap_device_get_context_loss_count(struct platform_device *pdev)
298{
299 struct omap_device *od;
300 u32 ret = 0;
301
302 od = _find_by_pdev(pdev);
303
304 if (od->hwmods_cnt)
305 ret = omap_hwmod_get_context_loss_count(od->hwmods[0]);
306
307 return ret;
308}
309
310/**
283 * omap_device_count_resources - count number of struct resource entries needed 311 * omap_device_count_resources - count number of struct resource entries needed
284 * @od: struct omap_device * 312 * @od: struct omap_device *
285 * 313 *
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index 1a686c89d8dd..e26e50487d60 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -33,9 +33,10 @@
33 33
34#include "sram.h" 34#include "sram.h"
35#include "fb.h" 35#include "fb.h"
36
37/* XXX These "sideways" includes are a sign that something is wrong */
36#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) 38#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
37# include "../mach-omap2/prm.h" 39# include "../mach-omap2/prm2xxx_3xxx.h"
38# include "../mach-omap2/cm.h"
39# include "../mach-omap2/sdrc.h" 40# include "../mach-omap2/sdrc.h"
40#endif 41#endif
41 42