diff options
Diffstat (limited to 'arch/arm/mach-omap2')
113 files changed, 13852 insertions, 6261 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 10eafa70a909..a8a3d1e23e26 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -1,28 +1,19 @@ | |||
1 | comment "OMAP Core Type" | 1 | comment "OMAP Core Type" |
2 | depends on ARCH_OMAP2 | 2 | depends on ARCH_OMAP2 |
3 | 3 | ||
4 | config ARCH_OMAP24XX | ||
5 | bool "OMAP24xx Based System" | ||
6 | depends on ARCH_OMAP2 | ||
7 | |||
8 | config ARCH_OMAP2420 | 4 | config ARCH_OMAP2420 |
9 | bool "OMAP2420 support" | 5 | bool "OMAP2420 support" |
10 | depends on ARCH_OMAP24XX | 6 | depends on ARCH_OMAP2 |
11 | select OMAP_DM_TIMER | 7 | select OMAP_DM_TIMER |
12 | select ARCH_OMAP_OTG | 8 | select ARCH_OMAP_OTG |
13 | 9 | ||
14 | config ARCH_OMAP2430 | 10 | config ARCH_OMAP2430 |
15 | bool "OMAP2430 support" | 11 | bool "OMAP2430 support" |
16 | depends on ARCH_OMAP24XX | 12 | depends on ARCH_OMAP2 |
17 | |||
18 | config ARCH_OMAP34XX | ||
19 | bool "OMAP34xx Based System" | ||
20 | depends on ARCH_OMAP3 | ||
21 | select USB_ARCH_HAS_EHCI | ||
22 | 13 | ||
23 | config ARCH_OMAP3430 | 14 | config ARCH_OMAP3430 |
24 | bool "OMAP3430 support" | 15 | bool "OMAP3430 support" |
25 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 16 | depends on ARCH_OMAP3 |
26 | select ARCH_OMAP_OTG | 17 | select ARCH_OMAP_OTG |
27 | 18 | ||
28 | config OMAP_PACKAGE_CBC | 19 | config OMAP_PACKAGE_CBC |
@@ -38,11 +29,11 @@ config OMAP_PACKAGE_CBP | |||
38 | bool | 29 | bool |
39 | 30 | ||
40 | comment "OMAP Board Type" | 31 | comment "OMAP Board Type" |
41 | depends on ARCH_OMAP2 || ARCH_OMAP3 || ARCH_OMAP4 | 32 | depends on ARCH_OMAP2PLUS |
42 | 33 | ||
43 | config MACH_OMAP_GENERIC | 34 | config MACH_OMAP_GENERIC |
44 | bool "Generic OMAP board" | 35 | bool "Generic OMAP board" |
45 | depends on ARCH_OMAP2 && ARCH_OMAP24XX | 36 | depends on ARCH_OMAP2 |
46 | 37 | ||
47 | config MACH_OMAP2_TUSB6010 | 38 | config MACH_OMAP2_TUSB6010 |
48 | bool | 39 | bool |
@@ -51,54 +42,59 @@ config MACH_OMAP2_TUSB6010 | |||
51 | 42 | ||
52 | config MACH_OMAP_H4 | 43 | config MACH_OMAP_H4 |
53 | bool "OMAP 2420 H4 board" | 44 | bool "OMAP 2420 H4 board" |
54 | depends on ARCH_OMAP2 && ARCH_OMAP24XX | 45 | depends on ARCH_OMAP2 |
55 | select OMAP_DEBUG_DEVICES | 46 | select OMAP_DEBUG_DEVICES |
56 | 47 | ||
57 | config MACH_OMAP_APOLLON | 48 | config MACH_OMAP_APOLLON |
58 | bool "OMAP 2420 Apollon board" | 49 | bool "OMAP 2420 Apollon board" |
59 | depends on ARCH_OMAP2 && ARCH_OMAP24XX | 50 | depends on ARCH_OMAP2 |
60 | 51 | ||
61 | config MACH_OMAP_2430SDP | 52 | config MACH_OMAP_2430SDP |
62 | bool "OMAP 2430 SDP board" | 53 | bool "OMAP 2430 SDP board" |
63 | depends on ARCH_OMAP2 && ARCH_OMAP24XX | 54 | depends on ARCH_OMAP2 |
64 | 55 | ||
65 | config MACH_OMAP3_BEAGLE | 56 | config MACH_OMAP3_BEAGLE |
66 | bool "OMAP3 BEAGLE board" | 57 | bool "OMAP3 BEAGLE board" |
67 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 58 | depends on ARCH_OMAP3 |
68 | select OMAP_PACKAGE_CBB | 59 | select OMAP_PACKAGE_CBB |
69 | 60 | ||
61 | config MACH_DEVKIT8000 | ||
62 | bool "DEVKIT8000 board" | ||
63 | depends on ARCH_OMAP3 | ||
64 | |||
70 | config MACH_OMAP_LDP | 65 | config MACH_OMAP_LDP |
71 | bool "OMAP3 LDP board" | 66 | bool "OMAP3 LDP board" |
72 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 67 | depends on ARCH_OMAP3 |
73 | select OMAP_PACKAGE_CBB | 68 | select OMAP_PACKAGE_CBB |
74 | 69 | ||
75 | config MACH_OVERO | 70 | config MACH_OVERO |
76 | bool "Gumstix Overo board" | 71 | bool "Gumstix Overo board" |
77 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 72 | depends on ARCH_OMAP3 |
78 | select OMAP_PACKAGE_CBB | 73 | select OMAP_PACKAGE_CBB |
79 | 74 | ||
80 | config MACH_OMAP3EVM | 75 | config MACH_OMAP3EVM |
81 | bool "OMAP 3530 EVM board" | 76 | bool "OMAP 3530 EVM board" |
82 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 77 | depends on ARCH_OMAP3 |
78 | select OMAP_PACKAGE_CBB | ||
83 | 79 | ||
84 | config MACH_OMAP3517EVM | 80 | config MACH_OMAP3517EVM |
85 | bool "OMAP3517/ AM3517 EVM board" | 81 | bool "OMAP3517/ AM3517 EVM board" |
86 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 82 | depends on ARCH_OMAP3 |
87 | select OMAP_PACKAGE_CBB | 83 | select OMAP_PACKAGE_CBB |
88 | 84 | ||
89 | config MACH_OMAP3_PANDORA | 85 | config MACH_OMAP3_PANDORA |
90 | bool "OMAP3 Pandora" | 86 | bool "OMAP3 Pandora" |
91 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 87 | depends on ARCH_OMAP3 |
92 | select OMAP_PACKAGE_CBB | 88 | select OMAP_PACKAGE_CBB |
93 | 89 | ||
94 | config MACH_OMAP3_TOUCHBOOK | 90 | config MACH_OMAP3_TOUCHBOOK |
95 | bool "OMAP3 Touch Book" | 91 | bool "OMAP3 Touch Book" |
96 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 92 | depends on ARCH_OMAP3 |
97 | select BACKLIGHT_CLASS_DEVICE | 93 | select BACKLIGHT_CLASS_DEVICE |
98 | 94 | ||
99 | config MACH_OMAP_3430SDP | 95 | config MACH_OMAP_3430SDP |
100 | bool "OMAP 3430 SDP board" | 96 | bool "OMAP 3430 SDP board" |
101 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 97 | depends on ARCH_OMAP3 |
102 | select OMAP_PACKAGE_CBB | 98 | select OMAP_PACKAGE_CBB |
103 | 99 | ||
104 | config MACH_NOKIA_N800 | 100 | config MACH_NOKIA_N800 |
@@ -119,33 +115,33 @@ config MACH_NOKIA_N8X0 | |||
119 | 115 | ||
120 | config MACH_NOKIA_RX51 | 116 | config MACH_NOKIA_RX51 |
121 | bool "Nokia RX-51 board" | 117 | bool "Nokia RX-51 board" |
122 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 118 | depends on ARCH_OMAP3 |
123 | select OMAP_PACKAGE_CBB | 119 | select OMAP_PACKAGE_CBB |
124 | 120 | ||
125 | config MACH_OMAP_ZOOM2 | 121 | config MACH_OMAP_ZOOM2 |
126 | bool "OMAP3 Zoom2 board" | 122 | bool "OMAP3 Zoom2 board" |
127 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 123 | depends on ARCH_OMAP3 |
128 | select OMAP_PACKAGE_CBB | 124 | select OMAP_PACKAGE_CBB |
129 | 125 | ||
130 | config MACH_OMAP_ZOOM3 | 126 | config MACH_OMAP_ZOOM3 |
131 | bool "OMAP3630 Zoom3 board" | 127 | bool "OMAP3630 Zoom3 board" |
132 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 128 | depends on ARCH_OMAP3 |
133 | select OMAP_PACKAGE_CBP | 129 | select OMAP_PACKAGE_CBP |
134 | 130 | ||
135 | config MACH_CM_T35 | 131 | config MACH_CM_T35 |
136 | bool "CompuLab CM-T35 module" | 132 | bool "CompuLab CM-T35 module" |
137 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 133 | depends on ARCH_OMAP3 |
138 | select OMAP_PACKAGE_CUS | 134 | select OMAP_PACKAGE_CUS |
139 | select OMAP_MUX | 135 | select OMAP_MUX |
140 | 136 | ||
141 | config MACH_IGEP0020 | 137 | config MACH_IGEP0020 |
142 | bool "IGEP0020" | 138 | bool "IGEP v2 board" |
143 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 139 | depends on ARCH_OMAP3 |
144 | select OMAP_PACKAGE_CBB | 140 | select OMAP_PACKAGE_CBB |
145 | 141 | ||
146 | config MACH_OMAP_3630SDP | 142 | config MACH_OMAP_3630SDP |
147 | bool "OMAP3630 SDP board" | 143 | bool "OMAP3630 SDP board" |
148 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 144 | depends on ARCH_OMAP3 |
149 | select OMAP_PACKAGE_CBP | 145 | select OMAP_PACKAGE_CBP |
150 | 146 | ||
151 | config MACH_OMAP_4430SDP | 147 | config MACH_OMAP_4430SDP |
@@ -161,7 +157,7 @@ config OMAP3_EMU | |||
161 | 157 | ||
162 | config OMAP3_SDRC_AC_TIMING | 158 | config OMAP3_SDRC_AC_TIMING |
163 | bool "Enable SDRC AC timing register changes" | 159 | bool "Enable SDRC AC timing register changes" |
164 | depends on ARCH_OMAP3 && ARCH_OMAP34XX | 160 | depends on ARCH_OMAP3 |
165 | default n | 161 | default n |
166 | help | 162 | help |
167 | If you know that none of your system initiators will attempt to | 163 | If you know that none of your system initiators will attempt to |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index b32678b848bc..2069fb33baaa 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -5,15 +5,17 @@ | |||
5 | # Common support | 5 | # Common support |
6 | obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o | 6 | obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o |
7 | 7 | ||
8 | omap-2-3-common = irq.o sdrc.o omap_hwmod.o | 8 | omap-2-3-common = irq.o sdrc.o |
9 | omap-3-4-common = dpll.o | 9 | hwmod-common = omap_hwmod.o \ |
10 | omap_hwmod_common_data.o | ||
10 | prcm-common = prcm.o powerdomain.o | 11 | prcm-common = prcm.o powerdomain.o |
11 | clock-common = clock.o clock_common_data.o clockdomain.o | 12 | clock-common = clock.o clock_common_data.o \ |
13 | clockdomain.o clkt_dpll.o \ | ||
14 | clkt_clksel.o | ||
12 | 15 | ||
13 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(clock-common) | 16 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) |
14 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(clock-common) \ | 17 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(hwmod-common) |
15 | $(omap-3-4-common) | 18 | obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) |
16 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-3-4-common) prcm.o clock.o | ||
17 | 19 | ||
18 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | 20 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o |
19 | 21 | ||
@@ -26,6 +28,10 @@ obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o | |||
26 | obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o | 28 | obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o |
27 | obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o | 29 | obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o |
28 | 30 | ||
31 | AFLAGS_sram242x.o :=-Wa,-march=armv6 | ||
32 | AFLAGS_sram243x.o :=-Wa,-march=armv6 | ||
33 | AFLAGS_sram34xx.o :=-Wa,-march=armv7-a | ||
34 | |||
29 | # Pin multiplexing | 35 | # Pin multiplexing |
30 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o | 36 | obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o |
31 | 37 | ||
@@ -36,9 +42,13 @@ obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o | |||
36 | # Power Management | 42 | # Power Management |
37 | ifeq ($(CONFIG_PM),y) | 43 | ifeq ($(CONFIG_PM),y) |
38 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o | 44 | obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o |
39 | obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o | 45 | obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o |
40 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o | 46 | obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o |
41 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o | 47 | obj-$(CONFIG_PM_DEBUG) += pm-debug.o |
48 | |||
49 | AFLAGS_sleep24xx.o :=-Wa,-march=armv6 | ||
50 | AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a | ||
51 | |||
42 | endif | 52 | endif |
43 | 53 | ||
44 | # PRCM | 54 | # PRCM |
@@ -47,14 +57,31 @@ obj-$(CONFIG_ARCH_OMAP3) += cm.o | |||
47 | obj-$(CONFIG_ARCH_OMAP4) += cm4xxx.o | 57 | obj-$(CONFIG_ARCH_OMAP4) += cm4xxx.o |
48 | 58 | ||
49 | # Clock framework | 59 | # Clock framework |
50 | obj-$(CONFIG_ARCH_OMAP2) += clock2xxx.o clock2xxx_data.o | 60 | obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ |
61 | clkt2xxx_sys.o \ | ||
62 | clkt2xxx_dpllcore.o \ | ||
63 | clkt2xxx_virt_prcm_set.o \ | ||
64 | clkt2xxx_apll.o clkt2xxx_osc.o | ||
65 | obj-$(CONFIG_ARCH_OMAP2420) += clock2420_data.o | ||
66 | obj-$(CONFIG_ARCH_OMAP2430) += clock2430.o clock2430_data.o | ||
67 | obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \ | ||
68 | clock34xx.o clkt34xx_dpll3m2.o \ | ||
69 | clock3517.o clock36xx.o \ | ||
70 | dpll3xxx.o clock3xxx_data.o | ||
71 | obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \ | ||
72 | dpll3xxx.o | ||
73 | |||
74 | # OMAP2 clock rate set data (old "OPP" data) | ||
51 | obj-$(CONFIG_ARCH_OMAP2420) += opp2420_data.o | 75 | obj-$(CONFIG_ARCH_OMAP2420) += opp2420_data.o |
52 | obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clock34xx_data.o | ||
53 | obj-$(CONFIG_ARCH_OMAP2430) += opp2430_data.o | 76 | obj-$(CONFIG_ARCH_OMAP2430) += opp2430_data.o |
54 | obj-$(CONFIG_ARCH_OMAP4) += clock44xx.o clock44xx_data.o | 77 | |
78 | # hwmod data | ||
79 | obj-$(CONFIG_ARCH_OMAP2420) += omap_hwmod_2420_data.o | ||
80 | obj-$(CONFIG_ARCH_OMAP2430) += omap_hwmod_2430_data.o | ||
81 | obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o | ||
55 | 82 | ||
56 | # EMU peripherals | 83 | # EMU peripherals |
57 | obj-$(CONFIG_OMAP3_EMU) += emu.o | 84 | obj-$(CONFIG_OMAP3_EMU) += emu.o |
58 | 85 | ||
59 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o | 86 | obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o |
60 | mailbox_mach-objs := mailbox.o | 87 | mailbox_mach-objs := mailbox.o |
@@ -71,45 +98,48 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y) | |||
71 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o | 98 | obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o |
72 | obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o | 99 | obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o |
73 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \ | 100 | obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \ |
74 | mmc-twl4030.o | 101 | hsmmc.o |
75 | obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o | 102 | obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o |
76 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \ | 103 | obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \ |
77 | mmc-twl4030.o | 104 | hsmmc.o |
105 | obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o \ | ||
106 | hsmmc.o | ||
78 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ | 107 | obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ |
79 | mmc-twl4030.o | 108 | hsmmc.o |
80 | obj-$(CONFIG_MACH_OVERO) += board-overo.o \ | 109 | obj-$(CONFIG_MACH_OVERO) += board-overo.o \ |
81 | mmc-twl4030.o | 110 | hsmmc.o |
82 | obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \ | 111 | obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \ |
83 | mmc-twl4030.o | 112 | hsmmc.o |
84 | obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ | 113 | obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ |
85 | mmc-twl4030.o | 114 | hsmmc.o |
86 | obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ | 115 | obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ |
87 | mmc-twl4030.o | 116 | hsmmc.o \ |
117 | board-sdp-flash.o | ||
88 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o | 118 | obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o |
89 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ | 119 | obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ |
90 | board-rx51-sdram.o \ | 120 | board-rx51-sdram.o \ |
91 | board-rx51-peripherals.o \ | 121 | board-rx51-peripherals.o \ |
92 | mmc-twl4030.o | 122 | hsmmc.o |
93 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ | 123 | obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ |
94 | board-zoom-peripherals.o \ | 124 | board-zoom-peripherals.o \ |
95 | mmc-twl4030.o \ | 125 | hsmmc.o \ |
96 | board-zoom-debugboard.o | 126 | board-zoom-debugboard.o |
97 | obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \ | 127 | obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \ |
98 | board-zoom-peripherals.o \ | 128 | board-zoom-peripherals.o \ |
99 | mmc-twl4030.o \ | 129 | hsmmc.o \ |
100 | board-zoom-debugboard.o | 130 | board-zoom-debugboard.o |
101 | obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \ | 131 | obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \ |
102 | board-zoom-peripherals.o \ | 132 | board-zoom-peripherals.o \ |
103 | mmc-twl4030.o | 133 | hsmmc.o |
104 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ | 134 | obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ |
105 | mmc-twl4030.o | 135 | hsmmc.o |
106 | obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \ | 136 | obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \ |
107 | mmc-twl4030.o | 137 | hsmmc.o |
108 | obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \ | 138 | obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \ |
109 | mmc-twl4030.o | 139 | hsmmc.o |
110 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o | 140 | obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o |
111 | 141 | ||
112 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o | 142 | obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o |
113 | 143 | ||
114 | # Platform specific device init code | 144 | # Platform specific device init code |
115 | obj-y += usb-musb.o | 145 | obj-y += usb-musb.o |
@@ -119,5 +149,8 @@ obj-y += usb-ehci.o | |||
119 | onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o | 149 | onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o |
120 | obj-y += $(onenand-m) $(onenand-y) | 150 | obj-y += $(onenand-m) $(onenand-y) |
121 | 151 | ||
152 | nand-$(CONFIG_MTD_NAND_OMAP2) := gpmc-nand.o | ||
153 | obj-y += $(nand-m) $(nand-y) | ||
154 | |||
122 | smc91x-$(CONFIG_SMC91X) := gpmc-smc91x.o | 155 | smc91x-$(CONFIG_SMC91X) := gpmc-smc91x.o |
123 | obj-y += $(smc91x-m) $(smc91x-y) | 156 | obj-y += $(smc91x-m) $(smc91x-y) |
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index e508904fb67e..01d113ff9fcf 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
20 | #include <linux/mtd/partitions.h> | 20 | #include <linux/mtd/partitions.h> |
21 | #include <linux/mtd/physmap.h> | ||
21 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
22 | #include <linux/i2c/twl.h> | 23 | #include <linux/i2c/twl.h> |
23 | #include <linux/err.h> | 24 | #include <linux/err.h> |
@@ -28,7 +29,6 @@ | |||
28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
29 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
30 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
31 | #include <asm/mach/flash.h> | ||
32 | 32 | ||
33 | #include <mach/gpio.h> | 33 | #include <mach/gpio.h> |
34 | #include <plat/mux.h> | 34 | #include <plat/mux.h> |
@@ -38,7 +38,7 @@ | |||
38 | #include <plat/usb.h> | 38 | #include <plat/usb.h> |
39 | #include <plat/gpmc-smc91x.h> | 39 | #include <plat/gpmc-smc91x.h> |
40 | 40 | ||
41 | #include "mmc-twl4030.h" | 41 | #include "hsmmc.h" |
42 | 42 | ||
43 | #define SDP2430_CS0_BASE 0x04000000 | 43 | #define SDP2430_CS0_BASE 0x04000000 |
44 | #define SECONDARY_LCD_GPIO 147 | 44 | #define SECONDARY_LCD_GPIO 147 |
@@ -74,8 +74,7 @@ static struct mtd_partition sdp2430_partitions[] = { | |||
74 | } | 74 | } |
75 | }; | 75 | }; |
76 | 76 | ||
77 | static struct flash_platform_data sdp2430_flash_data = { | 77 | static struct physmap_flash_data sdp2430_flash_data = { |
78 | .map_name = "cfi_probe", | ||
79 | .width = 2, | 78 | .width = 2, |
80 | .parts = sdp2430_partitions, | 79 | .parts = sdp2430_partitions, |
81 | .nr_parts = ARRAY_SIZE(sdp2430_partitions), | 80 | .nr_parts = ARRAY_SIZE(sdp2430_partitions), |
@@ -88,7 +87,7 @@ static struct resource sdp2430_flash_resource = { | |||
88 | }; | 87 | }; |
89 | 88 | ||
90 | static struct platform_device sdp2430_flash_device = { | 89 | static struct platform_device sdp2430_flash_device = { |
91 | .name = "omapflash", | 90 | .name = "physmap-flash", |
92 | .id = 0, | 91 | .id = 0, |
93 | .dev = { | 92 | .dev = { |
94 | .platform_data = &sdp2430_flash_data, | 93 | .platform_data = &sdp2430_flash_data, |
@@ -183,7 +182,7 @@ static int __init omap2430_i2c_init(void) | |||
183 | return 0; | 182 | return 0; |
184 | } | 183 | } |
185 | 184 | ||
186 | static struct twl4030_hsmmc_info mmc[] __initdata = { | 185 | static struct omap2_hsmmc_info mmc[] __initdata = { |
187 | { | 186 | { |
188 | .mmc = 1, | 187 | .mmc = 1, |
189 | .wires = 4, | 188 | .wires = 4, |
@@ -194,6 +193,12 @@ static struct twl4030_hsmmc_info mmc[] __initdata = { | |||
194 | {} /* Terminator */ | 193 | {} /* Terminator */ |
195 | }; | 194 | }; |
196 | 195 | ||
196 | static struct omap_musb_board_data musb_board_data = { | ||
197 | .interface_type = MUSB_INTERFACE_ULPI, | ||
198 | .mode = MUSB_OTG, | ||
199 | .power = 100, | ||
200 | }; | ||
201 | |||
197 | static void __init omap_2430sdp_init(void) | 202 | static void __init omap_2430sdp_init(void) |
198 | { | 203 | { |
199 | int ret; | 204 | int ret; |
@@ -202,8 +207,8 @@ static void __init omap_2430sdp_init(void) | |||
202 | 207 | ||
203 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); | 208 | platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); |
204 | omap_serial_init(); | 209 | omap_serial_init(); |
205 | twl4030_mmc_init(mmc); | 210 | omap2_hsmmc_init(mmc); |
206 | usb_musb_init(); | 211 | usb_musb_init(&musb_board_data); |
207 | board_smc91x_init(); | 212 | board_smc91x_init(); |
208 | 213 | ||
209 | /* Turn off secondary LCD backlight */ | 214 | /* Turn off secondary LCD backlight */ |
@@ -215,7 +220,7 @@ static void __init omap_2430sdp_init(void) | |||
215 | static void __init omap_2430sdp_map_io(void) | 220 | static void __init omap_2430sdp_map_io(void) |
216 | { | 221 | { |
217 | omap2_set_globals_243x(); | 222 | omap2_set_globals_243x(); |
218 | omap2_map_common_io(); | 223 | omap243x_map_common_io(); |
219 | } | 224 | } |
220 | 225 | ||
221 | MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") | 226 | MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") |
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 964c390c2f39..a101029ceb6f 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -41,9 +41,12 @@ | |||
41 | #include <plat/control.h> | 41 | #include <plat/control.h> |
42 | #include <plat/gpmc-smc91x.h> | 42 | #include <plat/gpmc-smc91x.h> |
43 | 43 | ||
44 | #include <mach/board-sdp.h> | ||
45 | |||
44 | #include "mux.h" | 46 | #include "mux.h" |
45 | #include "sdram-qimonda-hyb18m512160af-6.h" | 47 | #include "sdram-qimonda-hyb18m512160af-6.h" |
46 | #include "mmc-twl4030.h" | 48 | #include "hsmmc.h" |
49 | #include "pm.h" | ||
47 | 50 | ||
48 | #define CONFIG_DISABLE_HFCLK 1 | 51 | #define CONFIG_DISABLE_HFCLK 1 |
49 | 52 | ||
@@ -55,6 +58,24 @@ | |||
55 | 58 | ||
56 | #define TWL4030_MSECURE_GPIO 22 | 59 | #define TWL4030_MSECURE_GPIO 22 |
57 | 60 | ||
61 | /* FIXME: These values need to be updated based on more profiling on 3430sdp*/ | ||
62 | static struct cpuidle_params omap3_cpuidle_params_table[] = { | ||
63 | /* C1 */ | ||
64 | {1, 2, 2, 5}, | ||
65 | /* C2 */ | ||
66 | {1, 10, 10, 30}, | ||
67 | /* C3 */ | ||
68 | {1, 50, 50, 300}, | ||
69 | /* C4 */ | ||
70 | {1, 1500, 1800, 4000}, | ||
71 | /* C5 */ | ||
72 | {1, 2500, 7500, 12000}, | ||
73 | /* C6 */ | ||
74 | {1, 3000, 8500, 15000}, | ||
75 | /* C7 */ | ||
76 | {1, 10000, 30000, 300000}, | ||
77 | }; | ||
78 | |||
58 | static int board_keymap[] = { | 79 | static int board_keymap[] = { |
59 | KEY(0, 0, KEY_LEFT), | 80 | KEY(0, 0, KEY_LEFT), |
60 | KEY(0, 1, KEY_RIGHT), | 81 | KEY(0, 1, KEY_RIGHT), |
@@ -305,6 +326,7 @@ static void __init omap_3430sdp_init_irq(void) | |||
305 | { | 326 | { |
306 | omap_board_config = sdp3430_config; | 327 | omap_board_config = sdp3430_config; |
307 | omap_board_config_size = ARRAY_SIZE(sdp3430_config); | 328 | omap_board_config_size = ARRAY_SIZE(sdp3430_config); |
329 | omap3_pm_init_cpuidle(omap3_cpuidle_params_table); | ||
308 | omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL); | 330 | omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL); |
309 | omap_init_irq(); | 331 | omap_init_irq(); |
310 | omap_gpio_init(); | 332 | omap_gpio_init(); |
@@ -326,7 +348,7 @@ static struct twl4030_bci_platform_data sdp3430_bci_data = { | |||
326 | .tblsize = ARRAY_SIZE(sdp3430_batt_table), | 348 | .tblsize = ARRAY_SIZE(sdp3430_batt_table), |
327 | }; | 349 | }; |
328 | 350 | ||
329 | static struct twl4030_hsmmc_info mmc[] = { | 351 | static struct omap2_hsmmc_info mmc[] = { |
330 | { | 352 | { |
331 | .mmc = 1, | 353 | .mmc = 1, |
332 | /* 8 bits (default) requires S6.3 == ON, | 354 | /* 8 bits (default) requires S6.3 == ON, |
@@ -363,7 +385,7 @@ static int sdp3430_twl_gpio_setup(struct device *dev, | |||
363 | */ | 385 | */ |
364 | mmc[0].gpio_cd = gpio + 0; | 386 | mmc[0].gpio_cd = gpio + 0; |
365 | mmc[1].gpio_cd = gpio + 1; | 387 | mmc[1].gpio_cd = gpio + 1; |
366 | twl4030_mmc_init(mmc); | 388 | omap2_hsmmc_init(mmc); |
367 | 389 | ||
368 | /* link regulators to MMC adapters ... we "know" the | 390 | /* link regulators to MMC adapters ... we "know" the |
369 | * regulators will be set up only *after* we return. | 391 | * regulators will be set up only *after* we return. |
@@ -646,6 +668,120 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
646 | #define board_mux NULL | 668 | #define board_mux NULL |
647 | #endif | 669 | #endif |
648 | 670 | ||
671 | static struct mtd_partition sdp_nor_partitions[] = { | ||
672 | /* bootloader (U-Boot, etc) in first sector */ | ||
673 | { | ||
674 | .name = "Bootloader-NOR", | ||
675 | .offset = 0, | ||
676 | .size = SZ_256K, | ||
677 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
678 | }, | ||
679 | /* bootloader params in the next sector */ | ||
680 | { | ||
681 | .name = "Params-NOR", | ||
682 | .offset = MTDPART_OFS_APPEND, | ||
683 | .size = SZ_256K, | ||
684 | .mask_flags = 0, | ||
685 | }, | ||
686 | /* kernel */ | ||
687 | { | ||
688 | .name = "Kernel-NOR", | ||
689 | .offset = MTDPART_OFS_APPEND, | ||
690 | .size = SZ_2M, | ||
691 | .mask_flags = 0 | ||
692 | }, | ||
693 | /* file system */ | ||
694 | { | ||
695 | .name = "Filesystem-NOR", | ||
696 | .offset = MTDPART_OFS_APPEND, | ||
697 | .size = MTDPART_SIZ_FULL, | ||
698 | .mask_flags = 0 | ||
699 | } | ||
700 | }; | ||
701 | |||
702 | static struct mtd_partition sdp_onenand_partitions[] = { | ||
703 | { | ||
704 | .name = "X-Loader-OneNAND", | ||
705 | .offset = 0, | ||
706 | .size = 4 * (64 * 2048), | ||
707 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
708 | }, | ||
709 | { | ||
710 | .name = "U-Boot-OneNAND", | ||
711 | .offset = MTDPART_OFS_APPEND, | ||
712 | .size = 2 * (64 * 2048), | ||
713 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
714 | }, | ||
715 | { | ||
716 | .name = "U-Boot Environment-OneNAND", | ||
717 | .offset = MTDPART_OFS_APPEND, | ||
718 | .size = 1 * (64 * 2048), | ||
719 | }, | ||
720 | { | ||
721 | .name = "Kernel-OneNAND", | ||
722 | .offset = MTDPART_OFS_APPEND, | ||
723 | .size = 16 * (64 * 2048), | ||
724 | }, | ||
725 | { | ||
726 | .name = "File System-OneNAND", | ||
727 | .offset = MTDPART_OFS_APPEND, | ||
728 | .size = MTDPART_SIZ_FULL, | ||
729 | }, | ||
730 | }; | ||
731 | |||
732 | static struct mtd_partition sdp_nand_partitions[] = { | ||
733 | /* All the partition sizes are listed in terms of NAND block size */ | ||
734 | { | ||
735 | .name = "X-Loader-NAND", | ||
736 | .offset = 0, | ||
737 | .size = 4 * (64 * 2048), | ||
738 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
739 | }, | ||
740 | { | ||
741 | .name = "U-Boot-NAND", | ||
742 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ | ||
743 | .size = 10 * (64 * 2048), | ||
744 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
745 | }, | ||
746 | { | ||
747 | .name = "Boot Env-NAND", | ||
748 | |||
749 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ | ||
750 | .size = 6 * (64 * 2048), | ||
751 | }, | ||
752 | { | ||
753 | .name = "Kernel-NAND", | ||
754 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ | ||
755 | .size = 40 * (64 * 2048), | ||
756 | }, | ||
757 | { | ||
758 | .name = "File System - NAND", | ||
759 | .size = MTDPART_SIZ_FULL, | ||
760 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */ | ||
761 | }, | ||
762 | }; | ||
763 | |||
764 | static struct flash_partitions sdp_flash_partitions[] = { | ||
765 | { | ||
766 | .parts = sdp_nor_partitions, | ||
767 | .nr_parts = ARRAY_SIZE(sdp_nor_partitions), | ||
768 | }, | ||
769 | { | ||
770 | .parts = sdp_onenand_partitions, | ||
771 | .nr_parts = ARRAY_SIZE(sdp_onenand_partitions), | ||
772 | }, | ||
773 | { | ||
774 | .parts = sdp_nand_partitions, | ||
775 | .nr_parts = ARRAY_SIZE(sdp_nand_partitions), | ||
776 | }, | ||
777 | }; | ||
778 | |||
779 | static struct omap_musb_board_data musb_board_data = { | ||
780 | .interface_type = MUSB_INTERFACE_ULPI, | ||
781 | .mode = MUSB_OTG, | ||
782 | .power = 100, | ||
783 | }; | ||
784 | |||
649 | static void __init omap_3430sdp_init(void) | 785 | static void __init omap_3430sdp_init(void) |
650 | { | 786 | { |
651 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 787 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -660,8 +796,9 @@ static void __init omap_3430sdp_init(void) | |||
660 | ARRAY_SIZE(sdp3430_spi_board_info)); | 796 | ARRAY_SIZE(sdp3430_spi_board_info)); |
661 | ads7846_dev_init(); | 797 | ads7846_dev_init(); |
662 | omap_serial_init(); | 798 | omap_serial_init(); |
663 | usb_musb_init(); | 799 | usb_musb_init(&musb_board_data); |
664 | board_smc91x_init(); | 800 | board_smc91x_init(); |
801 | sdp_flash_init(sdp_flash_partitions); | ||
665 | sdp3430_display_init(); | 802 | sdp3430_display_init(); |
666 | enable_board_wakeup_source(); | 803 | enable_board_wakeup_source(); |
667 | usb_ehci_init(&ehci_pdata); | 804 | usb_ehci_init(&ehci_pdata); |
@@ -670,7 +807,7 @@ static void __init omap_3430sdp_init(void) | |||
670 | static void __init omap_3430sdp_map_io(void) | 807 | static void __init omap_3430sdp_map_io(void) |
671 | { | 808 | { |
672 | omap2_set_globals_343x(); | 809 | omap2_set_globals_343x(); |
673 | omap2_map_common_io(); | 810 | omap34xx_map_common_io(); |
674 | } | 811 | } |
675 | 812 | ||
676 | MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") | 813 | MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") |
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index 739059632811..4386d2b4a785 100755 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c | |||
@@ -68,8 +68,8 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
68 | 68 | ||
69 | static void __init omap_sdp_map_io(void) | 69 | static void __init omap_sdp_map_io(void) |
70 | { | 70 | { |
71 | omap2_set_globals_343x(); | 71 | omap2_set_globals_36xx(); |
72 | omap2_map_common_io(); | 72 | omap34xx_map_common_io(); |
73 | } | 73 | } |
74 | 74 | ||
75 | static struct omap_board_config_kernel sdp_config[] __initdata = { | 75 | static struct omap_board_config_kernel sdp_config[] __initdata = { |
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 0c6be6b4a7e2..180ac112e527 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/usb/otg.h> | ||
20 | 21 | ||
21 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
@@ -27,7 +28,9 @@ | |||
27 | #include <plat/common.h> | 28 | #include <plat/common.h> |
28 | #include <plat/control.h> | 29 | #include <plat/control.h> |
29 | #include <plat/timer-gp.h> | 30 | #include <plat/timer-gp.h> |
31 | #include <plat/usb.h> | ||
30 | #include <asm/hardware/gic.h> | 32 | #include <asm/hardware/gic.h> |
33 | #include <asm/hardware/cache-l2x0.h> | ||
31 | 34 | ||
32 | static struct platform_device sdp4430_lcd_device = { | 35 | static struct platform_device sdp4430_lcd_device = { |
33 | .name = "sdp4430_lcd", | 36 | .name = "sdp4430_lcd", |
@@ -38,10 +41,6 @@ static struct platform_device *sdp4430_devices[] __initdata = { | |||
38 | &sdp4430_lcd_device, | 41 | &sdp4430_lcd_device, |
39 | }; | 42 | }; |
40 | 43 | ||
41 | static struct omap_uart_config sdp4430_uart_config __initdata = { | ||
42 | .enabled_uarts = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3), | ||
43 | }; | ||
44 | |||
45 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { | 44 | static struct omap_lcd_config sdp4430_lcd_config __initdata = { |
46 | .ctrl_name = "internal", | 45 | .ctrl_name = "internal", |
47 | }; | 46 | }; |
@@ -50,6 +49,59 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = { | |||
50 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, | 49 | { OMAP_TAG_LCD, &sdp4430_lcd_config }, |
51 | }; | 50 | }; |
52 | 51 | ||
52 | #ifdef CONFIG_CACHE_L2X0 | ||
53 | noinline void omap_smc1(u32 fn, u32 arg) | ||
54 | { | ||
55 | register u32 r12 asm("r12") = fn; | ||
56 | register u32 r0 asm("r0") = arg; | ||
57 | |||
58 | /* This is common routine cache secure monitor API used to | ||
59 | * modify the PL310 secure registers. | ||
60 | * r0 contains the value to be modified and "r12" contains | ||
61 | * the monitor API number. It uses few CPU registers | ||
62 | * internally and hence they need be backed up including | ||
63 | * link register "lr". | ||
64 | * Explicitly save r11 and r12 the compiler generated code | ||
65 | * won't save it. | ||
66 | */ | ||
67 | asm volatile( | ||
68 | "stmfd r13!, {r11,r12}\n" | ||
69 | "dsb\n" | ||
70 | "smc\n" | ||
71 | "ldmfd r13!, {r11,r12}\n" | ||
72 | : "+r" (r0), "+r" (r12) | ||
73 | : | ||
74 | : "r4", "r5", "r10", "lr", "cc"); | ||
75 | } | ||
76 | EXPORT_SYMBOL(omap_smc1); | ||
77 | |||
78 | static int __init omap_l2_cache_init(void) | ||
79 | { | ||
80 | void __iomem *l2cache_base; | ||
81 | |||
82 | /* To avoid code running on other OMAPs in | ||
83 | * multi-omap builds | ||
84 | */ | ||
85 | if (!cpu_is_omap44xx()) | ||
86 | return -ENODEV; | ||
87 | |||
88 | /* Static mapping, never released */ | ||
89 | l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K); | ||
90 | BUG_ON(!l2cache_base); | ||
91 | |||
92 | /* Enable PL310 L2 Cache controller */ | ||
93 | omap_smc1(0x102, 0x1); | ||
94 | |||
95 | /* 32KB way size, 16-way associativity, | ||
96 | * parity disabled | ||
97 | */ | ||
98 | l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff); | ||
99 | |||
100 | return 0; | ||
101 | } | ||
102 | early_initcall(omap_l2_cache_init); | ||
103 | #endif | ||
104 | |||
53 | static void __init gic_init_irq(void) | 105 | static void __init gic_init_irq(void) |
54 | { | 106 | { |
55 | void __iomem *base; | 107 | void __iomem *base; |
@@ -77,17 +129,27 @@ static void __init omap_4430sdp_init_irq(void) | |||
77 | omap_gpio_init(); | 129 | omap_gpio_init(); |
78 | } | 130 | } |
79 | 131 | ||
132 | static struct omap_musb_board_data musb_board_data = { | ||
133 | .interface_type = MUSB_INTERFACE_UTMI, | ||
134 | .mode = MUSB_PERIPHERAL, | ||
135 | .power = 100, | ||
136 | }; | ||
80 | 137 | ||
81 | static void __init omap_4430sdp_init(void) | 138 | static void __init omap_4430sdp_init(void) |
82 | { | 139 | { |
83 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); | 140 | platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); |
84 | omap_serial_init(); | 141 | omap_serial_init(); |
142 | /* OMAP4 SDP uses internal transceiver so register nop transceiver */ | ||
143 | usb_nop_xceiv_register(); | ||
144 | /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ | ||
145 | if (!cpu_is_omap44xx()) | ||
146 | usb_musb_init(&musb_board_data); | ||
85 | } | 147 | } |
86 | 148 | ||
87 | static void __init omap_4430sdp_map_io(void) | 149 | static void __init omap_4430sdp_map_io(void) |
88 | { | 150 | { |
89 | omap2_set_globals_443x(); | 151 | omap2_set_globals_443x(); |
90 | omap2_map_common_io(); | 152 | omap44xx_map_common_io(); |
91 | } | 153 | } |
92 | 154 | ||
93 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") | 155 | MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") |
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index b4e6eca0e8a9..70c18614773c 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c | |||
@@ -20,8 +20,10 @@ | |||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/i2c/pca953x.h> | ||
23 | 24 | ||
24 | #include <mach/hardware.h> | 25 | #include <mach/hardware.h> |
26 | #include <mach/am35xx.h> | ||
25 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
26 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
@@ -29,9 +31,228 @@ | |||
29 | #include <plat/board.h> | 31 | #include <plat/board.h> |
30 | #include <plat/common.h> | 32 | #include <plat/common.h> |
31 | #include <plat/usb.h> | 33 | #include <plat/usb.h> |
34 | #include <plat/display.h> | ||
32 | 35 | ||
33 | #include "mux.h" | 36 | #include "mux.h" |
34 | 37 | ||
38 | #define LCD_PANEL_PWR 176 | ||
39 | #define LCD_PANEL_BKLIGHT_PWR 182 | ||
40 | #define LCD_PANEL_PWM 181 | ||
41 | |||
42 | static struct i2c_board_info __initdata am3517evm_i2c_boardinfo[] = { | ||
43 | { | ||
44 | I2C_BOARD_INFO("s35390a", 0x30), | ||
45 | .type = "s35390a", | ||
46 | }, | ||
47 | }; | ||
48 | |||
49 | /* | ||
50 | * RTC - S35390A | ||
51 | */ | ||
52 | #define GPIO_RTCS35390A_IRQ 55 | ||
53 | |||
54 | static void __init am3517_evm_rtc_init(void) | ||
55 | { | ||
56 | int r; | ||
57 | |||
58 | omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP); | ||
59 | r = gpio_request(GPIO_RTCS35390A_IRQ, "rtcs35390a-irq"); | ||
60 | if (r < 0) { | ||
61 | printk(KERN_WARNING "failed to request GPIO#%d\n", | ||
62 | GPIO_RTCS35390A_IRQ); | ||
63 | return; | ||
64 | } | ||
65 | r = gpio_direction_input(GPIO_RTCS35390A_IRQ); | ||
66 | if (r < 0) { | ||
67 | printk(KERN_WARNING "GPIO#%d cannot be configured as input\n", | ||
68 | GPIO_RTCS35390A_IRQ); | ||
69 | gpio_free(GPIO_RTCS35390A_IRQ); | ||
70 | return; | ||
71 | } | ||
72 | am3517evm_i2c_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ); | ||
73 | } | ||
74 | |||
75 | /* | ||
76 | * I2C GPIO Expander - TCA6416 | ||
77 | */ | ||
78 | |||
79 | /* Mounted on Base-Board */ | ||
80 | static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = { | ||
81 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
82 | }; | ||
83 | static struct i2c_board_info __initdata am3517evm_tca6416_info_0[] = { | ||
84 | { | ||
85 | I2C_BOARD_INFO("tca6416", 0x21), | ||
86 | .platform_data = &am3517evm_gpio_expander_info_0, | ||
87 | }, | ||
88 | }; | ||
89 | |||
90 | /* Mounted on UI Card */ | ||
91 | static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = { | ||
92 | .gpio_base = OMAP_MAX_GPIO_LINES + 16, | ||
93 | }; | ||
94 | static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = { | ||
95 | .gpio_base = OMAP_MAX_GPIO_LINES + 32, | ||
96 | }; | ||
97 | static struct i2c_board_info __initdata am3517evm_ui_tca6416_info[] = { | ||
98 | { | ||
99 | I2C_BOARD_INFO("tca6416", 0x20), | ||
100 | .platform_data = &am3517evm_ui_gpio_expander_info_1, | ||
101 | }, | ||
102 | { | ||
103 | I2C_BOARD_INFO("tca6416", 0x21), | ||
104 | .platform_data = &am3517evm_ui_gpio_expander_info_2, | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | static int __init am3517_evm_i2c_init(void) | ||
109 | { | ||
110 | omap_register_i2c_bus(1, 400, NULL, 0); | ||
111 | omap_register_i2c_bus(2, 400, am3517evm_tca6416_info_0, | ||
112 | ARRAY_SIZE(am3517evm_tca6416_info_0)); | ||
113 | omap_register_i2c_bus(3, 400, am3517evm_ui_tca6416_info, | ||
114 | ARRAY_SIZE(am3517evm_ui_tca6416_info)); | ||
115 | |||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static int lcd_enabled; | ||
120 | static int dvi_enabled; | ||
121 | |||
122 | static void __init am3517_evm_display_init(void) | ||
123 | { | ||
124 | int r; | ||
125 | |||
126 | omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP); | ||
127 | omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN); | ||
128 | omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN); | ||
129 | /* | ||
130 | * Enable GPIO 182 = LCD Backlight Power | ||
131 | */ | ||
132 | r = gpio_request(LCD_PANEL_BKLIGHT_PWR, "lcd_backlight_pwr"); | ||
133 | if (r) { | ||
134 | printk(KERN_ERR "failed to get lcd_backlight_pwr\n"); | ||
135 | return; | ||
136 | } | ||
137 | gpio_direction_output(LCD_PANEL_BKLIGHT_PWR, 1); | ||
138 | /* | ||
139 | * Enable GPIO 181 = LCD Panel PWM | ||
140 | */ | ||
141 | r = gpio_request(LCD_PANEL_PWM, "lcd_pwm"); | ||
142 | if (r) { | ||
143 | printk(KERN_ERR "failed to get lcd_pwm\n"); | ||
144 | goto err_1; | ||
145 | } | ||
146 | gpio_direction_output(LCD_PANEL_PWM, 1); | ||
147 | /* | ||
148 | * Enable GPIO 176 = LCD Panel Power enable pin | ||
149 | */ | ||
150 | r = gpio_request(LCD_PANEL_PWR, "lcd_panel_pwr"); | ||
151 | if (r) { | ||
152 | printk(KERN_ERR "failed to get lcd_panel_pwr\n"); | ||
153 | goto err_2; | ||
154 | } | ||
155 | gpio_direction_output(LCD_PANEL_PWR, 1); | ||
156 | |||
157 | printk(KERN_INFO "Display initialized successfully\n"); | ||
158 | return; | ||
159 | |||
160 | err_2: | ||
161 | gpio_free(LCD_PANEL_PWM); | ||
162 | err_1: | ||
163 | gpio_free(LCD_PANEL_BKLIGHT_PWR); | ||
164 | } | ||
165 | |||
166 | static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
167 | { | ||
168 | if (dvi_enabled) { | ||
169 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
170 | return -EINVAL; | ||
171 | } | ||
172 | gpio_set_value(LCD_PANEL_PWR, 1); | ||
173 | lcd_enabled = 1; | ||
174 | |||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
179 | { | ||
180 | gpio_set_value(LCD_PANEL_PWR, 0); | ||
181 | lcd_enabled = 0; | ||
182 | } | ||
183 | |||
184 | static struct omap_dss_device am3517_evm_lcd_device = { | ||
185 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
186 | .name = "lcd", | ||
187 | .driver_name = "sharp_lq_panel", | ||
188 | .phy.dpi.data_lines = 16, | ||
189 | .platform_enable = am3517_evm_panel_enable_lcd, | ||
190 | .platform_disable = am3517_evm_panel_disable_lcd, | ||
191 | }; | ||
192 | |||
193 | static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev) | ||
194 | { | ||
195 | return 0; | ||
196 | } | ||
197 | |||
198 | static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev) | ||
199 | { | ||
200 | } | ||
201 | |||
202 | static struct omap_dss_device am3517_evm_tv_device = { | ||
203 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
204 | .name = "tv", | ||
205 | .driver_name = "venc", | ||
206 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
207 | .platform_enable = am3517_evm_panel_enable_tv, | ||
208 | .platform_disable = am3517_evm_panel_disable_tv, | ||
209 | }; | ||
210 | |||
211 | static int am3517_evm_panel_enable_dvi(struct omap_dss_device *dssdev) | ||
212 | { | ||
213 | if (lcd_enabled) { | ||
214 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
215 | return -EINVAL; | ||
216 | } | ||
217 | dvi_enabled = 1; | ||
218 | |||
219 | return 0; | ||
220 | } | ||
221 | |||
222 | static void am3517_evm_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
223 | { | ||
224 | dvi_enabled = 0; | ||
225 | } | ||
226 | |||
227 | static struct omap_dss_device am3517_evm_dvi_device = { | ||
228 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
229 | .name = "dvi", | ||
230 | .driver_name = "generic_panel", | ||
231 | .phy.dpi.data_lines = 24, | ||
232 | .platform_enable = am3517_evm_panel_enable_dvi, | ||
233 | .platform_disable = am3517_evm_panel_disable_dvi, | ||
234 | }; | ||
235 | |||
236 | static struct omap_dss_device *am3517_evm_dss_devices[] = { | ||
237 | &am3517_evm_lcd_device, | ||
238 | &am3517_evm_tv_device, | ||
239 | &am3517_evm_dvi_device, | ||
240 | }; | ||
241 | |||
242 | static struct omap_dss_board_info am3517_evm_dss_data = { | ||
243 | .num_devices = ARRAY_SIZE(am3517_evm_dss_devices), | ||
244 | .devices = am3517_evm_dss_devices, | ||
245 | .default_device = &am3517_evm_lcd_device, | ||
246 | }; | ||
247 | |||
248 | struct platform_device am3517_evm_dss_device = { | ||
249 | .name = "omapdss", | ||
250 | .id = -1, | ||
251 | .dev = { | ||
252 | .platform_data = &am3517_evm_dss_data, | ||
253 | }, | ||
254 | }; | ||
255 | |||
35 | /* | 256 | /* |
36 | * Board initialization | 257 | * Board initialization |
37 | */ | 258 | */ |
@@ -39,6 +260,7 @@ static struct omap_board_config_kernel am3517_evm_config[] __initdata = { | |||
39 | }; | 260 | }; |
40 | 261 | ||
41 | static struct platform_device *am3517_evm_devices[] __initdata = { | 262 | static struct platform_device *am3517_evm_devices[] __initdata = { |
263 | &am3517_evm_dss_device, | ||
42 | }; | 264 | }; |
43 | 265 | ||
44 | static void __init am3517_evm_init_irq(void) | 266 | static void __init am3517_evm_init_irq(void) |
@@ -72,18 +294,31 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
72 | 294 | ||
73 | static void __init am3517_evm_init(void) | 295 | static void __init am3517_evm_init(void) |
74 | { | 296 | { |
297 | am3517_evm_i2c_init(); | ||
298 | |||
75 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 299 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
76 | platform_add_devices(am3517_evm_devices, | 300 | platform_add_devices(am3517_evm_devices, |
77 | ARRAY_SIZE(am3517_evm_devices)); | 301 | ARRAY_SIZE(am3517_evm_devices)); |
78 | 302 | ||
79 | omap_serial_init(); | 303 | omap_serial_init(); |
304 | |||
305 | /* Configure GPIO for EHCI port */ | ||
306 | omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); | ||
80 | usb_ehci_init(&ehci_pdata); | 307 | usb_ehci_init(&ehci_pdata); |
308 | /* DSS */ | ||
309 | am3517_evm_display_init(); | ||
310 | |||
311 | /* RTC - S35390A */ | ||
312 | am3517_evm_rtc_init(); | ||
313 | |||
314 | i2c_register_board_info(1, am3517evm_i2c_boardinfo, | ||
315 | ARRAY_SIZE(am3517evm_i2c_boardinfo)); | ||
81 | } | 316 | } |
82 | 317 | ||
83 | static void __init am3517_evm_map_io(void) | 318 | static void __init am3517_evm_map_io(void) |
84 | { | 319 | { |
85 | omap2_set_globals_343x(); | 320 | omap2_set_globals_343x(); |
86 | omap2_map_common_io(); | 321 | omap34xx_map_common_io(); |
87 | } | 322 | } |
88 | 323 | ||
89 | MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") | 324 | MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") |
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index fbbd68d69cc8..aa69fb999748 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c | |||
@@ -337,7 +337,7 @@ static void __init omap_apollon_init(void) | |||
337 | static void __init omap_apollon_map_io(void) | 337 | static void __init omap_apollon_map_io(void) |
338 | { | 338 | { |
339 | omap2_set_globals_242x(); | 339 | omap2_set_globals_242x(); |
340 | omap2_map_common_io(); | 340 | omap242x_map_common_io(); |
341 | } | 341 | } |
342 | 342 | ||
343 | MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") | 343 | MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") |
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 2626a9f8a73a..afa77caaff4d 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -32,6 +32,9 @@ | |||
32 | #include <linux/i2c/twl.h> | 32 | #include <linux/i2c/twl.h> |
33 | #include <linux/regulator/machine.h> | 33 | #include <linux/regulator/machine.h> |
34 | 34 | ||
35 | #include <linux/spi/spi.h> | ||
36 | #include <linux/spi/tdo24m.h> | ||
37 | |||
35 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
36 | #include <asm/mach/arch.h> | 39 | #include <asm/mach/arch.h> |
37 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
@@ -41,12 +44,13 @@ | |||
41 | #include <plat/nand.h> | 44 | #include <plat/nand.h> |
42 | #include <plat/gpmc.h> | 45 | #include <plat/gpmc.h> |
43 | #include <plat/usb.h> | 46 | #include <plat/usb.h> |
47 | #include <plat/display.h> | ||
44 | 48 | ||
45 | #include <mach/hardware.h> | 49 | #include <mach/hardware.h> |
46 | 50 | ||
47 | #include "mux.h" | 51 | #include "mux.h" |
48 | #include "sdram-micron-mt46h32m32lf-6.h" | 52 | #include "sdram-micron-mt46h32m32lf-6.h" |
49 | #include "mmc-twl4030.h" | 53 | #include "hsmmc.h" |
50 | 54 | ||
51 | #define CM_T35_GPIO_PENDOWN 57 | 55 | #define CM_T35_GPIO_PENDOWN 57 |
52 | 56 | ||
@@ -248,7 +252,6 @@ static inline void cm_t35_init_nand(void) {} | |||
248 | 252 | ||
249 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ | 253 | #if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ |
250 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) | 254 | defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) |
251 | #include <linux/spi/spi.h> | ||
252 | #include <linux/spi/ads7846.h> | 255 | #include <linux/spi/ads7846.h> |
253 | 256 | ||
254 | #include <plat/mcspi.h> | 257 | #include <plat/mcspi.h> |
@@ -304,6 +307,193 @@ static void __init cm_t35_init_ads7846(void) | |||
304 | static inline void cm_t35_init_ads7846(void) {} | 307 | static inline void cm_t35_init_ads7846(void) {} |
305 | #endif | 308 | #endif |
306 | 309 | ||
310 | #define CM_T35_LCD_EN_GPIO 157 | ||
311 | #define CM_T35_LCD_BL_GPIO 58 | ||
312 | #define CM_T35_DVI_EN_GPIO 54 | ||
313 | |||
314 | static int lcd_bl_gpio; | ||
315 | static int lcd_en_gpio; | ||
316 | static int dvi_en_gpio; | ||
317 | |||
318 | static int lcd_enabled; | ||
319 | static int dvi_enabled; | ||
320 | |||
321 | static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
322 | { | ||
323 | if (dvi_enabled) { | ||
324 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
325 | return -EINVAL; | ||
326 | } | ||
327 | |||
328 | gpio_set_value(lcd_en_gpio, 1); | ||
329 | gpio_set_value(lcd_bl_gpio, 1); | ||
330 | |||
331 | lcd_enabled = 1; | ||
332 | |||
333 | return 0; | ||
334 | } | ||
335 | |||
336 | static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
337 | { | ||
338 | lcd_enabled = 0; | ||
339 | |||
340 | gpio_set_value(lcd_bl_gpio, 0); | ||
341 | gpio_set_value(lcd_en_gpio, 0); | ||
342 | } | ||
343 | |||
344 | static int cm_t35_panel_enable_dvi(struct omap_dss_device *dssdev) | ||
345 | { | ||
346 | if (lcd_enabled) { | ||
347 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
348 | return -EINVAL; | ||
349 | } | ||
350 | |||
351 | gpio_set_value(dvi_en_gpio, 0); | ||
352 | dvi_enabled = 1; | ||
353 | |||
354 | return 0; | ||
355 | } | ||
356 | |||
357 | static void cm_t35_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
358 | { | ||
359 | gpio_set_value(dvi_en_gpio, 1); | ||
360 | dvi_enabled = 0; | ||
361 | } | ||
362 | |||
363 | static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev) | ||
364 | { | ||
365 | return 0; | ||
366 | } | ||
367 | |||
368 | static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev) | ||
369 | { | ||
370 | } | ||
371 | |||
372 | static struct omap_dss_device cm_t35_lcd_device = { | ||
373 | .name = "lcd", | ||
374 | .driver_name = "toppoly_tdo35s_panel", | ||
375 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
376 | .phy.dpi.data_lines = 18, | ||
377 | .platform_enable = cm_t35_panel_enable_lcd, | ||
378 | .platform_disable = cm_t35_panel_disable_lcd, | ||
379 | }; | ||
380 | |||
381 | static struct omap_dss_device cm_t35_dvi_device = { | ||
382 | .name = "dvi", | ||
383 | .driver_name = "generic_panel", | ||
384 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
385 | .phy.dpi.data_lines = 24, | ||
386 | .platform_enable = cm_t35_panel_enable_dvi, | ||
387 | .platform_disable = cm_t35_panel_disable_dvi, | ||
388 | }; | ||
389 | |||
390 | static struct omap_dss_device cm_t35_tv_device = { | ||
391 | .name = "tv", | ||
392 | .driver_name = "venc", | ||
393 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
394 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
395 | .platform_enable = cm_t35_panel_enable_tv, | ||
396 | .platform_disable = cm_t35_panel_disable_tv, | ||
397 | }; | ||
398 | |||
399 | static struct omap_dss_device *cm_t35_dss_devices[] = { | ||
400 | &cm_t35_lcd_device, | ||
401 | &cm_t35_dvi_device, | ||
402 | &cm_t35_tv_device, | ||
403 | }; | ||
404 | |||
405 | static struct omap_dss_board_info cm_t35_dss_data = { | ||
406 | .num_devices = ARRAY_SIZE(cm_t35_dss_devices), | ||
407 | .devices = cm_t35_dss_devices, | ||
408 | .default_device = &cm_t35_dvi_device, | ||
409 | }; | ||
410 | |||
411 | static struct platform_device cm_t35_dss_device = { | ||
412 | .name = "omapdss", | ||
413 | .id = -1, | ||
414 | .dev = { | ||
415 | .platform_data = &cm_t35_dss_data, | ||
416 | }, | ||
417 | }; | ||
418 | |||
419 | static struct omap2_mcspi_device_config tdo24m_mcspi_config = { | ||
420 | .turbo_mode = 0, | ||
421 | .single_channel = 1, /* 0: slave, 1: master */ | ||
422 | }; | ||
423 | |||
424 | static struct tdo24m_platform_data tdo24m_config = { | ||
425 | .model = TDO35S, | ||
426 | }; | ||
427 | |||
428 | static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = { | ||
429 | { | ||
430 | .modalias = "tdo24m", | ||
431 | .bus_num = 4, | ||
432 | .chip_select = 0, | ||
433 | .max_speed_hz = 1000000, | ||
434 | .controller_data = &tdo24m_mcspi_config, | ||
435 | .platform_data = &tdo24m_config, | ||
436 | }, | ||
437 | }; | ||
438 | |||
439 | static void __init cm_t35_init_display(void) | ||
440 | { | ||
441 | int err; | ||
442 | |||
443 | lcd_en_gpio = CM_T35_LCD_EN_GPIO; | ||
444 | lcd_bl_gpio = CM_T35_LCD_BL_GPIO; | ||
445 | dvi_en_gpio = CM_T35_DVI_EN_GPIO; | ||
446 | |||
447 | spi_register_board_info(cm_t35_lcd_spi_board_info, | ||
448 | ARRAY_SIZE(cm_t35_lcd_spi_board_info)); | ||
449 | |||
450 | err = gpio_request(lcd_en_gpio, "LCD RST"); | ||
451 | if (err) { | ||
452 | pr_err("CM-T35: failed to get LCD reset GPIO\n"); | ||
453 | goto out; | ||
454 | } | ||
455 | |||
456 | err = gpio_request(lcd_bl_gpio, "LCD BL"); | ||
457 | if (err) { | ||
458 | pr_err("CM-T35: failed to get LCD backlight control GPIO\n"); | ||
459 | goto err_lcd_bl; | ||
460 | } | ||
461 | |||
462 | err = gpio_request(dvi_en_gpio, "DVI EN"); | ||
463 | if (err) { | ||
464 | pr_err("CM-T35: failed to get DVI reset GPIO\n"); | ||
465 | goto err_dvi_en; | ||
466 | } | ||
467 | |||
468 | gpio_export(lcd_en_gpio, 0); | ||
469 | gpio_export(lcd_bl_gpio, 0); | ||
470 | gpio_export(dvi_en_gpio, 0); | ||
471 | gpio_direction_output(lcd_en_gpio, 0); | ||
472 | gpio_direction_output(lcd_bl_gpio, 0); | ||
473 | gpio_direction_output(dvi_en_gpio, 1); | ||
474 | |||
475 | msleep(50); | ||
476 | gpio_set_value(lcd_en_gpio, 1); | ||
477 | |||
478 | err = platform_device_register(&cm_t35_dss_device); | ||
479 | if (err) { | ||
480 | pr_err("CM-T35: failed to register DSS device\n"); | ||
481 | goto err_dev_reg; | ||
482 | } | ||
483 | |||
484 | return; | ||
485 | |||
486 | err_dev_reg: | ||
487 | gpio_free(dvi_en_gpio); | ||
488 | err_dvi_en: | ||
489 | gpio_free(lcd_bl_gpio); | ||
490 | err_lcd_bl: | ||
491 | gpio_free(lcd_en_gpio); | ||
492 | out: | ||
493 | |||
494 | return; | ||
495 | } | ||
496 | |||
307 | static struct regulator_consumer_supply cm_t35_vmmc1_supply = { | 497 | static struct regulator_consumer_supply cm_t35_vmmc1_supply = { |
308 | .supply = "vmmc", | 498 | .supply = "vmmc", |
309 | }; | 499 | }; |
@@ -312,6 +502,16 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = { | |||
312 | .supply = "vmmc_aux", | 502 | .supply = "vmmc_aux", |
313 | }; | 503 | }; |
314 | 504 | ||
505 | static struct regulator_consumer_supply cm_t35_vdac_supply = { | ||
506 | .supply = "vdda_dac", | ||
507 | .dev = &cm_t35_dss_device.dev, | ||
508 | }; | ||
509 | |||
510 | static struct regulator_consumer_supply cm_t35_vdvi_supply = { | ||
511 | .supply = "vdvi", | ||
512 | .dev = &cm_t35_dss_device.dev, | ||
513 | }; | ||
514 | |||
315 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 515 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
316 | static struct regulator_init_data cm_t35_vmmc1 = { | 516 | static struct regulator_init_data cm_t35_vmmc1 = { |
317 | .constraints = { | 517 | .constraints = { |
@@ -342,6 +542,35 @@ static struct regulator_init_data cm_t35_vsim = { | |||
342 | .consumer_supplies = &cm_t35_vsim_supply, | 542 | .consumer_supplies = &cm_t35_vsim_supply, |
343 | }; | 543 | }; |
344 | 544 | ||
545 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | ||
546 | static struct regulator_init_data cm_t35_vdac = { | ||
547 | .constraints = { | ||
548 | .min_uV = 1800000, | ||
549 | .max_uV = 1800000, | ||
550 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
551 | | REGULATOR_MODE_STANDBY, | ||
552 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
553 | | REGULATOR_CHANGE_STATUS, | ||
554 | }, | ||
555 | .num_consumer_supplies = 1, | ||
556 | .consumer_supplies = &cm_t35_vdac_supply, | ||
557 | }; | ||
558 | |||
559 | /* VPLL2 for digital video outputs */ | ||
560 | static struct regulator_init_data cm_t35_vpll2 = { | ||
561 | .constraints = { | ||
562 | .name = "VDVI", | ||
563 | .min_uV = 1800000, | ||
564 | .max_uV = 1800000, | ||
565 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
566 | | REGULATOR_MODE_STANDBY, | ||
567 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
568 | | REGULATOR_CHANGE_STATUS, | ||
569 | }, | ||
570 | .num_consumer_supplies = 1, | ||
571 | .consumer_supplies = &cm_t35_vdvi_supply, | ||
572 | }; | ||
573 | |||
345 | static struct twl4030_usb_data cm_t35_usb_data = { | 574 | static struct twl4030_usb_data cm_t35_usb_data = { |
346 | .usb_mode = T2_USB_MODE_ULPI, | 575 | .usb_mode = T2_USB_MODE_ULPI, |
347 | }; | 576 | }; |
@@ -364,7 +593,7 @@ static struct twl4030_keypad_data cm_t35_kp_data = { | |||
364 | .rep = 1, | 593 | .rep = 1, |
365 | }; | 594 | }; |
366 | 595 | ||
367 | static struct twl4030_hsmmc_info mmc[] = { | 596 | static struct omap2_hsmmc_info mmc[] = { |
368 | { | 597 | { |
369 | .mmc = 1, | 598 | .mmc = 1, |
370 | .wires = 4, | 599 | .wires = 4, |
@@ -413,7 +642,7 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, | |||
413 | 642 | ||
414 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 643 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
415 | mmc[0].gpio_cd = gpio + 0; | 644 | mmc[0].gpio_cd = gpio + 0; |
416 | twl4030_mmc_init(mmc); | 645 | omap2_hsmmc_init(mmc); |
417 | 646 | ||
418 | /* link regulators to MMC adapters */ | 647 | /* link regulators to MMC adapters */ |
419 | cm_t35_vmmc1_supply.dev = mmc[0].dev; | 648 | cm_t35_vmmc1_supply.dev = mmc[0].dev; |
@@ -445,6 +674,8 @@ static struct twl4030_platform_data cm_t35_twldata = { | |||
445 | .gpio = &cm_t35_gpio_data, | 674 | .gpio = &cm_t35_gpio_data, |
446 | .vmmc1 = &cm_t35_vmmc1, | 675 | .vmmc1 = &cm_t35_vmmc1, |
447 | .vsim = &cm_t35_vsim, | 676 | .vsim = &cm_t35_vsim, |
677 | .vdac = &cm_t35_vdac, | ||
678 | .vpll2 = &cm_t35_vpll2, | ||
448 | }; | 679 | }; |
449 | 680 | ||
450 | static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = { | 681 | static struct i2c_board_info __initdata cm_t35_i2c_boardinfo[] = { |
@@ -479,7 +710,7 @@ static void __init cm_t35_init_irq(void) | |||
479 | static void __init cm_t35_map_io(void) | 710 | static void __init cm_t35_map_io(void) |
480 | { | 711 | { |
481 | omap2_set_globals_343x(); | 712 | omap2_set_globals_343x(); |
482 | omap2_map_common_io(); | 713 | omap34xx_map_common_io(); |
483 | } | 714 | } |
484 | 715 | ||
485 | static struct omap_board_mux board_mux[] __initdata = { | 716 | static struct omap_board_mux board_mux[] __initdata = { |
@@ -568,6 +799,11 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
568 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), | 799 | OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), |
569 | OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), | 800 | OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT), |
570 | 801 | ||
802 | /* display controls */ | ||
803 | OMAP3_MUX(MCBSP1_FSR, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
804 | OMAP3_MUX(GPMC_NCS7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
805 | OMAP3_MUX(GPMC_NCS3, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), | ||
806 | |||
571 | /* TPS IRQ */ | 807 | /* TPS IRQ */ |
572 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \ | 808 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_WAKEUP_EN | \ |
573 | OMAP_PIN_INPUT_PULLUP), | 809 | OMAP_PIN_INPUT_PULLUP), |
@@ -575,6 +811,12 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
575 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 811 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
576 | }; | 812 | }; |
577 | 813 | ||
814 | static struct omap_musb_board_data musb_board_data = { | ||
815 | .interface_type = MUSB_INTERFACE_ULPI, | ||
816 | .mode = MUSB_OTG, | ||
817 | .power = 100, | ||
818 | }; | ||
819 | |||
578 | static void __init cm_t35_init(void) | 820 | static void __init cm_t35_init(void) |
579 | { | 821 | { |
580 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 822 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
@@ -584,8 +826,9 @@ static void __init cm_t35_init(void) | |||
584 | cm_t35_init_ads7846(); | 826 | cm_t35_init_ads7846(); |
585 | cm_t35_init_ethernet(); | 827 | cm_t35_init_ethernet(); |
586 | cm_t35_init_led(); | 828 | cm_t35_init_led(); |
829 | cm_t35_init_display(); | ||
587 | 830 | ||
588 | usb_musb_init(); | 831 | usb_musb_init(&musb_board_data); |
589 | } | 832 | } |
590 | 833 | ||
591 | MACHINE_START(CM_T35, "Compulab CM-T35") | 834 | MACHINE_START(CM_T35, "Compulab CM-T35") |
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c new file mode 100644 index 000000000000..371019054b49 --- /dev/null +++ b/arch/arm/mach-omap2/board-devkit8000.c | |||
@@ -0,0 +1,697 @@ | |||
1 | /* | ||
2 | * board-devkit8000.c - TimLL Devkit8000 | ||
3 | * | ||
4 | * Copyright (C) 2009 Kim Botherway | ||
5 | * Copyright (C) 2010 Thomas Weber | ||
6 | * | ||
7 | * Modified from mach-omap2/board-omap3beagle.c | ||
8 | * | ||
9 | * Initial code: Syed Mohammed Khasim | ||
10 | * | ||
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 | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | #include <linux/leds.h> | ||
24 | #include <linux/gpio.h> | ||
25 | #include <linux/input.h> | ||
26 | #include <linux/gpio_keys.h> | ||
27 | |||
28 | #include <linux/mtd/mtd.h> | ||
29 | #include <linux/mtd/partitions.h> | ||
30 | #include <linux/mtd/nand.h> | ||
31 | |||
32 | #include <linux/regulator/machine.h> | ||
33 | #include <linux/i2c/twl.h> | ||
34 | |||
35 | #include <mach/hardware.h> | ||
36 | #include <asm/mach-types.h> | ||
37 | #include <asm/mach/arch.h> | ||
38 | #include <asm/mach/map.h> | ||
39 | #include <asm/mach/flash.h> | ||
40 | |||
41 | #include <plat/board.h> | ||
42 | #include <plat/common.h> | ||
43 | #include <plat/gpmc.h> | ||
44 | #include <plat/nand.h> | ||
45 | #include <plat/usb.h> | ||
46 | #include <plat/timer-gp.h> | ||
47 | #include <plat/display.h> | ||
48 | |||
49 | #include <plat/mcspi.h> | ||
50 | #include <linux/input/matrix_keypad.h> | ||
51 | #include <linux/spi/spi.h> | ||
52 | #include <linux/spi/ads7846.h> | ||
53 | #include <linux/usb/otg.h> | ||
54 | #include <linux/dm9000.h> | ||
55 | #include <linux/interrupt.h> | ||
56 | |||
57 | #include "sdram-micron-mt46h32m32lf-6.h" | ||
58 | |||
59 | #include "mux.h" | ||
60 | #include "hsmmc.h" | ||
61 | |||
62 | #define GPMC_CS0_BASE 0x60 | ||
63 | #define GPMC_CS_SIZE 0x30 | ||
64 | |||
65 | #define NAND_BLOCK_SIZE SZ_128K | ||
66 | |||
67 | #define OMAP_DM9000_GPIO_IRQ 25 | ||
68 | #define OMAP3_DEVKIT_TS_GPIO 27 | ||
69 | |||
70 | static struct mtd_partition devkit8000_nand_partitions[] = { | ||
71 | /* All the partition sizes are listed in terms of NAND block size */ | ||
72 | { | ||
73 | .name = "X-Loader", | ||
74 | .offset = 0, | ||
75 | .size = 4 * NAND_BLOCK_SIZE, | ||
76 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
77 | }, | ||
78 | { | ||
79 | .name = "U-Boot", | ||
80 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ | ||
81 | .size = 15 * NAND_BLOCK_SIZE, | ||
82 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
83 | }, | ||
84 | { | ||
85 | .name = "U-Boot Env", | ||
86 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */ | ||
87 | .size = 1 * NAND_BLOCK_SIZE, | ||
88 | }, | ||
89 | { | ||
90 | .name = "Kernel", | ||
91 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ | ||
92 | .size = 32 * NAND_BLOCK_SIZE, | ||
93 | }, | ||
94 | { | ||
95 | .name = "File System", | ||
96 | .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */ | ||
97 | .size = MTDPART_SIZ_FULL, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct omap_nand_platform_data devkit8000_nand_data = { | ||
102 | .options = NAND_BUSWIDTH_16, | ||
103 | .parts = devkit8000_nand_partitions, | ||
104 | .nr_parts = ARRAY_SIZE(devkit8000_nand_partitions), | ||
105 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | ||
106 | }; | ||
107 | |||
108 | static struct resource devkit8000_nand_resource = { | ||
109 | .flags = IORESOURCE_MEM, | ||
110 | }; | ||
111 | |||
112 | static struct platform_device devkit8000_nand_device = { | ||
113 | .name = "omap2-nand", | ||
114 | .id = -1, | ||
115 | .dev = { | ||
116 | .platform_data = &devkit8000_nand_data, | ||
117 | }, | ||
118 | .num_resources = 1, | ||
119 | .resource = &devkit8000_nand_resource, | ||
120 | }; | ||
121 | |||
122 | static struct omap2_hsmmc_info mmc[] = { | ||
123 | { | ||
124 | .mmc = 1, | ||
125 | .wires = 8, | ||
126 | .gpio_wp = 29, | ||
127 | }, | ||
128 | {} /* Terminator */ | ||
129 | }; | ||
130 | static struct omap_board_config_kernel devkit8000_config[] __initdata = { | ||
131 | }; | ||
132 | |||
133 | static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev) | ||
134 | { | ||
135 | twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1); | ||
136 | twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0); | ||
137 | |||
138 | return 0; | ||
139 | } | ||
140 | |||
141 | static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev) | ||
142 | { | ||
143 | } | ||
144 | static int devkit8000_panel_enable_dvi(struct omap_dss_device *dssdev) | ||
145 | { | ||
146 | return 0; | ||
147 | } | ||
148 | |||
149 | static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) | ||
150 | { | ||
151 | } | ||
152 | |||
153 | static int devkit8000_panel_enable_tv(struct omap_dss_device *dssdev) | ||
154 | { | ||
155 | |||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | static void devkit8000_panel_disable_tv(struct omap_dss_device *dssdev) | ||
160 | { | ||
161 | } | ||
162 | |||
163 | |||
164 | static struct regulator_consumer_supply devkit8000_vmmc1_supply = { | ||
165 | .supply = "vmmc", | ||
166 | }; | ||
167 | |||
168 | static struct regulator_consumer_supply devkit8000_vsim_supply = { | ||
169 | .supply = "vmmc_aux", | ||
170 | }; | ||
171 | |||
172 | |||
173 | static struct omap_dss_device devkit8000_lcd_device = { | ||
174 | .name = "lcd", | ||
175 | .driver_name = "innolux_at_panel", | ||
176 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
177 | .phy.dpi.data_lines = 24, | ||
178 | .platform_enable = devkit8000_panel_enable_lcd, | ||
179 | .platform_disable = devkit8000_panel_disable_lcd, | ||
180 | }; | ||
181 | static struct omap_dss_device devkit8000_dvi_device = { | ||
182 | .name = "dvi", | ||
183 | .driver_name = "generic_panel", | ||
184 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
185 | .phy.dpi.data_lines = 24, | ||
186 | .platform_enable = devkit8000_panel_enable_dvi, | ||
187 | .platform_disable = devkit8000_panel_disable_dvi, | ||
188 | }; | ||
189 | |||
190 | static struct omap_dss_device devkit8000_tv_device = { | ||
191 | .name = "tv", | ||
192 | .driver_name = "venc", | ||
193 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
194 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
195 | .platform_enable = devkit8000_panel_enable_tv, | ||
196 | .platform_disable = devkit8000_panel_disable_tv, | ||
197 | }; | ||
198 | |||
199 | |||
200 | static struct omap_dss_device *devkit8000_dss_devices[] = { | ||
201 | &devkit8000_lcd_device, | ||
202 | &devkit8000_dvi_device, | ||
203 | &devkit8000_tv_device, | ||
204 | }; | ||
205 | |||
206 | static struct omap_dss_board_info devkit8000_dss_data = { | ||
207 | .num_devices = ARRAY_SIZE(devkit8000_dss_devices), | ||
208 | .devices = devkit8000_dss_devices, | ||
209 | .default_device = &devkit8000_lcd_device, | ||
210 | }; | ||
211 | |||
212 | static struct platform_device devkit8000_dss_device = { | ||
213 | .name = "omapdss", | ||
214 | .id = -1, | ||
215 | .dev = { | ||
216 | .platform_data = &devkit8000_dss_data, | ||
217 | }, | ||
218 | }; | ||
219 | |||
220 | static struct regulator_consumer_supply devkit8000_vdda_dac_supply = { | ||
221 | .supply = "vdda_dac", | ||
222 | .dev = &devkit8000_dss_device.dev, | ||
223 | }; | ||
224 | |||
225 | static int board_keymap[] = { | ||
226 | KEY(0, 0, KEY_1), | ||
227 | KEY(1, 0, KEY_2), | ||
228 | KEY(2, 0, KEY_3), | ||
229 | KEY(0, 1, KEY_4), | ||
230 | KEY(1, 1, KEY_5), | ||
231 | KEY(2, 1, KEY_6), | ||
232 | KEY(3, 1, KEY_F5), | ||
233 | KEY(0, 2, KEY_7), | ||
234 | KEY(1, 2, KEY_8), | ||
235 | KEY(2, 2, KEY_9), | ||
236 | KEY(3, 2, KEY_F6), | ||
237 | KEY(0, 3, KEY_F7), | ||
238 | KEY(1, 3, KEY_0), | ||
239 | KEY(2, 3, KEY_F8), | ||
240 | PERSISTENT_KEY(4, 5), | ||
241 | KEY(4, 4, KEY_VOLUMEUP), | ||
242 | KEY(5, 5, KEY_VOLUMEDOWN), | ||
243 | 0 | ||
244 | }; | ||
245 | |||
246 | static struct matrix_keymap_data board_map_data = { | ||
247 | .keymap = board_keymap, | ||
248 | .keymap_size = ARRAY_SIZE(board_keymap), | ||
249 | }; | ||
250 | |||
251 | static struct twl4030_keypad_data devkit8000_kp_data = { | ||
252 | .keymap_data = &board_map_data, | ||
253 | .rows = 6, | ||
254 | .cols = 6, | ||
255 | .rep = 1, | ||
256 | }; | ||
257 | |||
258 | static struct gpio_led gpio_leds[]; | ||
259 | |||
260 | static int devkit8000_twl_gpio_setup(struct device *dev, | ||
261 | unsigned gpio, unsigned ngpio) | ||
262 | { | ||
263 | omap_mux_init_gpio(29, OMAP_PIN_INPUT); | ||
264 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | ||
265 | mmc[0].gpio_cd = gpio + 0; | ||
266 | omap2_hsmmc_init(mmc); | ||
267 | |||
268 | /* link regulators to MMC adapters */ | ||
269 | devkit8000_vmmc1_supply.dev = mmc[0].dev; | ||
270 | devkit8000_vsim_supply.dev = mmc[0].dev; | ||
271 | |||
272 | /* REVISIT: need ehci-omap hooks for external VBUS | ||
273 | * power switch and overcurrent detect | ||
274 | */ | ||
275 | |||
276 | gpio_request(gpio + 1, "EHCI_nOC"); | ||
277 | gpio_direction_input(gpio + 1); | ||
278 | |||
279 | /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ | ||
280 | gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); | ||
281 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1); | ||
282 | |||
283 | /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ | ||
284 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | ||
285 | |||
286 | return 0; | ||
287 | } | ||
288 | |||
289 | static struct twl4030_gpio_platform_data devkit8000_gpio_data = { | ||
290 | .gpio_base = OMAP_MAX_GPIO_LINES, | ||
291 | .irq_base = TWL4030_GPIO_IRQ_BASE, | ||
292 | .irq_end = TWL4030_GPIO_IRQ_END, | ||
293 | .use_leds = true, | ||
294 | .pullups = BIT(1), | ||
295 | .pulldowns = BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13) | ||
296 | | BIT(15) | BIT(16) | BIT(17), | ||
297 | .setup = devkit8000_twl_gpio_setup, | ||
298 | }; | ||
299 | |||
300 | static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = { | ||
301 | { | ||
302 | .supply = "vdvi", | ||
303 | .dev = &devkit8000_lcd_device.dev, | ||
304 | }, | ||
305 | { | ||
306 | .supply = "vdss_dsi", | ||
307 | .dev = &devkit8000_dss_device.dev, | ||
308 | } | ||
309 | }; | ||
310 | |||
311 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | ||
312 | static struct regulator_init_data devkit8000_vmmc1 = { | ||
313 | .constraints = { | ||
314 | .min_uV = 1850000, | ||
315 | .max_uV = 3150000, | ||
316 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
317 | | REGULATOR_MODE_STANDBY, | ||
318 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
319 | | REGULATOR_CHANGE_MODE | ||
320 | | REGULATOR_CHANGE_STATUS, | ||
321 | }, | ||
322 | .num_consumer_supplies = 1, | ||
323 | .consumer_supplies = &devkit8000_vmmc1_supply, | ||
324 | }; | ||
325 | |||
326 | /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ | ||
327 | static struct regulator_init_data devkit8000_vsim = { | ||
328 | .constraints = { | ||
329 | .min_uV = 1800000, | ||
330 | .max_uV = 3000000, | ||
331 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
332 | | REGULATOR_MODE_STANDBY, | ||
333 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
334 | | REGULATOR_CHANGE_MODE | ||
335 | | REGULATOR_CHANGE_STATUS, | ||
336 | }, | ||
337 | .num_consumer_supplies = 1, | ||
338 | .consumer_supplies = &devkit8000_vsim_supply, | ||
339 | }; | ||
340 | |||
341 | /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ | ||
342 | static struct regulator_init_data devkit8000_vdac = { | ||
343 | .constraints = { | ||
344 | .min_uV = 1800000, | ||
345 | .max_uV = 1800000, | ||
346 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
347 | | REGULATOR_MODE_STANDBY, | ||
348 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
349 | | REGULATOR_CHANGE_STATUS, | ||
350 | }, | ||
351 | .num_consumer_supplies = 1, | ||
352 | .consumer_supplies = &devkit8000_vdda_dac_supply, | ||
353 | }; | ||
354 | |||
355 | /* VPLL2 for digital video outputs */ | ||
356 | static struct regulator_init_data devkit8000_vpll2 = { | ||
357 | .constraints = { | ||
358 | .name = "VDVI", | ||
359 | .min_uV = 1800000, | ||
360 | .max_uV = 1800000, | ||
361 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
362 | | REGULATOR_MODE_STANDBY, | ||
363 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
364 | | REGULATOR_CHANGE_STATUS, | ||
365 | }, | ||
366 | .num_consumer_supplies = ARRAY_SIZE(devkit8000_vpll2_supplies), | ||
367 | .consumer_supplies = devkit8000_vpll2_supplies, | ||
368 | }; | ||
369 | |||
370 | static struct twl4030_usb_data devkit8000_usb_data = { | ||
371 | .usb_mode = T2_USB_MODE_ULPI, | ||
372 | }; | ||
373 | |||
374 | static struct twl4030_codec_audio_data devkit8000_audio_data = { | ||
375 | .audio_mclk = 26000000, | ||
376 | }; | ||
377 | |||
378 | static struct twl4030_codec_data devkit8000_codec_data = { | ||
379 | .audio_mclk = 26000000, | ||
380 | .audio = &devkit8000_audio_data, | ||
381 | }; | ||
382 | |||
383 | static struct twl4030_platform_data devkit8000_twldata = { | ||
384 | .irq_base = TWL4030_IRQ_BASE, | ||
385 | .irq_end = TWL4030_IRQ_END, | ||
386 | |||
387 | /* platform_data for children goes here */ | ||
388 | .usb = &devkit8000_usb_data, | ||
389 | .gpio = &devkit8000_gpio_data, | ||
390 | .codec = &devkit8000_codec_data, | ||
391 | .vmmc1 = &devkit8000_vmmc1, | ||
392 | .vsim = &devkit8000_vsim, | ||
393 | .vdac = &devkit8000_vdac, | ||
394 | .vpll2 = &devkit8000_vpll2, | ||
395 | .keypad = &devkit8000_kp_data, | ||
396 | }; | ||
397 | |||
398 | static struct i2c_board_info __initdata devkit8000_i2c_boardinfo[] = { | ||
399 | { | ||
400 | I2C_BOARD_INFO("twl4030", 0x48), | ||
401 | .flags = I2C_CLIENT_WAKE, | ||
402 | .irq = INT_34XX_SYS_NIRQ, | ||
403 | .platform_data = &devkit8000_twldata, | ||
404 | }, | ||
405 | }; | ||
406 | |||
407 | static int __init devkit8000_i2c_init(void) | ||
408 | { | ||
409 | omap_register_i2c_bus(1, 2600, devkit8000_i2c_boardinfo, | ||
410 | ARRAY_SIZE(devkit8000_i2c_boardinfo)); | ||
411 | /* Bus 3 is attached to the DVI port where devices like the pico DLP | ||
412 | * projector don't work reliably with 400kHz */ | ||
413 | omap_register_i2c_bus(3, 400, NULL, 0); | ||
414 | return 0; | ||
415 | } | ||
416 | |||
417 | static struct gpio_led gpio_leds[] = { | ||
418 | { | ||
419 | .name = "led1", | ||
420 | .default_trigger = "heartbeat", | ||
421 | .gpio = 186, | ||
422 | .active_low = true, | ||
423 | }, | ||
424 | { | ||
425 | .name = "led2", | ||
426 | .default_trigger = "mmc0", | ||
427 | .gpio = 163, | ||
428 | .active_low = true, | ||
429 | }, | ||
430 | { | ||
431 | .name = "ledB", | ||
432 | .default_trigger = "none", | ||
433 | .gpio = 153, | ||
434 | .active_low = true, | ||
435 | }, | ||
436 | { | ||
437 | .name = "led3", | ||
438 | .default_trigger = "none", | ||
439 | .gpio = 164, | ||
440 | .active_low = true, | ||
441 | }, | ||
442 | }; | ||
443 | |||
444 | static struct gpio_led_platform_data gpio_led_info = { | ||
445 | .leds = gpio_leds, | ||
446 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
447 | }; | ||
448 | |||
449 | static struct platform_device leds_gpio = { | ||
450 | .name = "leds-gpio", | ||
451 | .id = -1, | ||
452 | .dev = { | ||
453 | .platform_data = &gpio_led_info, | ||
454 | }, | ||
455 | }; | ||
456 | |||
457 | static struct gpio_keys_button gpio_buttons[] = { | ||
458 | { | ||
459 | .code = BTN_EXTRA, | ||
460 | .gpio = 26, | ||
461 | .desc = "user", | ||
462 | .wakeup = 1, | ||
463 | }, | ||
464 | }; | ||
465 | |||
466 | static struct gpio_keys_platform_data gpio_key_info = { | ||
467 | .buttons = gpio_buttons, | ||
468 | .nbuttons = ARRAY_SIZE(gpio_buttons), | ||
469 | }; | ||
470 | |||
471 | static struct platform_device keys_gpio = { | ||
472 | .name = "gpio-keys", | ||
473 | .id = -1, | ||
474 | .dev = { | ||
475 | .platform_data = &gpio_key_info, | ||
476 | }, | ||
477 | }; | ||
478 | |||
479 | |||
480 | static void __init devkit8000_init_irq(void) | ||
481 | { | ||
482 | omap_board_config = devkit8000_config; | ||
483 | omap_board_config_size = ARRAY_SIZE(devkit8000_config); | ||
484 | omap2_init_common_hw(mt46h32m32lf6_sdrc_params, | ||
485 | mt46h32m32lf6_sdrc_params); | ||
486 | omap_init_irq(); | ||
487 | #ifdef CONFIG_OMAP_32K_TIMER | ||
488 | omap2_gp_clockevent_set_gptimer(12); | ||
489 | #endif | ||
490 | omap_gpio_init(); | ||
491 | } | ||
492 | |||
493 | static void __init devkit8000_ads7846_init(void) | ||
494 | { | ||
495 | int gpio = OMAP3_DEVKIT_TS_GPIO; | ||
496 | int ret; | ||
497 | |||
498 | ret = gpio_request(gpio, "ads7846_pen_down"); | ||
499 | if (ret < 0) { | ||
500 | printk(KERN_ERR "Failed to request GPIO %d for " | ||
501 | "ads7846 pen down IRQ\n", gpio); | ||
502 | return; | ||
503 | } | ||
504 | |||
505 | gpio_direction_input(gpio); | ||
506 | } | ||
507 | |||
508 | static int ads7846_get_pendown_state(void) | ||
509 | { | ||
510 | return !gpio_get_value(OMAP3_DEVKIT_TS_GPIO); | ||
511 | } | ||
512 | |||
513 | static struct ads7846_platform_data ads7846_config = { | ||
514 | .x_max = 0x0fff, | ||
515 | .y_max = 0x0fff, | ||
516 | .x_plate_ohms = 180, | ||
517 | .pressure_max = 255, | ||
518 | .debounce_max = 10, | ||
519 | .debounce_tol = 5, | ||
520 | .debounce_rep = 1, | ||
521 | .get_pendown_state = ads7846_get_pendown_state, | ||
522 | .keep_vref_on = 1, | ||
523 | .settle_delay_usecs = 150, | ||
524 | }; | ||
525 | |||
526 | static struct omap2_mcspi_device_config ads7846_mcspi_config = { | ||
527 | .turbo_mode = 0, | ||
528 | .single_channel = 1, /* 0: slave, 1: master */ | ||
529 | }; | ||
530 | |||
531 | static struct spi_board_info devkit8000_spi_board_info[] __initdata = { | ||
532 | { | ||
533 | .modalias = "ads7846", | ||
534 | .bus_num = 2, | ||
535 | .chip_select = 0, | ||
536 | .max_speed_hz = 1500000, | ||
537 | .controller_data = &ads7846_mcspi_config, | ||
538 | .irq = OMAP_GPIO_IRQ(OMAP3_DEVKIT_TS_GPIO), | ||
539 | .platform_data = &ads7846_config, | ||
540 | } | ||
541 | }; | ||
542 | |||
543 | #define OMAP_DM9000_BASE 0x2c000000 | ||
544 | |||
545 | static struct resource omap_dm9000_resources[] = { | ||
546 | [0] = { | ||
547 | .start = OMAP_DM9000_BASE, | ||
548 | .end = (OMAP_DM9000_BASE + 0x4 - 1), | ||
549 | .flags = IORESOURCE_MEM, | ||
550 | }, | ||
551 | [1] = { | ||
552 | .start = (OMAP_DM9000_BASE + 0x400), | ||
553 | .end = (OMAP_DM9000_BASE + 0x400 + 0x4 - 1), | ||
554 | .flags = IORESOURCE_MEM, | ||
555 | }, | ||
556 | [2] = { | ||
557 | .start = OMAP_GPIO_IRQ(OMAP_DM9000_GPIO_IRQ), | ||
558 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | ||
559 | }, | ||
560 | }; | ||
561 | |||
562 | static struct dm9000_plat_data omap_dm9000_platdata = { | ||
563 | .flags = DM9000_PLATF_16BITONLY, | ||
564 | }; | ||
565 | |||
566 | static struct platform_device omap_dm9000_dev = { | ||
567 | .name = "dm9000", | ||
568 | .id = -1, | ||
569 | .num_resources = ARRAY_SIZE(omap_dm9000_resources), | ||
570 | .resource = omap_dm9000_resources, | ||
571 | .dev = { | ||
572 | .platform_data = &omap_dm9000_platdata, | ||
573 | }, | ||
574 | }; | ||
575 | |||
576 | static void __init omap_dm9000_init(void) | ||
577 | { | ||
578 | if (gpio_request(OMAP_DM9000_GPIO_IRQ, "dm9000 irq") < 0) { | ||
579 | printk(KERN_ERR "Failed to request GPIO%d for dm9000 IRQ\n", | ||
580 | OMAP_DM9000_GPIO_IRQ); | ||
581 | return; | ||
582 | } | ||
583 | |||
584 | gpio_direction_input(OMAP_DM9000_GPIO_IRQ); | ||
585 | } | ||
586 | |||
587 | static struct platform_device *devkit8000_devices[] __initdata = { | ||
588 | &devkit8000_dss_device, | ||
589 | &leds_gpio, | ||
590 | &keys_gpio, | ||
591 | &omap_dm9000_dev, | ||
592 | }; | ||
593 | |||
594 | static void __init devkit8000_flash_init(void) | ||
595 | { | ||
596 | u8 cs = 0; | ||
597 | u8 nandcs = GPMC_CS_NUM + 1; | ||
598 | |||
599 | u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; | ||
600 | |||
601 | /* find out the chip-select on which NAND exists */ | ||
602 | while (cs < GPMC_CS_NUM) { | ||
603 | u32 ret = 0; | ||
604 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
605 | |||
606 | if ((ret & 0xC00) == 0x800) { | ||
607 | printk(KERN_INFO "Found NAND on CS%d\n", cs); | ||
608 | if (nandcs > GPMC_CS_NUM) | ||
609 | nandcs = cs; | ||
610 | } | ||
611 | cs++; | ||
612 | } | ||
613 | |||
614 | if (nandcs > GPMC_CS_NUM) { | ||
615 | printk(KERN_INFO "NAND: Unable to find configuration " | ||
616 | "in GPMC\n "); | ||
617 | return; | ||
618 | } | ||
619 | |||
620 | if (nandcs < GPMC_CS_NUM) { | ||
621 | devkit8000_nand_data.cs = nandcs; | ||
622 | devkit8000_nand_data.gpmc_cs_baseaddr = (void *) | ||
623 | (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); | ||
624 | devkit8000_nand_data.gpmc_baseaddr = (void *) | ||
625 | (gpmc_base_add); | ||
626 | |||
627 | printk(KERN_INFO "Registering NAND on CS%d\n", nandcs); | ||
628 | if (platform_device_register(&devkit8000_nand_device) < 0) | ||
629 | printk(KERN_ERR "Unable to register NAND device\n"); | ||
630 | } | ||
631 | } | ||
632 | |||
633 | static struct omap_musb_board_data musb_board_data = { | ||
634 | .interface_type = MUSB_INTERFACE_ULPI, | ||
635 | .mode = MUSB_OTG, | ||
636 | .power = 100, | ||
637 | }; | ||
638 | |||
639 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | ||
640 | |||
641 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, | ||
642 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, | ||
643 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
644 | |||
645 | .phy_reset = true, | ||
646 | .reset_gpio_port[0] = -EINVAL, | ||
647 | .reset_gpio_port[1] = 147, | ||
648 | .reset_gpio_port[2] = -EINVAL | ||
649 | }; | ||
650 | |||
651 | static void __init devkit8000_init(void) | ||
652 | { | ||
653 | devkit8000_i2c_init(); | ||
654 | platform_add_devices(devkit8000_devices, | ||
655 | ARRAY_SIZE(devkit8000_devices)); | ||
656 | omap_board_config = devkit8000_config; | ||
657 | omap_board_config_size = ARRAY_SIZE(devkit8000_config); | ||
658 | |||
659 | spi_register_board_info(devkit8000_spi_board_info, | ||
660 | ARRAY_SIZE(devkit8000_spi_board_info)); | ||
661 | |||
662 | omap_serial_init(); | ||
663 | |||
664 | omap_dm9000_init(); | ||
665 | |||
666 | devkit8000_ads7846_init(); | ||
667 | |||
668 | omap_mux_init_gpio(170, OMAP_PIN_INPUT); | ||
669 | |||
670 | gpio_request(170, "DVI_nPD"); | ||
671 | /* REVISIT leave DVI powered down until it's needed ... */ | ||
672 | gpio_direction_output(170, true); | ||
673 | |||
674 | usb_musb_init(&musb_board_data); | ||
675 | usb_ehci_init(&ehci_pdata); | ||
676 | devkit8000_flash_init(); | ||
677 | |||
678 | /* Ensure SDRC pins are mux'd for self-refresh */ | ||
679 | omap_mux_init_signal("sdr_cke0", OMAP_PIN_OUTPUT); | ||
680 | omap_mux_init_signal("sdr_cke1", OMAP_PIN_OUTPUT); | ||
681 | } | ||
682 | |||
683 | static void __init devkit8000_map_io(void) | ||
684 | { | ||
685 | omap2_set_globals_343x(); | ||
686 | omap34xx_map_common_io(); | ||
687 | } | ||
688 | |||
689 | MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") | ||
690 | .phys_io = 0x48000000, | ||
691 | .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, | ||
692 | .boot_params = 0x80000100, | ||
693 | .map_io = devkit8000_map_io, | ||
694 | .init_irq = devkit8000_init_irq, | ||
695 | .init_machine = devkit8000_init, | ||
696 | .timer = &omap_timer, | ||
697 | MACHINE_END | ||
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 7e6e6ca88be5..16cc06860670 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -50,7 +50,7 @@ static void __init omap_generic_init(void) | |||
50 | static void __init omap_generic_map_io(void) | 50 | static void __init omap_generic_map_io(void) |
51 | { | 51 | { |
52 | omap2_set_globals_242x(); /* should be 242x, 243x, or 343x */ | 52 | omap2_set_globals_242x(); /* should be 242x, 243x, or 343x */ |
53 | omap2_map_common_io(); | 53 | omap242x_map_common_io(); |
54 | } | 54 | } |
55 | 55 | ||
56 | MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") | 56 | MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") |
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index cfb7f1257d20..0665f2c8dc8e 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mtd/mtd.h> | 17 | #include <linux/mtd/mtd.h> |
18 | #include <linux/mtd/partitions.h> | 18 | #include <linux/mtd/partitions.h> |
19 | #include <linux/mtd/physmap.h> | ||
19 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
20 | #include <linux/workqueue.h> | 21 | #include <linux/workqueue.h> |
21 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
@@ -29,7 +30,6 @@ | |||
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
31 | #include <asm/mach/map.h> | 32 | #include <asm/mach/map.h> |
32 | #include <asm/mach/flash.h> | ||
33 | 33 | ||
34 | #include <plat/control.h> | 34 | #include <plat/control.h> |
35 | #include <mach/gpio.h> | 35 | #include <mach/gpio.h> |
@@ -115,8 +115,7 @@ static struct mtd_partition h4_partitions[] = { | |||
115 | } | 115 | } |
116 | }; | 116 | }; |
117 | 117 | ||
118 | static struct flash_platform_data h4_flash_data = { | 118 | static struct physmap_flash_data h4_flash_data = { |
119 | .map_name = "cfi_probe", | ||
120 | .width = 2, | 119 | .width = 2, |
121 | .parts = h4_partitions, | 120 | .parts = h4_partitions, |
122 | .nr_parts = ARRAY_SIZE(h4_partitions), | 121 | .nr_parts = ARRAY_SIZE(h4_partitions), |
@@ -127,7 +126,7 @@ static struct resource h4_flash_resource = { | |||
127 | }; | 126 | }; |
128 | 127 | ||
129 | static struct platform_device h4_flash_device = { | 128 | static struct platform_device h4_flash_device = { |
130 | .name = "omapflash", | 129 | .name = "physmap-flash", |
131 | .id = 0, | 130 | .id = 0, |
132 | .dev = { | 131 | .dev = { |
133 | .platform_data = &h4_flash_data, | 132 | .platform_data = &h4_flash_data, |
@@ -370,7 +369,7 @@ static void __init omap_h4_init(void) | |||
370 | static void __init omap_h4_map_io(void) | 369 | static void __init omap_h4_map_io(void) |
371 | { | 370 | { |
372 | omap2_set_globals_242x(); | 371 | omap2_set_globals_242x(); |
373 | omap2_map_common_io(); | 372 | omap242x_map_common_io(); |
374 | } | 373 | } |
375 | 374 | ||
376 | MACHINE_START(OMAP_H4, "OMAP2420 H4 board") | 375 | MACHINE_START(OMAP_H4, "OMAP2420 H4 board") |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 117b8fd7e3a6..9958987a3d0a 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/leds.h> | ||
19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
20 | 21 | ||
21 | #include <linux/regulator/machine.h> | 22 | #include <linux/regulator/machine.h> |
@@ -28,9 +29,12 @@ | |||
28 | #include <plat/common.h> | 29 | #include <plat/common.h> |
29 | #include <plat/gpmc.h> | 30 | #include <plat/gpmc.h> |
30 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
32 | #include <plat/display.h> | ||
33 | #include <plat/onenand.h> | ||
31 | 34 | ||
32 | #include "mux.h" | 35 | #include "mux.h" |
33 | #include "mmc-twl4030.h" | 36 | #include "hsmmc.h" |
37 | #include "sdram-numonyx-m65kxxxxam.h" | ||
34 | 38 | ||
35 | #define IGEP2_SMSC911X_CS 5 | 39 | #define IGEP2_SMSC911X_CS 5 |
36 | #define IGEP2_SMSC911X_GPIO 176 | 40 | #define IGEP2_SMSC911X_GPIO 176 |
@@ -38,6 +42,108 @@ | |||
38 | #define IGEP2_GPIO_LED0_RED 26 | 42 | #define IGEP2_GPIO_LED0_RED 26 |
39 | #define IGEP2_GPIO_LED0_GREEN 27 | 43 | #define IGEP2_GPIO_LED0_GREEN 27 |
40 | #define IGEP2_GPIO_LED1_RED 28 | 44 | #define IGEP2_GPIO_LED1_RED 28 |
45 | #define IGEP2_GPIO_DVI_PUP 170 | ||
46 | #define IGEP2_GPIO_WIFI_NPD 94 | ||
47 | #define IGEP2_GPIO_WIFI_NRESET 95 | ||
48 | |||
49 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | ||
50 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | ||
51 | |||
52 | #define ONENAND_MAP 0x20000000 | ||
53 | |||
54 | /* NAND04GR4E1A ( x2 Flash built-in COMBO POP MEMORY ) | ||
55 | * Since the device is equipped with two DataRAMs, and two-plane NAND | ||
56 | * Flash memory array, these two component enables simultaneous program | ||
57 | * of 4KiB. Plane1 has only even blocks such as block0, block2, block4 | ||
58 | * while Plane2 has only odd blocks such as block1, block3, block5. | ||
59 | * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) | ||
60 | */ | ||
61 | |||
62 | static struct mtd_partition igep2_onenand_partitions[] = { | ||
63 | { | ||
64 | .name = "X-Loader", | ||
65 | .offset = 0, | ||
66 | .size = 2 * (64*(2*2048)) | ||
67 | }, | ||
68 | { | ||
69 | .name = "U-Boot", | ||
70 | .offset = MTDPART_OFS_APPEND, | ||
71 | .size = 6 * (64*(2*2048)), | ||
72 | }, | ||
73 | { | ||
74 | .name = "Environment", | ||
75 | .offset = MTDPART_OFS_APPEND, | ||
76 | .size = 2 * (64*(2*2048)), | ||
77 | }, | ||
78 | { | ||
79 | .name = "Kernel", | ||
80 | .offset = MTDPART_OFS_APPEND, | ||
81 | .size = 12 * (64*(2*2048)), | ||
82 | }, | ||
83 | { | ||
84 | .name = "File System", | ||
85 | .offset = MTDPART_OFS_APPEND, | ||
86 | .size = MTDPART_SIZ_FULL, | ||
87 | }, | ||
88 | }; | ||
89 | |||
90 | static int igep2_onenand_setup(void __iomem *onenand_base, int freq) | ||
91 | { | ||
92 | /* nothing is required to be setup for onenand as of now */ | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | static struct omap_onenand_platform_data igep2_onenand_data = { | ||
97 | .parts = igep2_onenand_partitions, | ||
98 | .nr_parts = ARRAY_SIZE(igep2_onenand_partitions), | ||
99 | .onenand_setup = igep2_onenand_setup, | ||
100 | .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ | ||
101 | }; | ||
102 | |||
103 | static struct platform_device igep2_onenand_device = { | ||
104 | .name = "omap2-onenand", | ||
105 | .id = -1, | ||
106 | .dev = { | ||
107 | .platform_data = &igep2_onenand_data, | ||
108 | }, | ||
109 | }; | ||
110 | |||
111 | void __init igep2_flash_init(void) | ||
112 | { | ||
113 | u8 cs = 0; | ||
114 | u8 onenandcs = GPMC_CS_NUM + 1; | ||
115 | |||
116 | while (cs < GPMC_CS_NUM) { | ||
117 | u32 ret = 0; | ||
118 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
119 | |||
120 | /* Check if NAND/oneNAND is configured */ | ||
121 | if ((ret & 0xC00) == 0x800) | ||
122 | /* NAND found */ | ||
123 | pr_err("IGEP v2: Unsupported NAND found\n"); | ||
124 | else { | ||
125 | ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); | ||
126 | if ((ret & 0x3F) == (ONENAND_MAP >> 24)) | ||
127 | /* ONENAND found */ | ||
128 | onenandcs = cs; | ||
129 | } | ||
130 | cs++; | ||
131 | } | ||
132 | if (onenandcs > GPMC_CS_NUM) { | ||
133 | pr_err("IGEP v2: Unable to find configuration in GPMC\n"); | ||
134 | return; | ||
135 | } | ||
136 | |||
137 | if (onenandcs < GPMC_CS_NUM) { | ||
138 | igep2_onenand_data.cs = onenandcs; | ||
139 | if (platform_device_register(&igep2_onenand_device) < 0) | ||
140 | pr_err("IGEP v2: Unable to register OneNAND device\n"); | ||
141 | } | ||
142 | } | ||
143 | |||
144 | #else | ||
145 | void __init igep2_flash_init(void) {} | ||
146 | #endif | ||
41 | 147 | ||
42 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) | 148 | #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) |
43 | 149 | ||
@@ -106,6 +212,10 @@ static struct regulator_consumer_supply igep2_vmmc1_supply = { | |||
106 | .supply = "vmmc", | 212 | .supply = "vmmc", |
107 | }; | 213 | }; |
108 | 214 | ||
215 | static struct regulator_consumer_supply igep2_vmmc2_supply = { | ||
216 | .supply = "vmmc", | ||
217 | }; | ||
218 | |||
109 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ | 219 | /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ |
110 | static struct regulator_init_data igep2_vmmc1 = { | 220 | static struct regulator_init_data igep2_vmmc1 = { |
111 | .constraints = { | 221 | .constraints = { |
@@ -121,7 +231,22 @@ static struct regulator_init_data igep2_vmmc1 = { | |||
121 | .consumer_supplies = &igep2_vmmc1_supply, | 231 | .consumer_supplies = &igep2_vmmc1_supply, |
122 | }; | 232 | }; |
123 | 233 | ||
124 | static struct twl4030_hsmmc_info mmc[] = { | 234 | /* VMMC2 for OMAP VDD_MMC2 (i/o) and MMC2 WIFI */ |
235 | static struct regulator_init_data igep2_vmmc2 = { | ||
236 | .constraints = { | ||
237 | .min_uV = 1850000, | ||
238 | .max_uV = 3150000, | ||
239 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
240 | | REGULATOR_MODE_STANDBY, | ||
241 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
242 | | REGULATOR_CHANGE_MODE | ||
243 | | REGULATOR_CHANGE_STATUS, | ||
244 | }, | ||
245 | .num_consumer_supplies = 1, | ||
246 | .consumer_supplies = &igep2_vmmc2_supply, | ||
247 | }; | ||
248 | |||
249 | static struct omap2_hsmmc_info mmc[] = { | ||
125 | { | 250 | { |
126 | .mmc = 1, | 251 | .mmc = 1, |
127 | .wires = 4, | 252 | .wires = 4, |
@@ -142,12 +267,13 @@ static int igep2_twl_gpio_setup(struct device *dev, | |||
142 | { | 267 | { |
143 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 268 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
144 | mmc[0].gpio_cd = gpio + 0; | 269 | mmc[0].gpio_cd = gpio + 0; |
145 | twl4030_mmc_init(mmc); | 270 | omap2_hsmmc_init(mmc); |
146 | 271 | ||
147 | /* link regulators to MMC adapters ... we "know" the | 272 | /* link regulators to MMC adapters ... we "know" the |
148 | * regulators will be set up only *after* we return. | 273 | * regulators will be set up only *after* we return. |
149 | */ | 274 | */ |
150 | igep2_vmmc1_supply.dev = mmc[0].dev; | 275 | igep2_vmmc1_supply.dev = mmc[0].dev; |
276 | igep2_vmmc2_supply.dev = mmc[1].dev; | ||
151 | 277 | ||
152 | return 0; | 278 | return 0; |
153 | }; | 279 | }; |
@@ -164,23 +290,130 @@ static struct twl4030_usb_data igep2_usb_data = { | |||
164 | .usb_mode = T2_USB_MODE_ULPI, | 290 | .usb_mode = T2_USB_MODE_ULPI, |
165 | }; | 291 | }; |
166 | 292 | ||
293 | static int igep2_enable_dvi(struct omap_dss_device *dssdev) | ||
294 | { | ||
295 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1); | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static void igep2_disable_dvi(struct omap_dss_device *dssdev) | ||
301 | { | ||
302 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 0); | ||
303 | } | ||
304 | |||
305 | static struct omap_dss_device igep2_dvi_device = { | ||
306 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
307 | .name = "dvi", | ||
308 | .driver_name = "generic_panel", | ||
309 | .phy.dpi.data_lines = 24, | ||
310 | .platform_enable = igep2_enable_dvi, | ||
311 | .platform_disable = igep2_disable_dvi, | ||
312 | }; | ||
313 | |||
314 | static struct omap_dss_device *igep2_dss_devices[] = { | ||
315 | &igep2_dvi_device | ||
316 | }; | ||
317 | |||
318 | static struct omap_dss_board_info igep2_dss_data = { | ||
319 | .num_devices = ARRAY_SIZE(igep2_dss_devices), | ||
320 | .devices = igep2_dss_devices, | ||
321 | .default_device = &igep2_dvi_device, | ||
322 | }; | ||
323 | |||
324 | static struct platform_device igep2_dss_device = { | ||
325 | .name = "omapdss", | ||
326 | .id = -1, | ||
327 | .dev = { | ||
328 | .platform_data = &igep2_dss_data, | ||
329 | }, | ||
330 | }; | ||
331 | |||
332 | static struct regulator_consumer_supply igep2_vpll2_supply = { | ||
333 | .supply = "vdds_dsi", | ||
334 | .dev = &igep2_dss_device.dev, | ||
335 | }; | ||
336 | |||
337 | static struct regulator_init_data igep2_vpll2 = { | ||
338 | .constraints = { | ||
339 | .name = "VDVI", | ||
340 | .min_uV = 1800000, | ||
341 | .max_uV = 1800000, | ||
342 | .apply_uV = true, | ||
343 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
344 | | REGULATOR_MODE_STANDBY, | ||
345 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
346 | | REGULATOR_CHANGE_STATUS, | ||
347 | }, | ||
348 | .num_consumer_supplies = 1, | ||
349 | .consumer_supplies = &igep2_vpll2_supply, | ||
350 | }; | ||
351 | |||
352 | static void __init igep2_display_init(void) | ||
353 | { | ||
354 | if (gpio_request(IGEP2_GPIO_DVI_PUP, "GPIO_DVI_PUP") && | ||
355 | gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1)) | ||
356 | pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n"); | ||
357 | } | ||
358 | #ifdef CONFIG_LEDS_TRIGGERS | ||
359 | static struct gpio_led gpio_leds[] = { | ||
360 | { | ||
361 | .name = "GPIO_LED1_RED", | ||
362 | .default_trigger = "heartbeat", | ||
363 | .gpio = IGEP2_GPIO_LED1_RED, | ||
364 | }, | ||
365 | }; | ||
366 | |||
367 | static struct gpio_led_platform_data gpio_leds_info = { | ||
368 | .leds = gpio_leds, | ||
369 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
370 | }; | ||
371 | |||
372 | static struct platform_device leds_gpio = { | ||
373 | .name = "leds-gpio", | ||
374 | .id = -1, | ||
375 | .dev = { | ||
376 | .platform_data = &gpio_leds_info, | ||
377 | }, | ||
378 | }; | ||
379 | #endif | ||
380 | |||
381 | static struct platform_device *igep2_devices[] __initdata = { | ||
382 | &igep2_dss_device, | ||
383 | #ifdef CONFIG_LEDS_TRIGGERS | ||
384 | &leds_gpio, | ||
385 | #endif | ||
386 | }; | ||
387 | |||
167 | static void __init igep2_init_irq(void) | 388 | static void __init igep2_init_irq(void) |
168 | { | 389 | { |
169 | omap_board_config = igep2_config; | 390 | omap_board_config = igep2_config; |
170 | omap_board_config_size = ARRAY_SIZE(igep2_config); | 391 | omap_board_config_size = ARRAY_SIZE(igep2_config); |
171 | omap2_init_common_hw(NULL, NULL); | 392 | omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); |
172 | omap_init_irq(); | 393 | omap_init_irq(); |
173 | omap_gpio_init(); | 394 | omap_gpio_init(); |
174 | } | 395 | } |
175 | 396 | ||
397 | static struct twl4030_codec_audio_data igep2_audio_data = { | ||
398 | .audio_mclk = 26000000, | ||
399 | }; | ||
400 | |||
401 | static struct twl4030_codec_data igep2_codec_data = { | ||
402 | .audio_mclk = 26000000, | ||
403 | .audio = &igep2_audio_data, | ||
404 | }; | ||
405 | |||
176 | static struct twl4030_platform_data igep2_twldata = { | 406 | static struct twl4030_platform_data igep2_twldata = { |
177 | .irq_base = TWL4030_IRQ_BASE, | 407 | .irq_base = TWL4030_IRQ_BASE, |
178 | .irq_end = TWL4030_IRQ_END, | 408 | .irq_end = TWL4030_IRQ_END, |
179 | 409 | ||
180 | /* platform_data for children goes here */ | 410 | /* platform_data for children goes here */ |
181 | .usb = &igep2_usb_data, | 411 | .usb = &igep2_usb_data, |
412 | .codec = &igep2_codec_data, | ||
182 | .gpio = &igep2_gpio_data, | 413 | .gpio = &igep2_gpio_data, |
183 | .vmmc1 = &igep2_vmmc1, | 414 | .vmmc1 = &igep2_vmmc1, |
415 | .vmmc2 = &igep2_vmmc2, | ||
416 | .vpll2 = &igep2_vpll2, | ||
184 | 417 | ||
185 | }; | 418 | }; |
186 | 419 | ||
@@ -203,6 +436,23 @@ static int __init igep2_i2c_init(void) | |||
203 | return 0; | 436 | return 0; |
204 | } | 437 | } |
205 | 438 | ||
439 | static struct omap_musb_board_data musb_board_data = { | ||
440 | .interface_type = MUSB_INTERFACE_ULPI, | ||
441 | .mode = MUSB_OTG, | ||
442 | .power = 100, | ||
443 | }; | ||
444 | |||
445 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | ||
446 | .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
447 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, | ||
448 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
449 | |||
450 | .phy_reset = true, | ||
451 | .reset_gpio_port[0] = -EINVAL, | ||
452 | .reset_gpio_port[1] = IGEP2_GPIO_USBH_NRESET, | ||
453 | .reset_gpio_port[2] = -EINVAL, | ||
454 | }; | ||
455 | |||
206 | #ifdef CONFIG_OMAP_MUX | 456 | #ifdef CONFIG_OMAP_MUX |
207 | static struct omap_board_mux board_mux[] __initdata = { | 457 | static struct omap_board_mux board_mux[] __initdata = { |
208 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 458 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
@@ -215,9 +465,13 @@ static void __init igep2_init(void) | |||
215 | { | 465 | { |
216 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 466 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
217 | igep2_i2c_init(); | 467 | igep2_i2c_init(); |
468 | platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); | ||
218 | omap_serial_init(); | 469 | omap_serial_init(); |
219 | usb_musb_init(); | 470 | usb_musb_init(&musb_board_data); |
471 | usb_ehci_init(&ehci_pdata); | ||
220 | 472 | ||
473 | igep2_flash_init(); | ||
474 | igep2_display_init(); | ||
221 | igep2_init_smsc911x(); | 475 | igep2_init_smsc911x(); |
222 | 476 | ||
223 | /* GPIO userspace leds */ | 477 | /* GPIO userspace leds */ |
@@ -234,19 +488,36 @@ static void __init igep2_init(void) | |||
234 | gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0); | 488 | gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0); |
235 | } else | 489 | } else |
236 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); | 490 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); |
237 | 491 | #ifndef CONFIG_LEDS_TRIGGERS | |
238 | if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_LED1_RED") == 0) && | 492 | if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_LED1_RED") == 0) && |
239 | (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) { | 493 | (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) { |
240 | gpio_export(IGEP2_GPIO_LED1_RED, 0); | 494 | gpio_export(IGEP2_GPIO_LED1_RED, 0); |
241 | gpio_set_value(IGEP2_GPIO_LED1_RED, 0); | 495 | gpio_set_value(IGEP2_GPIO_LED1_RED, 0); |
242 | } else | 496 | } else |
243 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); | 497 | pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n"); |
498 | #endif | ||
499 | /* GPIO W-LAN + Bluetooth combo module */ | ||
500 | if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) && | ||
501 | (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) { | ||
502 | gpio_export(IGEP2_GPIO_WIFI_NPD, 0); | ||
503 | /* gpio_set_value(IGEP2_GPIO_WIFI_NPD, 0); */ | ||
504 | } else | ||
505 | pr_warning("IGEP v2: Could not obtain gpio GPIO_WIFI_NPD\n"); | ||
506 | |||
507 | if ((gpio_request(IGEP2_GPIO_WIFI_NRESET, "GPIO_WIFI_NRESET") == 0) && | ||
508 | (gpio_direction_output(IGEP2_GPIO_WIFI_NRESET, 1) == 0)) { | ||
509 | gpio_export(IGEP2_GPIO_WIFI_NRESET, 0); | ||
510 | gpio_set_value(IGEP2_GPIO_WIFI_NRESET, 0); | ||
511 | udelay(10); | ||
512 | gpio_set_value(IGEP2_GPIO_WIFI_NRESET, 1); | ||
513 | } else | ||
514 | pr_warning("IGEP v2: Could not obtain gpio GPIO_WIFI_NRESET\n"); | ||
244 | } | 515 | } |
245 | 516 | ||
246 | static void __init igep2_map_io(void) | 517 | static void __init igep2_map_io(void) |
247 | { | 518 | { |
248 | omap2_set_globals_343x(); | 519 | omap2_set_globals_343x(); |
249 | omap2_map_common_io(); | 520 | omap34xx_map_common_io(); |
250 | } | 521 | } |
251 | 522 | ||
252 | MACHINE_START(IGEP0020, "IGEP v2 board") | 523 | MACHINE_START(IGEP0020, "IGEP v2 board") |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 995d4a2b2dfd..5fcb52e71298 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <plat/usb.h> | 44 | #include <plat/usb.h> |
45 | 45 | ||
46 | #include "mux.h" | 46 | #include "mux.h" |
47 | #include "mmc-twl4030.h" | 47 | #include "hsmmc.h" |
48 | 48 | ||
49 | #define LDP_SMSC911X_CS 1 | 49 | #define LDP_SMSC911X_CS 1 |
50 | #define LDP_SMSC911X_GPIO 152 | 50 | #define LDP_SMSC911X_GPIO 152 |
@@ -359,7 +359,7 @@ static int __init omap_i2c_init(void) | |||
359 | return 0; | 359 | return 0; |
360 | } | 360 | } |
361 | 361 | ||
362 | static struct twl4030_hsmmc_info mmc[] __initdata = { | 362 | static struct omap2_hsmmc_info mmc[] __initdata = { |
363 | { | 363 | { |
364 | .mmc = 1, | 364 | .mmc = 1, |
365 | .wires = 4, | 365 | .wires = 4, |
@@ -383,6 +383,12 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
383 | #define board_mux NULL | 383 | #define board_mux NULL |
384 | #endif | 384 | #endif |
385 | 385 | ||
386 | static struct omap_musb_board_data musb_board_data = { | ||
387 | .interface_type = MUSB_INTERFACE_ULPI, | ||
388 | .mode = MUSB_OTG, | ||
389 | .power = 100, | ||
390 | }; | ||
391 | |||
386 | static void __init omap_ldp_init(void) | 392 | static void __init omap_ldp_init(void) |
387 | { | 393 | { |
388 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 394 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -394,9 +400,9 @@ static void __init omap_ldp_init(void) | |||
394 | ARRAY_SIZE(ldp_spi_board_info)); | 400 | ARRAY_SIZE(ldp_spi_board_info)); |
395 | ads7846_dev_init(); | 401 | ads7846_dev_init(); |
396 | omap_serial_init(); | 402 | omap_serial_init(); |
397 | usb_musb_init(); | 403 | usb_musb_init(&musb_board_data); |
398 | 404 | ||
399 | twl4030_mmc_init(mmc); | 405 | omap2_hsmmc_init(mmc); |
400 | /* link regulators to MMC adapters */ | 406 | /* link regulators to MMC adapters */ |
401 | ldp_vmmc1_supply.dev = mmc[0].dev; | 407 | ldp_vmmc1_supply.dev = mmc[0].dev; |
402 | } | 408 | } |
@@ -404,7 +410,7 @@ static void __init omap_ldp_init(void) | |||
404 | static void __init omap_ldp_map_io(void) | 410 | static void __init omap_ldp_map_io(void) |
405 | { | 411 | { |
406 | omap2_set_globals_343x(); | 412 | omap2_set_globals_343x(); |
407 | omap2_map_common_io(); | 413 | omap34xx_map_common_io(); |
408 | } | 414 | } |
409 | 415 | ||
410 | MACHINE_START(OMAP_LDP, "OMAP LDP board") | 416 | MACHINE_START(OMAP_LDP, "OMAP LDP board") |
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 764ab1ed576d..4cab0522d7ce 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/stddef.h> | 19 | #include <linux/stddef.h> |
20 | #include <linux/i2c.h> | ||
20 | #include <linux/spi/spi.h> | 21 | #include <linux/spi/spi.h> |
21 | #include <linux/usb/musb.h> | 22 | #include <linux/usb/musb.h> |
22 | 23 | ||
@@ -25,11 +26,17 @@ | |||
25 | 26 | ||
26 | #include <plat/board.h> | 27 | #include <plat/board.h> |
27 | #include <plat/common.h> | 28 | #include <plat/common.h> |
29 | #include <plat/menelaus.h> | ||
28 | #include <mach/irqs.h> | 30 | #include <mach/irqs.h> |
29 | #include <plat/mcspi.h> | 31 | #include <plat/mcspi.h> |
30 | #include <plat/onenand.h> | 32 | #include <plat/onenand.h> |
33 | #include <plat/mmc.h> | ||
31 | #include <plat/serial.h> | 34 | #include <plat/serial.h> |
32 | 35 | ||
36 | static int slot1_cover_open; | ||
37 | static int slot2_cover_open; | ||
38 | static struct device *mmc_device; | ||
39 | |||
33 | static struct omap2_mcspi_device_config p54spi_mcspi_config = { | 40 | static struct omap2_mcspi_device_config p54spi_mcspi_config = { |
34 | .turbo_mode = 0, | 41 | .turbo_mode = 0, |
35 | .single_channel = 1, | 42 | .single_channel = 1, |
@@ -96,10 +103,446 @@ static void __init n8x0_onenand_init(void) {} | |||
96 | 103 | ||
97 | #endif | 104 | #endif |
98 | 105 | ||
106 | #if defined(CONFIG_MENELAUS) && \ | ||
107 | (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)) | ||
108 | |||
109 | /* | ||
110 | * On both N800 and N810, only the first of the two MMC controllers is in use. | ||
111 | * The two MMC slots are multiplexed via Menelaus companion chip over I2C. | ||
112 | * On N800, both slots are powered via Menelaus. On N810, only one of the | ||
113 | * slots is powered via Menelaus. The N810 EMMC is powered via GPIO. | ||
114 | * | ||
115 | * VMMC slot 1 on both N800 and N810 | ||
116 | * VDCDC3_APE and VMCS2_APE slot 2 on N800 | ||
117 | * GPIO23 and GPIO9 slot 2 EMMC on N810 | ||
118 | * | ||
119 | */ | ||
120 | #define N8X0_SLOT_SWITCH_GPIO 96 | ||
121 | #define N810_EMMC_VSD_GPIO 23 | ||
122 | #define NN810_EMMC_VIO_GPIO 9 | ||
123 | |||
124 | static int n8x0_mmc_switch_slot(struct device *dev, int slot) | ||
125 | { | ||
126 | #ifdef CONFIG_MMC_DEBUG | ||
127 | dev_dbg(dev, "Choose slot %d\n", slot + 1); | ||
128 | #endif | ||
129 | gpio_set_value(N8X0_SLOT_SWITCH_GPIO, slot); | ||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | static int n8x0_mmc_set_power_menelaus(struct device *dev, int slot, | ||
134 | int power_on, int vdd) | ||
135 | { | ||
136 | int mV; | ||
137 | |||
138 | #ifdef CONFIG_MMC_DEBUG | ||
139 | dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, | ||
140 | power_on ? "on" : "off", vdd); | ||
141 | #endif | ||
142 | if (slot == 0) { | ||
143 | if (!power_on) | ||
144 | return menelaus_set_vmmc(0); | ||
145 | switch (1 << vdd) { | ||
146 | case MMC_VDD_33_34: | ||
147 | case MMC_VDD_32_33: | ||
148 | case MMC_VDD_31_32: | ||
149 | mV = 3100; | ||
150 | break; | ||
151 | case MMC_VDD_30_31: | ||
152 | mV = 3000; | ||
153 | break; | ||
154 | case MMC_VDD_28_29: | ||
155 | mV = 2800; | ||
156 | break; | ||
157 | case MMC_VDD_165_195: | ||
158 | mV = 1850; | ||
159 | break; | ||
160 | default: | ||
161 | BUG(); | ||
162 | } | ||
163 | return menelaus_set_vmmc(mV); | ||
164 | } else { | ||
165 | if (!power_on) | ||
166 | return menelaus_set_vdcdc(3, 0); | ||
167 | switch (1 << vdd) { | ||
168 | case MMC_VDD_33_34: | ||
169 | case MMC_VDD_32_33: | ||
170 | mV = 3300; | ||
171 | break; | ||
172 | case MMC_VDD_30_31: | ||
173 | case MMC_VDD_29_30: | ||
174 | mV = 3000; | ||
175 | break; | ||
176 | case MMC_VDD_28_29: | ||
177 | case MMC_VDD_27_28: | ||
178 | mV = 2800; | ||
179 | break; | ||
180 | case MMC_VDD_24_25: | ||
181 | case MMC_VDD_23_24: | ||
182 | mV = 2400; | ||
183 | break; | ||
184 | case MMC_VDD_22_23: | ||
185 | case MMC_VDD_21_22: | ||
186 | mV = 2200; | ||
187 | break; | ||
188 | case MMC_VDD_20_21: | ||
189 | mV = 2000; | ||
190 | break; | ||
191 | case MMC_VDD_165_195: | ||
192 | mV = 1800; | ||
193 | break; | ||
194 | default: | ||
195 | BUG(); | ||
196 | } | ||
197 | return menelaus_set_vdcdc(3, mV); | ||
198 | } | ||
199 | return 0; | ||
200 | } | ||
201 | |||
202 | static void n810_set_power_emmc(struct device *dev, | ||
203 | int power_on) | ||
204 | { | ||
205 | dev_dbg(dev, "Set EMMC power %s\n", power_on ? "on" : "off"); | ||
206 | |||
207 | if (power_on) { | ||
208 | gpio_set_value(N810_EMMC_VSD_GPIO, 1); | ||
209 | msleep(1); | ||
210 | gpio_set_value(NN810_EMMC_VIO_GPIO, 1); | ||
211 | msleep(1); | ||
212 | } else { | ||
213 | gpio_set_value(NN810_EMMC_VIO_GPIO, 0); | ||
214 | msleep(50); | ||
215 | gpio_set_value(N810_EMMC_VSD_GPIO, 0); | ||
216 | msleep(50); | ||
217 | } | ||
218 | } | ||
219 | |||
220 | static int n8x0_mmc_set_power(struct device *dev, int slot, int power_on, | ||
221 | int vdd) | ||
222 | { | ||
223 | if (machine_is_nokia_n800() || slot == 0) | ||
224 | return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd); | ||
225 | |||
226 | n810_set_power_emmc(dev, power_on); | ||
227 | |||
228 | return 0; | ||
229 | } | ||
230 | |||
231 | static int n8x0_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) | ||
232 | { | ||
233 | int r; | ||
234 | |||
235 | dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1, | ||
236 | bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); | ||
237 | BUG_ON(slot != 0 && slot != 1); | ||
238 | slot++; | ||
239 | switch (bus_mode) { | ||
240 | case MMC_BUSMODE_OPENDRAIN: | ||
241 | r = menelaus_set_mmc_opendrain(slot, 1); | ||
242 | break; | ||
243 | case MMC_BUSMODE_PUSHPULL: | ||
244 | r = menelaus_set_mmc_opendrain(slot, 0); | ||
245 | break; | ||
246 | default: | ||
247 | BUG(); | ||
248 | } | ||
249 | if (r != 0 && printk_ratelimit()) | ||
250 | dev_err(dev, "MMC: unable to set bus mode for slot %d\n", | ||
251 | slot); | ||
252 | return r; | ||
253 | } | ||
254 | |||
255 | static int n8x0_mmc_get_cover_state(struct device *dev, int slot) | ||
256 | { | ||
257 | slot++; | ||
258 | BUG_ON(slot != 1 && slot != 2); | ||
259 | if (slot == 1) | ||
260 | return slot1_cover_open; | ||
261 | else | ||
262 | return slot2_cover_open; | ||
263 | } | ||
264 | |||
265 | static void n8x0_mmc_callback(void *data, u8 card_mask) | ||
266 | { | ||
267 | int bit, *openp, index; | ||
268 | |||
269 | if (machine_is_nokia_n800()) { | ||
270 | bit = 1 << 1; | ||
271 | openp = &slot2_cover_open; | ||
272 | index = 1; | ||
273 | } else { | ||
274 | bit = 1; | ||
275 | openp = &slot1_cover_open; | ||
276 | index = 0; | ||
277 | } | ||
278 | |||
279 | if (card_mask & bit) | ||
280 | *openp = 1; | ||
281 | else | ||
282 | *openp = 0; | ||
283 | |||
284 | omap_mmc_notify_cover_event(mmc_device, index, *openp); | ||
285 | } | ||
286 | |||
287 | void n8x0_mmc_slot1_cover_handler(void *arg, int closed_state) | ||
288 | { | ||
289 | if (mmc_device == NULL) | ||
290 | return; | ||
291 | |||
292 | slot1_cover_open = !closed_state; | ||
293 | omap_mmc_notify_cover_event(mmc_device, 0, closed_state); | ||
294 | } | ||
295 | |||
296 | static int n8x0_mmc_late_init(struct device *dev) | ||
297 | { | ||
298 | int r, bit, *openp; | ||
299 | int vs2sel; | ||
300 | |||
301 | mmc_device = dev; | ||
302 | |||
303 | r = menelaus_set_slot_sel(1); | ||
304 | if (r < 0) | ||
305 | return r; | ||
306 | |||
307 | if (machine_is_nokia_n800()) | ||
308 | vs2sel = 0; | ||
309 | else | ||
310 | vs2sel = 2; | ||
311 | |||
312 | r = menelaus_set_mmc_slot(2, 0, vs2sel, 1); | ||
313 | if (r < 0) | ||
314 | return r; | ||
315 | |||
316 | n8x0_mmc_set_power(dev, 0, MMC_POWER_ON, 16); /* MMC_VDD_28_29 */ | ||
317 | n8x0_mmc_set_power(dev, 1, MMC_POWER_ON, 16); | ||
318 | |||
319 | r = menelaus_set_mmc_slot(1, 1, 0, 1); | ||
320 | if (r < 0) | ||
321 | return r; | ||
322 | r = menelaus_set_mmc_slot(2, 1, vs2sel, 1); | ||
323 | if (r < 0) | ||
324 | return r; | ||
325 | |||
326 | r = menelaus_get_slot_pin_states(); | ||
327 | if (r < 0) | ||
328 | return r; | ||
329 | |||
330 | if (machine_is_nokia_n800()) { | ||
331 | bit = 1 << 1; | ||
332 | openp = &slot2_cover_open; | ||
333 | } else { | ||
334 | bit = 1; | ||
335 | openp = &slot1_cover_open; | ||
336 | slot2_cover_open = 0; | ||
337 | } | ||
338 | |||
339 | /* All slot pin bits seem to be inversed until first switch change */ | ||
340 | if (r == 0xf || r == (0xf & ~bit)) | ||
341 | r = ~r; | ||
342 | |||
343 | if (r & bit) | ||
344 | *openp = 1; | ||
345 | else | ||
346 | *openp = 0; | ||
347 | |||
348 | r = menelaus_register_mmc_callback(n8x0_mmc_callback, NULL); | ||
349 | |||
350 | return r; | ||
351 | } | ||
352 | |||
353 | static void n8x0_mmc_shutdown(struct device *dev) | ||
354 | { | ||
355 | int vs2sel; | ||
356 | |||
357 | if (machine_is_nokia_n800()) | ||
358 | vs2sel = 0; | ||
359 | else | ||
360 | vs2sel = 2; | ||
361 | |||
362 | menelaus_set_mmc_slot(1, 0, 0, 0); | ||
363 | menelaus_set_mmc_slot(2, 0, vs2sel, 0); | ||
364 | } | ||
365 | |||
366 | static void n8x0_mmc_cleanup(struct device *dev) | ||
367 | { | ||
368 | menelaus_unregister_mmc_callback(); | ||
369 | |||
370 | gpio_free(N8X0_SLOT_SWITCH_GPIO); | ||
371 | |||
372 | if (machine_is_nokia_n810()) { | ||
373 | gpio_free(N810_EMMC_VSD_GPIO); | ||
374 | gpio_free(NN810_EMMC_VIO_GPIO); | ||
375 | } | ||
376 | } | ||
377 | |||
378 | /* | ||
379 | * MMC controller1 has two slots that are multiplexed via I2C. | ||
380 | * MMC controller2 is not in use. | ||
381 | */ | ||
382 | static struct omap_mmc_platform_data mmc1_data = { | ||
383 | .nr_slots = 2, | ||
384 | .switch_slot = n8x0_mmc_switch_slot, | ||
385 | .init = n8x0_mmc_late_init, | ||
386 | .cleanup = n8x0_mmc_cleanup, | ||
387 | .shutdown = n8x0_mmc_shutdown, | ||
388 | .max_freq = 24000000, | ||
389 | .dma_mask = 0xffffffff, | ||
390 | .slots[0] = { | ||
391 | .wires = 4, | ||
392 | .set_power = n8x0_mmc_set_power, | ||
393 | .set_bus_mode = n8x0_mmc_set_bus_mode, | ||
394 | .get_cover_state = n8x0_mmc_get_cover_state, | ||
395 | .ocr_mask = MMC_VDD_165_195 | MMC_VDD_30_31 | | ||
396 | MMC_VDD_32_33 | MMC_VDD_33_34, | ||
397 | .name = "internal", | ||
398 | }, | ||
399 | .slots[1] = { | ||
400 | .set_power = n8x0_mmc_set_power, | ||
401 | .set_bus_mode = n8x0_mmc_set_bus_mode, | ||
402 | .get_cover_state = n8x0_mmc_get_cover_state, | ||
403 | .ocr_mask = MMC_VDD_165_195 | MMC_VDD_20_21 | | ||
404 | MMC_VDD_21_22 | MMC_VDD_22_23 | | ||
405 | MMC_VDD_23_24 | MMC_VDD_24_25 | | ||
406 | MMC_VDD_27_28 | MMC_VDD_28_29 | | ||
407 | MMC_VDD_29_30 | MMC_VDD_30_31 | | ||
408 | MMC_VDD_32_33 | MMC_VDD_33_34, | ||
409 | .name = "external", | ||
410 | }, | ||
411 | }; | ||
412 | |||
413 | static struct omap_mmc_platform_data *mmc_data[OMAP24XX_NR_MMC]; | ||
414 | |||
415 | void __init n8x0_mmc_init(void) | ||
416 | |||
417 | { | ||
418 | int err; | ||
419 | |||
420 | if (machine_is_nokia_n810()) { | ||
421 | mmc1_data.slots[0].name = "external"; | ||
422 | |||
423 | /* | ||
424 | * Some Samsung Movinand chips do not like open-ended | ||
425 | * multi-block reads and fall to braind-dead state | ||
426 | * while doing so. Reducing the number of blocks in | ||
427 | * the transfer or delays in clock disable do not help | ||
428 | */ | ||
429 | mmc1_data.slots[1].name = "internal"; | ||
430 | mmc1_data.slots[1].ban_openended = 1; | ||
431 | } | ||
432 | |||
433 | err = gpio_request(N8X0_SLOT_SWITCH_GPIO, "MMC slot switch"); | ||
434 | if (err) | ||
435 | return err; | ||
436 | |||
437 | gpio_direction_output(N8X0_SLOT_SWITCH_GPIO, 0); | ||
438 | |||
439 | if (machine_is_nokia_n810()) { | ||
440 | err = gpio_request(N810_EMMC_VSD_GPIO, "MMC slot 2 Vddf"); | ||
441 | if (err) { | ||
442 | gpio_free(N8X0_SLOT_SWITCH_GPIO); | ||
443 | return err; | ||
444 | } | ||
445 | gpio_direction_output(N810_EMMC_VSD_GPIO, 0); | ||
446 | |||
447 | err = gpio_request(NN810_EMMC_VIO_GPIO, "MMC slot 2 Vdd"); | ||
448 | if (err) { | ||
449 | gpio_free(N8X0_SLOT_SWITCH_GPIO); | ||
450 | gpio_free(N810_EMMC_VSD_GPIO); | ||
451 | return err; | ||
452 | } | ||
453 | gpio_direction_output(NN810_EMMC_VIO_GPIO, 0); | ||
454 | } | ||
455 | |||
456 | mmc_data[0] = &mmc1_data; | ||
457 | omap2_init_mmc(mmc_data, OMAP24XX_NR_MMC); | ||
458 | } | ||
459 | #else | ||
460 | |||
461 | void __init n8x0_mmc_init(void) | ||
462 | { | ||
463 | } | ||
464 | |||
465 | void n8x0_mmc_slot1_cover_handler(void *arg, int state) | ||
466 | { | ||
467 | } | ||
468 | |||
469 | #endif /* CONFIG_MMC_OMAP */ | ||
470 | |||
471 | #ifdef CONFIG_MENELAUS | ||
472 | |||
473 | static int n8x0_auto_sleep_regulators(void) | ||
474 | { | ||
475 | u32 val; | ||
476 | int ret; | ||
477 | |||
478 | val = EN_VPLL_SLEEP | EN_VMMC_SLEEP \ | ||
479 | | EN_VAUX_SLEEP | EN_VIO_SLEEP \ | ||
480 | | EN_VMEM_SLEEP | EN_DC3_SLEEP \ | ||
481 | | EN_VC_SLEEP | EN_DC2_SLEEP; | ||
482 | |||
483 | ret = menelaus_set_regulator_sleep(1, val); | ||
484 | if (ret < 0) { | ||
485 | printk(KERN_ERR "Could not set regulators to sleep on " | ||
486 | "menelaus: %u\n", ret); | ||
487 | return ret; | ||
488 | } | ||
489 | return 0; | ||
490 | } | ||
491 | |||
492 | static int n8x0_auto_voltage_scale(void) | ||
493 | { | ||
494 | int ret; | ||
495 | |||
496 | ret = menelaus_set_vcore_hw(1400, 1050); | ||
497 | if (ret < 0) { | ||
498 | printk(KERN_ERR "Could not set VCORE voltage on " | ||
499 | "menelaus: %u\n", ret); | ||
500 | return ret; | ||
501 | } | ||
502 | return 0; | ||
503 | } | ||
504 | |||
505 | static int n8x0_menelaus_late_init(struct device *dev) | ||
506 | { | ||
507 | int ret; | ||
508 | |||
509 | ret = n8x0_auto_voltage_scale(); | ||
510 | if (ret < 0) | ||
511 | return ret; | ||
512 | ret = n8x0_auto_sleep_regulators(); | ||
513 | if (ret < 0) | ||
514 | return ret; | ||
515 | return 0; | ||
516 | } | ||
517 | |||
518 | static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] = { | ||
519 | { | ||
520 | I2C_BOARD_INFO("menelaus", 0x72), | ||
521 | .irq = INT_24XX_SYS_NIRQ, | ||
522 | }, | ||
523 | }; | ||
524 | |||
525 | static struct menelaus_platform_data n8x0_menelaus_platform_data = { | ||
526 | .late_init = n8x0_menelaus_late_init, | ||
527 | }; | ||
528 | |||
529 | static void __init n8x0_menelaus_init(void) | ||
530 | { | ||
531 | n8x0_i2c_board_info_1[0].platform_data = &n8x0_menelaus_platform_data; | ||
532 | omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1, | ||
533 | ARRAY_SIZE(n8x0_i2c_board_info_1)); | ||
534 | } | ||
535 | |||
536 | #else | ||
537 | static inline void __init n8x0_menelaus_init(void) | ||
538 | { | ||
539 | } | ||
540 | #endif | ||
541 | |||
99 | static void __init n8x0_map_io(void) | 542 | static void __init n8x0_map_io(void) |
100 | { | 543 | { |
101 | omap2_set_globals_242x(); | 544 | omap2_set_globals_242x(); |
102 | omap2_map_common_io(); | 545 | omap242x_map_common_io(); |
103 | } | 546 | } |
104 | 547 | ||
105 | static void __init n8x0_init_irq(void) | 548 | static void __init n8x0_init_irq(void) |
@@ -116,7 +559,9 @@ static void __init n8x0_init_machine(void) | |||
116 | ARRAY_SIZE(n800_spi_board_info)); | 559 | ARRAY_SIZE(n800_spi_board_info)); |
117 | 560 | ||
118 | omap_serial_init(); | 561 | omap_serial_init(); |
562 | n8x0_menelaus_init(); | ||
119 | n8x0_onenand_init(); | 563 | n8x0_onenand_init(); |
564 | n8x0_mmc_init(); | ||
120 | } | 565 | } |
121 | 566 | ||
122 | MACHINE_START(NOKIA_N800, "Nokia N800") | 567 | MACHINE_START(NOKIA_N800, "Nokia N800") |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 231cb4ec1847..6eb77e1f7c82 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -45,7 +45,7 @@ | |||
45 | #include <plat/timer-gp.h> | 45 | #include <plat/timer-gp.h> |
46 | 46 | ||
47 | #include "mux.h" | 47 | #include "mux.h" |
48 | #include "mmc-twl4030.h" | 48 | #include "hsmmc.h" |
49 | 49 | ||
50 | #define GPMC_CS0_BASE 0x60 | 50 | #define GPMC_CS0_BASE 0x60 |
51 | #define GPMC_CS_SIZE 0x30 | 51 | #define GPMC_CS_SIZE 0x30 |
@@ -108,7 +108,7 @@ static struct platform_device omap3beagle_nand_device = { | |||
108 | 108 | ||
109 | #include "sdram-micron-mt46h32m32lf-6.h" | 109 | #include "sdram-micron-mt46h32m32lf-6.h" |
110 | 110 | ||
111 | static struct twl4030_hsmmc_info mmc[] = { | 111 | static struct omap2_hsmmc_info mmc[] = { |
112 | { | 112 | { |
113 | .mmc = 1, | 113 | .mmc = 1, |
114 | .wires = 8, | 114 | .wires = 8, |
@@ -147,7 +147,7 @@ static int beagle_twl_gpio_setup(struct device *dev, | |||
147 | } | 147 | } |
148 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 148 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
149 | mmc[0].gpio_cd = gpio + 0; | 149 | mmc[0].gpio_cd = gpio + 0; |
150 | twl4030_mmc_init(mmc); | 150 | omap2_hsmmc_init(mmc); |
151 | 151 | ||
152 | /* link regulators to MMC adapters */ | 152 | /* link regulators to MMC adapters */ |
153 | beagle_vmmc1_supply.dev = mmc[0].dev; | 153 | beagle_vmmc1_supply.dev = mmc[0].dev; |
@@ -430,6 +430,12 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
430 | #define board_mux NULL | 430 | #define board_mux NULL |
431 | #endif | 431 | #endif |
432 | 432 | ||
433 | static struct omap_musb_board_data musb_board_data = { | ||
434 | .interface_type = MUSB_INTERFACE_ULPI, | ||
435 | .mode = MUSB_OTG, | ||
436 | .power = 100, | ||
437 | }; | ||
438 | |||
433 | static void __init omap3_beagle_init(void) | 439 | static void __init omap3_beagle_init(void) |
434 | { | 440 | { |
435 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 441 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -443,7 +449,7 @@ static void __init omap3_beagle_init(void) | |||
443 | /* REVISIT leave DVI powered down until it's needed ... */ | 449 | /* REVISIT leave DVI powered down until it's needed ... */ |
444 | gpio_direction_output(170, true); | 450 | gpio_direction_output(170, true); |
445 | 451 | ||
446 | usb_musb_init(); | 452 | usb_musb_init(&musb_board_data); |
447 | usb_ehci_init(&ehci_pdata); | 453 | usb_ehci_init(&ehci_pdata); |
448 | omap3beagle_flash_init(); | 454 | omap3beagle_flash_init(); |
449 | 455 | ||
@@ -455,7 +461,7 @@ static void __init omap3_beagle_init(void) | |||
455 | static void __init omap3_beagle_map_io(void) | 461 | static void __init omap3_beagle_map_io(void) |
456 | { | 462 | { |
457 | omap2_set_globals_343x(); | 463 | omap2_set_globals_343x(); |
458 | omap2_map_common_io(); | 464 | omap34xx_map_common_io(); |
459 | } | 465 | } |
460 | 466 | ||
461 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 467 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 34de17851572..d6bc88c426b5 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -41,10 +41,11 @@ | |||
41 | #include <plat/usb.h> | 41 | #include <plat/usb.h> |
42 | #include <plat/common.h> | 42 | #include <plat/common.h> |
43 | #include <plat/mcspi.h> | 43 | #include <plat/mcspi.h> |
44 | #include <plat/display.h> | ||
44 | 45 | ||
45 | #include "mux.h" | 46 | #include "mux.h" |
46 | #include "sdram-micron-mt46h32m32lf-6.h" | 47 | #include "sdram-micron-mt46h32m32lf-6.h" |
47 | #include "mmc-twl4030.h" | 48 | #include "hsmmc.h" |
48 | 49 | ||
49 | #define OMAP3_EVM_TS_GPIO 175 | 50 | #define OMAP3_EVM_TS_GPIO 175 |
50 | #define OMAP3_EVM_EHCI_VBUS 22 | 51 | #define OMAP3_EVM_EHCI_VBUS 22 |
@@ -147,6 +148,187 @@ static inline void __init omap3evm_init_smsc911x(void) | |||
147 | static inline void __init omap3evm_init_smsc911x(void) { return; } | 148 | static inline void __init omap3evm_init_smsc911x(void) { return; } |
148 | #endif | 149 | #endif |
149 | 150 | ||
151 | /* | ||
152 | * OMAP3EVM LCD Panel control signals | ||
153 | */ | ||
154 | #define OMAP3EVM_LCD_PANEL_LR 2 | ||
155 | #define OMAP3EVM_LCD_PANEL_UD 3 | ||
156 | #define OMAP3EVM_LCD_PANEL_INI 152 | ||
157 | #define OMAP3EVM_LCD_PANEL_ENVDD 153 | ||
158 | #define OMAP3EVM_LCD_PANEL_QVGA 154 | ||
159 | #define OMAP3EVM_LCD_PANEL_RESB 155 | ||
160 | #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 | ||
161 | #define OMAP3EVM_DVI_PANEL_EN_GPIO 199 | ||
162 | |||
163 | static int lcd_enabled; | ||
164 | static int dvi_enabled; | ||
165 | |||
166 | static void __init omap3_evm_display_init(void) | ||
167 | { | ||
168 | int r; | ||
169 | |||
170 | r = gpio_request(OMAP3EVM_LCD_PANEL_RESB, "lcd_panel_resb"); | ||
171 | if (r) { | ||
172 | printk(KERN_ERR "failed to get lcd_panel_resb\n"); | ||
173 | return; | ||
174 | } | ||
175 | gpio_direction_output(OMAP3EVM_LCD_PANEL_RESB, 1); | ||
176 | |||
177 | r = gpio_request(OMAP3EVM_LCD_PANEL_INI, "lcd_panel_ini"); | ||
178 | if (r) { | ||
179 | printk(KERN_ERR "failed to get lcd_panel_ini\n"); | ||
180 | goto err_1; | ||
181 | } | ||
182 | gpio_direction_output(OMAP3EVM_LCD_PANEL_INI, 1); | ||
183 | |||
184 | r = gpio_request(OMAP3EVM_LCD_PANEL_QVGA, "lcd_panel_qvga"); | ||
185 | if (r) { | ||
186 | printk(KERN_ERR "failed to get lcd_panel_qvga\n"); | ||
187 | goto err_2; | ||
188 | } | ||
189 | gpio_direction_output(OMAP3EVM_LCD_PANEL_QVGA, 0); | ||
190 | |||
191 | r = gpio_request(OMAP3EVM_LCD_PANEL_LR, "lcd_panel_lr"); | ||
192 | if (r) { | ||
193 | printk(KERN_ERR "failed to get lcd_panel_lr\n"); | ||
194 | goto err_3; | ||
195 | } | ||
196 | gpio_direction_output(OMAP3EVM_LCD_PANEL_LR, 1); | ||
197 | |||
198 | r = gpio_request(OMAP3EVM_LCD_PANEL_UD, "lcd_panel_ud"); | ||
199 | if (r) { | ||
200 | printk(KERN_ERR "failed to get lcd_panel_ud\n"); | ||
201 | goto err_4; | ||
202 | } | ||
203 | gpio_direction_output(OMAP3EVM_LCD_PANEL_UD, 1); | ||
204 | |||
205 | r = gpio_request(OMAP3EVM_LCD_PANEL_ENVDD, "lcd_panel_envdd"); | ||
206 | if (r) { | ||
207 | printk(KERN_ERR "failed to get lcd_panel_envdd\n"); | ||
208 | goto err_5; | ||
209 | } | ||
210 | gpio_direction_output(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
211 | |||
212 | return; | ||
213 | |||
214 | err_5: | ||
215 | gpio_free(OMAP3EVM_LCD_PANEL_UD); | ||
216 | err_4: | ||
217 | gpio_free(OMAP3EVM_LCD_PANEL_LR); | ||
218 | err_3: | ||
219 | gpio_free(OMAP3EVM_LCD_PANEL_QVGA); | ||
220 | err_2: | ||
221 | gpio_free(OMAP3EVM_LCD_PANEL_INI); | ||
222 | err_1: | ||
223 | gpio_free(OMAP3EVM_LCD_PANEL_RESB); | ||
224 | |||
225 | } | ||
226 | |||
227 | static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) | ||
228 | { | ||
229 | if (dvi_enabled) { | ||
230 | printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); | ||
231 | return -EINVAL; | ||
232 | } | ||
233 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); | ||
234 | |||
235 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
236 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
237 | else | ||
238 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
239 | |||
240 | lcd_enabled = 1; | ||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev) | ||
245 | { | ||
246 | gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); | ||
247 | |||
248 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) | ||
249 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); | ||
250 | else | ||
251 | gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); | ||
252 | |||
253 | lcd_enabled = 0; | ||
254 | } | ||
255 | |||
256 | static struct omap_dss_device omap3_evm_lcd_device = { | ||
257 | .name = "lcd", | ||
258 | .driver_name = "sharp_ls_panel", | ||
259 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
260 | .phy.dpi.data_lines = 18, | ||
261 | .platform_enable = omap3_evm_enable_lcd, | ||
262 | .platform_disable = omap3_evm_disable_lcd, | ||
263 | }; | ||
264 | |||
265 | static int omap3_evm_enable_tv(struct omap_dss_device *dssdev) | ||
266 | { | ||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static void omap3_evm_disable_tv(struct omap_dss_device *dssdev) | ||
271 | { | ||
272 | } | ||
273 | |||
274 | static struct omap_dss_device omap3_evm_tv_device = { | ||
275 | .name = "tv", | ||
276 | .driver_name = "venc", | ||
277 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
278 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
279 | .platform_enable = omap3_evm_enable_tv, | ||
280 | .platform_disable = omap3_evm_disable_tv, | ||
281 | }; | ||
282 | |||
283 | static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev) | ||
284 | { | ||
285 | if (lcd_enabled) { | ||
286 | printk(KERN_ERR "cannot enable DVI, LCD is enabled\n"); | ||
287 | return -EINVAL; | ||
288 | } | ||
289 | |||
290 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); | ||
291 | |||
292 | dvi_enabled = 1; | ||
293 | return 0; | ||
294 | } | ||
295 | |||
296 | static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) | ||
297 | { | ||
298 | gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); | ||
299 | |||
300 | dvi_enabled = 0; | ||
301 | } | ||
302 | |||
303 | static struct omap_dss_device omap3_evm_dvi_device = { | ||
304 | .name = "dvi", | ||
305 | .driver_name = "generic_panel", | ||
306 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
307 | .phy.dpi.data_lines = 24, | ||
308 | .platform_enable = omap3_evm_enable_dvi, | ||
309 | .platform_disable = omap3_evm_disable_dvi, | ||
310 | }; | ||
311 | |||
312 | static struct omap_dss_device *omap3_evm_dss_devices[] = { | ||
313 | &omap3_evm_lcd_device, | ||
314 | &omap3_evm_tv_device, | ||
315 | &omap3_evm_dvi_device, | ||
316 | }; | ||
317 | |||
318 | static struct omap_dss_board_info omap3_evm_dss_data = { | ||
319 | .num_devices = ARRAY_SIZE(omap3_evm_dss_devices), | ||
320 | .devices = omap3_evm_dss_devices, | ||
321 | .default_device = &omap3_evm_lcd_device, | ||
322 | }; | ||
323 | |||
324 | static struct platform_device omap3_evm_dss_device = { | ||
325 | .name = "omapdss", | ||
326 | .id = -1, | ||
327 | .dev = { | ||
328 | .platform_data = &omap3_evm_dss_data, | ||
329 | }, | ||
330 | }; | ||
331 | |||
150 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { | 332 | static struct regulator_consumer_supply omap3evm_vmmc1_supply = { |
151 | .supply = "vmmc", | 333 | .supply = "vmmc", |
152 | }; | 334 | }; |
@@ -185,7 +367,7 @@ static struct regulator_init_data omap3evm_vsim = { | |||
185 | .consumer_supplies = &omap3evm_vsim_supply, | 367 | .consumer_supplies = &omap3evm_vsim_supply, |
186 | }; | 368 | }; |
187 | 369 | ||
188 | static struct twl4030_hsmmc_info mmc[] = { | 370 | static struct omap2_hsmmc_info mmc[] = { |
189 | { | 371 | { |
190 | .mmc = 1, | 372 | .mmc = 1, |
191 | .wires = 4, | 373 | .wires = 4, |
@@ -225,7 +407,7 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
225 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 407 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
226 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); | 408 | omap_mux_init_gpio(63, OMAP_PIN_INPUT); |
227 | mmc[0].gpio_cd = gpio + 0; | 409 | mmc[0].gpio_cd = gpio + 0; |
228 | twl4030_mmc_init(mmc); | 410 | omap2_hsmmc_init(mmc); |
229 | 411 | ||
230 | /* link regulators to MMC adapters */ | 412 | /* link regulators to MMC adapters */ |
231 | omap3evm_vmmc1_supply.dev = mmc[0].dev; | 413 | omap3evm_vmmc1_supply.dev = mmc[0].dev; |
@@ -236,6 +418,14 @@ static int omap3evm_twl_gpio_setup(struct device *dev, | |||
236 | * the P2 connector; notably LEDA for the LCD backlight. | 418 | * the P2 connector; notably LEDA for the LCD backlight. |
237 | */ | 419 | */ |
238 | 420 | ||
421 | /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ | ||
422 | gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); | ||
423 | gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); | ||
424 | |||
425 | /* gpio + 7 == DVI Enable */ | ||
426 | gpio_request(gpio + 7, "EN_DVI"); | ||
427 | gpio_direction_output(gpio + 7, 0); | ||
428 | |||
239 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ | 429 | /* TWL4030_GPIO_MAX + 1 == ledB (out, active low LED) */ |
240 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; | 430 | gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; |
241 | 431 | ||
@@ -258,20 +448,23 @@ static struct twl4030_usb_data omap3evm_usb_data = { | |||
258 | 448 | ||
259 | static int board_keymap[] = { | 449 | static int board_keymap[] = { |
260 | KEY(0, 0, KEY_LEFT), | 450 | KEY(0, 0, KEY_LEFT), |
261 | KEY(0, 1, KEY_RIGHT), | 451 | KEY(0, 1, KEY_DOWN), |
262 | KEY(0, 2, KEY_A), | 452 | KEY(0, 2, KEY_ENTER), |
263 | KEY(0, 3, KEY_B), | 453 | KEY(0, 3, KEY_M), |
264 | KEY(1, 0, KEY_DOWN), | 454 | |
455 | KEY(1, 0, KEY_RIGHT), | ||
265 | KEY(1, 1, KEY_UP), | 456 | KEY(1, 1, KEY_UP), |
266 | KEY(1, 2, KEY_E), | 457 | KEY(1, 2, KEY_I), |
267 | KEY(1, 3, KEY_F), | 458 | KEY(1, 3, KEY_N), |
268 | KEY(2, 0, KEY_ENTER), | 459 | |
269 | KEY(2, 1, KEY_I), | 460 | KEY(2, 0, KEY_A), |
461 | KEY(2, 1, KEY_E), | ||
270 | KEY(2, 2, KEY_J), | 462 | KEY(2, 2, KEY_J), |
271 | KEY(2, 3, KEY_K), | 463 | KEY(2, 3, KEY_O), |
272 | KEY(3, 0, KEY_M), | 464 | |
273 | KEY(3, 1, KEY_N), | 465 | KEY(3, 0, KEY_B), |
274 | KEY(3, 2, KEY_O), | 466 | KEY(3, 1, KEY_F), |
467 | KEY(3, 2, KEY_K), | ||
275 | KEY(3, 3, KEY_P) | 468 | KEY(3, 3, KEY_P) |
276 | }; | 469 | }; |
277 | 470 | ||
@@ -300,6 +493,47 @@ static struct twl4030_codec_data omap3evm_codec_data = { | |||
300 | .audio = &omap3evm_audio_data, | 493 | .audio = &omap3evm_audio_data, |
301 | }; | 494 | }; |
302 | 495 | ||
496 | static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { | ||
497 | .supply = "vdda_dac", | ||
498 | .dev = &omap3_evm_dss_device.dev, | ||
499 | }; | ||
500 | |||
501 | /* VDAC for DSS driving S-Video */ | ||
502 | static struct regulator_init_data omap3_evm_vdac = { | ||
503 | .constraints = { | ||
504 | .min_uV = 1800000, | ||
505 | .max_uV = 1800000, | ||
506 | .apply_uV = true, | ||
507 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
508 | | REGULATOR_MODE_STANDBY, | ||
509 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
510 | | REGULATOR_CHANGE_STATUS, | ||
511 | }, | ||
512 | .num_consumer_supplies = 1, | ||
513 | .consumer_supplies = &omap3_evm_vdda_dac_supply, | ||
514 | }; | ||
515 | |||
516 | /* VPLL2 for digital video outputs */ | ||
517 | static struct regulator_consumer_supply omap3_evm_vpll2_supply = { | ||
518 | .supply = "vdvi", | ||
519 | .dev = &omap3_evm_lcd_device.dev, | ||
520 | }; | ||
521 | |||
522 | static struct regulator_init_data omap3_evm_vpll2 = { | ||
523 | .constraints = { | ||
524 | .name = "VDVI", | ||
525 | .min_uV = 1800000, | ||
526 | .max_uV = 1800000, | ||
527 | .apply_uV = true, | ||
528 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
529 | | REGULATOR_MODE_STANDBY, | ||
530 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
531 | | REGULATOR_CHANGE_STATUS, | ||
532 | }, | ||
533 | .num_consumer_supplies = 1, | ||
534 | .consumer_supplies = &omap3_evm_vpll2_supply, | ||
535 | }; | ||
536 | |||
303 | static struct twl4030_platform_data omap3evm_twldata = { | 537 | static struct twl4030_platform_data omap3evm_twldata = { |
304 | .irq_base = TWL4030_IRQ_BASE, | 538 | .irq_base = TWL4030_IRQ_BASE, |
305 | .irq_end = TWL4030_IRQ_END, | 539 | .irq_end = TWL4030_IRQ_END, |
@@ -310,6 +544,8 @@ static struct twl4030_platform_data omap3evm_twldata = { | |||
310 | .usb = &omap3evm_usb_data, | 544 | .usb = &omap3evm_usb_data, |
311 | .gpio = &omap3evm_gpio_data, | 545 | .gpio = &omap3evm_gpio_data, |
312 | .codec = &omap3evm_codec_data, | 546 | .codec = &omap3evm_codec_data, |
547 | .vdac = &omap3_evm_vdac, | ||
548 | .vpll2 = &omap3_evm_vpll2, | ||
313 | }; | 549 | }; |
314 | 550 | ||
315 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { | 551 | static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { |
@@ -337,15 +573,6 @@ static int __init omap3_evm_i2c_init(void) | |||
337 | return 0; | 573 | return 0; |
338 | } | 574 | } |
339 | 575 | ||
340 | static struct platform_device omap3_evm_lcd_device = { | ||
341 | .name = "omap3evm_lcd", | ||
342 | .id = -1, | ||
343 | }; | ||
344 | |||
345 | static struct omap_lcd_config omap3_evm_lcd_config __initdata = { | ||
346 | .ctrl_name = "internal", | ||
347 | }; | ||
348 | |||
349 | static void ads7846_dev_init(void) | 576 | static void ads7846_dev_init(void) |
350 | { | 577 | { |
351 | if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) | 578 | if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0) |
@@ -393,7 +620,6 @@ struct spi_board_info omap3evm_spi_board_info[] = { | |||
393 | }; | 620 | }; |
394 | 621 | ||
395 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { | 622 | static struct omap_board_config_kernel omap3_evm_config[] __initdata = { |
396 | { OMAP_TAG_LCD, &omap3_evm_lcd_config }, | ||
397 | }; | 623 | }; |
398 | 624 | ||
399 | static void __init omap3_evm_init_irq(void) | 625 | static void __init omap3_evm_init_irq(void) |
@@ -406,7 +632,7 @@ static void __init omap3_evm_init_irq(void) | |||
406 | } | 632 | } |
407 | 633 | ||
408 | static struct platform_device *omap3_evm_devices[] __initdata = { | 634 | static struct platform_device *omap3_evm_devices[] __initdata = { |
409 | &omap3_evm_lcd_device, | 635 | &omap3_evm_dss_device, |
410 | }; | 636 | }; |
411 | 637 | ||
412 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 638 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
@@ -424,12 +650,24 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | |||
424 | 650 | ||
425 | #ifdef CONFIG_OMAP_MUX | 651 | #ifdef CONFIG_OMAP_MUX |
426 | static struct omap_board_mux board_mux[] __initdata = { | 652 | static struct omap_board_mux board_mux[] __initdata = { |
653 | OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | | ||
654 | OMAP_PIN_OFF_INPUT_PULLUP | | ||
655 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
656 | OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | | ||
657 | OMAP_PIN_OFF_INPUT_PULLUP | | ||
658 | OMAP_PIN_OFF_WAKEUPENABLE), | ||
427 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 659 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
428 | }; | 660 | }; |
429 | #else | 661 | #else |
430 | #define board_mux NULL | 662 | #define board_mux NULL |
431 | #endif | 663 | #endif |
432 | 664 | ||
665 | static struct omap_musb_board_data musb_board_data = { | ||
666 | .interface_type = MUSB_INTERFACE_ULPI, | ||
667 | .mode = MUSB_OTG, | ||
668 | .power = 100, | ||
669 | }; | ||
670 | |||
433 | static void __init omap3_evm_init(void) | 671 | static void __init omap3_evm_init(void) |
434 | { | 672 | { |
435 | omap3_evm_get_revision(); | 673 | omap3_evm_get_revision(); |
@@ -443,10 +681,10 @@ static void __init omap3_evm_init(void) | |||
443 | ARRAY_SIZE(omap3evm_spi_board_info)); | 681 | ARRAY_SIZE(omap3evm_spi_board_info)); |
444 | 682 | ||
445 | omap_serial_init(); | 683 | omap_serial_init(); |
446 | #ifdef CONFIG_NOP_USB_XCEIV | 684 | |
447 | /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ | 685 | /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ |
448 | usb_nop_xceiv_register(); | 686 | usb_nop_xceiv_register(); |
449 | #endif | 687 | |
450 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { | 688 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) { |
451 | /* enable EHCI VBUS using GPIO22 */ | 689 | /* enable EHCI VBUS using GPIO22 */ |
452 | omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP); | 690 | omap_mux_init_gpio(22, OMAP_PIN_INPUT_PULLUP); |
@@ -469,16 +707,17 @@ static void __init omap3_evm_init(void) | |||
469 | omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); | 707 | omap_mux_init_gpio(135, OMAP_PIN_OUTPUT); |
470 | ehci_pdata.reset_gpio_port[1] = 135; | 708 | ehci_pdata.reset_gpio_port[1] = 135; |
471 | } | 709 | } |
472 | usb_musb_init(); | 710 | usb_musb_init(&musb_board_data); |
473 | usb_ehci_init(&ehci_pdata); | 711 | usb_ehci_init(&ehci_pdata); |
474 | ads7846_dev_init(); | 712 | ads7846_dev_init(); |
475 | omap3evm_init_smsc911x(); | 713 | omap3evm_init_smsc911x(); |
714 | omap3_evm_display_init(); | ||
476 | } | 715 | } |
477 | 716 | ||
478 | static void __init omap3_evm_map_io(void) | 717 | static void __init omap3_evm_map_io(void) |
479 | { | 718 | { |
480 | omap2_set_globals_343x(); | 719 | omap2_set_globals_343x(); |
481 | omap2_map_common_io(); | 720 | omap34xx_map_common_io(); |
482 | } | 721 | } |
483 | 722 | ||
484 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") | 723 | MACHINE_START(OMAP3EVM, "OMAP3 EVM") |
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index ef17cf1ab6d7..4827f4658df3 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
@@ -40,10 +40,11 @@ | |||
40 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
41 | #include <plat/mcspi.h> | 41 | #include <plat/mcspi.h> |
42 | #include <plat/usb.h> | 42 | #include <plat/usb.h> |
43 | #include <plat/display.h> | ||
43 | 44 | ||
44 | #include "mux.h" | 45 | #include "mux.h" |
45 | #include "sdram-micron-mt46h32m32lf-6.h" | 46 | #include "sdram-micron-mt46h32m32lf-6.h" |
46 | #include "mmc-twl4030.h" | 47 | #include "hsmmc.h" |
47 | 48 | ||
48 | #define OMAP3_PANDORA_TS_GPIO 94 | 49 | #define OMAP3_PANDORA_TS_GPIO 94 |
49 | 50 | ||
@@ -192,7 +193,41 @@ static struct twl4030_keypad_data pandora_kp_data = { | |||
192 | .rep = 1, | 193 | .rep = 1, |
193 | }; | 194 | }; |
194 | 195 | ||
195 | static struct twl4030_hsmmc_info omap3pandora_mmc[] = { | 196 | static struct omap_dss_device pandora_lcd_device = { |
197 | .name = "lcd", | ||
198 | .driver_name = "tpo_td043mtea1_panel", | ||
199 | .type = OMAP_DISPLAY_TYPE_DPI, | ||
200 | .phy.dpi.data_lines = 24, | ||
201 | .reset_gpio = 157, | ||
202 | }; | ||
203 | |||
204 | static struct omap_dss_device pandora_tv_device = { | ||
205 | .name = "tv", | ||
206 | .driver_name = "venc", | ||
207 | .type = OMAP_DISPLAY_TYPE_VENC, | ||
208 | .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, | ||
209 | }; | ||
210 | |||
211 | static struct omap_dss_device *pandora_dss_devices[] = { | ||
212 | &pandora_lcd_device, | ||
213 | &pandora_tv_device, | ||
214 | }; | ||
215 | |||
216 | static struct omap_dss_board_info pandora_dss_data = { | ||
217 | .num_devices = ARRAY_SIZE(pandora_dss_devices), | ||
218 | .devices = pandora_dss_devices, | ||
219 | .default_device = &pandora_lcd_device, | ||
220 | }; | ||
221 | |||
222 | static struct platform_device pandora_dss_device = { | ||
223 | .name = "omapdss", | ||
224 | .id = -1, | ||
225 | .dev = { | ||
226 | .platform_data = &pandora_dss_data, | ||
227 | }, | ||
228 | }; | ||
229 | |||
230 | static struct omap2_hsmmc_info omap3pandora_mmc[] = { | ||
196 | { | 231 | { |
197 | .mmc = 1, | 232 | .mmc = 1, |
198 | .wires = 4, | 233 | .wires = 4, |
@@ -217,25 +252,13 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = { | |||
217 | {} /* Terminator */ | 252 | {} /* Terminator */ |
218 | }; | 253 | }; |
219 | 254 | ||
220 | static struct regulator_consumer_supply pandora_vmmc1_supply = { | ||
221 | .supply = "vmmc", | ||
222 | }; | ||
223 | |||
224 | static struct regulator_consumer_supply pandora_vmmc2_supply = { | ||
225 | .supply = "vmmc", | ||
226 | }; | ||
227 | |||
228 | static int omap3pandora_twl_gpio_setup(struct device *dev, | 255 | static int omap3pandora_twl_gpio_setup(struct device *dev, |
229 | unsigned gpio, unsigned ngpio) | 256 | unsigned gpio, unsigned ngpio) |
230 | { | 257 | { |
231 | /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ | 258 | /* gpio + {0,1} is "mmc{0,1}_cd" (input/IRQ) */ |
232 | omap3pandora_mmc[0].gpio_cd = gpio + 0; | 259 | omap3pandora_mmc[0].gpio_cd = gpio + 0; |
233 | omap3pandora_mmc[1].gpio_cd = gpio + 1; | 260 | omap3pandora_mmc[1].gpio_cd = gpio + 1; |
234 | twl4030_mmc_init(omap3pandora_mmc); | 261 | omap2_hsmmc_init(omap3pandora_mmc); |
235 | |||
236 | /* link regulators to MMC adapters */ | ||
237 | pandora_vmmc1_supply.dev = omap3pandora_mmc[0].dev; | ||
238 | pandora_vmmc2_supply.dev = omap3pandora_mmc[1].dev; | ||
239 | 262 | ||
240 | return 0; | 263 | return 0; |
241 | } | 264 | } |
@@ -247,6 +270,36 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | |||
247 | .setup = omap3pandora_twl_gpio_setup, | 270 | .setup = omap3pandora_twl_gpio_setup, |
248 | }; | 271 | }; |
249 | 272 | ||
273 | static struct regulator_consumer_supply pandora_vmmc1_supply = | ||
274 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); | ||
275 | |||
276 | static struct regulator_consumer_supply pandora_vmmc2_supply = | ||
277 | REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); | ||
278 | |||
279 | static struct regulator_consumer_supply pandora_vdda_dac_supply = | ||
280 | REGULATOR_SUPPLY("vdda_dac", "omapdss"); | ||
281 | |||
282 | static struct regulator_consumer_supply pandora_vdds_supplies[] = { | ||
283 | REGULATOR_SUPPLY("vdds_sdi", "omapdss"), | ||
284 | REGULATOR_SUPPLY("vdds_dsi", "omapdss"), | ||
285 | }; | ||
286 | |||
287 | static struct regulator_consumer_supply pandora_vcc_lcd_supply = | ||
288 | REGULATOR_SUPPLY("vcc", "display0"); | ||
289 | |||
290 | static struct regulator_consumer_supply pandora_usb_phy_supply = | ||
291 | REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"); | ||
292 | |||
293 | /* ads7846 on SPI and 2 nub controllers on I2C */ | ||
294 | static struct regulator_consumer_supply pandora_vaux4_supplies[] = { | ||
295 | REGULATOR_SUPPLY("vcc", "spi1.0"), | ||
296 | REGULATOR_SUPPLY("vcc", "3-0066"), | ||
297 | REGULATOR_SUPPLY("vcc", "3-0067"), | ||
298 | }; | ||
299 | |||
300 | static struct regulator_consumer_supply pandora_adac_supply = | ||
301 | REGULATOR_SUPPLY("vcc", "soc-audio"); | ||
302 | |||
250 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | 303 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ |
251 | static struct regulator_init_data pandora_vmmc1 = { | 304 | static struct regulator_init_data pandora_vmmc1 = { |
252 | .constraints = { | 305 | .constraints = { |
@@ -277,6 +330,96 @@ static struct regulator_init_data pandora_vmmc2 = { | |||
277 | .consumer_supplies = &pandora_vmmc2_supply, | 330 | .consumer_supplies = &pandora_vmmc2_supply, |
278 | }; | 331 | }; |
279 | 332 | ||
333 | /* VDAC for DSS driving S-Video */ | ||
334 | static struct regulator_init_data pandora_vdac = { | ||
335 | .constraints = { | ||
336 | .min_uV = 1800000, | ||
337 | .max_uV = 1800000, | ||
338 | .apply_uV = true, | ||
339 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
340 | | REGULATOR_MODE_STANDBY, | ||
341 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
342 | | REGULATOR_CHANGE_STATUS, | ||
343 | }, | ||
344 | .num_consumer_supplies = 1, | ||
345 | .consumer_supplies = &pandora_vdda_dac_supply, | ||
346 | }; | ||
347 | |||
348 | /* VPLL2 for digital video outputs */ | ||
349 | static struct regulator_init_data pandora_vpll2 = { | ||
350 | .constraints = { | ||
351 | .min_uV = 1800000, | ||
352 | .max_uV = 1800000, | ||
353 | .apply_uV = true, | ||
354 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
355 | | REGULATOR_MODE_STANDBY, | ||
356 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
357 | | REGULATOR_CHANGE_STATUS, | ||
358 | }, | ||
359 | .num_consumer_supplies = ARRAY_SIZE(pandora_vdds_supplies), | ||
360 | .consumer_supplies = pandora_vdds_supplies, | ||
361 | }; | ||
362 | |||
363 | /* VAUX1 for LCD */ | ||
364 | static struct regulator_init_data pandora_vaux1 = { | ||
365 | .constraints = { | ||
366 | .min_uV = 3000000, | ||
367 | .max_uV = 3000000, | ||
368 | .apply_uV = true, | ||
369 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
370 | | REGULATOR_MODE_STANDBY, | ||
371 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
372 | | REGULATOR_CHANGE_STATUS, | ||
373 | }, | ||
374 | .num_consumer_supplies = 1, | ||
375 | .consumer_supplies = &pandora_vcc_lcd_supply, | ||
376 | }; | ||
377 | |||
378 | /* VAUX2 for USB host PHY */ | ||
379 | static struct regulator_init_data pandora_vaux2 = { | ||
380 | .constraints = { | ||
381 | .min_uV = 1800000, | ||
382 | .max_uV = 1800000, | ||
383 | .apply_uV = true, | ||
384 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
385 | | REGULATOR_MODE_STANDBY, | ||
386 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
387 | | REGULATOR_CHANGE_STATUS, | ||
388 | }, | ||
389 | .num_consumer_supplies = 1, | ||
390 | .consumer_supplies = &pandora_usb_phy_supply, | ||
391 | }; | ||
392 | |||
393 | /* VAUX4 for ads7846 and nubs */ | ||
394 | static struct regulator_init_data pandora_vaux4 = { | ||
395 | .constraints = { | ||
396 | .min_uV = 2800000, | ||
397 | .max_uV = 2800000, | ||
398 | .apply_uV = true, | ||
399 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
400 | | REGULATOR_MODE_STANDBY, | ||
401 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
402 | | REGULATOR_CHANGE_STATUS, | ||
403 | }, | ||
404 | .num_consumer_supplies = ARRAY_SIZE(pandora_vaux4_supplies), | ||
405 | .consumer_supplies = pandora_vaux4_supplies, | ||
406 | }; | ||
407 | |||
408 | /* VSIM for audio DAC */ | ||
409 | static struct regulator_init_data pandora_vsim = { | ||
410 | .constraints = { | ||
411 | .min_uV = 2800000, | ||
412 | .max_uV = 2800000, | ||
413 | .apply_uV = true, | ||
414 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
415 | | REGULATOR_MODE_STANDBY, | ||
416 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
417 | | REGULATOR_CHANGE_STATUS, | ||
418 | }, | ||
419 | .num_consumer_supplies = 1, | ||
420 | .consumer_supplies = &pandora_adac_supply, | ||
421 | }; | ||
422 | |||
280 | static struct twl4030_usb_data omap3pandora_usb_data = { | 423 | static struct twl4030_usb_data omap3pandora_usb_data = { |
281 | .usb_mode = T2_USB_MODE_ULPI, | 424 | .usb_mode = T2_USB_MODE_ULPI, |
282 | }; | 425 | }; |
@@ -298,6 +441,12 @@ static struct twl4030_platform_data omap3pandora_twldata = { | |||
298 | .codec = &omap3pandora_codec_data, | 441 | .codec = &omap3pandora_codec_data, |
299 | .vmmc1 = &pandora_vmmc1, | 442 | .vmmc1 = &pandora_vmmc1, |
300 | .vmmc2 = &pandora_vmmc2, | 443 | .vmmc2 = &pandora_vmmc2, |
444 | .vdac = &pandora_vdac, | ||
445 | .vpll2 = &pandora_vpll2, | ||
446 | .vaux1 = &pandora_vaux1, | ||
447 | .vaux2 = &pandora_vaux2, | ||
448 | .vaux4 = &pandora_vaux4, | ||
449 | .vsim = &pandora_vsim, | ||
301 | .keypad = &pandora_kp_data, | 450 | .keypad = &pandora_kp_data, |
302 | }; | 451 | }; |
303 | 452 | ||
@@ -365,6 +514,12 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { | |||
365 | .controller_data = &ads7846_mcspi_config, | 514 | .controller_data = &ads7846_mcspi_config, |
366 | .irq = OMAP_GPIO_IRQ(OMAP3_PANDORA_TS_GPIO), | 515 | .irq = OMAP_GPIO_IRQ(OMAP3_PANDORA_TS_GPIO), |
367 | .platform_data = &ads7846_config, | 516 | .platform_data = &ads7846_config, |
517 | }, { | ||
518 | .modalias = "tpo_td043mtea1_panel_spi", | ||
519 | .bus_num = 1, | ||
520 | .chip_select = 1, | ||
521 | .max_speed_hz = 375000, | ||
522 | .platform_data = &pandora_lcd_device, | ||
368 | } | 523 | } |
369 | }; | 524 | }; |
370 | 525 | ||
@@ -379,6 +534,7 @@ static void __init omap3pandora_init_irq(void) | |||
379 | static struct platform_device *omap3pandora_devices[] __initdata = { | 534 | static struct platform_device *omap3pandora_devices[] __initdata = { |
380 | &pandora_leds_gpio, | 535 | &pandora_leds_gpio, |
381 | &pandora_keys_gpio, | 536 | &pandora_keys_gpio, |
537 | &pandora_dss_device, | ||
382 | }; | 538 | }; |
383 | 539 | ||
384 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | 540 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { |
@@ -401,6 +557,12 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
401 | #define board_mux NULL | 557 | #define board_mux NULL |
402 | #endif | 558 | #endif |
403 | 559 | ||
560 | static struct omap_musb_board_data musb_board_data = { | ||
561 | .interface_type = MUSB_INTERFACE_ULPI, | ||
562 | .mode = MUSB_OTG, | ||
563 | .power = 100, | ||
564 | }; | ||
565 | |||
404 | static void __init omap3pandora_init(void) | 566 | static void __init omap3pandora_init(void) |
405 | { | 567 | { |
406 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 568 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -413,7 +575,7 @@ static void __init omap3pandora_init(void) | |||
413 | omap3pandora_ads7846_init(); | 575 | omap3pandora_ads7846_init(); |
414 | usb_ehci_init(&ehci_pdata); | 576 | usb_ehci_init(&ehci_pdata); |
415 | pandora_keys_gpio_init(); | 577 | pandora_keys_gpio_init(); |
416 | usb_musb_init(); | 578 | usb_musb_init(&musb_board_data); |
417 | 579 | ||
418 | /* Ensure SDRC pins are mux'd for self-refresh */ | 580 | /* Ensure SDRC pins are mux'd for self-refresh */ |
419 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 581 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
@@ -423,7 +585,7 @@ static void __init omap3pandora_init(void) | |||
423 | static void __init omap3pandora_map_io(void) | 585 | static void __init omap3pandora_map_io(void) |
424 | { | 586 | { |
425 | omap2_set_globals_343x(); | 587 | omap2_set_globals_343x(); |
426 | omap2_map_common_io(); | 588 | omap34xx_map_common_io(); |
427 | } | 589 | } |
428 | 590 | ||
429 | MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") | 591 | MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") |
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index fe3d22cb2457..3943d0f8322c 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c | |||
@@ -50,7 +50,7 @@ | |||
50 | #include <plat/timer-gp.h> | 50 | #include <plat/timer-gp.h> |
51 | 51 | ||
52 | #include "mux.h" | 52 | #include "mux.h" |
53 | #include "mmc-twl4030.h" | 53 | #include "hsmmc.h" |
54 | 54 | ||
55 | #include <asm/setup.h> | 55 | #include <asm/setup.h> |
56 | 56 | ||
@@ -122,7 +122,7 @@ static struct platform_device omap3touchbook_nand_device = { | |||
122 | 122 | ||
123 | #include "sdram-micron-mt46h32m32lf-6.h" | 123 | #include "sdram-micron-mt46h32m32lf-6.h" |
124 | 124 | ||
125 | static struct twl4030_hsmmc_info mmc[] = { | 125 | static struct omap2_hsmmc_info mmc[] = { |
126 | { | 126 | { |
127 | .mmc = 1, | 127 | .mmc = 1, |
128 | .wires = 8, | 128 | .wires = 8, |
@@ -161,7 +161,7 @@ static int touchbook_twl_gpio_setup(struct device *dev, | |||
161 | } | 161 | } |
162 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 162 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
163 | mmc[0].gpio_cd = gpio + 0; | 163 | mmc[0].gpio_cd = gpio + 0; |
164 | twl4030_mmc_init(mmc); | 164 | omap2_hsmmc_init(mmc); |
165 | 165 | ||
166 | /* link regulators to MMC adapters */ | 166 | /* link regulators to MMC adapters */ |
167 | touchbook_vmmc1_supply.dev = mmc[0].dev; | 167 | touchbook_vmmc1_supply.dev = mmc[0].dev; |
@@ -527,6 +527,12 @@ static void __init early_touchbook_revision(char **p) | |||
527 | } | 527 | } |
528 | __early_param("tbr=", early_touchbook_revision); | 528 | __early_param("tbr=", early_touchbook_revision); |
529 | 529 | ||
530 | static struct omap_musb_board_data musb_board_data = { | ||
531 | .interface_type = MUSB_INTERFACE_ULPI, | ||
532 | .mode = MUSB_OTG, | ||
533 | .power = 100, | ||
534 | }; | ||
535 | |||
530 | static void __init omap3_touchbook_init(void) | 536 | static void __init omap3_touchbook_init(void) |
531 | { | 537 | { |
532 | pm_power_off = omap3_touchbook_poweroff; | 538 | pm_power_off = omap3_touchbook_poweroff; |
@@ -545,7 +551,7 @@ static void __init omap3_touchbook_init(void) | |||
545 | spi_register_board_info(omap3_ads7846_spi_board_info, | 551 | spi_register_board_info(omap3_ads7846_spi_board_info, |
546 | ARRAY_SIZE(omap3_ads7846_spi_board_info)); | 552 | ARRAY_SIZE(omap3_ads7846_spi_board_info)); |
547 | omap3_ads7846_init(); | 553 | omap3_ads7846_init(); |
548 | usb_musb_init(); | 554 | usb_musb_init(&musb_board_data); |
549 | usb_ehci_init(&ehci_pdata); | 555 | usb_ehci_init(&ehci_pdata); |
550 | omap3touchbook_flash_init(); | 556 | omap3touchbook_flash_init(); |
551 | 557 | ||
@@ -557,7 +563,7 @@ static void __init omap3_touchbook_init(void) | |||
557 | static void __init omap3_touchbook_map_io(void) | 563 | static void __init omap3_touchbook_map_io(void) |
558 | { | 564 | { |
559 | omap2_set_globals_343x(); | 565 | omap2_set_globals_343x(); |
560 | omap2_map_common_io(); | 566 | omap34xx_map_common_io(); |
561 | } | 567 | } |
562 | 568 | ||
563 | MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") | 569 | MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index d192dd98a591..50872a42bec7 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -48,7 +48,7 @@ | |||
48 | 48 | ||
49 | #include "mux.h" | 49 | #include "mux.h" |
50 | #include "sdram-micron-mt46h32m32lf-6.h" | 50 | #include "sdram-micron-mt46h32m32lf-6.h" |
51 | #include "mmc-twl4030.h" | 51 | #include "hsmmc.h" |
52 | 52 | ||
53 | #define OVERO_GPIO_BT_XGATE 15 | 53 | #define OVERO_GPIO_BT_XGATE 15 |
54 | #define OVERO_GPIO_W2W_NRESET 16 | 54 | #define OVERO_GPIO_W2W_NRESET 16 |
@@ -272,7 +272,7 @@ static void __init overo_flash_init(void) | |||
272 | } | 272 | } |
273 | } | 273 | } |
274 | 274 | ||
275 | static struct twl4030_hsmmc_info mmc[] = { | 275 | static struct omap2_hsmmc_info mmc[] = { |
276 | { | 276 | { |
277 | .mmc = 1, | 277 | .mmc = 1, |
278 | .wires = 4, | 278 | .wires = 4, |
@@ -297,7 +297,7 @@ static struct regulator_consumer_supply overo_vmmc1_supply = { | |||
297 | static int overo_twl_gpio_setup(struct device *dev, | 297 | static int overo_twl_gpio_setup(struct device *dev, |
298 | unsigned gpio, unsigned ngpio) | 298 | unsigned gpio, unsigned ngpio) |
299 | { | 299 | { |
300 | twl4030_mmc_init(mmc); | 300 | omap2_hsmmc_init(mmc); |
301 | 301 | ||
302 | overo_vmmc1_supply.dev = mmc[0].dev; | 302 | overo_vmmc1_supply.dev = mmc[0].dev; |
303 | 303 | ||
@@ -413,6 +413,12 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
413 | #define board_mux NULL | 413 | #define board_mux NULL |
414 | #endif | 414 | #endif |
415 | 415 | ||
416 | static struct omap_musb_board_data musb_board_data = { | ||
417 | .interface_type = MUSB_INTERFACE_ULPI, | ||
418 | .mode = MUSB_OTG, | ||
419 | .power = 100, | ||
420 | }; | ||
421 | |||
416 | static void __init overo_init(void) | 422 | static void __init overo_init(void) |
417 | { | 423 | { |
418 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 424 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
@@ -420,7 +426,7 @@ static void __init overo_init(void) | |||
420 | platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); | 426 | platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); |
421 | omap_serial_init(); | 427 | omap_serial_init(); |
422 | overo_flash_init(); | 428 | overo_flash_init(); |
423 | usb_musb_init(); | 429 | usb_musb_init(&musb_board_data); |
424 | usb_ehci_init(&ehci_pdata); | 430 | usb_ehci_init(&ehci_pdata); |
425 | overo_ads7846_init(); | 431 | overo_ads7846_init(); |
426 | overo_init_smsc911x(); | 432 | overo_init_smsc911x(); |
@@ -469,7 +475,7 @@ static void __init overo_init(void) | |||
469 | static void __init overo_map_io(void) | 475 | static void __init overo_map_io(void) |
470 | { | 476 | { |
471 | omap2_set_globals_343x(); | 477 | omap2_set_globals_343x(); |
472 | omap2_map_common_io(); | 478 | omap34xx_map_common_io(); |
473 | } | 479 | } |
474 | 480 | ||
475 | MACHINE_START(OVERO, "Gumstix Overo") | 481 | MACHINE_START(OVERO, "Gumstix Overo") |
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index acafdbc8aa16..4377a4cf36eb 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <plat/gpmc-smc91x.h> | 34 | #include <plat/gpmc-smc91x.h> |
35 | 35 | ||
36 | #include "mux.h" | 36 | #include "mux.h" |
37 | #include "mmc-twl4030.h" | 37 | #include "hsmmc.h" |
38 | 38 | ||
39 | #define SYSTEM_REV_B_USES_VAUX3 0x1699 | 39 | #define SYSTEM_REV_B_USES_VAUX3 0x1699 |
40 | #define SYSTEM_REV_S_USES_VAUX3 0x8 | 40 | #define SYSTEM_REV_S_USES_VAUX3 0x8 |
@@ -209,7 +209,47 @@ static struct twl4030_madc_platform_data rx51_madc_data = { | |||
209 | .irq_line = 1, | 209 | .irq_line = 1, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static struct twl4030_hsmmc_info mmc[] = { | 212 | /* Enable input logic and pull all lines up when eMMC is on. */ |
213 | static struct omap_board_mux rx51_mmc2_on_mux[] = { | ||
214 | OMAP3_MUX(SDMMC2_CMD, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
215 | OMAP3_MUX(SDMMC2_DAT0, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
216 | OMAP3_MUX(SDMMC2_DAT1, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
217 | OMAP3_MUX(SDMMC2_DAT2, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
218 | OMAP3_MUX(SDMMC2_DAT3, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
219 | OMAP3_MUX(SDMMC2_DAT4, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
220 | OMAP3_MUX(SDMMC2_DAT5, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
221 | OMAP3_MUX(SDMMC2_DAT6, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
222 | OMAP3_MUX(SDMMC2_DAT7, OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0), | ||
223 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
224 | }; | ||
225 | |||
226 | /* Disable input logic and pull all lines down when eMMC is off. */ | ||
227 | static struct omap_board_mux rx51_mmc2_off_mux[] = { | ||
228 | OMAP3_MUX(SDMMC2_CMD, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
229 | OMAP3_MUX(SDMMC2_DAT0, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
230 | OMAP3_MUX(SDMMC2_DAT1, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
231 | OMAP3_MUX(SDMMC2_DAT2, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
232 | OMAP3_MUX(SDMMC2_DAT3, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
233 | OMAP3_MUX(SDMMC2_DAT4, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
234 | OMAP3_MUX(SDMMC2_DAT5, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
235 | OMAP3_MUX(SDMMC2_DAT6, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
236 | OMAP3_MUX(SDMMC2_DAT7, OMAP_PULL_ENA | OMAP_MUX_MODE0), | ||
237 | { .reg_offset = OMAP_MUX_TERMINATOR }, | ||
238 | }; | ||
239 | |||
240 | /* | ||
241 | * Current flows to eMMC when eMMC is off and the data lines are pulled up, | ||
242 | * so pull them down. N.B. we pull 8 lines because we are using 8 lines. | ||
243 | */ | ||
244 | static void rx51_mmc2_remux(struct device *dev, int slot, int power_on) | ||
245 | { | ||
246 | if (power_on) | ||
247 | omap_mux_write_array(rx51_mmc2_on_mux); | ||
248 | else | ||
249 | omap_mux_write_array(rx51_mmc2_off_mux); | ||
250 | } | ||
251 | |||
252 | static struct omap2_hsmmc_info mmc[] __initdata = { | ||
213 | { | 253 | { |
214 | .name = "external", | 254 | .name = "external", |
215 | .mmc = 1, | 255 | .mmc = 1, |
@@ -222,25 +262,29 @@ static struct twl4030_hsmmc_info mmc[] = { | |||
222 | { | 262 | { |
223 | .name = "internal", | 263 | .name = "internal", |
224 | .mmc = 2, | 264 | .mmc = 2, |
225 | .wires = 8, | 265 | .wires = 8, /* See also rx51_mmc2_remux */ |
226 | .gpio_cd = -EINVAL, | 266 | .gpio_cd = -EINVAL, |
227 | .gpio_wp = -EINVAL, | 267 | .gpio_wp = -EINVAL, |
228 | .nonremovable = true, | 268 | .nonremovable = true, |
229 | .power_saving = true, | 269 | .power_saving = true, |
270 | .remux = rx51_mmc2_remux, | ||
230 | }, | 271 | }, |
231 | {} /* Terminator */ | 272 | {} /* Terminator */ |
232 | }; | 273 | }; |
233 | 274 | ||
234 | static struct regulator_consumer_supply rx51_vmmc1_supply = { | 275 | static struct regulator_consumer_supply rx51_vmmc1_supply = { |
235 | .supply = "vmmc", | 276 | .supply = "vmmc", |
277 | .dev_name = "mmci-omap-hs.0", | ||
236 | }; | 278 | }; |
237 | 279 | ||
238 | static struct regulator_consumer_supply rx51_vmmc2_supply = { | 280 | static struct regulator_consumer_supply rx51_vmmc2_supply = { |
239 | .supply = "vmmc", | 281 | .supply = "vmmc", |
282 | .dev_name = "mmci-omap-hs.1", | ||
240 | }; | 283 | }; |
241 | 284 | ||
242 | static struct regulator_consumer_supply rx51_vsim_supply = { | 285 | static struct regulator_consumer_supply rx51_vsim_supply = { |
243 | .supply = "vmmc_aux", | 286 | .supply = "vmmc_aux", |
287 | .dev_name = "mmci-omap-hs.1", | ||
244 | }; | 288 | }; |
245 | 289 | ||
246 | static struct regulator_init_data rx51_vaux1 = { | 290 | static struct regulator_init_data rx51_vaux1 = { |
@@ -375,12 +419,6 @@ static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) | |||
375 | gpio_request(gpio + 7, "speaker_en"); | 419 | gpio_request(gpio + 7, "speaker_en"); |
376 | gpio_direction_output(gpio + 7, 1); | 420 | gpio_direction_output(gpio + 7, 1); |
377 | 421 | ||
378 | /* set up MMC adapters, linking their regulators to them */ | ||
379 | twl4030_mmc_init(mmc); | ||
380 | rx51_vmmc1_supply.dev = mmc[0].dev; | ||
381 | rx51_vmmc2_supply.dev = mmc[1].dev; | ||
382 | rx51_vsim_supply.dev = mmc[1].dev; | ||
383 | |||
384 | return 0; | 422 | return 0; |
385 | } | 423 | } |
386 | 424 | ||
@@ -751,5 +789,6 @@ void __init rx51_peripherals_init(void) | |||
751 | rx51_init_wl1251(); | 789 | rx51_init_wl1251(); |
752 | spi_register_board_info(rx51_peripherals_spi_board_info, | 790 | spi_register_board_info(rx51_peripherals_spi_board_info, |
753 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); | 791 | ARRAY_SIZE(rx51_peripherals_spi_board_info)); |
792 | omap2_hsmmc_init(mmc); | ||
754 | } | 793 | } |
755 | 794 | ||
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 67bb3476b707..b155c366c650 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/clk.h> | 16 | #include <linux/clk.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/leds.h> | ||
19 | 20 | ||
20 | #include <mach/hardware.h> | 21 | #include <mach/hardware.h> |
21 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
@@ -30,9 +31,49 @@ | |||
30 | #include <plat/usb.h> | 31 | #include <plat/usb.h> |
31 | 32 | ||
32 | #include "mux.h" | 33 | #include "mux.h" |
34 | #include "pm.h" | ||
35 | |||
36 | #define RX51_GPIO_SLEEP_IND 162 | ||
33 | 37 | ||
34 | struct omap_sdrc_params *rx51_get_sdram_timings(void); | 38 | struct omap_sdrc_params *rx51_get_sdram_timings(void); |
35 | 39 | ||
40 | static struct gpio_led gpio_leds[] = { | ||
41 | { | ||
42 | .name = "sleep_ind", | ||
43 | .gpio = RX51_GPIO_SLEEP_IND, | ||
44 | }, | ||
45 | }; | ||
46 | |||
47 | static struct gpio_led_platform_data gpio_led_info = { | ||
48 | .leds = gpio_leds, | ||
49 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
50 | }; | ||
51 | |||
52 | static struct platform_device leds_gpio = { | ||
53 | .name = "leds-gpio", | ||
54 | .id = -1, | ||
55 | .dev = { | ||
56 | .platform_data = &gpio_led_info, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static struct cpuidle_params rx51_cpuidle_params[] = { | ||
61 | /* C1 */ | ||
62 | {1, 110, 162, 5}, | ||
63 | /* C2 */ | ||
64 | {1, 106, 180, 309}, | ||
65 | /* C3 */ | ||
66 | {0, 107, 410, 46057}, | ||
67 | /* C4 */ | ||
68 | {0, 121, 3374, 46057}, | ||
69 | /* C5 */ | ||
70 | {1, 855, 1146, 46057}, | ||
71 | /* C6 */ | ||
72 | {0, 7580, 4134, 484329}, | ||
73 | /* C7 */ | ||
74 | {1, 7505, 15274, 484329}, | ||
75 | }; | ||
76 | |||
36 | static struct omap_lcd_config rx51_lcd_config = { | 77 | static struct omap_lcd_config rx51_lcd_config = { |
37 | .ctrl_name = "internal", | 78 | .ctrl_name = "internal", |
38 | }; | 79 | }; |
@@ -62,6 +103,7 @@ static void __init rx51_init_irq(void) | |||
62 | 103 | ||
63 | omap_board_config = rx51_config; | 104 | omap_board_config = rx51_config; |
64 | omap_board_config_size = ARRAY_SIZE(rx51_config); | 105 | omap_board_config_size = ARRAY_SIZE(rx51_config); |
106 | omap3_pm_init_cpuidle(rx51_cpuidle_params); | ||
65 | sdrc_params = rx51_get_sdram_timings(); | 107 | sdrc_params = rx51_get_sdram_timings(); |
66 | omap2_init_common_hw(sdrc_params, sdrc_params); | 108 | omap2_init_common_hw(sdrc_params, sdrc_params); |
67 | omap_init_irq(); | 109 | omap_init_irq(); |
@@ -78,22 +120,30 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
78 | #define board_mux NULL | 120 | #define board_mux NULL |
79 | #endif | 121 | #endif |
80 | 122 | ||
123 | static struct omap_musb_board_data musb_board_data = { | ||
124 | .interface_type = MUSB_INTERFACE_ULPI, | ||
125 | .mode = MUSB_PERIPHERAL, | ||
126 | .power = 0, | ||
127 | }; | ||
128 | |||
81 | static void __init rx51_init(void) | 129 | static void __init rx51_init(void) |
82 | { | 130 | { |
83 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 131 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
84 | omap_serial_init(); | 132 | omap_serial_init(); |
85 | usb_musb_init(); | 133 | usb_musb_init(&musb_board_data); |
86 | rx51_peripherals_init(); | 134 | rx51_peripherals_init(); |
87 | 135 | ||
88 | /* Ensure SDRC pins are mux'd for self-refresh */ | 136 | /* Ensure SDRC pins are mux'd for self-refresh */ |
89 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 137 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
90 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 138 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
139 | |||
140 | platform_device_register(&leds_gpio); | ||
91 | } | 141 | } |
92 | 142 | ||
93 | static void __init rx51_map_io(void) | 143 | static void __init rx51_map_io(void) |
94 | { | 144 | { |
95 | omap2_set_globals_343x(); | 145 | omap2_set_globals_343x(); |
96 | omap2_map_common_io(); | 146 | omap34xx_map_common_io(); |
97 | } | 147 | } |
98 | 148 | ||
99 | MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") | 149 | MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") |
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c b/arch/arm/mach-omap2/board-sdp-flash.c new file mode 100644 index 000000000000..b1b88deec7f2 --- /dev/null +++ b/arch/arm/mach-omap2/board-sdp-flash.c | |||
@@ -0,0 +1,272 @@ | |||
1 | /* | ||
2 | * board-sdp-flash.c | ||
3 | * Modified from mach-omap2/board-3430sdp-flash.c | ||
4 | * | ||
5 | * Copyright (C) 2009 Nokia Corporation | ||
6 | * Copyright (C) 2009 Texas Instruments | ||
7 | * | ||
8 | * Vimal Singh <vimalsingh@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/kernel.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/mtd/physmap.h> | ||
18 | #include <linux/io.h> | ||
19 | |||
20 | #include <plat/gpmc.h> | ||
21 | #include <plat/nand.h> | ||
22 | #include <plat/onenand.h> | ||
23 | #include <plat/tc.h> | ||
24 | #include <mach/board-sdp.h> | ||
25 | |||
26 | #define REG_FPGA_REV 0x10 | ||
27 | #define REG_FPGA_DIP_SWITCH_INPUT2 0x60 | ||
28 | #define MAX_SUPPORTED_GPMC_CONFIG 3 | ||
29 | |||
30 | #define DEBUG_BASE 0x08000000 /* debug board */ | ||
31 | |||
32 | #define PDC_NOR 1 | ||
33 | #define PDC_NAND 2 | ||
34 | #define PDC_ONENAND 3 | ||
35 | #define DBG_MPDB 4 | ||
36 | |||
37 | /* various memory sizes */ | ||
38 | #define FLASH_SIZE_SDPV1 SZ_64M /* NOR flash (64 Meg aligned) */ | ||
39 | #define FLASH_SIZE_SDPV2 SZ_128M /* NOR flash (256 Meg aligned) */ | ||
40 | |||
41 | /* | ||
42 | * SDP3430 V2 Board CS organization | ||
43 | * Different from SDP3430 V1. Now 4 switches used to specify CS | ||
44 | * | ||
45 | * See also the Switch S8 settings in the comments. | ||
46 | * | ||
47 | * REVISIT: Add support for 2430 SDP | ||
48 | */ | ||
49 | static const unsigned char chip_sel_sdp[][GPMC_CS_NUM] = { | ||
50 | {PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */ | ||
51 | {PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */ | ||
52 | {PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */ | ||
53 | }; | ||
54 | |||
55 | static struct physmap_flash_data sdp_nor_data = { | ||
56 | .width = 2, | ||
57 | }; | ||
58 | |||
59 | static struct resource sdp_nor_resource = { | ||
60 | .flags = IORESOURCE_MEM, | ||
61 | }; | ||
62 | |||
63 | static struct platform_device sdp_nor_device = { | ||
64 | .name = "physmap-flash", | ||
65 | .id = 0, | ||
66 | .dev = { | ||
67 | .platform_data = &sdp_nor_data, | ||
68 | }, | ||
69 | .num_resources = 1, | ||
70 | .resource = &sdp_nor_resource, | ||
71 | }; | ||
72 | |||
73 | static void | ||
74 | __init board_nor_init(struct flash_partitions sdp_nor_parts, u8 cs) | ||
75 | { | ||
76 | int err; | ||
77 | |||
78 | sdp_nor_data.parts = sdp_nor_parts.parts; | ||
79 | sdp_nor_data.nr_parts = sdp_nor_parts.nr_parts; | ||
80 | |||
81 | /* Configure start address and size of NOR device */ | ||
82 | if (omap_rev() >= OMAP3430_REV_ES1_0) { | ||
83 | err = gpmc_cs_request(cs, FLASH_SIZE_SDPV2 - 1, | ||
84 | (unsigned long *)&sdp_nor_resource.start); | ||
85 | sdp_nor_resource.end = sdp_nor_resource.start | ||
86 | + FLASH_SIZE_SDPV2 - 1; | ||
87 | } else { | ||
88 | err = gpmc_cs_request(cs, FLASH_SIZE_SDPV1 - 1, | ||
89 | (unsigned long *)&sdp_nor_resource.start); | ||
90 | sdp_nor_resource.end = sdp_nor_resource.start | ||
91 | + FLASH_SIZE_SDPV1 - 1; | ||
92 | } | ||
93 | if (err < 0) { | ||
94 | printk(KERN_ERR "NOR: Can't request GPMC CS\n"); | ||
95 | return; | ||
96 | } | ||
97 | if (platform_device_register(&sdp_nor_device) < 0) | ||
98 | printk(KERN_ERR "Unable to register NOR device\n"); | ||
99 | } | ||
100 | |||
101 | #if defined(CONFIG_MTD_ONENAND_OMAP2) || \ | ||
102 | defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) | ||
103 | static struct omap_onenand_platform_data board_onenand_data = { | ||
104 | .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ | ||
105 | }; | ||
106 | |||
107 | static void | ||
108 | __init board_onenand_init(struct flash_partitions sdp_onenand_parts, u8 cs) | ||
109 | { | ||
110 | board_onenand_data.cs = cs; | ||
111 | board_onenand_data.parts = sdp_onenand_parts.parts; | ||
112 | board_onenand_data.nr_parts = sdp_onenand_parts.nr_parts; | ||
113 | |||
114 | gpmc_onenand_init(&board_onenand_data); | ||
115 | } | ||
116 | #else | ||
117 | static void | ||
118 | __init board_onenand_init(struct flash_partitions sdp_onenand_parts, u8 cs) | ||
119 | { | ||
120 | } | ||
121 | #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ | ||
122 | |||
123 | #if defined(CONFIG_MTD_NAND_OMAP2) || \ | ||
124 | defined(CONFIG_MTD_NAND_OMAP2_MODULE) | ||
125 | |||
126 | /* Note that all values in this struct are in nanoseconds */ | ||
127 | static struct gpmc_timings nand_timings = { | ||
128 | |||
129 | .sync_clk = 0, | ||
130 | |||
131 | .cs_on = 0, | ||
132 | .cs_rd_off = 36, | ||
133 | .cs_wr_off = 36, | ||
134 | |||
135 | .adv_on = 6, | ||
136 | .adv_rd_off = 24, | ||
137 | .adv_wr_off = 36, | ||
138 | |||
139 | .we_off = 30, | ||
140 | .oe_off = 48, | ||
141 | |||
142 | .access = 54, | ||
143 | .rd_cycle = 72, | ||
144 | .wr_cycle = 72, | ||
145 | |||
146 | .wr_access = 30, | ||
147 | .wr_data_mux_bus = 0, | ||
148 | }; | ||
149 | |||
150 | static struct omap_nand_platform_data sdp_nand_data = { | ||
151 | .nand_setup = NULL, | ||
152 | .gpmc_t = &nand_timings, | ||
153 | .dma_channel = -1, /* disable DMA in OMAP NAND driver */ | ||
154 | .dev_ready = NULL, | ||
155 | .devsize = 0, /* '0' for 8-bit, '1' for 16-bit device */ | ||
156 | }; | ||
157 | |||
158 | static void | ||
159 | __init board_nand_init(struct flash_partitions sdp_nand_parts, u8 cs) | ||
160 | { | ||
161 | sdp_nand_data.cs = cs; | ||
162 | sdp_nand_data.parts = sdp_nand_parts.parts; | ||
163 | sdp_nand_data.nr_parts = sdp_nand_parts.nr_parts; | ||
164 | |||
165 | sdp_nand_data.gpmc_cs_baseaddr = (void *)(OMAP34XX_GPMC_VIRT + | ||
166 | GPMC_CS0_BASE + | ||
167 | cs * GPMC_CS_SIZE); | ||
168 | sdp_nand_data.gpmc_baseaddr = (void *) (OMAP34XX_GPMC_VIRT); | ||
169 | |||
170 | gpmc_nand_init(&sdp_nand_data); | ||
171 | } | ||
172 | #else | ||
173 | static void | ||
174 | __init board_nand_init(struct flash_partitions sdp_nand_parts, u8 cs) | ||
175 | { | ||
176 | } | ||
177 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ | ||
178 | |||
179 | /** | ||
180 | * get_gpmc0_type - Reads the FPGA DIP_SWITCH_INPUT_REGISTER2 to get | ||
181 | * the various cs values. | ||
182 | */ | ||
183 | static u8 get_gpmc0_type(void) | ||
184 | { | ||
185 | u8 cs = 0; | ||
186 | void __iomem *fpga_map_addr; | ||
187 | |||
188 | fpga_map_addr = ioremap(DEBUG_BASE, 4096); | ||
189 | if (!fpga_map_addr) | ||
190 | return -ENOMEM; | ||
191 | |||
192 | if (!(__raw_readw(fpga_map_addr + REG_FPGA_REV))) | ||
193 | /* we dont have an DEBUG FPGA??? */ | ||
194 | /* Depend on #defines!! default to strata boot return param */ | ||
195 | goto unmap; | ||
196 | |||
197 | /* S8-DIP-OFF = 1, S8-DIP-ON = 0 */ | ||
198 | cs = __raw_readw(fpga_map_addr + REG_FPGA_DIP_SWITCH_INPUT2) & 0xf; | ||
199 | |||
200 | /* ES2.0 SDP's onwards 4 dip switches are provided for CS */ | ||
201 | if (omap_rev() >= OMAP3430_REV_ES1_0) | ||
202 | /* change (S8-1:4=DS-2:0) to (S8-4:1=DS-2:0) */ | ||
203 | cs = ((cs & 8) >> 3) | ((cs & 4) >> 1) | | ||
204 | ((cs & 2) << 1) | ((cs & 1) << 3); | ||
205 | else | ||
206 | /* change (S8-1:3=DS-2:0) to (S8-3:1=DS-2:0) */ | ||
207 | cs = ((cs & 4) >> 2) | (cs & 2) | ((cs & 1) << 2); | ||
208 | unmap: | ||
209 | iounmap(fpga_map_addr); | ||
210 | return cs; | ||
211 | } | ||
212 | |||
213 | /** | ||
214 | * sdp3430_flash_init - Identify devices connected to GPMC and register. | ||
215 | * | ||
216 | * @return - void. | ||
217 | */ | ||
218 | void __init sdp_flash_init(struct flash_partitions sdp_partition_info[]) | ||
219 | { | ||
220 | u8 cs = 0; | ||
221 | u8 norcs = GPMC_CS_NUM + 1; | ||
222 | u8 nandcs = GPMC_CS_NUM + 1; | ||
223 | u8 onenandcs = GPMC_CS_NUM + 1; | ||
224 | u8 idx; | ||
225 | unsigned char *config_sel = NULL; | ||
226 | |||
227 | /* REVISIT: Is this return correct idx for 2430 SDP? | ||
228 | * for which cs configuration matches for 2430 SDP? | ||
229 | */ | ||
230 | idx = get_gpmc0_type(); | ||
231 | if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { | ||
232 | printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); | ||
233 | return; | ||
234 | } | ||
235 | config_sel = (unsigned char *)(chip_sel_sdp[idx]); | ||
236 | |||
237 | while (cs < GPMC_CS_NUM) { | ||
238 | switch (config_sel[cs]) { | ||
239 | case PDC_NOR: | ||
240 | if (norcs > GPMC_CS_NUM) | ||
241 | norcs = cs; | ||
242 | break; | ||
243 | case PDC_NAND: | ||
244 | if (nandcs > GPMC_CS_NUM) | ||
245 | nandcs = cs; | ||
246 | break; | ||
247 | case PDC_ONENAND: | ||
248 | if (onenandcs > GPMC_CS_NUM) | ||
249 | onenandcs = cs; | ||
250 | break; | ||
251 | }; | ||
252 | cs++; | ||
253 | } | ||
254 | |||
255 | if (norcs > GPMC_CS_NUM) | ||
256 | printk(KERN_INFO "OneNAND: Unable to find configuration " | ||
257 | " in GPMC\n "); | ||
258 | else | ||
259 | board_nor_init(sdp_partition_info[0], norcs); | ||
260 | |||
261 | if (onenandcs > GPMC_CS_NUM) | ||
262 | printk(KERN_INFO "OneNAND: Unable to find configuration " | ||
263 | " in GPMC\n "); | ||
264 | else | ||
265 | board_onenand_init(sdp_partition_info[1], onenandcs); | ||
266 | |||
267 | if (nandcs > GPMC_CS_NUM) | ||
268 | printk(KERN_INFO "NAND: Unable to find configuration " | ||
269 | " in GPMC\n "); | ||
270 | else | ||
271 | board_nand_init(sdp_partition_info[2], nandcs); | ||
272 | } | ||
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 8dd277c36661..ca95d8d64136 100755 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -24,7 +24,8 @@ | |||
24 | #include <plat/common.h> | 24 | #include <plat/common.h> |
25 | #include <plat/usb.h> | 25 | #include <plat/usb.h> |
26 | 26 | ||
27 | #include "mmc-twl4030.h" | 27 | #include "mux.h" |
28 | #include "hsmmc.h" | ||
28 | 29 | ||
29 | /* Zoom2 has Qwerty keyboard*/ | 30 | /* Zoom2 has Qwerty keyboard*/ |
30 | static int board_keymap[] = { | 31 | static int board_keymap[] = { |
@@ -63,21 +64,21 @@ static int board_keymap[] = { | |||
63 | KEY(5, 1, KEY_H), | 64 | KEY(5, 1, KEY_H), |
64 | KEY(5, 2, KEY_J), | 65 | KEY(5, 2, KEY_J), |
65 | KEY(5, 3, KEY_F3), | 66 | KEY(5, 3, KEY_F3), |
67 | KEY(5, 4, KEY_UNKNOWN), | ||
66 | KEY(5, 5, KEY_VOLUMEDOWN), | 68 | KEY(5, 5, KEY_VOLUMEDOWN), |
67 | KEY(5, 6, KEY_M), | 69 | KEY(5, 6, KEY_M), |
68 | KEY(5, 7, KEY_ENTER), | 70 | KEY(5, 7, KEY_RIGHT), |
69 | KEY(6, 0, KEY_Q), | 71 | KEY(6, 0, KEY_Q), |
70 | KEY(6, 1, KEY_A), | 72 | KEY(6, 1, KEY_A), |
71 | KEY(6, 2, KEY_N), | 73 | KEY(6, 2, KEY_N), |
72 | KEY(6, 3, KEY_BACKSPACE), | 74 | KEY(6, 3, KEY_BACKSPACE), |
73 | KEY(6, 6, KEY_P), | 75 | KEY(6, 6, KEY_P), |
74 | KEY(6, 7, KEY_SELECT), | 76 | KEY(6, 7, KEY_UP), |
75 | KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ | 77 | KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ |
76 | KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ | 78 | KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ |
77 | KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ | 79 | KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ |
78 | KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ | 80 | KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ |
79 | KEY(7, 5, KEY_RIGHT), | 81 | KEY(7, 6, KEY_SELECT), |
80 | KEY(7, 6, KEY_UP), | ||
81 | KEY(7, 7, KEY_DOWN) | 82 | KEY(7, 7, KEY_DOWN) |
82 | }; | 83 | }; |
83 | 84 | ||
@@ -150,7 +151,7 @@ static struct regulator_init_data zoom_vsim = { | |||
150 | .consumer_supplies = &zoom_vsim_supply, | 151 | .consumer_supplies = &zoom_vsim_supply, |
151 | }; | 152 | }; |
152 | 153 | ||
153 | static struct twl4030_hsmmc_info mmc[] __initdata = { | 154 | static struct omap2_hsmmc_info mmc[] __initdata = { |
154 | { | 155 | { |
155 | .name = "external", | 156 | .name = "external", |
156 | .mmc = 1, | 157 | .mmc = 1, |
@@ -175,7 +176,7 @@ static int zoom_twl_gpio_setup(struct device *dev, | |||
175 | { | 176 | { |
176 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ | 177 | /* gpio + 0 is "mmc0_cd" (input/IRQ) */ |
177 | mmc[0].gpio_cd = gpio + 0; | 178 | mmc[0].gpio_cd = gpio + 0; |
178 | twl4030_mmc_init(mmc); | 179 | omap2_hsmmc_init(mmc); |
179 | 180 | ||
180 | /* link regulators to MMC adapters ... we "know" the | 181 | /* link regulators to MMC adapters ... we "know" the |
181 | * regulators will be set up only *after* we return. | 182 | * regulators will be set up only *after* we return. |
@@ -263,9 +264,23 @@ static int __init omap_i2c_init(void) | |||
263 | return 0; | 264 | return 0; |
264 | } | 265 | } |
265 | 266 | ||
267 | static struct omap_musb_board_data musb_board_data = { | ||
268 | .interface_type = MUSB_INTERFACE_ULPI, | ||
269 | .mode = MUSB_OTG, | ||
270 | .power = 100, | ||
271 | }; | ||
272 | |||
273 | static void enable_board_wakeup_source(void) | ||
274 | { | ||
275 | /* T2 interrupt line (keypad) */ | ||
276 | omap_mux_init_signal("sys_nirq", | ||
277 | OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP); | ||
278 | } | ||
279 | |||
266 | void __init zoom_peripherals_init(void) | 280 | void __init zoom_peripherals_init(void) |
267 | { | 281 | { |
268 | omap_i2c_init(); | 282 | omap_i2c_init(); |
269 | omap_serial_init(); | 283 | omap_serial_init(); |
270 | usb_musb_init(); | 284 | usb_musb_init(&musb_board_data); |
285 | enable_board_wakeup_source(); | ||
271 | } | 286 | } |
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c index bb87cf7878ff..9a26f84b1141 100644 --- a/arch/arm/mach-omap2/board-zoom2.c +++ b/arch/arm/mach-omap2/board-zoom2.c | |||
@@ -87,7 +87,7 @@ static void __init omap_zoom2_init(void) | |||
87 | static void __init omap_zoom2_map_io(void) | 87 | static void __init omap_zoom2_map_io(void) |
88 | { | 88 | { |
89 | omap2_set_globals_343x(); | 89 | omap2_set_globals_343x(); |
90 | omap2_map_common_io(); | 90 | omap34xx_map_common_io(); |
91 | } | 91 | } |
92 | 92 | ||
93 | MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") | 93 | MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") |
diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c index a9fe9181b010..d3e3cd5170d1 100644 --- a/arch/arm/mach-omap2/board-zoom3.c +++ b/arch/arm/mach-omap2/board-zoom3.c | |||
@@ -20,14 +20,15 @@ | |||
20 | 20 | ||
21 | #include <plat/common.h> | 21 | #include <plat/common.h> |
22 | #include <plat/board.h> | 22 | #include <plat/board.h> |
23 | #include <plat/usb.h> | ||
23 | 24 | ||
24 | #include "mux.h" | 25 | #include "mux.h" |
25 | #include "sdram-hynix-h8mbx00u0mer-0em.h" | 26 | #include "sdram-hynix-h8mbx00u0mer-0em.h" |
26 | 27 | ||
27 | static void __init omap_zoom_map_io(void) | 28 | static void __init omap_zoom_map_io(void) |
28 | { | 29 | { |
29 | omap2_set_globals_343x(); | 30 | omap2_set_globals_36xx(); |
30 | omap2_map_common_io(); | 31 | omap34xx_map_common_io(); |
31 | } | 32 | } |
32 | 33 | ||
33 | static struct omap_board_config_kernel zoom_config[] __initdata = { | 34 | static struct omap_board_config_kernel zoom_config[] __initdata = { |
@@ -51,11 +52,24 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
51 | #define board_mux NULL | 52 | #define board_mux NULL |
52 | #endif | 53 | #endif |
53 | 54 | ||
55 | static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { | ||
56 | .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
57 | .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, | ||
58 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
59 | .phy_reset = true, | ||
60 | .reset_gpio_port[0] = -EINVAL, | ||
61 | .reset_gpio_port[1] = 64, | ||
62 | .reset_gpio_port[2] = -EINVAL, | ||
63 | }; | ||
64 | |||
54 | static void __init omap_zoom_init(void) | 65 | static void __init omap_zoom_init(void) |
55 | { | 66 | { |
56 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); | 67 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); |
57 | zoom_peripherals_init(); | 68 | zoom_peripherals_init(); |
58 | zoom_debugboard_init(); | 69 | zoom_debugboard_init(); |
70 | |||
71 | omap_mux_init_gpio(64, OMAP_PIN_OUTPUT); | ||
72 | usb_ehci_init(&ehci_pdata); | ||
59 | } | 73 | } |
60 | 74 | ||
61 | MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") | 75 | MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") |
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c new file mode 100644 index 000000000000..43d7246ce335 --- /dev/null +++ b/arch/arm/mach-omap2/clkt2xxx_apll.c | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * OMAP2xxx APLL clock control functions | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, | ||
12 | * Gordon McNutt and RidgeRun, Inc. | ||
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 | #undef DEBUG | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <plat/clock.h> | ||
25 | #include <plat/prcm.h> | ||
26 | |||
27 | #include "clock.h" | ||
28 | #include "clock2xxx.h" | ||
29 | #include "cm.h" | ||
30 | #include "cm-regbits-24xx.h" | ||
31 | |||
32 | /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ | ||
33 | #define EN_APLL_STOPPED 0 | ||
34 | #define EN_APLL_LOCKED 3 | ||
35 | |||
36 | /* CM_CLKSEL1_PLL.APLLS_CLKIN options (24XX) */ | ||
37 | #define APLLS_CLKIN_19_2MHZ 0 | ||
38 | #define APLLS_CLKIN_13MHZ 2 | ||
39 | #define APLLS_CLKIN_12MHZ 3 | ||
40 | |||
41 | void __iomem *cm_idlest_pll; | ||
42 | |||
43 | /* Private functions */ | ||
44 | |||
45 | /* Enable an APLL if off */ | ||
46 | static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) | ||
47 | { | ||
48 | u32 cval, apll_mask; | ||
49 | |||
50 | apll_mask = EN_APLL_LOCKED << clk->enable_bit; | ||
51 | |||
52 | cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); | ||
53 | |||
54 | if ((cval & apll_mask) == apll_mask) | ||
55 | return 0; /* apll already enabled */ | ||
56 | |||
57 | cval &= ~apll_mask; | ||
58 | cval |= apll_mask; | ||
59 | cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); | ||
60 | |||
61 | omap2_cm_wait_idlest(cm_idlest_pll, status_mask, | ||
62 | OMAP24XX_CM_IDLEST_VAL, clk->name); | ||
63 | |||
64 | /* | ||
65 | * REVISIT: Should we return an error code if omap2_wait_clock_ready() | ||
66 | * fails? | ||
67 | */ | ||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int omap2_clk_apll96_enable(struct clk *clk) | ||
72 | { | ||
73 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_96M_APLL); | ||
74 | } | ||
75 | |||
76 | static int omap2_clk_apll54_enable(struct clk *clk) | ||
77 | { | ||
78 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL); | ||
79 | } | ||
80 | |||
81 | /* Stop APLL */ | ||
82 | static void omap2_clk_apll_disable(struct clk *clk) | ||
83 | { | ||
84 | u32 cval; | ||
85 | |||
86 | cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); | ||
87 | cval &= ~(EN_APLL_LOCKED << clk->enable_bit); | ||
88 | cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); | ||
89 | } | ||
90 | |||
91 | /* Public data */ | ||
92 | |||
93 | const struct clkops clkops_apll96 = { | ||
94 | .enable = omap2_clk_apll96_enable, | ||
95 | .disable = omap2_clk_apll_disable, | ||
96 | }; | ||
97 | |||
98 | const struct clkops clkops_apll54 = { | ||
99 | .enable = omap2_clk_apll54_enable, | ||
100 | .disable = omap2_clk_apll_disable, | ||
101 | }; | ||
102 | |||
103 | /* Public functions */ | ||
104 | |||
105 | u32 omap2xxx_get_apll_clkin(void) | ||
106 | { | ||
107 | u32 aplls, srate = 0; | ||
108 | |||
109 | aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); | ||
110 | aplls &= OMAP24XX_APLLS_CLKIN_MASK; | ||
111 | aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; | ||
112 | |||
113 | if (aplls == APLLS_CLKIN_19_2MHZ) | ||
114 | srate = 19200000; | ||
115 | else if (aplls == APLLS_CLKIN_13MHZ) | ||
116 | srate = 13000000; | ||
117 | else if (aplls == APLLS_CLKIN_12MHZ) | ||
118 | srate = 12000000; | ||
119 | |||
120 | return srate; | ||
121 | } | ||
122 | |||
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpllcore.c b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c new file mode 100644 index 000000000000..019048434f13 --- /dev/null +++ b/arch/arm/mach-omap2/clkt2xxx_dpllcore.c | |||
@@ -0,0 +1,173 @@ | |||
1 | /* | ||
2 | * DPLL + CORE_CLK composite clock functions | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, | ||
12 | * Gordon McNutt and RidgeRun, Inc. | ||
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 | * XXX The DPLL and CORE clocks should be split into two separate clock | ||
19 | * types. | ||
20 | */ | ||
21 | #undef DEBUG | ||
22 | |||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/errno.h> | ||
25 | #include <linux/clk.h> | ||
26 | #include <linux/io.h> | ||
27 | |||
28 | #include <plat/clock.h> | ||
29 | #include <plat/sram.h> | ||
30 | #include <plat/sdrc.h> | ||
31 | |||
32 | #include "clock.h" | ||
33 | #include "clock2xxx.h" | ||
34 | #include "opp2xxx.h" | ||
35 | #include "cm.h" | ||
36 | #include "cm-regbits-24xx.h" | ||
37 | |||
38 | /* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ | ||
39 | |||
40 | /** | ||
41 | * omap2xxx_clk_get_core_rate - return the CORE_CLK rate | ||
42 | * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck") | ||
43 | * | ||
44 | * Returns the CORE_CLK rate. CORE_CLK can have one of three rate | ||
45 | * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz | ||
46 | * (the latter is unusual). This currently should be called with | ||
47 | * struct clk *dpll_ck, which is a composite clock of dpll_ck and | ||
48 | * core_ck. | ||
49 | */ | ||
50 | unsigned long omap2xxx_clk_get_core_rate(struct clk *clk) | ||
51 | { | ||
52 | long long core_clk; | ||
53 | u32 v; | ||
54 | |||
55 | core_clk = omap2_get_dpll_rate(clk); | ||
56 | |||
57 | v = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
58 | v &= OMAP24XX_CORE_CLK_SRC_MASK; | ||
59 | |||
60 | if (v == CORE_CLK_SRC_32K) | ||
61 | core_clk = 32768; | ||
62 | else | ||
63 | core_clk *= v; | ||
64 | |||
65 | return core_clk; | ||
66 | } | ||
67 | |||
68 | /* | ||
69 | * Uses the current prcm set to tell if a rate is valid. | ||
70 | * You can go slower, but not faster within a given rate set. | ||
71 | */ | ||
72 | static long omap2_dpllcore_round_rate(unsigned long target_rate) | ||
73 | { | ||
74 | u32 high, low, core_clk_src; | ||
75 | |||
76 | core_clk_src = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
77 | core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK; | ||
78 | |||
79 | if (core_clk_src == CORE_CLK_SRC_DPLL) { /* DPLL clockout */ | ||
80 | high = curr_prcm_set->dpll_speed * 2; | ||
81 | low = curr_prcm_set->dpll_speed; | ||
82 | } else { /* DPLL clockout x 2 */ | ||
83 | high = curr_prcm_set->dpll_speed; | ||
84 | low = curr_prcm_set->dpll_speed / 2; | ||
85 | } | ||
86 | |||
87 | #ifdef DOWN_VARIABLE_DPLL | ||
88 | if (target_rate > high) | ||
89 | return high; | ||
90 | else | ||
91 | return target_rate; | ||
92 | #else | ||
93 | if (target_rate > low) | ||
94 | return high; | ||
95 | else | ||
96 | return low; | ||
97 | #endif | ||
98 | |||
99 | } | ||
100 | |||
101 | unsigned long omap2_dpllcore_recalc(struct clk *clk) | ||
102 | { | ||
103 | return omap2xxx_clk_get_core_rate(clk); | ||
104 | } | ||
105 | |||
106 | int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | ||
107 | { | ||
108 | u32 cur_rate, low, mult, div, valid_rate, done_rate; | ||
109 | u32 bypass = 0; | ||
110 | struct prcm_config tmpset; | ||
111 | const struct dpll_data *dd; | ||
112 | |||
113 | cur_rate = omap2xxx_clk_get_core_rate(dclk); | ||
114 | mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
115 | mult &= OMAP24XX_CORE_CLK_SRC_MASK; | ||
116 | |||
117 | if ((rate == (cur_rate / 2)) && (mult == 2)) { | ||
118 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1); | ||
119 | } else if ((rate == (cur_rate * 2)) && (mult == 1)) { | ||
120 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
121 | } else if (rate != cur_rate) { | ||
122 | valid_rate = omap2_dpllcore_round_rate(rate); | ||
123 | if (valid_rate != rate) | ||
124 | return -EINVAL; | ||
125 | |||
126 | if (mult == 1) | ||
127 | low = curr_prcm_set->dpll_speed; | ||
128 | else | ||
129 | low = curr_prcm_set->dpll_speed / 2; | ||
130 | |||
131 | dd = clk->dpll_data; | ||
132 | if (!dd) | ||
133 | return -EINVAL; | ||
134 | |||
135 | tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg); | ||
136 | tmpset.cm_clksel1_pll &= ~(dd->mult_mask | | ||
137 | dd->div1_mask); | ||
138 | div = ((curr_prcm_set->xtal_speed / 1000000) - 1); | ||
139 | tmpset.cm_clksel2_pll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
140 | tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK; | ||
141 | if (rate > low) { | ||
142 | tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2; | ||
143 | mult = ((rate / 2) / 1000000); | ||
144 | done_rate = CORE_CLK_SRC_DPLL_X2; | ||
145 | } else { | ||
146 | tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL; | ||
147 | mult = (rate / 1000000); | ||
148 | done_rate = CORE_CLK_SRC_DPLL; | ||
149 | } | ||
150 | tmpset.cm_clksel1_pll |= (div << __ffs(dd->mult_mask)); | ||
151 | tmpset.cm_clksel1_pll |= (mult << __ffs(dd->div1_mask)); | ||
152 | |||
153 | /* Worst case */ | ||
154 | tmpset.base_sdrc_rfr = SDRC_RFR_CTRL_BYPASS; | ||
155 | |||
156 | if (rate == curr_prcm_set->xtal_speed) /* If asking for 1-1 */ | ||
157 | bypass = 1; | ||
158 | |||
159 | /* For omap2xxx_sdrc_init_params() */ | ||
160 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
161 | |||
162 | /* Force dll lock mode */ | ||
163 | omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr, | ||
164 | bypass); | ||
165 | |||
166 | /* Errata: ret dll entry state */ | ||
167 | omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked()); | ||
168 | omap2xxx_sdrc_reprogram(done_rate, 0); | ||
169 | } | ||
170 | |||
171 | return 0; | ||
172 | } | ||
173 | |||
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c new file mode 100644 index 000000000000..2167be84a5bc --- /dev/null +++ b/arch/arm/mach-omap2/clkt2xxx_osc.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * OMAP2xxx osc_clk-specific clock code | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, | ||
12 | * Gordon McNutt and RidgeRun, Inc. | ||
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 | #undef DEBUG | ||
19 | |||
20 | #include <linux/module.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/errno.h> | ||
23 | #include <linux/clk.h> | ||
24 | #include <linux/io.h> | ||
25 | |||
26 | #include <plat/clock.h> | ||
27 | |||
28 | #include "clock.h" | ||
29 | #include "clock2xxx.h" | ||
30 | #include "prm.h" | ||
31 | #include "prm-regbits-24xx.h" | ||
32 | |||
33 | static int omap2_enable_osc_ck(struct clk *clk) | ||
34 | { | ||
35 | u32 pcc; | ||
36 | |||
37 | pcc = __raw_readl(prcm_clksrc_ctrl); | ||
38 | |||
39 | __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl); | ||
40 | |||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static void omap2_disable_osc_ck(struct clk *clk) | ||
45 | { | ||
46 | u32 pcc; | ||
47 | |||
48 | pcc = __raw_readl(prcm_clksrc_ctrl); | ||
49 | |||
50 | __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl); | ||
51 | } | ||
52 | |||
53 | const struct clkops clkops_oscck = { | ||
54 | .enable = omap2_enable_osc_ck, | ||
55 | .disable = omap2_disable_osc_ck, | ||
56 | }; | ||
57 | |||
58 | unsigned long omap2_osc_clk_recalc(struct clk *clk) | ||
59 | { | ||
60 | return omap2xxx_get_apll_clkin() * omap2xxx_get_sysclkdiv(); | ||
61 | } | ||
62 | |||
diff --git a/arch/arm/mach-omap2/clkt2xxx_sys.c b/arch/arm/mach-omap2/clkt2xxx_sys.c new file mode 100644 index 000000000000..822b5a79f457 --- /dev/null +++ b/arch/arm/mach-omap2/clkt2xxx_sys.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * OMAP2xxx sys_clk-specific clock code | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, | ||
12 | * Gordon McNutt and RidgeRun, Inc. | ||
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 | #undef DEBUG | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/errno.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | #include <plat/clock.h> | ||
26 | |||
27 | #include "clock.h" | ||
28 | #include "clock2xxx.h" | ||
29 | #include "prm.h" | ||
30 | #include "prm-regbits-24xx.h" | ||
31 | |||
32 | void __iomem *prcm_clksrc_ctrl; | ||
33 | |||
34 | u32 omap2xxx_get_sysclkdiv(void) | ||
35 | { | ||
36 | u32 div; | ||
37 | |||
38 | div = __raw_readl(prcm_clksrc_ctrl); | ||
39 | div &= OMAP_SYSCLKDIV_MASK; | ||
40 | div >>= OMAP_SYSCLKDIV_SHIFT; | ||
41 | |||
42 | return div; | ||
43 | } | ||
44 | |||
45 | unsigned long omap2xxx_sys_clk_recalc(struct clk *clk) | ||
46 | { | ||
47 | return clk->parent->rate / omap2xxx_get_sysclkdiv(); | ||
48 | } | ||
49 | |||
50 | |||
diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c new file mode 100644 index 000000000000..3b1eac4d5390 --- /dev/null +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c | |||
@@ -0,0 +1,254 @@ | |||
1 | /* | ||
2 | * OMAP2xxx DVFS virtual clock functions | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, | ||
12 | * Gordon McNutt and RidgeRun, Inc. | ||
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 | * XXX Some of this code should be replaceable by the upcoming OPP layer | ||
19 | * code. However, some notion of "rate set" is probably still necessary | ||
20 | * for OMAP2xxx at least. Rate sets should be generalized so they can be | ||
21 | * used for any OMAP chip, not just OMAP2xxx. In particular, Richard Woodruff | ||
22 | * has in the past expressed a preference to use rate sets for OPP changes, | ||
23 | * rather than dynamically recalculating the clock tree, so if someone wants | ||
24 | * this badly enough to write the code to handle it, we should support it | ||
25 | * as an option. | ||
26 | */ | ||
27 | #undef DEBUG | ||
28 | |||
29 | #include <linux/kernel.h> | ||
30 | #include <linux/errno.h> | ||
31 | #include <linux/clk.h> | ||
32 | #include <linux/io.h> | ||
33 | #include <linux/cpufreq.h> | ||
34 | |||
35 | #include <plat/clock.h> | ||
36 | #include <plat/sram.h> | ||
37 | #include <plat/sdrc.h> | ||
38 | |||
39 | #include "clock.h" | ||
40 | #include "clock2xxx.h" | ||
41 | #include "opp2xxx.h" | ||
42 | #include "cm.h" | ||
43 | #include "cm-regbits-24xx.h" | ||
44 | |||
45 | const struct prcm_config *curr_prcm_set; | ||
46 | const struct prcm_config *rate_table; | ||
47 | |||
48 | /** | ||
49 | * omap2_table_mpu_recalc - just return the MPU speed | ||
50 | * @clk: virt_prcm_set struct clk | ||
51 | * | ||
52 | * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. | ||
53 | */ | ||
54 | unsigned long omap2_table_mpu_recalc(struct clk *clk) | ||
55 | { | ||
56 | return curr_prcm_set->mpu_speed; | ||
57 | } | ||
58 | |||
59 | /* | ||
60 | * Look for a rate equal or less than the target rate given a configuration set. | ||
61 | * | ||
62 | * What's not entirely clear is "which" field represents the key field. | ||
63 | * Some might argue L3-DDR, others ARM, others IVA. This code is simple and | ||
64 | * just uses the ARM rates. | ||
65 | */ | ||
66 | long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) | ||
67 | { | ||
68 | const struct prcm_config *ptr; | ||
69 | long highest_rate; | ||
70 | long sys_ck_rate; | ||
71 | |||
72 | sys_ck_rate = clk_get_rate(sclk); | ||
73 | |||
74 | highest_rate = -EINVAL; | ||
75 | |||
76 | for (ptr = rate_table; ptr->mpu_speed; ptr++) { | ||
77 | if (!(ptr->flags & cpu_mask)) | ||
78 | continue; | ||
79 | if (ptr->xtal_speed != sys_ck_rate) | ||
80 | continue; | ||
81 | |||
82 | highest_rate = ptr->mpu_speed; | ||
83 | |||
84 | /* Can check only after xtal frequency check */ | ||
85 | if (ptr->mpu_speed <= rate) | ||
86 | break; | ||
87 | } | ||
88 | return highest_rate; | ||
89 | } | ||
90 | |||
91 | /* Sets basic clocks based on the specified rate */ | ||
92 | int omap2_select_table_rate(struct clk *clk, unsigned long rate) | ||
93 | { | ||
94 | u32 cur_rate, done_rate, bypass = 0, tmp; | ||
95 | const struct prcm_config *prcm; | ||
96 | unsigned long found_speed = 0; | ||
97 | unsigned long flags; | ||
98 | long sys_ck_rate; | ||
99 | |||
100 | sys_ck_rate = clk_get_rate(sclk); | ||
101 | |||
102 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
103 | if (!(prcm->flags & cpu_mask)) | ||
104 | continue; | ||
105 | |||
106 | if (prcm->xtal_speed != sys_ck_rate) | ||
107 | continue; | ||
108 | |||
109 | if (prcm->mpu_speed <= rate) { | ||
110 | found_speed = prcm->mpu_speed; | ||
111 | break; | ||
112 | } | ||
113 | } | ||
114 | |||
115 | if (!found_speed) { | ||
116 | printk(KERN_INFO "Could not set MPU rate to %luMHz\n", | ||
117 | rate / 1000000); | ||
118 | return -EINVAL; | ||
119 | } | ||
120 | |||
121 | curr_prcm_set = prcm; | ||
122 | cur_rate = omap2xxx_clk_get_core_rate(dclk); | ||
123 | |||
124 | if (prcm->dpll_speed == cur_rate / 2) { | ||
125 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1); | ||
126 | } else if (prcm->dpll_speed == cur_rate * 2) { | ||
127 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
128 | } else if (prcm->dpll_speed != cur_rate) { | ||
129 | local_irq_save(flags); | ||
130 | |||
131 | if (prcm->dpll_speed == prcm->xtal_speed) | ||
132 | bypass = 1; | ||
133 | |||
134 | if ((prcm->cm_clksel2_pll & OMAP24XX_CORE_CLK_SRC_MASK) == | ||
135 | CORE_CLK_SRC_DPLL_X2) | ||
136 | done_rate = CORE_CLK_SRC_DPLL_X2; | ||
137 | else | ||
138 | done_rate = CORE_CLK_SRC_DPLL; | ||
139 | |||
140 | /* MPU divider */ | ||
141 | cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL); | ||
142 | |||
143 | /* dsp + iva1 div(2420), iva2.1(2430) */ | ||
144 | cm_write_mod_reg(prcm->cm_clksel_dsp, | ||
145 | OMAP24XX_DSP_MOD, CM_CLKSEL); | ||
146 | |||
147 | cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL); | ||
148 | |||
149 | /* Major subsystem dividers */ | ||
150 | tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; | ||
151 | cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, | ||
152 | CM_CLKSEL1); | ||
153 | |||
154 | if (cpu_is_omap2430()) | ||
155 | cm_write_mod_reg(prcm->cm_clksel_mdm, | ||
156 | OMAP2430_MDM_MOD, CM_CLKSEL); | ||
157 | |||
158 | /* x2 to enter omap2xxx_sdrc_init_params() */ | ||
159 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
160 | |||
161 | omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr, | ||
162 | bypass); | ||
163 | |||
164 | omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked()); | ||
165 | omap2xxx_sdrc_reprogram(done_rate, 0); | ||
166 | |||
167 | local_irq_restore(flags); | ||
168 | } | ||
169 | |||
170 | return 0; | ||
171 | } | ||
172 | |||
173 | #ifdef CONFIG_CPU_FREQ | ||
174 | /* | ||
175 | * Walk PRCM rate table and fillout cpufreq freq_table | ||
176 | * XXX This should be replaced by an OPP layer in the near future | ||
177 | */ | ||
178 | static struct cpufreq_frequency_table *freq_table; | ||
179 | |||
180 | void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | ||
181 | { | ||
182 | const struct prcm_config *prcm; | ||
183 | long sys_ck_rate; | ||
184 | int i = 0; | ||
185 | int tbl_sz = 0; | ||
186 | |||
187 | if (!cpu_is_omap24xx()) | ||
188 | return; | ||
189 | |||
190 | sys_ck_rate = clk_get_rate(sclk); | ||
191 | |||
192 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
193 | if (!(prcm->flags & cpu_mask)) | ||
194 | continue; | ||
195 | if (prcm->xtal_speed != sys_ck_rate) | ||
196 | continue; | ||
197 | |||
198 | /* don't put bypass rates in table */ | ||
199 | if (prcm->dpll_speed == prcm->xtal_speed) | ||
200 | continue; | ||
201 | |||
202 | tbl_sz++; | ||
203 | } | ||
204 | |||
205 | /* | ||
206 | * XXX Ensure that we're doing what CPUFreq expects for this error | ||
207 | * case and the following one | ||
208 | */ | ||
209 | if (tbl_sz == 0) { | ||
210 | pr_warning("%s: no matching entries in rate_table\n", | ||
211 | __func__); | ||
212 | return; | ||
213 | } | ||
214 | |||
215 | /* Include the CPUFREQ_TABLE_END terminator entry */ | ||
216 | tbl_sz++; | ||
217 | |||
218 | freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) * tbl_sz, | ||
219 | GFP_ATOMIC); | ||
220 | if (!freq_table) { | ||
221 | pr_err("%s: could not kzalloc frequency table\n", __func__); | ||
222 | return; | ||
223 | } | ||
224 | |||
225 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
226 | if (!(prcm->flags & cpu_mask)) | ||
227 | continue; | ||
228 | if (prcm->xtal_speed != sys_ck_rate) | ||
229 | continue; | ||
230 | |||
231 | /* don't put bypass rates in table */ | ||
232 | if (prcm->dpll_speed == prcm->xtal_speed) | ||
233 | continue; | ||
234 | |||
235 | freq_table[i].index = i; | ||
236 | freq_table[i].frequency = prcm->mpu_speed / 1000; | ||
237 | i++; | ||
238 | } | ||
239 | |||
240 | freq_table[i].index = i; | ||
241 | freq_table[i].frequency = CPUFREQ_TABLE_END; | ||
242 | |||
243 | *table = &freq_table[0]; | ||
244 | } | ||
245 | |||
246 | void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) | ||
247 | { | ||
248 | if (!cpu_is_omap24xx()) | ||
249 | return; | ||
250 | |||
251 | kfree(freq_table); | ||
252 | } | ||
253 | |||
254 | #endif | ||
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c new file mode 100644 index 000000000000..b2b1e37bb6bb --- /dev/null +++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c | |||
@@ -0,0 +1,121 @@ | |||
1 | /* | ||
2 | * OMAP34xx M2 divider clock code | ||
3 | * | ||
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2007-2010 Nokia Corporation | ||
6 | * | ||
7 | * Paul Walmsley | ||
8 | * Jouni Högander | ||
9 | * | ||
10 | * Parts of this code are based on code written by | ||
11 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | #undef DEBUG | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/errno.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <plat/clock.h> | ||
25 | #include <plat/sram.h> | ||
26 | #include <plat/sdrc.h> | ||
27 | |||
28 | #include "clock.h" | ||
29 | #include "clock3xxx.h" | ||
30 | #include "clock34xx.h" | ||
31 | #include "sdrc.h" | ||
32 | |||
33 | #define CYCLES_PER_MHZ 1000000 | ||
34 | |||
35 | /* | ||
36 | * CORE DPLL (DPLL3) M2 divider rate programming functions | ||
37 | * | ||
38 | * These call into SRAM code to do the actual CM writes, since the SDRAM | ||
39 | * is clocked from DPLL3. | ||
40 | */ | ||
41 | |||
42 | /** | ||
43 | * omap3_core_dpll_m2_set_rate - set CORE DPLL M2 divider | ||
44 | * @clk: struct clk * of DPLL to set | ||
45 | * @rate: rounded target rate | ||
46 | * | ||
47 | * Program the DPLL M2 divider with the rounded target rate. Returns | ||
48 | * -EINVAL upon error, or 0 upon success. | ||
49 | */ | ||
50 | int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) | ||
51 | { | ||
52 | u32 new_div = 0; | ||
53 | u32 unlock_dll = 0; | ||
54 | u32 c; | ||
55 | unsigned long validrate, sdrcrate, _mpurate; | ||
56 | struct omap_sdrc_params *sdrc_cs0; | ||
57 | struct omap_sdrc_params *sdrc_cs1; | ||
58 | int ret; | ||
59 | |||
60 | if (!clk || !rate) | ||
61 | return -EINVAL; | ||
62 | |||
63 | validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); | ||
64 | if (validrate != rate) | ||
65 | return -EINVAL; | ||
66 | |||
67 | sdrcrate = sdrc_ick_p->rate; | ||
68 | if (rate > clk->rate) | ||
69 | sdrcrate <<= ((rate / clk->rate) >> 1); | ||
70 | else | ||
71 | sdrcrate >>= ((clk->rate / rate) >> 1); | ||
72 | |||
73 | ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1); | ||
74 | if (ret) | ||
75 | return -EINVAL; | ||
76 | |||
77 | if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) { | ||
78 | pr_debug("clock: will unlock SDRC DLL\n"); | ||
79 | unlock_dll = 1; | ||
80 | } | ||
81 | |||
82 | /* | ||
83 | * XXX This only needs to be done when the CPU frequency changes | ||
84 | */ | ||
85 | _mpurate = arm_fck_p->rate / CYCLES_PER_MHZ; | ||
86 | c = (_mpurate << SDRC_MPURATE_SCALE) >> SDRC_MPURATE_BASE_SHIFT; | ||
87 | c += 1; /* for safety */ | ||
88 | c *= SDRC_MPURATE_LOOPS; | ||
89 | c >>= SDRC_MPURATE_SCALE; | ||
90 | if (c == 0) | ||
91 | c = 1; | ||
92 | |||
93 | pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, | ||
94 | validrate); | ||
95 | pr_debug("clock: SDRC CS0 timing params used:" | ||
96 | " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", | ||
97 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, | ||
98 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr); | ||
99 | if (sdrc_cs1) | ||
100 | pr_debug("clock: SDRC CS1 timing params used: " | ||
101 | " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", | ||
102 | sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, | ||
103 | sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); | ||
104 | |||
105 | if (sdrc_cs1) | ||
106 | omap3_configure_core_dpll( | ||
107 | new_div, unlock_dll, c, rate > clk->rate, | ||
108 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, | ||
109 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, | ||
110 | sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, | ||
111 | sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); | ||
112 | else | ||
113 | omap3_configure_core_dpll( | ||
114 | new_div, unlock_dll, c, rate > clk->rate, | ||
115 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, | ||
116 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, | ||
117 | 0, 0, 0, 0); | ||
118 | |||
119 | return 0; | ||
120 | } | ||
121 | |||
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c new file mode 100644 index 000000000000..e50812dd03fd --- /dev/null +++ b/arch/arm/mach-omap2/clkt_clksel.c | |||
@@ -0,0 +1,409 @@ | |||
1 | /* | ||
2 | * clkt_clksel.c - OMAP2/3/4 clksel clock functions | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
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 | ||
13 | * published by the Free Software Foundation. | ||
14 | * | ||
15 | * XXX At some point these clksel clocks should be split into | ||
16 | * "divider" clocks and "mux" clocks to better match the hardware. | ||
17 | * | ||
18 | * XXX Currently these clocks are only used in the OMAP2/3/4 code, but | ||
19 | * many of the OMAP1 clocks should be convertible to use this | ||
20 | * mechanism. | ||
21 | */ | ||
22 | #undef DEBUG | ||
23 | |||
24 | #include <linux/kernel.h> | ||
25 | #include <linux/errno.h> | ||
26 | #include <linux/clk.h> | ||
27 | #include <linux/io.h> | ||
28 | |||
29 | #include <plat/clock.h> | ||
30 | |||
31 | #include "clock.h" | ||
32 | #include "cm.h" | ||
33 | #include "cm-regbits-24xx.h" | ||
34 | #include "cm-regbits-34xx.h" | ||
35 | |||
36 | /* Private functions */ | ||
37 | |||
38 | /** | ||
39 | * _omap2_get_clksel_by_parent - return clksel struct for a given clk & parent | ||
40 | * @clk: OMAP struct clk ptr to inspect | ||
41 | * @src_clk: OMAP struct clk ptr of the parent clk to search for | ||
42 | * | ||
43 | * Scan the struct clksel array associated with the clock to find | ||
44 | * the element associated with the supplied parent clock address. | ||
45 | * Returns a pointer to the struct clksel on success or NULL on error. | ||
46 | */ | ||
47 | static const struct clksel *_omap2_get_clksel_by_parent(struct clk *clk, | ||
48 | struct clk *src_clk) | ||
49 | { | ||
50 | const struct clksel *clks; | ||
51 | |||
52 | if (!clk->clksel) | ||
53 | return NULL; | ||
54 | |||
55 | for (clks = clk->clksel; clks->parent; clks++) { | ||
56 | if (clks->parent == src_clk) | ||
57 | break; /* Found the requested parent */ | ||
58 | } | ||
59 | |||
60 | if (!clks->parent) { | ||
61 | printk(KERN_ERR "clock: Could not find parent clock %s in " | ||
62 | "clksel array of clock %s\n", src_clk->name, | ||
63 | clk->name); | ||
64 | return NULL; | ||
65 | } | ||
66 | |||
67 | return clks; | ||
68 | } | ||
69 | |||
70 | /* | ||
71 | * Converts encoded control register address into a full address | ||
72 | * On error, the return value (parent_div) will be 0. | ||
73 | */ | ||
74 | static u32 _omap2_clksel_get_src_field(struct clk *src_clk, struct clk *clk, | ||
75 | u32 *field_val) | ||
76 | { | ||
77 | const struct clksel *clks; | ||
78 | const struct clksel_rate *clkr; | ||
79 | |||
80 | clks = _omap2_get_clksel_by_parent(clk, src_clk); | ||
81 | if (!clks) | ||
82 | return 0; | ||
83 | |||
84 | for (clkr = clks->rates; clkr->div; clkr++) { | ||
85 | if (clkr->flags & cpu_mask && clkr->flags & DEFAULT_RATE) | ||
86 | break; /* Found the default rate for this platform */ | ||
87 | } | ||
88 | |||
89 | if (!clkr->div) { | ||
90 | printk(KERN_ERR "clock: Could not find default rate for " | ||
91 | "clock %s parent %s\n", clk->name, | ||
92 | src_clk->parent->name); | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | /* Should never happen. Add a clksel mask to the struct clk. */ | ||
97 | WARN_ON(clk->clksel_mask == 0); | ||
98 | |||
99 | *field_val = clkr->val; | ||
100 | |||
101 | return clkr->div; | ||
102 | } | ||
103 | |||
104 | |||
105 | /* Public functions */ | ||
106 | |||
107 | /** | ||
108 | * omap2_init_clksel_parent - set a clksel clk's parent field from the hardware | ||
109 | * @clk: OMAP clock struct ptr to use | ||
110 | * | ||
111 | * Given a pointer to a source-selectable struct clk, read the hardware | ||
112 | * register and determine what its parent is currently set to. Update the | ||
113 | * clk->parent field with the appropriate clk ptr. | ||
114 | */ | ||
115 | void omap2_init_clksel_parent(struct clk *clk) | ||
116 | { | ||
117 | const struct clksel *clks; | ||
118 | const struct clksel_rate *clkr; | ||
119 | u32 r, found = 0; | ||
120 | |||
121 | if (!clk->clksel) | ||
122 | return; | ||
123 | |||
124 | r = __raw_readl(clk->clksel_reg) & clk->clksel_mask; | ||
125 | r >>= __ffs(clk->clksel_mask); | ||
126 | |||
127 | for (clks = clk->clksel; clks->parent && !found; clks++) { | ||
128 | for (clkr = clks->rates; clkr->div && !found; clkr++) { | ||
129 | if ((clkr->flags & cpu_mask) && (clkr->val == r)) { | ||
130 | if (clk->parent != clks->parent) { | ||
131 | pr_debug("clock: inited %s parent " | ||
132 | "to %s (was %s)\n", | ||
133 | clk->name, clks->parent->name, | ||
134 | ((clk->parent) ? | ||
135 | clk->parent->name : "NULL")); | ||
136 | clk_reparent(clk, clks->parent); | ||
137 | }; | ||
138 | found = 1; | ||
139 | } | ||
140 | } | ||
141 | } | ||
142 | |||
143 | if (!found) | ||
144 | printk(KERN_ERR "clock: init parent: could not find " | ||
145 | "regval %0x for clock %s\n", r, clk->name); | ||
146 | |||
147 | return; | ||
148 | } | ||
149 | |||
150 | /* | ||
151 | * Used for clocks that are part of CLKSEL_xyz governed clocks. | ||
152 | * REVISIT: Maybe change to use clk->enable() functions like on omap1? | ||
153 | */ | ||
154 | unsigned long omap2_clksel_recalc(struct clk *clk) | ||
155 | { | ||
156 | unsigned long rate; | ||
157 | u32 div = 0; | ||
158 | |||
159 | pr_debug("clock: recalc'ing clksel clk %s\n", clk->name); | ||
160 | |||
161 | div = omap2_clksel_get_divisor(clk); | ||
162 | if (div == 0) | ||
163 | return clk->rate; | ||
164 | |||
165 | rate = clk->parent->rate / div; | ||
166 | |||
167 | pr_debug("clock: new clock rate is %ld (div %d)\n", rate, div); | ||
168 | |||
169 | return rate; | ||
170 | } | ||
171 | |||
172 | /** | ||
173 | * omap2_clksel_round_rate_div - find divisor for the given clock and rate | ||
174 | * @clk: OMAP struct clk to use | ||
175 | * @target_rate: desired clock rate | ||
176 | * @new_div: ptr to where we should store the divisor | ||
177 | * | ||
178 | * Finds 'best' divider value in an array based on the source and target | ||
179 | * rates. The divider array must be sorted with smallest divider first. | ||
180 | * Note that this will not work for clocks which are part of CONFIG_PARTICIPANT, | ||
181 | * they are only settable as part of virtual_prcm set. | ||
182 | * | ||
183 | * Returns the rounded clock rate or returns 0xffffffff on error. | ||
184 | */ | ||
185 | u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | ||
186 | u32 *new_div) | ||
187 | { | ||
188 | unsigned long test_rate; | ||
189 | const struct clksel *clks; | ||
190 | const struct clksel_rate *clkr; | ||
191 | u32 last_div = 0; | ||
192 | |||
193 | pr_debug("clock: clksel_round_rate_div: %s target_rate %ld\n", | ||
194 | clk->name, target_rate); | ||
195 | |||
196 | *new_div = 1; | ||
197 | |||
198 | clks = _omap2_get_clksel_by_parent(clk, clk->parent); | ||
199 | if (!clks) | ||
200 | return ~0; | ||
201 | |||
202 | for (clkr = clks->rates; clkr->div; clkr++) { | ||
203 | if (!(clkr->flags & cpu_mask)) | ||
204 | continue; | ||
205 | |||
206 | /* Sanity check */ | ||
207 | if (clkr->div <= last_div) | ||
208 | pr_err("clock: clksel_rate table not sorted " | ||
209 | "for clock %s", clk->name); | ||
210 | |||
211 | last_div = clkr->div; | ||
212 | |||
213 | test_rate = clk->parent->rate / clkr->div; | ||
214 | |||
215 | if (test_rate <= target_rate) | ||
216 | break; /* found it */ | ||
217 | } | ||
218 | |||
219 | if (!clkr->div) { | ||
220 | pr_err("clock: Could not find divisor for target " | ||
221 | "rate %ld for clock %s parent %s\n", target_rate, | ||
222 | clk->name, clk->parent->name); | ||
223 | return ~0; | ||
224 | } | ||
225 | |||
226 | *new_div = clkr->div; | ||
227 | |||
228 | pr_debug("clock: new_div = %d, new_rate = %ld\n", *new_div, | ||
229 | (clk->parent->rate / clkr->div)); | ||
230 | |||
231 | return clk->parent->rate / clkr->div; | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * omap2_clksel_round_rate - find rounded rate for the given clock and rate | ||
236 | * @clk: OMAP struct clk to use | ||
237 | * @target_rate: desired clock rate | ||
238 | * | ||
239 | * Compatibility wrapper for OMAP clock framework | ||
240 | * Finds best target rate based on the source clock and possible dividers. | ||
241 | * rates. The divider array must be sorted with smallest divider first. | ||
242 | * Note that this will not work for clocks which are part of CONFIG_PARTICIPANT, | ||
243 | * they are only settable as part of virtual_prcm set. | ||
244 | * | ||
245 | * Returns the rounded clock rate or returns 0xffffffff on error. | ||
246 | */ | ||
247 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate) | ||
248 | { | ||
249 | u32 new_div; | ||
250 | |||
251 | return omap2_clksel_round_rate_div(clk, target_rate, &new_div); | ||
252 | } | ||
253 | |||
254 | |||
255 | /* Given a clock and a rate apply a clock specific rounding function */ | ||
256 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate) | ||
257 | { | ||
258 | if (clk->round_rate) | ||
259 | return clk->round_rate(clk, rate); | ||
260 | |||
261 | return clk->rate; | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * omap2_clksel_to_divisor() - turn clksel field value into integer divider | ||
266 | * @clk: OMAP struct clk to use | ||
267 | * @field_val: register field value to find | ||
268 | * | ||
269 | * Given a struct clk of a rate-selectable clksel clock, and a register field | ||
270 | * value to search for, find the corresponding clock divisor. The register | ||
271 | * field value should be pre-masked and shifted down so the LSB is at bit 0 | ||
272 | * before calling. Returns 0 on error | ||
273 | */ | ||
274 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val) | ||
275 | { | ||
276 | const struct clksel *clks; | ||
277 | const struct clksel_rate *clkr; | ||
278 | |||
279 | clks = _omap2_get_clksel_by_parent(clk, clk->parent); | ||
280 | if (!clks) | ||
281 | return 0; | ||
282 | |||
283 | for (clkr = clks->rates; clkr->div; clkr++) { | ||
284 | if ((clkr->flags & cpu_mask) && (clkr->val == field_val)) | ||
285 | break; | ||
286 | } | ||
287 | |||
288 | if (!clkr->div) { | ||
289 | printk(KERN_ERR "clock: Could not find fieldval %d for " | ||
290 | "clock %s parent %s\n", field_val, clk->name, | ||
291 | clk->parent->name); | ||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | return clkr->div; | ||
296 | } | ||
297 | |||
298 | /** | ||
299 | * omap2_divisor_to_clksel() - turn clksel integer divisor into a field value | ||
300 | * @clk: OMAP struct clk to use | ||
301 | * @div: integer divisor to search for | ||
302 | * | ||
303 | * Given a struct clk of a rate-selectable clksel clock, and a clock divisor, | ||
304 | * find the corresponding register field value. The return register value is | ||
305 | * the value before left-shifting. Returns ~0 on error | ||
306 | */ | ||
307 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | ||
308 | { | ||
309 | const struct clksel *clks; | ||
310 | const struct clksel_rate *clkr; | ||
311 | |||
312 | /* should never happen */ | ||
313 | WARN_ON(div == 0); | ||
314 | |||
315 | clks = _omap2_get_clksel_by_parent(clk, clk->parent); | ||
316 | if (!clks) | ||
317 | return ~0; | ||
318 | |||
319 | for (clkr = clks->rates; clkr->div; clkr++) { | ||
320 | if ((clkr->flags & cpu_mask) && (clkr->div == div)) | ||
321 | break; | ||
322 | } | ||
323 | |||
324 | if (!clkr->div) { | ||
325 | printk(KERN_ERR "clock: Could not find divisor %d for " | ||
326 | "clock %s parent %s\n", div, clk->name, | ||
327 | clk->parent->name); | ||
328 | return ~0; | ||
329 | } | ||
330 | |||
331 | return clkr->val; | ||
332 | } | ||
333 | |||
334 | /** | ||
335 | * omap2_clksel_get_divisor - get current divider applied to parent clock. | ||
336 | * @clk: OMAP struct clk to use. | ||
337 | * | ||
338 | * Returns the integer divisor upon success or 0 on error. | ||
339 | */ | ||
340 | u32 omap2_clksel_get_divisor(struct clk *clk) | ||
341 | { | ||
342 | u32 v; | ||
343 | |||
344 | if (!clk->clksel_mask) | ||
345 | return 0; | ||
346 | |||
347 | v = __raw_readl(clk->clksel_reg) & clk->clksel_mask; | ||
348 | v >>= __ffs(clk->clksel_mask); | ||
349 | |||
350 | return omap2_clksel_to_divisor(clk, v); | ||
351 | } | ||
352 | |||
353 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate) | ||
354 | { | ||
355 | u32 v, field_val, validrate, new_div = 0; | ||
356 | |||
357 | if (!clk->clksel_mask) | ||
358 | return -EINVAL; | ||
359 | |||
360 | validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); | ||
361 | if (validrate != rate) | ||
362 | return -EINVAL; | ||
363 | |||
364 | field_val = omap2_divisor_to_clksel(clk, new_div); | ||
365 | if (field_val == ~0) | ||
366 | return -EINVAL; | ||
367 | |||
368 | v = __raw_readl(clk->clksel_reg); | ||
369 | v &= ~clk->clksel_mask; | ||
370 | v |= field_val << __ffs(clk->clksel_mask); | ||
371 | __raw_writel(v, clk->clksel_reg); | ||
372 | v = __raw_readl(clk->clksel_reg); /* OCP barrier */ | ||
373 | |||
374 | clk->rate = clk->parent->rate / new_div; | ||
375 | |||
376 | return 0; | ||
377 | } | ||
378 | |||
379 | int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent) | ||
380 | { | ||
381 | u32 field_val, v, parent_div; | ||
382 | |||
383 | if (!clk->clksel) | ||
384 | return -EINVAL; | ||
385 | |||
386 | parent_div = _omap2_clksel_get_src_field(new_parent, clk, &field_val); | ||
387 | if (!parent_div) | ||
388 | return -EINVAL; | ||
389 | |||
390 | /* Set new source value (previous dividers if any in effect) */ | ||
391 | v = __raw_readl(clk->clksel_reg); | ||
392 | v &= ~clk->clksel_mask; | ||
393 | v |= field_val << __ffs(clk->clksel_mask); | ||
394 | __raw_writel(v, clk->clksel_reg); | ||
395 | v = __raw_readl(clk->clksel_reg); /* OCP barrier */ | ||
396 | |||
397 | clk_reparent(clk, new_parent); | ||
398 | |||
399 | /* CLKSEL clocks follow their parents' rates, divided by a divisor */ | ||
400 | clk->rate = new_parent->rate; | ||
401 | |||
402 | if (parent_div > 0) | ||
403 | clk->rate /= parent_div; | ||
404 | |||
405 | pr_debug("clock: set parent of %s to %s (new rate %ld)\n", | ||
406 | clk->name, clk->parent->name, clk->rate); | ||
407 | |||
408 | return 0; | ||
409 | } | ||
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c new file mode 100644 index 000000000000..6ce512e902c6 --- /dev/null +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
@@ -0,0 +1,386 @@ | |||
1 | /* | ||
2 | * OMAP2/3/4 DPLL clock functions | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
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 | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | #undef DEBUG | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/errno.h> | ||
19 | #include <linux/clk.h> | ||
20 | #include <linux/io.h> | ||
21 | |||
22 | #include <asm/div64.h> | ||
23 | |||
24 | #include <plat/clock.h> | ||
25 | |||
26 | #include "clock.h" | ||
27 | #include "cm.h" | ||
28 | #include "cm-regbits-24xx.h" | ||
29 | #include "cm-regbits-34xx.h" | ||
30 | |||
31 | /* DPLL rate rounding: minimum DPLL multiplier, divider values */ | ||
32 | #define DPLL_MIN_MULTIPLIER 2 | ||
33 | #define DPLL_MIN_DIVIDER 1 | ||
34 | |||
35 | /* Possible error results from _dpll_test_mult */ | ||
36 | #define DPLL_MULT_UNDERFLOW -1 | ||
37 | |||
38 | /* | ||
39 | * Scale factor to mitigate roundoff errors in DPLL rate rounding. | ||
40 | * The higher the scale factor, the greater the risk of arithmetic overflow, | ||
41 | * but the closer the rounded rate to the target rate. DPLL_SCALE_FACTOR | ||
42 | * must be a power of DPLL_SCALE_BASE. | ||
43 | */ | ||
44 | #define DPLL_SCALE_FACTOR 64 | ||
45 | #define DPLL_SCALE_BASE 2 | ||
46 | #define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \ | ||
47 | (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE)) | ||
48 | |||
49 | /* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */ | ||
50 | #define DPLL_FINT_BAND1_MIN 750000 | ||
51 | #define DPLL_FINT_BAND1_MAX 2100000 | ||
52 | #define DPLL_FINT_BAND2_MIN 7500000 | ||
53 | #define DPLL_FINT_BAND2_MAX 21000000 | ||
54 | |||
55 | /* _dpll_test_fint() return codes */ | ||
56 | #define DPLL_FINT_UNDERFLOW -1 | ||
57 | #define DPLL_FINT_INVALID -2 | ||
58 | |||
59 | /* Private functions */ | ||
60 | |||
61 | /* | ||
62 | * _dpll_test_fint - test whether an Fint value is valid for the DPLL | ||
63 | * @clk: DPLL struct clk to test | ||
64 | * @n: divider value (N) to test | ||
65 | * | ||
66 | * Tests whether a particular divider @n will result in a valid DPLL | ||
67 | * internal clock frequency Fint. See the 34xx TRM 4.7.6.2 "DPLL Jitter | ||
68 | * Correction". Returns 0 if OK, -1 if the enclosing loop can terminate | ||
69 | * (assuming that it is counting N upwards), or -2 if the enclosing loop | ||
70 | * should skip to the next iteration (again assuming N is increasing). | ||
71 | */ | ||
72 | static int _dpll_test_fint(struct clk *clk, u8 n) | ||
73 | { | ||
74 | struct dpll_data *dd; | ||
75 | long fint; | ||
76 | int ret = 0; | ||
77 | |||
78 | dd = clk->dpll_data; | ||
79 | |||
80 | /* DPLL divider must result in a valid jitter correction val */ | ||
81 | fint = clk->parent->rate / (n + 1); | ||
82 | if (fint < DPLL_FINT_BAND1_MIN) { | ||
83 | |||
84 | pr_debug("rejecting n=%d due to Fint failure, " | ||
85 | "lowering max_divider\n", n); | ||
86 | dd->max_divider = n; | ||
87 | ret = DPLL_FINT_UNDERFLOW; | ||
88 | |||
89 | } else if (fint > DPLL_FINT_BAND1_MAX && | ||
90 | fint < DPLL_FINT_BAND2_MIN) { | ||
91 | |||
92 | pr_debug("rejecting n=%d due to Fint failure\n", n); | ||
93 | ret = DPLL_FINT_INVALID; | ||
94 | |||
95 | } else if (fint > DPLL_FINT_BAND2_MAX) { | ||
96 | |||
97 | pr_debug("rejecting n=%d due to Fint failure, " | ||
98 | "boosting min_divider\n", n); | ||
99 | dd->min_divider = n; | ||
100 | ret = DPLL_FINT_INVALID; | ||
101 | |||
102 | } | ||
103 | |||
104 | return ret; | ||
105 | } | ||
106 | |||
107 | static unsigned long _dpll_compute_new_rate(unsigned long parent_rate, | ||
108 | unsigned int m, unsigned int n) | ||
109 | { | ||
110 | unsigned long long num; | ||
111 | |||
112 | num = (unsigned long long)parent_rate * m; | ||
113 | do_div(num, n); | ||
114 | return num; | ||
115 | } | ||
116 | |||
117 | /* | ||
118 | * _dpll_test_mult - test a DPLL multiplier value | ||
119 | * @m: pointer to the DPLL m (multiplier) value under test | ||
120 | * @n: current DPLL n (divider) value under test | ||
121 | * @new_rate: pointer to storage for the resulting rounded rate | ||
122 | * @target_rate: the desired DPLL rate | ||
123 | * @parent_rate: the DPLL's parent clock rate | ||
124 | * | ||
125 | * This code tests a DPLL multiplier value, ensuring that the | ||
126 | * resulting rate will not be higher than the target_rate, and that | ||
127 | * the multiplier value itself is valid for the DPLL. Initially, the | ||
128 | * integer pointed to by the m argument should be prescaled by | ||
129 | * multiplying by DPLL_SCALE_FACTOR. The code will replace this with | ||
130 | * a non-scaled m upon return. This non-scaled m will result in a | ||
131 | * new_rate as close as possible to target_rate (but not greater than | ||
132 | * target_rate) given the current (parent_rate, n, prescaled m) | ||
133 | * triple. Returns DPLL_MULT_UNDERFLOW in the event that the | ||
134 | * non-scaled m attempted to underflow, which can allow the calling | ||
135 | * function to bail out early; or 0 upon success. | ||
136 | */ | ||
137 | static int _dpll_test_mult(int *m, int n, unsigned long *new_rate, | ||
138 | unsigned long target_rate, | ||
139 | unsigned long parent_rate) | ||
140 | { | ||
141 | int r = 0, carry = 0; | ||
142 | |||
143 | /* Unscale m and round if necessary */ | ||
144 | if (*m % DPLL_SCALE_FACTOR >= DPLL_ROUNDING_VAL) | ||
145 | carry = 1; | ||
146 | *m = (*m / DPLL_SCALE_FACTOR) + carry; | ||
147 | |||
148 | /* | ||
149 | * The new rate must be <= the target rate to avoid programming | ||
150 | * a rate that is impossible for the hardware to handle | ||
151 | */ | ||
152 | *new_rate = _dpll_compute_new_rate(parent_rate, *m, n); | ||
153 | if (*new_rate > target_rate) { | ||
154 | (*m)--; | ||
155 | *new_rate = 0; | ||
156 | } | ||
157 | |||
158 | /* Guard against m underflow */ | ||
159 | if (*m < DPLL_MIN_MULTIPLIER) { | ||
160 | *m = DPLL_MIN_MULTIPLIER; | ||
161 | *new_rate = 0; | ||
162 | r = DPLL_MULT_UNDERFLOW; | ||
163 | } | ||
164 | |||
165 | if (*new_rate == 0) | ||
166 | *new_rate = _dpll_compute_new_rate(parent_rate, *m, n); | ||
167 | |||
168 | return r; | ||
169 | } | ||
170 | |||
171 | /* Public functions */ | ||
172 | |||
173 | void omap2_init_dpll_parent(struct clk *clk) | ||
174 | { | ||
175 | u32 v; | ||
176 | struct dpll_data *dd; | ||
177 | |||
178 | dd = clk->dpll_data; | ||
179 | if (!dd) | ||
180 | return; | ||
181 | |||
182 | /* Return bypass rate if DPLL is bypassed */ | ||
183 | v = __raw_readl(dd->control_reg); | ||
184 | v &= dd->enable_mask; | ||
185 | v >>= __ffs(dd->enable_mask); | ||
186 | |||
187 | /* Reparent in case the dpll is in bypass */ | ||
188 | if (cpu_is_omap24xx()) { | ||
189 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | ||
190 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
191 | clk_reparent(clk, dd->clk_bypass); | ||
192 | } else if (cpu_is_omap34xx()) { | ||
193 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
194 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
195 | clk_reparent(clk, dd->clk_bypass); | ||
196 | } else if (cpu_is_omap44xx()) { | ||
197 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
198 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
199 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
200 | clk_reparent(clk, dd->clk_bypass); | ||
201 | } | ||
202 | return; | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * omap2_get_dpll_rate - returns the current DPLL CLKOUT rate | ||
207 | * @clk: struct clk * of a DPLL | ||
208 | * | ||
209 | * DPLLs can be locked or bypassed - basically, enabled or disabled. | ||
210 | * When locked, the DPLL output depends on the M and N values. When | ||
211 | * bypassed, on OMAP2xxx, the output rate is either the 32KiHz clock | ||
212 | * or sys_clk. Bypass rates on OMAP3 depend on the DPLL: DPLLs 1 and | ||
213 | * 2 are bypassed with dpll1_fclk and dpll2_fclk respectively | ||
214 | * (generated by DPLL3), while DPLL 3, 4, and 5 bypass rates are sys_clk. | ||
215 | * Returns the current DPLL CLKOUT rate (*not* CLKOUTX2) if the DPLL is | ||
216 | * locked, or the appropriate bypass rate if the DPLL is bypassed, or 0 | ||
217 | * if the clock @clk is not a DPLL. | ||
218 | */ | ||
219 | u32 omap2_get_dpll_rate(struct clk *clk) | ||
220 | { | ||
221 | long long dpll_clk; | ||
222 | u32 dpll_mult, dpll_div, v; | ||
223 | struct dpll_data *dd; | ||
224 | |||
225 | dd = clk->dpll_data; | ||
226 | if (!dd) | ||
227 | return 0; | ||
228 | |||
229 | /* Return bypass rate if DPLL is bypassed */ | ||
230 | v = __raw_readl(dd->control_reg); | ||
231 | v &= dd->enable_mask; | ||
232 | v >>= __ffs(dd->enable_mask); | ||
233 | |||
234 | if (cpu_is_omap24xx()) { | ||
235 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | ||
236 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
237 | return dd->clk_bypass->rate; | ||
238 | } else if (cpu_is_omap34xx()) { | ||
239 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
240 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
241 | return dd->clk_bypass->rate; | ||
242 | } else if (cpu_is_omap44xx()) { | ||
243 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
244 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
245 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
246 | return dd->clk_bypass->rate; | ||
247 | } | ||
248 | |||
249 | v = __raw_readl(dd->mult_div1_reg); | ||
250 | dpll_mult = v & dd->mult_mask; | ||
251 | dpll_mult >>= __ffs(dd->mult_mask); | ||
252 | dpll_div = v & dd->div1_mask; | ||
253 | dpll_div >>= __ffs(dd->div1_mask); | ||
254 | |||
255 | dpll_clk = (long long)dd->clk_ref->rate * dpll_mult; | ||
256 | do_div(dpll_clk, dpll_div + 1); | ||
257 | |||
258 | return dpll_clk; | ||
259 | } | ||
260 | |||
261 | /* DPLL rate rounding code */ | ||
262 | |||
263 | /** | ||
264 | * omap2_dpll_set_rate_tolerance: set the error tolerance during rate rounding | ||
265 | * @clk: struct clk * of the DPLL | ||
266 | * @tolerance: maximum rate error tolerance | ||
267 | * | ||
268 | * Set the maximum DPLL rate error tolerance for the rate rounding | ||
269 | * algorithm. The rate tolerance is an attempt to balance DPLL power | ||
270 | * saving (the least divider value "n") vs. rate fidelity (the least | ||
271 | * difference between the desired DPLL target rate and the rounded | ||
272 | * rate out of the algorithm). So, increasing the tolerance is likely | ||
273 | * to decrease DPLL power consumption and increase DPLL rate error. | ||
274 | * Returns -EINVAL if provided a null clock ptr or a clk that is not a | ||
275 | * DPLL; or 0 upon success. | ||
276 | */ | ||
277 | int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance) | ||
278 | { | ||
279 | if (!clk || !clk->dpll_data) | ||
280 | return -EINVAL; | ||
281 | |||
282 | clk->dpll_data->rate_tolerance = tolerance; | ||
283 | |||
284 | return 0; | ||
285 | } | ||
286 | |||
287 | /** | ||
288 | * omap2_dpll_round_rate - round a target rate for an OMAP DPLL | ||
289 | * @clk: struct clk * for a DPLL | ||
290 | * @target_rate: desired DPLL clock rate | ||
291 | * | ||
292 | * Given a DPLL, a desired target rate, and a rate tolerance, round | ||
293 | * the target rate to a possible, programmable rate for this DPLL. | ||
294 | * Rate tolerance is assumed to be set by the caller before this | ||
295 | * function is called. Attempts to select the minimum possible n | ||
296 | * within the tolerance to reduce power consumption. Stores the | ||
297 | * computed (m, n) in the DPLL's dpll_data structure so set_rate() | ||
298 | * will not need to call this (expensive) function again. Returns ~0 | ||
299 | * if the target rate cannot be rounded, either because the rate is | ||
300 | * too low or because the rate tolerance is set too tightly; or the | ||
301 | * rounded rate upon success. | ||
302 | */ | ||
303 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | ||
304 | { | ||
305 | int m, n, r, e, scaled_max_m; | ||
306 | unsigned long scaled_rt_rp, new_rate; | ||
307 | int min_e = -1, min_e_m = -1, min_e_n = -1; | ||
308 | struct dpll_data *dd; | ||
309 | |||
310 | if (!clk || !clk->dpll_data) | ||
311 | return ~0; | ||
312 | |||
313 | dd = clk->dpll_data; | ||
314 | |||
315 | pr_debug("clock: starting DPLL round_rate for clock %s, target rate " | ||
316 | "%ld\n", clk->name, target_rate); | ||
317 | |||
318 | scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); | ||
319 | scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; | ||
320 | |||
321 | dd->last_rounded_rate = 0; | ||
322 | |||
323 | for (n = dd->min_divider; n <= dd->max_divider; n++) { | ||
324 | |||
325 | /* Is the (input clk, divider) pair valid for the DPLL? */ | ||
326 | r = _dpll_test_fint(clk, n); | ||
327 | if (r == DPLL_FINT_UNDERFLOW) | ||
328 | break; | ||
329 | else if (r == DPLL_FINT_INVALID) | ||
330 | continue; | ||
331 | |||
332 | /* Compute the scaled DPLL multiplier, based on the divider */ | ||
333 | m = scaled_rt_rp * n; | ||
334 | |||
335 | /* | ||
336 | * Since we're counting n up, a m overflow means we | ||
337 | * can bail out completely (since as n increases in | ||
338 | * the next iteration, there's no way that m can | ||
339 | * increase beyond the current m) | ||
340 | */ | ||
341 | if (m > scaled_max_m) | ||
342 | break; | ||
343 | |||
344 | r = _dpll_test_mult(&m, n, &new_rate, target_rate, | ||
345 | dd->clk_ref->rate); | ||
346 | |||
347 | /* m can't be set low enough for this n - try with a larger n */ | ||
348 | if (r == DPLL_MULT_UNDERFLOW) | ||
349 | continue; | ||
350 | |||
351 | e = target_rate - new_rate; | ||
352 | pr_debug("clock: n = %d: m = %d: rate error is %d " | ||
353 | "(new_rate = %ld)\n", n, m, e, new_rate); | ||
354 | |||
355 | if (min_e == -1 || | ||
356 | min_e >= (int)(abs(e) - dd->rate_tolerance)) { | ||
357 | min_e = e; | ||
358 | min_e_m = m; | ||
359 | min_e_n = n; | ||
360 | |||
361 | pr_debug("clock: found new least error %d\n", min_e); | ||
362 | |||
363 | /* We found good settings -- bail out now */ | ||
364 | if (min_e <= dd->rate_tolerance) | ||
365 | break; | ||
366 | } | ||
367 | } | ||
368 | |||
369 | if (min_e < 0) { | ||
370 | pr_debug("clock: error: target rate or tolerance too low\n"); | ||
371 | return ~0; | ||
372 | } | ||
373 | |||
374 | dd->last_rounded_m = min_e_m; | ||
375 | dd->last_rounded_n = min_e_n; | ||
376 | dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate, | ||
377 | min_e_m, min_e_n); | ||
378 | |||
379 | pr_debug("clock: final least error: e = %d, m = %d, n = %d\n", | ||
380 | min_e, min_e_m, min_e_n); | ||
381 | pr_debug("clock: final rate: %ld (target rate: %ld)\n", | ||
382 | dd->last_rounded_rate, target_rate); | ||
383 | |||
384 | return dd->last_rounded_rate; | ||
385 | } | ||
386 | |||
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 759c72a48f7f..a6d0b34b7990 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * linux/arch/arm/mach-omap2/clock.c | 2 | * linux/arch/arm/mach-omap2/clock.c |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2008 Nokia Corporation | 5 | * Copyright (C) 2004-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Contacts: | 7 | * Contacts: |
8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
@@ -14,11 +14,10 @@ | |||
14 | */ | 14 | */ |
15 | #undef DEBUG | 15 | #undef DEBUG |
16 | 16 | ||
17 | #include <linux/module.h> | ||
18 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
19 | #include <linux/device.h> | ||
20 | #include <linux/list.h> | 18 | #include <linux/list.h> |
21 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/err.h> | ||
22 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
23 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
24 | #include <linux/io.h> | 23 | #include <linux/io.h> |
@@ -28,10 +27,7 @@ | |||
28 | #include <plat/clockdomain.h> | 27 | #include <plat/clockdomain.h> |
29 | #include <plat/cpu.h> | 28 | #include <plat/cpu.h> |
30 | #include <plat/prcm.h> | 29 | #include <plat/prcm.h> |
31 | #include <asm/div64.h> | ||
32 | 30 | ||
33 | #include <plat/sdrc.h> | ||
34 | #include "sdrc.h" | ||
35 | #include "clock.h" | 31 | #include "clock.h" |
36 | #include "prm.h" | 32 | #include "prm.h" |
37 | #include "prm-regbits-24xx.h" | 33 | #include "prm-regbits-24xx.h" |
@@ -39,140 +35,44 @@ | |||
39 | #include "cm-regbits-24xx.h" | 35 | #include "cm-regbits-24xx.h" |
40 | #include "cm-regbits-34xx.h" | 36 | #include "cm-regbits-34xx.h" |
41 | 37 | ||
42 | /* DPLL rate rounding: minimum DPLL multiplier, divider values */ | 38 | u8 cpu_mask; |
43 | #define DPLL_MIN_MULTIPLIER 1 | ||
44 | #define DPLL_MIN_DIVIDER 1 | ||
45 | |||
46 | /* Possible error results from _dpll_test_mult */ | ||
47 | #define DPLL_MULT_UNDERFLOW -1 | ||
48 | 39 | ||
49 | /* | 40 | /* |
50 | * Scale factor to mitigate roundoff errors in DPLL rate rounding. | 41 | * OMAP2+ specific clock functions |
51 | * The higher the scale factor, the greater the risk of arithmetic overflow, | ||
52 | * but the closer the rounded rate to the target rate. DPLL_SCALE_FACTOR | ||
53 | * must be a power of DPLL_SCALE_BASE. | ||
54 | */ | 42 | */ |
55 | #define DPLL_SCALE_FACTOR 64 | ||
56 | #define DPLL_SCALE_BASE 2 | ||
57 | #define DPLL_ROUNDING_VAL ((DPLL_SCALE_BASE / 2) * \ | ||
58 | (DPLL_SCALE_FACTOR / DPLL_SCALE_BASE)) | ||
59 | |||
60 | /* DPLL valid Fint frequency band limits - from 34xx TRM Section 4.7.6.2 */ | ||
61 | #define DPLL_FINT_BAND1_MIN 750000 | ||
62 | #define DPLL_FINT_BAND1_MAX 2100000 | ||
63 | #define DPLL_FINT_BAND2_MIN 7500000 | ||
64 | #define DPLL_FINT_BAND2_MAX 21000000 | ||
65 | |||
66 | /* _dpll_test_fint() return codes */ | ||
67 | #define DPLL_FINT_UNDERFLOW -1 | ||
68 | #define DPLL_FINT_INVALID -2 | ||
69 | |||
70 | u8 cpu_mask; | ||
71 | |||
72 | /*------------------------------------------------------------------------- | ||
73 | * OMAP2/3/4 specific clock functions | ||
74 | *-------------------------------------------------------------------------*/ | ||
75 | |||
76 | void omap2_init_dpll_parent(struct clk *clk) | ||
77 | { | ||
78 | u32 v; | ||
79 | struct dpll_data *dd; | ||
80 | |||
81 | dd = clk->dpll_data; | ||
82 | if (!dd) | ||
83 | return; | ||
84 | 43 | ||
85 | /* Return bypass rate if DPLL is bypassed */ | 44 | /* Private functions */ |
86 | v = __raw_readl(dd->control_reg); | ||
87 | v &= dd->enable_mask; | ||
88 | v >>= __ffs(dd->enable_mask); | ||
89 | |||
90 | /* Reparent in case the dpll is in bypass */ | ||
91 | if (cpu_is_omap24xx()) { | ||
92 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | ||
93 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
94 | clk_reparent(clk, dd->clk_bypass); | ||
95 | } else if (cpu_is_omap34xx()) { | ||
96 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
97 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
98 | clk_reparent(clk, dd->clk_bypass); | ||
99 | } else if (cpu_is_omap44xx()) { | ||
100 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
101 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
102 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
103 | clk_reparent(clk, dd->clk_bypass); | ||
104 | } | ||
105 | return; | ||
106 | } | ||
107 | 45 | ||
108 | /** | 46 | /** |
109 | * _omap2xxx_clk_commit - commit clock parent/rate changes in hardware | 47 | * _omap2_module_wait_ready - wait for an OMAP module to leave IDLE |
110 | * @clk: struct clk * | 48 | * @clk: struct clk * belonging to the module |
111 | * | ||
112 | * If @clk has the DELAYED_APP flag set, meaning that parent/rate changes | ||
113 | * don't take effect until the VALID_CONFIG bit is written, write the | ||
114 | * VALID_CONFIG bit and wait for the write to complete. No return value. | ||
115 | */ | ||
116 | static void _omap2xxx_clk_commit(struct clk *clk) | ||
117 | { | ||
118 | if (!cpu_is_omap24xx()) | ||
119 | return; | ||
120 | |||
121 | if (!(clk->flags & DELAYED_APP)) | ||
122 | return; | ||
123 | |||
124 | prm_write_mod_reg(OMAP24XX_VALID_CONFIG, OMAP24XX_GR_MOD, | ||
125 | OMAP2_PRCM_CLKCFG_CTRL_OFFSET); | ||
126 | /* OCP barrier */ | ||
127 | prm_read_mod_reg(OMAP24XX_GR_MOD, OMAP2_PRCM_CLKCFG_CTRL_OFFSET); | ||
128 | } | ||
129 | |||
130 | /* | ||
131 | * _dpll_test_fint - test whether an Fint value is valid for the DPLL | ||
132 | * @clk: DPLL struct clk to test | ||
133 | * @n: divider value (N) to test | ||
134 | * | 49 | * |
135 | * Tests whether a particular divider @n will result in a valid DPLL | 50 | * If the necessary clocks for the OMAP hardware IP block that |
136 | * internal clock frequency Fint. See the 34xx TRM 4.7.6.2 "DPLL Jitter | 51 | * corresponds to clock @clk are enabled, then wait for the module to |
137 | * Correction". Returns 0 if OK, -1 if the enclosing loop can terminate | 52 | * indicate readiness (i.e., to leave IDLE). This code does not |
138 | * (assuming that it is counting N upwards), or -2 if the enclosing loop | 53 | * belong in the clock code and will be moved in the medium term to |
139 | * should skip to the next iteration (again assuming N is increasing). | 54 | * module-dependent code. No return value. |
140 | */ | 55 | */ |
141 | static int _dpll_test_fint(struct clk *clk, u8 n) | 56 | static void _omap2_module_wait_ready(struct clk *clk) |
142 | { | 57 | { |
143 | struct dpll_data *dd; | 58 | void __iomem *companion_reg, *idlest_reg; |
144 | long fint; | 59 | u8 other_bit, idlest_bit, idlest_val; |
145 | int ret = 0; | ||
146 | |||
147 | dd = clk->dpll_data; | ||
148 | |||
149 | /* DPLL divider must result in a valid jitter correction val */ | ||
150 | fint = clk->parent->rate / (n + 1); | ||
151 | if (fint < DPLL_FINT_BAND1_MIN) { | ||
152 | |||
153 | pr_debug("rejecting n=%d due to Fint failure, " | ||
154 | "lowering max_divider\n", n); | ||
155 | dd->max_divider = n; | ||
156 | ret = DPLL_FINT_UNDERFLOW; | ||
157 | |||
158 | } else if (fint > DPLL_FINT_BAND1_MAX && | ||
159 | fint < DPLL_FINT_BAND2_MIN) { | ||
160 | |||
161 | pr_debug("rejecting n=%d due to Fint failure\n", n); | ||
162 | ret = DPLL_FINT_INVALID; | ||
163 | |||
164 | } else if (fint > DPLL_FINT_BAND2_MAX) { | ||
165 | |||
166 | pr_debug("rejecting n=%d due to Fint failure, " | ||
167 | "boosting min_divider\n", n); | ||
168 | dd->min_divider = n; | ||
169 | ret = DPLL_FINT_INVALID; | ||
170 | 60 | ||
61 | /* Not all modules have multiple clocks that their IDLEST depends on */ | ||
62 | if (clk->ops->find_companion) { | ||
63 | clk->ops->find_companion(clk, &companion_reg, &other_bit); | ||
64 | if (!(__raw_readl(companion_reg) & (1 << other_bit))) | ||
65 | return; | ||
171 | } | 66 | } |
172 | 67 | ||
173 | return ret; | 68 | clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val); |
69 | |||
70 | omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val, | ||
71 | clk->name); | ||
174 | } | 72 | } |
175 | 73 | ||
74 | /* Public functions */ | ||
75 | |||
176 | /** | 76 | /** |
177 | * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk | 77 | * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk |
178 | * @clk: OMAP clock struct ptr to use | 78 | * @clk: OMAP clock struct ptr to use |
@@ -181,7 +81,6 @@ static int _dpll_test_fint(struct clk *clk, u8 n) | |||
181 | * clockdomain pointer, and save it into the struct clk. Intended to be | 81 | * clockdomain pointer, and save it into the struct clk. Intended to be |
182 | * called during clk_register(). No return value. | 82 | * called during clk_register(). No return value. |
183 | */ | 83 | */ |
184 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdm f/w is in place */ | ||
185 | void omap2_init_clk_clkdm(struct clk *clk) | 84 | void omap2_init_clk_clkdm(struct clk *clk) |
186 | { | 85 | { |
187 | struct clockdomain *clkdm; | 86 | struct clockdomain *clkdm; |
@@ -199,117 +98,6 @@ void omap2_init_clk_clkdm(struct clk *clk) | |||
199 | "clkdm %s\n", clk->name, clk->clkdm_name); | 98 | "clkdm %s\n", clk->name, clk->clkdm_name); |
200 | } | 99 | } |
201 | } | 100 | } |
202 | #endif | ||
203 | |||
204 | /** | ||
205 | * omap2_init_clksel_parent - set a clksel clk's parent field from the hardware | ||
206 | * @clk: OMAP clock struct ptr to use | ||
207 | * | ||
208 | * Given a pointer to a source-selectable struct clk, read the hardware | ||
209 | * register and determine what its parent is currently set to. Update the | ||
210 | * clk->parent field with the appropriate clk ptr. | ||
211 | */ | ||
212 | void omap2_init_clksel_parent(struct clk *clk) | ||
213 | { | ||
214 | const struct clksel *clks; | ||
215 | const struct clksel_rate *clkr; | ||
216 | u32 r, found = 0; | ||
217 | |||
218 | if (!clk->clksel) | ||
219 | return; | ||
220 | |||
221 | r = __raw_readl(clk->clksel_reg) & clk->clksel_mask; | ||
222 | r >>= __ffs(clk->clksel_mask); | ||
223 | |||
224 | for (clks = clk->clksel; clks->parent && !found; clks++) { | ||
225 | for (clkr = clks->rates; clkr->div && !found; clkr++) { | ||
226 | if ((clkr->flags & cpu_mask) && (clkr->val == r)) { | ||
227 | if (clk->parent != clks->parent) { | ||
228 | pr_debug("clock: inited %s parent " | ||
229 | "to %s (was %s)\n", | ||
230 | clk->name, clks->parent->name, | ||
231 | ((clk->parent) ? | ||
232 | clk->parent->name : "NULL")); | ||
233 | clk_reparent(clk, clks->parent); | ||
234 | }; | ||
235 | found = 1; | ||
236 | } | ||
237 | } | ||
238 | } | ||
239 | |||
240 | if (!found) | ||
241 | printk(KERN_ERR "clock: init parent: could not find " | ||
242 | "regval %0x for clock %s\n", r, clk->name); | ||
243 | |||
244 | return; | ||
245 | } | ||
246 | |||
247 | /** | ||
248 | * omap2_get_dpll_rate - returns the current DPLL CLKOUT rate | ||
249 | * @clk: struct clk * of a DPLL | ||
250 | * | ||
251 | * DPLLs can be locked or bypassed - basically, enabled or disabled. | ||
252 | * When locked, the DPLL output depends on the M and N values. When | ||
253 | * bypassed, on OMAP2xxx, the output rate is either the 32KiHz clock | ||
254 | * or sys_clk. Bypass rates on OMAP3 depend on the DPLL: DPLLs 1 and | ||
255 | * 2 are bypassed with dpll1_fclk and dpll2_fclk respectively | ||
256 | * (generated by DPLL3), while DPLL 3, 4, and 5 bypass rates are sys_clk. | ||
257 | * Returns the current DPLL CLKOUT rate (*not* CLKOUTX2) if the DPLL is | ||
258 | * locked, or the appropriate bypass rate if the DPLL is bypassed, or 0 | ||
259 | * if the clock @clk is not a DPLL. | ||
260 | */ | ||
261 | u32 omap2_get_dpll_rate(struct clk *clk) | ||
262 | { | ||
263 | long long dpll_clk; | ||
264 | u32 dpll_mult, dpll_div, v; | ||
265 | struct dpll_data *dd; | ||
266 | |||
267 | dd = clk->dpll_data; | ||
268 | if (!dd) | ||
269 | return 0; | ||
270 | |||
271 | /* Return bypass rate if DPLL is bypassed */ | ||
272 | v = __raw_readl(dd->control_reg); | ||
273 | v &= dd->enable_mask; | ||
274 | v >>= __ffs(dd->enable_mask); | ||
275 | |||
276 | if (cpu_is_omap24xx()) { | ||
277 | if (v == OMAP2XXX_EN_DPLL_LPBYPASS || | ||
278 | v == OMAP2XXX_EN_DPLL_FRBYPASS) | ||
279 | return dd->clk_bypass->rate; | ||
280 | } else if (cpu_is_omap34xx()) { | ||
281 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | ||
282 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | ||
283 | return dd->clk_bypass->rate; | ||
284 | } else if (cpu_is_omap44xx()) { | ||
285 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | ||
286 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | ||
287 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | ||
288 | return dd->clk_bypass->rate; | ||
289 | } | ||
290 | |||
291 | v = __raw_readl(dd->mult_div1_reg); | ||
292 | dpll_mult = v & dd->mult_mask; | ||
293 | dpll_mult >>= __ffs(dd->mult_mask); | ||
294 | dpll_div = v & dd->div1_mask; | ||
295 | dpll_div >>= __ffs(dd->div1_mask); | ||
296 | |||
297 | dpll_clk = (long long)dd->clk_ref->rate * dpll_mult; | ||
298 | do_div(dpll_clk, dpll_div + 1); | ||
299 | |||
300 | return dpll_clk; | ||
301 | } | ||
302 | |||
303 | /* | ||
304 | * Used for clocks that have the same value as the parent clock, | ||
305 | * divided by some factor | ||
306 | */ | ||
307 | unsigned long omap2_fixed_divisor_recalc(struct clk *clk) | ||
308 | { | ||
309 | WARN_ON(!clk->fixed_div); | ||
310 | |||
311 | return clk->parent->rate / clk->fixed_div; | ||
312 | } | ||
313 | 101 | ||
314 | /** | 102 | /** |
315 | * omap2_clk_dflt_find_companion - find companion clock to @clk | 103 | * omap2_clk_dflt_find_companion - find companion clock to @clk |
@@ -351,7 +139,8 @@ void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg, | |||
351 | * omap2_clk_dflt_find_idlest - find CM_IDLEST reg va, bit shift for @clk | 139 | * omap2_clk_dflt_find_idlest - find CM_IDLEST reg va, bit shift for @clk |
352 | * @clk: struct clk * to find IDLEST info for | 140 | * @clk: struct clk * to find IDLEST info for |
353 | * @idlest_reg: void __iomem ** to return the CM_IDLEST va in | 141 | * @idlest_reg: void __iomem ** to return the CM_IDLEST va in |
354 | * @idlest_bit: u8 ** to return the CM_IDLEST bit shift in | 142 | * @idlest_bit: u8 * to return the CM_IDLEST bit shift in |
143 | * @idlest_val: u8 * to return the idle status indicator | ||
355 | * | 144 | * |
356 | * Return the CM_IDLEST register address and bit shift corresponding | 145 | * Return the CM_IDLEST register address and bit shift corresponding |
357 | * to the module that "owns" this clock. This default code assumes | 146 | * to the module that "owns" this clock. This default code assumes |
@@ -361,40 +150,26 @@ void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg, | |||
361 | * CM_IDLEST2). This is not true for all modules. No return value. | 150 | * CM_IDLEST2). This is not true for all modules. No return value. |
362 | */ | 151 | */ |
363 | void omap2_clk_dflt_find_idlest(struct clk *clk, void __iomem **idlest_reg, | 152 | void omap2_clk_dflt_find_idlest(struct clk *clk, void __iomem **idlest_reg, |
364 | u8 *idlest_bit) | 153 | u8 *idlest_bit, u8 *idlest_val) |
365 | { | 154 | { |
366 | u32 r; | 155 | u32 r; |
367 | 156 | ||
368 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); | 157 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); |
369 | *idlest_reg = (__force void __iomem *)r; | 158 | *idlest_reg = (__force void __iomem *)r; |
370 | *idlest_bit = clk->enable_bit; | 159 | *idlest_bit = clk->enable_bit; |
371 | } | ||
372 | 160 | ||
373 | /** | 161 | /* |
374 | * omap2_module_wait_ready - wait for an OMAP module to leave IDLE | 162 | * 24xx uses 0 to indicate not ready, and 1 to indicate ready. |
375 | * @clk: struct clk * belonging to the module | 163 | * 34xx reverses this, just to keep us on our toes |
376 | * | 164 | * AM35xx uses both, depending on the module. |
377 | * If the necessary clocks for the OMAP hardware IP block that | 165 | */ |
378 | * corresponds to clock @clk are enabled, then wait for the module to | 166 | if (cpu_is_omap24xx()) |
379 | * indicate readiness (i.e., to leave IDLE). This code does not | 167 | *idlest_val = OMAP24XX_CM_IDLEST_VAL; |
380 | * belong in the clock code and will be moved in the medium term to | 168 | else if (cpu_is_omap34xx()) |
381 | * module-dependent code. No return value. | 169 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; |
382 | */ | 170 | else |
383 | static void omap2_module_wait_ready(struct clk *clk) | 171 | BUG(); |
384 | { | ||
385 | void __iomem *companion_reg, *idlest_reg; | ||
386 | u8 other_bit, idlest_bit; | ||
387 | |||
388 | /* Not all modules have multiple clocks that their IDLEST depends on */ | ||
389 | if (clk->ops->find_companion) { | ||
390 | clk->ops->find_companion(clk, &companion_reg, &other_bit); | ||
391 | if (!(__raw_readl(companion_reg) & (1 << other_bit))) | ||
392 | return; | ||
393 | } | ||
394 | |||
395 | clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit); | ||
396 | 172 | ||
397 | omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), clk->name); | ||
398 | } | 173 | } |
399 | 174 | ||
400 | int omap2_dflt_clk_enable(struct clk *clk) | 175 | int omap2_dflt_clk_enable(struct clk *clk) |
@@ -416,7 +191,7 @@ int omap2_dflt_clk_enable(struct clk *clk) | |||
416 | v = __raw_readl(clk->enable_reg); /* OCP barrier */ | 191 | v = __raw_readl(clk->enable_reg); /* OCP barrier */ |
417 | 192 | ||
418 | if (clk->ops->find_idlest) | 193 | if (clk->ops->find_idlest) |
419 | omap2_module_wait_ready(clk); | 194 | _omap2_module_wait_ready(clk); |
420 | 195 | ||
421 | return 0; | 196 | return 0; |
422 | } | 197 | } |
@@ -456,337 +231,109 @@ const struct clkops clkops_omap2_dflt = { | |||
456 | .disable = omap2_dflt_clk_disable, | 231 | .disable = omap2_dflt_clk_disable, |
457 | }; | 232 | }; |
458 | 233 | ||
459 | /* Enables clock without considering parent dependencies or use count | 234 | /** |
460 | * REVISIT: Maybe change this to use clk->enable like on omap1? | 235 | * omap2_clk_disable - disable a clock, if the system is not using it |
236 | * @clk: struct clk * to disable | ||
237 | * | ||
238 | * Decrements the usecount on struct clk @clk. If there are no users | ||
239 | * left, call the clkops-specific clock disable function to disable it | ||
240 | * in hardware. If the clock is part of a clockdomain (which they all | ||
241 | * should be), request that the clockdomain be disabled. (It too has | ||
242 | * a usecount, and so will not be disabled in the hardware until it no | ||
243 | * longer has any users.) If the clock has a parent clock (most of | ||
244 | * them do), then call ourselves, recursing on the parent clock. This | ||
245 | * can cause an entire branch of the clock tree to be powered off by | ||
246 | * simply disabling one clock. Intended to be called with the clockfw_lock | ||
247 | * spinlock held. No return value. | ||
461 | */ | 248 | */ |
462 | static int _omap2_clk_enable(struct clk *clk) | ||
463 | { | ||
464 | return clk->ops->enable(clk); | ||
465 | } | ||
466 | |||
467 | /* Disables clock without considering parent dependencies or use count */ | ||
468 | static void _omap2_clk_disable(struct clk *clk) | ||
469 | { | ||
470 | clk->ops->disable(clk); | ||
471 | } | ||
472 | |||
473 | void omap2_clk_disable(struct clk *clk) | 249 | void omap2_clk_disable(struct clk *clk) |
474 | { | 250 | { |
475 | if (clk->usecount > 0 && !(--clk->usecount)) { | 251 | if (clk->usecount == 0) { |
476 | _omap2_clk_disable(clk); | 252 | WARN(1, "clock: %s: omap2_clk_disable() called, but usecount " |
477 | if (clk->parent) | 253 | "already 0?", clk->name); |
478 | omap2_clk_disable(clk->parent); | 254 | return; |
479 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdm f/w is in place */ | ||
480 | if (clk->clkdm) | ||
481 | omap2_clkdm_clk_disable(clk->clkdm, clk); | ||
482 | #endif | ||
483 | |||
484 | } | 255 | } |
485 | } | ||
486 | 256 | ||
487 | int omap2_clk_enable(struct clk *clk) | 257 | pr_debug("clock: %s: decrementing usecount\n", clk->name); |
488 | { | ||
489 | int ret = 0; | ||
490 | 258 | ||
491 | if (clk->usecount++ == 0) { | 259 | clk->usecount--; |
492 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdm f/w is in place */ | ||
493 | if (clk->clkdm) | ||
494 | omap2_clkdm_clk_enable(clk->clkdm, clk); | ||
495 | #endif | ||
496 | 260 | ||
497 | if (clk->parent) { | 261 | if (clk->usecount > 0) |
498 | ret = omap2_clk_enable(clk->parent); | 262 | return; |
499 | if (ret) | ||
500 | goto err; | ||
501 | } | ||
502 | 263 | ||
503 | ret = _omap2_clk_enable(clk); | 264 | pr_debug("clock: %s: disabling in hardware\n", clk->name); |
504 | if (ret) { | ||
505 | if (clk->parent) | ||
506 | omap2_clk_disable(clk->parent); | ||
507 | 265 | ||
508 | goto err; | 266 | clk->ops->disable(clk); |
509 | } | ||
510 | } | ||
511 | return ret; | ||
512 | 267 | ||
513 | err: | ||
514 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once clkdm f/w is in place */ | ||
515 | if (clk->clkdm) | 268 | if (clk->clkdm) |
516 | omap2_clkdm_clk_disable(clk->clkdm, clk); | 269 | omap2_clkdm_clk_disable(clk->clkdm, clk); |
517 | #endif | ||
518 | clk->usecount--; | ||
519 | return ret; | ||
520 | } | ||
521 | |||
522 | /* | ||
523 | * Used for clocks that are part of CLKSEL_xyz governed clocks. | ||
524 | * REVISIT: Maybe change to use clk->enable() functions like on omap1? | ||
525 | */ | ||
526 | unsigned long omap2_clksel_recalc(struct clk *clk) | ||
527 | { | ||
528 | unsigned long rate; | ||
529 | u32 div = 0; | ||
530 | |||
531 | pr_debug("clock: recalc'ing clksel clk %s\n", clk->name); | ||
532 | |||
533 | div = omap2_clksel_get_divisor(clk); | ||
534 | if (div == 0) | ||
535 | return clk->rate; | ||
536 | |||
537 | rate = clk->parent->rate / div; | ||
538 | |||
539 | pr_debug("clock: new clock rate is %ld (div %d)\n", rate, div); | ||
540 | |||
541 | return rate; | ||
542 | } | ||
543 | |||
544 | /** | ||
545 | * omap2_get_clksel_by_parent - return clksel struct for a given clk & parent | ||
546 | * @clk: OMAP struct clk ptr to inspect | ||
547 | * @src_clk: OMAP struct clk ptr of the parent clk to search for | ||
548 | * | ||
549 | * Scan the struct clksel array associated with the clock to find | ||
550 | * the element associated with the supplied parent clock address. | ||
551 | * Returns a pointer to the struct clksel on success or NULL on error. | ||
552 | */ | ||
553 | static const struct clksel *omap2_get_clksel_by_parent(struct clk *clk, | ||
554 | struct clk *src_clk) | ||
555 | { | ||
556 | const struct clksel *clks; | ||
557 | |||
558 | if (!clk->clksel) | ||
559 | return NULL; | ||
560 | |||
561 | for (clks = clk->clksel; clks->parent; clks++) { | ||
562 | if (clks->parent == src_clk) | ||
563 | break; /* Found the requested parent */ | ||
564 | } | ||
565 | |||
566 | if (!clks->parent) { | ||
567 | printk(KERN_ERR "clock: Could not find parent clock %s in " | ||
568 | "clksel array of clock %s\n", src_clk->name, | ||
569 | clk->name); | ||
570 | return NULL; | ||
571 | } | ||
572 | 270 | ||
573 | return clks; | 271 | if (clk->parent) |
272 | omap2_clk_disable(clk->parent); | ||
574 | } | 273 | } |
575 | 274 | ||
576 | /** | 275 | /** |
577 | * omap2_clksel_round_rate_div - find divisor for the given clock and rate | 276 | * omap2_clk_enable - request that the system enable a clock |
578 | * @clk: OMAP struct clk to use | 277 | * @clk: struct clk * to enable |
579 | * @target_rate: desired clock rate | ||
580 | * @new_div: ptr to where we should store the divisor | ||
581 | * | 278 | * |
582 | * Finds 'best' divider value in an array based on the source and target | 279 | * Increments the usecount on struct clk @clk. If there were no users |
583 | * rates. The divider array must be sorted with smallest divider first. | 280 | * previously, then recurse up the clock tree, enabling all of the |
584 | * Note that this will not work for clocks which are part of CONFIG_PARTICIPANT, | 281 | * clock's parents and all of the parent clockdomains, and finally, |
585 | * they are only settable as part of virtual_prcm set. | 282 | * enabling @clk's clockdomain, and @clk itself. Intended to be |
586 | * | 283 | * called with the clockfw_lock spinlock held. Returns 0 upon success |
587 | * Returns the rounded clock rate or returns 0xffffffff on error. | 284 | * or a negative error code upon failure. |
588 | */ | 285 | */ |
589 | u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | 286 | int omap2_clk_enable(struct clk *clk) |
590 | u32 *new_div) | ||
591 | { | ||
592 | unsigned long test_rate; | ||
593 | const struct clksel *clks; | ||
594 | const struct clksel_rate *clkr; | ||
595 | u32 last_div = 0; | ||
596 | |||
597 | pr_debug("clock: clksel_round_rate_div: %s target_rate %ld\n", | ||
598 | clk->name, target_rate); | ||
599 | |||
600 | *new_div = 1; | ||
601 | |||
602 | clks = omap2_get_clksel_by_parent(clk, clk->parent); | ||
603 | if (!clks) | ||
604 | return ~0; | ||
605 | |||
606 | for (clkr = clks->rates; clkr->div; clkr++) { | ||
607 | if (!(clkr->flags & cpu_mask)) | ||
608 | continue; | ||
609 | |||
610 | /* Sanity check */ | ||
611 | if (clkr->div <= last_div) | ||
612 | pr_err("clock: clksel_rate table not sorted " | ||
613 | "for clock %s", clk->name); | ||
614 | |||
615 | last_div = clkr->div; | ||
616 | |||
617 | test_rate = clk->parent->rate / clkr->div; | ||
618 | |||
619 | if (test_rate <= target_rate) | ||
620 | break; /* found it */ | ||
621 | } | ||
622 | |||
623 | if (!clkr->div) { | ||
624 | pr_err("clock: Could not find divisor for target " | ||
625 | "rate %ld for clock %s parent %s\n", target_rate, | ||
626 | clk->name, clk->parent->name); | ||
627 | return ~0; | ||
628 | } | ||
629 | |||
630 | *new_div = clkr->div; | ||
631 | |||
632 | pr_debug("clock: new_div = %d, new_rate = %ld\n", *new_div, | ||
633 | (clk->parent->rate / clkr->div)); | ||
634 | |||
635 | return (clk->parent->rate / clkr->div); | ||
636 | } | ||
637 | |||
638 | /** | ||
639 | * omap2_clksel_round_rate - find rounded rate for the given clock and rate | ||
640 | * @clk: OMAP struct clk to use | ||
641 | * @target_rate: desired clock rate | ||
642 | * | ||
643 | * Compatibility wrapper for OMAP clock framework | ||
644 | * Finds best target rate based on the source clock and possible dividers. | ||
645 | * rates. The divider array must be sorted with smallest divider first. | ||
646 | * Note that this will not work for clocks which are part of CONFIG_PARTICIPANT, | ||
647 | * they are only settable as part of virtual_prcm set. | ||
648 | * | ||
649 | * Returns the rounded clock rate or returns 0xffffffff on error. | ||
650 | */ | ||
651 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate) | ||
652 | { | ||
653 | u32 new_div; | ||
654 | |||
655 | return omap2_clksel_round_rate_div(clk, target_rate, &new_div); | ||
656 | } | ||
657 | |||
658 | |||
659 | /* Given a clock and a rate apply a clock specific rounding function */ | ||
660 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate) | ||
661 | { | 287 | { |
662 | if (clk->round_rate) | 288 | int ret; |
663 | return clk->round_rate(clk, rate); | ||
664 | 289 | ||
665 | if (clk->flags & RATE_FIXED) | 290 | pr_debug("clock: %s: incrementing usecount\n", clk->name); |
666 | printk(KERN_ERR "clock: generic omap2_clk_round_rate called " | ||
667 | "on fixed-rate clock %s\n", clk->name); | ||
668 | 291 | ||
669 | return clk->rate; | 292 | clk->usecount++; |
670 | } | ||
671 | |||
672 | /** | ||
673 | * omap2_clksel_to_divisor() - turn clksel field value into integer divider | ||
674 | * @clk: OMAP struct clk to use | ||
675 | * @field_val: register field value to find | ||
676 | * | ||
677 | * Given a struct clk of a rate-selectable clksel clock, and a register field | ||
678 | * value to search for, find the corresponding clock divisor. The register | ||
679 | * field value should be pre-masked and shifted down so the LSB is at bit 0 | ||
680 | * before calling. Returns 0 on error | ||
681 | */ | ||
682 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val) | ||
683 | { | ||
684 | const struct clksel *clks; | ||
685 | const struct clksel_rate *clkr; | ||
686 | 293 | ||
687 | clks = omap2_get_clksel_by_parent(clk, clk->parent); | 294 | if (clk->usecount > 1) |
688 | if (!clks) | ||
689 | return 0; | 295 | return 0; |
690 | 296 | ||
691 | for (clkr = clks->rates; clkr->div; clkr++) { | 297 | pr_debug("clock: %s: enabling in hardware\n", clk->name); |
692 | if ((clkr->flags & cpu_mask) && (clkr->val == field_val)) | ||
693 | break; | ||
694 | } | ||
695 | 298 | ||
696 | if (!clkr->div) { | 299 | if (clk->parent) { |
697 | printk(KERN_ERR "clock: Could not find fieldval %d for " | 300 | ret = omap2_clk_enable(clk->parent); |
698 | "clock %s parent %s\n", field_val, clk->name, | 301 | if (ret) { |
699 | clk->parent->name); | 302 | WARN(1, "clock: %s: could not enable parent %s: %d\n", |
700 | return 0; | 303 | clk->name, clk->parent->name, ret); |
304 | goto oce_err1; | ||
305 | } | ||
701 | } | 306 | } |
702 | 307 | ||
703 | return clkr->div; | 308 | if (clk->clkdm) { |
704 | } | 309 | ret = omap2_clkdm_clk_enable(clk->clkdm, clk); |
705 | 310 | if (ret) { | |
706 | /** | 311 | WARN(1, "clock: %s: could not enable clockdomain %s: " |
707 | * omap2_divisor_to_clksel() - turn clksel integer divisor into a field value | 312 | "%d\n", clk->name, clk->clkdm->name, ret); |
708 | * @clk: OMAP struct clk to use | 313 | goto oce_err2; |
709 | * @div: integer divisor to search for | 314 | } |
710 | * | ||
711 | * Given a struct clk of a rate-selectable clksel clock, and a clock divisor, | ||
712 | * find the corresponding register field value. The return register value is | ||
713 | * the value before left-shifting. Returns ~0 on error | ||
714 | */ | ||
715 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div) | ||
716 | { | ||
717 | const struct clksel *clks; | ||
718 | const struct clksel_rate *clkr; | ||
719 | |||
720 | /* should never happen */ | ||
721 | WARN_ON(div == 0); | ||
722 | |||
723 | clks = omap2_get_clksel_by_parent(clk, clk->parent); | ||
724 | if (!clks) | ||
725 | return ~0; | ||
726 | |||
727 | for (clkr = clks->rates; clkr->div; clkr++) { | ||
728 | if ((clkr->flags & cpu_mask) && (clkr->div == div)) | ||
729 | break; | ||
730 | } | 315 | } |
731 | 316 | ||
732 | if (!clkr->div) { | 317 | ret = clk->ops->enable(clk); |
733 | printk(KERN_ERR "clock: Could not find divisor %d for " | 318 | if (ret) { |
734 | "clock %s parent %s\n", div, clk->name, | 319 | WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); |
735 | clk->parent->name); | 320 | goto oce_err3; |
736 | return ~0; | ||
737 | } | 321 | } |
738 | 322 | ||
739 | return clkr->val; | 323 | return 0; |
740 | } | ||
741 | |||
742 | /** | ||
743 | * omap2_clksel_get_divisor - get current divider applied to parent clock. | ||
744 | * @clk: OMAP struct clk to use. | ||
745 | * | ||
746 | * Returns the integer divisor upon success or 0 on error. | ||
747 | */ | ||
748 | u32 omap2_clksel_get_divisor(struct clk *clk) | ||
749 | { | ||
750 | u32 v; | ||
751 | |||
752 | if (!clk->clksel_mask) | ||
753 | return 0; | ||
754 | |||
755 | v = __raw_readl(clk->clksel_reg) & clk->clksel_mask; | ||
756 | v >>= __ffs(clk->clksel_mask); | ||
757 | |||
758 | return omap2_clksel_to_divisor(clk, v); | ||
759 | } | ||
760 | |||
761 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate) | ||
762 | { | ||
763 | u32 v, field_val, validrate, new_div = 0; | ||
764 | |||
765 | if (!clk->clksel_mask) | ||
766 | return -EINVAL; | ||
767 | |||
768 | validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); | ||
769 | if (validrate != rate) | ||
770 | return -EINVAL; | ||
771 | |||
772 | field_val = omap2_divisor_to_clksel(clk, new_div); | ||
773 | if (field_val == ~0) | ||
774 | return -EINVAL; | ||
775 | |||
776 | v = __raw_readl(clk->clksel_reg); | ||
777 | v &= ~clk->clksel_mask; | ||
778 | v |= field_val << __ffs(clk->clksel_mask); | ||
779 | __raw_writel(v, clk->clksel_reg); | ||
780 | v = __raw_readl(clk->clksel_reg); /* OCP barrier */ | ||
781 | |||
782 | clk->rate = clk->parent->rate / new_div; | ||
783 | 324 | ||
784 | _omap2xxx_clk_commit(clk); | 325 | oce_err3: |
326 | if (clk->clkdm) | ||
327 | omap2_clkdm_clk_disable(clk->clkdm, clk); | ||
328 | oce_err2: | ||
329 | if (clk->parent) | ||
330 | omap2_clk_disable(clk->parent); | ||
331 | oce_err1: | ||
332 | clk->usecount--; | ||
785 | 333 | ||
786 | return 0; | 334 | return ret; |
787 | } | 335 | } |
788 | 336 | ||
789 | |||
790 | /* Set the clock rate for a clock source */ | 337 | /* Set the clock rate for a clock source */ |
791 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate) | 338 | int omap2_clk_set_rate(struct clk *clk, unsigned long rate) |
792 | { | 339 | { |
@@ -794,11 +341,6 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate) | |||
794 | 341 | ||
795 | pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); | 342 | pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); |
796 | 343 | ||
797 | /* CONFIG_PARTICIPANT clocks are changed only in sets via the | ||
798 | rate table mechanism, driven by mpu_speed */ | ||
799 | if (clk->flags & CONFIG_PARTICIPANT) | ||
800 | return -EINVAL; | ||
801 | |||
802 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ | 344 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ |
803 | if (clk->set_rate) | 345 | if (clk->set_rate) |
804 | ret = clk->set_rate(clk, rate); | 346 | ret = clk->set_rate(clk, rate); |
@@ -806,289 +348,152 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate) | |||
806 | return ret; | 348 | return ret; |
807 | } | 349 | } |
808 | 350 | ||
809 | /* | ||
810 | * Converts encoded control register address into a full address | ||
811 | * On error, the return value (parent_div) will be 0. | ||
812 | */ | ||
813 | static u32 _omap2_clksel_get_src_field(struct clk *src_clk, struct clk *clk, | ||
814 | u32 *field_val) | ||
815 | { | ||
816 | const struct clksel *clks; | ||
817 | const struct clksel_rate *clkr; | ||
818 | |||
819 | clks = omap2_get_clksel_by_parent(clk, src_clk); | ||
820 | if (!clks) | ||
821 | return 0; | ||
822 | |||
823 | for (clkr = clks->rates; clkr->div; clkr++) { | ||
824 | if (clkr->flags & cpu_mask && clkr->flags & DEFAULT_RATE) | ||
825 | break; /* Found the default rate for this platform */ | ||
826 | } | ||
827 | |||
828 | if (!clkr->div) { | ||
829 | printk(KERN_ERR "clock: Could not find default rate for " | ||
830 | "clock %s parent %s\n", clk->name, | ||
831 | src_clk->parent->name); | ||
832 | return 0; | ||
833 | } | ||
834 | |||
835 | /* Should never happen. Add a clksel mask to the struct clk. */ | ||
836 | WARN_ON(clk->clksel_mask == 0); | ||
837 | |||
838 | *field_val = clkr->val; | ||
839 | |||
840 | return clkr->div; | ||
841 | } | ||
842 | |||
843 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | 351 | int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) |
844 | { | 352 | { |
845 | u32 field_val, v, parent_div; | ||
846 | |||
847 | if (clk->flags & CONFIG_PARTICIPANT) | ||
848 | return -EINVAL; | ||
849 | |||
850 | if (!clk->clksel) | 353 | if (!clk->clksel) |
851 | return -EINVAL; | 354 | return -EINVAL; |
852 | 355 | ||
853 | parent_div = _omap2_clksel_get_src_field(new_parent, clk, &field_val); | 356 | if (clk->parent == new_parent) |
854 | if (!parent_div) | 357 | return 0; |
855 | return -EINVAL; | ||
856 | |||
857 | /* Set new source value (previous dividers if any in effect) */ | ||
858 | v = __raw_readl(clk->clksel_reg); | ||
859 | v &= ~clk->clksel_mask; | ||
860 | v |= field_val << __ffs(clk->clksel_mask); | ||
861 | __raw_writel(v, clk->clksel_reg); | ||
862 | v = __raw_readl(clk->clksel_reg); /* OCP barrier */ | ||
863 | |||
864 | _omap2xxx_clk_commit(clk); | ||
865 | |||
866 | clk_reparent(clk, new_parent); | ||
867 | |||
868 | /* CLKSEL clocks follow their parents' rates, divided by a divisor */ | ||
869 | clk->rate = new_parent->rate; | ||
870 | |||
871 | if (parent_div > 0) | ||
872 | clk->rate /= parent_div; | ||
873 | |||
874 | pr_debug("clock: set parent of %s to %s (new rate %ld)\n", | ||
875 | clk->name, clk->parent->name, clk->rate); | ||
876 | 358 | ||
877 | return 0; | 359 | return omap2_clksel_set_parent(clk, new_parent); |
878 | } | 360 | } |
879 | 361 | ||
880 | /* DPLL rate rounding code */ | 362 | /* OMAP3/4 non-CORE DPLL clkops */ |
881 | 363 | ||
882 | /** | 364 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
883 | * omap2_dpll_set_rate_tolerance: set the error tolerance during rate rounding | ||
884 | * @clk: struct clk * of the DPLL | ||
885 | * @tolerance: maximum rate error tolerance | ||
886 | * | ||
887 | * Set the maximum DPLL rate error tolerance for the rate rounding | ||
888 | * algorithm. The rate tolerance is an attempt to balance DPLL power | ||
889 | * saving (the least divider value "n") vs. rate fidelity (the least | ||
890 | * difference between the desired DPLL target rate and the rounded | ||
891 | * rate out of the algorithm). So, increasing the tolerance is likely | ||
892 | * to decrease DPLL power consumption and increase DPLL rate error. | ||
893 | * Returns -EINVAL if provided a null clock ptr or a clk that is not a | ||
894 | * DPLL; or 0 upon success. | ||
895 | */ | ||
896 | int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance) | ||
897 | { | ||
898 | if (!clk || !clk->dpll_data) | ||
899 | return -EINVAL; | ||
900 | |||
901 | clk->dpll_data->rate_tolerance = tolerance; | ||
902 | 365 | ||
903 | return 0; | 366 | const struct clkops clkops_omap3_noncore_dpll_ops = { |
904 | } | 367 | .enable = omap3_noncore_dpll_enable, |
368 | .disable = omap3_noncore_dpll_disable, | ||
369 | }; | ||
905 | 370 | ||
906 | static unsigned long _dpll_compute_new_rate(unsigned long parent_rate, | 371 | #endif |
907 | unsigned int m, unsigned int n) | ||
908 | { | ||
909 | unsigned long long num; | ||
910 | 372 | ||
911 | num = (unsigned long long)parent_rate * m; | ||
912 | do_div(num, n); | ||
913 | return num; | ||
914 | } | ||
915 | 373 | ||
916 | /* | 374 | /* |
917 | * _dpll_test_mult - test a DPLL multiplier value | 375 | * OMAP2+ clock reset and init functions |
918 | * @m: pointer to the DPLL m (multiplier) value under test | ||
919 | * @n: current DPLL n (divider) value under test | ||
920 | * @new_rate: pointer to storage for the resulting rounded rate | ||
921 | * @target_rate: the desired DPLL rate | ||
922 | * @parent_rate: the DPLL's parent clock rate | ||
923 | * | ||
924 | * This code tests a DPLL multiplier value, ensuring that the | ||
925 | * resulting rate will not be higher than the target_rate, and that | ||
926 | * the multiplier value itself is valid for the DPLL. Initially, the | ||
927 | * integer pointed to by the m argument should be prescaled by | ||
928 | * multiplying by DPLL_SCALE_FACTOR. The code will replace this with | ||
929 | * a non-scaled m upon return. This non-scaled m will result in a | ||
930 | * new_rate as close as possible to target_rate (but not greater than | ||
931 | * target_rate) given the current (parent_rate, n, prescaled m) | ||
932 | * triple. Returns DPLL_MULT_UNDERFLOW in the event that the | ||
933 | * non-scaled m attempted to underflow, which can allow the calling | ||
934 | * function to bail out early; or 0 upon success. | ||
935 | */ | 376 | */ |
936 | static int _dpll_test_mult(int *m, int n, unsigned long *new_rate, | 377 | |
937 | unsigned long target_rate, | 378 | #ifdef CONFIG_OMAP_RESET_CLOCKS |
938 | unsigned long parent_rate) | 379 | void omap2_clk_disable_unused(struct clk *clk) |
939 | { | 380 | { |
940 | int r = 0, carry = 0; | 381 | u32 regval32, v; |
941 | 382 | ||
942 | /* Unscale m and round if necessary */ | 383 | v = (clk->flags & INVERT_ENABLE) ? (1 << clk->enable_bit) : 0; |
943 | if (*m % DPLL_SCALE_FACTOR >= DPLL_ROUNDING_VAL) | ||
944 | carry = 1; | ||
945 | *m = (*m / DPLL_SCALE_FACTOR) + carry; | ||
946 | 384 | ||
947 | /* | 385 | regval32 = __raw_readl(clk->enable_reg); |
948 | * The new rate must be <= the target rate to avoid programming | 386 | if ((regval32 & (1 << clk->enable_bit)) == v) |
949 | * a rate that is impossible for the hardware to handle | 387 | return; |
950 | */ | ||
951 | *new_rate = _dpll_compute_new_rate(parent_rate, *m, n); | ||
952 | if (*new_rate > target_rate) { | ||
953 | (*m)--; | ||
954 | *new_rate = 0; | ||
955 | } | ||
956 | 388 | ||
957 | /* Guard against m underflow */ | 389 | printk(KERN_DEBUG "Disabling unused clock \"%s\"\n", clk->name); |
958 | if (*m < DPLL_MIN_MULTIPLIER) { | 390 | if (cpu_is_omap34xx()) { |
959 | *m = DPLL_MIN_MULTIPLIER; | 391 | omap2_clk_enable(clk); |
960 | *new_rate = 0; | 392 | omap2_clk_disable(clk); |
961 | r = DPLL_MULT_UNDERFLOW; | 393 | } else { |
394 | clk->ops->disable(clk); | ||
962 | } | 395 | } |
963 | 396 | if (clk->clkdm != NULL) | |
964 | if (*new_rate == 0) | 397 | pwrdm_clkdm_state_switch(clk->clkdm); |
965 | *new_rate = _dpll_compute_new_rate(parent_rate, *m, n); | ||
966 | |||
967 | return r; | ||
968 | } | 398 | } |
399 | #endif | ||
969 | 400 | ||
970 | /** | 401 | /** |
971 | * omap2_dpll_round_rate - round a target rate for an OMAP DPLL | 402 | * omap2_clk_switch_mpurate_at_boot - switch ARM MPU rate by boot-time argument |
972 | * @clk: struct clk * for a DPLL | 403 | * @mpurate_ck_name: clk name of the clock to change rate |
973 | * @target_rate: desired DPLL clock rate | ||
974 | * | 404 | * |
975 | * Given a DPLL, a desired target rate, and a rate tolerance, round | 405 | * Change the ARM MPU clock rate to the rate specified on the command |
976 | * the target rate to a possible, programmable rate for this DPLL. | 406 | * line, if one was specified. @mpurate_ck_name should be |
977 | * Rate tolerance is assumed to be set by the caller before this | 407 | * "virt_prcm_set" on OMAP2xxx and "dpll1_ck" on OMAP34xx/OMAP36xx. |
978 | * function is called. Attempts to select the minimum possible n | 408 | * XXX Does not handle voltage scaling - on OMAP2xxx this is currently |
979 | * within the tolerance to reduce power consumption. Stores the | 409 | * handled by the virt_prcm_set clock, but this should be handled by |
980 | * computed (m, n) in the DPLL's dpll_data structure so set_rate() | 410 | * the OPP layer. XXX This is intended to be handled by the OPP layer |
981 | * will not need to call this (expensive) function again. Returns ~0 | 411 | * code in the near future and should be removed from the clock code. |
982 | * if the target rate cannot be rounded, either because the rate is | 412 | * Returns -EINVAL if 'mpurate' is zero or if clk_set_rate() rejects |
983 | * too low or because the rate tolerance is set too tightly; or the | 413 | * the rate, -ENOENT if the struct clk referred to by @mpurate_ck_name |
984 | * rounded rate upon success. | 414 | * cannot be found, or 0 upon success. |
985 | */ | 415 | */ |
986 | long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) | 416 | int __init omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name) |
987 | { | 417 | { |
988 | int m, n, r, e, scaled_max_m; | 418 | struct clk *mpurate_ck; |
989 | unsigned long scaled_rt_rp, new_rate; | 419 | int r; |
990 | int min_e = -1, min_e_m = -1, min_e_n = -1; | ||
991 | struct dpll_data *dd; | ||
992 | 420 | ||
993 | if (!clk || !clk->dpll_data) | 421 | if (!mpurate) |
994 | return ~0; | 422 | return -EINVAL; |
995 | |||
996 | dd = clk->dpll_data; | ||
997 | |||
998 | pr_debug("clock: starting DPLL round_rate for clock %s, target rate " | ||
999 | "%ld\n", clk->name, target_rate); | ||
1000 | |||
1001 | scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); | ||
1002 | scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; | ||
1003 | |||
1004 | dd->last_rounded_rate = 0; | ||
1005 | |||
1006 | for (n = dd->min_divider; n <= dd->max_divider; n++) { | ||
1007 | |||
1008 | /* Is the (input clk, divider) pair valid for the DPLL? */ | ||
1009 | r = _dpll_test_fint(clk, n); | ||
1010 | if (r == DPLL_FINT_UNDERFLOW) | ||
1011 | break; | ||
1012 | else if (r == DPLL_FINT_INVALID) | ||
1013 | continue; | ||
1014 | |||
1015 | /* Compute the scaled DPLL multiplier, based on the divider */ | ||
1016 | m = scaled_rt_rp * n; | ||
1017 | |||
1018 | /* | ||
1019 | * Since we're counting n up, a m overflow means we | ||
1020 | * can bail out completely (since as n increases in | ||
1021 | * the next iteration, there's no way that m can | ||
1022 | * increase beyond the current m) | ||
1023 | */ | ||
1024 | if (m > scaled_max_m) | ||
1025 | break; | ||
1026 | |||
1027 | r = _dpll_test_mult(&m, n, &new_rate, target_rate, | ||
1028 | dd->clk_ref->rate); | ||
1029 | |||
1030 | /* m can't be set low enough for this n - try with a larger n */ | ||
1031 | if (r == DPLL_MULT_UNDERFLOW) | ||
1032 | continue; | ||
1033 | |||
1034 | e = target_rate - new_rate; | ||
1035 | pr_debug("clock: n = %d: m = %d: rate error is %d " | ||
1036 | "(new_rate = %ld)\n", n, m, e, new_rate); | ||
1037 | |||
1038 | if (min_e == -1 || | ||
1039 | min_e >= (int)(abs(e) - dd->rate_tolerance)) { | ||
1040 | min_e = e; | ||
1041 | min_e_m = m; | ||
1042 | min_e_n = n; | ||
1043 | |||
1044 | pr_debug("clock: found new least error %d\n", min_e); | ||
1045 | 423 | ||
1046 | /* We found good settings -- bail out now */ | 424 | mpurate_ck = clk_get(NULL, mpurate_ck_name); |
1047 | if (min_e <= dd->rate_tolerance) | 425 | if (WARN(IS_ERR(mpurate_ck), "Failed to get %s.\n", mpurate_ck_name)) |
1048 | break; | 426 | return -ENOENT; |
1049 | } | ||
1050 | } | ||
1051 | 427 | ||
1052 | if (min_e < 0) { | 428 | r = clk_set_rate(mpurate_ck, mpurate); |
1053 | pr_debug("clock: error: target rate or tolerance too low\n"); | 429 | if (IS_ERR_VALUE(r)) { |
1054 | return ~0; | 430 | WARN(1, "clock: %s: unable to set MPU rate to %d: %d\n", |
431 | mpurate_ck->name, mpurate, r); | ||
432 | return -EINVAL; | ||
1055 | } | 433 | } |
1056 | 434 | ||
1057 | dd->last_rounded_m = min_e_m; | 435 | calibrate_delay(); |
1058 | dd->last_rounded_n = min_e_n; | 436 | recalculate_root_clocks(); |
1059 | dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate, | ||
1060 | min_e_m, min_e_n); | ||
1061 | 437 | ||
1062 | pr_debug("clock: final least error: e = %d, m = %d, n = %d\n", | 438 | clk_put(mpurate_ck); |
1063 | min_e, min_e_m, min_e_n); | ||
1064 | pr_debug("clock: final rate: %ld (target rate: %ld)\n", | ||
1065 | dd->last_rounded_rate, target_rate); | ||
1066 | 439 | ||
1067 | return dd->last_rounded_rate; | 440 | return 0; |
1068 | } | 441 | } |
1069 | 442 | ||
1070 | /*------------------------------------------------------------------------- | 443 | /** |
1071 | * Omap2 clock reset and init functions | 444 | * omap2_clk_print_new_rates - print summary of current clock tree rates |
1072 | *-------------------------------------------------------------------------*/ | 445 | * @hfclkin_ck_name: clk name for the off-chip HF oscillator |
1073 | 446 | * @core_ck_name: clk name for the on-chip CORE_CLK | |
1074 | #ifdef CONFIG_OMAP_RESET_CLOCKS | 447 | * @mpu_ck_name: clk name for the ARM MPU clock |
1075 | void omap2_clk_disable_unused(struct clk *clk) | 448 | * |
449 | * Prints a short message to the console with the HFCLKIN oscillator | ||
450 | * rate, the rate of the CORE clock, and the rate of the ARM MPU clock. | ||
451 | * Called by the boot-time MPU rate switching code. XXX This is intended | ||
452 | * to be handled by the OPP layer code in the near future and should be | ||
453 | * removed from the clock code. No return value. | ||
454 | */ | ||
455 | void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name, | ||
456 | const char *core_ck_name, | ||
457 | const char *mpu_ck_name) | ||
1076 | { | 458 | { |
1077 | u32 regval32, v; | 459 | struct clk *hfclkin_ck, *core_ck, *mpu_ck; |
460 | unsigned long hfclkin_rate; | ||
1078 | 461 | ||
1079 | v = (clk->flags & INVERT_ENABLE) ? (1 << clk->enable_bit) : 0; | 462 | mpu_ck = clk_get(NULL, mpu_ck_name); |
463 | if (WARN(IS_ERR(mpu_ck), "clock: failed to get %s.\n", mpu_ck_name)) | ||
464 | return; | ||
1080 | 465 | ||
1081 | regval32 = __raw_readl(clk->enable_reg); | 466 | core_ck = clk_get(NULL, core_ck_name); |
1082 | if ((regval32 & (1 << clk->enable_bit)) == v) | 467 | if (WARN(IS_ERR(core_ck), "clock: failed to get %s.\n", core_ck_name)) |
1083 | return; | 468 | return; |
1084 | 469 | ||
1085 | printk(KERN_DEBUG "Disabling unused clock \"%s\"\n", clk->name); | 470 | hfclkin_ck = clk_get(NULL, hfclkin_ck_name); |
1086 | if (cpu_is_omap34xx()) { | 471 | if (WARN(IS_ERR(hfclkin_ck), "Failed to get %s.\n", hfclkin_ck_name)) |
1087 | omap2_clk_enable(clk); | 472 | return; |
1088 | omap2_clk_disable(clk); | 473 | |
1089 | } else | 474 | hfclkin_rate = clk_get_rate(hfclkin_ck); |
1090 | _omap2_clk_disable(clk); | 475 | |
1091 | if (clk->clkdm != NULL) | 476 | pr_info("Switched to new clocking rate (Crystal/Core/MPU): " |
1092 | pwrdm_clkdm_state_switch(clk->clkdm); | 477 | "%ld.%01ld/%ld/%ld MHz\n", |
1093 | } | 478 | (hfclkin_rate / 1000000), |
479 | ((hfclkin_rate / 100000) % 10), | ||
480 | (clk_get_rate(core_ck) / 1000000), | ||
481 | (clk_get_rate(mpu_ck) / 1000000)); | ||
482 | } | ||
483 | |||
484 | /* Common data */ | ||
485 | |||
486 | struct clk_functions omap2_clk_functions = { | ||
487 | .clk_enable = omap2_clk_enable, | ||
488 | .clk_disable = omap2_clk_disable, | ||
489 | .clk_round_rate = omap2_clk_round_rate, | ||
490 | .clk_set_rate = omap2_clk_set_rate, | ||
491 | .clk_set_parent = omap2_clk_set_parent, | ||
492 | .clk_disable_unused = omap2_clk_disable_unused, | ||
493 | #ifdef CONFIG_CPU_FREQ | ||
494 | /* These will be removed when the OPP code is integrated */ | ||
495 | .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, | ||
496 | .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table, | ||
1094 | #endif | 497 | #endif |
498 | }; | ||
499 | |||
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 93c48df3b5b1..ad8a1f7c1afc 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -47,7 +47,10 @@ | |||
47 | #define DPLL_LOW_POWER_BYPASS 0x5 | 47 | #define DPLL_LOW_POWER_BYPASS 0x5 |
48 | #define DPLL_LOCKED 0x7 | 48 | #define DPLL_LOCKED 0x7 |
49 | 49 | ||
50 | int omap2_clk_init(void); | 50 | /* DPLL Type and DCO Selection Flags */ |
51 | #define DPLL_J_TYPE 0x1 | ||
52 | #define DPLL_NO_DCO_SEL 0x2 | ||
53 | |||
51 | int omap2_clk_enable(struct clk *clk); | 54 | int omap2_clk_enable(struct clk *clk); |
52 | void omap2_clk_disable(struct clk *clk); | 55 | void omap2_clk_disable(struct clk *clk); |
53 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); | 56 | long omap2_clk_round_rate(struct clk *clk, unsigned long rate); |
@@ -78,23 +81,53 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | |||
78 | u32 *new_div); | 81 | u32 *new_div); |
79 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val); | 82 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val); |
80 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div); | 83 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div); |
81 | unsigned long omap2_fixed_divisor_recalc(struct clk *clk); | ||
82 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); | 84 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); |
83 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); | 85 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); |
86 | int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent); | ||
84 | u32 omap2_get_dpll_rate(struct clk *clk); | 87 | u32 omap2_get_dpll_rate(struct clk *clk); |
85 | void omap2_init_dpll_parent(struct clk *clk); | 88 | void omap2_init_dpll_parent(struct clk *clk); |
86 | int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); | 89 | int omap2_wait_clock_ready(void __iomem *reg, u32 cval, const char *name); |
87 | void omap2_clk_prepare_for_reboot(void); | 90 | |
91 | |||
92 | #ifdef CONFIG_ARCH_OMAP2 | ||
93 | void omap2xxx_clk_prepare_for_reboot(void); | ||
94 | #else | ||
95 | static inline void omap2xxx_clk_prepare_for_reboot(void) | ||
96 | { | ||
97 | } | ||
98 | #endif | ||
99 | |||
100 | #ifdef CONFIG_ARCH_OMAP3 | ||
101 | void omap3_clk_prepare_for_reboot(void); | ||
102 | #else | ||
103 | static inline void omap3_clk_prepare_for_reboot(void) | ||
104 | { | ||
105 | } | ||
106 | #endif | ||
107 | |||
108 | #ifdef CONFIG_ARCH_OMAP4 | ||
109 | void omap4_clk_prepare_for_reboot(void); | ||
110 | #else | ||
111 | static inline void omap4_clk_prepare_for_reboot(void) | ||
112 | { | ||
113 | } | ||
114 | #endif | ||
115 | |||
88 | int omap2_dflt_clk_enable(struct clk *clk); | 116 | int omap2_dflt_clk_enable(struct clk *clk); |
89 | void omap2_dflt_clk_disable(struct clk *clk); | 117 | void omap2_dflt_clk_disable(struct clk *clk); |
90 | void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg, | 118 | void omap2_clk_dflt_find_companion(struct clk *clk, void __iomem **other_reg, |
91 | u8 *other_bit); | 119 | u8 *other_bit); |
92 | void omap2_clk_dflt_find_idlest(struct clk *clk, void __iomem **idlest_reg, | 120 | void omap2_clk_dflt_find_idlest(struct clk *clk, void __iomem **idlest_reg, |
93 | u8 *idlest_bit); | 121 | u8 *idlest_bit, u8 *idlest_val); |
122 | int omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name); | ||
123 | void omap2_clk_print_new_rates(const char *hfclkin_ck_name, | ||
124 | const char *core_ck_name, | ||
125 | const char *mpu_ck_name); | ||
94 | 126 | ||
95 | extern u8 cpu_mask; | 127 | extern u8 cpu_mask; |
96 | 128 | ||
97 | extern const struct clkops clkops_omap2_dflt_wait; | 129 | extern const struct clkops clkops_omap2_dflt_wait; |
130 | extern const struct clkops clkops_dummy; | ||
98 | extern const struct clkops clkops_omap2_dflt; | 131 | extern const struct clkops clkops_omap2_dflt; |
99 | 132 | ||
100 | extern struct clk_functions omap2_clk_functions; | 133 | extern struct clk_functions omap2_clk_functions; |
@@ -104,5 +137,14 @@ extern const struct clksel_rate gpt_32k_rates[]; | |||
104 | extern const struct clksel_rate gpt_sys_rates[]; | 137 | extern const struct clksel_rate gpt_sys_rates[]; |
105 | extern const struct clksel_rate gfx_l3_rates[]; | 138 | extern const struct clksel_rate gfx_l3_rates[]; |
106 | 139 | ||
140 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ) | ||
141 | extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | ||
142 | extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); | ||
143 | #else | ||
144 | #define omap2_clk_init_cpufreq_table 0 | ||
145 | #define omap2_clk_exit_cpufreq_table 0 | ||
146 | #endif | ||
147 | |||
148 | extern const struct clkops clkops_omap3_noncore_dpll_ops; | ||
107 | 149 | ||
108 | #endif | 150 | #endif |
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c new file mode 100644 index 000000000000..f12af95ead45 --- /dev/null +++ b/arch/arm/mach-omap2/clock2420_data.c | |||
@@ -0,0 +1,1910 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap2/clock2420_data.c | ||
3 | * | ||
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
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 | ||
13 | * published by the Free Software Foundation. | ||
14 | */ | ||
15 | |||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/clk.h> | ||
18 | #include <linux/list.h> | ||
19 | |||
20 | #include <plat/clkdev_omap.h> | ||
21 | |||
22 | #include "clock.h" | ||
23 | #include "clock2xxx.h" | ||
24 | #include "opp2xxx.h" | ||
25 | #include "prm.h" | ||
26 | #include "cm.h" | ||
27 | #include "prm-regbits-24xx.h" | ||
28 | #include "cm-regbits-24xx.h" | ||
29 | #include "sdrc.h" | ||
30 | |||
31 | #define OMAP_CM_REGADDR OMAP2420_CM_REGADDR | ||
32 | |||
33 | /* | ||
34 | * 2420 clock tree. | ||
35 | * | ||
36 | * NOTE:In many cases here we are assigning a 'default' parent. In many | ||
37 | * cases the parent is selectable. The get/set parent calls will also | ||
38 | * switch sources. | ||
39 | * | ||
40 | * Many some clocks say always_enabled, but they can be auto idled for | ||
41 | * power savings. They will always be available upon clock request. | ||
42 | * | ||
43 | * Several sources are given initial rates which may be wrong, this will | ||
44 | * be fixed up in the init func. | ||
45 | * | ||
46 | * Things are broadly separated below by clock domains. It is | ||
47 | * noteworthy that most periferals have dependencies on multiple clock | ||
48 | * domains. Many get their interface clocks from the L4 domain, but get | ||
49 | * functional clocks from fixed sources or other core domain derived | ||
50 | * clocks. | ||
51 | */ | ||
52 | |||
53 | /* Base external input clocks */ | ||
54 | static struct clk func_32k_ck = { | ||
55 | .name = "func_32k_ck", | ||
56 | .ops = &clkops_null, | ||
57 | .rate = 32000, | ||
58 | .clkdm_name = "wkup_clkdm", | ||
59 | }; | ||
60 | |||
61 | static struct clk secure_32k_ck = { | ||
62 | .name = "secure_32k_ck", | ||
63 | .ops = &clkops_null, | ||
64 | .rate = 32768, | ||
65 | .clkdm_name = "wkup_clkdm", | ||
66 | }; | ||
67 | |||
68 | /* Typical 12/13MHz in standalone mode, will be 26Mhz in chassis mode */ | ||
69 | static struct clk osc_ck = { /* (*12, *13, 19.2, *26, 38.4)MHz */ | ||
70 | .name = "osc_ck", | ||
71 | .ops = &clkops_oscck, | ||
72 | .clkdm_name = "wkup_clkdm", | ||
73 | .recalc = &omap2_osc_clk_recalc, | ||
74 | }; | ||
75 | |||
76 | /* Without modem likely 12MHz, with modem likely 13MHz */ | ||
77 | static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */ | ||
78 | .name = "sys_ck", /* ~ ref_clk also */ | ||
79 | .ops = &clkops_null, | ||
80 | .parent = &osc_ck, | ||
81 | .clkdm_name = "wkup_clkdm", | ||
82 | .recalc = &omap2xxx_sys_clk_recalc, | ||
83 | }; | ||
84 | |||
85 | static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ | ||
86 | .name = "alt_ck", | ||
87 | .ops = &clkops_null, | ||
88 | .rate = 54000000, | ||
89 | .clkdm_name = "wkup_clkdm", | ||
90 | }; | ||
91 | |||
92 | /* | ||
93 | * Analog domain root source clocks | ||
94 | */ | ||
95 | |||
96 | /* dpll_ck, is broken out in to special cases through clksel */ | ||
97 | /* REVISIT: Rate changes on dpll_ck trigger a full set change. ... | ||
98 | * deal with this | ||
99 | */ | ||
100 | |||
101 | static struct dpll_data dpll_dd = { | ||
102 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | ||
103 | .mult_mask = OMAP24XX_DPLL_MULT_MASK, | ||
104 | .div1_mask = OMAP24XX_DPLL_DIV_MASK, | ||
105 | .clk_bypass = &sys_ck, | ||
106 | .clk_ref = &sys_ck, | ||
107 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | ||
108 | .enable_mask = OMAP24XX_EN_DPLL_MASK, | ||
109 | .max_multiplier = 1023, | ||
110 | .min_divider = 1, | ||
111 | .max_divider = 16, | ||
112 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | ||
113 | }; | ||
114 | |||
115 | /* | ||
116 | * XXX Cannot add round_rate here yet, as this is still a composite clock, | ||
117 | * not just a DPLL | ||
118 | */ | ||
119 | static struct clk dpll_ck = { | ||
120 | .name = "dpll_ck", | ||
121 | .ops = &clkops_null, | ||
122 | .parent = &sys_ck, /* Can be func_32k also */ | ||
123 | .dpll_data = &dpll_dd, | ||
124 | .clkdm_name = "wkup_clkdm", | ||
125 | .recalc = &omap2_dpllcore_recalc, | ||
126 | .set_rate = &omap2_reprogram_dpllcore, | ||
127 | }; | ||
128 | |||
129 | static struct clk apll96_ck = { | ||
130 | .name = "apll96_ck", | ||
131 | .ops = &clkops_apll96, | ||
132 | .parent = &sys_ck, | ||
133 | .rate = 96000000, | ||
134 | .flags = ENABLE_ON_INIT, | ||
135 | .clkdm_name = "wkup_clkdm", | ||
136 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | ||
137 | .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, | ||
138 | }; | ||
139 | |||
140 | static struct clk apll54_ck = { | ||
141 | .name = "apll54_ck", | ||
142 | .ops = &clkops_apll54, | ||
143 | .parent = &sys_ck, | ||
144 | .rate = 54000000, | ||
145 | .flags = ENABLE_ON_INIT, | ||
146 | .clkdm_name = "wkup_clkdm", | ||
147 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | ||
148 | .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, | ||
149 | }; | ||
150 | |||
151 | /* | ||
152 | * PRCM digital base sources | ||
153 | */ | ||
154 | |||
155 | /* func_54m_ck */ | ||
156 | |||
157 | static const struct clksel_rate func_54m_apll54_rates[] = { | ||
158 | { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
159 | { .div = 0 }, | ||
160 | }; | ||
161 | |||
162 | static const struct clksel_rate func_54m_alt_rates[] = { | ||
163 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
164 | { .div = 0 }, | ||
165 | }; | ||
166 | |||
167 | static const struct clksel func_54m_clksel[] = { | ||
168 | { .parent = &apll54_ck, .rates = func_54m_apll54_rates, }, | ||
169 | { .parent = &alt_ck, .rates = func_54m_alt_rates, }, | ||
170 | { .parent = NULL }, | ||
171 | }; | ||
172 | |||
173 | static struct clk func_54m_ck = { | ||
174 | .name = "func_54m_ck", | ||
175 | .ops = &clkops_null, | ||
176 | .parent = &apll54_ck, /* can also be alt_clk */ | ||
177 | .clkdm_name = "wkup_clkdm", | ||
178 | .init = &omap2_init_clksel_parent, | ||
179 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | ||
180 | .clksel_mask = OMAP24XX_54M_SOURCE, | ||
181 | .clksel = func_54m_clksel, | ||
182 | .recalc = &omap2_clksel_recalc, | ||
183 | }; | ||
184 | |||
185 | static struct clk core_ck = { | ||
186 | .name = "core_ck", | ||
187 | .ops = &clkops_null, | ||
188 | .parent = &dpll_ck, /* can also be 32k */ | ||
189 | .clkdm_name = "wkup_clkdm", | ||
190 | .recalc = &followparent_recalc, | ||
191 | }; | ||
192 | |||
193 | static struct clk func_96m_ck = { | ||
194 | .name = "func_96m_ck", | ||
195 | .ops = &clkops_null, | ||
196 | .parent = &apll96_ck, | ||
197 | .clkdm_name = "wkup_clkdm", | ||
198 | .recalc = &followparent_recalc, | ||
199 | }; | ||
200 | |||
201 | /* func_48m_ck */ | ||
202 | |||
203 | static const struct clksel_rate func_48m_apll96_rates[] = { | ||
204 | { .div = 2, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
205 | { .div = 0 }, | ||
206 | }; | ||
207 | |||
208 | static const struct clksel_rate func_48m_alt_rates[] = { | ||
209 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
210 | { .div = 0 }, | ||
211 | }; | ||
212 | |||
213 | static const struct clksel func_48m_clksel[] = { | ||
214 | { .parent = &apll96_ck, .rates = func_48m_apll96_rates }, | ||
215 | { .parent = &alt_ck, .rates = func_48m_alt_rates }, | ||
216 | { .parent = NULL } | ||
217 | }; | ||
218 | |||
219 | static struct clk func_48m_ck = { | ||
220 | .name = "func_48m_ck", | ||
221 | .ops = &clkops_null, | ||
222 | .parent = &apll96_ck, /* 96M or Alt */ | ||
223 | .clkdm_name = "wkup_clkdm", | ||
224 | .init = &omap2_init_clksel_parent, | ||
225 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL1), | ||
226 | .clksel_mask = OMAP24XX_48M_SOURCE, | ||
227 | .clksel = func_48m_clksel, | ||
228 | .recalc = &omap2_clksel_recalc, | ||
229 | .round_rate = &omap2_clksel_round_rate, | ||
230 | .set_rate = &omap2_clksel_set_rate | ||
231 | }; | ||
232 | |||
233 | static struct clk func_12m_ck = { | ||
234 | .name = "func_12m_ck", | ||
235 | .ops = &clkops_null, | ||
236 | .parent = &func_48m_ck, | ||
237 | .fixed_div = 4, | ||
238 | .clkdm_name = "wkup_clkdm", | ||
239 | .recalc = &omap_fixed_divisor_recalc, | ||
240 | }; | ||
241 | |||
242 | /* Secure timer, only available in secure mode */ | ||
243 | static struct clk wdt1_osc_ck = { | ||
244 | .name = "ck_wdt1_osc", | ||
245 | .ops = &clkops_null, /* RMK: missing? */ | ||
246 | .parent = &osc_ck, | ||
247 | .recalc = &followparent_recalc, | ||
248 | }; | ||
249 | |||
250 | /* | ||
251 | * The common_clkout* clksel_rate structs are common to | ||
252 | * sys_clkout, sys_clkout_src, sys_clkout2, and sys_clkout2_src. | ||
253 | * sys_clkout2_* are 2420-only, so the | ||
254 | * clksel_rate flags fields are inaccurate for those clocks. This is | ||
255 | * harmless since access to those clocks are gated by the struct clk | ||
256 | * flags fields, which mark them as 2420-only. | ||
257 | */ | ||
258 | static const struct clksel_rate common_clkout_src_core_rates[] = { | ||
259 | { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
260 | { .div = 0 } | ||
261 | }; | ||
262 | |||
263 | static const struct clksel_rate common_clkout_src_sys_rates[] = { | ||
264 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
265 | { .div = 0 } | ||
266 | }; | ||
267 | |||
268 | static const struct clksel_rate common_clkout_src_96m_rates[] = { | ||
269 | { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
270 | { .div = 0 } | ||
271 | }; | ||
272 | |||
273 | static const struct clksel_rate common_clkout_src_54m_rates[] = { | ||
274 | { .div = 1, .val = 3, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
275 | { .div = 0 } | ||
276 | }; | ||
277 | |||
278 | static const struct clksel common_clkout_src_clksel[] = { | ||
279 | { .parent = &core_ck, .rates = common_clkout_src_core_rates }, | ||
280 | { .parent = &sys_ck, .rates = common_clkout_src_sys_rates }, | ||
281 | { .parent = &func_96m_ck, .rates = common_clkout_src_96m_rates }, | ||
282 | { .parent = &func_54m_ck, .rates = common_clkout_src_54m_rates }, | ||
283 | { .parent = NULL } | ||
284 | }; | ||
285 | |||
286 | static struct clk sys_clkout_src = { | ||
287 | .name = "sys_clkout_src", | ||
288 | .ops = &clkops_omap2_dflt, | ||
289 | .parent = &func_54m_ck, | ||
290 | .clkdm_name = "wkup_clkdm", | ||
291 | .enable_reg = OMAP2420_PRCM_CLKOUT_CTRL, | ||
292 | .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT, | ||
293 | .init = &omap2_init_clksel_parent, | ||
294 | .clksel_reg = OMAP2420_PRCM_CLKOUT_CTRL, | ||
295 | .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK, | ||
296 | .clksel = common_clkout_src_clksel, | ||
297 | .recalc = &omap2_clksel_recalc, | ||
298 | .round_rate = &omap2_clksel_round_rate, | ||
299 | .set_rate = &omap2_clksel_set_rate | ||
300 | }; | ||
301 | |||
302 | static const struct clksel_rate common_clkout_rates[] = { | ||
303 | { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
304 | { .div = 2, .val = 1, .flags = RATE_IN_24XX }, | ||
305 | { .div = 4, .val = 2, .flags = RATE_IN_24XX }, | ||
306 | { .div = 8, .val = 3, .flags = RATE_IN_24XX }, | ||
307 | { .div = 16, .val = 4, .flags = RATE_IN_24XX }, | ||
308 | { .div = 0 }, | ||
309 | }; | ||
310 | |||
311 | static const struct clksel sys_clkout_clksel[] = { | ||
312 | { .parent = &sys_clkout_src, .rates = common_clkout_rates }, | ||
313 | { .parent = NULL } | ||
314 | }; | ||
315 | |||
316 | static struct clk sys_clkout = { | ||
317 | .name = "sys_clkout", | ||
318 | .ops = &clkops_null, | ||
319 | .parent = &sys_clkout_src, | ||
320 | .clkdm_name = "wkup_clkdm", | ||
321 | .clksel_reg = OMAP2420_PRCM_CLKOUT_CTRL, | ||
322 | .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK, | ||
323 | .clksel = sys_clkout_clksel, | ||
324 | .recalc = &omap2_clksel_recalc, | ||
325 | .round_rate = &omap2_clksel_round_rate, | ||
326 | .set_rate = &omap2_clksel_set_rate | ||
327 | }; | ||
328 | |||
329 | /* In 2430, new in 2420 ES2 */ | ||
330 | static struct clk sys_clkout2_src = { | ||
331 | .name = "sys_clkout2_src", | ||
332 | .ops = &clkops_omap2_dflt, | ||
333 | .parent = &func_54m_ck, | ||
334 | .clkdm_name = "wkup_clkdm", | ||
335 | .enable_reg = OMAP2420_PRCM_CLKOUT_CTRL, | ||
336 | .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT, | ||
337 | .init = &omap2_init_clksel_parent, | ||
338 | .clksel_reg = OMAP2420_PRCM_CLKOUT_CTRL, | ||
339 | .clksel_mask = OMAP2420_CLKOUT2_SOURCE_MASK, | ||
340 | .clksel = common_clkout_src_clksel, | ||
341 | .recalc = &omap2_clksel_recalc, | ||
342 | .round_rate = &omap2_clksel_round_rate, | ||
343 | .set_rate = &omap2_clksel_set_rate | ||
344 | }; | ||
345 | |||
346 | static const struct clksel sys_clkout2_clksel[] = { | ||
347 | { .parent = &sys_clkout2_src, .rates = common_clkout_rates }, | ||
348 | { .parent = NULL } | ||
349 | }; | ||
350 | |||
351 | /* In 2430, new in 2420 ES2 */ | ||
352 | static struct clk sys_clkout2 = { | ||
353 | .name = "sys_clkout2", | ||
354 | .ops = &clkops_null, | ||
355 | .parent = &sys_clkout2_src, | ||
356 | .clkdm_name = "wkup_clkdm", | ||
357 | .clksel_reg = OMAP2420_PRCM_CLKOUT_CTRL, | ||
358 | .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK, | ||
359 | .clksel = sys_clkout2_clksel, | ||
360 | .recalc = &omap2_clksel_recalc, | ||
361 | .round_rate = &omap2_clksel_round_rate, | ||
362 | .set_rate = &omap2_clksel_set_rate | ||
363 | }; | ||
364 | |||
365 | static struct clk emul_ck = { | ||
366 | .name = "emul_ck", | ||
367 | .ops = &clkops_omap2_dflt, | ||
368 | .parent = &func_54m_ck, | ||
369 | .clkdm_name = "wkup_clkdm", | ||
370 | .enable_reg = OMAP2420_PRCM_CLKEMUL_CTRL, | ||
371 | .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, | ||
372 | .recalc = &followparent_recalc, | ||
373 | |||
374 | }; | ||
375 | |||
376 | /* | ||
377 | * MPU clock domain | ||
378 | * Clocks: | ||
379 | * MPU_FCLK, MPU_ICLK | ||
380 | * INT_M_FCLK, INT_M_I_CLK | ||
381 | * | ||
382 | * - Individual clocks are hardware managed. | ||
383 | * - Base divider comes from: CM_CLKSEL_MPU | ||
384 | * | ||
385 | */ | ||
386 | static const struct clksel_rate mpu_core_rates[] = { | ||
387 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
388 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
389 | { .div = 4, .val = 4, .flags = RATE_IN_242X }, | ||
390 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
391 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
392 | { .div = 0 }, | ||
393 | }; | ||
394 | |||
395 | static const struct clksel mpu_clksel[] = { | ||
396 | { .parent = &core_ck, .rates = mpu_core_rates }, | ||
397 | { .parent = NULL } | ||
398 | }; | ||
399 | |||
400 | static struct clk mpu_ck = { /* Control cpu */ | ||
401 | .name = "mpu_ck", | ||
402 | .ops = &clkops_null, | ||
403 | .parent = &core_ck, | ||
404 | .clkdm_name = "mpu_clkdm", | ||
405 | .init = &omap2_init_clksel_parent, | ||
406 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL), | ||
407 | .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK, | ||
408 | .clksel = mpu_clksel, | ||
409 | .recalc = &omap2_clksel_recalc, | ||
410 | }; | ||
411 | |||
412 | /* | ||
413 | * DSP (2420-UMA+IVA1) clock domain | ||
414 | * Clocks: | ||
415 | * 2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP | ||
416 | * | ||
417 | * Won't be too specific here. The core clock comes into this block | ||
418 | * it is divided then tee'ed. One branch goes directly to xyz enable | ||
419 | * controls. The other branch gets further divided by 2 then possibly | ||
420 | * routed into a synchronizer and out of clocks abc. | ||
421 | */ | ||
422 | static const struct clksel_rate dsp_fck_core_rates[] = { | ||
423 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
424 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
425 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, | ||
426 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, | ||
427 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
428 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
429 | { .div = 12, .val = 12, .flags = RATE_IN_242X }, | ||
430 | { .div = 0 }, | ||
431 | }; | ||
432 | |||
433 | static const struct clksel dsp_fck_clksel[] = { | ||
434 | { .parent = &core_ck, .rates = dsp_fck_core_rates }, | ||
435 | { .parent = NULL } | ||
436 | }; | ||
437 | |||
438 | static struct clk dsp_fck = { | ||
439 | .name = "dsp_fck", | ||
440 | .ops = &clkops_omap2_dflt_wait, | ||
441 | .parent = &core_ck, | ||
442 | .clkdm_name = "dsp_clkdm", | ||
443 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | ||
444 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, | ||
445 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
446 | .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK, | ||
447 | .clksel = dsp_fck_clksel, | ||
448 | .recalc = &omap2_clksel_recalc, | ||
449 | }; | ||
450 | |||
451 | /* DSP interface clock */ | ||
452 | static const struct clksel_rate dsp_irate_ick_rates[] = { | ||
453 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
454 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
455 | { .div = 0 }, | ||
456 | }; | ||
457 | |||
458 | static const struct clksel dsp_irate_ick_clksel[] = { | ||
459 | { .parent = &dsp_fck, .rates = dsp_irate_ick_rates }, | ||
460 | { .parent = NULL } | ||
461 | }; | ||
462 | |||
463 | /* This clock does not exist as such in the TRM. */ | ||
464 | static struct clk dsp_irate_ick = { | ||
465 | .name = "dsp_irate_ick", | ||
466 | .ops = &clkops_null, | ||
467 | .parent = &dsp_fck, | ||
468 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
469 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | ||
470 | .clksel = dsp_irate_ick_clksel, | ||
471 | .recalc = &omap2_clksel_recalc, | ||
472 | }; | ||
473 | |||
474 | /* 2420 only */ | ||
475 | static struct clk dsp_ick = { | ||
476 | .name = "dsp_ick", /* apparently ipi and isp */ | ||
477 | .ops = &clkops_omap2_dflt_wait, | ||
478 | .parent = &dsp_irate_ick, | ||
479 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), | ||
480 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ | ||
481 | }; | ||
482 | |||
483 | /* | ||
484 | * The IVA1 is an ARM7 core on the 2420 that has nothing to do with | ||
485 | * the C54x, but which is contained in the DSP powerdomain. Does not | ||
486 | * exist on later OMAPs. | ||
487 | */ | ||
488 | static struct clk iva1_ifck = { | ||
489 | .name = "iva1_ifck", | ||
490 | .ops = &clkops_omap2_dflt_wait, | ||
491 | .parent = &core_ck, | ||
492 | .clkdm_name = "iva1_clkdm", | ||
493 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | ||
494 | .enable_bit = OMAP2420_EN_IVA_COP_SHIFT, | ||
495 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
496 | .clksel_mask = OMAP2420_CLKSEL_IVA_MASK, | ||
497 | .clksel = dsp_fck_clksel, | ||
498 | .recalc = &omap2_clksel_recalc, | ||
499 | }; | ||
500 | |||
501 | /* IVA1 mpu/int/i/f clocks are /2 of parent */ | ||
502 | static struct clk iva1_mpu_int_ifck = { | ||
503 | .name = "iva1_mpu_int_ifck", | ||
504 | .ops = &clkops_omap2_dflt_wait, | ||
505 | .parent = &iva1_ifck, | ||
506 | .clkdm_name = "iva1_clkdm", | ||
507 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | ||
508 | .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, | ||
509 | .fixed_div = 2, | ||
510 | .recalc = &omap_fixed_divisor_recalc, | ||
511 | }; | ||
512 | |||
513 | /* | ||
514 | * L3 clock domain | ||
515 | * L3 clocks are used for both interface and functional clocks to | ||
516 | * multiple entities. Some of these clocks are completely managed | ||
517 | * by hardware, and some others allow software control. Hardware | ||
518 | * managed ones general are based on directly CLK_REQ signals and | ||
519 | * various auto idle settings. The functional spec sets many of these | ||
520 | * as 'tie-high' for their enables. | ||
521 | * | ||
522 | * I-CLOCKS: | ||
523 | * L3-Interconnect, SMS, GPMC, SDRC, OCM_RAM, OCM_ROM, SDMA | ||
524 | * CAM, HS-USB. | ||
525 | * F-CLOCK | ||
526 | * SSI. | ||
527 | * | ||
528 | * GPMC memories and SDRC have timing and clock sensitive registers which | ||
529 | * may very well need notification when the clock changes. Currently for low | ||
530 | * operating points, these are taken care of in sleep.S. | ||
531 | */ | ||
532 | static const struct clksel_rate core_l3_core_rates[] = { | ||
533 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
534 | { .div = 2, .val = 2, .flags = RATE_IN_242X }, | ||
535 | { .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
536 | { .div = 6, .val = 6, .flags = RATE_IN_24XX }, | ||
537 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
538 | { .div = 12, .val = 12, .flags = RATE_IN_242X }, | ||
539 | { .div = 16, .val = 16, .flags = RATE_IN_242X }, | ||
540 | { .div = 0 } | ||
541 | }; | ||
542 | |||
543 | static const struct clksel core_l3_clksel[] = { | ||
544 | { .parent = &core_ck, .rates = core_l3_core_rates }, | ||
545 | { .parent = NULL } | ||
546 | }; | ||
547 | |||
548 | static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */ | ||
549 | .name = "core_l3_ck", | ||
550 | .ops = &clkops_null, | ||
551 | .parent = &core_ck, | ||
552 | .clkdm_name = "core_l3_clkdm", | ||
553 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
554 | .clksel_mask = OMAP24XX_CLKSEL_L3_MASK, | ||
555 | .clksel = core_l3_clksel, | ||
556 | .recalc = &omap2_clksel_recalc, | ||
557 | }; | ||
558 | |||
559 | /* usb_l4_ick */ | ||
560 | static const struct clksel_rate usb_l4_ick_core_l3_rates[] = { | ||
561 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
562 | { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
563 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, | ||
564 | { .div = 0 } | ||
565 | }; | ||
566 | |||
567 | static const struct clksel usb_l4_ick_clksel[] = { | ||
568 | { .parent = &core_l3_ck, .rates = usb_l4_ick_core_l3_rates }, | ||
569 | { .parent = NULL }, | ||
570 | }; | ||
571 | |||
572 | /* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ | ||
573 | static struct clk usb_l4_ick = { /* FS-USB interface clock */ | ||
574 | .name = "usb_l4_ick", | ||
575 | .ops = &clkops_omap2_dflt_wait, | ||
576 | .parent = &core_l3_ck, | ||
577 | .clkdm_name = "core_l4_clkdm", | ||
578 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | ||
579 | .enable_bit = OMAP24XX_EN_USB_SHIFT, | ||
580 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
581 | .clksel_mask = OMAP24XX_CLKSEL_USB_MASK, | ||
582 | .clksel = usb_l4_ick_clksel, | ||
583 | .recalc = &omap2_clksel_recalc, | ||
584 | }; | ||
585 | |||
586 | /* | ||
587 | * L4 clock management domain | ||
588 | * | ||
589 | * This domain contains lots of interface clocks from the L4 interface, some | ||
590 | * functional clocks. Fixed APLL functional source clocks are managed in | ||
591 | * this domain. | ||
592 | */ | ||
593 | static const struct clksel_rate l4_core_l3_rates[] = { | ||
594 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
595 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
596 | { .div = 0 } | ||
597 | }; | ||
598 | |||
599 | static const struct clksel l4_clksel[] = { | ||
600 | { .parent = &core_l3_ck, .rates = l4_core_l3_rates }, | ||
601 | { .parent = NULL } | ||
602 | }; | ||
603 | |||
604 | static struct clk l4_ck = { /* used both as an ick and fck */ | ||
605 | .name = "l4_ck", | ||
606 | .ops = &clkops_null, | ||
607 | .parent = &core_l3_ck, | ||
608 | .clkdm_name = "core_l4_clkdm", | ||
609 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
610 | .clksel_mask = OMAP24XX_CLKSEL_L4_MASK, | ||
611 | .clksel = l4_clksel, | ||
612 | .recalc = &omap2_clksel_recalc, | ||
613 | }; | ||
614 | |||
615 | /* | ||
616 | * SSI is in L3 management domain, its direct parent is core not l3, | ||
617 | * many core power domain entities are grouped into the L3 clock | ||
618 | * domain. | ||
619 | * SSI_SSR_FCLK, SSI_SST_FCLK, SSI_L4_ICLK | ||
620 | * | ||
621 | * ssr = core/1/2/3/4/5, sst = 1/2 ssr. | ||
622 | */ | ||
623 | static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = { | ||
624 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
625 | { .div = 2, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
626 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, | ||
627 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, | ||
628 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
629 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
630 | { .div = 0 } | ||
631 | }; | ||
632 | |||
633 | static const struct clksel ssi_ssr_sst_fck_clksel[] = { | ||
634 | { .parent = &core_ck, .rates = ssi_ssr_sst_fck_core_rates }, | ||
635 | { .parent = NULL } | ||
636 | }; | ||
637 | |||
638 | static struct clk ssi_ssr_sst_fck = { | ||
639 | .name = "ssi_fck", | ||
640 | .ops = &clkops_omap2_dflt_wait, | ||
641 | .parent = &core_ck, | ||
642 | .clkdm_name = "core_l3_clkdm", | ||
643 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | ||
644 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, | ||
645 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
646 | .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK, | ||
647 | .clksel = ssi_ssr_sst_fck_clksel, | ||
648 | .recalc = &omap2_clksel_recalc, | ||
649 | }; | ||
650 | |||
651 | /* | ||
652 | * Presumably this is the same as SSI_ICLK. | ||
653 | * TRM contradicts itself on what clockdomain SSI_ICLK is in | ||
654 | */ | ||
655 | static struct clk ssi_l4_ick = { | ||
656 | .name = "ssi_l4_ick", | ||
657 | .ops = &clkops_omap2_dflt_wait, | ||
658 | .parent = &l4_ck, | ||
659 | .clkdm_name = "core_l4_clkdm", | ||
660 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | ||
661 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, | ||
662 | .recalc = &followparent_recalc, | ||
663 | }; | ||
664 | |||
665 | |||
666 | /* | ||
667 | * GFX clock domain | ||
668 | * Clocks: | ||
669 | * GFX_FCLK, GFX_ICLK | ||
670 | * GFX_CG1(2d), GFX_CG2(3d) | ||
671 | * | ||
672 | * GFX_FCLK runs from L3, and is divided by (1,2,3,4) | ||
673 | * The 2d and 3d clocks run at a hardware determined | ||
674 | * divided value of fclk. | ||
675 | * | ||
676 | */ | ||
677 | |||
678 | /* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */ | ||
679 | static const struct clksel gfx_fck_clksel[] = { | ||
680 | { .parent = &core_l3_ck, .rates = gfx_l3_rates }, | ||
681 | { .parent = NULL }, | ||
682 | }; | ||
683 | |||
684 | static struct clk gfx_3d_fck = { | ||
685 | .name = "gfx_3d_fck", | ||
686 | .ops = &clkops_omap2_dflt_wait, | ||
687 | .parent = &core_l3_ck, | ||
688 | .clkdm_name = "gfx_clkdm", | ||
689 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), | ||
690 | .enable_bit = OMAP24XX_EN_3D_SHIFT, | ||
691 | .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL), | ||
692 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, | ||
693 | .clksel = gfx_fck_clksel, | ||
694 | .recalc = &omap2_clksel_recalc, | ||
695 | .round_rate = &omap2_clksel_round_rate, | ||
696 | .set_rate = &omap2_clksel_set_rate | ||
697 | }; | ||
698 | |||
699 | static struct clk gfx_2d_fck = { | ||
700 | .name = "gfx_2d_fck", | ||
701 | .ops = &clkops_omap2_dflt_wait, | ||
702 | .parent = &core_l3_ck, | ||
703 | .clkdm_name = "gfx_clkdm", | ||
704 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_FCLKEN), | ||
705 | .enable_bit = OMAP24XX_EN_2D_SHIFT, | ||
706 | .clksel_reg = OMAP_CM_REGADDR(GFX_MOD, CM_CLKSEL), | ||
707 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, | ||
708 | .clksel = gfx_fck_clksel, | ||
709 | .recalc = &omap2_clksel_recalc, | ||
710 | }; | ||
711 | |||
712 | static struct clk gfx_ick = { | ||
713 | .name = "gfx_ick", /* From l3 */ | ||
714 | .ops = &clkops_omap2_dflt_wait, | ||
715 | .parent = &core_l3_ck, | ||
716 | .clkdm_name = "gfx_clkdm", | ||
717 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), | ||
718 | .enable_bit = OMAP_EN_GFX_SHIFT, | ||
719 | .recalc = &followparent_recalc, | ||
720 | }; | ||
721 | |||
722 | /* | ||
723 | * DSS clock domain | ||
724 | * CLOCKs: | ||
725 | * DSS_L4_ICLK, DSS_L3_ICLK, | ||
726 | * DSS_CLK1, DSS_CLK2, DSS_54MHz_CLK | ||
727 | * | ||
728 | * DSS is both initiator and target. | ||
729 | */ | ||
730 | /* XXX Add RATE_NOT_VALIDATED */ | ||
731 | |||
732 | static const struct clksel_rate dss1_fck_sys_rates[] = { | ||
733 | { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
734 | { .div = 0 } | ||
735 | }; | ||
736 | |||
737 | static const struct clksel_rate dss1_fck_core_rates[] = { | ||
738 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
739 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | ||
740 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, | ||
741 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, | ||
742 | { .div = 5, .val = 5, .flags = RATE_IN_24XX }, | ||
743 | { .div = 6, .val = 6, .flags = RATE_IN_24XX }, | ||
744 | { .div = 8, .val = 8, .flags = RATE_IN_24XX }, | ||
745 | { .div = 9, .val = 9, .flags = RATE_IN_24XX }, | ||
746 | { .div = 12, .val = 12, .flags = RATE_IN_24XX }, | ||
747 | { .div = 16, .val = 16, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
748 | { .div = 0 } | ||
749 | }; | ||
750 | |||
751 | static const struct clksel dss1_fck_clksel[] = { | ||
752 | { .parent = &sys_ck, .rates = dss1_fck_sys_rates }, | ||
753 | { .parent = &core_ck, .rates = dss1_fck_core_rates }, | ||
754 | { .parent = NULL }, | ||
755 | }; | ||
756 | |||
757 | static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ | ||
758 | .name = "dss_ick", | ||
759 | .ops = &clkops_omap2_dflt, | ||
760 | .parent = &l4_ck, /* really both l3 and l4 */ | ||
761 | .clkdm_name = "dss_clkdm", | ||
762 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
763 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
764 | .recalc = &followparent_recalc, | ||
765 | }; | ||
766 | |||
767 | static struct clk dss1_fck = { | ||
768 | .name = "dss1_fck", | ||
769 | .ops = &clkops_omap2_dflt, | ||
770 | .parent = &core_ck, /* Core or sys */ | ||
771 | .clkdm_name = "dss_clkdm", | ||
772 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
773 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, | ||
774 | .init = &omap2_init_clksel_parent, | ||
775 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
776 | .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK, | ||
777 | .clksel = dss1_fck_clksel, | ||
778 | .recalc = &omap2_clksel_recalc, | ||
779 | }; | ||
780 | |||
781 | static const struct clksel_rate dss2_fck_sys_rates[] = { | ||
782 | { .div = 1, .val = 0, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
783 | { .div = 0 } | ||
784 | }; | ||
785 | |||
786 | static const struct clksel_rate dss2_fck_48m_rates[] = { | ||
787 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
788 | { .div = 0 } | ||
789 | }; | ||
790 | |||
791 | static const struct clksel dss2_fck_clksel[] = { | ||
792 | { .parent = &sys_ck, .rates = dss2_fck_sys_rates }, | ||
793 | { .parent = &func_48m_ck, .rates = dss2_fck_48m_rates }, | ||
794 | { .parent = NULL } | ||
795 | }; | ||
796 | |||
797 | static struct clk dss2_fck = { /* Alt clk used in power management */ | ||
798 | .name = "dss2_fck", | ||
799 | .ops = &clkops_omap2_dflt, | ||
800 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ | ||
801 | .clkdm_name = "dss_clkdm", | ||
802 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
803 | .enable_bit = OMAP24XX_EN_DSS2_SHIFT, | ||
804 | .init = &omap2_init_clksel_parent, | ||
805 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
806 | .clksel_mask = OMAP24XX_CLKSEL_DSS2_MASK, | ||
807 | .clksel = dss2_fck_clksel, | ||
808 | .recalc = &followparent_recalc, | ||
809 | }; | ||
810 | |||
811 | static struct clk dss_54m_fck = { /* Alt clk used in power management */ | ||
812 | .name = "dss_54m_fck", /* 54m tv clk */ | ||
813 | .ops = &clkops_omap2_dflt_wait, | ||
814 | .parent = &func_54m_ck, | ||
815 | .clkdm_name = "dss_clkdm", | ||
816 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
817 | .enable_bit = OMAP24XX_EN_TV_SHIFT, | ||
818 | .recalc = &followparent_recalc, | ||
819 | }; | ||
820 | |||
821 | /* | ||
822 | * CORE power domain ICLK & FCLK defines. | ||
823 | * Many of the these can have more than one possible parent. Entries | ||
824 | * here will likely have an L4 interface parent, and may have multiple | ||
825 | * functional clock parents. | ||
826 | */ | ||
827 | static const struct clksel_rate gpt_alt_rates[] = { | ||
828 | { .div = 1, .val = 2, .flags = RATE_IN_24XX | DEFAULT_RATE }, | ||
829 | { .div = 0 } | ||
830 | }; | ||
831 | |||
832 | static const struct clksel omap24xx_gpt_clksel[] = { | ||
833 | { .parent = &func_32k_ck, .rates = gpt_32k_rates }, | ||
834 | { .parent = &sys_ck, .rates = gpt_sys_rates }, | ||
835 | { .parent = &alt_ck, .rates = gpt_alt_rates }, | ||
836 | { .parent = NULL }, | ||
837 | }; | ||
838 | |||
839 | static struct clk gpt1_ick = { | ||
840 | .name = "gpt1_ick", | ||
841 | .ops = &clkops_omap2_dflt_wait, | ||
842 | .parent = &l4_ck, | ||
843 | .clkdm_name = "core_l4_clkdm", | ||
844 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | ||
845 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | ||
846 | .recalc = &followparent_recalc, | ||
847 | }; | ||
848 | |||
849 | static struct clk gpt1_fck = { | ||
850 | .name = "gpt1_fck", | ||
851 | .ops = &clkops_omap2_dflt_wait, | ||
852 | .parent = &func_32k_ck, | ||
853 | .clkdm_name = "core_l4_clkdm", | ||
854 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | ||
855 | .enable_bit = OMAP24XX_EN_GPT1_SHIFT, | ||
856 | .init = &omap2_init_clksel_parent, | ||
857 | .clksel_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_CLKSEL1), | ||
858 | .clksel_mask = OMAP24XX_CLKSEL_GPT1_MASK, | ||
859 | .clksel = omap24xx_gpt_clksel, | ||
860 | .recalc = &omap2_clksel_recalc, | ||
861 | .round_rate = &omap2_clksel_round_rate, | ||
862 | .set_rate = &omap2_clksel_set_rate | ||
863 | }; | ||
864 | |||
865 | static struct clk gpt2_ick = { | ||
866 | .name = "gpt2_ick", | ||
867 | .ops = &clkops_omap2_dflt_wait, | ||
868 | .parent = &l4_ck, | ||
869 | .clkdm_name = "core_l4_clkdm", | ||
870 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
871 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, | ||
872 | .recalc = &followparent_recalc, | ||
873 | }; | ||
874 | |||
875 | static struct clk gpt2_fck = { | ||
876 | .name = "gpt2_fck", | ||
877 | .ops = &clkops_omap2_dflt_wait, | ||
878 | .parent = &func_32k_ck, | ||
879 | .clkdm_name = "core_l4_clkdm", | ||
880 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
881 | .enable_bit = OMAP24XX_EN_GPT2_SHIFT, | ||
882 | .init = &omap2_init_clksel_parent, | ||
883 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
884 | .clksel_mask = OMAP24XX_CLKSEL_GPT2_MASK, | ||
885 | .clksel = omap24xx_gpt_clksel, | ||
886 | .recalc = &omap2_clksel_recalc, | ||
887 | }; | ||
888 | |||
889 | static struct clk gpt3_ick = { | ||
890 | .name = "gpt3_ick", | ||
891 | .ops = &clkops_omap2_dflt_wait, | ||
892 | .parent = &l4_ck, | ||
893 | .clkdm_name = "core_l4_clkdm", | ||
894 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
895 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, | ||
896 | .recalc = &followparent_recalc, | ||
897 | }; | ||
898 | |||
899 | static struct clk gpt3_fck = { | ||
900 | .name = "gpt3_fck", | ||
901 | .ops = &clkops_omap2_dflt_wait, | ||
902 | .parent = &func_32k_ck, | ||
903 | .clkdm_name = "core_l4_clkdm", | ||
904 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
905 | .enable_bit = OMAP24XX_EN_GPT3_SHIFT, | ||
906 | .init = &omap2_init_clksel_parent, | ||
907 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
908 | .clksel_mask = OMAP24XX_CLKSEL_GPT3_MASK, | ||
909 | .clksel = omap24xx_gpt_clksel, | ||
910 | .recalc = &omap2_clksel_recalc, | ||
911 | }; | ||
912 | |||
913 | static struct clk gpt4_ick = { | ||
914 | .name = "gpt4_ick", | ||
915 | .ops = &clkops_omap2_dflt_wait, | ||
916 | .parent = &l4_ck, | ||
917 | .clkdm_name = "core_l4_clkdm", | ||
918 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
919 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, | ||
920 | .recalc = &followparent_recalc, | ||
921 | }; | ||
922 | |||
923 | static struct clk gpt4_fck = { | ||
924 | .name = "gpt4_fck", | ||
925 | .ops = &clkops_omap2_dflt_wait, | ||
926 | .parent = &func_32k_ck, | ||
927 | .clkdm_name = "core_l4_clkdm", | ||
928 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
929 | .enable_bit = OMAP24XX_EN_GPT4_SHIFT, | ||
930 | .init = &omap2_init_clksel_parent, | ||
931 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
932 | .clksel_mask = OMAP24XX_CLKSEL_GPT4_MASK, | ||
933 | .clksel = omap24xx_gpt_clksel, | ||
934 | .recalc = &omap2_clksel_recalc, | ||
935 | }; | ||
936 | |||
937 | static struct clk gpt5_ick = { | ||
938 | .name = "gpt5_ick", | ||
939 | .ops = &clkops_omap2_dflt_wait, | ||
940 | .parent = &l4_ck, | ||
941 | .clkdm_name = "core_l4_clkdm", | ||
942 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
943 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, | ||
944 | .recalc = &followparent_recalc, | ||
945 | }; | ||
946 | |||
947 | static struct clk gpt5_fck = { | ||
948 | .name = "gpt5_fck", | ||
949 | .ops = &clkops_omap2_dflt_wait, | ||
950 | .parent = &func_32k_ck, | ||
951 | .clkdm_name = "core_l4_clkdm", | ||
952 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
953 | .enable_bit = OMAP24XX_EN_GPT5_SHIFT, | ||
954 | .init = &omap2_init_clksel_parent, | ||
955 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
956 | .clksel_mask = OMAP24XX_CLKSEL_GPT5_MASK, | ||
957 | .clksel = omap24xx_gpt_clksel, | ||
958 | .recalc = &omap2_clksel_recalc, | ||
959 | }; | ||
960 | |||
961 | static struct clk gpt6_ick = { | ||
962 | .name = "gpt6_ick", | ||
963 | .ops = &clkops_omap2_dflt_wait, | ||
964 | .parent = &l4_ck, | ||
965 | .clkdm_name = "core_l4_clkdm", | ||
966 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
967 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, | ||
968 | .recalc = &followparent_recalc, | ||
969 | }; | ||
970 | |||
971 | static struct clk gpt6_fck = { | ||
972 | .name = "gpt6_fck", | ||
973 | .ops = &clkops_omap2_dflt_wait, | ||
974 | .parent = &func_32k_ck, | ||
975 | .clkdm_name = "core_l4_clkdm", | ||
976 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
977 | .enable_bit = OMAP24XX_EN_GPT6_SHIFT, | ||
978 | .init = &omap2_init_clksel_parent, | ||
979 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
980 | .clksel_mask = OMAP24XX_CLKSEL_GPT6_MASK, | ||
981 | .clksel = omap24xx_gpt_clksel, | ||
982 | .recalc = &omap2_clksel_recalc, | ||
983 | }; | ||
984 | |||
985 | static struct clk gpt7_ick = { | ||
986 | .name = "gpt7_ick", | ||
987 | .ops = &clkops_omap2_dflt_wait, | ||
988 | .parent = &l4_ck, | ||
989 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
990 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | ||
991 | .recalc = &followparent_recalc, | ||
992 | }; | ||
993 | |||
994 | static struct clk gpt7_fck = { | ||
995 | .name = "gpt7_fck", | ||
996 | .ops = &clkops_omap2_dflt_wait, | ||
997 | .parent = &func_32k_ck, | ||
998 | .clkdm_name = "core_l4_clkdm", | ||
999 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1000 | .enable_bit = OMAP24XX_EN_GPT7_SHIFT, | ||
1001 | .init = &omap2_init_clksel_parent, | ||
1002 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
1003 | .clksel_mask = OMAP24XX_CLKSEL_GPT7_MASK, | ||
1004 | .clksel = omap24xx_gpt_clksel, | ||
1005 | .recalc = &omap2_clksel_recalc, | ||
1006 | }; | ||
1007 | |||
1008 | static struct clk gpt8_ick = { | ||
1009 | .name = "gpt8_ick", | ||
1010 | .ops = &clkops_omap2_dflt_wait, | ||
1011 | .parent = &l4_ck, | ||
1012 | .clkdm_name = "core_l4_clkdm", | ||
1013 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1014 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, | ||
1015 | .recalc = &followparent_recalc, | ||
1016 | }; | ||
1017 | |||
1018 | static struct clk gpt8_fck = { | ||
1019 | .name = "gpt8_fck", | ||
1020 | .ops = &clkops_omap2_dflt_wait, | ||
1021 | .parent = &func_32k_ck, | ||
1022 | .clkdm_name = "core_l4_clkdm", | ||
1023 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1024 | .enable_bit = OMAP24XX_EN_GPT8_SHIFT, | ||
1025 | .init = &omap2_init_clksel_parent, | ||
1026 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
1027 | .clksel_mask = OMAP24XX_CLKSEL_GPT8_MASK, | ||
1028 | .clksel = omap24xx_gpt_clksel, | ||
1029 | .recalc = &omap2_clksel_recalc, | ||
1030 | }; | ||
1031 | |||
1032 | static struct clk gpt9_ick = { | ||
1033 | .name = "gpt9_ick", | ||
1034 | .ops = &clkops_omap2_dflt_wait, | ||
1035 | .parent = &l4_ck, | ||
1036 | .clkdm_name = "core_l4_clkdm", | ||
1037 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1038 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, | ||
1039 | .recalc = &followparent_recalc, | ||
1040 | }; | ||
1041 | |||
1042 | static struct clk gpt9_fck = { | ||
1043 | .name = "gpt9_fck", | ||
1044 | .ops = &clkops_omap2_dflt_wait, | ||
1045 | .parent = &func_32k_ck, | ||
1046 | .clkdm_name = "core_l4_clkdm", | ||
1047 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1048 | .enable_bit = OMAP24XX_EN_GPT9_SHIFT, | ||
1049 | .init = &omap2_init_clksel_parent, | ||
1050 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
1051 | .clksel_mask = OMAP24XX_CLKSEL_GPT9_MASK, | ||
1052 | .clksel = omap24xx_gpt_clksel, | ||
1053 | .recalc = &omap2_clksel_recalc, | ||
1054 | }; | ||
1055 | |||
1056 | static struct clk gpt10_ick = { | ||
1057 | .name = "gpt10_ick", | ||
1058 | .ops = &clkops_omap2_dflt_wait, | ||
1059 | .parent = &l4_ck, | ||
1060 | .clkdm_name = "core_l4_clkdm", | ||
1061 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1062 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, | ||
1063 | .recalc = &followparent_recalc, | ||
1064 | }; | ||
1065 | |||
1066 | static struct clk gpt10_fck = { | ||
1067 | .name = "gpt10_fck", | ||
1068 | .ops = &clkops_omap2_dflt_wait, | ||
1069 | .parent = &func_32k_ck, | ||
1070 | .clkdm_name = "core_l4_clkdm", | ||
1071 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1072 | .enable_bit = OMAP24XX_EN_GPT10_SHIFT, | ||
1073 | .init = &omap2_init_clksel_parent, | ||
1074 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
1075 | .clksel_mask = OMAP24XX_CLKSEL_GPT10_MASK, | ||
1076 | .clksel = omap24xx_gpt_clksel, | ||
1077 | .recalc = &omap2_clksel_recalc, | ||
1078 | }; | ||
1079 | |||
1080 | static struct clk gpt11_ick = { | ||
1081 | .name = "gpt11_ick", | ||
1082 | .ops = &clkops_omap2_dflt_wait, | ||
1083 | .parent = &l4_ck, | ||
1084 | .clkdm_name = "core_l4_clkdm", | ||
1085 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1086 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, | ||
1087 | .recalc = &followparent_recalc, | ||
1088 | }; | ||
1089 | |||
1090 | static struct clk gpt11_fck = { | ||
1091 | .name = "gpt11_fck", | ||
1092 | .ops = &clkops_omap2_dflt_wait, | ||
1093 | .parent = &func_32k_ck, | ||
1094 | .clkdm_name = "core_l4_clkdm", | ||
1095 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1096 | .enable_bit = OMAP24XX_EN_GPT11_SHIFT, | ||
1097 | .init = &omap2_init_clksel_parent, | ||
1098 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
1099 | .clksel_mask = OMAP24XX_CLKSEL_GPT11_MASK, | ||
1100 | .clksel = omap24xx_gpt_clksel, | ||
1101 | .recalc = &omap2_clksel_recalc, | ||
1102 | }; | ||
1103 | |||
1104 | static struct clk gpt12_ick = { | ||
1105 | .name = "gpt12_ick", | ||
1106 | .ops = &clkops_omap2_dflt_wait, | ||
1107 | .parent = &l4_ck, | ||
1108 | .clkdm_name = "core_l4_clkdm", | ||
1109 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1110 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, | ||
1111 | .recalc = &followparent_recalc, | ||
1112 | }; | ||
1113 | |||
1114 | static struct clk gpt12_fck = { | ||
1115 | .name = "gpt12_fck", | ||
1116 | .ops = &clkops_omap2_dflt_wait, | ||
1117 | .parent = &secure_32k_ck, | ||
1118 | .clkdm_name = "core_l4_clkdm", | ||
1119 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1120 | .enable_bit = OMAP24XX_EN_GPT12_SHIFT, | ||
1121 | .init = &omap2_init_clksel_parent, | ||
1122 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL2), | ||
1123 | .clksel_mask = OMAP24XX_CLKSEL_GPT12_MASK, | ||
1124 | .clksel = omap24xx_gpt_clksel, | ||
1125 | .recalc = &omap2_clksel_recalc, | ||
1126 | }; | ||
1127 | |||
1128 | static struct clk mcbsp1_ick = { | ||
1129 | .name = "mcbsp1_ick", | ||
1130 | .ops = &clkops_omap2_dflt_wait, | ||
1131 | .parent = &l4_ck, | ||
1132 | .clkdm_name = "core_l4_clkdm", | ||
1133 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1134 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, | ||
1135 | .recalc = &followparent_recalc, | ||
1136 | }; | ||
1137 | |||
1138 | static struct clk mcbsp1_fck = { | ||
1139 | .name = "mcbsp1_fck", | ||
1140 | .ops = &clkops_omap2_dflt_wait, | ||
1141 | .parent = &func_96m_ck, | ||
1142 | .clkdm_name = "core_l4_clkdm", | ||
1143 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1144 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, | ||
1145 | .recalc = &followparent_recalc, | ||
1146 | }; | ||
1147 | |||
1148 | static struct clk mcbsp2_ick = { | ||
1149 | .name = "mcbsp2_ick", | ||
1150 | .ops = &clkops_omap2_dflt_wait, | ||
1151 | .parent = &l4_ck, | ||
1152 | .clkdm_name = "core_l4_clkdm", | ||
1153 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1154 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, | ||
1155 | .recalc = &followparent_recalc, | ||
1156 | }; | ||
1157 | |||
1158 | static struct clk mcbsp2_fck = { | ||
1159 | .name = "mcbsp2_fck", | ||
1160 | .ops = &clkops_omap2_dflt_wait, | ||
1161 | .parent = &func_96m_ck, | ||
1162 | .clkdm_name = "core_l4_clkdm", | ||
1163 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1164 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, | ||
1165 | .recalc = &followparent_recalc, | ||
1166 | }; | ||
1167 | |||
1168 | static struct clk mcspi1_ick = { | ||
1169 | .name = "mcspi1_ick", | ||
1170 | .ops = &clkops_omap2_dflt_wait, | ||
1171 | .parent = &l4_ck, | ||
1172 | .clkdm_name = "core_l4_clkdm", | ||
1173 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1174 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, | ||
1175 | .recalc = &followparent_recalc, | ||
1176 | }; | ||
1177 | |||
1178 | static struct clk mcspi1_fck = { | ||
1179 | .name = "mcspi1_fck", | ||
1180 | .ops = &clkops_omap2_dflt_wait, | ||
1181 | .parent = &func_48m_ck, | ||
1182 | .clkdm_name = "core_l4_clkdm", | ||
1183 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1184 | .enable_bit = OMAP24XX_EN_MCSPI1_SHIFT, | ||
1185 | .recalc = &followparent_recalc, | ||
1186 | }; | ||
1187 | |||
1188 | static struct clk mcspi2_ick = { | ||
1189 | .name = "mcspi2_ick", | ||
1190 | .ops = &clkops_omap2_dflt_wait, | ||
1191 | .parent = &l4_ck, | ||
1192 | .clkdm_name = "core_l4_clkdm", | ||
1193 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1194 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, | ||
1195 | .recalc = &followparent_recalc, | ||
1196 | }; | ||
1197 | |||
1198 | static struct clk mcspi2_fck = { | ||
1199 | .name = "mcspi2_fck", | ||
1200 | .ops = &clkops_omap2_dflt_wait, | ||
1201 | .parent = &func_48m_ck, | ||
1202 | .clkdm_name = "core_l4_clkdm", | ||
1203 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1204 | .enable_bit = OMAP24XX_EN_MCSPI2_SHIFT, | ||
1205 | .recalc = &followparent_recalc, | ||
1206 | }; | ||
1207 | |||
1208 | static struct clk uart1_ick = { | ||
1209 | .name = "uart1_ick", | ||
1210 | .ops = &clkops_omap2_dflt_wait, | ||
1211 | .parent = &l4_ck, | ||
1212 | .clkdm_name = "core_l4_clkdm", | ||
1213 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1214 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, | ||
1215 | .recalc = &followparent_recalc, | ||
1216 | }; | ||
1217 | |||
1218 | static struct clk uart1_fck = { | ||
1219 | .name = "uart1_fck", | ||
1220 | .ops = &clkops_omap2_dflt_wait, | ||
1221 | .parent = &func_48m_ck, | ||
1222 | .clkdm_name = "core_l4_clkdm", | ||
1223 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1224 | .enable_bit = OMAP24XX_EN_UART1_SHIFT, | ||
1225 | .recalc = &followparent_recalc, | ||
1226 | }; | ||
1227 | |||
1228 | static struct clk uart2_ick = { | ||
1229 | .name = "uart2_ick", | ||
1230 | .ops = &clkops_omap2_dflt_wait, | ||
1231 | .parent = &l4_ck, | ||
1232 | .clkdm_name = "core_l4_clkdm", | ||
1233 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1234 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, | ||
1235 | .recalc = &followparent_recalc, | ||
1236 | }; | ||
1237 | |||
1238 | static struct clk uart2_fck = { | ||
1239 | .name = "uart2_fck", | ||
1240 | .ops = &clkops_omap2_dflt_wait, | ||
1241 | .parent = &func_48m_ck, | ||
1242 | .clkdm_name = "core_l4_clkdm", | ||
1243 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1244 | .enable_bit = OMAP24XX_EN_UART2_SHIFT, | ||
1245 | .recalc = &followparent_recalc, | ||
1246 | }; | ||
1247 | |||
1248 | static struct clk uart3_ick = { | ||
1249 | .name = "uart3_ick", | ||
1250 | .ops = &clkops_omap2_dflt_wait, | ||
1251 | .parent = &l4_ck, | ||
1252 | .clkdm_name = "core_l4_clkdm", | ||
1253 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | ||
1254 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, | ||
1255 | .recalc = &followparent_recalc, | ||
1256 | }; | ||
1257 | |||
1258 | static struct clk uart3_fck = { | ||
1259 | .name = "uart3_fck", | ||
1260 | .ops = &clkops_omap2_dflt_wait, | ||
1261 | .parent = &func_48m_ck, | ||
1262 | .clkdm_name = "core_l4_clkdm", | ||
1263 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | ||
1264 | .enable_bit = OMAP24XX_EN_UART3_SHIFT, | ||
1265 | .recalc = &followparent_recalc, | ||
1266 | }; | ||
1267 | |||
1268 | static struct clk gpios_ick = { | ||
1269 | .name = "gpios_ick", | ||
1270 | .ops = &clkops_omap2_dflt_wait, | ||
1271 | .parent = &l4_ck, | ||
1272 | .clkdm_name = "core_l4_clkdm", | ||
1273 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | ||
1274 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | ||
1275 | .recalc = &followparent_recalc, | ||
1276 | }; | ||
1277 | |||
1278 | static struct clk gpios_fck = { | ||
1279 | .name = "gpios_fck", | ||
1280 | .ops = &clkops_omap2_dflt_wait, | ||
1281 | .parent = &func_32k_ck, | ||
1282 | .clkdm_name = "wkup_clkdm", | ||
1283 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | ||
1284 | .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, | ||
1285 | .recalc = &followparent_recalc, | ||
1286 | }; | ||
1287 | |||
1288 | static struct clk mpu_wdt_ick = { | ||
1289 | .name = "mpu_wdt_ick", | ||
1290 | .ops = &clkops_omap2_dflt_wait, | ||
1291 | .parent = &l4_ck, | ||
1292 | .clkdm_name = "core_l4_clkdm", | ||
1293 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | ||
1294 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | ||
1295 | .recalc = &followparent_recalc, | ||
1296 | }; | ||
1297 | |||
1298 | static struct clk mpu_wdt_fck = { | ||
1299 | .name = "mpu_wdt_fck", | ||
1300 | .ops = &clkops_omap2_dflt_wait, | ||
1301 | .parent = &func_32k_ck, | ||
1302 | .clkdm_name = "wkup_clkdm", | ||
1303 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_FCLKEN), | ||
1304 | .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, | ||
1305 | .recalc = &followparent_recalc, | ||
1306 | }; | ||
1307 | |||
1308 | static struct clk sync_32k_ick = { | ||
1309 | .name = "sync_32k_ick", | ||
1310 | .ops = &clkops_omap2_dflt_wait, | ||
1311 | .parent = &l4_ck, | ||
1312 | .flags = ENABLE_ON_INIT, | ||
1313 | .clkdm_name = "core_l4_clkdm", | ||
1314 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | ||
1315 | .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, | ||
1316 | .recalc = &followparent_recalc, | ||
1317 | }; | ||
1318 | |||
1319 | static struct clk wdt1_ick = { | ||
1320 | .name = "wdt1_ick", | ||
1321 | .ops = &clkops_omap2_dflt_wait, | ||
1322 | .parent = &l4_ck, | ||
1323 | .clkdm_name = "core_l4_clkdm", | ||
1324 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | ||
1325 | .enable_bit = OMAP24XX_EN_WDT1_SHIFT, | ||
1326 | .recalc = &followparent_recalc, | ||
1327 | }; | ||
1328 | |||
1329 | static struct clk omapctrl_ick = { | ||
1330 | .name = "omapctrl_ick", | ||
1331 | .ops = &clkops_omap2_dflt_wait, | ||
1332 | .parent = &l4_ck, | ||
1333 | .flags = ENABLE_ON_INIT, | ||
1334 | .clkdm_name = "core_l4_clkdm", | ||
1335 | .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), | ||
1336 | .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, | ||
1337 | .recalc = &followparent_recalc, | ||
1338 | }; | ||
1339 | |||
1340 | static struct clk cam_ick = { | ||
1341 | .name = "cam_ick", | ||
1342 | .ops = &clkops_omap2_dflt, | ||
1343 | .parent = &l4_ck, | ||
1344 | .clkdm_name = "core_l4_clkdm", | ||
1345 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1346 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, | ||
1347 | .recalc = &followparent_recalc, | ||
1348 | }; | ||
1349 | |||
1350 | /* | ||
1351 | * cam_fck controls both CAM_MCLK and CAM_FCLK. It should probably be | ||
1352 | * split into two separate clocks, since the parent clocks are different | ||
1353 | * and the clockdomains are also different. | ||
1354 | */ | ||
1355 | static struct clk cam_fck = { | ||
1356 | .name = "cam_fck", | ||
1357 | .ops = &clkops_omap2_dflt, | ||
1358 | .parent = &func_96m_ck, | ||
1359 | .clkdm_name = "core_l3_clkdm", | ||
1360 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1361 | .enable_bit = OMAP24XX_EN_CAM_SHIFT, | ||
1362 | .recalc = &followparent_recalc, | ||
1363 | }; | ||
1364 | |||
1365 | static struct clk mailboxes_ick = { | ||
1366 | .name = "mailboxes_ick", | ||
1367 | .ops = &clkops_omap2_dflt_wait, | ||
1368 | .parent = &l4_ck, | ||
1369 | .clkdm_name = "core_l4_clkdm", | ||
1370 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1371 | .enable_bit = OMAP24XX_EN_MAILBOXES_SHIFT, | ||
1372 | .recalc = &followparent_recalc, | ||
1373 | }; | ||
1374 | |||
1375 | static struct clk wdt4_ick = { | ||
1376 | .name = "wdt4_ick", | ||
1377 | .ops = &clkops_omap2_dflt_wait, | ||
1378 | .parent = &l4_ck, | ||
1379 | .clkdm_name = "core_l4_clkdm", | ||
1380 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1381 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, | ||
1382 | .recalc = &followparent_recalc, | ||
1383 | }; | ||
1384 | |||
1385 | static struct clk wdt4_fck = { | ||
1386 | .name = "wdt4_fck", | ||
1387 | .ops = &clkops_omap2_dflt_wait, | ||
1388 | .parent = &func_32k_ck, | ||
1389 | .clkdm_name = "core_l4_clkdm", | ||
1390 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1391 | .enable_bit = OMAP24XX_EN_WDT4_SHIFT, | ||
1392 | .recalc = &followparent_recalc, | ||
1393 | }; | ||
1394 | |||
1395 | static struct clk wdt3_ick = { | ||
1396 | .name = "wdt3_ick", | ||
1397 | .ops = &clkops_omap2_dflt_wait, | ||
1398 | .parent = &l4_ck, | ||
1399 | .clkdm_name = "core_l4_clkdm", | ||
1400 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1401 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, | ||
1402 | .recalc = &followparent_recalc, | ||
1403 | }; | ||
1404 | |||
1405 | static struct clk wdt3_fck = { | ||
1406 | .name = "wdt3_fck", | ||
1407 | .ops = &clkops_omap2_dflt_wait, | ||
1408 | .parent = &func_32k_ck, | ||
1409 | .clkdm_name = "core_l4_clkdm", | ||
1410 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1411 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, | ||
1412 | .recalc = &followparent_recalc, | ||
1413 | }; | ||
1414 | |||
1415 | static struct clk mspro_ick = { | ||
1416 | .name = "mspro_ick", | ||
1417 | .ops = &clkops_omap2_dflt_wait, | ||
1418 | .parent = &l4_ck, | ||
1419 | .clkdm_name = "core_l4_clkdm", | ||
1420 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1421 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, | ||
1422 | .recalc = &followparent_recalc, | ||
1423 | }; | ||
1424 | |||
1425 | static struct clk mspro_fck = { | ||
1426 | .name = "mspro_fck", | ||
1427 | .ops = &clkops_omap2_dflt_wait, | ||
1428 | .parent = &func_96m_ck, | ||
1429 | .clkdm_name = "core_l4_clkdm", | ||
1430 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1431 | .enable_bit = OMAP24XX_EN_MSPRO_SHIFT, | ||
1432 | .recalc = &followparent_recalc, | ||
1433 | }; | ||
1434 | |||
1435 | static struct clk mmc_ick = { | ||
1436 | .name = "mmc_ick", | ||
1437 | .ops = &clkops_omap2_dflt_wait, | ||
1438 | .parent = &l4_ck, | ||
1439 | .clkdm_name = "core_l4_clkdm", | ||
1440 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1441 | .enable_bit = OMAP2420_EN_MMC_SHIFT, | ||
1442 | .recalc = &followparent_recalc, | ||
1443 | }; | ||
1444 | |||
1445 | static struct clk mmc_fck = { | ||
1446 | .name = "mmc_fck", | ||
1447 | .ops = &clkops_omap2_dflt_wait, | ||
1448 | .parent = &func_96m_ck, | ||
1449 | .clkdm_name = "core_l4_clkdm", | ||
1450 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1451 | .enable_bit = OMAP2420_EN_MMC_SHIFT, | ||
1452 | .recalc = &followparent_recalc, | ||
1453 | }; | ||
1454 | |||
1455 | static struct clk fac_ick = { | ||
1456 | .name = "fac_ick", | ||
1457 | .ops = &clkops_omap2_dflt_wait, | ||
1458 | .parent = &l4_ck, | ||
1459 | .clkdm_name = "core_l4_clkdm", | ||
1460 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1461 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, | ||
1462 | .recalc = &followparent_recalc, | ||
1463 | }; | ||
1464 | |||
1465 | static struct clk fac_fck = { | ||
1466 | .name = "fac_fck", | ||
1467 | .ops = &clkops_omap2_dflt_wait, | ||
1468 | .parent = &func_12m_ck, | ||
1469 | .clkdm_name = "core_l4_clkdm", | ||
1470 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1471 | .enable_bit = OMAP24XX_EN_FAC_SHIFT, | ||
1472 | .recalc = &followparent_recalc, | ||
1473 | }; | ||
1474 | |||
1475 | static struct clk eac_ick = { | ||
1476 | .name = "eac_ick", | ||
1477 | .ops = &clkops_omap2_dflt_wait, | ||
1478 | .parent = &l4_ck, | ||
1479 | .clkdm_name = "core_l4_clkdm", | ||
1480 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1481 | .enable_bit = OMAP2420_EN_EAC_SHIFT, | ||
1482 | .recalc = &followparent_recalc, | ||
1483 | }; | ||
1484 | |||
1485 | static struct clk eac_fck = { | ||
1486 | .name = "eac_fck", | ||
1487 | .ops = &clkops_omap2_dflt_wait, | ||
1488 | .parent = &func_96m_ck, | ||
1489 | .clkdm_name = "core_l4_clkdm", | ||
1490 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1491 | .enable_bit = OMAP2420_EN_EAC_SHIFT, | ||
1492 | .recalc = &followparent_recalc, | ||
1493 | }; | ||
1494 | |||
1495 | static struct clk hdq_ick = { | ||
1496 | .name = "hdq_ick", | ||
1497 | .ops = &clkops_omap2_dflt_wait, | ||
1498 | .parent = &l4_ck, | ||
1499 | .clkdm_name = "core_l4_clkdm", | ||
1500 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1501 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, | ||
1502 | .recalc = &followparent_recalc, | ||
1503 | }; | ||
1504 | |||
1505 | static struct clk hdq_fck = { | ||
1506 | .name = "hdq_fck", | ||
1507 | .ops = &clkops_omap2_dflt_wait, | ||
1508 | .parent = &func_12m_ck, | ||
1509 | .clkdm_name = "core_l4_clkdm", | ||
1510 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1511 | .enable_bit = OMAP24XX_EN_HDQ_SHIFT, | ||
1512 | .recalc = &followparent_recalc, | ||
1513 | }; | ||
1514 | |||
1515 | static struct clk i2c2_ick = { | ||
1516 | .name = "i2c2_ick", | ||
1517 | .ops = &clkops_omap2_dflt_wait, | ||
1518 | .parent = &l4_ck, | ||
1519 | .clkdm_name = "core_l4_clkdm", | ||
1520 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1521 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, | ||
1522 | .recalc = &followparent_recalc, | ||
1523 | }; | ||
1524 | |||
1525 | static struct clk i2c2_fck = { | ||
1526 | .name = "i2c2_fck", | ||
1527 | .ops = &clkops_omap2_dflt_wait, | ||
1528 | .parent = &func_12m_ck, | ||
1529 | .clkdm_name = "core_l4_clkdm", | ||
1530 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1531 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, | ||
1532 | .recalc = &followparent_recalc, | ||
1533 | }; | ||
1534 | |||
1535 | static struct clk i2c1_ick = { | ||
1536 | .name = "i2c1_ick", | ||
1537 | .ops = &clkops_omap2_dflt_wait, | ||
1538 | .parent = &l4_ck, | ||
1539 | .clkdm_name = "core_l4_clkdm", | ||
1540 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1541 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, | ||
1542 | .recalc = &followparent_recalc, | ||
1543 | }; | ||
1544 | |||
1545 | static struct clk i2c1_fck = { | ||
1546 | .name = "i2c1_fck", | ||
1547 | .ops = &clkops_omap2_dflt_wait, | ||
1548 | .parent = &func_12m_ck, | ||
1549 | .clkdm_name = "core_l4_clkdm", | ||
1550 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1551 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, | ||
1552 | .recalc = &followparent_recalc, | ||
1553 | }; | ||
1554 | |||
1555 | static struct clk gpmc_fck = { | ||
1556 | .name = "gpmc_fck", | ||
1557 | .ops = &clkops_null, /* RMK: missing? */ | ||
1558 | .parent = &core_l3_ck, | ||
1559 | .flags = ENABLE_ON_INIT, | ||
1560 | .clkdm_name = "core_l3_clkdm", | ||
1561 | .recalc = &followparent_recalc, | ||
1562 | }; | ||
1563 | |||
1564 | static struct clk sdma_fck = { | ||
1565 | .name = "sdma_fck", | ||
1566 | .ops = &clkops_null, /* RMK: missing? */ | ||
1567 | .parent = &core_l3_ck, | ||
1568 | .clkdm_name = "core_l3_clkdm", | ||
1569 | .recalc = &followparent_recalc, | ||
1570 | }; | ||
1571 | |||
1572 | static struct clk sdma_ick = { | ||
1573 | .name = "sdma_ick", | ||
1574 | .ops = &clkops_null, /* RMK: missing? */ | ||
1575 | .parent = &l4_ck, | ||
1576 | .clkdm_name = "core_l3_clkdm", | ||
1577 | .recalc = &followparent_recalc, | ||
1578 | }; | ||
1579 | |||
1580 | static struct clk vlynq_ick = { | ||
1581 | .name = "vlynq_ick", | ||
1582 | .ops = &clkops_omap2_dflt_wait, | ||
1583 | .parent = &core_l3_ck, | ||
1584 | .clkdm_name = "core_l3_clkdm", | ||
1585 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1586 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, | ||
1587 | .recalc = &followparent_recalc, | ||
1588 | }; | ||
1589 | |||
1590 | static const struct clksel_rate vlynq_fck_96m_rates[] = { | ||
1591 | { .div = 1, .val = 0, .flags = RATE_IN_242X | DEFAULT_RATE }, | ||
1592 | { .div = 0 } | ||
1593 | }; | ||
1594 | |||
1595 | static const struct clksel_rate vlynq_fck_core_rates[] = { | ||
1596 | { .div = 1, .val = 1, .flags = RATE_IN_242X }, | ||
1597 | { .div = 2, .val = 2, .flags = RATE_IN_242X }, | ||
1598 | { .div = 3, .val = 3, .flags = RATE_IN_242X }, | ||
1599 | { .div = 4, .val = 4, .flags = RATE_IN_242X }, | ||
1600 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
1601 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
1602 | { .div = 9, .val = 9, .flags = RATE_IN_242X }, | ||
1603 | { .div = 12, .val = 12, .flags = RATE_IN_242X }, | ||
1604 | { .div = 16, .val = 16, .flags = RATE_IN_242X | DEFAULT_RATE }, | ||
1605 | { .div = 18, .val = 18, .flags = RATE_IN_242X }, | ||
1606 | { .div = 0 } | ||
1607 | }; | ||
1608 | |||
1609 | static const struct clksel vlynq_fck_clksel[] = { | ||
1610 | { .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates }, | ||
1611 | { .parent = &core_ck, .rates = vlynq_fck_core_rates }, | ||
1612 | { .parent = NULL } | ||
1613 | }; | ||
1614 | |||
1615 | static struct clk vlynq_fck = { | ||
1616 | .name = "vlynq_fck", | ||
1617 | .ops = &clkops_omap2_dflt_wait, | ||
1618 | .parent = &func_96m_ck, | ||
1619 | .clkdm_name = "core_l3_clkdm", | ||
1620 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1621 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, | ||
1622 | .init = &omap2_init_clksel_parent, | ||
1623 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
1624 | .clksel_mask = OMAP2420_CLKSEL_VLYNQ_MASK, | ||
1625 | .clksel = vlynq_fck_clksel, | ||
1626 | .recalc = &omap2_clksel_recalc, | ||
1627 | }; | ||
1628 | |||
1629 | static struct clk des_ick = { | ||
1630 | .name = "des_ick", | ||
1631 | .ops = &clkops_omap2_dflt_wait, | ||
1632 | .parent = &l4_ck, | ||
1633 | .clkdm_name = "core_l4_clkdm", | ||
1634 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | ||
1635 | .enable_bit = OMAP24XX_EN_DES_SHIFT, | ||
1636 | .recalc = &followparent_recalc, | ||
1637 | }; | ||
1638 | |||
1639 | static struct clk sha_ick = { | ||
1640 | .name = "sha_ick", | ||
1641 | .ops = &clkops_omap2_dflt_wait, | ||
1642 | .parent = &l4_ck, | ||
1643 | .clkdm_name = "core_l4_clkdm", | ||
1644 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | ||
1645 | .enable_bit = OMAP24XX_EN_SHA_SHIFT, | ||
1646 | .recalc = &followparent_recalc, | ||
1647 | }; | ||
1648 | |||
1649 | static struct clk rng_ick = { | ||
1650 | .name = "rng_ick", | ||
1651 | .ops = &clkops_omap2_dflt_wait, | ||
1652 | .parent = &l4_ck, | ||
1653 | .clkdm_name = "core_l4_clkdm", | ||
1654 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | ||
1655 | .enable_bit = OMAP24XX_EN_RNG_SHIFT, | ||
1656 | .recalc = &followparent_recalc, | ||
1657 | }; | ||
1658 | |||
1659 | static struct clk aes_ick = { | ||
1660 | .name = "aes_ick", | ||
1661 | .ops = &clkops_omap2_dflt_wait, | ||
1662 | .parent = &l4_ck, | ||
1663 | .clkdm_name = "core_l4_clkdm", | ||
1664 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | ||
1665 | .enable_bit = OMAP24XX_EN_AES_SHIFT, | ||
1666 | .recalc = &followparent_recalc, | ||
1667 | }; | ||
1668 | |||
1669 | static struct clk pka_ick = { | ||
1670 | .name = "pka_ick", | ||
1671 | .ops = &clkops_omap2_dflt_wait, | ||
1672 | .parent = &l4_ck, | ||
1673 | .clkdm_name = "core_l4_clkdm", | ||
1674 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), | ||
1675 | .enable_bit = OMAP24XX_EN_PKA_SHIFT, | ||
1676 | .recalc = &followparent_recalc, | ||
1677 | }; | ||
1678 | |||
1679 | static struct clk usb_fck = { | ||
1680 | .name = "usb_fck", | ||
1681 | .ops = &clkops_omap2_dflt_wait, | ||
1682 | .parent = &func_48m_ck, | ||
1683 | .clkdm_name = "core_l3_clkdm", | ||
1684 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | ||
1685 | .enable_bit = OMAP24XX_EN_USB_SHIFT, | ||
1686 | .recalc = &followparent_recalc, | ||
1687 | }; | ||
1688 | |||
1689 | /* | ||
1690 | * This clock is a composite clock which does entire set changes then | ||
1691 | * forces a rebalance. It keys on the MPU speed, but it really could | ||
1692 | * be any key speed part of a set in the rate table. | ||
1693 | * | ||
1694 | * to really change a set, you need memory table sets which get changed | ||
1695 | * in sram, pre-notifiers & post notifiers, changing the top set, without | ||
1696 | * having low level display recalc's won't work... this is why dpm notifiers | ||
1697 | * work, isr's off, walk a list of clocks already _off_ and not messing with | ||
1698 | * the bus. | ||
1699 | * | ||
1700 | * This clock should have no parent. It embodies the entire upper level | ||
1701 | * active set. A parent will mess up some of the init also. | ||
1702 | */ | ||
1703 | static struct clk virt_prcm_set = { | ||
1704 | .name = "virt_prcm_set", | ||
1705 | .ops = &clkops_null, | ||
1706 | .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ | ||
1707 | .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */ | ||
1708 | .set_rate = &omap2_select_table_rate, | ||
1709 | .round_rate = &omap2_round_to_table_rate, | ||
1710 | }; | ||
1711 | |||
1712 | |||
1713 | /* | ||
1714 | * clkdev integration | ||
1715 | */ | ||
1716 | |||
1717 | static struct omap_clk omap2420_clks[] = { | ||
1718 | /* external root sources */ | ||
1719 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_242X), | ||
1720 | CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_242X), | ||
1721 | CLK(NULL, "osc_ck", &osc_ck, CK_242X), | ||
1722 | CLK(NULL, "sys_ck", &sys_ck, CK_242X), | ||
1723 | CLK(NULL, "alt_ck", &alt_ck, CK_242X), | ||
1724 | /* internal analog sources */ | ||
1725 | CLK(NULL, "dpll_ck", &dpll_ck, CK_242X), | ||
1726 | CLK(NULL, "apll96_ck", &apll96_ck, CK_242X), | ||
1727 | CLK(NULL, "apll54_ck", &apll54_ck, CK_242X), | ||
1728 | /* internal prcm root sources */ | ||
1729 | CLK(NULL, "func_54m_ck", &func_54m_ck, CK_242X), | ||
1730 | CLK(NULL, "core_ck", &core_ck, CK_242X), | ||
1731 | CLK(NULL, "func_96m_ck", &func_96m_ck, CK_242X), | ||
1732 | CLK(NULL, "func_48m_ck", &func_48m_ck, CK_242X), | ||
1733 | CLK(NULL, "func_12m_ck", &func_12m_ck, CK_242X), | ||
1734 | CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_242X), | ||
1735 | CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_242X), | ||
1736 | CLK(NULL, "sys_clkout", &sys_clkout, CK_242X), | ||
1737 | CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X), | ||
1738 | CLK(NULL, "sys_clkout2", &sys_clkout2, CK_242X), | ||
1739 | CLK(NULL, "emul_ck", &emul_ck, CK_242X), | ||
1740 | /* mpu domain clocks */ | ||
1741 | CLK(NULL, "mpu_ck", &mpu_ck, CK_242X), | ||
1742 | /* dsp domain clocks */ | ||
1743 | CLK(NULL, "dsp_fck", &dsp_fck, CK_242X), | ||
1744 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_242X), | ||
1745 | CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), | ||
1746 | CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), | ||
1747 | CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), | ||
1748 | /* GFX domain clocks */ | ||
1749 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_242X), | ||
1750 | CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_242X), | ||
1751 | CLK(NULL, "gfx_ick", &gfx_ick, CK_242X), | ||
1752 | /* DSS domain clocks */ | ||
1753 | CLK("omapdss", "ick", &dss_ick, CK_242X), | ||
1754 | CLK("omapdss", "dss1_fck", &dss1_fck, CK_242X), | ||
1755 | CLK("omapdss", "dss2_fck", &dss2_fck, CK_242X), | ||
1756 | CLK("omapdss", "tv_fck", &dss_54m_fck, CK_242X), | ||
1757 | /* L3 domain clocks */ | ||
1758 | CLK(NULL, "core_l3_ck", &core_l3_ck, CK_242X), | ||
1759 | CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_242X), | ||
1760 | CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_242X), | ||
1761 | /* L4 domain clocks */ | ||
1762 | CLK(NULL, "l4_ck", &l4_ck, CK_242X), | ||
1763 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), | ||
1764 | /* virtual meta-group clock */ | ||
1765 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), | ||
1766 | /* general l4 interface ck, multi-parent functional clk */ | ||
1767 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_242X), | ||
1768 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_242X), | ||
1769 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_242X), | ||
1770 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_242X), | ||
1771 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_242X), | ||
1772 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_242X), | ||
1773 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_242X), | ||
1774 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_242X), | ||
1775 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_242X), | ||
1776 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_242X), | ||
1777 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_242X), | ||
1778 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_242X), | ||
1779 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_242X), | ||
1780 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_242X), | ||
1781 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_242X), | ||
1782 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_242X), | ||
1783 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_242X), | ||
1784 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_242X), | ||
1785 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_242X), | ||
1786 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_242X), | ||
1787 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_242X), | ||
1788 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_242X), | ||
1789 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_242X), | ||
1790 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_242X), | ||
1791 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_242X), | ||
1792 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_242X), | ||
1793 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_242X), | ||
1794 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_242X), | ||
1795 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_242X), | ||
1796 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_242X), | ||
1797 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_242X), | ||
1798 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_242X), | ||
1799 | CLK(NULL, "uart1_ick", &uart1_ick, CK_242X), | ||
1800 | CLK(NULL, "uart1_fck", &uart1_fck, CK_242X), | ||
1801 | CLK(NULL, "uart2_ick", &uart2_ick, CK_242X), | ||
1802 | CLK(NULL, "uart2_fck", &uart2_fck, CK_242X), | ||
1803 | CLK(NULL, "uart3_ick", &uart3_ick, CK_242X), | ||
1804 | CLK(NULL, "uart3_fck", &uart3_fck, CK_242X), | ||
1805 | CLK(NULL, "gpios_ick", &gpios_ick, CK_242X), | ||
1806 | CLK(NULL, "gpios_fck", &gpios_fck, CK_242X), | ||
1807 | CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_242X), | ||
1808 | CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_242X), | ||
1809 | CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_242X), | ||
1810 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_242X), | ||
1811 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_242X), | ||
1812 | CLK("omap24xxcam", "fck", &cam_fck, CK_242X), | ||
1813 | CLK("omap24xxcam", "ick", &cam_ick, CK_242X), | ||
1814 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_242X), | ||
1815 | CLK(NULL, "wdt4_ick", &wdt4_ick, CK_242X), | ||
1816 | CLK(NULL, "wdt4_fck", &wdt4_fck, CK_242X), | ||
1817 | CLK(NULL, "wdt3_ick", &wdt3_ick, CK_242X), | ||
1818 | CLK(NULL, "wdt3_fck", &wdt3_fck, CK_242X), | ||
1819 | CLK(NULL, "mspro_ick", &mspro_ick, CK_242X), | ||
1820 | CLK(NULL, "mspro_fck", &mspro_fck, CK_242X), | ||
1821 | CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X), | ||
1822 | CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X), | ||
1823 | CLK(NULL, "fac_ick", &fac_ick, CK_242X), | ||
1824 | CLK(NULL, "fac_fck", &fac_fck, CK_242X), | ||
1825 | CLK(NULL, "eac_ick", &eac_ick, CK_242X), | ||
1826 | CLK(NULL, "eac_fck", &eac_fck, CK_242X), | ||
1827 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_242X), | ||
1828 | CLK("omap_hdq.1", "fck", &hdq_fck, CK_242X), | ||
1829 | CLK("i2c_omap.1", "ick", &i2c1_ick, CK_242X), | ||
1830 | CLK("i2c_omap.1", "fck", &i2c1_fck, CK_242X), | ||
1831 | CLK("i2c_omap.2", "ick", &i2c2_ick, CK_242X), | ||
1832 | CLK("i2c_omap.2", "fck", &i2c2_fck, CK_242X), | ||
1833 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), | ||
1834 | CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), | ||
1835 | CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), | ||
1836 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), | ||
1837 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), | ||
1838 | CLK(NULL, "des_ick", &des_ick, CK_242X), | ||
1839 | CLK(NULL, "sha_ick", &sha_ick, CK_242X), | ||
1840 | CLK("omap_rng", "ick", &rng_ick, CK_242X), | ||
1841 | CLK(NULL, "aes_ick", &aes_ick, CK_242X), | ||
1842 | CLK(NULL, "pka_ick", &pka_ick, CK_242X), | ||
1843 | CLK(NULL, "usb_fck", &usb_fck, CK_242X), | ||
1844 | }; | ||
1845 | |||
1846 | /* | ||
1847 | * init code | ||
1848 | */ | ||
1849 | |||
1850 | int __init omap2420_clk_init(void) | ||
1851 | { | ||
1852 | const struct prcm_config *prcm; | ||
1853 | struct omap_clk *c; | ||
1854 | u32 clkrate; | ||
1855 | |||
1856 | prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL; | ||
1857 | cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST); | ||
1858 | cpu_mask = RATE_IN_242X; | ||
1859 | rate_table = omap2420_rate_table; | ||
1860 | |||
1861 | clk_init(&omap2_clk_functions); | ||
1862 | |||
1863 | for (c = omap2420_clks; c < omap2420_clks + ARRAY_SIZE(omap2420_clks); | ||
1864 | c++) | ||
1865 | clk_preinit(c->lk.clk); | ||
1866 | |||
1867 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); | ||
1868 | propagate_rate(&osc_ck); | ||
1869 | sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck); | ||
1870 | propagate_rate(&sys_ck); | ||
1871 | |||
1872 | for (c = omap2420_clks; c < omap2420_clks + ARRAY_SIZE(omap2420_clks); | ||
1873 | c++) { | ||
1874 | clkdev_add(&c->lk); | ||
1875 | clk_register(c->lk.clk); | ||
1876 | omap2_init_clk_clkdm(c->lk.clk); | ||
1877 | } | ||
1878 | |||
1879 | /* Check the MPU rate set by bootloader */ | ||
1880 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); | ||
1881 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
1882 | if (!(prcm->flags & cpu_mask)) | ||
1883 | continue; | ||
1884 | if (prcm->xtal_speed != sys_ck.rate) | ||
1885 | continue; | ||
1886 | if (prcm->dpll_speed <= clkrate) | ||
1887 | break; | ||
1888 | } | ||
1889 | curr_prcm_set = prcm; | ||
1890 | |||
1891 | recalculate_root_clocks(); | ||
1892 | |||
1893 | pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n", | ||
1894 | (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10, | ||
1895 | (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ; | ||
1896 | |||
1897 | /* | ||
1898 | * Only enable those clocks we will need, let the drivers | ||
1899 | * enable other clocks as necessary | ||
1900 | */ | ||
1901 | clk_enable_init_clocks(); | ||
1902 | |||
1903 | /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ | ||
1904 | vclk = clk_get(NULL, "virt_prcm_set"); | ||
1905 | sclk = clk_get(NULL, "sys_ck"); | ||
1906 | dclk = clk_get(NULL, "dpll_ck"); | ||
1907 | |||
1908 | return 0; | ||
1909 | } | ||
1910 | |||
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c new file mode 100644 index 000000000000..44d0cccc51a9 --- /dev/null +++ b/arch/arm/mach-omap2/clock2430.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * clock2430.c - OMAP2430-specific clock integration code | ||
3 | * | ||
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2004-2010 Nokia Corporation | ||
6 | * | ||
7 | * Contacts: | ||
8 | * Richard Woodruff <r-woodruff2@ti.com> | ||
9 | * Paul Walmsley | ||
10 | * | ||
11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, | ||
12 | * Gordon McNutt and RidgeRun, Inc. | ||
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 | #undef DEBUG | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <plat/clock.h> | ||
25 | |||
26 | #include "clock.h" | ||
27 | #include "clock2xxx.h" | ||
28 | #include "cm.h" | ||
29 | #include "cm-regbits-24xx.h" | ||
30 | |||
31 | /** | ||
32 | * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS | ||
33 | * @clk: struct clk * being enabled | ||
34 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | ||
35 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | ||
36 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
37 | * | ||
38 | * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the | ||
39 | * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function | ||
40 | * passes back the correct CM_IDLEST register address for I2CHS | ||
41 | * modules. No return value. | ||
42 | */ | ||
43 | static void omap2430_clk_i2chs_find_idlest(struct clk *clk, | ||
44 | void __iomem **idlest_reg, | ||
45 | u8 *idlest_bit, | ||
46 | u8 *idlest_val) | ||
47 | { | ||
48 | *idlest_reg = OMAP2430_CM_REGADDR(CORE_MOD, CM_IDLEST); | ||
49 | *idlest_bit = clk->enable_bit; | ||
50 | *idlest_val = OMAP24XX_CM_IDLEST_VAL; | ||
51 | } | ||
52 | |||
53 | /* 2430 I2CHS has non-standard IDLEST register */ | ||
54 | const struct clkops clkops_omap2430_i2chs_wait = { | ||
55 | .enable = omap2_dflt_clk_enable, | ||
56 | .disable = omap2_dflt_clk_disable, | ||
57 | .find_idlest = omap2430_clk_i2chs_find_idlest, | ||
58 | .find_companion = omap2_clk_dflt_find_companion, | ||
59 | }; | ||
diff --git a/arch/arm/mach-omap2/clock2xxx_data.c b/arch/arm/mach-omap2/clock2430_data.c index 97dc7cf7751d..0438b6e4f51a 100644 --- a/arch/arm/mach-omap2/clock2xxx_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-omap2/clock2xxx_data.c | 2 | * linux/arch/arm/mach-omap2/clock2430_data.c |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2009 Nokia Corporation | 5 | * Copyright (C) 2004-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Contacts: | 7 | * Contacts: |
8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
@@ -13,9 +13,9 @@ | |||
13 | * published by the Free Software Foundation. | 13 | * published by the Free Software Foundation. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
18 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/list.h> | ||
19 | 19 | ||
20 | #include <plat/clkdev_omap.h> | 20 | #include <plat/clkdev_omap.h> |
21 | 21 | ||
@@ -28,8 +28,10 @@ | |||
28 | #include "cm-regbits-24xx.h" | 28 | #include "cm-regbits-24xx.h" |
29 | #include "sdrc.h" | 29 | #include "sdrc.h" |
30 | 30 | ||
31 | /*------------------------------------------------------------------------- | 31 | #define OMAP_CM_REGADDR OMAP2430_CM_REGADDR |
32 | * 24xx clock tree. | 32 | |
33 | /* | ||
34 | * 2430 clock tree. | ||
33 | * | 35 | * |
34 | * NOTE:In many cases here we are assigning a 'default' parent. In many | 36 | * NOTE:In many cases here we are assigning a 'default' parent. In many |
35 | * cases the parent is selectable. The get/set parent calls will also | 37 | * cases the parent is selectable. The get/set parent calls will also |
@@ -46,14 +48,13 @@ | |||
46 | * domains. Many get their interface clocks from the L4 domain, but get | 48 | * domains. Many get their interface clocks from the L4 domain, but get |
47 | * functional clocks from fixed sources or other core domain derived | 49 | * functional clocks from fixed sources or other core domain derived |
48 | * clocks. | 50 | * clocks. |
49 | *-------------------------------------------------------------------------*/ | 51 | */ |
50 | 52 | ||
51 | /* Base external input clocks */ | 53 | /* Base external input clocks */ |
52 | static struct clk func_32k_ck = { | 54 | static struct clk func_32k_ck = { |
53 | .name = "func_32k_ck", | 55 | .name = "func_32k_ck", |
54 | .ops = &clkops_null, | 56 | .ops = &clkops_null, |
55 | .rate = 32000, | 57 | .rate = 32000, |
56 | .flags = RATE_FIXED, | ||
57 | .clkdm_name = "wkup_clkdm", | 58 | .clkdm_name = "wkup_clkdm", |
58 | }; | 59 | }; |
59 | 60 | ||
@@ -61,7 +62,6 @@ static struct clk secure_32k_ck = { | |||
61 | .name = "secure_32k_ck", | 62 | .name = "secure_32k_ck", |
62 | .ops = &clkops_null, | 63 | .ops = &clkops_null, |
63 | .rate = 32768, | 64 | .rate = 32768, |
64 | .flags = RATE_FIXED, | ||
65 | .clkdm_name = "wkup_clkdm", | 65 | .clkdm_name = "wkup_clkdm", |
66 | }; | 66 | }; |
67 | 67 | ||
@@ -79,14 +79,13 @@ static struct clk sys_ck = { /* (*12, *13, 19.2, 26, 38.4)MHz */ | |||
79 | .ops = &clkops_null, | 79 | .ops = &clkops_null, |
80 | .parent = &osc_ck, | 80 | .parent = &osc_ck, |
81 | .clkdm_name = "wkup_clkdm", | 81 | .clkdm_name = "wkup_clkdm", |
82 | .recalc = &omap2_sys_clk_recalc, | 82 | .recalc = &omap2xxx_sys_clk_recalc, |
83 | }; | 83 | }; |
84 | 84 | ||
85 | static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ | 85 | static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ |
86 | .name = "alt_ck", | 86 | .name = "alt_ck", |
87 | .ops = &clkops_null, | 87 | .ops = &clkops_null, |
88 | .rate = 54000000, | 88 | .rate = 54000000, |
89 | .flags = RATE_FIXED, | ||
90 | .clkdm_name = "wkup_clkdm", | 89 | .clkdm_name = "wkup_clkdm", |
91 | }; | 90 | }; |
92 | 91 | ||
@@ -107,7 +106,7 @@ static struct dpll_data dpll_dd = { | |||
107 | .clk_ref = &sys_ck, | 106 | .clk_ref = &sys_ck, |
108 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 107 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
109 | .enable_mask = OMAP24XX_EN_DPLL_MASK, | 108 | .enable_mask = OMAP24XX_EN_DPLL_MASK, |
110 | .max_multiplier = 1024, | 109 | .max_multiplier = 1023, |
111 | .min_divider = 1, | 110 | .min_divider = 1, |
112 | .max_divider = 16, | 111 | .max_divider = 16, |
113 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 112 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
@@ -132,7 +131,7 @@ static struct clk apll96_ck = { | |||
132 | .ops = &clkops_apll96, | 131 | .ops = &clkops_apll96, |
133 | .parent = &sys_ck, | 132 | .parent = &sys_ck, |
134 | .rate = 96000000, | 133 | .rate = 96000000, |
135 | .flags = RATE_FIXED | ENABLE_ON_INIT, | 134 | .flags = ENABLE_ON_INIT, |
136 | .clkdm_name = "wkup_clkdm", | 135 | .clkdm_name = "wkup_clkdm", |
137 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 136 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
138 | .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, | 137 | .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, |
@@ -143,7 +142,7 @@ static struct clk apll54_ck = { | |||
143 | .ops = &clkops_apll54, | 142 | .ops = &clkops_apll54, |
144 | .parent = &sys_ck, | 143 | .parent = &sys_ck, |
145 | .rate = 54000000, | 144 | .rate = 54000000, |
146 | .flags = RATE_FIXED | ENABLE_ON_INIT, | 145 | .flags = ENABLE_ON_INIT, |
147 | .clkdm_name = "wkup_clkdm", | 146 | .clkdm_name = "wkup_clkdm", |
148 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 147 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
149 | .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, | 148 | .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, |
@@ -208,7 +207,6 @@ static const struct clksel func_96m_clksel[] = { | |||
208 | { .parent = NULL } | 207 | { .parent = NULL } |
209 | }; | 208 | }; |
210 | 209 | ||
211 | /* The parent of this clock is not selectable on 2420. */ | ||
212 | static struct clk func_96m_ck = { | 210 | static struct clk func_96m_ck = { |
213 | .name = "func_96m_ck", | 211 | .name = "func_96m_ck", |
214 | .ops = &clkops_null, | 212 | .ops = &clkops_null, |
@@ -219,8 +217,6 @@ static struct clk func_96m_ck = { | |||
219 | .clksel_mask = OMAP2430_96M_SOURCE, | 217 | .clksel_mask = OMAP2430_96M_SOURCE, |
220 | .clksel = func_96m_clksel, | 218 | .clksel = func_96m_clksel, |
221 | .recalc = &omap2_clksel_recalc, | 219 | .recalc = &omap2_clksel_recalc, |
222 | .round_rate = &omap2_clksel_round_rate, | ||
223 | .set_rate = &omap2_clksel_set_rate | ||
224 | }; | 220 | }; |
225 | 221 | ||
226 | /* func_48m_ck */ | 222 | /* func_48m_ck */ |
@@ -261,7 +257,7 @@ static struct clk func_12m_ck = { | |||
261 | .parent = &func_48m_ck, | 257 | .parent = &func_48m_ck, |
262 | .fixed_div = 4, | 258 | .fixed_div = 4, |
263 | .clkdm_name = "wkup_clkdm", | 259 | .clkdm_name = "wkup_clkdm", |
264 | .recalc = &omap2_fixed_divisor_recalc, | 260 | .recalc = &omap_fixed_divisor_recalc, |
265 | }; | 261 | }; |
266 | 262 | ||
267 | /* Secure timer, only available in secure mode */ | 263 | /* Secure timer, only available in secure mode */ |
@@ -313,10 +309,10 @@ static struct clk sys_clkout_src = { | |||
313 | .ops = &clkops_omap2_dflt, | 309 | .ops = &clkops_omap2_dflt, |
314 | .parent = &func_54m_ck, | 310 | .parent = &func_54m_ck, |
315 | .clkdm_name = "wkup_clkdm", | 311 | .clkdm_name = "wkup_clkdm", |
316 | .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | 312 | .enable_reg = OMAP2430_PRCM_CLKOUT_CTRL, |
317 | .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT, | 313 | .enable_bit = OMAP24XX_CLKOUT_EN_SHIFT, |
318 | .init = &omap2_init_clksel_parent, | 314 | .init = &omap2_init_clksel_parent, |
319 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | 315 | .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL, |
320 | .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK, | 316 | .clksel_mask = OMAP24XX_CLKOUT_SOURCE_MASK, |
321 | .clksel = common_clkout_src_clksel, | 317 | .clksel = common_clkout_src_clksel, |
322 | .recalc = &omap2_clksel_recalc, | 318 | .recalc = &omap2_clksel_recalc, |
@@ -343,7 +339,7 @@ static struct clk sys_clkout = { | |||
343 | .ops = &clkops_null, | 339 | .ops = &clkops_null, |
344 | .parent = &sys_clkout_src, | 340 | .parent = &sys_clkout_src, |
345 | .clkdm_name = "wkup_clkdm", | 341 | .clkdm_name = "wkup_clkdm", |
346 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | 342 | .clksel_reg = OMAP2430_PRCM_CLKOUT_CTRL, |
347 | .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK, | 343 | .clksel_mask = OMAP24XX_CLKOUT_DIV_MASK, |
348 | .clksel = sys_clkout_clksel, | 344 | .clksel = sys_clkout_clksel, |
349 | .recalc = &omap2_clksel_recalc, | 345 | .recalc = &omap2_clksel_recalc, |
@@ -351,48 +347,12 @@ static struct clk sys_clkout = { | |||
351 | .set_rate = &omap2_clksel_set_rate | 347 | .set_rate = &omap2_clksel_set_rate |
352 | }; | 348 | }; |
353 | 349 | ||
354 | /* In 2430, new in 2420 ES2 */ | ||
355 | static struct clk sys_clkout2_src = { | ||
356 | .name = "sys_clkout2_src", | ||
357 | .ops = &clkops_omap2_dflt, | ||
358 | .parent = &func_54m_ck, | ||
359 | .clkdm_name = "wkup_clkdm", | ||
360 | .enable_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | ||
361 | .enable_bit = OMAP2420_CLKOUT2_EN_SHIFT, | ||
362 | .init = &omap2_init_clksel_parent, | ||
363 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | ||
364 | .clksel_mask = OMAP2420_CLKOUT2_SOURCE_MASK, | ||
365 | .clksel = common_clkout_src_clksel, | ||
366 | .recalc = &omap2_clksel_recalc, | ||
367 | .round_rate = &omap2_clksel_round_rate, | ||
368 | .set_rate = &omap2_clksel_set_rate | ||
369 | }; | ||
370 | |||
371 | static const struct clksel sys_clkout2_clksel[] = { | ||
372 | { .parent = &sys_clkout2_src, .rates = common_clkout_rates }, | ||
373 | { .parent = NULL } | ||
374 | }; | ||
375 | |||
376 | /* In 2430, new in 2420 ES2 */ | ||
377 | static struct clk sys_clkout2 = { | ||
378 | .name = "sys_clkout2", | ||
379 | .ops = &clkops_null, | ||
380 | .parent = &sys_clkout2_src, | ||
381 | .clkdm_name = "wkup_clkdm", | ||
382 | .clksel_reg = OMAP24XX_PRCM_CLKOUT_CTRL, | ||
383 | .clksel_mask = OMAP2420_CLKOUT2_DIV_MASK, | ||
384 | .clksel = sys_clkout2_clksel, | ||
385 | .recalc = &omap2_clksel_recalc, | ||
386 | .round_rate = &omap2_clksel_round_rate, | ||
387 | .set_rate = &omap2_clksel_set_rate | ||
388 | }; | ||
389 | |||
390 | static struct clk emul_ck = { | 350 | static struct clk emul_ck = { |
391 | .name = "emul_ck", | 351 | .name = "emul_ck", |
392 | .ops = &clkops_omap2_dflt, | 352 | .ops = &clkops_omap2_dflt, |
393 | .parent = &func_54m_ck, | 353 | .parent = &func_54m_ck, |
394 | .clkdm_name = "wkup_clkdm", | 354 | .clkdm_name = "wkup_clkdm", |
395 | .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL, | 355 | .enable_reg = OMAP2430_PRCM_CLKEMUL_CTRL, |
396 | .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, | 356 | .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, |
397 | .recalc = &followparent_recalc, | 357 | .recalc = &followparent_recalc, |
398 | 358 | ||
@@ -411,9 +371,6 @@ static struct clk emul_ck = { | |||
411 | static const struct clksel_rate mpu_core_rates[] = { | 371 | static const struct clksel_rate mpu_core_rates[] = { |
412 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, | 372 | { .div = 1, .val = 1, .flags = RATE_IN_24XX | DEFAULT_RATE }, |
413 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | 373 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
414 | { .div = 4, .val = 4, .flags = RATE_IN_242X }, | ||
415 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
416 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
417 | { .div = 0 }, | 374 | { .div = 0 }, |
418 | }; | 375 | }; |
419 | 376 | ||
@@ -426,22 +383,18 @@ static struct clk mpu_ck = { /* Control cpu */ | |||
426 | .name = "mpu_ck", | 383 | .name = "mpu_ck", |
427 | .ops = &clkops_null, | 384 | .ops = &clkops_null, |
428 | .parent = &core_ck, | 385 | .parent = &core_ck, |
429 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
430 | .clkdm_name = "mpu_clkdm", | 386 | .clkdm_name = "mpu_clkdm", |
431 | .init = &omap2_init_clksel_parent, | 387 | .init = &omap2_init_clksel_parent, |
432 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL), | 388 | .clksel_reg = OMAP_CM_REGADDR(MPU_MOD, CM_CLKSEL), |
433 | .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK, | 389 | .clksel_mask = OMAP24XX_CLKSEL_MPU_MASK, |
434 | .clksel = mpu_clksel, | 390 | .clksel = mpu_clksel, |
435 | .recalc = &omap2_clksel_recalc, | 391 | .recalc = &omap2_clksel_recalc, |
436 | .round_rate = &omap2_clksel_round_rate, | ||
437 | .set_rate = &omap2_clksel_set_rate | ||
438 | }; | 392 | }; |
439 | 393 | ||
440 | /* | 394 | /* |
441 | * DSP (2430-IVA2.1) (2420-UMA+IVA1) clock domain | 395 | * DSP (2430-IVA2.1) clock domain |
442 | * Clocks: | 396 | * Clocks: |
443 | * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK | 397 | * 2430: IVA2.1_FCLK (really just DSP_FCLK), IVA2.1_ICLK |
444 | * 2420: UMA_FCLK, UMA_ICLK, IVA_MPU, IVA_COP | ||
445 | * | 398 | * |
446 | * Won't be too specific here. The core clock comes into this block | 399 | * Won't be too specific here. The core clock comes into this block |
447 | * it is divided then tee'ed. One branch goes directly to xyz enable | 400 | * it is divided then tee'ed. One branch goes directly to xyz enable |
@@ -453,9 +406,6 @@ static const struct clksel_rate dsp_fck_core_rates[] = { | |||
453 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, | 406 | { .div = 2, .val = 2, .flags = RATE_IN_24XX }, |
454 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, | 407 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, |
455 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, | 408 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, |
456 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
457 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
458 | { .div = 12, .val = 12, .flags = RATE_IN_242X }, | ||
459 | { .div = 0 }, | 409 | { .div = 0 }, |
460 | }; | 410 | }; |
461 | 411 | ||
@@ -468,7 +418,6 @@ static struct clk dsp_fck = { | |||
468 | .name = "dsp_fck", | 418 | .name = "dsp_fck", |
469 | .ops = &clkops_omap2_dflt_wait, | 419 | .ops = &clkops_omap2_dflt_wait, |
470 | .parent = &core_ck, | 420 | .parent = &core_ck, |
471 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
472 | .clkdm_name = "dsp_clkdm", | 421 | .clkdm_name = "dsp_clkdm", |
473 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 422 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
474 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, | 423 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
@@ -476,8 +425,6 @@ static struct clk dsp_fck = { | |||
476 | .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK, | 425 | .clksel_mask = OMAP24XX_CLKSEL_DSP_MASK, |
477 | .clksel = dsp_fck_clksel, | 426 | .clksel = dsp_fck_clksel, |
478 | .recalc = &omap2_clksel_recalc, | 427 | .recalc = &omap2_clksel_recalc, |
479 | .round_rate = &omap2_clksel_round_rate, | ||
480 | .set_rate = &omap2_clksel_set_rate | ||
481 | }; | 428 | }; |
482 | 429 | ||
483 | /* DSP interface clock */ | 430 | /* DSP interface clock */ |
@@ -498,23 +445,10 @@ static struct clk dsp_irate_ick = { | |||
498 | .name = "dsp_irate_ick", | 445 | .name = "dsp_irate_ick", |
499 | .ops = &clkops_null, | 446 | .ops = &clkops_null, |
500 | .parent = &dsp_fck, | 447 | .parent = &dsp_fck, |
501 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
502 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | 448 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), |
503 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, | 449 | .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK, |
504 | .clksel = dsp_irate_ick_clksel, | 450 | .clksel = dsp_irate_ick_clksel, |
505 | .recalc = &omap2_clksel_recalc, | 451 | .recalc = &omap2_clksel_recalc, |
506 | .round_rate = &omap2_clksel_round_rate, | ||
507 | .set_rate = &omap2_clksel_set_rate | ||
508 | }; | ||
509 | |||
510 | /* 2420 only */ | ||
511 | static struct clk dsp_ick = { | ||
512 | .name = "dsp_ick", /* apparently ipi and isp */ | ||
513 | .ops = &clkops_omap2_dflt_wait, | ||
514 | .parent = &dsp_irate_ick, | ||
515 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
516 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), | ||
517 | .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ | ||
518 | }; | 452 | }; |
519 | 453 | ||
520 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ | 454 | /* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ |
@@ -522,45 +456,11 @@ static struct clk iva2_1_ick = { | |||
522 | .name = "iva2_1_ick", | 456 | .name = "iva2_1_ick", |
523 | .ops = &clkops_omap2_dflt_wait, | 457 | .ops = &clkops_omap2_dflt_wait, |
524 | .parent = &dsp_irate_ick, | 458 | .parent = &dsp_irate_ick, |
525 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
526 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 459 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
527 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, | 460 | .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, |
528 | }; | 461 | }; |
529 | 462 | ||
530 | /* | 463 | /* |
531 | * The IVA1 is an ARM7 core on the 2420 that has nothing to do with | ||
532 | * the C54x, but which is contained in the DSP powerdomain. Does not | ||
533 | * exist on later OMAPs. | ||
534 | */ | ||
535 | static struct clk iva1_ifck = { | ||
536 | .name = "iva1_ifck", | ||
537 | .ops = &clkops_omap2_dflt_wait, | ||
538 | .parent = &core_ck, | ||
539 | .flags = CONFIG_PARTICIPANT | DELAYED_APP, | ||
540 | .clkdm_name = "iva1_clkdm", | ||
541 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | ||
542 | .enable_bit = OMAP2420_EN_IVA_COP_SHIFT, | ||
543 | .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL), | ||
544 | .clksel_mask = OMAP2420_CLKSEL_IVA_MASK, | ||
545 | .clksel = dsp_fck_clksel, | ||
546 | .recalc = &omap2_clksel_recalc, | ||
547 | .round_rate = &omap2_clksel_round_rate, | ||
548 | .set_rate = &omap2_clksel_set_rate | ||
549 | }; | ||
550 | |||
551 | /* IVA1 mpu/int/i/f clocks are /2 of parent */ | ||
552 | static struct clk iva1_mpu_int_ifck = { | ||
553 | .name = "iva1_mpu_int_ifck", | ||
554 | .ops = &clkops_omap2_dflt_wait, | ||
555 | .parent = &iva1_ifck, | ||
556 | .clkdm_name = "iva1_clkdm", | ||
557 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | ||
558 | .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, | ||
559 | .fixed_div = 2, | ||
560 | .recalc = &omap2_fixed_divisor_recalc, | ||
561 | }; | ||
562 | |||
563 | /* | ||
564 | * L3 clock domain | 464 | * L3 clock domain |
565 | * L3 clocks are used for both interface and functional clocks to | 465 | * L3 clocks are used for both interface and functional clocks to |
566 | * multiple entities. Some of these clocks are completely managed | 466 | * multiple entities. Some of these clocks are completely managed |
@@ -581,12 +481,8 @@ static struct clk iva1_mpu_int_ifck = { | |||
581 | */ | 481 | */ |
582 | static const struct clksel_rate core_l3_core_rates[] = { | 482 | static const struct clksel_rate core_l3_core_rates[] = { |
583 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | 483 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, |
584 | { .div = 2, .val = 2, .flags = RATE_IN_242X }, | ||
585 | { .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE }, | 484 | { .div = 4, .val = 4, .flags = RATE_IN_24XX | DEFAULT_RATE }, |
586 | { .div = 6, .val = 6, .flags = RATE_IN_24XX }, | 485 | { .div = 6, .val = 6, .flags = RATE_IN_24XX }, |
587 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
588 | { .div = 12, .val = 12, .flags = RATE_IN_242X }, | ||
589 | { .div = 16, .val = 16, .flags = RATE_IN_242X }, | ||
590 | { .div = 0 } | 486 | { .div = 0 } |
591 | }; | 487 | }; |
592 | 488 | ||
@@ -599,14 +495,11 @@ static struct clk core_l3_ck = { /* Used for ick and fck, interconnect */ | |||
599 | .name = "core_l3_ck", | 495 | .name = "core_l3_ck", |
600 | .ops = &clkops_null, | 496 | .ops = &clkops_null, |
601 | .parent = &core_ck, | 497 | .parent = &core_ck, |
602 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
603 | .clkdm_name = "core_l3_clkdm", | 498 | .clkdm_name = "core_l3_clkdm", |
604 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | 499 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
605 | .clksel_mask = OMAP24XX_CLKSEL_L3_MASK, | 500 | .clksel_mask = OMAP24XX_CLKSEL_L3_MASK, |
606 | .clksel = core_l3_clksel, | 501 | .clksel = core_l3_clksel, |
607 | .recalc = &omap2_clksel_recalc, | 502 | .recalc = &omap2_clksel_recalc, |
608 | .round_rate = &omap2_clksel_round_rate, | ||
609 | .set_rate = &omap2_clksel_set_rate | ||
610 | }; | 503 | }; |
611 | 504 | ||
612 | /* usb_l4_ick */ | 505 | /* usb_l4_ick */ |
@@ -627,7 +520,6 @@ static struct clk usb_l4_ick = { /* FS-USB interface clock */ | |||
627 | .name = "usb_l4_ick", | 520 | .name = "usb_l4_ick", |
628 | .ops = &clkops_omap2_dflt_wait, | 521 | .ops = &clkops_omap2_dflt_wait, |
629 | .parent = &core_l3_ck, | 522 | .parent = &core_l3_ck, |
630 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
631 | .clkdm_name = "core_l4_clkdm", | 523 | .clkdm_name = "core_l4_clkdm", |
632 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 524 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
633 | .enable_bit = OMAP24XX_EN_USB_SHIFT, | 525 | .enable_bit = OMAP24XX_EN_USB_SHIFT, |
@@ -635,8 +527,6 @@ static struct clk usb_l4_ick = { /* FS-USB interface clock */ | |||
635 | .clksel_mask = OMAP24XX_CLKSEL_USB_MASK, | 527 | .clksel_mask = OMAP24XX_CLKSEL_USB_MASK, |
636 | .clksel = usb_l4_ick_clksel, | 528 | .clksel = usb_l4_ick_clksel, |
637 | .recalc = &omap2_clksel_recalc, | 529 | .recalc = &omap2_clksel_recalc, |
638 | .round_rate = &omap2_clksel_round_rate, | ||
639 | .set_rate = &omap2_clksel_set_rate | ||
640 | }; | 530 | }; |
641 | 531 | ||
642 | /* | 532 | /* |
@@ -661,14 +551,11 @@ static struct clk l4_ck = { /* used both as an ick and fck */ | |||
661 | .name = "l4_ck", | 551 | .name = "l4_ck", |
662 | .ops = &clkops_null, | 552 | .ops = &clkops_null, |
663 | .parent = &core_l3_ck, | 553 | .parent = &core_l3_ck, |
664 | .flags = DELAYED_APP, | ||
665 | .clkdm_name = "core_l4_clkdm", | 554 | .clkdm_name = "core_l4_clkdm", |
666 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | 555 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), |
667 | .clksel_mask = OMAP24XX_CLKSEL_L4_MASK, | 556 | .clksel_mask = OMAP24XX_CLKSEL_L4_MASK, |
668 | .clksel = l4_clksel, | 557 | .clksel = l4_clksel, |
669 | .recalc = &omap2_clksel_recalc, | 558 | .recalc = &omap2_clksel_recalc, |
670 | .round_rate = &omap2_clksel_round_rate, | ||
671 | .set_rate = &omap2_clksel_set_rate | ||
672 | }; | 559 | }; |
673 | 560 | ||
674 | /* | 561 | /* |
@@ -685,8 +572,6 @@ static const struct clksel_rate ssi_ssr_sst_fck_core_rates[] = { | |||
685 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, | 572 | { .div = 3, .val = 3, .flags = RATE_IN_24XX }, |
686 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, | 573 | { .div = 4, .val = 4, .flags = RATE_IN_24XX }, |
687 | { .div = 5, .val = 5, .flags = RATE_IN_243X }, | 574 | { .div = 5, .val = 5, .flags = RATE_IN_243X }, |
688 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
689 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
690 | { .div = 0 } | 575 | { .div = 0 } |
691 | }; | 576 | }; |
692 | 577 | ||
@@ -699,7 +584,6 @@ static struct clk ssi_ssr_sst_fck = { | |||
699 | .name = "ssi_fck", | 584 | .name = "ssi_fck", |
700 | .ops = &clkops_omap2_dflt_wait, | 585 | .ops = &clkops_omap2_dflt_wait, |
701 | .parent = &core_ck, | 586 | .parent = &core_ck, |
702 | .flags = DELAYED_APP, | ||
703 | .clkdm_name = "core_l3_clkdm", | 587 | .clkdm_name = "core_l3_clkdm", |
704 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 588 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
705 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, | 589 | .enable_bit = OMAP24XX_EN_SSI_SHIFT, |
@@ -707,8 +591,6 @@ static struct clk ssi_ssr_sst_fck = { | |||
707 | .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK, | 591 | .clksel_mask = OMAP24XX_CLKSEL_SSI_MASK, |
708 | .clksel = ssi_ssr_sst_fck_clksel, | 592 | .clksel = ssi_ssr_sst_fck_clksel, |
709 | .recalc = &omap2_clksel_recalc, | 593 | .recalc = &omap2_clksel_recalc, |
710 | .round_rate = &omap2_clksel_round_rate, | ||
711 | .set_rate = &omap2_clksel_set_rate | ||
712 | }; | 594 | }; |
713 | 595 | ||
714 | /* | 596 | /* |
@@ -737,7 +619,6 @@ static struct clk ssi_l4_ick = { | |||
737 | * divided value of fclk. | 619 | * divided value of fclk. |
738 | * | 620 | * |
739 | */ | 621 | */ |
740 | /* XXX REVISIT: GFX clock is part of CONFIG_PARTICIPANT, no? doublecheck. */ | ||
741 | 622 | ||
742 | /* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */ | 623 | /* This clksel struct is shared between gfx_3d_fck and gfx_2d_fck */ |
743 | static const struct clksel gfx_fck_clksel[] = { | 624 | static const struct clksel gfx_fck_clksel[] = { |
@@ -771,8 +652,6 @@ static struct clk gfx_2d_fck = { | |||
771 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, | 652 | .clksel_mask = OMAP_CLKSEL_GFX_MASK, |
772 | .clksel = gfx_fck_clksel, | 653 | .clksel = gfx_fck_clksel, |
773 | .recalc = &omap2_clksel_recalc, | 654 | .recalc = &omap2_clksel_recalc, |
774 | .round_rate = &omap2_clksel_round_rate, | ||
775 | .set_rate = &omap2_clksel_set_rate | ||
776 | }; | 655 | }; |
777 | 656 | ||
778 | static struct clk gfx_ick = { | 657 | static struct clk gfx_ick = { |
@@ -809,7 +688,6 @@ static struct clk mdm_ick = { /* used both as a ick and fck */ | |||
809 | .name = "mdm_ick", | 688 | .name = "mdm_ick", |
810 | .ops = &clkops_omap2_dflt_wait, | 689 | .ops = &clkops_omap2_dflt_wait, |
811 | .parent = &core_ck, | 690 | .parent = &core_ck, |
812 | .flags = DELAYED_APP | CONFIG_PARTICIPANT, | ||
813 | .clkdm_name = "mdm_clkdm", | 691 | .clkdm_name = "mdm_clkdm", |
814 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), | 692 | .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), |
815 | .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT, | 693 | .enable_bit = OMAP2430_CM_ICLKEN_MDM_EN_MDM_SHIFT, |
@@ -817,8 +695,6 @@ static struct clk mdm_ick = { /* used both as a ick and fck */ | |||
817 | .clksel_mask = OMAP2430_CLKSEL_MDM_MASK, | 695 | .clksel_mask = OMAP2430_CLKSEL_MDM_MASK, |
818 | .clksel = mdm_ick_clksel, | 696 | .clksel = mdm_ick_clksel, |
819 | .recalc = &omap2_clksel_recalc, | 697 | .recalc = &omap2_clksel_recalc, |
820 | .round_rate = &omap2_clksel_round_rate, | ||
821 | .set_rate = &omap2_clksel_set_rate | ||
822 | }; | 698 | }; |
823 | 699 | ||
824 | static struct clk mdm_osc_ck = { | 700 | static struct clk mdm_osc_ck = { |
@@ -880,7 +756,6 @@ static struct clk dss1_fck = { | |||
880 | .name = "dss1_fck", | 756 | .name = "dss1_fck", |
881 | .ops = &clkops_omap2_dflt, | 757 | .ops = &clkops_omap2_dflt, |
882 | .parent = &core_ck, /* Core or sys */ | 758 | .parent = &core_ck, /* Core or sys */ |
883 | .flags = DELAYED_APP, | ||
884 | .clkdm_name = "dss_clkdm", | 759 | .clkdm_name = "dss_clkdm", |
885 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 760 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
886 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, | 761 | .enable_bit = OMAP24XX_EN_DSS1_SHIFT, |
@@ -889,8 +764,6 @@ static struct clk dss1_fck = { | |||
889 | .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK, | 764 | .clksel_mask = OMAP24XX_CLKSEL_DSS1_MASK, |
890 | .clksel = dss1_fck_clksel, | 765 | .clksel = dss1_fck_clksel, |
891 | .recalc = &omap2_clksel_recalc, | 766 | .recalc = &omap2_clksel_recalc, |
892 | .round_rate = &omap2_clksel_round_rate, | ||
893 | .set_rate = &omap2_clksel_set_rate | ||
894 | }; | 767 | }; |
895 | 768 | ||
896 | static const struct clksel_rate dss2_fck_sys_rates[] = { | 769 | static const struct clksel_rate dss2_fck_sys_rates[] = { |
@@ -913,7 +786,6 @@ static struct clk dss2_fck = { /* Alt clk used in power management */ | |||
913 | .name = "dss2_fck", | 786 | .name = "dss2_fck", |
914 | .ops = &clkops_omap2_dflt, | 787 | .ops = &clkops_omap2_dflt, |
915 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ | 788 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ |
916 | .flags = DELAYED_APP, | ||
917 | .clkdm_name = "dss_clkdm", | 789 | .clkdm_name = "dss_clkdm", |
918 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 790 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
919 | .enable_bit = OMAP24XX_EN_DSS2_SHIFT, | 791 | .enable_bit = OMAP24XX_EN_DSS2_SHIFT, |
@@ -1242,9 +1114,8 @@ static struct clk gpt12_fck = { | |||
1242 | }; | 1114 | }; |
1243 | 1115 | ||
1244 | static struct clk mcbsp1_ick = { | 1116 | static struct clk mcbsp1_ick = { |
1245 | .name = "mcbsp_ick", | 1117 | .name = "mcbsp1_ick", |
1246 | .ops = &clkops_omap2_dflt_wait, | 1118 | .ops = &clkops_omap2_dflt_wait, |
1247 | .id = 1, | ||
1248 | .parent = &l4_ck, | 1119 | .parent = &l4_ck, |
1249 | .clkdm_name = "core_l4_clkdm", | 1120 | .clkdm_name = "core_l4_clkdm", |
1250 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1121 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1253,9 +1124,8 @@ static struct clk mcbsp1_ick = { | |||
1253 | }; | 1124 | }; |
1254 | 1125 | ||
1255 | static struct clk mcbsp1_fck = { | 1126 | static struct clk mcbsp1_fck = { |
1256 | .name = "mcbsp_fck", | 1127 | .name = "mcbsp1_fck", |
1257 | .ops = &clkops_omap2_dflt_wait, | 1128 | .ops = &clkops_omap2_dflt_wait, |
1258 | .id = 1, | ||
1259 | .parent = &func_96m_ck, | 1129 | .parent = &func_96m_ck, |
1260 | .clkdm_name = "core_l4_clkdm", | 1130 | .clkdm_name = "core_l4_clkdm", |
1261 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1131 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1264,9 +1134,8 @@ static struct clk mcbsp1_fck = { | |||
1264 | }; | 1134 | }; |
1265 | 1135 | ||
1266 | static struct clk mcbsp2_ick = { | 1136 | static struct clk mcbsp2_ick = { |
1267 | .name = "mcbsp_ick", | 1137 | .name = "mcbsp2_ick", |
1268 | .ops = &clkops_omap2_dflt_wait, | 1138 | .ops = &clkops_omap2_dflt_wait, |
1269 | .id = 2, | ||
1270 | .parent = &l4_ck, | 1139 | .parent = &l4_ck, |
1271 | .clkdm_name = "core_l4_clkdm", | 1140 | .clkdm_name = "core_l4_clkdm", |
1272 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1141 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1275,9 +1144,8 @@ static struct clk mcbsp2_ick = { | |||
1275 | }; | 1144 | }; |
1276 | 1145 | ||
1277 | static struct clk mcbsp2_fck = { | 1146 | static struct clk mcbsp2_fck = { |
1278 | .name = "mcbsp_fck", | 1147 | .name = "mcbsp2_fck", |
1279 | .ops = &clkops_omap2_dflt_wait, | 1148 | .ops = &clkops_omap2_dflt_wait, |
1280 | .id = 2, | ||
1281 | .parent = &func_96m_ck, | 1149 | .parent = &func_96m_ck, |
1282 | .clkdm_name = "core_l4_clkdm", | 1150 | .clkdm_name = "core_l4_clkdm", |
1283 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1151 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1286,9 +1154,8 @@ static struct clk mcbsp2_fck = { | |||
1286 | }; | 1154 | }; |
1287 | 1155 | ||
1288 | static struct clk mcbsp3_ick = { | 1156 | static struct clk mcbsp3_ick = { |
1289 | .name = "mcbsp_ick", | 1157 | .name = "mcbsp3_ick", |
1290 | .ops = &clkops_omap2_dflt_wait, | 1158 | .ops = &clkops_omap2_dflt_wait, |
1291 | .id = 3, | ||
1292 | .parent = &l4_ck, | 1159 | .parent = &l4_ck, |
1293 | .clkdm_name = "core_l4_clkdm", | 1160 | .clkdm_name = "core_l4_clkdm", |
1294 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1161 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1297,9 +1164,8 @@ static struct clk mcbsp3_ick = { | |||
1297 | }; | 1164 | }; |
1298 | 1165 | ||
1299 | static struct clk mcbsp3_fck = { | 1166 | static struct clk mcbsp3_fck = { |
1300 | .name = "mcbsp_fck", | 1167 | .name = "mcbsp3_fck", |
1301 | .ops = &clkops_omap2_dflt_wait, | 1168 | .ops = &clkops_omap2_dflt_wait, |
1302 | .id = 3, | ||
1303 | .parent = &func_96m_ck, | 1169 | .parent = &func_96m_ck, |
1304 | .clkdm_name = "core_l4_clkdm", | 1170 | .clkdm_name = "core_l4_clkdm", |
1305 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1171 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
@@ -1308,9 +1174,8 @@ static struct clk mcbsp3_fck = { | |||
1308 | }; | 1174 | }; |
1309 | 1175 | ||
1310 | static struct clk mcbsp4_ick = { | 1176 | static struct clk mcbsp4_ick = { |
1311 | .name = "mcbsp_ick", | 1177 | .name = "mcbsp4_ick", |
1312 | .ops = &clkops_omap2_dflt_wait, | 1178 | .ops = &clkops_omap2_dflt_wait, |
1313 | .id = 4, | ||
1314 | .parent = &l4_ck, | 1179 | .parent = &l4_ck, |
1315 | .clkdm_name = "core_l4_clkdm", | 1180 | .clkdm_name = "core_l4_clkdm", |
1316 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1181 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1319,9 +1184,8 @@ static struct clk mcbsp4_ick = { | |||
1319 | }; | 1184 | }; |
1320 | 1185 | ||
1321 | static struct clk mcbsp4_fck = { | 1186 | static struct clk mcbsp4_fck = { |
1322 | .name = "mcbsp_fck", | 1187 | .name = "mcbsp4_fck", |
1323 | .ops = &clkops_omap2_dflt_wait, | 1188 | .ops = &clkops_omap2_dflt_wait, |
1324 | .id = 4, | ||
1325 | .parent = &func_96m_ck, | 1189 | .parent = &func_96m_ck, |
1326 | .clkdm_name = "core_l4_clkdm", | 1190 | .clkdm_name = "core_l4_clkdm", |
1327 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1191 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
@@ -1330,9 +1194,8 @@ static struct clk mcbsp4_fck = { | |||
1330 | }; | 1194 | }; |
1331 | 1195 | ||
1332 | static struct clk mcbsp5_ick = { | 1196 | static struct clk mcbsp5_ick = { |
1333 | .name = "mcbsp_ick", | 1197 | .name = "mcbsp5_ick", |
1334 | .ops = &clkops_omap2_dflt_wait, | 1198 | .ops = &clkops_omap2_dflt_wait, |
1335 | .id = 5, | ||
1336 | .parent = &l4_ck, | 1199 | .parent = &l4_ck, |
1337 | .clkdm_name = "core_l4_clkdm", | 1200 | .clkdm_name = "core_l4_clkdm", |
1338 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1201 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1341,9 +1204,8 @@ static struct clk mcbsp5_ick = { | |||
1341 | }; | 1204 | }; |
1342 | 1205 | ||
1343 | static struct clk mcbsp5_fck = { | 1206 | static struct clk mcbsp5_fck = { |
1344 | .name = "mcbsp_fck", | 1207 | .name = "mcbsp5_fck", |
1345 | .ops = &clkops_omap2_dflt_wait, | 1208 | .ops = &clkops_omap2_dflt_wait, |
1346 | .id = 5, | ||
1347 | .parent = &func_96m_ck, | 1209 | .parent = &func_96m_ck, |
1348 | .clkdm_name = "core_l4_clkdm", | 1210 | .clkdm_name = "core_l4_clkdm", |
1349 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1211 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
@@ -1352,9 +1214,8 @@ static struct clk mcbsp5_fck = { | |||
1352 | }; | 1214 | }; |
1353 | 1215 | ||
1354 | static struct clk mcspi1_ick = { | 1216 | static struct clk mcspi1_ick = { |
1355 | .name = "mcspi_ick", | 1217 | .name = "mcspi1_ick", |
1356 | .ops = &clkops_omap2_dflt_wait, | 1218 | .ops = &clkops_omap2_dflt_wait, |
1357 | .id = 1, | ||
1358 | .parent = &l4_ck, | 1219 | .parent = &l4_ck, |
1359 | .clkdm_name = "core_l4_clkdm", | 1220 | .clkdm_name = "core_l4_clkdm", |
1360 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1221 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1363,9 +1224,8 @@ static struct clk mcspi1_ick = { | |||
1363 | }; | 1224 | }; |
1364 | 1225 | ||
1365 | static struct clk mcspi1_fck = { | 1226 | static struct clk mcspi1_fck = { |
1366 | .name = "mcspi_fck", | 1227 | .name = "mcspi1_fck", |
1367 | .ops = &clkops_omap2_dflt_wait, | 1228 | .ops = &clkops_omap2_dflt_wait, |
1368 | .id = 1, | ||
1369 | .parent = &func_48m_ck, | 1229 | .parent = &func_48m_ck, |
1370 | .clkdm_name = "core_l4_clkdm", | 1230 | .clkdm_name = "core_l4_clkdm", |
1371 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1231 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1374,9 +1234,8 @@ static struct clk mcspi1_fck = { | |||
1374 | }; | 1234 | }; |
1375 | 1235 | ||
1376 | static struct clk mcspi2_ick = { | 1236 | static struct clk mcspi2_ick = { |
1377 | .name = "mcspi_ick", | 1237 | .name = "mcspi2_ick", |
1378 | .ops = &clkops_omap2_dflt_wait, | 1238 | .ops = &clkops_omap2_dflt_wait, |
1379 | .id = 2, | ||
1380 | .parent = &l4_ck, | 1239 | .parent = &l4_ck, |
1381 | .clkdm_name = "core_l4_clkdm", | 1240 | .clkdm_name = "core_l4_clkdm", |
1382 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1241 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1385,9 +1244,8 @@ static struct clk mcspi2_ick = { | |||
1385 | }; | 1244 | }; |
1386 | 1245 | ||
1387 | static struct clk mcspi2_fck = { | 1246 | static struct clk mcspi2_fck = { |
1388 | .name = "mcspi_fck", | 1247 | .name = "mcspi2_fck", |
1389 | .ops = &clkops_omap2_dflt_wait, | 1248 | .ops = &clkops_omap2_dflt_wait, |
1390 | .id = 2, | ||
1391 | .parent = &func_48m_ck, | 1249 | .parent = &func_48m_ck, |
1392 | .clkdm_name = "core_l4_clkdm", | 1250 | .clkdm_name = "core_l4_clkdm", |
1393 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1251 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1396,9 +1254,8 @@ static struct clk mcspi2_fck = { | |||
1396 | }; | 1254 | }; |
1397 | 1255 | ||
1398 | static struct clk mcspi3_ick = { | 1256 | static struct clk mcspi3_ick = { |
1399 | .name = "mcspi_ick", | 1257 | .name = "mcspi3_ick", |
1400 | .ops = &clkops_omap2_dflt_wait, | 1258 | .ops = &clkops_omap2_dflt_wait, |
1401 | .id = 3, | ||
1402 | .parent = &l4_ck, | 1259 | .parent = &l4_ck, |
1403 | .clkdm_name = "core_l4_clkdm", | 1260 | .clkdm_name = "core_l4_clkdm", |
1404 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1261 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1407,9 +1264,8 @@ static struct clk mcspi3_ick = { | |||
1407 | }; | 1264 | }; |
1408 | 1265 | ||
1409 | static struct clk mcspi3_fck = { | 1266 | static struct clk mcspi3_fck = { |
1410 | .name = "mcspi_fck", | 1267 | .name = "mcspi3_fck", |
1411 | .ops = &clkops_omap2_dflt_wait, | 1268 | .ops = &clkops_omap2_dflt_wait, |
1412 | .id = 3, | ||
1413 | .parent = &func_48m_ck, | 1269 | .parent = &func_48m_ck, |
1414 | .clkdm_name = "core_l4_clkdm", | 1270 | .clkdm_name = "core_l4_clkdm", |
1415 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1271 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
@@ -1614,26 +1470,6 @@ static struct clk wdt4_fck = { | |||
1614 | .recalc = &followparent_recalc, | 1470 | .recalc = &followparent_recalc, |
1615 | }; | 1471 | }; |
1616 | 1472 | ||
1617 | static struct clk wdt3_ick = { | ||
1618 | .name = "wdt3_ick", | ||
1619 | .ops = &clkops_omap2_dflt_wait, | ||
1620 | .parent = &l4_ck, | ||
1621 | .clkdm_name = "core_l4_clkdm", | ||
1622 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1623 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, | ||
1624 | .recalc = &followparent_recalc, | ||
1625 | }; | ||
1626 | |||
1627 | static struct clk wdt3_fck = { | ||
1628 | .name = "wdt3_fck", | ||
1629 | .ops = &clkops_omap2_dflt_wait, | ||
1630 | .parent = &func_32k_ck, | ||
1631 | .clkdm_name = "core_l4_clkdm", | ||
1632 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1633 | .enable_bit = OMAP2420_EN_WDT3_SHIFT, | ||
1634 | .recalc = &followparent_recalc, | ||
1635 | }; | ||
1636 | |||
1637 | static struct clk mspro_ick = { | 1473 | static struct clk mspro_ick = { |
1638 | .name = "mspro_ick", | 1474 | .name = "mspro_ick", |
1639 | .ops = &clkops_omap2_dflt_wait, | 1475 | .ops = &clkops_omap2_dflt_wait, |
@@ -1654,26 +1490,6 @@ static struct clk mspro_fck = { | |||
1654 | .recalc = &followparent_recalc, | 1490 | .recalc = &followparent_recalc, |
1655 | }; | 1491 | }; |
1656 | 1492 | ||
1657 | static struct clk mmc_ick = { | ||
1658 | .name = "mmc_ick", | ||
1659 | .ops = &clkops_omap2_dflt_wait, | ||
1660 | .parent = &l4_ck, | ||
1661 | .clkdm_name = "core_l4_clkdm", | ||
1662 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1663 | .enable_bit = OMAP2420_EN_MMC_SHIFT, | ||
1664 | .recalc = &followparent_recalc, | ||
1665 | }; | ||
1666 | |||
1667 | static struct clk mmc_fck = { | ||
1668 | .name = "mmc_fck", | ||
1669 | .ops = &clkops_omap2_dflt_wait, | ||
1670 | .parent = &func_96m_ck, | ||
1671 | .clkdm_name = "core_l4_clkdm", | ||
1672 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1673 | .enable_bit = OMAP2420_EN_MMC_SHIFT, | ||
1674 | .recalc = &followparent_recalc, | ||
1675 | }; | ||
1676 | |||
1677 | static struct clk fac_ick = { | 1493 | static struct clk fac_ick = { |
1678 | .name = "fac_ick", | 1494 | .name = "fac_ick", |
1679 | .ops = &clkops_omap2_dflt_wait, | 1495 | .ops = &clkops_omap2_dflt_wait, |
@@ -1694,26 +1510,6 @@ static struct clk fac_fck = { | |||
1694 | .recalc = &followparent_recalc, | 1510 | .recalc = &followparent_recalc, |
1695 | }; | 1511 | }; |
1696 | 1512 | ||
1697 | static struct clk eac_ick = { | ||
1698 | .name = "eac_ick", | ||
1699 | .ops = &clkops_omap2_dflt_wait, | ||
1700 | .parent = &l4_ck, | ||
1701 | .clkdm_name = "core_l4_clkdm", | ||
1702 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1703 | .enable_bit = OMAP2420_EN_EAC_SHIFT, | ||
1704 | .recalc = &followparent_recalc, | ||
1705 | }; | ||
1706 | |||
1707 | static struct clk eac_fck = { | ||
1708 | .name = "eac_fck", | ||
1709 | .ops = &clkops_omap2_dflt_wait, | ||
1710 | .parent = &func_96m_ck, | ||
1711 | .clkdm_name = "core_l4_clkdm", | ||
1712 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1713 | .enable_bit = OMAP2420_EN_EAC_SHIFT, | ||
1714 | .recalc = &followparent_recalc, | ||
1715 | }; | ||
1716 | |||
1717 | static struct clk hdq_ick = { | 1513 | static struct clk hdq_ick = { |
1718 | .name = "hdq_ick", | 1514 | .name = "hdq_ick", |
1719 | .ops = &clkops_omap2_dflt_wait, | 1515 | .ops = &clkops_omap2_dflt_wait, |
@@ -1734,10 +1530,13 @@ static struct clk hdq_fck = { | |||
1734 | .recalc = &followparent_recalc, | 1530 | .recalc = &followparent_recalc, |
1735 | }; | 1531 | }; |
1736 | 1532 | ||
1533 | /* | ||
1534 | * XXX This is marked as a 2420-only define, but it claims to be present | ||
1535 | * on 2430 also. Double-check. | ||
1536 | */ | ||
1737 | static struct clk i2c2_ick = { | 1537 | static struct clk i2c2_ick = { |
1738 | .name = "i2c_ick", | 1538 | .name = "i2c2_ick", |
1739 | .ops = &clkops_omap2_dflt_wait, | 1539 | .ops = &clkops_omap2_dflt_wait, |
1740 | .id = 2, | ||
1741 | .parent = &l4_ck, | 1540 | .parent = &l4_ck, |
1742 | .clkdm_name = "core_l4_clkdm", | 1541 | .clkdm_name = "core_l4_clkdm", |
1743 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1542 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1745,21 +1544,9 @@ static struct clk i2c2_ick = { | |||
1745 | .recalc = &followparent_recalc, | 1544 | .recalc = &followparent_recalc, |
1746 | }; | 1545 | }; |
1747 | 1546 | ||
1748 | static struct clk i2c2_fck = { | ||
1749 | .name = "i2c_fck", | ||
1750 | .ops = &clkops_omap2_dflt_wait, | ||
1751 | .id = 2, | ||
1752 | .parent = &func_12m_ck, | ||
1753 | .clkdm_name = "core_l4_clkdm", | ||
1754 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1755 | .enable_bit = OMAP2420_EN_I2C2_SHIFT, | ||
1756 | .recalc = &followparent_recalc, | ||
1757 | }; | ||
1758 | |||
1759 | static struct clk i2chs2_fck = { | 1547 | static struct clk i2chs2_fck = { |
1760 | .name = "i2c_fck", | 1548 | .name = "i2chs2_fck", |
1761 | .ops = &clkops_omap2430_i2chs_wait, | 1549 | .ops = &clkops_omap2430_i2chs_wait, |
1762 | .id = 2, | ||
1763 | .parent = &func_96m_ck, | 1550 | .parent = &func_96m_ck, |
1764 | .clkdm_name = "core_l4_clkdm", | 1551 | .clkdm_name = "core_l4_clkdm", |
1765 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1552 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
@@ -1767,10 +1554,13 @@ static struct clk i2chs2_fck = { | |||
1767 | .recalc = &followparent_recalc, | 1554 | .recalc = &followparent_recalc, |
1768 | }; | 1555 | }; |
1769 | 1556 | ||
1557 | /* | ||
1558 | * XXX This is marked as a 2420-only define, but it claims to be present | ||
1559 | * on 2430 also. Double-check. | ||
1560 | */ | ||
1770 | static struct clk i2c1_ick = { | 1561 | static struct clk i2c1_ick = { |
1771 | .name = "i2c_ick", | 1562 | .name = "i2c1_ick", |
1772 | .ops = &clkops_omap2_dflt_wait, | 1563 | .ops = &clkops_omap2_dflt_wait, |
1773 | .id = 1, | ||
1774 | .parent = &l4_ck, | 1564 | .parent = &l4_ck, |
1775 | .clkdm_name = "core_l4_clkdm", | 1565 | .clkdm_name = "core_l4_clkdm", |
1776 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1566 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1778,21 +1568,9 @@ static struct clk i2c1_ick = { | |||
1778 | .recalc = &followparent_recalc, | 1568 | .recalc = &followparent_recalc, |
1779 | }; | 1569 | }; |
1780 | 1570 | ||
1781 | static struct clk i2c1_fck = { | ||
1782 | .name = "i2c_fck", | ||
1783 | .ops = &clkops_omap2_dflt_wait, | ||
1784 | .id = 1, | ||
1785 | .parent = &func_12m_ck, | ||
1786 | .clkdm_name = "core_l4_clkdm", | ||
1787 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1788 | .enable_bit = OMAP2420_EN_I2C1_SHIFT, | ||
1789 | .recalc = &followparent_recalc, | ||
1790 | }; | ||
1791 | |||
1792 | static struct clk i2chs1_fck = { | 1571 | static struct clk i2chs1_fck = { |
1793 | .name = "i2c_fck", | 1572 | .name = "i2chs1_fck", |
1794 | .ops = &clkops_omap2430_i2chs_wait, | 1573 | .ops = &clkops_omap2430_i2chs_wait, |
1795 | .id = 1, | ||
1796 | .parent = &func_96m_ck, | 1574 | .parent = &func_96m_ck, |
1797 | .clkdm_name = "core_l4_clkdm", | 1575 | .clkdm_name = "core_l4_clkdm", |
1798 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1576 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
@@ -1825,58 +1603,6 @@ static struct clk sdma_ick = { | |||
1825 | .recalc = &followparent_recalc, | 1603 | .recalc = &followparent_recalc, |
1826 | }; | 1604 | }; |
1827 | 1605 | ||
1828 | static struct clk vlynq_ick = { | ||
1829 | .name = "vlynq_ick", | ||
1830 | .ops = &clkops_omap2_dflt_wait, | ||
1831 | .parent = &core_l3_ck, | ||
1832 | .clkdm_name = "core_l3_clkdm", | ||
1833 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
1834 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, | ||
1835 | .recalc = &followparent_recalc, | ||
1836 | }; | ||
1837 | |||
1838 | static const struct clksel_rate vlynq_fck_96m_rates[] = { | ||
1839 | { .div = 1, .val = 0, .flags = RATE_IN_242X | DEFAULT_RATE }, | ||
1840 | { .div = 0 } | ||
1841 | }; | ||
1842 | |||
1843 | static const struct clksel_rate vlynq_fck_core_rates[] = { | ||
1844 | { .div = 1, .val = 1, .flags = RATE_IN_242X }, | ||
1845 | { .div = 2, .val = 2, .flags = RATE_IN_242X }, | ||
1846 | { .div = 3, .val = 3, .flags = RATE_IN_242X }, | ||
1847 | { .div = 4, .val = 4, .flags = RATE_IN_242X }, | ||
1848 | { .div = 6, .val = 6, .flags = RATE_IN_242X }, | ||
1849 | { .div = 8, .val = 8, .flags = RATE_IN_242X }, | ||
1850 | { .div = 9, .val = 9, .flags = RATE_IN_242X }, | ||
1851 | { .div = 12, .val = 12, .flags = RATE_IN_242X }, | ||
1852 | { .div = 16, .val = 16, .flags = RATE_IN_242X | DEFAULT_RATE }, | ||
1853 | { .div = 18, .val = 18, .flags = RATE_IN_242X }, | ||
1854 | { .div = 0 } | ||
1855 | }; | ||
1856 | |||
1857 | static const struct clksel vlynq_fck_clksel[] = { | ||
1858 | { .parent = &func_96m_ck, .rates = vlynq_fck_96m_rates }, | ||
1859 | { .parent = &core_ck, .rates = vlynq_fck_core_rates }, | ||
1860 | { .parent = NULL } | ||
1861 | }; | ||
1862 | |||
1863 | static struct clk vlynq_fck = { | ||
1864 | .name = "vlynq_fck", | ||
1865 | .ops = &clkops_omap2_dflt_wait, | ||
1866 | .parent = &func_96m_ck, | ||
1867 | .flags = DELAYED_APP, | ||
1868 | .clkdm_name = "core_l3_clkdm", | ||
1869 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | ||
1870 | .enable_bit = OMAP2420_EN_VLYNQ_SHIFT, | ||
1871 | .init = &omap2_init_clksel_parent, | ||
1872 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL1), | ||
1873 | .clksel_mask = OMAP2420_CLKSEL_VLYNQ_MASK, | ||
1874 | .clksel = vlynq_fck_clksel, | ||
1875 | .recalc = &omap2_clksel_recalc, | ||
1876 | .round_rate = &omap2_clksel_round_rate, | ||
1877 | .set_rate = &omap2_clksel_set_rate | ||
1878 | }; | ||
1879 | |||
1880 | static struct clk sdrc_ick = { | 1606 | static struct clk sdrc_ick = { |
1881 | .name = "sdrc_ick", | 1607 | .name = "sdrc_ick", |
1882 | .ops = &clkops_omap2_dflt_wait, | 1608 | .ops = &clkops_omap2_dflt_wait, |
@@ -1959,7 +1685,7 @@ static struct clk usbhs_ick = { | |||
1959 | }; | 1685 | }; |
1960 | 1686 | ||
1961 | static struct clk mmchs1_ick = { | 1687 | static struct clk mmchs1_ick = { |
1962 | .name = "mmchs_ick", | 1688 | .name = "mmchs1_ick", |
1963 | .ops = &clkops_omap2_dflt_wait, | 1689 | .ops = &clkops_omap2_dflt_wait, |
1964 | .parent = &l4_ck, | 1690 | .parent = &l4_ck, |
1965 | .clkdm_name = "core_l4_clkdm", | 1691 | .clkdm_name = "core_l4_clkdm", |
@@ -1969,7 +1695,7 @@ static struct clk mmchs1_ick = { | |||
1969 | }; | 1695 | }; |
1970 | 1696 | ||
1971 | static struct clk mmchs1_fck = { | 1697 | static struct clk mmchs1_fck = { |
1972 | .name = "mmchs_fck", | 1698 | .name = "mmchs1_fck", |
1973 | .ops = &clkops_omap2_dflt_wait, | 1699 | .ops = &clkops_omap2_dflt_wait, |
1974 | .parent = &func_96m_ck, | 1700 | .parent = &func_96m_ck, |
1975 | .clkdm_name = "core_l3_clkdm", | 1701 | .clkdm_name = "core_l3_clkdm", |
@@ -1979,9 +1705,8 @@ static struct clk mmchs1_fck = { | |||
1979 | }; | 1705 | }; |
1980 | 1706 | ||
1981 | static struct clk mmchs2_ick = { | 1707 | static struct clk mmchs2_ick = { |
1982 | .name = "mmchs_ick", | 1708 | .name = "mmchs2_ick", |
1983 | .ops = &clkops_omap2_dflt_wait, | 1709 | .ops = &clkops_omap2_dflt_wait, |
1984 | .id = 1, | ||
1985 | .parent = &l4_ck, | 1710 | .parent = &l4_ck, |
1986 | .clkdm_name = "core_l4_clkdm", | 1711 | .clkdm_name = "core_l4_clkdm", |
1987 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), | 1712 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), |
@@ -1990,9 +1715,8 @@ static struct clk mmchs2_ick = { | |||
1990 | }; | 1715 | }; |
1991 | 1716 | ||
1992 | static struct clk mmchs2_fck = { | 1717 | static struct clk mmchs2_fck = { |
1993 | .name = "mmchs_fck", | 1718 | .name = "mmchs2_fck", |
1994 | .ops = &clkops_omap2_dflt_wait, | 1719 | .ops = &clkops_omap2_dflt_wait, |
1995 | .id = 1, | ||
1996 | .parent = &func_96m_ck, | 1720 | .parent = &func_96m_ck, |
1997 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1721 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
1998 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, | 1722 | .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, |
@@ -2030,7 +1754,7 @@ static struct clk mdm_intc_ick = { | |||
2030 | }; | 1754 | }; |
2031 | 1755 | ||
2032 | static struct clk mmchsdb1_fck = { | 1756 | static struct clk mmchsdb1_fck = { |
2033 | .name = "mmchsdb_fck", | 1757 | .name = "mmchsdb1_fck", |
2034 | .ops = &clkops_omap2_dflt_wait, | 1758 | .ops = &clkops_omap2_dflt_wait, |
2035 | .parent = &func_32k_ck, | 1759 | .parent = &func_32k_ck, |
2036 | .clkdm_name = "core_l4_clkdm", | 1760 | .clkdm_name = "core_l4_clkdm", |
@@ -2040,9 +1764,8 @@ static struct clk mmchsdb1_fck = { | |||
2040 | }; | 1764 | }; |
2041 | 1765 | ||
2042 | static struct clk mmchsdb2_fck = { | 1766 | static struct clk mmchsdb2_fck = { |
2043 | .name = "mmchsdb_fck", | 1767 | .name = "mmchsdb2_fck", |
2044 | .ops = &clkops_omap2_dflt_wait, | 1768 | .ops = &clkops_omap2_dflt_wait, |
2045 | .id = 1, | ||
2046 | .parent = &func_32k_ck, | 1769 | .parent = &func_32k_ck, |
2047 | .clkdm_name = "core_l4_clkdm", | 1770 | .clkdm_name = "core_l4_clkdm", |
2048 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), | 1771 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), |
@@ -2067,7 +1790,6 @@ static struct clk mmchsdb2_fck = { | |||
2067 | static struct clk virt_prcm_set = { | 1790 | static struct clk virt_prcm_set = { |
2068 | .name = "virt_prcm_set", | 1791 | .name = "virt_prcm_set", |
2069 | .ops = &clkops_null, | 1792 | .ops = &clkops_null, |
2070 | .flags = DELAYED_APP, | ||
2071 | .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ | 1793 | .parent = &mpu_ck, /* Indexed by mpu speed, no parent */ |
2072 | .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */ | 1794 | .recalc = &omap2_table_mpu_recalc, /* sets are keyed on mpu rate */ |
2073 | .set_rate = &omap2_select_table_rate, | 1795 | .set_rate = &omap2_select_table_rate, |
@@ -2079,149 +1801,134 @@ static struct clk virt_prcm_set = { | |||
2079 | * clkdev integration | 1801 | * clkdev integration |
2080 | */ | 1802 | */ |
2081 | 1803 | ||
2082 | static struct omap_clk omap24xx_clks[] = { | 1804 | static struct omap_clk omap2430_clks[] = { |
2083 | /* external root sources */ | 1805 | /* external root sources */ |
2084 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X | CK_242X), | 1806 | CLK(NULL, "func_32k_ck", &func_32k_ck, CK_243X), |
2085 | CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X | CK_242X), | 1807 | CLK(NULL, "secure_32k_ck", &secure_32k_ck, CK_243X), |
2086 | CLK(NULL, "osc_ck", &osc_ck, CK_243X | CK_242X), | 1808 | CLK(NULL, "osc_ck", &osc_ck, CK_243X), |
2087 | CLK(NULL, "sys_ck", &sys_ck, CK_243X | CK_242X), | 1809 | CLK(NULL, "sys_ck", &sys_ck, CK_243X), |
2088 | CLK(NULL, "alt_ck", &alt_ck, CK_243X | CK_242X), | 1810 | CLK(NULL, "alt_ck", &alt_ck, CK_243X), |
2089 | /* internal analog sources */ | 1811 | /* internal analog sources */ |
2090 | CLK(NULL, "dpll_ck", &dpll_ck, CK_243X | CK_242X), | 1812 | CLK(NULL, "dpll_ck", &dpll_ck, CK_243X), |
2091 | CLK(NULL, "apll96_ck", &apll96_ck, CK_243X | CK_242X), | 1813 | CLK(NULL, "apll96_ck", &apll96_ck, CK_243X), |
2092 | CLK(NULL, "apll54_ck", &apll54_ck, CK_243X | CK_242X), | 1814 | CLK(NULL, "apll54_ck", &apll54_ck, CK_243X), |
2093 | /* internal prcm root sources */ | 1815 | /* internal prcm root sources */ |
2094 | CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X | CK_242X), | 1816 | CLK(NULL, "func_54m_ck", &func_54m_ck, CK_243X), |
2095 | CLK(NULL, "core_ck", &core_ck, CK_243X | CK_242X), | 1817 | CLK(NULL, "core_ck", &core_ck, CK_243X), |
2096 | CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X | CK_242X), | 1818 | CLK(NULL, "func_96m_ck", &func_96m_ck, CK_243X), |
2097 | CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X | CK_242X), | 1819 | CLK(NULL, "func_48m_ck", &func_48m_ck, CK_243X), |
2098 | CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X | CK_242X), | 1820 | CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X), |
2099 | CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X | CK_242X), | 1821 | CLK(NULL, "ck_wdt1_osc", &wdt1_osc_ck, CK_243X), |
2100 | CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X | CK_242X), | 1822 | CLK(NULL, "sys_clkout_src", &sys_clkout_src, CK_243X), |
2101 | CLK(NULL, "sys_clkout", &sys_clkout, CK_243X | CK_242X), | 1823 | CLK(NULL, "sys_clkout", &sys_clkout, CK_243X), |
2102 | CLK(NULL, "sys_clkout2_src", &sys_clkout2_src, CK_242X), | 1824 | CLK(NULL, "emul_ck", &emul_ck, CK_243X), |
2103 | CLK(NULL, "sys_clkout2", &sys_clkout2, CK_242X), | ||
2104 | CLK(NULL, "emul_ck", &emul_ck, CK_242X), | ||
2105 | /* mpu domain clocks */ | 1825 | /* mpu domain clocks */ |
2106 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X | CK_242X), | 1826 | CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), |
2107 | /* dsp domain clocks */ | 1827 | /* dsp domain clocks */ |
2108 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X | CK_242X), | 1828 | CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), |
2109 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X | CK_242X), | 1829 | CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X), |
2110 | CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), | ||
2111 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), | 1830 | CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), |
2112 | CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), | ||
2113 | CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), | ||
2114 | /* GFX domain clocks */ | 1831 | /* GFX domain clocks */ |
2115 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X | CK_242X), | 1832 | CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), |
2116 | CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X | CK_242X), | 1833 | CLK(NULL, "gfx_2d_fck", &gfx_2d_fck, CK_243X), |
2117 | CLK(NULL, "gfx_ick", &gfx_ick, CK_243X | CK_242X), | 1834 | CLK(NULL, "gfx_ick", &gfx_ick, CK_243X), |
2118 | /* Modem domain clocks */ | 1835 | /* Modem domain clocks */ |
2119 | CLK(NULL, "mdm_ick", &mdm_ick, CK_243X), | 1836 | CLK(NULL, "mdm_ick", &mdm_ick, CK_243X), |
2120 | CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), | 1837 | CLK(NULL, "mdm_osc_ck", &mdm_osc_ck, CK_243X), |
2121 | /* DSS domain clocks */ | 1838 | /* DSS domain clocks */ |
2122 | CLK("omapdss", "ick", &dss_ick, CK_243X | CK_242X), | 1839 | CLK("omapdss", "ick", &dss_ick, CK_243X), |
2123 | CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X | CK_242X), | 1840 | CLK("omapdss", "dss1_fck", &dss1_fck, CK_243X), |
2124 | CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X | CK_242X), | 1841 | CLK("omapdss", "dss2_fck", &dss2_fck, CK_243X), |
2125 | CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X | CK_242X), | 1842 | CLK("omapdss", "tv_fck", &dss_54m_fck, CK_243X), |
2126 | /* L3 domain clocks */ | 1843 | /* L3 domain clocks */ |
2127 | CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X | CK_242X), | 1844 | CLK(NULL, "core_l3_ck", &core_l3_ck, CK_243X), |
2128 | CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X | CK_242X), | 1845 | CLK(NULL, "ssi_fck", &ssi_ssr_sst_fck, CK_243X), |
2129 | CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X | CK_242X), | 1846 | CLK(NULL, "usb_l4_ick", &usb_l4_ick, CK_243X), |
2130 | /* L4 domain clocks */ | 1847 | /* L4 domain clocks */ |
2131 | CLK(NULL, "l4_ck", &l4_ck, CK_243X | CK_242X), | 1848 | CLK(NULL, "l4_ck", &l4_ck, CK_243X), |
2132 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X | CK_242X), | 1849 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), |
2133 | /* virtual meta-group clock */ | 1850 | /* virtual meta-group clock */ |
2134 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X | CK_242X), | 1851 | CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), |
2135 | /* general l4 interface ck, multi-parent functional clk */ | 1852 | /* general l4 interface ck, multi-parent functional clk */ |
2136 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X | CK_242X), | 1853 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_243X), |
2137 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X | CK_242X), | 1854 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_243X), |
2138 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X | CK_242X), | 1855 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_243X), |
2139 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X | CK_242X), | 1856 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_243X), |
2140 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X | CK_242X), | 1857 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_243X), |
2141 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X | CK_242X), | 1858 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_243X), |
2142 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X | CK_242X), | 1859 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_243X), |
2143 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X | CK_242X), | 1860 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_243X), |
2144 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X | CK_242X), | 1861 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_243X), |
2145 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X | CK_242X), | 1862 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_243X), |
2146 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X | CK_242X), | 1863 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_243X), |
2147 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X | CK_242X), | 1864 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_243X), |
2148 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X | CK_242X), | 1865 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_243X), |
2149 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X | CK_242X), | 1866 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_243X), |
2150 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X | CK_242X), | 1867 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_243X), |
2151 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X | CK_242X), | 1868 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_243X), |
2152 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X | CK_242X), | 1869 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_243X), |
2153 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X | CK_242X), | 1870 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_243X), |
2154 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X | CK_242X), | 1871 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_243X), |
2155 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X | CK_242X), | 1872 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_243X), |
2156 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X | CK_242X), | 1873 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_243X), |
2157 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X | CK_242X), | 1874 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_243X), |
2158 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X | CK_242X), | 1875 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_243X), |
2159 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X | CK_242X), | 1876 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_243X), |
2160 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X | CK_242X), | 1877 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_243X), |
2161 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X | CK_242X), | 1878 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_243X), |
2162 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X | CK_242X), | 1879 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_243X), |
2163 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X | CK_242X), | 1880 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_243X), |
2164 | CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X), | 1881 | CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_243X), |
2165 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X), | 1882 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_243X), |
2166 | CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X), | 1883 | CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_243X), |
2167 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X), | 1884 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_243X), |
2168 | CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X), | 1885 | CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_243X), |
2169 | CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X), | 1886 | CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_243X), |
2170 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X | CK_242X), | 1887 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_243X), |
2171 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X | CK_242X), | 1888 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_243X), |
2172 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X | CK_242X), | 1889 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_243X), |
2173 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X | CK_242X), | 1890 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_243X), |
2174 | CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X), | 1891 | CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_243X), |
2175 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X), | 1892 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_243X), |
2176 | CLK(NULL, "uart1_ick", &uart1_ick, CK_243X | CK_242X), | 1893 | CLK(NULL, "uart1_ick", &uart1_ick, CK_243X), |
2177 | CLK(NULL, "uart1_fck", &uart1_fck, CK_243X | CK_242X), | 1894 | CLK(NULL, "uart1_fck", &uart1_fck, CK_243X), |
2178 | CLK(NULL, "uart2_ick", &uart2_ick, CK_243X | CK_242X), | 1895 | CLK(NULL, "uart2_ick", &uart2_ick, CK_243X), |
2179 | CLK(NULL, "uart2_fck", &uart2_fck, CK_243X | CK_242X), | 1896 | CLK(NULL, "uart2_fck", &uart2_fck, CK_243X), |
2180 | CLK(NULL, "uart3_ick", &uart3_ick, CK_243X | CK_242X), | 1897 | CLK(NULL, "uart3_ick", &uart3_ick, CK_243X), |
2181 | CLK(NULL, "uart3_fck", &uart3_fck, CK_243X | CK_242X), | 1898 | CLK(NULL, "uart3_fck", &uart3_fck, CK_243X), |
2182 | CLK(NULL, "gpios_ick", &gpios_ick, CK_243X | CK_242X), | 1899 | CLK(NULL, "gpios_ick", &gpios_ick, CK_243X), |
2183 | CLK(NULL, "gpios_fck", &gpios_fck, CK_243X | CK_242X), | 1900 | CLK(NULL, "gpios_fck", &gpios_fck, CK_243X), |
2184 | CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X | CK_242X), | 1901 | CLK("omap_wdt", "ick", &mpu_wdt_ick, CK_243X), |
2185 | CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X | CK_242X), | 1902 | CLK("omap_wdt", "fck", &mpu_wdt_fck, CK_243X), |
2186 | CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X | CK_242X), | 1903 | CLK(NULL, "sync_32k_ick", &sync_32k_ick, CK_243X), |
2187 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X | CK_242X), | 1904 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_243X), |
2188 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X | CK_242X), | 1905 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_243X), |
2189 | CLK(NULL, "icr_ick", &icr_ick, CK_243X), | 1906 | CLK(NULL, "icr_ick", &icr_ick, CK_243X), |
2190 | CLK("omap24xxcam", "fck", &cam_fck, CK_243X | CK_242X), | 1907 | CLK("omap24xxcam", "fck", &cam_fck, CK_243X), |
2191 | CLK("omap24xxcam", "ick", &cam_ick, CK_243X | CK_242X), | 1908 | CLK("omap24xxcam", "ick", &cam_ick, CK_243X), |
2192 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X | CK_242X), | 1909 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_243X), |
2193 | CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X | CK_242X), | 1910 | CLK(NULL, "wdt4_ick", &wdt4_ick, CK_243X), |
2194 | CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X | CK_242X), | 1911 | CLK(NULL, "wdt4_fck", &wdt4_fck, CK_243X), |
2195 | CLK(NULL, "wdt3_ick", &wdt3_ick, CK_242X), | 1912 | CLK(NULL, "mspro_ick", &mspro_ick, CK_243X), |
2196 | CLK(NULL, "wdt3_fck", &wdt3_fck, CK_242X), | 1913 | CLK(NULL, "mspro_fck", &mspro_fck, CK_243X), |
2197 | CLK(NULL, "mspro_ick", &mspro_ick, CK_243X | CK_242X), | 1914 | CLK(NULL, "fac_ick", &fac_ick, CK_243X), |
2198 | CLK(NULL, "mspro_fck", &mspro_fck, CK_243X | CK_242X), | 1915 | CLK(NULL, "fac_fck", &fac_fck, CK_243X), |
2199 | CLK("mmci-omap.0", "ick", &mmc_ick, CK_242X), | 1916 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X), |
2200 | CLK("mmci-omap.0", "fck", &mmc_fck, CK_242X), | 1917 | CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X), |
2201 | CLK(NULL, "fac_ick", &fac_ick, CK_243X | CK_242X), | 1918 | CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X), |
2202 | CLK(NULL, "fac_fck", &fac_fck, CK_243X | CK_242X), | ||
2203 | CLK(NULL, "eac_ick", &eac_ick, CK_242X), | ||
2204 | CLK(NULL, "eac_fck", &eac_fck, CK_242X), | ||
2205 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_243X | CK_242X), | ||
2206 | CLK("omap_hdq.1", "fck", &hdq_fck, CK_243X | CK_242X), | ||
2207 | CLK("i2c_omap.1", "ick", &i2c1_ick, CK_243X | CK_242X), | ||
2208 | CLK("i2c_omap.1", "fck", &i2c1_fck, CK_242X), | ||
2209 | CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X), | 1919 | CLK("i2c_omap.1", "fck", &i2chs1_fck, CK_243X), |
2210 | CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X | CK_242X), | 1920 | CLK("i2c_omap.2", "ick", &i2c2_ick, CK_243X), |
2211 | CLK("i2c_omap.2", "fck", &i2c2_fck, CK_242X), | ||
2212 | CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X), | 1921 | CLK("i2c_omap.2", "fck", &i2chs2_fck, CK_243X), |
2213 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X | CK_242X), | 1922 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_243X), |
2214 | CLK(NULL, "sdma_fck", &sdma_fck, CK_243X | CK_242X), | 1923 | CLK(NULL, "sdma_fck", &sdma_fck, CK_243X), |
2215 | CLK(NULL, "sdma_ick", &sdma_ick, CK_243X | CK_242X), | 1924 | CLK(NULL, "sdma_ick", &sdma_ick, CK_243X), |
2216 | CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), | ||
2217 | CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), | ||
2218 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X), | 1925 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_243X), |
2219 | CLK(NULL, "des_ick", &des_ick, CK_243X | CK_242X), | 1926 | CLK(NULL, "des_ick", &des_ick, CK_243X), |
2220 | CLK(NULL, "sha_ick", &sha_ick, CK_243X | CK_242X), | 1927 | CLK(NULL, "sha_ick", &sha_ick, CK_243X), |
2221 | CLK("omap_rng", "ick", &rng_ick, CK_243X | CK_242X), | 1928 | CLK("omap_rng", "ick", &rng_ick, CK_243X), |
2222 | CLK(NULL, "aes_ick", &aes_ick, CK_243X | CK_242X), | 1929 | CLK(NULL, "aes_ick", &aes_ick, CK_243X), |
2223 | CLK(NULL, "pka_ick", &pka_ick, CK_243X | CK_242X), | 1930 | CLK(NULL, "pka_ick", &pka_ick, CK_243X), |
2224 | CLK(NULL, "usb_fck", &usb_fck, CK_243X | CK_242X), | 1931 | CLK(NULL, "usb_fck", &usb_fck, CK_243X), |
2225 | CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X), | 1932 | CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X), |
2226 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), | 1933 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), |
2227 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), | 1934 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), |
@@ -2238,41 +1945,34 @@ static struct omap_clk omap24xx_clks[] = { | |||
2238 | * init code | 1945 | * init code |
2239 | */ | 1946 | */ |
2240 | 1947 | ||
2241 | int __init omap2_clk_init(void) | 1948 | int __init omap2430_clk_init(void) |
2242 | { | 1949 | { |
2243 | const struct prcm_config *prcm; | 1950 | const struct prcm_config *prcm; |
2244 | struct omap_clk *c; | 1951 | struct omap_clk *c; |
2245 | u32 clkrate; | 1952 | u32 clkrate; |
2246 | u16 cpu_clkflg; | 1953 | |
2247 | 1954 | prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL; | |
2248 | if (cpu_is_omap242x()) { | 1955 | cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST); |
2249 | prcm_clksrc_ctrl = OMAP2420_PRCM_CLKSRC_CTRL; | 1956 | cpu_mask = RATE_IN_243X; |
2250 | cpu_mask = RATE_IN_242X; | 1957 | rate_table = omap2430_rate_table; |
2251 | cpu_clkflg = CK_242X; | ||
2252 | rate_table = omap2420_rate_table; | ||
2253 | } else if (cpu_is_omap2430()) { | ||
2254 | prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL; | ||
2255 | cpu_mask = RATE_IN_243X; | ||
2256 | cpu_clkflg = CK_243X; | ||
2257 | rate_table = omap2430_rate_table; | ||
2258 | } | ||
2259 | 1958 | ||
2260 | clk_init(&omap2_clk_functions); | 1959 | clk_init(&omap2_clk_functions); |
2261 | 1960 | ||
2262 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) | 1961 | for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks); |
1962 | c++) | ||
2263 | clk_preinit(c->lk.clk); | 1963 | clk_preinit(c->lk.clk); |
2264 | 1964 | ||
2265 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); | 1965 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); |
2266 | propagate_rate(&osc_ck); | 1966 | propagate_rate(&osc_ck); |
2267 | sys_ck.rate = omap2_sys_clk_recalc(&sys_ck); | 1967 | sys_ck.rate = omap2xxx_sys_clk_recalc(&sys_ck); |
2268 | propagate_rate(&sys_ck); | 1968 | propagate_rate(&sys_ck); |
2269 | 1969 | ||
2270 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) | 1970 | for (c = omap2430_clks; c < omap2430_clks + ARRAY_SIZE(omap2430_clks); |
2271 | if (c->cpu & cpu_clkflg) { | 1971 | c++) { |
2272 | clkdev_add(&c->lk); | 1972 | clkdev_add(&c->lk); |
2273 | clk_register(c->lk.clk); | 1973 | clk_register(c->lk.clk); |
2274 | omap2_init_clk_clkdm(c->lk.clk); | 1974 | omap2_init_clk_clkdm(c->lk.clk); |
2275 | } | 1975 | } |
2276 | 1976 | ||
2277 | /* Check the MPU rate set by bootloader */ | 1977 | /* Check the MPU rate set by bootloader */ |
2278 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); | 1978 | clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); |
@@ -2288,10 +1988,9 @@ int __init omap2_clk_init(void) | |||
2288 | 1988 | ||
2289 | recalculate_root_clocks(); | 1989 | recalculate_root_clocks(); |
2290 | 1990 | ||
2291 | printk(KERN_INFO "Clocking rate (Crystal/DPLL/MPU): " | 1991 | pr_info("Clocking rate (Crystal/DPLL/MPU): %ld.%01ld/%ld/%ld MHz\n", |
2292 | "%ld.%01ld/%ld/%ld MHz\n", | 1992 | (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10, |
2293 | (sys_ck.rate / 1000000), (sys_ck.rate / 100000) % 10, | 1993 | (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ; |
2294 | (dpll_ck.rate / 1000000), (mpu_ck.rate / 1000000)) ; | ||
2295 | 1994 | ||
2296 | /* | 1995 | /* |
2297 | * Only enable those clocks we will need, let the drivers | 1996 | * Only enable those clocks we will need, let the drivers |
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c index d0e3fb7f9298..80bb0f0e92e6 100644 --- a/arch/arm/mach-omap2/clock2xxx.c +++ b/arch/arm/mach-omap2/clock2xxx.c | |||
@@ -1,15 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-omap2/clock.c | 2 | * clock2xxx.c - OMAP2xxx-specific clock integration code |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2008 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2008 Nokia Corporation | 5 | * Copyright (C) 2004-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Contacts: | 7 | * Contacts: |
8 | * Richard Woodruff <r-woodruff2@ti.com> | 8 | * Richard Woodruff <r-woodruff2@ti.com> |
9 | * Paul Walmsley | 9 | * Paul Walmsley |
10 | * | 10 | * |
11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, | 11 | * Based on earlier work by Tuukka Tikkanen, Tony Lindgren, |
12 | * Gordon McNutt and RidgeRun, Inc. | 12 | * Gordon McNutt and RidgeRun, Inc. |
13 | * | 13 | * |
14 | * This program is free software; you can redistribute it and/or modify | 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 | 15 | * it under the terms of the GNU General Public License version 2 as |
@@ -17,529 +17,28 @@ | |||
17 | */ | 17 | */ |
18 | #undef DEBUG | 18 | #undef DEBUG |
19 | 19 | ||
20 | #include <linux/module.h> | ||
21 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
22 | #include <linux/device.h> | ||
23 | #include <linux/list.h> | ||
24 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
25 | #include <linux/delay.h> | ||
26 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
27 | #include <linux/io.h> | 23 | #include <linux/io.h> |
28 | #include <linux/cpufreq.h> | ||
29 | #include <linux/bitops.h> | ||
30 | 24 | ||
31 | #include <plat/clock.h> | 25 | #include <plat/clock.h> |
32 | #include <plat/sram.h> | ||
33 | #include <plat/prcm.h> | ||
34 | #include <plat/clkdev_omap.h> | ||
35 | #include <asm/div64.h> | ||
36 | #include <asm/clkdev.h> | ||
37 | 26 | ||
38 | #include <plat/sdrc.h> | ||
39 | #include "clock.h" | 27 | #include "clock.h" |
40 | #include "clock2xxx.h" | 28 | #include "clock2xxx.h" |
41 | #include "opp2xxx.h" | ||
42 | #include "prm.h" | ||
43 | #include "prm-regbits-24xx.h" | ||
44 | #include "cm.h" | 29 | #include "cm.h" |
45 | #include "cm-regbits-24xx.h" | 30 | #include "cm-regbits-24xx.h" |
46 | 31 | ||
47 | |||
48 | /* CM_CLKEN_PLL.EN_{54,96}M_PLL options (24XX) */ | ||
49 | #define EN_APLL_STOPPED 0 | ||
50 | #define EN_APLL_LOCKED 3 | ||
51 | |||
52 | /* CM_CLKSEL1_PLL.APLLS_CLKIN options (24XX) */ | ||
53 | #define APLLS_CLKIN_19_2MHZ 0 | ||
54 | #define APLLS_CLKIN_13MHZ 2 | ||
55 | #define APLLS_CLKIN_12MHZ 3 | ||
56 | |||
57 | /* #define DOWN_VARIABLE_DPLL 1 */ /* Experimental */ | ||
58 | |||
59 | const struct prcm_config *curr_prcm_set; | ||
60 | const struct prcm_config *rate_table; | ||
61 | |||
62 | struct clk *vclk, *sclk, *dclk; | 32 | struct clk *vclk, *sclk, *dclk; |
63 | 33 | ||
64 | void __iomem *prcm_clksrc_ctrl; | ||
65 | |||
66 | /*------------------------------------------------------------------------- | ||
67 | * Omap24xx specific clock functions | ||
68 | *-------------------------------------------------------------------------*/ | ||
69 | |||
70 | /** | ||
71 | * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS | ||
72 | * @clk: struct clk * being enabled | ||
73 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | ||
74 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | ||
75 | * | ||
76 | * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the | ||
77 | * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function | ||
78 | * passes back the correct CM_IDLEST register address for I2CHS | ||
79 | * modules. No return value. | ||
80 | */ | ||
81 | static void omap2430_clk_i2chs_find_idlest(struct clk *clk, | ||
82 | void __iomem **idlest_reg, | ||
83 | u8 *idlest_bit) | ||
84 | { | ||
85 | *idlest_reg = OMAP_CM_REGADDR(CORE_MOD, CM_IDLEST); | ||
86 | *idlest_bit = clk->enable_bit; | ||
87 | } | ||
88 | |||
89 | /* 2430 I2CHS has non-standard IDLEST register */ | ||
90 | const struct clkops clkops_omap2430_i2chs_wait = { | ||
91 | .enable = omap2_dflt_clk_enable, | ||
92 | .disable = omap2_dflt_clk_disable, | ||
93 | .find_idlest = omap2430_clk_i2chs_find_idlest, | ||
94 | .find_companion = omap2_clk_dflt_find_companion, | ||
95 | }; | ||
96 | |||
97 | /** | ||
98 | * omap2xxx_clk_get_core_rate - return the CORE_CLK rate | ||
99 | * @clk: pointer to the combined dpll_ck + core_ck (currently "dpll_ck") | ||
100 | * | ||
101 | * Returns the CORE_CLK rate. CORE_CLK can have one of three rate | ||
102 | * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz | ||
103 | * (the latter is unusual). This currently should be called with | ||
104 | * struct clk *dpll_ck, which is a composite clock of dpll_ck and | ||
105 | * core_ck. | ||
106 | */ | ||
107 | unsigned long omap2xxx_clk_get_core_rate(struct clk *clk) | ||
108 | { | ||
109 | long long core_clk; | ||
110 | u32 v; | ||
111 | |||
112 | core_clk = omap2_get_dpll_rate(clk); | ||
113 | |||
114 | v = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
115 | v &= OMAP24XX_CORE_CLK_SRC_MASK; | ||
116 | |||
117 | if (v == CORE_CLK_SRC_32K) | ||
118 | core_clk = 32768; | ||
119 | else | ||
120 | core_clk *= v; | ||
121 | |||
122 | return core_clk; | ||
123 | } | ||
124 | |||
125 | static int omap2_enable_osc_ck(struct clk *clk) | ||
126 | { | ||
127 | u32 pcc; | ||
128 | |||
129 | pcc = __raw_readl(prcm_clksrc_ctrl); | ||
130 | |||
131 | __raw_writel(pcc & ~OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl); | ||
132 | |||
133 | return 0; | ||
134 | } | ||
135 | |||
136 | static void omap2_disable_osc_ck(struct clk *clk) | ||
137 | { | ||
138 | u32 pcc; | ||
139 | |||
140 | pcc = __raw_readl(prcm_clksrc_ctrl); | ||
141 | |||
142 | __raw_writel(pcc | OMAP_AUTOEXTCLKMODE_MASK, prcm_clksrc_ctrl); | ||
143 | } | ||
144 | |||
145 | const struct clkops clkops_oscck = { | ||
146 | .enable = omap2_enable_osc_ck, | ||
147 | .disable = omap2_disable_osc_ck, | ||
148 | }; | ||
149 | |||
150 | #ifdef OLD_CK | ||
151 | /* Recalculate SYST_CLK */ | ||
152 | static void omap2_sys_clk_recalc(struct clk *clk) | ||
153 | { | ||
154 | u32 div = PRCM_CLKSRC_CTRL; | ||
155 | div &= (1 << 7) | (1 << 6); /* Test if ext clk divided by 1 or 2 */ | ||
156 | div >>= clk->rate_offset; | ||
157 | clk->rate = (clk->parent->rate / div); | ||
158 | propagate_rate(clk); | ||
159 | } | ||
160 | #endif /* OLD_CK */ | ||
161 | |||
162 | /* Enable an APLL if off */ | ||
163 | static int omap2_clk_apll_enable(struct clk *clk, u32 status_mask) | ||
164 | { | ||
165 | u32 cval, apll_mask; | ||
166 | |||
167 | apll_mask = EN_APLL_LOCKED << clk->enable_bit; | ||
168 | |||
169 | cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); | ||
170 | |||
171 | if ((cval & apll_mask) == apll_mask) | ||
172 | return 0; /* apll already enabled */ | ||
173 | |||
174 | cval &= ~apll_mask; | ||
175 | cval |= apll_mask; | ||
176 | cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); | ||
177 | |||
178 | omap2_cm_wait_idlest(OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), status_mask, | ||
179 | clk->name); | ||
180 | |||
181 | /* | ||
182 | * REVISIT: Should we return an error code if omap2_wait_clock_ready() | ||
183 | * fails? | ||
184 | */ | ||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | static int omap2_clk_apll96_enable(struct clk *clk) | ||
189 | { | ||
190 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_96M_APLL); | ||
191 | } | ||
192 | |||
193 | static int omap2_clk_apll54_enable(struct clk *clk) | ||
194 | { | ||
195 | return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL); | ||
196 | } | ||
197 | |||
198 | /* Stop APLL */ | ||
199 | static void omap2_clk_apll_disable(struct clk *clk) | ||
200 | { | ||
201 | u32 cval; | ||
202 | |||
203 | cval = cm_read_mod_reg(PLL_MOD, CM_CLKEN); | ||
204 | cval &= ~(EN_APLL_LOCKED << clk->enable_bit); | ||
205 | cm_write_mod_reg(cval, PLL_MOD, CM_CLKEN); | ||
206 | } | ||
207 | |||
208 | const struct clkops clkops_apll96 = { | ||
209 | .enable = omap2_clk_apll96_enable, | ||
210 | .disable = omap2_clk_apll_disable, | ||
211 | }; | ||
212 | |||
213 | const struct clkops clkops_apll54 = { | ||
214 | .enable = omap2_clk_apll54_enable, | ||
215 | .disable = omap2_clk_apll_disable, | ||
216 | }; | ||
217 | |||
218 | /* | 34 | /* |
219 | * Uses the current prcm set to tell if a rate is valid. | 35 | * Omap24xx specific clock functions |
220 | * You can go slower, but not faster within a given rate set. | ||
221 | */ | ||
222 | long omap2_dpllcore_round_rate(unsigned long target_rate) | ||
223 | { | ||
224 | u32 high, low, core_clk_src; | ||
225 | |||
226 | core_clk_src = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
227 | core_clk_src &= OMAP24XX_CORE_CLK_SRC_MASK; | ||
228 | |||
229 | if (core_clk_src == CORE_CLK_SRC_DPLL) { /* DPLL clockout */ | ||
230 | high = curr_prcm_set->dpll_speed * 2; | ||
231 | low = curr_prcm_set->dpll_speed; | ||
232 | } else { /* DPLL clockout x 2 */ | ||
233 | high = curr_prcm_set->dpll_speed; | ||
234 | low = curr_prcm_set->dpll_speed / 2; | ||
235 | } | ||
236 | |||
237 | #ifdef DOWN_VARIABLE_DPLL | ||
238 | if (target_rate > high) | ||
239 | return high; | ||
240 | else | ||
241 | return target_rate; | ||
242 | #else | ||
243 | if (target_rate > low) | ||
244 | return high; | ||
245 | else | ||
246 | return low; | ||
247 | #endif | ||
248 | |||
249 | } | ||
250 | |||
251 | unsigned long omap2_dpllcore_recalc(struct clk *clk) | ||
252 | { | ||
253 | return omap2xxx_clk_get_core_rate(clk); | ||
254 | } | ||
255 | |||
256 | int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | ||
257 | { | ||
258 | u32 cur_rate, low, mult, div, valid_rate, done_rate; | ||
259 | u32 bypass = 0; | ||
260 | struct prcm_config tmpset; | ||
261 | const struct dpll_data *dd; | ||
262 | |||
263 | cur_rate = omap2xxx_clk_get_core_rate(dclk); | ||
264 | mult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
265 | mult &= OMAP24XX_CORE_CLK_SRC_MASK; | ||
266 | |||
267 | if ((rate == (cur_rate / 2)) && (mult == 2)) { | ||
268 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1); | ||
269 | } else if ((rate == (cur_rate * 2)) && (mult == 1)) { | ||
270 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
271 | } else if (rate != cur_rate) { | ||
272 | valid_rate = omap2_dpllcore_round_rate(rate); | ||
273 | if (valid_rate != rate) | ||
274 | return -EINVAL; | ||
275 | |||
276 | if (mult == 1) | ||
277 | low = curr_prcm_set->dpll_speed; | ||
278 | else | ||
279 | low = curr_prcm_set->dpll_speed / 2; | ||
280 | |||
281 | dd = clk->dpll_data; | ||
282 | if (!dd) | ||
283 | return -EINVAL; | ||
284 | |||
285 | tmpset.cm_clksel1_pll = __raw_readl(dd->mult_div1_reg); | ||
286 | tmpset.cm_clksel1_pll &= ~(dd->mult_mask | | ||
287 | dd->div1_mask); | ||
288 | div = ((curr_prcm_set->xtal_speed / 1000000) - 1); | ||
289 | tmpset.cm_clksel2_pll = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2); | ||
290 | tmpset.cm_clksel2_pll &= ~OMAP24XX_CORE_CLK_SRC_MASK; | ||
291 | if (rate > low) { | ||
292 | tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL_X2; | ||
293 | mult = ((rate / 2) / 1000000); | ||
294 | done_rate = CORE_CLK_SRC_DPLL_X2; | ||
295 | } else { | ||
296 | tmpset.cm_clksel2_pll |= CORE_CLK_SRC_DPLL; | ||
297 | mult = (rate / 1000000); | ||
298 | done_rate = CORE_CLK_SRC_DPLL; | ||
299 | } | ||
300 | tmpset.cm_clksel1_pll |= (div << __ffs(dd->mult_mask)); | ||
301 | tmpset.cm_clksel1_pll |= (mult << __ffs(dd->div1_mask)); | ||
302 | |||
303 | /* Worst case */ | ||
304 | tmpset.base_sdrc_rfr = SDRC_RFR_CTRL_BYPASS; | ||
305 | |||
306 | if (rate == curr_prcm_set->xtal_speed) /* If asking for 1-1 */ | ||
307 | bypass = 1; | ||
308 | |||
309 | /* For omap2xxx_sdrc_init_params() */ | ||
310 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
311 | |||
312 | /* Force dll lock mode */ | ||
313 | omap2_set_prcm(tmpset.cm_clksel1_pll, tmpset.base_sdrc_rfr, | ||
314 | bypass); | ||
315 | |||
316 | /* Errata: ret dll entry state */ | ||
317 | omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked()); | ||
318 | omap2xxx_sdrc_reprogram(done_rate, 0); | ||
319 | } | ||
320 | |||
321 | return 0; | ||
322 | } | ||
323 | |||
324 | /** | ||
325 | * omap2_table_mpu_recalc - just return the MPU speed | ||
326 | * @clk: virt_prcm_set struct clk | ||
327 | * | ||
328 | * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. | ||
329 | */ | ||
330 | unsigned long omap2_table_mpu_recalc(struct clk *clk) | ||
331 | { | ||
332 | return curr_prcm_set->mpu_speed; | ||
333 | } | ||
334 | |||
335 | /* | ||
336 | * Look for a rate equal or less than the target rate given a configuration set. | ||
337 | * | ||
338 | * What's not entirely clear is "which" field represents the key field. | ||
339 | * Some might argue L3-DDR, others ARM, others IVA. This code is simple and | ||
340 | * just uses the ARM rates. | ||
341 | */ | ||
342 | long omap2_round_to_table_rate(struct clk *clk, unsigned long rate) | ||
343 | { | ||
344 | const struct prcm_config *ptr; | ||
345 | long highest_rate; | ||
346 | long sys_ck_rate; | ||
347 | |||
348 | sys_ck_rate = clk_get_rate(sclk); | ||
349 | |||
350 | highest_rate = -EINVAL; | ||
351 | |||
352 | for (ptr = rate_table; ptr->mpu_speed; ptr++) { | ||
353 | if (!(ptr->flags & cpu_mask)) | ||
354 | continue; | ||
355 | if (ptr->xtal_speed != sys_ck_rate) | ||
356 | continue; | ||
357 | |||
358 | highest_rate = ptr->mpu_speed; | ||
359 | |||
360 | /* Can check only after xtal frequency check */ | ||
361 | if (ptr->mpu_speed <= rate) | ||
362 | break; | ||
363 | } | ||
364 | return highest_rate; | ||
365 | } | ||
366 | |||
367 | /* Sets basic clocks based on the specified rate */ | ||
368 | int omap2_select_table_rate(struct clk *clk, unsigned long rate) | ||
369 | { | ||
370 | u32 cur_rate, done_rate, bypass = 0, tmp; | ||
371 | const struct prcm_config *prcm; | ||
372 | unsigned long found_speed = 0; | ||
373 | unsigned long flags; | ||
374 | long sys_ck_rate; | ||
375 | |||
376 | sys_ck_rate = clk_get_rate(sclk); | ||
377 | |||
378 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
379 | if (!(prcm->flags & cpu_mask)) | ||
380 | continue; | ||
381 | |||
382 | if (prcm->xtal_speed != sys_ck_rate) | ||
383 | continue; | ||
384 | |||
385 | if (prcm->mpu_speed <= rate) { | ||
386 | found_speed = prcm->mpu_speed; | ||
387 | break; | ||
388 | } | ||
389 | } | ||
390 | |||
391 | if (!found_speed) { | ||
392 | printk(KERN_INFO "Could not set MPU rate to %luMHz\n", | ||
393 | rate / 1000000); | ||
394 | return -EINVAL; | ||
395 | } | ||
396 | |||
397 | curr_prcm_set = prcm; | ||
398 | cur_rate = omap2xxx_clk_get_core_rate(dclk); | ||
399 | |||
400 | if (prcm->dpll_speed == cur_rate / 2) { | ||
401 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL, 1); | ||
402 | } else if (prcm->dpll_speed == cur_rate * 2) { | ||
403 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
404 | } else if (prcm->dpll_speed != cur_rate) { | ||
405 | local_irq_save(flags); | ||
406 | |||
407 | if (prcm->dpll_speed == prcm->xtal_speed) | ||
408 | bypass = 1; | ||
409 | |||
410 | if ((prcm->cm_clksel2_pll & OMAP24XX_CORE_CLK_SRC_MASK) == | ||
411 | CORE_CLK_SRC_DPLL_X2) | ||
412 | done_rate = CORE_CLK_SRC_DPLL_X2; | ||
413 | else | ||
414 | done_rate = CORE_CLK_SRC_DPLL; | ||
415 | |||
416 | /* MPU divider */ | ||
417 | cm_write_mod_reg(prcm->cm_clksel_mpu, MPU_MOD, CM_CLKSEL); | ||
418 | |||
419 | /* dsp + iva1 div(2420), iva2.1(2430) */ | ||
420 | cm_write_mod_reg(prcm->cm_clksel_dsp, | ||
421 | OMAP24XX_DSP_MOD, CM_CLKSEL); | ||
422 | |||
423 | cm_write_mod_reg(prcm->cm_clksel_gfx, GFX_MOD, CM_CLKSEL); | ||
424 | |||
425 | /* Major subsystem dividers */ | ||
426 | tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; | ||
427 | cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, | ||
428 | CM_CLKSEL1); | ||
429 | |||
430 | if (cpu_is_omap2430()) | ||
431 | cm_write_mod_reg(prcm->cm_clksel_mdm, | ||
432 | OMAP2430_MDM_MOD, CM_CLKSEL); | ||
433 | |||
434 | /* x2 to enter omap2xxx_sdrc_init_params() */ | ||
435 | omap2xxx_sdrc_reprogram(CORE_CLK_SRC_DPLL_X2, 1); | ||
436 | |||
437 | omap2_set_prcm(prcm->cm_clksel1_pll, prcm->base_sdrc_rfr, | ||
438 | bypass); | ||
439 | |||
440 | omap2xxx_sdrc_init_params(omap2xxx_sdrc_dll_is_unlocked()); | ||
441 | omap2xxx_sdrc_reprogram(done_rate, 0); | ||
442 | |||
443 | local_irq_restore(flags); | ||
444 | } | ||
445 | |||
446 | return 0; | ||
447 | } | ||
448 | |||
449 | #ifdef CONFIG_CPU_FREQ | ||
450 | /* | ||
451 | * Walk PRCM rate table and fillout cpufreq freq_table | ||
452 | */ | 36 | */ |
453 | static struct cpufreq_frequency_table freq_table[ARRAY_SIZE(rate_table)]; | ||
454 | |||
455 | void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | ||
456 | { | ||
457 | struct prcm_config *prcm; | ||
458 | int i = 0; | ||
459 | |||
460 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
461 | if (!(prcm->flags & cpu_mask)) | ||
462 | continue; | ||
463 | if (prcm->xtal_speed != sys_ck.rate) | ||
464 | continue; | ||
465 | |||
466 | /* don't put bypass rates in table */ | ||
467 | if (prcm->dpll_speed == prcm->xtal_speed) | ||
468 | continue; | ||
469 | |||
470 | freq_table[i].index = i; | ||
471 | freq_table[i].frequency = prcm->mpu_speed / 1000; | ||
472 | i++; | ||
473 | } | ||
474 | |||
475 | if (i == 0) { | ||
476 | printk(KERN_WARNING "%s: failed to initialize frequency " | ||
477 | "table\n", __func__); | ||
478 | return; | ||
479 | } | ||
480 | |||
481 | freq_table[i].index = i; | ||
482 | freq_table[i].frequency = CPUFREQ_TABLE_END; | ||
483 | |||
484 | *table = &freq_table[0]; | ||
485 | } | ||
486 | #endif | ||
487 | |||
488 | struct clk_functions omap2_clk_functions = { | ||
489 | .clk_enable = omap2_clk_enable, | ||
490 | .clk_disable = omap2_clk_disable, | ||
491 | .clk_round_rate = omap2_clk_round_rate, | ||
492 | .clk_set_rate = omap2_clk_set_rate, | ||
493 | .clk_set_parent = omap2_clk_set_parent, | ||
494 | .clk_disable_unused = omap2_clk_disable_unused, | ||
495 | #ifdef CONFIG_CPU_FREQ | ||
496 | .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, | ||
497 | #endif | ||
498 | }; | ||
499 | |||
500 | static u32 omap2_get_apll_clkin(void) | ||
501 | { | ||
502 | u32 aplls, srate = 0; | ||
503 | |||
504 | aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); | ||
505 | aplls &= OMAP24XX_APLLS_CLKIN_MASK; | ||
506 | aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; | ||
507 | |||
508 | if (aplls == APLLS_CLKIN_19_2MHZ) | ||
509 | srate = 19200000; | ||
510 | else if (aplls == APLLS_CLKIN_13MHZ) | ||
511 | srate = 13000000; | ||
512 | else if (aplls == APLLS_CLKIN_12MHZ) | ||
513 | srate = 12000000; | ||
514 | |||
515 | return srate; | ||
516 | } | ||
517 | |||
518 | static u32 omap2_get_sysclkdiv(void) | ||
519 | { | ||
520 | u32 div; | ||
521 | |||
522 | div = __raw_readl(prcm_clksrc_ctrl); | ||
523 | div &= OMAP_SYSCLKDIV_MASK; | ||
524 | div >>= OMAP_SYSCLKDIV_SHIFT; | ||
525 | |||
526 | return div; | ||
527 | } | ||
528 | |||
529 | unsigned long omap2_osc_clk_recalc(struct clk *clk) | ||
530 | { | ||
531 | return omap2_get_apll_clkin() * omap2_get_sysclkdiv(); | ||
532 | } | ||
533 | |||
534 | unsigned long omap2_sys_clk_recalc(struct clk *clk) | ||
535 | { | ||
536 | return clk->parent->rate / omap2_get_sysclkdiv(); | ||
537 | } | ||
538 | 37 | ||
539 | /* | 38 | /* |
540 | * Set clocks for bypass mode for reboot to work. | 39 | * Set clocks for bypass mode for reboot to work. |
541 | */ | 40 | */ |
542 | void omap2_clk_prepare_for_reboot(void) | 41 | void omap2xxx_clk_prepare_for_reboot(void) |
543 | { | 42 | { |
544 | u32 rate; | 43 | u32 rate; |
545 | 44 | ||
@@ -551,37 +50,24 @@ void omap2_clk_prepare_for_reboot(void) | |||
551 | } | 50 | } |
552 | 51 | ||
553 | /* | 52 | /* |
554 | * Switch the MPU rate if specified on cmdline. | 53 | * Switch the MPU rate if specified on cmdline. We cannot do this |
555 | * We cannot do this early until cmdline is parsed. | 54 | * early until cmdline is parsed. XXX This should be removed from the |
55 | * clock code and handled by the OPP layer code in the near future. | ||
556 | */ | 56 | */ |
557 | static int __init omap2_clk_arch_init(void) | 57 | static int __init omap2xxx_clk_arch_init(void) |
558 | { | 58 | { |
559 | struct clk *virt_prcm_set, *sys_ck, *dpll_ck, *mpu_ck; | 59 | int ret; |
560 | unsigned long sys_ck_rate; | ||
561 | |||
562 | if (!mpurate) | ||
563 | return -EINVAL; | ||
564 | 60 | ||
565 | virt_prcm_set = clk_get(NULL, "virt_prcm_set"); | 61 | if (!cpu_is_omap24xx()) |
566 | sys_ck = clk_get(NULL, "sys_ck"); | 62 | return 0; |
567 | dpll_ck = clk_get(NULL, "dpll_ck"); | ||
568 | mpu_ck = clk_get(NULL, "mpu_ck"); | ||
569 | 63 | ||
570 | if (clk_set_rate(virt_prcm_set, mpurate)) | 64 | ret = omap2_clk_switch_mpurate_at_boot("virt_prcm_set"); |
571 | printk(KERN_ERR "Could not find matching MPU rate\n"); | 65 | if (!ret) |
66 | omap2_clk_print_new_rates("sys_ck", "dpll_ck", "mpu_ck"); | ||
572 | 67 | ||
573 | recalculate_root_clocks(); | 68 | return ret; |
574 | |||
575 | sys_ck_rate = clk_get_rate(sys_ck); | ||
576 | |||
577 | pr_info("Switched to new clocking rate (Crystal/DPLL/MPU): " | ||
578 | "%ld.%01ld/%ld/%ld MHz\n", | ||
579 | (sys_ck_rate / 1000000), (sys_ck_rate / 100000) % 10, | ||
580 | (clk_get_rate(dpll_ck) / 1000000), | ||
581 | (clk_get_rate(mpu_ck) / 1000000)); | ||
582 | |||
583 | return 0; | ||
584 | } | 69 | } |
585 | arch_initcall(omap2_clk_arch_init); | 70 | |
71 | arch_initcall(omap2xxx_clk_arch_init); | ||
586 | 72 | ||
587 | 73 | ||
diff --git a/arch/arm/mach-omap2/clock2xxx.h b/arch/arm/mach-omap2/clock2xxx.h index e35efde4bd80..6a658b890c17 100644 --- a/arch/arm/mach-omap2/clock2xxx.h +++ b/arch/arm/mach-omap2/clock2xxx.h | |||
@@ -1,35 +1,38 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2 clock function prototypes and macros | 2 | * OMAP2 clock function prototypes and macros |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2009 Nokia Corporation | 5 | * Copyright (C) 2004-2010 Nokia Corporation |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_24XX_H | 8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK2XXX_H |
9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK_24XX_H | 9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK2XXX_H |
10 | 10 | ||
11 | unsigned long omap2_table_mpu_recalc(struct clk *clk); | 11 | unsigned long omap2_table_mpu_recalc(struct clk *clk); |
12 | int omap2_select_table_rate(struct clk *clk, unsigned long rate); | 12 | int omap2_select_table_rate(struct clk *clk, unsigned long rate); |
13 | long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); | 13 | long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); |
14 | unsigned long omap2_sys_clk_recalc(struct clk *clk); | 14 | unsigned long omap2xxx_sys_clk_recalc(struct clk *clk); |
15 | unsigned long omap2_osc_clk_recalc(struct clk *clk); | 15 | unsigned long omap2_osc_clk_recalc(struct clk *clk); |
16 | unsigned long omap2_sys_clk_recalc(struct clk *clk); | ||
17 | unsigned long omap2_dpllcore_recalc(struct clk *clk); | 16 | unsigned long omap2_dpllcore_recalc(struct clk *clk); |
18 | int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); | 17 | int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); |
19 | unsigned long omap2xxx_clk_get_core_rate(struct clk *clk); | 18 | unsigned long omap2xxx_clk_get_core_rate(struct clk *clk); |
19 | u32 omap2xxx_get_apll_clkin(void); | ||
20 | u32 omap2xxx_get_sysclkdiv(void); | ||
21 | void omap2xxx_clk_prepare_for_reboot(void); | ||
20 | 22 | ||
21 | /* REVISIT: These should be set dynamically for CONFIG_MULTI_OMAP2 */ | ||
22 | #ifdef CONFIG_ARCH_OMAP2420 | 23 | #ifdef CONFIG_ARCH_OMAP2420 |
23 | #define OMAP_CM_REGADDR OMAP2420_CM_REGADDR | 24 | int omap2420_clk_init(void); |
24 | #define OMAP24XX_PRCM_CLKOUT_CTRL OMAP2420_PRCM_CLKOUT_CTRL | ||
25 | #define OMAP24XX_PRCM_CLKEMUL_CTRL OMAP2420_PRCM_CLKEMUL_CTRL | ||
26 | #else | 25 | #else |
27 | #define OMAP_CM_REGADDR OMAP2430_CM_REGADDR | 26 | #define omap2420_clk_init() 0 |
28 | #define OMAP24XX_PRCM_CLKOUT_CTRL OMAP2430_PRCM_CLKOUT_CTRL | ||
29 | #define OMAP24XX_PRCM_CLKEMUL_CTRL OMAP2430_PRCM_CLKEMUL_CTRL | ||
30 | #endif | 27 | #endif |
31 | 28 | ||
32 | extern void __iomem *prcm_clksrc_ctrl; | 29 | #ifdef CONFIG_ARCH_OMAP2430 |
30 | int omap2430_clk_init(void); | ||
31 | #else | ||
32 | #define omap2430_clk_init() 0 | ||
33 | #endif | ||
34 | |||
35 | extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; | ||
33 | 36 | ||
34 | extern struct clk *dclk; | 37 | extern struct clk *dclk; |
35 | 38 | ||
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index ded32364f32b..6febd5f11e85 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -2,13 +2,14 @@ | |||
2 | * OMAP3-specific clock framework functions | 2 | * OMAP3-specific clock framework functions |
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 |
8 | * Testing and integration fixes by Jouni Högander | 8 | * Jouni Högander |
9 | * | 9 | * |
10 | * Parts of this code are based on code written by | 10 | * Parts of this code are based on code written by |
11 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu | 11 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu, |
12 | * Russell King | ||
12 | * | 13 | * |
13 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
14 | * it under the terms of the GNU General Public License version 2 as | 15 | * it under the terms of the GNU General Public License version 2 as |
@@ -16,50 +17,23 @@ | |||
16 | */ | 17 | */ |
17 | #undef DEBUG | 18 | #undef DEBUG |
18 | 19 | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/device.h> | ||
22 | #include <linux/list.h> | ||
23 | #include <linux/errno.h> | ||
24 | #include <linux/delay.h> | ||
25 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
26 | #include <linux/io.h> | 22 | #include <linux/io.h> |
27 | #include <linux/limits.h> | ||
28 | #include <linux/bitops.h> | ||
29 | 23 | ||
30 | #include <plat/cpu.h> | ||
31 | #include <plat/clock.h> | 24 | #include <plat/clock.h> |
32 | #include <plat/sram.h> | ||
33 | #include <plat/sdrc.h> | ||
34 | #include <asm/div64.h> | ||
35 | #include <asm/clkdev.h> | ||
36 | 25 | ||
37 | #include <plat/sdrc.h> | ||
38 | #include "clock.h" | 26 | #include "clock.h" |
39 | #include "clock34xx.h" | 27 | #include "clock34xx.h" |
40 | #include "sdrc.h" | ||
41 | #include "prm.h" | ||
42 | #include "prm-regbits-34xx.h" | ||
43 | #include "cm.h" | 28 | #include "cm.h" |
44 | #include "cm-regbits-34xx.h" | 29 | #include "cm-regbits-34xx.h" |
45 | 30 | ||
46 | #define CYCLES_PER_MHZ 1000000 | ||
47 | |||
48 | /* | ||
49 | * DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks | ||
50 | * that are sourced by DPLL5, and both of these require this clock | ||
51 | * to be at 120 MHz for proper operation. | ||
52 | */ | ||
53 | #define DPLL5_FREQ_FOR_USBHOST 120000000 | ||
54 | |||
55 | /* needed by omap3_core_dpll_m2_set_rate() */ | ||
56 | struct clk *sdrc_ick_p, *arm_fck_p; | ||
57 | |||
58 | /** | 31 | /** |
59 | * omap3430es2_clk_ssi_find_idlest - return CM_IDLEST info for SSI | 32 | * omap3430es2_clk_ssi_find_idlest - return CM_IDLEST info for SSI |
60 | * @clk: struct clk * being enabled | 33 | * @clk: struct clk * being enabled |
61 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | 34 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into |
62 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | 35 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into |
36 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
63 | * | 37 | * |
64 | * The OMAP3430ES2 SSI target CM_IDLEST bit is at a different shift | 38 | * The OMAP3430ES2 SSI target CM_IDLEST bit is at a different shift |
65 | * from the CM_{I,F}CLKEN bit. Pass back the correct info via | 39 | * from the CM_{I,F}CLKEN bit. Pass back the correct info via |
@@ -67,13 +41,15 @@ struct clk *sdrc_ick_p, *arm_fck_p; | |||
67 | */ | 41 | */ |
68 | static void omap3430es2_clk_ssi_find_idlest(struct clk *clk, | 42 | static void omap3430es2_clk_ssi_find_idlest(struct clk *clk, |
69 | void __iomem **idlest_reg, | 43 | void __iomem **idlest_reg, |
70 | u8 *idlest_bit) | 44 | u8 *idlest_bit, |
45 | u8 *idlest_val) | ||
71 | { | 46 | { |
72 | u32 r; | 47 | u32 r; |
73 | 48 | ||
74 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); | 49 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); |
75 | *idlest_reg = (__force void __iomem *)r; | 50 | *idlest_reg = (__force void __iomem *)r; |
76 | *idlest_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT; | 51 | *idlest_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT; |
52 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | ||
77 | } | 53 | } |
78 | 54 | ||
79 | const struct clkops clkops_omap3430es2_ssi_wait = { | 55 | const struct clkops clkops_omap3430es2_ssi_wait = { |
@@ -88,6 +64,7 @@ const struct clkops clkops_omap3430es2_ssi_wait = { | |||
88 | * @clk: struct clk * being enabled | 64 | * @clk: struct clk * being enabled |
89 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | 65 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into |
90 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | 66 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into |
67 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
91 | * | 68 | * |
92 | * Some OMAP modules on OMAP3 ES2+ chips have both initiator and | 69 | * Some OMAP modules on OMAP3 ES2+ chips have both initiator and |
93 | * target IDLEST bits. For our purposes, we are concerned with the | 70 | * target IDLEST bits. For our purposes, we are concerned with the |
@@ -98,7 +75,8 @@ const struct clkops clkops_omap3430es2_ssi_wait = { | |||
98 | */ | 75 | */ |
99 | static void omap3430es2_clk_dss_usbhost_find_idlest(struct clk *clk, | 76 | static void omap3430es2_clk_dss_usbhost_find_idlest(struct clk *clk, |
100 | void __iomem **idlest_reg, | 77 | void __iomem **idlest_reg, |
101 | u8 *idlest_bit) | 78 | u8 *idlest_bit, |
79 | u8 *idlest_val) | ||
102 | { | 80 | { |
103 | u32 r; | 81 | u32 r; |
104 | 82 | ||
@@ -106,6 +84,7 @@ static void omap3430es2_clk_dss_usbhost_find_idlest(struct clk *clk, | |||
106 | *idlest_reg = (__force void __iomem *)r; | 84 | *idlest_reg = (__force void __iomem *)r; |
107 | /* USBHOST_IDLE has same shift */ | 85 | /* USBHOST_IDLE has same shift */ |
108 | *idlest_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT; | 86 | *idlest_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT; |
87 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | ||
109 | } | 88 | } |
110 | 89 | ||
111 | const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | 90 | const struct clkops clkops_omap3430es2_dss_usbhost_wait = { |
@@ -120,6 +99,7 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | |||
120 | * @clk: struct clk * being enabled | 99 | * @clk: struct clk * being enabled |
121 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | 100 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into |
122 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | 101 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into |
102 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
123 | * | 103 | * |
124 | * The OMAP3430ES2 HSOTGUSB target CM_IDLEST bit is at a different | 104 | * The OMAP3430ES2 HSOTGUSB target CM_IDLEST bit is at a different |
125 | * shift from the CM_{I,F}CLKEN bit. Pass back the correct info via | 105 | * shift from the CM_{I,F}CLKEN bit. Pass back the correct info via |
@@ -127,13 +107,15 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = { | |||
127 | */ | 107 | */ |
128 | static void omap3430es2_clk_hsotgusb_find_idlest(struct clk *clk, | 108 | static void omap3430es2_clk_hsotgusb_find_idlest(struct clk *clk, |
129 | void __iomem **idlest_reg, | 109 | void __iomem **idlest_reg, |
130 | u8 *idlest_bit) | 110 | u8 *idlest_bit, |
111 | u8 *idlest_val) | ||
131 | { | 112 | { |
132 | u32 r; | 113 | u32 r; |
133 | 114 | ||
134 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); | 115 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); |
135 | *idlest_reg = (__force void __iomem *)r; | 116 | *idlest_reg = (__force void __iomem *)r; |
136 | *idlest_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT; | 117 | *idlest_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT; |
118 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | ||
137 | } | 119 | } |
138 | 120 | ||
139 | const struct clkops clkops_omap3430es2_hsotgusb_wait = { | 121 | const struct clkops clkops_omap3430es2_hsotgusb_wait = { |
@@ -142,213 +124,3 @@ const struct clkops clkops_omap3430es2_hsotgusb_wait = { | |||
142 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, | 124 | .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, |
143 | .find_companion = omap2_clk_dflt_find_companion, | 125 | .find_companion = omap2_clk_dflt_find_companion, |
144 | }; | 126 | }; |
145 | |||
146 | const struct clkops clkops_noncore_dpll_ops = { | ||
147 | .enable = omap3_noncore_dpll_enable, | ||
148 | .disable = omap3_noncore_dpll_disable, | ||
149 | }; | ||
150 | |||
151 | int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate) | ||
152 | { | ||
153 | /* | ||
154 | * According to the 12-5 CDP code from TI, "Limitation 2.5" | ||
155 | * on 3430ES1 prevents us from changing DPLL multipliers or dividers | ||
156 | * on DPLL4. | ||
157 | */ | ||
158 | if (omap_rev() == OMAP3430_REV_ES1_0) { | ||
159 | printk(KERN_ERR "clock: DPLL4 cannot change rate due to " | ||
160 | "silicon 'Limitation 2.5' on 3430ES1.\n"); | ||
161 | return -EINVAL; | ||
162 | } | ||
163 | return omap3_noncore_dpll_set_rate(clk, rate); | ||
164 | } | ||
165 | |||
166 | |||
167 | /* | ||
168 | * CORE DPLL (DPLL3) rate programming functions | ||
169 | * | ||
170 | * These call into SRAM code to do the actual CM writes, since the SDRAM | ||
171 | * is clocked from DPLL3. | ||
172 | */ | ||
173 | |||
174 | /** | ||
175 | * omap3_core_dpll_m2_set_rate - set CORE DPLL M2 divider | ||
176 | * @clk: struct clk * of DPLL to set | ||
177 | * @rate: rounded target rate | ||
178 | * | ||
179 | * Program the DPLL M2 divider with the rounded target rate. Returns | ||
180 | * -EINVAL upon error, or 0 upon success. | ||
181 | */ | ||
182 | int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) | ||
183 | { | ||
184 | u32 new_div = 0; | ||
185 | u32 unlock_dll = 0; | ||
186 | u32 c; | ||
187 | unsigned long validrate, sdrcrate, _mpurate; | ||
188 | struct omap_sdrc_params *sdrc_cs0; | ||
189 | struct omap_sdrc_params *sdrc_cs1; | ||
190 | int ret; | ||
191 | |||
192 | if (!clk || !rate) | ||
193 | return -EINVAL; | ||
194 | |||
195 | validrate = omap2_clksel_round_rate_div(clk, rate, &new_div); | ||
196 | if (validrate != rate) | ||
197 | return -EINVAL; | ||
198 | |||
199 | sdrcrate = sdrc_ick_p->rate; | ||
200 | if (rate > clk->rate) | ||
201 | sdrcrate <<= ((rate / clk->rate) >> 1); | ||
202 | else | ||
203 | sdrcrate >>= ((clk->rate / rate) >> 1); | ||
204 | |||
205 | ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1); | ||
206 | if (ret) | ||
207 | return -EINVAL; | ||
208 | |||
209 | if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) { | ||
210 | pr_debug("clock: will unlock SDRC DLL\n"); | ||
211 | unlock_dll = 1; | ||
212 | } | ||
213 | |||
214 | /* | ||
215 | * XXX This only needs to be done when the CPU frequency changes | ||
216 | */ | ||
217 | _mpurate = arm_fck_p->rate / CYCLES_PER_MHZ; | ||
218 | c = (_mpurate << SDRC_MPURATE_SCALE) >> SDRC_MPURATE_BASE_SHIFT; | ||
219 | c += 1; /* for safety */ | ||
220 | c *= SDRC_MPURATE_LOOPS; | ||
221 | c >>= SDRC_MPURATE_SCALE; | ||
222 | if (c == 0) | ||
223 | c = 1; | ||
224 | |||
225 | pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, | ||
226 | validrate); | ||
227 | pr_debug("clock: SDRC CS0 timing params used:" | ||
228 | " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", | ||
229 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, | ||
230 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr); | ||
231 | if (sdrc_cs1) | ||
232 | pr_debug("clock: SDRC CS1 timing params used: " | ||
233 | " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n", | ||
234 | sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, | ||
235 | sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); | ||
236 | |||
237 | if (sdrc_cs1) | ||
238 | omap3_configure_core_dpll( | ||
239 | new_div, unlock_dll, c, rate > clk->rate, | ||
240 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, | ||
241 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, | ||
242 | sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla, | ||
243 | sdrc_cs1->actim_ctrlb, sdrc_cs1->mr); | ||
244 | else | ||
245 | omap3_configure_core_dpll( | ||
246 | new_div, unlock_dll, c, rate > clk->rate, | ||
247 | sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, | ||
248 | sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, | ||
249 | 0, 0, 0, 0); | ||
250 | |||
251 | return 0; | ||
252 | } | ||
253 | |||
254 | /* Common clock code */ | ||
255 | |||
256 | /* | ||
257 | * As it is structured now, this will prevent an OMAP2/3 multiboot | ||
258 | * kernel from compiling. This will need further attention. | ||
259 | */ | ||
260 | #if defined(CONFIG_ARCH_OMAP3) | ||
261 | |||
262 | struct clk_functions omap2_clk_functions = { | ||
263 | .clk_enable = omap2_clk_enable, | ||
264 | .clk_disable = omap2_clk_disable, | ||
265 | .clk_round_rate = omap2_clk_round_rate, | ||
266 | .clk_set_rate = omap2_clk_set_rate, | ||
267 | .clk_set_parent = omap2_clk_set_parent, | ||
268 | .clk_disable_unused = omap2_clk_disable_unused, | ||
269 | }; | ||
270 | |||
271 | /* | ||
272 | * Set clocks for bypass mode for reboot to work. | ||
273 | */ | ||
274 | void omap2_clk_prepare_for_reboot(void) | ||
275 | { | ||
276 | /* REVISIT: Not ready for 343x */ | ||
277 | #if 0 | ||
278 | u32 rate; | ||
279 | |||
280 | if (vclk == NULL || sclk == NULL) | ||
281 | return; | ||
282 | |||
283 | rate = clk_get_rate(sclk); | ||
284 | clk_set_rate(vclk, rate); | ||
285 | #endif | ||
286 | } | ||
287 | |||
288 | void omap3_clk_lock_dpll5(void) | ||
289 | { | ||
290 | struct clk *dpll5_clk; | ||
291 | struct clk *dpll5_m2_clk; | ||
292 | |||
293 | dpll5_clk = clk_get(NULL, "dpll5_ck"); | ||
294 | clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); | ||
295 | clk_enable(dpll5_clk); | ||
296 | |||
297 | /* Enable autoidle to allow it to enter low power bypass */ | ||
298 | omap3_dpll_allow_idle(dpll5_clk); | ||
299 | |||
300 | /* Program dpll5_m2_clk divider for no division */ | ||
301 | dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); | ||
302 | clk_enable(dpll5_m2_clk); | ||
303 | clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST); | ||
304 | |||
305 | clk_disable(dpll5_m2_clk); | ||
306 | clk_disable(dpll5_clk); | ||
307 | return; | ||
308 | } | ||
309 | |||
310 | /* REVISIT: Move this init stuff out into clock.c */ | ||
311 | |||
312 | /* | ||
313 | * Switch the MPU rate if specified on cmdline. | ||
314 | * We cannot do this early until cmdline is parsed. | ||
315 | */ | ||
316 | static int __init omap2_clk_arch_init(void) | ||
317 | { | ||
318 | struct clk *osc_sys_ck, *dpll1_ck, *arm_fck, *core_ck; | ||
319 | unsigned long osc_sys_rate; | ||
320 | |||
321 | if (!mpurate) | ||
322 | return -EINVAL; | ||
323 | |||
324 | /* XXX test these for success */ | ||
325 | dpll1_ck = clk_get(NULL, "dpll1_ck"); | ||
326 | arm_fck = clk_get(NULL, "arm_fck"); | ||
327 | core_ck = clk_get(NULL, "core_ck"); | ||
328 | osc_sys_ck = clk_get(NULL, "osc_sys_ck"); | ||
329 | |||
330 | /* REVISIT: not yet ready for 343x */ | ||
331 | if (clk_set_rate(dpll1_ck, mpurate)) | ||
332 | printk(KERN_ERR "*** Unable to set MPU rate\n"); | ||
333 | |||
334 | recalculate_root_clocks(); | ||
335 | |||
336 | osc_sys_rate = clk_get_rate(osc_sys_ck); | ||
337 | |||
338 | pr_info("Switched to new clocking rate (Crystal/Core/MPU): " | ||
339 | "%ld.%01ld/%ld/%ld MHz\n", | ||
340 | (osc_sys_rate / 1000000), | ||
341 | ((osc_sys_rate / 100000) % 10), | ||
342 | (clk_get_rate(core_ck) / 1000000), | ||
343 | (clk_get_rate(arm_fck) / 1000000)); | ||
344 | |||
345 | calibrate_delay(); | ||
346 | |||
347 | return 0; | ||
348 | } | ||
349 | arch_initcall(omap2_clk_arch_init); | ||
350 | |||
351 | |||
352 | #endif | ||
353 | |||
354 | |||
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index 9a2c07eac9ad..628e8de57680 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
@@ -1,24 +1,15 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP3 clock function prototypes and macros | 2 | * OMAP34xx clock function prototypes and macros |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2009 Nokia Corporation | 5 | * Copyright (C) 2007-2010 Nokia Corporation |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_34XX_H | 8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H |
9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK_34XX_H | 9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H |
10 | 10 | ||
11 | int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate); | ||
12 | int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate); | ||
13 | void omap3_clk_lock_dpll5(void); | ||
14 | |||
15 | extern struct clk *sdrc_ick_p; | ||
16 | extern struct clk *arm_fck_p; | ||
17 | |||
18 | /* OMAP34xx-specific clkops */ | ||
19 | extern const struct clkops clkops_omap3430es2_ssi_wait; | 11 | extern const struct clkops clkops_omap3430es2_ssi_wait; |
20 | extern const struct clkops clkops_omap3430es2_hsotgusb_wait; | 12 | extern const struct clkops clkops_omap3430es2_hsotgusb_wait; |
21 | extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; | 13 | extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; |
22 | extern const struct clkops clkops_noncore_dpll_ops; | ||
23 | 14 | ||
24 | #endif | 15 | #endif |
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c new file mode 100644 index 000000000000..b496a9305e1c --- /dev/null +++ b/arch/arm/mach-omap2/clock3517.c | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * OMAP3517/3505-specific clock framework functions | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2010 Nokia Corporation | ||
6 | * | ||
7 | * Ranjith Lohithakshan | ||
8 | * Paul Walmsley | ||
9 | * | ||
10 | * Parts of this code are based on code written by | ||
11 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu, | ||
12 | * Russell King | ||
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 | #undef DEBUG | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <plat/clock.h> | ||
25 | |||
26 | #include "clock.h" | ||
27 | #include "clock3517.h" | ||
28 | #include "cm.h" | ||
29 | #include "cm-regbits-34xx.h" | ||
30 | |||
31 | /* | ||
32 | * In AM35xx IPSS, the {ICK,FCK} enable bits for modules are exported | ||
33 | * in the same register at a bit offset of 0x8. The EN_ACK for ICK is | ||
34 | * at an offset of 4 from ICK enable bit. | ||
35 | */ | ||
36 | #define AM35XX_IPSS_ICK_MASK 0xF | ||
37 | #define AM35XX_IPSS_ICK_EN_ACK_OFFSET 0x4 | ||
38 | #define AM35XX_IPSS_ICK_FCK_OFFSET 0x8 | ||
39 | #define AM35XX_IPSS_CLK_IDLEST_VAL 0 | ||
40 | |||
41 | /** | ||
42 | * am35xx_clk_find_idlest - return clock ACK info for AM35XX IPSS | ||
43 | * @clk: struct clk * being enabled | ||
44 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | ||
45 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | ||
46 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
47 | * | ||
48 | * The interface clocks on AM35xx IPSS reflects the clock idle status | ||
49 | * in the enable register itsel at a bit offset of 4 from the enable | ||
50 | * bit. A value of 1 indicates that clock is enabled. | ||
51 | */ | ||
52 | static void am35xx_clk_find_idlest(struct clk *clk, | ||
53 | void __iomem **idlest_reg, | ||
54 | u8 *idlest_bit, | ||
55 | u8 *idlest_val) | ||
56 | { | ||
57 | *idlest_reg = (__force void __iomem *)(clk->enable_reg); | ||
58 | *idlest_bit = clk->enable_bit + AM35XX_IPSS_ICK_EN_ACK_OFFSET; | ||
59 | *idlest_val = AM35XX_IPSS_CLK_IDLEST_VAL; | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * am35xx_clk_find_companion - find companion clock to @clk | ||
64 | * @clk: struct clk * to find the companion clock of | ||
65 | * @other_reg: void __iomem ** to return the companion clock CM_*CLKEN va in | ||
66 | * @other_bit: u8 ** to return the companion clock bit shift in | ||
67 | * | ||
68 | * Some clocks don't have companion clocks. For example, modules with | ||
69 | * only an interface clock (such as HECC) don't have a companion | ||
70 | * clock. Right now, this code relies on the hardware exporting a bit | ||
71 | * in the correct companion register that indicates that the | ||
72 | * nonexistent 'companion clock' is active. Future patches will | ||
73 | * associate this type of code with per-module data structures to | ||
74 | * avoid this issue, and remove the casts. No return value. | ||
75 | */ | ||
76 | static void am35xx_clk_find_companion(struct clk *clk, void __iomem **other_reg, | ||
77 | u8 *other_bit) | ||
78 | { | ||
79 | *other_reg = (__force void __iomem *)(clk->enable_reg); | ||
80 | if (clk->enable_bit & AM35XX_IPSS_ICK_MASK) | ||
81 | *other_bit = clk->enable_bit + AM35XX_IPSS_ICK_FCK_OFFSET; | ||
82 | else | ||
83 | *other_bit = clk->enable_bit - AM35XX_IPSS_ICK_FCK_OFFSET; | ||
84 | } | ||
85 | |||
86 | const struct clkops clkops_am35xx_ipss_module_wait = { | ||
87 | .enable = omap2_dflt_clk_enable, | ||
88 | .disable = omap2_dflt_clk_disable, | ||
89 | .find_idlest = am35xx_clk_find_idlest, | ||
90 | .find_companion = am35xx_clk_find_companion, | ||
91 | }; | ||
92 | |||
93 | /** | ||
94 | * am35xx_clk_ipss_find_idlest - return CM_IDLEST info for IPSS | ||
95 | * @clk: struct clk * being enabled | ||
96 | * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into | ||
97 | * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into | ||
98 | * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator | ||
99 | * | ||
100 | * The IPSS target CM_IDLEST bit is at a different shift from the | ||
101 | * CM_{I,F}CLKEN bit. Pass back the correct info via @idlest_reg | ||
102 | * and @idlest_bit. No return value. | ||
103 | */ | ||
104 | static void am35xx_clk_ipss_find_idlest(struct clk *clk, | ||
105 | void __iomem **idlest_reg, | ||
106 | u8 *idlest_bit, | ||
107 | u8 *idlest_val) | ||
108 | { | ||
109 | u32 r; | ||
110 | |||
111 | r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20); | ||
112 | *idlest_reg = (__force void __iomem *)r; | ||
113 | *idlest_bit = AM35XX_ST_IPSS_SHIFT; | ||
114 | *idlest_val = OMAP34XX_CM_IDLEST_VAL; | ||
115 | } | ||
116 | |||
117 | const struct clkops clkops_am35xx_ipss_wait = { | ||
118 | .enable = omap2_dflt_clk_enable, | ||
119 | .disable = omap2_dflt_clk_disable, | ||
120 | .find_idlest = am35xx_clk_ipss_find_idlest, | ||
121 | .find_companion = omap2_clk_dflt_find_companion, | ||
122 | }; | ||
123 | |||
124 | |||
diff --git a/arch/arm/mach-omap2/clock3517.h b/arch/arm/mach-omap2/clock3517.h new file mode 100644 index 000000000000..ca5e5a64c2e2 --- /dev/null +++ b/arch/arm/mach-omap2/clock3517.h | |||
@@ -0,0 +1,14 @@ | |||
1 | /* | ||
2 | * OMAP3517/3505 clock function prototypes and macros | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2010 Nokia Corporation | ||
6 | */ | ||
7 | |||
8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK3517_H | ||
9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK3517_H | ||
10 | |||
11 | extern const struct clkops clkops_am35xx_ipss_module_wait; | ||
12 | extern const struct clkops clkops_am35xx_ipss_wait; | ||
13 | |||
14 | #endif | ||
diff --git a/arch/arm/mach-omap2/clock36xx.c b/arch/arm/mach-omap2/clock36xx.c new file mode 100644 index 000000000000..0c5e25ed8879 --- /dev/null +++ b/arch/arm/mach-omap2/clock36xx.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * OMAP36xx-specific clkops | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2010 Nokia Corporation | ||
6 | * | ||
7 | * Mike Turquette | ||
8 | * Vijaykumar GN | ||
9 | * Paul Walmsley | ||
10 | * | ||
11 | * Parts of this code are based on code written by | ||
12 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu, | ||
13 | * Russell King | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License version 2 as | ||
17 | * published by the Free Software Foundation. | ||
18 | */ | ||
19 | #undef DEBUG | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | #include <plat/clock.h> | ||
26 | |||
27 | #include "clock.h" | ||
28 | #include "clock36xx.h" | ||
29 | |||
30 | |||
31 | /** | ||
32 | * omap36xx_pwrdn_clk_enable_with_hsdiv_restore - enable clocks suffering | ||
33 | * from HSDivider PWRDN problem Implements Errata ID: i556. | ||
34 | * @clk: DPLL output struct clk | ||
35 | * | ||
36 | * 3630 only: dpll3_m3_ck, dpll4_m2_ck, dpll4_m3_ck, dpll4_m4_ck, | ||
37 | * dpll4_m5_ck & dpll4_m6_ck dividers gets loaded with reset | ||
38 | * valueafter their respective PWRDN bits are set. Any dummy write | ||
39 | * (Any other value different from the Read value) to the | ||
40 | * corresponding CM_CLKSEL register will refresh the dividers. | ||
41 | */ | ||
42 | static int omap36xx_pwrdn_clk_enable_with_hsdiv_restore(struct clk *clk) | ||
43 | { | ||
44 | u32 dummy_v, orig_v, clksel_shift; | ||
45 | int ret; | ||
46 | |||
47 | /* Clear PWRDN bit of HSDIVIDER */ | ||
48 | ret = omap2_dflt_clk_enable(clk); | ||
49 | |||
50 | /* Restore the dividers */ | ||
51 | if (!ret) { | ||
52 | clksel_shift = __ffs(clk->parent->clksel_mask); | ||
53 | orig_v = __raw_readl(clk->parent->clksel_reg); | ||
54 | dummy_v = orig_v; | ||
55 | |||
56 | /* Write any other value different from the Read value */ | ||
57 | dummy_v ^= (1 << clksel_shift); | ||
58 | __raw_writel(dummy_v, clk->parent->clksel_reg); | ||
59 | |||
60 | /* Write the original divider */ | ||
61 | __raw_writel(orig_v, clk->parent->clksel_reg); | ||
62 | } | ||
63 | |||
64 | return ret; | ||
65 | } | ||
66 | |||
67 | const struct clkops clkops_omap36xx_pwrdn_with_hsdiv_wait_restore = { | ||
68 | .enable = omap36xx_pwrdn_clk_enable_with_hsdiv_restore, | ||
69 | .disable = omap2_dflt_clk_disable, | ||
70 | .find_companion = omap2_clk_dflt_find_companion, | ||
71 | .find_idlest = omap2_clk_dflt_find_idlest, | ||
72 | }; | ||
diff --git a/arch/arm/mach-omap2/clock36xx.h b/arch/arm/mach-omap2/clock36xx.h new file mode 100644 index 000000000000..a7dee5bc6364 --- /dev/null +++ b/arch/arm/mach-omap2/clock36xx.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * OMAP36xx clock function prototypes and macros | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2010 Nokia Corporation | ||
6 | */ | ||
7 | |||
8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK36XX_H | ||
9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK36XX_H | ||
10 | |||
11 | extern const struct clkops clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; | ||
12 | |||
13 | #endif | ||
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c new file mode 100644 index 000000000000..a447c4d2c28a --- /dev/null +++ b/arch/arm/mach-omap2/clock3xxx.c | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * OMAP3-specific clock framework functions | ||
3 | * | ||
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2007-2010 Nokia Corporation | ||
6 | * | ||
7 | * Paul Walmsley | ||
8 | * Jouni Högander | ||
9 | * | ||
10 | * Parts of this code are based on code written by | ||
11 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | #undef DEBUG | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/errno.h> | ||
21 | #include <linux/clk.h> | ||
22 | #include <linux/io.h> | ||
23 | |||
24 | #include <plat/clock.h> | ||
25 | |||
26 | #include "clock.h" | ||
27 | #include "clock3xxx.h" | ||
28 | #include "prm.h" | ||
29 | #include "prm-regbits-34xx.h" | ||
30 | #include "cm.h" | ||
31 | #include "cm-regbits-34xx.h" | ||
32 | |||
33 | /* | ||
34 | * DPLL5_FREQ_FOR_USBHOST: USBHOST and USBTLL are the only clocks | ||
35 | * that are sourced by DPLL5, and both of these require this clock | ||
36 | * to be at 120 MHz for proper operation. | ||
37 | */ | ||
38 | #define DPLL5_FREQ_FOR_USBHOST 120000000 | ||
39 | |||
40 | /* needed by omap3_core_dpll_m2_set_rate() */ | ||
41 | struct clk *sdrc_ick_p, *arm_fck_p; | ||
42 | |||
43 | int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate) | ||
44 | { | ||
45 | /* | ||
46 | * According to the 12-5 CDP code from TI, "Limitation 2.5" | ||
47 | * on 3430ES1 prevents us from changing DPLL multipliers or dividers | ||
48 | * on DPLL4. | ||
49 | */ | ||
50 | if (omap_rev() == OMAP3430_REV_ES1_0) { | ||
51 | pr_err("clock: DPLL4 cannot change rate due to " | ||
52 | "silicon 'Limitation 2.5' on 3430ES1.\n"); | ||
53 | return -EINVAL; | ||
54 | } | ||
55 | |||
56 | return omap3_noncore_dpll_set_rate(clk, rate); | ||
57 | } | ||
58 | |||
59 | void __init omap3_clk_lock_dpll5(void) | ||
60 | { | ||
61 | struct clk *dpll5_clk; | ||
62 | struct clk *dpll5_m2_clk; | ||
63 | |||
64 | dpll5_clk = clk_get(NULL, "dpll5_ck"); | ||
65 | clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); | ||
66 | clk_enable(dpll5_clk); | ||
67 | |||
68 | /* Enable autoidle to allow it to enter low power bypass */ | ||
69 | omap3_dpll_allow_idle(dpll5_clk); | ||
70 | |||
71 | /* Program dpll5_m2_clk divider for no division */ | ||
72 | dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); | ||
73 | clk_enable(dpll5_m2_clk); | ||
74 | clk_set_rate(dpll5_m2_clk, DPLL5_FREQ_FOR_USBHOST); | ||
75 | |||
76 | clk_disable(dpll5_m2_clk); | ||
77 | clk_disable(dpll5_clk); | ||
78 | return; | ||
79 | } | ||
80 | |||
81 | /* Common clock code */ | ||
82 | |||
83 | /* | ||
84 | * Switch the MPU rate if specified on cmdline. We cannot do this | ||
85 | * early until cmdline is parsed. XXX This should be removed from the | ||
86 | * clock code and handled by the OPP layer code in the near future. | ||
87 | */ | ||
88 | static int __init omap3xxx_clk_arch_init(void) | ||
89 | { | ||
90 | int ret; | ||
91 | |||
92 | if (!cpu_is_omap34xx()) | ||
93 | return 0; | ||
94 | |||
95 | ret = omap2_clk_switch_mpurate_at_boot("dpll1_ck"); | ||
96 | if (!ret) | ||
97 | omap2_clk_print_new_rates("osc_sys_ck", "arm_fck", "core_ck"); | ||
98 | |||
99 | return ret; | ||
100 | } | ||
101 | |||
102 | arch_initcall(omap3xxx_clk_arch_init); | ||
103 | |||
104 | |||
diff --git a/arch/arm/mach-omap2/clock3xxx.h b/arch/arm/mach-omap2/clock3xxx.h new file mode 100644 index 000000000000..8bbeeaf399e2 --- /dev/null +++ b/arch/arm/mach-omap2/clock3xxx.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * OMAP3-common clock function prototypes and macros | ||
3 | * | ||
4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2007-2010 Nokia Corporation | ||
6 | */ | ||
7 | |||
8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK3XXX_H | ||
9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK3XXX_H | ||
10 | |||
11 | int omap3xxx_clk_init(void); | ||
12 | int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate); | ||
13 | int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate); | ||
14 | void omap3_clk_lock_dpll5(void); | ||
15 | |||
16 | extern struct clk *sdrc_ick_p; | ||
17 | extern struct clk *arm_fck_p; | ||
18 | |||
19 | extern const struct clkops clkops_noncore_dpll_ops; | ||
20 | |||
21 | #endif | ||
diff --git a/arch/arm/mach-omap2/clock34xx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index 8bdcc9cc7f9a..d5153b6bd6cb 100644 --- a/arch/arm/mach-omap2/clock34xx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP3 clock data | 2 | * OMAP3 clock data |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-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 | * Written by Paul Walmsley |
8 | * With many device clock fixes by Kevin Hilman and Jouni Högander | 8 | * With many device clock fixes by Kevin Hilman and Jouni Högander |
@@ -16,15 +16,19 @@ | |||
16 | * to be requested from drivers directly. | 16 | * to be requested from drivers directly. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
21 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
21 | #include <linux/list.h> | ||
22 | 22 | ||
23 | #include <plat/control.h> | 23 | #include <plat/control.h> |
24 | #include <plat/clkdev_omap.h> | 24 | #include <plat/clkdev_omap.h> |
25 | 25 | ||
26 | #include "clock.h" | 26 | #include "clock.h" |
27 | #include "clock3xxx.h" | ||
27 | #include "clock34xx.h" | 28 | #include "clock34xx.h" |
29 | #include "clock36xx.h" | ||
30 | #include "clock3517.h" | ||
31 | |||
28 | #include "cm.h" | 32 | #include "cm.h" |
29 | #include "cm-regbits-34xx.h" | 33 | #include "cm-regbits-34xx.h" |
30 | #include "prm.h" | 34 | #include "prm.h" |
@@ -37,7 +41,8 @@ | |||
37 | #define OMAP_CM_REGADDR OMAP34XX_CM_REGADDR | 41 | #define OMAP_CM_REGADDR OMAP34XX_CM_REGADDR |
38 | 42 | ||
39 | /* Maximum DPLL multiplier, divider values for OMAP3 */ | 43 | /* Maximum DPLL multiplier, divider values for OMAP3 */ |
40 | #define OMAP3_MAX_DPLL_MULT 2048 | 44 | #define OMAP3_MAX_DPLL_MULT 2047 |
45 | #define OMAP3630_MAX_JTYPE_DPLL_MULT 4095 | ||
41 | #define OMAP3_MAX_DPLL_DIV 128 | 46 | #define OMAP3_MAX_DPLL_DIV 128 |
42 | 47 | ||
43 | /* | 48 | /* |
@@ -59,14 +64,12 @@ static struct clk omap_32k_fck = { | |||
59 | .name = "omap_32k_fck", | 64 | .name = "omap_32k_fck", |
60 | .ops = &clkops_null, | 65 | .ops = &clkops_null, |
61 | .rate = 32768, | 66 | .rate = 32768, |
62 | .flags = RATE_FIXED, | ||
63 | }; | 67 | }; |
64 | 68 | ||
65 | static struct clk secure_32k_fck = { | 69 | static struct clk secure_32k_fck = { |
66 | .name = "secure_32k_fck", | 70 | .name = "secure_32k_fck", |
67 | .ops = &clkops_null, | 71 | .ops = &clkops_null, |
68 | .rate = 32768, | 72 | .rate = 32768, |
69 | .flags = RATE_FIXED, | ||
70 | }; | 73 | }; |
71 | 74 | ||
72 | /* Virtual source clocks for osc_sys_ck */ | 75 | /* Virtual source clocks for osc_sys_ck */ |
@@ -74,42 +77,36 @@ static struct clk virt_12m_ck = { | |||
74 | .name = "virt_12m_ck", | 77 | .name = "virt_12m_ck", |
75 | .ops = &clkops_null, | 78 | .ops = &clkops_null, |
76 | .rate = 12000000, | 79 | .rate = 12000000, |
77 | .flags = RATE_FIXED, | ||
78 | }; | 80 | }; |
79 | 81 | ||
80 | static struct clk virt_13m_ck = { | 82 | static struct clk virt_13m_ck = { |
81 | .name = "virt_13m_ck", | 83 | .name = "virt_13m_ck", |
82 | .ops = &clkops_null, | 84 | .ops = &clkops_null, |
83 | .rate = 13000000, | 85 | .rate = 13000000, |
84 | .flags = RATE_FIXED, | ||
85 | }; | 86 | }; |
86 | 87 | ||
87 | static struct clk virt_16_8m_ck = { | 88 | static struct clk virt_16_8m_ck = { |
88 | .name = "virt_16_8m_ck", | 89 | .name = "virt_16_8m_ck", |
89 | .ops = &clkops_null, | 90 | .ops = &clkops_null, |
90 | .rate = 16800000, | 91 | .rate = 16800000, |
91 | .flags = RATE_FIXED, | ||
92 | }; | 92 | }; |
93 | 93 | ||
94 | static struct clk virt_19_2m_ck = { | 94 | static struct clk virt_19_2m_ck = { |
95 | .name = "virt_19_2m_ck", | 95 | .name = "virt_19_2m_ck", |
96 | .ops = &clkops_null, | 96 | .ops = &clkops_null, |
97 | .rate = 19200000, | 97 | .rate = 19200000, |
98 | .flags = RATE_FIXED, | ||
99 | }; | 98 | }; |
100 | 99 | ||
101 | static struct clk virt_26m_ck = { | 100 | static struct clk virt_26m_ck = { |
102 | .name = "virt_26m_ck", | 101 | .name = "virt_26m_ck", |
103 | .ops = &clkops_null, | 102 | .ops = &clkops_null, |
104 | .rate = 26000000, | 103 | .rate = 26000000, |
105 | .flags = RATE_FIXED, | ||
106 | }; | 104 | }; |
107 | 105 | ||
108 | static struct clk virt_38_4m_ck = { | 106 | static struct clk virt_38_4m_ck = { |
109 | .name = "virt_38_4m_ck", | 107 | .name = "virt_38_4m_ck", |
110 | .ops = &clkops_null, | 108 | .ops = &clkops_null, |
111 | .rate = 38400000, | 109 | .rate = 38400000, |
112 | .flags = RATE_FIXED, | ||
113 | }; | 110 | }; |
114 | 111 | ||
115 | static const struct clksel_rate osc_sys_12m_rates[] = { | 112 | static const struct clksel_rate osc_sys_12m_rates[] = { |
@@ -162,7 +159,6 @@ static struct clk osc_sys_ck = { | |||
162 | .clksel_mask = OMAP3430_SYS_CLKIN_SEL_MASK, | 159 | .clksel_mask = OMAP3430_SYS_CLKIN_SEL_MASK, |
163 | .clksel = osc_sys_clksel, | 160 | .clksel = osc_sys_clksel, |
164 | /* REVISIT: deal with autoextclkmode? */ | 161 | /* REVISIT: deal with autoextclkmode? */ |
165 | .flags = RATE_FIXED, | ||
166 | .recalc = &omap2_clksel_recalc, | 162 | .recalc = &omap2_clksel_recalc, |
167 | }; | 163 | }; |
168 | 164 | ||
@@ -236,6 +232,42 @@ static const struct clksel_rate div16_dpll_rates[] = { | |||
236 | { .div = 0 } | 232 | { .div = 0 } |
237 | }; | 233 | }; |
238 | 234 | ||
235 | static const struct clksel_rate div32_dpll4_rates_3630[] = { | ||
236 | { .div = 1, .val = 1, .flags = RATE_IN_36XX | DEFAULT_RATE }, | ||
237 | { .div = 2, .val = 2, .flags = RATE_IN_36XX }, | ||
238 | { .div = 3, .val = 3, .flags = RATE_IN_36XX }, | ||
239 | { .div = 4, .val = 4, .flags = RATE_IN_36XX }, | ||
240 | { .div = 5, .val = 5, .flags = RATE_IN_36XX }, | ||
241 | { .div = 6, .val = 6, .flags = RATE_IN_36XX }, | ||
242 | { .div = 7, .val = 7, .flags = RATE_IN_36XX }, | ||
243 | { .div = 8, .val = 8, .flags = RATE_IN_36XX }, | ||
244 | { .div = 9, .val = 9, .flags = RATE_IN_36XX }, | ||
245 | { .div = 10, .val = 10, .flags = RATE_IN_36XX }, | ||
246 | { .div = 11, .val = 11, .flags = RATE_IN_36XX }, | ||
247 | { .div = 12, .val = 12, .flags = RATE_IN_36XX }, | ||
248 | { .div = 13, .val = 13, .flags = RATE_IN_36XX }, | ||
249 | { .div = 14, .val = 14, .flags = RATE_IN_36XX }, | ||
250 | { .div = 15, .val = 15, .flags = RATE_IN_36XX }, | ||
251 | { .div = 16, .val = 16, .flags = RATE_IN_36XX }, | ||
252 | { .div = 17, .val = 17, .flags = RATE_IN_36XX }, | ||
253 | { .div = 18, .val = 18, .flags = RATE_IN_36XX }, | ||
254 | { .div = 19, .val = 19, .flags = RATE_IN_36XX }, | ||
255 | { .div = 20, .val = 20, .flags = RATE_IN_36XX }, | ||
256 | { .div = 21, .val = 21, .flags = RATE_IN_36XX }, | ||
257 | { .div = 22, .val = 22, .flags = RATE_IN_36XX }, | ||
258 | { .div = 23, .val = 23, .flags = RATE_IN_36XX }, | ||
259 | { .div = 24, .val = 24, .flags = RATE_IN_36XX }, | ||
260 | { .div = 25, .val = 25, .flags = RATE_IN_36XX }, | ||
261 | { .div = 26, .val = 26, .flags = RATE_IN_36XX }, | ||
262 | { .div = 27, .val = 27, .flags = RATE_IN_36XX }, | ||
263 | { .div = 28, .val = 28, .flags = RATE_IN_36XX }, | ||
264 | { .div = 29, .val = 29, .flags = RATE_IN_36XX }, | ||
265 | { .div = 30, .val = 30, .flags = RATE_IN_36XX }, | ||
266 | { .div = 31, .val = 31, .flags = RATE_IN_36XX }, | ||
267 | { .div = 32, .val = 32, .flags = RATE_IN_36XX }, | ||
268 | { .div = 0 } | ||
269 | }; | ||
270 | |||
239 | /* DPLL1 */ | 271 | /* DPLL1 */ |
240 | /* MPU clock source */ | 272 | /* MPU clock source */ |
241 | /* Type: DPLL */ | 273 | /* Type: DPLL */ |
@@ -337,7 +369,7 @@ static struct dpll_data dpll2_dd = { | |||
337 | 369 | ||
338 | static struct clk dpll2_ck = { | 370 | static struct clk dpll2_ck = { |
339 | .name = "dpll2_ck", | 371 | .name = "dpll2_ck", |
340 | .ops = &clkops_noncore_dpll_ops, | 372 | .ops = &clkops_omap3_noncore_dpll_ops, |
341 | .parent = &sys_ck, | 373 | .parent = &sys_ck, |
342 | .dpll_data = &dpll2_dd, | 374 | .dpll_data = &dpll2_dd, |
343 | .round_rate = &omap2_dpll_round_rate, | 375 | .round_rate = &omap2_dpll_round_rate, |
@@ -529,7 +561,8 @@ static struct clk emu_core_alwon_ck = { | |||
529 | /* DPLL4 */ | 561 | /* DPLL4 */ |
530 | /* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */ | 562 | /* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */ |
531 | /* Type: DPLL */ | 563 | /* Type: DPLL */ |
532 | static struct dpll_data dpll4_dd = { | 564 | static struct dpll_data dpll4_dd; |
565 | static struct dpll_data dpll4_dd_34xx __initdata = { | ||
533 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2), | 566 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2), |
534 | .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK, | 567 | .mult_mask = OMAP3430_PERIPH_DPLL_MULT_MASK, |
535 | .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK, | 568 | .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK, |
@@ -552,9 +585,32 @@ static struct dpll_data dpll4_dd = { | |||
552 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE | 585 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE |
553 | }; | 586 | }; |
554 | 587 | ||
588 | static struct dpll_data dpll4_dd_3630 __initdata = { | ||
589 | .mult_div1_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKSEL2), | ||
590 | .mult_mask = OMAP3630_PERIPH_DPLL_MULT_MASK, | ||
591 | .div1_mask = OMAP3430_PERIPH_DPLL_DIV_MASK, | ||
592 | .clk_bypass = &sys_ck, | ||
593 | .clk_ref = &sys_ck, | ||
594 | .control_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | ||
595 | .enable_mask = OMAP3430_EN_PERIPH_DPLL_MASK, | ||
596 | .modes = (1 << DPLL_LOW_POWER_STOP) | (1 << DPLL_LOCKED), | ||
597 | .auto_recal_bit = OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT, | ||
598 | .recal_en_bit = OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT, | ||
599 | .recal_st_bit = OMAP3430_PERIPH_DPLL_ST_SHIFT, | ||
600 | .autoidle_reg = OMAP_CM_REGADDR(PLL_MOD, CM_AUTOIDLE), | ||
601 | .autoidle_mask = OMAP3430_AUTO_PERIPH_DPLL_MASK, | ||
602 | .idlest_reg = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST), | ||
603 | .idlest_mask = OMAP3430_ST_PERIPH_CLK_MASK, | ||
604 | .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, | ||
605 | .min_divider = 1, | ||
606 | .max_divider = OMAP3_MAX_DPLL_DIV, | ||
607 | .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE, | ||
608 | .flags = DPLL_J_TYPE | ||
609 | }; | ||
610 | |||
555 | static struct clk dpll4_ck = { | 611 | static struct clk dpll4_ck = { |
556 | .name = "dpll4_ck", | 612 | .name = "dpll4_ck", |
557 | .ops = &clkops_noncore_dpll_ops, | 613 | .ops = &clkops_omap3_noncore_dpll_ops, |
558 | .parent = &sys_ck, | 614 | .parent = &sys_ck, |
559 | .dpll_data = &dpll4_dd, | 615 | .dpll_data = &dpll4_dd, |
560 | .round_rate = &omap2_dpll_round_rate, | 616 | .round_rate = &omap2_dpll_round_rate, |
@@ -581,8 +637,15 @@ static const struct clksel div16_dpll4_clksel[] = { | |||
581 | { .parent = NULL } | 637 | { .parent = NULL } |
582 | }; | 638 | }; |
583 | 639 | ||
640 | static const struct clksel div32_dpll4_clksel[] = { | ||
641 | { .parent = &dpll4_ck, .rates = div32_dpll4_rates_3630 }, | ||
642 | { .parent = NULL } | ||
643 | }; | ||
644 | |||
584 | /* This virtual clock is the source for dpll4_m2x2_ck */ | 645 | /* This virtual clock is the source for dpll4_m2x2_ck */ |
585 | static struct clk dpll4_m2_ck = { | 646 | static struct clk dpll4_m2_ck; |
647 | |||
648 | static struct clk dpll4_m2_ck_34xx __initdata = { | ||
586 | .name = "dpll4_m2_ck", | 649 | .name = "dpll4_m2_ck", |
587 | .ops = &clkops_null, | 650 | .ops = &clkops_null, |
588 | .parent = &dpll4_ck, | 651 | .parent = &dpll4_ck, |
@@ -594,6 +657,18 @@ static struct clk dpll4_m2_ck = { | |||
594 | .recalc = &omap2_clksel_recalc, | 657 | .recalc = &omap2_clksel_recalc, |
595 | }; | 658 | }; |
596 | 659 | ||
660 | static struct clk dpll4_m2_ck_3630 __initdata = { | ||
661 | .name = "dpll4_m2_ck", | ||
662 | .ops = &clkops_null, | ||
663 | .parent = &dpll4_ck, | ||
664 | .init = &omap2_init_clksel_parent, | ||
665 | .clksel_reg = OMAP_CM_REGADDR(PLL_MOD, OMAP3430_CM_CLKSEL3), | ||
666 | .clksel_mask = OMAP3630_DIV_96M_MASK, | ||
667 | .clksel = div32_dpll4_clksel, | ||
668 | .clkdm_name = "dpll4_clkdm", | ||
669 | .recalc = &omap2_clksel_recalc, | ||
670 | }; | ||
671 | |||
597 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 672 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
598 | static struct clk dpll4_m2x2_ck = { | 673 | static struct clk dpll4_m2x2_ck = { |
599 | .name = "dpll4_m2x2_ck", | 674 | .name = "dpll4_m2x2_ck", |
@@ -612,18 +687,24 @@ static struct clk dpll4_m2x2_ck = { | |||
612 | * 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and | 687 | * 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and |
613 | * CM_96K_(F)CLK. | 688 | * CM_96K_(F)CLK. |
614 | */ | 689 | */ |
615 | static struct clk omap_96m_alwon_fck = { | 690 | |
616 | .name = "omap_96m_alwon_fck", | 691 | /* Adding 192MHz Clock node needed by SGX */ |
692 | static struct clk omap_192m_alwon_fck = { | ||
693 | .name = "omap_192m_alwon_fck", | ||
617 | .ops = &clkops_null, | 694 | .ops = &clkops_null, |
618 | .parent = &dpll4_m2x2_ck, | 695 | .parent = &dpll4_m2x2_ck, |
619 | .recalc = &followparent_recalc, | 696 | .recalc = &followparent_recalc, |
620 | }; | 697 | }; |
621 | 698 | ||
622 | static struct clk cm_96m_fck = { | 699 | static const struct clksel_rate omap_96m_alwon_fck_rates[] = { |
623 | .name = "cm_96m_fck", | 700 | { .div = 1, .val = 1, .flags = RATE_IN_36XX }, |
624 | .ops = &clkops_null, | 701 | { .div = 2, .val = 2, .flags = RATE_IN_36XX | DEFAULT_RATE }, |
625 | .parent = &omap_96m_alwon_fck, | 702 | { .div = 0 } |
626 | .recalc = &followparent_recalc, | 703 | }; |
704 | |||
705 | static const struct clksel omap_96m_alwon_fck_clksel[] = { | ||
706 | { .parent = &omap_192m_alwon_fck, .rates = omap_96m_alwon_fck_rates }, | ||
707 | { .parent = NULL } | ||
627 | }; | 708 | }; |
628 | 709 | ||
629 | static const struct clksel_rate omap_96m_dpll_rates[] = { | 710 | static const struct clksel_rate omap_96m_dpll_rates[] = { |
@@ -636,6 +717,31 @@ static const struct clksel_rate omap_96m_sys_rates[] = { | |||
636 | { .div = 0 } | 717 | { .div = 0 } |
637 | }; | 718 | }; |
638 | 719 | ||
720 | static struct clk omap_96m_alwon_fck = { | ||
721 | .name = "omap_96m_alwon_fck", | ||
722 | .ops = &clkops_null, | ||
723 | .parent = &dpll4_m2x2_ck, | ||
724 | .recalc = &followparent_recalc, | ||
725 | }; | ||
726 | |||
727 | static struct clk omap_96m_alwon_fck_3630 = { | ||
728 | .name = "omap_96m_alwon_fck", | ||
729 | .parent = &omap_192m_alwon_fck, | ||
730 | .init = &omap2_init_clksel_parent, | ||
731 | .ops = &clkops_null, | ||
732 | .recalc = &omap2_clksel_recalc, | ||
733 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | ||
734 | .clksel_mask = OMAP3630_CLKSEL_96M_MASK, | ||
735 | .clksel = omap_96m_alwon_fck_clksel | ||
736 | }; | ||
737 | |||
738 | static struct clk cm_96m_fck = { | ||
739 | .name = "cm_96m_fck", | ||
740 | .ops = &clkops_null, | ||
741 | .parent = &omap_96m_alwon_fck, | ||
742 | .recalc = &followparent_recalc, | ||
743 | }; | ||
744 | |||
639 | static const struct clksel omap_96m_fck_clksel[] = { | 745 | static const struct clksel omap_96m_fck_clksel[] = { |
640 | { .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates }, | 746 | { .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates }, |
641 | { .parent = &sys_ck, .rates = omap_96m_sys_rates }, | 747 | { .parent = &sys_ck, .rates = omap_96m_sys_rates }, |
@@ -654,7 +760,9 @@ static struct clk omap_96m_fck = { | |||
654 | }; | 760 | }; |
655 | 761 | ||
656 | /* This virtual clock is the source for dpll4_m3x2_ck */ | 762 | /* This virtual clock is the source for dpll4_m3x2_ck */ |
657 | static struct clk dpll4_m3_ck = { | 763 | static struct clk dpll4_m3_ck; |
764 | |||
765 | static struct clk dpll4_m3_ck_34xx __initdata = { | ||
658 | .name = "dpll4_m3_ck", | 766 | .name = "dpll4_m3_ck", |
659 | .ops = &clkops_null, | 767 | .ops = &clkops_null, |
660 | .parent = &dpll4_ck, | 768 | .parent = &dpll4_ck, |
@@ -666,12 +774,23 @@ static struct clk dpll4_m3_ck = { | |||
666 | .recalc = &omap2_clksel_recalc, | 774 | .recalc = &omap2_clksel_recalc, |
667 | }; | 775 | }; |
668 | 776 | ||
777 | static struct clk dpll4_m3_ck_3630 __initdata = { | ||
778 | .name = "dpll4_m3_ck", | ||
779 | .ops = &clkops_null, | ||
780 | .parent = &dpll4_ck, | ||
781 | .init = &omap2_init_clksel_parent, | ||
782 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | ||
783 | .clksel_mask = OMAP3630_CLKSEL_TV_MASK, | ||
784 | .clksel = div32_dpll4_clksel, | ||
785 | .clkdm_name = "dpll4_clkdm", | ||
786 | .recalc = &omap2_clksel_recalc, | ||
787 | }; | ||
788 | |||
669 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 789 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
670 | static struct clk dpll4_m3x2_ck = { | 790 | static struct clk dpll4_m3x2_ck = { |
671 | .name = "dpll4_m3x2_ck", | 791 | .name = "dpll4_m3x2_ck", |
672 | .ops = &clkops_omap2_dflt_wait, | 792 | .ops = &clkops_omap2_dflt_wait, |
673 | .parent = &dpll4_m3_ck, | 793 | .parent = &dpll4_m3_ck, |
674 | .init = &omap2_init_clksel_parent, | ||
675 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 794 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
676 | .enable_bit = OMAP3430_PWRDN_TV_SHIFT, | 795 | .enable_bit = OMAP3430_PWRDN_TV_SHIFT, |
677 | .flags = INVERT_ENABLE, | 796 | .flags = INVERT_ENABLE, |
@@ -736,11 +855,13 @@ static struct clk omap_12m_fck = { | |||
736 | .ops = &clkops_null, | 855 | .ops = &clkops_null, |
737 | .parent = &omap_48m_fck, | 856 | .parent = &omap_48m_fck, |
738 | .fixed_div = 4, | 857 | .fixed_div = 4, |
739 | .recalc = &omap2_fixed_divisor_recalc, | 858 | .recalc = &omap_fixed_divisor_recalc, |
740 | }; | 859 | }; |
741 | 860 | ||
742 | /* This virstual clock is the source for dpll4_m4x2_ck */ | 861 | /* This virstual clock is the source for dpll4_m4x2_ck */ |
743 | static struct clk dpll4_m4_ck = { | 862 | static struct clk dpll4_m4_ck; |
863 | |||
864 | static struct clk dpll4_m4_ck_34xx __initdata = { | ||
744 | .name = "dpll4_m4_ck", | 865 | .name = "dpll4_m4_ck", |
745 | .ops = &clkops_null, | 866 | .ops = &clkops_null, |
746 | .parent = &dpll4_ck, | 867 | .parent = &dpll4_ck, |
@@ -754,6 +875,20 @@ static struct clk dpll4_m4_ck = { | |||
754 | .round_rate = &omap2_clksel_round_rate, | 875 | .round_rate = &omap2_clksel_round_rate, |
755 | }; | 876 | }; |
756 | 877 | ||
878 | static struct clk dpll4_m4_ck_3630 __initdata = { | ||
879 | .name = "dpll4_m4_ck", | ||
880 | .ops = &clkops_null, | ||
881 | .parent = &dpll4_ck, | ||
882 | .init = &omap2_init_clksel_parent, | ||
883 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | ||
884 | .clksel_mask = OMAP3630_CLKSEL_DSS1_MASK, | ||
885 | .clksel = div32_dpll4_clksel, | ||
886 | .clkdm_name = "dpll4_clkdm", | ||
887 | .recalc = &omap2_clksel_recalc, | ||
888 | .set_rate = &omap2_clksel_set_rate, | ||
889 | .round_rate = &omap2_clksel_round_rate, | ||
890 | }; | ||
891 | |||
757 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 892 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
758 | static struct clk dpll4_m4x2_ck = { | 893 | static struct clk dpll4_m4x2_ck = { |
759 | .name = "dpll4_m4x2_ck", | 894 | .name = "dpll4_m4x2_ck", |
@@ -767,7 +902,9 @@ static struct clk dpll4_m4x2_ck = { | |||
767 | }; | 902 | }; |
768 | 903 | ||
769 | /* This virtual clock is the source for dpll4_m5x2_ck */ | 904 | /* This virtual clock is the source for dpll4_m5x2_ck */ |
770 | static struct clk dpll4_m5_ck = { | 905 | static struct clk dpll4_m5_ck; |
906 | |||
907 | static struct clk dpll4_m5_ck_34xx __initdata = { | ||
771 | .name = "dpll4_m5_ck", | 908 | .name = "dpll4_m5_ck", |
772 | .ops = &clkops_null, | 909 | .ops = &clkops_null, |
773 | .parent = &dpll4_ck, | 910 | .parent = &dpll4_ck, |
@@ -776,6 +913,22 @@ static struct clk dpll4_m5_ck = { | |||
776 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, | 913 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, |
777 | .clksel = div16_dpll4_clksel, | 914 | .clksel = div16_dpll4_clksel, |
778 | .clkdm_name = "dpll4_clkdm", | 915 | .clkdm_name = "dpll4_clkdm", |
916 | .set_rate = &omap2_clksel_set_rate, | ||
917 | .round_rate = &omap2_clksel_round_rate, | ||
918 | .recalc = &omap2_clksel_recalc, | ||
919 | }; | ||
920 | |||
921 | static struct clk dpll4_m5_ck_3630 __initdata = { | ||
922 | .name = "dpll4_m5_ck", | ||
923 | .ops = &clkops_null, | ||
924 | .parent = &dpll4_ck, | ||
925 | .init = &omap2_init_clksel_parent, | ||
926 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), | ||
927 | .clksel_mask = OMAP3630_CLKSEL_CAM_MASK, | ||
928 | .clksel = div32_dpll4_clksel, | ||
929 | .clkdm_name = "dpll4_clkdm", | ||
930 | .set_rate = &omap2_clksel_set_rate, | ||
931 | .round_rate = &omap2_clksel_round_rate, | ||
779 | .recalc = &omap2_clksel_recalc, | 932 | .recalc = &omap2_clksel_recalc, |
780 | }; | 933 | }; |
781 | 934 | ||
@@ -792,7 +945,9 @@ static struct clk dpll4_m5x2_ck = { | |||
792 | }; | 945 | }; |
793 | 946 | ||
794 | /* This virtual clock is the source for dpll4_m6x2_ck */ | 947 | /* This virtual clock is the source for dpll4_m6x2_ck */ |
795 | static struct clk dpll4_m6_ck = { | 948 | static struct clk dpll4_m6_ck; |
949 | |||
950 | static struct clk dpll4_m6_ck_34xx __initdata = { | ||
796 | .name = "dpll4_m6_ck", | 951 | .name = "dpll4_m6_ck", |
797 | .ops = &clkops_null, | 952 | .ops = &clkops_null, |
798 | .parent = &dpll4_ck, | 953 | .parent = &dpll4_ck, |
@@ -804,12 +959,23 @@ static struct clk dpll4_m6_ck = { | |||
804 | .recalc = &omap2_clksel_recalc, | 959 | .recalc = &omap2_clksel_recalc, |
805 | }; | 960 | }; |
806 | 961 | ||
962 | static struct clk dpll4_m6_ck_3630 __initdata = { | ||
963 | .name = "dpll4_m6_ck", | ||
964 | .ops = &clkops_null, | ||
965 | .parent = &dpll4_ck, | ||
966 | .init = &omap2_init_clksel_parent, | ||
967 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | ||
968 | .clksel_mask = OMAP3630_DIV_DPLL4_MASK, | ||
969 | .clksel = div32_dpll4_clksel, | ||
970 | .clkdm_name = "dpll4_clkdm", | ||
971 | .recalc = &omap2_clksel_recalc, | ||
972 | }; | ||
973 | |||
807 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ | 974 | /* The PWRDN bit is apparently only available on 3430ES2 and above */ |
808 | static struct clk dpll4_m6x2_ck = { | 975 | static struct clk dpll4_m6x2_ck = { |
809 | .name = "dpll4_m6x2_ck", | 976 | .name = "dpll4_m6x2_ck", |
810 | .ops = &clkops_omap2_dflt_wait, | 977 | .ops = &clkops_omap2_dflt_wait, |
811 | .parent = &dpll4_m6_ck, | 978 | .parent = &dpll4_m6_ck, |
812 | .init = &omap2_init_clksel_parent, | ||
813 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), | 979 | .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), |
814 | .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT, | 980 | .enable_bit = OMAP3430_PWRDN_EMU_PERIPH_SHIFT, |
815 | .flags = INVERT_ENABLE, | 981 | .flags = INVERT_ENABLE, |
@@ -854,7 +1020,7 @@ static struct dpll_data dpll5_dd = { | |||
854 | 1020 | ||
855 | static struct clk dpll5_ck = { | 1021 | static struct clk dpll5_ck = { |
856 | .name = "dpll5_ck", | 1022 | .name = "dpll5_ck", |
857 | .ops = &clkops_noncore_dpll_ops, | 1023 | .ops = &clkops_omap3_noncore_dpll_ops, |
858 | .parent = &sys_ck, | 1024 | .parent = &sys_ck, |
859 | .dpll_data = &dpll5_dd, | 1025 | .dpll_data = &dpll5_dd, |
860 | .round_rate = &omap2_dpll_round_rate, | 1026 | .round_rate = &omap2_dpll_round_rate, |
@@ -1045,7 +1211,6 @@ static struct clk iva2_ck = { | |||
1045 | .name = "iva2_ck", | 1211 | .name = "iva2_ck", |
1046 | .ops = &clkops_omap2_dflt_wait, | 1212 | .ops = &clkops_omap2_dflt_wait, |
1047 | .parent = &dpll2_m2_ck, | 1213 | .parent = &dpll2_m2_ck, |
1048 | .init = &omap2_init_clksel_parent, | ||
1049 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN), | 1214 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_IVA2_MOD, CM_FCLKEN), |
1050 | .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT, | 1215 | .enable_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT, |
1051 | .clkdm_name = "iva2_clkdm", | 1216 | .clkdm_name = "iva2_clkdm", |
@@ -1119,7 +1284,6 @@ static struct clk gfx_l3_ck = { | |||
1119 | .name = "gfx_l3_ck", | 1284 | .name = "gfx_l3_ck", |
1120 | .ops = &clkops_omap2_dflt_wait, | 1285 | .ops = &clkops_omap2_dflt_wait, |
1121 | .parent = &l3_ick, | 1286 | .parent = &l3_ick, |
1122 | .init = &omap2_init_clksel_parent, | ||
1123 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), | 1287 | .enable_reg = OMAP_CM_REGADDR(GFX_MOD, CM_ICLKEN), |
1124 | .enable_bit = OMAP_EN_GFX_SHIFT, | 1288 | .enable_bit = OMAP_EN_GFX_SHIFT, |
1125 | .recalc = &followparent_recalc, | 1289 | .recalc = &followparent_recalc, |
@@ -1168,12 +1332,24 @@ static struct clk gfx_cg2_ck = { | |||
1168 | /* SGX power domain - 3430ES2 only */ | 1332 | /* SGX power domain - 3430ES2 only */ |
1169 | 1333 | ||
1170 | static const struct clksel_rate sgx_core_rates[] = { | 1334 | static const struct clksel_rate sgx_core_rates[] = { |
1335 | { .div = 2, .val = 5, .flags = RATE_IN_36XX }, | ||
1171 | { .div = 3, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, | 1336 | { .div = 3, .val = 0, .flags = RATE_IN_343X | DEFAULT_RATE }, |
1172 | { .div = 4, .val = 1, .flags = RATE_IN_343X }, | 1337 | { .div = 4, .val = 1, .flags = RATE_IN_343X }, |
1173 | { .div = 6, .val = 2, .flags = RATE_IN_343X }, | 1338 | { .div = 6, .val = 2, .flags = RATE_IN_343X }, |
1174 | { .div = 0 }, | 1339 | { .div = 0 }, |
1175 | }; | 1340 | }; |
1176 | 1341 | ||
1342 | static const struct clksel_rate sgx_192m_rates[] = { | ||
1343 | { .div = 1, .val = 4, .flags = RATE_IN_36XX | DEFAULT_RATE }, | ||
1344 | { .div = 0 }, | ||
1345 | }; | ||
1346 | |||
1347 | static const struct clksel_rate sgx_corex2_rates[] = { | ||
1348 | { .div = 3, .val = 6, .flags = RATE_IN_36XX | DEFAULT_RATE }, | ||
1349 | { .div = 5, .val = 7, .flags = RATE_IN_36XX }, | ||
1350 | { .div = 0 }, | ||
1351 | }; | ||
1352 | |||
1177 | static const struct clksel_rate sgx_96m_rates[] = { | 1353 | static const struct clksel_rate sgx_96m_rates[] = { |
1178 | { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE }, | 1354 | { .div = 1, .val = 3, .flags = RATE_IN_343X | DEFAULT_RATE }, |
1179 | { .div = 0 }, | 1355 | { .div = 0 }, |
@@ -1182,7 +1358,9 @@ static const struct clksel_rate sgx_96m_rates[] = { | |||
1182 | static const struct clksel sgx_clksel[] = { | 1358 | static const struct clksel sgx_clksel[] = { |
1183 | { .parent = &core_ck, .rates = sgx_core_rates }, | 1359 | { .parent = &core_ck, .rates = sgx_core_rates }, |
1184 | { .parent = &cm_96m_fck, .rates = sgx_96m_rates }, | 1360 | { .parent = &cm_96m_fck, .rates = sgx_96m_rates }, |
1185 | { .parent = NULL }, | 1361 | { .parent = &omap_192m_alwon_fck, .rates = sgx_192m_rates }, |
1362 | { .parent = &corex2_fck, .rates = sgx_corex2_rates }, | ||
1363 | { .parent = NULL } | ||
1186 | }; | 1364 | }; |
1187 | 1365 | ||
1188 | static struct clk sgx_fck = { | 1366 | static struct clk sgx_fck = { |
@@ -1196,6 +1374,8 @@ static struct clk sgx_fck = { | |||
1196 | .clksel = sgx_clksel, | 1374 | .clksel = sgx_clksel, |
1197 | .clkdm_name = "sgx_clkdm", | 1375 | .clkdm_name = "sgx_clkdm", |
1198 | .recalc = &omap2_clksel_recalc, | 1376 | .recalc = &omap2_clksel_recalc, |
1377 | .set_rate = &omap2_clksel_set_rate, | ||
1378 | .round_rate = &omap2_clksel_round_rate | ||
1199 | }; | 1379 | }; |
1200 | 1380 | ||
1201 | static struct clk sgx_ick = { | 1381 | static struct clk sgx_ick = { |
@@ -1322,9 +1502,8 @@ static struct clk core_96m_fck = { | |||
1322 | }; | 1502 | }; |
1323 | 1503 | ||
1324 | static struct clk mmchs3_fck = { | 1504 | static struct clk mmchs3_fck = { |
1325 | .name = "mmchs_fck", | 1505 | .name = "mmchs3_fck", |
1326 | .ops = &clkops_omap2_dflt_wait, | 1506 | .ops = &clkops_omap2_dflt_wait, |
1327 | .id = 2, | ||
1328 | .parent = &core_96m_fck, | 1507 | .parent = &core_96m_fck, |
1329 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1508 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1330 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, | 1509 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, |
@@ -1333,9 +1512,8 @@ static struct clk mmchs3_fck = { | |||
1333 | }; | 1512 | }; |
1334 | 1513 | ||
1335 | static struct clk mmchs2_fck = { | 1514 | static struct clk mmchs2_fck = { |
1336 | .name = "mmchs_fck", | 1515 | .name = "mmchs2_fck", |
1337 | .ops = &clkops_omap2_dflt_wait, | 1516 | .ops = &clkops_omap2_dflt_wait, |
1338 | .id = 1, | ||
1339 | .parent = &core_96m_fck, | 1517 | .parent = &core_96m_fck, |
1340 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1518 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1341 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, | 1519 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, |
@@ -1354,7 +1532,7 @@ static struct clk mspro_fck = { | |||
1354 | }; | 1532 | }; |
1355 | 1533 | ||
1356 | static struct clk mmchs1_fck = { | 1534 | static struct clk mmchs1_fck = { |
1357 | .name = "mmchs_fck", | 1535 | .name = "mmchs1_fck", |
1358 | .ops = &clkops_omap2_dflt_wait, | 1536 | .ops = &clkops_omap2_dflt_wait, |
1359 | .parent = &core_96m_fck, | 1537 | .parent = &core_96m_fck, |
1360 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1538 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
@@ -1364,9 +1542,8 @@ static struct clk mmchs1_fck = { | |||
1364 | }; | 1542 | }; |
1365 | 1543 | ||
1366 | static struct clk i2c3_fck = { | 1544 | static struct clk i2c3_fck = { |
1367 | .name = "i2c_fck", | 1545 | .name = "i2c3_fck", |
1368 | .ops = &clkops_omap2_dflt_wait, | 1546 | .ops = &clkops_omap2_dflt_wait, |
1369 | .id = 3, | ||
1370 | .parent = &core_96m_fck, | 1547 | .parent = &core_96m_fck, |
1371 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1548 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1372 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, | 1549 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, |
@@ -1375,9 +1552,8 @@ static struct clk i2c3_fck = { | |||
1375 | }; | 1552 | }; |
1376 | 1553 | ||
1377 | static struct clk i2c2_fck = { | 1554 | static struct clk i2c2_fck = { |
1378 | .name = "i2c_fck", | 1555 | .name = "i2c2_fck", |
1379 | .ops = &clkops_omap2_dflt_wait, | 1556 | .ops = &clkops_omap2_dflt_wait, |
1380 | .id = 2, | ||
1381 | .parent = &core_96m_fck, | 1557 | .parent = &core_96m_fck, |
1382 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1558 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1383 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, | 1559 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, |
@@ -1386,9 +1562,8 @@ static struct clk i2c2_fck = { | |||
1386 | }; | 1562 | }; |
1387 | 1563 | ||
1388 | static struct clk i2c1_fck = { | 1564 | static struct clk i2c1_fck = { |
1389 | .name = "i2c_fck", | 1565 | .name = "i2c1_fck", |
1390 | .ops = &clkops_omap2_dflt_wait, | 1566 | .ops = &clkops_omap2_dflt_wait, |
1391 | .id = 1, | ||
1392 | .parent = &core_96m_fck, | 1567 | .parent = &core_96m_fck, |
1393 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1568 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1394 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, | 1569 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, |
@@ -1417,9 +1592,8 @@ static const struct clksel mcbsp_15_clksel[] = { | |||
1417 | }; | 1592 | }; |
1418 | 1593 | ||
1419 | static struct clk mcbsp5_fck = { | 1594 | static struct clk mcbsp5_fck = { |
1420 | .name = "mcbsp_fck", | 1595 | .name = "mcbsp5_fck", |
1421 | .ops = &clkops_omap2_dflt_wait, | 1596 | .ops = &clkops_omap2_dflt_wait, |
1422 | .id = 5, | ||
1423 | .init = &omap2_init_clksel_parent, | 1597 | .init = &omap2_init_clksel_parent, |
1424 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1598 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1425 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, | 1599 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, |
@@ -1431,9 +1605,8 @@ static struct clk mcbsp5_fck = { | |||
1431 | }; | 1605 | }; |
1432 | 1606 | ||
1433 | static struct clk mcbsp1_fck = { | 1607 | static struct clk mcbsp1_fck = { |
1434 | .name = "mcbsp_fck", | 1608 | .name = "mcbsp1_fck", |
1435 | .ops = &clkops_omap2_dflt_wait, | 1609 | .ops = &clkops_omap2_dflt_wait, |
1436 | .id = 1, | ||
1437 | .init = &omap2_init_clksel_parent, | 1610 | .init = &omap2_init_clksel_parent, |
1438 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1611 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1439 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, | 1612 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, |
@@ -1455,9 +1628,8 @@ static struct clk core_48m_fck = { | |||
1455 | }; | 1628 | }; |
1456 | 1629 | ||
1457 | static struct clk mcspi4_fck = { | 1630 | static struct clk mcspi4_fck = { |
1458 | .name = "mcspi_fck", | 1631 | .name = "mcspi4_fck", |
1459 | .ops = &clkops_omap2_dflt_wait, | 1632 | .ops = &clkops_omap2_dflt_wait, |
1460 | .id = 4, | ||
1461 | .parent = &core_48m_fck, | 1633 | .parent = &core_48m_fck, |
1462 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1634 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1463 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, | 1635 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, |
@@ -1465,9 +1637,8 @@ static struct clk mcspi4_fck = { | |||
1465 | }; | 1637 | }; |
1466 | 1638 | ||
1467 | static struct clk mcspi3_fck = { | 1639 | static struct clk mcspi3_fck = { |
1468 | .name = "mcspi_fck", | 1640 | .name = "mcspi3_fck", |
1469 | .ops = &clkops_omap2_dflt_wait, | 1641 | .ops = &clkops_omap2_dflt_wait, |
1470 | .id = 3, | ||
1471 | .parent = &core_48m_fck, | 1642 | .parent = &core_48m_fck, |
1472 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1643 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1473 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, | 1644 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, |
@@ -1475,9 +1646,8 @@ static struct clk mcspi3_fck = { | |||
1475 | }; | 1646 | }; |
1476 | 1647 | ||
1477 | static struct clk mcspi2_fck = { | 1648 | static struct clk mcspi2_fck = { |
1478 | .name = "mcspi_fck", | 1649 | .name = "mcspi2_fck", |
1479 | .ops = &clkops_omap2_dflt_wait, | 1650 | .ops = &clkops_omap2_dflt_wait, |
1480 | .id = 2, | ||
1481 | .parent = &core_48m_fck, | 1651 | .parent = &core_48m_fck, |
1482 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1652 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1483 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, | 1653 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, |
@@ -1485,9 +1655,8 @@ static struct clk mcspi2_fck = { | |||
1485 | }; | 1655 | }; |
1486 | 1656 | ||
1487 | static struct clk mcspi1_fck = { | 1657 | static struct clk mcspi1_fck = { |
1488 | .name = "mcspi_fck", | 1658 | .name = "mcspi1_fck", |
1489 | .ops = &clkops_omap2_dflt_wait, | 1659 | .ops = &clkops_omap2_dflt_wait, |
1490 | .id = 1, | ||
1491 | .parent = &core_48m_fck, | 1660 | .parent = &core_48m_fck, |
1492 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1661 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1493 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, | 1662 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, |
@@ -1500,6 +1669,7 @@ static struct clk uart2_fck = { | |||
1500 | .parent = &core_48m_fck, | 1669 | .parent = &core_48m_fck, |
1501 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1670 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1502 | .enable_bit = OMAP3430_EN_UART2_SHIFT, | 1671 | .enable_bit = OMAP3430_EN_UART2_SHIFT, |
1672 | .clkdm_name = "core_l4_clkdm", | ||
1503 | .recalc = &followparent_recalc, | 1673 | .recalc = &followparent_recalc, |
1504 | }; | 1674 | }; |
1505 | 1675 | ||
@@ -1509,6 +1679,7 @@ static struct clk uart1_fck = { | |||
1509 | .parent = &core_48m_fck, | 1679 | .parent = &core_48m_fck, |
1510 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1680 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1511 | .enable_bit = OMAP3430_EN_UART1_SHIFT, | 1681 | .enable_bit = OMAP3430_EN_UART1_SHIFT, |
1682 | .clkdm_name = "core_l4_clkdm", | ||
1512 | .recalc = &followparent_recalc, | 1683 | .recalc = &followparent_recalc, |
1513 | }; | 1684 | }; |
1514 | 1685 | ||
@@ -1588,7 +1759,7 @@ static struct clk ssi_sst_fck_3430es1 = { | |||
1588 | .ops = &clkops_null, | 1759 | .ops = &clkops_null, |
1589 | .parent = &ssi_ssr_fck_3430es1, | 1760 | .parent = &ssi_ssr_fck_3430es1, |
1590 | .fixed_div = 2, | 1761 | .fixed_div = 2, |
1591 | .recalc = &omap2_fixed_divisor_recalc, | 1762 | .recalc = &omap_fixed_divisor_recalc, |
1592 | }; | 1763 | }; |
1593 | 1764 | ||
1594 | static struct clk ssi_sst_fck_3430es2 = { | 1765 | static struct clk ssi_sst_fck_3430es2 = { |
@@ -1596,7 +1767,7 @@ static struct clk ssi_sst_fck_3430es2 = { | |||
1596 | .ops = &clkops_null, | 1767 | .ops = &clkops_null, |
1597 | .parent = &ssi_ssr_fck_3430es2, | 1768 | .parent = &ssi_ssr_fck_3430es2, |
1598 | .fixed_div = 2, | 1769 | .fixed_div = 2, |
1599 | .recalc = &omap2_fixed_divisor_recalc, | 1770 | .recalc = &omap_fixed_divisor_recalc, |
1600 | }; | 1771 | }; |
1601 | 1772 | ||
1602 | 1773 | ||
@@ -1694,9 +1865,8 @@ static struct clk usbtll_ick = { | |||
1694 | }; | 1865 | }; |
1695 | 1866 | ||
1696 | static struct clk mmchs3_ick = { | 1867 | static struct clk mmchs3_ick = { |
1697 | .name = "mmchs_ick", | 1868 | .name = "mmchs3_ick", |
1698 | .ops = &clkops_omap2_dflt_wait, | 1869 | .ops = &clkops_omap2_dflt_wait, |
1699 | .id = 2, | ||
1700 | .parent = &core_l4_ick, | 1870 | .parent = &core_l4_ick, |
1701 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1871 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1702 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, | 1872 | .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, |
@@ -1746,9 +1916,8 @@ static struct clk des2_ick = { | |||
1746 | }; | 1916 | }; |
1747 | 1917 | ||
1748 | static struct clk mmchs2_ick = { | 1918 | static struct clk mmchs2_ick = { |
1749 | .name = "mmchs_ick", | 1919 | .name = "mmchs2_ick", |
1750 | .ops = &clkops_omap2_dflt_wait, | 1920 | .ops = &clkops_omap2_dflt_wait, |
1751 | .id = 1, | ||
1752 | .parent = &core_l4_ick, | 1921 | .parent = &core_l4_ick, |
1753 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1922 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1754 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, | 1923 | .enable_bit = OMAP3430_EN_MMC2_SHIFT, |
@@ -1757,7 +1926,7 @@ static struct clk mmchs2_ick = { | |||
1757 | }; | 1926 | }; |
1758 | 1927 | ||
1759 | static struct clk mmchs1_ick = { | 1928 | static struct clk mmchs1_ick = { |
1760 | .name = "mmchs_ick", | 1929 | .name = "mmchs1_ick", |
1761 | .ops = &clkops_omap2_dflt_wait, | 1930 | .ops = &clkops_omap2_dflt_wait, |
1762 | .parent = &core_l4_ick, | 1931 | .parent = &core_l4_ick, |
1763 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1932 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
@@ -1787,9 +1956,8 @@ static struct clk hdq_ick = { | |||
1787 | }; | 1956 | }; |
1788 | 1957 | ||
1789 | static struct clk mcspi4_ick = { | 1958 | static struct clk mcspi4_ick = { |
1790 | .name = "mcspi_ick", | 1959 | .name = "mcspi4_ick", |
1791 | .ops = &clkops_omap2_dflt_wait, | 1960 | .ops = &clkops_omap2_dflt_wait, |
1792 | .id = 4, | ||
1793 | .parent = &core_l4_ick, | 1961 | .parent = &core_l4_ick, |
1794 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1962 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1795 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, | 1963 | .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, |
@@ -1798,9 +1966,8 @@ static struct clk mcspi4_ick = { | |||
1798 | }; | 1966 | }; |
1799 | 1967 | ||
1800 | static struct clk mcspi3_ick = { | 1968 | static struct clk mcspi3_ick = { |
1801 | .name = "mcspi_ick", | 1969 | .name = "mcspi3_ick", |
1802 | .ops = &clkops_omap2_dflt_wait, | 1970 | .ops = &clkops_omap2_dflt_wait, |
1803 | .id = 3, | ||
1804 | .parent = &core_l4_ick, | 1971 | .parent = &core_l4_ick, |
1805 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1972 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1806 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, | 1973 | .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, |
@@ -1809,9 +1976,8 @@ static struct clk mcspi3_ick = { | |||
1809 | }; | 1976 | }; |
1810 | 1977 | ||
1811 | static struct clk mcspi2_ick = { | 1978 | static struct clk mcspi2_ick = { |
1812 | .name = "mcspi_ick", | 1979 | .name = "mcspi2_ick", |
1813 | .ops = &clkops_omap2_dflt_wait, | 1980 | .ops = &clkops_omap2_dflt_wait, |
1814 | .id = 2, | ||
1815 | .parent = &core_l4_ick, | 1981 | .parent = &core_l4_ick, |
1816 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1982 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1817 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, | 1983 | .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, |
@@ -1820,9 +1986,8 @@ static struct clk mcspi2_ick = { | |||
1820 | }; | 1986 | }; |
1821 | 1987 | ||
1822 | static struct clk mcspi1_ick = { | 1988 | static struct clk mcspi1_ick = { |
1823 | .name = "mcspi_ick", | 1989 | .name = "mcspi1_ick", |
1824 | .ops = &clkops_omap2_dflt_wait, | 1990 | .ops = &clkops_omap2_dflt_wait, |
1825 | .id = 1, | ||
1826 | .parent = &core_l4_ick, | 1991 | .parent = &core_l4_ick, |
1827 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 1992 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1828 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, | 1993 | .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, |
@@ -1831,9 +1996,8 @@ static struct clk mcspi1_ick = { | |||
1831 | }; | 1996 | }; |
1832 | 1997 | ||
1833 | static struct clk i2c3_ick = { | 1998 | static struct clk i2c3_ick = { |
1834 | .name = "i2c_ick", | 1999 | .name = "i2c3_ick", |
1835 | .ops = &clkops_omap2_dflt_wait, | 2000 | .ops = &clkops_omap2_dflt_wait, |
1836 | .id = 3, | ||
1837 | .parent = &core_l4_ick, | 2001 | .parent = &core_l4_ick, |
1838 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2002 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1839 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, | 2003 | .enable_bit = OMAP3430_EN_I2C3_SHIFT, |
@@ -1842,9 +2006,8 @@ static struct clk i2c3_ick = { | |||
1842 | }; | 2006 | }; |
1843 | 2007 | ||
1844 | static struct clk i2c2_ick = { | 2008 | static struct clk i2c2_ick = { |
1845 | .name = "i2c_ick", | 2009 | .name = "i2c2_ick", |
1846 | .ops = &clkops_omap2_dflt_wait, | 2010 | .ops = &clkops_omap2_dflt_wait, |
1847 | .id = 2, | ||
1848 | .parent = &core_l4_ick, | 2011 | .parent = &core_l4_ick, |
1849 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2012 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1850 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, | 2013 | .enable_bit = OMAP3430_EN_I2C2_SHIFT, |
@@ -1853,9 +2016,8 @@ static struct clk i2c2_ick = { | |||
1853 | }; | 2016 | }; |
1854 | 2017 | ||
1855 | static struct clk i2c1_ick = { | 2018 | static struct clk i2c1_ick = { |
1856 | .name = "i2c_ick", | 2019 | .name = "i2c1_ick", |
1857 | .ops = &clkops_omap2_dflt_wait, | 2020 | .ops = &clkops_omap2_dflt_wait, |
1858 | .id = 1, | ||
1859 | .parent = &core_l4_ick, | 2021 | .parent = &core_l4_ick, |
1860 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2022 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1861 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, | 2023 | .enable_bit = OMAP3430_EN_I2C1_SHIFT, |
@@ -1904,9 +2066,8 @@ static struct clk gpt10_ick = { | |||
1904 | }; | 2066 | }; |
1905 | 2067 | ||
1906 | static struct clk mcbsp5_ick = { | 2068 | static struct clk mcbsp5_ick = { |
1907 | .name = "mcbsp_ick", | 2069 | .name = "mcbsp5_ick", |
1908 | .ops = &clkops_omap2_dflt_wait, | 2070 | .ops = &clkops_omap2_dflt_wait, |
1909 | .id = 5, | ||
1910 | .parent = &core_l4_ick, | 2071 | .parent = &core_l4_ick, |
1911 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2072 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1912 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, | 2073 | .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, |
@@ -1915,9 +2076,8 @@ static struct clk mcbsp5_ick = { | |||
1915 | }; | 2076 | }; |
1916 | 2077 | ||
1917 | static struct clk mcbsp1_ick = { | 2078 | static struct clk mcbsp1_ick = { |
1918 | .name = "mcbsp_ick", | 2079 | .name = "mcbsp1_ick", |
1919 | .ops = &clkops_omap2_dflt_wait, | 2080 | .ops = &clkops_omap2_dflt_wait, |
1920 | .id = 1, | ||
1921 | .parent = &core_l4_ick, | 2081 | .parent = &core_l4_ick, |
1922 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2082 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
1923 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, | 2083 | .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, |
@@ -2712,9 +2872,8 @@ static struct clk gpt2_ick = { | |||
2712 | }; | 2872 | }; |
2713 | 2873 | ||
2714 | static struct clk mcbsp2_ick = { | 2874 | static struct clk mcbsp2_ick = { |
2715 | .name = "mcbsp_ick", | 2875 | .name = "mcbsp2_ick", |
2716 | .ops = &clkops_omap2_dflt_wait, | 2876 | .ops = &clkops_omap2_dflt_wait, |
2717 | .id = 2, | ||
2718 | .parent = &per_l4_ick, | 2877 | .parent = &per_l4_ick, |
2719 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2878 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2720 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, | 2879 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, |
@@ -2723,9 +2882,8 @@ static struct clk mcbsp2_ick = { | |||
2723 | }; | 2882 | }; |
2724 | 2883 | ||
2725 | static struct clk mcbsp3_ick = { | 2884 | static struct clk mcbsp3_ick = { |
2726 | .name = "mcbsp_ick", | 2885 | .name = "mcbsp3_ick", |
2727 | .ops = &clkops_omap2_dflt_wait, | 2886 | .ops = &clkops_omap2_dflt_wait, |
2728 | .id = 3, | ||
2729 | .parent = &per_l4_ick, | 2887 | .parent = &per_l4_ick, |
2730 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2888 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2731 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, | 2889 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, |
@@ -2734,9 +2892,8 @@ static struct clk mcbsp3_ick = { | |||
2734 | }; | 2892 | }; |
2735 | 2893 | ||
2736 | static struct clk mcbsp4_ick = { | 2894 | static struct clk mcbsp4_ick = { |
2737 | .name = "mcbsp_ick", | 2895 | .name = "mcbsp4_ick", |
2738 | .ops = &clkops_omap2_dflt_wait, | 2896 | .ops = &clkops_omap2_dflt_wait, |
2739 | .id = 4, | ||
2740 | .parent = &per_l4_ick, | 2897 | .parent = &per_l4_ick, |
2741 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), | 2898 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), |
2742 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, | 2899 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, |
@@ -2745,15 +2902,14 @@ static struct clk mcbsp4_ick = { | |||
2745 | }; | 2902 | }; |
2746 | 2903 | ||
2747 | static const struct clksel mcbsp_234_clksel[] = { | 2904 | static const struct clksel mcbsp_234_clksel[] = { |
2748 | { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates }, | 2905 | { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates }, |
2749 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, | 2906 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, |
2750 | { .parent = NULL } | 2907 | { .parent = NULL } |
2751 | }; | 2908 | }; |
2752 | 2909 | ||
2753 | static struct clk mcbsp2_fck = { | 2910 | static struct clk mcbsp2_fck = { |
2754 | .name = "mcbsp_fck", | 2911 | .name = "mcbsp2_fck", |
2755 | .ops = &clkops_omap2_dflt_wait, | 2912 | .ops = &clkops_omap2_dflt_wait, |
2756 | .id = 2, | ||
2757 | .init = &omap2_init_clksel_parent, | 2913 | .init = &omap2_init_clksel_parent, |
2758 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2914 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2759 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, | 2915 | .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, |
@@ -2765,9 +2921,8 @@ static struct clk mcbsp2_fck = { | |||
2765 | }; | 2921 | }; |
2766 | 2922 | ||
2767 | static struct clk mcbsp3_fck = { | 2923 | static struct clk mcbsp3_fck = { |
2768 | .name = "mcbsp_fck", | 2924 | .name = "mcbsp3_fck", |
2769 | .ops = &clkops_omap2_dflt_wait, | 2925 | .ops = &clkops_omap2_dflt_wait, |
2770 | .id = 3, | ||
2771 | .init = &omap2_init_clksel_parent, | 2926 | .init = &omap2_init_clksel_parent, |
2772 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2927 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2773 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, | 2928 | .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, |
@@ -2779,9 +2934,8 @@ static struct clk mcbsp3_fck = { | |||
2779 | }; | 2934 | }; |
2780 | 2935 | ||
2781 | static struct clk mcbsp4_fck = { | 2936 | static struct clk mcbsp4_fck = { |
2782 | .name = "mcbsp_fck", | 2937 | .name = "mcbsp4_fck", |
2783 | .ops = &clkops_omap2_dflt_wait, | 2938 | .ops = &clkops_omap2_dflt_wait, |
2784 | .id = 4, | ||
2785 | .init = &omap2_init_clksel_parent, | 2939 | .init = &omap2_init_clksel_parent, |
2786 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), | 2940 | .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_FCLKEN), |
2787 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, | 2941 | .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, |
@@ -2983,144 +3137,251 @@ static struct clk wdt1_fck = { | |||
2983 | .recalc = &followparent_recalc, | 3137 | .recalc = &followparent_recalc, |
2984 | }; | 3138 | }; |
2985 | 3139 | ||
3140 | /* Clocks for AM35XX */ | ||
3141 | static struct clk ipss_ick = { | ||
3142 | .name = "ipss_ick", | ||
3143 | .ops = &clkops_am35xx_ipss_wait, | ||
3144 | .parent = &core_l3_ick, | ||
3145 | .clkdm_name = "core_l3_clkdm", | ||
3146 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
3147 | .enable_bit = AM35XX_EN_IPSS_SHIFT, | ||
3148 | .recalc = &followparent_recalc, | ||
3149 | }; | ||
3150 | |||
3151 | static struct clk emac_ick = { | ||
3152 | .name = "emac_ick", | ||
3153 | .ops = &clkops_am35xx_ipss_module_wait, | ||
3154 | .parent = &ipss_ick, | ||
3155 | .clkdm_name = "core_l3_clkdm", | ||
3156 | .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL), | ||
3157 | .enable_bit = AM35XX_CPGMAC_VBUSP_CLK_SHIFT, | ||
3158 | .recalc = &followparent_recalc, | ||
3159 | }; | ||
3160 | |||
3161 | static struct clk rmii_ck = { | ||
3162 | .name = "rmii_ck", | ||
3163 | .ops = &clkops_null, | ||
3164 | .rate = 50000000, | ||
3165 | }; | ||
3166 | |||
3167 | static struct clk emac_fck = { | ||
3168 | .name = "emac_fck", | ||
3169 | .ops = &clkops_omap2_dflt, | ||
3170 | .parent = &rmii_ck, | ||
3171 | .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL), | ||
3172 | .enable_bit = AM35XX_CPGMAC_FCLK_SHIFT, | ||
3173 | .recalc = &followparent_recalc, | ||
3174 | }; | ||
3175 | |||
3176 | static struct clk hsotgusb_ick_am35xx = { | ||
3177 | .name = "hsotgusb_ick", | ||
3178 | .ops = &clkops_am35xx_ipss_module_wait, | ||
3179 | .parent = &ipss_ick, | ||
3180 | .clkdm_name = "core_l3_clkdm", | ||
3181 | .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL), | ||
3182 | .enable_bit = AM35XX_USBOTG_VBUSP_CLK_SHIFT, | ||
3183 | .recalc = &followparent_recalc, | ||
3184 | }; | ||
3185 | |||
3186 | static struct clk hsotgusb_fck_am35xx = { | ||
3187 | .name = "hsotgusb_fck", | ||
3188 | .ops = &clkops_omap2_dflt, | ||
3189 | .parent = &sys_ck, | ||
3190 | .clkdm_name = "core_l3_clkdm", | ||
3191 | .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL), | ||
3192 | .enable_bit = AM35XX_USBOTG_FCLK_SHIFT, | ||
3193 | .recalc = &followparent_recalc, | ||
3194 | }; | ||
3195 | |||
3196 | static struct clk hecc_ck = { | ||
3197 | .name = "hecc_ck", | ||
3198 | .ops = &clkops_am35xx_ipss_module_wait, | ||
3199 | .parent = &sys_ck, | ||
3200 | .clkdm_name = "core_l3_clkdm", | ||
3201 | .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL), | ||
3202 | .enable_bit = AM35XX_HECC_VBUSP_CLK_SHIFT, | ||
3203 | .recalc = &followparent_recalc, | ||
3204 | }; | ||
3205 | |||
3206 | static struct clk vpfe_ick = { | ||
3207 | .name = "vpfe_ick", | ||
3208 | .ops = &clkops_am35xx_ipss_module_wait, | ||
3209 | .parent = &ipss_ick, | ||
3210 | .clkdm_name = "core_l3_clkdm", | ||
3211 | .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL), | ||
3212 | .enable_bit = AM35XX_VPFE_VBUSP_CLK_SHIFT, | ||
3213 | .recalc = &followparent_recalc, | ||
3214 | }; | ||
3215 | |||
3216 | static struct clk pclk_ck = { | ||
3217 | .name = "pclk_ck", | ||
3218 | .ops = &clkops_null, | ||
3219 | .rate = 27000000, | ||
3220 | }; | ||
3221 | |||
3222 | static struct clk vpfe_fck = { | ||
3223 | .name = "vpfe_fck", | ||
3224 | .ops = &clkops_omap2_dflt, | ||
3225 | .parent = &pclk_ck, | ||
3226 | .enable_reg = OMAP343X_CTRL_REGADDR(AM35XX_CONTROL_IPSS_CLK_CTRL), | ||
3227 | .enable_bit = AM35XX_VPFE_FCLK_SHIFT, | ||
3228 | .recalc = &followparent_recalc, | ||
3229 | }; | ||
3230 | |||
3231 | /* | ||
3232 | * The UART1/2 functional clock acts as the functional | ||
3233 | * clock for UART4. No separate fclk control available. | ||
3234 | */ | ||
3235 | static struct clk uart4_ick_am35xx = { | ||
3236 | .name = "uart4_ick", | ||
3237 | .ops = &clkops_omap2_dflt_wait, | ||
3238 | .parent = &core_l4_ick, | ||
3239 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | ||
3240 | .enable_bit = AM35XX_EN_UART4_SHIFT, | ||
3241 | .clkdm_name = "core_l4_clkdm", | ||
3242 | .recalc = &followparent_recalc, | ||
3243 | }; | ||
3244 | |||
2986 | 3245 | ||
2987 | /* | 3246 | /* |
2988 | * clkdev | 3247 | * clkdev |
2989 | */ | 3248 | */ |
2990 | 3249 | ||
2991 | static struct omap_clk omap34xx_clks[] = { | 3250 | /* XXX At some point we should rename this file to clock3xxx_data.c */ |
2992 | CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_343X), | 3251 | static struct omap_clk omap3xxx_clks[] = { |
2993 | CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_343X), | 3252 | CLK(NULL, "omap_32k_fck", &omap_32k_fck, CK_3XXX), |
2994 | CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_343X), | 3253 | CLK(NULL, "virt_12m_ck", &virt_12m_ck, CK_3XXX), |
2995 | CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2), | 3254 | CLK(NULL, "virt_13m_ck", &virt_13m_ck, CK_3XXX), |
2996 | CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_343X), | 3255 | CLK(NULL, "virt_16_8m_ck", &virt_16_8m_ck, CK_3430ES2 | CK_AM35XX), |
2997 | CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_343X), | 3256 | CLK(NULL, "virt_19_2m_ck", &virt_19_2m_ck, CK_3XXX), |
2998 | CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_343X), | 3257 | CLK(NULL, "virt_26m_ck", &virt_26m_ck, CK_3XXX), |
2999 | CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_343X), | 3258 | CLK(NULL, "virt_38_4m_ck", &virt_38_4m_ck, CK_3XXX), |
3000 | CLK(NULL, "sys_ck", &sys_ck, CK_343X), | 3259 | CLK(NULL, "osc_sys_ck", &osc_sys_ck, CK_3XXX), |
3001 | CLK(NULL, "sys_altclk", &sys_altclk, CK_343X), | 3260 | CLK(NULL, "sys_ck", &sys_ck, CK_3XXX), |
3002 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_343X), | 3261 | CLK(NULL, "sys_altclk", &sys_altclk, CK_3XXX), |
3003 | CLK(NULL, "sys_clkout1", &sys_clkout1, CK_343X), | 3262 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_3XXX), |
3004 | CLK(NULL, "dpll1_ck", &dpll1_ck, CK_343X), | 3263 | CLK(NULL, "sys_clkout1", &sys_clkout1, CK_3XXX), |
3005 | CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_343X), | 3264 | CLK(NULL, "dpll1_ck", &dpll1_ck, CK_3XXX), |
3006 | CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_343X), | 3265 | CLK(NULL, "dpll1_x2_ck", &dpll1_x2_ck, CK_3XXX), |
3266 | CLK(NULL, "dpll1_x2m2_ck", &dpll1_x2m2_ck, CK_3XXX), | ||
3007 | CLK(NULL, "dpll2_ck", &dpll2_ck, CK_343X), | 3267 | CLK(NULL, "dpll2_ck", &dpll2_ck, CK_343X), |
3008 | CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_343X), | 3268 | CLK(NULL, "dpll2_m2_ck", &dpll2_m2_ck, CK_343X), |
3009 | CLK(NULL, "dpll3_ck", &dpll3_ck, CK_343X), | 3269 | CLK(NULL, "dpll3_ck", &dpll3_ck, CK_3XXX), |
3010 | CLK(NULL, "core_ck", &core_ck, CK_343X), | 3270 | CLK(NULL, "core_ck", &core_ck, CK_3XXX), |
3011 | CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_343X), | 3271 | CLK(NULL, "dpll3_x2_ck", &dpll3_x2_ck, CK_3XXX), |
3012 | CLK(NULL, "dpll3_m2_ck", &dpll3_m2_ck, CK_343X), | 3272 | CLK(NULL, "dpll3_m2_ck", &dpll3_m2_ck, CK_3XXX), |
3013 | CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_343X), | 3273 | CLK(NULL, "dpll3_m2x2_ck", &dpll3_m2x2_ck, CK_3XXX), |
3014 | CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_343X), | 3274 | CLK(NULL, "dpll3_m3_ck", &dpll3_m3_ck, CK_3XXX), |
3015 | CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_343X), | 3275 | CLK(NULL, "dpll3_m3x2_ck", &dpll3_m3x2_ck, CK_3XXX), |
3016 | CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck, CK_343X), | 3276 | CLK("etb", "emu_core_alwon_ck", &emu_core_alwon_ck, CK_3XXX), |
3017 | CLK(NULL, "dpll4_ck", &dpll4_ck, CK_343X), | 3277 | CLK(NULL, "dpll4_ck", &dpll4_ck, CK_3XXX), |
3018 | CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_343X), | 3278 | CLK(NULL, "dpll4_x2_ck", &dpll4_x2_ck, CK_3XXX), |
3019 | CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_343X), | 3279 | CLK(NULL, "omap_192m_alwon_fck", &omap_192m_alwon_fck, CK_36XX), |
3020 | CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_343X), | 3280 | CLK(NULL, "omap_96m_alwon_fck", &omap_96m_alwon_fck, CK_3XXX), |
3021 | CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_343X), | 3281 | CLK(NULL, "omap_96m_fck", &omap_96m_fck, CK_3XXX), |
3022 | CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_343X), | 3282 | CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_3XXX), |
3023 | CLK(NULL, "omap_48m_fck", &omap_48m_fck, CK_343X), | 3283 | CLK(NULL, "omap_54m_fck", &omap_54m_fck, CK_3XXX), |
3024 | CLK(NULL, "omap_12m_fck", &omap_12m_fck, CK_343X), | 3284 | CLK(NULL, "omap_48m_fck", &omap_48m_fck, CK_3XXX), |
3025 | CLK(NULL, "dpll4_m2_ck", &dpll4_m2_ck, CK_343X), | 3285 | CLK(NULL, "omap_12m_fck", &omap_12m_fck, CK_3XXX), |
3026 | CLK(NULL, "dpll4_m2x2_ck", &dpll4_m2x2_ck, CK_343X), | 3286 | CLK(NULL, "dpll4_m2_ck", &dpll4_m2_ck, CK_3XXX), |
3027 | CLK(NULL, "dpll4_m3_ck", &dpll4_m3_ck, CK_343X), | 3287 | CLK(NULL, "dpll4_m2x2_ck", &dpll4_m2x2_ck, CK_3XXX), |
3028 | CLK(NULL, "dpll4_m3x2_ck", &dpll4_m3x2_ck, CK_343X), | 3288 | CLK(NULL, "dpll4_m3_ck", &dpll4_m3_ck, CK_3XXX), |
3029 | CLK(NULL, "dpll4_m4_ck", &dpll4_m4_ck, CK_343X), | 3289 | CLK(NULL, "dpll4_m3x2_ck", &dpll4_m3x2_ck, CK_3XXX), |
3030 | CLK(NULL, "dpll4_m4x2_ck", &dpll4_m4x2_ck, CK_343X), | 3290 | CLK(NULL, "dpll4_m4_ck", &dpll4_m4_ck, CK_3XXX), |
3031 | CLK(NULL, "dpll4_m5_ck", &dpll4_m5_ck, CK_343X), | 3291 | CLK(NULL, "dpll4_m4x2_ck", &dpll4_m4x2_ck, CK_3XXX), |
3032 | CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_343X), | 3292 | CLK(NULL, "dpll4_m5_ck", &dpll4_m5_ck, CK_3XXX), |
3033 | CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_343X), | 3293 | CLK(NULL, "dpll4_m5x2_ck", &dpll4_m5x2_ck, CK_3XXX), |
3034 | CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_343X), | 3294 | CLK(NULL, "dpll4_m6_ck", &dpll4_m6_ck, CK_3XXX), |
3035 | CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_343X), | 3295 | CLK(NULL, "dpll4_m6x2_ck", &dpll4_m6x2_ck, CK_3XXX), |
3036 | CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2), | 3296 | CLK("etb", "emu_per_alwon_ck", &emu_per_alwon_ck, CK_3XXX), |
3037 | CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2), | 3297 | CLK(NULL, "dpll5_ck", &dpll5_ck, CK_3430ES2 | CK_AM35XX), |
3038 | CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_343X), | 3298 | CLK(NULL, "dpll5_m2_ck", &dpll5_m2_ck, CK_3430ES2 | CK_AM35XX), |
3039 | CLK(NULL, "sys_clkout2", &sys_clkout2, CK_343X), | 3299 | CLK(NULL, "clkout2_src_ck", &clkout2_src_ck, CK_3XXX), |
3040 | CLK(NULL, "corex2_fck", &corex2_fck, CK_343X), | 3300 | CLK(NULL, "sys_clkout2", &sys_clkout2, CK_3XXX), |
3041 | CLK(NULL, "dpll1_fck", &dpll1_fck, CK_343X), | 3301 | CLK(NULL, "corex2_fck", &corex2_fck, CK_3XXX), |
3042 | CLK(NULL, "mpu_ck", &mpu_ck, CK_343X), | 3302 | CLK(NULL, "dpll1_fck", &dpll1_fck, CK_3XXX), |
3043 | CLK(NULL, "arm_fck", &arm_fck, CK_343X), | 3303 | CLK(NULL, "mpu_ck", &mpu_ck, CK_3XXX), |
3044 | CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_343X), | 3304 | CLK(NULL, "arm_fck", &arm_fck, CK_3XXX), |
3305 | CLK("etb", "emu_mpu_alwon_ck", &emu_mpu_alwon_ck, CK_3XXX), | ||
3045 | CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X), | 3306 | CLK(NULL, "dpll2_fck", &dpll2_fck, CK_343X), |
3046 | CLK(NULL, "iva2_ck", &iva2_ck, CK_343X), | 3307 | CLK(NULL, "iva2_ck", &iva2_ck, CK_343X), |
3047 | CLK(NULL, "l3_ick", &l3_ick, CK_343X), | 3308 | CLK(NULL, "l3_ick", &l3_ick, CK_3XXX), |
3048 | CLK(NULL, "l4_ick", &l4_ick, CK_343X), | 3309 | CLK(NULL, "l4_ick", &l4_ick, CK_3XXX), |
3049 | CLK(NULL, "rm_ick", &rm_ick, CK_343X), | 3310 | CLK(NULL, "rm_ick", &rm_ick, CK_3XXX), |
3050 | CLK(NULL, "gfx_l3_ck", &gfx_l3_ck, CK_3430ES1), | 3311 | CLK(NULL, "gfx_l3_ck", &gfx_l3_ck, CK_3430ES1), |
3051 | CLK(NULL, "gfx_l3_fck", &gfx_l3_fck, CK_3430ES1), | 3312 | CLK(NULL, "gfx_l3_fck", &gfx_l3_fck, CK_3430ES1), |
3052 | CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1), | 3313 | CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1), |
3053 | CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1), | 3314 | CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1), |
3054 | CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1), | 3315 | CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1), |
3055 | CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2), | 3316 | CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2 | CK_3517), |
3056 | CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2), | 3317 | CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2 | CK_3517), |
3057 | CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), | 3318 | CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), |
3058 | CLK(NULL, "modem_fck", &modem_fck, CK_343X), | 3319 | CLK(NULL, "modem_fck", &modem_fck, CK_343X), |
3059 | CLK(NULL, "sad2d_ick", &sad2d_ick, CK_343X), | 3320 | CLK(NULL, "sad2d_ick", &sad2d_ick, CK_343X), |
3060 | CLK(NULL, "mad2d_ick", &mad2d_ick, CK_343X), | 3321 | CLK(NULL, "mad2d_ick", &mad2d_ick, CK_343X), |
3061 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_343X), | 3322 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_3XXX), |
3062 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_343X), | 3323 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_3XXX), |
3063 | CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2), | 3324 | CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2 | CK_AM35XX), |
3064 | CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2), | 3325 | CLK(NULL, "ts_fck", &ts_fck, CK_3430ES2 | CK_AM35XX), |
3065 | CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2), | 3326 | CLK(NULL, "usbtll_fck", &usbtll_fck, CK_3430ES2 | CK_AM35XX), |
3066 | CLK(NULL, "core_96m_fck", &core_96m_fck, CK_343X), | 3327 | CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), |
3067 | CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2), | 3328 | CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2 | CK_AM35XX), |
3068 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_343X), | 3329 | CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX), |
3069 | CLK(NULL, "mspro_fck", &mspro_fck, CK_343X), | 3330 | CLK(NULL, "mspro_fck", &mspro_fck, CK_343X), |
3070 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_343X), | 3331 | CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX), |
3071 | CLK("i2c_omap.3", "fck", &i2c3_fck, CK_343X), | 3332 | CLK("i2c_omap.3", "fck", &i2c3_fck, CK_3XXX), |
3072 | CLK("i2c_omap.2", "fck", &i2c2_fck, CK_343X), | 3333 | CLK("i2c_omap.2", "fck", &i2c2_fck, CK_3XXX), |
3073 | CLK("i2c_omap.1", "fck", &i2c1_fck, CK_343X), | 3334 | CLK("i2c_omap.1", "fck", &i2c1_fck, CK_3XXX), |
3074 | CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_343X), | 3335 | CLK("omap-mcbsp.5", "fck", &mcbsp5_fck, CK_3XXX), |
3075 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_343X), | 3336 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_3XXX), |
3076 | CLK(NULL, "core_48m_fck", &core_48m_fck, CK_343X), | 3337 | CLK(NULL, "core_48m_fck", &core_48m_fck, CK_3XXX), |
3077 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_343X), | 3338 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_3XXX), |
3078 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_343X), | 3339 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_3XXX), |
3079 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_343X), | 3340 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_3XXX), |
3080 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_343X), | 3341 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_3XXX), |
3081 | CLK(NULL, "uart2_fck", &uart2_fck, CK_343X), | 3342 | CLK(NULL, "uart2_fck", &uart2_fck, CK_3XXX), |
3082 | CLK(NULL, "uart1_fck", &uart1_fck, CK_343X), | 3343 | CLK(NULL, "uart1_fck", &uart1_fck, CK_3XXX), |
3083 | CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1), | 3344 | CLK(NULL, "fshostusb_fck", &fshostusb_fck, CK_3430ES1), |
3084 | CLK(NULL, "core_12m_fck", &core_12m_fck, CK_343X), | 3345 | CLK(NULL, "core_12m_fck", &core_12m_fck, CK_3XXX), |
3085 | CLK("omap_hdq.0", "fck", &hdq_fck, CK_343X), | 3346 | CLK("omap_hdq.0", "fck", &hdq_fck, CK_3XXX), |
3086 | CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1), | 3347 | CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es1, CK_3430ES1), |
3087 | CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2), | 3348 | CLK(NULL, "ssi_ssr_fck", &ssi_ssr_fck_3430es2, CK_3430ES2), |
3088 | CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), | 3349 | CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es1, CK_3430ES1), |
3089 | CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2), | 3350 | CLK(NULL, "ssi_sst_fck", &ssi_sst_fck_3430es2, CK_3430ES2), |
3090 | CLK(NULL, "core_l3_ick", &core_l3_ick, CK_343X), | 3351 | CLK(NULL, "core_l3_ick", &core_l3_ick, CK_3XXX), |
3091 | CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), | 3352 | CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es1, CK_3430ES1), |
3092 | CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2), | 3353 | CLK("musb_hdrc", "ick", &hsotgusb_ick_3430es2, CK_3430ES2), |
3093 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_343X), | 3354 | CLK(NULL, "sdrc_ick", &sdrc_ick, CK_3XXX), |
3094 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_343X), | 3355 | CLK(NULL, "gpmc_fck", &gpmc_fck, CK_3XXX), |
3095 | CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X), | 3356 | CLK(NULL, "security_l3_ick", &security_l3_ick, CK_343X), |
3096 | CLK(NULL, "pka_ick", &pka_ick, CK_343X), | 3357 | CLK(NULL, "pka_ick", &pka_ick, CK_343X), |
3097 | CLK(NULL, "core_l4_ick", &core_l4_ick, CK_343X), | 3358 | CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), |
3098 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2), | 3359 | CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2 | CK_AM35XX), |
3099 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2), | 3360 | CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2 | CK_AM35XX), |
3100 | CLK(NULL, "icr_ick", &icr_ick, CK_343X), | 3361 | CLK(NULL, "icr_ick", &icr_ick, CK_343X), |
3101 | CLK(NULL, "aes2_ick", &aes2_ick, CK_343X), | 3362 | CLK(NULL, "aes2_ick", &aes2_ick, CK_343X), |
3102 | CLK(NULL, "sha12_ick", &sha12_ick, CK_343X), | 3363 | CLK(NULL, "sha12_ick", &sha12_ick, CK_343X), |
3103 | CLK(NULL, "des2_ick", &des2_ick, CK_343X), | 3364 | CLK(NULL, "des2_ick", &des2_ick, CK_343X), |
3104 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_343X), | 3365 | CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), |
3105 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_343X), | 3366 | CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), |
3106 | CLK(NULL, "mspro_ick", &mspro_ick, CK_343X), | 3367 | CLK(NULL, "mspro_ick", &mspro_ick, CK_343X), |
3107 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_343X), | 3368 | CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), |
3108 | CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_343X), | 3369 | CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), |
3109 | CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_343X), | 3370 | CLK("omap2_mcspi.3", "ick", &mcspi3_ick, CK_3XXX), |
3110 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_343X), | 3371 | CLK("omap2_mcspi.2", "ick", &mcspi2_ick, CK_3XXX), |
3111 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_343X), | 3372 | CLK("omap2_mcspi.1", "ick", &mcspi1_ick, CK_3XXX), |
3112 | CLK("i2c_omap.3", "ick", &i2c3_ick, CK_343X), | 3373 | CLK("i2c_omap.3", "ick", &i2c3_ick, CK_3XXX), |
3113 | CLK("i2c_omap.2", "ick", &i2c2_ick, CK_343X), | 3374 | CLK("i2c_omap.2", "ick", &i2c2_ick, CK_3XXX), |
3114 | CLK("i2c_omap.1", "ick", &i2c1_ick, CK_343X), | 3375 | CLK("i2c_omap.1", "ick", &i2c1_ick, CK_3XXX), |
3115 | CLK(NULL, "uart2_ick", &uart2_ick, CK_343X), | 3376 | CLK(NULL, "uart2_ick", &uart2_ick, CK_3XXX), |
3116 | CLK(NULL, "uart1_ick", &uart1_ick, CK_343X), | 3377 | CLK(NULL, "uart1_ick", &uart1_ick, CK_3XXX), |
3117 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_343X), | 3378 | CLK(NULL, "gpt11_ick", &gpt11_ick, CK_3XXX), |
3118 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_343X), | 3379 | CLK(NULL, "gpt10_ick", &gpt10_ick, CK_3XXX), |
3119 | CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_343X), | 3380 | CLK("omap-mcbsp.5", "ick", &mcbsp5_ick, CK_3XXX), |
3120 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_343X), | 3381 | CLK("omap-mcbsp.1", "ick", &mcbsp1_ick, CK_3XXX), |
3121 | CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1), | 3382 | CLK(NULL, "fac_ick", &fac_ick, CK_3430ES1), |
3122 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_343X), | 3383 | CLK(NULL, "mailboxes_ick", &mailboxes_ick, CK_343X), |
3123 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_343X), | 3384 | CLK(NULL, "omapctrl_ick", &omapctrl_ick, CK_3XXX), |
3124 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_343X), | 3385 | CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_343X), |
3125 | CLK(NULL, "ssi_ick", &ssi_ick_3430es1, CK_3430ES1), | 3386 | CLK(NULL, "ssi_ick", &ssi_ick_3430es1, CK_3430ES1), |
3126 | CLK(NULL, "ssi_ick", &ssi_ick_3430es2, CK_3430ES2), | 3387 | CLK(NULL, "ssi_ick", &ssi_ick_3430es2, CK_3430ES2), |
@@ -3131,96 +3392,111 @@ static struct omap_clk omap34xx_clks[] = { | |||
3131 | CLK(NULL, "sha11_ick", &sha11_ick, CK_343X), | 3392 | CLK(NULL, "sha11_ick", &sha11_ick, CK_343X), |
3132 | CLK(NULL, "des1_ick", &des1_ick, CK_343X), | 3393 | CLK(NULL, "des1_ick", &des1_ick, CK_343X), |
3133 | CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1), | 3394 | CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es1, CK_3430ES1), |
3134 | CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2), | 3395 | CLK("omapdss", "dss1_fck", &dss1_alwon_fck_3430es2, CK_3430ES2 | CK_AM35XX), |
3135 | CLK("omapdss", "tv_fck", &dss_tv_fck, CK_343X), | 3396 | CLK("omapdss", "tv_fck", &dss_tv_fck, CK_3XXX), |
3136 | CLK("omapdss", "video_fck", &dss_96m_fck, CK_343X), | 3397 | CLK("omapdss", "video_fck", &dss_96m_fck, CK_3XXX), |
3137 | CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_343X), | 3398 | CLK("omapdss", "dss2_fck", &dss2_alwon_fck, CK_3XXX), |
3138 | CLK("omapdss", "ick", &dss_ick_3430es1, CK_3430ES1), | 3399 | CLK("omapdss", "ick", &dss_ick_3430es1, CK_3430ES1), |
3139 | CLK("omapdss", "ick", &dss_ick_3430es2, CK_3430ES2), | 3400 | CLK("omapdss", "ick", &dss_ick_3430es2, CK_3430ES2 | CK_AM35XX), |
3140 | CLK(NULL, "cam_mclk", &cam_mclk, CK_343X), | 3401 | CLK(NULL, "cam_mclk", &cam_mclk, CK_343X), |
3141 | CLK(NULL, "cam_ick", &cam_ick, CK_343X), | 3402 | CLK(NULL, "cam_ick", &cam_ick, CK_343X), |
3142 | CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X), | 3403 | CLK(NULL, "csi2_96m_fck", &csi2_96m_fck, CK_343X), |
3143 | CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2), | 3404 | CLK(NULL, "usbhost_120m_fck", &usbhost_120m_fck, CK_3430ES2 | CK_AM35XX), |
3144 | CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2), | 3405 | CLK(NULL, "usbhost_48m_fck", &usbhost_48m_fck, CK_3430ES2 | CK_AM35XX), |
3145 | CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2), | 3406 | CLK(NULL, "usbhost_ick", &usbhost_ick, CK_3430ES2 | CK_AM35XX), |
3146 | CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2), | 3407 | CLK(NULL, "usim_fck", &usim_fck, CK_3430ES2), |
3147 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_343X), | 3408 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_3XXX), |
3148 | CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_343X), | 3409 | CLK(NULL, "wkup_32k_fck", &wkup_32k_fck, CK_3XXX), |
3149 | CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_343X), | 3410 | CLK(NULL, "gpio1_dbck", &gpio1_dbck, CK_3XXX), |
3150 | CLK("omap_wdt", "fck", &wdt2_fck, CK_343X), | 3411 | CLK("omap_wdt", "fck", &wdt2_fck, CK_3XXX), |
3151 | CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_343X), | 3412 | CLK(NULL, "wkup_l4_ick", &wkup_l4_ick, CK_343X), |
3152 | CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2), | 3413 | CLK(NULL, "usim_ick", &usim_ick, CK_3430ES2), |
3153 | CLK("omap_wdt", "ick", &wdt2_ick, CK_343X), | 3414 | CLK("omap_wdt", "ick", &wdt2_ick, CK_3XXX), |
3154 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_343X), | 3415 | CLK(NULL, "wdt1_ick", &wdt1_ick, CK_3XXX), |
3155 | CLK(NULL, "gpio1_ick", &gpio1_ick, CK_343X), | 3416 | CLK(NULL, "gpio1_ick", &gpio1_ick, CK_3XXX), |
3156 | CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_343X), | 3417 | CLK(NULL, "omap_32ksync_ick", &omap_32ksync_ick, CK_3XXX), |
3157 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_343X), | 3418 | CLK(NULL, "gpt12_ick", &gpt12_ick, CK_3XXX), |
3158 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_343X), | 3419 | CLK(NULL, "gpt1_ick", &gpt1_ick, CK_3XXX), |
3159 | CLK(NULL, "per_96m_fck", &per_96m_fck, CK_343X), | 3420 | CLK(NULL, "per_96m_fck", &per_96m_fck, CK_3XXX), |
3160 | CLK(NULL, "per_48m_fck", &per_48m_fck, CK_343X), | 3421 | CLK(NULL, "per_48m_fck", &per_48m_fck, CK_3XXX), |
3161 | CLK(NULL, "uart3_fck", &uart3_fck, CK_343X), | 3422 | CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX), |
3162 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_343X), | 3423 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_3XXX), |
3163 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_343X), | 3424 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_3XXX), |
3164 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_343X), | 3425 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_3XXX), |
3165 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_343X), | 3426 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_3XXX), |
3166 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_343X), | 3427 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_3XXX), |
3167 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_343X), | 3428 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_3XXX), |
3168 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_343X), | 3429 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_3XXX), |
3169 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_343X), | 3430 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_3XXX), |
3170 | CLK(NULL, "per_32k_alwon_fck", &per_32k_alwon_fck, CK_343X), | 3431 | CLK(NULL, "per_32k_alwon_fck", &per_32k_alwon_fck, CK_3XXX), |
3171 | CLK(NULL, "gpio6_dbck", &gpio6_dbck, CK_343X), | 3432 | CLK(NULL, "gpio6_dbck", &gpio6_dbck, CK_3XXX), |
3172 | CLK(NULL, "gpio5_dbck", &gpio5_dbck, CK_343X), | 3433 | CLK(NULL, "gpio5_dbck", &gpio5_dbck, CK_3XXX), |
3173 | CLK(NULL, "gpio4_dbck", &gpio4_dbck, CK_343X), | 3434 | CLK(NULL, "gpio4_dbck", &gpio4_dbck, CK_3XXX), |
3174 | CLK(NULL, "gpio3_dbck", &gpio3_dbck, CK_343X), | 3435 | CLK(NULL, "gpio3_dbck", &gpio3_dbck, CK_3XXX), |
3175 | CLK(NULL, "gpio2_dbck", &gpio2_dbck, CK_343X), | 3436 | CLK(NULL, "gpio2_dbck", &gpio2_dbck, CK_3XXX), |
3176 | CLK(NULL, "wdt3_fck", &wdt3_fck, CK_343X), | 3437 | CLK(NULL, "wdt3_fck", &wdt3_fck, CK_3XXX), |
3177 | CLK(NULL, "per_l4_ick", &per_l4_ick, CK_343X), | 3438 | CLK(NULL, "per_l4_ick", &per_l4_ick, CK_3XXX), |
3178 | CLK(NULL, "gpio6_ick", &gpio6_ick, CK_343X), | 3439 | CLK(NULL, "gpio6_ick", &gpio6_ick, CK_3XXX), |
3179 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_343X), | 3440 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_3XXX), |
3180 | CLK(NULL, "gpio4_ick", &gpio4_ick, CK_343X), | 3441 | CLK(NULL, "gpio4_ick", &gpio4_ick, CK_3XXX), |
3181 | CLK(NULL, "gpio3_ick", &gpio3_ick, CK_343X), | 3442 | CLK(NULL, "gpio3_ick", &gpio3_ick, CK_3XXX), |
3182 | CLK(NULL, "gpio2_ick", &gpio2_ick, CK_343X), | 3443 | CLK(NULL, "gpio2_ick", &gpio2_ick, CK_3XXX), |
3183 | CLK(NULL, "wdt3_ick", &wdt3_ick, CK_343X), | 3444 | CLK(NULL, "wdt3_ick", &wdt3_ick, CK_3XXX), |
3184 | CLK(NULL, "uart3_ick", &uart3_ick, CK_343X), | 3445 | CLK(NULL, "uart3_ick", &uart3_ick, CK_3XXX), |
3185 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_343X), | 3446 | CLK(NULL, "gpt9_ick", &gpt9_ick, CK_3XXX), |
3186 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_343X), | 3447 | CLK(NULL, "gpt8_ick", &gpt8_ick, CK_3XXX), |
3187 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_343X), | 3448 | CLK(NULL, "gpt7_ick", &gpt7_ick, CK_3XXX), |
3188 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_343X), | 3449 | CLK(NULL, "gpt6_ick", &gpt6_ick, CK_3XXX), |
3189 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_343X), | 3450 | CLK(NULL, "gpt5_ick", &gpt5_ick, CK_3XXX), |
3190 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_343X), | 3451 | CLK(NULL, "gpt4_ick", &gpt4_ick, CK_3XXX), |
3191 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_343X), | 3452 | CLK(NULL, "gpt3_ick", &gpt3_ick, CK_3XXX), |
3192 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_343X), | 3453 | CLK(NULL, "gpt2_ick", &gpt2_ick, CK_3XXX), |
3193 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_343X), | 3454 | CLK("omap-mcbsp.2", "ick", &mcbsp2_ick, CK_3XXX), |
3194 | CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_343X), | 3455 | CLK("omap-mcbsp.3", "ick", &mcbsp3_ick, CK_3XXX), |
3195 | CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_343X), | 3456 | CLK("omap-mcbsp.4", "ick", &mcbsp4_ick, CK_3XXX), |
3196 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_343X), | 3457 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_3XXX), |
3197 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_343X), | 3458 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_3XXX), |
3198 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_343X), | 3459 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_3XXX), |
3199 | CLK("etb", "emu_src_ck", &emu_src_ck, CK_343X), | 3460 | CLK("etb", "emu_src_ck", &emu_src_ck, CK_3XXX), |
3200 | CLK(NULL, "pclk_fck", &pclk_fck, CK_343X), | 3461 | CLK(NULL, "pclk_fck", &pclk_fck, CK_3XXX), |
3201 | CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_343X), | 3462 | CLK(NULL, "pclkx2_fck", &pclkx2_fck, CK_3XXX), |
3202 | CLK(NULL, "atclk_fck", &atclk_fck, CK_343X), | 3463 | CLK(NULL, "atclk_fck", &atclk_fck, CK_3XXX), |
3203 | CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_343X), | 3464 | CLK(NULL, "traceclk_src_fck", &traceclk_src_fck, CK_3XXX), |
3204 | CLK(NULL, "traceclk_fck", &traceclk_fck, CK_343X), | 3465 | CLK(NULL, "traceclk_fck", &traceclk_fck, CK_3XXX), |
3205 | CLK(NULL, "sr1_fck", &sr1_fck, CK_343X), | 3466 | CLK(NULL, "sr1_fck", &sr1_fck, CK_343X), |
3206 | CLK(NULL, "sr2_fck", &sr2_fck, CK_343X), | 3467 | CLK(NULL, "sr2_fck", &sr2_fck, CK_343X), |
3207 | CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_343X), | 3468 | CLK(NULL, "sr_l4_ick", &sr_l4_ick, CK_343X), |
3208 | CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_343X), | 3469 | CLK(NULL, "secure_32k_fck", &secure_32k_fck, CK_3XXX), |
3209 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_343X), | 3470 | CLK(NULL, "gpt12_fck", &gpt12_fck, CK_3XXX), |
3210 | CLK(NULL, "wdt1_fck", &wdt1_fck, CK_343X), | 3471 | CLK(NULL, "wdt1_fck", &wdt1_fck, CK_3XXX), |
3211 | }; | 3472 | CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX), |
3212 | 3473 | CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX), | |
3213 | 3474 | CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX), | |
3214 | int __init omap2_clk_init(void) | 3475 | CLK("davinci_emac", "ick", &emac_ick, CK_AM35XX), |
3476 | CLK("davinci_emac", "fck", &emac_fck, CK_AM35XX), | ||
3477 | CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), | ||
3478 | CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), | ||
3479 | CLK("musb_hdrc", "ick", &hsotgusb_ick_am35xx, CK_AM35XX), | ||
3480 | CLK("musb_hdrc", "fck", &hsotgusb_fck_am35xx, CK_AM35XX), | ||
3481 | CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX), | ||
3482 | CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX), | ||
3483 | }; | ||
3484 | |||
3485 | |||
3486 | int __init omap3xxx_clk_init(void) | ||
3215 | { | 3487 | { |
3216 | /* struct prcm_config *prcm; */ | ||
3217 | struct omap_clk *c; | 3488 | struct omap_clk *c; |
3218 | /* u32 clkrate; */ | 3489 | u32 cpu_clkflg = CK_3XXX; |
3219 | u32 cpu_clkflg; | 3490 | |
3220 | 3491 | if (cpu_is_omap3517()) { | |
3221 | if (cpu_is_omap34xx()) { | 3492 | cpu_mask = RATE_IN_343X | RATE_IN_3430ES2; |
3493 | cpu_clkflg |= CK_3517; | ||
3494 | } else if (cpu_is_omap3505()) { | ||
3495 | cpu_mask = RATE_IN_343X | RATE_IN_3430ES2; | ||
3496 | cpu_clkflg |= CK_3505; | ||
3497 | } else if (cpu_is_omap34xx()) { | ||
3222 | cpu_mask = RATE_IN_343X; | 3498 | cpu_mask = RATE_IN_343X; |
3223 | cpu_clkflg = CK_343X; | 3499 | cpu_clkflg |= CK_343X; |
3224 | 3500 | ||
3225 | /* | 3501 | /* |
3226 | * Update this if there are further clock changes between ES2 | 3502 | * Update this if there are further clock changes between ES2 |
@@ -3234,34 +3510,70 @@ int __init omap2_clk_init(void) | |||
3234 | cpu_clkflg |= CK_3430ES2; | 3510 | cpu_clkflg |= CK_3430ES2; |
3235 | } | 3511 | } |
3236 | } | 3512 | } |
3513 | if (omap3_has_192mhz_clk()) | ||
3514 | omap_96m_alwon_fck = omap_96m_alwon_fck_3630; | ||
3515 | |||
3516 | if (cpu_is_omap3630()) { | ||
3517 | cpu_mask |= RATE_IN_36XX; | ||
3518 | cpu_clkflg |= CK_36XX; | ||
3519 | |||
3520 | /* | ||
3521 | * XXX This type of dynamic rewriting of the clock tree is | ||
3522 | * deprecated and should be revised soon. | ||
3523 | */ | ||
3524 | dpll4_m2_ck = dpll4_m2_ck_3630; | ||
3525 | dpll4_m3_ck = dpll4_m3_ck_3630; | ||
3526 | dpll4_m4_ck = dpll4_m4_ck_3630; | ||
3527 | dpll4_m5_ck = dpll4_m5_ck_3630; | ||
3528 | dpll4_m6_ck = dpll4_m6_ck_3630; | ||
3529 | |||
3530 | /* | ||
3531 | * For 3630: override clkops_omap2_dflt_wait for the | ||
3532 | * clocks affected from PWRDN reset Limitation | ||
3533 | */ | ||
3534 | dpll3_m3x2_ck.ops = | ||
3535 | &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; | ||
3536 | dpll4_m2x2_ck.ops = | ||
3537 | &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; | ||
3538 | dpll4_m3x2_ck.ops = | ||
3539 | &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; | ||
3540 | dpll4_m4x2_ck.ops = | ||
3541 | &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; | ||
3542 | dpll4_m5x2_ck.ops = | ||
3543 | &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; | ||
3544 | dpll4_m6x2_ck.ops = | ||
3545 | &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; | ||
3546 | } else { | ||
3547 | /* | ||
3548 | * XXX This type of dynamic rewriting of the clock tree is | ||
3549 | * deprecated and should be revised soon. | ||
3550 | */ | ||
3551 | dpll4_m2_ck = dpll4_m2_ck_34xx; | ||
3552 | dpll4_m3_ck = dpll4_m3_ck_34xx; | ||
3553 | dpll4_m4_ck = dpll4_m4_ck_34xx; | ||
3554 | dpll4_m5_ck = dpll4_m5_ck_34xx; | ||
3555 | dpll4_m6_ck = dpll4_m6_ck_34xx; | ||
3556 | } | ||
3557 | |||
3558 | if (cpu_is_omap3630()) | ||
3559 | dpll4_dd = dpll4_dd_3630; | ||
3560 | else | ||
3561 | dpll4_dd = dpll4_dd_34xx; | ||
3237 | 3562 | ||
3238 | clk_init(&omap2_clk_functions); | 3563 | clk_init(&omap2_clk_functions); |
3239 | 3564 | ||
3240 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) | 3565 | for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks); |
3566 | c++) | ||
3241 | clk_preinit(c->lk.clk); | 3567 | clk_preinit(c->lk.clk); |
3242 | 3568 | ||
3243 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) | 3569 | for (c = omap3xxx_clks; c < omap3xxx_clks + ARRAY_SIZE(omap3xxx_clks); |
3570 | c++) | ||
3244 | if (c->cpu & cpu_clkflg) { | 3571 | if (c->cpu & cpu_clkflg) { |
3245 | clkdev_add(&c->lk); | 3572 | clkdev_add(&c->lk); |
3246 | clk_register(c->lk.clk); | 3573 | clk_register(c->lk.clk); |
3247 | omap2_init_clk_clkdm(c->lk.clk); | 3574 | omap2_init_clk_clkdm(c->lk.clk); |
3248 | } | 3575 | } |
3249 | 3576 | ||
3250 | /* REVISIT: Not yet ready for OMAP3 */ | ||
3251 | #if 0 | ||
3252 | /* Check the MPU rate set by bootloader */ | ||
3253 | clkrate = omap2_get_dpll_rate_24xx(&dpll_ck); | ||
3254 | for (prcm = rate_table; prcm->mpu_speed; prcm++) { | ||
3255 | if (!(prcm->flags & cpu_mask)) | ||
3256 | continue; | ||
3257 | if (prcm->xtal_speed != sys_ck.rate) | ||
3258 | continue; | ||
3259 | if (prcm->dpll_speed <= clkrate) | ||
3260 | break; | ||
3261 | } | ||
3262 | curr_prcm_set = prcm; | ||
3263 | #endif | ||
3264 | |||
3265 | recalculate_root_clocks(); | 3577 | recalculate_root_clocks(); |
3266 | 3578 | ||
3267 | printk(KERN_INFO "Clocking rate (Crystal/Core/MPU): " | 3579 | printk(KERN_INFO "Clocking rate (Crystal/Core/MPU): " |
diff --git a/arch/arm/mach-omap2/clock44xx.c b/arch/arm/mach-omap2/clock44xx.c deleted file mode 100644 index e370868a79a8..000000000000 --- a/arch/arm/mach-omap2/clock44xx.c +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * OMAP4-specific clock framework functions | ||
3 | * | ||
4 | * Copyright (C) 2009 Texas Instruments, Inc. | ||
5 | * | ||
6 | * Rajendra Nayak (rnayak@ti.com) | ||
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 | |||
13 | #include <linux/errno.h> | ||
14 | #include "clock.h" | ||
15 | |||
16 | struct clk_functions omap2_clk_functions = { | ||
17 | .clk_enable = omap2_clk_enable, | ||
18 | .clk_disable = omap2_clk_disable, | ||
19 | .clk_round_rate = omap2_clk_round_rate, | ||
20 | .clk_set_rate = omap2_clk_set_rate, | ||
21 | .clk_set_parent = omap2_clk_set_parent, | ||
22 | .clk_disable_unused = omap2_clk_disable_unused, | ||
23 | }; | ||
24 | |||
25 | const struct clkops clkops_noncore_dpll_ops = { | ||
26 | .enable = &omap3_noncore_dpll_enable, | ||
27 | .disable = &omap3_noncore_dpll_disable, | ||
28 | }; | ||
29 | |||
30 | void omap2_clk_prepare_for_reboot(void) | ||
31 | { | ||
32 | return; | ||
33 | } | ||
diff --git a/arch/arm/mach-omap2/clock44xx.h b/arch/arm/mach-omap2/clock44xx.h index 59b9ced4daa1..6be1095936db 100644 --- a/arch/arm/mach-omap2/clock44xx.h +++ b/arch/arm/mach-omap2/clock44xx.h | |||
@@ -2,14 +2,19 @@ | |||
2 | * OMAP4 clock function prototypes and macros | 2 | * OMAP4 clock function prototypes and macros |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2010 Nokia Corporation | ||
5 | */ | 6 | */ |
6 | 7 | ||
7 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK_44XX_H | 8 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H |
8 | #define __ARCH_ARM_MACH_OMAP2_CLOCK_44XX_H | 9 | #define __ARCH_ARM_MACH_OMAP2_CLOCK44XX_H |
9 | 10 | ||
10 | #define OMAP4430_MAX_DPLL_MULT 2048 | 11 | /* |
12 | * XXX Missing values for the OMAP4 DPLL_USB | ||
13 | * XXX Missing min_multiplier values for all OMAP4 DPLLs | ||
14 | */ | ||
15 | #define OMAP4430_MAX_DPLL_MULT 2047 | ||
11 | #define OMAP4430_MAX_DPLL_DIV 128 | 16 | #define OMAP4430_MAX_DPLL_DIV 128 |
12 | 17 | ||
13 | extern const struct clkops clkops_noncore_dpll_ops; | 18 | int omap4xxx_clk_init(void); |
14 | 19 | ||
15 | #endif | 20 | #endif |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 2210e227d78a..28b107967c86 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP4 Clock data | 2 | * OMAP4 Clock data |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2009 Nokia Corporation | 5 | * Copyright (C) 2009-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Paul Walmsley (paul@pwsan.com) | 7 | * Paul Walmsley (paul@pwsan.com) |
8 | * Rajendra Nayak (rnayak@ti.com) | 8 | * Rajendra Nayak (rnayak@ti.com) |
@@ -20,7 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/module.h> | 23 | #include <linux/list.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | 25 | ||
26 | #include <plat/control.h> | 26 | #include <plat/control.h> |
@@ -39,42 +39,36 @@ static struct clk extalt_clkin_ck = { | |||
39 | .name = "extalt_clkin_ck", | 39 | .name = "extalt_clkin_ck", |
40 | .rate = 59000000, | 40 | .rate = 59000000, |
41 | .ops = &clkops_null, | 41 | .ops = &clkops_null, |
42 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
43 | }; | 42 | }; |
44 | 43 | ||
45 | static struct clk pad_clks_ck = { | 44 | static struct clk pad_clks_ck = { |
46 | .name = "pad_clks_ck", | 45 | .name = "pad_clks_ck", |
47 | .rate = 12000000, | 46 | .rate = 12000000, |
48 | .ops = &clkops_null, | 47 | .ops = &clkops_null, |
49 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
50 | }; | 48 | }; |
51 | 49 | ||
52 | static struct clk pad_slimbus_core_clks_ck = { | 50 | static struct clk pad_slimbus_core_clks_ck = { |
53 | .name = "pad_slimbus_core_clks_ck", | 51 | .name = "pad_slimbus_core_clks_ck", |
54 | .rate = 12000000, | 52 | .rate = 12000000, |
55 | .ops = &clkops_null, | 53 | .ops = &clkops_null, |
56 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
57 | }; | 54 | }; |
58 | 55 | ||
59 | static struct clk secure_32k_clk_src_ck = { | 56 | static struct clk secure_32k_clk_src_ck = { |
60 | .name = "secure_32k_clk_src_ck", | 57 | .name = "secure_32k_clk_src_ck", |
61 | .rate = 32768, | 58 | .rate = 32768, |
62 | .ops = &clkops_null, | 59 | .ops = &clkops_null, |
63 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
64 | }; | 60 | }; |
65 | 61 | ||
66 | static struct clk slimbus_clk = { | 62 | static struct clk slimbus_clk = { |
67 | .name = "slimbus_clk", | 63 | .name = "slimbus_clk", |
68 | .rate = 12000000, | 64 | .rate = 12000000, |
69 | .ops = &clkops_null, | 65 | .ops = &clkops_null, |
70 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
71 | }; | 66 | }; |
72 | 67 | ||
73 | static struct clk sys_32k_ck = { | 68 | static struct clk sys_32k_ck = { |
74 | .name = "sys_32k_ck", | 69 | .name = "sys_32k_ck", |
75 | .rate = 32768, | 70 | .rate = 32768, |
76 | .ops = &clkops_null, | 71 | .ops = &clkops_null, |
77 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
78 | }; | 72 | }; |
79 | 73 | ||
80 | static struct clk virt_12000000_ck = { | 74 | static struct clk virt_12000000_ck = { |
@@ -179,35 +173,30 @@ static struct clk sys_clkin_ck = { | |||
179 | .clksel_mask = OMAP4430_SYS_CLKSEL_MASK, | 173 | .clksel_mask = OMAP4430_SYS_CLKSEL_MASK, |
180 | .ops = &clkops_null, | 174 | .ops = &clkops_null, |
181 | .recalc = &omap2_clksel_recalc, | 175 | .recalc = &omap2_clksel_recalc, |
182 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
183 | }; | 176 | }; |
184 | 177 | ||
185 | static struct clk utmi_phy_clkout_ck = { | 178 | static struct clk utmi_phy_clkout_ck = { |
186 | .name = "utmi_phy_clkout_ck", | 179 | .name = "utmi_phy_clkout_ck", |
187 | .rate = 12000000, | 180 | .rate = 12000000, |
188 | .ops = &clkops_null, | 181 | .ops = &clkops_null, |
189 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
190 | }; | 182 | }; |
191 | 183 | ||
192 | static struct clk xclk60mhsp1_ck = { | 184 | static struct clk xclk60mhsp1_ck = { |
193 | .name = "xclk60mhsp1_ck", | 185 | .name = "xclk60mhsp1_ck", |
194 | .rate = 12000000, | 186 | .rate = 12000000, |
195 | .ops = &clkops_null, | 187 | .ops = &clkops_null, |
196 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
197 | }; | 188 | }; |
198 | 189 | ||
199 | static struct clk xclk60mhsp2_ck = { | 190 | static struct clk xclk60mhsp2_ck = { |
200 | .name = "xclk60mhsp2_ck", | 191 | .name = "xclk60mhsp2_ck", |
201 | .rate = 12000000, | 192 | .rate = 12000000, |
202 | .ops = &clkops_null, | 193 | .ops = &clkops_null, |
203 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
204 | }; | 194 | }; |
205 | 195 | ||
206 | static struct clk xclk60motg_ck = { | 196 | static struct clk xclk60motg_ck = { |
207 | .name = "xclk60motg_ck", | 197 | .name = "xclk60motg_ck", |
208 | .rate = 60000000, | 198 | .rate = 60000000, |
209 | .ops = &clkops_null, | 199 | .ops = &clkops_null, |
210 | .flags = CLOCK_IN_OMAP4430 | ALWAYS_ENABLED, | ||
211 | }; | 200 | }; |
212 | 201 | ||
213 | /* Module clocks and DPLL outputs */ | 202 | /* Module clocks and DPLL outputs */ |
@@ -233,7 +222,6 @@ static struct clk dpll_sys_ref_clk = { | |||
233 | .recalc = &omap2_clksel_recalc, | 222 | .recalc = &omap2_clksel_recalc, |
234 | .round_rate = &omap2_clksel_round_rate, | 223 | .round_rate = &omap2_clksel_round_rate, |
235 | .set_rate = &omap2_clksel_set_rate, | 224 | .set_rate = &omap2_clksel_set_rate, |
236 | .flags = CLOCK_IN_OMAP4430, | ||
237 | }; | 225 | }; |
238 | 226 | ||
239 | static const struct clksel abe_dpll_refclk_mux_sel[] = { | 227 | static const struct clksel abe_dpll_refclk_mux_sel[] = { |
@@ -251,7 +239,6 @@ static struct clk abe_dpll_refclk_mux_ck = { | |||
251 | .clksel_mask = OMAP4430_CLKSEL_0_0_MASK, | 239 | .clksel_mask = OMAP4430_CLKSEL_0_0_MASK, |
252 | .ops = &clkops_null, | 240 | .ops = &clkops_null, |
253 | .recalc = &omap2_clksel_recalc, | 241 | .recalc = &omap2_clksel_recalc, |
254 | .flags = CLOCK_IN_OMAP4430, | ||
255 | }; | 242 | }; |
256 | 243 | ||
257 | /* DPLL_ABE */ | 244 | /* DPLL_ABE */ |
@@ -279,11 +266,10 @@ static struct clk dpll_abe_ck = { | |||
279 | .parent = &abe_dpll_refclk_mux_ck, | 266 | .parent = &abe_dpll_refclk_mux_ck, |
280 | .dpll_data = &dpll_abe_dd, | 267 | .dpll_data = &dpll_abe_dd, |
281 | .init = &omap2_init_dpll_parent, | 268 | .init = &omap2_init_dpll_parent, |
282 | .ops = &clkops_noncore_dpll_ops, | 269 | .ops = &clkops_omap3_noncore_dpll_ops, |
283 | .recalc = &omap3_dpll_recalc, | 270 | .recalc = &omap3_dpll_recalc, |
284 | .round_rate = &omap2_dpll_round_rate, | 271 | .round_rate = &omap2_dpll_round_rate, |
285 | .set_rate = &omap3_noncore_dpll_set_rate, | 272 | .set_rate = &omap3_noncore_dpll_set_rate, |
286 | .flags = CLOCK_IN_OMAP4430, | ||
287 | }; | 273 | }; |
288 | 274 | ||
289 | static struct clk dpll_abe_m2x2_ck = { | 275 | static struct clk dpll_abe_m2x2_ck = { |
@@ -291,7 +277,6 @@ static struct clk dpll_abe_m2x2_ck = { | |||
291 | .parent = &dpll_abe_ck, | 277 | .parent = &dpll_abe_ck, |
292 | .ops = &clkops_null, | 278 | .ops = &clkops_null, |
293 | .recalc = &followparent_recalc, | 279 | .recalc = &followparent_recalc, |
294 | .flags = CLOCK_IN_OMAP4430, | ||
295 | }; | 280 | }; |
296 | 281 | ||
297 | static struct clk abe_24m_fclk = { | 282 | static struct clk abe_24m_fclk = { |
@@ -299,7 +284,6 @@ static struct clk abe_24m_fclk = { | |||
299 | .parent = &dpll_abe_m2x2_ck, | 284 | .parent = &dpll_abe_m2x2_ck, |
300 | .ops = &clkops_null, | 285 | .ops = &clkops_null, |
301 | .recalc = &followparent_recalc, | 286 | .recalc = &followparent_recalc, |
302 | .flags = CLOCK_IN_OMAP4430, | ||
303 | }; | 287 | }; |
304 | 288 | ||
305 | static const struct clksel_rate div3_1to4_rates[] = { | 289 | static const struct clksel_rate div3_1to4_rates[] = { |
@@ -324,7 +308,6 @@ static struct clk abe_clk = { | |||
324 | .recalc = &omap2_clksel_recalc, | 308 | .recalc = &omap2_clksel_recalc, |
325 | .round_rate = &omap2_clksel_round_rate, | 309 | .round_rate = &omap2_clksel_round_rate, |
326 | .set_rate = &omap2_clksel_set_rate, | 310 | .set_rate = &omap2_clksel_set_rate, |
327 | .flags = CLOCK_IN_OMAP4430, | ||
328 | }; | 311 | }; |
329 | 312 | ||
330 | static const struct clksel aess_fclk_div[] = { | 313 | static const struct clksel aess_fclk_div[] = { |
@@ -342,41 +325,40 @@ static struct clk aess_fclk = { | |||
342 | .recalc = &omap2_clksel_recalc, | 325 | .recalc = &omap2_clksel_recalc, |
343 | .round_rate = &omap2_clksel_round_rate, | 326 | .round_rate = &omap2_clksel_round_rate, |
344 | .set_rate = &omap2_clksel_set_rate, | 327 | .set_rate = &omap2_clksel_set_rate, |
345 | .flags = CLOCK_IN_OMAP4430, | ||
346 | }; | 328 | }; |
347 | 329 | ||
348 | static const struct clksel_rate div31_1to31_rates[] = { | 330 | static const struct clksel_rate div31_1to31_rates[] = { |
349 | { .div = 1, .val = 0, .flags = RATE_IN_4430 }, | 331 | { .div = 1, .val = 1, .flags = RATE_IN_4430 }, |
350 | { .div = 2, .val = 1, .flags = RATE_IN_4430 }, | 332 | { .div = 2, .val = 2, .flags = RATE_IN_4430 }, |
351 | { .div = 3, .val = 2, .flags = RATE_IN_4430 }, | 333 | { .div = 3, .val = 3, .flags = RATE_IN_4430 }, |
352 | { .div = 4, .val = 3, .flags = RATE_IN_4430 }, | 334 | { .div = 4, .val = 4, .flags = RATE_IN_4430 }, |
353 | { .div = 5, .val = 4, .flags = RATE_IN_4430 }, | 335 | { .div = 5, .val = 5, .flags = RATE_IN_4430 }, |
354 | { .div = 6, .val = 5, .flags = RATE_IN_4430 }, | 336 | { .div = 6, .val = 6, .flags = RATE_IN_4430 }, |
355 | { .div = 7, .val = 6, .flags = RATE_IN_4430 }, | 337 | { .div = 7, .val = 7, .flags = RATE_IN_4430 }, |
356 | { .div = 8, .val = 7, .flags = RATE_IN_4430 }, | 338 | { .div = 8, .val = 8, .flags = RATE_IN_4430 }, |
357 | { .div = 9, .val = 8, .flags = RATE_IN_4430 }, | 339 | { .div = 9, .val = 9, .flags = RATE_IN_4430 }, |
358 | { .div = 10, .val = 9, .flags = RATE_IN_4430 }, | 340 | { .div = 10, .val = 10, .flags = RATE_IN_4430 }, |
359 | { .div = 11, .val = 10, .flags = RATE_IN_4430 }, | 341 | { .div = 11, .val = 11, .flags = RATE_IN_4430 }, |
360 | { .div = 12, .val = 11, .flags = RATE_IN_4430 }, | 342 | { .div = 12, .val = 12, .flags = RATE_IN_4430 }, |
361 | { .div = 13, .val = 12, .flags = RATE_IN_4430 }, | 343 | { .div = 13, .val = 13, .flags = RATE_IN_4430 }, |
362 | { .div = 14, .val = 13, .flags = RATE_IN_4430 }, | 344 | { .div = 14, .val = 14, .flags = RATE_IN_4430 }, |
363 | { .div = 15, .val = 14, .flags = RATE_IN_4430 }, | 345 | { .div = 15, .val = 15, .flags = RATE_IN_4430 }, |
364 | { .div = 16, .val = 15, .flags = RATE_IN_4430 }, | 346 | { .div = 16, .val = 16, .flags = RATE_IN_4430 }, |
365 | { .div = 17, .val = 16, .flags = RATE_IN_4430 }, | 347 | { .div = 17, .val = 17, .flags = RATE_IN_4430 }, |
366 | { .div = 18, .val = 17, .flags = RATE_IN_4430 }, | 348 | { .div = 18, .val = 18, .flags = RATE_IN_4430 }, |
367 | { .div = 19, .val = 18, .flags = RATE_IN_4430 }, | 349 | { .div = 19, .val = 19, .flags = RATE_IN_4430 }, |
368 | { .div = 20, .val = 19, .flags = RATE_IN_4430 }, | 350 | { .div = 20, .val = 20, .flags = RATE_IN_4430 }, |
369 | { .div = 21, .val = 20, .flags = RATE_IN_4430 }, | 351 | { .div = 21, .val = 21, .flags = RATE_IN_4430 }, |
370 | { .div = 22, .val = 21, .flags = RATE_IN_4430 }, | 352 | { .div = 22, .val = 22, .flags = RATE_IN_4430 }, |
371 | { .div = 23, .val = 22, .flags = RATE_IN_4430 }, | 353 | { .div = 23, .val = 23, .flags = RATE_IN_4430 }, |
372 | { .div = 24, .val = 23, .flags = RATE_IN_4430 }, | 354 | { .div = 24, .val = 24, .flags = RATE_IN_4430 }, |
373 | { .div = 25, .val = 24, .flags = RATE_IN_4430 }, | 355 | { .div = 25, .val = 25, .flags = RATE_IN_4430 }, |
374 | { .div = 26, .val = 25, .flags = RATE_IN_4430 }, | 356 | { .div = 26, .val = 26, .flags = RATE_IN_4430 }, |
375 | { .div = 27, .val = 26, .flags = RATE_IN_4430 }, | 357 | { .div = 27, .val = 27, .flags = RATE_IN_4430 }, |
376 | { .div = 28, .val = 27, .flags = RATE_IN_4430 }, | 358 | { .div = 28, .val = 28, .flags = RATE_IN_4430 }, |
377 | { .div = 29, .val = 28, .flags = RATE_IN_4430 }, | 359 | { .div = 29, .val = 29, .flags = RATE_IN_4430 }, |
378 | { .div = 30, .val = 29, .flags = RATE_IN_4430 }, | 360 | { .div = 30, .val = 30, .flags = RATE_IN_4430 }, |
379 | { .div = 31, .val = 30, .flags = RATE_IN_4430 }, | 361 | { .div = 31, .val = 31, .flags = RATE_IN_4430 }, |
380 | { .div = 0 }, | 362 | { .div = 0 }, |
381 | }; | 363 | }; |
382 | 364 | ||
@@ -395,7 +377,6 @@ static struct clk dpll_abe_m3_ck = { | |||
395 | .recalc = &omap2_clksel_recalc, | 377 | .recalc = &omap2_clksel_recalc, |
396 | .round_rate = &omap2_clksel_round_rate, | 378 | .round_rate = &omap2_clksel_round_rate, |
397 | .set_rate = &omap2_clksel_set_rate, | 379 | .set_rate = &omap2_clksel_set_rate, |
398 | .flags = CLOCK_IN_OMAP4430, | ||
399 | }; | 380 | }; |
400 | 381 | ||
401 | static const struct clksel core_hsd_byp_clk_mux_sel[] = { | 382 | static const struct clksel core_hsd_byp_clk_mux_sel[] = { |
@@ -413,7 +394,6 @@ static struct clk core_hsd_byp_clk_mux_ck = { | |||
413 | .clksel_mask = OMAP4430_DPLL_BYP_CLKSEL_MASK, | 394 | .clksel_mask = OMAP4430_DPLL_BYP_CLKSEL_MASK, |
414 | .ops = &clkops_null, | 395 | .ops = &clkops_null, |
415 | .recalc = &omap2_clksel_recalc, | 396 | .recalc = &omap2_clksel_recalc, |
416 | .flags = CLOCK_IN_OMAP4430, | ||
417 | }; | 397 | }; |
418 | 398 | ||
419 | /* DPLL_CORE */ | 399 | /* DPLL_CORE */ |
@@ -443,7 +423,6 @@ static struct clk dpll_core_ck = { | |||
443 | .init = &omap2_init_dpll_parent, | 423 | .init = &omap2_init_dpll_parent, |
444 | .ops = &clkops_null, | 424 | .ops = &clkops_null, |
445 | .recalc = &omap3_dpll_recalc, | 425 | .recalc = &omap3_dpll_recalc, |
446 | .flags = CLOCK_IN_OMAP4430, | ||
447 | }; | 426 | }; |
448 | 427 | ||
449 | static const struct clksel dpll_core_m6_div[] = { | 428 | static const struct clksel dpll_core_m6_div[] = { |
@@ -461,7 +440,6 @@ static struct clk dpll_core_m6_ck = { | |||
461 | .recalc = &omap2_clksel_recalc, | 440 | .recalc = &omap2_clksel_recalc, |
462 | .round_rate = &omap2_clksel_round_rate, | 441 | .round_rate = &omap2_clksel_round_rate, |
463 | .set_rate = &omap2_clksel_set_rate, | 442 | .set_rate = &omap2_clksel_set_rate, |
464 | .flags = CLOCK_IN_OMAP4430, | ||
465 | }; | 443 | }; |
466 | 444 | ||
467 | static const struct clksel dbgclk_mux_sel[] = { | 445 | static const struct clksel dbgclk_mux_sel[] = { |
@@ -475,7 +453,6 @@ static struct clk dbgclk_mux_ck = { | |||
475 | .parent = &sys_clkin_ck, | 453 | .parent = &sys_clkin_ck, |
476 | .ops = &clkops_null, | 454 | .ops = &clkops_null, |
477 | .recalc = &followparent_recalc, | 455 | .recalc = &followparent_recalc, |
478 | .flags = CLOCK_IN_OMAP4430, | ||
479 | }; | 456 | }; |
480 | 457 | ||
481 | static struct clk dpll_core_m2_ck = { | 458 | static struct clk dpll_core_m2_ck = { |
@@ -488,7 +465,6 @@ static struct clk dpll_core_m2_ck = { | |||
488 | .recalc = &omap2_clksel_recalc, | 465 | .recalc = &omap2_clksel_recalc, |
489 | .round_rate = &omap2_clksel_round_rate, | 466 | .round_rate = &omap2_clksel_round_rate, |
490 | .set_rate = &omap2_clksel_set_rate, | 467 | .set_rate = &omap2_clksel_set_rate, |
491 | .flags = CLOCK_IN_OMAP4430, | ||
492 | }; | 468 | }; |
493 | 469 | ||
494 | static struct clk ddrphy_ck = { | 470 | static struct clk ddrphy_ck = { |
@@ -496,7 +472,6 @@ static struct clk ddrphy_ck = { | |||
496 | .parent = &dpll_core_m2_ck, | 472 | .parent = &dpll_core_m2_ck, |
497 | .ops = &clkops_null, | 473 | .ops = &clkops_null, |
498 | .recalc = &followparent_recalc, | 474 | .recalc = &followparent_recalc, |
499 | .flags = CLOCK_IN_OMAP4430, | ||
500 | }; | 475 | }; |
501 | 476 | ||
502 | static struct clk dpll_core_m5_ck = { | 477 | static struct clk dpll_core_m5_ck = { |
@@ -509,7 +484,6 @@ static struct clk dpll_core_m5_ck = { | |||
509 | .recalc = &omap2_clksel_recalc, | 484 | .recalc = &omap2_clksel_recalc, |
510 | .round_rate = &omap2_clksel_round_rate, | 485 | .round_rate = &omap2_clksel_round_rate, |
511 | .set_rate = &omap2_clksel_set_rate, | 486 | .set_rate = &omap2_clksel_set_rate, |
512 | .flags = CLOCK_IN_OMAP4430, | ||
513 | }; | 487 | }; |
514 | 488 | ||
515 | static const struct clksel div_core_div[] = { | 489 | static const struct clksel div_core_div[] = { |
@@ -527,7 +501,6 @@ static struct clk div_core_ck = { | |||
527 | .recalc = &omap2_clksel_recalc, | 501 | .recalc = &omap2_clksel_recalc, |
528 | .round_rate = &omap2_clksel_round_rate, | 502 | .round_rate = &omap2_clksel_round_rate, |
529 | .set_rate = &omap2_clksel_set_rate, | 503 | .set_rate = &omap2_clksel_set_rate, |
530 | .flags = CLOCK_IN_OMAP4430, | ||
531 | }; | 504 | }; |
532 | 505 | ||
533 | static const struct clksel_rate div4_1to8_rates[] = { | 506 | static const struct clksel_rate div4_1to8_rates[] = { |
@@ -553,7 +526,6 @@ static struct clk div_iva_hs_clk = { | |||
553 | .recalc = &omap2_clksel_recalc, | 526 | .recalc = &omap2_clksel_recalc, |
554 | .round_rate = &omap2_clksel_round_rate, | 527 | .round_rate = &omap2_clksel_round_rate, |
555 | .set_rate = &omap2_clksel_set_rate, | 528 | .set_rate = &omap2_clksel_set_rate, |
556 | .flags = CLOCK_IN_OMAP4430, | ||
557 | }; | 529 | }; |
558 | 530 | ||
559 | static struct clk div_mpu_hs_clk = { | 531 | static struct clk div_mpu_hs_clk = { |
@@ -566,7 +538,6 @@ static struct clk div_mpu_hs_clk = { | |||
566 | .recalc = &omap2_clksel_recalc, | 538 | .recalc = &omap2_clksel_recalc, |
567 | .round_rate = &omap2_clksel_round_rate, | 539 | .round_rate = &omap2_clksel_round_rate, |
568 | .set_rate = &omap2_clksel_set_rate, | 540 | .set_rate = &omap2_clksel_set_rate, |
569 | .flags = CLOCK_IN_OMAP4430, | ||
570 | }; | 541 | }; |
571 | 542 | ||
572 | static struct clk dpll_core_m4_ck = { | 543 | static struct clk dpll_core_m4_ck = { |
@@ -579,7 +550,6 @@ static struct clk dpll_core_m4_ck = { | |||
579 | .recalc = &omap2_clksel_recalc, | 550 | .recalc = &omap2_clksel_recalc, |
580 | .round_rate = &omap2_clksel_round_rate, | 551 | .round_rate = &omap2_clksel_round_rate, |
581 | .set_rate = &omap2_clksel_set_rate, | 552 | .set_rate = &omap2_clksel_set_rate, |
582 | .flags = CLOCK_IN_OMAP4430, | ||
583 | }; | 553 | }; |
584 | 554 | ||
585 | static struct clk dll_clk_div_ck = { | 555 | static struct clk dll_clk_div_ck = { |
@@ -587,7 +557,6 @@ static struct clk dll_clk_div_ck = { | |||
587 | .parent = &dpll_core_m4_ck, | 557 | .parent = &dpll_core_m4_ck, |
588 | .ops = &clkops_null, | 558 | .ops = &clkops_null, |
589 | .recalc = &followparent_recalc, | 559 | .recalc = &followparent_recalc, |
590 | .flags = CLOCK_IN_OMAP4430, | ||
591 | }; | 560 | }; |
592 | 561 | ||
593 | static struct clk dpll_abe_m2_ck = { | 562 | static struct clk dpll_abe_m2_ck = { |
@@ -600,7 +569,6 @@ static struct clk dpll_abe_m2_ck = { | |||
600 | .recalc = &omap2_clksel_recalc, | 569 | .recalc = &omap2_clksel_recalc, |
601 | .round_rate = &omap2_clksel_round_rate, | 570 | .round_rate = &omap2_clksel_round_rate, |
602 | .set_rate = &omap2_clksel_set_rate, | 571 | .set_rate = &omap2_clksel_set_rate, |
603 | .flags = CLOCK_IN_OMAP4430, | ||
604 | }; | 572 | }; |
605 | 573 | ||
606 | static struct clk dpll_core_m3_ck = { | 574 | static struct clk dpll_core_m3_ck = { |
@@ -613,7 +581,6 @@ static struct clk dpll_core_m3_ck = { | |||
613 | .recalc = &omap2_clksel_recalc, | 581 | .recalc = &omap2_clksel_recalc, |
614 | .round_rate = &omap2_clksel_round_rate, | 582 | .round_rate = &omap2_clksel_round_rate, |
615 | .set_rate = &omap2_clksel_set_rate, | 583 | .set_rate = &omap2_clksel_set_rate, |
616 | .flags = CLOCK_IN_OMAP4430, | ||
617 | }; | 584 | }; |
618 | 585 | ||
619 | static struct clk dpll_core_m7_ck = { | 586 | static struct clk dpll_core_m7_ck = { |
@@ -626,7 +593,6 @@ static struct clk dpll_core_m7_ck = { | |||
626 | .recalc = &omap2_clksel_recalc, | 593 | .recalc = &omap2_clksel_recalc, |
627 | .round_rate = &omap2_clksel_round_rate, | 594 | .round_rate = &omap2_clksel_round_rate, |
628 | .set_rate = &omap2_clksel_set_rate, | 595 | .set_rate = &omap2_clksel_set_rate, |
629 | .flags = CLOCK_IN_OMAP4430, | ||
630 | }; | 596 | }; |
631 | 597 | ||
632 | static const struct clksel iva_hsd_byp_clk_mux_sel[] = { | 598 | static const struct clksel iva_hsd_byp_clk_mux_sel[] = { |
@@ -640,7 +606,6 @@ static struct clk iva_hsd_byp_clk_mux_ck = { | |||
640 | .parent = &dpll_sys_ref_clk, | 606 | .parent = &dpll_sys_ref_clk, |
641 | .ops = &clkops_null, | 607 | .ops = &clkops_null, |
642 | .recalc = &followparent_recalc, | 608 | .recalc = &followparent_recalc, |
643 | .flags = CLOCK_IN_OMAP4430, | ||
644 | }; | 609 | }; |
645 | 610 | ||
646 | /* DPLL_IVA */ | 611 | /* DPLL_IVA */ |
@@ -668,11 +633,10 @@ static struct clk dpll_iva_ck = { | |||
668 | .parent = &dpll_sys_ref_clk, | 633 | .parent = &dpll_sys_ref_clk, |
669 | .dpll_data = &dpll_iva_dd, | 634 | .dpll_data = &dpll_iva_dd, |
670 | .init = &omap2_init_dpll_parent, | 635 | .init = &omap2_init_dpll_parent, |
671 | .ops = &clkops_noncore_dpll_ops, | 636 | .ops = &clkops_omap3_noncore_dpll_ops, |
672 | .recalc = &omap3_dpll_recalc, | 637 | .recalc = &omap3_dpll_recalc, |
673 | .round_rate = &omap2_dpll_round_rate, | 638 | .round_rate = &omap2_dpll_round_rate, |
674 | .set_rate = &omap3_noncore_dpll_set_rate, | 639 | .set_rate = &omap3_noncore_dpll_set_rate, |
675 | .flags = CLOCK_IN_OMAP4430, | ||
676 | }; | 640 | }; |
677 | 641 | ||
678 | static const struct clksel dpll_iva_m4_div[] = { | 642 | static const struct clksel dpll_iva_m4_div[] = { |
@@ -690,7 +654,6 @@ static struct clk dpll_iva_m4_ck = { | |||
690 | .recalc = &omap2_clksel_recalc, | 654 | .recalc = &omap2_clksel_recalc, |
691 | .round_rate = &omap2_clksel_round_rate, | 655 | .round_rate = &omap2_clksel_round_rate, |
692 | .set_rate = &omap2_clksel_set_rate, | 656 | .set_rate = &omap2_clksel_set_rate, |
693 | .flags = CLOCK_IN_OMAP4430, | ||
694 | }; | 657 | }; |
695 | 658 | ||
696 | static struct clk dpll_iva_m5_ck = { | 659 | static struct clk dpll_iva_m5_ck = { |
@@ -703,7 +666,6 @@ static struct clk dpll_iva_m5_ck = { | |||
703 | .recalc = &omap2_clksel_recalc, | 666 | .recalc = &omap2_clksel_recalc, |
704 | .round_rate = &omap2_clksel_round_rate, | 667 | .round_rate = &omap2_clksel_round_rate, |
705 | .set_rate = &omap2_clksel_set_rate, | 668 | .set_rate = &omap2_clksel_set_rate, |
706 | .flags = CLOCK_IN_OMAP4430, | ||
707 | }; | 669 | }; |
708 | 670 | ||
709 | /* DPLL_MPU */ | 671 | /* DPLL_MPU */ |
@@ -731,11 +693,10 @@ static struct clk dpll_mpu_ck = { | |||
731 | .parent = &dpll_sys_ref_clk, | 693 | .parent = &dpll_sys_ref_clk, |
732 | .dpll_data = &dpll_mpu_dd, | 694 | .dpll_data = &dpll_mpu_dd, |
733 | .init = &omap2_init_dpll_parent, | 695 | .init = &omap2_init_dpll_parent, |
734 | .ops = &clkops_noncore_dpll_ops, | 696 | .ops = &clkops_omap3_noncore_dpll_ops, |
735 | .recalc = &omap3_dpll_recalc, | 697 | .recalc = &omap3_dpll_recalc, |
736 | .round_rate = &omap2_dpll_round_rate, | 698 | .round_rate = &omap2_dpll_round_rate, |
737 | .set_rate = &omap3_noncore_dpll_set_rate, | 699 | .set_rate = &omap3_noncore_dpll_set_rate, |
738 | .flags = CLOCK_IN_OMAP4430, | ||
739 | }; | 700 | }; |
740 | 701 | ||
741 | static const struct clksel dpll_mpu_m2_div[] = { | 702 | static const struct clksel dpll_mpu_m2_div[] = { |
@@ -753,7 +714,6 @@ static struct clk dpll_mpu_m2_ck = { | |||
753 | .recalc = &omap2_clksel_recalc, | 714 | .recalc = &omap2_clksel_recalc, |
754 | .round_rate = &omap2_clksel_round_rate, | 715 | .round_rate = &omap2_clksel_round_rate, |
755 | .set_rate = &omap2_clksel_set_rate, | 716 | .set_rate = &omap2_clksel_set_rate, |
756 | .flags = CLOCK_IN_OMAP4430, | ||
757 | }; | 717 | }; |
758 | 718 | ||
759 | static struct clk per_hs_clk_div_ck = { | 719 | static struct clk per_hs_clk_div_ck = { |
@@ -761,7 +721,6 @@ static struct clk per_hs_clk_div_ck = { | |||
761 | .parent = &dpll_abe_m3_ck, | 721 | .parent = &dpll_abe_m3_ck, |
762 | .ops = &clkops_null, | 722 | .ops = &clkops_null, |
763 | .recalc = &followparent_recalc, | 723 | .recalc = &followparent_recalc, |
764 | .flags = CLOCK_IN_OMAP4430, | ||
765 | }; | 724 | }; |
766 | 725 | ||
767 | static const struct clksel per_hsd_byp_clk_mux_sel[] = { | 726 | static const struct clksel per_hsd_byp_clk_mux_sel[] = { |
@@ -779,7 +738,6 @@ static struct clk per_hsd_byp_clk_mux_ck = { | |||
779 | .clksel_mask = OMAP4430_DPLL_BYP_CLKSEL_MASK, | 738 | .clksel_mask = OMAP4430_DPLL_BYP_CLKSEL_MASK, |
780 | .ops = &clkops_null, | 739 | .ops = &clkops_null, |
781 | .recalc = &omap2_clksel_recalc, | 740 | .recalc = &omap2_clksel_recalc, |
782 | .flags = CLOCK_IN_OMAP4430, | ||
783 | }; | 741 | }; |
784 | 742 | ||
785 | /* DPLL_PER */ | 743 | /* DPLL_PER */ |
@@ -807,11 +765,10 @@ static struct clk dpll_per_ck = { | |||
807 | .parent = &dpll_sys_ref_clk, | 765 | .parent = &dpll_sys_ref_clk, |
808 | .dpll_data = &dpll_per_dd, | 766 | .dpll_data = &dpll_per_dd, |
809 | .init = &omap2_init_dpll_parent, | 767 | .init = &omap2_init_dpll_parent, |
810 | .ops = &clkops_noncore_dpll_ops, | 768 | .ops = &clkops_omap3_noncore_dpll_ops, |
811 | .recalc = &omap3_dpll_recalc, | 769 | .recalc = &omap3_dpll_recalc, |
812 | .round_rate = &omap2_dpll_round_rate, | 770 | .round_rate = &omap2_dpll_round_rate, |
813 | .set_rate = &omap3_noncore_dpll_set_rate, | 771 | .set_rate = &omap3_noncore_dpll_set_rate, |
814 | .flags = CLOCK_IN_OMAP4430, | ||
815 | }; | 772 | }; |
816 | 773 | ||
817 | static const struct clksel dpll_per_m2_div[] = { | 774 | static const struct clksel dpll_per_m2_div[] = { |
@@ -829,7 +786,6 @@ static struct clk dpll_per_m2_ck = { | |||
829 | .recalc = &omap2_clksel_recalc, | 786 | .recalc = &omap2_clksel_recalc, |
830 | .round_rate = &omap2_clksel_round_rate, | 787 | .round_rate = &omap2_clksel_round_rate, |
831 | .set_rate = &omap2_clksel_set_rate, | 788 | .set_rate = &omap2_clksel_set_rate, |
832 | .flags = CLOCK_IN_OMAP4430, | ||
833 | }; | 789 | }; |
834 | 790 | ||
835 | static struct clk dpll_per_m2x2_ck = { | 791 | static struct clk dpll_per_m2x2_ck = { |
@@ -837,7 +793,6 @@ static struct clk dpll_per_m2x2_ck = { | |||
837 | .parent = &dpll_per_ck, | 793 | .parent = &dpll_per_ck, |
838 | .ops = &clkops_null, | 794 | .ops = &clkops_null, |
839 | .recalc = &followparent_recalc, | 795 | .recalc = &followparent_recalc, |
840 | .flags = CLOCK_IN_OMAP4430, | ||
841 | }; | 796 | }; |
842 | 797 | ||
843 | static struct clk dpll_per_m3_ck = { | 798 | static struct clk dpll_per_m3_ck = { |
@@ -850,7 +805,6 @@ static struct clk dpll_per_m3_ck = { | |||
850 | .recalc = &omap2_clksel_recalc, | 805 | .recalc = &omap2_clksel_recalc, |
851 | .round_rate = &omap2_clksel_round_rate, | 806 | .round_rate = &omap2_clksel_round_rate, |
852 | .set_rate = &omap2_clksel_set_rate, | 807 | .set_rate = &omap2_clksel_set_rate, |
853 | .flags = CLOCK_IN_OMAP4430, | ||
854 | }; | 808 | }; |
855 | 809 | ||
856 | static struct clk dpll_per_m4_ck = { | 810 | static struct clk dpll_per_m4_ck = { |
@@ -863,7 +817,6 @@ static struct clk dpll_per_m4_ck = { | |||
863 | .recalc = &omap2_clksel_recalc, | 817 | .recalc = &omap2_clksel_recalc, |
864 | .round_rate = &omap2_clksel_round_rate, | 818 | .round_rate = &omap2_clksel_round_rate, |
865 | .set_rate = &omap2_clksel_set_rate, | 819 | .set_rate = &omap2_clksel_set_rate, |
866 | .flags = CLOCK_IN_OMAP4430, | ||
867 | }; | 820 | }; |
868 | 821 | ||
869 | static struct clk dpll_per_m5_ck = { | 822 | static struct clk dpll_per_m5_ck = { |
@@ -876,7 +829,6 @@ static struct clk dpll_per_m5_ck = { | |||
876 | .recalc = &omap2_clksel_recalc, | 829 | .recalc = &omap2_clksel_recalc, |
877 | .round_rate = &omap2_clksel_round_rate, | 830 | .round_rate = &omap2_clksel_round_rate, |
878 | .set_rate = &omap2_clksel_set_rate, | 831 | .set_rate = &omap2_clksel_set_rate, |
879 | .flags = CLOCK_IN_OMAP4430, | ||
880 | }; | 832 | }; |
881 | 833 | ||
882 | static struct clk dpll_per_m6_ck = { | 834 | static struct clk dpll_per_m6_ck = { |
@@ -889,7 +841,6 @@ static struct clk dpll_per_m6_ck = { | |||
889 | .recalc = &omap2_clksel_recalc, | 841 | .recalc = &omap2_clksel_recalc, |
890 | .round_rate = &omap2_clksel_round_rate, | 842 | .round_rate = &omap2_clksel_round_rate, |
891 | .set_rate = &omap2_clksel_set_rate, | 843 | .set_rate = &omap2_clksel_set_rate, |
892 | .flags = CLOCK_IN_OMAP4430, | ||
893 | }; | 844 | }; |
894 | 845 | ||
895 | static struct clk dpll_per_m7_ck = { | 846 | static struct clk dpll_per_m7_ck = { |
@@ -902,7 +853,6 @@ static struct clk dpll_per_m7_ck = { | |||
902 | .recalc = &omap2_clksel_recalc, | 853 | .recalc = &omap2_clksel_recalc, |
903 | .round_rate = &omap2_clksel_round_rate, | 854 | .round_rate = &omap2_clksel_round_rate, |
904 | .set_rate = &omap2_clksel_set_rate, | 855 | .set_rate = &omap2_clksel_set_rate, |
905 | .flags = CLOCK_IN_OMAP4430, | ||
906 | }; | 856 | }; |
907 | 857 | ||
908 | /* DPLL_UNIPRO */ | 858 | /* DPLL_UNIPRO */ |
@@ -930,11 +880,10 @@ static struct clk dpll_unipro_ck = { | |||
930 | .parent = &dpll_sys_ref_clk, | 880 | .parent = &dpll_sys_ref_clk, |
931 | .dpll_data = &dpll_unipro_dd, | 881 | .dpll_data = &dpll_unipro_dd, |
932 | .init = &omap2_init_dpll_parent, | 882 | .init = &omap2_init_dpll_parent, |
933 | .ops = &clkops_noncore_dpll_ops, | 883 | .ops = &clkops_omap3_noncore_dpll_ops, |
934 | .recalc = &omap3_dpll_recalc, | 884 | .recalc = &omap3_dpll_recalc, |
935 | .round_rate = &omap2_dpll_round_rate, | 885 | .round_rate = &omap2_dpll_round_rate, |
936 | .set_rate = &omap3_noncore_dpll_set_rate, | 886 | .set_rate = &omap3_noncore_dpll_set_rate, |
937 | .flags = CLOCK_IN_OMAP4430, | ||
938 | }; | 887 | }; |
939 | 888 | ||
940 | static const struct clksel dpll_unipro_m2x2_div[] = { | 889 | static const struct clksel dpll_unipro_m2x2_div[] = { |
@@ -952,7 +901,6 @@ static struct clk dpll_unipro_m2x2_ck = { | |||
952 | .recalc = &omap2_clksel_recalc, | 901 | .recalc = &omap2_clksel_recalc, |
953 | .round_rate = &omap2_clksel_round_rate, | 902 | .round_rate = &omap2_clksel_round_rate, |
954 | .set_rate = &omap2_clksel_set_rate, | 903 | .set_rate = &omap2_clksel_set_rate, |
955 | .flags = CLOCK_IN_OMAP4430, | ||
956 | }; | 904 | }; |
957 | 905 | ||
958 | static struct clk usb_hs_clk_div_ck = { | 906 | static struct clk usb_hs_clk_div_ck = { |
@@ -960,7 +908,6 @@ static struct clk usb_hs_clk_div_ck = { | |||
960 | .parent = &dpll_abe_m3_ck, | 908 | .parent = &dpll_abe_m3_ck, |
961 | .ops = &clkops_null, | 909 | .ops = &clkops_null, |
962 | .recalc = &followparent_recalc, | 910 | .recalc = &followparent_recalc, |
963 | .flags = CLOCK_IN_OMAP4430, | ||
964 | }; | 911 | }; |
965 | 912 | ||
966 | /* DPLL_USB */ | 913 | /* DPLL_USB */ |
@@ -980,6 +927,7 @@ static struct dpll_data dpll_usb_dd = { | |||
980 | .max_multiplier = OMAP4430_MAX_DPLL_MULT, | 927 | .max_multiplier = OMAP4430_MAX_DPLL_MULT, |
981 | .max_divider = OMAP4430_MAX_DPLL_DIV, | 928 | .max_divider = OMAP4430_MAX_DPLL_DIV, |
982 | .min_divider = 1, | 929 | .min_divider = 1, |
930 | .flags = DPLL_J_TYPE | DPLL_NO_DCO_SEL | ||
983 | }; | 931 | }; |
984 | 932 | ||
985 | 933 | ||
@@ -988,11 +936,10 @@ static struct clk dpll_usb_ck = { | |||
988 | .parent = &dpll_sys_ref_clk, | 936 | .parent = &dpll_sys_ref_clk, |
989 | .dpll_data = &dpll_usb_dd, | 937 | .dpll_data = &dpll_usb_dd, |
990 | .init = &omap2_init_dpll_parent, | 938 | .init = &omap2_init_dpll_parent, |
991 | .ops = &clkops_noncore_dpll_ops, | 939 | .ops = &clkops_omap3_noncore_dpll_ops, |
992 | .recalc = &omap3_dpll_recalc, | 940 | .recalc = &omap3_dpll_recalc, |
993 | .round_rate = &omap2_dpll_round_rate, | 941 | .round_rate = &omap2_dpll_round_rate, |
994 | .set_rate = &omap3_noncore_dpll_set_rate, | 942 | .set_rate = &omap3_noncore_dpll_set_rate, |
995 | .flags = CLOCK_IN_OMAP4430, | ||
996 | }; | 943 | }; |
997 | 944 | ||
998 | static struct clk dpll_usb_clkdcoldo_ck = { | 945 | static struct clk dpll_usb_clkdcoldo_ck = { |
@@ -1000,7 +947,6 @@ static struct clk dpll_usb_clkdcoldo_ck = { | |||
1000 | .parent = &dpll_usb_ck, | 947 | .parent = &dpll_usb_ck, |
1001 | .ops = &clkops_null, | 948 | .ops = &clkops_null, |
1002 | .recalc = &followparent_recalc, | 949 | .recalc = &followparent_recalc, |
1003 | .flags = CLOCK_IN_OMAP4430, | ||
1004 | }; | 950 | }; |
1005 | 951 | ||
1006 | static const struct clksel dpll_usb_m2_div[] = { | 952 | static const struct clksel dpll_usb_m2_div[] = { |
@@ -1018,7 +964,6 @@ static struct clk dpll_usb_m2_ck = { | |||
1018 | .recalc = &omap2_clksel_recalc, | 964 | .recalc = &omap2_clksel_recalc, |
1019 | .round_rate = &omap2_clksel_round_rate, | 965 | .round_rate = &omap2_clksel_round_rate, |
1020 | .set_rate = &omap2_clksel_set_rate, | 966 | .set_rate = &omap2_clksel_set_rate, |
1021 | .flags = CLOCK_IN_OMAP4430, | ||
1022 | }; | 967 | }; |
1023 | 968 | ||
1024 | static const struct clksel ducati_clk_mux_sel[] = { | 969 | static const struct clksel ducati_clk_mux_sel[] = { |
@@ -1036,7 +981,6 @@ static struct clk ducati_clk_mux_ck = { | |||
1036 | .clksel_mask = OMAP4430_CLKSEL_0_0_MASK, | 981 | .clksel_mask = OMAP4430_CLKSEL_0_0_MASK, |
1037 | .ops = &clkops_null, | 982 | .ops = &clkops_null, |
1038 | .recalc = &omap2_clksel_recalc, | 983 | .recalc = &omap2_clksel_recalc, |
1039 | .flags = CLOCK_IN_OMAP4430, | ||
1040 | }; | 984 | }; |
1041 | 985 | ||
1042 | static struct clk func_12m_fclk = { | 986 | static struct clk func_12m_fclk = { |
@@ -1044,7 +988,6 @@ static struct clk func_12m_fclk = { | |||
1044 | .parent = &dpll_per_m2x2_ck, | 988 | .parent = &dpll_per_m2x2_ck, |
1045 | .ops = &clkops_null, | 989 | .ops = &clkops_null, |
1046 | .recalc = &followparent_recalc, | 990 | .recalc = &followparent_recalc, |
1047 | .flags = CLOCK_IN_OMAP4430, | ||
1048 | }; | 991 | }; |
1049 | 992 | ||
1050 | static struct clk func_24m_clk = { | 993 | static struct clk func_24m_clk = { |
@@ -1052,7 +995,6 @@ static struct clk func_24m_clk = { | |||
1052 | .parent = &dpll_per_m2_ck, | 995 | .parent = &dpll_per_m2_ck, |
1053 | .ops = &clkops_null, | 996 | .ops = &clkops_null, |
1054 | .recalc = &followparent_recalc, | 997 | .recalc = &followparent_recalc, |
1055 | .flags = CLOCK_IN_OMAP4430, | ||
1056 | }; | 998 | }; |
1057 | 999 | ||
1058 | static struct clk func_24mc_fclk = { | 1000 | static struct clk func_24mc_fclk = { |
@@ -1060,7 +1002,6 @@ static struct clk func_24mc_fclk = { | |||
1060 | .parent = &dpll_per_m2x2_ck, | 1002 | .parent = &dpll_per_m2x2_ck, |
1061 | .ops = &clkops_null, | 1003 | .ops = &clkops_null, |
1062 | .recalc = &followparent_recalc, | 1004 | .recalc = &followparent_recalc, |
1063 | .flags = CLOCK_IN_OMAP4430, | ||
1064 | }; | 1005 | }; |
1065 | 1006 | ||
1066 | static const struct clksel_rate div2_4to8_rates[] = { | 1007 | static const struct clksel_rate div2_4to8_rates[] = { |
@@ -1084,7 +1025,6 @@ static struct clk func_48m_fclk = { | |||
1084 | .recalc = &omap2_clksel_recalc, | 1025 | .recalc = &omap2_clksel_recalc, |
1085 | .round_rate = &omap2_clksel_round_rate, | 1026 | .round_rate = &omap2_clksel_round_rate, |
1086 | .set_rate = &omap2_clksel_set_rate, | 1027 | .set_rate = &omap2_clksel_set_rate, |
1087 | .flags = CLOCK_IN_OMAP4430, | ||
1088 | }; | 1028 | }; |
1089 | 1029 | ||
1090 | static struct clk func_48mc_fclk = { | 1030 | static struct clk func_48mc_fclk = { |
@@ -1092,7 +1032,6 @@ static struct clk func_48mc_fclk = { | |||
1092 | .parent = &dpll_per_m2x2_ck, | 1032 | .parent = &dpll_per_m2x2_ck, |
1093 | .ops = &clkops_null, | 1033 | .ops = &clkops_null, |
1094 | .recalc = &followparent_recalc, | 1034 | .recalc = &followparent_recalc, |
1095 | .flags = CLOCK_IN_OMAP4430, | ||
1096 | }; | 1035 | }; |
1097 | 1036 | ||
1098 | static const struct clksel_rate div2_2to4_rates[] = { | 1037 | static const struct clksel_rate div2_2to4_rates[] = { |
@@ -1116,7 +1055,6 @@ static struct clk func_64m_fclk = { | |||
1116 | .recalc = &omap2_clksel_recalc, | 1055 | .recalc = &omap2_clksel_recalc, |
1117 | .round_rate = &omap2_clksel_round_rate, | 1056 | .round_rate = &omap2_clksel_round_rate, |
1118 | .set_rate = &omap2_clksel_set_rate, | 1057 | .set_rate = &omap2_clksel_set_rate, |
1119 | .flags = CLOCK_IN_OMAP4430, | ||
1120 | }; | 1058 | }; |
1121 | 1059 | ||
1122 | static const struct clksel func_96m_fclk_div[] = { | 1060 | static const struct clksel func_96m_fclk_div[] = { |
@@ -1134,7 +1072,6 @@ static struct clk func_96m_fclk = { | |||
1134 | .recalc = &omap2_clksel_recalc, | 1072 | .recalc = &omap2_clksel_recalc, |
1135 | .round_rate = &omap2_clksel_round_rate, | 1073 | .round_rate = &omap2_clksel_round_rate, |
1136 | .set_rate = &omap2_clksel_set_rate, | 1074 | .set_rate = &omap2_clksel_set_rate, |
1137 | .flags = CLOCK_IN_OMAP4430, | ||
1138 | }; | 1075 | }; |
1139 | 1076 | ||
1140 | static const struct clksel hsmmc6_fclk_sel[] = { | 1077 | static const struct clksel hsmmc6_fclk_sel[] = { |
@@ -1148,7 +1085,6 @@ static struct clk hsmmc6_fclk = { | |||
1148 | .parent = &func_64m_fclk, | 1085 | .parent = &func_64m_fclk, |
1149 | .ops = &clkops_null, | 1086 | .ops = &clkops_null, |
1150 | .recalc = &followparent_recalc, | 1087 | .recalc = &followparent_recalc, |
1151 | .flags = CLOCK_IN_OMAP4430, | ||
1152 | }; | 1088 | }; |
1153 | 1089 | ||
1154 | static const struct clksel_rate div2_1to8_rates[] = { | 1090 | static const struct clksel_rate div2_1to8_rates[] = { |
@@ -1172,7 +1108,6 @@ static struct clk init_60m_fclk = { | |||
1172 | .recalc = &omap2_clksel_recalc, | 1108 | .recalc = &omap2_clksel_recalc, |
1173 | .round_rate = &omap2_clksel_round_rate, | 1109 | .round_rate = &omap2_clksel_round_rate, |
1174 | .set_rate = &omap2_clksel_set_rate, | 1110 | .set_rate = &omap2_clksel_set_rate, |
1175 | .flags = CLOCK_IN_OMAP4430, | ||
1176 | }; | 1111 | }; |
1177 | 1112 | ||
1178 | static const struct clksel l3_div_div[] = { | 1113 | static const struct clksel l3_div_div[] = { |
@@ -1190,7 +1125,6 @@ static struct clk l3_div_ck = { | |||
1190 | .recalc = &omap2_clksel_recalc, | 1125 | .recalc = &omap2_clksel_recalc, |
1191 | .round_rate = &omap2_clksel_round_rate, | 1126 | .round_rate = &omap2_clksel_round_rate, |
1192 | .set_rate = &omap2_clksel_set_rate, | 1127 | .set_rate = &omap2_clksel_set_rate, |
1193 | .flags = CLOCK_IN_OMAP4430, | ||
1194 | }; | 1128 | }; |
1195 | 1129 | ||
1196 | static const struct clksel l4_div_div[] = { | 1130 | static const struct clksel l4_div_div[] = { |
@@ -1208,7 +1142,6 @@ static struct clk l4_div_ck = { | |||
1208 | .recalc = &omap2_clksel_recalc, | 1142 | .recalc = &omap2_clksel_recalc, |
1209 | .round_rate = &omap2_clksel_round_rate, | 1143 | .round_rate = &omap2_clksel_round_rate, |
1210 | .set_rate = &omap2_clksel_set_rate, | 1144 | .set_rate = &omap2_clksel_set_rate, |
1211 | .flags = CLOCK_IN_OMAP4430, | ||
1212 | }; | 1145 | }; |
1213 | 1146 | ||
1214 | static struct clk lp_clk_div_ck = { | 1147 | static struct clk lp_clk_div_ck = { |
@@ -1216,7 +1149,6 @@ static struct clk lp_clk_div_ck = { | |||
1216 | .parent = &dpll_abe_m2x2_ck, | 1149 | .parent = &dpll_abe_m2x2_ck, |
1217 | .ops = &clkops_null, | 1150 | .ops = &clkops_null, |
1218 | .recalc = &followparent_recalc, | 1151 | .recalc = &followparent_recalc, |
1219 | .flags = CLOCK_IN_OMAP4430, | ||
1220 | }; | 1152 | }; |
1221 | 1153 | ||
1222 | static const struct clksel l4_wkup_clk_mux_sel[] = { | 1154 | static const struct clksel l4_wkup_clk_mux_sel[] = { |
@@ -1234,7 +1166,6 @@ static struct clk l4_wkup_clk_mux_ck = { | |||
1234 | .clksel_mask = OMAP4430_CLKSEL_0_0_MASK, | 1166 | .clksel_mask = OMAP4430_CLKSEL_0_0_MASK, |
1235 | .ops = &clkops_null, | 1167 | .ops = &clkops_null, |
1236 | .recalc = &omap2_clksel_recalc, | 1168 | .recalc = &omap2_clksel_recalc, |
1237 | .flags = CLOCK_IN_OMAP4430, | ||
1238 | }; | 1169 | }; |
1239 | 1170 | ||
1240 | static const struct clksel per_abe_nc_fclk_div[] = { | 1171 | static const struct clksel per_abe_nc_fclk_div[] = { |
@@ -1252,7 +1183,6 @@ static struct clk per_abe_nc_fclk = { | |||
1252 | .recalc = &omap2_clksel_recalc, | 1183 | .recalc = &omap2_clksel_recalc, |
1253 | .round_rate = &omap2_clksel_round_rate, | 1184 | .round_rate = &omap2_clksel_round_rate, |
1254 | .set_rate = &omap2_clksel_set_rate, | 1185 | .set_rate = &omap2_clksel_set_rate, |
1255 | .flags = CLOCK_IN_OMAP4430, | ||
1256 | }; | 1186 | }; |
1257 | 1187 | ||
1258 | static const struct clksel mcasp2_fclk_sel[] = { | 1188 | static const struct clksel mcasp2_fclk_sel[] = { |
@@ -1266,7 +1196,6 @@ static struct clk mcasp2_fclk = { | |||
1266 | .parent = &func_96m_fclk, | 1196 | .parent = &func_96m_fclk, |
1267 | .ops = &clkops_null, | 1197 | .ops = &clkops_null, |
1268 | .recalc = &followparent_recalc, | 1198 | .recalc = &followparent_recalc, |
1269 | .flags = CLOCK_IN_OMAP4430, | ||
1270 | }; | 1199 | }; |
1271 | 1200 | ||
1272 | static struct clk mcasp3_fclk = { | 1201 | static struct clk mcasp3_fclk = { |
@@ -1274,7 +1203,6 @@ static struct clk mcasp3_fclk = { | |||
1274 | .parent = &func_96m_fclk, | 1203 | .parent = &func_96m_fclk, |
1275 | .ops = &clkops_null, | 1204 | .ops = &clkops_null, |
1276 | .recalc = &followparent_recalc, | 1205 | .recalc = &followparent_recalc, |
1277 | .flags = CLOCK_IN_OMAP4430, | ||
1278 | }; | 1206 | }; |
1279 | 1207 | ||
1280 | static struct clk ocp_abe_iclk = { | 1208 | static struct clk ocp_abe_iclk = { |
@@ -1282,7 +1210,6 @@ static struct clk ocp_abe_iclk = { | |||
1282 | .parent = &aess_fclk, | 1210 | .parent = &aess_fclk, |
1283 | .ops = &clkops_null, | 1211 | .ops = &clkops_null, |
1284 | .recalc = &followparent_recalc, | 1212 | .recalc = &followparent_recalc, |
1285 | .flags = CLOCK_IN_OMAP4430, | ||
1286 | }; | 1213 | }; |
1287 | 1214 | ||
1288 | static struct clk per_abe_24m_fclk = { | 1215 | static struct clk per_abe_24m_fclk = { |
@@ -1290,7 +1217,6 @@ static struct clk per_abe_24m_fclk = { | |||
1290 | .parent = &dpll_abe_m2_ck, | 1217 | .parent = &dpll_abe_m2_ck, |
1291 | .ops = &clkops_null, | 1218 | .ops = &clkops_null, |
1292 | .recalc = &followparent_recalc, | 1219 | .recalc = &followparent_recalc, |
1293 | .flags = CLOCK_IN_OMAP4430, | ||
1294 | }; | 1220 | }; |
1295 | 1221 | ||
1296 | static const struct clksel pmd_stm_clock_mux_sel[] = { | 1222 | static const struct clksel pmd_stm_clock_mux_sel[] = { |
@@ -1305,7 +1231,6 @@ static struct clk pmd_stm_clock_mux_ck = { | |||
1305 | .parent = &sys_clkin_ck, | 1231 | .parent = &sys_clkin_ck, |
1306 | .ops = &clkops_null, | 1232 | .ops = &clkops_null, |
1307 | .recalc = &followparent_recalc, | 1233 | .recalc = &followparent_recalc, |
1308 | .flags = CLOCK_IN_OMAP4430, | ||
1309 | }; | 1234 | }; |
1310 | 1235 | ||
1311 | static struct clk pmd_trace_clk_mux_ck = { | 1236 | static struct clk pmd_trace_clk_mux_ck = { |
@@ -1313,7 +1238,6 @@ static struct clk pmd_trace_clk_mux_ck = { | |||
1313 | .parent = &sys_clkin_ck, | 1238 | .parent = &sys_clkin_ck, |
1314 | .ops = &clkops_null, | 1239 | .ops = &clkops_null, |
1315 | .recalc = &followparent_recalc, | 1240 | .recalc = &followparent_recalc, |
1316 | .flags = CLOCK_IN_OMAP4430, | ||
1317 | }; | 1241 | }; |
1318 | 1242 | ||
1319 | static struct clk syc_clk_div_ck = { | 1243 | static struct clk syc_clk_div_ck = { |
@@ -1326,13 +1250,12 @@ static struct clk syc_clk_div_ck = { | |||
1326 | .recalc = &omap2_clksel_recalc, | 1250 | .recalc = &omap2_clksel_recalc, |
1327 | .round_rate = &omap2_clksel_round_rate, | 1251 | .round_rate = &omap2_clksel_round_rate, |
1328 | .set_rate = &omap2_clksel_set_rate, | 1252 | .set_rate = &omap2_clksel_set_rate, |
1329 | .flags = CLOCK_IN_OMAP4430, | ||
1330 | }; | 1253 | }; |
1331 | 1254 | ||
1332 | /* Leaf clocks controlled by modules */ | 1255 | /* Leaf clocks controlled by modules */ |
1333 | 1256 | ||
1334 | static struct clk aes1_ck = { | 1257 | static struct clk aes1_fck = { |
1335 | .name = "aes1_ck", | 1258 | .name = "aes1_fck", |
1336 | .ops = &clkops_omap2_dflt, | 1259 | .ops = &clkops_omap2_dflt, |
1337 | .enable_reg = OMAP4430_CM_L4SEC_AES1_CLKCTRL, | 1260 | .enable_reg = OMAP4430_CM_L4SEC_AES1_CLKCTRL, |
1338 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1261 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1341,8 +1264,8 @@ static struct clk aes1_ck = { | |||
1341 | .recalc = &followparent_recalc, | 1264 | .recalc = &followparent_recalc, |
1342 | }; | 1265 | }; |
1343 | 1266 | ||
1344 | static struct clk aes2_ck = { | 1267 | static struct clk aes2_fck = { |
1345 | .name = "aes2_ck", | 1268 | .name = "aes2_fck", |
1346 | .ops = &clkops_omap2_dflt, | 1269 | .ops = &clkops_omap2_dflt, |
1347 | .enable_reg = OMAP4430_CM_L4SEC_AES2_CLKCTRL, | 1270 | .enable_reg = OMAP4430_CM_L4SEC_AES2_CLKCTRL, |
1348 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1271 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1351,8 +1274,8 @@ static struct clk aes2_ck = { | |||
1351 | .recalc = &followparent_recalc, | 1274 | .recalc = &followparent_recalc, |
1352 | }; | 1275 | }; |
1353 | 1276 | ||
1354 | static struct clk aess_ck = { | 1277 | static struct clk aess_fck = { |
1355 | .name = "aess_ck", | 1278 | .name = "aess_fck", |
1356 | .ops = &clkops_omap2_dflt, | 1279 | .ops = &clkops_omap2_dflt, |
1357 | .enable_reg = OMAP4430_CM1_ABE_AESS_CLKCTRL, | 1280 | .enable_reg = OMAP4430_CM1_ABE_AESS_CLKCTRL, |
1358 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1281 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1361,8 +1284,8 @@ static struct clk aess_ck = { | |||
1361 | .recalc = &followparent_recalc, | 1284 | .recalc = &followparent_recalc, |
1362 | }; | 1285 | }; |
1363 | 1286 | ||
1364 | static struct clk cust_efuse_ck = { | 1287 | static struct clk cust_efuse_fck = { |
1365 | .name = "cust_efuse_ck", | 1288 | .name = "cust_efuse_fck", |
1366 | .ops = &clkops_omap2_dflt, | 1289 | .ops = &clkops_omap2_dflt, |
1367 | .enable_reg = OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL, | 1290 | .enable_reg = OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL, |
1368 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1291 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1371,8 +1294,8 @@ static struct clk cust_efuse_ck = { | |||
1371 | .recalc = &followparent_recalc, | 1294 | .recalc = &followparent_recalc, |
1372 | }; | 1295 | }; |
1373 | 1296 | ||
1374 | static struct clk des3des_ck = { | 1297 | static struct clk des3des_fck = { |
1375 | .name = "des3des_ck", | 1298 | .name = "des3des_fck", |
1376 | .ops = &clkops_omap2_dflt, | 1299 | .ops = &clkops_omap2_dflt, |
1377 | .enable_reg = OMAP4430_CM_L4SEC_DES3DES_CLKCTRL, | 1300 | .enable_reg = OMAP4430_CM_L4SEC_DES3DES_CLKCTRL, |
1378 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1301 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1397,7 +1320,6 @@ static struct clk dmic_sync_mux_ck = { | |||
1397 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, | 1320 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, |
1398 | .ops = &clkops_null, | 1321 | .ops = &clkops_null, |
1399 | .recalc = &omap2_clksel_recalc, | 1322 | .recalc = &omap2_clksel_recalc, |
1400 | .flags = CLOCK_IN_OMAP4430, | ||
1401 | }; | 1323 | }; |
1402 | 1324 | ||
1403 | static const struct clksel func_dmic_abe_gfclk_sel[] = { | 1325 | static const struct clksel func_dmic_abe_gfclk_sel[] = { |
@@ -1407,9 +1329,9 @@ static const struct clksel func_dmic_abe_gfclk_sel[] = { | |||
1407 | { .parent = NULL }, | 1329 | { .parent = NULL }, |
1408 | }; | 1330 | }; |
1409 | 1331 | ||
1410 | /* Merged func_dmic_abe_gfclk into dmic_ck */ | 1332 | /* Merged func_dmic_abe_gfclk into dmic */ |
1411 | static struct clk dmic_ck = { | 1333 | static struct clk dmic_fck = { |
1412 | .name = "dmic_ck", | 1334 | .name = "dmic_fck", |
1413 | .parent = &dmic_sync_mux_ck, | 1335 | .parent = &dmic_sync_mux_ck, |
1414 | .clksel = func_dmic_abe_gfclk_sel, | 1336 | .clksel = func_dmic_abe_gfclk_sel, |
1415 | .init = &omap2_init_clksel_parent, | 1337 | .init = &omap2_init_clksel_parent, |
@@ -1417,14 +1339,13 @@ static struct clk dmic_ck = { | |||
1417 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, | 1339 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, |
1418 | .ops = &clkops_omap2_dflt, | 1340 | .ops = &clkops_omap2_dflt, |
1419 | .recalc = &omap2_clksel_recalc, | 1341 | .recalc = &omap2_clksel_recalc, |
1420 | .flags = CLOCK_IN_OMAP4430, | ||
1421 | .enable_reg = OMAP4430_CM1_ABE_DMIC_CLKCTRL, | 1342 | .enable_reg = OMAP4430_CM1_ABE_DMIC_CLKCTRL, |
1422 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1343 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1423 | .clkdm_name = "abe_clkdm", | 1344 | .clkdm_name = "abe_clkdm", |
1424 | }; | 1345 | }; |
1425 | 1346 | ||
1426 | static struct clk dss_ck = { | 1347 | static struct clk dss_fck = { |
1427 | .name = "dss_ck", | 1348 | .name = "dss_fck", |
1428 | .ops = &clkops_omap2_dflt, | 1349 | .ops = &clkops_omap2_dflt, |
1429 | .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, | 1350 | .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, |
1430 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1351 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1433,8 +1354,8 @@ static struct clk dss_ck = { | |||
1433 | .recalc = &followparent_recalc, | 1354 | .recalc = &followparent_recalc, |
1434 | }; | 1355 | }; |
1435 | 1356 | ||
1436 | static struct clk ducati_ck = { | 1357 | static struct clk ducati_ick = { |
1437 | .name = "ducati_ck", | 1358 | .name = "ducati_ick", |
1438 | .ops = &clkops_omap2_dflt, | 1359 | .ops = &clkops_omap2_dflt, |
1439 | .enable_reg = OMAP4430_CM_DUCATI_DUCATI_CLKCTRL, | 1360 | .enable_reg = OMAP4430_CM_DUCATI_DUCATI_CLKCTRL, |
1440 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1361 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1443,8 +1364,8 @@ static struct clk ducati_ck = { | |||
1443 | .recalc = &followparent_recalc, | 1364 | .recalc = &followparent_recalc, |
1444 | }; | 1365 | }; |
1445 | 1366 | ||
1446 | static struct clk emif1_ck = { | 1367 | static struct clk emif1_ick = { |
1447 | .name = "emif1_ck", | 1368 | .name = "emif1_ick", |
1448 | .ops = &clkops_omap2_dflt, | 1369 | .ops = &clkops_omap2_dflt, |
1449 | .enable_reg = OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL, | 1370 | .enable_reg = OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL, |
1450 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1371 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1453,8 +1374,8 @@ static struct clk emif1_ck = { | |||
1453 | .recalc = &followparent_recalc, | 1374 | .recalc = &followparent_recalc, |
1454 | }; | 1375 | }; |
1455 | 1376 | ||
1456 | static struct clk emif2_ck = { | 1377 | static struct clk emif2_ick = { |
1457 | .name = "emif2_ck", | 1378 | .name = "emif2_ick", |
1458 | .ops = &clkops_omap2_dflt, | 1379 | .ops = &clkops_omap2_dflt, |
1459 | .enable_reg = OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL, | 1380 | .enable_reg = OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL, |
1460 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1381 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1468,9 +1389,9 @@ static const struct clksel fdif_fclk_div[] = { | |||
1468 | { .parent = NULL }, | 1389 | { .parent = NULL }, |
1469 | }; | 1390 | }; |
1470 | 1391 | ||
1471 | /* Merged fdif_fclk into fdif_ck */ | 1392 | /* Merged fdif_fclk into fdif */ |
1472 | static struct clk fdif_ck = { | 1393 | static struct clk fdif_fck = { |
1473 | .name = "fdif_ck", | 1394 | .name = "fdif_fck", |
1474 | .parent = &dpll_per_m4_ck, | 1395 | .parent = &dpll_per_m4_ck, |
1475 | .clksel = fdif_fclk_div, | 1396 | .clksel = fdif_fclk_div, |
1476 | .clksel_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL, | 1397 | .clksel_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL, |
@@ -1479,7 +1400,6 @@ static struct clk fdif_ck = { | |||
1479 | .recalc = &omap2_clksel_recalc, | 1400 | .recalc = &omap2_clksel_recalc, |
1480 | .round_rate = &omap2_clksel_round_rate, | 1401 | .round_rate = &omap2_clksel_round_rate, |
1481 | .set_rate = &omap2_clksel_set_rate, | 1402 | .set_rate = &omap2_clksel_set_rate, |
1482 | .flags = CLOCK_IN_OMAP4430, | ||
1483 | .enable_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL, | 1403 | .enable_reg = OMAP4430_CM_CAM_FDIF_CLKCTRL, |
1484 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1404 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1485 | .clkdm_name = "iss_clkdm", | 1405 | .clkdm_name = "iss_clkdm", |
@@ -1500,7 +1420,6 @@ static struct clk per_sgx_fclk = { | |||
1500 | .recalc = &omap2_clksel_recalc, | 1420 | .recalc = &omap2_clksel_recalc, |
1501 | .round_rate = &omap2_clksel_round_rate, | 1421 | .round_rate = &omap2_clksel_round_rate, |
1502 | .set_rate = &omap2_clksel_set_rate, | 1422 | .set_rate = &omap2_clksel_set_rate, |
1503 | .flags = CLOCK_IN_OMAP4430, | ||
1504 | }; | 1423 | }; |
1505 | 1424 | ||
1506 | static const struct clksel sgx_clk_mux_sel[] = { | 1425 | static const struct clksel sgx_clk_mux_sel[] = { |
@@ -1509,9 +1428,9 @@ static const struct clksel sgx_clk_mux_sel[] = { | |||
1509 | { .parent = NULL }, | 1428 | { .parent = NULL }, |
1510 | }; | 1429 | }; |
1511 | 1430 | ||
1512 | /* Merged sgx_clk_mux into gfx_ck */ | 1431 | /* Merged sgx_clk_mux into gfx */ |
1513 | static struct clk gfx_ck = { | 1432 | static struct clk gfx_fck = { |
1514 | .name = "gfx_ck", | 1433 | .name = "gfx_fck", |
1515 | .parent = &dpll_core_m7_ck, | 1434 | .parent = &dpll_core_m7_ck, |
1516 | .clksel = sgx_clk_mux_sel, | 1435 | .clksel = sgx_clk_mux_sel, |
1517 | .init = &omap2_init_clksel_parent, | 1436 | .init = &omap2_init_clksel_parent, |
@@ -1519,14 +1438,13 @@ static struct clk gfx_ck = { | |||
1519 | .clksel_mask = OMAP4430_CLKSEL_SGX_FCLK_MASK, | 1438 | .clksel_mask = OMAP4430_CLKSEL_SGX_FCLK_MASK, |
1520 | .ops = &clkops_omap2_dflt, | 1439 | .ops = &clkops_omap2_dflt, |
1521 | .recalc = &omap2_clksel_recalc, | 1440 | .recalc = &omap2_clksel_recalc, |
1522 | .flags = CLOCK_IN_OMAP4430, | ||
1523 | .enable_reg = OMAP4430_CM_GFX_GFX_CLKCTRL, | 1441 | .enable_reg = OMAP4430_CM_GFX_GFX_CLKCTRL, |
1524 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1442 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1525 | .clkdm_name = "l3_gfx_clkdm", | 1443 | .clkdm_name = "l3_gfx_clkdm", |
1526 | }; | 1444 | }; |
1527 | 1445 | ||
1528 | static struct clk gpio1_ck = { | 1446 | static struct clk gpio1_ick = { |
1529 | .name = "gpio1_ck", | 1447 | .name = "gpio1_ick", |
1530 | .ops = &clkops_omap2_dflt, | 1448 | .ops = &clkops_omap2_dflt, |
1531 | .enable_reg = OMAP4430_CM_WKUP_GPIO1_CLKCTRL, | 1449 | .enable_reg = OMAP4430_CM_WKUP_GPIO1_CLKCTRL, |
1532 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1450 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1535,8 +1453,8 @@ static struct clk gpio1_ck = { | |||
1535 | .recalc = &followparent_recalc, | 1453 | .recalc = &followparent_recalc, |
1536 | }; | 1454 | }; |
1537 | 1455 | ||
1538 | static struct clk gpio2_ck = { | 1456 | static struct clk gpio2_ick = { |
1539 | .name = "gpio2_ck", | 1457 | .name = "gpio2_ick", |
1540 | .ops = &clkops_omap2_dflt, | 1458 | .ops = &clkops_omap2_dflt, |
1541 | .enable_reg = OMAP4430_CM_L4PER_GPIO2_CLKCTRL, | 1459 | .enable_reg = OMAP4430_CM_L4PER_GPIO2_CLKCTRL, |
1542 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1460 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1545,8 +1463,8 @@ static struct clk gpio2_ck = { | |||
1545 | .recalc = &followparent_recalc, | 1463 | .recalc = &followparent_recalc, |
1546 | }; | 1464 | }; |
1547 | 1465 | ||
1548 | static struct clk gpio3_ck = { | 1466 | static struct clk gpio3_ick = { |
1549 | .name = "gpio3_ck", | 1467 | .name = "gpio3_ick", |
1550 | .ops = &clkops_omap2_dflt, | 1468 | .ops = &clkops_omap2_dflt, |
1551 | .enable_reg = OMAP4430_CM_L4PER_GPIO3_CLKCTRL, | 1469 | .enable_reg = OMAP4430_CM_L4PER_GPIO3_CLKCTRL, |
1552 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1470 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1555,8 +1473,8 @@ static struct clk gpio3_ck = { | |||
1555 | .recalc = &followparent_recalc, | 1473 | .recalc = &followparent_recalc, |
1556 | }; | 1474 | }; |
1557 | 1475 | ||
1558 | static struct clk gpio4_ck = { | 1476 | static struct clk gpio4_ick = { |
1559 | .name = "gpio4_ck", | 1477 | .name = "gpio4_ick", |
1560 | .ops = &clkops_omap2_dflt, | 1478 | .ops = &clkops_omap2_dflt, |
1561 | .enable_reg = OMAP4430_CM_L4PER_GPIO4_CLKCTRL, | 1479 | .enable_reg = OMAP4430_CM_L4PER_GPIO4_CLKCTRL, |
1562 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1480 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1565,8 +1483,8 @@ static struct clk gpio4_ck = { | |||
1565 | .recalc = &followparent_recalc, | 1483 | .recalc = &followparent_recalc, |
1566 | }; | 1484 | }; |
1567 | 1485 | ||
1568 | static struct clk gpio5_ck = { | 1486 | static struct clk gpio5_ick = { |
1569 | .name = "gpio5_ck", | 1487 | .name = "gpio5_ick", |
1570 | .ops = &clkops_omap2_dflt, | 1488 | .ops = &clkops_omap2_dflt, |
1571 | .enable_reg = OMAP4430_CM_L4PER_GPIO5_CLKCTRL, | 1489 | .enable_reg = OMAP4430_CM_L4PER_GPIO5_CLKCTRL, |
1572 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1490 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1575,8 +1493,8 @@ static struct clk gpio5_ck = { | |||
1575 | .recalc = &followparent_recalc, | 1493 | .recalc = &followparent_recalc, |
1576 | }; | 1494 | }; |
1577 | 1495 | ||
1578 | static struct clk gpio6_ck = { | 1496 | static struct clk gpio6_ick = { |
1579 | .name = "gpio6_ck", | 1497 | .name = "gpio6_ick", |
1580 | .ops = &clkops_omap2_dflt, | 1498 | .ops = &clkops_omap2_dflt, |
1581 | .enable_reg = OMAP4430_CM_L4PER_GPIO6_CLKCTRL, | 1499 | .enable_reg = OMAP4430_CM_L4PER_GPIO6_CLKCTRL, |
1582 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1500 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1585,8 +1503,8 @@ static struct clk gpio6_ck = { | |||
1585 | .recalc = &followparent_recalc, | 1503 | .recalc = &followparent_recalc, |
1586 | }; | 1504 | }; |
1587 | 1505 | ||
1588 | static struct clk gpmc_ck = { | 1506 | static struct clk gpmc_ick = { |
1589 | .name = "gpmc_ck", | 1507 | .name = "gpmc_ick", |
1590 | .ops = &clkops_omap2_dflt, | 1508 | .ops = &clkops_omap2_dflt, |
1591 | .enable_reg = OMAP4430_CM_L3_2_GPMC_CLKCTRL, | 1509 | .enable_reg = OMAP4430_CM_L3_2_GPMC_CLKCTRL, |
1592 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1510 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1601,9 +1519,12 @@ static const struct clksel dmt1_clk_mux_sel[] = { | |||
1601 | { .parent = NULL }, | 1519 | { .parent = NULL }, |
1602 | }; | 1520 | }; |
1603 | 1521 | ||
1604 | /* Merged dmt1_clk_mux into gptimer1_ck */ | 1522 | /* |
1605 | static struct clk gptimer1_ck = { | 1523 | * Merged dmt1_clk_mux into gptimer1 |
1606 | .name = "gptimer1_ck", | 1524 | * gptimer1 renamed temporarily into gpt1 to match OMAP3 convention |
1525 | */ | ||
1526 | static struct clk gpt1_fck = { | ||
1527 | .name = "gpt1_fck", | ||
1607 | .parent = &sys_clkin_ck, | 1528 | .parent = &sys_clkin_ck, |
1608 | .clksel = dmt1_clk_mux_sel, | 1529 | .clksel = dmt1_clk_mux_sel, |
1609 | .init = &omap2_init_clksel_parent, | 1530 | .init = &omap2_init_clksel_parent, |
@@ -1611,15 +1532,17 @@ static struct clk gptimer1_ck = { | |||
1611 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1532 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1612 | .ops = &clkops_omap2_dflt, | 1533 | .ops = &clkops_omap2_dflt, |
1613 | .recalc = &omap2_clksel_recalc, | 1534 | .recalc = &omap2_clksel_recalc, |
1614 | .flags = CLOCK_IN_OMAP4430, | ||
1615 | .enable_reg = OMAP4430_CM_WKUP_TIMER1_CLKCTRL, | 1535 | .enable_reg = OMAP4430_CM_WKUP_TIMER1_CLKCTRL, |
1616 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1536 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1617 | .clkdm_name = "l4_wkup_clkdm", | 1537 | .clkdm_name = "l4_wkup_clkdm", |
1618 | }; | 1538 | }; |
1619 | 1539 | ||
1620 | /* Merged cm2_dm10_mux into gptimer10_ck */ | 1540 | /* |
1621 | static struct clk gptimer10_ck = { | 1541 | * Merged cm2_dm10_mux into gptimer10 |
1622 | .name = "gptimer10_ck", | 1542 | * gptimer10 renamed temporarily into gpt10 to match OMAP3 convention |
1543 | */ | ||
1544 | static struct clk gpt10_fck = { | ||
1545 | .name = "gpt10_fck", | ||
1623 | .parent = &sys_clkin_ck, | 1546 | .parent = &sys_clkin_ck, |
1624 | .clksel = dmt1_clk_mux_sel, | 1547 | .clksel = dmt1_clk_mux_sel, |
1625 | .init = &omap2_init_clksel_parent, | 1548 | .init = &omap2_init_clksel_parent, |
@@ -1627,15 +1550,17 @@ static struct clk gptimer10_ck = { | |||
1627 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1550 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1628 | .ops = &clkops_omap2_dflt, | 1551 | .ops = &clkops_omap2_dflt, |
1629 | .recalc = &omap2_clksel_recalc, | 1552 | .recalc = &omap2_clksel_recalc, |
1630 | .flags = CLOCK_IN_OMAP4430, | ||
1631 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, | 1553 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL, |
1632 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1554 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1633 | .clkdm_name = "l4_per_clkdm", | 1555 | .clkdm_name = "l4_per_clkdm", |
1634 | }; | 1556 | }; |
1635 | 1557 | ||
1636 | /* Merged cm2_dm11_mux into gptimer11_ck */ | 1558 | /* |
1637 | static struct clk gptimer11_ck = { | 1559 | * Merged cm2_dm11_mux into gptimer11 |
1638 | .name = "gptimer11_ck", | 1560 | * gptimer11 renamed temporarily into gpt11 to match OMAP3 convention |
1561 | */ | ||
1562 | static struct clk gpt11_fck = { | ||
1563 | .name = "gpt11_fck", | ||
1639 | .parent = &sys_clkin_ck, | 1564 | .parent = &sys_clkin_ck, |
1640 | .clksel = dmt1_clk_mux_sel, | 1565 | .clksel = dmt1_clk_mux_sel, |
1641 | .init = &omap2_init_clksel_parent, | 1566 | .init = &omap2_init_clksel_parent, |
@@ -1643,15 +1568,17 @@ static struct clk gptimer11_ck = { | |||
1643 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1568 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1644 | .ops = &clkops_omap2_dflt, | 1569 | .ops = &clkops_omap2_dflt, |
1645 | .recalc = &omap2_clksel_recalc, | 1570 | .recalc = &omap2_clksel_recalc, |
1646 | .flags = CLOCK_IN_OMAP4430, | ||
1647 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, | 1571 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL, |
1648 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1572 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1649 | .clkdm_name = "l4_per_clkdm", | 1573 | .clkdm_name = "l4_per_clkdm", |
1650 | }; | 1574 | }; |
1651 | 1575 | ||
1652 | /* Merged cm2_dm2_mux into gptimer2_ck */ | 1576 | /* |
1653 | static struct clk gptimer2_ck = { | 1577 | * Merged cm2_dm2_mux into gptimer2 |
1654 | .name = "gptimer2_ck", | 1578 | * gptimer2 renamed temporarily into gpt2 to match OMAP3 convention |
1579 | */ | ||
1580 | static struct clk gpt2_fck = { | ||
1581 | .name = "gpt2_fck", | ||
1655 | .parent = &sys_clkin_ck, | 1582 | .parent = &sys_clkin_ck, |
1656 | .clksel = dmt1_clk_mux_sel, | 1583 | .clksel = dmt1_clk_mux_sel, |
1657 | .init = &omap2_init_clksel_parent, | 1584 | .init = &omap2_init_clksel_parent, |
@@ -1659,15 +1586,17 @@ static struct clk gptimer2_ck = { | |||
1659 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1586 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1660 | .ops = &clkops_omap2_dflt, | 1587 | .ops = &clkops_omap2_dflt, |
1661 | .recalc = &omap2_clksel_recalc, | 1588 | .recalc = &omap2_clksel_recalc, |
1662 | .flags = CLOCK_IN_OMAP4430, | ||
1663 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, | 1589 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL, |
1664 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1590 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1665 | .clkdm_name = "l4_per_clkdm", | 1591 | .clkdm_name = "l4_per_clkdm", |
1666 | }; | 1592 | }; |
1667 | 1593 | ||
1668 | /* Merged cm2_dm3_mux into gptimer3_ck */ | 1594 | /* |
1669 | static struct clk gptimer3_ck = { | 1595 | * Merged cm2_dm3_mux into gptimer3 |
1670 | .name = "gptimer3_ck", | 1596 | * gptimer3 renamed temporarily into gpt3 to match OMAP3 convention |
1597 | */ | ||
1598 | static struct clk gpt3_fck = { | ||
1599 | .name = "gpt3_fck", | ||
1671 | .parent = &sys_clkin_ck, | 1600 | .parent = &sys_clkin_ck, |
1672 | .clksel = dmt1_clk_mux_sel, | 1601 | .clksel = dmt1_clk_mux_sel, |
1673 | .init = &omap2_init_clksel_parent, | 1602 | .init = &omap2_init_clksel_parent, |
@@ -1675,15 +1604,17 @@ static struct clk gptimer3_ck = { | |||
1675 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1604 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1676 | .ops = &clkops_omap2_dflt, | 1605 | .ops = &clkops_omap2_dflt, |
1677 | .recalc = &omap2_clksel_recalc, | 1606 | .recalc = &omap2_clksel_recalc, |
1678 | .flags = CLOCK_IN_OMAP4430, | ||
1679 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL, | 1607 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL, |
1680 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1608 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1681 | .clkdm_name = "l4_per_clkdm", | 1609 | .clkdm_name = "l4_per_clkdm", |
1682 | }; | 1610 | }; |
1683 | 1611 | ||
1684 | /* Merged cm2_dm4_mux into gptimer4_ck */ | 1612 | /* |
1685 | static struct clk gptimer4_ck = { | 1613 | * Merged cm2_dm4_mux into gptimer4 |
1686 | .name = "gptimer4_ck", | 1614 | * gptimer4 renamed temporarily into gpt4 to match OMAP3 convention |
1615 | */ | ||
1616 | static struct clk gpt4_fck = { | ||
1617 | .name = "gpt4_fck", | ||
1687 | .parent = &sys_clkin_ck, | 1618 | .parent = &sys_clkin_ck, |
1688 | .clksel = dmt1_clk_mux_sel, | 1619 | .clksel = dmt1_clk_mux_sel, |
1689 | .init = &omap2_init_clksel_parent, | 1620 | .init = &omap2_init_clksel_parent, |
@@ -1691,7 +1622,6 @@ static struct clk gptimer4_ck = { | |||
1691 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1622 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1692 | .ops = &clkops_omap2_dflt, | 1623 | .ops = &clkops_omap2_dflt, |
1693 | .recalc = &omap2_clksel_recalc, | 1624 | .recalc = &omap2_clksel_recalc, |
1694 | .flags = CLOCK_IN_OMAP4430, | ||
1695 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL, | 1625 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL, |
1696 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1626 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1697 | .clkdm_name = "l4_per_clkdm", | 1627 | .clkdm_name = "l4_per_clkdm", |
@@ -1703,9 +1633,12 @@ static const struct clksel timer5_sync_mux_sel[] = { | |||
1703 | { .parent = NULL }, | 1633 | { .parent = NULL }, |
1704 | }; | 1634 | }; |
1705 | 1635 | ||
1706 | /* Merged timer5_sync_mux into gptimer5_ck */ | 1636 | /* |
1707 | static struct clk gptimer5_ck = { | 1637 | * Merged timer5_sync_mux into gptimer5 |
1708 | .name = "gptimer5_ck", | 1638 | * gptimer5 renamed temporarily into gpt5 to match OMAP3 convention |
1639 | */ | ||
1640 | static struct clk gpt5_fck = { | ||
1641 | .name = "gpt5_fck", | ||
1709 | .parent = &syc_clk_div_ck, | 1642 | .parent = &syc_clk_div_ck, |
1710 | .clksel = timer5_sync_mux_sel, | 1643 | .clksel = timer5_sync_mux_sel, |
1711 | .init = &omap2_init_clksel_parent, | 1644 | .init = &omap2_init_clksel_parent, |
@@ -1713,15 +1646,17 @@ static struct clk gptimer5_ck = { | |||
1713 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1646 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1714 | .ops = &clkops_omap2_dflt, | 1647 | .ops = &clkops_omap2_dflt, |
1715 | .recalc = &omap2_clksel_recalc, | 1648 | .recalc = &omap2_clksel_recalc, |
1716 | .flags = CLOCK_IN_OMAP4430, | ||
1717 | .enable_reg = OMAP4430_CM1_ABE_TIMER5_CLKCTRL, | 1649 | .enable_reg = OMAP4430_CM1_ABE_TIMER5_CLKCTRL, |
1718 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1650 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1719 | .clkdm_name = "abe_clkdm", | 1651 | .clkdm_name = "abe_clkdm", |
1720 | }; | 1652 | }; |
1721 | 1653 | ||
1722 | /* Merged timer6_sync_mux into gptimer6_ck */ | 1654 | /* |
1723 | static struct clk gptimer6_ck = { | 1655 | * Merged timer6_sync_mux into gptimer6 |
1724 | .name = "gptimer6_ck", | 1656 | * gptimer6 renamed temporarily into gpt6 to match OMAP3 convention |
1657 | */ | ||
1658 | static struct clk gpt6_fck = { | ||
1659 | .name = "gpt6_fck", | ||
1725 | .parent = &syc_clk_div_ck, | 1660 | .parent = &syc_clk_div_ck, |
1726 | .clksel = timer5_sync_mux_sel, | 1661 | .clksel = timer5_sync_mux_sel, |
1727 | .init = &omap2_init_clksel_parent, | 1662 | .init = &omap2_init_clksel_parent, |
@@ -1729,15 +1664,17 @@ static struct clk gptimer6_ck = { | |||
1729 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1664 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1730 | .ops = &clkops_omap2_dflt, | 1665 | .ops = &clkops_omap2_dflt, |
1731 | .recalc = &omap2_clksel_recalc, | 1666 | .recalc = &omap2_clksel_recalc, |
1732 | .flags = CLOCK_IN_OMAP4430, | ||
1733 | .enable_reg = OMAP4430_CM1_ABE_TIMER6_CLKCTRL, | 1667 | .enable_reg = OMAP4430_CM1_ABE_TIMER6_CLKCTRL, |
1734 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1668 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1735 | .clkdm_name = "abe_clkdm", | 1669 | .clkdm_name = "abe_clkdm", |
1736 | }; | 1670 | }; |
1737 | 1671 | ||
1738 | /* Merged timer7_sync_mux into gptimer7_ck */ | 1672 | /* |
1739 | static struct clk gptimer7_ck = { | 1673 | * Merged timer7_sync_mux into gptimer7 |
1740 | .name = "gptimer7_ck", | 1674 | * gptimer7 renamed temporarily into gpt7 to match OMAP3 convention |
1675 | */ | ||
1676 | static struct clk gpt7_fck = { | ||
1677 | .name = "gpt7_fck", | ||
1741 | .parent = &syc_clk_div_ck, | 1678 | .parent = &syc_clk_div_ck, |
1742 | .clksel = timer5_sync_mux_sel, | 1679 | .clksel = timer5_sync_mux_sel, |
1743 | .init = &omap2_init_clksel_parent, | 1680 | .init = &omap2_init_clksel_parent, |
@@ -1745,15 +1682,17 @@ static struct clk gptimer7_ck = { | |||
1745 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1682 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1746 | .ops = &clkops_omap2_dflt, | 1683 | .ops = &clkops_omap2_dflt, |
1747 | .recalc = &omap2_clksel_recalc, | 1684 | .recalc = &omap2_clksel_recalc, |
1748 | .flags = CLOCK_IN_OMAP4430, | ||
1749 | .enable_reg = OMAP4430_CM1_ABE_TIMER7_CLKCTRL, | 1685 | .enable_reg = OMAP4430_CM1_ABE_TIMER7_CLKCTRL, |
1750 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1686 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1751 | .clkdm_name = "abe_clkdm", | 1687 | .clkdm_name = "abe_clkdm", |
1752 | }; | 1688 | }; |
1753 | 1689 | ||
1754 | /* Merged timer8_sync_mux into gptimer8_ck */ | 1690 | /* |
1755 | static struct clk gptimer8_ck = { | 1691 | * Merged timer8_sync_mux into gptimer8 |
1756 | .name = "gptimer8_ck", | 1692 | * gptimer8 renamed temporarily into gpt8 to match OMAP3 convention |
1693 | */ | ||
1694 | static struct clk gpt8_fck = { | ||
1695 | .name = "gpt8_fck", | ||
1757 | .parent = &syc_clk_div_ck, | 1696 | .parent = &syc_clk_div_ck, |
1758 | .clksel = timer5_sync_mux_sel, | 1697 | .clksel = timer5_sync_mux_sel, |
1759 | .init = &omap2_init_clksel_parent, | 1698 | .init = &omap2_init_clksel_parent, |
@@ -1761,15 +1700,17 @@ static struct clk gptimer8_ck = { | |||
1761 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1700 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1762 | .ops = &clkops_omap2_dflt, | 1701 | .ops = &clkops_omap2_dflt, |
1763 | .recalc = &omap2_clksel_recalc, | 1702 | .recalc = &omap2_clksel_recalc, |
1764 | .flags = CLOCK_IN_OMAP4430, | ||
1765 | .enable_reg = OMAP4430_CM1_ABE_TIMER8_CLKCTRL, | 1703 | .enable_reg = OMAP4430_CM1_ABE_TIMER8_CLKCTRL, |
1766 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1704 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1767 | .clkdm_name = "abe_clkdm", | 1705 | .clkdm_name = "abe_clkdm", |
1768 | }; | 1706 | }; |
1769 | 1707 | ||
1770 | /* Merged cm2_dm9_mux into gptimer9_ck */ | 1708 | /* |
1771 | static struct clk gptimer9_ck = { | 1709 | * Merged cm2_dm9_mux into gptimer9 |
1772 | .name = "gptimer9_ck", | 1710 | * gptimer9 renamed temporarily into gpt9 to match OMAP3 convention |
1711 | */ | ||
1712 | static struct clk gpt9_fck = { | ||
1713 | .name = "gpt9_fck", | ||
1773 | .parent = &sys_clkin_ck, | 1714 | .parent = &sys_clkin_ck, |
1774 | .clksel = dmt1_clk_mux_sel, | 1715 | .clksel = dmt1_clk_mux_sel, |
1775 | .init = &omap2_init_clksel_parent, | 1716 | .init = &omap2_init_clksel_parent, |
@@ -1777,14 +1718,13 @@ static struct clk gptimer9_ck = { | |||
1777 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 1718 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
1778 | .ops = &clkops_omap2_dflt, | 1719 | .ops = &clkops_omap2_dflt, |
1779 | .recalc = &omap2_clksel_recalc, | 1720 | .recalc = &omap2_clksel_recalc, |
1780 | .flags = CLOCK_IN_OMAP4430, | ||
1781 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL, | 1721 | .enable_reg = OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL, |
1782 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1722 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1783 | .clkdm_name = "l4_per_clkdm", | 1723 | .clkdm_name = "l4_per_clkdm", |
1784 | }; | 1724 | }; |
1785 | 1725 | ||
1786 | static struct clk hdq1w_ck = { | 1726 | static struct clk hdq1w_fck = { |
1787 | .name = "hdq1w_ck", | 1727 | .name = "hdq1w_fck", |
1788 | .ops = &clkops_omap2_dflt, | 1728 | .ops = &clkops_omap2_dflt, |
1789 | .enable_reg = OMAP4430_CM_L4PER_HDQ1W_CLKCTRL, | 1729 | .enable_reg = OMAP4430_CM_L4PER_HDQ1W_CLKCTRL, |
1790 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1730 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1793,9 +1733,9 @@ static struct clk hdq1w_ck = { | |||
1793 | .recalc = &followparent_recalc, | 1733 | .recalc = &followparent_recalc, |
1794 | }; | 1734 | }; |
1795 | 1735 | ||
1796 | /* Merged hsi_fclk into hsi_ck */ | 1736 | /* Merged hsi_fclk into hsi */ |
1797 | static struct clk hsi_ck = { | 1737 | static struct clk hsi_ick = { |
1798 | .name = "hsi_ck", | 1738 | .name = "hsi_ick", |
1799 | .parent = &dpll_per_m2x2_ck, | 1739 | .parent = &dpll_per_m2x2_ck, |
1800 | .clksel = per_sgx_fclk_div, | 1740 | .clksel = per_sgx_fclk_div, |
1801 | .clksel_reg = OMAP4430_CM_L3INIT_HSI_CLKCTRL, | 1741 | .clksel_reg = OMAP4430_CM_L3INIT_HSI_CLKCTRL, |
@@ -1804,14 +1744,13 @@ static struct clk hsi_ck = { | |||
1804 | .recalc = &omap2_clksel_recalc, | 1744 | .recalc = &omap2_clksel_recalc, |
1805 | .round_rate = &omap2_clksel_round_rate, | 1745 | .round_rate = &omap2_clksel_round_rate, |
1806 | .set_rate = &omap2_clksel_set_rate, | 1746 | .set_rate = &omap2_clksel_set_rate, |
1807 | .flags = CLOCK_IN_OMAP4430, | ||
1808 | .enable_reg = OMAP4430_CM_L3INIT_HSI_CLKCTRL, | 1747 | .enable_reg = OMAP4430_CM_L3INIT_HSI_CLKCTRL, |
1809 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1748 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
1810 | .clkdm_name = "l3_init_clkdm", | 1749 | .clkdm_name = "l3_init_clkdm", |
1811 | }; | 1750 | }; |
1812 | 1751 | ||
1813 | static struct clk i2c1_ck = { | 1752 | static struct clk i2c1_fck = { |
1814 | .name = "i2c1_ck", | 1753 | .name = "i2c1_fck", |
1815 | .ops = &clkops_omap2_dflt, | 1754 | .ops = &clkops_omap2_dflt, |
1816 | .enable_reg = OMAP4430_CM_L4PER_I2C1_CLKCTRL, | 1755 | .enable_reg = OMAP4430_CM_L4PER_I2C1_CLKCTRL, |
1817 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1756 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1820,8 +1759,8 @@ static struct clk i2c1_ck = { | |||
1820 | .recalc = &followparent_recalc, | 1759 | .recalc = &followparent_recalc, |
1821 | }; | 1760 | }; |
1822 | 1761 | ||
1823 | static struct clk i2c2_ck = { | 1762 | static struct clk i2c2_fck = { |
1824 | .name = "i2c2_ck", | 1763 | .name = "i2c2_fck", |
1825 | .ops = &clkops_omap2_dflt, | 1764 | .ops = &clkops_omap2_dflt, |
1826 | .enable_reg = OMAP4430_CM_L4PER_I2C2_CLKCTRL, | 1765 | .enable_reg = OMAP4430_CM_L4PER_I2C2_CLKCTRL, |
1827 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1766 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1830,8 +1769,8 @@ static struct clk i2c2_ck = { | |||
1830 | .recalc = &followparent_recalc, | 1769 | .recalc = &followparent_recalc, |
1831 | }; | 1770 | }; |
1832 | 1771 | ||
1833 | static struct clk i2c3_ck = { | 1772 | static struct clk i2c3_fck = { |
1834 | .name = "i2c3_ck", | 1773 | .name = "i2c3_fck", |
1835 | .ops = &clkops_omap2_dflt, | 1774 | .ops = &clkops_omap2_dflt, |
1836 | .enable_reg = OMAP4430_CM_L4PER_I2C3_CLKCTRL, | 1775 | .enable_reg = OMAP4430_CM_L4PER_I2C3_CLKCTRL, |
1837 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1776 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1840,8 +1779,8 @@ static struct clk i2c3_ck = { | |||
1840 | .recalc = &followparent_recalc, | 1779 | .recalc = &followparent_recalc, |
1841 | }; | 1780 | }; |
1842 | 1781 | ||
1843 | static struct clk i2c4_ck = { | 1782 | static struct clk i2c4_fck = { |
1844 | .name = "i2c4_ck", | 1783 | .name = "i2c4_fck", |
1845 | .ops = &clkops_omap2_dflt, | 1784 | .ops = &clkops_omap2_dflt, |
1846 | .enable_reg = OMAP4430_CM_L4PER_I2C4_CLKCTRL, | 1785 | .enable_reg = OMAP4430_CM_L4PER_I2C4_CLKCTRL, |
1847 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1786 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1850,8 +1789,8 @@ static struct clk i2c4_ck = { | |||
1850 | .recalc = &followparent_recalc, | 1789 | .recalc = &followparent_recalc, |
1851 | }; | 1790 | }; |
1852 | 1791 | ||
1853 | static struct clk iss_ck = { | 1792 | static struct clk iss_fck = { |
1854 | .name = "iss_ck", | 1793 | .name = "iss_fck", |
1855 | .ops = &clkops_omap2_dflt, | 1794 | .ops = &clkops_omap2_dflt, |
1856 | .enable_reg = OMAP4430_CM_CAM_ISS_CLKCTRL, | 1795 | .enable_reg = OMAP4430_CM_CAM_ISS_CLKCTRL, |
1857 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1796 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1860,8 +1799,8 @@ static struct clk iss_ck = { | |||
1860 | .recalc = &followparent_recalc, | 1799 | .recalc = &followparent_recalc, |
1861 | }; | 1800 | }; |
1862 | 1801 | ||
1863 | static struct clk ivahd_ck = { | 1802 | static struct clk ivahd_ick = { |
1864 | .name = "ivahd_ck", | 1803 | .name = "ivahd_ick", |
1865 | .ops = &clkops_omap2_dflt, | 1804 | .ops = &clkops_omap2_dflt, |
1866 | .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL, | 1805 | .enable_reg = OMAP4430_CM_IVAHD_IVAHD_CLKCTRL, |
1867 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1806 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1870,8 +1809,8 @@ static struct clk ivahd_ck = { | |||
1870 | .recalc = &followparent_recalc, | 1809 | .recalc = &followparent_recalc, |
1871 | }; | 1810 | }; |
1872 | 1811 | ||
1873 | static struct clk keyboard_ck = { | 1812 | static struct clk keyboard_fck = { |
1874 | .name = "keyboard_ck", | 1813 | .name = "keyboard_fck", |
1875 | .ops = &clkops_omap2_dflt, | 1814 | .ops = &clkops_omap2_dflt, |
1876 | .enable_reg = OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL, | 1815 | .enable_reg = OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL, |
1877 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1816 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -1880,8 +1819,8 @@ static struct clk keyboard_ck = { | |||
1880 | .recalc = &followparent_recalc, | 1819 | .recalc = &followparent_recalc, |
1881 | }; | 1820 | }; |
1882 | 1821 | ||
1883 | static struct clk l3_instr_interconnect_ck = { | 1822 | static struct clk l3_instr_interconnect_ick = { |
1884 | .name = "l3_instr_interconnect_ck", | 1823 | .name = "l3_instr_interconnect_ick", |
1885 | .ops = &clkops_omap2_dflt, | 1824 | .ops = &clkops_omap2_dflt, |
1886 | .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL, | 1825 | .enable_reg = OMAP4430_CM_L3INSTR_L3_INSTR_CLKCTRL, |
1887 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1826 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1890,8 +1829,8 @@ static struct clk l3_instr_interconnect_ck = { | |||
1890 | .recalc = &followparent_recalc, | 1829 | .recalc = &followparent_recalc, |
1891 | }; | 1830 | }; |
1892 | 1831 | ||
1893 | static struct clk l3_interconnect_3_ck = { | 1832 | static struct clk l3_interconnect_3_ick = { |
1894 | .name = "l3_interconnect_3_ck", | 1833 | .name = "l3_interconnect_3_ick", |
1895 | .ops = &clkops_omap2_dflt, | 1834 | .ops = &clkops_omap2_dflt, |
1896 | .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL, | 1835 | .enable_reg = OMAP4430_CM_L3INSTR_L3_3_CLKCTRL, |
1897 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 1836 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -1909,7 +1848,6 @@ static struct clk mcasp_sync_mux_ck = { | |||
1909 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, | 1848 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, |
1910 | .ops = &clkops_null, | 1849 | .ops = &clkops_null, |
1911 | .recalc = &omap2_clksel_recalc, | 1850 | .recalc = &omap2_clksel_recalc, |
1912 | .flags = CLOCK_IN_OMAP4430, | ||
1913 | }; | 1851 | }; |
1914 | 1852 | ||
1915 | static const struct clksel func_mcasp_abe_gfclk_sel[] = { | 1853 | static const struct clksel func_mcasp_abe_gfclk_sel[] = { |
@@ -1919,9 +1857,9 @@ static const struct clksel func_mcasp_abe_gfclk_sel[] = { | |||
1919 | { .parent = NULL }, | 1857 | { .parent = NULL }, |
1920 | }; | 1858 | }; |
1921 | 1859 | ||
1922 | /* Merged func_mcasp_abe_gfclk into mcasp_ck */ | 1860 | /* Merged func_mcasp_abe_gfclk into mcasp */ |
1923 | static struct clk mcasp_ck = { | 1861 | static struct clk mcasp_fck = { |
1924 | .name = "mcasp_ck", | 1862 | .name = "mcasp_fck", |
1925 | .parent = &mcasp_sync_mux_ck, | 1863 | .parent = &mcasp_sync_mux_ck, |
1926 | .clksel = func_mcasp_abe_gfclk_sel, | 1864 | .clksel = func_mcasp_abe_gfclk_sel, |
1927 | .init = &omap2_init_clksel_parent, | 1865 | .init = &omap2_init_clksel_parent, |
@@ -1929,7 +1867,6 @@ static struct clk mcasp_ck = { | |||
1929 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, | 1867 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, |
1930 | .ops = &clkops_omap2_dflt, | 1868 | .ops = &clkops_omap2_dflt, |
1931 | .recalc = &omap2_clksel_recalc, | 1869 | .recalc = &omap2_clksel_recalc, |
1932 | .flags = CLOCK_IN_OMAP4430, | ||
1933 | .enable_reg = OMAP4430_CM1_ABE_MCASP_CLKCTRL, | 1870 | .enable_reg = OMAP4430_CM1_ABE_MCASP_CLKCTRL, |
1934 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1871 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1935 | .clkdm_name = "abe_clkdm", | 1872 | .clkdm_name = "abe_clkdm", |
@@ -1944,7 +1881,6 @@ static struct clk mcbsp1_sync_mux_ck = { | |||
1944 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, | 1881 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, |
1945 | .ops = &clkops_null, | 1882 | .ops = &clkops_null, |
1946 | .recalc = &omap2_clksel_recalc, | 1883 | .recalc = &omap2_clksel_recalc, |
1947 | .flags = CLOCK_IN_OMAP4430, | ||
1948 | }; | 1884 | }; |
1949 | 1885 | ||
1950 | static const struct clksel func_mcbsp1_gfclk_sel[] = { | 1886 | static const struct clksel func_mcbsp1_gfclk_sel[] = { |
@@ -1954,9 +1890,9 @@ static const struct clksel func_mcbsp1_gfclk_sel[] = { | |||
1954 | { .parent = NULL }, | 1890 | { .parent = NULL }, |
1955 | }; | 1891 | }; |
1956 | 1892 | ||
1957 | /* Merged func_mcbsp1_gfclk into mcbsp1_ck */ | 1893 | /* Merged func_mcbsp1_gfclk into mcbsp1 */ |
1958 | static struct clk mcbsp1_ck = { | 1894 | static struct clk mcbsp1_fck = { |
1959 | .name = "mcbsp1_ck", | 1895 | .name = "mcbsp1_fck", |
1960 | .parent = &mcbsp1_sync_mux_ck, | 1896 | .parent = &mcbsp1_sync_mux_ck, |
1961 | .clksel = func_mcbsp1_gfclk_sel, | 1897 | .clksel = func_mcbsp1_gfclk_sel, |
1962 | .init = &omap2_init_clksel_parent, | 1898 | .init = &omap2_init_clksel_parent, |
@@ -1964,7 +1900,6 @@ static struct clk mcbsp1_ck = { | |||
1964 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, | 1900 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, |
1965 | .ops = &clkops_omap2_dflt, | 1901 | .ops = &clkops_omap2_dflt, |
1966 | .recalc = &omap2_clksel_recalc, | 1902 | .recalc = &omap2_clksel_recalc, |
1967 | .flags = CLOCK_IN_OMAP4430, | ||
1968 | .enable_reg = OMAP4430_CM1_ABE_MCBSP1_CLKCTRL, | 1903 | .enable_reg = OMAP4430_CM1_ABE_MCBSP1_CLKCTRL, |
1969 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1904 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
1970 | .clkdm_name = "abe_clkdm", | 1905 | .clkdm_name = "abe_clkdm", |
@@ -1979,7 +1914,6 @@ static struct clk mcbsp2_sync_mux_ck = { | |||
1979 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, | 1914 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, |
1980 | .ops = &clkops_null, | 1915 | .ops = &clkops_null, |
1981 | .recalc = &omap2_clksel_recalc, | 1916 | .recalc = &omap2_clksel_recalc, |
1982 | .flags = CLOCK_IN_OMAP4430, | ||
1983 | }; | 1917 | }; |
1984 | 1918 | ||
1985 | static const struct clksel func_mcbsp2_gfclk_sel[] = { | 1919 | static const struct clksel func_mcbsp2_gfclk_sel[] = { |
@@ -1989,9 +1923,9 @@ static const struct clksel func_mcbsp2_gfclk_sel[] = { | |||
1989 | { .parent = NULL }, | 1923 | { .parent = NULL }, |
1990 | }; | 1924 | }; |
1991 | 1925 | ||
1992 | /* Merged func_mcbsp2_gfclk into mcbsp2_ck */ | 1926 | /* Merged func_mcbsp2_gfclk into mcbsp2 */ |
1993 | static struct clk mcbsp2_ck = { | 1927 | static struct clk mcbsp2_fck = { |
1994 | .name = "mcbsp2_ck", | 1928 | .name = "mcbsp2_fck", |
1995 | .parent = &mcbsp2_sync_mux_ck, | 1929 | .parent = &mcbsp2_sync_mux_ck, |
1996 | .clksel = func_mcbsp2_gfclk_sel, | 1930 | .clksel = func_mcbsp2_gfclk_sel, |
1997 | .init = &omap2_init_clksel_parent, | 1931 | .init = &omap2_init_clksel_parent, |
@@ -1999,7 +1933,6 @@ static struct clk mcbsp2_ck = { | |||
1999 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, | 1933 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, |
2000 | .ops = &clkops_omap2_dflt, | 1934 | .ops = &clkops_omap2_dflt, |
2001 | .recalc = &omap2_clksel_recalc, | 1935 | .recalc = &omap2_clksel_recalc, |
2002 | .flags = CLOCK_IN_OMAP4430, | ||
2003 | .enable_reg = OMAP4430_CM1_ABE_MCBSP2_CLKCTRL, | 1936 | .enable_reg = OMAP4430_CM1_ABE_MCBSP2_CLKCTRL, |
2004 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1937 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
2005 | .clkdm_name = "abe_clkdm", | 1938 | .clkdm_name = "abe_clkdm", |
@@ -2014,7 +1947,6 @@ static struct clk mcbsp3_sync_mux_ck = { | |||
2014 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, | 1947 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, |
2015 | .ops = &clkops_null, | 1948 | .ops = &clkops_null, |
2016 | .recalc = &omap2_clksel_recalc, | 1949 | .recalc = &omap2_clksel_recalc, |
2017 | .flags = CLOCK_IN_OMAP4430, | ||
2018 | }; | 1950 | }; |
2019 | 1951 | ||
2020 | static const struct clksel func_mcbsp3_gfclk_sel[] = { | 1952 | static const struct clksel func_mcbsp3_gfclk_sel[] = { |
@@ -2024,9 +1956,9 @@ static const struct clksel func_mcbsp3_gfclk_sel[] = { | |||
2024 | { .parent = NULL }, | 1956 | { .parent = NULL }, |
2025 | }; | 1957 | }; |
2026 | 1958 | ||
2027 | /* Merged func_mcbsp3_gfclk into mcbsp3_ck */ | 1959 | /* Merged func_mcbsp3_gfclk into mcbsp3 */ |
2028 | static struct clk mcbsp3_ck = { | 1960 | static struct clk mcbsp3_fck = { |
2029 | .name = "mcbsp3_ck", | 1961 | .name = "mcbsp3_fck", |
2030 | .parent = &mcbsp3_sync_mux_ck, | 1962 | .parent = &mcbsp3_sync_mux_ck, |
2031 | .clksel = func_mcbsp3_gfclk_sel, | 1963 | .clksel = func_mcbsp3_gfclk_sel, |
2032 | .init = &omap2_init_clksel_parent, | 1964 | .init = &omap2_init_clksel_parent, |
@@ -2034,7 +1966,6 @@ static struct clk mcbsp3_ck = { | |||
2034 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, | 1966 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_MASK, |
2035 | .ops = &clkops_omap2_dflt, | 1967 | .ops = &clkops_omap2_dflt, |
2036 | .recalc = &omap2_clksel_recalc, | 1968 | .recalc = &omap2_clksel_recalc, |
2037 | .flags = CLOCK_IN_OMAP4430, | ||
2038 | .enable_reg = OMAP4430_CM1_ABE_MCBSP3_CLKCTRL, | 1969 | .enable_reg = OMAP4430_CM1_ABE_MCBSP3_CLKCTRL, |
2039 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 1970 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
2040 | .clkdm_name = "abe_clkdm", | 1971 | .clkdm_name = "abe_clkdm", |
@@ -2049,7 +1980,6 @@ static struct clk mcbsp4_sync_mux_ck = { | |||
2049 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, | 1980 | .clksel_mask = OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK, |
2050 | .ops = &clkops_null, | 1981 | .ops = &clkops_null, |
2051 | .recalc = &omap2_clksel_recalc, | 1982 | .recalc = &omap2_clksel_recalc, |
2052 | .flags = CLOCK_IN_OMAP4430, | ||
2053 | }; | 1983 | }; |
2054 | 1984 | ||
2055 | static const struct clksel per_mcbsp4_gfclk_sel[] = { | 1985 | static const struct clksel per_mcbsp4_gfclk_sel[] = { |
@@ -2058,9 +1988,9 @@ static const struct clksel per_mcbsp4_gfclk_sel[] = { | |||
2058 | { .parent = NULL }, | 1988 | { .parent = NULL }, |
2059 | }; | 1989 | }; |
2060 | 1990 | ||
2061 | /* Merged per_mcbsp4_gfclk into mcbsp4_ck */ | 1991 | /* Merged per_mcbsp4_gfclk into mcbsp4 */ |
2062 | static struct clk mcbsp4_ck = { | 1992 | static struct clk mcbsp4_fck = { |
2063 | .name = "mcbsp4_ck", | 1993 | .name = "mcbsp4_fck", |
2064 | .parent = &mcbsp4_sync_mux_ck, | 1994 | .parent = &mcbsp4_sync_mux_ck, |
2065 | .clksel = per_mcbsp4_gfclk_sel, | 1995 | .clksel = per_mcbsp4_gfclk_sel, |
2066 | .init = &omap2_init_clksel_parent, | 1996 | .init = &omap2_init_clksel_parent, |
@@ -2068,14 +1998,13 @@ static struct clk mcbsp4_ck = { | |||
2068 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_24_24_MASK, | 1998 | .clksel_mask = OMAP4430_CLKSEL_SOURCE_24_24_MASK, |
2069 | .ops = &clkops_omap2_dflt, | 1999 | .ops = &clkops_omap2_dflt, |
2070 | .recalc = &omap2_clksel_recalc, | 2000 | .recalc = &omap2_clksel_recalc, |
2071 | .flags = CLOCK_IN_OMAP4430, | ||
2072 | .enable_reg = OMAP4430_CM_L4PER_MCBSP4_CLKCTRL, | 2001 | .enable_reg = OMAP4430_CM_L4PER_MCBSP4_CLKCTRL, |
2073 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2002 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
2074 | .clkdm_name = "l4_per_clkdm", | 2003 | .clkdm_name = "l4_per_clkdm", |
2075 | }; | 2004 | }; |
2076 | 2005 | ||
2077 | static struct clk mcspi1_ck = { | 2006 | static struct clk mcspi1_fck = { |
2078 | .name = "mcspi1_ck", | 2007 | .name = "mcspi1_fck", |
2079 | .ops = &clkops_omap2_dflt, | 2008 | .ops = &clkops_omap2_dflt, |
2080 | .enable_reg = OMAP4430_CM_L4PER_MCSPI1_CLKCTRL, | 2009 | .enable_reg = OMAP4430_CM_L4PER_MCSPI1_CLKCTRL, |
2081 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2010 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2084,8 +2013,8 @@ static struct clk mcspi1_ck = { | |||
2084 | .recalc = &followparent_recalc, | 2013 | .recalc = &followparent_recalc, |
2085 | }; | 2014 | }; |
2086 | 2015 | ||
2087 | static struct clk mcspi2_ck = { | 2016 | static struct clk mcspi2_fck = { |
2088 | .name = "mcspi2_ck", | 2017 | .name = "mcspi2_fck", |
2089 | .ops = &clkops_omap2_dflt, | 2018 | .ops = &clkops_omap2_dflt, |
2090 | .enable_reg = OMAP4430_CM_L4PER_MCSPI2_CLKCTRL, | 2019 | .enable_reg = OMAP4430_CM_L4PER_MCSPI2_CLKCTRL, |
2091 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2020 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2094,8 +2023,8 @@ static struct clk mcspi2_ck = { | |||
2094 | .recalc = &followparent_recalc, | 2023 | .recalc = &followparent_recalc, |
2095 | }; | 2024 | }; |
2096 | 2025 | ||
2097 | static struct clk mcspi3_ck = { | 2026 | static struct clk mcspi3_fck = { |
2098 | .name = "mcspi3_ck", | 2027 | .name = "mcspi3_fck", |
2099 | .ops = &clkops_omap2_dflt, | 2028 | .ops = &clkops_omap2_dflt, |
2100 | .enable_reg = OMAP4430_CM_L4PER_MCSPI3_CLKCTRL, | 2029 | .enable_reg = OMAP4430_CM_L4PER_MCSPI3_CLKCTRL, |
2101 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2030 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2104,8 +2033,8 @@ static struct clk mcspi3_ck = { | |||
2104 | .recalc = &followparent_recalc, | 2033 | .recalc = &followparent_recalc, |
2105 | }; | 2034 | }; |
2106 | 2035 | ||
2107 | static struct clk mcspi4_ck = { | 2036 | static struct clk mcspi4_fck = { |
2108 | .name = "mcspi4_ck", | 2037 | .name = "mcspi4_fck", |
2109 | .ops = &clkops_omap2_dflt, | 2038 | .ops = &clkops_omap2_dflt, |
2110 | .enable_reg = OMAP4430_CM_L4PER_MCSPI4_CLKCTRL, | 2039 | .enable_reg = OMAP4430_CM_L4PER_MCSPI4_CLKCTRL, |
2111 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2040 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2114,9 +2043,9 @@ static struct clk mcspi4_ck = { | |||
2114 | .recalc = &followparent_recalc, | 2043 | .recalc = &followparent_recalc, |
2115 | }; | 2044 | }; |
2116 | 2045 | ||
2117 | /* Merged hsmmc1_fclk into mmc1_ck */ | 2046 | /* Merged hsmmc1_fclk into mmc1 */ |
2118 | static struct clk mmc1_ck = { | 2047 | static struct clk mmc1_fck = { |
2119 | .name = "mmc1_ck", | 2048 | .name = "mmc1_fck", |
2120 | .parent = &func_64m_fclk, | 2049 | .parent = &func_64m_fclk, |
2121 | .clksel = hsmmc6_fclk_sel, | 2050 | .clksel = hsmmc6_fclk_sel, |
2122 | .init = &omap2_init_clksel_parent, | 2051 | .init = &omap2_init_clksel_parent, |
@@ -2124,15 +2053,14 @@ static struct clk mmc1_ck = { | |||
2124 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 2053 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
2125 | .ops = &clkops_omap2_dflt, | 2054 | .ops = &clkops_omap2_dflt, |
2126 | .recalc = &omap2_clksel_recalc, | 2055 | .recalc = &omap2_clksel_recalc, |
2127 | .flags = CLOCK_IN_OMAP4430, | ||
2128 | .enable_reg = OMAP4430_CM_L3INIT_MMC1_CLKCTRL, | 2056 | .enable_reg = OMAP4430_CM_L3INIT_MMC1_CLKCTRL, |
2129 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2057 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
2130 | .clkdm_name = "l3_init_clkdm", | 2058 | .clkdm_name = "l3_init_clkdm", |
2131 | }; | 2059 | }; |
2132 | 2060 | ||
2133 | /* Merged hsmmc2_fclk into mmc2_ck */ | 2061 | /* Merged hsmmc2_fclk into mmc2 */ |
2134 | static struct clk mmc2_ck = { | 2062 | static struct clk mmc2_fck = { |
2135 | .name = "mmc2_ck", | 2063 | .name = "mmc2_fck", |
2136 | .parent = &func_64m_fclk, | 2064 | .parent = &func_64m_fclk, |
2137 | .clksel = hsmmc6_fclk_sel, | 2065 | .clksel = hsmmc6_fclk_sel, |
2138 | .init = &omap2_init_clksel_parent, | 2066 | .init = &omap2_init_clksel_parent, |
@@ -2140,14 +2068,13 @@ static struct clk mmc2_ck = { | |||
2140 | .clksel_mask = OMAP4430_CLKSEL_MASK, | 2068 | .clksel_mask = OMAP4430_CLKSEL_MASK, |
2141 | .ops = &clkops_omap2_dflt, | 2069 | .ops = &clkops_omap2_dflt, |
2142 | .recalc = &omap2_clksel_recalc, | 2070 | .recalc = &omap2_clksel_recalc, |
2143 | .flags = CLOCK_IN_OMAP4430, | ||
2144 | .enable_reg = OMAP4430_CM_L3INIT_MMC2_CLKCTRL, | 2071 | .enable_reg = OMAP4430_CM_L3INIT_MMC2_CLKCTRL, |
2145 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2072 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
2146 | .clkdm_name = "l3_init_clkdm", | 2073 | .clkdm_name = "l3_init_clkdm", |
2147 | }; | 2074 | }; |
2148 | 2075 | ||
2149 | static struct clk mmc3_ck = { | 2076 | static struct clk mmc3_fck = { |
2150 | .name = "mmc3_ck", | 2077 | .name = "mmc3_fck", |
2151 | .ops = &clkops_omap2_dflt, | 2078 | .ops = &clkops_omap2_dflt, |
2152 | .enable_reg = OMAP4430_CM_L4PER_MMCSD3_CLKCTRL, | 2079 | .enable_reg = OMAP4430_CM_L4PER_MMCSD3_CLKCTRL, |
2153 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2080 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2156,8 +2083,8 @@ static struct clk mmc3_ck = { | |||
2156 | .recalc = &followparent_recalc, | 2083 | .recalc = &followparent_recalc, |
2157 | }; | 2084 | }; |
2158 | 2085 | ||
2159 | static struct clk mmc4_ck = { | 2086 | static struct clk mmc4_fck = { |
2160 | .name = "mmc4_ck", | 2087 | .name = "mmc4_fck", |
2161 | .ops = &clkops_omap2_dflt, | 2088 | .ops = &clkops_omap2_dflt, |
2162 | .enable_reg = OMAP4430_CM_L4PER_MMCSD4_CLKCTRL, | 2089 | .enable_reg = OMAP4430_CM_L4PER_MMCSD4_CLKCTRL, |
2163 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2090 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2166,8 +2093,8 @@ static struct clk mmc4_ck = { | |||
2166 | .recalc = &followparent_recalc, | 2093 | .recalc = &followparent_recalc, |
2167 | }; | 2094 | }; |
2168 | 2095 | ||
2169 | static struct clk mmc5_ck = { | 2096 | static struct clk mmc5_fck = { |
2170 | .name = "mmc5_ck", | 2097 | .name = "mmc5_fck", |
2171 | .ops = &clkops_omap2_dflt, | 2098 | .ops = &clkops_omap2_dflt, |
2172 | .enable_reg = OMAP4430_CM_L4PER_MMCSD5_CLKCTRL, | 2099 | .enable_reg = OMAP4430_CM_L4PER_MMCSD5_CLKCTRL, |
2173 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2100 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2176,8 +2103,8 @@ static struct clk mmc5_ck = { | |||
2176 | .recalc = &followparent_recalc, | 2103 | .recalc = &followparent_recalc, |
2177 | }; | 2104 | }; |
2178 | 2105 | ||
2179 | static struct clk ocp_wp1_ck = { | 2106 | static struct clk ocp_wp1_ick = { |
2180 | .name = "ocp_wp1_ck", | 2107 | .name = "ocp_wp1_ick", |
2181 | .ops = &clkops_omap2_dflt, | 2108 | .ops = &clkops_omap2_dflt, |
2182 | .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL, | 2109 | .enable_reg = OMAP4430_CM_L3INSTR_OCP_WP1_CLKCTRL, |
2183 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 2110 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -2186,8 +2113,8 @@ static struct clk ocp_wp1_ck = { | |||
2186 | .recalc = &followparent_recalc, | 2113 | .recalc = &followparent_recalc, |
2187 | }; | 2114 | }; |
2188 | 2115 | ||
2189 | static struct clk pdm_ck = { | 2116 | static struct clk pdm_fck = { |
2190 | .name = "pdm_ck", | 2117 | .name = "pdm_fck", |
2191 | .ops = &clkops_omap2_dflt, | 2118 | .ops = &clkops_omap2_dflt, |
2192 | .enable_reg = OMAP4430_CM1_ABE_PDM_CLKCTRL, | 2119 | .enable_reg = OMAP4430_CM1_ABE_PDM_CLKCTRL, |
2193 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2120 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2196,8 +2123,8 @@ static struct clk pdm_ck = { | |||
2196 | .recalc = &followparent_recalc, | 2123 | .recalc = &followparent_recalc, |
2197 | }; | 2124 | }; |
2198 | 2125 | ||
2199 | static struct clk pkaeip29_ck = { | 2126 | static struct clk pkaeip29_fck = { |
2200 | .name = "pkaeip29_ck", | 2127 | .name = "pkaeip29_fck", |
2201 | .ops = &clkops_omap2_dflt, | 2128 | .ops = &clkops_omap2_dflt, |
2202 | .enable_reg = OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL, | 2129 | .enable_reg = OMAP4430_CM_L4SEC_PKAEIP29_CLKCTRL, |
2203 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2130 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2206,8 +2133,8 @@ static struct clk pkaeip29_ck = { | |||
2206 | .recalc = &followparent_recalc, | 2133 | .recalc = &followparent_recalc, |
2207 | }; | 2134 | }; |
2208 | 2135 | ||
2209 | static struct clk rng_ck = { | 2136 | static struct clk rng_ick = { |
2210 | .name = "rng_ck", | 2137 | .name = "rng_ick", |
2211 | .ops = &clkops_omap2_dflt, | 2138 | .ops = &clkops_omap2_dflt, |
2212 | .enable_reg = OMAP4430_CM_L4SEC_RNG_CLKCTRL, | 2139 | .enable_reg = OMAP4430_CM_L4SEC_RNG_CLKCTRL, |
2213 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 2140 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -2216,8 +2143,8 @@ static struct clk rng_ck = { | |||
2216 | .recalc = &followparent_recalc, | 2143 | .recalc = &followparent_recalc, |
2217 | }; | 2144 | }; |
2218 | 2145 | ||
2219 | static struct clk sha2md51_ck = { | 2146 | static struct clk sha2md51_fck = { |
2220 | .name = "sha2md51_ck", | 2147 | .name = "sha2md51_fck", |
2221 | .ops = &clkops_omap2_dflt, | 2148 | .ops = &clkops_omap2_dflt, |
2222 | .enable_reg = OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL, | 2149 | .enable_reg = OMAP4430_CM_L4SEC_SHA2MD51_CLKCTRL, |
2223 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2150 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2226,8 +2153,8 @@ static struct clk sha2md51_ck = { | |||
2226 | .recalc = &followparent_recalc, | 2153 | .recalc = &followparent_recalc, |
2227 | }; | 2154 | }; |
2228 | 2155 | ||
2229 | static struct clk sl2_ck = { | 2156 | static struct clk sl2_ick = { |
2230 | .name = "sl2_ck", | 2157 | .name = "sl2_ick", |
2231 | .ops = &clkops_omap2_dflt, | 2158 | .ops = &clkops_omap2_dflt, |
2232 | .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL, | 2159 | .enable_reg = OMAP4430_CM_IVAHD_SL2_CLKCTRL, |
2233 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 2160 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -2236,8 +2163,8 @@ static struct clk sl2_ck = { | |||
2236 | .recalc = &followparent_recalc, | 2163 | .recalc = &followparent_recalc, |
2237 | }; | 2164 | }; |
2238 | 2165 | ||
2239 | static struct clk slimbus1_ck = { | 2166 | static struct clk slimbus1_fck = { |
2240 | .name = "slimbus1_ck", | 2167 | .name = "slimbus1_fck", |
2241 | .ops = &clkops_omap2_dflt, | 2168 | .ops = &clkops_omap2_dflt, |
2242 | .enable_reg = OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL, | 2169 | .enable_reg = OMAP4430_CM1_ABE_SLIMBUS_CLKCTRL, |
2243 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2170 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2246,8 +2173,8 @@ static struct clk slimbus1_ck = { | |||
2246 | .recalc = &followparent_recalc, | 2173 | .recalc = &followparent_recalc, |
2247 | }; | 2174 | }; |
2248 | 2175 | ||
2249 | static struct clk slimbus2_ck = { | 2176 | static struct clk slimbus2_fck = { |
2250 | .name = "slimbus2_ck", | 2177 | .name = "slimbus2_fck", |
2251 | .ops = &clkops_omap2_dflt, | 2178 | .ops = &clkops_omap2_dflt, |
2252 | .enable_reg = OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL, | 2179 | .enable_reg = OMAP4430_CM_L4PER_SLIMBUS2_CLKCTRL, |
2253 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2180 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2256,8 +2183,8 @@ static struct clk slimbus2_ck = { | |||
2256 | .recalc = &followparent_recalc, | 2183 | .recalc = &followparent_recalc, |
2257 | }; | 2184 | }; |
2258 | 2185 | ||
2259 | static struct clk sr_core_ck = { | 2186 | static struct clk sr_core_fck = { |
2260 | .name = "sr_core_ck", | 2187 | .name = "sr_core_fck", |
2261 | .ops = &clkops_omap2_dflt, | 2188 | .ops = &clkops_omap2_dflt, |
2262 | .enable_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL, | 2189 | .enable_reg = OMAP4430_CM_ALWON_SR_CORE_CLKCTRL, |
2263 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2190 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2266,8 +2193,8 @@ static struct clk sr_core_ck = { | |||
2266 | .recalc = &followparent_recalc, | 2193 | .recalc = &followparent_recalc, |
2267 | }; | 2194 | }; |
2268 | 2195 | ||
2269 | static struct clk sr_iva_ck = { | 2196 | static struct clk sr_iva_fck = { |
2270 | .name = "sr_iva_ck", | 2197 | .name = "sr_iva_fck", |
2271 | .ops = &clkops_omap2_dflt, | 2198 | .ops = &clkops_omap2_dflt, |
2272 | .enable_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL, | 2199 | .enable_reg = OMAP4430_CM_ALWON_SR_IVA_CLKCTRL, |
2273 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2200 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2276,8 +2203,8 @@ static struct clk sr_iva_ck = { | |||
2276 | .recalc = &followparent_recalc, | 2203 | .recalc = &followparent_recalc, |
2277 | }; | 2204 | }; |
2278 | 2205 | ||
2279 | static struct clk sr_mpu_ck = { | 2206 | static struct clk sr_mpu_fck = { |
2280 | .name = "sr_mpu_ck", | 2207 | .name = "sr_mpu_fck", |
2281 | .ops = &clkops_omap2_dflt, | 2208 | .ops = &clkops_omap2_dflt, |
2282 | .enable_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL, | 2209 | .enable_reg = OMAP4430_CM_ALWON_SR_MPU_CLKCTRL, |
2283 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2210 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2286,8 +2213,8 @@ static struct clk sr_mpu_ck = { | |||
2286 | .recalc = &followparent_recalc, | 2213 | .recalc = &followparent_recalc, |
2287 | }; | 2214 | }; |
2288 | 2215 | ||
2289 | static struct clk tesla_ck = { | 2216 | static struct clk tesla_ick = { |
2290 | .name = "tesla_ck", | 2217 | .name = "tesla_ick", |
2291 | .ops = &clkops_omap2_dflt, | 2218 | .ops = &clkops_omap2_dflt, |
2292 | .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, | 2219 | .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, |
2293 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 2220 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -2296,8 +2223,8 @@ static struct clk tesla_ck = { | |||
2296 | .recalc = &followparent_recalc, | 2223 | .recalc = &followparent_recalc, |
2297 | }; | 2224 | }; |
2298 | 2225 | ||
2299 | static struct clk uart1_ck = { | 2226 | static struct clk uart1_fck = { |
2300 | .name = "uart1_ck", | 2227 | .name = "uart1_fck", |
2301 | .ops = &clkops_omap2_dflt, | 2228 | .ops = &clkops_omap2_dflt, |
2302 | .enable_reg = OMAP4430_CM_L4PER_UART1_CLKCTRL, | 2229 | .enable_reg = OMAP4430_CM_L4PER_UART1_CLKCTRL, |
2303 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2230 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2306,8 +2233,8 @@ static struct clk uart1_ck = { | |||
2306 | .recalc = &followparent_recalc, | 2233 | .recalc = &followparent_recalc, |
2307 | }; | 2234 | }; |
2308 | 2235 | ||
2309 | static struct clk uart2_ck = { | 2236 | static struct clk uart2_fck = { |
2310 | .name = "uart2_ck", | 2237 | .name = "uart2_fck", |
2311 | .ops = &clkops_omap2_dflt, | 2238 | .ops = &clkops_omap2_dflt, |
2312 | .enable_reg = OMAP4430_CM_L4PER_UART2_CLKCTRL, | 2239 | .enable_reg = OMAP4430_CM_L4PER_UART2_CLKCTRL, |
2313 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2240 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2316,8 +2243,8 @@ static struct clk uart2_ck = { | |||
2316 | .recalc = &followparent_recalc, | 2243 | .recalc = &followparent_recalc, |
2317 | }; | 2244 | }; |
2318 | 2245 | ||
2319 | static struct clk uart3_ck = { | 2246 | static struct clk uart3_fck = { |
2320 | .name = "uart3_ck", | 2247 | .name = "uart3_fck", |
2321 | .ops = &clkops_omap2_dflt, | 2248 | .ops = &clkops_omap2_dflt, |
2322 | .enable_reg = OMAP4430_CM_L4PER_UART3_CLKCTRL, | 2249 | .enable_reg = OMAP4430_CM_L4PER_UART3_CLKCTRL, |
2323 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2250 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2326,8 +2253,8 @@ static struct clk uart3_ck = { | |||
2326 | .recalc = &followparent_recalc, | 2253 | .recalc = &followparent_recalc, |
2327 | }; | 2254 | }; |
2328 | 2255 | ||
2329 | static struct clk uart4_ck = { | 2256 | static struct clk uart4_fck = { |
2330 | .name = "uart4_ck", | 2257 | .name = "uart4_fck", |
2331 | .ops = &clkops_omap2_dflt, | 2258 | .ops = &clkops_omap2_dflt, |
2332 | .enable_reg = OMAP4430_CM_L4PER_UART4_CLKCTRL, | 2259 | .enable_reg = OMAP4430_CM_L4PER_UART4_CLKCTRL, |
2333 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2260 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2336,8 +2263,8 @@ static struct clk uart4_ck = { | |||
2336 | .recalc = &followparent_recalc, | 2263 | .recalc = &followparent_recalc, |
2337 | }; | 2264 | }; |
2338 | 2265 | ||
2339 | static struct clk unipro1_ck = { | 2266 | static struct clk unipro1_fck = { |
2340 | .name = "unipro1_ck", | 2267 | .name = "unipro1_fck", |
2341 | .ops = &clkops_omap2_dflt, | 2268 | .ops = &clkops_omap2_dflt, |
2342 | .enable_reg = OMAP4430_CM_L3INIT_UNIPRO1_CLKCTRL, | 2269 | .enable_reg = OMAP4430_CM_L3INIT_UNIPRO1_CLKCTRL, |
2343 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2270 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2346,8 +2273,8 @@ static struct clk unipro1_ck = { | |||
2346 | .recalc = &followparent_recalc, | 2273 | .recalc = &followparent_recalc, |
2347 | }; | 2274 | }; |
2348 | 2275 | ||
2349 | static struct clk usb_host_ck = { | 2276 | static struct clk usb_host_fck = { |
2350 | .name = "usb_host_ck", | 2277 | .name = "usb_host_fck", |
2351 | .ops = &clkops_omap2_dflt, | 2278 | .ops = &clkops_omap2_dflt, |
2352 | .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL, | 2279 | .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_CLKCTRL, |
2353 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2280 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2356,8 +2283,8 @@ static struct clk usb_host_ck = { | |||
2356 | .recalc = &followparent_recalc, | 2283 | .recalc = &followparent_recalc, |
2357 | }; | 2284 | }; |
2358 | 2285 | ||
2359 | static struct clk usb_host_fs_ck = { | 2286 | static struct clk usb_host_fs_fck = { |
2360 | .name = "usb_host_fs_ck", | 2287 | .name = "usb_host_fs_fck", |
2361 | .ops = &clkops_omap2_dflt, | 2288 | .ops = &clkops_omap2_dflt, |
2362 | .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL, | 2289 | .enable_reg = OMAP4430_CM_L3INIT_USB_HOST_FS_CLKCTRL, |
2363 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2290 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2366,8 +2293,8 @@ static struct clk usb_host_fs_ck = { | |||
2366 | .recalc = &followparent_recalc, | 2293 | .recalc = &followparent_recalc, |
2367 | }; | 2294 | }; |
2368 | 2295 | ||
2369 | static struct clk usb_otg_ck = { | 2296 | static struct clk usb_otg_ick = { |
2370 | .name = "usb_otg_ck", | 2297 | .name = "usb_otg_ick", |
2371 | .ops = &clkops_omap2_dflt, | 2298 | .ops = &clkops_omap2_dflt, |
2372 | .enable_reg = OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL, | 2299 | .enable_reg = OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL, |
2373 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 2300 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -2376,8 +2303,8 @@ static struct clk usb_otg_ck = { | |||
2376 | .recalc = &followparent_recalc, | 2303 | .recalc = &followparent_recalc, |
2377 | }; | 2304 | }; |
2378 | 2305 | ||
2379 | static struct clk usb_tll_ck = { | 2306 | static struct clk usb_tll_ick = { |
2380 | .name = "usb_tll_ck", | 2307 | .name = "usb_tll_ick", |
2381 | .ops = &clkops_omap2_dflt, | 2308 | .ops = &clkops_omap2_dflt, |
2382 | .enable_reg = OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL, | 2309 | .enable_reg = OMAP4430_CM_L3INIT_USB_TLL_CLKCTRL, |
2383 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 2310 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -2386,8 +2313,8 @@ static struct clk usb_tll_ck = { | |||
2386 | .recalc = &followparent_recalc, | 2313 | .recalc = &followparent_recalc, |
2387 | }; | 2314 | }; |
2388 | 2315 | ||
2389 | static struct clk usbphyocp2scp_ck = { | 2316 | static struct clk usbphyocp2scp_ick = { |
2390 | .name = "usbphyocp2scp_ck", | 2317 | .name = "usbphyocp2scp_ick", |
2391 | .ops = &clkops_omap2_dflt, | 2318 | .ops = &clkops_omap2_dflt, |
2392 | .enable_reg = OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, | 2319 | .enable_reg = OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, |
2393 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, | 2320 | .enable_bit = OMAP4430_MODULEMODE_HWCTRL, |
@@ -2396,8 +2323,8 @@ static struct clk usbphyocp2scp_ck = { | |||
2396 | .recalc = &followparent_recalc, | 2323 | .recalc = &followparent_recalc, |
2397 | }; | 2324 | }; |
2398 | 2325 | ||
2399 | static struct clk usim_ck = { | 2326 | static struct clk usim_fck = { |
2400 | .name = "usim_ck", | 2327 | .name = "usim_fck", |
2401 | .ops = &clkops_omap2_dflt, | 2328 | .ops = &clkops_omap2_dflt, |
2402 | .enable_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, | 2329 | .enable_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, |
2403 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2330 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2406,8 +2333,8 @@ static struct clk usim_ck = { | |||
2406 | .recalc = &followparent_recalc, | 2333 | .recalc = &followparent_recalc, |
2407 | }; | 2334 | }; |
2408 | 2335 | ||
2409 | static struct clk wdt2_ck = { | 2336 | static struct clk wdt2_fck = { |
2410 | .name = "wdt2_ck", | 2337 | .name = "wdt2_fck", |
2411 | .ops = &clkops_omap2_dflt, | 2338 | .ops = &clkops_omap2_dflt, |
2412 | .enable_reg = OMAP4430_CM_WKUP_WDT2_CLKCTRL, | 2339 | .enable_reg = OMAP4430_CM_WKUP_WDT2_CLKCTRL, |
2413 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2340 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2416,8 +2343,8 @@ static struct clk wdt2_ck = { | |||
2416 | .recalc = &followparent_recalc, | 2343 | .recalc = &followparent_recalc, |
2417 | }; | 2344 | }; |
2418 | 2345 | ||
2419 | static struct clk wdt3_ck = { | 2346 | static struct clk wdt3_fck = { |
2420 | .name = "wdt3_ck", | 2347 | .name = "wdt3_fck", |
2421 | .ops = &clkops_omap2_dflt, | 2348 | .ops = &clkops_omap2_dflt, |
2422 | .enable_reg = OMAP4430_CM1_ABE_WDT3_CLKCTRL, | 2349 | .enable_reg = OMAP4430_CM1_ABE_WDT3_CLKCTRL, |
2423 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, | 2350 | .enable_bit = OMAP4430_MODULEMODE_SWCTRL, |
@@ -2442,7 +2369,6 @@ static struct clk otg_60m_gfclk_ck = { | |||
2442 | .clksel_mask = OMAP4430_CLKSEL_60M_MASK, | 2369 | .clksel_mask = OMAP4430_CLKSEL_60M_MASK, |
2443 | .ops = &clkops_null, | 2370 | .ops = &clkops_null, |
2444 | .recalc = &omap2_clksel_recalc, | 2371 | .recalc = &omap2_clksel_recalc, |
2445 | .flags = CLOCK_IN_OMAP4430, | ||
2446 | }; | 2372 | }; |
2447 | 2373 | ||
2448 | static const struct clksel stm_clk_div_div[] = { | 2374 | static const struct clksel stm_clk_div_div[] = { |
@@ -2460,7 +2386,6 @@ static struct clk stm_clk_div_ck = { | |||
2460 | .recalc = &omap2_clksel_recalc, | 2386 | .recalc = &omap2_clksel_recalc, |
2461 | .round_rate = &omap2_clksel_round_rate, | 2387 | .round_rate = &omap2_clksel_round_rate, |
2462 | .set_rate = &omap2_clksel_set_rate, | 2388 | .set_rate = &omap2_clksel_set_rate, |
2463 | .flags = CLOCK_IN_OMAP4430, | ||
2464 | }; | 2389 | }; |
2465 | 2390 | ||
2466 | static const struct clksel trace_clk_div_div[] = { | 2391 | static const struct clksel trace_clk_div_div[] = { |
@@ -2478,7 +2403,6 @@ static struct clk trace_clk_div_ck = { | |||
2478 | .recalc = &omap2_clksel_recalc, | 2403 | .recalc = &omap2_clksel_recalc, |
2479 | .round_rate = &omap2_clksel_round_rate, | 2404 | .round_rate = &omap2_clksel_round_rate, |
2480 | .set_rate = &omap2_clksel_set_rate, | 2405 | .set_rate = &omap2_clksel_set_rate, |
2481 | .flags = CLOCK_IN_OMAP4430, | ||
2482 | }; | 2406 | }; |
2483 | 2407 | ||
2484 | static const struct clksel_rate div2_14to18_rates[] = { | 2408 | static const struct clksel_rate div2_14to18_rates[] = { |
@@ -2502,7 +2426,6 @@ static struct clk usim_fclk = { | |||
2502 | .recalc = &omap2_clksel_recalc, | 2426 | .recalc = &omap2_clksel_recalc, |
2503 | .round_rate = &omap2_clksel_round_rate, | 2427 | .round_rate = &omap2_clksel_round_rate, |
2504 | .set_rate = &omap2_clksel_set_rate, | 2428 | .set_rate = &omap2_clksel_set_rate, |
2505 | .flags = CLOCK_IN_OMAP4430, | ||
2506 | }; | 2429 | }; |
2507 | 2430 | ||
2508 | static const struct clksel utmi_p1_gfclk_sel[] = { | 2431 | static const struct clksel utmi_p1_gfclk_sel[] = { |
@@ -2520,7 +2443,6 @@ static struct clk utmi_p1_gfclk_ck = { | |||
2520 | .clksel_mask = OMAP4430_CLKSEL_UTMI_P1_MASK, | 2443 | .clksel_mask = OMAP4430_CLKSEL_UTMI_P1_MASK, |
2521 | .ops = &clkops_null, | 2444 | .ops = &clkops_null, |
2522 | .recalc = &omap2_clksel_recalc, | 2445 | .recalc = &omap2_clksel_recalc, |
2523 | .flags = CLOCK_IN_OMAP4430, | ||
2524 | }; | 2446 | }; |
2525 | 2447 | ||
2526 | static const struct clksel utmi_p2_gfclk_sel[] = { | 2448 | static const struct clksel utmi_p2_gfclk_sel[] = { |
@@ -2538,7 +2460,6 @@ static struct clk utmi_p2_gfclk_ck = { | |||
2538 | .clksel_mask = OMAP4430_CLKSEL_UTMI_P2_MASK, | 2460 | .clksel_mask = OMAP4430_CLKSEL_UTMI_P2_MASK, |
2539 | .ops = &clkops_null, | 2461 | .ops = &clkops_null, |
2540 | .recalc = &omap2_clksel_recalc, | 2462 | .recalc = &omap2_clksel_recalc, |
2541 | .flags = CLOCK_IN_OMAP4430, | ||
2542 | }; | 2463 | }; |
2543 | 2464 | ||
2544 | /* | 2465 | /* |
@@ -2631,106 +2552,139 @@ static struct omap_clk omap44xx_clks[] = { | |||
2631 | CLK(NULL, "pmd_stm_clock_mux_ck", &pmd_stm_clock_mux_ck, CK_443X), | 2552 | CLK(NULL, "pmd_stm_clock_mux_ck", &pmd_stm_clock_mux_ck, CK_443X), |
2632 | CLK(NULL, "pmd_trace_clk_mux_ck", &pmd_trace_clk_mux_ck, CK_443X), | 2553 | CLK(NULL, "pmd_trace_clk_mux_ck", &pmd_trace_clk_mux_ck, CK_443X), |
2633 | CLK(NULL, "syc_clk_div_ck", &syc_clk_div_ck, CK_443X), | 2554 | CLK(NULL, "syc_clk_div_ck", &syc_clk_div_ck, CK_443X), |
2634 | CLK(NULL, "aes1_ck", &aes1_ck, CK_443X), | 2555 | CLK(NULL, "aes1_fck", &aes1_fck, CK_443X), |
2635 | CLK(NULL, "aes2_ck", &aes2_ck, CK_443X), | 2556 | CLK(NULL, "aes2_fck", &aes2_fck, CK_443X), |
2636 | CLK(NULL, "aess_ck", &aess_ck, CK_443X), | 2557 | CLK(NULL, "aess_fck", &aess_fck, CK_443X), |
2637 | CLK(NULL, "cust_efuse_ck", &cust_efuse_ck, CK_443X), | 2558 | CLK(NULL, "cust_efuse_fck", &cust_efuse_fck, CK_443X), |
2638 | CLK(NULL, "des3des_ck", &des3des_ck, CK_443X), | 2559 | CLK(NULL, "des3des_fck", &des3des_fck, CK_443X), |
2639 | CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X), | 2560 | CLK(NULL, "dmic_sync_mux_ck", &dmic_sync_mux_ck, CK_443X), |
2640 | CLK(NULL, "dmic_ck", &dmic_ck, CK_443X), | 2561 | CLK(NULL, "dmic_fck", &dmic_fck, CK_443X), |
2641 | CLK(NULL, "dss_ck", &dss_ck, CK_443X), | 2562 | CLK(NULL, "dss_fck", &dss_fck, CK_443X), |
2642 | CLK(NULL, "ducati_ck", &ducati_ck, CK_443X), | 2563 | CLK(NULL, "ducati_ick", &ducati_ick, CK_443X), |
2643 | CLK(NULL, "emif1_ck", &emif1_ck, CK_443X), | 2564 | CLK(NULL, "emif1_ick", &emif1_ick, CK_443X), |
2644 | CLK(NULL, "emif2_ck", &emif2_ck, CK_443X), | 2565 | CLK(NULL, "emif2_ick", &emif2_ick, CK_443X), |
2645 | CLK(NULL, "fdif_ck", &fdif_ck, CK_443X), | 2566 | CLK(NULL, "fdif_fck", &fdif_fck, CK_443X), |
2646 | CLK(NULL, "per_sgx_fclk", &per_sgx_fclk, CK_443X), | 2567 | CLK(NULL, "per_sgx_fclk", &per_sgx_fclk, CK_443X), |
2647 | CLK(NULL, "gfx_ck", &gfx_ck, CK_443X), | 2568 | CLK(NULL, "gfx_fck", &gfx_fck, CK_443X), |
2648 | CLK(NULL, "gpio1_ck", &gpio1_ck, CK_443X), | 2569 | CLK(NULL, "gpio1_ick", &gpio1_ick, CK_443X), |
2649 | CLK(NULL, "gpio2_ck", &gpio2_ck, CK_443X), | 2570 | CLK(NULL, "gpio2_ick", &gpio2_ick, CK_443X), |
2650 | CLK(NULL, "gpio3_ck", &gpio3_ck, CK_443X), | 2571 | CLK(NULL, "gpio3_ick", &gpio3_ick, CK_443X), |
2651 | CLK(NULL, "gpio4_ck", &gpio4_ck, CK_443X), | 2572 | CLK(NULL, "gpio4_ick", &gpio4_ick, CK_443X), |
2652 | CLK(NULL, "gpio5_ck", &gpio5_ck, CK_443X), | 2573 | CLK(NULL, "gpio5_ick", &gpio5_ick, CK_443X), |
2653 | CLK(NULL, "gpio6_ck", &gpio6_ck, CK_443X), | 2574 | CLK(NULL, "gpio6_ick", &gpio6_ick, CK_443X), |
2654 | CLK(NULL, "gpmc_ck", &gpmc_ck, CK_443X), | 2575 | CLK(NULL, "gpmc_ick", &gpmc_ick, CK_443X), |
2655 | CLK(NULL, "gptimer1_ck", &gptimer1_ck, CK_443X), | 2576 | CLK(NULL, "gpt1_fck", &gpt1_fck, CK_443X), |
2656 | CLK(NULL, "gptimer10_ck", &gptimer10_ck, CK_443X), | 2577 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_443X), |
2657 | CLK(NULL, "gptimer11_ck", &gptimer11_ck, CK_443X), | 2578 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_443X), |
2658 | CLK(NULL, "gptimer2_ck", &gptimer2_ck, CK_443X), | 2579 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_443X), |
2659 | CLK(NULL, "gptimer3_ck", &gptimer3_ck, CK_443X), | 2580 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_443X), |
2660 | CLK(NULL, "gptimer4_ck", &gptimer4_ck, CK_443X), | 2581 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_443X), |
2661 | CLK(NULL, "gptimer5_ck", &gptimer5_ck, CK_443X), | 2582 | CLK(NULL, "gpt5_fck", &gpt5_fck, CK_443X), |
2662 | CLK(NULL, "gptimer6_ck", &gptimer6_ck, CK_443X), | 2583 | CLK(NULL, "gpt6_fck", &gpt6_fck, CK_443X), |
2663 | CLK(NULL, "gptimer7_ck", &gptimer7_ck, CK_443X), | 2584 | CLK(NULL, "gpt7_fck", &gpt7_fck, CK_443X), |
2664 | CLK(NULL, "gptimer8_ck", &gptimer8_ck, CK_443X), | 2585 | CLK(NULL, "gpt8_fck", &gpt8_fck, CK_443X), |
2665 | CLK(NULL, "gptimer9_ck", &gptimer9_ck, CK_443X), | 2586 | CLK(NULL, "gpt9_fck", &gpt9_fck, CK_443X), |
2666 | CLK("omap2_hdq.0", "ick", &hdq1w_ck, CK_443X), | 2587 | CLK("omap2_hdq.0", "fck", &hdq1w_fck, CK_443X), |
2667 | CLK(NULL, "hsi_ck", &hsi_ck, CK_443X), | 2588 | CLK(NULL, "hsi_ick", &hsi_ick, CK_443X), |
2668 | CLK("i2c_omap.1", "ick", &i2c1_ck, CK_443X), | 2589 | CLK("i2c_omap.1", "fck", &i2c1_fck, CK_443X), |
2669 | CLK("i2c_omap.2", "ick", &i2c2_ck, CK_443X), | 2590 | CLK("i2c_omap.2", "fck", &i2c2_fck, CK_443X), |
2670 | CLK("i2c_omap.3", "ick", &i2c3_ck, CK_443X), | 2591 | CLK("i2c_omap.3", "fck", &i2c3_fck, CK_443X), |
2671 | CLK("i2c_omap.4", "ick", &i2c4_ck, CK_443X), | 2592 | CLK("i2c_omap.4", "fck", &i2c4_fck, CK_443X), |
2672 | CLK(NULL, "iss_ck", &iss_ck, CK_443X), | 2593 | CLK(NULL, "iss_fck", &iss_fck, CK_443X), |
2673 | CLK(NULL, "ivahd_ck", &ivahd_ck, CK_443X), | 2594 | CLK(NULL, "ivahd_ick", &ivahd_ick, CK_443X), |
2674 | CLK(NULL, "keyboard_ck", &keyboard_ck, CK_443X), | 2595 | CLK(NULL, "keyboard_fck", &keyboard_fck, CK_443X), |
2675 | CLK(NULL, "l3_instr_interconnect_ck", &l3_instr_interconnect_ck, CK_443X), | 2596 | CLK(NULL, "l3_instr_interconnect_ick", &l3_instr_interconnect_ick, CK_443X), |
2676 | CLK(NULL, "l3_interconnect_3_ck", &l3_interconnect_3_ck, CK_443X), | 2597 | CLK(NULL, "l3_interconnect_3_ick", &l3_interconnect_3_ick, CK_443X), |
2677 | CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X), | 2598 | CLK(NULL, "mcasp_sync_mux_ck", &mcasp_sync_mux_ck, CK_443X), |
2678 | CLK(NULL, "mcasp_ck", &mcasp_ck, CK_443X), | 2599 | CLK(NULL, "mcasp_fck", &mcasp_fck, CK_443X), |
2679 | CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X), | 2600 | CLK(NULL, "mcbsp1_sync_mux_ck", &mcbsp1_sync_mux_ck, CK_443X), |
2680 | CLK("omap-mcbsp.1", "fck", &mcbsp1_ck, CK_443X), | 2601 | CLK("omap-mcbsp.1", "fck", &mcbsp1_fck, CK_443X), |
2681 | CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X), | 2602 | CLK(NULL, "mcbsp2_sync_mux_ck", &mcbsp2_sync_mux_ck, CK_443X), |
2682 | CLK("omap-mcbsp.2", "fck", &mcbsp2_ck, CK_443X), | 2603 | CLK("omap-mcbsp.2", "fck", &mcbsp2_fck, CK_443X), |
2683 | CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X), | 2604 | CLK(NULL, "mcbsp3_sync_mux_ck", &mcbsp3_sync_mux_ck, CK_443X), |
2684 | CLK("omap-mcbsp.3", "fck", &mcbsp3_ck, CK_443X), | 2605 | CLK("omap-mcbsp.3", "fck", &mcbsp3_fck, CK_443X), |
2685 | CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X), | 2606 | CLK(NULL, "mcbsp4_sync_mux_ck", &mcbsp4_sync_mux_ck, CK_443X), |
2686 | CLK("omap-mcbsp.4", "fck", &mcbsp4_ck, CK_443X), | 2607 | CLK("omap-mcbsp.4", "fck", &mcbsp4_fck, CK_443X), |
2687 | CLK("omap2_mcspi.1", "fck", &mcspi1_ck, CK_443X), | 2608 | CLK("omap2_mcspi.1", "fck", &mcspi1_fck, CK_443X), |
2688 | CLK("omap2_mcspi.2", "fck", &mcspi2_ck, CK_443X), | 2609 | CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), |
2689 | CLK("omap2_mcspi.3", "fck", &mcspi3_ck, CK_443X), | 2610 | CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), |
2690 | CLK("omap2_mcspi.4", "fck", &mcspi4_ck, CK_443X), | 2611 | CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), |
2691 | CLK("mmci-omap-hs.0", "fck", &mmc1_ck, CK_443X), | 2612 | CLK("mmci-omap-hs.0", "fck", &mmc1_fck, CK_443X), |
2692 | CLK("mmci-omap-hs.1", "fck", &mmc2_ck, CK_443X), | 2613 | CLK("mmci-omap-hs.1", "fck", &mmc2_fck, CK_443X), |
2693 | CLK("mmci-omap-hs.2", "fck", &mmc3_ck, CK_443X), | 2614 | CLK("mmci-omap-hs.2", "fck", &mmc3_fck, CK_443X), |
2694 | CLK("mmci-omap-hs.3", "fck", &mmc4_ck, CK_443X), | 2615 | CLK("mmci-omap-hs.3", "fck", &mmc4_fck, CK_443X), |
2695 | CLK("mmci-omap-hs.4", "fck", &mmc5_ck, CK_443X), | 2616 | CLK("mmci-omap-hs.4", "fck", &mmc5_fck, CK_443X), |
2696 | CLK(NULL, "ocp_wp1_ck", &ocp_wp1_ck, CK_443X), | 2617 | CLK(NULL, "ocp_wp1_ick", &ocp_wp1_ick, CK_443X), |
2697 | CLK(NULL, "pdm_ck", &pdm_ck, CK_443X), | 2618 | CLK(NULL, "pdm_fck", &pdm_fck, CK_443X), |
2698 | CLK(NULL, "pkaeip29_ck", &pkaeip29_ck, CK_443X), | 2619 | CLK(NULL, "pkaeip29_fck", &pkaeip29_fck, CK_443X), |
2699 | CLK("omap_rng", "ick", &rng_ck, CK_443X), | 2620 | CLK("omap_rng", "ick", &rng_ick, CK_443X), |
2700 | CLK(NULL, "sha2md51_ck", &sha2md51_ck, CK_443X), | 2621 | CLK(NULL, "sha2md51_fck", &sha2md51_fck, CK_443X), |
2701 | CLK(NULL, "sl2_ck", &sl2_ck, CK_443X), | 2622 | CLK(NULL, "sl2_ick", &sl2_ick, CK_443X), |
2702 | CLK(NULL, "slimbus1_ck", &slimbus1_ck, CK_443X), | 2623 | CLK(NULL, "slimbus1_fck", &slimbus1_fck, CK_443X), |
2703 | CLK(NULL, "slimbus2_ck", &slimbus2_ck, CK_443X), | 2624 | CLK(NULL, "slimbus2_fck", &slimbus2_fck, CK_443X), |
2704 | CLK(NULL, "sr_core_ck", &sr_core_ck, CK_443X), | 2625 | CLK(NULL, "sr_core_fck", &sr_core_fck, CK_443X), |
2705 | CLK(NULL, "sr_iva_ck", &sr_iva_ck, CK_443X), | 2626 | CLK(NULL, "sr_iva_fck", &sr_iva_fck, CK_443X), |
2706 | CLK(NULL, "sr_mpu_ck", &sr_mpu_ck, CK_443X), | 2627 | CLK(NULL, "sr_mpu_fck", &sr_mpu_fck, CK_443X), |
2707 | CLK(NULL, "tesla_ck", &tesla_ck, CK_443X), | 2628 | CLK(NULL, "tesla_ick", &tesla_ick, CK_443X), |
2708 | CLK(NULL, "uart1_ck", &uart1_ck, CK_443X), | 2629 | CLK(NULL, "uart1_fck", &uart1_fck, CK_443X), |
2709 | CLK(NULL, "uart2_ck", &uart2_ck, CK_443X), | 2630 | CLK(NULL, "uart2_fck", &uart2_fck, CK_443X), |
2710 | CLK(NULL, "uart3_ck", &uart3_ck, CK_443X), | 2631 | CLK(NULL, "uart3_fck", &uart3_fck, CK_443X), |
2711 | CLK(NULL, "uart4_ck", &uart4_ck, CK_443X), | 2632 | CLK(NULL, "uart4_fck", &uart4_fck, CK_443X), |
2712 | CLK(NULL, "unipro1_ck", &unipro1_ck, CK_443X), | 2633 | CLK(NULL, "unipro1_fck", &unipro1_fck, CK_443X), |
2713 | CLK(NULL, "usb_host_ck", &usb_host_ck, CK_443X), | 2634 | CLK(NULL, "usb_host_fck", &usb_host_fck, CK_443X), |
2714 | CLK(NULL, "usb_host_fs_ck", &usb_host_fs_ck, CK_443X), | 2635 | CLK(NULL, "usb_host_fs_fck", &usb_host_fs_fck, CK_443X), |
2715 | CLK("musb_hdrc", "ick", &usb_otg_ck, CK_443X), | 2636 | CLK("musb_hdrc", "ick", &usb_otg_ick, CK_443X), |
2716 | CLK(NULL, "usb_tll_ck", &usb_tll_ck, CK_443X), | 2637 | CLK(NULL, "usb_tll_ick", &usb_tll_ick, CK_443X), |
2717 | CLK(NULL, "usbphyocp2scp_ck", &usbphyocp2scp_ck, CK_443X), | 2638 | CLK(NULL, "usbphyocp2scp_ick", &usbphyocp2scp_ick, CK_443X), |
2718 | CLK(NULL, "usim_ck", &usim_ck, CK_443X), | 2639 | CLK(NULL, "usim_fck", &usim_fck, CK_443X), |
2719 | CLK("omap_wdt", "fck", &wdt2_ck, CK_443X), | 2640 | CLK("omap_wdt", "fck", &wdt2_fck, CK_443X), |
2720 | CLK(NULL, "wdt3_ck", &wdt3_ck, CK_443X), | 2641 | CLK(NULL, "wdt3_fck", &wdt3_fck, CK_443X), |
2721 | CLK(NULL, "otg_60m_gfclk_ck", &otg_60m_gfclk_ck, CK_443X), | 2642 | CLK(NULL, "otg_60m_gfclk_ck", &otg_60m_gfclk_ck, CK_443X), |
2722 | CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X), | 2643 | CLK(NULL, "stm_clk_div_ck", &stm_clk_div_ck, CK_443X), |
2723 | CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X), | 2644 | CLK(NULL, "trace_clk_div_ck", &trace_clk_div_ck, CK_443X), |
2724 | CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), | 2645 | CLK(NULL, "usim_fclk", &usim_fclk, CK_443X), |
2725 | CLK(NULL, "utmi_p1_gfclk_ck", &utmi_p1_gfclk_ck, CK_443X), | 2646 | CLK(NULL, "utmi_p1_gfclk_ck", &utmi_p1_gfclk_ck, CK_443X), |
2726 | CLK(NULL, "utmi_p2_gfclk_ck", &utmi_p2_gfclk_ck, CK_443X), | 2647 | CLK(NULL, "utmi_p2_gfclk_ck", &utmi_p2_gfclk_ck, CK_443X), |
2727 | }; | 2648 | CLK(NULL, "gpio1_dbck", &dummy_ck, CK_443X), |
2728 | 2649 | CLK(NULL, "gpio2_dbck", &dummy_ck, CK_443X), | |
2729 | int __init omap2_clk_init(void) | 2650 | CLK(NULL, "gpio3_dbck", &dummy_ck, CK_443X), |
2651 | CLK(NULL, "gpio4_dbck", &dummy_ck, CK_443X), | ||
2652 | CLK(NULL, "gpio5_dbck", &dummy_ck, CK_443X), | ||
2653 | CLK(NULL, "gpio6_dbck", &dummy_ck, CK_443X), | ||
2654 | CLK(NULL, "gpmc_ck", &dummy_ck, CK_443X), | ||
2655 | CLK(NULL, "gpt1_ick", &dummy_ck, CK_443X), | ||
2656 | CLK(NULL, "gpt2_ick", &dummy_ck, CK_443X), | ||
2657 | CLK(NULL, "gpt3_ick", &dummy_ck, CK_443X), | ||
2658 | CLK(NULL, "gpt4_ick", &dummy_ck, CK_443X), | ||
2659 | CLK(NULL, "gpt5_ick", &dummy_ck, CK_443X), | ||
2660 | CLK(NULL, "gpt6_ick", &dummy_ck, CK_443X), | ||
2661 | CLK(NULL, "gpt7_ick", &dummy_ck, CK_443X), | ||
2662 | CLK(NULL, "gpt8_ick", &dummy_ck, CK_443X), | ||
2663 | CLK(NULL, "gpt9_ick", &dummy_ck, CK_443X), | ||
2664 | CLK(NULL, "gpt10_ick", &dummy_ck, CK_443X), | ||
2665 | CLK(NULL, "gpt11_ick", &dummy_ck, CK_443X), | ||
2666 | CLK("i2c_omap.1", "ick", &dummy_ck, CK_443X), | ||
2667 | CLK("i2c_omap.2", "ick", &dummy_ck, CK_443X), | ||
2668 | CLK("i2c_omap.3", "ick", &dummy_ck, CK_443X), | ||
2669 | CLK("i2c_omap.4", "ick", &dummy_ck, CK_443X), | ||
2670 | CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X), | ||
2671 | CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X), | ||
2672 | CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X), | ||
2673 | CLK("omap-mcbsp.4", "ick", &dummy_ck, CK_443X), | ||
2674 | CLK("omap-mcspi.1", "ick", &dummy_ck, CK_443X), | ||
2675 | CLK("omap-mcspi.2", "ick", &dummy_ck, CK_443X), | ||
2676 | CLK("omap-mcspi.3", "ick", &dummy_ck, CK_443X), | ||
2677 | CLK("omap-mcspi.4", "ick", &dummy_ck, CK_443X), | ||
2678 | CLK(NULL, "uart1_ick", &dummy_ck, CK_443X), | ||
2679 | CLK(NULL, "uart2_ick", &dummy_ck, CK_443X), | ||
2680 | CLK(NULL, "uart3_ick", &dummy_ck, CK_443X), | ||
2681 | CLK(NULL, "uart4_ick", &dummy_ck, CK_443X), | ||
2682 | CLK("omap_wdt", "ick", &dummy_ck, CK_443X), | ||
2683 | }; | ||
2684 | |||
2685 | int __init omap4xxx_clk_init(void) | ||
2730 | { | 2686 | { |
2731 | /* struct prcm_config *prcm; */ | ||
2732 | struct omap_clk *c; | 2687 | struct omap_clk *c; |
2733 | /* u32 clkrate; */ | ||
2734 | u32 cpu_clkflg; | 2688 | u32 cpu_clkflg; |
2735 | 2689 | ||
2736 | if (cpu_is_omap44xx()) { | 2690 | if (cpu_is_omap44xx()) { |
@@ -2749,9 +2703,7 @@ int __init omap2_clk_init(void) | |||
2749 | if (c->cpu & cpu_clkflg) { | 2703 | if (c->cpu & cpu_clkflg) { |
2750 | clkdev_add(&c->lk); | 2704 | clkdev_add(&c->lk); |
2751 | clk_register(c->lk.clk); | 2705 | clk_register(c->lk.clk); |
2752 | /* TODO | ||
2753 | omap2_init_clk_clkdm(c->lk.clk); | 2706 | omap2_init_clk_clkdm(c->lk.clk); |
2754 | */ | ||
2755 | } | 2707 | } |
2756 | 2708 | ||
2757 | recalculate_root_clocks(); | 2709 | recalculate_root_clocks(); |
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 1a45ed1e8ba1..b87ad66f083e 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -1,10 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2/3 clockdomain framework functions | 2 | * OMAP2/3/4 clockdomain framework functions |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2008-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2008-2009 Nokia Corporation | 5 | * Copyright (C) 2008-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley and Jouni Högander | 7 | * Written by Paul Walmsley and Jouni Högander |
8 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> | ||
8 | * | 9 | * |
9 | * This program is free software; you can redistribute it and/or modify | 10 | * 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 | * it under the terms of the GNU General Public License version 2 as |
@@ -26,43 +27,124 @@ | |||
26 | 27 | ||
27 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
28 | 29 | ||
29 | #include <plat/clock.h> | ||
30 | |||
31 | #include "prm.h" | 30 | #include "prm.h" |
32 | #include "prm-regbits-24xx.h" | 31 | #include "prm-regbits-24xx.h" |
33 | #include "cm.h" | 32 | #include "cm.h" |
34 | 33 | ||
34 | #include <plat/clock.h> | ||
35 | #include <plat/powerdomain.h> | 35 | #include <plat/powerdomain.h> |
36 | #include <plat/clockdomain.h> | 36 | #include <plat/clockdomain.h> |
37 | #include <plat/prcm.h> | ||
37 | 38 | ||
38 | /* clkdm_list contains all registered struct clockdomains */ | 39 | /* clkdm_list contains all registered struct clockdomains */ |
39 | static LIST_HEAD(clkdm_list); | 40 | static LIST_HEAD(clkdm_list); |
40 | 41 | ||
41 | /* clkdm_mutex protects clkdm_list add and del ops */ | 42 | /* array of clockdomain deps to be added/removed when clkdm in hwsup mode */ |
42 | static DEFINE_MUTEX(clkdm_mutex); | 43 | static struct clkdm_autodep *autodeps; |
43 | |||
44 | /* array of powerdomain deps to be added/removed when clkdm in hwsup mode */ | ||
45 | static struct clkdm_pwrdm_autodep *autodeps; | ||
46 | 44 | ||
47 | 45 | ||
48 | /* Private functions */ | 46 | /* Private functions */ |
49 | 47 | ||
48 | static struct clockdomain *_clkdm_lookup(const char *name) | ||
49 | { | ||
50 | struct clockdomain *clkdm, *temp_clkdm; | ||
51 | |||
52 | if (!name) | ||
53 | return NULL; | ||
54 | |||
55 | clkdm = NULL; | ||
56 | |||
57 | list_for_each_entry(temp_clkdm, &clkdm_list, node) { | ||
58 | if (!strcmp(name, temp_clkdm->name)) { | ||
59 | clkdm = temp_clkdm; | ||
60 | break; | ||
61 | } | ||
62 | } | ||
63 | |||
64 | return clkdm; | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * _clkdm_register - register a clockdomain | ||
69 | * @clkdm: struct clockdomain * to register | ||
70 | * | ||
71 | * Adds a clockdomain to the internal clockdomain list. | ||
72 | * Returns -EINVAL if given a null pointer, -EEXIST if a clockdomain is | ||
73 | * already registered by the provided name, or 0 upon success. | ||
74 | */ | ||
75 | static int _clkdm_register(struct clockdomain *clkdm) | ||
76 | { | ||
77 | struct powerdomain *pwrdm; | ||
78 | |||
79 | if (!clkdm || !clkdm->name) | ||
80 | return -EINVAL; | ||
81 | |||
82 | if (!omap_chip_is(clkdm->omap_chip)) | ||
83 | return -EINVAL; | ||
84 | |||
85 | pwrdm = pwrdm_lookup(clkdm->pwrdm.name); | ||
86 | if (!pwrdm) { | ||
87 | pr_err("clockdomain: %s: powerdomain %s does not exist\n", | ||
88 | clkdm->name, clkdm->pwrdm.name); | ||
89 | return -EINVAL; | ||
90 | } | ||
91 | clkdm->pwrdm.ptr = pwrdm; | ||
92 | |||
93 | /* Verify that the clockdomain is not already registered */ | ||
94 | if (_clkdm_lookup(clkdm->name)) | ||
95 | return -EEXIST; | ||
96 | |||
97 | list_add(&clkdm->node, &clkdm_list); | ||
98 | |||
99 | pwrdm_add_clkdm(pwrdm, clkdm); | ||
100 | |||
101 | pr_debug("clockdomain: registered %s\n", clkdm->name); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | /* _clkdm_deps_lookup - look up the specified clockdomain in a clkdm list */ | ||
107 | static struct clkdm_dep *_clkdm_deps_lookup(struct clockdomain *clkdm, | ||
108 | struct clkdm_dep *deps) | ||
109 | { | ||
110 | struct clkdm_dep *cd; | ||
111 | |||
112 | if (!clkdm || !deps || !omap_chip_is(clkdm->omap_chip)) | ||
113 | return ERR_PTR(-EINVAL); | ||
114 | |||
115 | for (cd = deps; cd->clkdm_name; cd++) { | ||
116 | if (!omap_chip_is(cd->omap_chip)) | ||
117 | continue; | ||
118 | |||
119 | if (!cd->clkdm && cd->clkdm_name) | ||
120 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); | ||
121 | |||
122 | if (cd->clkdm == clkdm) | ||
123 | break; | ||
124 | } | ||
125 | |||
126 | if (!cd->clkdm_name) | ||
127 | return ERR_PTR(-ENOENT); | ||
128 | |||
129 | return cd; | ||
130 | } | ||
131 | |||
50 | /* | 132 | /* |
51 | * _autodep_lookup - resolve autodep pwrdm names to pwrdm pointers; store | 133 | * _autodep_lookup - resolve autodep clkdm names to clkdm pointers; store |
52 | * @autodep: struct clkdm_pwrdm_autodep * to resolve | 134 | * @autodep: struct clkdm_autodep * to resolve |
53 | * | 135 | * |
54 | * Resolve autodep powerdomain names to powerdomain pointers via | 136 | * Resolve autodep clockdomain names to clockdomain pointers via |
55 | * pwrdm_lookup() and store the pointers in the autodep structure. An | 137 | * clkdm_lookup() and store the pointers in the autodep structure. An |
56 | * "autodep" is a powerdomain sleep/wakeup dependency that is | 138 | * "autodep" is a clockdomain sleep/wakeup dependency that is |
57 | * automatically added and removed whenever clocks in the associated | 139 | * automatically added and removed whenever clocks in the associated |
58 | * clockdomain are enabled or disabled (respectively) when the | 140 | * clockdomain are enabled or disabled (respectively) when the |
59 | * clockdomain is in hardware-supervised mode. Meant to be called | 141 | * clockdomain is in hardware-supervised mode. Meant to be called |
60 | * once at clockdomain layer initialization, since these should remain | 142 | * once at clockdomain layer initialization, since these should remain |
61 | * fixed for a particular architecture. No return value. | 143 | * fixed for a particular architecture. No return value. |
62 | */ | 144 | */ |
63 | static void _autodep_lookup(struct clkdm_pwrdm_autodep *autodep) | 145 | static void _autodep_lookup(struct clkdm_autodep *autodep) |
64 | { | 146 | { |
65 | struct powerdomain *pwrdm; | 147 | struct clockdomain *clkdm; |
66 | 148 | ||
67 | if (!autodep) | 149 | if (!autodep) |
68 | return; | 150 | return; |
@@ -70,13 +152,13 @@ static void _autodep_lookup(struct clkdm_pwrdm_autodep *autodep) | |||
70 | if (!omap_chip_is(autodep->omap_chip)) | 152 | if (!omap_chip_is(autodep->omap_chip)) |
71 | return; | 153 | return; |
72 | 154 | ||
73 | pwrdm = pwrdm_lookup(autodep->pwrdm.name); | 155 | clkdm = clkdm_lookup(autodep->clkdm.name); |
74 | if (!pwrdm) { | 156 | if (!clkdm) { |
75 | pr_err("clockdomain: autodeps: powerdomain %s does not exist\n", | 157 | pr_err("clockdomain: autodeps: clockdomain %s does not exist\n", |
76 | autodep->pwrdm.name); | 158 | autodep->clkdm.name); |
77 | pwrdm = ERR_PTR(-ENOENT); | 159 | clkdm = ERR_PTR(-ENOENT); |
78 | } | 160 | } |
79 | autodep->pwrdm.ptr = pwrdm; | 161 | autodep->clkdm.ptr = clkdm; |
80 | } | 162 | } |
81 | 163 | ||
82 | /* | 164 | /* |
@@ -89,21 +171,24 @@ static void _autodep_lookup(struct clkdm_pwrdm_autodep *autodep) | |||
89 | */ | 171 | */ |
90 | static void _clkdm_add_autodeps(struct clockdomain *clkdm) | 172 | static void _clkdm_add_autodeps(struct clockdomain *clkdm) |
91 | { | 173 | { |
92 | struct clkdm_pwrdm_autodep *autodep; | 174 | struct clkdm_autodep *autodep; |
93 | 175 | ||
94 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) { | 176 | if (!autodeps) |
95 | if (IS_ERR(autodep->pwrdm.ptr)) | 177 | return; |
178 | |||
179 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { | ||
180 | if (IS_ERR(autodep->clkdm.ptr)) | ||
96 | continue; | 181 | continue; |
97 | 182 | ||
98 | if (!omap_chip_is(autodep->omap_chip)) | 183 | if (!omap_chip_is(autodep->omap_chip)) |
99 | continue; | 184 | continue; |
100 | 185 | ||
101 | pr_debug("clockdomain: adding %s sleepdep/wkdep for " | 186 | pr_debug("clockdomain: adding %s sleepdep/wkdep for " |
102 | "pwrdm %s\n", autodep->pwrdm.ptr->name, | 187 | "clkdm %s\n", autodep->clkdm.ptr->name, |
103 | clkdm->pwrdm.ptr->name); | 188 | clkdm->name); |
104 | 189 | ||
105 | pwrdm_add_sleepdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); | 190 | clkdm_add_sleepdep(clkdm, autodep->clkdm.ptr); |
106 | pwrdm_add_wkdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); | 191 | clkdm_add_wkdep(clkdm, autodep->clkdm.ptr); |
107 | } | 192 | } |
108 | } | 193 | } |
109 | 194 | ||
@@ -117,21 +202,24 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm) | |||
117 | */ | 202 | */ |
118 | static void _clkdm_del_autodeps(struct clockdomain *clkdm) | 203 | static void _clkdm_del_autodeps(struct clockdomain *clkdm) |
119 | { | 204 | { |
120 | struct clkdm_pwrdm_autodep *autodep; | 205 | struct clkdm_autodep *autodep; |
206 | |||
207 | if (!autodeps) | ||
208 | return; | ||
121 | 209 | ||
122 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) { | 210 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { |
123 | if (IS_ERR(autodep->pwrdm.ptr)) | 211 | if (IS_ERR(autodep->clkdm.ptr)) |
124 | continue; | 212 | continue; |
125 | 213 | ||
126 | if (!omap_chip_is(autodep->omap_chip)) | 214 | if (!omap_chip_is(autodep->omap_chip)) |
127 | continue; | 215 | continue; |
128 | 216 | ||
129 | pr_debug("clockdomain: removing %s sleepdep/wkdep for " | 217 | pr_debug("clockdomain: removing %s sleepdep/wkdep for " |
130 | "pwrdm %s\n", autodep->pwrdm.ptr->name, | 218 | "clkdm %s\n", autodep->clkdm.ptr->name, |
131 | clkdm->pwrdm.ptr->name); | 219 | clkdm->name); |
132 | 220 | ||
133 | pwrdm_del_sleepdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); | 221 | clkdm_del_sleepdep(clkdm, autodep->clkdm.ptr); |
134 | pwrdm_del_wkdep(clkdm->pwrdm.ptr, autodep->pwrdm.ptr); | 222 | clkdm_del_wkdep(clkdm, autodep->clkdm.ptr); |
135 | } | 223 | } |
136 | } | 224 | } |
137 | 225 | ||
@@ -145,152 +233,167 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm) | |||
145 | */ | 233 | */ |
146 | static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable) | 234 | static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable) |
147 | { | 235 | { |
148 | u32 v; | 236 | u32 bits, v; |
149 | 237 | ||
150 | if (cpu_is_omap24xx()) { | 238 | if (cpu_is_omap24xx()) { |
151 | if (enable) | 239 | if (enable) |
152 | v = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; | 240 | bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; |
153 | else | 241 | else |
154 | v = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; | 242 | bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; |
155 | } else if (cpu_is_omap34xx()) { | 243 | } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { |
156 | if (enable) | 244 | if (enable) |
157 | v = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; | 245 | bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; |
158 | else | 246 | else |
159 | v = OMAP34XX_CLKSTCTRL_DISABLE_AUTO; | 247 | bits = OMAP34XX_CLKSTCTRL_DISABLE_AUTO; |
160 | } else { | 248 | } else { |
161 | BUG(); | 249 | BUG(); |
162 | } | 250 | } |
163 | 251 | ||
164 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, | 252 | bits = bits << __ffs(clkdm->clktrctrl_mask); |
165 | v << __ffs(clkdm->clktrctrl_mask), | ||
166 | clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); | ||
167 | } | ||
168 | |||
169 | static struct clockdomain *_clkdm_lookup(const char *name) | ||
170 | { | ||
171 | struct clockdomain *clkdm, *temp_clkdm; | ||
172 | |||
173 | if (!name) | ||
174 | return NULL; | ||
175 | |||
176 | clkdm = NULL; | ||
177 | 253 | ||
178 | list_for_each_entry(temp_clkdm, &clkdm_list, node) { | 254 | v = __raw_readl(clkdm->clkstctrl_reg); |
179 | if (!strcmp(name, temp_clkdm->name)) { | 255 | v &= ~(clkdm->clktrctrl_mask); |
180 | clkdm = temp_clkdm; | 256 | v |= bits; |
181 | break; | 257 | __raw_writel(v, clkdm->clkstctrl_reg); |
182 | } | ||
183 | } | ||
184 | 258 | ||
185 | return clkdm; | ||
186 | } | 259 | } |
187 | 260 | ||
188 | |||
189 | /* Public functions */ | ||
190 | |||
191 | /** | 261 | /** |
192 | * clkdm_init - set up the clockdomain layer | 262 | * _init_wkdep_usecount - initialize wkdep usecounts to match hardware |
193 | * @clkdms: optional pointer to an array of clockdomains to register | 263 | * @clkdm: clockdomain to initialize wkdep usecounts |
194 | * @init_autodeps: optional pointer to an array of autodeps to register | ||
195 | * | 264 | * |
196 | * Set up internal state. If a pointer to an array of clockdomains | 265 | * Initialize the wakeup dependency usecount variables for clockdomain @clkdm. |
197 | * was supplied, loop through the list of clockdomains, register all | 266 | * If a wakeup dependency is present in the hardware, the usecount will be |
198 | * that are available on the current platform. Similarly, if a | 267 | * set to 1; otherwise, it will be set to 0. Software should clear all |
199 | * pointer to an array of clockdomain-powerdomain autodependencies was | 268 | * software wakeup dependencies prior to calling this function if it wishes |
200 | * provided, register those. No return value. | 269 | * to ensure that all usecounts start at 0. No return value. |
201 | */ | 270 | */ |
202 | void clkdm_init(struct clockdomain **clkdms, | 271 | static void _init_wkdep_usecount(struct clockdomain *clkdm) |
203 | struct clkdm_pwrdm_autodep *init_autodeps) | ||
204 | { | 272 | { |
205 | struct clockdomain **c = NULL; | 273 | u32 v; |
206 | struct clkdm_pwrdm_autodep *autodep = NULL; | 274 | struct clkdm_dep *cd; |
207 | 275 | ||
208 | if (clkdms) | 276 | if (!clkdm->wkdep_srcs) |
209 | for (c = clkdms; *c; c++) | 277 | return; |
210 | clkdm_register(*c); | ||
211 | 278 | ||
212 | autodeps = init_autodeps; | 279 | for (cd = clkdm->wkdep_srcs; cd->clkdm_name; cd++) { |
213 | if (autodeps) | 280 | if (!omap_chip_is(cd->omap_chip)) |
214 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) | 281 | continue; |
215 | _autodep_lookup(autodep); | 282 | |
283 | if (!cd->clkdm && cd->clkdm_name) | ||
284 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); | ||
285 | |||
286 | if (!cd->clkdm) { | ||
287 | WARN(!cd->clkdm, "clockdomain: %s: wkdep clkdm %s not " | ||
288 | "found\n", clkdm->name, cd->clkdm_name); | ||
289 | continue; | ||
290 | } | ||
291 | |||
292 | v = prm_read_mod_bits_shift(clkdm->pwrdm.ptr->prcm_offs, | ||
293 | PM_WKDEP, | ||
294 | (1 << cd->clkdm->dep_bit)); | ||
295 | |||
296 | if (v) | ||
297 | pr_debug("clockdomain: %s: wakeup dependency already " | ||
298 | "set to wake up when %s wakes\n", | ||
299 | clkdm->name, cd->clkdm->name); | ||
300 | |||
301 | atomic_set(&cd->wkdep_usecount, (v) ? 1 : 0); | ||
302 | } | ||
216 | } | 303 | } |
217 | 304 | ||
218 | /** | 305 | /** |
219 | * clkdm_register - register a clockdomain | 306 | * _init_sleepdep_usecount - initialize sleepdep usecounts to match hardware |
220 | * @clkdm: struct clockdomain * to register | 307 | * @clkdm: clockdomain to initialize sleepdep usecounts |
221 | * | 308 | * |
222 | * Adds a clockdomain to the internal clockdomain list. | 309 | * Initialize the sleep dependency usecount variables for clockdomain @clkdm. |
223 | * Returns -EINVAL if given a null pointer, -EEXIST if a clockdomain is | 310 | * If a sleep dependency is present in the hardware, the usecount will be |
224 | * already registered by the provided name, or 0 upon success. | 311 | * set to 1; otherwise, it will be set to 0. Software should clear all |
312 | * software sleep dependencies prior to calling this function if it wishes | ||
313 | * to ensure that all usecounts start at 0. No return value. | ||
225 | */ | 314 | */ |
226 | int clkdm_register(struct clockdomain *clkdm) | 315 | static void _init_sleepdep_usecount(struct clockdomain *clkdm) |
227 | { | 316 | { |
228 | int ret = -EINVAL; | 317 | u32 v; |
229 | struct powerdomain *pwrdm; | 318 | struct clkdm_dep *cd; |
230 | 319 | ||
231 | if (!clkdm || !clkdm->name) | 320 | if (!cpu_is_omap34xx()) |
232 | return -EINVAL; | 321 | return; |
233 | 322 | ||
234 | if (!omap_chip_is(clkdm->omap_chip)) | 323 | if (!clkdm->sleepdep_srcs) |
235 | return -EINVAL; | 324 | return; |
236 | 325 | ||
237 | pwrdm = pwrdm_lookup(clkdm->pwrdm.name); | 326 | for (cd = clkdm->sleepdep_srcs; cd->clkdm_name; cd++) { |
238 | if (!pwrdm) { | 327 | if (!omap_chip_is(cd->omap_chip)) |
239 | pr_err("clockdomain: %s: powerdomain %s does not exist\n", | 328 | continue; |
240 | clkdm->name, clkdm->pwrdm.name); | ||
241 | return -EINVAL; | ||
242 | } | ||
243 | clkdm->pwrdm.ptr = pwrdm; | ||
244 | 329 | ||
245 | mutex_lock(&clkdm_mutex); | 330 | if (!cd->clkdm && cd->clkdm_name) |
246 | /* Verify that the clockdomain is not already registered */ | 331 | cd->clkdm = _clkdm_lookup(cd->clkdm_name); |
247 | if (_clkdm_lookup(clkdm->name)) { | ||
248 | ret = -EEXIST; | ||
249 | goto cr_unlock; | ||
250 | } | ||
251 | 332 | ||
252 | list_add(&clkdm->node, &clkdm_list); | 333 | if (!cd->clkdm) { |
334 | WARN(!cd->clkdm, "clockdomain: %s: sleepdep clkdm %s " | ||
335 | "not found\n", clkdm->name, cd->clkdm_name); | ||
336 | continue; | ||
337 | } | ||
253 | 338 | ||
254 | pwrdm_add_clkdm(pwrdm, clkdm); | 339 | v = prm_read_mod_bits_shift(clkdm->pwrdm.ptr->prcm_offs, |
340 | OMAP3430_CM_SLEEPDEP, | ||
341 | (1 << cd->clkdm->dep_bit)); | ||
255 | 342 | ||
256 | pr_debug("clockdomain: registered %s\n", clkdm->name); | 343 | if (v) |
257 | ret = 0; | 344 | pr_debug("clockdomain: %s: sleep dependency already " |
345 | "set to prevent from idling until %s " | ||
346 | "idles\n", clkdm->name, cd->clkdm->name); | ||
258 | 347 | ||
259 | cr_unlock: | 348 | atomic_set(&cd->sleepdep_usecount, (v) ? 1 : 0); |
260 | mutex_unlock(&clkdm_mutex); | 349 | } |
350 | }; | ||
261 | 351 | ||
262 | return ret; | 352 | /* Public functions */ |
263 | } | ||
264 | 353 | ||
265 | /** | 354 | /** |
266 | * clkdm_unregister - unregister a clockdomain | 355 | * clkdm_init - set up the clockdomain layer |
267 | * @clkdm: struct clockdomain * to unregister | 356 | * @clkdms: optional pointer to an array of clockdomains to register |
357 | * @init_autodeps: optional pointer to an array of autodeps to register | ||
268 | * | 358 | * |
269 | * Removes a clockdomain from the internal clockdomain list. Returns | 359 | * Set up internal state. If a pointer to an array of clockdomains |
270 | * -EINVAL if clkdm argument is NULL. | 360 | * @clkdms was supplied, loop through the list of clockdomains, |
361 | * register all that are available on the current platform. Similarly, | ||
362 | * if a pointer to an array of clockdomain autodependencies | ||
363 | * @init_autodeps was provided, register those. No return value. | ||
271 | */ | 364 | */ |
272 | int clkdm_unregister(struct clockdomain *clkdm) | 365 | void clkdm_init(struct clockdomain **clkdms, |
366 | struct clkdm_autodep *init_autodeps) | ||
273 | { | 367 | { |
274 | if (!clkdm) | 368 | struct clockdomain **c = NULL; |
275 | return -EINVAL; | 369 | struct clockdomain *clkdm; |
276 | 370 | struct clkdm_autodep *autodep = NULL; | |
277 | pwrdm_del_clkdm(clkdm->pwrdm.ptr, clkdm); | ||
278 | 371 | ||
279 | mutex_lock(&clkdm_mutex); | 372 | if (clkdms) |
280 | list_del(&clkdm->node); | 373 | for (c = clkdms; *c; c++) |
281 | mutex_unlock(&clkdm_mutex); | 374 | _clkdm_register(*c); |
282 | 375 | ||
283 | pr_debug("clockdomain: unregistered %s\n", clkdm->name); | 376 | autodeps = init_autodeps; |
377 | if (autodeps) | ||
378 | for (autodep = autodeps; autodep->clkdm.ptr; autodep++) | ||
379 | _autodep_lookup(autodep); | ||
284 | 380 | ||
285 | return 0; | 381 | /* |
382 | * Ensure that the *dep_usecount registers reflect the current | ||
383 | * state of the PRCM. | ||
384 | */ | ||
385 | list_for_each_entry(clkdm, &clkdm_list, node) { | ||
386 | _init_wkdep_usecount(clkdm); | ||
387 | _init_sleepdep_usecount(clkdm); | ||
388 | } | ||
286 | } | 389 | } |
287 | 390 | ||
288 | /** | 391 | /** |
289 | * clkdm_lookup - look up a clockdomain by name, return a pointer | 392 | * clkdm_lookup - look up a clockdomain by name, return a pointer |
290 | * @name: name of clockdomain | 393 | * @name: name of clockdomain |
291 | * | 394 | * |
292 | * Find a registered clockdomain by its name. Returns a pointer to the | 395 | * Find a registered clockdomain by its name @name. Returns a pointer |
293 | * struct clockdomain if found, or NULL otherwise. | 396 | * to the struct clockdomain if found, or NULL otherwise. |
294 | */ | 397 | */ |
295 | struct clockdomain *clkdm_lookup(const char *name) | 398 | struct clockdomain *clkdm_lookup(const char *name) |
296 | { | 399 | { |
@@ -301,14 +404,12 @@ struct clockdomain *clkdm_lookup(const char *name) | |||
301 | 404 | ||
302 | clkdm = NULL; | 405 | clkdm = NULL; |
303 | 406 | ||
304 | mutex_lock(&clkdm_mutex); | ||
305 | list_for_each_entry(temp_clkdm, &clkdm_list, node) { | 407 | list_for_each_entry(temp_clkdm, &clkdm_list, node) { |
306 | if (!strcmp(name, temp_clkdm->name)) { | 408 | if (!strcmp(name, temp_clkdm->name)) { |
307 | clkdm = temp_clkdm; | 409 | clkdm = temp_clkdm; |
308 | break; | 410 | break; |
309 | } | 411 | } |
310 | } | 412 | } |
311 | mutex_unlock(&clkdm_mutex); | ||
312 | 413 | ||
313 | return clkdm; | 414 | return clkdm; |
314 | } | 415 | } |
@@ -317,8 +418,8 @@ struct clockdomain *clkdm_lookup(const char *name) | |||
317 | * clkdm_for_each - call function on each registered clockdomain | 418 | * clkdm_for_each - call function on each registered clockdomain |
318 | * @fn: callback function * | 419 | * @fn: callback function * |
319 | * | 420 | * |
320 | * Call the supplied function for each registered clockdomain. | 421 | * Call the supplied function @fn for each registered clockdomain. |
321 | * The callback function can return anything but 0 to bail | 422 | * The callback function @fn can return anything but 0 to bail |
322 | * out early from the iterator. The callback function is called with | 423 | * out early from the iterator. The callback function is called with |
323 | * the clkdm_mutex held, so no clockdomain structure manipulation | 424 | * the clkdm_mutex held, so no clockdomain structure manipulation |
324 | * functions should be called from the callback, although hardware | 425 | * functions should be called from the callback, although hardware |
@@ -336,13 +437,11 @@ int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), | |||
336 | if (!fn) | 437 | if (!fn) |
337 | return -EINVAL; | 438 | return -EINVAL; |
338 | 439 | ||
339 | mutex_lock(&clkdm_mutex); | ||
340 | list_for_each_entry(clkdm, &clkdm_list, node) { | 440 | list_for_each_entry(clkdm, &clkdm_list, node) { |
341 | ret = (*fn)(clkdm, user); | 441 | ret = (*fn)(clkdm, user); |
342 | if (ret) | 442 | if (ret) |
343 | break; | 443 | break; |
344 | } | 444 | } |
345 | mutex_unlock(&clkdm_mutex); | ||
346 | 445 | ||
347 | return ret; | 446 | return ret; |
348 | } | 447 | } |
@@ -353,7 +452,7 @@ int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), | |||
353 | * @clkdm: struct clockdomain * | 452 | * @clkdm: struct clockdomain * |
354 | * | 453 | * |
355 | * Return a pointer to the struct powerdomain that the specified clockdomain | 454 | * Return a pointer to the struct powerdomain that the specified clockdomain |
356 | * 'clkdm' exists in, or returns NULL if clkdm argument is NULL. | 455 | * @clkdm exists in, or returns NULL if @clkdm is NULL. |
357 | */ | 456 | */ |
358 | struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm) | 457 | struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm) |
359 | { | 458 | { |
@@ -367,11 +466,309 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm) | |||
367 | /* Hardware clockdomain control */ | 466 | /* Hardware clockdomain control */ |
368 | 467 | ||
369 | /** | 468 | /** |
469 | * clkdm_add_wkdep - add a wakeup dependency from clkdm2 to clkdm1 | ||
470 | * @clkdm1: wake this struct clockdomain * up (dependent) | ||
471 | * @clkdm2: when this struct clockdomain * wakes up (source) | ||
472 | * | ||
473 | * When the clockdomain represented by @clkdm2 wakes up, wake up | ||
474 | * @clkdm1. Implemented in hardware on the OMAP, this feature is | ||
475 | * designed to reduce wakeup latency of the dependent clockdomain @clkdm1. | ||
476 | * Returns -EINVAL if presented with invalid clockdomain pointers, | ||
477 | * -ENOENT if @clkdm2 cannot wake up clkdm1 in hardware, or 0 upon | ||
478 | * success. | ||
479 | */ | ||
480 | int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | ||
481 | { | ||
482 | struct clkdm_dep *cd; | ||
483 | |||
484 | if (!clkdm1 || !clkdm2) | ||
485 | return -EINVAL; | ||
486 | |||
487 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); | ||
488 | if (IS_ERR(cd)) { | ||
489 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | ||
490 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | ||
491 | return PTR_ERR(cd); | ||
492 | } | ||
493 | |||
494 | if (atomic_inc_return(&cd->wkdep_usecount) == 1) { | ||
495 | pr_debug("clockdomain: hardware will wake up %s when %s wakes " | ||
496 | "up\n", clkdm1->name, clkdm2->name); | ||
497 | |||
498 | prm_set_mod_reg_bits((1 << clkdm2->dep_bit), | ||
499 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
500 | } | ||
501 | |||
502 | return 0; | ||
503 | } | ||
504 | |||
505 | /** | ||
506 | * clkdm_del_wkdep - remove a wakeup dependency from clkdm2 to clkdm1 | ||
507 | * @clkdm1: wake this struct clockdomain * up (dependent) | ||
508 | * @clkdm2: when this struct clockdomain * wakes up (source) | ||
509 | * | ||
510 | * Remove a wakeup dependency causing @clkdm1 to wake up when @clkdm2 | ||
511 | * wakes up. Returns -EINVAL if presented with invalid clockdomain | ||
512 | * pointers, -ENOENT if @clkdm2 cannot wake up clkdm1 in hardware, or | ||
513 | * 0 upon success. | ||
514 | */ | ||
515 | int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | ||
516 | { | ||
517 | struct clkdm_dep *cd; | ||
518 | |||
519 | if (!clkdm1 || !clkdm2) | ||
520 | return -EINVAL; | ||
521 | |||
522 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); | ||
523 | if (IS_ERR(cd)) { | ||
524 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | ||
525 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | ||
526 | return PTR_ERR(cd); | ||
527 | } | ||
528 | |||
529 | if (atomic_dec_return(&cd->wkdep_usecount) == 0) { | ||
530 | pr_debug("clockdomain: hardware will no longer wake up %s " | ||
531 | "after %s wakes up\n", clkdm1->name, clkdm2->name); | ||
532 | |||
533 | prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), | ||
534 | clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
535 | } | ||
536 | |||
537 | return 0; | ||
538 | } | ||
539 | |||
540 | /** | ||
541 | * clkdm_read_wkdep - read wakeup dependency state from clkdm2 to clkdm1 | ||
542 | * @clkdm1: wake this struct clockdomain * up (dependent) | ||
543 | * @clkdm2: when this struct clockdomain * wakes up (source) | ||
544 | * | ||
545 | * Return 1 if a hardware wakeup dependency exists wherein @clkdm1 will be | ||
546 | * awoken when @clkdm2 wakes up; 0 if dependency is not set; -EINVAL | ||
547 | * if either clockdomain pointer is invalid; or -ENOENT if the hardware | ||
548 | * is incapable. | ||
549 | * | ||
550 | * REVISIT: Currently this function only represents software-controllable | ||
551 | * wakeup dependencies. Wakeup dependencies fixed in hardware are not | ||
552 | * yet handled here. | ||
553 | */ | ||
554 | int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | ||
555 | { | ||
556 | struct clkdm_dep *cd; | ||
557 | |||
558 | if (!clkdm1 || !clkdm2) | ||
559 | return -EINVAL; | ||
560 | |||
561 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); | ||
562 | if (IS_ERR(cd)) { | ||
563 | pr_debug("clockdomain: hardware cannot set/clear wake up of " | ||
564 | "%s when %s wakes up\n", clkdm1->name, clkdm2->name); | ||
565 | return PTR_ERR(cd); | ||
566 | } | ||
567 | |||
568 | /* XXX It's faster to return the atomic wkdep_usecount */ | ||
569 | return prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP, | ||
570 | (1 << clkdm2->dep_bit)); | ||
571 | } | ||
572 | |||
573 | /** | ||
574 | * clkdm_clear_all_wkdeps - remove all wakeup dependencies from target clkdm | ||
575 | * @clkdm: struct clockdomain * to remove all wakeup dependencies from | ||
576 | * | ||
577 | * Remove all inter-clockdomain wakeup dependencies that could cause | ||
578 | * @clkdm to wake. Intended to be used during boot to initialize the | ||
579 | * PRCM to a known state, after all clockdomains are put into swsup idle | ||
580 | * and woken up. Returns -EINVAL if @clkdm pointer is invalid, or | ||
581 | * 0 upon success. | ||
582 | */ | ||
583 | int clkdm_clear_all_wkdeps(struct clockdomain *clkdm) | ||
584 | { | ||
585 | struct clkdm_dep *cd; | ||
586 | u32 mask = 0; | ||
587 | |||
588 | if (!clkdm) | ||
589 | return -EINVAL; | ||
590 | |||
591 | for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { | ||
592 | if (!omap_chip_is(cd->omap_chip)) | ||
593 | continue; | ||
594 | |||
595 | /* PRM accesses are slow, so minimize them */ | ||
596 | mask |= 1 << cd->clkdm->dep_bit; | ||
597 | atomic_set(&cd->wkdep_usecount, 0); | ||
598 | } | ||
599 | |||
600 | prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP); | ||
601 | |||
602 | return 0; | ||
603 | } | ||
604 | |||
605 | /** | ||
606 | * clkdm_add_sleepdep - add a sleep dependency from clkdm2 to clkdm1 | ||
607 | * @clkdm1: prevent this struct clockdomain * from sleeping (dependent) | ||
608 | * @clkdm2: when this struct clockdomain * is active (source) | ||
609 | * | ||
610 | * Prevent @clkdm1 from automatically going inactive (and then to | ||
611 | * retention or off) if @clkdm2 is active. Returns -EINVAL if | ||
612 | * presented with invalid clockdomain pointers or called on a machine | ||
613 | * that does not support software-configurable hardware sleep | ||
614 | * dependencies, -ENOENT if the specified dependency cannot be set in | ||
615 | * hardware, or 0 upon success. | ||
616 | */ | ||
617 | int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | ||
618 | { | ||
619 | struct clkdm_dep *cd; | ||
620 | |||
621 | if (!cpu_is_omap34xx()) | ||
622 | return -EINVAL; | ||
623 | |||
624 | if (!clkdm1 || !clkdm2) | ||
625 | return -EINVAL; | ||
626 | |||
627 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); | ||
628 | if (IS_ERR(cd)) { | ||
629 | pr_debug("clockdomain: hardware cannot set/clear sleep " | ||
630 | "dependency affecting %s from %s\n", clkdm1->name, | ||
631 | clkdm2->name); | ||
632 | return PTR_ERR(cd); | ||
633 | } | ||
634 | |||
635 | if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { | ||
636 | pr_debug("clockdomain: will prevent %s from sleeping if %s " | ||
637 | "is active\n", clkdm1->name, clkdm2->name); | ||
638 | |||
639 | cm_set_mod_reg_bits((1 << clkdm2->dep_bit), | ||
640 | clkdm1->pwrdm.ptr->prcm_offs, | ||
641 | OMAP3430_CM_SLEEPDEP); | ||
642 | } | ||
643 | |||
644 | return 0; | ||
645 | } | ||
646 | |||
647 | /** | ||
648 | * clkdm_del_sleepdep - remove a sleep dependency from clkdm2 to clkdm1 | ||
649 | * @clkdm1: prevent this struct clockdomain * from sleeping (dependent) | ||
650 | * @clkdm2: when this struct clockdomain * is active (source) | ||
651 | * | ||
652 | * Allow @clkdm1 to automatically go inactive (and then to retention or | ||
653 | * off), independent of the activity state of @clkdm2. Returns -EINVAL | ||
654 | * if presented with invalid clockdomain pointers or called on a machine | ||
655 | * that does not support software-configurable hardware sleep dependencies, | ||
656 | * -ENOENT if the specified dependency cannot be cleared in hardware, or | ||
657 | * 0 upon success. | ||
658 | */ | ||
659 | int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | ||
660 | { | ||
661 | struct clkdm_dep *cd; | ||
662 | |||
663 | if (!cpu_is_omap34xx()) | ||
664 | return -EINVAL; | ||
665 | |||
666 | if (!clkdm1 || !clkdm2) | ||
667 | return -EINVAL; | ||
668 | |||
669 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); | ||
670 | if (IS_ERR(cd)) { | ||
671 | pr_debug("clockdomain: hardware cannot set/clear sleep " | ||
672 | "dependency affecting %s from %s\n", clkdm1->name, | ||
673 | clkdm2->name); | ||
674 | return PTR_ERR(cd); | ||
675 | } | ||
676 | |||
677 | if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { | ||
678 | pr_debug("clockdomain: will no longer prevent %s from " | ||
679 | "sleeping if %s is active\n", clkdm1->name, | ||
680 | clkdm2->name); | ||
681 | |||
682 | cm_clear_mod_reg_bits((1 << clkdm2->dep_bit), | ||
683 | clkdm1->pwrdm.ptr->prcm_offs, | ||
684 | OMAP3430_CM_SLEEPDEP); | ||
685 | } | ||
686 | |||
687 | return 0; | ||
688 | } | ||
689 | |||
690 | /** | ||
691 | * clkdm_read_sleepdep - read sleep dependency state from clkdm2 to clkdm1 | ||
692 | * @clkdm1: prevent this struct clockdomain * from sleeping (dependent) | ||
693 | * @clkdm2: when this struct clockdomain * is active (source) | ||
694 | * | ||
695 | * Return 1 if a hardware sleep dependency exists wherein @clkdm1 will | ||
696 | * not be allowed to automatically go inactive if @clkdm2 is active; | ||
697 | * 0 if @clkdm1's automatic power state inactivity transition is independent | ||
698 | * of @clkdm2's; -EINVAL if either clockdomain pointer is invalid or called | ||
699 | * on a machine that does not support software-configurable hardware sleep | ||
700 | * dependencies; or -ENOENT if the hardware is incapable. | ||
701 | * | ||
702 | * REVISIT: Currently this function only represents software-controllable | ||
703 | * sleep dependencies. Sleep dependencies fixed in hardware are not | ||
704 | * yet handled here. | ||
705 | */ | ||
706 | int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) | ||
707 | { | ||
708 | struct clkdm_dep *cd; | ||
709 | |||
710 | if (!cpu_is_omap34xx()) | ||
711 | return -EINVAL; | ||
712 | |||
713 | if (!clkdm1 || !clkdm2) | ||
714 | return -EINVAL; | ||
715 | |||
716 | cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); | ||
717 | if (IS_ERR(cd)) { | ||
718 | pr_debug("clockdomain: hardware cannot set/clear sleep " | ||
719 | "dependency affecting %s from %s\n", clkdm1->name, | ||
720 | clkdm2->name); | ||
721 | return PTR_ERR(cd); | ||
722 | } | ||
723 | |||
724 | /* XXX It's faster to return the atomic sleepdep_usecount */ | ||
725 | return prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, | ||
726 | OMAP3430_CM_SLEEPDEP, | ||
727 | (1 << clkdm2->dep_bit)); | ||
728 | } | ||
729 | |||
730 | /** | ||
731 | * clkdm_clear_all_sleepdeps - remove all sleep dependencies from target clkdm | ||
732 | * @clkdm: struct clockdomain * to remove all sleep dependencies from | ||
733 | * | ||
734 | * Remove all inter-clockdomain sleep dependencies that could prevent | ||
735 | * @clkdm from idling. Intended to be used during boot to initialize the | ||
736 | * PRCM to a known state, after all clockdomains are put into swsup idle | ||
737 | * and woken up. Returns -EINVAL if @clkdm pointer is invalid, or | ||
738 | * 0 upon success. | ||
739 | */ | ||
740 | int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) | ||
741 | { | ||
742 | struct clkdm_dep *cd; | ||
743 | u32 mask = 0; | ||
744 | |||
745 | if (!cpu_is_omap34xx()) | ||
746 | return -EINVAL; | ||
747 | |||
748 | if (!clkdm) | ||
749 | return -EINVAL; | ||
750 | |||
751 | for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { | ||
752 | if (!omap_chip_is(cd->omap_chip)) | ||
753 | continue; | ||
754 | |||
755 | /* PRM accesses are slow, so minimize them */ | ||
756 | mask |= 1 << cd->clkdm->dep_bit; | ||
757 | atomic_set(&cd->sleepdep_usecount, 0); | ||
758 | } | ||
759 | |||
760 | prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, | ||
761 | OMAP3430_CM_SLEEPDEP); | ||
762 | |||
763 | return 0; | ||
764 | } | ||
765 | |||
766 | /** | ||
370 | * omap2_clkdm_clktrctrl_read - read the clkdm's current state transition mode | 767 | * omap2_clkdm_clktrctrl_read - read the clkdm's current state transition mode |
371 | * @clk: struct clk * of a clockdomain | 768 | * @clkdm: struct clkdm * of a clockdomain |
372 | * | 769 | * |
373 | * Return the clockdomain's current state transition mode from the | 770 | * Return the clockdomain @clkdm current state transition mode from the |
374 | * corresponding domain CM_CLKSTCTRL register. Returns -EINVAL if clk | 771 | * corresponding domain CM_CLKSTCTRL register. Returns -EINVAL if @clkdm |
375 | * is NULL or the current mode upon success. | 772 | * is NULL or the current mode upon success. |
376 | */ | 773 | */ |
377 | static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | 774 | static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) |
@@ -381,7 +778,7 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | |||
381 | if (!clkdm) | 778 | if (!clkdm) |
382 | return -EINVAL; | 779 | return -EINVAL; |
383 | 780 | ||
384 | v = cm_read_mod_reg(clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); | 781 | v = __raw_readl(clkdm->clkstctrl_reg); |
385 | v &= clkdm->clktrctrl_mask; | 782 | v &= clkdm->clktrctrl_mask; |
386 | v >>= __ffs(clkdm->clktrctrl_mask); | 783 | v >>= __ffs(clkdm->clktrctrl_mask); |
387 | 784 | ||
@@ -393,7 +790,7 @@ static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm) | |||
393 | * @clkdm: struct clockdomain * | 790 | * @clkdm: struct clockdomain * |
394 | * | 791 | * |
395 | * Instruct the CM to force a sleep transition on the specified | 792 | * Instruct the CM to force a sleep transition on the specified |
396 | * clockdomain 'clkdm'. Returns -EINVAL if clk is NULL or if | 793 | * clockdomain @clkdm. Returns -EINVAL if @clkdm is NULL or if |
397 | * clockdomain does not support software-initiated sleep; 0 upon | 794 | * clockdomain does not support software-initiated sleep; 0 upon |
398 | * success. | 795 | * success. |
399 | */ | 796 | */ |
@@ -413,15 +810,17 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
413 | if (cpu_is_omap24xx()) { | 810 | if (cpu_is_omap24xx()) { |
414 | 811 | ||
415 | cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, | 812 | cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, |
416 | clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL); | 813 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); |
417 | 814 | ||
418 | } else if (cpu_is_omap34xx()) { | 815 | } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { |
419 | 816 | ||
420 | u32 v = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << | 817 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << |
421 | __ffs(clkdm->clktrctrl_mask)); | 818 | __ffs(clkdm->clktrctrl_mask)); |
422 | 819 | ||
423 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, | 820 | u32 v = __raw_readl(clkdm->clkstctrl_reg); |
424 | clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); | 821 | v &= ~(clkdm->clktrctrl_mask); |
822 | v |= bits; | ||
823 | __raw_writel(v, clkdm->clkstctrl_reg); | ||
425 | 824 | ||
426 | } else { | 825 | } else { |
427 | BUG(); | 826 | BUG(); |
@@ -435,7 +834,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
435 | * @clkdm: struct clockdomain * | 834 | * @clkdm: struct clockdomain * |
436 | * | 835 | * |
437 | * Instruct the CM to force a wakeup transition on the specified | 836 | * Instruct the CM to force a wakeup transition on the specified |
438 | * clockdomain 'clkdm'. Returns -EINVAL if clkdm is NULL or if the | 837 | * clockdomain @clkdm. Returns -EINVAL if @clkdm is NULL or if the |
439 | * clockdomain does not support software-controlled wakeup; 0 upon | 838 | * clockdomain does not support software-controlled wakeup; 0 upon |
440 | * success. | 839 | * success. |
441 | */ | 840 | */ |
@@ -455,15 +854,17 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
455 | if (cpu_is_omap24xx()) { | 854 | if (cpu_is_omap24xx()) { |
456 | 855 | ||
457 | cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, | 856 | cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, |
458 | clkdm->pwrdm.ptr->prcm_offs, PM_PWSTCTRL); | 857 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); |
459 | 858 | ||
460 | } else if (cpu_is_omap34xx()) { | 859 | } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { |
461 | 860 | ||
462 | u32 v = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << | 861 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << |
463 | __ffs(clkdm->clktrctrl_mask)); | 862 | __ffs(clkdm->clktrctrl_mask)); |
464 | 863 | ||
465 | cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v, | 864 | u32 v = __raw_readl(clkdm->clkstctrl_reg); |
466 | clkdm->pwrdm.ptr->prcm_offs, CM_CLKSTCTRL); | 865 | v &= ~(clkdm->clktrctrl_mask); |
866 | v |= bits; | ||
867 | __raw_writel(v, clkdm->clkstctrl_reg); | ||
467 | 868 | ||
468 | } else { | 869 | } else { |
469 | BUG(); | 870 | BUG(); |
@@ -476,7 +877,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
476 | * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm | 877 | * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm |
477 | * @clkdm: struct clockdomain * | 878 | * @clkdm: struct clockdomain * |
478 | * | 879 | * |
479 | * Allow the hardware to automatically switch the clockdomain into | 880 | * Allow the hardware to automatically switch the clockdomain @clkdm into |
480 | * active or idle states, as needed by downstream clocks. If the | 881 | * active or idle states, as needed by downstream clocks. If the |
481 | * clockdomain has any downstream clocks enabled in the clock | 882 | * clockdomain has any downstream clocks enabled in the clock |
482 | * framework, wkdep/sleepdep autodependencies are added; this is so | 883 | * framework, wkdep/sleepdep autodependencies are added; this is so |
@@ -496,8 +897,17 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | |||
496 | pr_debug("clockdomain: enabling automatic idle transitions for %s\n", | 897 | pr_debug("clockdomain: enabling automatic idle transitions for %s\n", |
497 | clkdm->name); | 898 | clkdm->name); |
498 | 899 | ||
499 | if (atomic_read(&clkdm->usecount) > 0) | 900 | /* |
500 | _clkdm_add_autodeps(clkdm); | 901 | * XXX This should be removed once TI adds wakeup/sleep |
902 | * dependency code and data for OMAP4. | ||
903 | */ | ||
904 | if (cpu_is_omap44xx()) { | ||
905 | WARN_ONCE(1, "clockdomain: OMAP4 wakeup/sleep dependency " | ||
906 | "support is not yet implemented\n"); | ||
907 | } else { | ||
908 | if (atomic_read(&clkdm->usecount) > 0) | ||
909 | _clkdm_add_autodeps(clkdm); | ||
910 | } | ||
501 | 911 | ||
502 | _omap2_clkdm_set_hwsup(clkdm, 1); | 912 | _omap2_clkdm_set_hwsup(clkdm, 1); |
503 | 913 | ||
@@ -509,8 +919,8 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm) | |||
509 | * @clkdm: struct clockdomain * | 919 | * @clkdm: struct clockdomain * |
510 | * | 920 | * |
511 | * Prevent the hardware from automatically switching the clockdomain | 921 | * Prevent the hardware from automatically switching the clockdomain |
512 | * into inactive or idle states. If the clockdomain has downstream | 922 | * @clkdm into inactive or idle states. If the clockdomain has |
513 | * clocks enabled in the clock framework, wkdep/sleepdep | 923 | * downstream clocks enabled in the clock framework, wkdep/sleepdep |
514 | * autodependencies are removed. No return value. | 924 | * autodependencies are removed. No return value. |
515 | */ | 925 | */ |
516 | void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | 926 | void omap2_clkdm_deny_idle(struct clockdomain *clkdm) |
@@ -529,8 +939,17 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | |||
529 | 939 | ||
530 | _omap2_clkdm_set_hwsup(clkdm, 0); | 940 | _omap2_clkdm_set_hwsup(clkdm, 0); |
531 | 941 | ||
532 | if (atomic_read(&clkdm->usecount) > 0) | 942 | /* |
533 | _clkdm_del_autodeps(clkdm); | 943 | * XXX This should be removed once TI adds wakeup/sleep |
944 | * dependency code and data for OMAP4. | ||
945 | */ | ||
946 | if (cpu_is_omap44xx()) { | ||
947 | WARN_ONCE(1, "clockdomain: OMAP4 wakeup/sleep dependency " | ||
948 | "support is not yet implemented\n"); | ||
949 | } else { | ||
950 | if (atomic_read(&clkdm->usecount) > 0) | ||
951 | _clkdm_del_autodeps(clkdm); | ||
952 | } | ||
534 | } | 953 | } |
535 | 954 | ||
536 | 955 | ||
@@ -541,14 +960,14 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm) | |||
541 | * @clkdm: struct clockdomain * | 960 | * @clkdm: struct clockdomain * |
542 | * @clk: struct clk * of the enabled downstream clock | 961 | * @clk: struct clk * of the enabled downstream clock |
543 | * | 962 | * |
544 | * Increment the usecount of this clockdomain 'clkdm' and ensure that | 963 | * Increment the usecount of the clockdomain @clkdm and ensure that it |
545 | * it is awake. Intended to be called by clk_enable() code. If the | 964 | * is awake before @clk is enabled. Intended to be called by |
546 | * clockdomain is in software-supervised idle mode, force the | 965 | * clk_enable() code. If the clockdomain is in software-supervised |
547 | * clockdomain to wake. If the clockdomain is in hardware-supervised | 966 | * idle mode, force the clockdomain to wake. If the clockdomain is in |
548 | * idle mode, add clkdm-pwrdm autodependencies, to ensure that devices | 967 | * hardware-supervised idle mode, add clkdm-pwrdm autodependencies, to |
549 | * in the clockdomain can be read from/written to by on-chip processors. | 968 | * ensure that devices in the clockdomain can be read from/written to |
550 | * Returns -EINVAL if passed null pointers; returns 0 upon success or | 969 | * by on-chip processors. Returns -EINVAL if passed null pointers; |
551 | * if the clockdomain is in hwsup idle mode. | 970 | * returns 0 upon success or if the clockdomain is in hwsup idle mode. |
552 | */ | 971 | */ |
553 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | 972 | int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) |
554 | { | 973 | { |
@@ -570,6 +989,9 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
570 | pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, | 989 | pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, |
571 | clk->name); | 990 | clk->name); |
572 | 991 | ||
992 | if (!clkdm->clkstctrl_reg) | ||
993 | return 0; | ||
994 | |||
573 | v = omap2_clkdm_clktrctrl_read(clkdm); | 995 | v = omap2_clkdm_clktrctrl_read(clkdm); |
574 | 996 | ||
575 | if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || | 997 | if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || |
@@ -593,13 +1015,14 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) | |||
593 | * @clkdm: struct clockdomain * | 1015 | * @clkdm: struct clockdomain * |
594 | * @clk: struct clk * of the disabled downstream clock | 1016 | * @clk: struct clk * of the disabled downstream clock |
595 | * | 1017 | * |
596 | * Decrement the usecount of this clockdomain 'clkdm'. Intended to be | 1018 | * Decrement the usecount of this clockdomain @clkdm when @clk is |
597 | * called by clk_disable() code. If the usecount goes to 0, put the | 1019 | * disabled. Intended to be called by clk_disable() code. If the |
598 | * clockdomain to sleep (software-supervised mode) or remove the | 1020 | * clockdomain usecount goes to 0, put the clockdomain to sleep |
599 | * clkdm-pwrdm autodependencies (hardware-supervised mode). Returns | 1021 | * (software-supervised mode) or remove the clkdm autodependencies |
600 | * -EINVAL if passed null pointers; -ERANGE if the clkdm usecount | 1022 | * (hardware-supervised mode). Returns -EINVAL if passed null |
601 | * underflows and debugging is enabled; or returns 0 upon success or | 1023 | * pointers; -ERANGE if the @clkdm usecount underflows and debugging |
602 | * if the clockdomain is in hwsup idle mode. | 1024 | * is enabled; or returns 0 upon success or if the clockdomain is in |
1025 | * hwsup idle mode. | ||
603 | */ | 1026 | */ |
604 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | 1027 | int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) |
605 | { | 1028 | { |
@@ -628,6 +1051,9 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) | |||
628 | pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, | 1051 | pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, |
629 | clk->name); | 1052 | clk->name); |
630 | 1053 | ||
1054 | if (!clkdm->clkstctrl_reg) | ||
1055 | return 0; | ||
1056 | |||
631 | v = omap2_clkdm_clktrctrl_read(clkdm); | 1057 | v = omap2_clkdm_clktrctrl_read(clkdm); |
632 | 1058 | ||
633 | if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || | 1059 | if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) || |
diff --git a/arch/arm/mach-omap2/clockdomains.h b/arch/arm/mach-omap2/clockdomains.h index c4ee0761d908..8fc19ff2cd89 100644 --- a/arch/arm/mach-omap2/clockdomains.h +++ b/arch/arm/mach-omap2/clockdomains.h | |||
@@ -1,16 +1,420 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2/3 clockdomains | 2 | * OMAP2/3 clockdomains |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2008-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2008 Nokia Corporation | 5 | * Copyright (C) 2008-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley and Jouni Högander |
8 | * | ||
9 | * This file contains clockdomains and clockdomain wakeup/sleep | ||
10 | * dependencies for the OMAP2/3 chips. Some notes: | ||
11 | * | ||
12 | * A useful validation rule for struct clockdomain: Any clockdomain | ||
13 | * referenced by a wkdep_srcs or sleepdep_srcs array must have a | ||
14 | * dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really just | ||
15 | * software-controllable dependencies. Non-software-controllable | ||
16 | * dependencies do exist, but they are not encoded below (yet). | ||
17 | * | ||
18 | * 24xx does not support programmable sleep dependencies (SLEEPDEP) | ||
19 | * | ||
20 | * The overly-specific dep_bit names are due to a bit name collision | ||
21 | * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift | ||
22 | * value are the same for all powerdomains: 2 | ||
23 | * | ||
24 | * XXX should dep_bit be a mask, so we can test to see if it is 0 as a | ||
25 | * sanity check? | ||
26 | * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE | ||
27 | */ | ||
28 | |||
29 | /* | ||
30 | * To-Do List | ||
31 | * -> Port the Sleep/Wakeup dependencies for the domains | ||
32 | * from the Power domain framework | ||
8 | */ | 33 | */ |
9 | 34 | ||
10 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H | 35 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H |
11 | #define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H | 36 | #define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H |
12 | 37 | ||
13 | #include <plat/clockdomain.h> | 38 | #include <plat/clockdomain.h> |
39 | #include "cm.h" | ||
40 | #include "prm.h" | ||
41 | |||
42 | /* | ||
43 | * Clockdomain dependencies for wkdeps/sleepdeps | ||
44 | * | ||
45 | * XXX Hardware dependencies (e.g., dependencies that cannot be | ||
46 | * changed in software) are not included here yet, but should be. | ||
47 | */ | ||
48 | |||
49 | /* OMAP2/3-common wakeup dependencies */ | ||
50 | |||
51 | /* | ||
52 | * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP | ||
53 | * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE | ||
54 | * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE | ||
55 | * These can share data since they will never be present simultaneously | ||
56 | * on the same device. | ||
57 | */ | ||
58 | static struct clkdm_dep gfx_sgx_wkdeps[] = { | ||
59 | { | ||
60 | .clkdm_name = "core_l3_clkdm", | ||
61 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
62 | }, | ||
63 | { | ||
64 | .clkdm_name = "core_l4_clkdm", | ||
65 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
66 | }, | ||
67 | { | ||
68 | .clkdm_name = "iva2_clkdm", | ||
69 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
70 | }, | ||
71 | { | ||
72 | .clkdm_name = "mpu_clkdm", | ||
73 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
74 | CHIP_IS_OMAP3430) | ||
75 | }, | ||
76 | { | ||
77 | .clkdm_name = "wkup_clkdm", | ||
78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
79 | CHIP_IS_OMAP3430) | ||
80 | }, | ||
81 | { NULL }, | ||
82 | }; | ||
83 | |||
84 | |||
85 | /* 24XX-specific possible dependencies */ | ||
86 | |||
87 | #ifdef CONFIG_ARCH_OMAP2 | ||
88 | |||
89 | /* Wakeup dependency source arrays */ | ||
90 | |||
91 | /* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ | ||
92 | static struct clkdm_dep dsp_24xx_wkdeps[] = { | ||
93 | { | ||
94 | .clkdm_name = "core_l3_clkdm", | ||
95 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
96 | }, | ||
97 | { | ||
98 | .clkdm_name = "core_l4_clkdm", | ||
99 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
100 | }, | ||
101 | { | ||
102 | .clkdm_name = "mpu_clkdm", | ||
103 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
104 | }, | ||
105 | { | ||
106 | .clkdm_name = "wkup_clkdm", | ||
107 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
108 | }, | ||
109 | { NULL }, | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP | ||
114 | * 2430 adds MDM | ||
115 | */ | ||
116 | static struct clkdm_dep mpu_24xx_wkdeps[] = { | ||
117 | { | ||
118 | .clkdm_name = "core_l3_clkdm", | ||
119 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
120 | }, | ||
121 | { | ||
122 | .clkdm_name = "core_l4_clkdm", | ||
123 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
124 | }, | ||
125 | { | ||
126 | .clkdm_name = "dsp_clkdm", | ||
127 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
128 | }, | ||
129 | { | ||
130 | .clkdm_name = "wkup_clkdm", | ||
131 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
132 | }, | ||
133 | { | ||
134 | .clkdm_name = "mdm_clkdm", | ||
135 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
136 | }, | ||
137 | { NULL }, | ||
138 | }; | ||
139 | |||
140 | /* | ||
141 | * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP | ||
142 | * 2430 adds MDM | ||
143 | */ | ||
144 | static struct clkdm_dep core_24xx_wkdeps[] = { | ||
145 | { | ||
146 | .clkdm_name = "dsp_clkdm", | ||
147 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
148 | }, | ||
149 | { | ||
150 | .clkdm_name = "gfx_clkdm", | ||
151 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
152 | }, | ||
153 | { | ||
154 | .clkdm_name = "mpu_clkdm", | ||
155 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
156 | }, | ||
157 | { | ||
158 | .clkdm_name = "wkup_clkdm", | ||
159 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
160 | }, | ||
161 | { | ||
162 | .clkdm_name = "mdm_clkdm", | ||
163 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
164 | }, | ||
165 | { NULL }, | ||
166 | }; | ||
167 | |||
168 | #endif | ||
169 | |||
170 | |||
171 | /* 2430-specific possible wakeup dependencies */ | ||
172 | |||
173 | #ifdef CONFIG_ARCH_OMAP2430 | ||
174 | |||
175 | /* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ | ||
176 | static struct clkdm_dep mdm_2430_wkdeps[] = { | ||
177 | { | ||
178 | .clkdm_name = "core_l3_clkdm", | ||
179 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
180 | }, | ||
181 | { | ||
182 | .clkdm_name = "core_l4_clkdm", | ||
183 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
184 | }, | ||
185 | { | ||
186 | .clkdm_name = "mpu_clkdm", | ||
187 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
188 | }, | ||
189 | { | ||
190 | .clkdm_name = "wkup_clkdm", | ||
191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
192 | }, | ||
193 | { NULL }, | ||
194 | }; | ||
195 | |||
196 | #endif /* CONFIG_ARCH_OMAP2430 */ | ||
197 | |||
198 | |||
199 | /* OMAP3-specific possible dependencies */ | ||
200 | |||
201 | #ifdef CONFIG_ARCH_OMAP3 | ||
202 | |||
203 | /* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */ | ||
204 | static struct clkdm_dep per_wkdeps[] = { | ||
205 | { | ||
206 | .clkdm_name = "core_l3_clkdm", | ||
207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
208 | }, | ||
209 | { | ||
210 | .clkdm_name = "core_l4_clkdm", | ||
211 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
212 | }, | ||
213 | { | ||
214 | .clkdm_name = "iva2_clkdm", | ||
215 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
216 | }, | ||
217 | { | ||
218 | .clkdm_name = "mpu_clkdm", | ||
219 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
220 | }, | ||
221 | { | ||
222 | .clkdm_name = "wkup_clkdm", | ||
223 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
224 | }, | ||
225 | { NULL }, | ||
226 | }; | ||
227 | |||
228 | /* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */ | ||
229 | static struct clkdm_dep usbhost_wkdeps[] = { | ||
230 | { | ||
231 | .clkdm_name = "core_l3_clkdm", | ||
232 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
233 | }, | ||
234 | { | ||
235 | .clkdm_name = "core_l4_clkdm", | ||
236 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
237 | }, | ||
238 | { | ||
239 | .clkdm_name = "iva2_clkdm", | ||
240 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
241 | }, | ||
242 | { | ||
243 | .clkdm_name = "mpu_clkdm", | ||
244 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
245 | }, | ||
246 | { | ||
247 | .clkdm_name = "wkup_clkdm", | ||
248 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
249 | }, | ||
250 | { NULL }, | ||
251 | }; | ||
252 | |||
253 | /* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */ | ||
254 | static struct clkdm_dep mpu_3xxx_wkdeps[] = { | ||
255 | { | ||
256 | .clkdm_name = "core_l3_clkdm", | ||
257 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
258 | }, | ||
259 | { | ||
260 | .clkdm_name = "core_l4_clkdm", | ||
261 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
262 | }, | ||
263 | { | ||
264 | .clkdm_name = "iva2_clkdm", | ||
265 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
266 | }, | ||
267 | { | ||
268 | .clkdm_name = "dss_clkdm", | ||
269 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
270 | }, | ||
271 | { | ||
272 | .clkdm_name = "per_clkdm", | ||
273 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
274 | }, | ||
275 | { NULL }, | ||
276 | }; | ||
277 | |||
278 | /* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */ | ||
279 | static struct clkdm_dep iva2_wkdeps[] = { | ||
280 | { | ||
281 | .clkdm_name = "core_l3_clkdm", | ||
282 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
283 | }, | ||
284 | { | ||
285 | .clkdm_name = "core_l4_clkdm", | ||
286 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
287 | }, | ||
288 | { | ||
289 | .clkdm_name = "mpu_clkdm", | ||
290 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
291 | }, | ||
292 | { | ||
293 | .clkdm_name = "wkup_clkdm", | ||
294 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
295 | }, | ||
296 | { | ||
297 | .clkdm_name = "dss_clkdm", | ||
298 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
299 | }, | ||
300 | { | ||
301 | .clkdm_name = "per_clkdm", | ||
302 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
303 | }, | ||
304 | { NULL }, | ||
305 | }; | ||
306 | |||
307 | |||
308 | /* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */ | ||
309 | static struct clkdm_dep cam_wkdeps[] = { | ||
310 | { | ||
311 | .clkdm_name = "iva2_clkdm", | ||
312 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
313 | }, | ||
314 | { | ||
315 | .clkdm_name = "mpu_clkdm", | ||
316 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
317 | }, | ||
318 | { | ||
319 | .clkdm_name = "wkup_clkdm", | ||
320 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
321 | }, | ||
322 | { NULL }, | ||
323 | }; | ||
324 | |||
325 | /* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */ | ||
326 | static struct clkdm_dep dss_wkdeps[] = { | ||
327 | { | ||
328 | .clkdm_name = "iva2_clkdm", | ||
329 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
330 | }, | ||
331 | { | ||
332 | .clkdm_name = "mpu_clkdm", | ||
333 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
334 | }, | ||
335 | { | ||
336 | .clkdm_name = "wkup_clkdm", | ||
337 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
338 | }, | ||
339 | { NULL }, | ||
340 | }; | ||
341 | |||
342 | /* 3430: PM_WKDEP_NEON: MPU */ | ||
343 | static struct clkdm_dep neon_wkdeps[] = { | ||
344 | { | ||
345 | .clkdm_name = "mpu_clkdm", | ||
346 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
347 | }, | ||
348 | { NULL }, | ||
349 | }; | ||
350 | |||
351 | |||
352 | /* Sleep dependency source arrays for OMAP3-specific clkdms */ | ||
353 | |||
354 | /* 3430: CM_SLEEPDEP_DSS: MPU, IVA */ | ||
355 | static struct clkdm_dep dss_sleepdeps[] = { | ||
356 | { | ||
357 | .clkdm_name = "mpu_clkdm", | ||
358 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
359 | }, | ||
360 | { | ||
361 | .clkdm_name = "iva2_clkdm", | ||
362 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
363 | }, | ||
364 | { NULL }, | ||
365 | }; | ||
366 | |||
367 | /* 3430: CM_SLEEPDEP_PER: MPU, IVA */ | ||
368 | static struct clkdm_dep per_sleepdeps[] = { | ||
369 | { | ||
370 | .clkdm_name = "mpu_clkdm", | ||
371 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
372 | }, | ||
373 | { | ||
374 | .clkdm_name = "iva2_clkdm", | ||
375 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
376 | }, | ||
377 | { NULL }, | ||
378 | }; | ||
379 | |||
380 | /* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */ | ||
381 | static struct clkdm_dep usbhost_sleepdeps[] = { | ||
382 | { | ||
383 | .clkdm_name = "mpu_clkdm", | ||
384 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
385 | }, | ||
386 | { | ||
387 | .clkdm_name = "iva2_clkdm", | ||
388 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
389 | }, | ||
390 | { NULL }, | ||
391 | }; | ||
392 | |||
393 | /* 3430: CM_SLEEPDEP_CAM: MPU */ | ||
394 | static struct clkdm_dep cam_sleepdeps[] = { | ||
395 | { | ||
396 | .clkdm_name = "mpu_clkdm", | ||
397 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
398 | }, | ||
399 | { NULL }, | ||
400 | }; | ||
401 | |||
402 | /* | ||
403 | * 3430ES1: CM_SLEEPDEP_GFX: MPU | ||
404 | * 3430ES2: CM_SLEEPDEP_SGX: MPU | ||
405 | * These can share data since they will never be present simultaneously | ||
406 | * on the same device. | ||
407 | */ | ||
408 | static struct clkdm_dep gfx_sgx_sleepdeps[] = { | ||
409 | { | ||
410 | .clkdm_name = "mpu_clkdm", | ||
411 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
412 | }, | ||
413 | { NULL }, | ||
414 | }; | ||
415 | |||
416 | #endif /* CONFIG_ARCH_OMAP3 */ | ||
417 | |||
14 | 418 | ||
15 | /* | 419 | /* |
16 | * OMAP2/3-common clockdomains | 420 | * OMAP2/3-common clockdomains |
@@ -21,10 +425,13 @@ | |||
21 | * sys_clkout/sys_clkout2. | 425 | * sys_clkout/sys_clkout2. |
22 | */ | 426 | */ |
23 | 427 | ||
428 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | ||
429 | |||
24 | /* This is an implicit clockdomain - it is never defined as such in TRM */ | 430 | /* This is an implicit clockdomain - it is never defined as such in TRM */ |
25 | static struct clockdomain wkup_clkdm = { | 431 | static struct clockdomain wkup_clkdm = { |
26 | .name = "wkup_clkdm", | 432 | .name = "wkup_clkdm", |
27 | .pwrdm = { .name = "wkup_pwrdm" }, | 433 | .pwrdm = { .name = "wkup_pwrdm" }, |
434 | .dep_bit = OMAP_EN_WKUP_SHIFT, | ||
28 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | 435 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), |
29 | }; | 436 | }; |
30 | 437 | ||
@@ -40,6 +447,8 @@ static struct clockdomain cm_clkdm = { | |||
40 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | 447 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), |
41 | }; | 448 | }; |
42 | 449 | ||
450 | #endif | ||
451 | |||
43 | /* | 452 | /* |
44 | * 2420-only clockdomains | 453 | * 2420-only clockdomains |
45 | */ | 454 | */ |
@@ -50,6 +459,8 @@ static struct clockdomain mpu_2420_clkdm = { | |||
50 | .name = "mpu_clkdm", | 459 | .name = "mpu_clkdm", |
51 | .pwrdm = { .name = "mpu_pwrdm" }, | 460 | .pwrdm = { .name = "mpu_pwrdm" }, |
52 | .flags = CLKDM_CAN_HWSUP, | 461 | .flags = CLKDM_CAN_HWSUP, |
462 | .clkstctrl_reg = OMAP2420_CM_REGADDR(MPU_MOD, OMAP2_CM_CLKSTCTRL), | ||
463 | .wkdep_srcs = mpu_24xx_wkdeps, | ||
53 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | 464 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
54 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 465 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
55 | }; | 466 | }; |
@@ -58,11 +469,64 @@ static struct clockdomain iva1_2420_clkdm = { | |||
58 | .name = "iva1_clkdm", | 469 | .name = "iva1_clkdm", |
59 | .pwrdm = { .name = "dsp_pwrdm" }, | 470 | .pwrdm = { .name = "dsp_pwrdm" }, |
60 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 471 | .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, | ||
475 | .wkdep_srcs = dsp_24xx_wkdeps, | ||
61 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, | 476 | .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK, |
62 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 477 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
63 | }; | 478 | }; |
64 | 479 | ||
65 | #endif /* CONFIG_ARCH_OMAP2420 */ | 480 | static struct clockdomain dsp_2420_clkdm = { |
481 | .name = "dsp_clkdm", | ||
482 | .pwrdm = { .name = "dsp_pwrdm" }, | ||
483 | .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, | ||
487 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
488 | }; | ||
489 | |||
490 | static struct clockdomain gfx_2420_clkdm = { | ||
491 | .name = "gfx_clkdm", | ||
492 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
493 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
494 | .clkstctrl_reg = OMAP2420_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), | ||
495 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
496 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | ||
497 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
498 | }; | ||
499 | |||
500 | static struct clockdomain core_l3_2420_clkdm = { | ||
501 | .name = "core_l3_clkdm", | ||
502 | .pwrdm = { .name = "core_pwrdm" }, | ||
503 | .flags = CLKDM_CAN_HWSUP, | ||
504 | .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
505 | .wkdep_srcs = core_24xx_wkdeps, | ||
506 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | ||
507 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
508 | }; | ||
509 | |||
510 | static struct clockdomain core_l4_2420_clkdm = { | ||
511 | .name = "core_l4_clkdm", | ||
512 | .pwrdm = { .name = "core_pwrdm" }, | ||
513 | .flags = CLKDM_CAN_HWSUP, | ||
514 | .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
515 | .wkdep_srcs = core_24xx_wkdeps, | ||
516 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | ||
517 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
518 | }; | ||
519 | |||
520 | static struct clockdomain dss_2420_clkdm = { | ||
521 | .name = "dss_clkdm", | ||
522 | .pwrdm = { .name = "core_pwrdm" }, | ||
523 | .flags = CLKDM_CAN_HWSUP, | ||
524 | .clkstctrl_reg = OMAP2420_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
525 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | ||
526 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | ||
527 | }; | ||
528 | |||
529 | #endif /* CONFIG_ARCH_OMAP2420 */ | ||
66 | 530 | ||
67 | 531 | ||
68 | /* | 532 | /* |
@@ -75,80 +539,105 @@ static struct clockdomain mpu_2430_clkdm = { | |||
75 | .name = "mpu_clkdm", | 539 | .name = "mpu_clkdm", |
76 | .pwrdm = { .name = "mpu_pwrdm" }, | 540 | .pwrdm = { .name = "mpu_pwrdm" }, |
77 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 541 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
542 | .clkstctrl_reg = OMAP2430_CM_REGADDR(MPU_MOD, | ||
543 | OMAP2_CM_CLKSTCTRL), | ||
544 | .wkdep_srcs = mpu_24xx_wkdeps, | ||
78 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, | 545 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK, |
79 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 546 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
80 | }; | 547 | }; |
81 | 548 | ||
549 | /* Another case of bit name collisions between several registers: EN_MDM */ | ||
82 | static struct clockdomain mdm_clkdm = { | 550 | static struct clockdomain mdm_clkdm = { |
83 | .name = "mdm_clkdm", | 551 | .name = "mdm_clkdm", |
84 | .pwrdm = { .name = "mdm_pwrdm" }, | 552 | .pwrdm = { .name = "mdm_pwrdm" }, |
85 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 553 | .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, | ||
557 | .wkdep_srcs = mdm_2430_wkdeps, | ||
86 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, | 558 | .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK, |
87 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 559 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
88 | }; | 560 | }; |
89 | 561 | ||
90 | #endif /* CONFIG_ARCH_OMAP2430 */ | 562 | static struct clockdomain dsp_2430_clkdm = { |
91 | |||
92 | |||
93 | /* | ||
94 | * 24XX-only clockdomains | ||
95 | */ | ||
96 | |||
97 | #if defined(CONFIG_ARCH_OMAP24XX) | ||
98 | |||
99 | static struct clockdomain dsp_clkdm = { | ||
100 | .name = "dsp_clkdm", | 563 | .name = "dsp_clkdm", |
101 | .pwrdm = { .name = "dsp_pwrdm" }, | 564 | .pwrdm = { .name = "dsp_pwrdm" }, |
102 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 565 | .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, | ||
569 | .wkdep_srcs = dsp_24xx_wkdeps, | ||
103 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, | 570 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK, |
104 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 571 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
105 | }; | 572 | }; |
106 | 573 | ||
107 | static struct clockdomain gfx_24xx_clkdm = { | 574 | static struct clockdomain gfx_2430_clkdm = { |
108 | .name = "gfx_clkdm", | 575 | .name = "gfx_clkdm", |
109 | .pwrdm = { .name = "gfx_pwrdm" }, | 576 | .pwrdm = { .name = "gfx_pwrdm" }, |
110 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 577 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
578 | .clkstctrl_reg = OMAP2430_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), | ||
579 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
111 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, | 580 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK, |
112 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 581 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
113 | }; | 582 | }; |
114 | 583 | ||
115 | static struct clockdomain core_l3_24xx_clkdm = { | 584 | /* |
585 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
586 | * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm | ||
587 | * could cause trouble | ||
588 | */ | ||
589 | static struct clockdomain core_l3_2430_clkdm = { | ||
116 | .name = "core_l3_clkdm", | 590 | .name = "core_l3_clkdm", |
117 | .pwrdm = { .name = "core_pwrdm" }, | 591 | .pwrdm = { .name = "core_pwrdm" }, |
118 | .flags = CLKDM_CAN_HWSUP, | 592 | .flags = CLKDM_CAN_HWSUP, |
593 | .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
594 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | ||
595 | .wkdep_srcs = core_24xx_wkdeps, | ||
119 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, | 596 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK, |
120 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 597 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
121 | }; | 598 | }; |
122 | 599 | ||
123 | static struct clockdomain core_l4_24xx_clkdm = { | 600 | /* |
601 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
602 | * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm | ||
603 | * could cause trouble | ||
604 | */ | ||
605 | static struct clockdomain core_l4_2430_clkdm = { | ||
124 | .name = "core_l4_clkdm", | 606 | .name = "core_l4_clkdm", |
125 | .pwrdm = { .name = "core_pwrdm" }, | 607 | .pwrdm = { .name = "core_pwrdm" }, |
126 | .flags = CLKDM_CAN_HWSUP, | 608 | .flags = CLKDM_CAN_HWSUP, |
609 | .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
610 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | ||
611 | .wkdep_srcs = core_24xx_wkdeps, | ||
127 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, | 612 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK, |
128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 613 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
129 | }; | 614 | }; |
130 | 615 | ||
131 | static struct clockdomain dss_24xx_clkdm = { | 616 | static struct clockdomain dss_2430_clkdm = { |
132 | .name = "dss_clkdm", | 617 | .name = "dss_clkdm", |
133 | .pwrdm = { .name = "core_pwrdm" }, | 618 | .pwrdm = { .name = "core_pwrdm" }, |
134 | .flags = CLKDM_CAN_HWSUP, | 619 | .flags = CLKDM_CAN_HWSUP, |
620 | .clkstctrl_reg = OMAP2430_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
135 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, | 621 | .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK, |
136 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 622 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
137 | }; | 623 | }; |
138 | 624 | ||
139 | #endif /* CONFIG_ARCH_OMAP24XX */ | 625 | #endif /* CONFIG_ARCH_OMAP2430 */ |
140 | 626 | ||
141 | 627 | ||
142 | /* | 628 | /* |
143 | * 34xx clockdomains | 629 | * OMAP3 clockdomains |
144 | */ | 630 | */ |
145 | 631 | ||
146 | #if defined(CONFIG_ARCH_OMAP34XX) | 632 | #if defined(CONFIG_ARCH_OMAP3) |
147 | 633 | ||
148 | static struct clockdomain mpu_34xx_clkdm = { | 634 | static struct clockdomain mpu_3xxx_clkdm = { |
149 | .name = "mpu_clkdm", | 635 | .name = "mpu_clkdm", |
150 | .pwrdm = { .name = "mpu_pwrdm" }, | 636 | .pwrdm = { .name = "mpu_pwrdm" }, |
151 | .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP, | 637 | .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, | ||
640 | .wkdep_srcs = mpu_3xxx_wkdeps, | ||
152 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, | 641 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK, |
153 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 642 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
154 | }; | 643 | }; |
@@ -157,6 +646,9 @@ static struct clockdomain neon_clkdm = { | |||
157 | .name = "neon_clkdm", | 646 | .name = "neon_clkdm", |
158 | .pwrdm = { .name = "neon_pwrdm" }, | 647 | .pwrdm = { .name = "neon_pwrdm" }, |
159 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 648 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
649 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_NEON_MOD, | ||
650 | OMAP2_CM_CLKSTCTRL), | ||
651 | .wkdep_srcs = neon_wkdeps, | ||
160 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, | 652 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK, |
161 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 653 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
162 | }; | 654 | }; |
@@ -165,6 +657,10 @@ static struct clockdomain iva2_clkdm = { | |||
165 | .name = "iva2_clkdm", | 657 | .name = "iva2_clkdm", |
166 | .pwrdm = { .name = "iva2_pwrdm" }, | 658 | .pwrdm = { .name = "iva2_pwrdm" }, |
167 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 659 | .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, | ||
663 | .wkdep_srcs = iva2_wkdeps, | ||
168 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, | 664 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, |
169 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 665 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
170 | }; | 666 | }; |
@@ -173,6 +669,9 @@ static struct clockdomain gfx_3430es1_clkdm = { | |||
173 | .name = "gfx_clkdm", | 669 | .name = "gfx_clkdm", |
174 | .pwrdm = { .name = "gfx_pwrdm" }, | 670 | .pwrdm = { .name = "gfx_pwrdm" }, |
175 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 671 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
672 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(GFX_MOD, OMAP2_CM_CLKSTCTRL), | ||
673 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
674 | .sleepdep_srcs = gfx_sgx_sleepdeps, | ||
176 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, | 675 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK, |
177 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), | 676 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1), |
178 | }; | 677 | }; |
@@ -181,6 +680,10 @@ static struct clockdomain sgx_clkdm = { | |||
181 | .name = "sgx_clkdm", | 680 | .name = "sgx_clkdm", |
182 | .pwrdm = { .name = "sgx_pwrdm" }, | 681 | .pwrdm = { .name = "sgx_pwrdm" }, |
183 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 682 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
683 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_SGX_MOD, | ||
684 | OMAP2_CM_CLKSTCTRL), | ||
685 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
686 | .sleepdep_srcs = gfx_sgx_sleepdeps, | ||
184 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, | 687 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK, |
185 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 688 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
186 | }; | 689 | }; |
@@ -196,30 +699,51 @@ static struct clockdomain d2d_clkdm = { | |||
196 | .name = "d2d_clkdm", | 699 | .name = "d2d_clkdm", |
197 | .pwrdm = { .name = "core_pwrdm" }, | 700 | .pwrdm = { .name = "core_pwrdm" }, |
198 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 701 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
702 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
199 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, | 703 | .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK, |
200 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 704 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
201 | }; | 705 | }; |
202 | 706 | ||
203 | static struct clockdomain core_l3_34xx_clkdm = { | 707 | /* |
708 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
709 | * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm | ||
710 | * could cause trouble | ||
711 | */ | ||
712 | static struct clockdomain core_l3_3xxx_clkdm = { | ||
204 | .name = "core_l3_clkdm", | 713 | .name = "core_l3_clkdm", |
205 | .pwrdm = { .name = "core_pwrdm" }, | 714 | .pwrdm = { .name = "core_pwrdm" }, |
206 | .flags = CLKDM_CAN_HWSUP, | 715 | .flags = CLKDM_CAN_HWSUP, |
716 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
717 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | ||
207 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, | 718 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK, |
208 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 719 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
209 | }; | 720 | }; |
210 | 721 | ||
211 | static struct clockdomain core_l4_34xx_clkdm = { | 722 | /* |
723 | * XXX add usecounting for clkdm dependencies, otherwise the presence | ||
724 | * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm | ||
725 | * could cause trouble | ||
726 | */ | ||
727 | static struct clockdomain core_l4_3xxx_clkdm = { | ||
212 | .name = "core_l4_clkdm", | 728 | .name = "core_l4_clkdm", |
213 | .pwrdm = { .name = "core_pwrdm" }, | 729 | .pwrdm = { .name = "core_pwrdm" }, |
214 | .flags = CLKDM_CAN_HWSUP, | 730 | .flags = CLKDM_CAN_HWSUP, |
731 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(CORE_MOD, OMAP2_CM_CLKSTCTRL), | ||
732 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | ||
215 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, | 733 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK, |
216 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 734 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
217 | }; | 735 | }; |
218 | 736 | ||
219 | static struct clockdomain dss_34xx_clkdm = { | 737 | /* Another case of bit name collisions between several registers: EN_DSS */ |
738 | static struct clockdomain dss_3xxx_clkdm = { | ||
220 | .name = "dss_clkdm", | 739 | .name = "dss_clkdm", |
221 | .pwrdm = { .name = "dss_pwrdm" }, | 740 | .pwrdm = { .name = "dss_pwrdm" }, |
222 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 741 | .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, | ||
745 | .wkdep_srcs = dss_wkdeps, | ||
746 | .sleepdep_srcs = dss_sleepdeps, | ||
223 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, | 747 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK, |
224 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 748 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
225 | }; | 749 | }; |
@@ -228,6 +752,10 @@ static struct clockdomain cam_clkdm = { | |||
228 | .name = "cam_clkdm", | 752 | .name = "cam_clkdm", |
229 | .pwrdm = { .name = "cam_pwrdm" }, | 753 | .pwrdm = { .name = "cam_pwrdm" }, |
230 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 754 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
755 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_CAM_MOD, | ||
756 | OMAP2_CM_CLKSTCTRL), | ||
757 | .wkdep_srcs = cam_wkdeps, | ||
758 | .sleepdep_srcs = cam_sleepdeps, | ||
231 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, | 759 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK, |
232 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 760 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
233 | }; | 761 | }; |
@@ -236,6 +764,10 @@ static struct clockdomain usbhost_clkdm = { | |||
236 | .name = "usbhost_clkdm", | 764 | .name = "usbhost_clkdm", |
237 | .pwrdm = { .name = "usbhost_pwrdm" }, | 765 | .pwrdm = { .name = "usbhost_pwrdm" }, |
238 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 766 | .flags = CLKDM_CAN_HWSUP_SWSUP, |
767 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, | ||
768 | OMAP2_CM_CLKSTCTRL), | ||
769 | .wkdep_srcs = usbhost_wkdeps, | ||
770 | .sleepdep_srcs = usbhost_sleepdeps, | ||
239 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, | 771 | .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK, |
240 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 772 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
241 | }; | 773 | }; |
@@ -244,6 +776,11 @@ static struct clockdomain per_clkdm = { | |||
244 | .name = "per_clkdm", | 776 | .name = "per_clkdm", |
245 | .pwrdm = { .name = "per_pwrdm" }, | 777 | .pwrdm = { .name = "per_pwrdm" }, |
246 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 778 | .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, | ||
782 | .wkdep_srcs = per_wkdeps, | ||
783 | .sleepdep_srcs = per_sleepdeps, | ||
247 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, | 784 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK, |
248 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 785 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
249 | }; | 786 | }; |
@@ -256,6 +793,8 @@ static struct clockdomain emu_clkdm = { | |||
256 | .name = "emu_clkdm", | 793 | .name = "emu_clkdm", |
257 | .pwrdm = { .name = "emu_pwrdm" }, | 794 | .pwrdm = { .name = "emu_pwrdm" }, |
258 | .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, | 795 | .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP, |
796 | .clkstctrl_reg = OMAP34XX_CM_REGADDR(OMAP3430_EMU_MOD, | ||
797 | OMAP2_CM_CLKSTCTRL), | ||
259 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, | 798 | .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK, |
260 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 799 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
261 | }; | 800 | }; |
@@ -290,64 +829,70 @@ static struct clockdomain dpll5_clkdm = { | |||
290 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 829 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
291 | }; | 830 | }; |
292 | 831 | ||
293 | #endif /* CONFIG_ARCH_OMAP34XX */ | 832 | #endif /* CONFIG_ARCH_OMAP3 */ |
833 | |||
834 | #include "clockdomains44xx.h" | ||
294 | 835 | ||
295 | /* | 836 | /* |
296 | * Clockdomain-powerdomain hwsup dependencies (34XX only) | 837 | * Clockdomain hwsup dependencies (OMAP3 only) |
297 | */ | 838 | */ |
298 | 839 | ||
299 | static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = { | 840 | static struct clkdm_autodep clkdm_autodeps[] = { |
300 | { | 841 | { |
301 | .pwrdm = { .name = "mpu_pwrdm" }, | 842 | .clkdm = { .name = "mpu_clkdm" }, |
302 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 843 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
303 | }, | 844 | }, |
304 | { | 845 | { |
305 | .pwrdm = { .name = "iva2_pwrdm" }, | 846 | .clkdm = { .name = "iva2_clkdm" }, |
306 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | 847 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) |
307 | }, | 848 | }, |
308 | { | 849 | { |
309 | .pwrdm = { .name = NULL }, | 850 | .clkdm = { .name = NULL }, |
310 | } | 851 | } |
311 | }; | 852 | }; |
312 | 853 | ||
313 | /* | 854 | /* |
314 | * | 855 | * List of clockdomain pointers per platform |
315 | */ | 856 | */ |
316 | 857 | ||
317 | static struct clockdomain *clockdomains_omap[] = { | 858 | static struct clockdomain *clockdomains_omap[] = { |
318 | 859 | ||
860 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | ||
319 | &wkup_clkdm, | 861 | &wkup_clkdm, |
320 | &cm_clkdm, | 862 | &cm_clkdm, |
321 | &prm_clkdm, | 863 | &prm_clkdm, |
864 | #endif | ||
322 | 865 | ||
323 | #ifdef CONFIG_ARCH_OMAP2420 | 866 | #ifdef CONFIG_ARCH_OMAP2420 |
324 | &mpu_2420_clkdm, | 867 | &mpu_2420_clkdm, |
325 | &iva1_2420_clkdm, | 868 | &iva1_2420_clkdm, |
869 | &dsp_2420_clkdm, | ||
870 | &gfx_2420_clkdm, | ||
871 | &core_l3_2420_clkdm, | ||
872 | &core_l4_2420_clkdm, | ||
873 | &dss_2420_clkdm, | ||
326 | #endif | 874 | #endif |
327 | 875 | ||
328 | #ifdef CONFIG_ARCH_OMAP2430 | 876 | #ifdef CONFIG_ARCH_OMAP2430 |
329 | &mpu_2430_clkdm, | 877 | &mpu_2430_clkdm, |
330 | &mdm_clkdm, | 878 | &mdm_clkdm, |
879 | &dsp_2430_clkdm, | ||
880 | &gfx_2430_clkdm, | ||
881 | &core_l3_2430_clkdm, | ||
882 | &core_l4_2430_clkdm, | ||
883 | &dss_2430_clkdm, | ||
331 | #endif | 884 | #endif |
332 | 885 | ||
333 | #ifdef CONFIG_ARCH_OMAP24XX | 886 | #ifdef CONFIG_ARCH_OMAP3 |
334 | &dsp_clkdm, | 887 | &mpu_3xxx_clkdm, |
335 | &gfx_24xx_clkdm, | ||
336 | &core_l3_24xx_clkdm, | ||
337 | &core_l4_24xx_clkdm, | ||
338 | &dss_24xx_clkdm, | ||
339 | #endif | ||
340 | |||
341 | #ifdef CONFIG_ARCH_OMAP34XX | ||
342 | &mpu_34xx_clkdm, | ||
343 | &neon_clkdm, | 888 | &neon_clkdm, |
344 | &iva2_clkdm, | 889 | &iva2_clkdm, |
345 | &gfx_3430es1_clkdm, | 890 | &gfx_3430es1_clkdm, |
346 | &sgx_clkdm, | 891 | &sgx_clkdm, |
347 | &d2d_clkdm, | 892 | &d2d_clkdm, |
348 | &core_l3_34xx_clkdm, | 893 | &core_l3_3xxx_clkdm, |
349 | &core_l4_34xx_clkdm, | 894 | &core_l4_3xxx_clkdm, |
350 | &dss_34xx_clkdm, | 895 | &dss_3xxx_clkdm, |
351 | &cam_clkdm, | 896 | &cam_clkdm, |
352 | &usbhost_clkdm, | 897 | &usbhost_clkdm, |
353 | &per_clkdm, | 898 | &per_clkdm, |
@@ -359,6 +904,33 @@ static struct clockdomain *clockdomains_omap[] = { | |||
359 | &dpll5_clkdm, | 904 | &dpll5_clkdm, |
360 | #endif | 905 | #endif |
361 | 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 | |||
362 | NULL, | 934 | NULL, |
363 | }; | 935 | }; |
364 | 936 | ||
diff --git a/arch/arm/mach-omap2/clockdomains44xx.h b/arch/arm/mach-omap2/clockdomains44xx.h new file mode 100644 index 000000000000..438aaee2e392 --- /dev/null +++ b/arch/arm/mach-omap2/clockdomains44xx.h | |||
@@ -0,0 +1,250 @@ | |||
1 | /* | ||
2 | * OMAP4 Clock domains framework | ||
3 | * | ||
4 | * Copyright (C) 2009 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2009 Nokia Corporation | ||
6 | * | ||
7 | * Abhijit Pagare (abhijitpagare@ti.com) | ||
8 | * Benoit Cousson (b-cousson@ti.com) | ||
9 | * | ||
10 | * This file is automatically generated from the OMAP hardware databases. | ||
11 | * We respectfully ask that any modifications to this file be coordinated | ||
12 | * with the public linux-omap@vger.kernel.org mailing list and the | ||
13 | * authors above to ensure that the autogeneration scripts are kept | ||
14 | * up-to-date with the file contents. | ||
15 | * | ||
16 | * This program is free software; you can redistribute it and/or modify | ||
17 | * it under the terms of the GNU General Public License version 2 as | ||
18 | * published by the Free Software Foundation. | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | * To-Do List | ||
23 | * -> Populate the Sleep/Wakeup dependencies for the domains | ||
24 | */ | ||
25 | |||
26 | #ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H | ||
27 | #define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS44XX_H | ||
28 | |||
29 | #include <plat/clockdomain.h> | ||
30 | |||
31 | #if defined(CONFIG_ARCH_OMAP4) | ||
32 | |||
33 | static struct clockdomain l4_cefuse_44xx_clkdm = { | ||
34 | .name = "l4_cefuse_clkdm", | ||
35 | .pwrdm = { .name = "cefuse_pwrdm" }, | ||
36 | .clkstctrl_reg = OMAP4430_CM_CEFUSE_CLKSTCTRL, | ||
37 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
38 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
39 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
40 | }; | ||
41 | |||
42 | static struct clockdomain l4_cfg_44xx_clkdm = { | ||
43 | .name = "l4_cfg_clkdm", | ||
44 | .pwrdm = { .name = "core_pwrdm" }, | ||
45 | .clkstctrl_reg = OMAP4430_CM_L4CFG_CLKSTCTRL, | ||
46 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
47 | .flags = CLKDM_CAN_HWSUP, | ||
48 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
49 | }; | ||
50 | |||
51 | static struct clockdomain tesla_44xx_clkdm = { | ||
52 | .name = "tesla_clkdm", | ||
53 | .pwrdm = { .name = "tesla_pwrdm" }, | ||
54 | .clkstctrl_reg = OMAP4430_CM_TESLA_CLKSTCTRL, | ||
55 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
56 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
57 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
58 | }; | ||
59 | |||
60 | static struct clockdomain l3_gfx_44xx_clkdm = { | ||
61 | .name = "l3_gfx_clkdm", | ||
62 | .pwrdm = { .name = "gfx_pwrdm" }, | ||
63 | .clkstctrl_reg = OMAP4430_CM_GFX_CLKSTCTRL, | ||
64 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
65 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
66 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
67 | }; | ||
68 | |||
69 | static struct clockdomain ivahd_44xx_clkdm = { | ||
70 | .name = "ivahd_clkdm", | ||
71 | .pwrdm = { .name = "ivahd_pwrdm" }, | ||
72 | .clkstctrl_reg = OMAP4430_CM_IVAHD_CLKSTCTRL, | ||
73 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
74 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
75 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
76 | }; | ||
77 | |||
78 | static struct clockdomain l4_secure_44xx_clkdm = { | ||
79 | .name = "l4_secure_clkdm", | ||
80 | .pwrdm = { .name = "l4per_pwrdm" }, | ||
81 | .clkstctrl_reg = OMAP4430_CM_L4SEC_CLKSTCTRL, | ||
82 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
83 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
84 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
85 | }; | ||
86 | |||
87 | static struct clockdomain l4_per_44xx_clkdm = { | ||
88 | .name = "l4_per_clkdm", | ||
89 | .pwrdm = { .name = "l4per_pwrdm" }, | ||
90 | .clkstctrl_reg = OMAP4430_CM_L4PER_CLKSTCTRL, | ||
91 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
92 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
93 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
94 | }; | ||
95 | |||
96 | static struct clockdomain abe_44xx_clkdm = { | ||
97 | .name = "abe_clkdm", | ||
98 | .pwrdm = { .name = "abe_pwrdm" }, | ||
99 | .clkstctrl_reg = OMAP4430_CM1_ABE_CLKSTCTRL, | ||
100 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
101 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
102 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
103 | }; | ||
104 | |||
105 | static struct clockdomain l3_instr_44xx_clkdm = { | ||
106 | .name = "l3_instr_clkdm", | ||
107 | .pwrdm = { .name = "core_pwrdm" }, | ||
108 | .clkstctrl_reg = OMAP4430_CM_L3INSTR_CLKSTCTRL, | ||
109 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
110 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
111 | }; | ||
112 | |||
113 | static struct clockdomain l3_init_44xx_clkdm = { | ||
114 | .name = "l3_init_clkdm", | ||
115 | .pwrdm = { .name = "l3init_pwrdm" }, | ||
116 | .clkstctrl_reg = OMAP4430_CM_L3INIT_CLKSTCTRL, | ||
117 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
118 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
119 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
120 | }; | ||
121 | |||
122 | static struct clockdomain mpuss_44xx_clkdm = { | ||
123 | .name = "mpuss_clkdm", | ||
124 | .pwrdm = { .name = "mpu_pwrdm" }, | ||
125 | .clkstctrl_reg = OMAP4430_CM_MPU_CLKSTCTRL, | ||
126 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
127 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
128 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
129 | }; | ||
130 | |||
131 | static struct clockdomain mpu0_44xx_clkdm = { | ||
132 | .name = "mpu0_clkdm", | ||
133 | .pwrdm = { .name = "cpu0_pwrdm" }, | ||
134 | .clkstctrl_reg = OMAP4430_CM_PDA_CPU0_CLKSTCTRL, | ||
135 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
136 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
137 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
138 | }; | ||
139 | |||
140 | static struct clockdomain mpu1_44xx_clkdm = { | ||
141 | .name = "mpu1_clkdm", | ||
142 | .pwrdm = { .name = "cpu1_pwrdm" }, | ||
143 | .clkstctrl_reg = OMAP4430_CM_PDA_CPU1_CLKSTCTRL, | ||
144 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
145 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
146 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
147 | }; | ||
148 | |||
149 | static struct clockdomain l3_emif_44xx_clkdm = { | ||
150 | .name = "l3_emif_clkdm", | ||
151 | .pwrdm = { .name = "core_pwrdm" }, | ||
152 | .clkstctrl_reg = OMAP4430_CM_MEMIF_CLKSTCTRL, | ||
153 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
154 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
155 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
156 | }; | ||
157 | |||
158 | static struct clockdomain l4_ao_44xx_clkdm = { | ||
159 | .name = "l4_ao_clkdm", | ||
160 | .pwrdm = { .name = "always_on_core_pwrdm" }, | ||
161 | .clkstctrl_reg = OMAP4430_CM_ALWON_CLKSTCTRL, | ||
162 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
163 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
165 | }; | ||
166 | |||
167 | static struct clockdomain ducati_44xx_clkdm = { | ||
168 | .name = "ducati_clkdm", | ||
169 | .pwrdm = { .name = "core_pwrdm" }, | ||
170 | .clkstctrl_reg = OMAP4430_CM_DUCATI_CLKSTCTRL, | ||
171 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
172 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
173 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
174 | }; | ||
175 | |||
176 | static struct clockdomain l3_2_44xx_clkdm = { | ||
177 | .name = "l3_2_clkdm", | ||
178 | .pwrdm = { .name = "core_pwrdm" }, | ||
179 | .clkstctrl_reg = OMAP4430_CM_L3_2_CLKSTCTRL, | ||
180 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
181 | .flags = CLKDM_CAN_HWSUP, | ||
182 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
183 | }; | ||
184 | |||
185 | static struct clockdomain l3_1_44xx_clkdm = { | ||
186 | .name = "l3_1_clkdm", | ||
187 | .pwrdm = { .name = "core_pwrdm" }, | ||
188 | .clkstctrl_reg = OMAP4430_CM_L3_1_CLKSTCTRL, | ||
189 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
190 | .flags = CLKDM_CAN_HWSUP, | ||
191 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
192 | }; | ||
193 | |||
194 | static struct clockdomain l3_d2d_44xx_clkdm = { | ||
195 | .name = "l3_d2d_clkdm", | ||
196 | .pwrdm = { .name = "core_pwrdm" }, | ||
197 | .clkstctrl_reg = OMAP4430_CM_D2D_CLKSTCTRL, | ||
198 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
199 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
200 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
201 | }; | ||
202 | |||
203 | static struct clockdomain iss_44xx_clkdm = { | ||
204 | .name = "iss_clkdm", | ||
205 | .pwrdm = { .name = "cam_pwrdm" }, | ||
206 | .clkstctrl_reg = OMAP4430_CM_CAM_CLKSTCTRL, | ||
207 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
208 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
209 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
210 | }; | ||
211 | |||
212 | static struct clockdomain l3_dss_44xx_clkdm = { | ||
213 | .name = "l3_dss_clkdm", | ||
214 | .pwrdm = { .name = "dss_pwrdm" }, | ||
215 | .clkstctrl_reg = OMAP4430_CM_DSS_CLKSTCTRL, | ||
216 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
217 | .flags = CLKDM_CAN_HWSUP_SWSUP, | ||
218 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
219 | }; | ||
220 | |||
221 | static struct clockdomain l4_wkup_44xx_clkdm = { | ||
222 | .name = "l4_wkup_clkdm", | ||
223 | .pwrdm = { .name = "wkup_pwrdm" }, | ||
224 | .clkstctrl_reg = OMAP4430_CM_WKUP_CLKSTCTRL, | ||
225 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
226 | .flags = CLKDM_CAN_HWSUP, | ||
227 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
228 | }; | ||
229 | |||
230 | static struct clockdomain emu_sys_44xx_clkdm = { | ||
231 | .name = "emu_sys_clkdm", | ||
232 | .pwrdm = { .name = "emu_pwrdm" }, | ||
233 | .clkstctrl_reg = OMAP4430_CM_EMU_CLKSTCTRL, | ||
234 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
235 | .flags = CLKDM_CAN_HWSUP, | ||
236 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
237 | }; | ||
238 | |||
239 | static struct clockdomain l3_dma_44xx_clkdm = { | ||
240 | .name = "l3_dma_clkdm", | ||
241 | .pwrdm = { .name = "core_pwrdm" }, | ||
242 | .clkstctrl_reg = OMAP4430_CM_SDMA_CLKSTCTRL, | ||
243 | .clktrctrl_mask = OMAP4430_CLKTRCTRL_MASK, | ||
244 | .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, | ||
245 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
246 | }; | ||
247 | |||
248 | #endif | ||
249 | |||
250 | #endif | ||
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index 6923deb98a28..a3a3ca07e383 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h | |||
@@ -55,7 +55,7 @@ | |||
55 | /* Bits specific to each register */ | 55 | /* Bits specific to each register */ |
56 | 56 | ||
57 | /* CM_FCLKEN_IVA2 */ | 57 | /* CM_FCLKEN_IVA2 */ |
58 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2 (1 << 0) | 58 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK (1 << 0) |
59 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT 0 | 59 | #define OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT 0 |
60 | 60 | ||
61 | /* CM_CLKEN_PLL_IVA2 */ | 61 | /* CM_CLKEN_PLL_IVA2 */ |
@@ -168,6 +168,12 @@ | |||
168 | #define OMAP3430_EN_SDRC (1 << 1) | 168 | #define OMAP3430_EN_SDRC (1 << 1) |
169 | #define OMAP3430_EN_SDRC_SHIFT 1 | 169 | #define OMAP3430_EN_SDRC_SHIFT 1 |
170 | 170 | ||
171 | /* AM35XX specific CM_ICLKEN1_CORE bits */ | ||
172 | #define AM35XX_EN_IPSS_MASK (1 << 4) | ||
173 | #define AM35XX_EN_IPSS_SHIFT 4 | ||
174 | #define AM35XX_EN_UART4_MASK (1 << 23) | ||
175 | #define AM35XX_EN_UART4_SHIFT 23 | ||
176 | |||
171 | /* CM_ICLKEN2_CORE */ | 177 | /* CM_ICLKEN2_CORE */ |
172 | #define OMAP3430_EN_PKA (1 << 4) | 178 | #define OMAP3430_EN_PKA (1 << 4) |
173 | #define OMAP3430_EN_PKA_SHIFT 4 | 179 | #define OMAP3430_EN_PKA_SHIFT 4 |
@@ -220,6 +226,10 @@ | |||
220 | #define OMAP3430_ST_SSI_STDBY_SHIFT 0 | 226 | #define OMAP3430_ST_SSI_STDBY_SHIFT 0 |
221 | #define OMAP3430_ST_SSI_STDBY_MASK (1 << 0) | 227 | #define OMAP3430_ST_SSI_STDBY_MASK (1 << 0) |
222 | 228 | ||
229 | /* AM35xx specific CM_IDLEST1_CORE bits */ | ||
230 | #define AM35XX_ST_IPSS_SHIFT 5 | ||
231 | #define AM35XX_ST_IPSS_MASK (1 << 5) | ||
232 | |||
223 | /* CM_IDLEST2_CORE */ | 233 | /* CM_IDLEST2_CORE */ |
224 | #define OMAP3430_ST_PKA_SHIFT 4 | 234 | #define OMAP3430_ST_PKA_SHIFT 4 |
225 | #define OMAP3430_ST_PKA_MASK (1 << 4) | 235 | #define OMAP3430_ST_PKA_MASK (1 << 4) |
@@ -336,6 +346,8 @@ | |||
336 | #define OMAP3430_CLKSEL_L4_MASK (0x3 << 2) | 346 | #define OMAP3430_CLKSEL_L4_MASK (0x3 << 2) |
337 | #define OMAP3430_CLKSEL_L3_SHIFT 0 | 347 | #define OMAP3430_CLKSEL_L3_SHIFT 0 |
338 | #define OMAP3430_CLKSEL_L3_MASK (0x3 << 0) | 348 | #define OMAP3430_CLKSEL_L3_MASK (0x3 << 0) |
349 | #define OMAP3630_CLKSEL_96M_SHIFT 12 | ||
350 | #define OMAP3630_CLKSEL_96M_MASK (0x3 << 12) | ||
339 | 351 | ||
340 | /* CM_CLKSTCTRL_CORE */ | 352 | /* CM_CLKSTCTRL_CORE */ |
341 | #define OMAP3430ES1_CLKTRCTRL_D2D_SHIFT 4 | 353 | #define OMAP3430ES1_CLKTRCTRL_D2D_SHIFT 4 |
@@ -379,6 +391,10 @@ | |||
379 | #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT 1 | 391 | #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_SHIFT 1 |
380 | #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_MASK (1 << 1) | 392 | #define OMAP3430ES2_CM_FCLKEN_SGX_EN_SGX_MASK (1 << 1) |
381 | 393 | ||
394 | /* CM_IDLEST_SGX */ | ||
395 | #define OMAP3430ES2_ST_SGX_SHIFT 1 | ||
396 | #define OMAP3430ES2_ST_SGX_MASK (1 << 1) | ||
397 | |||
382 | /* CM_ICLKEN_SGX */ | 398 | /* CM_ICLKEN_SGX */ |
383 | #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT 0 | 399 | #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_SHIFT 0 |
384 | #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_MASK (1 << 0) | 400 | #define OMAP3430ES2_CM_ICLKEN_SGX_EN_SGX_MASK (1 << 0) |
@@ -517,12 +533,18 @@ | |||
517 | /* CM_CLKSEL2_PLL */ | 533 | /* CM_CLKSEL2_PLL */ |
518 | #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8 | 534 | #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8 |
519 | #define OMAP3430_PERIPH_DPLL_MULT_MASK (0x7ff << 8) | 535 | #define OMAP3430_PERIPH_DPLL_MULT_MASK (0x7ff << 8) |
536 | #define OMAP3630_PERIPH_DPLL_MULT_MASK (0xfff << 8) | ||
520 | #define OMAP3430_PERIPH_DPLL_DIV_SHIFT 0 | 537 | #define OMAP3430_PERIPH_DPLL_DIV_SHIFT 0 |
521 | #define OMAP3430_PERIPH_DPLL_DIV_MASK (0x7f << 0) | 538 | #define OMAP3430_PERIPH_DPLL_DIV_MASK (0x7f << 0) |
539 | #define OMAP3630_PERIPH_DPLL_DCO_SEL_SHIFT 21 | ||
540 | #define OMAP3630_PERIPH_DPLL_DCO_SEL_MASK (0x7 << 21) | ||
541 | #define OMAP3630_PERIPH_DPLL_SD_DIV_SHIFT 24 | ||
542 | #define OMAP3630_PERIPH_DPLL_SD_DIV_MASK (0xff << 24) | ||
522 | 543 | ||
523 | /* CM_CLKSEL3_PLL */ | 544 | /* CM_CLKSEL3_PLL */ |
524 | #define OMAP3430_DIV_96M_SHIFT 0 | 545 | #define OMAP3430_DIV_96M_SHIFT 0 |
525 | #define OMAP3430_DIV_96M_MASK (0x1f << 0) | 546 | #define OMAP3430_DIV_96M_MASK (0x1f << 0) |
547 | #define OMAP3630_DIV_96M_MASK (0x3f << 0) | ||
526 | 548 | ||
527 | /* CM_CLKSEL4_PLL */ | 549 | /* CM_CLKSEL4_PLL */ |
528 | #define OMAP3430ES2_PERIPH2_DPLL_MULT_SHIFT 8 | 550 | #define OMAP3430ES2_PERIPH2_DPLL_MULT_SHIFT 8 |
@@ -569,8 +591,10 @@ | |||
569 | /* CM_CLKSEL_DSS */ | 591 | /* CM_CLKSEL_DSS */ |
570 | #define OMAP3430_CLKSEL_TV_SHIFT 8 | 592 | #define OMAP3430_CLKSEL_TV_SHIFT 8 |
571 | #define OMAP3430_CLKSEL_TV_MASK (0x1f << 8) | 593 | #define OMAP3430_CLKSEL_TV_MASK (0x1f << 8) |
594 | #define OMAP3630_CLKSEL_TV_MASK (0x3f << 8) | ||
572 | #define OMAP3430_CLKSEL_DSS1_SHIFT 0 | 595 | #define OMAP3430_CLKSEL_DSS1_SHIFT 0 |
573 | #define OMAP3430_CLKSEL_DSS1_MASK (0x1f << 0) | 596 | #define OMAP3430_CLKSEL_DSS1_MASK (0x1f << 0) |
597 | #define OMAP3630_CLKSEL_DSS1_MASK (0x3f << 0) | ||
574 | 598 | ||
575 | /* CM_SLEEPDEP_DSS specific bits */ | 599 | /* CM_SLEEPDEP_DSS specific bits */ |
576 | 600 | ||
@@ -598,6 +622,7 @@ | |||
598 | /* CM_CLKSEL_CAM */ | 622 | /* CM_CLKSEL_CAM */ |
599 | #define OMAP3430_CLKSEL_CAM_SHIFT 0 | 623 | #define OMAP3430_CLKSEL_CAM_SHIFT 0 |
600 | #define OMAP3430_CLKSEL_CAM_MASK (0x1f << 0) | 624 | #define OMAP3430_CLKSEL_CAM_MASK (0x1f << 0) |
625 | #define OMAP3630_CLKSEL_CAM_MASK (0x3f << 0) | ||
601 | 626 | ||
602 | /* CM_SLEEPDEP_CAM specific bits */ | 627 | /* CM_SLEEPDEP_CAM specific bits */ |
603 | 628 | ||
@@ -693,6 +718,7 @@ | |||
693 | /* CM_CLKSEL1_EMU */ | 718 | /* CM_CLKSEL1_EMU */ |
694 | #define OMAP3430_DIV_DPLL4_SHIFT 24 | 719 | #define OMAP3430_DIV_DPLL4_SHIFT 24 |
695 | #define OMAP3430_DIV_DPLL4_MASK (0x1f << 24) | 720 | #define OMAP3430_DIV_DPLL4_MASK (0x1f << 24) |
721 | #define OMAP3630_DIV_DPLL4_MASK (0x3f << 24) | ||
696 | #define OMAP3430_DIV_DPLL3_SHIFT 16 | 722 | #define OMAP3430_DIV_DPLL3_SHIFT 16 |
697 | #define OMAP3430_DIV_DPLL3_MASK (0x1f << 16) | 723 | #define OMAP3430_DIV_DPLL3_MASK (0x1f << 16) |
698 | #define OMAP3430_CLKSEL_TRACECLK_SHIFT 11 | 724 | #define OMAP3430_CLKSEL_TRACECLK_SHIFT 11 |
diff --git a/arch/arm/mach-omap2/cm-regbits-44xx.h b/arch/arm/mach-omap2/cm-regbits-44xx.h index 0e67f75aa35c..ac8458e43252 100644 --- a/arch/arm/mach-omap2/cm-regbits-44xx.h +++ b/arch/arm/mach-omap2/cm-regbits-44xx.h | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | 27 | ||
28 | /* Used by CM_L3_1_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP */ | 28 | /* Used by CM_L3_1_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP */ |
29 | #define OMAP4430_ABE_DYNDEP_SHIFT (1 << 3) | 29 | #define OMAP4430_ABE_DYNDEP_SHIFT 3 |
30 | #define OMAP4430_ABE_DYNDEP_MASK BITFIELD(3, 3) | 30 | #define OMAP4430_ABE_DYNDEP_MASK BITFIELD(3, 3) |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -34,15 +34,15 @@ | |||
34 | * CM_L3INIT_STATICDEP, CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, | 34 | * CM_L3INIT_STATICDEP, CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, |
35 | * CM_TESLA_STATICDEP | 35 | * CM_TESLA_STATICDEP |
36 | */ | 36 | */ |
37 | #define OMAP4430_ABE_STATDEP_SHIFT (1 << 3) | 37 | #define OMAP4430_ABE_STATDEP_SHIFT 3 |
38 | #define OMAP4430_ABE_STATDEP_MASK BITFIELD(3, 3) | 38 | #define OMAP4430_ABE_STATDEP_MASK BITFIELD(3, 3) |
39 | 39 | ||
40 | /* Used by CM_L4CFG_DYNAMICDEP */ | 40 | /* Used by CM_L4CFG_DYNAMICDEP */ |
41 | #define OMAP4430_ALWONCORE_DYNDEP_SHIFT (1 << 16) | 41 | #define OMAP4430_ALWONCORE_DYNDEP_SHIFT 16 |
42 | #define OMAP4430_ALWONCORE_DYNDEP_MASK BITFIELD(16, 16) | 42 | #define OMAP4430_ALWONCORE_DYNDEP_MASK BITFIELD(16, 16) |
43 | 43 | ||
44 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */ | 44 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */ |
45 | #define OMAP4430_ALWONCORE_STATDEP_SHIFT (1 << 16) | 45 | #define OMAP4430_ALWONCORE_STATDEP_SHIFT 16 |
46 | #define OMAP4430_ALWONCORE_STATDEP_MASK BITFIELD(16, 16) | 46 | #define OMAP4430_ALWONCORE_STATDEP_MASK BITFIELD(16, 16) |
47 | 47 | ||
48 | /* | 48 | /* |
@@ -50,371 +50,371 @@ | |||
50 | * CM_AUTOIDLE_DPLL_CORE_RESTORE, CM_AUTOIDLE_DPLL_ABE, CM_AUTOIDLE_DPLL_CORE, | 50 | * CM_AUTOIDLE_DPLL_CORE_RESTORE, CM_AUTOIDLE_DPLL_ABE, CM_AUTOIDLE_DPLL_CORE, |
51 | * CM_AUTOIDLE_DPLL_DDRPHY, CM_AUTOIDLE_DPLL_IVA, CM_AUTOIDLE_DPLL_MPU | 51 | * CM_AUTOIDLE_DPLL_DDRPHY, CM_AUTOIDLE_DPLL_IVA, CM_AUTOIDLE_DPLL_MPU |
52 | */ | 52 | */ |
53 | #define OMAP4430_AUTO_DPLL_MODE_SHIFT (1 << 0) | 53 | #define OMAP4430_AUTO_DPLL_MODE_SHIFT 0 |
54 | #define OMAP4430_AUTO_DPLL_MODE_MASK BITFIELD(0, 2) | 54 | #define OMAP4430_AUTO_DPLL_MODE_MASK BITFIELD(0, 2) |
55 | 55 | ||
56 | /* Used by CM_L4CFG_DYNAMICDEP */ | 56 | /* Used by CM_L4CFG_DYNAMICDEP */ |
57 | #define OMAP4430_CEFUSE_DYNDEP_SHIFT (1 << 17) | 57 | #define OMAP4430_CEFUSE_DYNDEP_SHIFT 17 |
58 | #define OMAP4430_CEFUSE_DYNDEP_MASK BITFIELD(17, 17) | 58 | #define OMAP4430_CEFUSE_DYNDEP_MASK BITFIELD(17, 17) |
59 | 59 | ||
60 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */ | 60 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP, CM_TESLA_STATICDEP */ |
61 | #define OMAP4430_CEFUSE_STATDEP_SHIFT (1 << 17) | 61 | #define OMAP4430_CEFUSE_STATDEP_SHIFT 17 |
62 | #define OMAP4430_CEFUSE_STATDEP_MASK BITFIELD(17, 17) | 62 | #define OMAP4430_CEFUSE_STATDEP_MASK BITFIELD(17, 17) |
63 | 63 | ||
64 | /* Used by CM1_ABE_CLKSTCTRL */ | 64 | /* Used by CM1_ABE_CLKSTCTRL */ |
65 | #define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_SHIFT (1 << 13) | 65 | #define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_SHIFT 13 |
66 | #define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_MASK BITFIELD(13, 13) | 66 | #define OMAP4430_CLKACTIVITY_ABE_24M_GFCLK_MASK BITFIELD(13, 13) |
67 | 67 | ||
68 | /* Used by CM1_ABE_CLKSTCTRL */ | 68 | /* Used by CM1_ABE_CLKSTCTRL */ |
69 | #define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_SHIFT (1 << 12) | 69 | #define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_SHIFT 12 |
70 | #define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_MASK BITFIELD(12, 12) | 70 | #define OMAP4430_CLKACTIVITY_ABE_ALWON_32K_CLK_MASK BITFIELD(12, 12) |
71 | 71 | ||
72 | /* Used by CM_WKUP_CLKSTCTRL */ | 72 | /* Used by CM_WKUP_CLKSTCTRL */ |
73 | #define OMAP4430_CLKACTIVITY_ABE_LP_CLK_SHIFT (1 << 9) | 73 | #define OMAP4430_CLKACTIVITY_ABE_LP_CLK_SHIFT 9 |
74 | #define OMAP4430_CLKACTIVITY_ABE_LP_CLK_MASK BITFIELD(9, 9) | 74 | #define OMAP4430_CLKACTIVITY_ABE_LP_CLK_MASK BITFIELD(9, 9) |
75 | 75 | ||
76 | /* Used by CM1_ABE_CLKSTCTRL */ | 76 | /* Used by CM1_ABE_CLKSTCTRL */ |
77 | #define OMAP4430_CLKACTIVITY_ABE_SYSCLK_SHIFT (1 << 11) | 77 | #define OMAP4430_CLKACTIVITY_ABE_SYSCLK_SHIFT 11 |
78 | #define OMAP4430_CLKACTIVITY_ABE_SYSCLK_MASK BITFIELD(11, 11) | 78 | #define OMAP4430_CLKACTIVITY_ABE_SYSCLK_MASK BITFIELD(11, 11) |
79 | 79 | ||
80 | /* Used by CM1_ABE_CLKSTCTRL */ | 80 | /* Used by CM1_ABE_CLKSTCTRL */ |
81 | #define OMAP4430_CLKACTIVITY_ABE_X2_CLK_SHIFT (1 << 8) | 81 | #define OMAP4430_CLKACTIVITY_ABE_X2_CLK_SHIFT 8 |
82 | #define OMAP4430_CLKACTIVITY_ABE_X2_CLK_MASK BITFIELD(8, 8) | 82 | #define OMAP4430_CLKACTIVITY_ABE_X2_CLK_MASK BITFIELD(8, 8) |
83 | 83 | ||
84 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ | 84 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ |
85 | #define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_SHIFT (1 << 11) | 85 | #define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_SHIFT 11 |
86 | #define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_MASK BITFIELD(11, 11) | 86 | #define OMAP4430_CLKACTIVITY_ASYNC_DLL_CLK_MASK BITFIELD(11, 11) |
87 | 87 | ||
88 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ | 88 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ |
89 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_SHIFT (1 << 12) | 89 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_SHIFT 12 |
90 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_MASK BITFIELD(12, 12) | 90 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY1_CLK_MASK BITFIELD(12, 12) |
91 | 91 | ||
92 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ | 92 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ |
93 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_SHIFT (1 << 13) | 93 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_SHIFT 13 |
94 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_MASK BITFIELD(13, 13) | 94 | #define OMAP4430_CLKACTIVITY_ASYNC_PHY2_CLK_MASK BITFIELD(13, 13) |
95 | 95 | ||
96 | /* Used by CM_CAM_CLKSTCTRL */ | 96 | /* Used by CM_CAM_CLKSTCTRL */ |
97 | #define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_SHIFT (1 << 9) | 97 | #define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_SHIFT 9 |
98 | #define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_MASK BITFIELD(9, 9) | 98 | #define OMAP4430_CLKACTIVITY_CAM_PHY_CTRL_GCLK_MASK BITFIELD(9, 9) |
99 | 99 | ||
100 | /* Used by CM_EMU_CLKSTCTRL */ | 100 | /* Used by CM_EMU_CLKSTCTRL */ |
101 | #define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_SHIFT (1 << 9) | 101 | #define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_SHIFT 9 |
102 | #define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_MASK BITFIELD(9, 9) | 102 | #define OMAP4430_CLKACTIVITY_CORE_DPLL_EMU_CLK_MASK BITFIELD(9, 9) |
103 | 103 | ||
104 | /* Used by CM_CEFUSE_CLKSTCTRL */ | 104 | /* Used by CM_CEFUSE_CLKSTCTRL */ |
105 | #define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT (1 << 9) | 105 | #define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_SHIFT 9 |
106 | #define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK BITFIELD(9, 9) | 106 | #define OMAP4430_CLKACTIVITY_CUST_EFUSE_SYS_CLK_MASK BITFIELD(9, 9) |
107 | 107 | ||
108 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ | 108 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ |
109 | #define OMAP4430_CLKACTIVITY_DLL_CLK_SHIFT (1 << 9) | 109 | #define OMAP4430_CLKACTIVITY_DLL_CLK_SHIFT 9 |
110 | #define OMAP4430_CLKACTIVITY_DLL_CLK_MASK BITFIELD(9, 9) | 110 | #define OMAP4430_CLKACTIVITY_DLL_CLK_MASK BITFIELD(9, 9) |
111 | 111 | ||
112 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 112 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
113 | #define OMAP4430_CLKACTIVITY_DMT10_GFCLK_SHIFT (1 << 9) | 113 | #define OMAP4430_CLKACTIVITY_DMT10_GFCLK_SHIFT 9 |
114 | #define OMAP4430_CLKACTIVITY_DMT10_GFCLK_MASK BITFIELD(9, 9) | 114 | #define OMAP4430_CLKACTIVITY_DMT10_GFCLK_MASK BITFIELD(9, 9) |
115 | 115 | ||
116 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 116 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
117 | #define OMAP4430_CLKACTIVITY_DMT11_GFCLK_SHIFT (1 << 10) | 117 | #define OMAP4430_CLKACTIVITY_DMT11_GFCLK_SHIFT 10 |
118 | #define OMAP4430_CLKACTIVITY_DMT11_GFCLK_MASK BITFIELD(10, 10) | 118 | #define OMAP4430_CLKACTIVITY_DMT11_GFCLK_MASK BITFIELD(10, 10) |
119 | 119 | ||
120 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 120 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
121 | #define OMAP4430_CLKACTIVITY_DMT2_GFCLK_SHIFT (1 << 11) | 121 | #define OMAP4430_CLKACTIVITY_DMT2_GFCLK_SHIFT 11 |
122 | #define OMAP4430_CLKACTIVITY_DMT2_GFCLK_MASK BITFIELD(11, 11) | 122 | #define OMAP4430_CLKACTIVITY_DMT2_GFCLK_MASK BITFIELD(11, 11) |
123 | 123 | ||
124 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 124 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
125 | #define OMAP4430_CLKACTIVITY_DMT3_GFCLK_SHIFT (1 << 12) | 125 | #define OMAP4430_CLKACTIVITY_DMT3_GFCLK_SHIFT 12 |
126 | #define OMAP4430_CLKACTIVITY_DMT3_GFCLK_MASK BITFIELD(12, 12) | 126 | #define OMAP4430_CLKACTIVITY_DMT3_GFCLK_MASK BITFIELD(12, 12) |
127 | 127 | ||
128 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 128 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
129 | #define OMAP4430_CLKACTIVITY_DMT4_GFCLK_SHIFT (1 << 13) | 129 | #define OMAP4430_CLKACTIVITY_DMT4_GFCLK_SHIFT 13 |
130 | #define OMAP4430_CLKACTIVITY_DMT4_GFCLK_MASK BITFIELD(13, 13) | 130 | #define OMAP4430_CLKACTIVITY_DMT4_GFCLK_MASK BITFIELD(13, 13) |
131 | 131 | ||
132 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 132 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
133 | #define OMAP4430_CLKACTIVITY_DMT9_GFCLK_SHIFT (1 << 14) | 133 | #define OMAP4430_CLKACTIVITY_DMT9_GFCLK_SHIFT 14 |
134 | #define OMAP4430_CLKACTIVITY_DMT9_GFCLK_MASK BITFIELD(14, 14) | 134 | #define OMAP4430_CLKACTIVITY_DMT9_GFCLK_MASK BITFIELD(14, 14) |
135 | 135 | ||
136 | /* Used by CM_DSS_CLKSTCTRL */ | 136 | /* Used by CM_DSS_CLKSTCTRL */ |
137 | #define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_SHIFT (1 << 10) | 137 | #define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_SHIFT 10 |
138 | #define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_MASK BITFIELD(10, 10) | 138 | #define OMAP4430_CLKACTIVITY_DSS_ALWON_SYS_CLK_MASK BITFIELD(10, 10) |
139 | 139 | ||
140 | /* Used by CM_DSS_CLKSTCTRL */ | 140 | /* Used by CM_DSS_CLKSTCTRL */ |
141 | #define OMAP4430_CLKACTIVITY_DSS_FCLK_SHIFT (1 << 9) | 141 | #define OMAP4430_CLKACTIVITY_DSS_FCLK_SHIFT 9 |
142 | #define OMAP4430_CLKACTIVITY_DSS_FCLK_MASK BITFIELD(9, 9) | 142 | #define OMAP4430_CLKACTIVITY_DSS_FCLK_MASK BITFIELD(9, 9) |
143 | 143 | ||
144 | /* Used by CM_DUCATI_CLKSTCTRL */ | 144 | /* Used by CM_DUCATI_CLKSTCTRL */ |
145 | #define OMAP4430_CLKACTIVITY_DUCATI_GCLK_SHIFT (1 << 8) | 145 | #define OMAP4430_CLKACTIVITY_DUCATI_GCLK_SHIFT 8 |
146 | #define OMAP4430_CLKACTIVITY_DUCATI_GCLK_MASK BITFIELD(8, 8) | 146 | #define OMAP4430_CLKACTIVITY_DUCATI_GCLK_MASK BITFIELD(8, 8) |
147 | 147 | ||
148 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 148 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
149 | #define OMAP4430_CLKACTIVITY_EMAC_50MHZ_CLK_SHIFT (1 << 10) | 149 | #define OMAP4430_CLKACTIVITY_EMAC_50MHZ_CLK_SHIFT 10 |
150 | #define OMAP4430_CLKACTIVITY_EMAC_50MHZ_CLK_MASK BITFIELD(10, 10) | 150 | #define OMAP4430_CLKACTIVITY_EMAC_50MHZ_CLK_MASK BITFIELD(10, 10) |
151 | 151 | ||
152 | /* Used by CM_EMU_CLKSTCTRL */ | 152 | /* Used by CM_EMU_CLKSTCTRL */ |
153 | #define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_SHIFT (1 << 8) | 153 | #define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_SHIFT 8 |
154 | #define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_MASK BITFIELD(8, 8) | 154 | #define OMAP4430_CLKACTIVITY_EMU_SYS_CLK_MASK BITFIELD(8, 8) |
155 | 155 | ||
156 | /* Used by CM_CAM_CLKSTCTRL */ | 156 | /* Used by CM_CAM_CLKSTCTRL */ |
157 | #define OMAP4430_CLKACTIVITY_FDIF_GFCLK_SHIFT (1 << 10) | 157 | #define OMAP4430_CLKACTIVITY_FDIF_GFCLK_SHIFT 10 |
158 | #define OMAP4430_CLKACTIVITY_FDIF_GFCLK_MASK BITFIELD(10, 10) | 158 | #define OMAP4430_CLKACTIVITY_FDIF_GFCLK_MASK BITFIELD(10, 10) |
159 | 159 | ||
160 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 160 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
161 | #define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_SHIFT (1 << 15) | 161 | #define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_SHIFT 15 |
162 | #define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_MASK BITFIELD(15, 15) | 162 | #define OMAP4430_CLKACTIVITY_FUNC_12M_GFCLK_MASK BITFIELD(15, 15) |
163 | 163 | ||
164 | /* Used by CM1_ABE_CLKSTCTRL */ | 164 | /* Used by CM1_ABE_CLKSTCTRL */ |
165 | #define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_SHIFT (1 << 10) | 165 | #define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_SHIFT 10 |
166 | #define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_MASK BITFIELD(10, 10) | 166 | #define OMAP4430_CLKACTIVITY_FUNC_24M_GFCLK_MASK BITFIELD(10, 10) |
167 | 167 | ||
168 | /* Used by CM_DSS_CLKSTCTRL */ | 168 | /* Used by CM_DSS_CLKSTCTRL */ |
169 | #define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_SHIFT (1 << 11) | 169 | #define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_SHIFT 11 |
170 | #define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_MASK BITFIELD(11, 11) | 170 | #define OMAP4430_CLKACTIVITY_HDMI_PHY_48MHZ_GFCLK_MASK BITFIELD(11, 11) |
171 | 171 | ||
172 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 172 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
173 | #define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_SHIFT (1 << 20) | 173 | #define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_SHIFT 20 |
174 | #define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_MASK BITFIELD(20, 20) | 174 | #define OMAP4430_CLKACTIVITY_HSIC_P1_480M_GFCLK_MASK BITFIELD(20, 20) |
175 | 175 | ||
176 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 176 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
177 | #define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_SHIFT (1 << 26) | 177 | #define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_SHIFT 26 |
178 | #define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_MASK BITFIELD(26, 26) | 178 | #define OMAP4430_CLKACTIVITY_HSIC_P1_GFCLK_MASK BITFIELD(26, 26) |
179 | 179 | ||
180 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 180 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
181 | #define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_SHIFT (1 << 21) | 181 | #define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_SHIFT 21 |
182 | #define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_MASK BITFIELD(21, 21) | 182 | #define OMAP4430_CLKACTIVITY_HSIC_P2_480M_GFCLK_MASK BITFIELD(21, 21) |
183 | 183 | ||
184 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 184 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
185 | #define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_SHIFT (1 << 27) | 185 | #define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_SHIFT 27 |
186 | #define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_MASK BITFIELD(27, 27) | 186 | #define OMAP4430_CLKACTIVITY_HSIC_P2_GFCLK_MASK BITFIELD(27, 27) |
187 | 187 | ||
188 | /* Used by CM_L3INIT_CLKSTCTRL */ | 188 | /* Used by CM_L3INIT_CLKSTCTRL */ |
189 | #define OMAP4430_CLKACTIVITY_INIT_32K_GFCLK_SHIFT (1 << 31) | 189 | #define OMAP4430_CLKACTIVITY_INIT_32K_GFCLK_SHIFT 31 |
190 | #define OMAP4430_CLKACTIVITY_INIT_32K_GFCLK_MASK BITFIELD(31, 31) | 190 | #define OMAP4430_CLKACTIVITY_INIT_32K_GFCLK_MASK BITFIELD(31, 31) |
191 | 191 | ||
192 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 192 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
193 | #define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_SHIFT (1 << 13) | 193 | #define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_SHIFT 13 |
194 | #define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_MASK BITFIELD(13, 13) | 194 | #define OMAP4430_CLKACTIVITY_INIT_48MC_GFCLK_MASK BITFIELD(13, 13) |
195 | 195 | ||
196 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 196 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
197 | #define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_SHIFT (1 << 12) | 197 | #define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_SHIFT 12 |
198 | #define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_MASK BITFIELD(12, 12) | 198 | #define OMAP4430_CLKACTIVITY_INIT_48M_GFCLK_MASK BITFIELD(12, 12) |
199 | 199 | ||
200 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 200 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
201 | #define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_SHIFT (1 << 28) | 201 | #define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_SHIFT 28 |
202 | #define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_MASK BITFIELD(28, 28) | 202 | #define OMAP4430_CLKACTIVITY_INIT_60M_P1_GFCLK_MASK BITFIELD(28, 28) |
203 | 203 | ||
204 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 204 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
205 | #define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_SHIFT (1 << 29) | 205 | #define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_SHIFT 29 |
206 | #define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_MASK BITFIELD(29, 29) | 206 | #define OMAP4430_CLKACTIVITY_INIT_60M_P2_GFCLK_MASK BITFIELD(29, 29) |
207 | 207 | ||
208 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 208 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
209 | #define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_SHIFT (1 << 11) | 209 | #define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_SHIFT 11 |
210 | #define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_MASK BITFIELD(11, 11) | 210 | #define OMAP4430_CLKACTIVITY_INIT_96M_GFCLK_MASK BITFIELD(11, 11) |
211 | 211 | ||
212 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 212 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
213 | #define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_SHIFT (1 << 16) | 213 | #define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_SHIFT 16 |
214 | #define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_MASK BITFIELD(16, 16) | 214 | #define OMAP4430_CLKACTIVITY_INIT_HSI_GFCLK_MASK BITFIELD(16, 16) |
215 | 215 | ||
216 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 216 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
217 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_SHIFT (1 << 17) | 217 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_SHIFT 17 |
218 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_MASK BITFIELD(17, 17) | 218 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC1_GFCLK_MASK BITFIELD(17, 17) |
219 | 219 | ||
220 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 220 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
221 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_SHIFT (1 << 18) | 221 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_SHIFT 18 |
222 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_MASK BITFIELD(18, 18) | 222 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC2_GFCLK_MASK BITFIELD(18, 18) |
223 | 223 | ||
224 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 224 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
225 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_SHIFT (1 << 19) | 225 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_SHIFT 19 |
226 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_MASK BITFIELD(19, 19) | 226 | #define OMAP4430_CLKACTIVITY_INIT_HSMMC6_GFCLK_MASK BITFIELD(19, 19) |
227 | 227 | ||
228 | /* Used by CM_CAM_CLKSTCTRL */ | 228 | /* Used by CM_CAM_CLKSTCTRL */ |
229 | #define OMAP4430_CLKACTIVITY_ISS_GCLK_SHIFT (1 << 8) | 229 | #define OMAP4430_CLKACTIVITY_ISS_GCLK_SHIFT 8 |
230 | #define OMAP4430_CLKACTIVITY_ISS_GCLK_MASK BITFIELD(8, 8) | 230 | #define OMAP4430_CLKACTIVITY_ISS_GCLK_MASK BITFIELD(8, 8) |
231 | 231 | ||
232 | /* Used by CM_IVAHD_CLKSTCTRL */ | 232 | /* Used by CM_IVAHD_CLKSTCTRL */ |
233 | #define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_SHIFT (1 << 8) | 233 | #define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_SHIFT 8 |
234 | #define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_MASK BITFIELD(8, 8) | 234 | #define OMAP4430_CLKACTIVITY_IVAHD_ROOT_CLK_MASK BITFIELD(8, 8) |
235 | 235 | ||
236 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 236 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
237 | #define OMAP4430_CLKACTIVITY_L3INIT_DPLL_ALWON_CLK_SHIFT (1 << 14) | 237 | #define OMAP4430_CLKACTIVITY_L3INIT_DPLL_ALWON_CLK_SHIFT 14 |
238 | #define OMAP4430_CLKACTIVITY_L3INIT_DPLL_ALWON_CLK_MASK BITFIELD(14, 14) | 238 | #define OMAP4430_CLKACTIVITY_L3INIT_DPLL_ALWON_CLK_MASK BITFIELD(14, 14) |
239 | 239 | ||
240 | /* Used by CM_L3_1_CLKSTCTRL, CM_L3_1_CLKSTCTRL_RESTORE */ | 240 | /* Used by CM_L3_1_CLKSTCTRL, CM_L3_1_CLKSTCTRL_RESTORE */ |
241 | #define OMAP4430_CLKACTIVITY_L3_1_GICLK_SHIFT (1 << 8) | 241 | #define OMAP4430_CLKACTIVITY_L3_1_GICLK_SHIFT 8 |
242 | #define OMAP4430_CLKACTIVITY_L3_1_GICLK_MASK BITFIELD(8, 8) | 242 | #define OMAP4430_CLKACTIVITY_L3_1_GICLK_MASK BITFIELD(8, 8) |
243 | 243 | ||
244 | /* Used by CM_L3_2_CLKSTCTRL, CM_L3_2_CLKSTCTRL_RESTORE */ | 244 | /* Used by CM_L3_2_CLKSTCTRL, CM_L3_2_CLKSTCTRL_RESTORE */ |
245 | #define OMAP4430_CLKACTIVITY_L3_2_GICLK_SHIFT (1 << 8) | 245 | #define OMAP4430_CLKACTIVITY_L3_2_GICLK_SHIFT 8 |
246 | #define OMAP4430_CLKACTIVITY_L3_2_GICLK_MASK BITFIELD(8, 8) | 246 | #define OMAP4430_CLKACTIVITY_L3_2_GICLK_MASK BITFIELD(8, 8) |
247 | 247 | ||
248 | /* Used by CM_D2D_CLKSTCTRL */ | 248 | /* Used by CM_D2D_CLKSTCTRL */ |
249 | #define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_SHIFT (1 << 8) | 249 | #define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_SHIFT 8 |
250 | #define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_MASK BITFIELD(8, 8) | 250 | #define OMAP4430_CLKACTIVITY_L3_D2D_GICLK_MASK BITFIELD(8, 8) |
251 | 251 | ||
252 | /* Used by CM_SDMA_CLKSTCTRL */ | 252 | /* Used by CM_SDMA_CLKSTCTRL */ |
253 | #define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_SHIFT (1 << 8) | 253 | #define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_SHIFT 8 |
254 | #define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_MASK BITFIELD(8, 8) | 254 | #define OMAP4430_CLKACTIVITY_L3_DMA_GICLK_MASK BITFIELD(8, 8) |
255 | 255 | ||
256 | /* Used by CM_DSS_CLKSTCTRL */ | 256 | /* Used by CM_DSS_CLKSTCTRL */ |
257 | #define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_SHIFT (1 << 8) | 257 | #define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_SHIFT 8 |
258 | #define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_MASK BITFIELD(8, 8) | 258 | #define OMAP4430_CLKACTIVITY_L3_DSS_GICLK_MASK BITFIELD(8, 8) |
259 | 259 | ||
260 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ | 260 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ |
261 | #define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_SHIFT (1 << 8) | 261 | #define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_SHIFT 8 |
262 | #define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_MASK BITFIELD(8, 8) | 262 | #define OMAP4430_CLKACTIVITY_L3_EMIF_GICLK_MASK BITFIELD(8, 8) |
263 | 263 | ||
264 | /* Used by CM_GFX_CLKSTCTRL */ | 264 | /* Used by CM_GFX_CLKSTCTRL */ |
265 | #define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_SHIFT (1 << 8) | 265 | #define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_SHIFT 8 |
266 | #define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_MASK BITFIELD(8, 8) | 266 | #define OMAP4430_CLKACTIVITY_L3_GFX_GICLK_MASK BITFIELD(8, 8) |
267 | 267 | ||
268 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 268 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
269 | #define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_SHIFT (1 << 8) | 269 | #define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_SHIFT 8 |
270 | #define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_MASK BITFIELD(8, 8) | 270 | #define OMAP4430_CLKACTIVITY_L3_INIT_GICLK_MASK BITFIELD(8, 8) |
271 | 271 | ||
272 | /* Used by CM_L3INSTR_CLKSTCTRL */ | 272 | /* Used by CM_L3INSTR_CLKSTCTRL */ |
273 | #define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_SHIFT (1 << 8) | 273 | #define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_SHIFT 8 |
274 | #define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_MASK BITFIELD(8, 8) | 274 | #define OMAP4430_CLKACTIVITY_L3_INSTR_GICLK_MASK BITFIELD(8, 8) |
275 | 275 | ||
276 | /* Used by CM_L4SEC_CLKSTCTRL */ | 276 | /* Used by CM_L4SEC_CLKSTCTRL */ |
277 | #define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_SHIFT (1 << 8) | 277 | #define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_SHIFT 8 |
278 | #define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_MASK BITFIELD(8, 8) | 278 | #define OMAP4430_CLKACTIVITY_L3_SECURE_GICLK_MASK BITFIELD(8, 8) |
279 | 279 | ||
280 | /* Used by CM_ALWON_CLKSTCTRL */ | 280 | /* Used by CM_ALWON_CLKSTCTRL */ |
281 | #define OMAP4430_CLKACTIVITY_L4_AO_ICLK_SHIFT (1 << 8) | 281 | #define OMAP4430_CLKACTIVITY_L4_AO_ICLK_SHIFT 8 |
282 | #define OMAP4430_CLKACTIVITY_L4_AO_ICLK_MASK BITFIELD(8, 8) | 282 | #define OMAP4430_CLKACTIVITY_L4_AO_ICLK_MASK BITFIELD(8, 8) |
283 | 283 | ||
284 | /* Used by CM_CEFUSE_CLKSTCTRL */ | 284 | /* Used by CM_CEFUSE_CLKSTCTRL */ |
285 | #define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT (1 << 8) | 285 | #define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_SHIFT 8 |
286 | #define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_MASK BITFIELD(8, 8) | 286 | #define OMAP4430_CLKACTIVITY_L4_CEFUSE_GICLK_MASK BITFIELD(8, 8) |
287 | 287 | ||
288 | /* Used by CM_L4CFG_CLKSTCTRL, CM_L4CFG_CLKSTCTRL_RESTORE */ | 288 | /* Used by CM_L4CFG_CLKSTCTRL, CM_L4CFG_CLKSTCTRL_RESTORE */ |
289 | #define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_SHIFT (1 << 8) | 289 | #define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_SHIFT 8 |
290 | #define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_MASK BITFIELD(8, 8) | 290 | #define OMAP4430_CLKACTIVITY_L4_CFG_GICLK_MASK BITFIELD(8, 8) |
291 | 291 | ||
292 | /* Used by CM_D2D_CLKSTCTRL */ | 292 | /* Used by CM_D2D_CLKSTCTRL */ |
293 | #define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_SHIFT (1 << 9) | 293 | #define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_SHIFT 9 |
294 | #define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_MASK BITFIELD(9, 9) | 294 | #define OMAP4430_CLKACTIVITY_L4_D2D_GICLK_MASK BITFIELD(9, 9) |
295 | 295 | ||
296 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 296 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
297 | #define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_SHIFT (1 << 9) | 297 | #define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_SHIFT 9 |
298 | #define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_MASK BITFIELD(9, 9) | 298 | #define OMAP4430_CLKACTIVITY_L4_INIT_GICLK_MASK BITFIELD(9, 9) |
299 | 299 | ||
300 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 300 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
301 | #define OMAP4430_CLKACTIVITY_L4_PER_GICLK_SHIFT (1 << 8) | 301 | #define OMAP4430_CLKACTIVITY_L4_PER_GICLK_SHIFT 8 |
302 | #define OMAP4430_CLKACTIVITY_L4_PER_GICLK_MASK BITFIELD(8, 8) | 302 | #define OMAP4430_CLKACTIVITY_L4_PER_GICLK_MASK BITFIELD(8, 8) |
303 | 303 | ||
304 | /* Used by CM_L4SEC_CLKSTCTRL */ | 304 | /* Used by CM_L4SEC_CLKSTCTRL */ |
305 | #define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_SHIFT (1 << 9) | 305 | #define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_SHIFT 9 |
306 | #define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_MASK BITFIELD(9, 9) | 306 | #define OMAP4430_CLKACTIVITY_L4_SECURE_GICLK_MASK BITFIELD(9, 9) |
307 | 307 | ||
308 | /* Used by CM_WKUP_CLKSTCTRL */ | 308 | /* Used by CM_WKUP_CLKSTCTRL */ |
309 | #define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_SHIFT (1 << 12) | 309 | #define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_SHIFT 12 |
310 | #define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_MASK BITFIELD(12, 12) | 310 | #define OMAP4430_CLKACTIVITY_L4_WKUP_GICLK_MASK BITFIELD(12, 12) |
311 | 311 | ||
312 | /* Used by CM_MPU_CLKSTCTRL, CM_MPU_CLKSTCTRL_RESTORE */ | 312 | /* Used by CM_MPU_CLKSTCTRL, CM_MPU_CLKSTCTRL_RESTORE */ |
313 | #define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_SHIFT (1 << 8) | 313 | #define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_SHIFT 8 |
314 | #define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_MASK BITFIELD(8, 8) | 314 | #define OMAP4430_CLKACTIVITY_MPU_DPLL_CLK_MASK BITFIELD(8, 8) |
315 | 315 | ||
316 | /* Used by CM1_ABE_CLKSTCTRL */ | 316 | /* Used by CM1_ABE_CLKSTCTRL */ |
317 | #define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_SHIFT (1 << 9) | 317 | #define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_SHIFT 9 |
318 | #define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_MASK BITFIELD(9, 9) | 318 | #define OMAP4430_CLKACTIVITY_OCP_ABE_GICLK_MASK BITFIELD(9, 9) |
319 | 319 | ||
320 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 320 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
321 | #define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_SHIFT (1 << 16) | 321 | #define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_SHIFT 16 |
322 | #define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_MASK BITFIELD(16, 16) | 322 | #define OMAP4430_CLKACTIVITY_PER_24MC_GFCLK_MASK BITFIELD(16, 16) |
323 | 323 | ||
324 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 324 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
325 | #define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_SHIFT (1 << 17) | 325 | #define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_SHIFT 17 |
326 | #define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_MASK BITFIELD(17, 17) | 326 | #define OMAP4430_CLKACTIVITY_PER_32K_GFCLK_MASK BITFIELD(17, 17) |
327 | 327 | ||
328 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 328 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
329 | #define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_SHIFT (1 << 18) | 329 | #define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_SHIFT 18 |
330 | #define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_MASK BITFIELD(18, 18) | 330 | #define OMAP4430_CLKACTIVITY_PER_48M_GFCLK_MASK BITFIELD(18, 18) |
331 | 331 | ||
332 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 332 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
333 | #define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_SHIFT (1 << 19) | 333 | #define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_SHIFT 19 |
334 | #define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_MASK BITFIELD(19, 19) | 334 | #define OMAP4430_CLKACTIVITY_PER_96M_GFCLK_MASK BITFIELD(19, 19) |
335 | 335 | ||
336 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 336 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
337 | #define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_SHIFT (1 << 25) | 337 | #define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_SHIFT 25 |
338 | #define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_MASK BITFIELD(25, 25) | 338 | #define OMAP4430_CLKACTIVITY_PER_ABE_24M_GFCLK_MASK BITFIELD(25, 25) |
339 | 339 | ||
340 | /* Used by CM_EMU_CLKSTCTRL */ | 340 | /* Used by CM_EMU_CLKSTCTRL */ |
341 | #define OMAP4430_CLKACTIVITY_PER_DPLL_EMU_CLK_SHIFT (1 << 10) | 341 | #define OMAP4430_CLKACTIVITY_PER_DPLL_EMU_CLK_SHIFT 10 |
342 | #define OMAP4430_CLKACTIVITY_PER_DPLL_EMU_CLK_MASK BITFIELD(10, 10) | 342 | #define OMAP4430_CLKACTIVITY_PER_DPLL_EMU_CLK_MASK BITFIELD(10, 10) |
343 | 343 | ||
344 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 344 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
345 | #define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_SHIFT (1 << 20) | 345 | #define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_SHIFT 20 |
346 | #define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_MASK BITFIELD(20, 20) | 346 | #define OMAP4430_CLKACTIVITY_PER_MCASP2_GFCLK_MASK BITFIELD(20, 20) |
347 | 347 | ||
348 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 348 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
349 | #define OMAP4430_CLKACTIVITY_PER_MCASP3_GFCLK_SHIFT (1 << 21) | 349 | #define OMAP4430_CLKACTIVITY_PER_MCASP3_GFCLK_SHIFT 21 |
350 | #define OMAP4430_CLKACTIVITY_PER_MCASP3_GFCLK_MASK BITFIELD(21, 21) | 350 | #define OMAP4430_CLKACTIVITY_PER_MCASP3_GFCLK_MASK BITFIELD(21, 21) |
351 | 351 | ||
352 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 352 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
353 | #define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_SHIFT (1 << 22) | 353 | #define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_SHIFT 22 |
354 | #define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_MASK BITFIELD(22, 22) | 354 | #define OMAP4430_CLKACTIVITY_PER_MCBSP4_GFCLK_MASK BITFIELD(22, 22) |
355 | 355 | ||
356 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ | 356 | /* Used by CM_L4PER_CLKSTCTRL, CM_L4PER_CLKSTCTRL_RESTORE */ |
357 | #define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_SHIFT (1 << 24) | 357 | #define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_SHIFT 24 |
358 | #define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_MASK BITFIELD(24, 24) | 358 | #define OMAP4430_CLKACTIVITY_PER_SYS_GFCLK_MASK BITFIELD(24, 24) |
359 | 359 | ||
360 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ | 360 | /* Used by CM_MEMIF_CLKSTCTRL, CM_MEMIF_CLKSTCTRL_RESTORE */ |
361 | #define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_SHIFT (1 << 10) | 361 | #define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_SHIFT 10 |
362 | #define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_MASK BITFIELD(10, 10) | 362 | #define OMAP4430_CLKACTIVITY_PHY_ROOT_CLK_MASK BITFIELD(10, 10) |
363 | 363 | ||
364 | /* Used by CM_GFX_CLKSTCTRL */ | 364 | /* Used by CM_GFX_CLKSTCTRL */ |
365 | #define OMAP4430_CLKACTIVITY_SGX_GFCLK_SHIFT (1 << 9) | 365 | #define OMAP4430_CLKACTIVITY_SGX_GFCLK_SHIFT 9 |
366 | #define OMAP4430_CLKACTIVITY_SGX_GFCLK_MASK BITFIELD(9, 9) | 366 | #define OMAP4430_CLKACTIVITY_SGX_GFCLK_MASK BITFIELD(9, 9) |
367 | 367 | ||
368 | /* Used by CM_ALWON_CLKSTCTRL */ | 368 | /* Used by CM_ALWON_CLKSTCTRL */ |
369 | #define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_SHIFT (1 << 11) | 369 | #define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_SHIFT 11 |
370 | #define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_MASK BITFIELD(11, 11) | 370 | #define OMAP4430_CLKACTIVITY_SR_CORE_SYSCLK_MASK BITFIELD(11, 11) |
371 | 371 | ||
372 | /* Used by CM_ALWON_CLKSTCTRL */ | 372 | /* Used by CM_ALWON_CLKSTCTRL */ |
373 | #define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_SHIFT (1 << 10) | 373 | #define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_SHIFT 10 |
374 | #define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_MASK BITFIELD(10, 10) | 374 | #define OMAP4430_CLKACTIVITY_SR_IVA_SYSCLK_MASK BITFIELD(10, 10) |
375 | 375 | ||
376 | /* Used by CM_ALWON_CLKSTCTRL */ | 376 | /* Used by CM_ALWON_CLKSTCTRL */ |
377 | #define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_SHIFT (1 << 9) | 377 | #define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_SHIFT 9 |
378 | #define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_MASK BITFIELD(9, 9) | 378 | #define OMAP4430_CLKACTIVITY_SR_MPU_SYSCLK_MASK BITFIELD(9, 9) |
379 | 379 | ||
380 | /* Used by CM_WKUP_CLKSTCTRL */ | 380 | /* Used by CM_WKUP_CLKSTCTRL */ |
381 | #define OMAP4430_CLKACTIVITY_SYS_CLK_SHIFT (1 << 8) | 381 | #define OMAP4430_CLKACTIVITY_SYS_CLK_SHIFT 8 |
382 | #define OMAP4430_CLKACTIVITY_SYS_CLK_MASK BITFIELD(8, 8) | 382 | #define OMAP4430_CLKACTIVITY_SYS_CLK_MASK BITFIELD(8, 8) |
383 | 383 | ||
384 | /* Used by CM_TESLA_CLKSTCTRL */ | 384 | /* Used by CM_TESLA_CLKSTCTRL */ |
385 | #define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_SHIFT (1 << 8) | 385 | #define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_SHIFT 8 |
386 | #define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_MASK BITFIELD(8, 8) | 386 | #define OMAP4430_CLKACTIVITY_TESLA_ROOT_CLK_MASK BITFIELD(8, 8) |
387 | 387 | ||
388 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 388 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
389 | #define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_SHIFT (1 << 22) | 389 | #define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_SHIFT 22 |
390 | #define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_MASK BITFIELD(22, 22) | 390 | #define OMAP4430_CLKACTIVITY_TLL_CH0_GFCLK_MASK BITFIELD(22, 22) |
391 | 391 | ||
392 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 392 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
393 | #define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_SHIFT (1 << 23) | 393 | #define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_SHIFT 23 |
394 | #define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_MASK BITFIELD(23, 23) | 394 | #define OMAP4430_CLKACTIVITY_TLL_CH1_GFCLK_MASK BITFIELD(23, 23) |
395 | 395 | ||
396 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 396 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
397 | #define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_SHIFT (1 << 24) | 397 | #define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_SHIFT 24 |
398 | #define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_MASK BITFIELD(24, 24) | 398 | #define OMAP4430_CLKACTIVITY_TLL_CH2_GFCLK_MASK BITFIELD(24, 24) |
399 | 399 | ||
400 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 400 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
401 | #define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_SHIFT (1 << 15) | 401 | #define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_SHIFT 15 |
402 | #define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_MASK BITFIELD(15, 15) | 402 | #define OMAP4430_CLKACTIVITY_USB_DPLL_HS_CLK_MASK BITFIELD(15, 15) |
403 | 403 | ||
404 | /* Used by CM_WKUP_CLKSTCTRL */ | 404 | /* Used by CM_WKUP_CLKSTCTRL */ |
405 | #define OMAP4430_CLKACTIVITY_USIM_GFCLK_SHIFT (1 << 10) | 405 | #define OMAP4430_CLKACTIVITY_USIM_GFCLK_SHIFT 10 |
406 | #define OMAP4430_CLKACTIVITY_USIM_GFCLK_MASK BITFIELD(10, 10) | 406 | #define OMAP4430_CLKACTIVITY_USIM_GFCLK_MASK BITFIELD(10, 10) |
407 | 407 | ||
408 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 408 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
409 | #define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_SHIFT (1 << 30) | 409 | #define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_SHIFT 30 |
410 | #define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_MASK BITFIELD(30, 30) | 410 | #define OMAP4430_CLKACTIVITY_UTMI_P3_GFCLK_MASK BITFIELD(30, 30) |
411 | 411 | ||
412 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ | 412 | /* Used by CM_L3INIT_CLKSTCTRL, CM_L3INIT_CLKSTCTRL_RESTORE */ |
413 | #define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_SHIFT (1 << 25) | 413 | #define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_SHIFT 25 |
414 | #define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_MASK BITFIELD(25, 25) | 414 | #define OMAP4430_CLKACTIVITY_UTMI_ROOT_GFCLK_MASK BITFIELD(25, 25) |
415 | 415 | ||
416 | /* Used by CM_WKUP_CLKSTCTRL */ | 416 | /* Used by CM_WKUP_CLKSTCTRL */ |
417 | #define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_SHIFT (1 << 11) | 417 | #define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_SHIFT 11 |
418 | #define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_MASK BITFIELD(11, 11) | 418 | #define OMAP4430_CLKACTIVITY_WKUP_32K_GFCLK_MASK BITFIELD(11, 11) |
419 | 419 | ||
420 | /* | 420 | /* |
@@ -426,7 +426,7 @@ | |||
426 | * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, | 426 | * CM1_ABE_TIMER5_CLKCTRL, CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, |
427 | * CM1_ABE_TIMER8_CLKCTRL | 427 | * CM1_ABE_TIMER8_CLKCTRL |
428 | */ | 428 | */ |
429 | #define OMAP4430_CLKSEL_SHIFT (1 << 24) | 429 | #define OMAP4430_CLKSEL_SHIFT 24 |
430 | #define OMAP4430_CLKSEL_MASK BITFIELD(24, 24) | 430 | #define OMAP4430_CLKSEL_MASK BITFIELD(24, 24) |
431 | 431 | ||
432 | /* | 432 | /* |
@@ -434,43 +434,43 @@ | |||
434 | * CM_DPLL_SYS_REF_CLKSEL, CM_L4_WKUP_CLKSEL, CM_CLKSEL_DUCATI_ISS_ROOT, | 434 | * CM_DPLL_SYS_REF_CLKSEL, CM_L4_WKUP_CLKSEL, CM_CLKSEL_DUCATI_ISS_ROOT, |
435 | * CM_CLKSEL_USB_60MHZ | 435 | * CM_CLKSEL_USB_60MHZ |
436 | */ | 436 | */ |
437 | #define OMAP4430_CLKSEL_0_0_SHIFT (1 << 0) | 437 | #define OMAP4430_CLKSEL_0_0_SHIFT 0 |
438 | #define OMAP4430_CLKSEL_0_0_MASK BITFIELD(0, 0) | 438 | #define OMAP4430_CLKSEL_0_0_MASK BITFIELD(0, 0) |
439 | 439 | ||
440 | /* Renamed from CLKSEL Used by CM_BYPCLK_DPLL_IVA, CM_BYPCLK_DPLL_MPU */ | 440 | /* Renamed from CLKSEL Used by CM_BYPCLK_DPLL_IVA, CM_BYPCLK_DPLL_MPU */ |
441 | #define OMAP4430_CLKSEL_0_1_SHIFT (1 << 0) | 441 | #define OMAP4430_CLKSEL_0_1_SHIFT 0 |
442 | #define OMAP4430_CLKSEL_0_1_MASK BITFIELD(0, 1) | 442 | #define OMAP4430_CLKSEL_0_1_MASK BITFIELD(0, 1) |
443 | 443 | ||
444 | /* Renamed from CLKSEL Used by CM_L3INIT_HSI_CLKCTRL */ | 444 | /* Renamed from CLKSEL Used by CM_L3INIT_HSI_CLKCTRL */ |
445 | #define OMAP4430_CLKSEL_24_25_SHIFT (1 << 24) | 445 | #define OMAP4430_CLKSEL_24_25_SHIFT 24 |
446 | #define OMAP4430_CLKSEL_24_25_MASK BITFIELD(24, 25) | 446 | #define OMAP4430_CLKSEL_24_25_MASK BITFIELD(24, 25) |
447 | 447 | ||
448 | /* Used by CM_L3INIT_USB_OTG_CLKCTRL */ | 448 | /* Used by CM_L3INIT_USB_OTG_CLKCTRL */ |
449 | #define OMAP4430_CLKSEL_60M_SHIFT (1 << 24) | 449 | #define OMAP4430_CLKSEL_60M_SHIFT 24 |
450 | #define OMAP4430_CLKSEL_60M_MASK BITFIELD(24, 24) | 450 | #define OMAP4430_CLKSEL_60M_MASK BITFIELD(24, 24) |
451 | 451 | ||
452 | /* Used by CM1_ABE_AESS_CLKCTRL */ | 452 | /* Used by CM1_ABE_AESS_CLKCTRL */ |
453 | #define OMAP4430_CLKSEL_AESS_FCLK_SHIFT (1 << 24) | 453 | #define OMAP4430_CLKSEL_AESS_FCLK_SHIFT 24 |
454 | #define OMAP4430_CLKSEL_AESS_FCLK_MASK BITFIELD(24, 24) | 454 | #define OMAP4430_CLKSEL_AESS_FCLK_MASK BITFIELD(24, 24) |
455 | 455 | ||
456 | /* Used by CM_CLKSEL_CORE_RESTORE, CM_CLKSEL_CORE */ | 456 | /* Used by CM_CLKSEL_CORE_RESTORE, CM_CLKSEL_CORE */ |
457 | #define OMAP4430_CLKSEL_CORE_SHIFT (1 << 0) | 457 | #define OMAP4430_CLKSEL_CORE_SHIFT 0 |
458 | #define OMAP4430_CLKSEL_CORE_MASK BITFIELD(0, 0) | 458 | #define OMAP4430_CLKSEL_CORE_MASK BITFIELD(0, 0) |
459 | 459 | ||
460 | /* Renamed from CLKSEL_CORE Used by CM_SHADOW_FREQ_CONFIG2 */ | 460 | /* Renamed from CLKSEL_CORE Used by CM_SHADOW_FREQ_CONFIG2 */ |
461 | #define OMAP4430_CLKSEL_CORE_1_1_SHIFT (1 << 1) | 461 | #define OMAP4430_CLKSEL_CORE_1_1_SHIFT 1 |
462 | #define OMAP4430_CLKSEL_CORE_1_1_MASK BITFIELD(1, 1) | 462 | #define OMAP4430_CLKSEL_CORE_1_1_MASK BITFIELD(1, 1) |
463 | 463 | ||
464 | /* Used by CM_WKUP_USIM_CLKCTRL */ | 464 | /* Used by CM_WKUP_USIM_CLKCTRL */ |
465 | #define OMAP4430_CLKSEL_DIV_SHIFT (1 << 24) | 465 | #define OMAP4430_CLKSEL_DIV_SHIFT 24 |
466 | #define OMAP4430_CLKSEL_DIV_MASK BITFIELD(24, 24) | 466 | #define OMAP4430_CLKSEL_DIV_MASK BITFIELD(24, 24) |
467 | 467 | ||
468 | /* Used by CM_CAM_FDIF_CLKCTRL */ | 468 | /* Used by CM_CAM_FDIF_CLKCTRL */ |
469 | #define OMAP4430_CLKSEL_FCLK_SHIFT (1 << 24) | 469 | #define OMAP4430_CLKSEL_FCLK_SHIFT 24 |
470 | #define OMAP4430_CLKSEL_FCLK_MASK BITFIELD(24, 25) | 470 | #define OMAP4430_CLKSEL_FCLK_MASK BITFIELD(24, 25) |
471 | 471 | ||
472 | /* Used by CM_L4PER_MCBSP4_CLKCTRL */ | 472 | /* Used by CM_L4PER_MCBSP4_CLKCTRL */ |
473 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT (1 << 25) | 473 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_SHIFT 25 |
474 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK BITFIELD(25, 25) | 474 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_MASK BITFIELD(25, 25) |
475 | 475 | ||
476 | /* | 476 | /* |
@@ -478,58 +478,58 @@ | |||
478 | * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL, | 478 | * CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, CM1_ABE_MCBSP2_CLKCTRL, |
479 | * CM1_ABE_MCBSP3_CLKCTRL | 479 | * CM1_ABE_MCBSP3_CLKCTRL |
480 | */ | 480 | */ |
481 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_SHIFT (1 << 26) | 481 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_SHIFT 26 |
482 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_MASK BITFIELD(26, 27) | 482 | #define OMAP4430_CLKSEL_INTERNAL_SOURCE_CM1_ABE_DMIC_MASK BITFIELD(26, 27) |
483 | 483 | ||
484 | /* Used by CM_CLKSEL_CORE_RESTORE, CM_CLKSEL_CORE */ | 484 | /* Used by CM_CLKSEL_CORE_RESTORE, CM_CLKSEL_CORE */ |
485 | #define OMAP4430_CLKSEL_L3_SHIFT (1 << 4) | 485 | #define OMAP4430_CLKSEL_L3_SHIFT 4 |
486 | #define OMAP4430_CLKSEL_L3_MASK BITFIELD(4, 4) | 486 | #define OMAP4430_CLKSEL_L3_MASK BITFIELD(4, 4) |
487 | 487 | ||
488 | /* Renamed from CLKSEL_L3 Used by CM_SHADOW_FREQ_CONFIG2 */ | 488 | /* Renamed from CLKSEL_L3 Used by CM_SHADOW_FREQ_CONFIG2 */ |
489 | #define OMAP4430_CLKSEL_L3_SHADOW_SHIFT (1 << 2) | 489 | #define OMAP4430_CLKSEL_L3_SHADOW_SHIFT 2 |
490 | #define OMAP4430_CLKSEL_L3_SHADOW_MASK BITFIELD(2, 2) | 490 | #define OMAP4430_CLKSEL_L3_SHADOW_MASK BITFIELD(2, 2) |
491 | 491 | ||
492 | /* Used by CM_CLKSEL_CORE_RESTORE, CM_CLKSEL_CORE */ | 492 | /* Used by CM_CLKSEL_CORE_RESTORE, CM_CLKSEL_CORE */ |
493 | #define OMAP4430_CLKSEL_L4_SHIFT (1 << 8) | 493 | #define OMAP4430_CLKSEL_L4_SHIFT 8 |
494 | #define OMAP4430_CLKSEL_L4_MASK BITFIELD(8, 8) | 494 | #define OMAP4430_CLKSEL_L4_MASK BITFIELD(8, 8) |
495 | 495 | ||
496 | /* Used by CM_CLKSEL_ABE */ | 496 | /* Used by CM_CLKSEL_ABE */ |
497 | #define OMAP4430_CLKSEL_OPP_SHIFT (1 << 0) | 497 | #define OMAP4430_CLKSEL_OPP_SHIFT 0 |
498 | #define OMAP4430_CLKSEL_OPP_MASK BITFIELD(0, 1) | 498 | #define OMAP4430_CLKSEL_OPP_MASK BITFIELD(0, 1) |
499 | 499 | ||
500 | /* Used by CM_GFX_GFX_CLKCTRL */ | 500 | /* Used by CM_GFX_GFX_CLKCTRL */ |
501 | #define OMAP4430_CLKSEL_PER_192M_SHIFT (1 << 25) | 501 | #define OMAP4430_CLKSEL_PER_192M_SHIFT 25 |
502 | #define OMAP4430_CLKSEL_PER_192M_MASK BITFIELD(25, 26) | 502 | #define OMAP4430_CLKSEL_PER_192M_MASK BITFIELD(25, 26) |
503 | 503 | ||
504 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ | 504 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ |
505 | #define OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT (1 << 27) | 505 | #define OMAP4430_CLKSEL_PMD_STM_CLK_SHIFT 27 |
506 | #define OMAP4430_CLKSEL_PMD_STM_CLK_MASK BITFIELD(27, 29) | 506 | #define OMAP4430_CLKSEL_PMD_STM_CLK_MASK BITFIELD(27, 29) |
507 | 507 | ||
508 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ | 508 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ |
509 | #define OMAP4430_CLKSEL_PMD_TRACE_CLK_SHIFT (1 << 24) | 509 | #define OMAP4430_CLKSEL_PMD_TRACE_CLK_SHIFT 24 |
510 | #define OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK BITFIELD(24, 26) | 510 | #define OMAP4430_CLKSEL_PMD_TRACE_CLK_MASK BITFIELD(24, 26) |
511 | 511 | ||
512 | /* Used by CM_GFX_GFX_CLKCTRL */ | 512 | /* Used by CM_GFX_GFX_CLKCTRL */ |
513 | #define OMAP4430_CLKSEL_SGX_FCLK_SHIFT (1 << 24) | 513 | #define OMAP4430_CLKSEL_SGX_FCLK_SHIFT 24 |
514 | #define OMAP4430_CLKSEL_SGX_FCLK_MASK BITFIELD(24, 24) | 514 | #define OMAP4430_CLKSEL_SGX_FCLK_MASK BITFIELD(24, 24) |
515 | 515 | ||
516 | /* | 516 | /* |
517 | * Used by CM1_ABE_DMIC_CLKCTRL, CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, | 517 | * Used by CM1_ABE_DMIC_CLKCTRL, CM1_ABE_MCASP_CLKCTRL, CM1_ABE_MCBSP1_CLKCTRL, |
518 | * CM1_ABE_MCBSP2_CLKCTRL, CM1_ABE_MCBSP3_CLKCTRL | 518 | * CM1_ABE_MCBSP2_CLKCTRL, CM1_ABE_MCBSP3_CLKCTRL |
519 | */ | 519 | */ |
520 | #define OMAP4430_CLKSEL_SOURCE_SHIFT (1 << 24) | 520 | #define OMAP4430_CLKSEL_SOURCE_SHIFT 24 |
521 | #define OMAP4430_CLKSEL_SOURCE_MASK BITFIELD(24, 25) | 521 | #define OMAP4430_CLKSEL_SOURCE_MASK BITFIELD(24, 25) |
522 | 522 | ||
523 | /* Renamed from CLKSEL_SOURCE Used by CM_L4PER_MCBSP4_CLKCTRL */ | 523 | /* Renamed from CLKSEL_SOURCE Used by CM_L4PER_MCBSP4_CLKCTRL */ |
524 | #define OMAP4430_CLKSEL_SOURCE_24_24_SHIFT (1 << 24) | 524 | #define OMAP4430_CLKSEL_SOURCE_24_24_SHIFT 24 |
525 | #define OMAP4430_CLKSEL_SOURCE_24_24_MASK BITFIELD(24, 24) | 525 | #define OMAP4430_CLKSEL_SOURCE_24_24_MASK BITFIELD(24, 24) |
526 | 526 | ||
527 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 527 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
528 | #define OMAP4430_CLKSEL_UTMI_P1_SHIFT (1 << 24) | 528 | #define OMAP4430_CLKSEL_UTMI_P1_SHIFT 24 |
529 | #define OMAP4430_CLKSEL_UTMI_P1_MASK BITFIELD(24, 24) | 529 | #define OMAP4430_CLKSEL_UTMI_P1_MASK BITFIELD(24, 24) |
530 | 530 | ||
531 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 531 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
532 | #define OMAP4430_CLKSEL_UTMI_P2_SHIFT (1 << 25) | 532 | #define OMAP4430_CLKSEL_UTMI_P2_SHIFT 25 |
533 | #define OMAP4430_CLKSEL_UTMI_P2_MASK BITFIELD(25, 25) | 533 | #define OMAP4430_CLKSEL_UTMI_P2_MASK BITFIELD(25, 25) |
534 | 534 | ||
535 | /* | 535 | /* |
@@ -544,23 +544,23 @@ | |||
544 | * CM_IVAHD_CLKSTCTRL, CM_DSS_CLKSTCTRL, CM_MPU_CLKSTCTRL, CM_TESLA_CLKSTCTRL, | 544 | * CM_IVAHD_CLKSTCTRL, CM_DSS_CLKSTCTRL, CM_MPU_CLKSTCTRL, CM_TESLA_CLKSTCTRL, |
545 | * CM1_ABE_CLKSTCTRL, CM_MPU_CLKSTCTRL_RESTORE | 545 | * CM1_ABE_CLKSTCTRL, CM_MPU_CLKSTCTRL_RESTORE |
546 | */ | 546 | */ |
547 | #define OMAP4430_CLKTRCTRL_SHIFT (1 << 0) | 547 | #define OMAP4430_CLKTRCTRL_SHIFT 0 |
548 | #define OMAP4430_CLKTRCTRL_MASK BITFIELD(0, 1) | 548 | #define OMAP4430_CLKTRCTRL_MASK BITFIELD(0, 1) |
549 | 549 | ||
550 | /* Used by CM_EMU_OVERRIDE_DPLL_CORE */ | 550 | /* Used by CM_EMU_OVERRIDE_DPLL_CORE */ |
551 | #define OMAP4430_CORE_DPLL_EMU_DIV_SHIFT (1 << 0) | 551 | #define OMAP4430_CORE_DPLL_EMU_DIV_SHIFT 0 |
552 | #define OMAP4430_CORE_DPLL_EMU_DIV_MASK BITFIELD(0, 6) | 552 | #define OMAP4430_CORE_DPLL_EMU_DIV_MASK BITFIELD(0, 6) |
553 | 553 | ||
554 | /* Used by CM_EMU_OVERRIDE_DPLL_CORE */ | 554 | /* Used by CM_EMU_OVERRIDE_DPLL_CORE */ |
555 | #define OMAP4430_CORE_DPLL_EMU_MULT_SHIFT (1 << 8) | 555 | #define OMAP4430_CORE_DPLL_EMU_MULT_SHIFT 8 |
556 | #define OMAP4430_CORE_DPLL_EMU_MULT_MASK BITFIELD(8, 18) | 556 | #define OMAP4430_CORE_DPLL_EMU_MULT_MASK BITFIELD(8, 18) |
557 | 557 | ||
558 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */ | 558 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */ |
559 | #define OMAP4430_D2D_DYNDEP_SHIFT (1 << 18) | 559 | #define OMAP4430_D2D_DYNDEP_SHIFT 18 |
560 | #define OMAP4430_D2D_DYNDEP_MASK BITFIELD(18, 18) | 560 | #define OMAP4430_D2D_DYNDEP_MASK BITFIELD(18, 18) |
561 | 561 | ||
562 | /* Used by CM_MPU_STATICDEP */ | 562 | /* Used by CM_MPU_STATICDEP */ |
563 | #define OMAP4430_D2D_STATDEP_SHIFT (1 << 18) | 563 | #define OMAP4430_D2D_STATDEP_SHIFT 18 |
564 | #define OMAP4430_D2D_STATDEP_MASK BITFIELD(18, 18) | 564 | #define OMAP4430_D2D_STATDEP_MASK BITFIELD(18, 18) |
565 | 565 | ||
566 | /* | 566 | /* |
@@ -570,19 +570,19 @@ | |||
570 | * CM_SSC_DELTAMSTEP_DPLL_DDRPHY, CM_SSC_DELTAMSTEP_DPLL_IVA, | 570 | * CM_SSC_DELTAMSTEP_DPLL_DDRPHY, CM_SSC_DELTAMSTEP_DPLL_IVA, |
571 | * CM_SSC_DELTAMSTEP_DPLL_MPU | 571 | * CM_SSC_DELTAMSTEP_DPLL_MPU |
572 | */ | 572 | */ |
573 | #define OMAP4430_DELTAMSTEP_SHIFT (1 << 0) | 573 | #define OMAP4430_DELTAMSTEP_SHIFT 0 |
574 | #define OMAP4430_DELTAMSTEP_MASK BITFIELD(0, 19) | 574 | #define OMAP4430_DELTAMSTEP_MASK BITFIELD(0, 19) |
575 | 575 | ||
576 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ | 576 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ |
577 | #define OMAP4430_DLL_OVERRIDE_SHIFT (1 << 2) | 577 | #define OMAP4430_DLL_OVERRIDE_SHIFT 2 |
578 | #define OMAP4430_DLL_OVERRIDE_MASK BITFIELD(2, 2) | 578 | #define OMAP4430_DLL_OVERRIDE_MASK BITFIELD(2, 2) |
579 | 579 | ||
580 | /* Renamed from DLL_OVERRIDE Used by CM_DLL_CTRL */ | 580 | /* Renamed from DLL_OVERRIDE Used by CM_DLL_CTRL */ |
581 | #define OMAP4430_DLL_OVERRIDE_0_0_SHIFT (1 << 0) | 581 | #define OMAP4430_DLL_OVERRIDE_0_0_SHIFT 0 |
582 | #define OMAP4430_DLL_OVERRIDE_0_0_MASK BITFIELD(0, 0) | 582 | #define OMAP4430_DLL_OVERRIDE_0_0_MASK BITFIELD(0, 0) |
583 | 583 | ||
584 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ | 584 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ |
585 | #define OMAP4430_DLL_RESET_SHIFT (1 << 3) | 585 | #define OMAP4430_DLL_RESET_SHIFT 3 |
586 | #define OMAP4430_DLL_RESET_MASK BITFIELD(3, 3) | 586 | #define OMAP4430_DLL_RESET_MASK BITFIELD(3, 3) |
587 | 587 | ||
588 | /* | 588 | /* |
@@ -590,40 +590,40 @@ | |||
590 | * CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, | 590 | * CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, |
591 | * CM_CLKSEL_DPLL_DDRPHY, CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU | 591 | * CM_CLKSEL_DPLL_DDRPHY, CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU |
592 | */ | 592 | */ |
593 | #define OMAP4430_DPLL_BYP_CLKSEL_SHIFT (1 << 23) | 593 | #define OMAP4430_DPLL_BYP_CLKSEL_SHIFT 23 |
594 | #define OMAP4430_DPLL_BYP_CLKSEL_MASK BITFIELD(23, 23) | 594 | #define OMAP4430_DPLL_BYP_CLKSEL_MASK BITFIELD(23, 23) |
595 | 595 | ||
596 | /* Used by CM_CLKDCOLDO_DPLL_USB */ | 596 | /* Used by CM_CLKDCOLDO_DPLL_USB */ |
597 | #define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT (1 << 8) | 597 | #define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_SHIFT 8 |
598 | #define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_MASK BITFIELD(8, 8) | 598 | #define OMAP4430_DPLL_CLKDCOLDO_GATE_CTRL_MASK BITFIELD(8, 8) |
599 | 599 | ||
600 | /* Used by CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_CORE */ | 600 | /* Used by CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_CORE */ |
601 | #define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_SHIFT (1 << 20) | 601 | #define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_SHIFT 20 |
602 | #define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_MASK BITFIELD(20, 20) | 602 | #define OMAP4430_DPLL_CLKOUTHIF_CLKSEL_MASK BITFIELD(20, 20) |
603 | 603 | ||
604 | /* | 604 | /* |
605 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, | 605 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, |
606 | * CM_DIV_M3_DPLL_CORE | 606 | * CM_DIV_M3_DPLL_CORE |
607 | */ | 607 | */ |
608 | #define OMAP4430_DPLL_CLKOUTHIF_DIV_SHIFT (1 << 0) | 608 | #define OMAP4430_DPLL_CLKOUTHIF_DIV_SHIFT 0 |
609 | #define OMAP4430_DPLL_CLKOUTHIF_DIV_MASK BITFIELD(0, 4) | 609 | #define OMAP4430_DPLL_CLKOUTHIF_DIV_MASK BITFIELD(0, 4) |
610 | 610 | ||
611 | /* | 611 | /* |
612 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, | 612 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, |
613 | * CM_DIV_M3_DPLL_CORE | 613 | * CM_DIV_M3_DPLL_CORE |
614 | */ | 614 | */ |
615 | #define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_SHIFT (1 << 5) | 615 | #define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_SHIFT 5 |
616 | #define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_MASK BITFIELD(5, 5) | 616 | #define OMAP4430_DPLL_CLKOUTHIF_DIVCHACK_MASK BITFIELD(5, 5) |
617 | 617 | ||
618 | /* | 618 | /* |
619 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, | 619 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, |
620 | * CM_DIV_M3_DPLL_CORE | 620 | * CM_DIV_M3_DPLL_CORE |
621 | */ | 621 | */ |
622 | #define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT (1 << 8) | 622 | #define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_SHIFT 8 |
623 | #define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_MASK BITFIELD(8, 8) | 623 | #define OMAP4430_DPLL_CLKOUTHIF_GATE_CTRL_MASK BITFIELD(8, 8) |
624 | 624 | ||
625 | /* Used by CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO, CM_DIV_M2_DPLL_ABE */ | 625 | /* Used by CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO, CM_DIV_M2_DPLL_ABE */ |
626 | #define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_SHIFT (1 << 10) | 626 | #define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_SHIFT 10 |
627 | #define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK BITFIELD(10, 10) | 627 | #define OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK BITFIELD(10, 10) |
628 | 628 | ||
629 | /* | 629 | /* |
@@ -631,11 +631,11 @@ | |||
631 | * CM_DIV_M2_DPLL_CORE_RESTORE, CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, | 631 | * CM_DIV_M2_DPLL_CORE_RESTORE, CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, |
632 | * CM_DIV_M2_DPLL_DDRPHY, CM_DIV_M2_DPLL_MPU | 632 | * CM_DIV_M2_DPLL_DDRPHY, CM_DIV_M2_DPLL_MPU |
633 | */ | 633 | */ |
634 | #define OMAP4430_DPLL_CLKOUT_DIV_SHIFT (1 << 0) | 634 | #define OMAP4430_DPLL_CLKOUT_DIV_SHIFT 0 |
635 | #define OMAP4430_DPLL_CLKOUT_DIV_MASK BITFIELD(0, 4) | 635 | #define OMAP4430_DPLL_CLKOUT_DIV_MASK BITFIELD(0, 4) |
636 | 636 | ||
637 | /* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_USB */ | 637 | /* Renamed from DPLL_CLKOUT_DIV Used by CM_DIV_M2_DPLL_USB */ |
638 | #define OMAP4430_DPLL_CLKOUT_DIV_0_6_SHIFT (1 << 0) | 638 | #define OMAP4430_DPLL_CLKOUT_DIV_0_6_SHIFT 0 |
639 | #define OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK BITFIELD(0, 6) | 639 | #define OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK BITFIELD(0, 6) |
640 | 640 | ||
641 | /* | 641 | /* |
@@ -643,11 +643,11 @@ | |||
643 | * CM_DIV_M2_DPLL_CORE_RESTORE, CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, | 643 | * CM_DIV_M2_DPLL_CORE_RESTORE, CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, |
644 | * CM_DIV_M2_DPLL_DDRPHY, CM_DIV_M2_DPLL_MPU | 644 | * CM_DIV_M2_DPLL_DDRPHY, CM_DIV_M2_DPLL_MPU |
645 | */ | 645 | */ |
646 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_SHIFT (1 << 5) | 646 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_SHIFT 5 |
647 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_MASK BITFIELD(5, 5) | 647 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_MASK BITFIELD(5, 5) |
648 | 648 | ||
649 | /* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_USB */ | 649 | /* Renamed from DPLL_CLKOUT_DIVCHACK Used by CM_DIV_M2_DPLL_USB */ |
650 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_SHIFT (1 << 7) | 650 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_SHIFT 7 |
651 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_MASK BITFIELD(7, 7) | 651 | #define OMAP4430_DPLL_CLKOUT_DIVCHACK_M2_USB_MASK BITFIELD(7, 7) |
652 | 652 | ||
653 | /* | 653 | /* |
@@ -655,23 +655,23 @@ | |||
655 | * CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY, | 655 | * CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY, |
656 | * CM_DIV_M2_DPLL_MPU | 656 | * CM_DIV_M2_DPLL_MPU |
657 | */ | 657 | */ |
658 | #define OMAP4430_DPLL_CLKOUT_GATE_CTRL_SHIFT (1 << 8) | 658 | #define OMAP4430_DPLL_CLKOUT_GATE_CTRL_SHIFT 8 |
659 | #define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK BITFIELD(8, 8) | 659 | #define OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK BITFIELD(8, 8) |
660 | 660 | ||
661 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ | 661 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ |
662 | #define OMAP4430_DPLL_CORE_DPLL_EN_SHIFT (1 << 8) | 662 | #define OMAP4430_DPLL_CORE_DPLL_EN_SHIFT 8 |
663 | #define OMAP4430_DPLL_CORE_DPLL_EN_MASK BITFIELD(8, 10) | 663 | #define OMAP4430_DPLL_CORE_DPLL_EN_MASK BITFIELD(8, 10) |
664 | 664 | ||
665 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ | 665 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ |
666 | #define OMAP4430_DPLL_CORE_M2_DIV_SHIFT (1 << 11) | 666 | #define OMAP4430_DPLL_CORE_M2_DIV_SHIFT 11 |
667 | #define OMAP4430_DPLL_CORE_M2_DIV_MASK BITFIELD(11, 15) | 667 | #define OMAP4430_DPLL_CORE_M2_DIV_MASK BITFIELD(11, 15) |
668 | 668 | ||
669 | /* Used by CM_SHADOW_FREQ_CONFIG2 */ | 669 | /* Used by CM_SHADOW_FREQ_CONFIG2 */ |
670 | #define OMAP4430_DPLL_CORE_M5_DIV_SHIFT (1 << 3) | 670 | #define OMAP4430_DPLL_CORE_M5_DIV_SHIFT 3 |
671 | #define OMAP4430_DPLL_CORE_M5_DIV_MASK BITFIELD(3, 7) | 671 | #define OMAP4430_DPLL_CORE_M5_DIV_MASK BITFIELD(3, 7) |
672 | 672 | ||
673 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ | 673 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ |
674 | #define OMAP4430_DPLL_CORE_SYS_REF_CLKSEL_SHIFT (1 << 1) | 674 | #define OMAP4430_DPLL_CORE_SYS_REF_CLKSEL_SHIFT 1 |
675 | #define OMAP4430_DPLL_CORE_SYS_REF_CLKSEL_MASK BITFIELD(1, 1) | 675 | #define OMAP4430_DPLL_CORE_SYS_REF_CLKSEL_MASK BITFIELD(1, 1) |
676 | 676 | ||
677 | /* | 677 | /* |
@@ -679,11 +679,11 @@ | |||
679 | * CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, | 679 | * CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, |
680 | * CM_CLKSEL_DPLL_DDRPHY, CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU | 680 | * CM_CLKSEL_DPLL_DDRPHY, CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU |
681 | */ | 681 | */ |
682 | #define OMAP4430_DPLL_DIV_SHIFT (1 << 0) | 682 | #define OMAP4430_DPLL_DIV_SHIFT 0 |
683 | #define OMAP4430_DPLL_DIV_MASK BITFIELD(0, 6) | 683 | #define OMAP4430_DPLL_DIV_MASK BITFIELD(0, 6) |
684 | 684 | ||
685 | /* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_USB */ | 685 | /* Renamed from DPLL_DIV Used by CM_CLKSEL_DPLL_USB */ |
686 | #define OMAP4430_DPLL_DIV_0_7_SHIFT (1 << 0) | 686 | #define OMAP4430_DPLL_DIV_0_7_SHIFT 0 |
687 | #define OMAP4430_DPLL_DIV_0_7_MASK BITFIELD(0, 7) | 687 | #define OMAP4430_DPLL_DIV_0_7_MASK BITFIELD(0, 7) |
688 | 688 | ||
689 | /* | 689 | /* |
@@ -691,11 +691,11 @@ | |||
691 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, | 691 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, |
692 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU | 692 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU |
693 | */ | 693 | */ |
694 | #define OMAP4430_DPLL_DRIFTGUARD_EN_SHIFT (1 << 8) | 694 | #define OMAP4430_DPLL_DRIFTGUARD_EN_SHIFT 8 |
695 | #define OMAP4430_DPLL_DRIFTGUARD_EN_MASK BITFIELD(8, 8) | 695 | #define OMAP4430_DPLL_DRIFTGUARD_EN_MASK BITFIELD(8, 8) |
696 | 696 | ||
697 | /* Renamed from DPLL_DRIFTGUARD_EN Used by CM_CLKMODE_DPLL_UNIPRO */ | 697 | /* Renamed from DPLL_DRIFTGUARD_EN Used by CM_CLKMODE_DPLL_UNIPRO */ |
698 | #define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_SHIFT (1 << 3) | 698 | #define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_SHIFT 3 |
699 | #define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_MASK BITFIELD(3, 3) | 699 | #define OMAP4430_DPLL_DRIFTGUARD_EN_3_3_MASK BITFIELD(3, 3) |
700 | 700 | ||
701 | /* | 701 | /* |
@@ -703,7 +703,7 @@ | |||
703 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, | 703 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, |
704 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU | 704 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU |
705 | */ | 705 | */ |
706 | #define OMAP4430_DPLL_EN_SHIFT (1 << 0) | 706 | #define OMAP4430_DPLL_EN_SHIFT 0 |
707 | #define OMAP4430_DPLL_EN_MASK BITFIELD(0, 2) | 707 | #define OMAP4430_DPLL_EN_MASK BITFIELD(0, 2) |
708 | 708 | ||
709 | /* | 709 | /* |
@@ -711,7 +711,7 @@ | |||
711 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, | 711 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, |
712 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU | 712 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU |
713 | */ | 713 | */ |
714 | #define OMAP4430_DPLL_LPMODE_EN_SHIFT (1 << 10) | 714 | #define OMAP4430_DPLL_LPMODE_EN_SHIFT 10 |
715 | #define OMAP4430_DPLL_LPMODE_EN_MASK BITFIELD(10, 10) | 715 | #define OMAP4430_DPLL_LPMODE_EN_MASK BITFIELD(10, 10) |
716 | 716 | ||
717 | /* | 717 | /* |
@@ -719,11 +719,11 @@ | |||
719 | * CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, | 719 | * CM_CLKSEL_DPLL_CORE_RESTORE, CM_CLKSEL_DPLL_ABE, CM_CLKSEL_DPLL_CORE, |
720 | * CM_CLKSEL_DPLL_DDRPHY, CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU | 720 | * CM_CLKSEL_DPLL_DDRPHY, CM_CLKSEL_DPLL_IVA, CM_CLKSEL_DPLL_MPU |
721 | */ | 721 | */ |
722 | #define OMAP4430_DPLL_MULT_SHIFT (1 << 8) | 722 | #define OMAP4430_DPLL_MULT_SHIFT 8 |
723 | #define OMAP4430_DPLL_MULT_MASK BITFIELD(8, 18) | 723 | #define OMAP4430_DPLL_MULT_MASK BITFIELD(8, 18) |
724 | 724 | ||
725 | /* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_USB */ | 725 | /* Renamed from DPLL_MULT Used by CM_CLKSEL_DPLL_USB */ |
726 | #define OMAP4430_DPLL_MULT_USB_SHIFT (1 << 8) | 726 | #define OMAP4430_DPLL_MULT_USB_SHIFT 8 |
727 | #define OMAP4430_DPLL_MULT_USB_MASK BITFIELD(8, 19) | 727 | #define OMAP4430_DPLL_MULT_USB_MASK BITFIELD(8, 19) |
728 | 728 | ||
729 | /* | 729 | /* |
@@ -731,11 +731,11 @@ | |||
731 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, | 731 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, |
732 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU | 732 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU |
733 | */ | 733 | */ |
734 | #define OMAP4430_DPLL_REGM4XEN_SHIFT (1 << 11) | 734 | #define OMAP4430_DPLL_REGM4XEN_SHIFT 11 |
735 | #define OMAP4430_DPLL_REGM4XEN_MASK BITFIELD(11, 11) | 735 | #define OMAP4430_DPLL_REGM4XEN_MASK BITFIELD(11, 11) |
736 | 736 | ||
737 | /* Used by CM_CLKSEL_DPLL_USB */ | 737 | /* Used by CM_CLKSEL_DPLL_USB */ |
738 | #define OMAP4430_DPLL_SD_DIV_SHIFT (1 << 24) | 738 | #define OMAP4430_DPLL_SD_DIV_SHIFT 24 |
739 | #define OMAP4430_DPLL_SD_DIV_MASK BITFIELD(24, 31) | 739 | #define OMAP4430_DPLL_SD_DIV_MASK BITFIELD(24, 31) |
740 | 740 | ||
741 | /* | 741 | /* |
@@ -743,7 +743,7 @@ | |||
743 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, | 743 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, |
744 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU | 744 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU |
745 | */ | 745 | */ |
746 | #define OMAP4430_DPLL_SSC_ACK_SHIFT (1 << 13) | 746 | #define OMAP4430_DPLL_SSC_ACK_SHIFT 13 |
747 | #define OMAP4430_DPLL_SSC_ACK_MASK BITFIELD(13, 13) | 747 | #define OMAP4430_DPLL_SSC_ACK_MASK BITFIELD(13, 13) |
748 | 748 | ||
749 | /* | 749 | /* |
@@ -751,7 +751,7 @@ | |||
751 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, | 751 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, |
752 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU | 752 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU |
753 | */ | 753 | */ |
754 | #define OMAP4430_DPLL_SSC_DOWNSPREAD_SHIFT (1 << 14) | 754 | #define OMAP4430_DPLL_SSC_DOWNSPREAD_SHIFT 14 |
755 | #define OMAP4430_DPLL_SSC_DOWNSPREAD_MASK BITFIELD(14, 14) | 755 | #define OMAP4430_DPLL_SSC_DOWNSPREAD_MASK BITFIELD(14, 14) |
756 | 756 | ||
757 | /* | 757 | /* |
@@ -759,154 +759,154 @@ | |||
759 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, | 759 | * CM_CLKMODE_DPLL_CORE_RESTORE, CM_CLKMODE_DPLL_ABE, CM_CLKMODE_DPLL_CORE, |
760 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU | 760 | * CM_CLKMODE_DPLL_DDRPHY, CM_CLKMODE_DPLL_IVA, CM_CLKMODE_DPLL_MPU |
761 | */ | 761 | */ |
762 | #define OMAP4430_DPLL_SSC_EN_SHIFT (1 << 12) | 762 | #define OMAP4430_DPLL_SSC_EN_SHIFT 12 |
763 | #define OMAP4430_DPLL_SSC_EN_MASK BITFIELD(12, 12) | 763 | #define OMAP4430_DPLL_SSC_EN_MASK BITFIELD(12, 12) |
764 | 764 | ||
765 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ | 765 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ |
766 | #define OMAP4430_DSS_DYNDEP_SHIFT (1 << 8) | 766 | #define OMAP4430_DSS_DYNDEP_SHIFT 8 |
767 | #define OMAP4430_DSS_DYNDEP_MASK BITFIELD(8, 8) | 767 | #define OMAP4430_DSS_DYNDEP_MASK BITFIELD(8, 8) |
768 | 768 | ||
769 | /* | 769 | /* |
770 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_SDMA_STATICDEP_RESTORE, | 770 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_SDMA_STATICDEP_RESTORE, |
771 | * CM_MPU_STATICDEP | 771 | * CM_MPU_STATICDEP |
772 | */ | 772 | */ |
773 | #define OMAP4430_DSS_STATDEP_SHIFT (1 << 8) | 773 | #define OMAP4430_DSS_STATDEP_SHIFT 8 |
774 | #define OMAP4430_DSS_STATDEP_MASK BITFIELD(8, 8) | 774 | #define OMAP4430_DSS_STATDEP_MASK BITFIELD(8, 8) |
775 | 775 | ||
776 | /* Used by CM_L3_2_DYNAMICDEP */ | 776 | /* Used by CM_L3_2_DYNAMICDEP */ |
777 | #define OMAP4430_DUCATI_DYNDEP_SHIFT (1 << 0) | 777 | #define OMAP4430_DUCATI_DYNDEP_SHIFT 0 |
778 | #define OMAP4430_DUCATI_DYNDEP_MASK BITFIELD(0, 0) | 778 | #define OMAP4430_DUCATI_DYNDEP_MASK BITFIELD(0, 0) |
779 | 779 | ||
780 | /* Used by CM_SDMA_STATICDEP, CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP */ | 780 | /* Used by CM_SDMA_STATICDEP, CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP */ |
781 | #define OMAP4430_DUCATI_STATDEP_SHIFT (1 << 0) | 781 | #define OMAP4430_DUCATI_STATDEP_SHIFT 0 |
782 | #define OMAP4430_DUCATI_STATDEP_MASK BITFIELD(0, 0) | 782 | #define OMAP4430_DUCATI_STATDEP_MASK BITFIELD(0, 0) |
783 | 783 | ||
784 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ | 784 | /* Used by CM_SHADOW_FREQ_CONFIG1_RESTORE, CM_SHADOW_FREQ_CONFIG1 */ |
785 | #define OMAP4430_FREQ_UPDATE_SHIFT (1 << 0) | 785 | #define OMAP4430_FREQ_UPDATE_SHIFT 0 |
786 | #define OMAP4430_FREQ_UPDATE_MASK BITFIELD(0, 0) | 786 | #define OMAP4430_FREQ_UPDATE_MASK BITFIELD(0, 0) |
787 | 787 | ||
788 | /* Used by CM_L3_2_DYNAMICDEP */ | 788 | /* Used by CM_L3_2_DYNAMICDEP */ |
789 | #define OMAP4430_GFX_DYNDEP_SHIFT (1 << 10) | 789 | #define OMAP4430_GFX_DYNDEP_SHIFT 10 |
790 | #define OMAP4430_GFX_DYNDEP_MASK BITFIELD(10, 10) | 790 | #define OMAP4430_GFX_DYNDEP_MASK BITFIELD(10, 10) |
791 | 791 | ||
792 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ | 792 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ |
793 | #define OMAP4430_GFX_STATDEP_SHIFT (1 << 10) | 793 | #define OMAP4430_GFX_STATDEP_SHIFT 10 |
794 | #define OMAP4430_GFX_STATDEP_MASK BITFIELD(10, 10) | 794 | #define OMAP4430_GFX_STATDEP_MASK BITFIELD(10, 10) |
795 | 795 | ||
796 | /* Used by CM_SHADOW_FREQ_CONFIG2 */ | 796 | /* Used by CM_SHADOW_FREQ_CONFIG2 */ |
797 | #define OMAP4430_GPMC_FREQ_UPDATE_SHIFT (1 << 0) | 797 | #define OMAP4430_GPMC_FREQ_UPDATE_SHIFT 0 |
798 | #define OMAP4430_GPMC_FREQ_UPDATE_MASK BITFIELD(0, 0) | 798 | #define OMAP4430_GPMC_FREQ_UPDATE_MASK BITFIELD(0, 0) |
799 | 799 | ||
800 | /* | 800 | /* |
801 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, | 801 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, |
802 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA | 802 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA |
803 | */ | 803 | */ |
804 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIV_SHIFT (1 << 0) | 804 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIV_SHIFT 0 |
805 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK BITFIELD(0, 4) | 805 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK BITFIELD(0, 4) |
806 | 806 | ||
807 | /* | 807 | /* |
808 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, | 808 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, |
809 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA | 809 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA |
810 | */ | 810 | */ |
811 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT (1 << 5) | 811 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_SHIFT 5 |
812 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_MASK BITFIELD(5, 5) | 812 | #define OMAP4430_HSDIVIDER_CLKOUT1_DIVCHACK_MASK BITFIELD(5, 5) |
813 | 813 | ||
814 | /* | 814 | /* |
815 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, | 815 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, |
816 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA | 816 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA |
817 | */ | 817 | */ |
818 | #define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT (1 << 8) | 818 | #define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_SHIFT 8 |
819 | #define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK BITFIELD(8, 8) | 819 | #define OMAP4430_HSDIVIDER_CLKOUT1_GATE_CTRL_MASK BITFIELD(8, 8) |
820 | 820 | ||
821 | /* | 821 | /* |
822 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, | 822 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, |
823 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA | 823 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA |
824 | */ | 824 | */ |
825 | #define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_SHIFT (1 << 12) | 825 | #define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_SHIFT 12 |
826 | #define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_MASK BITFIELD(12, 12) | 826 | #define OMAP4430_HSDIVIDER_CLKOUT1_PWDN_MASK BITFIELD(12, 12) |
827 | 827 | ||
828 | /* | 828 | /* |
829 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, | 829 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, |
830 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA | 830 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA |
831 | */ | 831 | */ |
832 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIV_SHIFT (1 << 0) | 832 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIV_SHIFT 0 |
833 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK BITFIELD(0, 4) | 833 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK BITFIELD(0, 4) |
834 | 834 | ||
835 | /* | 835 | /* |
836 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, | 836 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, |
837 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA | 837 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA |
838 | */ | 838 | */ |
839 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT (1 << 5) | 839 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_SHIFT 5 |
840 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_MASK BITFIELD(5, 5) | 840 | #define OMAP4430_HSDIVIDER_CLKOUT2_DIVCHACK_MASK BITFIELD(5, 5) |
841 | 841 | ||
842 | /* | 842 | /* |
843 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, | 843 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, |
844 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA | 844 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA |
845 | */ | 845 | */ |
846 | #define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT (1 << 8) | 846 | #define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_SHIFT 8 |
847 | #define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK BITFIELD(8, 8) | 847 | #define OMAP4430_HSDIVIDER_CLKOUT2_GATE_CTRL_MASK BITFIELD(8, 8) |
848 | 848 | ||
849 | /* | 849 | /* |
850 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, | 850 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, |
851 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA | 851 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA |
852 | */ | 852 | */ |
853 | #define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_SHIFT (1 << 12) | 853 | #define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_SHIFT 12 |
854 | #define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_MASK BITFIELD(12, 12) | 854 | #define OMAP4430_HSDIVIDER_CLKOUT2_PWDN_MASK BITFIELD(12, 12) |
855 | 855 | ||
856 | /* | 856 | /* |
857 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, | 857 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, |
858 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY | 858 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY |
859 | */ | 859 | */ |
860 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIV_SHIFT (1 << 0) | 860 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIV_SHIFT 0 |
861 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK BITFIELD(0, 4) | 861 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK BITFIELD(0, 4) |
862 | 862 | ||
863 | /* | 863 | /* |
864 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, | 864 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, |
865 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY | 865 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY |
866 | */ | 866 | */ |
867 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT (1 << 5) | 867 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_SHIFT 5 |
868 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_MASK BITFIELD(5, 5) | 868 | #define OMAP4430_HSDIVIDER_CLKOUT3_DIVCHACK_MASK BITFIELD(5, 5) |
869 | 869 | ||
870 | /* | 870 | /* |
871 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, | 871 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, |
872 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY | 872 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY |
873 | */ | 873 | */ |
874 | #define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT (1 << 8) | 874 | #define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_SHIFT 8 |
875 | #define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK BITFIELD(8, 8) | 875 | #define OMAP4430_HSDIVIDER_CLKOUT3_GATE_CTRL_MASK BITFIELD(8, 8) |
876 | 876 | ||
877 | /* | 877 | /* |
878 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, | 878 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, |
879 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY | 879 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY |
880 | */ | 880 | */ |
881 | #define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_SHIFT (1 << 12) | 881 | #define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_SHIFT 12 |
882 | #define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_MASK BITFIELD(12, 12) | 882 | #define OMAP4430_HSDIVIDER_CLKOUT3_PWDN_MASK BITFIELD(12, 12) |
883 | 883 | ||
884 | /* | 884 | /* |
885 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, | 885 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, |
886 | * CM_DIV_M7_DPLL_CORE | 886 | * CM_DIV_M7_DPLL_CORE |
887 | */ | 887 | */ |
888 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIV_SHIFT (1 << 0) | 888 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIV_SHIFT 0 |
889 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK BITFIELD(0, 4) | 889 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK BITFIELD(0, 4) |
890 | 890 | ||
891 | /* | 891 | /* |
892 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, | 892 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, |
893 | * CM_DIV_M7_DPLL_CORE | 893 | * CM_DIV_M7_DPLL_CORE |
894 | */ | 894 | */ |
895 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_SHIFT (1 << 5) | 895 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_SHIFT 5 |
896 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_MASK BITFIELD(5, 5) | 896 | #define OMAP4430_HSDIVIDER_CLKOUT4_DIVCHACK_MASK BITFIELD(5, 5) |
897 | 897 | ||
898 | /* | 898 | /* |
899 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, | 899 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, |
900 | * CM_DIV_M7_DPLL_CORE | 900 | * CM_DIV_M7_DPLL_CORE |
901 | */ | 901 | */ |
902 | #define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_SHIFT (1 << 8) | 902 | #define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_SHIFT 8 |
903 | #define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_MASK BITFIELD(8, 8) | 903 | #define OMAP4430_HSDIVIDER_CLKOUT4_GATE_CTRL_MASK BITFIELD(8, 8) |
904 | 904 | ||
905 | /* | 905 | /* |
906 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, | 906 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, |
907 | * CM_DIV_M7_DPLL_CORE | 907 | * CM_DIV_M7_DPLL_CORE |
908 | */ | 908 | */ |
909 | #define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_SHIFT (1 << 12) | 909 | #define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_SHIFT 12 |
910 | #define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_MASK BITFIELD(12, 12) | 910 | #define OMAP4430_HSDIVIDER_CLKOUT4_PWDN_MASK BITFIELD(12, 12) |
911 | 911 | ||
912 | /* | 912 | /* |
@@ -962,22 +962,22 @@ | |||
962 | * CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, CM1_ABE_TIMER8_CLKCTRL, | 962 | * CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, CM1_ABE_TIMER8_CLKCTRL, |
963 | * CM1_ABE_WDT3_CLKCTRL, CM_CM1_PROFILING_CLKCTRL | 963 | * CM1_ABE_WDT3_CLKCTRL, CM_CM1_PROFILING_CLKCTRL |
964 | */ | 964 | */ |
965 | #define OMAP4430_IDLEST_SHIFT (1 << 16) | 965 | #define OMAP4430_IDLEST_SHIFT 16 |
966 | #define OMAP4430_IDLEST_MASK BITFIELD(16, 17) | 966 | #define OMAP4430_IDLEST_MASK BITFIELD(16, 17) |
967 | 967 | ||
968 | /* Used by CM_DUCATI_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */ | 968 | /* Used by CM_DUCATI_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP */ |
969 | #define OMAP4430_ISS_DYNDEP_SHIFT (1 << 9) | 969 | #define OMAP4430_ISS_DYNDEP_SHIFT 9 |
970 | #define OMAP4430_ISS_DYNDEP_MASK BITFIELD(9, 9) | 970 | #define OMAP4430_ISS_DYNDEP_MASK BITFIELD(9, 9) |
971 | 971 | ||
972 | /* | 972 | /* |
973 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_SDMA_STATICDEP_RESTORE, | 973 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_SDMA_STATICDEP_RESTORE, |
974 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP | 974 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP |
975 | */ | 975 | */ |
976 | #define OMAP4430_ISS_STATDEP_SHIFT (1 << 9) | 976 | #define OMAP4430_ISS_STATDEP_SHIFT 9 |
977 | #define OMAP4430_ISS_STATDEP_MASK BITFIELD(9, 9) | 977 | #define OMAP4430_ISS_STATDEP_MASK BITFIELD(9, 9) |
978 | 978 | ||
979 | /* Used by CM_L3_2_DYNAMICDEP, CM_TESLA_DYNAMICDEP */ | 979 | /* Used by CM_L3_2_DYNAMICDEP, CM_TESLA_DYNAMICDEP */ |
980 | #define OMAP4430_IVAHD_DYNDEP_SHIFT (1 << 2) | 980 | #define OMAP4430_IVAHD_DYNDEP_SHIFT 2 |
981 | #define OMAP4430_IVAHD_DYNDEP_MASK BITFIELD(2, 2) | 981 | #define OMAP4430_IVAHD_DYNDEP_MASK BITFIELD(2, 2) |
982 | 982 | ||
983 | /* | 983 | /* |
@@ -986,25 +986,25 @@ | |||
986 | * CM_SDMA_STATICDEP_RESTORE, CM_DSS_STATICDEP, CM_MPU_STATICDEP, | 986 | * CM_SDMA_STATICDEP_RESTORE, CM_DSS_STATICDEP, CM_MPU_STATICDEP, |
987 | * CM_TESLA_STATICDEP | 987 | * CM_TESLA_STATICDEP |
988 | */ | 988 | */ |
989 | #define OMAP4430_IVAHD_STATDEP_SHIFT (1 << 2) | 989 | #define OMAP4430_IVAHD_STATDEP_SHIFT 2 |
990 | #define OMAP4430_IVAHD_STATDEP_MASK BITFIELD(2, 2) | 990 | #define OMAP4430_IVAHD_STATDEP_MASK BITFIELD(2, 2) |
991 | 991 | ||
992 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ | 992 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ |
993 | #define OMAP4430_L3INIT_DYNDEP_SHIFT (1 << 7) | 993 | #define OMAP4430_L3INIT_DYNDEP_SHIFT 7 |
994 | #define OMAP4430_L3INIT_DYNDEP_MASK BITFIELD(7, 7) | 994 | #define OMAP4430_L3INIT_DYNDEP_MASK BITFIELD(7, 7) |
995 | 995 | ||
996 | /* | 996 | /* |
997 | * Used by CM_D2D_STATICDEP, CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, | 997 | * Used by CM_D2D_STATICDEP, CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, |
998 | * CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, CM_TESLA_STATICDEP | 998 | * CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, CM_TESLA_STATICDEP |
999 | */ | 999 | */ |
1000 | #define OMAP4430_L3INIT_STATDEP_SHIFT (1 << 7) | 1000 | #define OMAP4430_L3INIT_STATDEP_SHIFT 7 |
1001 | #define OMAP4430_L3INIT_STATDEP_MASK BITFIELD(7, 7) | 1001 | #define OMAP4430_L3INIT_STATDEP_MASK BITFIELD(7, 7) |
1002 | 1002 | ||
1003 | /* | 1003 | /* |
1004 | * Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L3INIT_DYNAMICDEP, | 1004 | * Used by CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, CM_L3INIT_DYNAMICDEP, |
1005 | * CM_DSS_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP | 1005 | * CM_DSS_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP |
1006 | */ | 1006 | */ |
1007 | #define OMAP4430_L3_1_DYNDEP_SHIFT (1 << 5) | 1007 | #define OMAP4430_L3_1_DYNDEP_SHIFT 5 |
1008 | #define OMAP4430_L3_1_DYNDEP_MASK BITFIELD(5, 5) | 1008 | #define OMAP4430_L3_1_DYNDEP_MASK BITFIELD(5, 5) |
1009 | 1009 | ||
1010 | /* | 1010 | /* |
@@ -1013,7 +1013,7 @@ | |||
1013 | * CM_SDMA_STATICDEP_RESTORE, CM_IVAHD_STATICDEP, CM_DSS_STATICDEP, | 1013 | * CM_SDMA_STATICDEP_RESTORE, CM_IVAHD_STATICDEP, CM_DSS_STATICDEP, |
1014 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP | 1014 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP |
1015 | */ | 1015 | */ |
1016 | #define OMAP4430_L3_1_STATDEP_SHIFT (1 << 5) | 1016 | #define OMAP4430_L3_1_STATDEP_SHIFT 5 |
1017 | #define OMAP4430_L3_1_STATDEP_MASK BITFIELD(5, 5) | 1017 | #define OMAP4430_L3_1_STATDEP_MASK BITFIELD(5, 5) |
1018 | 1018 | ||
1019 | /* | 1019 | /* |
@@ -1022,7 +1022,7 @@ | |||
1022 | * CM_GFX_DYNAMICDEP, CM_L4SEC_DYNAMICDEP, CM_L3INIT_DYNAMICDEP, | 1022 | * CM_GFX_DYNAMICDEP, CM_L4SEC_DYNAMICDEP, CM_L3INIT_DYNAMICDEP, |
1023 | * CM_CAM_DYNAMICDEP, CM_IVAHD_DYNAMICDEP | 1023 | * CM_CAM_DYNAMICDEP, CM_IVAHD_DYNAMICDEP |
1024 | */ | 1024 | */ |
1025 | #define OMAP4430_L3_2_DYNDEP_SHIFT (1 << 6) | 1025 | #define OMAP4430_L3_2_DYNDEP_SHIFT 6 |
1026 | #define OMAP4430_L3_2_DYNDEP_MASK BITFIELD(6, 6) | 1026 | #define OMAP4430_L3_2_DYNDEP_MASK BITFIELD(6, 6) |
1027 | 1027 | ||
1028 | /* | 1028 | /* |
@@ -1031,11 +1031,11 @@ | |||
1031 | * CM_SDMA_STATICDEP_RESTORE, CM_IVAHD_STATICDEP, CM_DSS_STATICDEP, | 1031 | * CM_SDMA_STATICDEP_RESTORE, CM_IVAHD_STATICDEP, CM_DSS_STATICDEP, |
1032 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP | 1032 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP |
1033 | */ | 1033 | */ |
1034 | #define OMAP4430_L3_2_STATDEP_SHIFT (1 << 6) | 1034 | #define OMAP4430_L3_2_STATDEP_SHIFT 6 |
1035 | #define OMAP4430_L3_2_STATDEP_MASK BITFIELD(6, 6) | 1035 | #define OMAP4430_L3_2_STATDEP_MASK BITFIELD(6, 6) |
1036 | 1036 | ||
1037 | /* Used by CM_L3_1_DYNAMICDEP */ | 1037 | /* Used by CM_L3_1_DYNAMICDEP */ |
1038 | #define OMAP4430_L4CFG_DYNDEP_SHIFT (1 << 12) | 1038 | #define OMAP4430_L4CFG_DYNDEP_SHIFT 12 |
1039 | #define OMAP4430_L4CFG_DYNDEP_MASK BITFIELD(12, 12) | 1039 | #define OMAP4430_L4CFG_DYNDEP_MASK BITFIELD(12, 12) |
1040 | 1040 | ||
1041 | /* | 1041 | /* |
@@ -1043,11 +1043,11 @@ | |||
1043 | * CM_L3INIT_STATICDEP, CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, | 1043 | * CM_L3INIT_STATICDEP, CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, |
1044 | * CM_TESLA_STATICDEP | 1044 | * CM_TESLA_STATICDEP |
1045 | */ | 1045 | */ |
1046 | #define OMAP4430_L4CFG_STATDEP_SHIFT (1 << 12) | 1046 | #define OMAP4430_L4CFG_STATDEP_SHIFT 12 |
1047 | #define OMAP4430_L4CFG_STATDEP_MASK BITFIELD(12, 12) | 1047 | #define OMAP4430_L4CFG_STATDEP_MASK BITFIELD(12, 12) |
1048 | 1048 | ||
1049 | /* Used by CM_L3_2_DYNAMICDEP */ | 1049 | /* Used by CM_L3_2_DYNAMICDEP */ |
1050 | #define OMAP4430_L4PER_DYNDEP_SHIFT (1 << 13) | 1050 | #define OMAP4430_L4PER_DYNDEP_SHIFT 13 |
1051 | #define OMAP4430_L4PER_DYNDEP_MASK BITFIELD(13, 13) | 1051 | #define OMAP4430_L4PER_DYNDEP_MASK BITFIELD(13, 13) |
1052 | 1052 | ||
1053 | /* | 1053 | /* |
@@ -1055,36 +1055,36 @@ | |||
1055 | * CM_L4SEC_STATICDEP, CM_L3INIT_STATICDEP, CM_SDMA_STATICDEP_RESTORE, | 1055 | * CM_L4SEC_STATICDEP, CM_L3INIT_STATICDEP, CM_SDMA_STATICDEP_RESTORE, |
1056 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP | 1056 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP |
1057 | */ | 1057 | */ |
1058 | #define OMAP4430_L4PER_STATDEP_SHIFT (1 << 13) | 1058 | #define OMAP4430_L4PER_STATDEP_SHIFT 13 |
1059 | #define OMAP4430_L4PER_STATDEP_MASK BITFIELD(13, 13) | 1059 | #define OMAP4430_L4PER_STATDEP_MASK BITFIELD(13, 13) |
1060 | 1060 | ||
1061 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ | 1061 | /* Used by CM_L3_2_DYNAMICDEP, CM_L4PER_DYNAMICDEP */ |
1062 | #define OMAP4430_L4SEC_DYNDEP_SHIFT (1 << 14) | 1062 | #define OMAP4430_L4SEC_DYNDEP_SHIFT 14 |
1063 | #define OMAP4430_L4SEC_DYNDEP_MASK BITFIELD(14, 14) | 1063 | #define OMAP4430_L4SEC_DYNDEP_MASK BITFIELD(14, 14) |
1064 | 1064 | ||
1065 | /* | 1065 | /* |
1066 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_L3INIT_STATICDEP, | 1066 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_L3INIT_STATICDEP, |
1067 | * CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP | 1067 | * CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP |
1068 | */ | 1068 | */ |
1069 | #define OMAP4430_L4SEC_STATDEP_SHIFT (1 << 14) | 1069 | #define OMAP4430_L4SEC_STATDEP_SHIFT 14 |
1070 | #define OMAP4430_L4SEC_STATDEP_MASK BITFIELD(14, 14) | 1070 | #define OMAP4430_L4SEC_STATDEP_MASK BITFIELD(14, 14) |
1071 | 1071 | ||
1072 | /* Used by CM_L4CFG_DYNAMICDEP */ | 1072 | /* Used by CM_L4CFG_DYNAMICDEP */ |
1073 | #define OMAP4430_L4WKUP_DYNDEP_SHIFT (1 << 15) | 1073 | #define OMAP4430_L4WKUP_DYNDEP_SHIFT 15 |
1074 | #define OMAP4430_L4WKUP_DYNDEP_MASK BITFIELD(15, 15) | 1074 | #define OMAP4430_L4WKUP_DYNDEP_MASK BITFIELD(15, 15) |
1075 | 1075 | ||
1076 | /* | 1076 | /* |
1077 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_L3INIT_STATICDEP, | 1077 | * Used by CM_DUCATI_STATICDEP, CM_SDMA_STATICDEP, CM_L3INIT_STATICDEP, |
1078 | * CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, CM_TESLA_STATICDEP | 1078 | * CM_SDMA_STATICDEP_RESTORE, CM_MPU_STATICDEP, CM_TESLA_STATICDEP |
1079 | */ | 1079 | */ |
1080 | #define OMAP4430_L4WKUP_STATDEP_SHIFT (1 << 15) | 1080 | #define OMAP4430_L4WKUP_STATDEP_SHIFT 15 |
1081 | #define OMAP4430_L4WKUP_STATDEP_MASK BITFIELD(15, 15) | 1081 | #define OMAP4430_L4WKUP_STATDEP_MASK BITFIELD(15, 15) |
1082 | 1082 | ||
1083 | /* | 1083 | /* |
1084 | * Used by CM_D2D_DYNAMICDEP, CM_L3_1_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, | 1084 | * Used by CM_D2D_DYNAMICDEP, CM_L3_1_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, |
1085 | * CM_MPU_DYNAMICDEP | 1085 | * CM_MPU_DYNAMICDEP |
1086 | */ | 1086 | */ |
1087 | #define OMAP4430_MEMIF_DYNDEP_SHIFT (1 << 4) | 1087 | #define OMAP4430_MEMIF_DYNDEP_SHIFT 4 |
1088 | #define OMAP4430_MEMIF_DYNDEP_MASK BITFIELD(4, 4) | 1088 | #define OMAP4430_MEMIF_DYNDEP_MASK BITFIELD(4, 4) |
1089 | 1089 | ||
1090 | /* | 1090 | /* |
@@ -1093,7 +1093,7 @@ | |||
1093 | * CM_SDMA_STATICDEP_RESTORE, CM_IVAHD_STATICDEP, CM_DSS_STATICDEP, | 1093 | * CM_SDMA_STATICDEP_RESTORE, CM_IVAHD_STATICDEP, CM_DSS_STATICDEP, |
1094 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP | 1094 | * CM_MPU_STATICDEP, CM_TESLA_STATICDEP |
1095 | */ | 1095 | */ |
1096 | #define OMAP4430_MEMIF_STATDEP_SHIFT (1 << 4) | 1096 | #define OMAP4430_MEMIF_STATDEP_SHIFT 4 |
1097 | #define OMAP4430_MEMIF_STATDEP_MASK BITFIELD(4, 4) | 1097 | #define OMAP4430_MEMIF_STATDEP_MASK BITFIELD(4, 4) |
1098 | 1098 | ||
1099 | /* | 1099 | /* |
@@ -1103,7 +1103,7 @@ | |||
1103 | * CM_SSC_MODFREQDIV_DPLL_DDRPHY, CM_SSC_MODFREQDIV_DPLL_IVA, | 1103 | * CM_SSC_MODFREQDIV_DPLL_DDRPHY, CM_SSC_MODFREQDIV_DPLL_IVA, |
1104 | * CM_SSC_MODFREQDIV_DPLL_MPU | 1104 | * CM_SSC_MODFREQDIV_DPLL_MPU |
1105 | */ | 1105 | */ |
1106 | #define OMAP4430_MODFREQDIV_EXPONENT_SHIFT (1 << 8) | 1106 | #define OMAP4430_MODFREQDIV_EXPONENT_SHIFT 8 |
1107 | #define OMAP4430_MODFREQDIV_EXPONENT_MASK BITFIELD(8, 10) | 1107 | #define OMAP4430_MODFREQDIV_EXPONENT_MASK BITFIELD(8, 10) |
1108 | 1108 | ||
1109 | /* | 1109 | /* |
@@ -1113,7 +1113,7 @@ | |||
1113 | * CM_SSC_MODFREQDIV_DPLL_DDRPHY, CM_SSC_MODFREQDIV_DPLL_IVA, | 1113 | * CM_SSC_MODFREQDIV_DPLL_DDRPHY, CM_SSC_MODFREQDIV_DPLL_IVA, |
1114 | * CM_SSC_MODFREQDIV_DPLL_MPU | 1114 | * CM_SSC_MODFREQDIV_DPLL_MPU |
1115 | */ | 1115 | */ |
1116 | #define OMAP4430_MODFREQDIV_MANTISSA_SHIFT (1 << 0) | 1116 | #define OMAP4430_MODFREQDIV_MANTISSA_SHIFT 0 |
1117 | #define OMAP4430_MODFREQDIV_MANTISSA_MASK BITFIELD(0, 6) | 1117 | #define OMAP4430_MODFREQDIV_MANTISSA_MASK BITFIELD(0, 6) |
1118 | 1118 | ||
1119 | /* | 1119 | /* |
@@ -1169,23 +1169,23 @@ | |||
1169 | * CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, CM1_ABE_TIMER8_CLKCTRL, | 1169 | * CM1_ABE_TIMER6_CLKCTRL, CM1_ABE_TIMER7_CLKCTRL, CM1_ABE_TIMER8_CLKCTRL, |
1170 | * CM1_ABE_WDT3_CLKCTRL, CM_CM1_PROFILING_CLKCTRL | 1170 | * CM1_ABE_WDT3_CLKCTRL, CM_CM1_PROFILING_CLKCTRL |
1171 | */ | 1171 | */ |
1172 | #define OMAP4430_MODULEMODE_SHIFT (1 << 0) | 1172 | #define OMAP4430_MODULEMODE_SHIFT 0 |
1173 | #define OMAP4430_MODULEMODE_MASK BITFIELD(0, 1) | 1173 | #define OMAP4430_MODULEMODE_MASK BITFIELD(0, 1) |
1174 | 1174 | ||
1175 | /* Used by CM_DSS_DSS_CLKCTRL */ | 1175 | /* Used by CM_DSS_DSS_CLKCTRL */ |
1176 | #define OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT (1 << 9) | 1176 | #define OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT 9 |
1177 | #define OMAP4430_OPTFCLKEN_48MHZ_CLK_MASK BITFIELD(9, 9) | 1177 | #define OMAP4430_OPTFCLKEN_48MHZ_CLK_MASK BITFIELD(9, 9) |
1178 | 1178 | ||
1179 | /* Used by CM_WKUP_BANDGAP_CLKCTRL */ | 1179 | /* Used by CM_WKUP_BANDGAP_CLKCTRL */ |
1180 | #define OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT (1 << 8) | 1180 | #define OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT 8 |
1181 | #define OMAP4430_OPTFCLKEN_BGAP_32K_MASK BITFIELD(8, 8) | 1181 | #define OMAP4430_OPTFCLKEN_BGAP_32K_MASK BITFIELD(8, 8) |
1182 | 1182 | ||
1183 | /* Used by CM_L3INIT_USBPHYOCP2SCP_CLKCTRL */ | 1183 | /* Used by CM_L3INIT_USBPHYOCP2SCP_CLKCTRL */ |
1184 | #define OMAP4430_OPTFCLKEN_CLK32K_SHIFT (1 << 9) | 1184 | #define OMAP4430_OPTFCLKEN_CLK32K_SHIFT 9 |
1185 | #define OMAP4430_OPTFCLKEN_CLK32K_MASK BITFIELD(9, 9) | 1185 | #define OMAP4430_OPTFCLKEN_CLK32K_MASK BITFIELD(9, 9) |
1186 | 1186 | ||
1187 | /* Used by CM_CAM_ISS_CLKCTRL */ | 1187 | /* Used by CM_CAM_ISS_CLKCTRL */ |
1188 | #define OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT (1 << 8) | 1188 | #define OMAP4430_OPTFCLKEN_CTRLCLK_SHIFT 8 |
1189 | #define OMAP4430_OPTFCLKEN_CTRLCLK_MASK BITFIELD(8, 8) | 1189 | #define OMAP4430_OPTFCLKEN_CTRLCLK_MASK BITFIELD(8, 8) |
1190 | 1190 | ||
1191 | /* | 1191 | /* |
@@ -1195,119 +1195,119 @@ | |||
1195 | * CM_L4PER_GPIO3_CLKCTRL_RESTORE, CM_L4PER_GPIO4_CLKCTRL_RESTORE, | 1195 | * CM_L4PER_GPIO3_CLKCTRL_RESTORE, CM_L4PER_GPIO4_CLKCTRL_RESTORE, |
1196 | * CM_L4PER_GPIO5_CLKCTRL_RESTORE, CM_L4PER_GPIO6_CLKCTRL_RESTORE | 1196 | * CM_L4PER_GPIO5_CLKCTRL_RESTORE, CM_L4PER_GPIO6_CLKCTRL_RESTORE |
1197 | */ | 1197 | */ |
1198 | #define OMAP4430_OPTFCLKEN_DBCLK_SHIFT (1 << 8) | 1198 | #define OMAP4430_OPTFCLKEN_DBCLK_SHIFT 8 |
1199 | #define OMAP4430_OPTFCLKEN_DBCLK_MASK BITFIELD(8, 8) | 1199 | #define OMAP4430_OPTFCLKEN_DBCLK_MASK BITFIELD(8, 8) |
1200 | 1200 | ||
1201 | /* Used by CM_MEMIF_DLL_CLKCTRL, CM_MEMIF_DLL_H_CLKCTRL */ | 1201 | /* Used by CM_MEMIF_DLL_CLKCTRL, CM_MEMIF_DLL_H_CLKCTRL */ |
1202 | #define OMAP4430_OPTFCLKEN_DLL_CLK_SHIFT (1 << 8) | 1202 | #define OMAP4430_OPTFCLKEN_DLL_CLK_SHIFT 8 |
1203 | #define OMAP4430_OPTFCLKEN_DLL_CLK_MASK BITFIELD(8, 8) | 1203 | #define OMAP4430_OPTFCLKEN_DLL_CLK_MASK BITFIELD(8, 8) |
1204 | 1204 | ||
1205 | /* Used by CM_DSS_DSS_CLKCTRL */ | 1205 | /* Used by CM_DSS_DSS_CLKCTRL */ |
1206 | #define OMAP4430_OPTFCLKEN_DSSCLK_SHIFT (1 << 8) | 1206 | #define OMAP4430_OPTFCLKEN_DSSCLK_SHIFT 8 |
1207 | #define OMAP4430_OPTFCLKEN_DSSCLK_MASK BITFIELD(8, 8) | 1207 | #define OMAP4430_OPTFCLKEN_DSSCLK_MASK BITFIELD(8, 8) |
1208 | 1208 | ||
1209 | /* Used by CM1_ABE_SLIMBUS_CLKCTRL */ | 1209 | /* Used by CM1_ABE_SLIMBUS_CLKCTRL */ |
1210 | #define OMAP4430_OPTFCLKEN_FCLK0_SHIFT (1 << 8) | 1210 | #define OMAP4430_OPTFCLKEN_FCLK0_SHIFT 8 |
1211 | #define OMAP4430_OPTFCLKEN_FCLK0_MASK BITFIELD(8, 8) | 1211 | #define OMAP4430_OPTFCLKEN_FCLK0_MASK BITFIELD(8, 8) |
1212 | 1212 | ||
1213 | /* Used by CM1_ABE_SLIMBUS_CLKCTRL */ | 1213 | /* Used by CM1_ABE_SLIMBUS_CLKCTRL */ |
1214 | #define OMAP4430_OPTFCLKEN_FCLK1_SHIFT (1 << 9) | 1214 | #define OMAP4430_OPTFCLKEN_FCLK1_SHIFT 9 |
1215 | #define OMAP4430_OPTFCLKEN_FCLK1_MASK BITFIELD(9, 9) | 1215 | #define OMAP4430_OPTFCLKEN_FCLK1_MASK BITFIELD(9, 9) |
1216 | 1216 | ||
1217 | /* Used by CM1_ABE_SLIMBUS_CLKCTRL */ | 1217 | /* Used by CM1_ABE_SLIMBUS_CLKCTRL */ |
1218 | #define OMAP4430_OPTFCLKEN_FCLK2_SHIFT (1 << 10) | 1218 | #define OMAP4430_OPTFCLKEN_FCLK2_SHIFT 10 |
1219 | #define OMAP4430_OPTFCLKEN_FCLK2_MASK BITFIELD(10, 10) | 1219 | #define OMAP4430_OPTFCLKEN_FCLK2_MASK BITFIELD(10, 10) |
1220 | 1220 | ||
1221 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1221 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1222 | #define OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT (1 << 15) | 1222 | #define OMAP4430_OPTFCLKEN_FUNC48MCLK_SHIFT 15 |
1223 | #define OMAP4430_OPTFCLKEN_FUNC48MCLK_MASK BITFIELD(15, 15) | 1223 | #define OMAP4430_OPTFCLKEN_FUNC48MCLK_MASK BITFIELD(15, 15) |
1224 | 1224 | ||
1225 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1225 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1226 | #define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT (1 << 13) | 1226 | #define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_SHIFT 13 |
1227 | #define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_MASK BITFIELD(13, 13) | 1227 | #define OMAP4430_OPTFCLKEN_HSIC480M_P1_CLK_MASK BITFIELD(13, 13) |
1228 | 1228 | ||
1229 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1229 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1230 | #define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT (1 << 14) | 1230 | #define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_SHIFT 14 |
1231 | #define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_MASK BITFIELD(14, 14) | 1231 | #define OMAP4430_OPTFCLKEN_HSIC480M_P2_CLK_MASK BITFIELD(14, 14) |
1232 | 1232 | ||
1233 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1233 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1234 | #define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT (1 << 11) | 1234 | #define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_SHIFT 11 |
1235 | #define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_MASK BITFIELD(11, 11) | 1235 | #define OMAP4430_OPTFCLKEN_HSIC60M_P1_CLK_MASK BITFIELD(11, 11) |
1236 | 1236 | ||
1237 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1237 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1238 | #define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT (1 << 12) | 1238 | #define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_SHIFT 12 |
1239 | #define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_MASK BITFIELD(12, 12) | 1239 | #define OMAP4430_OPTFCLKEN_HSIC60M_P2_CLK_MASK BITFIELD(12, 12) |
1240 | 1240 | ||
1241 | /* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ | 1241 | /* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ |
1242 | #define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT (1 << 8) | 1242 | #define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_SHIFT 8 |
1243 | #define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_MASK BITFIELD(8, 8) | 1243 | #define OMAP4430_OPTFCLKEN_PER24MC_GFCLK_MASK BITFIELD(8, 8) |
1244 | 1244 | ||
1245 | /* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ | 1245 | /* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ |
1246 | #define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT (1 << 9) | 1246 | #define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_SHIFT 9 |
1247 | #define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_MASK BITFIELD(9, 9) | 1247 | #define OMAP4430_OPTFCLKEN_PERABE24M_GFCLK_MASK BITFIELD(9, 9) |
1248 | 1248 | ||
1249 | /* Used by CM_L3INIT_USBPHYOCP2SCP_CLKCTRL */ | 1249 | /* Used by CM_L3INIT_USBPHYOCP2SCP_CLKCTRL */ |
1250 | #define OMAP4430_OPTFCLKEN_PHY_48M_SHIFT (1 << 8) | 1250 | #define OMAP4430_OPTFCLKEN_PHY_48M_SHIFT 8 |
1251 | #define OMAP4430_OPTFCLKEN_PHY_48M_MASK BITFIELD(8, 8) | 1251 | #define OMAP4430_OPTFCLKEN_PHY_48M_MASK BITFIELD(8, 8) |
1252 | 1252 | ||
1253 | /* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ | 1253 | /* Used by CM_L4PER_SLIMBUS2_CLKCTRL */ |
1254 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT (1 << 10) | 1254 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_SHIFT 10 |
1255 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_MASK BITFIELD(10, 10) | 1255 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_MASK BITFIELD(10, 10) |
1256 | 1256 | ||
1257 | /* Renamed from OPTFCLKEN_SLIMBUS_CLK Used by CM1_ABE_SLIMBUS_CLKCTRL */ | 1257 | /* Renamed from OPTFCLKEN_SLIMBUS_CLK Used by CM1_ABE_SLIMBUS_CLKCTRL */ |
1258 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT (1 << 11) | 1258 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_SHIFT 11 |
1259 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_MASK BITFIELD(11, 11) | 1259 | #define OMAP4430_OPTFCLKEN_SLIMBUS_CLK_11_11_MASK BITFIELD(11, 11) |
1260 | 1260 | ||
1261 | /* Used by CM_DSS_DSS_CLKCTRL */ | 1261 | /* Used by CM_DSS_DSS_CLKCTRL */ |
1262 | #define OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT (1 << 10) | 1262 | #define OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT 10 |
1263 | #define OMAP4430_OPTFCLKEN_SYS_CLK_MASK BITFIELD(10, 10) | 1263 | #define OMAP4430_OPTFCLKEN_SYS_CLK_MASK BITFIELD(10, 10) |
1264 | 1264 | ||
1265 | /* Used by CM_DSS_DSS_CLKCTRL */ | 1265 | /* Used by CM_DSS_DSS_CLKCTRL */ |
1266 | #define OMAP4430_OPTFCLKEN_TV_CLK_SHIFT (1 << 11) | 1266 | #define OMAP4430_OPTFCLKEN_TV_CLK_SHIFT 11 |
1267 | #define OMAP4430_OPTFCLKEN_TV_CLK_MASK BITFIELD(11, 11) | 1267 | #define OMAP4430_OPTFCLKEN_TV_CLK_MASK BITFIELD(11, 11) |
1268 | 1268 | ||
1269 | /* Used by CM_L3INIT_UNIPRO1_CLKCTRL */ | 1269 | /* Used by CM_L3INIT_UNIPRO1_CLKCTRL */ |
1270 | #define OMAP4430_OPTFCLKEN_TXPHYCLK_SHIFT (1 << 8) | 1270 | #define OMAP4430_OPTFCLKEN_TXPHYCLK_SHIFT 8 |
1271 | #define OMAP4430_OPTFCLKEN_TXPHYCLK_MASK BITFIELD(8, 8) | 1271 | #define OMAP4430_OPTFCLKEN_TXPHYCLK_MASK BITFIELD(8, 8) |
1272 | 1272 | ||
1273 | /* Used by CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE */ | 1273 | /* Used by CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE */ |
1274 | #define OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT (1 << 8) | 1274 | #define OMAP4430_OPTFCLKEN_USB_CH0_CLK_SHIFT 8 |
1275 | #define OMAP4430_OPTFCLKEN_USB_CH0_CLK_MASK BITFIELD(8, 8) | 1275 | #define OMAP4430_OPTFCLKEN_USB_CH0_CLK_MASK BITFIELD(8, 8) |
1276 | 1276 | ||
1277 | /* Used by CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE */ | 1277 | /* Used by CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE */ |
1278 | #define OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT (1 << 9) | 1278 | #define OMAP4430_OPTFCLKEN_USB_CH1_CLK_SHIFT 9 |
1279 | #define OMAP4430_OPTFCLKEN_USB_CH1_CLK_MASK BITFIELD(9, 9) | 1279 | #define OMAP4430_OPTFCLKEN_USB_CH1_CLK_MASK BITFIELD(9, 9) |
1280 | 1280 | ||
1281 | /* Used by CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE */ | 1281 | /* Used by CM_L3INIT_USB_TLL_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE */ |
1282 | #define OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT (1 << 10) | 1282 | #define OMAP4430_OPTFCLKEN_USB_CH2_CLK_SHIFT 10 |
1283 | #define OMAP4430_OPTFCLKEN_USB_CH2_CLK_MASK BITFIELD(10, 10) | 1283 | #define OMAP4430_OPTFCLKEN_USB_CH2_CLK_MASK BITFIELD(10, 10) |
1284 | 1284 | ||
1285 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1285 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1286 | #define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT (1 << 8) | 1286 | #define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_SHIFT 8 |
1287 | #define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_MASK BITFIELD(8, 8) | 1287 | #define OMAP4430_OPTFCLKEN_UTMI_P1_CLK_MASK BITFIELD(8, 8) |
1288 | 1288 | ||
1289 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1289 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1290 | #define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT (1 << 9) | 1290 | #define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_SHIFT 9 |
1291 | #define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_MASK BITFIELD(9, 9) | 1291 | #define OMAP4430_OPTFCLKEN_UTMI_P2_CLK_MASK BITFIELD(9, 9) |
1292 | 1292 | ||
1293 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ | 1293 | /* Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_HOST_CLKCTRL_RESTORE */ |
1294 | #define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT (1 << 10) | 1294 | #define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_SHIFT 10 |
1295 | #define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_MASK BITFIELD(10, 10) | 1295 | #define OMAP4430_OPTFCLKEN_UTMI_P3_CLK_MASK BITFIELD(10, 10) |
1296 | 1296 | ||
1297 | /* Used by CM_L3INIT_USB_OTG_CLKCTRL */ | 1297 | /* Used by CM_L3INIT_USB_OTG_CLKCTRL */ |
1298 | #define OMAP4430_OPTFCLKEN_XCLK_SHIFT (1 << 8) | 1298 | #define OMAP4430_OPTFCLKEN_XCLK_SHIFT 8 |
1299 | #define OMAP4430_OPTFCLKEN_XCLK_MASK BITFIELD(8, 8) | 1299 | #define OMAP4430_OPTFCLKEN_XCLK_MASK BITFIELD(8, 8) |
1300 | 1300 | ||
1301 | /* Used by CM_EMU_OVERRIDE_DPLL_PER, CM_EMU_OVERRIDE_DPLL_CORE */ | 1301 | /* Used by CM_EMU_OVERRIDE_DPLL_PER, CM_EMU_OVERRIDE_DPLL_CORE */ |
1302 | #define OMAP4430_OVERRIDE_ENABLE_SHIFT (1 << 19) | 1302 | #define OMAP4430_OVERRIDE_ENABLE_SHIFT 19 |
1303 | #define OMAP4430_OVERRIDE_ENABLE_MASK BITFIELD(19, 19) | 1303 | #define OMAP4430_OVERRIDE_ENABLE_MASK BITFIELD(19, 19) |
1304 | 1304 | ||
1305 | /* Used by CM_CLKSEL_ABE */ | 1305 | /* Used by CM_CLKSEL_ABE */ |
1306 | #define OMAP4430_PAD_CLKS_GATE_SHIFT (1 << 8) | 1306 | #define OMAP4430_PAD_CLKS_GATE_SHIFT 8 |
1307 | #define OMAP4430_PAD_CLKS_GATE_MASK BITFIELD(8, 8) | 1307 | #define OMAP4430_PAD_CLKS_GATE_MASK BITFIELD(8, 8) |
1308 | 1308 | ||
1309 | /* Used by CM_CORE_DVFS_CURRENT, CM_IVA_DVFS_CURRENT */ | 1309 | /* Used by CM_CORE_DVFS_CURRENT, CM_IVA_DVFS_CURRENT */ |
1310 | #define OMAP4430_PERF_CURRENT_SHIFT (1 << 0) | 1310 | #define OMAP4430_PERF_CURRENT_SHIFT 0 |
1311 | #define OMAP4430_PERF_CURRENT_MASK BITFIELD(0, 7) | 1311 | #define OMAP4430_PERF_CURRENT_MASK BITFIELD(0, 7) |
1312 | 1312 | ||
1313 | /* | 1313 | /* |
@@ -1315,66 +1315,66 @@ | |||
1315 | * CM_CORE_DVFS_PERF4, CM_IVA_DVFS_PERF_ABE, CM_IVA_DVFS_PERF_IVAHD, | 1315 | * CM_CORE_DVFS_PERF4, CM_IVA_DVFS_PERF_ABE, CM_IVA_DVFS_PERF_IVAHD, |
1316 | * CM_IVA_DVFS_PERF_TESLA | 1316 | * CM_IVA_DVFS_PERF_TESLA |
1317 | */ | 1317 | */ |
1318 | #define OMAP4430_PERF_REQ_SHIFT (1 << 0) | 1318 | #define OMAP4430_PERF_REQ_SHIFT 0 |
1319 | #define OMAP4430_PERF_REQ_MASK BITFIELD(0, 7) | 1319 | #define OMAP4430_PERF_REQ_MASK BITFIELD(0, 7) |
1320 | 1320 | ||
1321 | /* Used by CM_EMU_OVERRIDE_DPLL_PER */ | 1321 | /* Used by CM_EMU_OVERRIDE_DPLL_PER */ |
1322 | #define OMAP4430_PER_DPLL_EMU_DIV_SHIFT (1 << 0) | 1322 | #define OMAP4430_PER_DPLL_EMU_DIV_SHIFT 0 |
1323 | #define OMAP4430_PER_DPLL_EMU_DIV_MASK BITFIELD(0, 6) | 1323 | #define OMAP4430_PER_DPLL_EMU_DIV_MASK BITFIELD(0, 6) |
1324 | 1324 | ||
1325 | /* Used by CM_EMU_OVERRIDE_DPLL_PER */ | 1325 | /* Used by CM_EMU_OVERRIDE_DPLL_PER */ |
1326 | #define OMAP4430_PER_DPLL_EMU_MULT_SHIFT (1 << 8) | 1326 | #define OMAP4430_PER_DPLL_EMU_MULT_SHIFT 8 |
1327 | #define OMAP4430_PER_DPLL_EMU_MULT_MASK BITFIELD(8, 18) | 1327 | #define OMAP4430_PER_DPLL_EMU_MULT_MASK BITFIELD(8, 18) |
1328 | 1328 | ||
1329 | /* Used by CM_RESTORE_ST */ | 1329 | /* Used by CM_RESTORE_ST */ |
1330 | #define OMAP4430_PHASE1_COMPLETED_SHIFT (1 << 0) | 1330 | #define OMAP4430_PHASE1_COMPLETED_SHIFT 0 |
1331 | #define OMAP4430_PHASE1_COMPLETED_MASK BITFIELD(0, 0) | 1331 | #define OMAP4430_PHASE1_COMPLETED_MASK BITFIELD(0, 0) |
1332 | 1332 | ||
1333 | /* Used by CM_RESTORE_ST */ | 1333 | /* Used by CM_RESTORE_ST */ |
1334 | #define OMAP4430_PHASE2A_COMPLETED_SHIFT (1 << 1) | 1334 | #define OMAP4430_PHASE2A_COMPLETED_SHIFT 1 |
1335 | #define OMAP4430_PHASE2A_COMPLETED_MASK BITFIELD(1, 1) | 1335 | #define OMAP4430_PHASE2A_COMPLETED_MASK BITFIELD(1, 1) |
1336 | 1336 | ||
1337 | /* Used by CM_RESTORE_ST */ | 1337 | /* Used by CM_RESTORE_ST */ |
1338 | #define OMAP4430_PHASE2B_COMPLETED_SHIFT (1 << 2) | 1338 | #define OMAP4430_PHASE2B_COMPLETED_SHIFT 2 |
1339 | #define OMAP4430_PHASE2B_COMPLETED_MASK BITFIELD(2, 2) | 1339 | #define OMAP4430_PHASE2B_COMPLETED_MASK BITFIELD(2, 2) |
1340 | 1340 | ||
1341 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ | 1341 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ |
1342 | #define OMAP4430_PMD_STM_MUX_CTRL_SHIFT (1 << 20) | 1342 | #define OMAP4430_PMD_STM_MUX_CTRL_SHIFT 20 |
1343 | #define OMAP4430_PMD_STM_MUX_CTRL_MASK BITFIELD(20, 21) | 1343 | #define OMAP4430_PMD_STM_MUX_CTRL_MASK BITFIELD(20, 21) |
1344 | 1344 | ||
1345 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ | 1345 | /* Used by CM_EMU_DEBUGSS_CLKCTRL */ |
1346 | #define OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT (1 << 22) | 1346 | #define OMAP4430_PMD_TRACE_MUX_CTRL_SHIFT 22 |
1347 | #define OMAP4430_PMD_TRACE_MUX_CTRL_MASK BITFIELD(22, 23) | 1347 | #define OMAP4430_PMD_TRACE_MUX_CTRL_MASK BITFIELD(22, 23) |
1348 | 1348 | ||
1349 | /* Used by CM_DYN_DEP_PRESCAL */ | 1349 | /* Used by CM_DYN_DEP_PRESCAL */ |
1350 | #define OMAP4430_PRESCAL_SHIFT (1 << 0) | 1350 | #define OMAP4430_PRESCAL_SHIFT 0 |
1351 | #define OMAP4430_PRESCAL_MASK BITFIELD(0, 5) | 1351 | #define OMAP4430_PRESCAL_MASK BITFIELD(0, 5) |
1352 | 1352 | ||
1353 | /* Used by REVISION_CM2, REVISION_CM1 */ | 1353 | /* Used by REVISION_CM2, REVISION_CM1 */ |
1354 | #define OMAP4430_REV_SHIFT (1 << 0) | 1354 | #define OMAP4430_REV_SHIFT 0 |
1355 | #define OMAP4430_REV_MASK BITFIELD(0, 7) | 1355 | #define OMAP4430_REV_MASK BITFIELD(0, 7) |
1356 | 1356 | ||
1357 | /* | 1357 | /* |
1358 | * Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL, | 1358 | * Used by CM_L3INIT_USB_HOST_CLKCTRL, CM_L3INIT_USB_TLL_CLKCTRL, |
1359 | * CM_L3INIT_USB_HOST_CLKCTRL_RESTORE, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE | 1359 | * CM_L3INIT_USB_HOST_CLKCTRL_RESTORE, CM_L3INIT_USB_TLL_CLKCTRL_RESTORE |
1360 | */ | 1360 | */ |
1361 | #define OMAP4430_SAR_MODE_SHIFT (1 << 4) | 1361 | #define OMAP4430_SAR_MODE_SHIFT 4 |
1362 | #define OMAP4430_SAR_MODE_MASK BITFIELD(4, 4) | 1362 | #define OMAP4430_SAR_MODE_MASK BITFIELD(4, 4) |
1363 | 1363 | ||
1364 | /* Used by CM_SCALE_FCLK */ | 1364 | /* Used by CM_SCALE_FCLK */ |
1365 | #define OMAP4430_SCALE_FCLK_SHIFT (1 << 0) | 1365 | #define OMAP4430_SCALE_FCLK_SHIFT 0 |
1366 | #define OMAP4430_SCALE_FCLK_MASK BITFIELD(0, 0) | 1366 | #define OMAP4430_SCALE_FCLK_MASK BITFIELD(0, 0) |
1367 | 1367 | ||
1368 | /* Used by CM_L4CFG_DYNAMICDEP */ | 1368 | /* Used by CM_L4CFG_DYNAMICDEP */ |
1369 | #define OMAP4430_SDMA_DYNDEP_SHIFT (1 << 11) | 1369 | #define OMAP4430_SDMA_DYNDEP_SHIFT 11 |
1370 | #define OMAP4430_SDMA_DYNDEP_MASK BITFIELD(11, 11) | 1370 | #define OMAP4430_SDMA_DYNDEP_MASK BITFIELD(11, 11) |
1371 | 1371 | ||
1372 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ | 1372 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ |
1373 | #define OMAP4430_SDMA_STATDEP_SHIFT (1 << 11) | 1373 | #define OMAP4430_SDMA_STATDEP_SHIFT 11 |
1374 | #define OMAP4430_SDMA_STATDEP_MASK BITFIELD(11, 11) | 1374 | #define OMAP4430_SDMA_STATDEP_MASK BITFIELD(11, 11) |
1375 | 1375 | ||
1376 | /* Used by CM_CLKSEL_ABE */ | 1376 | /* Used by CM_CLKSEL_ABE */ |
1377 | #define OMAP4430_SLIMBUS_CLK_GATE_SHIFT (1 << 10) | 1377 | #define OMAP4430_SLIMBUS_CLK_GATE_SHIFT 10 |
1378 | #define OMAP4430_SLIMBUS_CLK_GATE_MASK BITFIELD(10, 10) | 1378 | #define OMAP4430_SLIMBUS_CLK_GATE_MASK BITFIELD(10, 10) |
1379 | 1379 | ||
1380 | /* | 1380 | /* |
@@ -1390,7 +1390,7 @@ | |||
1390 | * CM_IVAHD_IVAHD_CLKCTRL, CM_DSS_DEISS_CLKCTRL, CM_DSS_DSS_CLKCTRL, | 1390 | * CM_IVAHD_IVAHD_CLKCTRL, CM_DSS_DEISS_CLKCTRL, CM_DSS_DSS_CLKCTRL, |
1391 | * CM_MPU_MPU_CLKCTRL, CM_TESLA_TESLA_CLKCTRL, CM1_ABE_AESS_CLKCTRL | 1391 | * CM_MPU_MPU_CLKCTRL, CM_TESLA_TESLA_CLKCTRL, CM1_ABE_AESS_CLKCTRL |
1392 | */ | 1392 | */ |
1393 | #define OMAP4430_STBYST_SHIFT (1 << 18) | 1393 | #define OMAP4430_STBYST_SHIFT 18 |
1394 | #define OMAP4430_STBYST_MASK BITFIELD(18, 18) | 1394 | #define OMAP4430_STBYST_MASK BITFIELD(18, 18) |
1395 | 1395 | ||
1396 | /* | 1396 | /* |
@@ -1398,11 +1398,11 @@ | |||
1398 | * CM_IDLEST_DPLL_ABE, CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDRPHY, | 1398 | * CM_IDLEST_DPLL_ABE, CM_IDLEST_DPLL_CORE, CM_IDLEST_DPLL_DDRPHY, |
1399 | * CM_IDLEST_DPLL_IVA, CM_IDLEST_DPLL_MPU | 1399 | * CM_IDLEST_DPLL_IVA, CM_IDLEST_DPLL_MPU |
1400 | */ | 1400 | */ |
1401 | #define OMAP4430_ST_DPLL_CLK_SHIFT (1 << 0) | 1401 | #define OMAP4430_ST_DPLL_CLK_SHIFT 0 |
1402 | #define OMAP4430_ST_DPLL_CLK_MASK BITFIELD(0, 0) | 1402 | #define OMAP4430_ST_DPLL_CLK_MASK BITFIELD(0, 0) |
1403 | 1403 | ||
1404 | /* Used by CM_CLKDCOLDO_DPLL_USB */ | 1404 | /* Used by CM_CLKDCOLDO_DPLL_USB */ |
1405 | #define OMAP4430_ST_DPLL_CLKDCOLDO_SHIFT (1 << 9) | 1405 | #define OMAP4430_ST_DPLL_CLKDCOLDO_SHIFT 9 |
1406 | #define OMAP4430_ST_DPLL_CLKDCOLDO_MASK BITFIELD(9, 9) | 1406 | #define OMAP4430_ST_DPLL_CLKDCOLDO_MASK BITFIELD(9, 9) |
1407 | 1407 | ||
1408 | /* | 1408 | /* |
@@ -1410,58 +1410,58 @@ | |||
1410 | * CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY, | 1410 | * CM_DIV_M2_DPLL_ABE, CM_DIV_M2_DPLL_CORE, CM_DIV_M2_DPLL_DDRPHY, |
1411 | * CM_DIV_M2_DPLL_MPU | 1411 | * CM_DIV_M2_DPLL_MPU |
1412 | */ | 1412 | */ |
1413 | #define OMAP4430_ST_DPLL_CLKOUT_SHIFT (1 << 9) | 1413 | #define OMAP4430_ST_DPLL_CLKOUT_SHIFT 9 |
1414 | #define OMAP4430_ST_DPLL_CLKOUT_MASK BITFIELD(9, 9) | 1414 | #define OMAP4430_ST_DPLL_CLKOUT_MASK BITFIELD(9, 9) |
1415 | 1415 | ||
1416 | /* | 1416 | /* |
1417 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, | 1417 | * Used by CM_DIV_M3_DPLL_PER, CM_DIV_M3_DPLL_CORE_RESTORE, CM_DIV_M3_DPLL_ABE, |
1418 | * CM_DIV_M3_DPLL_CORE | 1418 | * CM_DIV_M3_DPLL_CORE |
1419 | */ | 1419 | */ |
1420 | #define OMAP4430_ST_DPLL_CLKOUTHIF_SHIFT (1 << 9) | 1420 | #define OMAP4430_ST_DPLL_CLKOUTHIF_SHIFT 9 |
1421 | #define OMAP4430_ST_DPLL_CLKOUTHIF_MASK BITFIELD(9, 9) | 1421 | #define OMAP4430_ST_DPLL_CLKOUTHIF_MASK BITFIELD(9, 9) |
1422 | 1422 | ||
1423 | /* Used by CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO, CM_DIV_M2_DPLL_ABE */ | 1423 | /* Used by CM_DIV_M2_DPLL_PER, CM_DIV_M2_DPLL_UNIPRO, CM_DIV_M2_DPLL_ABE */ |
1424 | #define OMAP4430_ST_DPLL_CLKOUTX2_SHIFT (1 << 11) | 1424 | #define OMAP4430_ST_DPLL_CLKOUTX2_SHIFT 11 |
1425 | #define OMAP4430_ST_DPLL_CLKOUTX2_MASK BITFIELD(11, 11) | 1425 | #define OMAP4430_ST_DPLL_CLKOUTX2_MASK BITFIELD(11, 11) |
1426 | 1426 | ||
1427 | /* | 1427 | /* |
1428 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, | 1428 | * Used by CM_DIV_M4_DPLL_PER, CM_DIV_M4_DPLL_CORE_RESTORE, |
1429 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA | 1429 | * CM_DIV_M4_DPLL_CORE, CM_DIV_M4_DPLL_DDRPHY, CM_DIV_M4_DPLL_IVA |
1430 | */ | 1430 | */ |
1431 | #define OMAP4430_ST_HSDIVIDER_CLKOUT1_SHIFT (1 << 9) | 1431 | #define OMAP4430_ST_HSDIVIDER_CLKOUT1_SHIFT 9 |
1432 | #define OMAP4430_ST_HSDIVIDER_CLKOUT1_MASK BITFIELD(9, 9) | 1432 | #define OMAP4430_ST_HSDIVIDER_CLKOUT1_MASK BITFIELD(9, 9) |
1433 | 1433 | ||
1434 | /* | 1434 | /* |
1435 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, | 1435 | * Used by CM_DIV_M5_DPLL_PER, CM_DIV_M5_DPLL_CORE_RESTORE, |
1436 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA | 1436 | * CM_DIV_M5_DPLL_CORE, CM_DIV_M5_DPLL_DDRPHY, CM_DIV_M5_DPLL_IVA |
1437 | */ | 1437 | */ |
1438 | #define OMAP4430_ST_HSDIVIDER_CLKOUT2_SHIFT (1 << 9) | 1438 | #define OMAP4430_ST_HSDIVIDER_CLKOUT2_SHIFT 9 |
1439 | #define OMAP4430_ST_HSDIVIDER_CLKOUT2_MASK BITFIELD(9, 9) | 1439 | #define OMAP4430_ST_HSDIVIDER_CLKOUT2_MASK BITFIELD(9, 9) |
1440 | 1440 | ||
1441 | /* | 1441 | /* |
1442 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, | 1442 | * Used by CM_DIV_M6_DPLL_PER, CM_DIV_M6_DPLL_CORE_RESTORE, |
1443 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY | 1443 | * CM_DIV_M6_DPLL_CORE, CM_DIV_M6_DPLL_DDRPHY |
1444 | */ | 1444 | */ |
1445 | #define OMAP4430_ST_HSDIVIDER_CLKOUT3_SHIFT (1 << 9) | 1445 | #define OMAP4430_ST_HSDIVIDER_CLKOUT3_SHIFT 9 |
1446 | #define OMAP4430_ST_HSDIVIDER_CLKOUT3_MASK BITFIELD(9, 9) | 1446 | #define OMAP4430_ST_HSDIVIDER_CLKOUT3_MASK BITFIELD(9, 9) |
1447 | 1447 | ||
1448 | /* | 1448 | /* |
1449 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, | 1449 | * Used by CM_DIV_M7_DPLL_PER, CM_DIV_M7_DPLL_CORE_RESTORE, |
1450 | * CM_DIV_M7_DPLL_CORE | 1450 | * CM_DIV_M7_DPLL_CORE |
1451 | */ | 1451 | */ |
1452 | #define OMAP4430_ST_HSDIVIDER_CLKOUT4_SHIFT (1 << 9) | 1452 | #define OMAP4430_ST_HSDIVIDER_CLKOUT4_SHIFT 9 |
1453 | #define OMAP4430_ST_HSDIVIDER_CLKOUT4_MASK BITFIELD(9, 9) | 1453 | #define OMAP4430_ST_HSDIVIDER_CLKOUT4_MASK BITFIELD(9, 9) |
1454 | 1454 | ||
1455 | /* Used by CM_SYS_CLKSEL */ | 1455 | /* Used by CM_SYS_CLKSEL */ |
1456 | #define OMAP4430_SYS_CLKSEL_SHIFT (1 << 0) | 1456 | #define OMAP4430_SYS_CLKSEL_SHIFT 0 |
1457 | #define OMAP4430_SYS_CLKSEL_MASK BITFIELD(0, 2) | 1457 | #define OMAP4430_SYS_CLKSEL_MASK BITFIELD(0, 2) |
1458 | 1458 | ||
1459 | /* Used by CM_L4CFG_DYNAMICDEP */ | 1459 | /* Used by CM_L4CFG_DYNAMICDEP */ |
1460 | #define OMAP4430_TESLA_DYNDEP_SHIFT (1 << 1) | 1460 | #define OMAP4430_TESLA_DYNDEP_SHIFT 1 |
1461 | #define OMAP4430_TESLA_DYNDEP_MASK BITFIELD(1, 1) | 1461 | #define OMAP4430_TESLA_DYNDEP_MASK BITFIELD(1, 1) |
1462 | 1462 | ||
1463 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ | 1463 | /* Used by CM_DUCATI_STATICDEP, CM_MPU_STATICDEP */ |
1464 | #define OMAP4430_TESLA_STATDEP_SHIFT (1 << 1) | 1464 | #define OMAP4430_TESLA_STATDEP_SHIFT 1 |
1465 | #define OMAP4430_TESLA_STATDEP_MASK BITFIELD(1, 1) | 1465 | #define OMAP4430_TESLA_STATDEP_MASK BITFIELD(1, 1) |
1466 | 1466 | ||
1467 | /* | 1467 | /* |
@@ -1469,6 +1469,6 @@ | |||
1469 | * CM_L3_1_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, | 1469 | * CM_L3_1_DYNAMICDEP, CM_L3_2_DYNAMICDEP, CM_L4CFG_DYNAMICDEP, |
1470 | * CM_L4PER_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP | 1470 | * CM_L4PER_DYNAMICDEP, CM_MPU_DYNAMICDEP, CM_TESLA_DYNAMICDEP |
1471 | */ | 1471 | */ |
1472 | #define OMAP4430_WINDOWSIZE_SHIFT (1 << 24) | 1472 | #define OMAP4430_WINDOWSIZE_SHIFT 24 |
1473 | #define OMAP4430_WINDOWSIZE_MASK BITFIELD(24, 27) | 1473 | #define OMAP4430_WINDOWSIZE_MASK BITFIELD(24, 27) |
1474 | #endif | 1474 | #endif |
diff --git a/arch/arm/mach-omap2/cm.h b/arch/arm/mach-omap2/cm.h index 90a4086fbdf4..94728b1ee3c4 100644 --- a/arch/arm/mach-omap2/cm.h +++ b/arch/arm/mach-omap2/cm.h | |||
@@ -67,7 +67,8 @@ | |||
67 | #define CM_CLKSEL 0x0040 | 67 | #define CM_CLKSEL 0x0040 |
68 | #define CM_CLKSEL1 CM_CLKSEL | 68 | #define CM_CLKSEL1 CM_CLKSEL |
69 | #define CM_CLKSEL2 0x0044 | 69 | #define CM_CLKSEL2 0x0044 |
70 | #define CM_CLKSTCTRL 0x0048 | 70 | #define OMAP2_CM_CLKSTCTRL 0x0048 |
71 | #define OMAP4_CM_CLKSTCTRL 0x0000 | ||
71 | 72 | ||
72 | 73 | ||
73 | /* Architecture-specific registers */ | 74 | /* Architecture-specific registers */ |
@@ -88,7 +89,7 @@ | |||
88 | #define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL | 89 | #define OMAP3430_CM_CLKSEL1_PLL CM_CLKSEL |
89 | #define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2 | 90 | #define OMAP3430_CM_CLKSEL2_PLL CM_CLKSEL2 |
90 | #define OMAP3430_CM_SLEEPDEP CM_CLKSEL2 | 91 | #define OMAP3430_CM_SLEEPDEP CM_CLKSEL2 |
91 | #define OMAP3430_CM_CLKSEL3 CM_CLKSTCTRL | 92 | #define OMAP3430_CM_CLKSEL3 OMAP2_CM_CLKSTCTRL |
92 | #define OMAP3430_CM_CLKSTST 0x004c | 93 | #define OMAP3430_CM_CLKSTST 0x004c |
93 | #define OMAP3430ES2_CM_CLKSEL4 0x004c | 94 | #define OMAP3430ES2_CM_CLKSEL4 0x004c |
94 | #define OMAP3430ES2_CM_CLKSEL5 0x0050 | 95 | #define OMAP3430ES2_CM_CLKSEL5 0x0050 |
@@ -138,5 +139,8 @@ static inline u32 cm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | |||
138 | /* CM_IDLEST_GFX */ | 139 | /* CM_IDLEST_GFX */ |
139 | #define OMAP_ST_GFX (1 << 0) | 140 | #define OMAP_ST_GFX (1 << 0) |
140 | 141 | ||
142 | /* CM_IDLEST indicator */ | ||
143 | #define OMAP24XX_CM_IDLEST_VAL 0 | ||
144 | #define OMAP34XX_CM_IDLEST_VAL 1 | ||
141 | 145 | ||
142 | #endif | 146 | #endif |
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c index cdd1f35636dd..43f8a33655d4 100644 --- a/arch/arm/mach-omap2/control.c +++ b/arch/arm/mach-omap2/control.c | |||
@@ -140,7 +140,11 @@ static struct omap3_control_regs control_context; | |||
140 | 140 | ||
141 | void __init omap2_set_globals_control(struct omap_globals *omap2_globals) | 141 | void __init omap2_set_globals_control(struct omap_globals *omap2_globals) |
142 | { | 142 | { |
143 | omap2_ctrl_base = omap2_globals->ctrl; | 143 | /* Static mapping, never released */ |
144 | if (omap2_globals->ctrl) { | ||
145 | omap2_ctrl_base = ioremap(omap2_globals->ctrl, SZ_4K); | ||
146 | WARN_ON(!omap2_ctrl_base); | ||
147 | } | ||
144 | } | 148 | } |
145 | 149 | ||
146 | void __iomem *omap_ctrl_base_get(void) | 150 | void __iomem *omap_ctrl_base_get(void) |
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index a26d6a08ae3f..3d3d035db9af 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -45,6 +45,8 @@ | |||
45 | #define OMAP3_STATE_C6 5 /* C6 - MPU OFF + Core RET */ | 45 | #define OMAP3_STATE_C6 5 /* C6 - MPU OFF + Core RET */ |
46 | #define OMAP3_STATE_C7 6 /* C7 - MPU OFF + Core OFF */ | 46 | #define OMAP3_STATE_C7 6 /* C7 - MPU OFF + Core OFF */ |
47 | 47 | ||
48 | #define OMAP3_STATE_MAX OMAP3_STATE_C7 | ||
49 | |||
48 | struct omap3_processor_cx { | 50 | struct omap3_processor_cx { |
49 | u8 valid; | 51 | u8 valid; |
50 | u8 type; | 52 | u8 type; |
@@ -60,6 +62,30 @@ struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES]; | |||
60 | struct omap3_processor_cx current_cx_state; | 62 | struct omap3_processor_cx current_cx_state; |
61 | struct powerdomain *mpu_pd, *core_pd; | 63 | struct powerdomain *mpu_pd, *core_pd; |
62 | 64 | ||
65 | /* | ||
66 | * The latencies/thresholds for various C states have | ||
67 | * to be configured from the respective board files. | ||
68 | * These are some default values (which might not provide | ||
69 | * the best power savings) used on boards which do not | ||
70 | * pass these details from the board file. | ||
71 | */ | ||
72 | static struct cpuidle_params cpuidle_params_table[] = { | ||
73 | /* C1 */ | ||
74 | {1, 2, 2, 5}, | ||
75 | /* C2 */ | ||
76 | {1, 10, 10, 30}, | ||
77 | /* C3 */ | ||
78 | {1, 50, 50, 300}, | ||
79 | /* C4 */ | ||
80 | {1, 1500, 1800, 4000}, | ||
81 | /* C5 */ | ||
82 | {1, 2500, 7500, 12000}, | ||
83 | /* C6 */ | ||
84 | {1, 3000, 8500, 15000}, | ||
85 | /* C7 */ | ||
86 | {1, 10000, 30000, 300000}, | ||
87 | }; | ||
88 | |||
63 | static int omap3_idle_bm_check(void) | 89 | static int omap3_idle_bm_check(void) |
64 | { | 90 | { |
65 | if (!omap3_can_sleep()) | 91 | if (!omap3_can_sleep()) |
@@ -104,13 +130,6 @@ static int omap3_enter_idle(struct cpuidle_device *dev, | |||
104 | local_irq_disable(); | 130 | local_irq_disable(); |
105 | local_fiq_disable(); | 131 | local_fiq_disable(); |
106 | 132 | ||
107 | if (!enable_off_mode) { | ||
108 | if (mpu_state < PWRDM_POWER_RET) | ||
109 | mpu_state = PWRDM_POWER_RET; | ||
110 | if (core_state < PWRDM_POWER_RET) | ||
111 | core_state = PWRDM_POWER_RET; | ||
112 | } | ||
113 | |||
114 | pwrdm_set_next_pwrst(mpu_pd, mpu_state); | 133 | pwrdm_set_next_pwrst(mpu_pd, mpu_state); |
115 | pwrdm_set_next_pwrst(core_pd, core_state); | 134 | pwrdm_set_next_pwrst(core_pd, core_state); |
116 | 135 | ||
@@ -137,7 +156,68 @@ return_sleep_time: | |||
137 | local_irq_enable(); | 156 | local_irq_enable(); |
138 | local_fiq_enable(); | 157 | local_fiq_enable(); |
139 | 158 | ||
140 | return (u32)timespec_to_ns(&ts_idle)/1000; | 159 | return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC; |
160 | } | ||
161 | |||
162 | /** | ||
163 | * next_valid_state - Find next valid c-state | ||
164 | * @dev: cpuidle device | ||
165 | * @state: Currently selected c-state | ||
166 | * | ||
167 | * If the current state is valid, it is returned back to the caller. | ||
168 | * Else, this function searches for a lower c-state which is still | ||
169 | * valid (as defined in omap3_power_states[]). | ||
170 | */ | ||
171 | static struct cpuidle_state *next_valid_state(struct cpuidle_device *dev, | ||
172 | struct cpuidle_state *curr) | ||
173 | { | ||
174 | struct cpuidle_state *next = NULL; | ||
175 | struct omap3_processor_cx *cx; | ||
176 | |||
177 | cx = (struct omap3_processor_cx *)cpuidle_get_statedata(curr); | ||
178 | |||
179 | /* Check if current state is valid */ | ||
180 | if (cx->valid) { | ||
181 | return curr; | ||
182 | } else { | ||
183 | u8 idx = OMAP3_STATE_MAX; | ||
184 | |||
185 | /* | ||
186 | * Reach the current state starting at highest C-state | ||
187 | */ | ||
188 | for (; idx >= OMAP3_STATE_C1; idx--) { | ||
189 | if (&dev->states[idx] == curr) { | ||
190 | next = &dev->states[idx]; | ||
191 | break; | ||
192 | } | ||
193 | } | ||
194 | |||
195 | /* | ||
196 | * Should never hit this condition. | ||
197 | */ | ||
198 | WARN_ON(next == NULL); | ||
199 | |||
200 | /* | ||
201 | * Drop to next valid state. | ||
202 | * Start search from the next (lower) state. | ||
203 | */ | ||
204 | idx--; | ||
205 | for (; idx >= OMAP3_STATE_C1; idx--) { | ||
206 | struct omap3_processor_cx *cx; | ||
207 | |||
208 | cx = cpuidle_get_statedata(&dev->states[idx]); | ||
209 | if (cx->valid) { | ||
210 | next = &dev->states[idx]; | ||
211 | break; | ||
212 | } | ||
213 | } | ||
214 | /* | ||
215 | * C1 and C2 are always valid. | ||
216 | * So, no need to check for 'next==NULL' outside this loop. | ||
217 | */ | ||
218 | } | ||
219 | |||
220 | return next; | ||
141 | } | 221 | } |
142 | 222 | ||
143 | /** | 223 | /** |
@@ -152,7 +232,7 @@ return_sleep_time: | |||
152 | static int omap3_enter_idle_bm(struct cpuidle_device *dev, | 232 | static int omap3_enter_idle_bm(struct cpuidle_device *dev, |
153 | struct cpuidle_state *state) | 233 | struct cpuidle_state *state) |
154 | { | 234 | { |
155 | struct cpuidle_state *new_state = state; | 235 | struct cpuidle_state *new_state = next_valid_state(dev, state); |
156 | 236 | ||
157 | if ((state->flags & CPUIDLE_FLAG_CHECK_BM) && omap3_idle_bm_check()) { | 237 | if ((state->flags & CPUIDLE_FLAG_CHECK_BM) && omap3_idle_bm_check()) { |
158 | BUG_ON(!dev->safe_state); | 238 | BUG_ON(!dev->safe_state); |
@@ -165,6 +245,50 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, | |||
165 | 245 | ||
166 | DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); | 246 | DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); |
167 | 247 | ||
248 | /** | ||
249 | * omap3_cpuidle_update_states - Update the cpuidle states. | ||
250 | * | ||
251 | * Currently, this function toggles the validity of idle states based upon | ||
252 | * the flag 'enable_off_mode'. When the flag is set all states are valid. | ||
253 | * Else, states leading to OFF state set to be invalid. | ||
254 | */ | ||
255 | void omap3_cpuidle_update_states(void) | ||
256 | { | ||
257 | int i; | ||
258 | |||
259 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { | ||
260 | struct omap3_processor_cx *cx = &omap3_power_states[i]; | ||
261 | |||
262 | if (enable_off_mode) { | ||
263 | cx->valid = 1; | ||
264 | } else { | ||
265 | if ((cx->mpu_state == PWRDM_POWER_OFF) || | ||
266 | (cx->core_state == PWRDM_POWER_OFF)) | ||
267 | cx->valid = 0; | ||
268 | } | ||
269 | } | ||
270 | } | ||
271 | |||
272 | void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) | ||
273 | { | ||
274 | int i; | ||
275 | |||
276 | if (!cpuidle_board_params) | ||
277 | return; | ||
278 | |||
279 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { | ||
280 | cpuidle_params_table[i].valid = | ||
281 | cpuidle_board_params[i].valid; | ||
282 | cpuidle_params_table[i].sleep_latency = | ||
283 | cpuidle_board_params[i].sleep_latency; | ||
284 | cpuidle_params_table[i].wake_latency = | ||
285 | cpuidle_board_params[i].wake_latency; | ||
286 | cpuidle_params_table[i].threshold = | ||
287 | cpuidle_board_params[i].threshold; | ||
288 | } | ||
289 | return; | ||
290 | } | ||
291 | |||
168 | /* omap3_init_power_states - Initialises the OMAP3 specific C states. | 292 | /* omap3_init_power_states - Initialises the OMAP3 specific C states. |
169 | * | 293 | * |
170 | * Below is the desciption of each C state. | 294 | * Below is the desciption of each C state. |
@@ -179,75 +303,103 @@ DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); | |||
179 | void omap_init_power_states(void) | 303 | void omap_init_power_states(void) |
180 | { | 304 | { |
181 | /* C1 . MPU WFI + Core active */ | 305 | /* C1 . MPU WFI + Core active */ |
182 | omap3_power_states[OMAP3_STATE_C1].valid = 1; | 306 | omap3_power_states[OMAP3_STATE_C1].valid = |
307 | cpuidle_params_table[OMAP3_STATE_C1].valid; | ||
183 | omap3_power_states[OMAP3_STATE_C1].type = OMAP3_STATE_C1; | 308 | omap3_power_states[OMAP3_STATE_C1].type = OMAP3_STATE_C1; |
184 | omap3_power_states[OMAP3_STATE_C1].sleep_latency = 2; | 309 | omap3_power_states[OMAP3_STATE_C1].sleep_latency = |
185 | omap3_power_states[OMAP3_STATE_C1].wakeup_latency = 2; | 310 | cpuidle_params_table[OMAP3_STATE_C1].sleep_latency; |
186 | omap3_power_states[OMAP3_STATE_C1].threshold = 5; | 311 | omap3_power_states[OMAP3_STATE_C1].wakeup_latency = |
312 | cpuidle_params_table[OMAP3_STATE_C1].wake_latency; | ||
313 | omap3_power_states[OMAP3_STATE_C1].threshold = | ||
314 | cpuidle_params_table[OMAP3_STATE_C1].threshold; | ||
187 | omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON; | 315 | omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON; |
188 | omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON; | 316 | omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON; |
189 | omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; | 317 | omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; |
190 | 318 | ||
191 | /* C2 . MPU WFI + Core inactive */ | 319 | /* C2 . MPU WFI + Core inactive */ |
192 | omap3_power_states[OMAP3_STATE_C2].valid = 1; | 320 | omap3_power_states[OMAP3_STATE_C2].valid = |
321 | cpuidle_params_table[OMAP3_STATE_C2].valid; | ||
193 | omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2; | 322 | omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2; |
194 | omap3_power_states[OMAP3_STATE_C2].sleep_latency = 10; | 323 | omap3_power_states[OMAP3_STATE_C2].sleep_latency = |
195 | omap3_power_states[OMAP3_STATE_C2].wakeup_latency = 10; | 324 | cpuidle_params_table[OMAP3_STATE_C2].sleep_latency; |
196 | omap3_power_states[OMAP3_STATE_C2].threshold = 30; | 325 | omap3_power_states[OMAP3_STATE_C2].wakeup_latency = |
326 | cpuidle_params_table[OMAP3_STATE_C2].wake_latency; | ||
327 | omap3_power_states[OMAP3_STATE_C2].threshold = | ||
328 | cpuidle_params_table[OMAP3_STATE_C2].threshold; | ||
197 | omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON; | 329 | omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON; |
198 | omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON; | 330 | omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON; |
199 | omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID; | 331 | omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID; |
200 | 332 | ||
201 | /* C3 . MPU CSWR + Core inactive */ | 333 | /* C3 . MPU CSWR + Core inactive */ |
202 | omap3_power_states[OMAP3_STATE_C3].valid = 1; | 334 | omap3_power_states[OMAP3_STATE_C3].valid = |
335 | cpuidle_params_table[OMAP3_STATE_C3].valid; | ||
203 | omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3; | 336 | omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3; |
204 | omap3_power_states[OMAP3_STATE_C3].sleep_latency = 50; | 337 | omap3_power_states[OMAP3_STATE_C3].sleep_latency = |
205 | omap3_power_states[OMAP3_STATE_C3].wakeup_latency = 50; | 338 | cpuidle_params_table[OMAP3_STATE_C3].sleep_latency; |
206 | omap3_power_states[OMAP3_STATE_C3].threshold = 300; | 339 | omap3_power_states[OMAP3_STATE_C3].wakeup_latency = |
340 | cpuidle_params_table[OMAP3_STATE_C3].wake_latency; | ||
341 | omap3_power_states[OMAP3_STATE_C3].threshold = | ||
342 | cpuidle_params_table[OMAP3_STATE_C3].threshold; | ||
207 | omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET; | 343 | omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET; |
208 | omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON; | 344 | omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON; |
209 | omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID | | 345 | omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID | |
210 | CPUIDLE_FLAG_CHECK_BM; | 346 | CPUIDLE_FLAG_CHECK_BM; |
211 | 347 | ||
212 | /* C4 . MPU OFF + Core inactive */ | 348 | /* C4 . MPU OFF + Core inactive */ |
213 | omap3_power_states[OMAP3_STATE_C4].valid = 1; | 349 | omap3_power_states[OMAP3_STATE_C4].valid = |
350 | cpuidle_params_table[OMAP3_STATE_C4].valid; | ||
214 | omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4; | 351 | omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4; |
215 | omap3_power_states[OMAP3_STATE_C4].sleep_latency = 1500; | 352 | omap3_power_states[OMAP3_STATE_C4].sleep_latency = |
216 | omap3_power_states[OMAP3_STATE_C4].wakeup_latency = 1800; | 353 | cpuidle_params_table[OMAP3_STATE_C4].sleep_latency; |
217 | omap3_power_states[OMAP3_STATE_C4].threshold = 4000; | 354 | omap3_power_states[OMAP3_STATE_C4].wakeup_latency = |
355 | cpuidle_params_table[OMAP3_STATE_C4].wake_latency; | ||
356 | omap3_power_states[OMAP3_STATE_C4].threshold = | ||
357 | cpuidle_params_table[OMAP3_STATE_C4].threshold; | ||
218 | omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF; | 358 | omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF; |
219 | omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON; | 359 | omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON; |
220 | omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID | | 360 | omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID | |
221 | CPUIDLE_FLAG_CHECK_BM; | 361 | CPUIDLE_FLAG_CHECK_BM; |
222 | 362 | ||
223 | /* C5 . MPU CSWR + Core CSWR*/ | 363 | /* C5 . MPU CSWR + Core CSWR*/ |
224 | omap3_power_states[OMAP3_STATE_C5].valid = 1; | 364 | omap3_power_states[OMAP3_STATE_C5].valid = |
365 | cpuidle_params_table[OMAP3_STATE_C5].valid; | ||
225 | omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5; | 366 | omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5; |
226 | omap3_power_states[OMAP3_STATE_C5].sleep_latency = 2500; | 367 | omap3_power_states[OMAP3_STATE_C5].sleep_latency = |
227 | omap3_power_states[OMAP3_STATE_C5].wakeup_latency = 7500; | 368 | cpuidle_params_table[OMAP3_STATE_C5].sleep_latency; |
228 | omap3_power_states[OMAP3_STATE_C5].threshold = 12000; | 369 | omap3_power_states[OMAP3_STATE_C5].wakeup_latency = |
370 | cpuidle_params_table[OMAP3_STATE_C5].wake_latency; | ||
371 | omap3_power_states[OMAP3_STATE_C5].threshold = | ||
372 | cpuidle_params_table[OMAP3_STATE_C5].threshold; | ||
229 | omap3_power_states[OMAP3_STATE_C5].mpu_state = PWRDM_POWER_RET; | 373 | omap3_power_states[OMAP3_STATE_C5].mpu_state = PWRDM_POWER_RET; |
230 | omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET; | 374 | omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET; |
231 | omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID | | 375 | omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID | |
232 | CPUIDLE_FLAG_CHECK_BM; | 376 | CPUIDLE_FLAG_CHECK_BM; |
233 | 377 | ||
234 | /* C6 . MPU OFF + Core CSWR */ | 378 | /* C6 . MPU OFF + Core CSWR */ |
235 | omap3_power_states[OMAP3_STATE_C6].valid = 1; | 379 | omap3_power_states[OMAP3_STATE_C6].valid = |
380 | cpuidle_params_table[OMAP3_STATE_C6].valid; | ||
236 | omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6; | 381 | omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6; |
237 | omap3_power_states[OMAP3_STATE_C6].sleep_latency = 3000; | 382 | omap3_power_states[OMAP3_STATE_C6].sleep_latency = |
238 | omap3_power_states[OMAP3_STATE_C6].wakeup_latency = 8500; | 383 | cpuidle_params_table[OMAP3_STATE_C6].sleep_latency; |
239 | omap3_power_states[OMAP3_STATE_C6].threshold = 15000; | 384 | omap3_power_states[OMAP3_STATE_C6].wakeup_latency = |
385 | cpuidle_params_table[OMAP3_STATE_C6].wake_latency; | ||
386 | omap3_power_states[OMAP3_STATE_C6].threshold = | ||
387 | cpuidle_params_table[OMAP3_STATE_C6].threshold; | ||
240 | omap3_power_states[OMAP3_STATE_C6].mpu_state = PWRDM_POWER_OFF; | 388 | omap3_power_states[OMAP3_STATE_C6].mpu_state = PWRDM_POWER_OFF; |
241 | omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET; | 389 | omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET; |
242 | omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID | | 390 | omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID | |
243 | CPUIDLE_FLAG_CHECK_BM; | 391 | CPUIDLE_FLAG_CHECK_BM; |
244 | 392 | ||
245 | /* C7 . MPU OFF + Core OFF */ | 393 | /* C7 . MPU OFF + Core OFF */ |
246 | omap3_power_states[OMAP3_STATE_C7].valid = 1; | 394 | omap3_power_states[OMAP3_STATE_C7].valid = |
395 | cpuidle_params_table[OMAP3_STATE_C7].valid; | ||
247 | omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7; | 396 | omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7; |
248 | omap3_power_states[OMAP3_STATE_C7].sleep_latency = 10000; | 397 | omap3_power_states[OMAP3_STATE_C7].sleep_latency = |
249 | omap3_power_states[OMAP3_STATE_C7].wakeup_latency = 30000; | 398 | cpuidle_params_table[OMAP3_STATE_C7].sleep_latency; |
250 | omap3_power_states[OMAP3_STATE_C7].threshold = 300000; | 399 | omap3_power_states[OMAP3_STATE_C7].wakeup_latency = |
400 | cpuidle_params_table[OMAP3_STATE_C7].wake_latency; | ||
401 | omap3_power_states[OMAP3_STATE_C7].threshold = | ||
402 | cpuidle_params_table[OMAP3_STATE_C7].threshold; | ||
251 | omap3_power_states[OMAP3_STATE_C7].mpu_state = PWRDM_POWER_OFF; | 403 | omap3_power_states[OMAP3_STATE_C7].mpu_state = PWRDM_POWER_OFF; |
252 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; | 404 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; |
253 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | | 405 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | |
@@ -302,6 +454,8 @@ int __init omap3_idle_init(void) | |||
302 | return -EINVAL; | 454 | return -EINVAL; |
303 | dev->state_count = count; | 455 | dev->state_count = count; |
304 | 456 | ||
457 | omap3_cpuidle_update_states(); | ||
458 | |||
305 | if (cpuidle_register_device(dev)) { | 459 | if (cpuidle_register_device(dev)) { |
306 | printk(KERN_ERR "%s: CPUidle register device failed\n", | 460 | printk(KERN_ERR "%s: CPUidle register device failed\n", |
307 | __func__); | 461 | __func__); |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 18ad93160abb..23e4d7733610 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -141,7 +141,7 @@ static inline void omap_init_camera(void) | |||
141 | #define MBOX_REG_SIZE 0x120 | 141 | #define MBOX_REG_SIZE 0x120 |
142 | 142 | ||
143 | #ifdef CONFIG_ARCH_OMAP2 | 143 | #ifdef CONFIG_ARCH_OMAP2 |
144 | static struct resource omap_mbox_resources[] = { | 144 | static struct resource omap2_mbox_resources[] = { |
145 | { | 145 | { |
146 | .start = OMAP24XX_MAILBOX_BASE, | 146 | .start = OMAP24XX_MAILBOX_BASE, |
147 | .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, | 147 | .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, |
@@ -156,10 +156,14 @@ static struct resource omap_mbox_resources[] = { | |||
156 | .flags = IORESOURCE_IRQ, | 156 | .flags = IORESOURCE_IRQ, |
157 | }, | 157 | }, |
158 | }; | 158 | }; |
159 | static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources); | ||
160 | #else | ||
161 | #define omap2_mbox_resources NULL | ||
162 | #define omap2_mbox_resources_sz 0 | ||
159 | #endif | 163 | #endif |
160 | 164 | ||
161 | #ifdef CONFIG_ARCH_OMAP3 | 165 | #ifdef CONFIG_ARCH_OMAP3 |
162 | static struct resource omap_mbox_resources[] = { | 166 | static struct resource omap3_mbox_resources[] = { |
163 | { | 167 | { |
164 | .start = OMAP34XX_MAILBOX_BASE, | 168 | .start = OMAP34XX_MAILBOX_BASE, |
165 | .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, | 169 | .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, |
@@ -170,12 +174,16 @@ static struct resource omap_mbox_resources[] = { | |||
170 | .flags = IORESOURCE_IRQ, | 174 | .flags = IORESOURCE_IRQ, |
171 | }, | 175 | }, |
172 | }; | 176 | }; |
177 | static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources); | ||
178 | #else | ||
179 | #define omap3_mbox_resources NULL | ||
180 | #define omap3_mbox_resources_sz 0 | ||
173 | #endif | 181 | #endif |
174 | 182 | ||
175 | #ifdef CONFIG_ARCH_OMAP4 | 183 | #ifdef CONFIG_ARCH_OMAP4 |
176 | 184 | ||
177 | #define OMAP4_MBOX_REG_SIZE 0x130 | 185 | #define OMAP4_MBOX_REG_SIZE 0x130 |
178 | static struct resource omap_mbox_resources[] = { | 186 | static struct resource omap4_mbox_resources[] = { |
179 | { | 187 | { |
180 | .start = OMAP44XX_MAILBOX_BASE, | 188 | .start = OMAP44XX_MAILBOX_BASE, |
181 | .end = OMAP44XX_MAILBOX_BASE + | 189 | .end = OMAP44XX_MAILBOX_BASE + |
@@ -183,10 +191,14 @@ static struct resource omap_mbox_resources[] = { | |||
183 | .flags = IORESOURCE_MEM, | 191 | .flags = IORESOURCE_MEM, |
184 | }, | 192 | }, |
185 | { | 193 | { |
186 | .start = INT_44XX_MAIL_U0_MPU, | 194 | .start = OMAP44XX_IRQ_MAIL_U0, |
187 | .flags = IORESOURCE_IRQ, | 195 | .flags = IORESOURCE_IRQ, |
188 | }, | 196 | }, |
189 | }; | 197 | }; |
198 | static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources); | ||
199 | #else | ||
200 | #define omap4_mbox_resources NULL | ||
201 | #define omap4_mbox_resources_sz 0 | ||
190 | #endif | 202 | #endif |
191 | 203 | ||
192 | static struct platform_device mbox_device = { | 204 | static struct platform_device mbox_device = { |
@@ -196,9 +208,15 @@ static struct platform_device mbox_device = { | |||
196 | 208 | ||
197 | static inline void omap_init_mbox(void) | 209 | static inline void omap_init_mbox(void) |
198 | { | 210 | { |
199 | if (cpu_is_omap2420() || cpu_is_omap3430() || cpu_is_omap44xx()) { | 211 | if (cpu_is_omap24xx()) { |
200 | mbox_device.num_resources = ARRAY_SIZE(omap_mbox_resources); | 212 | mbox_device.resource = omap2_mbox_resources; |
201 | mbox_device.resource = omap_mbox_resources; | 213 | mbox_device.num_resources = omap2_mbox_resources_sz; |
214 | } else if (cpu_is_omap34xx()) { | ||
215 | mbox_device.resource = omap3_mbox_resources; | ||
216 | mbox_device.num_resources = omap3_mbox_resources_sz; | ||
217 | } else if (cpu_is_omap44xx()) { | ||
218 | mbox_device.resource = omap4_mbox_resources; | ||
219 | mbox_device.num_resources = omap4_mbox_resources_sz; | ||
202 | } else { | 220 | } else { |
203 | pr_err("%s: platform not supported\n", __func__); | 221 | pr_err("%s: platform not supported\n", __func__); |
204 | return; | 222 | return; |
@@ -492,7 +510,12 @@ static struct platform_device dummy_pdev = { | |||
492 | **/ | 510 | **/ |
493 | static void __init omap_hsmmc_reset(void) | 511 | static void __init omap_hsmmc_reset(void) |
494 | { | 512 | { |
495 | u32 i, nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC : | 513 | u32 i, nr_controllers; |
514 | |||
515 | if (cpu_is_omap242x()) | ||
516 | return; | ||
517 | |||
518 | nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC : | ||
496 | (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC); | 519 | (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC); |
497 | 520 | ||
498 | for (i = 0; i < nr_controllers; i++) { | 521 | for (i = 0; i < nr_controllers; i++) { |
@@ -697,13 +720,13 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
697 | if (!cpu_is_omap44xx()) | 720 | if (!cpu_is_omap44xx()) |
698 | return; | 721 | return; |
699 | base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET; | 722 | base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET; |
700 | irq = INT_44XX_MMC4_IRQ; | 723 | irq = OMAP44XX_IRQ_MMC4; |
701 | break; | 724 | break; |
702 | case 4: | 725 | case 4: |
703 | if (!cpu_is_omap44xx()) | 726 | if (!cpu_is_omap44xx()) |
704 | return; | 727 | return; |
705 | base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; | 728 | base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; |
706 | irq = INT_44XX_MMC5_IRQ; | 729 | irq = OMAP44XX_IRQ_MMC4; |
707 | break; | 730 | break; |
708 | default: | 731 | default: |
709 | continue; | 732 | continue; |
@@ -715,7 +738,7 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, | |||
715 | } else if (cpu_is_omap44xx()) { | 738 | } else if (cpu_is_omap44xx()) { |
716 | if (i < 3) { | 739 | if (i < 3) { |
717 | base += OMAP4_MMC_REG_OFFSET; | 740 | base += OMAP4_MMC_REG_OFFSET; |
718 | irq += IRQ_GIC_START; | 741 | irq += OMAP44XX_IRQ_GIC_START; |
719 | } | 742 | } |
720 | size = OMAP4_HSMMC_SIZE; | 743 | size = OMAP4_HSMMC_SIZE; |
721 | name = "mmci-omap-hs"; | 744 | name = "mmci-omap-hs"; |
diff --git a/arch/arm/mach-omap2/dpll.c b/arch/arm/mach-omap2/dpll3xxx.c index f6055b493294..b32ccd954a1b 100644 --- a/arch/arm/mach-omap2/dpll.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -1,11 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP3/4 - specific DPLL control functions | 2 | * OMAP3/4 - specific DPLL control functions |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. |
5 | * Copyright (C) 2009 Nokia Corporation | 5 | * Copyright (C) 2009-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
8 | * Testing and integration fixes by Jouni Högander | 8 | * Testing and integration fixes by Jouni Högander |
9 | * | ||
10 | * 36xx support added by Vishwanath BS, Richard Woodruff, and Nishanth | ||
11 | * Menon | ||
9 | * | 12 | * |
10 | * Parts of this code are based on code written by | 13 | * Parts of this code are based on code written by |
11 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu | 14 | * Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu |
@@ -15,7 +18,6 @@ | |||
15 | * published by the Free Software Foundation. | 18 | * published by the Free Software Foundation. |
16 | */ | 19 | */ |
17 | 20 | ||
18 | #include <linux/module.h> | ||
19 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
20 | #include <linux/device.h> | 22 | #include <linux/device.h> |
21 | #include <linux/list.h> | 23 | #include <linux/list.h> |
@@ -23,13 +25,10 @@ | |||
23 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
24 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
25 | #include <linux/io.h> | 27 | #include <linux/io.h> |
26 | #include <linux/limits.h> | ||
27 | #include <linux/bitops.h> | 28 | #include <linux/bitops.h> |
28 | 29 | ||
29 | #include <plat/cpu.h> | 30 | #include <plat/cpu.h> |
30 | #include <plat/clock.h> | 31 | #include <plat/clock.h> |
31 | #include <plat/sram.h> | ||
32 | #include <asm/div64.h> | ||
33 | #include <asm/clkdev.h> | 32 | #include <asm/clkdev.h> |
34 | 33 | ||
35 | #include "clock.h" | 34 | #include "clock.h" |
@@ -44,17 +43,7 @@ | |||
44 | 43 | ||
45 | #define MAX_DPLL_WAIT_TRIES 1000000 | 44 | #define MAX_DPLL_WAIT_TRIES 1000000 |
46 | 45 | ||
47 | 46 | /* Private functions */ | |
48 | /** | ||
49 | * omap3_dpll_recalc - recalculate DPLL rate | ||
50 | * @clk: DPLL struct clk | ||
51 | * | ||
52 | * Recalculate and propagate the DPLL rate. | ||
53 | */ | ||
54 | unsigned long omap3_dpll_recalc(struct clk *clk) | ||
55 | { | ||
56 | return omap2_get_dpll_rate(clk); | ||
57 | } | ||
58 | 47 | ||
59 | /* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ | 48 | /* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ |
60 | static void _omap3_dpll_write_clken(struct clk *clk, u8 clken_bits) | 49 | static void _omap3_dpll_write_clken(struct clk *clk, u8 clken_bits) |
@@ -136,8 +125,6 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n) | |||
136 | return f; | 125 | return f; |
137 | } | 126 | } |
138 | 127 | ||
139 | /* Non-CORE DPLL (e.g., DPLLs that do not control SDRC) clock functions */ | ||
140 | |||
141 | /* | 128 | /* |
142 | * _omap3_noncore_dpll_lock - instruct a DPLL to lock and wait for readiness | 129 | * _omap3_noncore_dpll_lock - instruct a DPLL to lock and wait for readiness |
143 | * @clk: pointer to a DPLL struct clk | 130 | * @clk: pointer to a DPLL struct clk |
@@ -238,6 +225,122 @@ static int _omap3_noncore_dpll_stop(struct clk *clk) | |||
238 | } | 225 | } |
239 | 226 | ||
240 | /** | 227 | /** |
228 | * lookup_dco_sddiv - Set j-type DPLL4 compensation variables | ||
229 | * @clk: pointer to a DPLL struct clk | ||
230 | * @dco: digital control oscillator selector | ||
231 | * @sd_div: target sigma-delta divider | ||
232 | * @m: DPLL multiplier to set | ||
233 | * @n: DPLL divider to set | ||
234 | * | ||
235 | * See 36xx TRM section 3.5.3.3.3.2 "Type B DPLL (Low-Jitter)" | ||
236 | * | ||
237 | * XXX This code is not needed for 3430/AM35xx; can it be optimized | ||
238 | * out in non-multi-OMAP builds for those chips? | ||
239 | */ | ||
240 | static void lookup_dco_sddiv(struct clk *clk, u8 *dco, u8 *sd_div, u16 m, | ||
241 | u8 n) | ||
242 | { | ||
243 | unsigned long fint, clkinp, sd; /* watch out for overflow */ | ||
244 | int mod1, mod2; | ||
245 | |||
246 | clkinp = clk->parent->rate; | ||
247 | fint = (clkinp / n) * m; | ||
248 | |||
249 | if (fint < 1000000000) | ||
250 | *dco = 2; | ||
251 | else | ||
252 | *dco = 4; | ||
253 | /* | ||
254 | * target sigma-delta to near 250MHz | ||
255 | * sd = ceil[(m/(n+1)) * (clkinp_MHz / 250)] | ||
256 | */ | ||
257 | clkinp /= 100000; /* shift from MHz to 10*Hz for 38.4 and 19.2 */ | ||
258 | mod1 = (clkinp * m) % (250 * n); | ||
259 | sd = (clkinp * m) / (250 * n); | ||
260 | mod2 = sd % 10; | ||
261 | sd /= 10; | ||
262 | |||
263 | if (mod1 || mod2) | ||
264 | sd++; | ||
265 | *sd_div = sd; | ||
266 | } | ||
267 | |||
268 | /* | ||
269 | * _omap3_noncore_dpll_program - set non-core DPLL M,N values directly | ||
270 | * @clk: struct clk * of DPLL to set | ||
271 | * @m: DPLL multiplier to set | ||
272 | * @n: DPLL divider to set | ||
273 | * @freqsel: FREQSEL value to set | ||
274 | * | ||
275 | * Program the DPLL with the supplied M, N values, and wait for the DPLL to | ||
276 | * lock.. Returns -EINVAL upon error, or 0 upon success. | ||
277 | */ | ||
278 | static int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel) | ||
279 | { | ||
280 | struct dpll_data *dd = clk->dpll_data; | ||
281 | u32 v; | ||
282 | |||
283 | /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */ | ||
284 | _omap3_noncore_dpll_bypass(clk); | ||
285 | |||
286 | /* | ||
287 | * Set jitter correction. No jitter correction for OMAP4 and 3630 | ||
288 | * since freqsel field is no longer present | ||
289 | */ | ||
290 | if (!cpu_is_omap44xx() && !cpu_is_omap3630()) { | ||
291 | v = __raw_readl(dd->control_reg); | ||
292 | v &= ~dd->freqsel_mask; | ||
293 | v |= freqsel << __ffs(dd->freqsel_mask); | ||
294 | __raw_writel(v, dd->control_reg); | ||
295 | } | ||
296 | |||
297 | /* Set DPLL multiplier, divider */ | ||
298 | v = __raw_readl(dd->mult_div1_reg); | ||
299 | v &= ~(dd->mult_mask | dd->div1_mask); | ||
300 | v |= m << __ffs(dd->mult_mask); | ||
301 | v |= (n - 1) << __ffs(dd->div1_mask); | ||
302 | |||
303 | /* | ||
304 | * XXX This code is not needed for 3430/AM35XX; can it be optimized | ||
305 | * out in non-multi-OMAP builds for those chips? | ||
306 | */ | ||
307 | if ((dd->flags & DPLL_J_TYPE) && !(dd->flags & DPLL_NO_DCO_SEL)) { | ||
308 | u8 dco, sd_div; | ||
309 | lookup_dco_sddiv(clk, &dco, &sd_div, m, n); | ||
310 | /* XXX This probably will need revision for OMAP4 */ | ||
311 | v &= ~(OMAP3630_PERIPH_DPLL_DCO_SEL_MASK | ||
312 | | OMAP3630_PERIPH_DPLL_SD_DIV_MASK); | ||
313 | v |= dco << __ffs(OMAP3630_PERIPH_DPLL_DCO_SEL_MASK); | ||
314 | v |= sd_div << __ffs(OMAP3630_PERIPH_DPLL_SD_DIV_MASK); | ||
315 | } | ||
316 | |||
317 | __raw_writel(v, dd->mult_div1_reg); | ||
318 | |||
319 | /* We let the clock framework set the other output dividers later */ | ||
320 | |||
321 | /* REVISIT: Set ramp-up delay? */ | ||
322 | |||
323 | _omap3_noncore_dpll_lock(clk); | ||
324 | |||
325 | return 0; | ||
326 | } | ||
327 | |||
328 | /* Public functions */ | ||
329 | |||
330 | /** | ||
331 | * omap3_dpll_recalc - recalculate DPLL rate | ||
332 | * @clk: DPLL struct clk | ||
333 | * | ||
334 | * Recalculate and propagate the DPLL rate. | ||
335 | */ | ||
336 | unsigned long omap3_dpll_recalc(struct clk *clk) | ||
337 | { | ||
338 | return omap2_get_dpll_rate(clk); | ||
339 | } | ||
340 | |||
341 | /* Non-CORE DPLL (e.g., DPLLs that do not control SDRC) clock functions */ | ||
342 | |||
343 | /** | ||
241 | * omap3_noncore_dpll_enable - instruct a DPLL to enter bypass or lock mode | 344 | * omap3_noncore_dpll_enable - instruct a DPLL to enter bypass or lock mode |
242 | * @clk: pointer to a DPLL struct clk | 345 | * @clk: pointer to a DPLL struct clk |
243 | * | 346 | * |
@@ -292,48 +395,6 @@ void omap3_noncore_dpll_disable(struct clk *clk) | |||
292 | 395 | ||
293 | /* Non-CORE DPLL rate set code */ | 396 | /* Non-CORE DPLL rate set code */ |
294 | 397 | ||
295 | /* | ||
296 | * omap3_noncore_dpll_program - set non-core DPLL M,N values directly | ||
297 | * @clk: struct clk * of DPLL to set | ||
298 | * @m: DPLL multiplier to set | ||
299 | * @n: DPLL divider to set | ||
300 | * @freqsel: FREQSEL value to set | ||
301 | * | ||
302 | * Program the DPLL with the supplied M, N values, and wait for the DPLL to | ||
303 | * lock.. Returns -EINVAL upon error, or 0 upon success. | ||
304 | */ | ||
305 | int omap3_noncore_dpll_program(struct clk *clk, u16 m, u8 n, u16 freqsel) | ||
306 | { | ||
307 | struct dpll_data *dd = clk->dpll_data; | ||
308 | u32 v; | ||
309 | |||
310 | /* 3430 ES2 TRM: 4.7.6.9 DPLL Programming Sequence */ | ||
311 | _omap3_noncore_dpll_bypass(clk); | ||
312 | |||
313 | /* Set jitter correction */ | ||
314 | if (!cpu_is_omap44xx()) { | ||
315 | v = __raw_readl(dd->control_reg); | ||
316 | v &= ~dd->freqsel_mask; | ||
317 | v |= freqsel << __ffs(dd->freqsel_mask); | ||
318 | __raw_writel(v, dd->control_reg); | ||
319 | } | ||
320 | |||
321 | /* Set DPLL multiplier, divider */ | ||
322 | v = __raw_readl(dd->mult_div1_reg); | ||
323 | v &= ~(dd->mult_mask | dd->div1_mask); | ||
324 | v |= m << __ffs(dd->mult_mask); | ||
325 | v |= (n - 1) << __ffs(dd->div1_mask); | ||
326 | __raw_writel(v, dd->mult_div1_reg); | ||
327 | |||
328 | /* We let the clock framework set the other output dividers later */ | ||
329 | |||
330 | /* REVISIT: Set ramp-up delay? */ | ||
331 | |||
332 | _omap3_noncore_dpll_lock(clk); | ||
333 | |||
334 | return 0; | ||
335 | } | ||
336 | |||
337 | /** | 398 | /** |
338 | * omap3_noncore_dpll_set_rate - set non-core DPLL rate | 399 | * omap3_noncore_dpll_set_rate - set non-core DPLL rate |
339 | * @clk: struct clk * of DPLL to set | 400 | * @clk: struct clk * of DPLL to set |
@@ -384,8 +445,8 @@ int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) | |||
384 | if (dd->last_rounded_rate == 0) | 445 | if (dd->last_rounded_rate == 0) |
385 | return -EINVAL; | 446 | return -EINVAL; |
386 | 447 | ||
387 | /* No freqsel on OMAP4 */ | 448 | /* No freqsel on OMAP4 and OMAP3630 */ |
388 | if (!cpu_is_omap44xx()) { | 449 | if (!cpu_is_omap44xx() && !cpu_is_omap3630()) { |
389 | freqsel = _omap3_dpll_compute_freqsel(clk, | 450 | freqsel = _omap3_dpll_compute_freqsel(clk, |
390 | dd->last_rounded_n); | 451 | dd->last_rounded_n); |
391 | if (!freqsel) | 452 | if (!freqsel) |
@@ -530,7 +591,7 @@ unsigned long omap3_clkoutx2_recalc(struct clk *clk) | |||
530 | 591 | ||
531 | v = __raw_readl(dd->control_reg) & dd->enable_mask; | 592 | v = __raw_readl(dd->control_reg) & dd->enable_mask; |
532 | v >>= __ffs(dd->enable_mask); | 593 | v >>= __ffs(dd->enable_mask); |
533 | if (v != OMAP3XXX_EN_DPLL_LOCKED) | 594 | if ((v != OMAP3XXX_EN_DPLL_LOCKED) || (dd->flags & DPLL_J_TYPE)) |
534 | rate = clk->parent->rate; | 595 | rate = clk->parent->rate; |
535 | else | 596 | else |
536 | rate = clk->parent->rate * 2; | 597 | rate = clk->parent->rate * 2; |
diff --git a/arch/arm/mach-omap2/emu.c b/arch/arm/mach-omap2/emu.c index ec0d984a26fc..9c442e290ccb 100644 --- a/arch/arm/mach-omap2/emu.c +++ b/arch/arm/mach-omap2/emu.c | |||
@@ -56,6 +56,9 @@ static struct amba_device omap3_etm_device = { | |||
56 | 56 | ||
57 | static int __init emu_init(void) | 57 | static int __init emu_init(void) |
58 | { | 58 | { |
59 | if (!cpu_is_omap34xx()) | ||
60 | return -ENODEV; | ||
61 | |||
59 | amba_device_register(&omap3_etb_device, &iomem_resource); | 62 | amba_device_register(&omap3_etb_device, &iomem_resource); |
60 | amba_device_register(&omap3_etm_device, &iomem_resource); | 63 | amba_device_register(&omap3_etm_device, &iomem_resource); |
61 | 64 | ||
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c new file mode 100644 index 000000000000..64d74f05abbe --- /dev/null +++ b/arch/arm/mach-omap2/gpmc-nand.c | |||
@@ -0,0 +1,139 @@ | |||
1 | /* | ||
2 | * gpmc-nand.c | ||
3 | * | ||
4 | * Copyright (C) 2009 Texas Instruments | ||
5 | * Vimal Singh <vimalsingh@ti.com> | ||
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/platform_device.h> | ||
14 | #include <linux/io.h> | ||
15 | |||
16 | #include <asm/mach/flash.h> | ||
17 | |||
18 | #include <plat/nand.h> | ||
19 | #include <plat/board.h> | ||
20 | #include <plat/gpmc.h> | ||
21 | |||
22 | #define WR_RD_PIN_MONITORING 0x00600000 | ||
23 | |||
24 | static struct omap_nand_platform_data *gpmc_nand_data; | ||
25 | |||
26 | static struct resource gpmc_nand_resource = { | ||
27 | .flags = IORESOURCE_MEM, | ||
28 | }; | ||
29 | |||
30 | static struct platform_device gpmc_nand_device = { | ||
31 | .name = "omap2-nand", | ||
32 | .id = 0, | ||
33 | .num_resources = 1, | ||
34 | .resource = &gpmc_nand_resource, | ||
35 | }; | ||
36 | |||
37 | static int omap2_nand_gpmc_retime(void) | ||
38 | { | ||
39 | struct gpmc_timings t; | ||
40 | int err; | ||
41 | |||
42 | memset(&t, 0, sizeof(t)); | ||
43 | t.sync_clk = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->sync_clk); | ||
44 | t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on); | ||
45 | t.adv_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->adv_on); | ||
46 | |||
47 | /* Read */ | ||
48 | t.adv_rd_off = gpmc_round_ns_to_ticks( | ||
49 | gpmc_nand_data->gpmc_t->adv_rd_off); | ||
50 | t.oe_on = t.adv_on; | ||
51 | t.access = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->access); | ||
52 | t.oe_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->oe_off); | ||
53 | t.cs_rd_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_rd_off); | ||
54 | t.rd_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->rd_cycle); | ||
55 | |||
56 | /* Write */ | ||
57 | t.adv_wr_off = gpmc_round_ns_to_ticks( | ||
58 | gpmc_nand_data->gpmc_t->adv_wr_off); | ||
59 | t.we_on = t.oe_on; | ||
60 | if (cpu_is_omap34xx()) { | ||
61 | t.wr_data_mux_bus = gpmc_round_ns_to_ticks( | ||
62 | gpmc_nand_data->gpmc_t->wr_data_mux_bus); | ||
63 | t.wr_access = gpmc_round_ns_to_ticks( | ||
64 | gpmc_nand_data->gpmc_t->wr_access); | ||
65 | } | ||
66 | t.we_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->we_off); | ||
67 | t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off); | ||
68 | t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); | ||
69 | |||
70 | /* Configure GPMC */ | ||
71 | gpmc_cs_write_reg(gpmc_nand_data->cs, GPMC_CS_CONFIG1, | ||
72 | GPMC_CONFIG1_DEVICESIZE(gpmc_nand_data->devsize) | | ||
73 | GPMC_CONFIG1_DEVICETYPE_NAND); | ||
74 | |||
75 | err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); | ||
76 | if (err) | ||
77 | return err; | ||
78 | |||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | static int gpmc_nand_setup(void) | ||
83 | { | ||
84 | struct device *dev = &gpmc_nand_device.dev; | ||
85 | |||
86 | /* Set timings in GPMC */ | ||
87 | if (omap2_nand_gpmc_retime() < 0) { | ||
88 | dev_err(dev, "Unable to set gpmc timings\n"); | ||
89 | return -EINVAL; | ||
90 | } | ||
91 | |||
92 | return 0; | ||
93 | } | ||
94 | |||
95 | int __init gpmc_nand_init(struct omap_nand_platform_data *_nand_data) | ||
96 | { | ||
97 | unsigned int val; | ||
98 | int err = 0; | ||
99 | struct device *dev = &gpmc_nand_device.dev; | ||
100 | |||
101 | gpmc_nand_data = _nand_data; | ||
102 | gpmc_nand_data->nand_setup = gpmc_nand_setup; | ||
103 | gpmc_nand_device.dev.platform_data = gpmc_nand_data; | ||
104 | |||
105 | err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE, | ||
106 | &gpmc_nand_data->phys_base); | ||
107 | if (err < 0) { | ||
108 | dev_err(dev, "Cannot request GPMC CS\n"); | ||
109 | return err; | ||
110 | } | ||
111 | |||
112 | err = gpmc_nand_setup(); | ||
113 | if (err < 0) { | ||
114 | dev_err(dev, "NAND platform setup failed: %d\n", err); | ||
115 | return err; | ||
116 | } | ||
117 | |||
118 | /* Enable RD PIN Monitoring Reg */ | ||
119 | if (gpmc_nand_data->dev_ready) { | ||
120 | val = gpmc_cs_read_reg(gpmc_nand_data->cs, | ||
121 | GPMC_CS_CONFIG1); | ||
122 | val |= WR_RD_PIN_MONITORING; | ||
123 | gpmc_cs_write_reg(gpmc_nand_data->cs, | ||
124 | GPMC_CS_CONFIG1, val); | ||
125 | } | ||
126 | |||
127 | err = platform_device_register(&gpmc_nand_device); | ||
128 | if (err < 0) { | ||
129 | dev_err(dev, "Unable to register NAND device\n"); | ||
130 | goto out_free_cs; | ||
131 | } | ||
132 | |||
133 | return 0; | ||
134 | |||
135 | out_free_cs: | ||
136 | gpmc_cs_free(gpmc_nand_data->cs); | ||
137 | |||
138 | return err; | ||
139 | } | ||
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index bd8cb5974726..5bc3ca03551c 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -505,7 +505,7 @@ static void __init gpmc_mem_init(void) | |||
505 | void __init gpmc_init(void) | 505 | void __init gpmc_init(void) |
506 | { | 506 | { |
507 | u32 l; | 507 | u32 l; |
508 | char *ck; | 508 | char *ck = NULL; |
509 | 509 | ||
510 | if (cpu_is_omap24xx()) { | 510 | if (cpu_is_omap24xx()) { |
511 | ck = "core_l3_ck"; | 511 | ck = "core_l3_ck"; |
@@ -521,6 +521,9 @@ void __init gpmc_init(void) | |||
521 | l = OMAP44XX_GPMC_BASE; | 521 | l = OMAP44XX_GPMC_BASE; |
522 | } | 522 | } |
523 | 523 | ||
524 | if (WARN_ON(!ck)) | ||
525 | return; | ||
526 | |||
524 | gpmc_l3_clk = clk_get(NULL, ck); | 527 | gpmc_l3_clk = clk_get(NULL, ck); |
525 | if (IS_ERR(gpmc_l3_clk)) { | 528 | if (IS_ERR(gpmc_l3_clk)) { |
526 | printk(KERN_ERR "Could not get GPMC clock %s\n", ck); | 529 | printk(KERN_ERR "Could not get GPMC clock %s\n", ck); |
@@ -534,6 +537,8 @@ void __init gpmc_init(void) | |||
534 | BUG(); | 537 | BUG(); |
535 | } | 538 | } |
536 | 539 | ||
540 | clk_enable(gpmc_l3_clk); | ||
541 | |||
537 | l = gpmc_read_reg(GPMC_REVISION); | 542 | l = gpmc_read_reg(GPMC_REVISION); |
538 | printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); | 543 | printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); |
539 | /* Set smart idle mode and automatic L3 clock gating */ | 544 | /* Set smart idle mode and automatic L3 clock gating */ |
@@ -547,9 +552,10 @@ void __init gpmc_init(void) | |||
547 | #ifdef CONFIG_ARCH_OMAP3 | 552 | #ifdef CONFIG_ARCH_OMAP3 |
548 | static struct omap3_gpmc_regs gpmc_context; | 553 | static struct omap3_gpmc_regs gpmc_context; |
549 | 554 | ||
550 | void omap3_gpmc_save_context() | 555 | void omap3_gpmc_save_context(void) |
551 | { | 556 | { |
552 | int i; | 557 | int i; |
558 | |||
553 | gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG); | 559 | gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG); |
554 | gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE); | 560 | gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE); |
555 | gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL); | 561 | gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL); |
@@ -578,9 +584,10 @@ void omap3_gpmc_save_context() | |||
578 | } | 584 | } |
579 | } | 585 | } |
580 | 586 | ||
581 | void omap3_gpmc_restore_context() | 587 | void omap3_gpmc_restore_context(void) |
582 | { | 588 | { |
583 | int i; | 589 | int i; |
590 | |||
584 | gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig); | 591 | gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig); |
585 | gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable); | 592 | gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable); |
586 | gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context.timeout_ctrl); | 593 | gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context.timeout_ctrl); |
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c new file mode 100644 index 000000000000..9ad229594b46 --- /dev/null +++ b/arch/arm/mach-omap2/hsmmc.c | |||
@@ -0,0 +1,266 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap2/hsmmc.c | ||
3 | * | ||
4 | * Copyright (C) 2007-2008 Texas Instruments | ||
5 | * Copyright (C) 2008 Nokia Corporation | ||
6 | * Author: Texas Instruments | ||
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 | #include <linux/kernel.h> | ||
13 | #include <linux/slab.h> | ||
14 | #include <linux/string.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <mach/hardware.h> | ||
17 | #include <plat/control.h> | ||
18 | #include <plat/mmc.h> | ||
19 | #include <plat/omap-pm.h> | ||
20 | |||
21 | #include "hsmmc.h" | ||
22 | |||
23 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | ||
24 | |||
25 | static u16 control_pbias_offset; | ||
26 | static u16 control_devconf1_offset; | ||
27 | |||
28 | #define HSMMC_NAME_LEN 9 | ||
29 | |||
30 | static struct hsmmc_controller { | ||
31 | char name[HSMMC_NAME_LEN + 1]; | ||
32 | } hsmmc[OMAP34XX_NR_MMC]; | ||
33 | |||
34 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | ||
35 | |||
36 | static int hsmmc_get_context_loss(struct device *dev) | ||
37 | { | ||
38 | return omap_pm_get_dev_context_loss_count(dev); | ||
39 | } | ||
40 | |||
41 | #else | ||
42 | #define hsmmc_get_context_loss NULL | ||
43 | #endif | ||
44 | |||
45 | static void hsmmc1_before_set_reg(struct device *dev, int slot, | ||
46 | int power_on, int vdd) | ||
47 | { | ||
48 | u32 reg, prog_io; | ||
49 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
50 | |||
51 | if (mmc->slots[0].remux) | ||
52 | mmc->slots[0].remux(dev, slot, power_on); | ||
53 | |||
54 | /* | ||
55 | * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the | ||
56 | * card with Vcc regulator (from twl4030 or whatever). OMAP has both | ||
57 | * 1.8V and 3.0V modes, controlled by the PBIAS register. | ||
58 | * | ||
59 | * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which | ||
60 | * is most naturally TWL VSIM; those pins also use PBIAS. | ||
61 | * | ||
62 | * FIXME handle VMMC1A as needed ... | ||
63 | */ | ||
64 | if (power_on) { | ||
65 | if (cpu_is_omap2430()) { | ||
66 | reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1); | ||
67 | if ((1 << vdd) >= MMC_VDD_30_31) | ||
68 | reg |= OMAP243X_MMC1_ACTIVE_OVERWRITE; | ||
69 | else | ||
70 | reg &= ~OMAP243X_MMC1_ACTIVE_OVERWRITE; | ||
71 | omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1); | ||
72 | } | ||
73 | |||
74 | if (mmc->slots[0].internal_clock) { | ||
75 | reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
76 | reg |= OMAP2_MMCSDIO1ADPCLKISEL; | ||
77 | omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0); | ||
78 | } | ||
79 | |||
80 | reg = omap_ctrl_readl(control_pbias_offset); | ||
81 | if (cpu_is_omap3630()) { | ||
82 | /* Set MMC I/O to 52Mhz */ | ||
83 | prog_io = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1); | ||
84 | prog_io |= OMAP3630_PRG_SDMMC1_SPEEDCTRL; | ||
85 | omap_ctrl_writel(prog_io, OMAP343X_CONTROL_PROG_IO1); | ||
86 | } else { | ||
87 | reg |= OMAP2_PBIASSPEEDCTRL0; | ||
88 | } | ||
89 | reg &= ~OMAP2_PBIASLITEPWRDNZ0; | ||
90 | omap_ctrl_writel(reg, control_pbias_offset); | ||
91 | } else { | ||
92 | reg = omap_ctrl_readl(control_pbias_offset); | ||
93 | reg &= ~OMAP2_PBIASLITEPWRDNZ0; | ||
94 | omap_ctrl_writel(reg, control_pbias_offset); | ||
95 | } | ||
96 | } | ||
97 | |||
98 | static void hsmmc1_after_set_reg(struct device *dev, int slot, | ||
99 | int power_on, int vdd) | ||
100 | { | ||
101 | u32 reg; | ||
102 | |||
103 | /* 100ms delay required for PBIAS configuration */ | ||
104 | msleep(100); | ||
105 | |||
106 | if (power_on) { | ||
107 | reg = omap_ctrl_readl(control_pbias_offset); | ||
108 | reg |= (OMAP2_PBIASLITEPWRDNZ0 | OMAP2_PBIASSPEEDCTRL0); | ||
109 | if ((1 << vdd) <= MMC_VDD_165_195) | ||
110 | reg &= ~OMAP2_PBIASLITEVMODE0; | ||
111 | else | ||
112 | reg |= OMAP2_PBIASLITEVMODE0; | ||
113 | omap_ctrl_writel(reg, control_pbias_offset); | ||
114 | } else { | ||
115 | reg = omap_ctrl_readl(control_pbias_offset); | ||
116 | reg |= (OMAP2_PBIASSPEEDCTRL0 | OMAP2_PBIASLITEPWRDNZ0 | | ||
117 | OMAP2_PBIASLITEVMODE0); | ||
118 | omap_ctrl_writel(reg, control_pbias_offset); | ||
119 | } | ||
120 | } | ||
121 | |||
122 | static void hsmmc23_before_set_reg(struct device *dev, int slot, | ||
123 | int power_on, int vdd) | ||
124 | { | ||
125 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
126 | |||
127 | if (mmc->slots[0].remux) | ||
128 | mmc->slots[0].remux(dev, slot, power_on); | ||
129 | |||
130 | if (power_on) { | ||
131 | /* Only MMC2 supports a CLKIN */ | ||
132 | if (mmc->slots[0].internal_clock) { | ||
133 | u32 reg; | ||
134 | |||
135 | reg = omap_ctrl_readl(control_devconf1_offset); | ||
136 | reg |= OMAP2_MMCSDIO2ADPCLKISEL; | ||
137 | omap_ctrl_writel(reg, control_devconf1_offset); | ||
138 | } | ||
139 | } | ||
140 | } | ||
141 | |||
142 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; | ||
143 | |||
144 | void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) | ||
145 | { | ||
146 | struct omap2_hsmmc_info *c; | ||
147 | int nr_hsmmc = ARRAY_SIZE(hsmmc_data); | ||
148 | int i; | ||
149 | |||
150 | if (cpu_is_omap2430()) { | ||
151 | control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; | ||
152 | control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; | ||
153 | } else { | ||
154 | control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; | ||
155 | control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; | ||
156 | } | ||
157 | |||
158 | for (c = controllers; c->mmc; c++) { | ||
159 | struct hsmmc_controller *hc = hsmmc + c->mmc - 1; | ||
160 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | ||
161 | |||
162 | if (!c->mmc || c->mmc > nr_hsmmc) { | ||
163 | pr_debug("MMC%d: no such controller\n", c->mmc); | ||
164 | continue; | ||
165 | } | ||
166 | if (mmc) { | ||
167 | pr_debug("MMC%d: already configured\n", c->mmc); | ||
168 | continue; | ||
169 | } | ||
170 | |||
171 | mmc = kzalloc(sizeof(struct omap_mmc_platform_data), | ||
172 | GFP_KERNEL); | ||
173 | if (!mmc) { | ||
174 | pr_err("Cannot allocate memory for mmc device!\n"); | ||
175 | goto done; | ||
176 | } | ||
177 | |||
178 | if (c->name) | ||
179 | strncpy(hc->name, c->name, HSMMC_NAME_LEN); | ||
180 | else | ||
181 | snprintf(hc->name, ARRAY_SIZE(hc->name), | ||
182 | "mmc%islot%i", c->mmc, 1); | ||
183 | mmc->slots[0].name = hc->name; | ||
184 | mmc->nr_slots = 1; | ||
185 | mmc->slots[0].wires = c->wires; | ||
186 | mmc->slots[0].internal_clock = !c->ext_clock; | ||
187 | mmc->dma_mask = 0xffffffff; | ||
188 | |||
189 | mmc->get_context_loss_count = hsmmc_get_context_loss; | ||
190 | |||
191 | mmc->slots[0].switch_pin = c->gpio_cd; | ||
192 | mmc->slots[0].gpio_wp = c->gpio_wp; | ||
193 | |||
194 | mmc->slots[0].remux = c->remux; | ||
195 | |||
196 | if (c->cover_only) | ||
197 | mmc->slots[0].cover = 1; | ||
198 | |||
199 | if (c->nonremovable) | ||
200 | mmc->slots[0].nonremovable = 1; | ||
201 | |||
202 | if (c->power_saving) | ||
203 | mmc->slots[0].power_saving = 1; | ||
204 | |||
205 | if (c->no_off) | ||
206 | mmc->slots[0].no_off = 1; | ||
207 | |||
208 | if (c->vcc_aux_disable_is_sleep) | ||
209 | mmc->slots[0].vcc_aux_disable_is_sleep = 1; | ||
210 | |||
211 | /* NOTE: MMC slots should have a Vcc regulator set up. | ||
212 | * This may be from a TWL4030-family chip, another | ||
213 | * controllable regulator, or a fixed supply. | ||
214 | * | ||
215 | * temporary HACK: ocr_mask instead of fixed supply | ||
216 | */ | ||
217 | mmc->slots[0].ocr_mask = c->ocr_mask; | ||
218 | |||
219 | switch (c->mmc) { | ||
220 | case 1: | ||
221 | /* on-chip level shifting via PBIAS0/PBIAS1 */ | ||
222 | mmc->slots[0].before_set_reg = hsmmc1_before_set_reg; | ||
223 | mmc->slots[0].after_set_reg = hsmmc1_after_set_reg; | ||
224 | |||
225 | /* Omap3630 HSMMC1 supports only 4-bit */ | ||
226 | if (cpu_is_omap3630() && c->wires > 4) { | ||
227 | c->wires = 4; | ||
228 | mmc->slots[0].wires = c->wires; | ||
229 | } | ||
230 | break; | ||
231 | case 2: | ||
232 | if (c->ext_clock) | ||
233 | c->transceiver = 1; | ||
234 | if (c->transceiver && c->wires > 4) | ||
235 | c->wires = 4; | ||
236 | /* FALLTHROUGH */ | ||
237 | case 3: | ||
238 | /* off-chip level shifting, or none */ | ||
239 | mmc->slots[0].before_set_reg = hsmmc23_before_set_reg; | ||
240 | mmc->slots[0].after_set_reg = NULL; | ||
241 | break; | ||
242 | default: | ||
243 | pr_err("MMC%d configuration not supported!\n", c->mmc); | ||
244 | kfree(mmc); | ||
245 | continue; | ||
246 | } | ||
247 | hsmmc_data[c->mmc - 1] = mmc; | ||
248 | } | ||
249 | |||
250 | omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); | ||
251 | |||
252 | /* pass the device nodes back to board setup code */ | ||
253 | for (c = controllers; c->mmc; c++) { | ||
254 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | ||
255 | |||
256 | if (!c->mmc || c->mmc > nr_hsmmc) | ||
257 | continue; | ||
258 | c->dev = mmc->dev; | ||
259 | } | ||
260 | |||
261 | done: | ||
262 | for (i = 0; i < nr_hsmmc; i++) | ||
263 | kfree(hsmmc_data[i]); | ||
264 | } | ||
265 | |||
266 | #endif | ||
diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/hsmmc.h index a47e68563fb6..36f0ba8d89e2 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.h +++ b/arch/arm/mach-omap2/hsmmc.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | struct twl4030_hsmmc_info { | 9 | struct omap2_hsmmc_info { |
10 | u8 mmc; /* controller 1/2/3 */ | 10 | u8 mmc; /* controller 1/2/3 */ |
11 | u8 wires; /* 1/4/8 wires */ | 11 | u8 wires; /* 1/4/8 wires */ |
12 | bool transceiver; /* MMC-2 option */ | 12 | bool transceiver; /* MMC-2 option */ |
@@ -14,22 +14,24 @@ struct twl4030_hsmmc_info { | |||
14 | bool cover_only; /* No card detect - just cover switch */ | 14 | bool cover_only; /* No card detect - just cover switch */ |
15 | bool nonremovable; /* Nonremovable e.g. eMMC */ | 15 | bool nonremovable; /* Nonremovable e.g. eMMC */ |
16 | bool power_saving; /* Try to sleep or power off when possible */ | 16 | bool power_saving; /* Try to sleep or power off when possible */ |
17 | bool no_off; /* power_saving and power is not to go off */ | ||
18 | bool vcc_aux_disable_is_sleep; /* Regulator off remapped to sleep */ | ||
17 | int gpio_cd; /* or -EINVAL */ | 19 | int gpio_cd; /* or -EINVAL */ |
18 | int gpio_wp; /* or -EINVAL */ | 20 | int gpio_wp; /* or -EINVAL */ |
19 | char *name; /* or NULL for default */ | 21 | char *name; /* or NULL for default */ |
20 | struct device *dev; /* returned: pointer to mmc adapter */ | 22 | struct device *dev; /* returned: pointer to mmc adapter */ |
21 | int ocr_mask; /* temporary HACK */ | 23 | int ocr_mask; /* temporary HACK */ |
24 | /* Remux (pad configuation) when powering on/off */ | ||
25 | void (*remux)(struct device *dev, int slot, int power_on); | ||
22 | }; | 26 | }; |
23 | 27 | ||
24 | #if defined(CONFIG_REGULATOR) && \ | 28 | #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) |
25 | (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ | ||
26 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)) | ||
27 | 29 | ||
28 | void twl4030_mmc_init(struct twl4030_hsmmc_info *); | 30 | void omap2_hsmmc_init(struct omap2_hsmmc_info *); |
29 | 31 | ||
30 | #else | 32 | #else |
31 | 33 | ||
32 | static inline void twl4030_mmc_init(struct twl4030_hsmmc_info *info) | 34 | static inline void omap2_hsmmc_init(struct omap2_hsmmc_info *info) |
33 | { | 35 | { |
34 | } | 36 | } |
35 | 37 | ||
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c index 789ca8c02f0c..7951ae1447ee 100644 --- a/arch/arm/mach-omap2/i2c.c +++ b/arch/arm/mach-omap2/i2c.c | |||
@@ -25,9 +25,7 @@ | |||
25 | 25 | ||
26 | #include "mux.h" | 26 | #include "mux.h" |
27 | 27 | ||
28 | int __init omap_register_i2c_bus(int bus_id, u32 clkrate, | 28 | void __init omap2_i2c_mux_pins(int bus_id) |
29 | struct i2c_board_info const *info, | ||
30 | unsigned len) | ||
31 | { | 29 | { |
32 | if (cpu_is_omap24xx()) { | 30 | if (cpu_is_omap24xx()) { |
33 | const int omap24xx_pins[][2] = { | 31 | const int omap24xx_pins[][2] = { |
@@ -51,6 +49,4 @@ int __init omap_register_i2c_bus(int bus_id, u32 clkrate, | |||
51 | sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id); | 49 | sprintf(mux_name, "i2c%i_sda.i2c%i_sda", bus_id, bus_id); |
52 | omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); | 50 | omap_mux_init_signal(mux_name, OMAP_PIN_INPUT); |
53 | } | 51 | } |
54 | |||
55 | return omap_plat_register_i2c_bus(bus_id, clkrate, info, len); | ||
56 | } | 52 | } |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index a091b53657b9..37b8a1a4adf8 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -57,6 +57,8 @@ int omap_type(void) | |||
57 | val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); | 57 | val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); |
58 | } else if (cpu_is_omap34xx()) { | 58 | } else if (cpu_is_omap34xx()) { |
59 | val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); | 59 | val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); |
60 | } else if (cpu_is_omap44xx()) { | ||
61 | val = omap_ctrl_readl(OMAP44XX_CONTROL_STATUS); | ||
60 | } else { | 62 | } else { |
61 | pr_err("Cannot detect omap type!\n"); | 63 | pr_err("Cannot detect omap type!\n"); |
62 | goto out; | 64 | goto out; |
@@ -175,6 +177,8 @@ void __init omap3_check_features(void) | |||
175 | OMAP3_CHECK_FEATURE(status, SGX); | 177 | OMAP3_CHECK_FEATURE(status, SGX); |
176 | OMAP3_CHECK_FEATURE(status, NEON); | 178 | OMAP3_CHECK_FEATURE(status, NEON); |
177 | OMAP3_CHECK_FEATURE(status, ISP); | 179 | OMAP3_CHECK_FEATURE(status, ISP); |
180 | if (cpu_is_omap3630()) | ||
181 | omap3_features |= OMAP3_HAS_192MHZ_CLK; | ||
178 | 182 | ||
179 | /* | 183 | /* |
180 | * TODO: Get additional info (where applicable) | 184 | * TODO: Get additional info (where applicable) |
@@ -188,6 +192,8 @@ void __init omap3_check_revision(void) | |||
188 | u16 hawkeye; | 192 | u16 hawkeye; |
189 | u8 rev; | 193 | u8 rev; |
190 | 194 | ||
195 | omap_chip.oc = CHIP_IS_OMAP3430; | ||
196 | |||
191 | /* | 197 | /* |
192 | * We cannot access revision registers on ES1.0. | 198 | * We cannot access revision registers on ES1.0. |
193 | * If the processor type is Cortex-A8 and the revision is 0x0 | 199 | * If the processor type is Cortex-A8 and the revision is 0x0 |
@@ -196,6 +202,7 @@ void __init omap3_check_revision(void) | |||
196 | cpuid = read_cpuid(CPUID_ID); | 202 | cpuid = read_cpuid(CPUID_ID); |
197 | if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { | 203 | if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { |
198 | omap_revision = OMAP3430_REV_ES1_0; | 204 | omap_revision = OMAP3430_REV_ES1_0; |
205 | omap_chip.oc |= CHIP_IS_OMAP3430ES1; | ||
199 | return; | 206 | return; |
200 | } | 207 | } |
201 | 208 | ||
@@ -216,18 +223,28 @@ void __init omap3_check_revision(void) | |||
216 | case 0: /* Take care of early samples */ | 223 | case 0: /* Take care of early samples */ |
217 | case 1: | 224 | case 1: |
218 | omap_revision = OMAP3430_REV_ES2_0; | 225 | omap_revision = OMAP3430_REV_ES2_0; |
226 | omap_chip.oc |= CHIP_IS_OMAP3430ES2; | ||
219 | break; | 227 | break; |
220 | case 2: | 228 | case 2: |
221 | omap_revision = OMAP3430_REV_ES2_1; | 229 | omap_revision = OMAP3430_REV_ES2_1; |
230 | omap_chip.oc |= CHIP_IS_OMAP3430ES2; | ||
222 | break; | 231 | break; |
223 | case 3: | 232 | case 3: |
224 | omap_revision = OMAP3430_REV_ES3_0; | 233 | omap_revision = OMAP3430_REV_ES3_0; |
234 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_0; | ||
225 | break; | 235 | break; |
226 | case 4: | 236 | case 4: |
237 | omap_revision = OMAP3430_REV_ES3_1; | ||
238 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | ||
239 | break; | ||
240 | case 7: | ||
227 | /* FALLTHROUGH */ | 241 | /* FALLTHROUGH */ |
228 | default: | 242 | default: |
229 | /* Use the latest known revision as default */ | 243 | /* Use the latest known revision as default */ |
230 | omap_revision = OMAP3430_REV_ES3_1; | 244 | omap_revision = OMAP3430_REV_ES3_1_2; |
245 | |||
246 | /* REVISIT: Add CHIP_IS_OMAP3430ES3_1_2? */ | ||
247 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | ||
231 | } | 248 | } |
232 | break; | 249 | break; |
233 | case 0xb868: | 250 | case 0xb868: |
@@ -235,14 +252,18 @@ void __init omap3_check_revision(void) | |||
235 | * | 252 | * |
236 | * Set the device to be OMAP3505 here. Actual device | 253 | * Set the device to be OMAP3505 here. Actual device |
237 | * is identified later based on the features. | 254 | * is identified later based on the features. |
255 | * | ||
256 | * REVISIT: AM3505/AM3517 should have their own CHIP_IS | ||
238 | */ | 257 | */ |
239 | omap_revision = OMAP3505_REV(rev); | 258 | omap_revision = OMAP3505_REV(rev); |
259 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | ||
240 | break; | 260 | break; |
241 | case 0xb891: | 261 | case 0xb891: |
242 | /* FALLTHROUGH */ | 262 | /* FALLTHROUGH */ |
243 | default: | 263 | default: |
244 | /* Unknown default to latest silicon rev as default*/ | 264 | /* Unknown default to latest silicon rev as default*/ |
245 | omap_revision = OMAP3630_REV_ES1_0; | 265 | omap_revision = OMAP3630_REV_ES1_0; |
266 | omap_chip.oc |= CHIP_IS_OMAP3630ES1; | ||
246 | } | 267 | } |
247 | } | 268 | } |
248 | 269 | ||
@@ -264,6 +285,7 @@ void __init omap4_check_revision(void) | |||
264 | 285 | ||
265 | if ((hawkeye == 0xb852) && (rev == 0x0)) { | 286 | if ((hawkeye == 0xb852) && (rev == 0x0)) { |
266 | omap_revision = OMAP4430_REV_ES1_0; | 287 | omap_revision = OMAP4430_REV_ES1_0; |
288 | omap_chip.oc |= CHIP_IS_OMAP4430ES1; | ||
267 | pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name); | 289 | pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name); |
268 | return; | 290 | return; |
269 | } | 291 | } |
@@ -341,6 +363,7 @@ void __init omap3_cpuinfo(void) | |||
341 | OMAP3_SHOW_FEATURE(sgx); | 363 | OMAP3_SHOW_FEATURE(sgx); |
342 | OMAP3_SHOW_FEATURE(neon); | 364 | OMAP3_SHOW_FEATURE(neon); |
343 | OMAP3_SHOW_FEATURE(isp); | 365 | OMAP3_SHOW_FEATURE(isp); |
366 | OMAP3_SHOW_FEATURE(192mhz_clk); | ||
344 | 367 | ||
345 | printk(")\n"); | 368 | printk(")\n"); |
346 | } | 369 | } |
@@ -360,6 +383,7 @@ void __init omap2_check_revision(void) | |||
360 | omap3_check_revision(); | 383 | omap3_check_revision(); |
361 | omap3_check_features(); | 384 | omap3_check_features(); |
362 | omap3_cpuinfo(); | 385 | omap3_cpuinfo(); |
386 | return; | ||
363 | } else if (cpu_is_omap44xx()) { | 387 | } else if (cpu_is_omap44xx()) { |
364 | omap4_check_revision(); | 388 | omap4_check_revision(); |
365 | return; | 389 | return; |
@@ -374,27 +398,14 @@ void __init omap2_check_revision(void) | |||
374 | if (cpu_is_omap243x()) { | 398 | if (cpu_is_omap243x()) { |
375 | /* Currently only supports 2430ES2.1 and 2430-all */ | 399 | /* Currently only supports 2430ES2.1 and 2430-all */ |
376 | omap_chip.oc |= CHIP_IS_OMAP2430; | 400 | omap_chip.oc |= CHIP_IS_OMAP2430; |
401 | return; | ||
377 | } else if (cpu_is_omap242x()) { | 402 | } else if (cpu_is_omap242x()) { |
378 | /* Currently only supports 2420ES2.1.1 and 2420-all */ | 403 | /* Currently only supports 2420ES2.1.1 and 2420-all */ |
379 | omap_chip.oc |= CHIP_IS_OMAP2420; | 404 | omap_chip.oc |= CHIP_IS_OMAP2420; |
380 | } else if (cpu_is_omap3505() || cpu_is_omap3517()) { | 405 | return; |
381 | omap_chip.oc = CHIP_IS_OMAP3430 | CHIP_IS_OMAP3430ES3_1; | ||
382 | } else if (cpu_is_omap343x()) { | ||
383 | omap_chip.oc = CHIP_IS_OMAP3430; | ||
384 | if (omap_rev() == OMAP3430_REV_ES1_0) | ||
385 | omap_chip.oc |= CHIP_IS_OMAP3430ES1; | ||
386 | else if (omap_rev() >= OMAP3430_REV_ES2_0 && | ||
387 | omap_rev() <= OMAP3430_REV_ES2_1) | ||
388 | omap_chip.oc |= CHIP_IS_OMAP3430ES2; | ||
389 | else if (omap_rev() == OMAP3430_REV_ES3_0) | ||
390 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_0; | ||
391 | else if (omap_rev() == OMAP3430_REV_ES3_1) | ||
392 | omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; | ||
393 | else if (omap_rev() == OMAP3630_REV_ES1_0) | ||
394 | omap_chip.oc |= CHIP_IS_OMAP3630ES1; | ||
395 | } else { | ||
396 | pr_err("Uninitialized omap_chip, please fix!\n"); | ||
397 | } | 406 | } |
407 | |||
408 | pr_err("Uninitialized omap_chip, please fix!\n"); | ||
398 | } | 409 | } |
399 | 410 | ||
400 | /* | 411 | /* |
diff --git a/arch/arm/mach-omap2/include/mach/am35xx.h b/arch/arm/mach-omap2/include/mach/am35xx.h new file mode 100644 index 000000000000..a705f946fc46 --- /dev/null +++ b/arch/arm/mach-omap2/include/mach/am35xx.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /*: | ||
2 | * Address mappings and base address for AM35XX specific interconnects | ||
3 | * and peripherals. | ||
4 | * | ||
5 | * Copyright (C) 2009 Texas Instruments | ||
6 | * | ||
7 | * Author: Sriramakrishnan <srk@ti.com> | ||
8 | * Vaibhav Hiremath <hvaibhav@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 | #ifndef __ASM_ARCH_AM35XX_H | ||
15 | #define __ASM_ARCH_AM35XX_H | ||
16 | |||
17 | /* | ||
18 | * Base addresses | ||
19 | * Note: OMAP3430 IVA2 memory space is being used for AM35xx IPSS modules | ||
20 | */ | ||
21 | #define AM35XX_IPSS_EMAC_BASE 0x5C000000 | ||
22 | #define AM35XX_IPSS_USBOTGSS_BASE 0x5C040000 | ||
23 | #define AM35XX_IPSS_HECC_BASE 0x5C050000 | ||
24 | #define AM35XX_IPSS_VPFE_BASE 0x5C060000 | ||
25 | |||
26 | #endif /* __ASM_ARCH_AM35XX_H */ | ||
diff --git a/arch/arm/mach-omap2/include/mach/board-sdp.h b/arch/arm/mach-omap2/include/mach/board-sdp.h new file mode 100644 index 000000000000..465169c0908a --- /dev/null +++ b/arch/arm/mach-omap2/include/mach/board-sdp.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * board-sdp.h | ||
3 | * | ||
4 | * Information structures for SDP-specific board config data | ||
5 | * | ||
6 | * Copyright (C) 2009 Nokia Corporation | ||
7 | * Copyright (C) 2009 Texas Instruments | ||
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 | #include <linux/mtd/mtd.h> | ||
14 | #include <linux/mtd/partitions.h> | ||
15 | |||
16 | struct flash_partitions { | ||
17 | struct mtd_partition *parts; | ||
18 | int nr_parts; | ||
19 | }; | ||
20 | |||
21 | extern void sdp_flash_init(struct flash_partitions []); | ||
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S index e9f255df9163..4a63a2ea484d 100644 --- a/arch/arm/mach-omap2/include/mach/debug-macro.S +++ b/arch/arm/mach-omap2/include/mach/debug-macro.S | |||
@@ -11,32 +11,107 @@ | |||
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | .macro addruart,rx | 14 | #include <linux/serial_reg.h> |
15 | |||
16 | #include <plat/serial.h> | ||
17 | |||
18 | #define UART_OFFSET(addr) ((addr) & 0x00ffffff) | ||
19 | |||
20 | .pushsection .data | ||
21 | omap_uart_phys: .word 0 | ||
22 | omap_uart_virt: .word 0 | ||
23 | omap_uart_lsr: .word 0 | ||
24 | .popsection | ||
25 | |||
26 | /* | ||
27 | * Note that this code won't work if the bootloader passes | ||
28 | * a wrong machine ID number in r1. To debug, just hardcode | ||
29 | * the desired UART phys and virt addresses temporarily into | ||
30 | * the omap_uart_phys and omap_uart_virt above. | ||
31 | */ | ||
32 | .macro addruart, rx, tmp | ||
33 | |||
34 | /* Use omap_uart_phys/virt if already configured */ | ||
35 | 10: mrc p15, 0, \rx, c1, c0 | ||
36 | tst \rx, #1 @ MMU enabled? | ||
37 | ldreq \rx, =omap_uart_phys @ physical base address | ||
38 | ldrne \rx, =omap_uart_virt @ virtual base address | ||
39 | ldr \rx, [\rx, #0] | ||
40 | cmp \rx, #0 @ is port configured? | ||
41 | bne 99f @ already configured | ||
42 | |||
43 | /* Check UART1 scratchpad register for uart to use */ | ||
15 | mrc p15, 0, \rx, c1, c0 | 44 | mrc p15, 0, \rx, c1, c0 |
16 | tst \rx, #1 @ MMU enabled? | 45 | tst \rx, #1 @ MMU enabled? |
17 | #ifdef CONFIG_ARCH_OMAP2 | ||
18 | moveq \rx, #0x48000000 @ physical base address | 46 | moveq \rx, #0x48000000 @ physical base address |
19 | movne \rx, #0xfa000000 @ virtual base | 47 | movne \rx, #0xfa000000 @ virtual base |
20 | orr \rx, \rx, #0x0006a000 | 48 | orr \rx, \rx, #0x0006a000 @ uart1 on omap2/3/4 |
21 | #ifdef CONFIG_OMAP_LL_DEBUG_UART2 | 49 | ldrb \rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)] @ scratchpad |
22 | add \rx, \rx, #0x00002000 @ UART 2 | 50 | |
23 | #endif | 51 | /* Select the UART to use based on the UART1 scratchpad value */ |
24 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 | 52 | cmp \rx, #0 @ no port configured? |
25 | add \rx, \rx, #0x00004000 @ UART 3 | 53 | beq 21f @ if none, try to use UART1 |
26 | #endif | 54 | cmp \rx, #OMAP2UART1 @ OMAP2/3/4UART1 |
27 | 55 | beq 21f @ configure OMAP2/3/4UART1 | |
28 | #elif defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) | 56 | cmp \rx, #OMAP2UART2 @ OMAP2/3/4UART2 |
29 | moveq \rx, #0x48000000 @ physical base address | 57 | beq 22f @ configure OMAP2/3/4UART2 |
30 | movne \rx, #0xfa000000 @ virtual base | 58 | cmp \rx, #OMAP2UART3 @ only on 24xx |
31 | orr \rx, \rx, #0x0006a000 | 59 | beq 23f @ configure OMAP2UART3 |
32 | #ifdef CONFIG_OMAP_LL_DEBUG_UART2 | 60 | cmp \rx, #OMAP3UART3 @ only on 34xx |
33 | add \rx, \rx, #0x00002000 @ UART 2 | 61 | beq 33f @ configure OMAP3UART3 |
34 | #endif | 62 | cmp \rx, #OMAP4UART3 @ only on 44xx |
35 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 | 63 | beq 43f @ configure OMAP4UART3 |
36 | add \rx, \rx, #0x00fb0000 @ UART 3 | 64 | cmp \rx, #OMAP3UART4 @ only on 36xx |
37 | add \rx, \rx, #0x00006000 | 65 | beq 34f @ configure OMAP3UART4 |
38 | #endif | 66 | cmp \rx, #OMAP4UART4 @ only on 44xx |
39 | #endif | 67 | beq 44f @ configure OMAP4UART4 |
68 | cmp \rx, #ZOOM_UART @ only on zoom2/3 | ||
69 | beq 95f @ configure ZOOM_UART | ||
70 | |||
71 | /* Configure the UART offset from the phys/virt base */ | ||
72 | 21: mov \rx, #UART_OFFSET(OMAP2_UART1_BASE) @ omap2/3/4 | ||
73 | b 98f | ||
74 | 22: mov \rx, #UART_OFFSET(OMAP2_UART2_BASE) @ omap2/3/4 | ||
75 | b 98f | ||
76 | 23: mov \rx, #UART_OFFSET(OMAP2_UART3_BASE) | ||
77 | b 98f | ||
78 | 33: mov \rx, #UART_OFFSET(OMAP3_UART1_BASE) | ||
79 | add \rx, \rx, #0x00fb0000 | ||
80 | add \rx, \rx, #0x00006000 @ OMAP3_UART3_BASE | ||
81 | b 98f | ||
82 | 34: mov \rx, #UART_OFFSET(OMAP3_UART1_BASE) | ||
83 | add \rx, \rx, #0x00fb0000 | ||
84 | add \rx, \rx, #0x00028000 @ OMAP3_UART4_BASE | ||
85 | b 98f | ||
86 | 43: mov \rx, #UART_OFFSET(OMAP4_UART3_BASE) | ||
87 | b 98f | ||
88 | 44: mov \rx, #UART_OFFSET(OMAP4_UART4_BASE) | ||
89 | b 98f | ||
90 | 95: mov \rx, #ZOOM_UART_BASE | ||
91 | ldr \tmp, =omap_uart_phys | ||
92 | str \rx, [\tmp, #0] | ||
93 | mov \rx, #ZOOM_UART_VIRT | ||
94 | ldr \tmp, =omap_uart_virt | ||
95 | str \rx, [\tmp, #0] | ||
96 | mov \rx, #(UART_LSR << ZOOM_PORT_SHIFT) | ||
97 | ldr \tmp, =omap_uart_lsr | ||
98 | str \rx, [\tmp, #0] | ||
99 | b 10b | ||
100 | |||
101 | /* Store both phys and virt address for the uart */ | ||
102 | 98: add \rx, \rx, #0x48000000 @ phys base | ||
103 | ldr \tmp, =omap_uart_phys | ||
104 | str \rx, [\tmp, #0] | ||
105 | sub \rx, \rx, #0x48000000 @ phys base | ||
106 | add \rx, \rx, #0xfa000000 @ virt base | ||
107 | ldr \tmp, =omap_uart_virt | ||
108 | str \rx, [\tmp, #0] | ||
109 | mov \rx, #(UART_LSR << OMAP_PORT_SHIFT) | ||
110 | ldr \tmp, =omap_uart_lsr | ||
111 | str \rx, [\tmp, #0] | ||
112 | |||
113 | b 10b | ||
114 | 99: | ||
40 | .endm | 115 | .endm |
41 | 116 | ||
42 | .macro senduart,rd,rx | 117 | .macro senduart,rd,rx |
@@ -44,15 +119,12 @@ | |||
44 | .endm | 119 | .endm |
45 | 120 | ||
46 | .macro busyuart,rd,rx | 121 | .macro busyuart,rd,rx |
47 | 1001: ldrb \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends | 122 | 1001: ldr \rd, =omap_uart_lsr |
48 | and \rd, \rd, #0x60 | 123 | ldr \rd, [\rd, #0] |
49 | teq \rd, #0x60 | 124 | ldrb \rd, [\rx, \rd] |
50 | beq 1002f | 125 | and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE) |
51 | ldrb \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only | 126 | teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE) |
52 | and \rd, \rd, #0x60 | ||
53 | teq \rd, #0x60 | ||
54 | bne 1001b | 127 | bne 1001b |
55 | 1002: | ||
56 | .endm | 128 | .endm |
57 | 129 | ||
58 | .macro waituart,rd,rx | 130 | .macro waituart,rd,rx |
diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S index c7f1720bf282..ff25c7e4e606 100644 --- a/arch/arm/mach-omap2/include/mach/entry-macro.S +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S | |||
@@ -17,46 +17,134 @@ | |||
17 | 17 | ||
18 | #include <plat/omap24xx.h> | 18 | #include <plat/omap24xx.h> |
19 | #include <plat/omap34xx.h> | 19 | #include <plat/omap34xx.h> |
20 | |||
21 | /* REVISIT: This should be set dynamically if CONFIG_MULTI_OMAP2 is selected */ | ||
22 | #if defined(CONFIG_ARCH_OMAP2420) || defined(CONFIG_ARCH_OMAP2430) | ||
23 | #define OMAP2_VA_IC_BASE OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE) | ||
24 | #elif defined(CONFIG_ARCH_OMAP34XX) | ||
25 | #define OMAP2_VA_IC_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE) | ||
26 | #endif | ||
27 | #if defined(CONFIG_ARCH_OMAP4) | ||
28 | #include <plat/omap44xx.h> | 20 | #include <plat/omap44xx.h> |
29 | #endif | 21 | |
30 | #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* Active interrupt offset */ | 22 | #include <plat/multi.h> |
31 | #define ACTIVEIRQ_MASK 0x7f /* Active interrupt bits */ | 23 | |
24 | #define OMAP2_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE) | ||
25 | #define OMAP3_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE) | ||
26 | #define OMAP4_IRQ_BASE OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE) | ||
27 | #define INTCPS_SIR_IRQ_OFFSET 0x0040 /* omap2/3 active interrupt offset */ | ||
28 | #define ACTIVEIRQ_MASK 0x7f /* omap2/3 active interrupt bits */ | ||
32 | 29 | ||
33 | .macro disable_fiq | 30 | .macro disable_fiq |
34 | .endm | 31 | .endm |
35 | 32 | ||
36 | .macro get_irqnr_preamble, base, tmp | 33 | .macro arch_ret_to_user, tmp1, tmp2 |
37 | .endm | 34 | .endm |
38 | 35 | ||
39 | .macro arch_ret_to_user, tmp1, tmp2 | 36 | /* |
37 | * Unoptimized irq functions for multi-omap2, 3 and 4 | ||
38 | */ | ||
39 | |||
40 | #ifdef MULTI_OMAP2 | ||
41 | .pushsection .data | ||
42 | omap_irq_base: .word 0 | ||
43 | .popsection | ||
44 | |||
45 | /* Configure the interrupt base on the first interrupt */ | ||
46 | .macro get_irqnr_preamble, base, tmp | ||
47 | 9: | ||
48 | ldr \base, =omap_irq_base @ irq base address | ||
49 | ldr \base, [\base, #0] @ irq base value | ||
50 | cmp \base, #0 @ already configured? | ||
51 | bne 9997f @ nothing to do | ||
52 | |||
53 | mrc p15, 0, \tmp, c0, c0, 0 @ get processor revision | ||
54 | and \tmp, \tmp, #0x000f0000 @ only check architecture | ||
55 | cmp \tmp, #0x00060000 @ is v6? | ||
56 | beq 2400f @ found v6 so it's omap24xx | ||
57 | mrc p15, 0, \tmp, c0, c0, 0 @ get processor revision | ||
58 | and \tmp, \tmp, #0x000000f0 @ check cortex 8 or 9 | ||
59 | cmp \tmp, #0x00000080 @ cortex A-8? | ||
60 | beq 3400f @ found A-8 so it's omap34xx | ||
61 | cmp \tmp, #0x00000090 @ cortex A-9? | ||
62 | beq 4400f @ found A-9 so it's omap44xx | ||
63 | 2400: ldr \base, =OMAP2_IRQ_BASE | ||
64 | ldr \tmp, =omap_irq_base | ||
65 | str \base, [\tmp, #0] | ||
66 | b 9b | ||
67 | 3400: ldr \base, =OMAP3_IRQ_BASE | ||
68 | ldr \tmp, =omap_irq_base | ||
69 | str \base, [\tmp, #0] | ||
70 | b 9b | ||
71 | 4400: ldr \base, =OMAP4_IRQ_BASE | ||
72 | ldr \tmp, =omap_irq_base | ||
73 | str \base, [\tmp, #0] | ||
74 | b 9b | ||
75 | 9997: | ||
40 | .endm | 76 | .endm |
41 | 77 | ||
42 | #ifndef CONFIG_ARCH_OMAP4 | 78 | /* Check the pending interrupts. Note that base already set */ |
43 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 79 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
44 | ldr \base, =OMAP2_VA_IC_BASE | 80 | tst \base, #0x100 @ gic address? |
81 | bne 4401f @ found gic | ||
82 | |||
83 | /* Handle omap2 and omap3 */ | ||
45 | ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ | 84 | ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ |
46 | cmp \irqnr, #0x0 | 85 | cmp \irqnr, #0x0 |
47 | bne 2222f | 86 | bne 9998f |
48 | ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */ | 87 | ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */ |
49 | cmp \irqnr, #0x0 | 88 | cmp \irqnr, #0x0 |
50 | bne 2222f | 89 | bne 9998f |
51 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ | 90 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ |
52 | cmp \irqnr, #0x0 | 91 | cmp \irqnr, #0x0 |
53 | 2222: | 92 | 9998: |
54 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] | 93 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] |
55 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ | 94 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ |
95 | b 9999f | ||
56 | 96 | ||
97 | /* Handle omap4 */ | ||
98 | 4401: ldr \irqstat, [\base, #GIC_CPU_INTACK] | ||
99 | ldr \tmp, =1021 | ||
100 | bic \irqnr, \irqstat, #0x1c00 | ||
101 | cmp \irqnr, #29 | ||
102 | cmpcc \irqnr, \irqnr | ||
103 | cmpne \irqnr, \tmp | ||
104 | cmpcs \irqnr, \irqnr | ||
105 | 9999: | ||
57 | .endm | 106 | .endm |
107 | |||
108 | |||
109 | #else /* MULTI_OMAP2 */ | ||
110 | |||
111 | |||
112 | /* | ||
113 | * Optimized irq functions for omap2, 3 and 4 | ||
114 | */ | ||
115 | |||
116 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) | ||
117 | .macro get_irqnr_preamble, base, tmp | ||
118 | #ifdef CONFIG_ARCH_OMAP2 | ||
119 | ldr \base, =OMAP2_IRQ_BASE | ||
58 | #else | 120 | #else |
59 | #define OMAP44XX_VA_GIC_CPU_BASE OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE) | 121 | ldr \base, =OMAP3_IRQ_BASE |
122 | #endif | ||
123 | .endm | ||
124 | |||
125 | /* Check the pending interrupts. Note that base already set */ | ||
126 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
127 | ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ | ||
128 | cmp \irqnr, #0x0 | ||
129 | bne 9999f | ||
130 | ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */ | ||
131 | cmp \irqnr, #0x0 | ||
132 | bne 9999f | ||
133 | ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ | ||
134 | cmp \irqnr, #0x0 | ||
135 | 9999: | ||
136 | ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] | ||
137 | and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ | ||
138 | |||
139 | .endm | ||
140 | #endif | ||
141 | |||
142 | |||
143 | #ifdef CONFIG_ARCH_OMAP4 | ||
144 | |||
145 | .macro get_irqnr_preamble, base, tmp | ||
146 | ldr \base, =OMAP4_IRQ_BASE | ||
147 | .endm | ||
60 | 148 | ||
61 | /* | 149 | /* |
62 | * The interrupt numbering scheme is defined in the | 150 | * The interrupt numbering scheme is defined in the |
@@ -78,7 +166,6 @@ | |||
78 | * valid range for an IRQ (30-1020 inclusive). | 166 | * valid range for an IRQ (30-1020 inclusive). |
79 | */ | 167 | */ |
80 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 168 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
81 | ldr \base, =OMAP44XX_VA_GIC_CPU_BASE | ||
82 | ldr \irqstat, [\base, #GIC_CPU_INTACK] | 169 | ldr \irqstat, [\base, #GIC_CPU_INTACK] |
83 | 170 | ||
84 | ldr \tmp, =1021 | 171 | ldr \tmp, =1021 |
@@ -119,6 +206,7 @@ | |||
119 | cmp \tmp, #0 | 206 | cmp \tmp, #0 |
120 | .endm | 207 | .endm |
121 | #endif | 208 | #endif |
209 | #endif /* MULTI_OMAP2 */ | ||
122 | 210 | ||
123 | .macro irq_prio_table | 211 | .macro irq_prio_table |
124 | .endm | 212 | .endm |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index a8749e8017b9..402e8f0d0f21 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -33,10 +33,11 @@ | |||
33 | #include <plat/sdrc.h> | 33 | #include <plat/sdrc.h> |
34 | #include <plat/gpmc.h> | 34 | #include <plat/gpmc.h> |
35 | #include <plat/serial.h> | 35 | #include <plat/serial.h> |
36 | #include <plat/mux.h> | ||
37 | #include <plat/vram.h> | 36 | #include <plat/vram.h> |
38 | 37 | ||
39 | #include "clock.h" | 38 | #include "clock2xxx.h" |
39 | #include "clock3xxx.h" | ||
40 | #include "clock44xx.h" | ||
40 | 41 | ||
41 | #include <plat/omap-pm.h> | 42 | #include <plat/omap-pm.h> |
42 | #include <plat/powerdomain.h> | 43 | #include <plat/powerdomain.h> |
@@ -45,16 +46,13 @@ | |||
45 | #include <plat/clockdomain.h> | 46 | #include <plat/clockdomain.h> |
46 | #include "clockdomains.h" | 47 | #include "clockdomains.h" |
47 | #include <plat/omap_hwmod.h> | 48 | #include <plat/omap_hwmod.h> |
48 | #include "omap_hwmod_2420.h" | ||
49 | #include "omap_hwmod_2430.h" | ||
50 | #include "omap_hwmod_34xx.h" | ||
51 | 49 | ||
52 | /* | 50 | /* |
53 | * The machine specific code may provide the extra mapping besides the | 51 | * The machine specific code may provide the extra mapping besides the |
54 | * default mapping provided here. | 52 | * default mapping provided here. |
55 | */ | 53 | */ |
56 | 54 | ||
57 | #ifdef CONFIG_ARCH_OMAP24XX | 55 | #ifdef CONFIG_ARCH_OMAP2 |
58 | static struct map_desc omap24xx_io_desc[] __initdata = { | 56 | static struct map_desc omap24xx_io_desc[] __initdata = { |
59 | { | 57 | { |
60 | .virtual = L3_24XX_VIRT, | 58 | .virtual = L3_24XX_VIRT, |
@@ -73,21 +71,21 @@ static struct map_desc omap24xx_io_desc[] __initdata = { | |||
73 | #ifdef CONFIG_ARCH_OMAP2420 | 71 | #ifdef CONFIG_ARCH_OMAP2420 |
74 | static struct map_desc omap242x_io_desc[] __initdata = { | 72 | static struct map_desc omap242x_io_desc[] __initdata = { |
75 | { | 73 | { |
76 | .virtual = DSP_MEM_24XX_VIRT, | 74 | .virtual = DSP_MEM_2420_VIRT, |
77 | .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), | 75 | .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS), |
78 | .length = DSP_MEM_24XX_SIZE, | 76 | .length = DSP_MEM_2420_SIZE, |
79 | .type = MT_DEVICE | 77 | .type = MT_DEVICE |
80 | }, | 78 | }, |
81 | { | 79 | { |
82 | .virtual = DSP_IPI_24XX_VIRT, | 80 | .virtual = DSP_IPI_2420_VIRT, |
83 | .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), | 81 | .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS), |
84 | .length = DSP_IPI_24XX_SIZE, | 82 | .length = DSP_IPI_2420_SIZE, |
85 | .type = MT_DEVICE | 83 | .type = MT_DEVICE |
86 | }, | 84 | }, |
87 | { | 85 | { |
88 | .virtual = DSP_MMU_24XX_VIRT, | 86 | .virtual = DSP_MMU_2420_VIRT, |
89 | .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), | 87 | .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS), |
90 | .length = DSP_MMU_24XX_SIZE, | 88 | .length = DSP_MMU_2420_SIZE, |
91 | .type = MT_DEVICE | 89 | .type = MT_DEVICE |
92 | }, | 90 | }, |
93 | }; | 91 | }; |
@@ -124,7 +122,7 @@ static struct map_desc omap243x_io_desc[] __initdata = { | |||
124 | #endif | 122 | #endif |
125 | #endif | 123 | #endif |
126 | 124 | ||
127 | #ifdef CONFIG_ARCH_OMAP34XX | 125 | #ifdef CONFIG_ARCH_OMAP3 |
128 | static struct map_desc omap34xx_io_desc[] __initdata = { | 126 | static struct map_desc omap34xx_io_desc[] __initdata = { |
129 | { | 127 | { |
130 | .virtual = L3_34XX_VIRT, | 128 | .virtual = L3_34XX_VIRT, |
@@ -139,12 +137,6 @@ static struct map_desc omap34xx_io_desc[] __initdata = { | |||
139 | .type = MT_DEVICE | 137 | .type = MT_DEVICE |
140 | }, | 138 | }, |
141 | { | 139 | { |
142 | .virtual = L4_WK_34XX_VIRT, | ||
143 | .pfn = __phys_to_pfn(L4_WK_34XX_PHYS), | ||
144 | .length = L4_WK_34XX_SIZE, | ||
145 | .type = MT_DEVICE | ||
146 | }, | ||
147 | { | ||
148 | .virtual = OMAP34XX_GPMC_VIRT, | 140 | .virtual = OMAP34XX_GPMC_VIRT, |
149 | .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS), | 141 | .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS), |
150 | .length = OMAP34XX_GPMC_SIZE, | 142 | .length = OMAP34XX_GPMC_SIZE, |
@@ -191,12 +183,6 @@ static struct map_desc omap44xx_io_desc[] __initdata = { | |||
191 | .type = MT_DEVICE, | 183 | .type = MT_DEVICE, |
192 | }, | 184 | }, |
193 | { | 185 | { |
194 | .virtual = L4_WK_44XX_VIRT, | ||
195 | .pfn = __phys_to_pfn(L4_WK_44XX_PHYS), | ||
196 | .length = L4_WK_44XX_SIZE, | ||
197 | .type = MT_DEVICE, | ||
198 | }, | ||
199 | { | ||
200 | .virtual = OMAP44XX_GPMC_VIRT, | 186 | .virtual = OMAP44XX_GPMC_VIRT, |
201 | .pfn = __phys_to_pfn(OMAP44XX_GPMC_PHYS), | 187 | .pfn = __phys_to_pfn(OMAP44XX_GPMC_PHYS), |
202 | .length = OMAP44XX_GPMC_SIZE, | 188 | .length = OMAP44XX_GPMC_SIZE, |
@@ -235,37 +221,54 @@ static struct map_desc omap44xx_io_desc[] __initdata = { | |||
235 | }; | 221 | }; |
236 | #endif | 222 | #endif |
237 | 223 | ||
238 | void __init omap2_map_common_io(void) | 224 | static void __init _omap2_map_common_io(void) |
225 | { | ||
226 | /* Normally devicemaps_init() would flush caches and tlb after | ||
227 | * mdesc->map_io(), but we must also do it here because of the CPU | ||
228 | * revision check below. | ||
229 | */ | ||
230 | local_flush_tlb_all(); | ||
231 | flush_cache_all(); | ||
232 | |||
233 | omap2_check_revision(); | ||
234 | omap_sram_init(); | ||
235 | omapfb_reserve_sdram(); | ||
236 | omap_vram_reserve_sdram(); | ||
237 | } | ||
238 | |||
239 | #ifdef CONFIG_ARCH_OMAP2420 | ||
240 | void __init omap242x_map_common_io() | ||
239 | { | 241 | { |
240 | #if defined(CONFIG_ARCH_OMAP2420) | ||
241 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); | 242 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); |
242 | iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); | 243 | iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); |
244 | _omap2_map_common_io(); | ||
245 | } | ||
243 | #endif | 246 | #endif |
244 | 247 | ||
245 | #if defined(CONFIG_ARCH_OMAP2430) | 248 | #ifdef CONFIG_ARCH_OMAP2430 |
249 | void __init omap243x_map_common_io() | ||
250 | { | ||
246 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); | 251 | iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); |
247 | iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); | 252 | iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); |
253 | _omap2_map_common_io(); | ||
254 | } | ||
248 | #endif | 255 | #endif |
249 | 256 | ||
250 | #if defined(CONFIG_ARCH_OMAP34XX) | 257 | #ifdef CONFIG_ARCH_OMAP3 |
258 | void __init omap34xx_map_common_io() | ||
259 | { | ||
251 | iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); | 260 | iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); |
261 | _omap2_map_common_io(); | ||
262 | } | ||
252 | #endif | 263 | #endif |
253 | 264 | ||
254 | #if defined(CONFIG_ARCH_OMAP4) | 265 | #ifdef CONFIG_ARCH_OMAP4 |
266 | void __init omap44xx_map_common_io() | ||
267 | { | ||
255 | iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); | 268 | iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); |
256 | #endif | 269 | _omap2_map_common_io(); |
257 | /* Normally devicemaps_init() would flush caches and tlb after | ||
258 | * mdesc->map_io(), but we must also do it here because of the CPU | ||
259 | * revision check below. | ||
260 | */ | ||
261 | local_flush_tlb_all(); | ||
262 | flush_cache_all(); | ||
263 | |||
264 | omap2_check_revision(); | ||
265 | omap_sram_init(); | ||
266 | omapfb_reserve_sdram(); | ||
267 | omap_vram_reserve_sdram(); | ||
268 | } | 270 | } |
271 | #endif | ||
269 | 272 | ||
270 | /* | 273 | /* |
271 | * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters | 274 | * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters |
@@ -304,24 +307,31 @@ static int __init _omap2_init_reprogram_sdrc(void) | |||
304 | void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | 307 | void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, |
305 | struct omap_sdrc_params *sdrc_cs1) | 308 | struct omap_sdrc_params *sdrc_cs1) |
306 | { | 309 | { |
307 | struct omap_hwmod **hwmods = NULL; | 310 | pwrdm_init(powerdomains_omap); |
311 | clkdm_init(clockdomains_omap, clkdm_autodeps); | ||
312 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ | ||
313 | if (cpu_is_omap242x()) | ||
314 | omap2420_hwmod_init(); | ||
315 | else if (cpu_is_omap243x()) | ||
316 | omap2430_hwmod_init(); | ||
317 | else if (cpu_is_omap34xx()) | ||
318 | omap3xxx_hwmod_init(); | ||
319 | omap2_mux_init(); | ||
320 | /* The OPP tables have to be registered before a clk init */ | ||
321 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); | ||
322 | #endif | ||
308 | 323 | ||
309 | if (cpu_is_omap2420()) | 324 | if (cpu_is_omap2420()) |
310 | hwmods = omap2420_hwmods; | 325 | omap2420_clk_init(); |
311 | else if (cpu_is_omap2430()) | 326 | else if (cpu_is_omap2430()) |
312 | hwmods = omap2430_hwmods; | 327 | omap2430_clk_init(); |
313 | else if (cpu_is_omap34xx()) | 328 | else if (cpu_is_omap34xx()) |
314 | hwmods = omap34xx_hwmods; | 329 | omap3xxx_clk_init(); |
330 | else if (cpu_is_omap44xx()) | ||
331 | omap4xxx_clk_init(); | ||
332 | else | ||
333 | pr_err("Could not init clock framework - unknown CPU\n"); | ||
315 | 334 | ||
316 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ | ||
317 | /* The OPP tables have to be registered before a clk init */ | ||
318 | omap_hwmod_init(hwmods); | ||
319 | omap2_mux_init(); | ||
320 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); | ||
321 | pwrdm_init(powerdomains_omap); | ||
322 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); | ||
323 | #endif | ||
324 | omap2_clk_init(); | ||
325 | omap_serial_early_init(); | 335 | omap_serial_early_init(); |
326 | #ifndef CONFIG_ARCH_OMAP4 | 336 | #ifndef CONFIG_ARCH_OMAP4 |
327 | omap_hwmod_late_init(); | 337 | omap_hwmod_late_init(); |
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index e9bc782fa414..26aeef560aa3 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c | |||
@@ -194,7 +194,7 @@ void __init omap_init_irq(void) | |||
194 | int i; | 194 | int i; |
195 | 195 | ||
196 | for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { | 196 | for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { |
197 | unsigned long base; | 197 | unsigned long base = 0; |
198 | struct omap_irq_bank *bank = irq_banks + i; | 198 | struct omap_irq_bank *bank = irq_banks + i; |
199 | 199 | ||
200 | if (cpu_is_omap24xx()) | 200 | if (cpu_is_omap24xx()) |
@@ -202,6 +202,8 @@ void __init omap_init_irq(void) | |||
202 | else if (cpu_is_omap34xx()) | 202 | else if (cpu_is_omap34xx()) |
203 | base = OMAP34XX_IC_BASE; | 203 | base = OMAP34XX_IC_BASE; |
204 | 204 | ||
205 | BUG_ON(!base); | ||
206 | |||
205 | /* Static mapping, never released */ | 207 | /* Static mapping, never released */ |
206 | bank->base_reg = ioremap(base, SZ_4K); | 208 | bank->base_reg = ioremap(base, SZ_4K); |
207 | if (!bank->base_reg) { | 209 | if (!bank->base_reg) { |
@@ -274,4 +276,22 @@ void omap_intc_restore_context(void) | |||
274 | } | 276 | } |
275 | /* MIRs are saved and restore with other PRCM registers */ | 277 | /* MIRs are saved and restore with other PRCM registers */ |
276 | } | 278 | } |
279 | |||
280 | void omap3_intc_suspend(void) | ||
281 | { | ||
282 | /* A pending interrupt would prevent OMAP from entering suspend */ | ||
283 | omap_ack_irq(0); | ||
284 | } | ||
285 | |||
286 | void omap3_intc_prepare_idle(void) | ||
287 | { | ||
288 | /* Disable autoidle as it can stall interrupt controller */ | ||
289 | intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG); | ||
290 | } | ||
291 | |||
292 | void omap3_intc_resume_idle(void) | ||
293 | { | ||
294 | /* Re-enable autoidle */ | ||
295 | intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG); | ||
296 | } | ||
277 | #endif /* CONFIG_ARCH_OMAP3 */ | 297 | #endif /* CONFIG_ARCH_OMAP3 */ |
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 281ab6342448..52a981cb8fdd 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c | |||
@@ -40,6 +40,9 @@ | |||
40 | #define AUTOIDLE (1 << 0) | 40 | #define AUTOIDLE (1 << 0) |
41 | #define SOFTRESET (1 << 1) | 41 | #define SOFTRESET (1 << 1) |
42 | #define SMARTIDLE (2 << 3) | 42 | #define SMARTIDLE (2 << 3) |
43 | #define OMAP4_SOFTRESET (1 << 0) | ||
44 | #define OMAP4_NOIDLE (1 << 2) | ||
45 | #define OMAP4_SMARTIDLE (2 << 2) | ||
43 | 46 | ||
44 | /* SYSSTATUS: register bit definition */ | 47 | /* SYSSTATUS: register bit definition */ |
45 | #define RESETDONE (1 << 0) | 48 | #define RESETDONE (1 << 0) |
@@ -93,29 +96,47 @@ static int omap2_mbox_startup(struct omap_mbox *mbox) | |||
93 | 96 | ||
94 | mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); | 97 | mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); |
95 | if (IS_ERR(mbox_ick_handle)) { | 98 | if (IS_ERR(mbox_ick_handle)) { |
96 | printk(KERN_ERR "Could not get mailboxes_ick: %d\n", | 99 | printk(KERN_ERR "Could not get mailboxes_ick: %ld\n", |
97 | PTR_ERR(mbox_ick_handle)); | 100 | PTR_ERR(mbox_ick_handle)); |
98 | return PTR_ERR(mbox_ick_handle); | 101 | return PTR_ERR(mbox_ick_handle); |
99 | } | 102 | } |
100 | clk_enable(mbox_ick_handle); | 103 | clk_enable(mbox_ick_handle); |
101 | 104 | ||
102 | mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG); | 105 | if (cpu_is_omap44xx()) { |
103 | timeout = jiffies + msecs_to_jiffies(20); | 106 | mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG); |
104 | do { | 107 | timeout = jiffies + msecs_to_jiffies(20); |
105 | l = mbox_read_reg(MAILBOX_SYSSTATUS); | 108 | do { |
106 | if (l & RESETDONE) | 109 | l = mbox_read_reg(MAILBOX_SYSCONFIG); |
107 | break; | 110 | if (!(l & OMAP4_SOFTRESET)) |
108 | } while (!time_after(jiffies, timeout)); | 111 | break; |
109 | 112 | } while (!time_after(jiffies, timeout)); | |
110 | if (!(l & RESETDONE)) { | 113 | |
111 | pr_err("Can't take mmu out of reset\n"); | 114 | if (l & OMAP4_SOFTRESET) { |
112 | return -ENODEV; | 115 | pr_err("Can't take mailbox out of reset\n"); |
116 | return -ENODEV; | ||
117 | } | ||
118 | } else { | ||
119 | mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG); | ||
120 | timeout = jiffies + msecs_to_jiffies(20); | ||
121 | do { | ||
122 | l = mbox_read_reg(MAILBOX_SYSSTATUS); | ||
123 | if (l & RESETDONE) | ||
124 | break; | ||
125 | } while (!time_after(jiffies, timeout)); | ||
126 | |||
127 | if (!(l & RESETDONE)) { | ||
128 | pr_err("Can't take mailbox out of reset\n"); | ||
129 | return -ENODEV; | ||
130 | } | ||
113 | } | 131 | } |
114 | 132 | ||
115 | l = mbox_read_reg(MAILBOX_REVISION); | 133 | l = mbox_read_reg(MAILBOX_REVISION); |
116 | pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); | 134 | pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); |
117 | 135 | ||
118 | l = SMARTIDLE | AUTOIDLE; | 136 | if (cpu_is_omap44xx()) |
137 | l = OMAP4_SMARTIDLE; | ||
138 | else | ||
139 | l = SMARTIDLE | AUTOIDLE; | ||
119 | mbox_write_reg(l, MAILBOX_SYSCONFIG); | 140 | mbox_write_reg(l, MAILBOX_SYSCONFIG); |
120 | 141 | ||
121 | omap2_mbox_enable_irq(mbox, IRQ_RX); | 142 | omap2_mbox_enable_irq(mbox, IRQ_RX); |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index baa451733850..be8fce395a58 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -65,9 +65,11 @@ static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { | |||
65 | }, | 65 | }, |
66 | }; | 66 | }; |
67 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) | 67 | #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata) |
68 | #define OMAP2420_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
68 | #else | 69 | #else |
69 | #define omap2420_mcbsp_pdata NULL | 70 | #define omap2420_mcbsp_pdata NULL |
70 | #define OMAP2420_MCBSP_PDATA_SZ 0 | 71 | #define OMAP2420_MCBSP_PDATA_SZ 0 |
72 | #define OMAP2420_MCBSP_REG_NUM 0 | ||
71 | #endif | 73 | #endif |
72 | 74 | ||
73 | #ifdef CONFIG_ARCH_OMAP2430 | 75 | #ifdef CONFIG_ARCH_OMAP2430 |
@@ -114,12 +116,14 @@ static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { | |||
114 | }, | 116 | }, |
115 | }; | 117 | }; |
116 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) | 118 | #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata) |
119 | #define OMAP2430_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
117 | #else | 120 | #else |
118 | #define omap2430_mcbsp_pdata NULL | 121 | #define omap2430_mcbsp_pdata NULL |
119 | #define OMAP2430_MCBSP_PDATA_SZ 0 | 122 | #define OMAP2430_MCBSP_PDATA_SZ 0 |
123 | #define OMAP2430_MCBSP_REG_NUM 0 | ||
120 | #endif | 124 | #endif |
121 | 125 | ||
122 | #ifdef CONFIG_ARCH_OMAP34XX | 126 | #ifdef CONFIG_ARCH_OMAP3 |
123 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | 127 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { |
124 | { | 128 | { |
125 | .phys_base = OMAP34XX_MCBSP1_BASE, | 129 | .phys_base = OMAP34XX_MCBSP1_BASE, |
@@ -132,6 +136,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
132 | }, | 136 | }, |
133 | { | 137 | { |
134 | .phys_base = OMAP34XX_MCBSP2_BASE, | 138 | .phys_base = OMAP34XX_MCBSP2_BASE, |
139 | .phys_base_st = OMAP34XX_MCBSP2_ST_BASE, | ||
135 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | 140 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, |
136 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | 141 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, |
137 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | 142 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, |
@@ -141,6 +146,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
141 | }, | 146 | }, |
142 | { | 147 | { |
143 | .phys_base = OMAP34XX_MCBSP3_BASE, | 148 | .phys_base = OMAP34XX_MCBSP3_BASE, |
149 | .phys_base_st = OMAP34XX_MCBSP3_ST_BASE, | ||
144 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, | 150 | .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX, |
145 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, | 151 | .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX, |
146 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | 152 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, |
@@ -168,9 +174,11 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
168 | }, | 174 | }, |
169 | }; | 175 | }; |
170 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) | 176 | #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata) |
177 | #define OMAP34XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
171 | #else | 178 | #else |
172 | #define omap34xx_mcbsp_pdata NULL | 179 | #define omap34xx_mcbsp_pdata NULL |
173 | #define OMAP34XX_MCBSP_PDATA_SZ 0 | 180 | #define OMAP34XX_MCBSP_PDATA_SZ 0 |
181 | #define OMAP34XX_MCBSP_REG_NUM 0 | ||
174 | #endif | 182 | #endif |
175 | 183 | ||
176 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | 184 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { |
@@ -208,17 +216,23 @@ static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | |||
208 | }, | 216 | }, |
209 | }; | 217 | }; |
210 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) | 218 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) |
219 | #define OMAP44XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) | ||
211 | 220 | ||
212 | static int __init omap2_mcbsp_init(void) | 221 | static int __init omap2_mcbsp_init(void) |
213 | { | 222 | { |
214 | if (cpu_is_omap2420()) | 223 | if (cpu_is_omap2420()) { |
215 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; | 224 | omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; |
216 | if (cpu_is_omap2430()) | 225 | omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16); |
226 | } else if (cpu_is_omap2430()) { | ||
217 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; | 227 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; |
218 | if (cpu_is_omap34xx()) | 228 | omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32); |
229 | } else if (cpu_is_omap34xx()) { | ||
219 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; | 230 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; |
220 | if (cpu_is_omap44xx()) | 231 | omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32); |
232 | } else if (cpu_is_omap44xx()) { | ||
221 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; | 233 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; |
234 | omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32); | ||
235 | } | ||
222 | 236 | ||
223 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 237 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
224 | GFP_KERNEL); | 238 | GFP_KERNEL); |
diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c deleted file mode 100644 index 0c3c72d934bf..000000000000 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ /dev/null | |||
@@ -1,537 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-omap2/mmc-twl4030.c | ||
3 | * | ||
4 | * Copyright (C) 2007-2008 Texas Instruments | ||
5 | * Copyright (C) 2008 Nokia Corporation | ||
6 | * Author: Texas Instruments | ||
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 | #include <linux/err.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/delay.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <linux/mmc/host.h> | ||
20 | #include <linux/regulator/consumer.h> | ||
21 | |||
22 | #include <mach/hardware.h> | ||
23 | #include <plat/control.h> | ||
24 | #include <plat/mmc.h> | ||
25 | #include <plat/board.h> | ||
26 | |||
27 | #include "mmc-twl4030.h" | ||
28 | |||
29 | |||
30 | #if defined(CONFIG_REGULATOR) && \ | ||
31 | (defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)) | ||
32 | |||
33 | static u16 control_pbias_offset; | ||
34 | static u16 control_devconf1_offset; | ||
35 | |||
36 | #define HSMMC_NAME_LEN 9 | ||
37 | |||
38 | static struct twl_mmc_controller { | ||
39 | struct omap_mmc_platform_data *mmc; | ||
40 | /* Vcc == configured supply | ||
41 | * Vcc_alt == optional | ||
42 | * - MMC1, supply for DAT4..DAT7 | ||
43 | * - MMC2/MMC2, external level shifter voltage supply, for | ||
44 | * chip (SDIO, eMMC, etc) or transceiver (MMC2 only) | ||
45 | */ | ||
46 | struct regulator *vcc; | ||
47 | struct regulator *vcc_aux; | ||
48 | char name[HSMMC_NAME_LEN + 1]; | ||
49 | } hsmmc[OMAP34XX_NR_MMC]; | ||
50 | |||
51 | static int twl_mmc_card_detect(int irq) | ||
52 | { | ||
53 | unsigned i; | ||
54 | |||
55 | for (i = 0; i < ARRAY_SIZE(hsmmc); i++) { | ||
56 | struct omap_mmc_platform_data *mmc; | ||
57 | |||
58 | mmc = hsmmc[i].mmc; | ||
59 | if (!mmc) | ||
60 | continue; | ||
61 | if (irq != mmc->slots[0].card_detect_irq) | ||
62 | continue; | ||
63 | |||
64 | /* NOTE: assumes card detect signal is active-low */ | ||
65 | return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); | ||
66 | } | ||
67 | return -ENOSYS; | ||
68 | } | ||
69 | |||
70 | static int twl_mmc_get_ro(struct device *dev, int slot) | ||
71 | { | ||
72 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
73 | |||
74 | /* NOTE: assumes write protect signal is active-high */ | ||
75 | return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); | ||
76 | } | ||
77 | |||
78 | static int twl_mmc_get_cover_state(struct device *dev, int slot) | ||
79 | { | ||
80 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
81 | |||
82 | /* NOTE: assumes card detect signal is active-low */ | ||
83 | return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); | ||
84 | } | ||
85 | |||
86 | /* | ||
87 | * MMC Slot Initialization. | ||
88 | */ | ||
89 | static int twl_mmc_late_init(struct device *dev) | ||
90 | { | ||
91 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
92 | int ret = 0; | ||
93 | int i; | ||
94 | |||
95 | /* MMC/SD/SDIO doesn't require a card detect switch */ | ||
96 | if (gpio_is_valid(mmc->slots[0].switch_pin)) { | ||
97 | ret = gpio_request(mmc->slots[0].switch_pin, "mmc_cd"); | ||
98 | if (ret) | ||
99 | goto done; | ||
100 | ret = gpio_direction_input(mmc->slots[0].switch_pin); | ||
101 | if (ret) | ||
102 | goto err; | ||
103 | } | ||
104 | |||
105 | /* require at least main regulator */ | ||
106 | for (i = 0; i < ARRAY_SIZE(hsmmc); i++) { | ||
107 | if (hsmmc[i].name == mmc->slots[0].name) { | ||
108 | struct regulator *reg; | ||
109 | |||
110 | hsmmc[i].mmc = mmc; | ||
111 | |||
112 | reg = regulator_get(dev, "vmmc"); | ||
113 | if (IS_ERR(reg)) { | ||
114 | dev_dbg(dev, "vmmc regulator missing\n"); | ||
115 | /* HACK: until fixed.c regulator is usable, | ||
116 | * we don't require a main regulator | ||
117 | * for MMC2 or MMC3 | ||
118 | */ | ||
119 | if (i != 0) | ||
120 | break; | ||
121 | ret = PTR_ERR(reg); | ||
122 | hsmmc[i].vcc = NULL; | ||
123 | goto err; | ||
124 | } | ||
125 | hsmmc[i].vcc = reg; | ||
126 | mmc->slots[0].ocr_mask = mmc_regulator_get_ocrmask(reg); | ||
127 | |||
128 | /* allow an aux regulator */ | ||
129 | reg = regulator_get(dev, "vmmc_aux"); | ||
130 | hsmmc[i].vcc_aux = IS_ERR(reg) ? NULL : reg; | ||
131 | |||
132 | /* UGLY HACK: workaround regulator framework bugs. | ||
133 | * When the bootloader leaves a supply active, it's | ||
134 | * initialized with zero usecount ... and we can't | ||
135 | * disable it without first enabling it. Until the | ||
136 | * framework is fixed, we need a workaround like this | ||
137 | * (which is safe for MMC, but not in general). | ||
138 | */ | ||
139 | if (regulator_is_enabled(hsmmc[i].vcc) > 0) { | ||
140 | regulator_enable(hsmmc[i].vcc); | ||
141 | regulator_disable(hsmmc[i].vcc); | ||
142 | } | ||
143 | if (hsmmc[i].vcc_aux) { | ||
144 | if (regulator_is_enabled(reg) > 0) { | ||
145 | regulator_enable(reg); | ||
146 | regulator_disable(reg); | ||
147 | } | ||
148 | } | ||
149 | |||
150 | break; | ||
151 | } | ||
152 | } | ||
153 | |||
154 | return 0; | ||
155 | |||
156 | err: | ||
157 | gpio_free(mmc->slots[0].switch_pin); | ||
158 | done: | ||
159 | mmc->slots[0].card_detect_irq = 0; | ||
160 | mmc->slots[0].card_detect = NULL; | ||
161 | |||
162 | dev_err(dev, "err %d configuring card detect\n", ret); | ||
163 | return ret; | ||
164 | } | ||
165 | |||
166 | static void twl_mmc_cleanup(struct device *dev) | ||
167 | { | ||
168 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
169 | int i; | ||
170 | |||
171 | gpio_free(mmc->slots[0].switch_pin); | ||
172 | for(i = 0; i < ARRAY_SIZE(hsmmc); i++) { | ||
173 | regulator_put(hsmmc[i].vcc); | ||
174 | regulator_put(hsmmc[i].vcc_aux); | ||
175 | } | ||
176 | } | ||
177 | |||
178 | #ifdef CONFIG_PM | ||
179 | |||
180 | static int twl_mmc_suspend(struct device *dev, int slot) | ||
181 | { | ||
182 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
183 | |||
184 | disable_irq(mmc->slots[0].card_detect_irq); | ||
185 | return 0; | ||
186 | } | ||
187 | |||
188 | static int twl_mmc_resume(struct device *dev, int slot) | ||
189 | { | ||
190 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
191 | |||
192 | enable_irq(mmc->slots[0].card_detect_irq); | ||
193 | return 0; | ||
194 | } | ||
195 | |||
196 | #else | ||
197 | #define twl_mmc_suspend NULL | ||
198 | #define twl_mmc_resume NULL | ||
199 | #endif | ||
200 | |||
201 | #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) | ||
202 | |||
203 | static int twl4030_mmc_get_context_loss(struct device *dev) | ||
204 | { | ||
205 | /* FIXME: PM DPS not implemented yet */ | ||
206 | return 0; | ||
207 | } | ||
208 | |||
209 | #else | ||
210 | #define twl4030_mmc_get_context_loss NULL | ||
211 | #endif | ||
212 | |||
213 | static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, | ||
214 | int vdd) | ||
215 | { | ||
216 | u32 reg, prog_io; | ||
217 | int ret = 0; | ||
218 | struct twl_mmc_controller *c = &hsmmc[0]; | ||
219 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
220 | |||
221 | /* | ||
222 | * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the | ||
223 | * card with Vcc regulator (from twl4030 or whatever). OMAP has both | ||
224 | * 1.8V and 3.0V modes, controlled by the PBIAS register. | ||
225 | * | ||
226 | * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which | ||
227 | * is most naturally TWL VSIM; those pins also use PBIAS. | ||
228 | * | ||
229 | * FIXME handle VMMC1A as needed ... | ||
230 | */ | ||
231 | if (power_on) { | ||
232 | if (cpu_is_omap2430()) { | ||
233 | reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1); | ||
234 | if ((1 << vdd) >= MMC_VDD_30_31) | ||
235 | reg |= OMAP243X_MMC1_ACTIVE_OVERWRITE; | ||
236 | else | ||
237 | reg &= ~OMAP243X_MMC1_ACTIVE_OVERWRITE; | ||
238 | omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1); | ||
239 | } | ||
240 | |||
241 | if (mmc->slots[0].internal_clock) { | ||
242 | reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); | ||
243 | reg |= OMAP2_MMCSDIO1ADPCLKISEL; | ||
244 | omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0); | ||
245 | } | ||
246 | |||
247 | reg = omap_ctrl_readl(control_pbias_offset); | ||
248 | if (cpu_is_omap3630()) { | ||
249 | /* Set MMC I/O to 52Mhz */ | ||
250 | prog_io = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1); | ||
251 | prog_io |= OMAP3630_PRG_SDMMC1_SPEEDCTRL; | ||
252 | omap_ctrl_writel(prog_io, OMAP343X_CONTROL_PROG_IO1); | ||
253 | } else { | ||
254 | reg |= OMAP2_PBIASSPEEDCTRL0; | ||
255 | } | ||
256 | reg &= ~OMAP2_PBIASLITEPWRDNZ0; | ||
257 | omap_ctrl_writel(reg, control_pbias_offset); | ||
258 | |||
259 | ret = mmc_regulator_set_ocr(c->vcc, vdd); | ||
260 | |||
261 | /* 100ms delay required for PBIAS configuration */ | ||
262 | msleep(100); | ||
263 | reg = omap_ctrl_readl(control_pbias_offset); | ||
264 | reg |= (OMAP2_PBIASLITEPWRDNZ0 | OMAP2_PBIASSPEEDCTRL0); | ||
265 | if ((1 << vdd) <= MMC_VDD_165_195) | ||
266 | reg &= ~OMAP2_PBIASLITEVMODE0; | ||
267 | else | ||
268 | reg |= OMAP2_PBIASLITEVMODE0; | ||
269 | omap_ctrl_writel(reg, control_pbias_offset); | ||
270 | } else { | ||
271 | reg = omap_ctrl_readl(control_pbias_offset); | ||
272 | reg &= ~OMAP2_PBIASLITEPWRDNZ0; | ||
273 | omap_ctrl_writel(reg, control_pbias_offset); | ||
274 | |||
275 | ret = mmc_regulator_set_ocr(c->vcc, 0); | ||
276 | |||
277 | /* 100ms delay required for PBIAS configuration */ | ||
278 | msleep(100); | ||
279 | reg = omap_ctrl_readl(control_pbias_offset); | ||
280 | reg |= (OMAP2_PBIASSPEEDCTRL0 | OMAP2_PBIASLITEPWRDNZ0 | | ||
281 | OMAP2_PBIASLITEVMODE0); | ||
282 | omap_ctrl_writel(reg, control_pbias_offset); | ||
283 | } | ||
284 | |||
285 | return ret; | ||
286 | } | ||
287 | |||
288 | static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) | ||
289 | { | ||
290 | int ret = 0; | ||
291 | struct twl_mmc_controller *c = NULL; | ||
292 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
293 | int i; | ||
294 | |||
295 | for (i = 1; i < ARRAY_SIZE(hsmmc); i++) { | ||
296 | if (mmc == hsmmc[i].mmc) { | ||
297 | c = &hsmmc[i]; | ||
298 | break; | ||
299 | } | ||
300 | } | ||
301 | |||
302 | if (c == NULL) | ||
303 | return -ENODEV; | ||
304 | |||
305 | /* If we don't see a Vcc regulator, assume it's a fixed | ||
306 | * voltage always-on regulator. | ||
307 | */ | ||
308 | if (!c->vcc) | ||
309 | return 0; | ||
310 | |||
311 | /* | ||
312 | * Assume Vcc regulator is used only to power the card ... OMAP | ||
313 | * VDDS is used to power the pins, optionally with a transceiver to | ||
314 | * support cards using voltages other than VDDS (1.8V nominal). When a | ||
315 | * transceiver is used, DAT3..7 are muxed as transceiver control pins. | ||
316 | * | ||
317 | * In some cases this regulator won't support enable/disable; | ||
318 | * e.g. it's a fixed rail for a WLAN chip. | ||
319 | * | ||
320 | * In other cases vcc_aux switches interface power. Example, for | ||
321 | * eMMC cards it represents VccQ. Sometimes transceivers or SDIO | ||
322 | * chips/cards need an interface voltage rail too. | ||
323 | */ | ||
324 | if (power_on) { | ||
325 | /* only MMC2 supports a CLKIN */ | ||
326 | if (mmc->slots[0].internal_clock) { | ||
327 | u32 reg; | ||
328 | |||
329 | reg = omap_ctrl_readl(control_devconf1_offset); | ||
330 | reg |= OMAP2_MMCSDIO2ADPCLKISEL; | ||
331 | omap_ctrl_writel(reg, control_devconf1_offset); | ||
332 | } | ||
333 | ret = mmc_regulator_set_ocr(c->vcc, vdd); | ||
334 | /* enable interface voltage rail, if needed */ | ||
335 | if (ret == 0 && c->vcc_aux) { | ||
336 | ret = regulator_enable(c->vcc_aux); | ||
337 | if (ret < 0) | ||
338 | ret = mmc_regulator_set_ocr(c->vcc, 0); | ||
339 | } | ||
340 | } else { | ||
341 | if (c->vcc_aux && (ret = regulator_is_enabled(c->vcc_aux)) > 0) | ||
342 | ret = regulator_disable(c->vcc_aux); | ||
343 | if (ret == 0) | ||
344 | ret = mmc_regulator_set_ocr(c->vcc, 0); | ||
345 | } | ||
346 | |||
347 | return ret; | ||
348 | } | ||
349 | |||
350 | static int twl_mmc1_set_sleep(struct device *dev, int slot, int sleep, int vdd, | ||
351 | int cardsleep) | ||
352 | { | ||
353 | struct twl_mmc_controller *c = &hsmmc[0]; | ||
354 | int mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL; | ||
355 | |||
356 | return regulator_set_mode(c->vcc, mode); | ||
357 | } | ||
358 | |||
359 | static int twl_mmc23_set_sleep(struct device *dev, int slot, int sleep, int vdd, | ||
360 | int cardsleep) | ||
361 | { | ||
362 | struct twl_mmc_controller *c = NULL; | ||
363 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
364 | int i, err, mode; | ||
365 | |||
366 | for (i = 1; i < ARRAY_SIZE(hsmmc); i++) { | ||
367 | if (mmc == hsmmc[i].mmc) { | ||
368 | c = &hsmmc[i]; | ||
369 | break; | ||
370 | } | ||
371 | } | ||
372 | |||
373 | if (c == NULL) | ||
374 | return -ENODEV; | ||
375 | |||
376 | /* | ||
377 | * If we don't see a Vcc regulator, assume it's a fixed | ||
378 | * voltage always-on regulator. | ||
379 | */ | ||
380 | if (!c->vcc) | ||
381 | return 0; | ||
382 | |||
383 | mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL; | ||
384 | |||
385 | if (!c->vcc_aux) | ||
386 | return regulator_set_mode(c->vcc, mode); | ||
387 | |||
388 | if (cardsleep) { | ||
389 | /* VCC can be turned off if card is asleep */ | ||
390 | struct regulator *vcc_aux = c->vcc_aux; | ||
391 | |||
392 | c->vcc_aux = NULL; | ||
393 | if (sleep) | ||
394 | err = twl_mmc23_set_power(dev, slot, 0, 0); | ||
395 | else | ||
396 | err = twl_mmc23_set_power(dev, slot, 1, vdd); | ||
397 | c->vcc_aux = vcc_aux; | ||
398 | } else | ||
399 | err = regulator_set_mode(c->vcc, mode); | ||
400 | if (err) | ||
401 | return err; | ||
402 | return regulator_set_mode(c->vcc_aux, mode); | ||
403 | } | ||
404 | |||
405 | static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; | ||
406 | |||
407 | void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) | ||
408 | { | ||
409 | struct twl4030_hsmmc_info *c; | ||
410 | int nr_hsmmc = ARRAY_SIZE(hsmmc_data); | ||
411 | |||
412 | if (cpu_is_omap2430()) { | ||
413 | control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; | ||
414 | control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; | ||
415 | nr_hsmmc = 2; | ||
416 | } else { | ||
417 | control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; | ||
418 | control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; | ||
419 | } | ||
420 | |||
421 | for (c = controllers; c->mmc; c++) { | ||
422 | struct twl_mmc_controller *twl = hsmmc + c->mmc - 1; | ||
423 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | ||
424 | |||
425 | if (!c->mmc || c->mmc > nr_hsmmc) { | ||
426 | pr_debug("MMC%d: no such controller\n", c->mmc); | ||
427 | continue; | ||
428 | } | ||
429 | if (mmc) { | ||
430 | pr_debug("MMC%d: already configured\n", c->mmc); | ||
431 | continue; | ||
432 | } | ||
433 | |||
434 | mmc = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL); | ||
435 | if (!mmc) { | ||
436 | pr_err("Cannot allocate memory for mmc device!\n"); | ||
437 | return; | ||
438 | } | ||
439 | |||
440 | if (c->name) | ||
441 | strncpy(twl->name, c->name, HSMMC_NAME_LEN); | ||
442 | else | ||
443 | snprintf(twl->name, ARRAY_SIZE(twl->name), | ||
444 | "mmc%islot%i", c->mmc, 1); | ||
445 | mmc->slots[0].name = twl->name; | ||
446 | mmc->nr_slots = 1; | ||
447 | mmc->slots[0].wires = c->wires; | ||
448 | mmc->slots[0].internal_clock = !c->ext_clock; | ||
449 | mmc->dma_mask = 0xffffffff; | ||
450 | mmc->init = twl_mmc_late_init; | ||
451 | |||
452 | /* note: twl4030 card detect GPIOs can disable VMMCx ... */ | ||
453 | if (gpio_is_valid(c->gpio_cd)) { | ||
454 | mmc->cleanup = twl_mmc_cleanup; | ||
455 | mmc->suspend = twl_mmc_suspend; | ||
456 | mmc->resume = twl_mmc_resume; | ||
457 | |||
458 | mmc->slots[0].switch_pin = c->gpio_cd; | ||
459 | mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd); | ||
460 | if (c->cover_only) | ||
461 | mmc->slots[0].get_cover_state = twl_mmc_get_cover_state; | ||
462 | else | ||
463 | mmc->slots[0].card_detect = twl_mmc_card_detect; | ||
464 | } else | ||
465 | mmc->slots[0].switch_pin = -EINVAL; | ||
466 | |||
467 | mmc->get_context_loss_count = | ||
468 | twl4030_mmc_get_context_loss; | ||
469 | |||
470 | /* write protect normally uses an OMAP gpio */ | ||
471 | if (gpio_is_valid(c->gpio_wp)) { | ||
472 | gpio_request(c->gpio_wp, "mmc_wp"); | ||
473 | gpio_direction_input(c->gpio_wp); | ||
474 | |||
475 | mmc->slots[0].gpio_wp = c->gpio_wp; | ||
476 | mmc->slots[0].get_ro = twl_mmc_get_ro; | ||
477 | } else | ||
478 | mmc->slots[0].gpio_wp = -EINVAL; | ||
479 | |||
480 | if (c->nonremovable) | ||
481 | mmc->slots[0].nonremovable = 1; | ||
482 | |||
483 | if (c->power_saving) | ||
484 | mmc->slots[0].power_saving = 1; | ||
485 | |||
486 | /* NOTE: MMC slots should have a Vcc regulator set up. | ||
487 | * This may be from a TWL4030-family chip, another | ||
488 | * controllable regulator, or a fixed supply. | ||
489 | * | ||
490 | * temporary HACK: ocr_mask instead of fixed supply | ||
491 | */ | ||
492 | mmc->slots[0].ocr_mask = c->ocr_mask; | ||
493 | |||
494 | switch (c->mmc) { | ||
495 | case 1: | ||
496 | /* on-chip level shifting via PBIAS0/PBIAS1 */ | ||
497 | mmc->slots[0].set_power = twl_mmc1_set_power; | ||
498 | mmc->slots[0].set_sleep = twl_mmc1_set_sleep; | ||
499 | |||
500 | /* Omap3630 HSMMC1 supports only 4-bit */ | ||
501 | if (cpu_is_omap3630() && c->wires > 4) { | ||
502 | c->wires = 4; | ||
503 | mmc->slots[0].wires = c->wires; | ||
504 | } | ||
505 | break; | ||
506 | case 2: | ||
507 | if (c->ext_clock) | ||
508 | c->transceiver = 1; | ||
509 | if (c->transceiver && c->wires > 4) | ||
510 | c->wires = 4; | ||
511 | /* FALLTHROUGH */ | ||
512 | case 3: | ||
513 | /* off-chip level shifting, or none */ | ||
514 | mmc->slots[0].set_power = twl_mmc23_set_power; | ||
515 | mmc->slots[0].set_sleep = twl_mmc23_set_sleep; | ||
516 | break; | ||
517 | default: | ||
518 | pr_err("MMC%d configuration not supported!\n", c->mmc); | ||
519 | kfree(mmc); | ||
520 | continue; | ||
521 | } | ||
522 | hsmmc_data[c->mmc - 1] = mmc; | ||
523 | } | ||
524 | |||
525 | omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); | ||
526 | |||
527 | /* pass the device nodes back to board setup code */ | ||
528 | for (c = controllers; c->mmc; c++) { | ||
529 | struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; | ||
530 | |||
531 | if (!c->mmc || c->mmc > nr_hsmmc) | ||
532 | continue; | ||
533 | c->dev = mmc->dev; | ||
534 | } | ||
535 | } | ||
536 | |||
537 | #endif | ||
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index e071b3fd1878..b4ca84ee0a95 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c | |||
@@ -51,7 +51,7 @@ struct omap_mux_entry { | |||
51 | static unsigned long mux_phys; | 51 | static unsigned long mux_phys; |
52 | static void __iomem *mux_base; | 52 | static void __iomem *mux_base; |
53 | 53 | ||
54 | static inline u16 omap_mux_read(u16 reg) | 54 | u16 omap_mux_read(u16 reg) |
55 | { | 55 | { |
56 | if (cpu_is_omap24xx()) | 56 | if (cpu_is_omap24xx()) |
57 | return __raw_readb(mux_base + reg); | 57 | return __raw_readb(mux_base + reg); |
@@ -59,7 +59,7 @@ static inline u16 omap_mux_read(u16 reg) | |||
59 | return __raw_readw(mux_base + reg); | 59 | return __raw_readw(mux_base + reg); |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline void omap_mux_write(u16 val, u16 reg) | 62 | void omap_mux_write(u16 val, u16 reg) |
63 | { | 63 | { |
64 | if (cpu_is_omap24xx()) | 64 | if (cpu_is_omap24xx()) |
65 | __raw_writeb(val, mux_base + reg); | 65 | __raw_writeb(val, mux_base + reg); |
@@ -67,7 +67,15 @@ static inline void omap_mux_write(u16 val, u16 reg) | |||
67 | __raw_writew(val, mux_base + reg); | 67 | __raw_writew(val, mux_base + reg); |
68 | } | 68 | } |
69 | 69 | ||
70 | #if defined(CONFIG_ARCH_OMAP24XX) && defined(CONFIG_OMAP_MUX) | 70 | void omap_mux_write_array(struct omap_board_mux *board_mux) |
71 | { | ||
72 | while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) { | ||
73 | omap_mux_write(board_mux->value, board_mux->reg_offset); | ||
74 | board_mux++; | ||
75 | } | ||
76 | } | ||
77 | |||
78 | #if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_OMAP_MUX) | ||
71 | 79 | ||
72 | static struct omap_mux_cfg arch_mux_cfg; | 80 | static struct omap_mux_cfg arch_mux_cfg; |
73 | 81 | ||
@@ -361,7 +369,7 @@ int __init omap2_mux_init(void) | |||
361 | 369 | ||
362 | /*----------------------------------------------------------------------------*/ | 370 | /*----------------------------------------------------------------------------*/ |
363 | 371 | ||
364 | #ifdef CONFIG_ARCH_OMAP34XX | 372 | #ifdef CONFIG_ARCH_OMAP3 |
365 | static LIST_HEAD(muxmodes); | 373 | static LIST_HEAD(muxmodes); |
366 | static DEFINE_MUTEX(muxmode_mutex); | 374 | static DEFINE_MUTEX(muxmode_mutex); |
367 | 375 | ||
@@ -478,7 +486,7 @@ int __init omap_mux_init_signal(char *muxname, int val) | |||
478 | static inline void omap_mux_decode(struct seq_file *s, u16 val) | 486 | static inline void omap_mux_decode(struct seq_file *s, u16 val) |
479 | { | 487 | { |
480 | char *flags[OMAP_MUX_MAX_NR_FLAGS]; | 488 | char *flags[OMAP_MUX_MAX_NR_FLAGS]; |
481 | char mode[14]; | 489 | char mode[sizeof("OMAP_MUX_MODE") + 1]; |
482 | int i = -1; | 490 | int i = -1; |
483 | 491 | ||
484 | sprintf(mode, "OMAP_MUX_MODE%d", val & 0x7); | 492 | sprintf(mode, "OMAP_MUX_MODE%d", val & 0x7); |
@@ -545,6 +553,7 @@ static int omap_mux_dbg_board_show(struct seq_file *s, void *unused) | |||
545 | if (!m0_name) | 553 | if (!m0_name) |
546 | continue; | 554 | continue; |
547 | 555 | ||
556 | /* REVISIT: Needs to be updated if mode0 names get longer */ | ||
548 | for (i = 0; i < OMAP_MUX_DEFNAME_LEN; i++) { | 557 | for (i = 0; i < OMAP_MUX_DEFNAME_LEN; i++) { |
549 | if (m0_name[i] == '\0') { | 558 | if (m0_name[i] == '\0') { |
550 | m0_def[i] = m0_name[i]; | 559 | m0_def[i] = m0_name[i]; |
@@ -833,14 +842,6 @@ static void __init omap_mux_set_cmdline_signals(void) | |||
833 | kfree(options); | 842 | kfree(options); |
834 | } | 843 | } |
835 | 844 | ||
836 | static void __init omap_mux_set_board_signals(struct omap_board_mux *board_mux) | ||
837 | { | ||
838 | while (board_mux->reg_offset != OMAP_MUX_TERMINATOR) { | ||
839 | omap_mux_write(board_mux->value, board_mux->reg_offset); | ||
840 | board_mux++; | ||
841 | } | ||
842 | } | ||
843 | |||
844 | static int __init omap_mux_copy_names(struct omap_mux *src, | 845 | static int __init omap_mux_copy_names(struct omap_mux *src, |
845 | struct omap_mux *dst) | 846 | struct omap_mux *dst) |
846 | { | 847 | { |
@@ -960,7 +961,12 @@ static void __init omap_mux_init_list(struct omap_mux *superset) | |||
960 | while (superset->reg_offset != OMAP_MUX_TERMINATOR) { | 961 | while (superset->reg_offset != OMAP_MUX_TERMINATOR) { |
961 | struct omap_mux *entry; | 962 | struct omap_mux *entry; |
962 | 963 | ||
963 | #ifndef CONFIG_OMAP_MUX | 964 | #ifdef CONFIG_OMAP_MUX |
965 | if (!superset->muxnames || !superset->muxnames[0]) { | ||
966 | superset++; | ||
967 | continue; | ||
968 | } | ||
969 | #else | ||
964 | /* Skip pins that are not muxed as GPIO by bootloader */ | 970 | /* Skip pins that are not muxed as GPIO by bootloader */ |
965 | if (!OMAP_MODE_GPIO(omap_mux_read(superset->reg_offset))) { | 971 | if (!OMAP_MODE_GPIO(omap_mux_read(superset->reg_offset))) { |
966 | superset++; | 972 | superset++; |
@@ -977,6 +983,38 @@ static void __init omap_mux_init_list(struct omap_mux *superset) | |||
977 | } | 983 | } |
978 | } | 984 | } |
979 | 985 | ||
986 | #ifdef CONFIG_OMAP_MUX | ||
987 | |||
988 | static void omap_mux_init_package(struct omap_mux *superset, | ||
989 | struct omap_mux *package_subset, | ||
990 | struct omap_ball *package_balls) | ||
991 | { | ||
992 | if (package_subset) | ||
993 | omap_mux_package_fixup(package_subset, superset); | ||
994 | if (package_balls) | ||
995 | omap_mux_package_init_balls(package_balls, superset); | ||
996 | } | ||
997 | |||
998 | static void omap_mux_init_signals(struct omap_board_mux *board_mux) | ||
999 | { | ||
1000 | omap_mux_set_cmdline_signals(); | ||
1001 | omap_mux_write_array(board_mux); | ||
1002 | } | ||
1003 | |||
1004 | #else | ||
1005 | |||
1006 | static void omap_mux_init_package(struct omap_mux *superset, | ||
1007 | struct omap_mux *package_subset, | ||
1008 | struct omap_ball *package_balls) | ||
1009 | { | ||
1010 | } | ||
1011 | |||
1012 | static void omap_mux_init_signals(struct omap_board_mux *board_mux) | ||
1013 | { | ||
1014 | } | ||
1015 | |||
1016 | #endif | ||
1017 | |||
980 | int __init omap_mux_init(u32 mux_pbase, u32 mux_size, | 1018 | int __init omap_mux_init(u32 mux_pbase, u32 mux_size, |
981 | struct omap_mux *superset, | 1019 | struct omap_mux *superset, |
982 | struct omap_mux *package_subset, | 1020 | struct omap_mux *package_subset, |
@@ -993,17 +1031,12 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size, | |||
993 | return -ENODEV; | 1031 | return -ENODEV; |
994 | } | 1032 | } |
995 | 1033 | ||
996 | #ifdef CONFIG_OMAP_MUX | 1034 | omap_mux_init_package(superset, package_subset, package_balls); |
997 | omap_mux_package_fixup(package_subset, superset); | ||
998 | omap_mux_package_init_balls(package_balls, superset); | ||
999 | omap_mux_set_cmdline_signals(); | ||
1000 | omap_mux_set_board_signals(board_mux); | ||
1001 | #endif | ||
1002 | |||
1003 | omap_mux_init_list(superset); | 1035 | omap_mux_init_list(superset); |
1036 | omap_mux_init_signals(board_mux); | ||
1004 | 1037 | ||
1005 | return 0; | 1038 | return 0; |
1006 | } | 1039 | } |
1007 | 1040 | ||
1008 | #endif /* CONFIG_ARCH_OMAP34XX */ | 1041 | #endif /* CONFIG_ARCH_OMAP3 */ |
1009 | 1042 | ||
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index d8b4d5ad2278..480abc56e605 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h | |||
@@ -102,7 +102,7 @@ struct omap_board_mux { | |||
102 | u16 value; | 102 | u16 value; |
103 | }; | 103 | }; |
104 | 104 | ||
105 | #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_ARCH_OMAP34XX) | 105 | #if defined(CONFIG_OMAP_MUX) && defined(CONFIG_ARCH_OMAP3) |
106 | 106 | ||
107 | /** | 107 | /** |
108 | * omap_mux_init_gpio - initialize a signal based on the GPIO number | 108 | * omap_mux_init_gpio - initialize a signal based on the GPIO number |
@@ -147,6 +147,30 @@ u16 omap_mux_get_gpio(int gpio); | |||
147 | void omap_mux_set_gpio(u16 val, int gpio); | 147 | void omap_mux_set_gpio(u16 val, int gpio); |
148 | 148 | ||
149 | /** | 149 | /** |
150 | * omap_mux_read() - read mux register | ||
151 | * @mux_offset: Offset of the mux register | ||
152 | * | ||
153 | */ | ||
154 | u16 omap_mux_read(u16 mux_offset); | ||
155 | |||
156 | /** | ||
157 | * omap_mux_write() - write mux register | ||
158 | * @val: New mux register value | ||
159 | * @mux_offset: Offset of the mux register | ||
160 | * | ||
161 | * This should be only needed for dynamic remuxing of non-gpio signals. | ||
162 | */ | ||
163 | void omap_mux_write(u16 val, u16 mux_offset); | ||
164 | |||
165 | /** | ||
166 | * omap_mux_write_array() - write an array of mux registers | ||
167 | * @board_mux: Array of mux registers terminated by MAP_MUX_TERMINATOR | ||
168 | * | ||
169 | * This should be only needed for dynamic remuxing of non-gpio signals. | ||
170 | */ | ||
171 | void omap_mux_write_array(struct omap_board_mux *board_mux); | ||
172 | |||
173 | /** | ||
150 | * omap3_mux_init() - initialize mux system with board specific set | 174 | * omap3_mux_init() - initialize mux system with board specific set |
151 | * @board_mux: Board specific mux table | 175 | * @board_mux: Board specific mux table |
152 | * @flags: OMAP package type used for the board | 176 | * @flags: OMAP package type used for the board |
diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c index 68e0a595f9a1..07aa7b3c95f7 100644 --- a/arch/arm/mach-omap2/mux34xx.c +++ b/arch/arm/mach-omap2/mux34xx.c | |||
@@ -649,6 +649,53 @@ static struct omap_mux __initdata omap3_muxmodes[] = { | |||
649 | _OMAP3_MUXENTRY(UART3_TX_IRTX, 166, | 649 | _OMAP3_MUXENTRY(UART3_TX_IRTX, 166, |
650 | "uart3_tx_irtx", NULL, NULL, NULL, | 650 | "uart3_tx_irtx", NULL, NULL, NULL, |
651 | "gpio_166", NULL, NULL, "safe_mode"), | 651 | "gpio_166", NULL, NULL, "safe_mode"), |
652 | |||
653 | /* Only on 3630, see omap36xx_cbp_subset for the signals */ | ||
654 | _OMAP3_MUXENTRY(GPMC_A11, 0, | ||
655 | NULL, NULL, NULL, NULL, | ||
656 | NULL, NULL, NULL, NULL), | ||
657 | _OMAP3_MUXENTRY(SAD2D_MBUSFLAG, 0, | ||
658 | NULL, NULL, NULL, NULL, | ||
659 | NULL, NULL, NULL, NULL), | ||
660 | _OMAP3_MUXENTRY(SAD2D_MREAD, 0, | ||
661 | NULL, NULL, NULL, NULL, | ||
662 | NULL, NULL, NULL, NULL), | ||
663 | _OMAP3_MUXENTRY(SAD2D_MWRITE, 0, | ||
664 | NULL, NULL, NULL, NULL, | ||
665 | NULL, NULL, NULL, NULL), | ||
666 | _OMAP3_MUXENTRY(SAD2D_SBUSFLAG, 0, | ||
667 | NULL, NULL, NULL, NULL, | ||
668 | NULL, NULL, NULL, NULL), | ||
669 | _OMAP3_MUXENTRY(SAD2D_SREAD, 0, | ||
670 | NULL, NULL, NULL, NULL, | ||
671 | NULL, NULL, NULL, NULL), | ||
672 | _OMAP3_MUXENTRY(SAD2D_SWRITE, 0, | ||
673 | NULL, NULL, NULL, NULL, | ||
674 | NULL, NULL, NULL, NULL), | ||
675 | _OMAP3_MUXENTRY(GPMC_A11, 0, | ||
676 | NULL, NULL, NULL, NULL, | ||
677 | NULL, NULL, NULL, NULL), | ||
678 | _OMAP3_MUXENTRY(SAD2D_MCAD28, 0, | ||
679 | NULL, NULL, NULL, NULL, | ||
680 | NULL, NULL, NULL, NULL), | ||
681 | _OMAP3_MUXENTRY(SAD2D_MCAD29, 0, | ||
682 | NULL, NULL, NULL, NULL, | ||
683 | NULL, NULL, NULL, NULL), | ||
684 | _OMAP3_MUXENTRY(SAD2D_MCAD32, 0, | ||
685 | NULL, NULL, NULL, NULL, | ||
686 | NULL, NULL, NULL, NULL), | ||
687 | _OMAP3_MUXENTRY(SAD2D_MCAD33, 0, | ||
688 | NULL, NULL, NULL, NULL, | ||
689 | NULL, NULL, NULL, NULL), | ||
690 | _OMAP3_MUXENTRY(SAD2D_MCAD34, 0, | ||
691 | NULL, NULL, NULL, NULL, | ||
692 | NULL, NULL, NULL, NULL), | ||
693 | _OMAP3_MUXENTRY(SAD2D_MCAD35, 0, | ||
694 | NULL, NULL, NULL, NULL, | ||
695 | NULL, NULL, NULL, NULL), | ||
696 | _OMAP3_MUXENTRY(SAD2D_MCAD36, 0, | ||
697 | NULL, NULL, NULL, NULL, | ||
698 | NULL, NULL, NULL, NULL), | ||
652 | { .reg_offset = OMAP_MUX_TERMINATOR }, | 699 | { .reg_offset = OMAP_MUX_TERMINATOR }, |
653 | }; | 700 | }; |
654 | 701 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index d8c8545875b1..c6649472ce0d 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -84,17 +84,17 @@ static u8 inited; | |||
84 | */ | 84 | */ |
85 | static int _update_sysc_cache(struct omap_hwmod *oh) | 85 | static int _update_sysc_cache(struct omap_hwmod *oh) |
86 | { | 86 | { |
87 | if (!oh->sysconfig) { | 87 | if (!oh->class->sysc) { |
88 | WARN(!oh->sysconfig, "omap_hwmod: %s: cannot read " | 88 | WARN(1, "omap_hwmod: %s: cannot read OCP_SYSCONFIG: not defined on hwmod's class\n", oh->name); |
89 | "OCP_SYSCONFIG: not defined on hwmod\n", oh->name); | ||
90 | return -EINVAL; | 89 | return -EINVAL; |
91 | } | 90 | } |
92 | 91 | ||
93 | /* XXX ensure module interface clock is up */ | 92 | /* XXX ensure module interface clock is up */ |
94 | 93 | ||
95 | oh->_sysc_cache = omap_hwmod_readl(oh, oh->sysconfig->sysc_offs); | 94 | oh->_sysc_cache = omap_hwmod_readl(oh, oh->class->sysc->sysc_offs); |
96 | 95 | ||
97 | oh->_int_flags |= _HWMOD_SYSCONFIG_LOADED; | 96 | if (!(oh->class->sysc->sysc_flags & SYSC_NO_CACHE)) |
97 | oh->_int_flags |= _HWMOD_SYSCONFIG_LOADED; | ||
98 | 98 | ||
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
@@ -104,14 +104,13 @@ static int _update_sysc_cache(struct omap_hwmod *oh) | |||
104 | * @v: OCP_SYSCONFIG value to write | 104 | * @v: OCP_SYSCONFIG value to write |
105 | * @oh: struct omap_hwmod * | 105 | * @oh: struct omap_hwmod * |
106 | * | 106 | * |
107 | * Write @v into the module OCP_SYSCONFIG register, if it has one. No | 107 | * Write @v into the module class' OCP_SYSCONFIG register, if it has |
108 | * return value. | 108 | * one. No return value. |
109 | */ | 109 | */ |
110 | static void _write_sysconfig(u32 v, struct omap_hwmod *oh) | 110 | static void _write_sysconfig(u32 v, struct omap_hwmod *oh) |
111 | { | 111 | { |
112 | if (!oh->sysconfig) { | 112 | if (!oh->class->sysc) { |
113 | WARN(!oh->sysconfig, "omap_hwmod: %s: cannot write " | 113 | WARN(1, "omap_hwmod: %s: cannot write OCP_SYSCONFIG: not defined on hwmod's class\n", oh->name); |
114 | "OCP_SYSCONFIG: not defined on hwmod\n", oh->name); | ||
115 | return; | 114 | return; |
116 | } | 115 | } |
117 | 116 | ||
@@ -119,7 +118,7 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh) | |||
119 | 118 | ||
120 | if (oh->_sysc_cache != v) { | 119 | if (oh->_sysc_cache != v) { |
121 | oh->_sysc_cache = v; | 120 | oh->_sysc_cache = v; |
122 | omap_hwmod_writel(v, oh, oh->sysconfig->sysc_offs); | 121 | omap_hwmod_writel(v, oh, oh->class->sysc->sysc_offs); |
123 | } | 122 | } |
124 | } | 123 | } |
125 | 124 | ||
@@ -136,12 +135,23 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh) | |||
136 | static int _set_master_standbymode(struct omap_hwmod *oh, u8 standbymode, | 135 | static int _set_master_standbymode(struct omap_hwmod *oh, u8 standbymode, |
137 | u32 *v) | 136 | u32 *v) |
138 | { | 137 | { |
139 | if (!oh->sysconfig || | 138 | u32 mstandby_mask; |
140 | !(oh->sysconfig->sysc_flags & SYSC_HAS_MIDLEMODE)) | 139 | u8 mstandby_shift; |
140 | |||
141 | if (!oh->class->sysc || | ||
142 | !(oh->class->sysc->sysc_flags & SYSC_HAS_MIDLEMODE)) | ||
143 | return -EINVAL; | ||
144 | |||
145 | if (!oh->class->sysc->sysc_fields) { | ||
146 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); | ||
141 | return -EINVAL; | 147 | return -EINVAL; |
148 | } | ||
149 | |||
150 | mstandby_shift = oh->class->sysc->sysc_fields->midle_shift; | ||
151 | mstandby_mask = (0x3 << mstandby_shift); | ||
142 | 152 | ||
143 | *v &= ~SYSC_MIDLEMODE_MASK; | 153 | *v &= ~mstandby_mask; |
144 | *v |= __ffs(standbymode) << SYSC_MIDLEMODE_SHIFT; | 154 | *v |= __ffs(standbymode) << mstandby_shift; |
145 | 155 | ||
146 | return 0; | 156 | return 0; |
147 | } | 157 | } |
@@ -158,12 +168,23 @@ static int _set_master_standbymode(struct omap_hwmod *oh, u8 standbymode, | |||
158 | */ | 168 | */ |
159 | static int _set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode, u32 *v) | 169 | static int _set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode, u32 *v) |
160 | { | 170 | { |
161 | if (!oh->sysconfig || | 171 | u32 sidle_mask; |
162 | !(oh->sysconfig->sysc_flags & SYSC_HAS_SIDLEMODE)) | 172 | u8 sidle_shift; |
173 | |||
174 | if (!oh->class->sysc || | ||
175 | !(oh->class->sysc->sysc_flags & SYSC_HAS_SIDLEMODE)) | ||
176 | return -EINVAL; | ||
177 | |||
178 | if (!oh->class->sysc->sysc_fields) { | ||
179 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); | ||
163 | return -EINVAL; | 180 | return -EINVAL; |
181 | } | ||
164 | 182 | ||
165 | *v &= ~SYSC_SIDLEMODE_MASK; | 183 | sidle_shift = oh->class->sysc->sysc_fields->sidle_shift; |
166 | *v |= __ffs(idlemode) << SYSC_SIDLEMODE_SHIFT; | 184 | sidle_mask = (0x3 << sidle_shift); |
185 | |||
186 | *v &= ~sidle_mask; | ||
187 | *v |= __ffs(idlemode) << sidle_shift; | ||
167 | 188 | ||
168 | return 0; | 189 | return 0; |
169 | } | 190 | } |
@@ -181,12 +202,23 @@ static int _set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode, u32 *v) | |||
181 | */ | 202 | */ |
182 | static int _set_clockactivity(struct omap_hwmod *oh, u8 clockact, u32 *v) | 203 | static int _set_clockactivity(struct omap_hwmod *oh, u8 clockact, u32 *v) |
183 | { | 204 | { |
184 | if (!oh->sysconfig || | 205 | u32 clkact_mask; |
185 | !(oh->sysconfig->sysc_flags & SYSC_HAS_CLOCKACTIVITY)) | 206 | u8 clkact_shift; |
207 | |||
208 | if (!oh->class->sysc || | ||
209 | !(oh->class->sysc->sysc_flags & SYSC_HAS_CLOCKACTIVITY)) | ||
186 | return -EINVAL; | 210 | return -EINVAL; |
187 | 211 | ||
188 | *v &= ~SYSC_CLOCKACTIVITY_MASK; | 212 | if (!oh->class->sysc->sysc_fields) { |
189 | *v |= clockact << SYSC_CLOCKACTIVITY_SHIFT; | 213 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); |
214 | return -EINVAL; | ||
215 | } | ||
216 | |||
217 | clkact_shift = oh->class->sysc->sysc_fields->clkact_shift; | ||
218 | clkact_mask = (0x3 << clkact_shift); | ||
219 | |||
220 | *v &= ~clkact_mask; | ||
221 | *v |= clockact << clkact_shift; | ||
190 | 222 | ||
191 | return 0; | 223 | return 0; |
192 | } | 224 | } |
@@ -201,11 +233,20 @@ static int _set_clockactivity(struct omap_hwmod *oh, u8 clockact, u32 *v) | |||
201 | */ | 233 | */ |
202 | static int _set_softreset(struct omap_hwmod *oh, u32 *v) | 234 | static int _set_softreset(struct omap_hwmod *oh, u32 *v) |
203 | { | 235 | { |
204 | if (!oh->sysconfig || | 236 | u32 softrst_mask; |
205 | !(oh->sysconfig->sysc_flags & SYSC_HAS_SOFTRESET)) | 237 | |
238 | if (!oh->class->sysc || | ||
239 | !(oh->class->sysc->sysc_flags & SYSC_HAS_SOFTRESET)) | ||
206 | return -EINVAL; | 240 | return -EINVAL; |
207 | 241 | ||
208 | *v |= SYSC_SOFTRESET_MASK; | 242 | if (!oh->class->sysc->sysc_fields) { |
243 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); | ||
244 | return -EINVAL; | ||
245 | } | ||
246 | |||
247 | softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift); | ||
248 | |||
249 | *v |= softrst_mask; | ||
209 | 250 | ||
210 | return 0; | 251 | return 0; |
211 | } | 252 | } |
@@ -226,12 +267,23 @@ static int _set_softreset(struct omap_hwmod *oh, u32 *v) | |||
226 | static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle, | 267 | static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle, |
227 | u32 *v) | 268 | u32 *v) |
228 | { | 269 | { |
229 | if (!oh->sysconfig || | 270 | u32 autoidle_mask; |
230 | !(oh->sysconfig->sysc_flags & SYSC_HAS_AUTOIDLE)) | 271 | u8 autoidle_shift; |
272 | |||
273 | if (!oh->class->sysc || | ||
274 | !(oh->class->sysc->sysc_flags & SYSC_HAS_AUTOIDLE)) | ||
231 | return -EINVAL; | 275 | return -EINVAL; |
232 | 276 | ||
233 | *v &= ~SYSC_AUTOIDLE_MASK; | 277 | if (!oh->class->sysc->sysc_fields) { |
234 | *v |= autoidle << SYSC_AUTOIDLE_SHIFT; | 278 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); |
279 | return -EINVAL; | ||
280 | } | ||
281 | |||
282 | autoidle_shift = oh->class->sysc->sysc_fields->autoidle_shift; | ||
283 | autoidle_mask = (0x3 << autoidle_shift); | ||
284 | |||
285 | *v &= ~autoidle_mask; | ||
286 | *v |= autoidle << autoidle_shift; | ||
235 | 287 | ||
236 | return 0; | 288 | return 0; |
237 | } | 289 | } |
@@ -245,14 +297,21 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle, | |||
245 | */ | 297 | */ |
246 | static int _enable_wakeup(struct omap_hwmod *oh) | 298 | static int _enable_wakeup(struct omap_hwmod *oh) |
247 | { | 299 | { |
248 | u32 v; | 300 | u32 v, wakeup_mask; |
249 | 301 | ||
250 | if (!oh->sysconfig || | 302 | if (!oh->class->sysc || |
251 | !(oh->sysconfig->sysc_flags & SYSC_HAS_ENAWAKEUP)) | 303 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) |
252 | return -EINVAL; | 304 | return -EINVAL; |
253 | 305 | ||
306 | if (!oh->class->sysc->sysc_fields) { | ||
307 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); | ||
308 | return -EINVAL; | ||
309 | } | ||
310 | |||
311 | wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); | ||
312 | |||
254 | v = oh->_sysc_cache; | 313 | v = oh->_sysc_cache; |
255 | v |= SYSC_ENAWAKEUP_MASK; | 314 | v |= wakeup_mask; |
256 | _write_sysconfig(v, oh); | 315 | _write_sysconfig(v, oh); |
257 | 316 | ||
258 | /* XXX test pwrdm_get_wken for this hwmod's subsystem */ | 317 | /* XXX test pwrdm_get_wken for this hwmod's subsystem */ |
@@ -271,14 +330,21 @@ static int _enable_wakeup(struct omap_hwmod *oh) | |||
271 | */ | 330 | */ |
272 | static int _disable_wakeup(struct omap_hwmod *oh) | 331 | static int _disable_wakeup(struct omap_hwmod *oh) |
273 | { | 332 | { |
274 | u32 v; | 333 | u32 v, wakeup_mask; |
275 | 334 | ||
276 | if (!oh->sysconfig || | 335 | if (!oh->class->sysc || |
277 | !(oh->sysconfig->sysc_flags & SYSC_HAS_ENAWAKEUP)) | 336 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) |
278 | return -EINVAL; | 337 | return -EINVAL; |
279 | 338 | ||
339 | if (!oh->class->sysc->sysc_fields) { | ||
340 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); | ||
341 | return -EINVAL; | ||
342 | } | ||
343 | |||
344 | wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); | ||
345 | |||
280 | v = oh->_sysc_cache; | 346 | v = oh->_sysc_cache; |
281 | v &= ~SYSC_ENAWAKEUP_MASK; | 347 | v &= ~wakeup_mask; |
282 | _write_sysconfig(v, oh); | 348 | _write_sysconfig(v, oh); |
283 | 349 | ||
284 | /* XXX test pwrdm_get_wken for this hwmod's subsystem */ | 350 | /* XXX test pwrdm_get_wken for this hwmod's subsystem */ |
@@ -298,15 +364,14 @@ static int _disable_wakeup(struct omap_hwmod *oh) | |||
298 | * be accessed by the IVA, there should be a sleepdep between the IVA | 364 | * be accessed by the IVA, there should be a sleepdep between the IVA |
299 | * initiator and the module). Only applies to modules in smart-idle | 365 | * initiator and the module). Only applies to modules in smart-idle |
300 | * mode. Returns -EINVAL upon error or passes along | 366 | * mode. Returns -EINVAL upon error or passes along |
301 | * pwrdm_add_sleepdep() value upon success. | 367 | * clkdm_add_sleepdep() value upon success. |
302 | */ | 368 | */ |
303 | static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | 369 | static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) |
304 | { | 370 | { |
305 | if (!oh->_clk) | 371 | if (!oh->_clk) |
306 | return -EINVAL; | 372 | return -EINVAL; |
307 | 373 | ||
308 | return pwrdm_add_sleepdep(oh->_clk->clkdm->pwrdm.ptr, | 374 | return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); |
309 | init_oh->_clk->clkdm->pwrdm.ptr); | ||
310 | } | 375 | } |
311 | 376 | ||
312 | /** | 377 | /** |
@@ -319,15 +384,14 @@ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | |||
319 | * be accessed by the IVA, there should be no sleepdep between the IVA | 384 | * be accessed by the IVA, there should be no sleepdep between the IVA |
320 | * initiator and the module). Only applies to modules in smart-idle | 385 | * initiator and the module). Only applies to modules in smart-idle |
321 | * mode. Returns -EINVAL upon error or passes along | 386 | * mode. Returns -EINVAL upon error or passes along |
322 | * pwrdm_add_sleepdep() value upon success. | 387 | * clkdm_del_sleepdep() value upon success. |
323 | */ | 388 | */ |
324 | static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) | 389 | static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) |
325 | { | 390 | { |
326 | if (!oh->_clk) | 391 | if (!oh->_clk) |
327 | return -EINVAL; | 392 | return -EINVAL; |
328 | 393 | ||
329 | return pwrdm_del_sleepdep(oh->_clk->clkdm->pwrdm.ptr, | 394 | return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); |
330 | init_oh->_clk->clkdm->pwrdm.ptr); | ||
331 | } | 395 | } |
332 | 396 | ||
333 | /** | 397 | /** |
@@ -343,18 +407,18 @@ static int _init_main_clk(struct omap_hwmod *oh) | |||
343 | struct clk *c; | 407 | struct clk *c; |
344 | int ret = 0; | 408 | int ret = 0; |
345 | 409 | ||
346 | if (!oh->clkdev_con_id) | 410 | if (!oh->main_clk) |
347 | return 0; | 411 | return 0; |
348 | 412 | ||
349 | c = clk_get_sys(oh->clkdev_dev_id, oh->clkdev_con_id); | 413 | c = omap_clk_get_by_name(oh->main_clk); |
350 | WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s.%s\n", | 414 | WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get main_clk %s\n", |
351 | oh->name, oh->clkdev_dev_id, oh->clkdev_con_id); | 415 | oh->name, oh->main_clk); |
352 | if (IS_ERR(c)) | 416 | if (IS_ERR(c)) |
353 | ret = -EINVAL; | 417 | ret = -EINVAL; |
354 | oh->_clk = c; | 418 | oh->_clk = c; |
355 | 419 | ||
356 | WARN(!c->clkdm, "omap_hwmod: %s: missing clockdomain for %s.\n", | 420 | WARN(!c->clkdm, "omap_hwmod: %s: missing clockdomain for %s.\n", |
357 | oh->clkdev_con_id, c->name); | 421 | oh->main_clk, c->name); |
358 | 422 | ||
359 | return ret; | 423 | return ret; |
360 | } | 424 | } |
@@ -377,13 +441,12 @@ static int _init_interface_clks(struct omap_hwmod *oh) | |||
377 | return 0; | 441 | return 0; |
378 | 442 | ||
379 | for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) { | 443 | for (i = 0, os = *oh->slaves; i < oh->slaves_cnt; i++, os++) { |
380 | if (!os->clkdev_con_id) | 444 | if (!os->clk) |
381 | continue; | 445 | continue; |
382 | 446 | ||
383 | c = clk_get_sys(os->clkdev_dev_id, os->clkdev_con_id); | 447 | c = omap_clk_get_by_name(os->clk); |
384 | WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get " | 448 | WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get " |
385 | "interface_clk %s.%s\n", oh->name, | 449 | "interface_clk %s\n", oh->name, os->clk); |
386 | os->clkdev_dev_id, os->clkdev_con_id); | ||
387 | if (IS_ERR(c)) | 450 | if (IS_ERR(c)) |
388 | ret = -EINVAL; | 451 | ret = -EINVAL; |
389 | os->_clk = c; | 452 | os->_clk = c; |
@@ -407,10 +470,9 @@ static int _init_opt_clks(struct omap_hwmod *oh) | |||
407 | int ret = 0; | 470 | int ret = 0; |
408 | 471 | ||
409 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { | 472 | for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { |
410 | c = clk_get_sys(oc->clkdev_dev_id, oc->clkdev_con_id); | 473 | c = omap_clk_get_by_name(oc->clk); |
411 | WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get opt_clk " | 474 | WARN(IS_ERR(c), "omap_hwmod: %s: cannot clk_get opt_clk " |
412 | "%s.%s\n", oh->name, oc->clkdev_dev_id, | 475 | "%s\n", oh->name, oc->clk); |
413 | oc->clkdev_con_id); | ||
414 | if (IS_ERR(c)) | 476 | if (IS_ERR(c)) |
415 | ret = -EINVAL; | 477 | ret = -EINVAL; |
416 | oc->_clk = c; | 478 | oc->_clk = c; |
@@ -567,27 +629,28 @@ static void __iomem *_find_mpu_rt_base(struct omap_hwmod *oh, u8 index) | |||
567 | */ | 629 | */ |
568 | static void _sysc_enable(struct omap_hwmod *oh) | 630 | static void _sysc_enable(struct omap_hwmod *oh) |
569 | { | 631 | { |
570 | u8 idlemode; | 632 | u8 idlemode, sf; |
571 | u32 v; | 633 | u32 v; |
572 | 634 | ||
573 | if (!oh->sysconfig) | 635 | if (!oh->class->sysc) |
574 | return; | 636 | return; |
575 | 637 | ||
576 | v = oh->_sysc_cache; | 638 | v = oh->_sysc_cache; |
639 | sf = oh->class->sysc->sysc_flags; | ||
577 | 640 | ||
578 | if (oh->sysconfig->sysc_flags & SYSC_HAS_SIDLEMODE) { | 641 | if (sf & SYSC_HAS_SIDLEMODE) { |
579 | idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? | 642 | idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? |
580 | HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; | 643 | HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; |
581 | _set_slave_idlemode(oh, idlemode, &v); | 644 | _set_slave_idlemode(oh, idlemode, &v); |
582 | } | 645 | } |
583 | 646 | ||
584 | if (oh->sysconfig->sysc_flags & SYSC_HAS_MIDLEMODE) { | 647 | if (sf & SYSC_HAS_MIDLEMODE) { |
585 | idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? | 648 | idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? |
586 | HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; | 649 | HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART; |
587 | _set_master_standbymode(oh, idlemode, &v); | 650 | _set_master_standbymode(oh, idlemode, &v); |
588 | } | 651 | } |
589 | 652 | ||
590 | if (oh->sysconfig->sysc_flags & SYSC_HAS_AUTOIDLE) { | 653 | if (sf & SYSC_HAS_AUTOIDLE) { |
591 | idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ? | 654 | idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ? |
592 | 0 : 1; | 655 | 0 : 1; |
593 | _set_module_autoidle(oh, idlemode, &v); | 656 | _set_module_autoidle(oh, idlemode, &v); |
@@ -600,9 +663,9 @@ static void _sysc_enable(struct omap_hwmod *oh) | |||
600 | * calling into this code. But this must wait until the | 663 | * calling into this code. But this must wait until the |
601 | * clock structures are tagged with omap_hwmod entries | 664 | * clock structures are tagged with omap_hwmod entries |
602 | */ | 665 | */ |
603 | if (oh->flags & HWMOD_SET_DEFAULT_CLOCKACT && | 666 | if ((oh->flags & HWMOD_SET_DEFAULT_CLOCKACT) && |
604 | oh->sysconfig->sysc_flags & SYSC_HAS_CLOCKACTIVITY) | 667 | (sf & SYSC_HAS_CLOCKACTIVITY)) |
605 | _set_clockactivity(oh, oh->sysconfig->clockact, &v); | 668 | _set_clockactivity(oh, oh->class->sysc->clockact, &v); |
606 | 669 | ||
607 | _write_sysconfig(v, oh); | 670 | _write_sysconfig(v, oh); |
608 | } | 671 | } |
@@ -618,21 +681,22 @@ static void _sysc_enable(struct omap_hwmod *oh) | |||
618 | */ | 681 | */ |
619 | static void _sysc_idle(struct omap_hwmod *oh) | 682 | static void _sysc_idle(struct omap_hwmod *oh) |
620 | { | 683 | { |
621 | u8 idlemode; | 684 | u8 idlemode, sf; |
622 | u32 v; | 685 | u32 v; |
623 | 686 | ||
624 | if (!oh->sysconfig) | 687 | if (!oh->class->sysc) |
625 | return; | 688 | return; |
626 | 689 | ||
627 | v = oh->_sysc_cache; | 690 | v = oh->_sysc_cache; |
691 | sf = oh->class->sysc->sysc_flags; | ||
628 | 692 | ||
629 | if (oh->sysconfig->sysc_flags & SYSC_HAS_SIDLEMODE) { | 693 | if (sf & SYSC_HAS_SIDLEMODE) { |
630 | idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? | 694 | idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ? |
631 | HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; | 695 | HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; |
632 | _set_slave_idlemode(oh, idlemode, &v); | 696 | _set_slave_idlemode(oh, idlemode, &v); |
633 | } | 697 | } |
634 | 698 | ||
635 | if (oh->sysconfig->sysc_flags & SYSC_HAS_MIDLEMODE) { | 699 | if (sf & SYSC_HAS_MIDLEMODE) { |
636 | idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? | 700 | idlemode = (oh->flags & HWMOD_SWSUP_MSTANDBY) ? |
637 | HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; | 701 | HWMOD_IDLEMODE_FORCE : HWMOD_IDLEMODE_SMART; |
638 | _set_master_standbymode(oh, idlemode, &v); | 702 | _set_master_standbymode(oh, idlemode, &v); |
@@ -651,19 +715,21 @@ static void _sysc_idle(struct omap_hwmod *oh) | |||
651 | static void _sysc_shutdown(struct omap_hwmod *oh) | 715 | static void _sysc_shutdown(struct omap_hwmod *oh) |
652 | { | 716 | { |
653 | u32 v; | 717 | u32 v; |
718 | u8 sf; | ||
654 | 719 | ||
655 | if (!oh->sysconfig) | 720 | if (!oh->class->sysc) |
656 | return; | 721 | return; |
657 | 722 | ||
658 | v = oh->_sysc_cache; | 723 | v = oh->_sysc_cache; |
724 | sf = oh->class->sysc->sysc_flags; | ||
659 | 725 | ||
660 | if (oh->sysconfig->sysc_flags & SYSC_HAS_SIDLEMODE) | 726 | if (sf & SYSC_HAS_SIDLEMODE) |
661 | _set_slave_idlemode(oh, HWMOD_IDLEMODE_FORCE, &v); | 727 | _set_slave_idlemode(oh, HWMOD_IDLEMODE_FORCE, &v); |
662 | 728 | ||
663 | if (oh->sysconfig->sysc_flags & SYSC_HAS_MIDLEMODE) | 729 | if (sf & SYSC_HAS_MIDLEMODE) |
664 | _set_master_standbymode(oh, HWMOD_IDLEMODE_FORCE, &v); | 730 | _set_master_standbymode(oh, HWMOD_IDLEMODE_FORCE, &v); |
665 | 731 | ||
666 | if (oh->sysconfig->sysc_flags & SYSC_HAS_AUTOIDLE) | 732 | if (sf & SYSC_HAS_AUTOIDLE) |
667 | _set_module_autoidle(oh, 1, &v); | 733 | _set_module_autoidle(oh, 1, &v); |
668 | 734 | ||
669 | _write_sysconfig(v, oh); | 735 | _write_sysconfig(v, oh); |
@@ -780,9 +846,9 @@ static int _reset(struct omap_hwmod *oh) | |||
780 | u32 r, v; | 846 | u32 r, v; |
781 | int c = 0; | 847 | int c = 0; |
782 | 848 | ||
783 | if (!oh->sysconfig || | 849 | if (!oh->class->sysc || |
784 | !(oh->sysconfig->sysc_flags & SYSC_HAS_SOFTRESET) || | 850 | !(oh->class->sysc->sysc_flags & SYSC_HAS_SOFTRESET) || |
785 | (oh->sysconfig->sysc_flags & SYSS_MISSING)) | 851 | (oh->class->sysc->sysc_flags & SYSS_MISSING)) |
786 | return -EINVAL; | 852 | return -EINVAL; |
787 | 853 | ||
788 | /* clocks must be on for this operation */ | 854 | /* clocks must be on for this operation */ |
@@ -800,7 +866,7 @@ static int _reset(struct omap_hwmod *oh) | |||
800 | return r; | 866 | return r; |
801 | _write_sysconfig(v, oh); | 867 | _write_sysconfig(v, oh); |
802 | 868 | ||
803 | omap_test_timeout((omap_hwmod_readl(oh, oh->sysconfig->syss_offs) & | 869 | omap_test_timeout((omap_hwmod_readl(oh, oh->class->sysc->syss_offs) & |
804 | SYSS_RESETDONE_MASK), | 870 | SYSS_RESETDONE_MASK), |
805 | MAX_MODULE_RESET_WAIT, c); | 871 | MAX_MODULE_RESET_WAIT, c); |
806 | 872 | ||
@@ -846,7 +912,7 @@ static int _enable(struct omap_hwmod *oh) | |||
846 | _add_initiator_dep(oh, mpu_oh); | 912 | _add_initiator_dep(oh, mpu_oh); |
847 | _enable_clocks(oh); | 913 | _enable_clocks(oh); |
848 | 914 | ||
849 | if (oh->sysconfig) { | 915 | if (oh->class->sysc) { |
850 | if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED)) | 916 | if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED)) |
851 | _update_sysc_cache(oh); | 917 | _update_sysc_cache(oh); |
852 | _sysc_enable(oh); | 918 | _sysc_enable(oh); |
@@ -877,7 +943,7 @@ static int _idle(struct omap_hwmod *oh) | |||
877 | 943 | ||
878 | pr_debug("omap_hwmod: %s: idling\n", oh->name); | 944 | pr_debug("omap_hwmod: %s: idling\n", oh->name); |
879 | 945 | ||
880 | if (oh->sysconfig) | 946 | if (oh->class->sysc) |
881 | _sysc_idle(oh); | 947 | _sysc_idle(oh); |
882 | _del_initiator_dep(oh, mpu_oh); | 948 | _del_initiator_dep(oh, mpu_oh); |
883 | _disable_clocks(oh); | 949 | _disable_clocks(oh); |
@@ -907,7 +973,7 @@ static int _shutdown(struct omap_hwmod *oh) | |||
907 | 973 | ||
908 | pr_debug("omap_hwmod: %s: disabling\n", oh->name); | 974 | pr_debug("omap_hwmod: %s: disabling\n", oh->name); |
909 | 975 | ||
910 | if (oh->sysconfig) | 976 | if (oh->class->sysc) |
911 | _sysc_shutdown(oh); | 977 | _sysc_shutdown(oh); |
912 | _del_initiator_dep(oh, mpu_oh); | 978 | _del_initiator_dep(oh, mpu_oh); |
913 | /* XXX what about the other system initiators here? DMA, tesla, d2d */ | 979 | /* XXX what about the other system initiators here? DMA, tesla, d2d */ |
@@ -967,7 +1033,7 @@ static int _setup(struct omap_hwmod *oh) | |||
967 | * _enable() function should be split to avoid the | 1033 | * _enable() function should be split to avoid the |
968 | * rewrite of the OCP_SYSCONFIG register. | 1034 | * rewrite of the OCP_SYSCONFIG register. |
969 | */ | 1035 | */ |
970 | if (oh->sysconfig) { | 1036 | if (oh->class->sysc) { |
971 | _update_sysc_cache(oh); | 1037 | _update_sysc_cache(oh); |
972 | _sysc_enable(oh); | 1038 | _sysc_enable(oh); |
973 | } | 1039 | } |
@@ -993,13 +1059,33 @@ void omap_hwmod_writel(u32 v, struct omap_hwmod *oh, u16 reg_offs) | |||
993 | __raw_writel(v, oh->_rt_va + reg_offs); | 1059 | __raw_writel(v, oh->_rt_va + reg_offs); |
994 | } | 1060 | } |
995 | 1061 | ||
1062 | int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode) | ||
1063 | { | ||
1064 | u32 v; | ||
1065 | int retval = 0; | ||
1066 | |||
1067 | if (!oh) | ||
1068 | return -EINVAL; | ||
1069 | |||
1070 | v = oh->_sysc_cache; | ||
1071 | |||
1072 | retval = _set_slave_idlemode(oh, idlemode, &v); | ||
1073 | if (!retval) | ||
1074 | _write_sysconfig(v, oh); | ||
1075 | |||
1076 | return retval; | ||
1077 | } | ||
1078 | |||
996 | /** | 1079 | /** |
997 | * omap_hwmod_register - register a struct omap_hwmod | 1080 | * omap_hwmod_register - register a struct omap_hwmod |
998 | * @oh: struct omap_hwmod * | 1081 | * @oh: struct omap_hwmod * |
999 | * | 1082 | * |
1000 | * Registers the omap_hwmod @oh. Returns -EEXIST if an omap_hwmod already | 1083 | * Registers the omap_hwmod @oh. Returns -EEXIST if an omap_hwmod |
1001 | * has been registered by the same name; -EINVAL if the omap_hwmod is in the | 1084 | * already has been registered by the same name; -EINVAL if the |
1002 | * wrong state, or 0 on success. | 1085 | * omap_hwmod is in the wrong state, if @oh is NULL, if the |
1086 | * omap_hwmod's class field is NULL; if the omap_hwmod is missing a | ||
1087 | * name, or if the omap_hwmod's class is missing a name; or 0 upon | ||
1088 | * success. | ||
1003 | * | 1089 | * |
1004 | * XXX The data should be copied into bootmem, so the original data | 1090 | * XXX The data should be copied into bootmem, so the original data |
1005 | * should be marked __initdata and freed after init. This would allow | 1091 | * should be marked __initdata and freed after init. This would allow |
@@ -1011,7 +1097,8 @@ int omap_hwmod_register(struct omap_hwmod *oh) | |||
1011 | { | 1097 | { |
1012 | int ret, ms_id; | 1098 | int ret, ms_id; |
1013 | 1099 | ||
1014 | if (!oh || (oh->_state != _HWMOD_STATE_UNKNOWN)) | 1100 | if (!oh || !oh->name || !oh->class || !oh->class->name || |
1101 | (oh->_state != _HWMOD_STATE_UNKNOWN)) | ||
1015 | return -EINVAL; | 1102 | return -EINVAL; |
1016 | 1103 | ||
1017 | mutex_lock(&omap_hwmod_mutex); | 1104 | mutex_lock(&omap_hwmod_mutex); |
@@ -1284,7 +1371,7 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh) | |||
1284 | { | 1371 | { |
1285 | BUG_ON(!oh); | 1372 | BUG_ON(!oh); |
1286 | 1373 | ||
1287 | if (!oh->sysconfig || !oh->sysconfig->sysc_flags) { | 1374 | if (!oh->class->sysc || !oh->class->sysc->sysc_flags) { |
1288 | WARN(1, "omap_device: %s: OCP barrier impossible due to " | 1375 | WARN(1, "omap_device: %s: OCP barrier impossible due to " |
1289 | "device configuration\n", oh->name); | 1376 | "device configuration\n", oh->name); |
1290 | return; | 1377 | return; |
@@ -1294,7 +1381,7 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh) | |||
1294 | * Forces posted writes to complete on the OCP thread handling | 1381 | * Forces posted writes to complete on the OCP thread handling |
1295 | * register writes | 1382 | * register writes |
1296 | */ | 1383 | */ |
1297 | omap_hwmod_readl(oh, oh->sysconfig->sysc_offs); | 1384 | omap_hwmod_readl(oh, oh->class->sysc->sysc_offs); |
1298 | } | 1385 | } |
1299 | 1386 | ||
1300 | /** | 1387 | /** |
@@ -1487,8 +1574,8 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, | |||
1487 | */ | 1574 | */ |
1488 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) | 1575 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) |
1489 | { | 1576 | { |
1490 | if (!oh->sysconfig || | 1577 | if (!oh->class->sysc || |
1491 | !(oh->sysconfig->sysc_flags & SYSC_HAS_ENAWAKEUP)) | 1578 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) |
1492 | return -EINVAL; | 1579 | return -EINVAL; |
1493 | 1580 | ||
1494 | mutex_lock(&omap_hwmod_mutex); | 1581 | mutex_lock(&omap_hwmod_mutex); |
@@ -1512,8 +1599,8 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) | |||
1512 | */ | 1599 | */ |
1513 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) | 1600 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) |
1514 | { | 1601 | { |
1515 | if (!oh->sysconfig || | 1602 | if (!oh->class->sysc || |
1516 | !(oh->sysconfig->sysc_flags & SYSC_HAS_ENAWAKEUP)) | 1603 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) |
1517 | return -EINVAL; | 1604 | return -EINVAL; |
1518 | 1605 | ||
1519 | mutex_lock(&omap_hwmod_mutex); | 1606 | mutex_lock(&omap_hwmod_mutex); |
@@ -1522,3 +1609,52 @@ int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) | |||
1522 | 1609 | ||
1523 | return 0; | 1610 | return 0; |
1524 | } | 1611 | } |
1612 | |||
1613 | /** | ||
1614 | * omap_hwmod_for_each_by_class - call @fn for each hwmod of class @classname | ||
1615 | * @classname: struct omap_hwmod_class name to search for | ||
1616 | * @fn: callback function pointer to call for each hwmod in class @classname | ||
1617 | * @user: arbitrary context data to pass to the callback function | ||
1618 | * | ||
1619 | * For each omap_hwmod of class @classname, call @fn. Takes | ||
1620 | * omap_hwmod_mutex to prevent the hwmod list from changing during the | ||
1621 | * iteration. If the callback function returns something other than | ||
1622 | * zero, the iterator is terminated, and the callback function's return | ||
1623 | * value is passed back to the caller. Returns 0 upon success, -EINVAL | ||
1624 | * if @classname or @fn are NULL, or passes back the error code from @fn. | ||
1625 | */ | ||
1626 | int omap_hwmod_for_each_by_class(const char *classname, | ||
1627 | int (*fn)(struct omap_hwmod *oh, | ||
1628 | void *user), | ||
1629 | void *user) | ||
1630 | { | ||
1631 | struct omap_hwmod *temp_oh; | ||
1632 | int ret = 0; | ||
1633 | |||
1634 | if (!classname || !fn) | ||
1635 | return -EINVAL; | ||
1636 | |||
1637 | pr_debug("omap_hwmod: %s: looking for modules of class %s\n", | ||
1638 | __func__, classname); | ||
1639 | |||
1640 | mutex_lock(&omap_hwmod_mutex); | ||
1641 | |||
1642 | list_for_each_entry(temp_oh, &omap_hwmod_list, node) { | ||
1643 | if (!strcmp(temp_oh->class->name, classname)) { | ||
1644 | pr_debug("omap_hwmod: %s: %s: calling callback fn\n", | ||
1645 | __func__, temp_oh->name); | ||
1646 | ret = (*fn)(temp_oh, user); | ||
1647 | if (ret) | ||
1648 | break; | ||
1649 | } | ||
1650 | } | ||
1651 | |||
1652 | mutex_unlock(&omap_hwmod_mutex); | ||
1653 | |||
1654 | if (ret) | ||
1655 | pr_debug("omap_hwmod: %s: iterator terminated early: %d\n", | ||
1656 | __func__, ret); | ||
1657 | |||
1658 | return ret; | ||
1659 | } | ||
1660 | |||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420.h b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index a9ca1b99a301..eb7ee2453b24 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420.h +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * omap_hwmod_2420.h - hardware modules present on the OMAP2420 chips | 2 | * omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Nokia Corporation | 4 | * Copyright (C) 2009-2010 Nokia Corporation |
5 | * Paul Walmsley | 5 | * Paul Walmsley |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -9,20 +9,26 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | * | 10 | * |
11 | * XXX handle crossbar/shared link difference for L3? | 11 | * XXX handle crossbar/shared link difference for L3? |
12 | * | 12 | * XXX these should be marked initdata for multi-OMAP kernels |
13 | */ | 13 | */ |
14 | #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2420_H | ||
15 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2420_H | ||
16 | |||
17 | #ifdef CONFIG_ARCH_OMAP2420 | ||
18 | |||
19 | #include <plat/omap_hwmod.h> | 14 | #include <plat/omap_hwmod.h> |
20 | #include <mach/irqs.h> | 15 | #include <mach/irqs.h> |
21 | #include <plat/cpu.h> | 16 | #include <plat/cpu.h> |
22 | #include <plat/dma.h> | 17 | #include <plat/dma.h> |
23 | 18 | ||
19 | #include "omap_hwmod_common_data.h" | ||
20 | |||
24 | #include "prm-regbits-24xx.h" | 21 | #include "prm-regbits-24xx.h" |
25 | 22 | ||
23 | /* | ||
24 | * OMAP2420 hardware module integration data | ||
25 | * | ||
26 | * ALl of the data in this section should be autogeneratable from the | ||
27 | * TI hardware database or other technical documentation. Data that | ||
28 | * is driver-specific or driver-kernel integration-specific belongs | ||
29 | * elsewhere. | ||
30 | */ | ||
31 | |||
26 | static struct omap_hwmod omap2420_mpu_hwmod; | 32 | static struct omap_hwmod omap2420_mpu_hwmod; |
27 | static struct omap_hwmod omap2420_l3_hwmod; | 33 | static struct omap_hwmod omap2420_l3_hwmod; |
28 | static struct omap_hwmod omap2420_l4_core_hwmod; | 34 | static struct omap_hwmod omap2420_l4_core_hwmod; |
@@ -54,6 +60,7 @@ static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = { | |||
54 | /* L3 */ | 60 | /* L3 */ |
55 | static struct omap_hwmod omap2420_l3_hwmod = { | 61 | static struct omap_hwmod omap2420_l3_hwmod = { |
56 | .name = "l3_hwmod", | 62 | .name = "l3_hwmod", |
63 | .class = &l3_hwmod_class, | ||
57 | .masters = omap2420_l3_masters, | 64 | .masters = omap2420_l3_masters, |
58 | .masters_cnt = ARRAY_SIZE(omap2420_l3_masters), | 65 | .masters_cnt = ARRAY_SIZE(omap2420_l3_masters), |
59 | .slaves = omap2420_l3_slaves, | 66 | .slaves = omap2420_l3_slaves, |
@@ -83,6 +90,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = { | |||
83 | /* L4 CORE */ | 90 | /* L4 CORE */ |
84 | static struct omap_hwmod omap2420_l4_core_hwmod = { | 91 | static struct omap_hwmod omap2420_l4_core_hwmod = { |
85 | .name = "l4_core_hwmod", | 92 | .name = "l4_core_hwmod", |
93 | .class = &l4_hwmod_class, | ||
86 | .masters = omap2420_l4_core_masters, | 94 | .masters = omap2420_l4_core_masters, |
87 | .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), | 95 | .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), |
88 | .slaves = omap2420_l4_core_slaves, | 96 | .slaves = omap2420_l4_core_slaves, |
@@ -102,6 +110,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = { | |||
102 | /* L4 WKUP */ | 110 | /* L4 WKUP */ |
103 | static struct omap_hwmod omap2420_l4_wkup_hwmod = { | 111 | static struct omap_hwmod omap2420_l4_wkup_hwmod = { |
104 | .name = "l4_wkup_hwmod", | 112 | .name = "l4_wkup_hwmod", |
113 | .class = &l4_hwmod_class, | ||
105 | .masters = omap2420_l4_wkup_masters, | 114 | .masters = omap2420_l4_wkup_masters, |
106 | .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), | 115 | .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), |
107 | .slaves = omap2420_l4_wkup_slaves, | 116 | .slaves = omap2420_l4_wkup_slaves, |
@@ -117,8 +126,8 @@ static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = { | |||
117 | /* MPU */ | 126 | /* MPU */ |
118 | static struct omap_hwmod omap2420_mpu_hwmod = { | 127 | static struct omap_hwmod omap2420_mpu_hwmod = { |
119 | .name = "mpu_hwmod", | 128 | .name = "mpu_hwmod", |
120 | .clkdev_dev_id = NULL, | 129 | .class = &mpu_hwmod_class, |
121 | .clkdev_con_id = "mpu_ck", | 130 | .main_clk = "mpu_ck", |
122 | .masters = omap2420_mpu_masters, | 131 | .masters = omap2420_mpu_masters, |
123 | .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters), | 132 | .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters), |
124 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), | 133 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), |
@@ -132,10 +141,9 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = { | |||
132 | NULL, | 141 | NULL, |
133 | }; | 142 | }; |
134 | 143 | ||
135 | #else | 144 | int __init omap2420_hwmod_init(void) |
136 | # define omap2420_hwmods 0 | 145 | { |
137 | #endif | 146 | return omap_hwmod_init(omap2420_hwmods); |
138 | 147 | } | |
139 | #endif | ||
140 | 148 | ||
141 | 149 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430.h b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 59a208bea6c2..241bd8230729 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430.h +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * omap_hwmod_2430.h - hardware modules present on the OMAP2430 chips | 2 | * omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 chips |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Nokia Corporation | 4 | * Copyright (C) 2009-2010 Nokia Corporation |
5 | * Paul Walmsley | 5 | * Paul Walmsley |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -9,20 +9,26 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | * | 10 | * |
11 | * XXX handle crossbar/shared link difference for L3? | 11 | * XXX handle crossbar/shared link difference for L3? |
12 | * | 12 | * XXX these should be marked initdata for multi-OMAP kernels |
13 | */ | 13 | */ |
14 | #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2430_H | ||
15 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD2430_H | ||
16 | |||
17 | #ifdef CONFIG_ARCH_OMAP2430 | ||
18 | |||
19 | #include <plat/omap_hwmod.h> | 14 | #include <plat/omap_hwmod.h> |
20 | #include <mach/irqs.h> | 15 | #include <mach/irqs.h> |
21 | #include <plat/cpu.h> | 16 | #include <plat/cpu.h> |
22 | #include <plat/dma.h> | 17 | #include <plat/dma.h> |
23 | 18 | ||
19 | #include "omap_hwmod_common_data.h" | ||
20 | |||
24 | #include "prm-regbits-24xx.h" | 21 | #include "prm-regbits-24xx.h" |
25 | 22 | ||
23 | /* | ||
24 | * OMAP2430 hardware module integration data | ||
25 | * | ||
26 | * ALl of the data in this section should be autogeneratable from the | ||
27 | * TI hardware database or other technical documentation. Data that | ||
28 | * is driver-specific or driver-kernel integration-specific belongs | ||
29 | * elsewhere. | ||
30 | */ | ||
31 | |||
26 | static struct omap_hwmod omap2430_mpu_hwmod; | 32 | static struct omap_hwmod omap2430_mpu_hwmod; |
27 | static struct omap_hwmod omap2430_l3_hwmod; | 33 | static struct omap_hwmod omap2430_l3_hwmod; |
28 | static struct omap_hwmod omap2430_l4_core_hwmod; | 34 | static struct omap_hwmod omap2430_l4_core_hwmod; |
@@ -54,6 +60,7 @@ static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = { | |||
54 | /* L3 */ | 60 | /* L3 */ |
55 | static struct omap_hwmod omap2430_l3_hwmod = { | 61 | static struct omap_hwmod omap2430_l3_hwmod = { |
56 | .name = "l3_hwmod", | 62 | .name = "l3_hwmod", |
63 | .class = &l3_hwmod_class, | ||
57 | .masters = omap2430_l3_masters, | 64 | .masters = omap2430_l3_masters, |
58 | .masters_cnt = ARRAY_SIZE(omap2430_l3_masters), | 65 | .masters_cnt = ARRAY_SIZE(omap2430_l3_masters), |
59 | .slaves = omap2430_l3_slaves, | 66 | .slaves = omap2430_l3_slaves, |
@@ -85,6 +92,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { | |||
85 | /* L4 CORE */ | 92 | /* L4 CORE */ |
86 | static struct omap_hwmod omap2430_l4_core_hwmod = { | 93 | static struct omap_hwmod omap2430_l4_core_hwmod = { |
87 | .name = "l4_core_hwmod", | 94 | .name = "l4_core_hwmod", |
95 | .class = &l4_hwmod_class, | ||
88 | .masters = omap2430_l4_core_masters, | 96 | .masters = omap2430_l4_core_masters, |
89 | .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), | 97 | .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), |
90 | .slaves = omap2430_l4_core_slaves, | 98 | .slaves = omap2430_l4_core_slaves, |
@@ -104,6 +112,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = { | |||
104 | /* L4 WKUP */ | 112 | /* L4 WKUP */ |
105 | static struct omap_hwmod omap2430_l4_wkup_hwmod = { | 113 | static struct omap_hwmod omap2430_l4_wkup_hwmod = { |
106 | .name = "l4_wkup_hwmod", | 114 | .name = "l4_wkup_hwmod", |
115 | .class = &l4_hwmod_class, | ||
107 | .masters = omap2430_l4_wkup_masters, | 116 | .masters = omap2430_l4_wkup_masters, |
108 | .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), | 117 | .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), |
109 | .slaves = omap2430_l4_wkup_slaves, | 118 | .slaves = omap2430_l4_wkup_slaves, |
@@ -119,8 +128,8 @@ static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = { | |||
119 | /* MPU */ | 128 | /* MPU */ |
120 | static struct omap_hwmod omap2430_mpu_hwmod = { | 129 | static struct omap_hwmod omap2430_mpu_hwmod = { |
121 | .name = "mpu_hwmod", | 130 | .name = "mpu_hwmod", |
122 | .clkdev_dev_id = NULL, | 131 | .class = &mpu_hwmod_class, |
123 | .clkdev_con_id = "mpu_ck", | 132 | .main_clk = "mpu_ck", |
124 | .masters = omap2430_mpu_masters, | 133 | .masters = omap2430_mpu_masters, |
125 | .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters), | 134 | .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters), |
126 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 135 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
@@ -134,10 +143,9 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = { | |||
134 | NULL, | 143 | NULL, |
135 | }; | 144 | }; |
136 | 145 | ||
137 | #else | 146 | int __init omap2430_hwmod_init(void) |
138 | # define omap2430_hwmods 0 | 147 | { |
139 | #endif | 148 | return omap_hwmod_init(omap2430_hwmods); |
140 | 149 | } | |
141 | #endif | ||
142 | 150 | ||
143 | 151 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_34xx.h b/arch/arm/mach-omap2/omap_hwmod_34xx.h deleted file mode 100644 index b6076b9c364e..000000000000 --- a/arch/arm/mach-omap2/omap_hwmod_34xx.h +++ /dev/null | |||
@@ -1,168 +0,0 @@ | |||
1 | /* | ||
2 | * omap_hwmod_34xx.h - hardware modules present on the OMAP34xx chips | ||
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 | #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD34XX_H | ||
13 | #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD34XX_H | ||
14 | |||
15 | #ifdef CONFIG_ARCH_OMAP34XX | ||
16 | |||
17 | #include <plat/omap_hwmod.h> | ||
18 | #include <mach/irqs.h> | ||
19 | #include <plat/cpu.h> | ||
20 | #include <plat/dma.h> | ||
21 | |||
22 | #include "prm-regbits-34xx.h" | ||
23 | |||
24 | static struct omap_hwmod omap34xx_mpu_hwmod; | ||
25 | static struct omap_hwmod omap34xx_l3_hwmod; | ||
26 | static struct omap_hwmod omap34xx_l4_core_hwmod; | ||
27 | static struct omap_hwmod omap34xx_l4_per_hwmod; | ||
28 | |||
29 | /* L3 -> L4_CORE interface */ | ||
30 | static struct omap_hwmod_ocp_if omap34xx_l3__l4_core = { | ||
31 | .master = &omap34xx_l3_hwmod, | ||
32 | .slave = &omap34xx_l4_core_hwmod, | ||
33 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
34 | }; | ||
35 | |||
36 | /* L3 -> L4_PER interface */ | ||
37 | static struct omap_hwmod_ocp_if omap34xx_l3__l4_per = { | ||
38 | .master = &omap34xx_l3_hwmod, | ||
39 | .slave = &omap34xx_l4_per_hwmod, | ||
40 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
41 | }; | ||
42 | |||
43 | /* MPU -> L3 interface */ | ||
44 | static struct omap_hwmod_ocp_if omap34xx_mpu__l3 = { | ||
45 | .master = &omap34xx_mpu_hwmod, | ||
46 | .slave = &omap34xx_l3_hwmod, | ||
47 | .user = OCP_USER_MPU, | ||
48 | }; | ||
49 | |||
50 | /* Slave interfaces on the L3 interconnect */ | ||
51 | static struct omap_hwmod_ocp_if *omap34xx_l3_slaves[] = { | ||
52 | &omap34xx_mpu__l3, | ||
53 | }; | ||
54 | |||
55 | /* Master interfaces on the L3 interconnect */ | ||
56 | static struct omap_hwmod_ocp_if *omap34xx_l3_masters[] = { | ||
57 | &omap34xx_l3__l4_core, | ||
58 | &omap34xx_l3__l4_per, | ||
59 | }; | ||
60 | |||
61 | /* L3 */ | ||
62 | static struct omap_hwmod omap34xx_l3_hwmod = { | ||
63 | .name = "l3_hwmod", | ||
64 | .masters = omap34xx_l3_masters, | ||
65 | .masters_cnt = ARRAY_SIZE(omap34xx_l3_masters), | ||
66 | .slaves = omap34xx_l3_slaves, | ||
67 | .slaves_cnt = ARRAY_SIZE(omap34xx_l3_slaves), | ||
68 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
69 | }; | ||
70 | |||
71 | static struct omap_hwmod omap34xx_l4_wkup_hwmod; | ||
72 | |||
73 | /* L4_CORE -> L4_WKUP interface */ | ||
74 | static struct omap_hwmod_ocp_if omap34xx_l4_core__l4_wkup = { | ||
75 | .master = &omap34xx_l4_core_hwmod, | ||
76 | .slave = &omap34xx_l4_wkup_hwmod, | ||
77 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
78 | }; | ||
79 | |||
80 | /* Slave interfaces on the L4_CORE interconnect */ | ||
81 | static struct omap_hwmod_ocp_if *omap34xx_l4_core_slaves[] = { | ||
82 | &omap34xx_l3__l4_core, | ||
83 | }; | ||
84 | |||
85 | /* Master interfaces on the L4_CORE interconnect */ | ||
86 | static struct omap_hwmod_ocp_if *omap34xx_l4_core_masters[] = { | ||
87 | &omap34xx_l4_core__l4_wkup, | ||
88 | }; | ||
89 | |||
90 | /* L4 CORE */ | ||
91 | static struct omap_hwmod omap34xx_l4_core_hwmod = { | ||
92 | .name = "l4_core_hwmod", | ||
93 | .masters = omap34xx_l4_core_masters, | ||
94 | .masters_cnt = ARRAY_SIZE(omap34xx_l4_core_masters), | ||
95 | .slaves = omap34xx_l4_core_slaves, | ||
96 | .slaves_cnt = ARRAY_SIZE(omap34xx_l4_core_slaves), | ||
97 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
98 | }; | ||
99 | |||
100 | /* Slave interfaces on the L4_PER interconnect */ | ||
101 | static struct omap_hwmod_ocp_if *omap34xx_l4_per_slaves[] = { | ||
102 | &omap34xx_l3__l4_per, | ||
103 | }; | ||
104 | |||
105 | /* Master interfaces on the L4_PER interconnect */ | ||
106 | static struct omap_hwmod_ocp_if *omap34xx_l4_per_masters[] = { | ||
107 | }; | ||
108 | |||
109 | /* L4 PER */ | ||
110 | static struct omap_hwmod omap34xx_l4_per_hwmod = { | ||
111 | .name = "l4_per_hwmod", | ||
112 | .masters = omap34xx_l4_per_masters, | ||
113 | .masters_cnt = ARRAY_SIZE(omap34xx_l4_per_masters), | ||
114 | .slaves = omap34xx_l4_per_slaves, | ||
115 | .slaves_cnt = ARRAY_SIZE(omap34xx_l4_per_slaves), | ||
116 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
117 | }; | ||
118 | |||
119 | /* Slave interfaces on the L4_WKUP interconnect */ | ||
120 | static struct omap_hwmod_ocp_if *omap34xx_l4_wkup_slaves[] = { | ||
121 | &omap34xx_l4_core__l4_wkup, | ||
122 | }; | ||
123 | |||
124 | /* Master interfaces on the L4_WKUP interconnect */ | ||
125 | static struct omap_hwmod_ocp_if *omap34xx_l4_wkup_masters[] = { | ||
126 | }; | ||
127 | |||
128 | /* L4 WKUP */ | ||
129 | static struct omap_hwmod omap34xx_l4_wkup_hwmod = { | ||
130 | .name = "l4_wkup_hwmod", | ||
131 | .masters = omap34xx_l4_wkup_masters, | ||
132 | .masters_cnt = ARRAY_SIZE(omap34xx_l4_wkup_masters), | ||
133 | .slaves = omap34xx_l4_wkup_slaves, | ||
134 | .slaves_cnt = ARRAY_SIZE(omap34xx_l4_wkup_slaves), | ||
135 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
136 | }; | ||
137 | |||
138 | /* Master interfaces on the MPU device */ | ||
139 | static struct omap_hwmod_ocp_if *omap34xx_mpu_masters[] = { | ||
140 | &omap34xx_mpu__l3, | ||
141 | }; | ||
142 | |||
143 | /* MPU */ | ||
144 | static struct omap_hwmod omap34xx_mpu_hwmod = { | ||
145 | .name = "mpu_hwmod", | ||
146 | .clkdev_dev_id = NULL, | ||
147 | .clkdev_con_id = "arm_fck", | ||
148 | .masters = omap34xx_mpu_masters, | ||
149 | .masters_cnt = ARRAY_SIZE(omap34xx_mpu_masters), | ||
150 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
151 | }; | ||
152 | |||
153 | static __initdata struct omap_hwmod *omap34xx_hwmods[] = { | ||
154 | &omap34xx_l3_hwmod, | ||
155 | &omap34xx_l4_core_hwmod, | ||
156 | &omap34xx_l4_per_hwmod, | ||
157 | &omap34xx_l4_wkup_hwmod, | ||
158 | &omap34xx_mpu_hwmod, | ||
159 | NULL, | ||
160 | }; | ||
161 | |||
162 | #else | ||
163 | # define omap34xx_hwmods 0 | ||
164 | #endif | ||
165 | |||
166 | #endif | ||
167 | |||
168 | |||
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c new file mode 100644 index 000000000000..ed6084004260 --- /dev/null +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | * omap_hwmod_3xxx_data.c - hardware modules present on the OMAP3xxx chips | ||
3 | * | ||
4 | * Copyright (C) 2009-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 | * The data in this file should be completely autogeneratable from | ||
12 | * the TI hardware database or other technical documentation. | ||
13 | * | ||
14 | * XXX these should be marked initdata for multi-OMAP kernels | ||
15 | */ | ||
16 | #include <plat/omap_hwmod.h> | ||
17 | #include <mach/irqs.h> | ||
18 | #include <plat/cpu.h> | ||
19 | #include <plat/dma.h> | ||
20 | |||
21 | #include "omap_hwmod_common_data.h" | ||
22 | |||
23 | #include "prm-regbits-34xx.h" | ||
24 | |||
25 | /* | ||
26 | * OMAP3xxx hardware module integration data | ||
27 | * | ||
28 | * ALl of the data in this section should be autogeneratable from the | ||
29 | * TI hardware database or other technical documentation. Data that | ||
30 | * is driver-specific or driver-kernel integration-specific belongs | ||
31 | * elsewhere. | ||
32 | */ | ||
33 | |||
34 | static struct omap_hwmod omap3xxx_mpu_hwmod; | ||
35 | static struct omap_hwmod omap3xxx_l3_hwmod; | ||
36 | static struct omap_hwmod omap3xxx_l4_core_hwmod; | ||
37 | static struct omap_hwmod omap3xxx_l4_per_hwmod; | ||
38 | |||
39 | /* L3 -> L4_CORE interface */ | ||
40 | static struct omap_hwmod_ocp_if omap3xxx_l3__l4_core = { | ||
41 | .master = &omap3xxx_l3_hwmod, | ||
42 | .slave = &omap3xxx_l4_core_hwmod, | ||
43 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
44 | }; | ||
45 | |||
46 | /* L3 -> L4_PER interface */ | ||
47 | static struct omap_hwmod_ocp_if omap3xxx_l3__l4_per = { | ||
48 | .master = &omap3xxx_l3_hwmod, | ||
49 | .slave = &omap3xxx_l4_per_hwmod, | ||
50 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
51 | }; | ||
52 | |||
53 | /* MPU -> L3 interface */ | ||
54 | static struct omap_hwmod_ocp_if omap3xxx_mpu__l3 = { | ||
55 | .master = &omap3xxx_mpu_hwmod, | ||
56 | .slave = &omap3xxx_l3_hwmod, | ||
57 | .user = OCP_USER_MPU, | ||
58 | }; | ||
59 | |||
60 | /* Slave interfaces on the L3 interconnect */ | ||
61 | static struct omap_hwmod_ocp_if *omap3xxx_l3_slaves[] = { | ||
62 | &omap3xxx_mpu__l3, | ||
63 | }; | ||
64 | |||
65 | /* Master interfaces on the L3 interconnect */ | ||
66 | static struct omap_hwmod_ocp_if *omap3xxx_l3_masters[] = { | ||
67 | &omap3xxx_l3__l4_core, | ||
68 | &omap3xxx_l3__l4_per, | ||
69 | }; | ||
70 | |||
71 | /* L3 */ | ||
72 | static struct omap_hwmod omap3xxx_l3_hwmod = { | ||
73 | .name = "l3_hwmod", | ||
74 | .class = &l3_hwmod_class, | ||
75 | .masters = omap3xxx_l3_masters, | ||
76 | .masters_cnt = ARRAY_SIZE(omap3xxx_l3_masters), | ||
77 | .slaves = omap3xxx_l3_slaves, | ||
78 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_slaves), | ||
79 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
80 | }; | ||
81 | |||
82 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod; | ||
83 | |||
84 | /* L4_CORE -> L4_WKUP interface */ | ||
85 | static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { | ||
86 | .master = &omap3xxx_l4_core_hwmod, | ||
87 | .slave = &omap3xxx_l4_wkup_hwmod, | ||
88 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
89 | }; | ||
90 | |||
91 | /* Slave interfaces on the L4_CORE interconnect */ | ||
92 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { | ||
93 | &omap3xxx_l3__l4_core, | ||
94 | }; | ||
95 | |||
96 | /* Master interfaces on the L4_CORE interconnect */ | ||
97 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = { | ||
98 | &omap3xxx_l4_core__l4_wkup, | ||
99 | }; | ||
100 | |||
101 | /* L4 CORE */ | ||
102 | static struct omap_hwmod omap3xxx_l4_core_hwmod = { | ||
103 | .name = "l4_core_hwmod", | ||
104 | .class = &l4_hwmod_class, | ||
105 | .masters = omap3xxx_l4_core_masters, | ||
106 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters), | ||
107 | .slaves = omap3xxx_l4_core_slaves, | ||
108 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), | ||
109 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
110 | }; | ||
111 | |||
112 | /* Slave interfaces on the L4_PER interconnect */ | ||
113 | static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = { | ||
114 | &omap3xxx_l3__l4_per, | ||
115 | }; | ||
116 | |||
117 | /* Master interfaces on the L4_PER interconnect */ | ||
118 | static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = { | ||
119 | }; | ||
120 | |||
121 | /* L4 PER */ | ||
122 | static struct omap_hwmod omap3xxx_l4_per_hwmod = { | ||
123 | .name = "l4_per_hwmod", | ||
124 | .class = &l4_hwmod_class, | ||
125 | .masters = omap3xxx_l4_per_masters, | ||
126 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters), | ||
127 | .slaves = omap3xxx_l4_per_slaves, | ||
128 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), | ||
129 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
130 | }; | ||
131 | |||
132 | /* Slave interfaces on the L4_WKUP interconnect */ | ||
133 | static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_slaves[] = { | ||
134 | &omap3xxx_l4_core__l4_wkup, | ||
135 | }; | ||
136 | |||
137 | /* Master interfaces on the L4_WKUP interconnect */ | ||
138 | static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = { | ||
139 | }; | ||
140 | |||
141 | /* L4 WKUP */ | ||
142 | static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { | ||
143 | .name = "l4_wkup_hwmod", | ||
144 | .class = &l4_hwmod_class, | ||
145 | .masters = omap3xxx_l4_wkup_masters, | ||
146 | .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters), | ||
147 | .slaves = omap3xxx_l4_wkup_slaves, | ||
148 | .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), | ||
149 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
150 | }; | ||
151 | |||
152 | /* Master interfaces on the MPU device */ | ||
153 | static struct omap_hwmod_ocp_if *omap3xxx_mpu_masters[] = { | ||
154 | &omap3xxx_mpu__l3, | ||
155 | }; | ||
156 | |||
157 | /* MPU */ | ||
158 | static struct omap_hwmod omap3xxx_mpu_hwmod = { | ||
159 | .name = "mpu_hwmod", | ||
160 | .class = &mpu_hwmod_class, | ||
161 | .main_clk = "arm_fck", | ||
162 | .masters = omap3xxx_mpu_masters, | ||
163 | .masters_cnt = ARRAY_SIZE(omap3xxx_mpu_masters), | ||
164 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
165 | }; | ||
166 | |||
167 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | ||
168 | &omap3xxx_l3_hwmod, | ||
169 | &omap3xxx_l4_core_hwmod, | ||
170 | &omap3xxx_l4_per_hwmod, | ||
171 | &omap3xxx_l4_wkup_hwmod, | ||
172 | &omap3xxx_mpu_hwmod, | ||
173 | NULL, | ||
174 | }; | ||
175 | |||
176 | int __init omap3xxx_hwmod_init(void) | ||
177 | { | ||
178 | return omap_hwmod_init(omap3xxx_hwmods); | ||
179 | } | ||
180 | |||
181 | |||
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.c b/arch/arm/mach-omap2/omap_hwmod_common_data.c new file mode 100644 index 000000000000..1e80b914fa1a --- /dev/null +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * omap_hwmod common data structures | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
5 | * Thara Gopinath <thara@ti.com> | ||
6 | * Benoît Cousson | ||
7 | * | ||
8 | * Copyright (C) 2010 Nokia Corporation | ||
9 | * Paul Walmsley | ||
10 | * | ||
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 | ||
13 | * published by the Free Software Foundation. | ||
14 | * | ||
15 | * This data/structures are to be used while defining OMAP on-chip module | ||
16 | * data and their integration with other OMAP modules and Linux. | ||
17 | */ | ||
18 | |||
19 | #include <plat/omap_hwmod.h> | ||
20 | |||
21 | #include "omap_hwmod_common_data.h" | ||
22 | |||
23 | /** | ||
24 | * struct omap_hwmod_sysc_type1 - TYPE1 sysconfig scheme. | ||
25 | * | ||
26 | * To be used by hwmod structure to specify the sysconfig offsets | ||
27 | * if the device ip is compliant with the original PRCM protocol | ||
28 | * defined for OMAP2420. | ||
29 | */ | ||
30 | struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1 = { | ||
31 | .midle_shift = SYSC_TYPE1_MIDLEMODE_SHIFT, | ||
32 | .clkact_shift = SYSC_TYPE1_CLOCKACTIVITY_SHIFT, | ||
33 | .sidle_shift = SYSC_TYPE1_SIDLEMODE_SHIFT, | ||
34 | .enwkup_shift = SYSC_TYPE1_ENAWAKEUP_SHIFT, | ||
35 | .srst_shift = SYSC_TYPE1_SOFTRESET_SHIFT, | ||
36 | .autoidle_shift = SYSC_TYPE1_AUTOIDLE_SHIFT, | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * struct omap_hwmod_sysc_type2 - TYPE2 sysconfig scheme. | ||
41 | * | ||
42 | * To be used by hwmod structure to specify the sysconfig offsets if the | ||
43 | * device ip is compliant with the new PRCM protocol defined for new | ||
44 | * OMAP4 IPs. | ||
45 | */ | ||
46 | struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2 = { | ||
47 | .midle_shift = SYSC_TYPE2_MIDLEMODE_SHIFT, | ||
48 | .sidle_shift = SYSC_TYPE2_SIDLEMODE_SHIFT, | ||
49 | .srst_shift = SYSC_TYPE2_SOFTRESET_SHIFT, | ||
50 | }; | ||
51 | |||
52 | |||
53 | /* | ||
54 | * omap_hwmod class data | ||
55 | */ | ||
56 | |||
57 | struct omap_hwmod_class l3_hwmod_class = { | ||
58 | .name = "l3" | ||
59 | }; | ||
60 | |||
61 | struct omap_hwmod_class l4_hwmod_class = { | ||
62 | .name = "l4" | ||
63 | }; | ||
64 | |||
65 | struct omap_hwmod_class mpu_hwmod_class = { | ||
66 | .name = "mpu" | ||
67 | }; | ||
68 | |||
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h new file mode 100644 index 000000000000..3645a28c7c27 --- /dev/null +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * omap_hwmod_common_data.h - OMAP hwmod common macros and declarations | ||
3 | * | ||
4 | * Copyright (C) 2010 Nokia Corporation | ||
5 | * Paul Walmsley | ||
6 | * | ||
7 | * Copyright (C) 2010 Texas Instruments, Inc. | ||
8 | * Benoît Cousson | ||
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 | #ifndef __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H | ||
15 | #define __ARCH_ARM_MACH_OMAP2_OMAP_HWMOD_COMMON_DATA_H | ||
16 | |||
17 | #include <plat/omap_hwmod.h> | ||
18 | |||
19 | /* OMAP hwmod classes - forward declarations */ | ||
20 | extern struct omap_hwmod_class l3_hwmod_class; | ||
21 | extern struct omap_hwmod_class l4_hwmod_class; | ||
22 | extern struct omap_hwmod_class mpu_hwmod_class; | ||
23 | |||
24 | #endif | ||
diff --git a/arch/arm/mach-omap2/opp2420_data.c b/arch/arm/mach-omap2/opp2420_data.c index 126a9396b3a8..e6dda694fd5c 100644 --- a/arch/arm/mach-omap2/opp2420_data.c +++ b/arch/arm/mach-omap2/opp2420_data.c | |||
@@ -9,45 +9,47 @@ | |||
9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. | 9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. |
10 | * These configurations are characterized by voltage and speed for clocks. | 10 | * These configurations are characterized by voltage and speed for clocks. |
11 | * The device is only validated for certain combinations. One way to express | 11 | * The device is only validated for certain combinations. One way to express |
12 | * these combinations is via the 'ratio's' which the clocks operate with | 12 | * these combinations is via the 'ratios' which the clocks operate with |
13 | * respect to each other. These ratio sets are for a given voltage/DPLL | 13 | * respect to each other. These ratio sets are for a given voltage/DPLL |
14 | * setting. All configurations can be described by a DPLL setting and a ratio | 14 | * setting. All configurations can be described by a DPLL setting and a ratio. |
15 | * There are 3 ratio sets for the 2430 and X ratio sets for 2420. | ||
16 | * | ||
17 | * 2430 differs from 2420 in that there are no more phase synchronizers used. | ||
18 | * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs | ||
19 | * 2430 (iva2.1, NOdsp, mdm) | ||
20 | * | 15 | * |
21 | * XXX Missing voltage data. | 16 | * XXX Missing voltage data. |
17 | * XXX Missing 19.2MHz sys_clk rate sets (needed for N800/N810) | ||
22 | * | 18 | * |
23 | * THe format described in this file is deprecated. Once a reasonable | 19 | * THe format described in this file is deprecated. Once a reasonable |
24 | * OPP API exists, the data in this file should be converted to use it. | 20 | * OPP API exists, the data in this file should be converted to use it. |
25 | * | 21 | * |
26 | * This is technically part of the OMAP2xxx clock code. | 22 | * This is technically part of the OMAP2xxx clock code. |
23 | * | ||
24 | * Considerable work is still needed to fully support dynamic frequency | ||
25 | * changes on OMAP2xxx-series chips. Readers interested in such a | ||
26 | * project are encouraged to review the Maemo Diablo RX-34 and RX-44 | ||
27 | * kernel source at: | ||
28 | * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/ | ||
27 | */ | 29 | */ |
28 | 30 | ||
29 | #include "opp2xxx.h" | 31 | #include "opp2xxx.h" |
30 | #include "sdrc.h" | 32 | #include "sdrc.h" |
31 | #include "clock.h" | 33 | #include "clock.h" |
32 | 34 | ||
33 | /*------------------------------------------------------------------------- | 35 | /* |
34 | * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. | 36 | * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated. |
35 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, | 37 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, |
36 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, | 38 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, |
37 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM | 39 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM |
38 | * | 40 | * |
39 | * Filling in table based on H4 boards and 2430-SDPs variants available. | 41 | * Filling in table based on H4 boards available. There are quite a |
40 | * There are quite a few more rates combinations which could be defined. | 42 | * few more rate combinations which could be defined. |
41 | * | 43 | * |
42 | * When multiple values are defined the start up will try and choose the | 44 | * When multiple values are defined the start up will try and choose |
43 | * fastest one. If a 'fast' value is defined, then automatically, the /2 | 45 | * the fastest one. If a 'fast' value is defined, then automatically, |
44 | * one should be included as it can be used. Generally having more that | 46 | * the /2 one should be included as it can be used. Generally having |
45 | * one fast set does not make sense, as static timings need to be changed | 47 | * more than one fast set does not make sense, as static timings need |
46 | * to change the set. The exception is the bypass setting which is | 48 | * to be changed to change the set. The exception is the bypass |
47 | * availble for low power bypass. | 49 | * setting which is available for low power bypass. |
48 | * | 50 | * |
49 | * Note: This table needs to be sorted, fastest to slowest. | 51 | * Note: This table needs to be sorted, fastest to slowest. |
50 | *-------------------------------------------------------------------------*/ | 52 | **/ |
51 | const struct prcm_config omap2420_rate_table[] = { | 53 | const struct prcm_config omap2420_rate_table[] = { |
52 | /* PRCM I - FAST */ | 54 | /* PRCM I - FAST */ |
53 | {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */ | 55 | {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */ |
diff --git a/arch/arm/mach-omap2/opp2430_data.c b/arch/arm/mach-omap2/opp2430_data.c index edb81672c844..1b9596ae201e 100644 --- a/arch/arm/mach-omap2/opp2430_data.c +++ b/arch/arm/mach-omap2/opp2430_data.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * opp2420_data.c - old-style "OPP" table for OMAP2420 | 2 | * opp2430_data.c - old-style "OPP" table for OMAP2430 |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2005-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2004-2009 Nokia Corporation | 5 | * Copyright (C) 2004-2009 Nokia Corporation |
@@ -9,16 +9,16 @@ | |||
9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. | 9 | * The OMAP2 processor can be run at several discrete 'PRCM configurations'. |
10 | * These configurations are characterized by voltage and speed for clocks. | 10 | * These configurations are characterized by voltage and speed for clocks. |
11 | * The device is only validated for certain combinations. One way to express | 11 | * The device is only validated for certain combinations. One way to express |
12 | * these combinations is via the 'ratio's' which the clocks operate with | 12 | * these combinations is via the 'ratios' which the clocks operate with |
13 | * respect to each other. These ratio sets are for a given voltage/DPLL | 13 | * respect to each other. These ratio sets are for a given voltage/DPLL |
14 | * setting. All configurations can be described by a DPLL setting and a ratio | 14 | * setting. All configurations can be described by a DPLL setting and a ratio. |
15 | * There are 3 ratio sets for the 2430 and X ratio sets for 2420. | ||
16 | * | 15 | * |
17 | * 2430 differs from 2420 in that there are no more phase synchronizers used. | 16 | * 2430 differs from 2420 in that there are no more phase synchronizers used. |
18 | * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs | 17 | * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs |
19 | * 2430 (iva2.1, NOdsp, mdm) | 18 | * 2430 (iva2.1, NOdsp, mdm) |
20 | * | 19 | * |
21 | * XXX Missing voltage data. | 20 | * XXX Missing voltage data. |
21 | * XXX Missing 19.2MHz sys_clk rate sets. | ||
22 | * | 22 | * |
23 | * THe format described in this file is deprecated. Once a reasonable | 23 | * THe format described in this file is deprecated. Once a reasonable |
24 | * OPP API exists, the data in this file should be converted to use it. | 24 | * OPP API exists, the data in this file should be converted to use it. |
@@ -30,24 +30,24 @@ | |||
30 | #include "sdrc.h" | 30 | #include "sdrc.h" |
31 | #include "clock.h" | 31 | #include "clock.h" |
32 | 32 | ||
33 | /*------------------------------------------------------------------------- | 33 | /* |
34 | * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. | 34 | * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated. |
35 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, | 35 | * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, |
36 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, | 36 | * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, |
37 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM | 37 | * CM_CLKSEL2_PLL, CM_CLKSEL_MDM |
38 | * | 38 | * |
39 | * Filling in table based on H4 boards and 2430-SDPs variants available. | 39 | * Filling in table based on 2430-SDPs variants available. There are |
40 | * There are quite a few more rates combinations which could be defined. | 40 | * quite a few more rate combinations which could be defined. |
41 | * | 41 | * |
42 | * When multiple values are defined the start up will try and choose the | 42 | * When multiple values are defined the start up will try and choose |
43 | * fastest one. If a 'fast' value is defined, then automatically, the /2 | 43 | * the fastest one. If a 'fast' value is defined, then automatically, |
44 | * one should be included as it can be used. Generally having more that | 44 | * the /2 one should be included as it can be used. Generally having |
45 | * one fast set does not make sense, as static timings need to be changed | 45 | * more than one fast set does not make sense, as static timings need |
46 | * to change the set. The exception is the bypass setting which is | 46 | * to be changed to change the set. The exception is the bypass |
47 | * availble for low power bypass. | 47 | * setting which is available for low power bypass. |
48 | * | 48 | * |
49 | * Note: This table needs to be sorted, fastest to slowest. | 49 | * Note: This table needs to be sorted, fastest to slowest. |
50 | *-------------------------------------------------------------------------*/ | 50 | */ |
51 | const struct prcm_config omap2430_rate_table[] = { | 51 | const struct prcm_config omap2430_rate_table[] = { |
52 | /* PRCM #4 - ratio2 (ES2.1) - FAST */ | 52 | /* PRCM #4 - ratio2 (ES2.1) - FAST */ |
53 | {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */ | 53 | {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */ |
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h index ed6df04e2f29..38b730550506 100644 --- a/arch/arm/mach-omap2/opp2xxx.h +++ b/arch/arm/mach-omap2/opp2xxx.h | |||
@@ -417,7 +417,12 @@ struct prcm_config { | |||
417 | 417 | ||
418 | 418 | ||
419 | extern const struct prcm_config omap2420_rate_table[]; | 419 | extern const struct prcm_config omap2420_rate_table[]; |
420 | |||
421 | #ifdef CONFIG_ARCH_OMAP2430 | ||
420 | extern const struct prcm_config omap2430_rate_table[]; | 422 | extern const struct prcm_config omap2430_rate_table[]; |
423 | #else | ||
424 | #define omap2430_rate_table NULL | ||
425 | #endif | ||
421 | extern const struct prcm_config *rate_table; | 426 | extern const struct prcm_config *rate_table; |
422 | extern const struct prcm_config *curr_prcm_set; | 427 | extern const struct prcm_config *curr_prcm_set; |
423 | 428 | ||
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 860b755d2220..c18f7f2f19bc 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c | |||
@@ -54,8 +54,6 @@ int omap2_pm_debug; | |||
54 | regs[reg_count++].val = \ | 54 | regs[reg_count++].val = \ |
55 | __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off))) | 55 | __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off))) |
56 | 56 | ||
57 | static int __init pm_dbg_init(void); | ||
58 | |||
59 | void omap2_pm_dump(int mode, int resume, unsigned int us) | 57 | void omap2_pm_dump(int mode, int resume, unsigned int us) |
60 | { | 58 | { |
61 | struct reg { | 59 | struct reg { |
@@ -69,9 +67,9 @@ void omap2_pm_dump(int mode, int resume, unsigned int us) | |||
69 | #if 0 | 67 | #if 0 |
70 | /* MPU */ | 68 | /* MPU */ |
71 | DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET); | 69 | DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET); |
72 | DUMP_CM_MOD_REG(MPU_MOD, CM_CLKSTCTRL); | 70 | DUMP_CM_MOD_REG(MPU_MOD, OMAP2_CM_CLKSTCTRL); |
73 | DUMP_PRM_MOD_REG(MPU_MOD, PM_PWSTCTRL); | 71 | DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTCTRL); |
74 | DUMP_PRM_MOD_REG(MPU_MOD, PM_PWSTST); | 72 | DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTST); |
75 | DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP); | 73 | DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP); |
76 | #endif | 74 | #endif |
77 | #if 0 | 75 | #if 0 |
@@ -95,7 +93,7 @@ void omap2_pm_dump(int mode, int resume, unsigned int us) | |||
95 | DUMP_CM_MOD_REG(WKUP_MOD, CM_ICLKEN); | 93 | DUMP_CM_MOD_REG(WKUP_MOD, CM_ICLKEN); |
96 | DUMP_CM_MOD_REG(PLL_MOD, CM_CLKEN); | 94 | DUMP_CM_MOD_REG(PLL_MOD, CM_CLKEN); |
97 | DUMP_CM_MOD_REG(PLL_MOD, CM_AUTOIDLE); | 95 | DUMP_CM_MOD_REG(PLL_MOD, CM_AUTOIDLE); |
98 | DUMP_PRM_MOD_REG(CORE_MOD, PM_PWSTST); | 96 | DUMP_PRM_MOD_REG(CORE_MOD, OMAP2_PM_PWSTST); |
99 | #endif | 97 | #endif |
100 | #if 0 | 98 | #if 0 |
101 | /* DSP */ | 99 | /* DSP */ |
@@ -105,11 +103,11 @@ void omap2_pm_dump(int mode, int resume, unsigned int us) | |||
105 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_IDLEST); | 103 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_IDLEST); |
106 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE); | 104 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE); |
107 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL); | 105 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL); |
108 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSTCTRL); | 106 | DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_CM_CLKSTCTRL); |
109 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, RM_RSTCTRL); | 107 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTCTRL); |
110 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, RM_RSTST); | 108 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTST); |
111 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, PM_PWSTCTRL); | 109 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTCTRL); |
112 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, PM_PWSTST); | 110 | DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTST); |
113 | } | 111 | } |
114 | #endif | 112 | #endif |
115 | } else { | 113 | } else { |
@@ -167,6 +165,8 @@ struct dentry *pm_dbg_dir; | |||
167 | 165 | ||
168 | static int pm_dbg_init_done; | 166 | static int pm_dbg_init_done; |
169 | 167 | ||
168 | static int __init pm_dbg_init(void); | ||
169 | |||
170 | enum { | 170 | enum { |
171 | DEBUG_FILE_COUNTERS = 0, | 171 | DEBUG_FILE_COUNTERS = 0, |
172 | DEBUG_FILE_TIMERS, | 172 | DEBUG_FILE_TIMERS, |
@@ -385,6 +385,11 @@ static int pwrdm_dbg_show_counter(struct powerdomain *pwrdm, void *user) | |||
385 | seq_printf(s, ",%s:%d", pwrdm_state_names[i], | 385 | seq_printf(s, ",%s:%d", pwrdm_state_names[i], |
386 | pwrdm->state_counter[i]); | 386 | pwrdm->state_counter[i]); |
387 | 387 | ||
388 | seq_printf(s, ",RET-LOGIC-OFF:%d", pwrdm->ret_logic_off_counter); | ||
389 | for (i = 0; i < pwrdm->banks; i++) | ||
390 | seq_printf(s, ",RET-MEMBANK%d-OFF:%d", i + 1, | ||
391 | pwrdm->ret_mem_off_counter[i]); | ||
392 | |||
388 | seq_printf(s, "\n"); | 393 | seq_printf(s, "\n"); |
389 | 394 | ||
390 | return 0; | 395 | return 0; |
@@ -488,9 +493,11 @@ int pm_dbg_regset_init(int reg_set) | |||
488 | 493 | ||
489 | static int pwrdm_suspend_get(void *data, u64 *val) | 494 | static int pwrdm_suspend_get(void *data, u64 *val) |
490 | { | 495 | { |
491 | *val = omap3_pm_get_suspend_state((struct powerdomain *)data); | 496 | int ret; |
497 | ret = omap3_pm_get_suspend_state((struct powerdomain *)data); | ||
498 | *val = ret; | ||
492 | 499 | ||
493 | if (*val >= 0) | 500 | if (ret >= 0) |
494 | return 0; | 501 | return 0; |
495 | return *val; | 502 | return *val; |
496 | } | 503 | } |
@@ -575,7 +582,7 @@ static int __init pm_dbg_init(void) | |||
575 | (void) debugfs_create_file("time", S_IRUGO, | 582 | (void) debugfs_create_file("time", S_IRUGO, |
576 | d, (void *)DEBUG_FILE_TIMERS, &debug_fops); | 583 | d, (void *)DEBUG_FILE_TIMERS, &debug_fops); |
577 | 584 | ||
578 | pwrdm_for_each_nolock(pwrdms_setup, (void *)d); | 585 | pwrdm_for_each(pwrdms_setup, (void *)d); |
579 | 586 | ||
580 | pm_dbg_dir = debugfs_create_dir("registers", d); | 587 | pm_dbg_dir = debugfs_create_dir("registers", d); |
581 | if (IS_ERR(pm_dbg_dir)) | 588 | if (IS_ERR(pm_dbg_dir)) |
@@ -604,6 +611,4 @@ static int __init pm_dbg_init(void) | |||
604 | } | 611 | } |
605 | arch_initcall(pm_dbg_init); | 612 | arch_initcall(pm_dbg_init); |
606 | 613 | ||
607 | #else | ||
608 | void pm_dbg_update_time(struct powerdomain *pwrdm, int prev) {} | ||
609 | #endif | 614 | #endif |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 0bf345db7147..bd6466a2b039 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -23,6 +23,22 @@ extern int omap3_can_sleep(void); | |||
23 | extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); | 23 | extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); |
24 | extern int omap3_idle_init(void); | 24 | extern int omap3_idle_init(void); |
25 | 25 | ||
26 | struct cpuidle_params { | ||
27 | u8 valid; | ||
28 | u32 sleep_latency; | ||
29 | u32 wake_latency; | ||
30 | u32 threshold; | ||
31 | }; | ||
32 | |||
33 | #if defined(CONFIG_PM) && defined(CONFIG_CPU_IDLE) | ||
34 | extern void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params); | ||
35 | #else | ||
36 | static | ||
37 | inline void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) | ||
38 | { | ||
39 | } | ||
40 | #endif | ||
41 | |||
26 | extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); | 42 | extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); |
27 | extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); | 43 | extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); |
28 | 44 | ||
@@ -32,12 +48,20 @@ extern struct omap_dm_timer *gptimer_wakeup; | |||
32 | #ifdef CONFIG_PM_DEBUG | 48 | #ifdef CONFIG_PM_DEBUG |
33 | extern void omap2_pm_dump(int mode, int resume, unsigned int us); | 49 | extern void omap2_pm_dump(int mode, int resume, unsigned int us); |
34 | extern int omap2_pm_debug; | 50 | extern int omap2_pm_debug; |
51 | #else | ||
52 | #define omap2_pm_dump(mode, resume, us) do {} while (0); | ||
53 | #define omap2_pm_debug 0 | ||
54 | #endif | ||
55 | |||
56 | #if defined(CONFIG_CPU_IDLE) | ||
57 | extern void omap3_cpuidle_update_states(void); | ||
58 | #endif | ||
59 | |||
60 | #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) | ||
35 | extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev); | 61 | extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev); |
36 | extern int pm_dbg_regset_save(int reg_set); | 62 | extern int pm_dbg_regset_save(int reg_set); |
37 | extern int pm_dbg_regset_init(int reg_set); | 63 | extern int pm_dbg_regset_init(int reg_set); |
38 | #else | 64 | #else |
39 | #define omap2_pm_dump(mode, resume, us) do {} while (0); | ||
40 | #define omap2_pm_debug 0 | ||
41 | #define pm_dbg_update_time(pwrdm, prev) do {} while (0); | 65 | #define pm_dbg_update_time(pwrdm, prev) do {} while (0); |
42 | #define pm_dbg_regset_save(reg_set) do {} while (0); | 66 | #define pm_dbg_regset_save(reg_set) do {} while (0); |
43 | #define pm_dbg_regset_init(reg_set) do {} while (0); | 67 | #define pm_dbg_regset_init(reg_set) do {} while (0); |
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index cba05b9f041f..374299ea7ade 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -57,11 +57,8 @@ static void (*omap2_sram_idle)(void); | |||
57 | static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, | 57 | static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, |
58 | void __iomem *sdrc_power); | 58 | void __iomem *sdrc_power); |
59 | 59 | ||
60 | static struct powerdomain *mpu_pwrdm; | 60 | static struct powerdomain *mpu_pwrdm, *core_pwrdm; |
61 | static struct powerdomain *core_pwrdm; | 61 | static struct clockdomain *dsp_clkdm, *mpu_clkdm, *wkup_clkdm, *gfx_clkdm; |
62 | |||
63 | static struct clockdomain *dsp_clkdm; | ||
64 | static struct clockdomain *gfx_clkdm; | ||
65 | 62 | ||
66 | static struct clk *osc_ck, *emul_ck; | 63 | static struct clk *osc_ck, *emul_ck; |
67 | 64 | ||
@@ -219,11 +216,12 @@ static void omap2_enter_mpu_retention(void) | |||
219 | /* Try to enter MPU retention */ | 216 | /* Try to enter MPU retention */ |
220 | prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) | | 217 | prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) | |
221 | OMAP_LOGICRETSTATE, | 218 | OMAP_LOGICRETSTATE, |
222 | MPU_MOD, PM_PWSTCTRL); | 219 | MPU_MOD, OMAP2_PM_PWSTCTRL); |
223 | } else { | 220 | } else { |
224 | /* Block MPU retention */ | 221 | /* Block MPU retention */ |
225 | 222 | ||
226 | prm_write_mod_reg(OMAP_LOGICRETSTATE, MPU_MOD, PM_PWSTCTRL); | 223 | prm_write_mod_reg(OMAP_LOGICRETSTATE, MPU_MOD, |
224 | OMAP2_PM_PWSTCTRL); | ||
227 | only_idle = 1; | 225 | only_idle = 1; |
228 | } | 226 | } |
229 | 227 | ||
@@ -333,9 +331,17 @@ static struct platform_suspend_ops omap_pm_ops = { | |||
333 | .valid = suspend_valid_only_mem, | 331 | .valid = suspend_valid_only_mem, |
334 | }; | 332 | }; |
335 | 333 | ||
336 | static int _pm_clkdm_enable_hwsup(struct clockdomain *clkdm, void *unused) | 334 | /* XXX This function should be shareable between OMAP2xxx and OMAP3 */ |
335 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) | ||
337 | { | 336 | { |
338 | omap2_clkdm_allow_idle(clkdm); | 337 | clkdm_clear_all_wkdeps(clkdm); |
338 | clkdm_clear_all_sleepdeps(clkdm); | ||
339 | |||
340 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) | ||
341 | omap2_clkdm_allow_idle(clkdm); | ||
342 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && | ||
343 | atomic_read(&clkdm->usecount) == 0) | ||
344 | omap2_clkdm_sleep(clkdm); | ||
339 | return 0; | 345 | return 0; |
340 | } | 346 | } |
341 | 347 | ||
@@ -348,14 +354,6 @@ static void __init prcm_setup_regs(void) | |||
348 | prm_write_mod_reg(OMAP24XX_AUTOIDLE, OCP_MOD, | 354 | prm_write_mod_reg(OMAP24XX_AUTOIDLE, OCP_MOD, |
349 | OMAP2_PRCM_SYSCONFIG_OFFSET); | 355 | OMAP2_PRCM_SYSCONFIG_OFFSET); |
350 | 356 | ||
351 | /* Set all domain wakeup dependencies */ | ||
352 | prm_write_mod_reg(OMAP_EN_WKUP_MASK, MPU_MOD, PM_WKDEP); | ||
353 | prm_write_mod_reg(0, OMAP24XX_DSP_MOD, PM_WKDEP); | ||
354 | prm_write_mod_reg(0, GFX_MOD, PM_WKDEP); | ||
355 | prm_write_mod_reg(0, CORE_MOD, PM_WKDEP); | ||
356 | if (cpu_is_omap2430()) | ||
357 | prm_write_mod_reg(0, OMAP2430_MDM_MOD, PM_WKDEP); | ||
358 | |||
359 | /* | 357 | /* |
360 | * Set CORE powerdomain memory banks to retain their contents | 358 | * Set CORE powerdomain memory banks to retain their contents |
361 | * during RETENTION | 359 | * during RETENTION |
@@ -384,8 +382,12 @@ static void __init prcm_setup_regs(void) | |||
384 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); | 382 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); |
385 | omap2_clkdm_sleep(gfx_clkdm); | 383 | omap2_clkdm_sleep(gfx_clkdm); |
386 | 384 | ||
387 | /* Enable clockdomain hardware-supervised control for all clkdms */ | 385 | /* |
388 | clkdm_for_each(_pm_clkdm_enable_hwsup, NULL); | 386 | * Clear clockdomain wakeup dependencies and enable |
387 | * hardware-supervised idle for all clkdms | ||
388 | */ | ||
389 | clkdm_for_each(clkdms_setup, NULL); | ||
390 | clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); | ||
389 | 391 | ||
390 | /* Enable clock autoidle for all domains */ | 392 | /* Enable clock autoidle for all domains */ |
391 | cm_write_mod_reg(OMAP24XX_AUTO_CAM | | 393 | cm_write_mod_reg(OMAP24XX_AUTO_CAM | |
@@ -481,7 +483,7 @@ static int __init omap2_pm_init(void) | |||
481 | l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET); | 483 | l = prm_read_mod_reg(OCP_MOD, OMAP2_PRCM_REVISION_OFFSET); |
482 | printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); | 484 | printk(KERN_INFO "PRCM revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f); |
483 | 485 | ||
484 | /* Look up important powerdomains, clockdomains */ | 486 | /* Look up important powerdomains */ |
485 | 487 | ||
486 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); | 488 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); |
487 | if (!mpu_pwrdm) | 489 | if (!mpu_pwrdm) |
@@ -491,9 +493,19 @@ static int __init omap2_pm_init(void) | |||
491 | if (!core_pwrdm) | 493 | if (!core_pwrdm) |
492 | pr_err("PM: core_pwrdm not found\n"); | 494 | pr_err("PM: core_pwrdm not found\n"); |
493 | 495 | ||
496 | /* Look up important clockdomains */ | ||
497 | |||
498 | mpu_clkdm = clkdm_lookup("mpu_clkdm"); | ||
499 | if (!mpu_clkdm) | ||
500 | pr_err("PM: mpu_clkdm not found\n"); | ||
501 | |||
502 | wkup_clkdm = clkdm_lookup("wkup_clkdm"); | ||
503 | if (!wkup_clkdm) | ||
504 | pr_err("PM: wkup_clkdm not found\n"); | ||
505 | |||
494 | dsp_clkdm = clkdm_lookup("dsp_clkdm"); | 506 | dsp_clkdm = clkdm_lookup("dsp_clkdm"); |
495 | if (!dsp_clkdm) | 507 | if (!dsp_clkdm) |
496 | pr_err("PM: mpu_clkdm not found\n"); | 508 | pr_err("PM: dsp_clkdm not found\n"); |
497 | 509 | ||
498 | gfx_clkdm = clkdm_lookup("gfx_clkdm"); | 510 | gfx_clkdm = clkdm_lookup("gfx_clkdm"); |
499 | if (!gfx_clkdm) | 511 | if (!gfx_clkdm) |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 81ed252a0f8a..fee2efb172e7 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
27 | #include <linux/gpio.h> | 27 | #include <linux/gpio.h> |
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/delay.h> | ||
29 | 30 | ||
30 | #include <plat/sram.h> | 31 | #include <plat/sram.h> |
31 | #include <plat/clockdomain.h> | 32 | #include <plat/clockdomain.h> |
@@ -124,9 +125,17 @@ static void omap3_core_save_context(void) | |||
124 | control_padconf_off |= START_PADCONF_SAVE; | 125 | control_padconf_off |= START_PADCONF_SAVE; |
125 | omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); | 126 | omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); |
126 | /* wait for the save to complete */ | 127 | /* wait for the save to complete */ |
127 | while (!omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) | 128 | while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) |
128 | & PADCONF_SAVE_DONE) | 129 | & PADCONF_SAVE_DONE)) |
129 | ; | 130 | udelay(1); |
131 | |||
132 | /* | ||
133 | * Force write last pad into memory, as this can fail in some | ||
134 | * cases according to erratas 1.157, 1.185 | ||
135 | */ | ||
136 | omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14), | ||
137 | OMAP343X_CONTROL_MEM_WKUP + 0x2a0); | ||
138 | |||
130 | /* Save the Interrupt controller context */ | 139 | /* Save the Interrupt controller context */ |
131 | omap_intc_save_context(); | 140 | omap_intc_save_context(); |
132 | /* Save the GPMC context */ | 141 | /* Save the GPMC context */ |
@@ -392,6 +401,7 @@ void omap_sram_idle(void) | |||
392 | prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); | 401 | prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); |
393 | omap3_enable_io_chain(); | 402 | omap3_enable_io_chain(); |
394 | } | 403 | } |
404 | omap3_intc_prepare_idle(); | ||
395 | 405 | ||
396 | /* | 406 | /* |
397 | * On EMU/HS devices ROM code restores a SRDC value | 407 | * On EMU/HS devices ROM code restores a SRDC value |
@@ -438,6 +448,7 @@ void omap_sram_idle(void) | |||
438 | OMAP3430_GR_MOD, | 448 | OMAP3430_GR_MOD, |
439 | OMAP3_PRM_VOLTCTRL_OFFSET); | 449 | OMAP3_PRM_VOLTCTRL_OFFSET); |
440 | } | 450 | } |
451 | omap3_intc_resume_idle(); | ||
441 | 452 | ||
442 | /* PER */ | 453 | /* PER */ |
443 | if (per_next_state < PWRDM_POWER_ON) { | 454 | if (per_next_state < PWRDM_POWER_ON) { |
@@ -578,6 +589,8 @@ static int omap3_pm_suspend(void) | |||
578 | } | 589 | } |
579 | 590 | ||
580 | omap_uart_prepare_suspend(); | 591 | omap_uart_prepare_suspend(); |
592 | omap3_intc_suspend(); | ||
593 | |||
581 | omap_sram_idle(); | 594 | omap_sram_idle(); |
582 | 595 | ||
583 | restore: | 596 | restore: |
@@ -672,10 +685,10 @@ static void __init omap3_iva_idle(void) | |||
672 | prm_write_mod_reg(OMAP3430_RST1_IVA2 | | 685 | prm_write_mod_reg(OMAP3430_RST1_IVA2 | |
673 | OMAP3430_RST2_IVA2 | | 686 | OMAP3430_RST2_IVA2 | |
674 | OMAP3430_RST3_IVA2, | 687 | OMAP3430_RST3_IVA2, |
675 | OMAP3430_IVA2_MOD, RM_RSTCTRL); | 688 | OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); |
676 | 689 | ||
677 | /* Enable IVA2 clock */ | 690 | /* Enable IVA2 clock */ |
678 | cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2, | 691 | cm_write_mod_reg(OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_MASK, |
679 | OMAP3430_IVA2_MOD, CM_FCLKEN); | 692 | OMAP3430_IVA2_MOD, CM_FCLKEN); |
680 | 693 | ||
681 | /* Set IVA2 boot mode to 'idle' */ | 694 | /* Set IVA2 boot mode to 'idle' */ |
@@ -683,7 +696,7 @@ static void __init omap3_iva_idle(void) | |||
683 | OMAP343X_CONTROL_IVA2_BOOTMOD); | 696 | OMAP343X_CONTROL_IVA2_BOOTMOD); |
684 | 697 | ||
685 | /* Un-reset IVA2 */ | 698 | /* Un-reset IVA2 */ |
686 | prm_write_mod_reg(0, OMAP3430_IVA2_MOD, RM_RSTCTRL); | 699 | prm_write_mod_reg(0, OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); |
687 | 700 | ||
688 | /* Disable IVA2 clock */ | 701 | /* Disable IVA2 clock */ |
689 | cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); | 702 | cm_write_mod_reg(0, OMAP3430_IVA2_MOD, CM_FCLKEN); |
@@ -692,7 +705,7 @@ static void __init omap3_iva_idle(void) | |||
692 | prm_write_mod_reg(OMAP3430_RST1_IVA2 | | 705 | prm_write_mod_reg(OMAP3430_RST1_IVA2 | |
693 | OMAP3430_RST2_IVA2 | | 706 | OMAP3430_RST2_IVA2 | |
694 | OMAP3430_RST3_IVA2, | 707 | OMAP3430_RST3_IVA2, |
695 | OMAP3430_IVA2_MOD, RM_RSTCTRL); | 708 | OMAP3430_IVA2_MOD, OMAP2_RM_RSTCTRL); |
696 | } | 709 | } |
697 | 710 | ||
698 | static void __init omap3_d2d_idle(void) | 711 | static void __init omap3_d2d_idle(void) |
@@ -715,8 +728,8 @@ static void __init omap3_d2d_idle(void) | |||
715 | /* reset modem */ | 728 | /* reset modem */ |
716 | prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON | | 729 | prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON | |
717 | OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST, | 730 | OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST, |
718 | CORE_MOD, RM_RSTCTRL); | 731 | CORE_MOD, OMAP2_RM_RSTCTRL); |
719 | prm_write_mod_reg(0, CORE_MOD, RM_RSTCTRL); | 732 | prm_write_mod_reg(0, CORE_MOD, OMAP2_RM_RSTCTRL); |
720 | } | 733 | } |
721 | 734 | ||
722 | static void __init prcm_setup_regs(void) | 735 | static void __init prcm_setup_regs(void) |
@@ -835,6 +848,8 @@ static void __init prcm_setup_regs(void) | |||
835 | CM_AUTOIDLE); | 848 | CM_AUTOIDLE); |
836 | } | 849 | } |
837 | 850 | ||
851 | omap_ctrl_writel(OMAP3430_AUTOIDLE, OMAP2_CONTROL_SYSCONFIG); | ||
852 | |||
838 | /* | 853 | /* |
839 | * Set all plls to autoidle. This is needed until autoidle is | 854 | * Set all plls to autoidle. This is needed until autoidle is |
840 | * enabled by clockfw | 855 | * enabled by clockfw |
@@ -875,15 +890,23 @@ static void __init prcm_setup_regs(void) | |||
875 | prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN, | 890 | prm_write_mod_reg(OMAP3430_IO_EN | OMAP3430_WKUP_EN, |
876 | OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); | 891 | OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); |
877 | 892 | ||
893 | /* Enable PM_WKEN to support DSS LPR */ | ||
894 | prm_write_mod_reg(OMAP3430_PM_WKEN_DSS_EN_DSS, | ||
895 | OMAP3430_DSS_MOD, PM_WKEN); | ||
896 | |||
878 | /* Enable wakeups in PER */ | 897 | /* Enable wakeups in PER */ |
879 | prm_write_mod_reg(OMAP3430_EN_GPIO2 | OMAP3430_EN_GPIO3 | | 898 | prm_write_mod_reg(OMAP3430_EN_GPIO2 | OMAP3430_EN_GPIO3 | |
880 | OMAP3430_EN_GPIO4 | OMAP3430_EN_GPIO5 | | 899 | OMAP3430_EN_GPIO4 | OMAP3430_EN_GPIO5 | |
881 | OMAP3430_EN_GPIO6 | OMAP3430_EN_UART3, | 900 | OMAP3430_EN_GPIO6 | OMAP3430_EN_UART3 | |
901 | OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 | | ||
902 | OMAP3430_EN_MCBSP4, | ||
882 | OMAP3430_PER_MOD, PM_WKEN); | 903 | OMAP3430_PER_MOD, PM_WKEN); |
883 | /* and allow them to wake up MPU */ | 904 | /* and allow them to wake up MPU */ |
884 | prm_write_mod_reg(OMAP3430_GRPSEL_GPIO2 | OMAP3430_EN_GPIO3 | | 905 | prm_write_mod_reg(OMAP3430_GRPSEL_GPIO2 | OMAP3430_EN_GPIO3 | |
885 | OMAP3430_GRPSEL_GPIO4 | OMAP3430_EN_GPIO5 | | 906 | OMAP3430_GRPSEL_GPIO4 | OMAP3430_EN_GPIO5 | |
886 | OMAP3430_GRPSEL_GPIO6 | OMAP3430_EN_UART3, | 907 | OMAP3430_GRPSEL_GPIO6 | OMAP3430_EN_UART3 | |
908 | OMAP3430_EN_MCBSP2 | OMAP3430_EN_MCBSP3 | | ||
909 | OMAP3430_EN_MCBSP4, | ||
887 | OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL); | 910 | OMAP3430_PER_MOD, OMAP3430_PM_MPUGRPSEL); |
888 | 911 | ||
889 | /* Don't attach IVA interrupts */ | 912 | /* Don't attach IVA interrupts */ |
@@ -893,31 +916,13 @@ static void __init prcm_setup_regs(void) | |||
893 | prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL); | 916 | prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL); |
894 | 917 | ||
895 | /* Clear any pending 'reset' flags */ | 918 | /* Clear any pending 'reset' flags */ |
896 | prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST); | 919 | prm_write_mod_reg(0xffffffff, MPU_MOD, OMAP2_RM_RSTST); |
897 | prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST); | 920 | prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP2_RM_RSTST); |
898 | prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST); | 921 | prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, OMAP2_RM_RSTST); |
899 | prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST); | 922 | prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, OMAP2_RM_RSTST); |
900 | prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST); | 923 | prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, OMAP2_RM_RSTST); |
901 | prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST); | 924 | prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, OMAP2_RM_RSTST); |
902 | prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST); | 925 | prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, OMAP2_RM_RSTST); |
903 | |||
904 | /* Clear any pending PRCM interrupts */ | ||
905 | prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); | ||
906 | |||
907 | /* Don't attach IVA interrupts */ | ||
908 | prm_write_mod_reg(0, WKUP_MOD, OMAP3430_PM_IVAGRPSEL); | ||
909 | prm_write_mod_reg(0, CORE_MOD, OMAP3430_PM_IVAGRPSEL1); | ||
910 | prm_write_mod_reg(0, CORE_MOD, OMAP3430ES2_PM_IVAGRPSEL3); | ||
911 | prm_write_mod_reg(0, OMAP3430_PER_MOD, OMAP3430_PM_IVAGRPSEL); | ||
912 | |||
913 | /* Clear any pending 'reset' flags */ | ||
914 | prm_write_mod_reg(0xffffffff, MPU_MOD, RM_RSTST); | ||
915 | prm_write_mod_reg(0xffffffff, CORE_MOD, RM_RSTST); | ||
916 | prm_write_mod_reg(0xffffffff, OMAP3430_PER_MOD, RM_RSTST); | ||
917 | prm_write_mod_reg(0xffffffff, OMAP3430_EMU_MOD, RM_RSTST); | ||
918 | prm_write_mod_reg(0xffffffff, OMAP3430_NEON_MOD, RM_RSTST); | ||
919 | prm_write_mod_reg(0xffffffff, OMAP3430_DSS_MOD, RM_RSTST); | ||
920 | prm_write_mod_reg(0xffffffff, OMAP3430ES2_USBHOST_MOD, RM_RSTST); | ||
921 | 926 | ||
922 | /* Clear any pending PRCM interrupts */ | 927 | /* Clear any pending PRCM interrupts */ |
923 | prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); | 928 | prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); |
@@ -936,6 +941,10 @@ void omap3_pm_off_mode_enable(int enable) | |||
936 | else | 941 | else |
937 | state = PWRDM_POWER_RET; | 942 | state = PWRDM_POWER_RET; |
938 | 943 | ||
944 | #ifdef CONFIG_CPU_IDLE | ||
945 | omap3_cpuidle_update_states(); | ||
946 | #endif | ||
947 | |||
939 | list_for_each_entry(pwrst, &pwrst_list, node) { | 948 | list_for_each_entry(pwrst, &pwrst_list, node) { |
940 | pwrst->next_state = state; | 949 | pwrst->next_state = state; |
941 | set_pwrdm_state(pwrst->pwrdm, state); | 950 | set_pwrdm_state(pwrst->pwrdm, state); |
@@ -993,6 +1002,9 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | |||
993 | */ | 1002 | */ |
994 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) | 1003 | static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) |
995 | { | 1004 | { |
1005 | clkdm_clear_all_wkdeps(clkdm); | ||
1006 | clkdm_clear_all_sleepdeps(clkdm); | ||
1007 | |||
996 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) | 1008 | if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) |
997 | omap2_clkdm_allow_idle(clkdm); | 1009 | omap2_clkdm_allow_idle(clkdm); |
998 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && | 1010 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && |
@@ -1013,6 +1025,7 @@ void omap_push_sram_idle(void) | |||
1013 | static int __init omap3_pm_init(void) | 1025 | static int __init omap3_pm_init(void) |
1014 | { | 1026 | { |
1015 | struct power_state *pwrst, *tmp; | 1027 | struct power_state *pwrst, *tmp; |
1028 | struct clockdomain *neon_clkdm, *per_clkdm, *mpu_clkdm, *core_clkdm; | ||
1016 | int ret; | 1029 | int ret; |
1017 | 1030 | ||
1018 | if (!cpu_is_omap34xx()) | 1031 | if (!cpu_is_omap34xx()) |
@@ -1052,6 +1065,11 @@ static int __init omap3_pm_init(void) | |||
1052 | core_pwrdm = pwrdm_lookup("core_pwrdm"); | 1065 | core_pwrdm = pwrdm_lookup("core_pwrdm"); |
1053 | cam_pwrdm = pwrdm_lookup("cam_pwrdm"); | 1066 | cam_pwrdm = pwrdm_lookup("cam_pwrdm"); |
1054 | 1067 | ||
1068 | neon_clkdm = clkdm_lookup("neon_clkdm"); | ||
1069 | mpu_clkdm = clkdm_lookup("mpu_clkdm"); | ||
1070 | per_clkdm = clkdm_lookup("per_clkdm"); | ||
1071 | core_clkdm = clkdm_lookup("core_clkdm"); | ||
1072 | |||
1055 | omap_push_sram_idle(); | 1073 | omap_push_sram_idle(); |
1056 | #ifdef CONFIG_SUSPEND | 1074 | #ifdef CONFIG_SUSPEND |
1057 | suspend_set_ops(&omap_pm_ops); | 1075 | suspend_set_ops(&omap_pm_ops); |
@@ -1060,14 +1078,14 @@ static int __init omap3_pm_init(void) | |||
1060 | pm_idle = omap3_pm_idle; | 1078 | pm_idle = omap3_pm_idle; |
1061 | omap3_idle_init(); | 1079 | omap3_idle_init(); |
1062 | 1080 | ||
1063 | pwrdm_add_wkdep(neon_pwrdm, mpu_pwrdm); | 1081 | clkdm_add_wkdep(neon_clkdm, mpu_clkdm); |
1064 | /* | 1082 | /* |
1065 | * REVISIT: This wkdep is only necessary when GPIO2-6 are enabled for | 1083 | * REVISIT: This wkdep is only necessary when GPIO2-6 are enabled for |
1066 | * IO-pad wakeup. Otherwise it will unnecessarily waste power | 1084 | * IO-pad wakeup. Otherwise it will unnecessarily waste power |
1067 | * waking up PER with every CORE wakeup - see | 1085 | * waking up PER with every CORE wakeup - see |
1068 | * http://marc.info/?l=linux-omap&m=121852150710062&w=2 | 1086 | * http://marc.info/?l=linux-omap&m=121852150710062&w=2 |
1069 | */ | 1087 | */ |
1070 | pwrdm_add_wkdep(per_pwrdm, core_pwrdm); | 1088 | clkdm_add_wkdep(per_clkdm, core_clkdm); |
1071 | 1089 | ||
1072 | if (omap_type() != OMAP2_DEVICE_TYPE_GP) { | 1090 | if (omap_type() != OMAP2_DEVICE_TYPE_GP) { |
1073 | omap3_secure_ram_storage = | 1091 | omap3_secure_ram_storage = |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 26b3f3ee82a3..9a0fb385622b 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -2,10 +2,12 @@ | |||
2 | * OMAP powerdomain control | 2 | * OMAP powerdomain control |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2008 Nokia Corporation | 5 | * Copyright (C) 2007-2009 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
8 | * | 8 | * |
9 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> | ||
10 | * | ||
9 | * 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 |
10 | * 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 |
11 | * published by the Free Software Foundation. | 13 | * published by the Free Software Foundation. |
@@ -26,12 +28,15 @@ | |||
26 | 28 | ||
27 | #include "cm.h" | 29 | #include "cm.h" |
28 | #include "cm-regbits-34xx.h" | 30 | #include "cm-regbits-34xx.h" |
31 | #include "cm-regbits-44xx.h" | ||
29 | #include "prm.h" | 32 | #include "prm.h" |
30 | #include "prm-regbits-34xx.h" | 33 | #include "prm-regbits-34xx.h" |
34 | #include "prm-regbits-44xx.h" | ||
31 | 35 | ||
32 | #include <plat/cpu.h> | 36 | #include <plat/cpu.h> |
33 | #include <plat/powerdomain.h> | 37 | #include <plat/powerdomain.h> |
34 | #include <plat/clockdomain.h> | 38 | #include <plat/clockdomain.h> |
39 | #include <plat/prcm.h> | ||
35 | 40 | ||
36 | #include "pm.h" | 41 | #include "pm.h" |
37 | 42 | ||
@@ -40,28 +45,42 @@ enum { | |||
40 | PWRDM_STATE_PREV, | 45 | PWRDM_STATE_PREV, |
41 | }; | 46 | }; |
42 | 47 | ||
43 | /* pwrdm_list contains all registered struct powerdomains */ | 48 | /* Variable holding value of the CPU dependent PWRSTCTRL Register Offset */ |
44 | static LIST_HEAD(pwrdm_list); | 49 | static u16 pwrstctrl_reg_offs; |
45 | 50 | ||
46 | /* | 51 | /* Variable holding value of the CPU dependent PWRSTST Register Offset */ |
47 | * pwrdm_rwlock protects pwrdm_list add and del ops - also reused to | 52 | static u16 pwrstst_reg_offs; |
48 | * protect pwrdm_clkdms[] during clkdm add/del ops | ||
49 | */ | ||
50 | static DEFINE_RWLOCK(pwrdm_rwlock); | ||
51 | 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 | */ | ||
52 | 58 | ||
53 | /* Private functions */ | 59 | /* OMAP3 and OMAP4 Memory Onstate Masks (common across all power domains) */ |
54 | 60 | #define OMAP_MEM0_ONSTATE_MASK OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK | |
55 | static u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) | 61 | #define OMAP_MEM1_ONSTATE_MASK OMAP3430_L1FLATMEMONSTATE_MASK |
56 | { | 62 | #define OMAP_MEM2_ONSTATE_MASK OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK |
57 | u32 v; | 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 | ||
68 | #define OMAP_MEM1_RETSTATE_MASK OMAP3430_L1FLATMEMRETSTATE | ||
69 | #define OMAP_MEM2_RETSTATE_MASK OMAP3430_SHAREDL2CACHEFLATRETSTATE | ||
70 | #define OMAP_MEM3_RETSTATE_MASK OMAP3430_L2FLATMEMRETSTATE | ||
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 | ||
58 | 79 | ||
59 | v = prm_read_mod_reg(domain, idx); | 80 | /* pwrdm_list contains all registered struct powerdomains */ |
60 | v &= mask; | 81 | static LIST_HEAD(pwrdm_list); |
61 | v >>= __ffs(mask); | ||
62 | 82 | ||
63 | return v; | 83 | /* Private functions */ |
64 | } | ||
65 | 84 | ||
66 | static struct powerdomain *_pwrdm_lookup(const char *name) | 85 | static struct powerdomain *_pwrdm_lookup(const char *name) |
67 | { | 86 | { |
@@ -79,32 +98,63 @@ static struct powerdomain *_pwrdm_lookup(const char *name) | |||
79 | return pwrdm; | 98 | return pwrdm; |
80 | } | 99 | } |
81 | 100 | ||
82 | /* _pwrdm_deps_lookup - look up the specified powerdomain in a pwrdm list */ | 101 | /** |
83 | static struct powerdomain *_pwrdm_deps_lookup(struct powerdomain *pwrdm, | 102 | * _pwrdm_register - register a powerdomain |
84 | struct pwrdm_dep *deps) | 103 | * @pwrdm: struct powerdomain * to register |
104 | * | ||
105 | * Adds a powerdomain to the internal powerdomain list. Returns | ||
106 | * -EINVAL if given a null pointer, -EEXIST if a powerdomain is | ||
107 | * already registered by the provided name, or 0 upon success. | ||
108 | */ | ||
109 | static int _pwrdm_register(struct powerdomain *pwrdm) | ||
85 | { | 110 | { |
86 | struct pwrdm_dep *pd; | 111 | int i; |
112 | |||
113 | if (!pwrdm) | ||
114 | return -EINVAL; | ||
115 | |||
116 | if (!omap_chip_is(pwrdm->omap_chip)) | ||
117 | return -EINVAL; | ||
87 | 118 | ||
88 | if (!pwrdm || !deps || !omap_chip_is(pwrdm->omap_chip)) | 119 | if (_pwrdm_lookup(pwrdm->name)) |
89 | return ERR_PTR(-EINVAL); | 120 | return -EEXIST; |
90 | 121 | ||
91 | for (pd = deps; pd->pwrdm_name; pd++) { | 122 | list_add(&pwrdm->node, &pwrdm_list); |
92 | 123 | ||
93 | if (!omap_chip_is(pd->omap_chip)) | 124 | /* Initialize the powerdomain's state counter */ |
94 | continue; | 125 | for (i = 0; i < PWRDM_MAX_PWRSTS; i++) |
126 | pwrdm->state_counter[i] = 0; | ||
95 | 127 | ||
96 | if (!pd->pwrdm && pd->pwrdm_name) | 128 | pwrdm->ret_logic_off_counter = 0; |
97 | pd->pwrdm = pwrdm_lookup(pd->pwrdm_name); | 129 | for (i = 0; i < pwrdm->banks; i++) |
130 | pwrdm->ret_mem_off_counter[i] = 0; | ||
98 | 131 | ||
99 | if (pd->pwrdm == pwrdm) | 132 | pwrdm_wait_transition(pwrdm); |
100 | break; | 133 | pwrdm->state = pwrdm_read_pwrst(pwrdm); |
134 | pwrdm->state_counter[pwrdm->state] = 1; | ||
101 | 135 | ||
102 | } | 136 | pr_debug("powerdomain: registered %s\n", pwrdm->name); |
103 | 137 | ||
104 | if (!pd->pwrdm_name) | 138 | return 0; |
105 | return ERR_PTR(-ENOENT); | 139 | } |
106 | 140 | ||
107 | return pd->pwrdm; | 141 | static void _update_logic_membank_counters(struct powerdomain *pwrdm) |
142 | { | ||
143 | int i; | ||
144 | u8 prev_logic_pwrst, prev_mem_pwrst; | ||
145 | |||
146 | prev_logic_pwrst = pwrdm_read_prev_logic_pwrst(pwrdm); | ||
147 | if ((pwrdm->pwrsts_logic_ret == PWRSTS_OFF_RET) && | ||
148 | (prev_logic_pwrst == PWRDM_POWER_OFF)) | ||
149 | pwrdm->ret_logic_off_counter++; | ||
150 | |||
151 | for (i = 0; i < pwrdm->banks; i++) { | ||
152 | prev_mem_pwrst = pwrdm_read_prev_mem_pwrst(pwrdm, i); | ||
153 | |||
154 | if ((pwrdm->pwrsts_mem_ret[i] == PWRSTS_OFF_RET) && | ||
155 | (prev_mem_pwrst == PWRDM_POWER_OFF)) | ||
156 | pwrdm->ret_mem_off_counter[i]++; | ||
157 | } | ||
108 | } | 158 | } |
109 | 159 | ||
110 | static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) | 160 | static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) |
@@ -126,6 +176,8 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) | |||
126 | prev = pwrdm_read_prev_pwrst(pwrdm); | 176 | prev = pwrdm_read_prev_pwrst(pwrdm); |
127 | if (pwrdm->state != prev) | 177 | if (pwrdm->state != prev) |
128 | pwrdm->state_counter[prev]++; | 178 | pwrdm->state_counter[prev]++; |
179 | if (prev == PWRDM_POWER_RET) | ||
180 | _update_logic_membank_counters(pwrdm); | ||
129 | break; | 181 | break; |
130 | default: | 182 | default: |
131 | return -EINVAL; | 183 | return -EINVAL; |
@@ -154,134 +206,71 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) | |||
154 | return 0; | 206 | return 0; |
155 | } | 207 | } |
156 | 208 | ||
157 | static __init void _pwrdm_setup(struct powerdomain *pwrdm) | ||
158 | { | ||
159 | int i; | ||
160 | |||
161 | for (i = 0; i < PWRDM_MAX_PWRSTS; i++) | ||
162 | pwrdm->state_counter[i] = 0; | ||
163 | |||
164 | pwrdm_wait_transition(pwrdm); | ||
165 | pwrdm->state = pwrdm_read_pwrst(pwrdm); | ||
166 | pwrdm->state_counter[pwrdm->state] = 1; | ||
167 | |||
168 | } | ||
169 | |||
170 | /* Public functions */ | 209 | /* Public functions */ |
171 | 210 | ||
172 | /** | 211 | /** |
173 | * pwrdm_init - set up the powerdomain layer | 212 | * pwrdm_init - set up the powerdomain layer |
213 | * @pwrdm_list: array of struct powerdomain pointers to register | ||
174 | * | 214 | * |
175 | * Loop through the list of powerdomains, registering all that are | 215 | * Loop through the array of powerdomains @pwrdm_list, registering all |
176 | * available on the current CPU. If pwrdm_list is supplied and not | 216 | * that are available on the current CPU. If pwrdm_list is supplied |
177 | * null, all of the referenced powerdomains will be registered. No | 217 | * and not null, all of the referenced powerdomains will be |
178 | * return value. | 218 | * registered. No return value. XXX pwrdm_list is not really a |
219 | * "list"; it is an array. Rename appropriately. | ||
179 | */ | 220 | */ |
180 | void pwrdm_init(struct powerdomain **pwrdm_list) | 221 | void pwrdm_init(struct powerdomain **pwrdm_list) |
181 | { | 222 | { |
182 | struct powerdomain **p = NULL; | 223 | struct powerdomain **p = NULL; |
183 | 224 | ||
184 | if (pwrdm_list) { | 225 | if (cpu_is_omap24xx() | cpu_is_omap34xx()) { |
185 | for (p = pwrdm_list; *p; p++) { | 226 | pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL; |
186 | pwrdm_register(*p); | 227 | pwrstst_reg_offs = OMAP2_PM_PWSTST; |
187 | _pwrdm_setup(*p); | 228 | } else if (cpu_is_omap44xx()) { |
188 | } | 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; | ||
189 | } | 235 | } |
190 | } | ||
191 | |||
192 | /** | ||
193 | * pwrdm_register - register a powerdomain | ||
194 | * @pwrdm: struct powerdomain * to register | ||
195 | * | ||
196 | * Adds a powerdomain to the internal powerdomain list. Returns | ||
197 | * -EINVAL if given a null pointer, -EEXIST if a powerdomain is | ||
198 | * already registered by the provided name, or 0 upon success. | ||
199 | */ | ||
200 | int pwrdm_register(struct powerdomain *pwrdm) | ||
201 | { | ||
202 | unsigned long flags; | ||
203 | int ret = -EINVAL; | ||
204 | |||
205 | if (!pwrdm) | ||
206 | return -EINVAL; | ||
207 | 236 | ||
208 | if (!omap_chip_is(pwrdm->omap_chip)) | 237 | if (pwrdm_list) { |
209 | return -EINVAL; | 238 | for (p = pwrdm_list; *p; p++) |
210 | 239 | _pwrdm_register(*p); | |
211 | write_lock_irqsave(&pwrdm_rwlock, flags); | ||
212 | if (_pwrdm_lookup(pwrdm->name)) { | ||
213 | ret = -EEXIST; | ||
214 | goto pr_unlock; | ||
215 | } | 240 | } |
216 | |||
217 | list_add(&pwrdm->node, &pwrdm_list); | ||
218 | |||
219 | pr_debug("powerdomain: registered %s\n", pwrdm->name); | ||
220 | ret = 0; | ||
221 | |||
222 | pr_unlock: | ||
223 | write_unlock_irqrestore(&pwrdm_rwlock, flags); | ||
224 | |||
225 | return ret; | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * pwrdm_unregister - unregister a powerdomain | ||
230 | * @pwrdm: struct powerdomain * to unregister | ||
231 | * | ||
232 | * Removes a powerdomain from the internal powerdomain list. Returns | ||
233 | * -EINVAL if pwrdm argument is NULL. | ||
234 | */ | ||
235 | int pwrdm_unregister(struct powerdomain *pwrdm) | ||
236 | { | ||
237 | unsigned long flags; | ||
238 | |||
239 | if (!pwrdm) | ||
240 | return -EINVAL; | ||
241 | |||
242 | write_lock_irqsave(&pwrdm_rwlock, flags); | ||
243 | list_del(&pwrdm->node); | ||
244 | write_unlock_irqrestore(&pwrdm_rwlock, flags); | ||
245 | |||
246 | pr_debug("powerdomain: unregistered %s\n", pwrdm->name); | ||
247 | |||
248 | return 0; | ||
249 | } | 241 | } |
250 | 242 | ||
251 | /** | 243 | /** |
252 | * pwrdm_lookup - look up a powerdomain by name, return a pointer | 244 | * pwrdm_lookup - look up a powerdomain by name, return a pointer |
253 | * @name: name of powerdomain | 245 | * @name: name of powerdomain |
254 | * | 246 | * |
255 | * Find a registered powerdomain by its name. Returns a pointer to the | 247 | * Find a registered powerdomain by its name @name. Returns a pointer |
256 | * struct powerdomain if found, or NULL otherwise. | 248 | * to the struct powerdomain if found, or NULL otherwise. |
257 | */ | 249 | */ |
258 | struct powerdomain *pwrdm_lookup(const char *name) | 250 | struct powerdomain *pwrdm_lookup(const char *name) |
259 | { | 251 | { |
260 | struct powerdomain *pwrdm; | 252 | struct powerdomain *pwrdm; |
261 | unsigned long flags; | ||
262 | 253 | ||
263 | if (!name) | 254 | if (!name) |
264 | return NULL; | 255 | return NULL; |
265 | 256 | ||
266 | read_lock_irqsave(&pwrdm_rwlock, flags); | ||
267 | pwrdm = _pwrdm_lookup(name); | 257 | pwrdm = _pwrdm_lookup(name); |
268 | read_unlock_irqrestore(&pwrdm_rwlock, flags); | ||
269 | 258 | ||
270 | return pwrdm; | 259 | return pwrdm; |
271 | } | 260 | } |
272 | 261 | ||
273 | /** | 262 | /** |
274 | * pwrdm_for_each_nolock - call function on each registered clockdomain | 263 | * pwrdm_for_each - call function on each registered clockdomain |
275 | * @fn: callback function * | 264 | * @fn: callback function * |
276 | * | 265 | * |
277 | * Call the supplied function for each registered powerdomain. The | 266 | * Call the supplied function @fn for each registered powerdomain. |
278 | * callback function can return anything but 0 to bail out early from | 267 | * The callback function @fn can return anything but 0 to bail out |
279 | * the iterator. Returns the last return value of the callback function, which | 268 | * early from the iterator. Returns the last return value of the |
280 | * should be 0 for success or anything else to indicate failure; or -EINVAL if | 269 | * callback function, which should be 0 for success or anything else |
281 | * the function pointer is null. | 270 | * to indicate failure; or -EINVAL if the function pointer is null. |
282 | */ | 271 | */ |
283 | int pwrdm_for_each_nolock(int (*fn)(struct powerdomain *pwrdm, void *user), | 272 | int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm, void *user), |
284 | void *user) | 273 | void *user) |
285 | { | 274 | { |
286 | struct powerdomain *temp_pwrdm; | 275 | struct powerdomain *temp_pwrdm; |
287 | int ret = 0; | 276 | int ret = 0; |
@@ -299,40 +288,17 @@ int pwrdm_for_each_nolock(int (*fn)(struct powerdomain *pwrdm, void *user), | |||
299 | } | 288 | } |
300 | 289 | ||
301 | /** | 290 | /** |
302 | * pwrdm_for_each - call function on each registered clockdomain | ||
303 | * @fn: callback function * | ||
304 | * | ||
305 | * This function is the same as 'pwrdm_for_each_nolock()', but keeps the | ||
306 | * &pwrdm_rwlock locked for reading, so no powerdomain structure manipulation | ||
307 | * functions should be called from the callback, although hardware powerdomain | ||
308 | * control functions are fine. | ||
309 | */ | ||
310 | int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm, void *user), | ||
311 | void *user) | ||
312 | { | ||
313 | unsigned long flags; | ||
314 | int ret; | ||
315 | |||
316 | read_lock_irqsave(&pwrdm_rwlock, flags); | ||
317 | ret = pwrdm_for_each_nolock(fn, user); | ||
318 | read_unlock_irqrestore(&pwrdm_rwlock, flags); | ||
319 | |||
320 | return ret; | ||
321 | } | ||
322 | |||
323 | /** | ||
324 | * pwrdm_add_clkdm - add a clockdomain to a powerdomain | 291 | * pwrdm_add_clkdm - add a clockdomain to a powerdomain |
325 | * @pwrdm: struct powerdomain * to add the clockdomain to | 292 | * @pwrdm: struct powerdomain * to add the clockdomain to |
326 | * @clkdm: struct clockdomain * to associate with a powerdomain | 293 | * @clkdm: struct clockdomain * to associate with a powerdomain |
327 | * | 294 | * |
328 | * Associate the clockdomain 'clkdm' with a powerdomain 'pwrdm'. This | 295 | * Associate the clockdomain @clkdm with a powerdomain @pwrdm. This |
329 | * enables the use of pwrdm_for_each_clkdm(). Returns -EINVAL if | 296 | * enables the use of pwrdm_for_each_clkdm(). Returns -EINVAL if |
330 | * presented with invalid pointers; -ENOMEM if memory could not be allocated; | 297 | * presented with invalid pointers; -ENOMEM if memory could not be allocated; |
331 | * or 0 upon success. | 298 | * or 0 upon success. |
332 | */ | 299 | */ |
333 | int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | 300 | int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) |
334 | { | 301 | { |
335 | unsigned long flags; | ||
336 | int i; | 302 | int i; |
337 | int ret = -EINVAL; | 303 | int ret = -EINVAL; |
338 | 304 | ||
@@ -342,8 +308,6 @@ int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | |||
342 | pr_debug("powerdomain: associating clockdomain %s with powerdomain " | 308 | pr_debug("powerdomain: associating clockdomain %s with powerdomain " |
343 | "%s\n", clkdm->name, pwrdm->name); | 309 | "%s\n", clkdm->name, pwrdm->name); |
344 | 310 | ||
345 | write_lock_irqsave(&pwrdm_rwlock, flags); | ||
346 | |||
347 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) { | 311 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) { |
348 | if (!pwrdm->pwrdm_clkdms[i]) | 312 | if (!pwrdm->pwrdm_clkdms[i]) |
349 | break; | 313 | break; |
@@ -368,8 +332,6 @@ int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | |||
368 | ret = 0; | 332 | ret = 0; |
369 | 333 | ||
370 | pac_exit: | 334 | pac_exit: |
371 | write_unlock_irqrestore(&pwrdm_rwlock, flags); | ||
372 | |||
373 | return ret; | 335 | return ret; |
374 | } | 336 | } |
375 | 337 | ||
@@ -378,14 +340,13 @@ pac_exit: | |||
378 | * @pwrdm: struct powerdomain * to add the clockdomain to | 340 | * @pwrdm: struct powerdomain * to add the clockdomain to |
379 | * @clkdm: struct clockdomain * to associate with a powerdomain | 341 | * @clkdm: struct clockdomain * to associate with a powerdomain |
380 | * | 342 | * |
381 | * Dissociate the clockdomain 'clkdm' from the powerdomain | 343 | * Dissociate the clockdomain @clkdm from the powerdomain |
382 | * 'pwrdm'. Returns -EINVAL if presented with invalid pointers; | 344 | * @pwrdm. Returns -EINVAL if presented with invalid pointers; -ENOENT |
383 | * -ENOENT if the clkdm was not associated with the powerdomain, or 0 | 345 | * if @clkdm was not associated with the powerdomain, or 0 upon |
384 | * upon success. | 346 | * success. |
385 | */ | 347 | */ |
386 | int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | 348 | int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) |
387 | { | 349 | { |
388 | unsigned long flags; | ||
389 | int ret = -EINVAL; | 350 | int ret = -EINVAL; |
390 | int i; | 351 | int i; |
391 | 352 | ||
@@ -395,8 +356,6 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | |||
395 | pr_debug("powerdomain: dissociating clockdomain %s from powerdomain " | 356 | pr_debug("powerdomain: dissociating clockdomain %s from powerdomain " |
396 | "%s\n", clkdm->name, pwrdm->name); | 357 | "%s\n", clkdm->name, pwrdm->name); |
397 | 358 | ||
398 | write_lock_irqsave(&pwrdm_rwlock, flags); | ||
399 | |||
400 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) | 359 | for (i = 0; i < PWRDM_MAX_CLKDMS; i++) |
401 | if (pwrdm->pwrdm_clkdms[i] == clkdm) | 360 | if (pwrdm->pwrdm_clkdms[i] == clkdm) |
402 | break; | 361 | break; |
@@ -413,8 +372,6 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm) | |||
413 | ret = 0; | 372 | ret = 0; |
414 | 373 | ||
415 | pdc_exit: | 374 | pdc_exit: |
416 | write_unlock_irqrestore(&pwrdm_rwlock, flags); | ||
417 | |||
418 | return ret; | 375 | return ret; |
419 | } | 376 | } |
420 | 377 | ||
@@ -423,259 +380,34 @@ pdc_exit: | |||
423 | * @pwrdm: struct powerdomain * to iterate over | 380 | * @pwrdm: struct powerdomain * to iterate over |
424 | * @fn: callback function * | 381 | * @fn: callback function * |
425 | * | 382 | * |
426 | * Call the supplied function for each clockdomain in the powerdomain | 383 | * Call the supplied function @fn for each clockdomain in the powerdomain |
427 | * 'pwrdm'. The callback function can return anything but 0 to bail | 384 | * @pwrdm. The callback function can return anything but 0 to bail |
428 | * out early from the iterator. The callback function is called with | 385 | * out early from the iterator. Returns -EINVAL if presented with |
429 | * the pwrdm_rwlock held for reading, so no powerdomain structure | 386 | * invalid pointers; or passes along the last return value of the |
430 | * manipulation functions should be called from the callback, although | 387 | * callback function, which should be 0 for success or anything else |
431 | * hardware powerdomain control functions are fine. Returns -EINVAL | 388 | * to indicate failure. |
432 | * if presented with invalid pointers; or passes along the last return | ||
433 | * value of the callback function, which should be 0 for success or | ||
434 | * anything else to indicate failure. | ||
435 | */ | 389 | */ |
436 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, | 390 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, |
437 | int (*fn)(struct powerdomain *pwrdm, | 391 | int (*fn)(struct powerdomain *pwrdm, |
438 | struct clockdomain *clkdm)) | 392 | struct clockdomain *clkdm)) |
439 | { | 393 | { |
440 | unsigned long flags; | ||
441 | int ret = 0; | 394 | int ret = 0; |
442 | int i; | 395 | int i; |
443 | 396 | ||
444 | if (!fn) | 397 | if (!fn) |
445 | return -EINVAL; | 398 | return -EINVAL; |
446 | 399 | ||
447 | read_lock_irqsave(&pwrdm_rwlock, flags); | ||
448 | |||
449 | for (i = 0; i < PWRDM_MAX_CLKDMS && !ret; i++) | 400 | for (i = 0; i < PWRDM_MAX_CLKDMS && !ret; i++) |
450 | ret = (*fn)(pwrdm, pwrdm->pwrdm_clkdms[i]); | 401 | ret = (*fn)(pwrdm, pwrdm->pwrdm_clkdms[i]); |
451 | 402 | ||
452 | read_unlock_irqrestore(&pwrdm_rwlock, flags); | ||
453 | |||
454 | return ret; | 403 | return ret; |
455 | } | 404 | } |
456 | 405 | ||
457 | |||
458 | /** | ||
459 | * pwrdm_add_wkdep - add a wakeup dependency from pwrdm2 to pwrdm1 | ||
460 | * @pwrdm1: wake this struct powerdomain * up (dependent) | ||
461 | * @pwrdm2: when this struct powerdomain * wakes up (source) | ||
462 | * | ||
463 | * When the powerdomain represented by pwrdm2 wakes up (due to an | ||
464 | * interrupt), wake up pwrdm1. Implemented in hardware on the OMAP, | ||
465 | * this feature is designed to reduce wakeup latency of the dependent | ||
466 | * powerdomain. Returns -EINVAL if presented with invalid powerdomain | ||
467 | * pointers, -ENOENT if pwrdm2 cannot wake up pwrdm1 in hardware, or | ||
468 | * 0 upon success. | ||
469 | */ | ||
470 | int pwrdm_add_wkdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2) | ||
471 | { | ||
472 | struct powerdomain *p; | ||
473 | |||
474 | if (!pwrdm1) | ||
475 | return -EINVAL; | ||
476 | |||
477 | p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->wkdep_srcs); | ||
478 | if (IS_ERR(p)) { | ||
479 | pr_debug("powerdomain: hardware cannot set/clear wake up of " | ||
480 | "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name); | ||
481 | return PTR_ERR(p); | ||
482 | } | ||
483 | |||
484 | pr_debug("powerdomain: hardware will wake up %s when %s wakes up\n", | ||
485 | pwrdm1->name, pwrdm2->name); | ||
486 | |||
487 | prm_set_mod_reg_bits((1 << pwrdm2->dep_bit), | ||
488 | pwrdm1->prcm_offs, PM_WKDEP); | ||
489 | |||
490 | return 0; | ||
491 | } | ||
492 | |||
493 | /** | ||
494 | * pwrdm_del_wkdep - remove a wakeup dependency from pwrdm2 to pwrdm1 | ||
495 | * @pwrdm1: wake this struct powerdomain * up (dependent) | ||
496 | * @pwrdm2: when this struct powerdomain * wakes up (source) | ||
497 | * | ||
498 | * Remove a wakeup dependency that causes pwrdm1 to wake up when pwrdm2 | ||
499 | * wakes up. Returns -EINVAL if presented with invalid powerdomain | ||
500 | * pointers, -ENOENT if pwrdm2 cannot wake up pwrdm1 in hardware, or | ||
501 | * 0 upon success. | ||
502 | */ | ||
503 | int pwrdm_del_wkdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2) | ||
504 | { | ||
505 | struct powerdomain *p; | ||
506 | |||
507 | if (!pwrdm1) | ||
508 | return -EINVAL; | ||
509 | |||
510 | p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->wkdep_srcs); | ||
511 | if (IS_ERR(p)) { | ||
512 | pr_debug("powerdomain: hardware cannot set/clear wake up of " | ||
513 | "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name); | ||
514 | return PTR_ERR(p); | ||
515 | } | ||
516 | |||
517 | pr_debug("powerdomain: hardware will no longer wake up %s after %s " | ||
518 | "wakes up\n", pwrdm1->name, pwrdm2->name); | ||
519 | |||
520 | prm_clear_mod_reg_bits((1 << pwrdm2->dep_bit), | ||
521 | pwrdm1->prcm_offs, PM_WKDEP); | ||
522 | |||
523 | return 0; | ||
524 | } | ||
525 | |||
526 | /** | ||
527 | * pwrdm_read_wkdep - read wakeup dependency state from pwrdm2 to pwrdm1 | ||
528 | * @pwrdm1: wake this struct powerdomain * up (dependent) | ||
529 | * @pwrdm2: when this struct powerdomain * wakes up (source) | ||
530 | * | ||
531 | * Return 1 if a hardware wakeup dependency exists wherein pwrdm1 will be | ||
532 | * awoken when pwrdm2 wakes up; 0 if dependency is not set; -EINVAL | ||
533 | * if either powerdomain pointer is invalid; or -ENOENT if the hardware | ||
534 | * is incapable. | ||
535 | * | ||
536 | * REVISIT: Currently this function only represents software-controllable | ||
537 | * wakeup dependencies. Wakeup dependencies fixed in hardware are not | ||
538 | * yet handled here. | ||
539 | */ | ||
540 | int pwrdm_read_wkdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2) | ||
541 | { | ||
542 | struct powerdomain *p; | ||
543 | |||
544 | if (!pwrdm1) | ||
545 | return -EINVAL; | ||
546 | |||
547 | p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->wkdep_srcs); | ||
548 | if (IS_ERR(p)) { | ||
549 | pr_debug("powerdomain: hardware cannot set/clear wake up of " | ||
550 | "%s when %s wakes up\n", pwrdm1->name, pwrdm2->name); | ||
551 | return PTR_ERR(p); | ||
552 | } | ||
553 | |||
554 | return prm_read_mod_bits_shift(pwrdm1->prcm_offs, PM_WKDEP, | ||
555 | (1 << pwrdm2->dep_bit)); | ||
556 | } | ||
557 | |||
558 | /** | ||
559 | * pwrdm_add_sleepdep - add a sleep dependency from pwrdm2 to pwrdm1 | ||
560 | * @pwrdm1: prevent this struct powerdomain * from sleeping (dependent) | ||
561 | * @pwrdm2: when this struct powerdomain * is active (source) | ||
562 | * | ||
563 | * Prevent pwrdm1 from automatically going inactive (and then to | ||
564 | * retention or off) if pwrdm2 is still active. Returns -EINVAL if | ||
565 | * presented with invalid powerdomain pointers or called on a machine | ||
566 | * that does not support software-configurable hardware sleep dependencies, | ||
567 | * -ENOENT if the specified dependency cannot be set in hardware, or | ||
568 | * 0 upon success. | ||
569 | */ | ||
570 | int pwrdm_add_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2) | ||
571 | { | ||
572 | struct powerdomain *p; | ||
573 | |||
574 | if (!cpu_is_omap34xx()) | ||
575 | return -EINVAL; | ||
576 | |||
577 | if (!pwrdm1) | ||
578 | return -EINVAL; | ||
579 | |||
580 | p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs); | ||
581 | if (IS_ERR(p)) { | ||
582 | pr_debug("powerdomain: hardware cannot set/clear sleep " | ||
583 | "dependency affecting %s from %s\n", pwrdm1->name, | ||
584 | pwrdm2->name); | ||
585 | return PTR_ERR(p); | ||
586 | } | ||
587 | |||
588 | pr_debug("powerdomain: will prevent %s from sleeping if %s is active\n", | ||
589 | pwrdm1->name, pwrdm2->name); | ||
590 | |||
591 | cm_set_mod_reg_bits((1 << pwrdm2->dep_bit), | ||
592 | pwrdm1->prcm_offs, OMAP3430_CM_SLEEPDEP); | ||
593 | |||
594 | return 0; | ||
595 | } | ||
596 | |||
597 | /** | ||
598 | * pwrdm_del_sleepdep - remove a sleep dependency from pwrdm2 to pwrdm1 | ||
599 | * @pwrdm1: prevent this struct powerdomain * from sleeping (dependent) | ||
600 | * @pwrdm2: when this struct powerdomain * is active (source) | ||
601 | * | ||
602 | * Allow pwrdm1 to automatically go inactive (and then to retention or | ||
603 | * off), independent of the activity state of pwrdm2. Returns -EINVAL | ||
604 | * if presented with invalid powerdomain pointers or called on a machine | ||
605 | * that does not support software-configurable hardware sleep dependencies, | ||
606 | * -ENOENT if the specified dependency cannot be cleared in hardware, or | ||
607 | * 0 upon success. | ||
608 | */ | ||
609 | int pwrdm_del_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2) | ||
610 | { | ||
611 | struct powerdomain *p; | ||
612 | |||
613 | if (!cpu_is_omap34xx()) | ||
614 | return -EINVAL; | ||
615 | |||
616 | if (!pwrdm1) | ||
617 | return -EINVAL; | ||
618 | |||
619 | p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs); | ||
620 | if (IS_ERR(p)) { | ||
621 | pr_debug("powerdomain: hardware cannot set/clear sleep " | ||
622 | "dependency affecting %s from %s\n", pwrdm1->name, | ||
623 | pwrdm2->name); | ||
624 | return PTR_ERR(p); | ||
625 | } | ||
626 | |||
627 | pr_debug("powerdomain: will no longer prevent %s from sleeping if " | ||
628 | "%s is active\n", pwrdm1->name, pwrdm2->name); | ||
629 | |||
630 | cm_clear_mod_reg_bits((1 << pwrdm2->dep_bit), | ||
631 | pwrdm1->prcm_offs, OMAP3430_CM_SLEEPDEP); | ||
632 | |||
633 | return 0; | ||
634 | } | ||
635 | |||
636 | /** | ||
637 | * pwrdm_read_sleepdep - read sleep dependency state from pwrdm2 to pwrdm1 | ||
638 | * @pwrdm1: prevent this struct powerdomain * from sleeping (dependent) | ||
639 | * @pwrdm2: when this struct powerdomain * is active (source) | ||
640 | * | ||
641 | * Return 1 if a hardware sleep dependency exists wherein pwrdm1 will | ||
642 | * not be allowed to automatically go inactive if pwrdm2 is active; | ||
643 | * 0 if pwrdm1's automatic power state inactivity transition is independent | ||
644 | * of pwrdm2's; -EINVAL if either powerdomain pointer is invalid or called | ||
645 | * on a machine that does not support software-configurable hardware sleep | ||
646 | * dependencies; or -ENOENT if the hardware is incapable. | ||
647 | * | ||
648 | * REVISIT: Currently this function only represents software-controllable | ||
649 | * sleep dependencies. Sleep dependencies fixed in hardware are not | ||
650 | * yet handled here. | ||
651 | */ | ||
652 | int pwrdm_read_sleepdep(struct powerdomain *pwrdm1, struct powerdomain *pwrdm2) | ||
653 | { | ||
654 | struct powerdomain *p; | ||
655 | |||
656 | if (!cpu_is_omap34xx()) | ||
657 | return -EINVAL; | ||
658 | |||
659 | if (!pwrdm1) | ||
660 | return -EINVAL; | ||
661 | |||
662 | p = _pwrdm_deps_lookup(pwrdm2, pwrdm1->sleepdep_srcs); | ||
663 | if (IS_ERR(p)) { | ||
664 | pr_debug("powerdomain: hardware cannot set/clear sleep " | ||
665 | "dependency affecting %s from %s\n", pwrdm1->name, | ||
666 | pwrdm2->name); | ||
667 | return PTR_ERR(p); | ||
668 | } | ||
669 | |||
670 | return prm_read_mod_bits_shift(pwrdm1->prcm_offs, OMAP3430_CM_SLEEPDEP, | ||
671 | (1 << pwrdm2->dep_bit)); | ||
672 | } | ||
673 | |||
674 | /** | 406 | /** |
675 | * pwrdm_get_mem_bank_count - get number of memory banks in this powerdomain | 407 | * pwrdm_get_mem_bank_count - get number of memory banks in this powerdomain |
676 | * @pwrdm: struct powerdomain * | 408 | * @pwrdm: struct powerdomain * |
677 | * | 409 | * |
678 | * Return the number of controllable memory banks in powerdomain pwrdm, | 410 | * Return the number of controllable memory banks in powerdomain @pwrdm, |
679 | * starting with 1. Returns -EINVAL if the powerdomain pointer is null. | 411 | * starting with 1. Returns -EINVAL if the powerdomain pointer is null. |
680 | */ | 412 | */ |
681 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm) | 413 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm) |
@@ -691,7 +423,7 @@ int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm) | |||
691 | * @pwrdm: struct powerdomain * to set | 423 | * @pwrdm: struct powerdomain * to set |
692 | * @pwrst: one of the PWRDM_POWER_* macros | 424 | * @pwrst: one of the PWRDM_POWER_* macros |
693 | * | 425 | * |
694 | * Set the powerdomain pwrdm's next power state to pwrst. The powerdomain | 426 | * Set the powerdomain @pwrdm's next power state to @pwrst. The powerdomain |
695 | * may not enter this state immediately if the preconditions for this state | 427 | * may not enter this state immediately if the preconditions for this state |
696 | * have not been satisfied. Returns -EINVAL if the powerdomain pointer is | 428 | * have not been satisfied. Returns -EINVAL if the powerdomain pointer is |
697 | * null or if the power state is invalid for the powerdomin, or returns 0 | 429 | * null or if the power state is invalid for the powerdomin, or returns 0 |
@@ -710,7 +442,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) | |||
710 | 442 | ||
711 | prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, | 443 | prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, |
712 | (pwrst << OMAP_POWERSTATE_SHIFT), | 444 | (pwrst << OMAP_POWERSTATE_SHIFT), |
713 | pwrdm->prcm_offs, PM_PWSTCTRL); | 445 | pwrdm->prcm_offs, pwrstctrl_reg_offs); |
714 | 446 | ||
715 | return 0; | 447 | return 0; |
716 | } | 448 | } |
@@ -719,7 +451,7 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) | |||
719 | * pwrdm_read_next_pwrst - get next powerdomain power state | 451 | * pwrdm_read_next_pwrst - get next powerdomain power state |
720 | * @pwrdm: struct powerdomain * to get power state | 452 | * @pwrdm: struct powerdomain * to get power state |
721 | * | 453 | * |
722 | * Return the powerdomain pwrdm's next power state. Returns -EINVAL | 454 | * Return the powerdomain @pwrdm's next power state. Returns -EINVAL |
723 | * if the powerdomain pointer is null or returns the next power state | 455 | * if the powerdomain pointer is null or returns the next power state |
724 | * upon success. | 456 | * upon success. |
725 | */ | 457 | */ |
@@ -728,15 +460,15 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm) | |||
728 | if (!pwrdm) | 460 | if (!pwrdm) |
729 | return -EINVAL; | 461 | return -EINVAL; |
730 | 462 | ||
731 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTCTRL, | 463 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, |
732 | OMAP_POWERSTATE_MASK); | 464 | pwrstctrl_reg_offs, OMAP_POWERSTATE_MASK); |
733 | } | 465 | } |
734 | 466 | ||
735 | /** | 467 | /** |
736 | * pwrdm_read_pwrst - get current powerdomain power state | 468 | * pwrdm_read_pwrst - get current powerdomain power state |
737 | * @pwrdm: struct powerdomain * to get power state | 469 | * @pwrdm: struct powerdomain * to get power state |
738 | * | 470 | * |
739 | * Return the powerdomain pwrdm's current power state. Returns -EINVAL | 471 | * Return the powerdomain @pwrdm's current power state. Returns -EINVAL |
740 | * if the powerdomain pointer is null or returns the current power state | 472 | * if the powerdomain pointer is null or returns the current power state |
741 | * upon success. | 473 | * upon success. |
742 | */ | 474 | */ |
@@ -745,15 +477,15 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm) | |||
745 | if (!pwrdm) | 477 | if (!pwrdm) |
746 | return -EINVAL; | 478 | return -EINVAL; |
747 | 479 | ||
748 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTST, | 480 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, |
749 | OMAP_POWERSTATEST_MASK); | 481 | pwrstst_reg_offs, OMAP_POWERSTATEST_MASK); |
750 | } | 482 | } |
751 | 483 | ||
752 | /** | 484 | /** |
753 | * pwrdm_read_prev_pwrst - get previous powerdomain power state | 485 | * pwrdm_read_prev_pwrst - get previous powerdomain power state |
754 | * @pwrdm: struct powerdomain * to get previous power state | 486 | * @pwrdm: struct powerdomain * to get previous power state |
755 | * | 487 | * |
756 | * Return the powerdomain pwrdm's previous power state. Returns -EINVAL | 488 | * Return the powerdomain @pwrdm's previous power state. Returns -EINVAL |
757 | * if the powerdomain pointer is null or returns the previous power state | 489 | * if the powerdomain pointer is null or returns the previous power state |
758 | * upon success. | 490 | * upon success. |
759 | */ | 491 | */ |
@@ -771,11 +503,11 @@ int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) | |||
771 | * @pwrdm: struct powerdomain * to set | 503 | * @pwrdm: struct powerdomain * to set |
772 | * @pwrst: one of the PWRDM_POWER_* macros | 504 | * @pwrst: one of the PWRDM_POWER_* macros |
773 | * | 505 | * |
774 | * Set the next power state that the logic portion of the powerdomain | 506 | * Set the next power state @pwrst that the logic portion of the |
775 | * pwrdm will enter when the powerdomain enters retention. This will | 507 | * powerdomain @pwrdm will enter when the powerdomain enters retention. |
776 | * be either RETENTION or OFF, if supported. Returns -EINVAL if the | 508 | * This will be either RETENTION or OFF, if supported. Returns |
777 | * powerdomain pointer is null or the target power state is not not | 509 | * -EINVAL if the powerdomain pointer is null or the target power |
778 | * supported, or returns 0 upon success. | 510 | * state is not not supported, or returns 0 upon success. |
779 | */ | 511 | */ |
780 | int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) | 512 | int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) |
781 | { | 513 | { |
@@ -796,7 +528,7 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) | |||
796 | */ | 528 | */ |
797 | prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE, | 529 | prm_rmw_mod_reg_bits(OMAP3430_LOGICL1CACHERETSTATE, |
798 | (pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE)), | 530 | (pwrst << __ffs(OMAP3430_LOGICL1CACHERETSTATE)), |
799 | pwrdm->prcm_offs, PM_PWSTCTRL); | 531 | pwrdm->prcm_offs, pwrstctrl_reg_offs); |
800 | 532 | ||
801 | return 0; | 533 | return 0; |
802 | } | 534 | } |
@@ -807,13 +539,14 @@ int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst) | |||
807 | * @bank: memory bank number to set (0-3) | 539 | * @bank: memory bank number to set (0-3) |
808 | * @pwrst: one of the PWRDM_POWER_* macros | 540 | * @pwrst: one of the PWRDM_POWER_* macros |
809 | * | 541 | * |
810 | * Set the next power state that memory bank x of the powerdomain | 542 | * Set the next power state @pwrst that memory bank @bank of the |
811 | * pwrdm will enter when the powerdomain enters the ON state. Bank | 543 | * powerdomain @pwrdm will enter when the powerdomain enters the ON |
812 | * will be a number from 0 to 3, and represents different types of | 544 | * state. @bank will be a number from 0 to 3, and represents different |
813 | * memory, depending on the powerdomain. Returns -EINVAL if the | 545 | * types of memory, depending on the powerdomain. Returns -EINVAL if |
814 | * powerdomain pointer is null or the target power state is not not | 546 | * the powerdomain pointer is null or the target power state is not |
815 | * supported for this memory bank, -EEXIST if the target memory bank | 547 | * not supported for this memory bank, -EEXIST if the target memory |
816 | * does not exist or is not controllable, or returns 0 upon success. | 548 | * bank does not exist or is not controllable, or returns 0 upon |
549 | * success. | ||
817 | */ | 550 | */ |
818 | int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | 551 | int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) |
819 | { | 552 | { |
@@ -839,16 +572,19 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
839 | */ | 572 | */ |
840 | switch (bank) { | 573 | switch (bank) { |
841 | case 0: | 574 | case 0: |
842 | m = OMAP3430_SHAREDL1CACHEFLATONSTATE_MASK; | 575 | m = OMAP_MEM0_ONSTATE_MASK; |
843 | break; | 576 | break; |
844 | case 1: | 577 | case 1: |
845 | m = OMAP3430_L1FLATMEMONSTATE_MASK; | 578 | m = OMAP_MEM1_ONSTATE_MASK; |
846 | break; | 579 | break; |
847 | case 2: | 580 | case 2: |
848 | m = OMAP3430_SHAREDL2CACHEFLATONSTATE_MASK; | 581 | m = OMAP_MEM2_ONSTATE_MASK; |
849 | break; | 582 | break; |
850 | case 3: | 583 | case 3: |
851 | m = OMAP3430_L2FLATMEMONSTATE_MASK; | 584 | m = OMAP_MEM3_ONSTATE_MASK; |
585 | break; | ||
586 | case 4: | ||
587 | m = OMAP_MEM4_ONSTATE_MASK; | ||
852 | break; | 588 | break; |
853 | default: | 589 | default: |
854 | WARN_ON(1); /* should never happen */ | 590 | WARN_ON(1); /* should never happen */ |
@@ -856,7 +592,7 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
856 | } | 592 | } |
857 | 593 | ||
858 | prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), | 594 | prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), |
859 | pwrdm->prcm_offs, PM_PWSTCTRL); | 595 | pwrdm->prcm_offs, pwrstctrl_reg_offs); |
860 | 596 | ||
861 | return 0; | 597 | return 0; |
862 | } | 598 | } |
@@ -867,14 +603,15 @@ int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
867 | * @bank: memory bank number to set (0-3) | 603 | * @bank: memory bank number to set (0-3) |
868 | * @pwrst: one of the PWRDM_POWER_* macros | 604 | * @pwrst: one of the PWRDM_POWER_* macros |
869 | * | 605 | * |
870 | * Set the next power state that memory bank x of the powerdomain | 606 | * Set the next power state @pwrst that memory bank @bank of the |
871 | * pwrdm will enter when the powerdomain enters the RETENTION state. | 607 | * powerdomain @pwrdm will enter when the powerdomain enters the |
872 | * Bank will be a number from 0 to 3, and represents different types | 608 | * RETENTION state. Bank will be a number from 0 to 3, and represents |
873 | * of memory, depending on the powerdomain. pwrst will be either | 609 | * different types of memory, depending on the powerdomain. @pwrst |
874 | * RETENTION or OFF, if supported. Returns -EINVAL if the powerdomain | 610 | * will be either RETENTION or OFF, if supported. Returns -EINVAL if |
875 | * pointer is null or the target power state is not not supported for | 611 | * the powerdomain pointer is null or the target power state is not |
876 | * this memory bank, -EEXIST if the target memory bank does not exist | 612 | * not supported for this memory bank, -EEXIST if the target memory |
877 | * or is not controllable, or returns 0 upon success. | 613 | * bank does not exist or is not controllable, or returns 0 upon |
614 | * success. | ||
878 | */ | 615 | */ |
879 | int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | 616 | int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) |
880 | { | 617 | { |
@@ -900,16 +637,19 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
900 | */ | 637 | */ |
901 | switch (bank) { | 638 | switch (bank) { |
902 | case 0: | 639 | case 0: |
903 | m = OMAP3430_SHAREDL1CACHEFLATRETSTATE; | 640 | m = OMAP_MEM0_RETSTATE_MASK; |
904 | break; | 641 | break; |
905 | case 1: | 642 | case 1: |
906 | m = OMAP3430_L1FLATMEMRETSTATE; | 643 | m = OMAP_MEM1_RETSTATE_MASK; |
907 | break; | 644 | break; |
908 | case 2: | 645 | case 2: |
909 | m = OMAP3430_SHAREDL2CACHEFLATRETSTATE; | 646 | m = OMAP_MEM2_RETSTATE_MASK; |
910 | break; | 647 | break; |
911 | case 3: | 648 | case 3: |
912 | m = OMAP3430_L2FLATMEMRETSTATE; | 649 | m = OMAP_MEM3_RETSTATE_MASK; |
650 | break; | ||
651 | case 4: | ||
652 | m = OMAP_MEM4_RETSTATE_MASK; | ||
913 | break; | 653 | break; |
914 | default: | 654 | default: |
915 | WARN_ON(1); /* should never happen */ | 655 | WARN_ON(1); /* should never happen */ |
@@ -917,7 +657,7 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
917 | } | 657 | } |
918 | 658 | ||
919 | prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs, | 659 | prm_rmw_mod_reg_bits(m, (pwrst << __ffs(m)), pwrdm->prcm_offs, |
920 | PM_PWSTCTRL); | 660 | pwrstctrl_reg_offs); |
921 | 661 | ||
922 | return 0; | 662 | return 0; |
923 | } | 663 | } |
@@ -926,27 +666,27 @@ int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst) | |||
926 | * pwrdm_read_logic_pwrst - get current powerdomain logic retention power state | 666 | * pwrdm_read_logic_pwrst - get current powerdomain logic retention power state |
927 | * @pwrdm: struct powerdomain * to get current logic retention power state | 667 | * @pwrdm: struct powerdomain * to get current logic retention power state |
928 | * | 668 | * |
929 | * Return the current power state that the logic portion of | 669 | * Return the power state that the logic portion of powerdomain @pwrdm |
930 | * powerdomain pwrdm will enter | 670 | * will enter when the powerdomain enters retention. Returns -EINVAL |
931 | * Returns -EINVAL if the powerdomain pointer is null or returns the | 671 | * if the powerdomain pointer is null or returns the logic retention |
932 | * current logic retention power state upon success. | 672 | * power state upon success. |
933 | */ | 673 | */ |
934 | int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) | 674 | int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm) |
935 | { | 675 | { |
936 | if (!pwrdm) | 676 | if (!pwrdm) |
937 | return -EINVAL; | 677 | return -EINVAL; |
938 | 678 | ||
939 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTST, | 679 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, |
940 | OMAP3430_LOGICSTATEST); | 680 | pwrstst_reg_offs, OMAP3430_LOGICSTATEST); |
941 | } | 681 | } |
942 | 682 | ||
943 | /** | 683 | /** |
944 | * pwrdm_read_prev_logic_pwrst - get previous powerdomain logic power state | 684 | * pwrdm_read_prev_logic_pwrst - get previous powerdomain logic power state |
945 | * @pwrdm: struct powerdomain * to get previous logic power state | 685 | * @pwrdm: struct powerdomain * to get previous logic power state |
946 | * | 686 | * |
947 | * Return the powerdomain pwrdm's logic power state. Returns -EINVAL | 687 | * Return the powerdomain @pwrdm's previous logic power state. Returns |
948 | * if the powerdomain pointer is null or returns the previous logic | 688 | * -EINVAL if the powerdomain pointer is null or returns the previous |
949 | * power state upon success. | 689 | * logic power state upon success. |
950 | */ | 690 | */ |
951 | int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm) | 691 | int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm) |
952 | { | 692 | { |
@@ -964,12 +704,35 @@ int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm) | |||
964 | } | 704 | } |
965 | 705 | ||
966 | /** | 706 | /** |
707 | * pwrdm_read_logic_retst - get next powerdomain logic power state | ||
708 | * @pwrdm: struct powerdomain * to get next logic power state | ||
709 | * | ||
710 | * Return the powerdomain pwrdm's logic power state. Returns -EINVAL | ||
711 | * if the powerdomain pointer is null or returns the next logic | ||
712 | * power state upon success. | ||
713 | */ | ||
714 | int pwrdm_read_logic_retst(struct powerdomain *pwrdm) | ||
715 | { | ||
716 | if (!pwrdm) | ||
717 | return -EINVAL; | ||
718 | |||
719 | /* | ||
720 | * The register bit names below may not correspond to the | ||
721 | * actual names of the bits in each powerdomain's register, | ||
722 | * but the type of value returned is the same for each | ||
723 | * powerdomain. | ||
724 | */ | ||
725 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, pwrstctrl_reg_offs, | ||
726 | OMAP3430_LOGICSTATEST); | ||
727 | } | ||
728 | |||
729 | /** | ||
967 | * pwrdm_read_mem_pwrst - get current memory bank power state | 730 | * pwrdm_read_mem_pwrst - get current memory bank power state |
968 | * @pwrdm: struct powerdomain * to get current memory bank power state | 731 | * @pwrdm: struct powerdomain * to get current memory bank power state |
969 | * @bank: memory bank number (0-3) | 732 | * @bank: memory bank number (0-3) |
970 | * | 733 | * |
971 | * Return the powerdomain pwrdm's current memory power state for bank | 734 | * Return the powerdomain @pwrdm's current memory power state for bank |
972 | * x. Returns -EINVAL if the powerdomain pointer is null, -EEXIST if | 735 | * @bank. Returns -EINVAL if the powerdomain pointer is null, -EEXIST if |
973 | * the target memory bank does not exist or is not controllable, or | 736 | * the target memory bank does not exist or is not controllable, or |
974 | * returns the current memory power state upon success. | 737 | * returns the current memory power state upon success. |
975 | */ | 738 | */ |
@@ -994,23 +757,27 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank) | |||
994 | */ | 757 | */ |
995 | switch (bank) { | 758 | switch (bank) { |
996 | case 0: | 759 | case 0: |
997 | m = OMAP3430_SHAREDL1CACHEFLATSTATEST_MASK; | 760 | m = OMAP_MEM0_STATEST_MASK; |
998 | break; | 761 | break; |
999 | case 1: | 762 | case 1: |
1000 | m = OMAP3430_L1FLATMEMSTATEST_MASK; | 763 | m = OMAP_MEM1_STATEST_MASK; |
1001 | break; | 764 | break; |
1002 | case 2: | 765 | case 2: |
1003 | m = OMAP3430_SHAREDL2CACHEFLATSTATEST_MASK; | 766 | m = OMAP_MEM2_STATEST_MASK; |
1004 | break; | 767 | break; |
1005 | case 3: | 768 | case 3: |
1006 | m = OMAP3430_L2FLATMEMSTATEST_MASK; | 769 | m = OMAP_MEM3_STATEST_MASK; |
770 | break; | ||
771 | case 4: | ||
772 | m = OMAP_MEM4_STATEST_MASK; | ||
1007 | break; | 773 | break; |
1008 | default: | 774 | default: |
1009 | WARN_ON(1); /* should never happen */ | 775 | WARN_ON(1); /* should never happen */ |
1010 | return -EEXIST; | 776 | return -EEXIST; |
1011 | } | 777 | } |
1012 | 778 | ||
1013 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, PM_PWSTST, m); | 779 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, |
780 | pwrstst_reg_offs, m); | ||
1014 | } | 781 | } |
1015 | 782 | ||
1016 | /** | 783 | /** |
@@ -1018,10 +785,11 @@ int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank) | |||
1018 | * @pwrdm: struct powerdomain * to get previous memory bank power state | 785 | * @pwrdm: struct powerdomain * to get previous memory bank power state |
1019 | * @bank: memory bank number (0-3) | 786 | * @bank: memory bank number (0-3) |
1020 | * | 787 | * |
1021 | * Return the powerdomain pwrdm's previous memory power state for bank | 788 | * Return the powerdomain @pwrdm's previous memory power state for |
1022 | * x. Returns -EINVAL if the powerdomain pointer is null, -EEXIST if | 789 | * bank @bank. Returns -EINVAL if the powerdomain pointer is null, |
1023 | * the target memory bank does not exist or is not controllable, or | 790 | * -EEXIST if the target memory bank does not exist or is not |
1024 | * returns the previous memory power state upon success. | 791 | * controllable, or returns the previous memory power state upon |
792 | * success. | ||
1025 | */ | 793 | */ |
1026 | int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank) | 794 | int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank) |
1027 | { | 795 | { |
@@ -1065,13 +833,63 @@ int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank) | |||
1065 | } | 833 | } |
1066 | 834 | ||
1067 | /** | 835 | /** |
836 | * pwrdm_read_mem_retst - get next memory bank power state | ||
837 | * @pwrdm: struct powerdomain * to get mext memory bank power state | ||
838 | * @bank: memory bank number (0-3) | ||
839 | * | ||
840 | * Return the powerdomain pwrdm's next memory power state for bank | ||
841 | * x. Returns -EINVAL if the powerdomain pointer is null, -EEXIST if | ||
842 | * the target memory bank does not exist or is not controllable, or | ||
843 | * returns the next memory power state upon success. | ||
844 | */ | ||
845 | int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank) | ||
846 | { | ||
847 | u32 m; | ||
848 | |||
849 | if (!pwrdm) | ||
850 | return -EINVAL; | ||
851 | |||
852 | if (pwrdm->banks < (bank + 1)) | ||
853 | return -EEXIST; | ||
854 | |||
855 | /* | ||
856 | * The register bit names below may not correspond to the | ||
857 | * actual names of the bits in each powerdomain's register, | ||
858 | * but the type of value returned is the same for each | ||
859 | * powerdomain. | ||
860 | */ | ||
861 | switch (bank) { | ||
862 | case 0: | ||
863 | m = OMAP_MEM0_RETSTATE_MASK; | ||
864 | break; | ||
865 | case 1: | ||
866 | m = OMAP_MEM1_RETSTATE_MASK; | ||
867 | break; | ||
868 | case 2: | ||
869 | m = OMAP_MEM2_RETSTATE_MASK; | ||
870 | break; | ||
871 | case 3: | ||
872 | m = OMAP_MEM3_RETSTATE_MASK; | ||
873 | break; | ||
874 | case 4: | ||
875 | m = OMAP_MEM4_RETSTATE_MASK; | ||
876 | default: | ||
877 | WARN_ON(1); /* should never happen */ | ||
878 | return -EEXIST; | ||
879 | } | ||
880 | |||
881 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, | ||
882 | pwrstctrl_reg_offs, m); | ||
883 | } | ||
884 | |||
885 | /** | ||
1068 | * pwrdm_clear_all_prev_pwrst - clear previous powerstate register for a pwrdm | 886 | * pwrdm_clear_all_prev_pwrst - clear previous powerstate register for a pwrdm |
1069 | * @pwrdm: struct powerdomain * to clear | 887 | * @pwrdm: struct powerdomain * to clear |
1070 | * | 888 | * |
1071 | * Clear the powerdomain's previous power state register. Clears the | 889 | * Clear the powerdomain's previous power state register @pwrdm. |
1072 | * entire register, including logic and memory bank previous power states. | 890 | * Clears the entire register, including logic and memory bank |
1073 | * Returns -EINVAL if the powerdomain pointer is null, or returns 0 upon | 891 | * previous power states. Returns -EINVAL if the powerdomain pointer |
1074 | * success. | 892 | * is null, or returns 0 upon success. |
1075 | */ | 893 | */ |
1076 | int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm) | 894 | int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm) |
1077 | { | 895 | { |
@@ -1096,11 +914,11 @@ int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm) | |||
1096 | * @pwrdm: struct powerdomain * | 914 | * @pwrdm: struct powerdomain * |
1097 | * | 915 | * |
1098 | * Enable automatic context save-and-restore upon power state change | 916 | * Enable automatic context save-and-restore upon power state change |
1099 | * for some devices in a powerdomain. Warning: this only affects a | 917 | * for some devices in the powerdomain @pwrdm. Warning: this only |
1100 | * subset of devices in a powerdomain; check the TRM closely. Returns | 918 | * affects a subset of devices in a powerdomain; check the TRM |
1101 | * -EINVAL if the powerdomain pointer is null or if the powerdomain | 919 | * closely. Returns -EINVAL if the powerdomain pointer is null or if |
1102 | * does not support automatic save-and-restore, or returns 0 upon | 920 | * the powerdomain does not support automatic save-and-restore, or |
1103 | * success. | 921 | * returns 0 upon success. |
1104 | */ | 922 | */ |
1105 | int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) | 923 | int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) |
1106 | { | 924 | { |
@@ -1114,7 +932,7 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) | |||
1114 | pwrdm->name); | 932 | pwrdm->name); |
1115 | 933 | ||
1116 | prm_rmw_mod_reg_bits(0, 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, | 934 | prm_rmw_mod_reg_bits(0, 1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, |
1117 | pwrdm->prcm_offs, PM_PWSTCTRL); | 935 | pwrdm->prcm_offs, pwrstctrl_reg_offs); |
1118 | 936 | ||
1119 | return 0; | 937 | return 0; |
1120 | } | 938 | } |
@@ -1124,11 +942,11 @@ int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm) | |||
1124 | * @pwrdm: struct powerdomain * | 942 | * @pwrdm: struct powerdomain * |
1125 | * | 943 | * |
1126 | * Disable automatic context save-and-restore upon power state change | 944 | * Disable automatic context save-and-restore upon power state change |
1127 | * for some devices in a powerdomain. Warning: this only affects a | 945 | * for some devices in the powerdomain @pwrdm. Warning: this only |
1128 | * subset of devices in a powerdomain; check the TRM closely. Returns | 946 | * affects a subset of devices in a powerdomain; check the TRM |
1129 | * -EINVAL if the powerdomain pointer is null or if the powerdomain | 947 | * closely. Returns -EINVAL if the powerdomain pointer is null or if |
1130 | * does not support automatic save-and-restore, or returns 0 upon | 948 | * the powerdomain does not support automatic save-and-restore, or |
1131 | * success. | 949 | * returns 0 upon success. |
1132 | */ | 950 | */ |
1133 | int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) | 951 | int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) |
1134 | { | 952 | { |
@@ -1142,7 +960,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) | |||
1142 | pwrdm->name); | 960 | pwrdm->name); |
1143 | 961 | ||
1144 | prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 0, | 962 | prm_rmw_mod_reg_bits(1 << OMAP3430ES2_SAVEANDRESTORE_SHIFT, 0, |
1145 | pwrdm->prcm_offs, PM_PWSTCTRL); | 963 | pwrdm->prcm_offs, pwrstctrl_reg_offs); |
1146 | 964 | ||
1147 | return 0; | 965 | return 0; |
1148 | } | 966 | } |
@@ -1151,7 +969,7 @@ int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) | |||
1151 | * pwrdm_has_hdwr_sar - test whether powerdomain supports hardware SAR | 969 | * pwrdm_has_hdwr_sar - test whether powerdomain supports hardware SAR |
1152 | * @pwrdm: struct powerdomain * | 970 | * @pwrdm: struct powerdomain * |
1153 | * | 971 | * |
1154 | * Returns 1 if powerdomain 'pwrdm' supports hardware save-and-restore | 972 | * Returns 1 if powerdomain @pwrdm supports hardware save-and-restore |
1155 | * for some devices, or 0 if it does not. | 973 | * for some devices, or 0 if it does not. |
1156 | */ | 974 | */ |
1157 | bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm) | 975 | bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm) |
@@ -1163,7 +981,7 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm) | |||
1163 | * pwrdm_wait_transition - wait for powerdomain power transition to finish | 981 | * pwrdm_wait_transition - wait for powerdomain power transition to finish |
1164 | * @pwrdm: struct powerdomain * to wait for | 982 | * @pwrdm: struct powerdomain * to wait for |
1165 | * | 983 | * |
1166 | * If the powerdomain pwrdm is in the process of a state transition, | 984 | * If the powerdomain @pwrdm is in the process of a state transition, |
1167 | * spin until it completes the power transition, or until an iteration | 985 | * spin until it completes the power transition, or until an iteration |
1168 | * bailout value is reached. Returns -EINVAL if the powerdomain | 986 | * bailout value is reached. Returns -EINVAL if the powerdomain |
1169 | * pointer is null, -EAGAIN if the bailout value was reached, or | 987 | * pointer is null, -EAGAIN if the bailout value was reached, or |
@@ -1183,10 +1001,10 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm) | |||
1183 | */ | 1001 | */ |
1184 | 1002 | ||
1185 | /* XXX Is this udelay() value meaningful? */ | 1003 | /* XXX Is this udelay() value meaningful? */ |
1186 | while ((prm_read_mod_reg(pwrdm->prcm_offs, PM_PWSTST) & | 1004 | while ((prm_read_mod_reg(pwrdm->prcm_offs, pwrstst_reg_offs) & |
1187 | OMAP_INTRANSITION) && | 1005 | OMAP_INTRANSITION) && |
1188 | (c++ < PWRDM_TRANSITION_BAILOUT)) | 1006 | (c++ < PWRDM_TRANSITION_BAILOUT)) |
1189 | udelay(1); | 1007 | udelay(1); |
1190 | 1008 | ||
1191 | if (c > PWRDM_TRANSITION_BAILOUT) { | 1009 | if (c > PWRDM_TRANSITION_BAILOUT) { |
1192 | printk(KERN_ERR "powerdomain: waited too long for " | 1010 | printk(KERN_ERR "powerdomain: waited too long for " |
@@ -1213,12 +1031,6 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm) | |||
1213 | 1031 | ||
1214 | return -EINVAL; | 1032 | return -EINVAL; |
1215 | } | 1033 | } |
1216 | int pwrdm_clk_state_switch(struct clk *clk) | ||
1217 | { | ||
1218 | if (clk != NULL && clk->clkdm != NULL) | ||
1219 | return pwrdm_clkdm_state_switch(clk->clkdm); | ||
1220 | return -EINVAL; | ||
1221 | } | ||
1222 | 1034 | ||
1223 | int pwrdm_pre_transition(void) | 1035 | int pwrdm_pre_transition(void) |
1224 | { | 1036 | { |
diff --git a/arch/arm/mach-omap2/powerdomains.h b/arch/arm/mach-omap2/powerdomains.h index 057b2e3e2c35..105cbcaefd3b 100644 --- a/arch/arm/mach-omap2/powerdomains.h +++ b/arch/arm/mach-omap2/powerdomains.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2/3 common powerdomain definitions | 2 | * OMAP2/3 common powerdomain definitions |
3 | * | 3 | * |
4 | * Copyright (C) 2007-8 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-8 Nokia Corporation | 5 | * Copyright (C) 2007-2009 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
8 | * Debugging and integration fixes by Jouni Högander | 8 | * Debugging and integration fixes by Jouni Högander |
@@ -12,26 +12,21 @@ | |||
12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | /* | ||
16 | * To Do List | ||
17 | * -> Move the Sleep/Wakeup dependencies from Power Domain framework to | ||
18 | * Clock Domain Framework | ||
19 | */ | ||
20 | |||
15 | #ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS | 21 | #ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS |
16 | #define ARCH_ARM_MACH_OMAP2_POWERDOMAINS | 22 | #define ARCH_ARM_MACH_OMAP2_POWERDOMAINS |
17 | 23 | ||
18 | /* | 24 | /* |
19 | * This file contains all of the powerdomains that have some element | 25 | * This file contains all of the powerdomains that have some element |
20 | * of software control for the OMAP24xx and OMAP34XX chips. | 26 | * of software control for the OMAP24xx and OMAP34xx chips. |
21 | * | ||
22 | * A few notes: | ||
23 | * | 27 | * |
24 | * This is not an exhaustive listing of powerdomains on the chips; only | 28 | * This is not an exhaustive listing of powerdomains on the chips; only |
25 | * powerdomains that can be controlled in software. | 29 | * powerdomains that can be controlled in software. |
26 | * | ||
27 | * A useful validation rule for struct powerdomain: | ||
28 | * Any powerdomain referenced by a wkdep_srcs or sleepdep_srcs array | ||
29 | * must have a dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really | ||
30 | * just software-controllable dependencies. Non-software-controllable | ||
31 | * dependencies do exist, but they are not encoded below (yet). | ||
32 | * | ||
33 | * 24xx does not support programmable sleep dependencies (SLEEPDEP) | ||
34 | * | ||
35 | */ | 30 | */ |
36 | 31 | ||
37 | /* | 32 | /* |
@@ -41,26 +36,17 @@ | |||
41 | * | 36 | * |
42 | * On the 2420, this is a 'C55 DSP called, simply, the DSP. Its | 37 | * On the 2420, this is a 'C55 DSP called, simply, the DSP. Its |
43 | * powerdomain is called the "DSP power domain." On the 2430, the | 38 | * powerdomain is called the "DSP power domain." On the 2430, the |
44 | * on-board DSP is a 'C64 DSP, now called the IVA2 or IVA2.1. Its | 39 | * on-board DSP is a 'C64 DSP, now called (along with its hardware |
45 | * powerdomain is still called the "DSP power domain." On the 3430, | 40 | * accelerators) the IVA2 or IVA2.1. Its powerdomain is still called |
46 | * the DSP is a 'C64 DSP like the 2430, also known as the IVA2; but | 41 | * the "DSP power domain." On the 3430, the DSP is a 'C64 DSP like the |
47 | * its powerdomain is now called the "IVA2 power domain." | 42 | * 2430, also known as the IVA2; but its powerdomain is now called the |
43 | * "IVA2 power domain." | ||
48 | * | 44 | * |
49 | * The 2420 also has something called the IVA, which is a separate ARM | 45 | * The 2420 also has something called the IVA, which is a separate ARM |
50 | * core, and has nothing to do with the DSP/IVA2. | 46 | * core, and has nothing to do with the DSP/IVA2. |
51 | * | 47 | * |
52 | * Ideally the DSP/IVA2 could just be the same powerdomain, but the PRCM | 48 | * Ideally the DSP/IVA2 could just be the same powerdomain, but the PRCM |
53 | * address offset is different between the C55 and C64 DSPs. | 49 | * address offset is different between the C55 and C64 DSPs. |
54 | * | ||
55 | * The overly-specific dep_bit names are due to a bit name collision | ||
56 | * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift | ||
57 | * value are the same for all powerdomains: 2 | ||
58 | */ | ||
59 | |||
60 | /* | ||
61 | * XXX should dep_bit be a mask, so we can test to see if it is 0 as a | ||
62 | * sanity check? | ||
63 | * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE | ||
64 | */ | 50 | */ |
65 | 51 | ||
66 | #include <plat/powerdomain.h> | 52 | #include <plat/powerdomain.h> |
@@ -68,69 +54,23 @@ | |||
68 | #include "prcm-common.h" | 54 | #include "prcm-common.h" |
69 | #include "prm.h" | 55 | #include "prm.h" |
70 | #include "cm.h" | 56 | #include "cm.h" |
71 | |||
72 | /* OMAP2/3-common powerdomains and wakeup dependencies */ | ||
73 | |||
74 | /* | ||
75 | * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP | ||
76 | * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE | ||
77 | * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE | ||
78 | */ | ||
79 | static struct pwrdm_dep gfx_sgx_wkdeps[] = { | ||
80 | { | ||
81 | .pwrdm_name = "core_pwrdm", | ||
82 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
83 | }, | ||
84 | { | ||
85 | .pwrdm_name = "iva2_pwrdm", | ||
86 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
87 | }, | ||
88 | { | ||
89 | .pwrdm_name = "mpu_pwrdm", | ||
90 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
91 | CHIP_IS_OMAP3430) | ||
92 | }, | ||
93 | { | ||
94 | .pwrdm_name = "wkup_pwrdm", | ||
95 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | ||
96 | CHIP_IS_OMAP3430) | ||
97 | }, | ||
98 | { NULL }, | ||
99 | }; | ||
100 | |||
101 | /* | ||
102 | * 3430: CM_SLEEPDEP_CAM: MPU | ||
103 | * 3430ES1: CM_SLEEPDEP_GFX: MPU | ||
104 | * 3430ES2: CM_SLEEPDEP_SGX: MPU | ||
105 | */ | ||
106 | static struct pwrdm_dep cam_gfx_sleepdeps[] = { | ||
107 | { | ||
108 | .pwrdm_name = "mpu_pwrdm", | ||
109 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
110 | }, | ||
111 | { NULL }, | ||
112 | }; | ||
113 | |||
114 | |||
115 | #include "powerdomains24xx.h" | 57 | #include "powerdomains24xx.h" |
116 | #include "powerdomains34xx.h" | 58 | #include "powerdomains34xx.h" |
59 | #include "powerdomains44xx.h" | ||
117 | 60 | ||
61 | /* OMAP2/3-common powerdomains */ | ||
118 | 62 | ||
119 | /* | 63 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
120 | * OMAP2/3 common powerdomains | ||
121 | */ | ||
122 | 64 | ||
123 | /* | 65 | /* |
124 | * The GFX powerdomain is not present on 3430ES2, but currently we do not | 66 | * The GFX powerdomain is not present on 3430ES2, but currently we do not |
125 | * have a macro to filter it out at compile-time. | 67 | * have a macro to filter it out at compile-time. |
126 | */ | 68 | */ |
127 | static struct powerdomain gfx_pwrdm = { | 69 | static struct powerdomain gfx_omap2_pwrdm = { |
128 | .name = "gfx_pwrdm", | 70 | .name = "gfx_pwrdm", |
129 | .prcm_offs = GFX_MOD, | 71 | .prcm_offs = GFX_MOD, |
130 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | | 72 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | |
131 | CHIP_IS_OMAP3430ES1), | 73 | CHIP_IS_OMAP3430ES1), |
132 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
133 | .sleepdep_srcs = cam_gfx_sleepdeps, | ||
134 | .pwrsts = PWRSTS_OFF_RET_ON, | 74 | .pwrsts = PWRSTS_OFF_RET_ON, |
135 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 75 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
136 | .banks = 1, | 76 | .banks = 1, |
@@ -142,22 +82,24 @@ static struct powerdomain gfx_pwrdm = { | |||
142 | }, | 82 | }, |
143 | }; | 83 | }; |
144 | 84 | ||
145 | static struct powerdomain wkup_pwrdm = { | 85 | static struct powerdomain wkup_omap2_pwrdm = { |
146 | .name = "wkup_pwrdm", | 86 | .name = "wkup_pwrdm", |
147 | .prcm_offs = WKUP_MOD, | 87 | .prcm_offs = WKUP_MOD, |
148 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), | 88 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), |
149 | .dep_bit = OMAP_EN_WKUP_SHIFT, | ||
150 | }; | 89 | }; |
151 | 90 | ||
91 | #endif | ||
152 | 92 | ||
153 | 93 | ||
154 | /* As powerdomains are added or removed above, this list must also be changed */ | 94 | /* As powerdomains are added or removed above, this list must also be changed */ |
155 | static struct powerdomain *powerdomains_omap[] __initdata = { | 95 | static struct powerdomain *powerdomains_omap[] __initdata = { |
156 | 96 | ||
157 | &gfx_pwrdm, | 97 | #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) |
158 | &wkup_pwrdm, | 98 | &wkup_omap2_pwrdm, |
99 | &gfx_omap2_pwrdm, | ||
100 | #endif | ||
159 | 101 | ||
160 | #ifdef CONFIG_ARCH_OMAP24XX | 102 | #ifdef CONFIG_ARCH_OMAP2 |
161 | &dsp_pwrdm, | 103 | &dsp_pwrdm, |
162 | &mpu_24xx_pwrdm, | 104 | &mpu_24xx_pwrdm, |
163 | &core_24xx_pwrdm, | 105 | &core_24xx_pwrdm, |
@@ -167,12 +109,12 @@ static struct powerdomain *powerdomains_omap[] __initdata = { | |||
167 | &mdm_pwrdm, | 109 | &mdm_pwrdm, |
168 | #endif | 110 | #endif |
169 | 111 | ||
170 | #ifdef CONFIG_ARCH_OMAP34XX | 112 | #ifdef CONFIG_ARCH_OMAP3 |
171 | &iva2_pwrdm, | 113 | &iva2_pwrdm, |
172 | &mpu_34xx_pwrdm, | 114 | &mpu_3xxx_pwrdm, |
173 | &neon_pwrdm, | 115 | &neon_pwrdm, |
174 | &core_34xx_pre_es3_1_pwrdm, | 116 | &core_3xxx_pre_es3_1_pwrdm, |
175 | &core_34xx_es3_1_pwrdm, | 117 | &core_3xxx_es3_1_pwrdm, |
176 | &cam_pwrdm, | 118 | &cam_pwrdm, |
177 | &dss_pwrdm, | 119 | &dss_pwrdm, |
178 | &per_pwrdm, | 120 | &per_pwrdm, |
@@ -186,6 +128,24 @@ static struct powerdomain *powerdomains_omap[] __initdata = { | |||
186 | &dpll5_pwrdm, | 128 | &dpll5_pwrdm, |
187 | #endif | 129 | #endif |
188 | 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 | ||
189 | NULL | 149 | NULL |
190 | }; | 150 | }; |
191 | 151 | ||
diff --git a/arch/arm/mach-omap2/powerdomains24xx.h b/arch/arm/mach-omap2/powerdomains24xx.h index bd249a495aa9..775093add9b6 100644 --- a/arch/arm/mach-omap2/powerdomains24xx.h +++ b/arch/arm/mach-omap2/powerdomains24xx.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * OMAP24XX powerdomain definitions | 2 | * OMAP24XX powerdomain definitions |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2008 Nokia Corporation | 5 | * Copyright (C) 2007-2009 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
8 | * Debugging and integration fixes by Jouni Högander | 8 | * Debugging and integration fixes by Jouni Högander |
@@ -30,83 +30,7 @@ | |||
30 | 30 | ||
31 | /* 24XX powerdomains and dependencies */ | 31 | /* 24XX powerdomains and dependencies */ |
32 | 32 | ||
33 | #ifdef CONFIG_ARCH_OMAP24XX | 33 | #ifdef CONFIG_ARCH_OMAP2 |
34 | |||
35 | |||
36 | /* Wakeup dependency source arrays */ | ||
37 | |||
38 | /* | ||
39 | * 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP | ||
40 | * 2430 PM_WKDEP_MDM: same as above | ||
41 | */ | ||
42 | static struct pwrdm_dep dsp_mdm_24xx_wkdeps[] = { | ||
43 | { | ||
44 | .pwrdm_name = "core_pwrdm", | ||
45 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
46 | }, | ||
47 | { | ||
48 | .pwrdm_name = "mpu_pwrdm", | ||
49 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
50 | }, | ||
51 | { | ||
52 | .pwrdm_name = "wkup_pwrdm", | ||
53 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
54 | }, | ||
55 | { NULL }, | ||
56 | }; | ||
57 | |||
58 | /* | ||
59 | * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP | ||
60 | * 2430 adds MDM | ||
61 | */ | ||
62 | static struct pwrdm_dep mpu_24xx_wkdeps[] = { | ||
63 | { | ||
64 | .pwrdm_name = "core_pwrdm", | ||
65 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
66 | }, | ||
67 | { | ||
68 | .pwrdm_name = "dsp_pwrdm", | ||
69 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
70 | }, | ||
71 | { | ||
72 | .pwrdm_name = "wkup_pwrdm", | ||
73 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
74 | }, | ||
75 | { | ||
76 | .pwrdm_name = "mdm_pwrdm", | ||
77 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
78 | }, | ||
79 | { NULL }, | ||
80 | }; | ||
81 | |||
82 | /* | ||
83 | * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP | ||
84 | * 2430 adds MDM | ||
85 | */ | ||
86 | static struct pwrdm_dep core_24xx_wkdeps[] = { | ||
87 | { | ||
88 | .pwrdm_name = "dsp_pwrdm", | ||
89 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
90 | }, | ||
91 | { | ||
92 | .pwrdm_name = "gfx_pwrdm", | ||
93 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
94 | }, | ||
95 | { | ||
96 | .pwrdm_name = "mpu_pwrdm", | ||
97 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
98 | }, | ||
99 | { | ||
100 | .pwrdm_name = "wkup_pwrdm", | ||
101 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX) | ||
102 | }, | ||
103 | { | ||
104 | .pwrdm_name = "mdm_pwrdm", | ||
105 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) | ||
106 | }, | ||
107 | { NULL }, | ||
108 | }; | ||
109 | |||
110 | 34 | ||
111 | /* Powerdomains */ | 35 | /* Powerdomains */ |
112 | 36 | ||
@@ -114,8 +38,6 @@ static struct powerdomain dsp_pwrdm = { | |||
114 | .name = "dsp_pwrdm", | 38 | .name = "dsp_pwrdm", |
115 | .prcm_offs = OMAP24XX_DSP_MOD, | 39 | .prcm_offs = OMAP24XX_DSP_MOD, |
116 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 40 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
117 | .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT, | ||
118 | .wkdep_srcs = dsp_mdm_24xx_wkdeps, | ||
119 | .pwrsts = PWRSTS_OFF_RET_ON, | 41 | .pwrsts = PWRSTS_OFF_RET_ON, |
120 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 42 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
121 | .banks = 1, | 43 | .banks = 1, |
@@ -131,8 +53,6 @@ static struct powerdomain mpu_24xx_pwrdm = { | |||
131 | .name = "mpu_pwrdm", | 53 | .name = "mpu_pwrdm", |
132 | .prcm_offs = MPU_MOD, | 54 | .prcm_offs = MPU_MOD, |
133 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 55 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
134 | .dep_bit = OMAP24XX_EN_MPU_SHIFT, | ||
135 | .wkdep_srcs = mpu_24xx_wkdeps, | ||
136 | .pwrsts = PWRSTS_OFF_RET_ON, | 56 | .pwrsts = PWRSTS_OFF_RET_ON, |
137 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 57 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
138 | .banks = 1, | 58 | .banks = 1, |
@@ -148,9 +68,7 @@ static struct powerdomain core_24xx_pwrdm = { | |||
148 | .name = "core_pwrdm", | 68 | .name = "core_pwrdm", |
149 | .prcm_offs = CORE_MOD, | 69 | .prcm_offs = CORE_MOD, |
150 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), | 70 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), |
151 | .wkdep_srcs = core_24xx_wkdeps, | ||
152 | .pwrsts = PWRSTS_OFF_RET_ON, | 71 | .pwrsts = PWRSTS_OFF_RET_ON, |
153 | .dep_bit = OMAP24XX_EN_CORE_SHIFT, | ||
154 | .banks = 3, | 72 | .banks = 3, |
155 | .pwrsts_mem_ret = { | 73 | .pwrsts_mem_ret = { |
156 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ | 74 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ |
@@ -164,7 +82,7 @@ static struct powerdomain core_24xx_pwrdm = { | |||
164 | }, | 82 | }, |
165 | }; | 83 | }; |
166 | 84 | ||
167 | #endif /* CONFIG_ARCH_OMAP24XX */ | 85 | #endif /* CONFIG_ARCH_OMAP2 */ |
168 | 86 | ||
169 | 87 | ||
170 | 88 | ||
@@ -176,13 +94,10 @@ static struct powerdomain core_24xx_pwrdm = { | |||
176 | 94 | ||
177 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ | 95 | /* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ |
178 | 96 | ||
179 | /* Another case of bit name collisions between several registers: EN_MDM */ | ||
180 | static struct powerdomain mdm_pwrdm = { | 97 | static struct powerdomain mdm_pwrdm = { |
181 | .name = "mdm_pwrdm", | 98 | .name = "mdm_pwrdm", |
182 | .prcm_offs = OMAP2430_MDM_MOD, | 99 | .prcm_offs = OMAP2430_MDM_MOD, |
183 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), | 100 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), |
184 | .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT, | ||
185 | .wkdep_srcs = dsp_mdm_24xx_wkdeps, | ||
186 | .pwrsts = PWRSTS_OFF_RET_ON, | 101 | .pwrsts = PWRSTS_OFF_RET_ON, |
187 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 102 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
188 | .banks = 1, | 103 | .banks = 1, |
diff --git a/arch/arm/mach-omap2/powerdomains34xx.h b/arch/arm/mach-omap2/powerdomains34xx.h index 588f7e07d0ea..bd87112beea8 100644 --- a/arch/arm/mach-omap2/powerdomains34xx.h +++ b/arch/arm/mach-omap2/powerdomains34xx.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP34XX powerdomain definitions | 2 | * OMAP3 powerdomain definitions |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2008 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2008 Nokia Corporation | 5 | * Copyright (C) 2007-2010 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
8 | * Debugging and integration fixes by Jouni Högander | 8 | * Debugging and integration fixes by Jouni Högander |
@@ -32,128 +32,7 @@ | |||
32 | * 34XX-specific powerdomains, dependencies | 32 | * 34XX-specific powerdomains, dependencies |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #ifdef CONFIG_ARCH_OMAP34XX | 35 | #ifdef CONFIG_ARCH_OMAP3 |
36 | |||
37 | /* | ||
38 | * 3430: PM_WKDEP_{PER,USBHOST}: CORE, IVA2, MPU, WKUP | ||
39 | * (USBHOST is ES2 only) | ||
40 | */ | ||
41 | static struct pwrdm_dep per_usbhost_wkdeps[] = { | ||
42 | { | ||
43 | .pwrdm_name = "core_pwrdm", | ||
44 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
45 | }, | ||
46 | { | ||
47 | .pwrdm_name = "iva2_pwrdm", | ||
48 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
49 | }, | ||
50 | { | ||
51 | .pwrdm_name = "mpu_pwrdm", | ||
52 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
53 | }, | ||
54 | { | ||
55 | .pwrdm_name = "wkup_pwrdm", | ||
56 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
57 | }, | ||
58 | { NULL }, | ||
59 | }; | ||
60 | |||
61 | /* | ||
62 | * 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER | ||
63 | */ | ||
64 | static struct pwrdm_dep mpu_34xx_wkdeps[] = { | ||
65 | { | ||
66 | .pwrdm_name = "core_pwrdm", | ||
67 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
68 | }, | ||
69 | { | ||
70 | .pwrdm_name = "iva2_pwrdm", | ||
71 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
72 | }, | ||
73 | { | ||
74 | .pwrdm_name = "dss_pwrdm", | ||
75 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
76 | }, | ||
77 | { | ||
78 | .pwrdm_name = "per_pwrdm", | ||
79 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
80 | }, | ||
81 | { NULL }, | ||
82 | }; | ||
83 | |||
84 | /* | ||
85 | * 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER | ||
86 | */ | ||
87 | static struct pwrdm_dep iva2_wkdeps[] = { | ||
88 | { | ||
89 | .pwrdm_name = "core_pwrdm", | ||
90 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
91 | }, | ||
92 | { | ||
93 | .pwrdm_name = "mpu_pwrdm", | ||
94 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
95 | }, | ||
96 | { | ||
97 | .pwrdm_name = "wkup_pwrdm", | ||
98 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
99 | }, | ||
100 | { | ||
101 | .pwrdm_name = "dss_pwrdm", | ||
102 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
103 | }, | ||
104 | { | ||
105 | .pwrdm_name = "per_pwrdm", | ||
106 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
107 | }, | ||
108 | { NULL }, | ||
109 | }; | ||
110 | |||
111 | |||
112 | /* 3430 PM_WKDEP_{CAM,DSS}: IVA2, MPU, WKUP */ | ||
113 | static struct pwrdm_dep cam_dss_wkdeps[] = { | ||
114 | { | ||
115 | .pwrdm_name = "iva2_pwrdm", | ||
116 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
117 | }, | ||
118 | { | ||
119 | .pwrdm_name = "mpu_pwrdm", | ||
120 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
121 | }, | ||
122 | { | ||
123 | .pwrdm_name = "wkup_pwrdm", | ||
124 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
125 | }, | ||
126 | { NULL }, | ||
127 | }; | ||
128 | |||
129 | /* 3430: PM_WKDEP_NEON: MPU */ | ||
130 | static struct pwrdm_dep neon_wkdeps[] = { | ||
131 | { | ||
132 | .pwrdm_name = "mpu_pwrdm", | ||
133 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
134 | }, | ||
135 | { NULL }, | ||
136 | }; | ||
137 | |||
138 | |||
139 | /* Sleep dependency source arrays for 34xx-specific pwrdms - 34XX only */ | ||
140 | |||
141 | /* | ||
142 | * 3430: CM_SLEEPDEP_{DSS,PER}: MPU, IVA | ||
143 | * 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA | ||
144 | */ | ||
145 | static struct pwrdm_dep dss_per_usbhost_sleepdeps[] = { | ||
146 | { | ||
147 | .pwrdm_name = "mpu_pwrdm", | ||
148 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
149 | }, | ||
150 | { | ||
151 | .pwrdm_name = "iva2_pwrdm", | ||
152 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) | ||
153 | }, | ||
154 | { NULL }, | ||
155 | }; | ||
156 | |||
157 | 36 | ||
158 | /* | 37 | /* |
159 | * Powerdomains | 38 | * Powerdomains |
@@ -163,8 +42,6 @@ static struct powerdomain iva2_pwrdm = { | |||
163 | .name = "iva2_pwrdm", | 42 | .name = "iva2_pwrdm", |
164 | .prcm_offs = OMAP3430_IVA2_MOD, | 43 | .prcm_offs = OMAP3430_IVA2_MOD, |
165 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 44 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
166 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, | ||
167 | .wkdep_srcs = iva2_wkdeps, | ||
168 | .pwrsts = PWRSTS_OFF_RET_ON, | 45 | .pwrsts = PWRSTS_OFF_RET_ON, |
169 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 46 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
170 | .banks = 4, | 47 | .banks = 4, |
@@ -182,12 +59,10 @@ static struct powerdomain iva2_pwrdm = { | |||
182 | }, | 59 | }, |
183 | }; | 60 | }; |
184 | 61 | ||
185 | static struct powerdomain mpu_34xx_pwrdm = { | 62 | static struct powerdomain mpu_3xxx_pwrdm = { |
186 | .name = "mpu_pwrdm", | 63 | .name = "mpu_pwrdm", |
187 | .prcm_offs = MPU_MOD, | 64 | .prcm_offs = MPU_MOD, |
188 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 65 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
189 | .dep_bit = OMAP3430_EN_MPU_SHIFT, | ||
190 | .wkdep_srcs = mpu_34xx_wkdeps, | ||
191 | .pwrsts = PWRSTS_OFF_RET_ON, | 66 | .pwrsts = PWRSTS_OFF_RET_ON, |
192 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 67 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
193 | .flags = PWRDM_HAS_MPU_QUIRK, | 68 | .flags = PWRDM_HAS_MPU_QUIRK, |
@@ -200,15 +75,14 @@ static struct powerdomain mpu_34xx_pwrdm = { | |||
200 | }, | 75 | }, |
201 | }; | 76 | }; |
202 | 77 | ||
203 | /* No wkdeps or sleepdeps for 34xx core apparently */ | 78 | static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { |
204 | static struct powerdomain core_34xx_pre_es3_1_pwrdm = { | ||
205 | .name = "core_pwrdm", | 79 | .name = "core_pwrdm", |
206 | .prcm_offs = CORE_MOD, | 80 | .prcm_offs = CORE_MOD, |
207 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | | 81 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 | |
208 | CHIP_IS_OMAP3430ES2 | | 82 | CHIP_IS_OMAP3430ES2 | |
209 | CHIP_IS_OMAP3430ES3_0), | 83 | CHIP_IS_OMAP3430ES3_0), |
210 | .pwrsts = PWRSTS_OFF_RET_ON, | 84 | .pwrsts = PWRSTS_OFF_RET_ON, |
211 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | 85 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
212 | .banks = 2, | 86 | .banks = 2, |
213 | .pwrsts_mem_ret = { | 87 | .pwrsts_mem_ret = { |
214 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ | 88 | [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */ |
@@ -220,13 +94,12 @@ static struct powerdomain core_34xx_pre_es3_1_pwrdm = { | |||
220 | }, | 94 | }, |
221 | }; | 95 | }; |
222 | 96 | ||
223 | /* No wkdeps or sleepdeps for 34xx core apparently */ | 97 | static struct powerdomain core_3xxx_es3_1_pwrdm = { |
224 | static struct powerdomain core_34xx_es3_1_pwrdm = { | ||
225 | .name = "core_pwrdm", | 98 | .name = "core_pwrdm", |
226 | .prcm_offs = CORE_MOD, | 99 | .prcm_offs = CORE_MOD, |
227 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES3_1), | 100 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES3_1), |
228 | .pwrsts = PWRSTS_OFF_RET_ON, | 101 | .pwrsts = PWRSTS_OFF_RET_ON, |
229 | .dep_bit = OMAP3430_EN_CORE_SHIFT, | 102 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
230 | .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */ | 103 | .flags = PWRDM_HAS_HDWR_SAR, /* for USBTLL only */ |
231 | .banks = 2, | 104 | .banks = 2, |
232 | .pwrsts_mem_ret = { | 105 | .pwrsts_mem_ret = { |
@@ -239,14 +112,10 @@ static struct powerdomain core_34xx_es3_1_pwrdm = { | |||
239 | }, | 112 | }, |
240 | }; | 113 | }; |
241 | 114 | ||
242 | /* Another case of bit name collisions between several registers: EN_DSS */ | ||
243 | static struct powerdomain dss_pwrdm = { | 115 | static struct powerdomain dss_pwrdm = { |
244 | .name = "dss_pwrdm", | 116 | .name = "dss_pwrdm", |
245 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 117 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
246 | .prcm_offs = OMAP3430_DSS_MOD, | 118 | .prcm_offs = OMAP3430_DSS_MOD, |
247 | .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT, | ||
248 | .wkdep_srcs = cam_dss_wkdeps, | ||
249 | .sleepdep_srcs = dss_per_usbhost_sleepdeps, | ||
250 | .pwrsts = PWRSTS_OFF_RET_ON, | 119 | .pwrsts = PWRSTS_OFF_RET_ON, |
251 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 120 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
252 | .banks = 1, | 121 | .banks = 1, |
@@ -267,8 +136,6 @@ static struct powerdomain sgx_pwrdm = { | |||
267 | .name = "sgx_pwrdm", | 136 | .name = "sgx_pwrdm", |
268 | .prcm_offs = OMAP3430ES2_SGX_MOD, | 137 | .prcm_offs = OMAP3430ES2_SGX_MOD, |
269 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 138 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
270 | .wkdep_srcs = gfx_sgx_wkdeps, | ||
271 | .sleepdep_srcs = cam_gfx_sleepdeps, | ||
272 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ | 139 | /* XXX This is accurate for 3430 SGX, but what about GFX? */ |
273 | .pwrsts = PWRSTS_OFF_ON, | 140 | .pwrsts = PWRSTS_OFF_ON, |
274 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 141 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
@@ -285,8 +152,6 @@ static struct powerdomain cam_pwrdm = { | |||
285 | .name = "cam_pwrdm", | 152 | .name = "cam_pwrdm", |
286 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 153 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
287 | .prcm_offs = OMAP3430_CAM_MOD, | 154 | .prcm_offs = OMAP3430_CAM_MOD, |
288 | .wkdep_srcs = cam_dss_wkdeps, | ||
289 | .sleepdep_srcs = cam_gfx_sleepdeps, | ||
290 | .pwrsts = PWRSTS_OFF_RET_ON, | 155 | .pwrsts = PWRSTS_OFF_RET_ON, |
291 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 156 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
292 | .banks = 1, | 157 | .banks = 1, |
@@ -302,9 +167,6 @@ static struct powerdomain per_pwrdm = { | |||
302 | .name = "per_pwrdm", | 167 | .name = "per_pwrdm", |
303 | .prcm_offs = OMAP3430_PER_MOD, | 168 | .prcm_offs = OMAP3430_PER_MOD, |
304 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 169 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
305 | .dep_bit = OMAP3430_EN_PER_SHIFT, | ||
306 | .wkdep_srcs = per_usbhost_wkdeps, | ||
307 | .sleepdep_srcs = dss_per_usbhost_sleepdeps, | ||
308 | .pwrsts = PWRSTS_OFF_RET_ON, | 170 | .pwrsts = PWRSTS_OFF_RET_ON, |
309 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | 171 | .pwrsts_logic_ret = PWRSTS_OFF_RET, |
310 | .banks = 1, | 172 | .banks = 1, |
@@ -326,7 +188,6 @@ static struct powerdomain neon_pwrdm = { | |||
326 | .name = "neon_pwrdm", | 188 | .name = "neon_pwrdm", |
327 | .prcm_offs = OMAP3430_NEON_MOD, | 189 | .prcm_offs = OMAP3430_NEON_MOD, |
328 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | 190 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), |
329 | .wkdep_srcs = neon_wkdeps, | ||
330 | .pwrsts = PWRSTS_OFF_RET_ON, | 191 | .pwrsts = PWRSTS_OFF_RET_ON, |
331 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 192 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
332 | }; | 193 | }; |
@@ -335,8 +196,6 @@ static struct powerdomain usbhost_pwrdm = { | |||
335 | .name = "usbhost_pwrdm", | 196 | .name = "usbhost_pwrdm", |
336 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, | 197 | .prcm_offs = OMAP3430ES2_USBHOST_MOD, |
337 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), | 198 | .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), |
338 | .wkdep_srcs = per_usbhost_wkdeps, | ||
339 | .sleepdep_srcs = dss_per_usbhost_sleepdeps, | ||
340 | .pwrsts = PWRSTS_OFF_RET_ON, | 199 | .pwrsts = PWRSTS_OFF_RET_ON, |
341 | .pwrsts_logic_ret = PWRDM_POWER_RET, | 200 | .pwrsts_logic_ret = PWRDM_POWER_RET, |
342 | /* | 201 | /* |
@@ -386,7 +245,7 @@ static struct powerdomain dpll5_pwrdm = { | |||
386 | }; | 245 | }; |
387 | 246 | ||
388 | 247 | ||
389 | #endif /* CONFIG_ARCH_OMAP34XX */ | 248 | #endif /* CONFIG_ARCH_OMAP3 */ |
390 | 249 | ||
391 | 250 | ||
392 | #endif | 251 | #endif |
diff --git a/arch/arm/mach-omap2/powerdomains44xx.h b/arch/arm/mach-omap2/powerdomains44xx.h new file mode 100644 index 000000000000..c1015147d579 --- /dev/null +++ b/arch/arm/mach-omap2/powerdomains44xx.h | |||
@@ -0,0 +1,310 @@ | |||
1 | /* | ||
2 | * OMAP4 Power domains framework | ||
3 | * | ||
4 | * Copyright (C) 2009 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2009 Nokia Corporation | ||
6 | * | ||
7 | * Abhijit Pagare (abhijitpagare@ti.com) | ||
8 | * Benoit Cousson (b-cousson@ti.com) | ||
9 | * Paul Walmsley | ||
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 | |||
22 | #ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H | ||
23 | #define __ARCH_ARM_MACH_OMAP2_POWERDOMAINS44XX_H | ||
24 | |||
25 | #include <plat/powerdomain.h> | ||
26 | |||
27 | #include "prcm-common.h" | ||
28 | #include "cm.h" | ||
29 | #include "cm-regbits-44xx.h" | ||
30 | #include "prm.h" | ||
31 | #include "prm-regbits-44xx.h" | ||
32 | |||
33 | #if defined(CONFIG_ARCH_OMAP4) | ||
34 | |||
35 | /* core_44xx_pwrdm: CORE power domain */ | ||
36 | static struct powerdomain core_44xx_pwrdm = { | ||
37 | .name = "core_pwrdm", | ||
38 | .prcm_offs = OMAP4430_PRM_CORE_MOD, | ||
39 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
40 | .pwrsts = PWRSTS_RET_ON, | ||
41 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
42 | .banks = 5, | ||
43 | .pwrsts_mem_ret = { | ||
44 | [0] = PWRDM_POWER_OFF, /* core_nret_bank */ | ||
45 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ | ||
46 | [2] = PWRDM_POWER_RET, /* core_other_bank */ | ||
47 | [3] = PWRSTS_OFF_RET, /* ducati_l2ram */ | ||
48 | [4] = PWRSTS_OFF_RET, /* ducati_unicache */ | ||
49 | }, | ||
50 | .pwrsts_mem_on = { | ||
51 | [0] = PWRDM_POWER_ON, /* core_nret_bank */ | ||
52 | [1] = PWRSTS_OFF_RET, /* core_ocmram */ | ||
53 | [2] = PWRDM_POWER_ON, /* core_other_bank */ | ||
54 | [3] = PWRDM_POWER_ON, /* ducati_l2ram */ | ||
55 | [4] = PWRDM_POWER_ON, /* ducati_unicache */ | ||
56 | }, | ||
57 | }; | ||
58 | |||
59 | /* gfx_44xx_pwrdm: 3D accelerator power domain */ | ||
60 | static struct powerdomain gfx_44xx_pwrdm = { | ||
61 | .name = "gfx_pwrdm", | ||
62 | .prcm_offs = OMAP4430_PRM_GFX_MOD, | ||
63 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
64 | .pwrsts = PWRSTS_OFF_ON, | ||
65 | .banks = 1, | ||
66 | .pwrsts_mem_ret = { | ||
67 | [0] = PWRDM_POWER_OFF, /* gfx_mem */ | ||
68 | }, | ||
69 | .pwrsts_mem_on = { | ||
70 | [0] = PWRDM_POWER_ON, /* gfx_mem */ | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | /* abe_44xx_pwrdm: Audio back end power domain */ | ||
75 | static struct powerdomain abe_44xx_pwrdm = { | ||
76 | .name = "abe_pwrdm", | ||
77 | .prcm_offs = OMAP4430_PRM_ABE_MOD, | ||
78 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
79 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
80 | .pwrsts_logic_ret = PWRDM_POWER_OFF, | ||
81 | .banks = 2, | ||
82 | .pwrsts_mem_ret = { | ||
83 | [0] = PWRDM_POWER_RET, /* aessmem */ | ||
84 | [1] = PWRDM_POWER_OFF, /* periphmem */ | ||
85 | }, | ||
86 | .pwrsts_mem_on = { | ||
87 | [0] = PWRDM_POWER_ON, /* aessmem */ | ||
88 | [1] = PWRDM_POWER_ON, /* periphmem */ | ||
89 | }, | ||
90 | }; | ||
91 | |||
92 | /* dss_44xx_pwrdm: Display subsystem power domain */ | ||
93 | static struct powerdomain dss_44xx_pwrdm = { | ||
94 | .name = "dss_pwrdm", | ||
95 | .prcm_offs = OMAP4430_PRM_DSS_MOD, | ||
96 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
97 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
98 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
99 | .banks = 1, | ||
100 | .pwrsts_mem_ret = { | ||
101 | [0] = PWRDM_POWER_OFF, /* dss_mem */ | ||
102 | }, | ||
103 | .pwrsts_mem_on = { | ||
104 | [0] = PWRDM_POWER_ON, /* dss_mem */ | ||
105 | }, | ||
106 | }; | ||
107 | |||
108 | /* tesla_44xx_pwrdm: Tesla processor power domain */ | ||
109 | static struct powerdomain tesla_44xx_pwrdm = { | ||
110 | .name = "tesla_pwrdm", | ||
111 | .prcm_offs = OMAP4430_PRM_TESLA_MOD, | ||
112 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
113 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
114 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
115 | .banks = 3, | ||
116 | .pwrsts_mem_ret = { | ||
117 | [0] = PWRDM_POWER_RET, /* tesla_edma */ | ||
118 | [1] = PWRSTS_OFF_RET, /* tesla_l1 */ | ||
119 | [2] = PWRSTS_OFF_RET, /* tesla_l2 */ | ||
120 | }, | ||
121 | .pwrsts_mem_on = { | ||
122 | [0] = PWRDM_POWER_ON, /* tesla_edma */ | ||
123 | [1] = PWRDM_POWER_ON, /* tesla_l1 */ | ||
124 | [2] = PWRDM_POWER_ON, /* tesla_l2 */ | ||
125 | }, | ||
126 | }; | ||
127 | |||
128 | /* wkup_44xx_pwrdm: Wake-up power domain */ | ||
129 | static struct powerdomain wkup_44xx_pwrdm = { | ||
130 | .name = "wkup_pwrdm", | ||
131 | .prcm_offs = OMAP4430_PRM_WKUP_MOD, | ||
132 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
133 | .pwrsts = PWRDM_POWER_ON, | ||
134 | .banks = 1, | ||
135 | .pwrsts_mem_ret = { | ||
136 | [0] = PWRDM_POWER_OFF, /* wkup_bank */ | ||
137 | }, | ||
138 | .pwrsts_mem_on = { | ||
139 | [0] = PWRDM_POWER_ON, /* wkup_bank */ | ||
140 | }, | ||
141 | }; | ||
142 | |||
143 | /* cpu0_44xx_pwrdm: MPU0 processor and Neon coprocessor power domain */ | ||
144 | static struct powerdomain cpu0_44xx_pwrdm = { | ||
145 | .name = "cpu0_pwrdm", | ||
146 | .prcm_offs = OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, | ||
147 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
148 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
149 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
150 | .banks = 1, | ||
151 | .pwrsts_mem_ret = { | ||
152 | [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ | ||
153 | }, | ||
154 | .pwrsts_mem_on = { | ||
155 | [0] = PWRDM_POWER_ON, /* cpu0_l1 */ | ||
156 | }, | ||
157 | }; | ||
158 | |||
159 | /* cpu1_44xx_pwrdm: MPU1 processor and Neon coprocessor power domain */ | ||
160 | static struct powerdomain cpu1_44xx_pwrdm = { | ||
161 | .name = "cpu1_pwrdm", | ||
162 | .prcm_offs = OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, | ||
163 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
164 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
165 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
166 | .banks = 1, | ||
167 | .pwrsts_mem_ret = { | ||
168 | [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ | ||
169 | }, | ||
170 | .pwrsts_mem_on = { | ||
171 | [0] = PWRDM_POWER_ON, /* cpu1_l1 */ | ||
172 | }, | ||
173 | }; | ||
174 | |||
175 | /* emu_44xx_pwrdm: Emulation power domain */ | ||
176 | static struct powerdomain emu_44xx_pwrdm = { | ||
177 | .name = "emu_pwrdm", | ||
178 | .prcm_offs = OMAP4430_PRM_EMU_MOD, | ||
179 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
180 | .pwrsts = PWRSTS_OFF_ON, | ||
181 | .banks = 1, | ||
182 | .pwrsts_mem_ret = { | ||
183 | [0] = PWRDM_POWER_OFF, /* emu_bank */ | ||
184 | }, | ||
185 | .pwrsts_mem_on = { | ||
186 | [0] = PWRDM_POWER_ON, /* emu_bank */ | ||
187 | }, | ||
188 | }; | ||
189 | |||
190 | /* mpu_44xx_pwrdm: Modena processor and the Neon coprocessor power domain */ | ||
191 | static struct powerdomain mpu_44xx_pwrdm = { | ||
192 | .name = "mpu_pwrdm", | ||
193 | .prcm_offs = OMAP4430_PRM_MPU_MOD, | ||
194 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
195 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
196 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
197 | .banks = 3, | ||
198 | .pwrsts_mem_ret = { | ||
199 | [0] = PWRSTS_OFF_RET, /* mpu_l1 */ | ||
200 | [1] = PWRSTS_OFF_RET, /* mpu_l2 */ | ||
201 | [2] = PWRDM_POWER_RET, /* mpu_ram */ | ||
202 | }, | ||
203 | .pwrsts_mem_on = { | ||
204 | [0] = PWRDM_POWER_ON, /* mpu_l1 */ | ||
205 | [1] = PWRDM_POWER_ON, /* mpu_l2 */ | ||
206 | [2] = PWRDM_POWER_ON, /* mpu_ram */ | ||
207 | }, | ||
208 | }; | ||
209 | |||
210 | /* ivahd_44xx_pwrdm: IVA-HD power domain */ | ||
211 | static struct powerdomain ivahd_44xx_pwrdm = { | ||
212 | .name = "ivahd_pwrdm", | ||
213 | .prcm_offs = OMAP4430_PRM_IVAHD_MOD, | ||
214 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
215 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
216 | .pwrsts_logic_ret = PWRDM_POWER_OFF, | ||
217 | .banks = 4, | ||
218 | .pwrsts_mem_ret = { | ||
219 | [0] = PWRDM_POWER_OFF, /* hwa_mem */ | ||
220 | [1] = PWRSTS_OFF_RET, /* sl2_mem */ | ||
221 | [2] = PWRSTS_OFF_RET, /* tcm1_mem */ | ||
222 | [3] = PWRSTS_OFF_RET, /* tcm2_mem */ | ||
223 | }, | ||
224 | .pwrsts_mem_on = { | ||
225 | [0] = PWRDM_POWER_ON, /* hwa_mem */ | ||
226 | [1] = PWRDM_POWER_ON, /* sl2_mem */ | ||
227 | [2] = PWRDM_POWER_ON, /* tcm1_mem */ | ||
228 | [3] = PWRDM_POWER_ON, /* tcm2_mem */ | ||
229 | }, | ||
230 | }; | ||
231 | |||
232 | /* cam_44xx_pwrdm: Camera subsystem power domain */ | ||
233 | static struct powerdomain cam_44xx_pwrdm = { | ||
234 | .name = "cam_pwrdm", | ||
235 | .prcm_offs = OMAP4430_PRM_CAM_MOD, | ||
236 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
237 | .pwrsts = PWRSTS_OFF_ON, | ||
238 | .banks = 1, | ||
239 | .pwrsts_mem_ret = { | ||
240 | [0] = PWRDM_POWER_OFF, /* cam_mem */ | ||
241 | }, | ||
242 | .pwrsts_mem_on = { | ||
243 | [0] = PWRDM_POWER_ON, /* cam_mem */ | ||
244 | }, | ||
245 | }; | ||
246 | |||
247 | /* l3init_44xx_pwrdm: L3 initators pheripherals power domain */ | ||
248 | static struct powerdomain l3init_44xx_pwrdm = { | ||
249 | .name = "l3init_pwrdm", | ||
250 | .prcm_offs = OMAP4430_PRM_L3INIT_MOD, | ||
251 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
252 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
253 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
254 | .banks = 1, | ||
255 | .pwrsts_mem_ret = { | ||
256 | [0] = PWRDM_POWER_OFF, /* l3init_bank1 */ | ||
257 | }, | ||
258 | .pwrsts_mem_on = { | ||
259 | [0] = PWRDM_POWER_ON, /* l3init_bank1 */ | ||
260 | }, | ||
261 | }; | ||
262 | |||
263 | /* l4per_44xx_pwrdm: Target peripherals power domain */ | ||
264 | static struct powerdomain l4per_44xx_pwrdm = { | ||
265 | .name = "l4per_pwrdm", | ||
266 | .prcm_offs = OMAP4430_PRM_L4PER_MOD, | ||
267 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
268 | .pwrsts = PWRSTS_OFF_RET_ON, | ||
269 | .pwrsts_logic_ret = PWRSTS_OFF_RET, | ||
270 | .banks = 2, | ||
271 | .pwrsts_mem_ret = { | ||
272 | [0] = PWRDM_POWER_OFF, /* nonretained_bank */ | ||
273 | [1] = PWRDM_POWER_RET, /* retained_bank */ | ||
274 | }, | ||
275 | .pwrsts_mem_on = { | ||
276 | [0] = PWRDM_POWER_ON, /* nonretained_bank */ | ||
277 | [1] = PWRDM_POWER_ON, /* retained_bank */ | ||
278 | }, | ||
279 | }; | ||
280 | |||
281 | /* | ||
282 | * always_on_core_44xx_pwrdm: Always ON logic that sits in VDD_CORE voltage | ||
283 | * domain | ||
284 | */ | ||
285 | static struct powerdomain always_on_core_44xx_pwrdm = { | ||
286 | .name = "always_on_core_pwrdm", | ||
287 | .prcm_offs = OMAP4430_PRM_ALWAYS_ON_MOD, | ||
288 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
289 | .pwrsts = PWRDM_POWER_ON, | ||
290 | }; | ||
291 | |||
292 | /* cefuse_44xx_pwrdm: Customer efuse controller power domain */ | ||
293 | static struct powerdomain cefuse_44xx_pwrdm = { | ||
294 | .name = "cefuse_pwrdm", | ||
295 | .prcm_offs = OMAP4430_PRM_CEFUSE_MOD, | ||
296 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), | ||
297 | .pwrsts = PWRSTS_OFF_ON, | ||
298 | }; | ||
299 | |||
300 | /* | ||
301 | * The following power domains are not under SW control | ||
302 | * | ||
303 | * always_on_iva | ||
304 | * always_on_mpu | ||
305 | * stdefuse | ||
306 | */ | ||
307 | |||
308 | #endif | ||
309 | |||
310 | #endif | ||
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 61ac2a418bd0..90f603d434c6 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
@@ -119,6 +119,15 @@ | |||
119 | #define OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD 0x0400 | 119 | #define OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD 0x0400 |
120 | #define OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD 0x0800 | 120 | #define OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD 0x0800 |
121 | 121 | ||
122 | /* Base Addresses for the OMAP4 */ | ||
123 | |||
124 | #define OMAP4430_CM1_BASE 0x4a004000 | ||
125 | #define OMAP4430_CM2_BASE 0x4a008000 | ||
126 | #define OMAP4430_PRM_BASE 0x4a306000 | ||
127 | #define OMAP4430_SCRM_BASE 0x4a30a000 | ||
128 | #define OMAP4430_CHIRONSS_BASE 0x48243000 | ||
129 | |||
130 | |||
122 | /* 24XX register bits shared between CM & PRM registers */ | 131 | /* 24XX register bits shared between CM & PRM registers */ |
123 | 132 | ||
124 | /* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ | 133 | /* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 3ea8177ffb25..81872aacb801 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -11,6 +11,7 @@ | |||
11 | * Rajendra Nayak <rnayak@ti.com> | 11 | * Rajendra Nayak <rnayak@ti.com> |
12 | * | 12 | * |
13 | * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc. | 13 | * Some pieces of code Copyright (C) 2005 Texas Instruments, Inc. |
14 | * Upgraded with OMAP4 support by Abhijit Pagare <abhijitpagare@ti.com> | ||
14 | * | 15 | * |
15 | * This program is free software; you can redistribute it and/or modify | 16 | * This program is free software; you can redistribute it and/or modify |
16 | * 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 |
@@ -28,6 +29,7 @@ | |||
28 | #include <plat/control.h> | 29 | #include <plat/control.h> |
29 | 30 | ||
30 | #include "clock.h" | 31 | #include "clock.h" |
32 | #include "clock2xxx.h" | ||
31 | #include "cm.h" | 33 | #include "cm.h" |
32 | #include "prm.h" | 34 | #include "prm.h" |
33 | #include "prm-regbits-24xx.h" | 35 | #include "prm-regbits-24xx.h" |
@@ -44,7 +46,6 @@ struct omap3_prcm_regs { | |||
44 | u32 iva2_cm_clksel2; | 46 | u32 iva2_cm_clksel2; |
45 | u32 cm_sysconfig; | 47 | u32 cm_sysconfig; |
46 | u32 sgx_cm_clksel; | 48 | u32 sgx_cm_clksel; |
47 | u32 wkup_cm_clksel; | ||
48 | u32 dss_cm_clksel; | 49 | u32 dss_cm_clksel; |
49 | u32 cam_cm_clksel; | 50 | u32 cam_cm_clksel; |
50 | u32 per_cm_clksel; | 51 | u32 per_cm_clksel; |
@@ -53,7 +54,6 @@ struct omap3_prcm_regs { | |||
53 | u32 pll_cm_autoidle2; | 54 | u32 pll_cm_autoidle2; |
54 | u32 pll_cm_clksel4; | 55 | u32 pll_cm_clksel4; |
55 | u32 pll_cm_clksel5; | 56 | u32 pll_cm_clksel5; |
56 | u32 pll_cm_clken; | ||
57 | u32 pll_cm_clken2; | 57 | u32 pll_cm_clken2; |
58 | u32 cm_polctrl; | 58 | u32 cm_polctrl; |
59 | u32 iva2_cm_fclken; | 59 | u32 iva2_cm_fclken; |
@@ -77,7 +77,6 @@ struct omap3_prcm_regs { | |||
77 | u32 usbhost_cm_iclken; | 77 | u32 usbhost_cm_iclken; |
78 | u32 iva2_cm_autiidle2; | 78 | u32 iva2_cm_autiidle2; |
79 | u32 mpu_cm_autoidle2; | 79 | u32 mpu_cm_autoidle2; |
80 | u32 pll_cm_autoidle; | ||
81 | u32 iva2_cm_clkstctrl; | 80 | u32 iva2_cm_clkstctrl; |
82 | u32 mpu_cm_clkstctrl; | 81 | u32 mpu_cm_clkstctrl; |
83 | u32 core_cm_clkstctrl; | 82 | u32 core_cm_clkstctrl; |
@@ -124,19 +123,25 @@ struct omap3_prcm_regs prcm_context; | |||
124 | u32 omap_prcm_get_reset_sources(void) | 123 | u32 omap_prcm_get_reset_sources(void) |
125 | { | 124 | { |
126 | /* XXX This presumably needs modification for 34XX */ | 125 | /* XXX This presumably needs modification for 34XX */ |
127 | return prm_read_mod_reg(WKUP_MOD, RM_RSTST) & 0x7f; | 126 | if (cpu_is_omap24xx() | cpu_is_omap34xx()) |
127 | return prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f; | ||
128 | if (cpu_is_omap44xx()) | ||
129 | return prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f; | ||
130 | |||
131 | return 0; | ||
128 | } | 132 | } |
129 | EXPORT_SYMBOL(omap_prcm_get_reset_sources); | 133 | EXPORT_SYMBOL(omap_prcm_get_reset_sources); |
130 | 134 | ||
131 | /* Resets clock rates and reboots the system. Only called from system.h */ | 135 | /* Resets clock rates and reboots the system. Only called from system.h */ |
132 | void omap_prcm_arch_reset(char mode) | 136 | void omap_prcm_arch_reset(char mode) |
133 | { | 137 | { |
134 | s16 prcm_offs; | 138 | s16 prcm_offs = 0; |
135 | omap2_clk_prepare_for_reboot(); | 139 | |
140 | if (cpu_is_omap24xx()) { | ||
141 | omap2xxx_clk_prepare_for_reboot(); | ||
136 | 142 | ||
137 | if (cpu_is_omap24xx()) | ||
138 | prcm_offs = WKUP_MOD; | 143 | prcm_offs = WKUP_MOD; |
139 | else if (cpu_is_omap34xx()) { | 144 | } else if (cpu_is_omap34xx()) { |
140 | u32 l; | 145 | u32 l; |
141 | 146 | ||
142 | prcm_offs = OMAP3430_GR_MOD; | 147 | prcm_offs = OMAP3430_GR_MOD; |
@@ -147,10 +152,17 @@ void omap_prcm_arch_reset(char mode) | |||
147 | * cf. OMAP34xx TRM, Initialization / Software Booting | 152 | * cf. OMAP34xx TRM, Initialization / Software Booting |
148 | * Configuration. */ | 153 | * Configuration. */ |
149 | omap_writel(l, OMAP343X_SCRATCHPAD + 4); | 154 | omap_writel(l, OMAP343X_SCRATCHPAD + 4); |
150 | } else | 155 | } else if (cpu_is_omap44xx()) |
156 | prcm_offs = OMAP4430_PRM_DEVICE_MOD; | ||
157 | else | ||
151 | WARN_ON(1); | 158 | WARN_ON(1); |
152 | 159 | ||
153 | prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL); | 160 | if (cpu_is_omap24xx() | cpu_is_omap34xx()) |
161 | prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, | ||
162 | OMAP2_RM_RSTCTRL); | ||
163 | if (cpu_is_omap44xx()) | ||
164 | prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, | ||
165 | OMAP4_RM_RSTCTRL); | ||
154 | } | 166 | } |
155 | 167 | ||
156 | static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) | 168 | static inline u32 __omap_prcm_read(void __iomem *base, s16 module, u16 reg) |
@@ -191,6 +203,18 @@ u32 prm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx) | |||
191 | return v; | 203 | return v; |
192 | } | 204 | } |
193 | 205 | ||
206 | /* Read a PRM register, AND it, and shift the result down to bit 0 */ | ||
207 | u32 prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) | ||
208 | { | ||
209 | u32 v; | ||
210 | |||
211 | v = prm_read_mod_reg(domain, idx); | ||
212 | v &= mask; | ||
213 | v >>= __ffs(mask); | ||
214 | |||
215 | return v; | ||
216 | } | ||
217 | |||
194 | /* Read a register in a CM module */ | 218 | /* Read a register in a CM module */ |
195 | u32 cm_read_mod_reg(s16 module, u16 idx) | 219 | u32 cm_read_mod_reg(s16 module, u16 idx) |
196 | { | 220 | { |
@@ -220,26 +244,22 @@ u32 cm_rmw_mod_reg_bits(u32 mask, u32 bits, s16 module, s16 idx) | |||
220 | * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness | 244 | * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness |
221 | * @reg: physical address of module IDLEST register | 245 | * @reg: physical address of module IDLEST register |
222 | * @mask: value to mask against to determine if the module is active | 246 | * @mask: value to mask against to determine if the module is active |
247 | * @idlest: idle state indicator (0 or 1) for the clock | ||
223 | * @name: name of the clock (for printk) | 248 | * @name: name of the clock (for printk) |
224 | * | 249 | * |
225 | * Returns 1 if the module indicated readiness in time, or 0 if it | 250 | * Returns 1 if the module indicated readiness in time, or 0 if it |
226 | * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds. | 251 | * failed to enable in roughly MAX_MODULE_ENABLE_WAIT microseconds. |
227 | */ | 252 | */ |
228 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name) | 253 | int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, |
254 | const char *name) | ||
229 | { | 255 | { |
230 | int i = 0; | 256 | int i = 0; |
231 | int ena = 0; | 257 | int ena = 0; |
232 | 258 | ||
233 | /* | 259 | if (idlest) |
234 | * 24xx uses 0 to indicate not ready, and 1 to indicate ready. | ||
235 | * 34xx reverses this, just to keep us on our toes | ||
236 | */ | ||
237 | if (cpu_is_omap24xx()) | ||
238 | ena = mask; | ||
239 | else if (cpu_is_omap34xx()) | ||
240 | ena = 0; | 260 | ena = 0; |
241 | else | 261 | else |
242 | BUG(); | 262 | ena = mask; |
243 | 263 | ||
244 | /* Wait for lock */ | 264 | /* Wait for lock */ |
245 | omap_test_timeout(((__raw_readl(reg) & mask) == ena), | 265 | omap_test_timeout(((__raw_readl(reg) & mask) == ena), |
@@ -257,9 +277,19 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, const char *name) | |||
257 | 277 | ||
258 | void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals) | 278 | void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals) |
259 | { | 279 | { |
260 | prm_base = omap2_globals->prm; | 280 | /* Static mapping, never released */ |
261 | cm_base = omap2_globals->cm; | 281 | if (omap2_globals->prm) { |
262 | cm2_base = omap2_globals->cm2; | 282 | prm_base = ioremap(omap2_globals->prm, SZ_8K); |
283 | WARN_ON(!prm_base); | ||
284 | } | ||
285 | if (omap2_globals->cm) { | ||
286 | cm_base = ioremap(omap2_globals->cm, SZ_8K); | ||
287 | WARN_ON(!cm_base); | ||
288 | } | ||
289 | if (omap2_globals->cm2) { | ||
290 | cm2_base = ioremap(omap2_globals->cm2, SZ_8K); | ||
291 | WARN_ON(!cm2_base); | ||
292 | } | ||
263 | } | 293 | } |
264 | 294 | ||
265 | #ifdef CONFIG_ARCH_OMAP3 | 295 | #ifdef CONFIG_ARCH_OMAP3 |
@@ -274,7 +304,6 @@ void omap3_prcm_save_context(void) | |||
274 | prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG); | 304 | prcm_context.cm_sysconfig = __raw_readl(OMAP3430_CM_SYSCONFIG); |
275 | prcm_context.sgx_cm_clksel = | 305 | prcm_context.sgx_cm_clksel = |
276 | cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL); | 306 | cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSEL); |
277 | prcm_context.wkup_cm_clksel = cm_read_mod_reg(WKUP_MOD, CM_CLKSEL); | ||
278 | prcm_context.dss_cm_clksel = | 307 | prcm_context.dss_cm_clksel = |
279 | cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL); | 308 | cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSEL); |
280 | prcm_context.cam_cm_clksel = | 309 | prcm_context.cam_cm_clksel = |
@@ -284,15 +313,13 @@ void omap3_prcm_save_context(void) | |||
284 | prcm_context.emu_cm_clksel = | 313 | prcm_context.emu_cm_clksel = |
285 | cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1); | 314 | cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSEL1); |
286 | prcm_context.emu_cm_clkstctrl = | 315 | prcm_context.emu_cm_clkstctrl = |
287 | cm_read_mod_reg(OMAP3430_EMU_MOD, CM_CLKSTCTRL); | 316 | cm_read_mod_reg(OMAP3430_EMU_MOD, OMAP2_CM_CLKSTCTRL); |
288 | prcm_context.pll_cm_autoidle2 = | 317 | prcm_context.pll_cm_autoidle2 = |
289 | cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2); | 318 | cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE2); |
290 | prcm_context.pll_cm_clksel4 = | 319 | prcm_context.pll_cm_clksel4 = |
291 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4); | 320 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL4); |
292 | prcm_context.pll_cm_clksel5 = | 321 | prcm_context.pll_cm_clksel5 = |
293 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5); | 322 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKSEL5); |
294 | prcm_context.pll_cm_clken = | ||
295 | cm_read_mod_reg(PLL_MOD, CM_CLKEN); | ||
296 | prcm_context.pll_cm_clken2 = | 323 | prcm_context.pll_cm_clken2 = |
297 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2); | 324 | cm_read_mod_reg(PLL_MOD, OMAP3430ES2_CM_CLKEN2); |
298 | prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL); | 325 | prcm_context.cm_polctrl = __raw_readl(OMAP3430_CM_POLCTRL); |
@@ -338,26 +365,26 @@ void omap3_prcm_save_context(void) | |||
338 | cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2); | 365 | cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_AUTOIDLE2); |
339 | prcm_context.mpu_cm_autoidle2 = | 366 | prcm_context.mpu_cm_autoidle2 = |
340 | cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2); | 367 | cm_read_mod_reg(MPU_MOD, CM_AUTOIDLE2); |
341 | prcm_context.pll_cm_autoidle = | ||
342 | cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE); | ||
343 | prcm_context.iva2_cm_clkstctrl = | 368 | prcm_context.iva2_cm_clkstctrl = |
344 | cm_read_mod_reg(OMAP3430_IVA2_MOD, CM_CLKSTCTRL); | 369 | cm_read_mod_reg(OMAP3430_IVA2_MOD, OMAP2_CM_CLKSTCTRL); |
345 | prcm_context.mpu_cm_clkstctrl = | 370 | prcm_context.mpu_cm_clkstctrl = |
346 | cm_read_mod_reg(MPU_MOD, CM_CLKSTCTRL); | 371 | cm_read_mod_reg(MPU_MOD, OMAP2_CM_CLKSTCTRL); |
347 | prcm_context.core_cm_clkstctrl = | 372 | prcm_context.core_cm_clkstctrl = |
348 | cm_read_mod_reg(CORE_MOD, CM_CLKSTCTRL); | 373 | cm_read_mod_reg(CORE_MOD, OMAP2_CM_CLKSTCTRL); |
349 | prcm_context.sgx_cm_clkstctrl = | 374 | prcm_context.sgx_cm_clkstctrl = |
350 | cm_read_mod_reg(OMAP3430ES2_SGX_MOD, CM_CLKSTCTRL); | 375 | cm_read_mod_reg(OMAP3430ES2_SGX_MOD, |
376 | OMAP2_CM_CLKSTCTRL); | ||
351 | prcm_context.dss_cm_clkstctrl = | 377 | prcm_context.dss_cm_clkstctrl = |
352 | cm_read_mod_reg(OMAP3430_DSS_MOD, CM_CLKSTCTRL); | 378 | cm_read_mod_reg(OMAP3430_DSS_MOD, OMAP2_CM_CLKSTCTRL); |
353 | prcm_context.cam_cm_clkstctrl = | 379 | prcm_context.cam_cm_clkstctrl = |
354 | cm_read_mod_reg(OMAP3430_CAM_MOD, CM_CLKSTCTRL); | 380 | cm_read_mod_reg(OMAP3430_CAM_MOD, OMAP2_CM_CLKSTCTRL); |
355 | prcm_context.per_cm_clkstctrl = | 381 | prcm_context.per_cm_clkstctrl = |
356 | cm_read_mod_reg(OMAP3430_PER_MOD, CM_CLKSTCTRL); | 382 | cm_read_mod_reg(OMAP3430_PER_MOD, OMAP2_CM_CLKSTCTRL); |
357 | prcm_context.neon_cm_clkstctrl = | 383 | prcm_context.neon_cm_clkstctrl = |
358 | cm_read_mod_reg(OMAP3430_NEON_MOD, CM_CLKSTCTRL); | 384 | cm_read_mod_reg(OMAP3430_NEON_MOD, OMAP2_CM_CLKSTCTRL); |
359 | prcm_context.usbhost_cm_clkstctrl = | 385 | prcm_context.usbhost_cm_clkstctrl = |
360 | cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, CM_CLKSTCTRL); | 386 | cm_read_mod_reg(OMAP3430ES2_USBHOST_MOD, |
387 | OMAP2_CM_CLKSTCTRL); | ||
361 | prcm_context.core_cm_autoidle1 = | 388 | prcm_context.core_cm_autoidle1 = |
362 | cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1); | 389 | cm_read_mod_reg(CORE_MOD, CM_AUTOIDLE1); |
363 | prcm_context.core_cm_autoidle2 = | 390 | prcm_context.core_cm_autoidle2 = |
@@ -431,7 +458,6 @@ void omap3_prcm_restore_context(void) | |||
431 | __raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG); | 458 | __raw_writel(prcm_context.cm_sysconfig, OMAP3430_CM_SYSCONFIG); |
432 | cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD, | 459 | cm_write_mod_reg(prcm_context.sgx_cm_clksel, OMAP3430ES2_SGX_MOD, |
433 | CM_CLKSEL); | 460 | CM_CLKSEL); |
434 | cm_write_mod_reg(prcm_context.wkup_cm_clksel, WKUP_MOD, CM_CLKSEL); | ||
435 | cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD, | 461 | cm_write_mod_reg(prcm_context.dss_cm_clksel, OMAP3430_DSS_MOD, |
436 | CM_CLKSEL); | 462 | CM_CLKSEL); |
437 | cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD, | 463 | cm_write_mod_reg(prcm_context.cam_cm_clksel, OMAP3430_CAM_MOD, |
@@ -441,14 +467,13 @@ void omap3_prcm_restore_context(void) | |||
441 | cm_write_mod_reg(prcm_context.emu_cm_clksel, OMAP3430_EMU_MOD, | 467 | cm_write_mod_reg(prcm_context.emu_cm_clksel, OMAP3430_EMU_MOD, |
442 | CM_CLKSEL1); | 468 | CM_CLKSEL1); |
443 | cm_write_mod_reg(prcm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD, | 469 | cm_write_mod_reg(prcm_context.emu_cm_clkstctrl, OMAP3430_EMU_MOD, |
444 | CM_CLKSTCTRL); | 470 | OMAP2_CM_CLKSTCTRL); |
445 | cm_write_mod_reg(prcm_context.pll_cm_autoidle2, PLL_MOD, | 471 | cm_write_mod_reg(prcm_context.pll_cm_autoidle2, PLL_MOD, |
446 | CM_AUTOIDLE2); | 472 | CM_AUTOIDLE2); |
447 | cm_write_mod_reg(prcm_context.pll_cm_clksel4, PLL_MOD, | 473 | cm_write_mod_reg(prcm_context.pll_cm_clksel4, PLL_MOD, |
448 | OMAP3430ES2_CM_CLKSEL4); | 474 | OMAP3430ES2_CM_CLKSEL4); |
449 | cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD, | 475 | cm_write_mod_reg(prcm_context.pll_cm_clksel5, PLL_MOD, |
450 | OMAP3430ES2_CM_CLKSEL5); | 476 | OMAP3430ES2_CM_CLKSEL5); |
451 | cm_write_mod_reg(prcm_context.pll_cm_clken, PLL_MOD, CM_CLKEN); | ||
452 | cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD, | 477 | cm_write_mod_reg(prcm_context.pll_cm_clken2, PLL_MOD, |
453 | OMAP3430ES2_CM_CLKEN2); | 478 | OMAP3430ES2_CM_CLKEN2); |
454 | __raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL); | 479 | __raw_writel(prcm_context.cm_polctrl, OMAP3430_CM_POLCTRL); |
@@ -487,24 +512,24 @@ void omap3_prcm_restore_context(void) | |||
487 | cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD, | 512 | cm_write_mod_reg(prcm_context.iva2_cm_autiidle2, OMAP3430_IVA2_MOD, |
488 | CM_AUTOIDLE2); | 513 | CM_AUTOIDLE2); |
489 | cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2); | 514 | cm_write_mod_reg(prcm_context.mpu_cm_autoidle2, MPU_MOD, CM_AUTOIDLE2); |
490 | cm_write_mod_reg(prcm_context.pll_cm_autoidle, PLL_MOD, CM_AUTOIDLE); | ||
491 | cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD, | 515 | cm_write_mod_reg(prcm_context.iva2_cm_clkstctrl, OMAP3430_IVA2_MOD, |
492 | CM_CLKSTCTRL); | 516 | OMAP2_CM_CLKSTCTRL); |
493 | cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD, CM_CLKSTCTRL); | 517 | cm_write_mod_reg(prcm_context.mpu_cm_clkstctrl, MPU_MOD, |
518 | OMAP2_CM_CLKSTCTRL); | ||
494 | cm_write_mod_reg(prcm_context.core_cm_clkstctrl, CORE_MOD, | 519 | cm_write_mod_reg(prcm_context.core_cm_clkstctrl, CORE_MOD, |
495 | CM_CLKSTCTRL); | 520 | OMAP2_CM_CLKSTCTRL); |
496 | cm_write_mod_reg(prcm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD, | 521 | cm_write_mod_reg(prcm_context.sgx_cm_clkstctrl, OMAP3430ES2_SGX_MOD, |
497 | CM_CLKSTCTRL); | 522 | OMAP2_CM_CLKSTCTRL); |
498 | cm_write_mod_reg(prcm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD, | 523 | cm_write_mod_reg(prcm_context.dss_cm_clkstctrl, OMAP3430_DSS_MOD, |
499 | CM_CLKSTCTRL); | 524 | OMAP2_CM_CLKSTCTRL); |
500 | cm_write_mod_reg(prcm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD, | 525 | cm_write_mod_reg(prcm_context.cam_cm_clkstctrl, OMAP3430_CAM_MOD, |
501 | CM_CLKSTCTRL); | 526 | OMAP2_CM_CLKSTCTRL); |
502 | cm_write_mod_reg(prcm_context.per_cm_clkstctrl, OMAP3430_PER_MOD, | 527 | cm_write_mod_reg(prcm_context.per_cm_clkstctrl, OMAP3430_PER_MOD, |
503 | CM_CLKSTCTRL); | 528 | OMAP2_CM_CLKSTCTRL); |
504 | cm_write_mod_reg(prcm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD, | 529 | cm_write_mod_reg(prcm_context.neon_cm_clkstctrl, OMAP3430_NEON_MOD, |
505 | CM_CLKSTCTRL); | 530 | OMAP2_CM_CLKSTCTRL); |
506 | cm_write_mod_reg(prcm_context.usbhost_cm_clkstctrl, | 531 | cm_write_mod_reg(prcm_context.usbhost_cm_clkstctrl, |
507 | OMAP3430ES2_USBHOST_MOD, CM_CLKSTCTRL); | 532 | OMAP3430ES2_USBHOST_MOD, OMAP2_CM_CLKSTCTRL); |
508 | cm_write_mod_reg(prcm_context.core_cm_autoidle1, CORE_MOD, | 533 | cm_write_mod_reg(prcm_context.core_cm_autoidle1, CORE_MOD, |
509 | CM_AUTOIDLE1); | 534 | CM_AUTOIDLE1); |
510 | cm_write_mod_reg(prcm_context.core_cm_autoidle2, CORE_MOD, | 535 | cm_write_mod_reg(prcm_context.core_cm_autoidle2, CORE_MOD, |
diff --git a/arch/arm/mach-omap2/prm-regbits-44xx.h b/arch/arm/mach-omap2/prm-regbits-44xx.h index 301c810fb269..597be4a2b9ff 100644 --- a/arch/arm/mach-omap2/prm-regbits-44xx.h +++ b/arch/arm/mach-omap2/prm-regbits-44xx.h | |||
@@ -29,412 +29,412 @@ | |||
29 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 29 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
30 | * PRM_LDO_SRAM_MPU_SETUP | 30 | * PRM_LDO_SRAM_MPU_SETUP |
31 | */ | 31 | */ |
32 | #define OMAP4430_ABBOFF_ACT_EXPORT_SHIFT (1 << 1) | 32 | #define OMAP4430_ABBOFF_ACT_EXPORT_SHIFT 1 |
33 | #define OMAP4430_ABBOFF_ACT_EXPORT_MASK BITFIELD(1, 1) | 33 | #define OMAP4430_ABBOFF_ACT_EXPORT_MASK BITFIELD(1, 1) |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 36 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
37 | * PRM_LDO_SRAM_MPU_SETUP | 37 | * PRM_LDO_SRAM_MPU_SETUP |
38 | */ | 38 | */ |
39 | #define OMAP4430_ABBOFF_SLEEP_EXPORT_SHIFT (1 << 2) | 39 | #define OMAP4430_ABBOFF_SLEEP_EXPORT_SHIFT 2 |
40 | #define OMAP4430_ABBOFF_SLEEP_EXPORT_MASK BITFIELD(2, 2) | 40 | #define OMAP4430_ABBOFF_SLEEP_EXPORT_MASK BITFIELD(2, 2) |
41 | 41 | ||
42 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 42 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
43 | #define OMAP4430_ABB_IVA_DONE_EN_SHIFT (1 << 31) | 43 | #define OMAP4430_ABB_IVA_DONE_EN_SHIFT 31 |
44 | #define OMAP4430_ABB_IVA_DONE_EN_MASK BITFIELD(31, 31) | 44 | #define OMAP4430_ABB_IVA_DONE_EN_MASK BITFIELD(31, 31) |
45 | 45 | ||
46 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 46 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
47 | #define OMAP4430_ABB_IVA_DONE_ST_SHIFT (1 << 31) | 47 | #define OMAP4430_ABB_IVA_DONE_ST_SHIFT 31 |
48 | #define OMAP4430_ABB_IVA_DONE_ST_MASK BITFIELD(31, 31) | 48 | #define OMAP4430_ABB_IVA_DONE_ST_MASK BITFIELD(31, 31) |
49 | 49 | ||
50 | /* Used by PRM_IRQENABLE_MPU_2 */ | 50 | /* Used by PRM_IRQENABLE_MPU_2 */ |
51 | #define OMAP4430_ABB_MPU_DONE_EN_SHIFT (1 << 7) | 51 | #define OMAP4430_ABB_MPU_DONE_EN_SHIFT 7 |
52 | #define OMAP4430_ABB_MPU_DONE_EN_MASK BITFIELD(7, 7) | 52 | #define OMAP4430_ABB_MPU_DONE_EN_MASK BITFIELD(7, 7) |
53 | 53 | ||
54 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 54 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
55 | #define OMAP4430_ABB_MPU_DONE_ST_SHIFT (1 << 7) | 55 | #define OMAP4430_ABB_MPU_DONE_ST_SHIFT 7 |
56 | #define OMAP4430_ABB_MPU_DONE_ST_MASK BITFIELD(7, 7) | 56 | #define OMAP4430_ABB_MPU_DONE_ST_MASK BITFIELD(7, 7) |
57 | 57 | ||
58 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ | 58 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ |
59 | #define OMAP4430_ACTIVE_FBB_SEL_SHIFT (1 << 2) | 59 | #define OMAP4430_ACTIVE_FBB_SEL_SHIFT 2 |
60 | #define OMAP4430_ACTIVE_FBB_SEL_MASK BITFIELD(2, 2) | 60 | #define OMAP4430_ACTIVE_FBB_SEL_MASK BITFIELD(2, 2) |
61 | 61 | ||
62 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ | 62 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ |
63 | #define OMAP4430_ACTIVE_RBB_SEL_SHIFT (1 << 1) | 63 | #define OMAP4430_ACTIVE_RBB_SEL_SHIFT 1 |
64 | #define OMAP4430_ACTIVE_RBB_SEL_MASK BITFIELD(1, 1) | 64 | #define OMAP4430_ACTIVE_RBB_SEL_MASK BITFIELD(1, 1) |
65 | 65 | ||
66 | /* Used by PM_ABE_PWRSTCTRL */ | 66 | /* Used by PM_ABE_PWRSTCTRL */ |
67 | #define OMAP4430_AESSMEM_ONSTATE_SHIFT (1 << 16) | 67 | #define OMAP4430_AESSMEM_ONSTATE_SHIFT 16 |
68 | #define OMAP4430_AESSMEM_ONSTATE_MASK BITFIELD(16, 17) | 68 | #define OMAP4430_AESSMEM_ONSTATE_MASK BITFIELD(16, 17) |
69 | 69 | ||
70 | /* Used by PM_ABE_PWRSTCTRL */ | 70 | /* Used by PM_ABE_PWRSTCTRL */ |
71 | #define OMAP4430_AESSMEM_RETSTATE_SHIFT (1 << 8) | 71 | #define OMAP4430_AESSMEM_RETSTATE_SHIFT 8 |
72 | #define OMAP4430_AESSMEM_RETSTATE_MASK BITFIELD(8, 8) | 72 | #define OMAP4430_AESSMEM_RETSTATE_MASK BITFIELD(8, 8) |
73 | 73 | ||
74 | /* Used by PM_ABE_PWRSTST */ | 74 | /* Used by PM_ABE_PWRSTST */ |
75 | #define OMAP4430_AESSMEM_STATEST_SHIFT (1 << 4) | 75 | #define OMAP4430_AESSMEM_STATEST_SHIFT 4 |
76 | #define OMAP4430_AESSMEM_STATEST_MASK BITFIELD(4, 5) | 76 | #define OMAP4430_AESSMEM_STATEST_MASK BITFIELD(4, 5) |
77 | 77 | ||
78 | /* | 78 | /* |
79 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 79 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
80 | * PRM_LDO_SRAM_MPU_SETUP | 80 | * PRM_LDO_SRAM_MPU_SETUP |
81 | */ | 81 | */ |
82 | #define OMAP4430_AIPOFF_SHIFT (1 << 8) | 82 | #define OMAP4430_AIPOFF_SHIFT 8 |
83 | #define OMAP4430_AIPOFF_MASK BITFIELD(8, 8) | 83 | #define OMAP4430_AIPOFF_MASK BITFIELD(8, 8) |
84 | 84 | ||
85 | /* Used by PRM_VOLTCTRL */ | 85 | /* Used by PRM_VOLTCTRL */ |
86 | #define OMAP4430_AUTO_CTRL_VDD_CORE_L_SHIFT (1 << 0) | 86 | #define OMAP4430_AUTO_CTRL_VDD_CORE_L_SHIFT 0 |
87 | #define OMAP4430_AUTO_CTRL_VDD_CORE_L_MASK BITFIELD(0, 1) | 87 | #define OMAP4430_AUTO_CTRL_VDD_CORE_L_MASK BITFIELD(0, 1) |
88 | 88 | ||
89 | /* Used by PRM_VOLTCTRL */ | 89 | /* Used by PRM_VOLTCTRL */ |
90 | #define OMAP4430_AUTO_CTRL_VDD_IVA_L_SHIFT (1 << 4) | 90 | #define OMAP4430_AUTO_CTRL_VDD_IVA_L_SHIFT 4 |
91 | #define OMAP4430_AUTO_CTRL_VDD_IVA_L_MASK BITFIELD(4, 5) | 91 | #define OMAP4430_AUTO_CTRL_VDD_IVA_L_MASK BITFIELD(4, 5) |
92 | 92 | ||
93 | /* Used by PRM_VOLTCTRL */ | 93 | /* Used by PRM_VOLTCTRL */ |
94 | #define OMAP4430_AUTO_CTRL_VDD_MPU_L_SHIFT (1 << 2) | 94 | #define OMAP4430_AUTO_CTRL_VDD_MPU_L_SHIFT 2 |
95 | #define OMAP4430_AUTO_CTRL_VDD_MPU_L_MASK BITFIELD(2, 3) | 95 | #define OMAP4430_AUTO_CTRL_VDD_MPU_L_MASK BITFIELD(2, 3) |
96 | 96 | ||
97 | /* Used by PM_CAM_PWRSTCTRL */ | 97 | /* Used by PM_CAM_PWRSTCTRL */ |
98 | #define OMAP4430_CAM_MEM_ONSTATE_SHIFT (1 << 16) | 98 | #define OMAP4430_CAM_MEM_ONSTATE_SHIFT 16 |
99 | #define OMAP4430_CAM_MEM_ONSTATE_MASK BITFIELD(16, 17) | 99 | #define OMAP4430_CAM_MEM_ONSTATE_MASK BITFIELD(16, 17) |
100 | 100 | ||
101 | /* Used by PM_CAM_PWRSTST */ | 101 | /* Used by PM_CAM_PWRSTST */ |
102 | #define OMAP4430_CAM_MEM_STATEST_SHIFT (1 << 4) | 102 | #define OMAP4430_CAM_MEM_STATEST_SHIFT 4 |
103 | #define OMAP4430_CAM_MEM_STATEST_MASK BITFIELD(4, 5) | 103 | #define OMAP4430_CAM_MEM_STATEST_MASK BITFIELD(4, 5) |
104 | 104 | ||
105 | /* Used by PRM_CLKREQCTRL */ | 105 | /* Used by PRM_CLKREQCTRL */ |
106 | #define OMAP4430_CLKREQ_COND_SHIFT (1 << 0) | 106 | #define OMAP4430_CLKREQ_COND_SHIFT 0 |
107 | #define OMAP4430_CLKREQ_COND_MASK BITFIELD(0, 2) | 107 | #define OMAP4430_CLKREQ_COND_MASK BITFIELD(0, 2) |
108 | 108 | ||
109 | /* Used by PRM_VC_VAL_SMPS_RA_CMD */ | 109 | /* Used by PRM_VC_VAL_SMPS_RA_CMD */ |
110 | #define OMAP4430_CMDRA_VDD_CORE_L_SHIFT (1 << 0) | 110 | #define OMAP4430_CMDRA_VDD_CORE_L_SHIFT 0 |
111 | #define OMAP4430_CMDRA_VDD_CORE_L_MASK BITFIELD(0, 7) | 111 | #define OMAP4430_CMDRA_VDD_CORE_L_MASK BITFIELD(0, 7) |
112 | 112 | ||
113 | /* Used by PRM_VC_VAL_SMPS_RA_CMD */ | 113 | /* Used by PRM_VC_VAL_SMPS_RA_CMD */ |
114 | #define OMAP4430_CMDRA_VDD_IVA_L_SHIFT (1 << 8) | 114 | #define OMAP4430_CMDRA_VDD_IVA_L_SHIFT 8 |
115 | #define OMAP4430_CMDRA_VDD_IVA_L_MASK BITFIELD(8, 15) | 115 | #define OMAP4430_CMDRA_VDD_IVA_L_MASK BITFIELD(8, 15) |
116 | 116 | ||
117 | /* Used by PRM_VC_VAL_SMPS_RA_CMD */ | 117 | /* Used by PRM_VC_VAL_SMPS_RA_CMD */ |
118 | #define OMAP4430_CMDRA_VDD_MPU_L_SHIFT (1 << 16) | 118 | #define OMAP4430_CMDRA_VDD_MPU_L_SHIFT 16 |
119 | #define OMAP4430_CMDRA_VDD_MPU_L_MASK BITFIELD(16, 23) | 119 | #define OMAP4430_CMDRA_VDD_MPU_L_MASK BITFIELD(16, 23) |
120 | 120 | ||
121 | /* Used by PRM_VC_CFG_CHANNEL */ | 121 | /* Used by PRM_VC_CFG_CHANNEL */ |
122 | #define OMAP4430_CMD_VDD_CORE_L_SHIFT (1 << 4) | 122 | #define OMAP4430_CMD_VDD_CORE_L_SHIFT 4 |
123 | #define OMAP4430_CMD_VDD_CORE_L_MASK BITFIELD(4, 4) | 123 | #define OMAP4430_CMD_VDD_CORE_L_MASK BITFIELD(4, 4) |
124 | 124 | ||
125 | /* Used by PRM_VC_CFG_CHANNEL */ | 125 | /* Used by PRM_VC_CFG_CHANNEL */ |
126 | #define OMAP4430_CMD_VDD_IVA_L_SHIFT (1 << 12) | 126 | #define OMAP4430_CMD_VDD_IVA_L_SHIFT 12 |
127 | #define OMAP4430_CMD_VDD_IVA_L_MASK BITFIELD(12, 12) | 127 | #define OMAP4430_CMD_VDD_IVA_L_MASK BITFIELD(12, 12) |
128 | 128 | ||
129 | /* Used by PRM_VC_CFG_CHANNEL */ | 129 | /* Used by PRM_VC_CFG_CHANNEL */ |
130 | #define OMAP4430_CMD_VDD_MPU_L_SHIFT (1 << 17) | 130 | #define OMAP4430_CMD_VDD_MPU_L_SHIFT 17 |
131 | #define OMAP4430_CMD_VDD_MPU_L_MASK BITFIELD(17, 17) | 131 | #define OMAP4430_CMD_VDD_MPU_L_MASK BITFIELD(17, 17) |
132 | 132 | ||
133 | /* Used by PM_CORE_PWRSTCTRL */ | 133 | /* Used by PM_CORE_PWRSTCTRL */ |
134 | #define OMAP4430_CORE_OCMRAM_ONSTATE_SHIFT (1 << 18) | 134 | #define OMAP4430_CORE_OCMRAM_ONSTATE_SHIFT 18 |
135 | #define OMAP4430_CORE_OCMRAM_ONSTATE_MASK BITFIELD(18, 19) | 135 | #define OMAP4430_CORE_OCMRAM_ONSTATE_MASK BITFIELD(18, 19) |
136 | 136 | ||
137 | /* Used by PM_CORE_PWRSTCTRL */ | 137 | /* Used by PM_CORE_PWRSTCTRL */ |
138 | #define OMAP4430_CORE_OCMRAM_RETSTATE_SHIFT (1 << 9) | 138 | #define OMAP4430_CORE_OCMRAM_RETSTATE_SHIFT 9 |
139 | #define OMAP4430_CORE_OCMRAM_RETSTATE_MASK BITFIELD(9, 9) | 139 | #define OMAP4430_CORE_OCMRAM_RETSTATE_MASK BITFIELD(9, 9) |
140 | 140 | ||
141 | /* Used by PM_CORE_PWRSTST */ | 141 | /* Used by PM_CORE_PWRSTST */ |
142 | #define OMAP4430_CORE_OCMRAM_STATEST_SHIFT (1 << 6) | 142 | #define OMAP4430_CORE_OCMRAM_STATEST_SHIFT 6 |
143 | #define OMAP4430_CORE_OCMRAM_STATEST_MASK BITFIELD(6, 7) | 143 | #define OMAP4430_CORE_OCMRAM_STATEST_MASK BITFIELD(6, 7) |
144 | 144 | ||
145 | /* Used by PM_CORE_PWRSTCTRL */ | 145 | /* Used by PM_CORE_PWRSTCTRL */ |
146 | #define OMAP4430_CORE_OTHER_BANK_ONSTATE_SHIFT (1 << 16) | 146 | #define OMAP4430_CORE_OTHER_BANK_ONSTATE_SHIFT 16 |
147 | #define OMAP4430_CORE_OTHER_BANK_ONSTATE_MASK BITFIELD(16, 17) | 147 | #define OMAP4430_CORE_OTHER_BANK_ONSTATE_MASK BITFIELD(16, 17) |
148 | 148 | ||
149 | /* Used by PM_CORE_PWRSTCTRL */ | 149 | /* Used by PM_CORE_PWRSTCTRL */ |
150 | #define OMAP4430_CORE_OTHER_BANK_RETSTATE_SHIFT (1 << 8) | 150 | #define OMAP4430_CORE_OTHER_BANK_RETSTATE_SHIFT 8 |
151 | #define OMAP4430_CORE_OTHER_BANK_RETSTATE_MASK BITFIELD(8, 8) | 151 | #define OMAP4430_CORE_OTHER_BANK_RETSTATE_MASK BITFIELD(8, 8) |
152 | 152 | ||
153 | /* Used by PM_CORE_PWRSTST */ | 153 | /* Used by PM_CORE_PWRSTST */ |
154 | #define OMAP4430_CORE_OTHER_BANK_STATEST_SHIFT (1 << 4) | 154 | #define OMAP4430_CORE_OTHER_BANK_STATEST_SHIFT 4 |
155 | #define OMAP4430_CORE_OTHER_BANK_STATEST_MASK BITFIELD(4, 5) | 155 | #define OMAP4430_CORE_OTHER_BANK_STATEST_MASK BITFIELD(4, 5) |
156 | 156 | ||
157 | /* Used by PRM_VC_VAL_BYPASS */ | 157 | /* Used by PRM_VC_VAL_BYPASS */ |
158 | #define OMAP4430_DATA_SHIFT (1 << 16) | 158 | #define OMAP4430_DATA_SHIFT 16 |
159 | #define OMAP4430_DATA_MASK BITFIELD(16, 23) | 159 | #define OMAP4430_DATA_MASK BITFIELD(16, 23) |
160 | 160 | ||
161 | /* Used by PRM_DEVICE_OFF_CTRL */ | 161 | /* Used by PRM_DEVICE_OFF_CTRL */ |
162 | #define OMAP4430_DEVICE_OFF_ENABLE_SHIFT (1 << 0) | 162 | #define OMAP4430_DEVICE_OFF_ENABLE_SHIFT 0 |
163 | #define OMAP4430_DEVICE_OFF_ENABLE_MASK BITFIELD(0, 0) | 163 | #define OMAP4430_DEVICE_OFF_ENABLE_MASK BITFIELD(0, 0) |
164 | 164 | ||
165 | /* Used by PRM_VC_CFG_I2C_MODE */ | 165 | /* Used by PRM_VC_CFG_I2C_MODE */ |
166 | #define OMAP4430_DFILTEREN_SHIFT (1 << 6) | 166 | #define OMAP4430_DFILTEREN_SHIFT 6 |
167 | #define OMAP4430_DFILTEREN_MASK BITFIELD(6, 6) | 167 | #define OMAP4430_DFILTEREN_MASK BITFIELD(6, 6) |
168 | 168 | ||
169 | /* Used by PRM_IRQENABLE_MPU, PRM_IRQENABLE_TESLA */ | 169 | /* Used by PRM_IRQENABLE_MPU, PRM_IRQENABLE_TESLA */ |
170 | #define OMAP4430_DPLL_ABE_RECAL_EN_SHIFT (1 << 4) | 170 | #define OMAP4430_DPLL_ABE_RECAL_EN_SHIFT 4 |
171 | #define OMAP4430_DPLL_ABE_RECAL_EN_MASK BITFIELD(4, 4) | 171 | #define OMAP4430_DPLL_ABE_RECAL_EN_MASK BITFIELD(4, 4) |
172 | 172 | ||
173 | /* Used by PRM_IRQSTATUS_MPU, PRM_IRQSTATUS_TESLA */ | 173 | /* Used by PRM_IRQSTATUS_MPU, PRM_IRQSTATUS_TESLA */ |
174 | #define OMAP4430_DPLL_ABE_RECAL_ST_SHIFT (1 << 4) | 174 | #define OMAP4430_DPLL_ABE_RECAL_ST_SHIFT 4 |
175 | #define OMAP4430_DPLL_ABE_RECAL_ST_MASK BITFIELD(4, 4) | 175 | #define OMAP4430_DPLL_ABE_RECAL_ST_MASK BITFIELD(4, 4) |
176 | 176 | ||
177 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 177 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
178 | #define OMAP4430_DPLL_CORE_RECAL_EN_SHIFT (1 << 0) | 178 | #define OMAP4430_DPLL_CORE_RECAL_EN_SHIFT 0 |
179 | #define OMAP4430_DPLL_CORE_RECAL_EN_MASK BITFIELD(0, 0) | 179 | #define OMAP4430_DPLL_CORE_RECAL_EN_MASK BITFIELD(0, 0) |
180 | 180 | ||
181 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 181 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
182 | #define OMAP4430_DPLL_CORE_RECAL_ST_SHIFT (1 << 0) | 182 | #define OMAP4430_DPLL_CORE_RECAL_ST_SHIFT 0 |
183 | #define OMAP4430_DPLL_CORE_RECAL_ST_MASK BITFIELD(0, 0) | 183 | #define OMAP4430_DPLL_CORE_RECAL_ST_MASK BITFIELD(0, 0) |
184 | 184 | ||
185 | /* Used by PRM_IRQENABLE_MPU */ | 185 | /* Used by PRM_IRQENABLE_MPU */ |
186 | #define OMAP4430_DPLL_DDRPHY_RECAL_EN_SHIFT (1 << 6) | 186 | #define OMAP4430_DPLL_DDRPHY_RECAL_EN_SHIFT 6 |
187 | #define OMAP4430_DPLL_DDRPHY_RECAL_EN_MASK BITFIELD(6, 6) | 187 | #define OMAP4430_DPLL_DDRPHY_RECAL_EN_MASK BITFIELD(6, 6) |
188 | 188 | ||
189 | /* Used by PRM_IRQSTATUS_MPU */ | 189 | /* Used by PRM_IRQSTATUS_MPU */ |
190 | #define OMAP4430_DPLL_DDRPHY_RECAL_ST_SHIFT (1 << 6) | 190 | #define OMAP4430_DPLL_DDRPHY_RECAL_ST_SHIFT 6 |
191 | #define OMAP4430_DPLL_DDRPHY_RECAL_ST_MASK BITFIELD(6, 6) | 191 | #define OMAP4430_DPLL_DDRPHY_RECAL_ST_MASK BITFIELD(6, 6) |
192 | 192 | ||
193 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU, PRM_IRQENABLE_TESLA */ | 193 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU, PRM_IRQENABLE_TESLA */ |
194 | #define OMAP4430_DPLL_IVA_RECAL_EN_SHIFT (1 << 2) | 194 | #define OMAP4430_DPLL_IVA_RECAL_EN_SHIFT 2 |
195 | #define OMAP4430_DPLL_IVA_RECAL_EN_MASK BITFIELD(2, 2) | 195 | #define OMAP4430_DPLL_IVA_RECAL_EN_MASK BITFIELD(2, 2) |
196 | 196 | ||
197 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU, PRM_IRQSTATUS_TESLA */ | 197 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU, PRM_IRQSTATUS_TESLA */ |
198 | #define OMAP4430_DPLL_IVA_RECAL_ST_SHIFT (1 << 2) | 198 | #define OMAP4430_DPLL_IVA_RECAL_ST_SHIFT 2 |
199 | #define OMAP4430_DPLL_IVA_RECAL_ST_MASK BITFIELD(2, 2) | 199 | #define OMAP4430_DPLL_IVA_RECAL_ST_MASK BITFIELD(2, 2) |
200 | 200 | ||
201 | /* Used by PRM_IRQENABLE_MPU */ | 201 | /* Used by PRM_IRQENABLE_MPU */ |
202 | #define OMAP4430_DPLL_MPU_RECAL_EN_SHIFT (1 << 1) | 202 | #define OMAP4430_DPLL_MPU_RECAL_EN_SHIFT 1 |
203 | #define OMAP4430_DPLL_MPU_RECAL_EN_MASK BITFIELD(1, 1) | 203 | #define OMAP4430_DPLL_MPU_RECAL_EN_MASK BITFIELD(1, 1) |
204 | 204 | ||
205 | /* Used by PRM_IRQSTATUS_MPU */ | 205 | /* Used by PRM_IRQSTATUS_MPU */ |
206 | #define OMAP4430_DPLL_MPU_RECAL_ST_SHIFT (1 << 1) | 206 | #define OMAP4430_DPLL_MPU_RECAL_ST_SHIFT 1 |
207 | #define OMAP4430_DPLL_MPU_RECAL_ST_MASK BITFIELD(1, 1) | 207 | #define OMAP4430_DPLL_MPU_RECAL_ST_MASK BITFIELD(1, 1) |
208 | 208 | ||
209 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 209 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
210 | #define OMAP4430_DPLL_PER_RECAL_EN_SHIFT (1 << 3) | 210 | #define OMAP4430_DPLL_PER_RECAL_EN_SHIFT 3 |
211 | #define OMAP4430_DPLL_PER_RECAL_EN_MASK BITFIELD(3, 3) | 211 | #define OMAP4430_DPLL_PER_RECAL_EN_MASK BITFIELD(3, 3) |
212 | 212 | ||
213 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 213 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
214 | #define OMAP4430_DPLL_PER_RECAL_ST_SHIFT (1 << 3) | 214 | #define OMAP4430_DPLL_PER_RECAL_ST_SHIFT 3 |
215 | #define OMAP4430_DPLL_PER_RECAL_ST_MASK BITFIELD(3, 3) | 215 | #define OMAP4430_DPLL_PER_RECAL_ST_MASK BITFIELD(3, 3) |
216 | 216 | ||
217 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 217 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
218 | #define OMAP4430_DPLL_UNIPRO_RECAL_EN_SHIFT (1 << 7) | 218 | #define OMAP4430_DPLL_UNIPRO_RECAL_EN_SHIFT 7 |
219 | #define OMAP4430_DPLL_UNIPRO_RECAL_EN_MASK BITFIELD(7, 7) | 219 | #define OMAP4430_DPLL_UNIPRO_RECAL_EN_MASK BITFIELD(7, 7) |
220 | 220 | ||
221 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 221 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
222 | #define OMAP4430_DPLL_UNIPRO_RECAL_ST_SHIFT (1 << 7) | 222 | #define OMAP4430_DPLL_UNIPRO_RECAL_ST_SHIFT 7 |
223 | #define OMAP4430_DPLL_UNIPRO_RECAL_ST_MASK BITFIELD(7, 7) | 223 | #define OMAP4430_DPLL_UNIPRO_RECAL_ST_MASK BITFIELD(7, 7) |
224 | 224 | ||
225 | /* Used by PRM_IRQENABLE_MPU */ | 225 | /* Used by PRM_IRQENABLE_MPU */ |
226 | #define OMAP4430_DPLL_USB_RECAL_EN_SHIFT (1 << 5) | 226 | #define OMAP4430_DPLL_USB_RECAL_EN_SHIFT 5 |
227 | #define OMAP4430_DPLL_USB_RECAL_EN_MASK BITFIELD(5, 5) | 227 | #define OMAP4430_DPLL_USB_RECAL_EN_MASK BITFIELD(5, 5) |
228 | 228 | ||
229 | /* Used by PRM_IRQSTATUS_MPU */ | 229 | /* Used by PRM_IRQSTATUS_MPU */ |
230 | #define OMAP4430_DPLL_USB_RECAL_ST_SHIFT (1 << 5) | 230 | #define OMAP4430_DPLL_USB_RECAL_ST_SHIFT 5 |
231 | #define OMAP4430_DPLL_USB_RECAL_ST_MASK BITFIELD(5, 5) | 231 | #define OMAP4430_DPLL_USB_RECAL_ST_MASK BITFIELD(5, 5) |
232 | 232 | ||
233 | /* Used by PM_DSS_PWRSTCTRL */ | 233 | /* Used by PM_DSS_PWRSTCTRL */ |
234 | #define OMAP4430_DSS_MEM_ONSTATE_SHIFT (1 << 16) | 234 | #define OMAP4430_DSS_MEM_ONSTATE_SHIFT 16 |
235 | #define OMAP4430_DSS_MEM_ONSTATE_MASK BITFIELD(16, 17) | 235 | #define OMAP4430_DSS_MEM_ONSTATE_MASK BITFIELD(16, 17) |
236 | 236 | ||
237 | /* Used by PM_DSS_PWRSTCTRL */ | 237 | /* Used by PM_DSS_PWRSTCTRL */ |
238 | #define OMAP4430_DSS_MEM_RETSTATE_SHIFT (1 << 8) | 238 | #define OMAP4430_DSS_MEM_RETSTATE_SHIFT 8 |
239 | #define OMAP4430_DSS_MEM_RETSTATE_MASK BITFIELD(8, 8) | 239 | #define OMAP4430_DSS_MEM_RETSTATE_MASK BITFIELD(8, 8) |
240 | 240 | ||
241 | /* Used by PM_DSS_PWRSTST */ | 241 | /* Used by PM_DSS_PWRSTST */ |
242 | #define OMAP4430_DSS_MEM_STATEST_SHIFT (1 << 4) | 242 | #define OMAP4430_DSS_MEM_STATEST_SHIFT 4 |
243 | #define OMAP4430_DSS_MEM_STATEST_MASK BITFIELD(4, 5) | 243 | #define OMAP4430_DSS_MEM_STATEST_MASK BITFIELD(4, 5) |
244 | 244 | ||
245 | /* Used by PM_CORE_PWRSTCTRL */ | 245 | /* Used by PM_CORE_PWRSTCTRL */ |
246 | #define OMAP4430_DUCATI_L2RAM_ONSTATE_SHIFT (1 << 20) | 246 | #define OMAP4430_DUCATI_L2RAM_ONSTATE_SHIFT 20 |
247 | #define OMAP4430_DUCATI_L2RAM_ONSTATE_MASK BITFIELD(20, 21) | 247 | #define OMAP4430_DUCATI_L2RAM_ONSTATE_MASK BITFIELD(20, 21) |
248 | 248 | ||
249 | /* Used by PM_CORE_PWRSTCTRL */ | 249 | /* Used by PM_CORE_PWRSTCTRL */ |
250 | #define OMAP4430_DUCATI_L2RAM_RETSTATE_SHIFT (1 << 10) | 250 | #define OMAP4430_DUCATI_L2RAM_RETSTATE_SHIFT 10 |
251 | #define OMAP4430_DUCATI_L2RAM_RETSTATE_MASK BITFIELD(10, 10) | 251 | #define OMAP4430_DUCATI_L2RAM_RETSTATE_MASK BITFIELD(10, 10) |
252 | 252 | ||
253 | /* Used by PM_CORE_PWRSTST */ | 253 | /* Used by PM_CORE_PWRSTST */ |
254 | #define OMAP4430_DUCATI_L2RAM_STATEST_SHIFT (1 << 8) | 254 | #define OMAP4430_DUCATI_L2RAM_STATEST_SHIFT 8 |
255 | #define OMAP4430_DUCATI_L2RAM_STATEST_MASK BITFIELD(8, 9) | 255 | #define OMAP4430_DUCATI_L2RAM_STATEST_MASK BITFIELD(8, 9) |
256 | 256 | ||
257 | /* Used by PM_CORE_PWRSTCTRL */ | 257 | /* Used by PM_CORE_PWRSTCTRL */ |
258 | #define OMAP4430_DUCATI_UNICACHE_ONSTATE_SHIFT (1 << 22) | 258 | #define OMAP4430_DUCATI_UNICACHE_ONSTATE_SHIFT 22 |
259 | #define OMAP4430_DUCATI_UNICACHE_ONSTATE_MASK BITFIELD(22, 23) | 259 | #define OMAP4430_DUCATI_UNICACHE_ONSTATE_MASK BITFIELD(22, 23) |
260 | 260 | ||
261 | /* Used by PM_CORE_PWRSTCTRL */ | 261 | /* Used by PM_CORE_PWRSTCTRL */ |
262 | #define OMAP4430_DUCATI_UNICACHE_RETSTATE_SHIFT (1 << 11) | 262 | #define OMAP4430_DUCATI_UNICACHE_RETSTATE_SHIFT 11 |
263 | #define OMAP4430_DUCATI_UNICACHE_RETSTATE_MASK BITFIELD(11, 11) | 263 | #define OMAP4430_DUCATI_UNICACHE_RETSTATE_MASK BITFIELD(11, 11) |
264 | 264 | ||
265 | /* Used by PM_CORE_PWRSTST */ | 265 | /* Used by PM_CORE_PWRSTST */ |
266 | #define OMAP4430_DUCATI_UNICACHE_STATEST_SHIFT (1 << 10) | 266 | #define OMAP4430_DUCATI_UNICACHE_STATEST_SHIFT 10 |
267 | #define OMAP4430_DUCATI_UNICACHE_STATEST_MASK BITFIELD(10, 11) | 267 | #define OMAP4430_DUCATI_UNICACHE_STATEST_MASK BITFIELD(10, 11) |
268 | 268 | ||
269 | /* Used by RM_MPU_RSTST */ | 269 | /* Used by RM_MPU_RSTST */ |
270 | #define OMAP4430_EMULATION_RST_SHIFT (1 << 0) | 270 | #define OMAP4430_EMULATION_RST_SHIFT 0 |
271 | #define OMAP4430_EMULATION_RST_MASK BITFIELD(0, 0) | 271 | #define OMAP4430_EMULATION_RST_MASK BITFIELD(0, 0) |
272 | 272 | ||
273 | /* Used by RM_DUCATI_RSTST */ | 273 | /* Used by RM_DUCATI_RSTST */ |
274 | #define OMAP4430_EMULATION_RST1ST_SHIFT (1 << 3) | 274 | #define OMAP4430_EMULATION_RST1ST_SHIFT 3 |
275 | #define OMAP4430_EMULATION_RST1ST_MASK BITFIELD(3, 3) | 275 | #define OMAP4430_EMULATION_RST1ST_MASK BITFIELD(3, 3) |
276 | 276 | ||
277 | /* Used by RM_DUCATI_RSTST */ | 277 | /* Used by RM_DUCATI_RSTST */ |
278 | #define OMAP4430_EMULATION_RST2ST_SHIFT (1 << 4) | 278 | #define OMAP4430_EMULATION_RST2ST_SHIFT 4 |
279 | #define OMAP4430_EMULATION_RST2ST_MASK BITFIELD(4, 4) | 279 | #define OMAP4430_EMULATION_RST2ST_MASK BITFIELD(4, 4) |
280 | 280 | ||
281 | /* Used by RM_IVAHD_RSTST */ | 281 | /* Used by RM_IVAHD_RSTST */ |
282 | #define OMAP4430_EMULATION_SEQ1_RST1ST_SHIFT (1 << 3) | 282 | #define OMAP4430_EMULATION_SEQ1_RST1ST_SHIFT 3 |
283 | #define OMAP4430_EMULATION_SEQ1_RST1ST_MASK BITFIELD(3, 3) | 283 | #define OMAP4430_EMULATION_SEQ1_RST1ST_MASK BITFIELD(3, 3) |
284 | 284 | ||
285 | /* Used by RM_IVAHD_RSTST */ | 285 | /* Used by RM_IVAHD_RSTST */ |
286 | #define OMAP4430_EMULATION_SEQ2_RST2ST_SHIFT (1 << 4) | 286 | #define OMAP4430_EMULATION_SEQ2_RST2ST_SHIFT 4 |
287 | #define OMAP4430_EMULATION_SEQ2_RST2ST_MASK BITFIELD(4, 4) | 287 | #define OMAP4430_EMULATION_SEQ2_RST2ST_MASK BITFIELD(4, 4) |
288 | 288 | ||
289 | /* Used by PM_EMU_PWRSTCTRL */ | 289 | /* Used by PM_EMU_PWRSTCTRL */ |
290 | #define OMAP4430_EMU_BANK_ONSTATE_SHIFT (1 << 16) | 290 | #define OMAP4430_EMU_BANK_ONSTATE_SHIFT 16 |
291 | #define OMAP4430_EMU_BANK_ONSTATE_MASK BITFIELD(16, 17) | 291 | #define OMAP4430_EMU_BANK_ONSTATE_MASK BITFIELD(16, 17) |
292 | 292 | ||
293 | /* Used by PM_EMU_PWRSTST */ | 293 | /* Used by PM_EMU_PWRSTST */ |
294 | #define OMAP4430_EMU_BANK_STATEST_SHIFT (1 << 4) | 294 | #define OMAP4430_EMU_BANK_STATEST_SHIFT 4 |
295 | #define OMAP4430_EMU_BANK_STATEST_MASK BITFIELD(4, 5) | 295 | #define OMAP4430_EMU_BANK_STATEST_MASK BITFIELD(4, 5) |
296 | 296 | ||
297 | /* | 297 | /* |
298 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 298 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
299 | * PRM_LDO_SRAM_MPU_SETUP, PRM_SRAM_WKUP_SETUP | 299 | * PRM_LDO_SRAM_MPU_SETUP, PRM_SRAM_WKUP_SETUP |
300 | */ | 300 | */ |
301 | #define OMAP4430_ENABLE_RTA_EXPORT_SHIFT (1 << 0) | 301 | #define OMAP4430_ENABLE_RTA_EXPORT_SHIFT 0 |
302 | #define OMAP4430_ENABLE_RTA_EXPORT_MASK BITFIELD(0, 0) | 302 | #define OMAP4430_ENABLE_RTA_EXPORT_MASK BITFIELD(0, 0) |
303 | 303 | ||
304 | /* | 304 | /* |
305 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 305 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
306 | * PRM_LDO_SRAM_MPU_SETUP | 306 | * PRM_LDO_SRAM_MPU_SETUP |
307 | */ | 307 | */ |
308 | #define OMAP4430_ENFUNC1_SHIFT (1 << 3) | 308 | #define OMAP4430_ENFUNC1_SHIFT 3 |
309 | #define OMAP4430_ENFUNC1_MASK BITFIELD(3, 3) | 309 | #define OMAP4430_ENFUNC1_MASK BITFIELD(3, 3) |
310 | 310 | ||
311 | /* | 311 | /* |
312 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 312 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
313 | * PRM_LDO_SRAM_MPU_SETUP | 313 | * PRM_LDO_SRAM_MPU_SETUP |
314 | */ | 314 | */ |
315 | #define OMAP4430_ENFUNC3_SHIFT (1 << 5) | 315 | #define OMAP4430_ENFUNC3_SHIFT 5 |
316 | #define OMAP4430_ENFUNC3_MASK BITFIELD(5, 5) | 316 | #define OMAP4430_ENFUNC3_MASK BITFIELD(5, 5) |
317 | 317 | ||
318 | /* | 318 | /* |
319 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 319 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
320 | * PRM_LDO_SRAM_MPU_SETUP | 320 | * PRM_LDO_SRAM_MPU_SETUP |
321 | */ | 321 | */ |
322 | #define OMAP4430_ENFUNC4_SHIFT (1 << 6) | 322 | #define OMAP4430_ENFUNC4_SHIFT 6 |
323 | #define OMAP4430_ENFUNC4_MASK BITFIELD(6, 6) | 323 | #define OMAP4430_ENFUNC4_MASK BITFIELD(6, 6) |
324 | 324 | ||
325 | /* | 325 | /* |
326 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, | 326 | * Used by PRM_LDO_SRAM_CORE_SETUP, PRM_LDO_SRAM_IVA_SETUP, |
327 | * PRM_LDO_SRAM_MPU_SETUP | 327 | * PRM_LDO_SRAM_MPU_SETUP |
328 | */ | 328 | */ |
329 | #define OMAP4430_ENFUNC5_SHIFT (1 << 7) | 329 | #define OMAP4430_ENFUNC5_SHIFT 7 |
330 | #define OMAP4430_ENFUNC5_MASK BITFIELD(7, 7) | 330 | #define OMAP4430_ENFUNC5_MASK BITFIELD(7, 7) |
331 | 331 | ||
332 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ | 332 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ |
333 | #define OMAP4430_ERRORGAIN_SHIFT (1 << 16) | 333 | #define OMAP4430_ERRORGAIN_SHIFT 16 |
334 | #define OMAP4430_ERRORGAIN_MASK BITFIELD(16, 23) | 334 | #define OMAP4430_ERRORGAIN_MASK BITFIELD(16, 23) |
335 | 335 | ||
336 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ | 336 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ |
337 | #define OMAP4430_ERROROFFSET_SHIFT (1 << 24) | 337 | #define OMAP4430_ERROROFFSET_SHIFT 24 |
338 | #define OMAP4430_ERROROFFSET_MASK BITFIELD(24, 31) | 338 | #define OMAP4430_ERROROFFSET_MASK BITFIELD(24, 31) |
339 | 339 | ||
340 | /* Used by PRM_RSTST */ | 340 | /* Used by PRM_RSTST */ |
341 | #define OMAP4430_EXTERNAL_WARM_RST_SHIFT (1 << 5) | 341 | #define OMAP4430_EXTERNAL_WARM_RST_SHIFT 5 |
342 | #define OMAP4430_EXTERNAL_WARM_RST_MASK BITFIELD(5, 5) | 342 | #define OMAP4430_EXTERNAL_WARM_RST_MASK BITFIELD(5, 5) |
343 | 343 | ||
344 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ | 344 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ |
345 | #define OMAP4430_FORCEUPDATE_SHIFT (1 << 1) | 345 | #define OMAP4430_FORCEUPDATE_SHIFT 1 |
346 | #define OMAP4430_FORCEUPDATE_MASK BITFIELD(1, 1) | 346 | #define OMAP4430_FORCEUPDATE_MASK BITFIELD(1, 1) |
347 | 347 | ||
348 | /* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_IVA_VOLTAGE, PRM_VP_MPU_VOLTAGE */ | 348 | /* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_IVA_VOLTAGE, PRM_VP_MPU_VOLTAGE */ |
349 | #define OMAP4430_FORCEUPDATEWAIT_SHIFT (1 << 8) | 349 | #define OMAP4430_FORCEUPDATEWAIT_SHIFT 8 |
350 | #define OMAP4430_FORCEUPDATEWAIT_MASK BITFIELD(8, 31) | 350 | #define OMAP4430_FORCEUPDATEWAIT_MASK BITFIELD(8, 31) |
351 | 351 | ||
352 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_TESLA */ | 352 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_TESLA */ |
353 | #define OMAP4430_FORCEWKUP_EN_SHIFT (1 << 10) | 353 | #define OMAP4430_FORCEWKUP_EN_SHIFT 10 |
354 | #define OMAP4430_FORCEWKUP_EN_MASK BITFIELD(10, 10) | 354 | #define OMAP4430_FORCEWKUP_EN_MASK BITFIELD(10, 10) |
355 | 355 | ||
356 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_TESLA */ | 356 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_TESLA */ |
357 | #define OMAP4430_FORCEWKUP_ST_SHIFT (1 << 10) | 357 | #define OMAP4430_FORCEWKUP_ST_SHIFT 10 |
358 | #define OMAP4430_FORCEWKUP_ST_MASK BITFIELD(10, 10) | 358 | #define OMAP4430_FORCEWKUP_ST_MASK BITFIELD(10, 10) |
359 | 359 | ||
360 | /* Used by PM_GFX_PWRSTCTRL */ | 360 | /* Used by PM_GFX_PWRSTCTRL */ |
361 | #define OMAP4430_GFX_MEM_ONSTATE_SHIFT (1 << 16) | 361 | #define OMAP4430_GFX_MEM_ONSTATE_SHIFT 16 |
362 | #define OMAP4430_GFX_MEM_ONSTATE_MASK BITFIELD(16, 17) | 362 | #define OMAP4430_GFX_MEM_ONSTATE_MASK BITFIELD(16, 17) |
363 | 363 | ||
364 | /* Used by PM_GFX_PWRSTST */ | 364 | /* Used by PM_GFX_PWRSTST */ |
365 | #define OMAP4430_GFX_MEM_STATEST_SHIFT (1 << 4) | 365 | #define OMAP4430_GFX_MEM_STATEST_SHIFT 4 |
366 | #define OMAP4430_GFX_MEM_STATEST_MASK BITFIELD(4, 5) | 366 | #define OMAP4430_GFX_MEM_STATEST_MASK BITFIELD(4, 5) |
367 | 367 | ||
368 | /* Used by PRM_RSTST */ | 368 | /* Used by PRM_RSTST */ |
369 | #define OMAP4430_GLOBAL_COLD_RST_SHIFT (1 << 0) | 369 | #define OMAP4430_GLOBAL_COLD_RST_SHIFT 0 |
370 | #define OMAP4430_GLOBAL_COLD_RST_MASK BITFIELD(0, 0) | 370 | #define OMAP4430_GLOBAL_COLD_RST_MASK BITFIELD(0, 0) |
371 | 371 | ||
372 | /* Used by PRM_RSTST */ | 372 | /* Used by PRM_RSTST */ |
373 | #define OMAP4430_GLOBAL_WARM_SW_RST_SHIFT (1 << 1) | 373 | #define OMAP4430_GLOBAL_WARM_SW_RST_SHIFT 1 |
374 | #define OMAP4430_GLOBAL_WARM_SW_RST_MASK BITFIELD(1, 1) | 374 | #define OMAP4430_GLOBAL_WARM_SW_RST_MASK BITFIELD(1, 1) |
375 | 375 | ||
376 | /* Used by PRM_IO_PMCTRL */ | 376 | /* Used by PRM_IO_PMCTRL */ |
377 | #define OMAP4430_GLOBAL_WUEN_SHIFT (1 << 16) | 377 | #define OMAP4430_GLOBAL_WUEN_SHIFT 16 |
378 | #define OMAP4430_GLOBAL_WUEN_MASK BITFIELD(16, 16) | 378 | #define OMAP4430_GLOBAL_WUEN_MASK BITFIELD(16, 16) |
379 | 379 | ||
380 | /* Used by PRM_VC_CFG_I2C_MODE */ | 380 | /* Used by PRM_VC_CFG_I2C_MODE */ |
381 | #define OMAP4430_HSMCODE_SHIFT (1 << 0) | 381 | #define OMAP4430_HSMCODE_SHIFT 0 |
382 | #define OMAP4430_HSMCODE_MASK BITFIELD(0, 2) | 382 | #define OMAP4430_HSMCODE_MASK BITFIELD(0, 2) |
383 | 383 | ||
384 | /* Used by PRM_VC_CFG_I2C_MODE */ | 384 | /* Used by PRM_VC_CFG_I2C_MODE */ |
385 | #define OMAP4430_HSMODEEN_SHIFT (1 << 3) | 385 | #define OMAP4430_HSMODEEN_SHIFT 3 |
386 | #define OMAP4430_HSMODEEN_MASK BITFIELD(3, 3) | 386 | #define OMAP4430_HSMODEEN_MASK BITFIELD(3, 3) |
387 | 387 | ||
388 | /* Used by PRM_VC_CFG_I2C_CLK */ | 388 | /* Used by PRM_VC_CFG_I2C_CLK */ |
389 | #define OMAP4430_HSSCLH_SHIFT (1 << 16) | 389 | #define OMAP4430_HSSCLH_SHIFT 16 |
390 | #define OMAP4430_HSSCLH_MASK BITFIELD(16, 23) | 390 | #define OMAP4430_HSSCLH_MASK BITFIELD(16, 23) |
391 | 391 | ||
392 | /* Used by PRM_VC_CFG_I2C_CLK */ | 392 | /* Used by PRM_VC_CFG_I2C_CLK */ |
393 | #define OMAP4430_HSSCLL_SHIFT (1 << 24) | 393 | #define OMAP4430_HSSCLL_SHIFT 24 |
394 | #define OMAP4430_HSSCLL_MASK BITFIELD(24, 31) | 394 | #define OMAP4430_HSSCLL_MASK BITFIELD(24, 31) |
395 | 395 | ||
396 | /* Used by PM_IVAHD_PWRSTCTRL */ | 396 | /* Used by PM_IVAHD_PWRSTCTRL */ |
397 | #define OMAP4430_HWA_MEM_ONSTATE_SHIFT (1 << 16) | 397 | #define OMAP4430_HWA_MEM_ONSTATE_SHIFT 16 |
398 | #define OMAP4430_HWA_MEM_ONSTATE_MASK BITFIELD(16, 17) | 398 | #define OMAP4430_HWA_MEM_ONSTATE_MASK BITFIELD(16, 17) |
399 | 399 | ||
400 | /* Used by PM_IVAHD_PWRSTCTRL */ | 400 | /* Used by PM_IVAHD_PWRSTCTRL */ |
401 | #define OMAP4430_HWA_MEM_RETSTATE_SHIFT (1 << 8) | 401 | #define OMAP4430_HWA_MEM_RETSTATE_SHIFT 8 |
402 | #define OMAP4430_HWA_MEM_RETSTATE_MASK BITFIELD(8, 8) | 402 | #define OMAP4430_HWA_MEM_RETSTATE_MASK BITFIELD(8, 8) |
403 | 403 | ||
404 | /* Used by PM_IVAHD_PWRSTST */ | 404 | /* Used by PM_IVAHD_PWRSTST */ |
405 | #define OMAP4430_HWA_MEM_STATEST_SHIFT (1 << 4) | 405 | #define OMAP4430_HWA_MEM_STATEST_SHIFT 4 |
406 | #define OMAP4430_HWA_MEM_STATEST_MASK BITFIELD(4, 5) | 406 | #define OMAP4430_HWA_MEM_STATEST_MASK BITFIELD(4, 5) |
407 | 407 | ||
408 | /* Used by RM_MPU_RSTST */ | 408 | /* Used by RM_MPU_RSTST */ |
409 | #define OMAP4430_ICECRUSHER_MPU_RST_SHIFT (1 << 1) | 409 | #define OMAP4430_ICECRUSHER_MPU_RST_SHIFT 1 |
410 | #define OMAP4430_ICECRUSHER_MPU_RST_MASK BITFIELD(1, 1) | 410 | #define OMAP4430_ICECRUSHER_MPU_RST_MASK BITFIELD(1, 1) |
411 | 411 | ||
412 | /* Used by RM_DUCATI_RSTST */ | 412 | /* Used by RM_DUCATI_RSTST */ |
413 | #define OMAP4430_ICECRUSHER_RST1ST_SHIFT (1 << 5) | 413 | #define OMAP4430_ICECRUSHER_RST1ST_SHIFT 5 |
414 | #define OMAP4430_ICECRUSHER_RST1ST_MASK BITFIELD(5, 5) | 414 | #define OMAP4430_ICECRUSHER_RST1ST_MASK BITFIELD(5, 5) |
415 | 415 | ||
416 | /* Used by RM_DUCATI_RSTST */ | 416 | /* Used by RM_DUCATI_RSTST */ |
417 | #define OMAP4430_ICECRUSHER_RST2ST_SHIFT (1 << 6) | 417 | #define OMAP4430_ICECRUSHER_RST2ST_SHIFT 6 |
418 | #define OMAP4430_ICECRUSHER_RST2ST_MASK BITFIELD(6, 6) | 418 | #define OMAP4430_ICECRUSHER_RST2ST_MASK BITFIELD(6, 6) |
419 | 419 | ||
420 | /* Used by RM_IVAHD_RSTST */ | 420 | /* Used by RM_IVAHD_RSTST */ |
421 | #define OMAP4430_ICECRUSHER_SEQ1_RST1ST_SHIFT (1 << 5) | 421 | #define OMAP4430_ICECRUSHER_SEQ1_RST1ST_SHIFT 5 |
422 | #define OMAP4430_ICECRUSHER_SEQ1_RST1ST_MASK BITFIELD(5, 5) | 422 | #define OMAP4430_ICECRUSHER_SEQ1_RST1ST_MASK BITFIELD(5, 5) |
423 | 423 | ||
424 | /* Used by RM_IVAHD_RSTST */ | 424 | /* Used by RM_IVAHD_RSTST */ |
425 | #define OMAP4430_ICECRUSHER_SEQ2_RST2ST_SHIFT (1 << 6) | 425 | #define OMAP4430_ICECRUSHER_SEQ2_RST2ST_SHIFT 6 |
426 | #define OMAP4430_ICECRUSHER_SEQ2_RST2ST_MASK BITFIELD(6, 6) | 426 | #define OMAP4430_ICECRUSHER_SEQ2_RST2ST_MASK BITFIELD(6, 6) |
427 | 427 | ||
428 | /* Used by PRM_RSTST */ | 428 | /* Used by PRM_RSTST */ |
429 | #define OMAP4430_ICEPICK_RST_SHIFT (1 << 9) | 429 | #define OMAP4430_ICEPICK_RST_SHIFT 9 |
430 | #define OMAP4430_ICEPICK_RST_MASK BITFIELD(9, 9) | 430 | #define OMAP4430_ICEPICK_RST_MASK BITFIELD(9, 9) |
431 | 431 | ||
432 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ | 432 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ |
433 | #define OMAP4430_INITVDD_SHIFT (1 << 2) | 433 | #define OMAP4430_INITVDD_SHIFT 2 |
434 | #define OMAP4430_INITVDD_MASK BITFIELD(2, 2) | 434 | #define OMAP4430_INITVDD_MASK BITFIELD(2, 2) |
435 | 435 | ||
436 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ | 436 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ |
437 | #define OMAP4430_INITVOLTAGE_SHIFT (1 << 8) | 437 | #define OMAP4430_INITVOLTAGE_SHIFT 8 |
438 | #define OMAP4430_INITVOLTAGE_MASK BITFIELD(8, 15) | 438 | #define OMAP4430_INITVOLTAGE_MASK BITFIELD(8, 15) |
439 | 439 | ||
440 | /* | 440 | /* |
@@ -442,47 +442,47 @@ | |||
442 | * PM_ABE_PWRSTST, PM_GFX_PWRSTST, PM_MPU_PWRSTST, PM_CEFUSE_PWRSTST, | 442 | * PM_ABE_PWRSTST, PM_GFX_PWRSTST, PM_MPU_PWRSTST, PM_CEFUSE_PWRSTST, |
443 | * PM_DSS_PWRSTST, PM_L4PER_PWRSTST, PM_TESLA_PWRSTST, PM_IVAHD_PWRSTST | 443 | * PM_DSS_PWRSTST, PM_L4PER_PWRSTST, PM_TESLA_PWRSTST, PM_IVAHD_PWRSTST |
444 | */ | 444 | */ |
445 | #define OMAP4430_INTRANSITION_SHIFT (1 << 20) | 445 | #define OMAP4430_INTRANSITION_SHIFT 20 |
446 | #define OMAP4430_INTRANSITION_MASK BITFIELD(20, 20) | 446 | #define OMAP4430_INTRANSITION_MASK BITFIELD(20, 20) |
447 | 447 | ||
448 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 448 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
449 | #define OMAP4430_IO_EN_SHIFT (1 << 9) | 449 | #define OMAP4430_IO_EN_SHIFT 9 |
450 | #define OMAP4430_IO_EN_MASK BITFIELD(9, 9) | 450 | #define OMAP4430_IO_EN_MASK BITFIELD(9, 9) |
451 | 451 | ||
452 | /* Used by PRM_IO_PMCTRL */ | 452 | /* Used by PRM_IO_PMCTRL */ |
453 | #define OMAP4430_IO_ON_STATUS_SHIFT (1 << 5) | 453 | #define OMAP4430_IO_ON_STATUS_SHIFT 5 |
454 | #define OMAP4430_IO_ON_STATUS_MASK BITFIELD(5, 5) | 454 | #define OMAP4430_IO_ON_STATUS_MASK BITFIELD(5, 5) |
455 | 455 | ||
456 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 456 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
457 | #define OMAP4430_IO_ST_SHIFT (1 << 9) | 457 | #define OMAP4430_IO_ST_SHIFT 9 |
458 | #define OMAP4430_IO_ST_MASK BITFIELD(9, 9) | 458 | #define OMAP4430_IO_ST_MASK BITFIELD(9, 9) |
459 | 459 | ||
460 | /* Used by PRM_IO_PMCTRL */ | 460 | /* Used by PRM_IO_PMCTRL */ |
461 | #define OMAP4430_ISOCLK_OVERRIDE_SHIFT (1 << 0) | 461 | #define OMAP4430_ISOCLK_OVERRIDE_SHIFT 0 |
462 | #define OMAP4430_ISOCLK_OVERRIDE_MASK BITFIELD(0, 0) | 462 | #define OMAP4430_ISOCLK_OVERRIDE_MASK BITFIELD(0, 0) |
463 | 463 | ||
464 | /* Used by PRM_IO_PMCTRL */ | 464 | /* Used by PRM_IO_PMCTRL */ |
465 | #define OMAP4430_ISOCLK_STATUS_SHIFT (1 << 1) | 465 | #define OMAP4430_ISOCLK_STATUS_SHIFT 1 |
466 | #define OMAP4430_ISOCLK_STATUS_MASK BITFIELD(1, 1) | 466 | #define OMAP4430_ISOCLK_STATUS_MASK BITFIELD(1, 1) |
467 | 467 | ||
468 | /* Used by PRM_IO_PMCTRL */ | 468 | /* Used by PRM_IO_PMCTRL */ |
469 | #define OMAP4430_ISOOVR_EXTEND_SHIFT (1 << 4) | 469 | #define OMAP4430_ISOOVR_EXTEND_SHIFT 4 |
470 | #define OMAP4430_ISOOVR_EXTEND_MASK BITFIELD(4, 4) | 470 | #define OMAP4430_ISOOVR_EXTEND_MASK BITFIELD(4, 4) |
471 | 471 | ||
472 | /* Used by PRM_IO_COUNT */ | 472 | /* Used by PRM_IO_COUNT */ |
473 | #define OMAP4430_ISO_2_ON_TIME_SHIFT (1 << 0) | 473 | #define OMAP4430_ISO_2_ON_TIME_SHIFT 0 |
474 | #define OMAP4430_ISO_2_ON_TIME_MASK BITFIELD(0, 7) | 474 | #define OMAP4430_ISO_2_ON_TIME_MASK BITFIELD(0, 7) |
475 | 475 | ||
476 | /* Used by PM_L3INIT_PWRSTCTRL */ | 476 | /* Used by PM_L3INIT_PWRSTCTRL */ |
477 | #define OMAP4430_L3INIT_BANK1_ONSTATE_SHIFT (1 << 16) | 477 | #define OMAP4430_L3INIT_BANK1_ONSTATE_SHIFT 16 |
478 | #define OMAP4430_L3INIT_BANK1_ONSTATE_MASK BITFIELD(16, 17) | 478 | #define OMAP4430_L3INIT_BANK1_ONSTATE_MASK BITFIELD(16, 17) |
479 | 479 | ||
480 | /* Used by PM_L3INIT_PWRSTCTRL */ | 480 | /* Used by PM_L3INIT_PWRSTCTRL */ |
481 | #define OMAP4430_L3INIT_BANK1_RETSTATE_SHIFT (1 << 8) | 481 | #define OMAP4430_L3INIT_BANK1_RETSTATE_SHIFT 8 |
482 | #define OMAP4430_L3INIT_BANK1_RETSTATE_MASK BITFIELD(8, 8) | 482 | #define OMAP4430_L3INIT_BANK1_RETSTATE_MASK BITFIELD(8, 8) |
483 | 483 | ||
484 | /* Used by PM_L3INIT_PWRSTST */ | 484 | /* Used by PM_L3INIT_PWRSTST */ |
485 | #define OMAP4430_L3INIT_BANK1_STATEST_SHIFT (1 << 4) | 485 | #define OMAP4430_L3INIT_BANK1_STATEST_SHIFT 4 |
486 | #define OMAP4430_L3INIT_BANK1_STATEST_MASK BITFIELD(4, 5) | 486 | #define OMAP4430_L3INIT_BANK1_STATEST_MASK BITFIELD(4, 5) |
487 | 487 | ||
488 | /* | 488 | /* |
@@ -490,7 +490,7 @@ | |||
490 | * PM_MPU_PWRSTCTRL, PM_DSS_PWRSTCTRL, PM_L4PER_PWRSTCTRL, PM_TESLA_PWRSTCTRL, | 490 | * PM_MPU_PWRSTCTRL, PM_DSS_PWRSTCTRL, PM_L4PER_PWRSTCTRL, PM_TESLA_PWRSTCTRL, |
491 | * PM_IVAHD_PWRSTCTRL | 491 | * PM_IVAHD_PWRSTCTRL |
492 | */ | 492 | */ |
493 | #define OMAP4430_LOGICRETSTATE_SHIFT (1 << 2) | 493 | #define OMAP4430_LOGICRETSTATE_SHIFT 2 |
494 | #define OMAP4430_LOGICRETSTATE_MASK BITFIELD(2, 2) | 494 | #define OMAP4430_LOGICRETSTATE_MASK BITFIELD(2, 2) |
495 | 495 | ||
496 | /* | 496 | /* |
@@ -498,7 +498,7 @@ | |||
498 | * PM_ABE_PWRSTST, PM_GFX_PWRSTST, PM_MPU_PWRSTST, PM_CEFUSE_PWRSTST, | 498 | * PM_ABE_PWRSTST, PM_GFX_PWRSTST, PM_MPU_PWRSTST, PM_CEFUSE_PWRSTST, |
499 | * PM_DSS_PWRSTST, PM_L4PER_PWRSTST, PM_TESLA_PWRSTST, PM_IVAHD_PWRSTST | 499 | * PM_DSS_PWRSTST, PM_L4PER_PWRSTST, PM_TESLA_PWRSTST, PM_IVAHD_PWRSTST |
500 | */ | 500 | */ |
501 | #define OMAP4430_LOGICSTATEST_SHIFT (1 << 2) | 501 | #define OMAP4430_LOGICSTATEST_SHIFT 2 |
502 | #define OMAP4430_LOGICSTATEST_MASK BITFIELD(2, 2) | 502 | #define OMAP4430_LOGICSTATEST_MASK BITFIELD(2, 2) |
503 | 503 | ||
504 | /* | 504 | /* |
@@ -537,7 +537,7 @@ | |||
537 | * RM_L4PER_SLIMBUS2_CONTEXT, RM_L4SEC_PKAEIP29_CONTEXT, | 537 | * RM_L4PER_SLIMBUS2_CONTEXT, RM_L4SEC_PKAEIP29_CONTEXT, |
538 | * RM_TESLA_TESLA_CONTEXT, RM_IVAHD_IVAHD_CONTEXT, RM_IVAHD_SL2_CONTEXT | 538 | * RM_TESLA_TESLA_CONTEXT, RM_IVAHD_IVAHD_CONTEXT, RM_IVAHD_SL2_CONTEXT |
539 | */ | 539 | */ |
540 | #define OMAP4430_LOSTCONTEXT_DFF_SHIFT (1 << 0) | 540 | #define OMAP4430_LOSTCONTEXT_DFF_SHIFT 0 |
541 | #define OMAP4430_LOSTCONTEXT_DFF_MASK BITFIELD(0, 0) | 541 | #define OMAP4430_LOSTCONTEXT_DFF_MASK BITFIELD(0, 0) |
542 | 542 | ||
543 | /* | 543 | /* |
@@ -558,58 +558,58 @@ | |||
558 | * RM_L4SEC_AES2_CONTEXT, RM_L4SEC_CRYPTODMA_CONTEXT, RM_L4SEC_DES3DES_CONTEXT, | 558 | * RM_L4SEC_AES2_CONTEXT, RM_L4SEC_CRYPTODMA_CONTEXT, RM_L4SEC_DES3DES_CONTEXT, |
559 | * RM_L4SEC_RNG_CONTEXT, RM_L4SEC_SHA2MD51_CONTEXT, RM_TESLA_TESLA_CONTEXT | 559 | * RM_L4SEC_RNG_CONTEXT, RM_L4SEC_SHA2MD51_CONTEXT, RM_TESLA_TESLA_CONTEXT |
560 | */ | 560 | */ |
561 | #define OMAP4430_LOSTCONTEXT_RFF_SHIFT (1 << 1) | 561 | #define OMAP4430_LOSTCONTEXT_RFF_SHIFT 1 |
562 | #define OMAP4430_LOSTCONTEXT_RFF_MASK BITFIELD(1, 1) | 562 | #define OMAP4430_LOSTCONTEXT_RFF_MASK BITFIELD(1, 1) |
563 | 563 | ||
564 | /* Used by RM_ABE_AESS_CONTEXT */ | 564 | /* Used by RM_ABE_AESS_CONTEXT */ |
565 | #define OMAP4430_LOSTMEM_AESSMEM_SHIFT (1 << 8) | 565 | #define OMAP4430_LOSTMEM_AESSMEM_SHIFT 8 |
566 | #define OMAP4430_LOSTMEM_AESSMEM_MASK BITFIELD(8, 8) | 566 | #define OMAP4430_LOSTMEM_AESSMEM_MASK BITFIELD(8, 8) |
567 | 567 | ||
568 | /* Used by RM_CAM_FDIF_CONTEXT, RM_CAM_ISS_CONTEXT */ | 568 | /* Used by RM_CAM_FDIF_CONTEXT, RM_CAM_ISS_CONTEXT */ |
569 | #define OMAP4430_LOSTMEM_CAM_MEM_SHIFT (1 << 8) | 569 | #define OMAP4430_LOSTMEM_CAM_MEM_SHIFT 8 |
570 | #define OMAP4430_LOSTMEM_CAM_MEM_MASK BITFIELD(8, 8) | 570 | #define OMAP4430_LOSTMEM_CAM_MEM_MASK BITFIELD(8, 8) |
571 | 571 | ||
572 | /* Used by RM_L3INSTR_OCP_WP1_CONTEXT */ | 572 | /* Used by RM_L3INSTR_OCP_WP1_CONTEXT */ |
573 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_SHIFT (1 << 8) | 573 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_SHIFT 8 |
574 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_MASK BITFIELD(8, 8) | 574 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_MASK BITFIELD(8, 8) |
575 | 575 | ||
576 | /* Renamed from LOSTMEM_CORE_NRET_BANK Used by RM_MEMIF_DMM_CONTEXT */ | 576 | /* Renamed from LOSTMEM_CORE_NRET_BANK Used by RM_MEMIF_DMM_CONTEXT */ |
577 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_9_9_SHIFT (1 << 9) | 577 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_9_9_SHIFT 9 |
578 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_9_9_MASK BITFIELD(9, 9) | 578 | #define OMAP4430_LOSTMEM_CORE_NRET_BANK_9_9_MASK BITFIELD(9, 9) |
579 | 579 | ||
580 | /* Used by RM_L3_2_OCMC_RAM_CONTEXT */ | 580 | /* Used by RM_L3_2_OCMC_RAM_CONTEXT */ |
581 | #define OMAP4430_LOSTMEM_CORE_OCMRAM_SHIFT (1 << 8) | 581 | #define OMAP4430_LOSTMEM_CORE_OCMRAM_SHIFT 8 |
582 | #define OMAP4430_LOSTMEM_CORE_OCMRAM_MASK BITFIELD(8, 8) | 582 | #define OMAP4430_LOSTMEM_CORE_OCMRAM_MASK BITFIELD(8, 8) |
583 | 583 | ||
584 | /* | 584 | /* |
585 | * Used by RM_D2D_MODEM_ICR_CONTEXT, RM_MEMIF_DMM_CONTEXT, | 585 | * Used by RM_D2D_MODEM_ICR_CONTEXT, RM_MEMIF_DMM_CONTEXT, |
586 | * RM_SDMA_SDMA_CONTEXT | 586 | * RM_SDMA_SDMA_CONTEXT |
587 | */ | 587 | */ |
588 | #define OMAP4430_LOSTMEM_CORE_OTHER_BANK_SHIFT (1 << 8) | 588 | #define OMAP4430_LOSTMEM_CORE_OTHER_BANK_SHIFT 8 |
589 | #define OMAP4430_LOSTMEM_CORE_OTHER_BANK_MASK BITFIELD(8, 8) | 589 | #define OMAP4430_LOSTMEM_CORE_OTHER_BANK_MASK BITFIELD(8, 8) |
590 | 590 | ||
591 | /* Used by RM_DSS_DEISS_CONTEXT, RM_DSS_DSS_CONTEXT */ | 591 | /* Used by RM_DSS_DEISS_CONTEXT, RM_DSS_DSS_CONTEXT */ |
592 | #define OMAP4430_LOSTMEM_DSS_MEM_SHIFT (1 << 8) | 592 | #define OMAP4430_LOSTMEM_DSS_MEM_SHIFT 8 |
593 | #define OMAP4430_LOSTMEM_DSS_MEM_MASK BITFIELD(8, 8) | 593 | #define OMAP4430_LOSTMEM_DSS_MEM_MASK BITFIELD(8, 8) |
594 | 594 | ||
595 | /* Used by RM_DUCATI_DUCATI_CONTEXT */ | 595 | /* Used by RM_DUCATI_DUCATI_CONTEXT */ |
596 | #define OMAP4430_LOSTMEM_DUCATI_L2RAM_SHIFT (1 << 9) | 596 | #define OMAP4430_LOSTMEM_DUCATI_L2RAM_SHIFT 9 |
597 | #define OMAP4430_LOSTMEM_DUCATI_L2RAM_MASK BITFIELD(9, 9) | 597 | #define OMAP4430_LOSTMEM_DUCATI_L2RAM_MASK BITFIELD(9, 9) |
598 | 598 | ||
599 | /* Used by RM_DUCATI_DUCATI_CONTEXT */ | 599 | /* Used by RM_DUCATI_DUCATI_CONTEXT */ |
600 | #define OMAP4430_LOSTMEM_DUCATI_UNICACHE_SHIFT (1 << 8) | 600 | #define OMAP4430_LOSTMEM_DUCATI_UNICACHE_SHIFT 8 |
601 | #define OMAP4430_LOSTMEM_DUCATI_UNICACHE_MASK BITFIELD(8, 8) | 601 | #define OMAP4430_LOSTMEM_DUCATI_UNICACHE_MASK BITFIELD(8, 8) |
602 | 602 | ||
603 | /* Used by RM_EMU_DEBUGSS_CONTEXT */ | 603 | /* Used by RM_EMU_DEBUGSS_CONTEXT */ |
604 | #define OMAP4430_LOSTMEM_EMU_BANK_SHIFT (1 << 8) | 604 | #define OMAP4430_LOSTMEM_EMU_BANK_SHIFT 8 |
605 | #define OMAP4430_LOSTMEM_EMU_BANK_MASK BITFIELD(8, 8) | 605 | #define OMAP4430_LOSTMEM_EMU_BANK_MASK BITFIELD(8, 8) |
606 | 606 | ||
607 | /* Used by RM_GFX_GFX_CONTEXT */ | 607 | /* Used by RM_GFX_GFX_CONTEXT */ |
608 | #define OMAP4430_LOSTMEM_GFX_MEM_SHIFT (1 << 8) | 608 | #define OMAP4430_LOSTMEM_GFX_MEM_SHIFT 8 |
609 | #define OMAP4430_LOSTMEM_GFX_MEM_MASK BITFIELD(8, 8) | 609 | #define OMAP4430_LOSTMEM_GFX_MEM_MASK BITFIELD(8, 8) |
610 | 610 | ||
611 | /* Used by RM_IVAHD_IVAHD_CONTEXT */ | 611 | /* Used by RM_IVAHD_IVAHD_CONTEXT */ |
612 | #define OMAP4430_LOSTMEM_HWA_MEM_SHIFT (1 << 10) | 612 | #define OMAP4430_LOSTMEM_HWA_MEM_SHIFT 10 |
613 | #define OMAP4430_LOSTMEM_HWA_MEM_MASK BITFIELD(10, 10) | 613 | #define OMAP4430_LOSTMEM_HWA_MEM_MASK BITFIELD(10, 10) |
614 | 614 | ||
615 | /* | 615 | /* |
@@ -619,19 +619,19 @@ | |||
619 | * RM_L3INIT_TPPSS_CONTEXT, RM_L3INIT_UNIPRO1_CONTEXT, | 619 | * RM_L3INIT_TPPSS_CONTEXT, RM_L3INIT_UNIPRO1_CONTEXT, |
620 | * RM_L3INIT_USB_OTG_CONTEXT, RM_L3INIT_XHPI_CONTEXT | 620 | * RM_L3INIT_USB_OTG_CONTEXT, RM_L3INIT_XHPI_CONTEXT |
621 | */ | 621 | */ |
622 | #define OMAP4430_LOSTMEM_L3INIT_BANK1_SHIFT (1 << 8) | 622 | #define OMAP4430_LOSTMEM_L3INIT_BANK1_SHIFT 8 |
623 | #define OMAP4430_LOSTMEM_L3INIT_BANK1_MASK BITFIELD(8, 8) | 623 | #define OMAP4430_LOSTMEM_L3INIT_BANK1_MASK BITFIELD(8, 8) |
624 | 624 | ||
625 | /* Used by RM_MPU_MPU_CONTEXT */ | 625 | /* Used by RM_MPU_MPU_CONTEXT */ |
626 | #define OMAP4430_LOSTMEM_MPU_L1_SHIFT (1 << 8) | 626 | #define OMAP4430_LOSTMEM_MPU_L1_SHIFT 8 |
627 | #define OMAP4430_LOSTMEM_MPU_L1_MASK BITFIELD(8, 8) | 627 | #define OMAP4430_LOSTMEM_MPU_L1_MASK BITFIELD(8, 8) |
628 | 628 | ||
629 | /* Used by RM_MPU_MPU_CONTEXT */ | 629 | /* Used by RM_MPU_MPU_CONTEXT */ |
630 | #define OMAP4430_LOSTMEM_MPU_L2_SHIFT (1 << 9) | 630 | #define OMAP4430_LOSTMEM_MPU_L2_SHIFT 9 |
631 | #define OMAP4430_LOSTMEM_MPU_L2_MASK BITFIELD(9, 9) | 631 | #define OMAP4430_LOSTMEM_MPU_L2_MASK BITFIELD(9, 9) |
632 | 632 | ||
633 | /* Used by RM_MPU_MPU_CONTEXT */ | 633 | /* Used by RM_MPU_MPU_CONTEXT */ |
634 | #define OMAP4430_LOSTMEM_MPU_RAM_SHIFT (1 << 10) | 634 | #define OMAP4430_LOSTMEM_MPU_RAM_SHIFT 10 |
635 | #define OMAP4430_LOSTMEM_MPU_RAM_MASK BITFIELD(10, 10) | 635 | #define OMAP4430_LOSTMEM_MPU_RAM_MASK BITFIELD(10, 10) |
636 | 636 | ||
637 | /* | 637 | /* |
@@ -639,14 +639,14 @@ | |||
639 | * RM_L4PER_MCBSP4_CONTEXT, RM_L4PER_MMCSD3_CONTEXT, RM_L4PER_MMCSD4_CONTEXT, | 639 | * RM_L4PER_MCBSP4_CONTEXT, RM_L4PER_MMCSD3_CONTEXT, RM_L4PER_MMCSD4_CONTEXT, |
640 | * RM_L4PER_MMCSD5_CONTEXT, RM_L4PER_SLIMBUS2_CONTEXT, RM_L4SEC_PKAEIP29_CONTEXT | 640 | * RM_L4PER_MMCSD5_CONTEXT, RM_L4PER_SLIMBUS2_CONTEXT, RM_L4SEC_PKAEIP29_CONTEXT |
641 | */ | 641 | */ |
642 | #define OMAP4430_LOSTMEM_NONRETAINED_BANK_SHIFT (1 << 8) | 642 | #define OMAP4430_LOSTMEM_NONRETAINED_BANK_SHIFT 8 |
643 | #define OMAP4430_LOSTMEM_NONRETAINED_BANK_MASK BITFIELD(8, 8) | 643 | #define OMAP4430_LOSTMEM_NONRETAINED_BANK_MASK BITFIELD(8, 8) |
644 | 644 | ||
645 | /* | 645 | /* |
646 | * Used by RM_ABE_DMIC_CONTEXT, RM_ABE_MCBSP1_CONTEXT, RM_ABE_MCBSP2_CONTEXT, | 646 | * Used by RM_ABE_DMIC_CONTEXT, RM_ABE_MCBSP1_CONTEXT, RM_ABE_MCBSP2_CONTEXT, |
647 | * RM_ABE_MCBSP3_CONTEXT, RM_ABE_PDM_CONTEXT, RM_ABE_SLIMBUS_CONTEXT | 647 | * RM_ABE_MCBSP3_CONTEXT, RM_ABE_PDM_CONTEXT, RM_ABE_SLIMBUS_CONTEXT |
648 | */ | 648 | */ |
649 | #define OMAP4430_LOSTMEM_PERIHPMEM_SHIFT (1 << 8) | 649 | #define OMAP4430_LOSTMEM_PERIHPMEM_SHIFT 8 |
650 | #define OMAP4430_LOSTMEM_PERIHPMEM_MASK BITFIELD(8, 8) | 650 | #define OMAP4430_LOSTMEM_PERIHPMEM_MASK BITFIELD(8, 8) |
651 | 651 | ||
652 | /* | 652 | /* |
@@ -654,35 +654,35 @@ | |||
654 | * RM_L4PER_UART2_CONTEXT, RM_L4PER_UART3_CONTEXT, RM_L4PER_UART4_CONTEXT, | 654 | * RM_L4PER_UART2_CONTEXT, RM_L4PER_UART3_CONTEXT, RM_L4PER_UART4_CONTEXT, |
655 | * RM_L4SEC_CRYPTODMA_CONTEXT | 655 | * RM_L4SEC_CRYPTODMA_CONTEXT |
656 | */ | 656 | */ |
657 | #define OMAP4430_LOSTMEM_RETAINED_BANK_SHIFT (1 << 8) | 657 | #define OMAP4430_LOSTMEM_RETAINED_BANK_SHIFT 8 |
658 | #define OMAP4430_LOSTMEM_RETAINED_BANK_MASK BITFIELD(8, 8) | 658 | #define OMAP4430_LOSTMEM_RETAINED_BANK_MASK BITFIELD(8, 8) |
659 | 659 | ||
660 | /* Used by RM_IVAHD_SL2_CONTEXT */ | 660 | /* Used by RM_IVAHD_SL2_CONTEXT */ |
661 | #define OMAP4430_LOSTMEM_SL2_MEM_SHIFT (1 << 8) | 661 | #define OMAP4430_LOSTMEM_SL2_MEM_SHIFT 8 |
662 | #define OMAP4430_LOSTMEM_SL2_MEM_MASK BITFIELD(8, 8) | 662 | #define OMAP4430_LOSTMEM_SL2_MEM_MASK BITFIELD(8, 8) |
663 | 663 | ||
664 | /* Used by RM_IVAHD_IVAHD_CONTEXT */ | 664 | /* Used by RM_IVAHD_IVAHD_CONTEXT */ |
665 | #define OMAP4430_LOSTMEM_TCM1_MEM_SHIFT (1 << 8) | 665 | #define OMAP4430_LOSTMEM_TCM1_MEM_SHIFT 8 |
666 | #define OMAP4430_LOSTMEM_TCM1_MEM_MASK BITFIELD(8, 8) | 666 | #define OMAP4430_LOSTMEM_TCM1_MEM_MASK BITFIELD(8, 8) |
667 | 667 | ||
668 | /* Used by RM_IVAHD_IVAHD_CONTEXT */ | 668 | /* Used by RM_IVAHD_IVAHD_CONTEXT */ |
669 | #define OMAP4430_LOSTMEM_TCM2_MEM_SHIFT (1 << 9) | 669 | #define OMAP4430_LOSTMEM_TCM2_MEM_SHIFT 9 |
670 | #define OMAP4430_LOSTMEM_TCM2_MEM_MASK BITFIELD(9, 9) | 670 | #define OMAP4430_LOSTMEM_TCM2_MEM_MASK BITFIELD(9, 9) |
671 | 671 | ||
672 | /* Used by RM_TESLA_TESLA_CONTEXT */ | 672 | /* Used by RM_TESLA_TESLA_CONTEXT */ |
673 | #define OMAP4430_LOSTMEM_TESLA_EDMA_SHIFT (1 << 10) | 673 | #define OMAP4430_LOSTMEM_TESLA_EDMA_SHIFT 10 |
674 | #define OMAP4430_LOSTMEM_TESLA_EDMA_MASK BITFIELD(10, 10) | 674 | #define OMAP4430_LOSTMEM_TESLA_EDMA_MASK BITFIELD(10, 10) |
675 | 675 | ||
676 | /* Used by RM_TESLA_TESLA_CONTEXT */ | 676 | /* Used by RM_TESLA_TESLA_CONTEXT */ |
677 | #define OMAP4430_LOSTMEM_TESLA_L1_SHIFT (1 << 8) | 677 | #define OMAP4430_LOSTMEM_TESLA_L1_SHIFT 8 |
678 | #define OMAP4430_LOSTMEM_TESLA_L1_MASK BITFIELD(8, 8) | 678 | #define OMAP4430_LOSTMEM_TESLA_L1_MASK BITFIELD(8, 8) |
679 | 679 | ||
680 | /* Used by RM_TESLA_TESLA_CONTEXT */ | 680 | /* Used by RM_TESLA_TESLA_CONTEXT */ |
681 | #define OMAP4430_LOSTMEM_TESLA_L2_SHIFT (1 << 9) | 681 | #define OMAP4430_LOSTMEM_TESLA_L2_SHIFT 9 |
682 | #define OMAP4430_LOSTMEM_TESLA_L2_MASK BITFIELD(9, 9) | 682 | #define OMAP4430_LOSTMEM_TESLA_L2_MASK BITFIELD(9, 9) |
683 | 683 | ||
684 | /* Used by RM_WKUP_SARRAM_CONTEXT */ | 684 | /* Used by RM_WKUP_SARRAM_CONTEXT */ |
685 | #define OMAP4430_LOSTMEM_WKUP_BANK_SHIFT (1 << 8) | 685 | #define OMAP4430_LOSTMEM_WKUP_BANK_SHIFT 8 |
686 | #define OMAP4430_LOSTMEM_WKUP_BANK_MASK BITFIELD(8, 8) | 686 | #define OMAP4430_LOSTMEM_WKUP_BANK_MASK BITFIELD(8, 8) |
687 | 687 | ||
688 | /* | 688 | /* |
@@ -690,164 +690,164 @@ | |||
690 | * PM_ABE_PWRSTCTRL, PM_GFX_PWRSTCTRL, PM_MPU_PWRSTCTRL, PM_CEFUSE_PWRSTCTRL, | 690 | * PM_ABE_PWRSTCTRL, PM_GFX_PWRSTCTRL, PM_MPU_PWRSTCTRL, PM_CEFUSE_PWRSTCTRL, |
691 | * PM_DSS_PWRSTCTRL, PM_L4PER_PWRSTCTRL, PM_TESLA_PWRSTCTRL, PM_IVAHD_PWRSTCTRL | 691 | * PM_DSS_PWRSTCTRL, PM_L4PER_PWRSTCTRL, PM_TESLA_PWRSTCTRL, PM_IVAHD_PWRSTCTRL |
692 | */ | 692 | */ |
693 | #define OMAP4430_LOWPOWERSTATECHANGE_SHIFT (1 << 4) | 693 | #define OMAP4430_LOWPOWERSTATECHANGE_SHIFT 4 |
694 | #define OMAP4430_LOWPOWERSTATECHANGE_MASK BITFIELD(4, 4) | 694 | #define OMAP4430_LOWPOWERSTATECHANGE_MASK BITFIELD(4, 4) |
695 | 695 | ||
696 | /* Used by PM_CORE_PWRSTCTRL */ | 696 | /* Used by PM_CORE_PWRSTCTRL */ |
697 | #define OMAP4430_MEMORYCHANGE_SHIFT (1 << 3) | 697 | #define OMAP4430_MEMORYCHANGE_SHIFT 3 |
698 | #define OMAP4430_MEMORYCHANGE_MASK BITFIELD(3, 3) | 698 | #define OMAP4430_MEMORYCHANGE_MASK BITFIELD(3, 3) |
699 | 699 | ||
700 | /* Used by PRM_MODEM_IF_CTRL */ | 700 | /* Used by PRM_MODEM_IF_CTRL */ |
701 | #define OMAP4430_MODEM_READY_SHIFT (1 << 1) | 701 | #define OMAP4430_MODEM_READY_SHIFT 1 |
702 | #define OMAP4430_MODEM_READY_MASK BITFIELD(1, 1) | 702 | #define OMAP4430_MODEM_READY_MASK BITFIELD(1, 1) |
703 | 703 | ||
704 | /* Used by PRM_MODEM_IF_CTRL */ | 704 | /* Used by PRM_MODEM_IF_CTRL */ |
705 | #define OMAP4430_MODEM_SHUTDOWN_IRQ_SHIFT (1 << 9) | 705 | #define OMAP4430_MODEM_SHUTDOWN_IRQ_SHIFT 9 |
706 | #define OMAP4430_MODEM_SHUTDOWN_IRQ_MASK BITFIELD(9, 9) | 706 | #define OMAP4430_MODEM_SHUTDOWN_IRQ_MASK BITFIELD(9, 9) |
707 | 707 | ||
708 | /* Used by PRM_MODEM_IF_CTRL */ | 708 | /* Used by PRM_MODEM_IF_CTRL */ |
709 | #define OMAP4430_MODEM_SLEEP_ST_SHIFT (1 << 16) | 709 | #define OMAP4430_MODEM_SLEEP_ST_SHIFT 16 |
710 | #define OMAP4430_MODEM_SLEEP_ST_MASK BITFIELD(16, 16) | 710 | #define OMAP4430_MODEM_SLEEP_ST_MASK BITFIELD(16, 16) |
711 | 711 | ||
712 | /* Used by PRM_MODEM_IF_CTRL */ | 712 | /* Used by PRM_MODEM_IF_CTRL */ |
713 | #define OMAP4430_MODEM_WAKE_IRQ_SHIFT (1 << 8) | 713 | #define OMAP4430_MODEM_WAKE_IRQ_SHIFT 8 |
714 | #define OMAP4430_MODEM_WAKE_IRQ_MASK BITFIELD(8, 8) | 714 | #define OMAP4430_MODEM_WAKE_IRQ_MASK BITFIELD(8, 8) |
715 | 715 | ||
716 | /* Used by PM_MPU_PWRSTCTRL */ | 716 | /* Used by PM_MPU_PWRSTCTRL */ |
717 | #define OMAP4430_MPU_L1_ONSTATE_SHIFT (1 << 16) | 717 | #define OMAP4430_MPU_L1_ONSTATE_SHIFT 16 |
718 | #define OMAP4430_MPU_L1_ONSTATE_MASK BITFIELD(16, 17) | 718 | #define OMAP4430_MPU_L1_ONSTATE_MASK BITFIELD(16, 17) |
719 | 719 | ||
720 | /* Used by PM_MPU_PWRSTCTRL */ | 720 | /* Used by PM_MPU_PWRSTCTRL */ |
721 | #define OMAP4430_MPU_L1_RETSTATE_SHIFT (1 << 8) | 721 | #define OMAP4430_MPU_L1_RETSTATE_SHIFT 8 |
722 | #define OMAP4430_MPU_L1_RETSTATE_MASK BITFIELD(8, 8) | 722 | #define OMAP4430_MPU_L1_RETSTATE_MASK BITFIELD(8, 8) |
723 | 723 | ||
724 | /* Used by PM_MPU_PWRSTST */ | 724 | /* Used by PM_MPU_PWRSTST */ |
725 | #define OMAP4430_MPU_L1_STATEST_SHIFT (1 << 4) | 725 | #define OMAP4430_MPU_L1_STATEST_SHIFT 4 |
726 | #define OMAP4430_MPU_L1_STATEST_MASK BITFIELD(4, 5) | 726 | #define OMAP4430_MPU_L1_STATEST_MASK BITFIELD(4, 5) |
727 | 727 | ||
728 | /* Used by PM_MPU_PWRSTCTRL */ | 728 | /* Used by PM_MPU_PWRSTCTRL */ |
729 | #define OMAP4430_MPU_L2_ONSTATE_SHIFT (1 << 18) | 729 | #define OMAP4430_MPU_L2_ONSTATE_SHIFT 18 |
730 | #define OMAP4430_MPU_L2_ONSTATE_MASK BITFIELD(18, 19) | 730 | #define OMAP4430_MPU_L2_ONSTATE_MASK BITFIELD(18, 19) |
731 | 731 | ||
732 | /* Used by PM_MPU_PWRSTCTRL */ | 732 | /* Used by PM_MPU_PWRSTCTRL */ |
733 | #define OMAP4430_MPU_L2_RETSTATE_SHIFT (1 << 9) | 733 | #define OMAP4430_MPU_L2_RETSTATE_SHIFT 9 |
734 | #define OMAP4430_MPU_L2_RETSTATE_MASK BITFIELD(9, 9) | 734 | #define OMAP4430_MPU_L2_RETSTATE_MASK BITFIELD(9, 9) |
735 | 735 | ||
736 | /* Used by PM_MPU_PWRSTST */ | 736 | /* Used by PM_MPU_PWRSTST */ |
737 | #define OMAP4430_MPU_L2_STATEST_SHIFT (1 << 6) | 737 | #define OMAP4430_MPU_L2_STATEST_SHIFT 6 |
738 | #define OMAP4430_MPU_L2_STATEST_MASK BITFIELD(6, 7) | 738 | #define OMAP4430_MPU_L2_STATEST_MASK BITFIELD(6, 7) |
739 | 739 | ||
740 | /* Used by PM_MPU_PWRSTCTRL */ | 740 | /* Used by PM_MPU_PWRSTCTRL */ |
741 | #define OMAP4430_MPU_RAM_ONSTATE_SHIFT (1 << 20) | 741 | #define OMAP4430_MPU_RAM_ONSTATE_SHIFT 20 |
742 | #define OMAP4430_MPU_RAM_ONSTATE_MASK BITFIELD(20, 21) | 742 | #define OMAP4430_MPU_RAM_ONSTATE_MASK BITFIELD(20, 21) |
743 | 743 | ||
744 | /* Used by PM_MPU_PWRSTCTRL */ | 744 | /* Used by PM_MPU_PWRSTCTRL */ |
745 | #define OMAP4430_MPU_RAM_RETSTATE_SHIFT (1 << 10) | 745 | #define OMAP4430_MPU_RAM_RETSTATE_SHIFT 10 |
746 | #define OMAP4430_MPU_RAM_RETSTATE_MASK BITFIELD(10, 10) | 746 | #define OMAP4430_MPU_RAM_RETSTATE_MASK BITFIELD(10, 10) |
747 | 747 | ||
748 | /* Used by PM_MPU_PWRSTST */ | 748 | /* Used by PM_MPU_PWRSTST */ |
749 | #define OMAP4430_MPU_RAM_STATEST_SHIFT (1 << 8) | 749 | #define OMAP4430_MPU_RAM_STATEST_SHIFT 8 |
750 | #define OMAP4430_MPU_RAM_STATEST_MASK BITFIELD(8, 9) | 750 | #define OMAP4430_MPU_RAM_STATEST_MASK BITFIELD(8, 9) |
751 | 751 | ||
752 | /* Used by PRM_RSTST */ | 752 | /* Used by PRM_RSTST */ |
753 | #define OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT (1 << 2) | 753 | #define OMAP4430_MPU_SECURITY_VIOL_RST_SHIFT 2 |
754 | #define OMAP4430_MPU_SECURITY_VIOL_RST_MASK BITFIELD(2, 2) | 754 | #define OMAP4430_MPU_SECURITY_VIOL_RST_MASK BITFIELD(2, 2) |
755 | 755 | ||
756 | /* Used by PRM_RSTST */ | 756 | /* Used by PRM_RSTST */ |
757 | #define OMAP4430_MPU_WDT_RST_SHIFT (1 << 3) | 757 | #define OMAP4430_MPU_WDT_RST_SHIFT 3 |
758 | #define OMAP4430_MPU_WDT_RST_MASK BITFIELD(3, 3) | 758 | #define OMAP4430_MPU_WDT_RST_MASK BITFIELD(3, 3) |
759 | 759 | ||
760 | /* Used by PM_L4PER_PWRSTCTRL */ | 760 | /* Used by PM_L4PER_PWRSTCTRL */ |
761 | #define OMAP4430_NONRETAINED_BANK_ONSTATE_SHIFT (1 << 18) | 761 | #define OMAP4430_NONRETAINED_BANK_ONSTATE_SHIFT 18 |
762 | #define OMAP4430_NONRETAINED_BANK_ONSTATE_MASK BITFIELD(18, 19) | 762 | #define OMAP4430_NONRETAINED_BANK_ONSTATE_MASK BITFIELD(18, 19) |
763 | 763 | ||
764 | /* Used by PM_L4PER_PWRSTCTRL */ | 764 | /* Used by PM_L4PER_PWRSTCTRL */ |
765 | #define OMAP4430_NONRETAINED_BANK_RETSTATE_SHIFT (1 << 9) | 765 | #define OMAP4430_NONRETAINED_BANK_RETSTATE_SHIFT 9 |
766 | #define OMAP4430_NONRETAINED_BANK_RETSTATE_MASK BITFIELD(9, 9) | 766 | #define OMAP4430_NONRETAINED_BANK_RETSTATE_MASK BITFIELD(9, 9) |
767 | 767 | ||
768 | /* Used by PM_L4PER_PWRSTST */ | 768 | /* Used by PM_L4PER_PWRSTST */ |
769 | #define OMAP4430_NONRETAINED_BANK_STATEST_SHIFT (1 << 6) | 769 | #define OMAP4430_NONRETAINED_BANK_STATEST_SHIFT 6 |
770 | #define OMAP4430_NONRETAINED_BANK_STATEST_MASK BITFIELD(6, 7) | 770 | #define OMAP4430_NONRETAINED_BANK_STATEST_MASK BITFIELD(6, 7) |
771 | 771 | ||
772 | /* Used by PM_CORE_PWRSTCTRL */ | 772 | /* Used by PM_CORE_PWRSTCTRL */ |
773 | #define OMAP4430_OCP_NRET_BANK_ONSTATE_SHIFT (1 << 24) | 773 | #define OMAP4430_OCP_NRET_BANK_ONSTATE_SHIFT 24 |
774 | #define OMAP4430_OCP_NRET_BANK_ONSTATE_MASK BITFIELD(24, 25) | 774 | #define OMAP4430_OCP_NRET_BANK_ONSTATE_MASK BITFIELD(24, 25) |
775 | 775 | ||
776 | /* Used by PM_CORE_PWRSTCTRL */ | 776 | /* Used by PM_CORE_PWRSTCTRL */ |
777 | #define OMAP4430_OCP_NRET_BANK_RETSTATE_SHIFT (1 << 12) | 777 | #define OMAP4430_OCP_NRET_BANK_RETSTATE_SHIFT 12 |
778 | #define OMAP4430_OCP_NRET_BANK_RETSTATE_MASK BITFIELD(12, 12) | 778 | #define OMAP4430_OCP_NRET_BANK_RETSTATE_MASK BITFIELD(12, 12) |
779 | 779 | ||
780 | /* Used by PM_CORE_PWRSTST */ | 780 | /* Used by PM_CORE_PWRSTST */ |
781 | #define OMAP4430_OCP_NRET_BANK_STATEST_SHIFT (1 << 12) | 781 | #define OMAP4430_OCP_NRET_BANK_STATEST_SHIFT 12 |
782 | #define OMAP4430_OCP_NRET_BANK_STATEST_MASK BITFIELD(12, 13) | 782 | #define OMAP4430_OCP_NRET_BANK_STATEST_MASK BITFIELD(12, 13) |
783 | 783 | ||
784 | /* | 784 | /* |
785 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, | 785 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, |
786 | * PRM_VC_VAL_CMD_VDD_MPU_L | 786 | * PRM_VC_VAL_CMD_VDD_MPU_L |
787 | */ | 787 | */ |
788 | #define OMAP4430_OFF_SHIFT (1 << 0) | 788 | #define OMAP4430_OFF_SHIFT 0 |
789 | #define OMAP4430_OFF_MASK BITFIELD(0, 7) | 789 | #define OMAP4430_OFF_MASK BITFIELD(0, 7) |
790 | 790 | ||
791 | /* Used by PRM_LDO_BANDGAP_CTRL */ | 791 | /* Used by PRM_LDO_BANDGAP_CTRL */ |
792 | #define OMAP4430_OFF_ENABLE_SHIFT (1 << 0) | 792 | #define OMAP4430_OFF_ENABLE_SHIFT 0 |
793 | #define OMAP4430_OFF_ENABLE_MASK BITFIELD(0, 0) | 793 | #define OMAP4430_OFF_ENABLE_MASK BITFIELD(0, 0) |
794 | 794 | ||
795 | /* | 795 | /* |
796 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, | 796 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, |
797 | * PRM_VC_VAL_CMD_VDD_MPU_L | 797 | * PRM_VC_VAL_CMD_VDD_MPU_L |
798 | */ | 798 | */ |
799 | #define OMAP4430_ON_SHIFT (1 << 24) | 799 | #define OMAP4430_ON_SHIFT 24 |
800 | #define OMAP4430_ON_MASK BITFIELD(24, 31) | 800 | #define OMAP4430_ON_MASK BITFIELD(24, 31) |
801 | 801 | ||
802 | /* | 802 | /* |
803 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, | 803 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, |
804 | * PRM_VC_VAL_CMD_VDD_MPU_L | 804 | * PRM_VC_VAL_CMD_VDD_MPU_L |
805 | */ | 805 | */ |
806 | #define OMAP4430_ONLP_SHIFT (1 << 16) | 806 | #define OMAP4430_ONLP_SHIFT 16 |
807 | #define OMAP4430_ONLP_MASK BITFIELD(16, 23) | 807 | #define OMAP4430_ONLP_MASK BITFIELD(16, 23) |
808 | 808 | ||
809 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ | 809 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ |
810 | #define OMAP4430_OPP_CHANGE_SHIFT (1 << 2) | 810 | #define OMAP4430_OPP_CHANGE_SHIFT 2 |
811 | #define OMAP4430_OPP_CHANGE_MASK BITFIELD(2, 2) | 811 | #define OMAP4430_OPP_CHANGE_MASK BITFIELD(2, 2) |
812 | 812 | ||
813 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ | 813 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ |
814 | #define OMAP4430_OPP_SEL_SHIFT (1 << 0) | 814 | #define OMAP4430_OPP_SEL_SHIFT 0 |
815 | #define OMAP4430_OPP_SEL_MASK BITFIELD(0, 1) | 815 | #define OMAP4430_OPP_SEL_MASK BITFIELD(0, 1) |
816 | 816 | ||
817 | /* Used by PRM_SRAM_COUNT */ | 817 | /* Used by PRM_SRAM_COUNT */ |
818 | #define OMAP4430_PCHARGECNT_VALUE_SHIFT (1 << 0) | 818 | #define OMAP4430_PCHARGECNT_VALUE_SHIFT 0 |
819 | #define OMAP4430_PCHARGECNT_VALUE_MASK BITFIELD(0, 5) | 819 | #define OMAP4430_PCHARGECNT_VALUE_MASK BITFIELD(0, 5) |
820 | 820 | ||
821 | /* Used by PRM_PSCON_COUNT */ | 821 | /* Used by PRM_PSCON_COUNT */ |
822 | #define OMAP4430_PCHARGE_TIME_SHIFT (1 << 0) | 822 | #define OMAP4430_PCHARGE_TIME_SHIFT 0 |
823 | #define OMAP4430_PCHARGE_TIME_MASK BITFIELD(0, 7) | 823 | #define OMAP4430_PCHARGE_TIME_MASK BITFIELD(0, 7) |
824 | 824 | ||
825 | /* Used by PM_ABE_PWRSTCTRL */ | 825 | /* Used by PM_ABE_PWRSTCTRL */ |
826 | #define OMAP4430_PERIPHMEM_ONSTATE_SHIFT (1 << 20) | 826 | #define OMAP4430_PERIPHMEM_ONSTATE_SHIFT 20 |
827 | #define OMAP4430_PERIPHMEM_ONSTATE_MASK BITFIELD(20, 21) | 827 | #define OMAP4430_PERIPHMEM_ONSTATE_MASK BITFIELD(20, 21) |
828 | 828 | ||
829 | /* Used by PM_ABE_PWRSTCTRL */ | 829 | /* Used by PM_ABE_PWRSTCTRL */ |
830 | #define OMAP4430_PERIPHMEM_RETSTATE_SHIFT (1 << 10) | 830 | #define OMAP4430_PERIPHMEM_RETSTATE_SHIFT 10 |
831 | #define OMAP4430_PERIPHMEM_RETSTATE_MASK BITFIELD(10, 10) | 831 | #define OMAP4430_PERIPHMEM_RETSTATE_MASK BITFIELD(10, 10) |
832 | 832 | ||
833 | /* Used by PM_ABE_PWRSTST */ | 833 | /* Used by PM_ABE_PWRSTST */ |
834 | #define OMAP4430_PERIPHMEM_STATEST_SHIFT (1 << 8) | 834 | #define OMAP4430_PERIPHMEM_STATEST_SHIFT 8 |
835 | #define OMAP4430_PERIPHMEM_STATEST_MASK BITFIELD(8, 9) | 835 | #define OMAP4430_PERIPHMEM_STATEST_MASK BITFIELD(8, 9) |
836 | 836 | ||
837 | /* Used by PRM_PHASE1_CNDP */ | 837 | /* Used by PRM_PHASE1_CNDP */ |
838 | #define OMAP4430_PHASE1_CNDP_SHIFT (1 << 0) | 838 | #define OMAP4430_PHASE1_CNDP_SHIFT 0 |
839 | #define OMAP4430_PHASE1_CNDP_MASK BITFIELD(0, 31) | 839 | #define OMAP4430_PHASE1_CNDP_MASK BITFIELD(0, 31) |
840 | 840 | ||
841 | /* Used by PRM_PHASE2A_CNDP */ | 841 | /* Used by PRM_PHASE2A_CNDP */ |
842 | #define OMAP4430_PHASE2A_CNDP_SHIFT (1 << 0) | 842 | #define OMAP4430_PHASE2A_CNDP_SHIFT 0 |
843 | #define OMAP4430_PHASE2A_CNDP_MASK BITFIELD(0, 31) | 843 | #define OMAP4430_PHASE2A_CNDP_MASK BITFIELD(0, 31) |
844 | 844 | ||
845 | /* Used by PRM_PHASE2B_CNDP */ | 845 | /* Used by PRM_PHASE2B_CNDP */ |
846 | #define OMAP4430_PHASE2B_CNDP_SHIFT (1 << 0) | 846 | #define OMAP4430_PHASE2B_CNDP_SHIFT 0 |
847 | #define OMAP4430_PHASE2B_CNDP_MASK BITFIELD(0, 31) | 847 | #define OMAP4430_PHASE2B_CNDP_MASK BITFIELD(0, 31) |
848 | 848 | ||
849 | /* Used by PRM_PSCON_COUNT */ | 849 | /* Used by PRM_PSCON_COUNT */ |
850 | #define OMAP4430_PONOUT_2_PGOODIN_TIME_SHIFT (1 << 8) | 850 | #define OMAP4430_PONOUT_2_PGOODIN_TIME_SHIFT 8 |
851 | #define OMAP4430_PONOUT_2_PGOODIN_TIME_MASK BITFIELD(8, 15) | 851 | #define OMAP4430_PONOUT_2_PGOODIN_TIME_MASK BITFIELD(8, 15) |
852 | 852 | ||
853 | /* | 853 | /* |
@@ -856,7 +856,7 @@ | |||
856 | * PM_CEFUSE_PWRSTCTRL, PM_DSS_PWRSTCTRL, PM_L4PER_PWRSTCTRL, | 856 | * PM_CEFUSE_PWRSTCTRL, PM_DSS_PWRSTCTRL, PM_L4PER_PWRSTCTRL, |
857 | * PM_TESLA_PWRSTCTRL, PM_IVAHD_PWRSTCTRL | 857 | * PM_TESLA_PWRSTCTRL, PM_IVAHD_PWRSTCTRL |
858 | */ | 858 | */ |
859 | #define OMAP4430_POWERSTATE_SHIFT (1 << 0) | 859 | #define OMAP4430_POWERSTATE_SHIFT 0 |
860 | #define OMAP4430_POWERSTATE_MASK BITFIELD(0, 1) | 860 | #define OMAP4430_POWERSTATE_MASK BITFIELD(0, 1) |
861 | 861 | ||
862 | /* | 862 | /* |
@@ -864,35 +864,35 @@ | |||
864 | * PM_ABE_PWRSTST, PM_GFX_PWRSTST, PM_MPU_PWRSTST, PM_CEFUSE_PWRSTST, | 864 | * PM_ABE_PWRSTST, PM_GFX_PWRSTST, PM_MPU_PWRSTST, PM_CEFUSE_PWRSTST, |
865 | * PM_DSS_PWRSTST, PM_L4PER_PWRSTST, PM_TESLA_PWRSTST, PM_IVAHD_PWRSTST | 865 | * PM_DSS_PWRSTST, PM_L4PER_PWRSTST, PM_TESLA_PWRSTST, PM_IVAHD_PWRSTST |
866 | */ | 866 | */ |
867 | #define OMAP4430_POWERSTATEST_SHIFT (1 << 0) | 867 | #define OMAP4430_POWERSTATEST_SHIFT 0 |
868 | #define OMAP4430_POWERSTATEST_MASK BITFIELD(0, 1) | 868 | #define OMAP4430_POWERSTATEST_MASK BITFIELD(0, 1) |
869 | 869 | ||
870 | /* Used by PRM_PWRREQCTRL */ | 870 | /* Used by PRM_PWRREQCTRL */ |
871 | #define OMAP4430_PWRREQ_COND_SHIFT (1 << 0) | 871 | #define OMAP4430_PWRREQ_COND_SHIFT 0 |
872 | #define OMAP4430_PWRREQ_COND_MASK BITFIELD(0, 1) | 872 | #define OMAP4430_PWRREQ_COND_MASK BITFIELD(0, 1) |
873 | 873 | ||
874 | /* Used by PRM_VC_CFG_CHANNEL */ | 874 | /* Used by PRM_VC_CFG_CHANNEL */ |
875 | #define OMAP4430_RACEN_VDD_CORE_L_SHIFT (1 << 3) | 875 | #define OMAP4430_RACEN_VDD_CORE_L_SHIFT 3 |
876 | #define OMAP4430_RACEN_VDD_CORE_L_MASK BITFIELD(3, 3) | 876 | #define OMAP4430_RACEN_VDD_CORE_L_MASK BITFIELD(3, 3) |
877 | 877 | ||
878 | /* Used by PRM_VC_CFG_CHANNEL */ | 878 | /* Used by PRM_VC_CFG_CHANNEL */ |
879 | #define OMAP4430_RACEN_VDD_IVA_L_SHIFT (1 << 11) | 879 | #define OMAP4430_RACEN_VDD_IVA_L_SHIFT 11 |
880 | #define OMAP4430_RACEN_VDD_IVA_L_MASK BITFIELD(11, 11) | 880 | #define OMAP4430_RACEN_VDD_IVA_L_MASK BITFIELD(11, 11) |
881 | 881 | ||
882 | /* Used by PRM_VC_CFG_CHANNEL */ | 882 | /* Used by PRM_VC_CFG_CHANNEL */ |
883 | #define OMAP4430_RACEN_VDD_MPU_L_SHIFT (1 << 20) | 883 | #define OMAP4430_RACEN_VDD_MPU_L_SHIFT 20 |
884 | #define OMAP4430_RACEN_VDD_MPU_L_MASK BITFIELD(20, 20) | 884 | #define OMAP4430_RACEN_VDD_MPU_L_MASK BITFIELD(20, 20) |
885 | 885 | ||
886 | /* Used by PRM_VC_CFG_CHANNEL */ | 886 | /* Used by PRM_VC_CFG_CHANNEL */ |
887 | #define OMAP4430_RAC_VDD_CORE_L_SHIFT (1 << 2) | 887 | #define OMAP4430_RAC_VDD_CORE_L_SHIFT 2 |
888 | #define OMAP4430_RAC_VDD_CORE_L_MASK BITFIELD(2, 2) | 888 | #define OMAP4430_RAC_VDD_CORE_L_MASK BITFIELD(2, 2) |
889 | 889 | ||
890 | /* Used by PRM_VC_CFG_CHANNEL */ | 890 | /* Used by PRM_VC_CFG_CHANNEL */ |
891 | #define OMAP4430_RAC_VDD_IVA_L_SHIFT (1 << 10) | 891 | #define OMAP4430_RAC_VDD_IVA_L_SHIFT 10 |
892 | #define OMAP4430_RAC_VDD_IVA_L_MASK BITFIELD(10, 10) | 892 | #define OMAP4430_RAC_VDD_IVA_L_MASK BITFIELD(10, 10) |
893 | 893 | ||
894 | /* Used by PRM_VC_CFG_CHANNEL */ | 894 | /* Used by PRM_VC_CFG_CHANNEL */ |
895 | #define OMAP4430_RAC_VDD_MPU_L_SHIFT (1 << 19) | 895 | #define OMAP4430_RAC_VDD_MPU_L_SHIFT 19 |
896 | #define OMAP4430_RAC_VDD_MPU_L_MASK BITFIELD(19, 19) | 896 | #define OMAP4430_RAC_VDD_MPU_L_MASK BITFIELD(19, 19) |
897 | 897 | ||
898 | /* | 898 | /* |
@@ -900,7 +900,7 @@ | |||
900 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, | 900 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, |
901 | * PRM_VOLTSETUP_MPU_RET_SLEEP | 901 | * PRM_VOLTSETUP_MPU_RET_SLEEP |
902 | */ | 902 | */ |
903 | #define OMAP4430_RAMP_DOWN_COUNT_SHIFT (1 << 16) | 903 | #define OMAP4430_RAMP_DOWN_COUNT_SHIFT 16 |
904 | #define OMAP4430_RAMP_DOWN_COUNT_MASK BITFIELD(16, 21) | 904 | #define OMAP4430_RAMP_DOWN_COUNT_MASK BITFIELD(16, 21) |
905 | 905 | ||
906 | /* | 906 | /* |
@@ -908,7 +908,7 @@ | |||
908 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, | 908 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, |
909 | * PRM_VOLTSETUP_MPU_RET_SLEEP | 909 | * PRM_VOLTSETUP_MPU_RET_SLEEP |
910 | */ | 910 | */ |
911 | #define OMAP4430_RAMP_DOWN_PRESCAL_SHIFT (1 << 24) | 911 | #define OMAP4430_RAMP_DOWN_PRESCAL_SHIFT 24 |
912 | #define OMAP4430_RAMP_DOWN_PRESCAL_MASK BITFIELD(24, 25) | 912 | #define OMAP4430_RAMP_DOWN_PRESCAL_MASK BITFIELD(24, 25) |
913 | 913 | ||
914 | /* | 914 | /* |
@@ -916,7 +916,7 @@ | |||
916 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, | 916 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, |
917 | * PRM_VOLTSETUP_MPU_RET_SLEEP | 917 | * PRM_VOLTSETUP_MPU_RET_SLEEP |
918 | */ | 918 | */ |
919 | #define OMAP4430_RAMP_UP_COUNT_SHIFT (1 << 0) | 919 | #define OMAP4430_RAMP_UP_COUNT_SHIFT 0 |
920 | #define OMAP4430_RAMP_UP_COUNT_MASK BITFIELD(0, 5) | 920 | #define OMAP4430_RAMP_UP_COUNT_MASK BITFIELD(0, 5) |
921 | 921 | ||
922 | /* | 922 | /* |
@@ -924,1282 +924,1282 @@ | |||
924 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, | 924 | * PRM_VOLTSETUP_IVA_OFF, PRM_VOLTSETUP_IVA_RET_SLEEP, PRM_VOLTSETUP_MPU_OFF, |
925 | * PRM_VOLTSETUP_MPU_RET_SLEEP | 925 | * PRM_VOLTSETUP_MPU_RET_SLEEP |
926 | */ | 926 | */ |
927 | #define OMAP4430_RAMP_UP_PRESCAL_SHIFT (1 << 8) | 927 | #define OMAP4430_RAMP_UP_PRESCAL_SHIFT 8 |
928 | #define OMAP4430_RAMP_UP_PRESCAL_MASK BITFIELD(8, 9) | 928 | #define OMAP4430_RAMP_UP_PRESCAL_MASK BITFIELD(8, 9) |
929 | 929 | ||
930 | /* Used by PRM_VC_CFG_CHANNEL */ | 930 | /* Used by PRM_VC_CFG_CHANNEL */ |
931 | #define OMAP4430_RAV_VDD_CORE_L_SHIFT (1 << 1) | 931 | #define OMAP4430_RAV_VDD_CORE_L_SHIFT 1 |
932 | #define OMAP4430_RAV_VDD_CORE_L_MASK BITFIELD(1, 1) | 932 | #define OMAP4430_RAV_VDD_CORE_L_MASK BITFIELD(1, 1) |
933 | 933 | ||
934 | /* Used by PRM_VC_CFG_CHANNEL */ | 934 | /* Used by PRM_VC_CFG_CHANNEL */ |
935 | #define OMAP4430_RAV_VDD_IVA_L_SHIFT (1 << 9) | 935 | #define OMAP4430_RAV_VDD_IVA_L_SHIFT 9 |
936 | #define OMAP4430_RAV_VDD_IVA_L_MASK BITFIELD(9, 9) | 936 | #define OMAP4430_RAV_VDD_IVA_L_MASK BITFIELD(9, 9) |
937 | 937 | ||
938 | /* Used by PRM_VC_CFG_CHANNEL */ | 938 | /* Used by PRM_VC_CFG_CHANNEL */ |
939 | #define OMAP4430_RAV_VDD_MPU_L_SHIFT (1 << 18) | 939 | #define OMAP4430_RAV_VDD_MPU_L_SHIFT 18 |
940 | #define OMAP4430_RAV_VDD_MPU_L_MASK BITFIELD(18, 18) | 940 | #define OMAP4430_RAV_VDD_MPU_L_MASK BITFIELD(18, 18) |
941 | 941 | ||
942 | /* Used by PRM_VC_VAL_BYPASS */ | 942 | /* Used by PRM_VC_VAL_BYPASS */ |
943 | #define OMAP4430_REGADDR_SHIFT (1 << 8) | 943 | #define OMAP4430_REGADDR_SHIFT 8 |
944 | #define OMAP4430_REGADDR_MASK BITFIELD(8, 15) | 944 | #define OMAP4430_REGADDR_MASK BITFIELD(8, 15) |
945 | 945 | ||
946 | /* | 946 | /* |
947 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, | 947 | * Used by PRM_VC_VAL_CMD_VDD_CORE_L, PRM_VC_VAL_CMD_VDD_IVA_L, |
948 | * PRM_VC_VAL_CMD_VDD_MPU_L | 948 | * PRM_VC_VAL_CMD_VDD_MPU_L |
949 | */ | 949 | */ |
950 | #define OMAP4430_RET_SHIFT (1 << 8) | 950 | #define OMAP4430_RET_SHIFT 8 |
951 | #define OMAP4430_RET_MASK BITFIELD(8, 15) | 951 | #define OMAP4430_RET_MASK BITFIELD(8, 15) |
952 | 952 | ||
953 | /* Used by PM_L4PER_PWRSTCTRL */ | 953 | /* Used by PM_L4PER_PWRSTCTRL */ |
954 | #define OMAP4430_RETAINED_BANK_ONSTATE_SHIFT (1 << 16) | 954 | #define OMAP4430_RETAINED_BANK_ONSTATE_SHIFT 16 |
955 | #define OMAP4430_RETAINED_BANK_ONSTATE_MASK BITFIELD(16, 17) | 955 | #define OMAP4430_RETAINED_BANK_ONSTATE_MASK BITFIELD(16, 17) |
956 | 956 | ||
957 | /* Used by PM_L4PER_PWRSTCTRL */ | 957 | /* Used by PM_L4PER_PWRSTCTRL */ |
958 | #define OMAP4430_RETAINED_BANK_RETSTATE_SHIFT (1 << 8) | 958 | #define OMAP4430_RETAINED_BANK_RETSTATE_SHIFT 8 |
959 | #define OMAP4430_RETAINED_BANK_RETSTATE_MASK BITFIELD(8, 8) | 959 | #define OMAP4430_RETAINED_BANK_RETSTATE_MASK BITFIELD(8, 8) |
960 | 960 | ||
961 | /* Used by PM_L4PER_PWRSTST */ | 961 | /* Used by PM_L4PER_PWRSTST */ |
962 | #define OMAP4430_RETAINED_BANK_STATEST_SHIFT (1 << 4) | 962 | #define OMAP4430_RETAINED_BANK_STATEST_SHIFT 4 |
963 | #define OMAP4430_RETAINED_BANK_STATEST_MASK BITFIELD(4, 5) | 963 | #define OMAP4430_RETAINED_BANK_STATEST_MASK BITFIELD(4, 5) |
964 | 964 | ||
965 | /* | 965 | /* |
966 | * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL, | 966 | * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL, |
967 | * PRM_LDO_SRAM_MPU_CTRL | 967 | * PRM_LDO_SRAM_MPU_CTRL |
968 | */ | 968 | */ |
969 | #define OMAP4430_RETMODE_ENABLE_SHIFT (1 << 0) | 969 | #define OMAP4430_RETMODE_ENABLE_SHIFT 0 |
970 | #define OMAP4430_RETMODE_ENABLE_MASK BITFIELD(0, 0) | 970 | #define OMAP4430_RETMODE_ENABLE_MASK BITFIELD(0, 0) |
971 | 971 | ||
972 | /* Used by REVISION_PRM */ | 972 | /* Used by REVISION_PRM */ |
973 | #define OMAP4430_REV_SHIFT (1 << 0) | 973 | #define OMAP4430_REV_SHIFT 0 |
974 | #define OMAP4430_REV_MASK BITFIELD(0, 7) | 974 | #define OMAP4430_REV_MASK BITFIELD(0, 7) |
975 | 975 | ||
976 | /* Used by RM_DUCATI_RSTCTRL, RM_TESLA_RSTCTRL, RM_IVAHD_RSTCTRL */ | 976 | /* Used by RM_DUCATI_RSTCTRL, RM_TESLA_RSTCTRL, RM_IVAHD_RSTCTRL */ |
977 | #define OMAP4430_RST1_SHIFT (1 << 0) | 977 | #define OMAP4430_RST1_SHIFT 0 |
978 | #define OMAP4430_RST1_MASK BITFIELD(0, 0) | 978 | #define OMAP4430_RST1_MASK BITFIELD(0, 0) |
979 | 979 | ||
980 | /* Used by RM_DUCATI_RSTST, RM_TESLA_RSTST, RM_IVAHD_RSTST */ | 980 | /* Used by RM_DUCATI_RSTST, RM_TESLA_RSTST, RM_IVAHD_RSTST */ |
981 | #define OMAP4430_RST1ST_SHIFT (1 << 0) | 981 | #define OMAP4430_RST1ST_SHIFT 0 |
982 | #define OMAP4430_RST1ST_MASK BITFIELD(0, 0) | 982 | #define OMAP4430_RST1ST_MASK BITFIELD(0, 0) |
983 | 983 | ||
984 | /* Used by RM_DUCATI_RSTCTRL, RM_TESLA_RSTCTRL, RM_IVAHD_RSTCTRL */ | 984 | /* Used by RM_DUCATI_RSTCTRL, RM_TESLA_RSTCTRL, RM_IVAHD_RSTCTRL */ |
985 | #define OMAP4430_RST2_SHIFT (1 << 1) | 985 | #define OMAP4430_RST2_SHIFT 1 |
986 | #define OMAP4430_RST2_MASK BITFIELD(1, 1) | 986 | #define OMAP4430_RST2_MASK BITFIELD(1, 1) |
987 | 987 | ||
988 | /* Used by RM_DUCATI_RSTST, RM_TESLA_RSTST, RM_IVAHD_RSTST */ | 988 | /* Used by RM_DUCATI_RSTST, RM_TESLA_RSTST, RM_IVAHD_RSTST */ |
989 | #define OMAP4430_RST2ST_SHIFT (1 << 1) | 989 | #define OMAP4430_RST2ST_SHIFT 1 |
990 | #define OMAP4430_RST2ST_MASK BITFIELD(1, 1) | 990 | #define OMAP4430_RST2ST_MASK BITFIELD(1, 1) |
991 | 991 | ||
992 | /* Used by RM_DUCATI_RSTCTRL, RM_IVAHD_RSTCTRL */ | 992 | /* Used by RM_DUCATI_RSTCTRL, RM_IVAHD_RSTCTRL */ |
993 | #define OMAP4430_RST3_SHIFT (1 << 2) | 993 | #define OMAP4430_RST3_SHIFT 2 |
994 | #define OMAP4430_RST3_MASK BITFIELD(2, 2) | 994 | #define OMAP4430_RST3_MASK BITFIELD(2, 2) |
995 | 995 | ||
996 | /* Used by RM_DUCATI_RSTST, RM_IVAHD_RSTST */ | 996 | /* Used by RM_DUCATI_RSTST, RM_IVAHD_RSTST */ |
997 | #define OMAP4430_RST3ST_SHIFT (1 << 2) | 997 | #define OMAP4430_RST3ST_SHIFT 2 |
998 | #define OMAP4430_RST3ST_MASK BITFIELD(2, 2) | 998 | #define OMAP4430_RST3ST_MASK BITFIELD(2, 2) |
999 | 999 | ||
1000 | /* Used by PRM_RSTTIME */ | 1000 | /* Used by PRM_RSTTIME */ |
1001 | #define OMAP4430_RSTTIME1_SHIFT (1 << 0) | 1001 | #define OMAP4430_RSTTIME1_SHIFT 0 |
1002 | #define OMAP4430_RSTTIME1_MASK BITFIELD(0, 9) | 1002 | #define OMAP4430_RSTTIME1_MASK BITFIELD(0, 9) |
1003 | 1003 | ||
1004 | /* Used by PRM_RSTTIME */ | 1004 | /* Used by PRM_RSTTIME */ |
1005 | #define OMAP4430_RSTTIME2_SHIFT (1 << 10) | 1005 | #define OMAP4430_RSTTIME2_SHIFT 10 |
1006 | #define OMAP4430_RSTTIME2_MASK BITFIELD(10, 14) | 1006 | #define OMAP4430_RSTTIME2_MASK BITFIELD(10, 14) |
1007 | 1007 | ||
1008 | /* Used by PRM_RSTCTRL */ | 1008 | /* Used by PRM_RSTCTRL */ |
1009 | #define OMAP4430_RST_GLOBAL_COLD_SW_SHIFT (1 << 1) | 1009 | #define OMAP4430_RST_GLOBAL_COLD_SW_SHIFT 1 |
1010 | #define OMAP4430_RST_GLOBAL_COLD_SW_MASK BITFIELD(1, 1) | 1010 | #define OMAP4430_RST_GLOBAL_COLD_SW_MASK BITFIELD(1, 1) |
1011 | 1011 | ||
1012 | /* Used by PRM_RSTCTRL */ | 1012 | /* Used by PRM_RSTCTRL */ |
1013 | #define OMAP4430_RST_GLOBAL_WARM_SW_SHIFT (1 << 0) | 1013 | #define OMAP4430_RST_GLOBAL_WARM_SW_SHIFT 0 |
1014 | #define OMAP4430_RST_GLOBAL_WARM_SW_MASK BITFIELD(0, 0) | 1014 | #define OMAP4430_RST_GLOBAL_WARM_SW_MASK BITFIELD(0, 0) |
1015 | 1015 | ||
1016 | /* Used by PRM_VC_CFG_CHANNEL */ | 1016 | /* Used by PRM_VC_CFG_CHANNEL */ |
1017 | #define OMAP4430_SA_VDD_CORE_L_SHIFT (1 << 0) | 1017 | #define OMAP4430_SA_VDD_CORE_L_SHIFT 0 |
1018 | #define OMAP4430_SA_VDD_CORE_L_MASK BITFIELD(0, 0) | 1018 | #define OMAP4430_SA_VDD_CORE_L_MASK BITFIELD(0, 0) |
1019 | 1019 | ||
1020 | /* Renamed from SA_VDD_CORE_L Used by PRM_VC_SMPS_SA */ | 1020 | /* Renamed from SA_VDD_CORE_L Used by PRM_VC_SMPS_SA */ |
1021 | #define OMAP4430_SA_VDD_CORE_L_0_6_SHIFT (1 << 0) | 1021 | #define OMAP4430_SA_VDD_CORE_L_0_6_SHIFT 0 |
1022 | #define OMAP4430_SA_VDD_CORE_L_0_6_MASK BITFIELD(0, 6) | 1022 | #define OMAP4430_SA_VDD_CORE_L_0_6_MASK BITFIELD(0, 6) |
1023 | 1023 | ||
1024 | /* Used by PRM_VC_CFG_CHANNEL */ | 1024 | /* Used by PRM_VC_CFG_CHANNEL */ |
1025 | #define OMAP4430_SA_VDD_IVA_L_SHIFT (1 << 8) | 1025 | #define OMAP4430_SA_VDD_IVA_L_SHIFT 8 |
1026 | #define OMAP4430_SA_VDD_IVA_L_MASK BITFIELD(8, 8) | 1026 | #define OMAP4430_SA_VDD_IVA_L_MASK BITFIELD(8, 8) |
1027 | 1027 | ||
1028 | /* Renamed from SA_VDD_IVA_L Used by PRM_VC_SMPS_SA */ | 1028 | /* Renamed from SA_VDD_IVA_L Used by PRM_VC_SMPS_SA */ |
1029 | #define OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT (1 << 8) | 1029 | #define OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_SHIFT 8 |
1030 | #define OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK BITFIELD(8, 14) | 1030 | #define OMAP4430_SA_VDD_IVA_L_PRM_VC_SMPS_SA_MASK BITFIELD(8, 14) |
1031 | 1031 | ||
1032 | /* Used by PRM_VC_CFG_CHANNEL */ | 1032 | /* Used by PRM_VC_CFG_CHANNEL */ |
1033 | #define OMAP4430_SA_VDD_MPU_L_SHIFT (1 << 16) | 1033 | #define OMAP4430_SA_VDD_MPU_L_SHIFT 16 |
1034 | #define OMAP4430_SA_VDD_MPU_L_MASK BITFIELD(16, 16) | 1034 | #define OMAP4430_SA_VDD_MPU_L_MASK BITFIELD(16, 16) |
1035 | 1035 | ||
1036 | /* Renamed from SA_VDD_MPU_L Used by PRM_VC_SMPS_SA */ | 1036 | /* Renamed from SA_VDD_MPU_L Used by PRM_VC_SMPS_SA */ |
1037 | #define OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT (1 << 16) | 1037 | #define OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_SHIFT 16 |
1038 | #define OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK BITFIELD(16, 22) | 1038 | #define OMAP4430_SA_VDD_MPU_L_PRM_VC_SMPS_SA_MASK BITFIELD(16, 22) |
1039 | 1039 | ||
1040 | /* Used by PRM_VC_CFG_I2C_CLK */ | 1040 | /* Used by PRM_VC_CFG_I2C_CLK */ |
1041 | #define OMAP4430_SCLH_SHIFT (1 << 0) | 1041 | #define OMAP4430_SCLH_SHIFT 0 |
1042 | #define OMAP4430_SCLH_MASK BITFIELD(0, 7) | 1042 | #define OMAP4430_SCLH_MASK BITFIELD(0, 7) |
1043 | 1043 | ||
1044 | /* Used by PRM_VC_CFG_I2C_CLK */ | 1044 | /* Used by PRM_VC_CFG_I2C_CLK */ |
1045 | #define OMAP4430_SCLL_SHIFT (1 << 8) | 1045 | #define OMAP4430_SCLL_SHIFT 8 |
1046 | #define OMAP4430_SCLL_MASK BITFIELD(8, 15) | 1046 | #define OMAP4430_SCLL_MASK BITFIELD(8, 15) |
1047 | 1047 | ||
1048 | /* Used by PRM_RSTST */ | 1048 | /* Used by PRM_RSTST */ |
1049 | #define OMAP4430_SECURE_WDT_RST_SHIFT (1 << 4) | 1049 | #define OMAP4430_SECURE_WDT_RST_SHIFT 4 |
1050 | #define OMAP4430_SECURE_WDT_RST_MASK BITFIELD(4, 4) | 1050 | #define OMAP4430_SECURE_WDT_RST_MASK BITFIELD(4, 4) |
1051 | 1051 | ||
1052 | /* Used by PM_IVAHD_PWRSTCTRL */ | 1052 | /* Used by PM_IVAHD_PWRSTCTRL */ |
1053 | #define OMAP4430_SL2_MEM_ONSTATE_SHIFT (1 << 18) | 1053 | #define OMAP4430_SL2_MEM_ONSTATE_SHIFT 18 |
1054 | #define OMAP4430_SL2_MEM_ONSTATE_MASK BITFIELD(18, 19) | 1054 | #define OMAP4430_SL2_MEM_ONSTATE_MASK BITFIELD(18, 19) |
1055 | 1055 | ||
1056 | /* Used by PM_IVAHD_PWRSTCTRL */ | 1056 | /* Used by PM_IVAHD_PWRSTCTRL */ |
1057 | #define OMAP4430_SL2_MEM_RETSTATE_SHIFT (1 << 9) | 1057 | #define OMAP4430_SL2_MEM_RETSTATE_SHIFT 9 |
1058 | #define OMAP4430_SL2_MEM_RETSTATE_MASK BITFIELD(9, 9) | 1058 | #define OMAP4430_SL2_MEM_RETSTATE_MASK BITFIELD(9, 9) |
1059 | 1059 | ||
1060 | /* Used by PM_IVAHD_PWRSTST */ | 1060 | /* Used by PM_IVAHD_PWRSTST */ |
1061 | #define OMAP4430_SL2_MEM_STATEST_SHIFT (1 << 6) | 1061 | #define OMAP4430_SL2_MEM_STATEST_SHIFT 6 |
1062 | #define OMAP4430_SL2_MEM_STATEST_MASK BITFIELD(6, 7) | 1062 | #define OMAP4430_SL2_MEM_STATEST_MASK BITFIELD(6, 7) |
1063 | 1063 | ||
1064 | /* Used by PRM_VC_VAL_BYPASS */ | 1064 | /* Used by PRM_VC_VAL_BYPASS */ |
1065 | #define OMAP4430_SLAVEADDR_SHIFT (1 << 0) | 1065 | #define OMAP4430_SLAVEADDR_SHIFT 0 |
1066 | #define OMAP4430_SLAVEADDR_MASK BITFIELD(0, 6) | 1066 | #define OMAP4430_SLAVEADDR_MASK BITFIELD(0, 6) |
1067 | 1067 | ||
1068 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ | 1068 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ |
1069 | #define OMAP4430_SLEEP_RBB_SEL_SHIFT (1 << 3) | 1069 | #define OMAP4430_SLEEP_RBB_SEL_SHIFT 3 |
1070 | #define OMAP4430_SLEEP_RBB_SEL_MASK BITFIELD(3, 3) | 1070 | #define OMAP4430_SLEEP_RBB_SEL_MASK BITFIELD(3, 3) |
1071 | 1071 | ||
1072 | /* Used by PRM_SRAM_COUNT */ | 1072 | /* Used by PRM_SRAM_COUNT */ |
1073 | #define OMAP4430_SLPCNT_VALUE_SHIFT (1 << 16) | 1073 | #define OMAP4430_SLPCNT_VALUE_SHIFT 16 |
1074 | #define OMAP4430_SLPCNT_VALUE_MASK BITFIELD(16, 23) | 1074 | #define OMAP4430_SLPCNT_VALUE_MASK BITFIELD(16, 23) |
1075 | 1075 | ||
1076 | /* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_IVA_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */ | 1076 | /* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_IVA_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */ |
1077 | #define OMAP4430_SMPSWAITTIMEMAX_SHIFT (1 << 8) | 1077 | #define OMAP4430_SMPSWAITTIMEMAX_SHIFT 8 |
1078 | #define OMAP4430_SMPSWAITTIMEMAX_MASK BITFIELD(8, 23) | 1078 | #define OMAP4430_SMPSWAITTIMEMAX_MASK BITFIELD(8, 23) |
1079 | 1079 | ||
1080 | /* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_IVA_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */ | 1080 | /* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_IVA_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */ |
1081 | #define OMAP4430_SMPSWAITTIMEMIN_SHIFT (1 << 8) | 1081 | #define OMAP4430_SMPSWAITTIMEMIN_SHIFT 8 |
1082 | #define OMAP4430_SMPSWAITTIMEMIN_MASK BITFIELD(8, 23) | 1082 | #define OMAP4430_SMPSWAITTIMEMIN_MASK BITFIELD(8, 23) |
1083 | 1083 | ||
1084 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ | 1084 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ |
1085 | #define OMAP4430_SR2EN_SHIFT (1 << 0) | 1085 | #define OMAP4430_SR2EN_SHIFT 0 |
1086 | #define OMAP4430_SR2EN_MASK BITFIELD(0, 0) | 1086 | #define OMAP4430_SR2EN_MASK BITFIELD(0, 0) |
1087 | 1087 | ||
1088 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ | 1088 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ |
1089 | #define OMAP4430_SR2_IN_TRANSITION_SHIFT (1 << 6) | 1089 | #define OMAP4430_SR2_IN_TRANSITION_SHIFT 6 |
1090 | #define OMAP4430_SR2_IN_TRANSITION_MASK BITFIELD(6, 6) | 1090 | #define OMAP4430_SR2_IN_TRANSITION_MASK BITFIELD(6, 6) |
1091 | 1091 | ||
1092 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ | 1092 | /* Used by PRM_LDO_ABB_IVA_CTRL, PRM_LDO_ABB_MPU_CTRL */ |
1093 | #define OMAP4430_SR2_STATUS_SHIFT (1 << 3) | 1093 | #define OMAP4430_SR2_STATUS_SHIFT 3 |
1094 | #define OMAP4430_SR2_STATUS_MASK BITFIELD(3, 4) | 1094 | #define OMAP4430_SR2_STATUS_MASK BITFIELD(3, 4) |
1095 | 1095 | ||
1096 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ | 1096 | /* Used by PRM_LDO_ABB_IVA_SETUP, PRM_LDO_ABB_MPU_SETUP */ |
1097 | #define OMAP4430_SR2_WTCNT_VALUE_SHIFT (1 << 8) | 1097 | #define OMAP4430_SR2_WTCNT_VALUE_SHIFT 8 |
1098 | #define OMAP4430_SR2_WTCNT_VALUE_MASK BITFIELD(8, 15) | 1098 | #define OMAP4430_SR2_WTCNT_VALUE_MASK BITFIELD(8, 15) |
1099 | 1099 | ||
1100 | /* | 1100 | /* |
1101 | * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL, | 1101 | * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL, |
1102 | * PRM_LDO_SRAM_MPU_CTRL | 1102 | * PRM_LDO_SRAM_MPU_CTRL |
1103 | */ | 1103 | */ |
1104 | #define OMAP4430_SRAMLDO_STATUS_SHIFT (1 << 8) | 1104 | #define OMAP4430_SRAMLDO_STATUS_SHIFT 8 |
1105 | #define OMAP4430_SRAMLDO_STATUS_MASK BITFIELD(8, 8) | 1105 | #define OMAP4430_SRAMLDO_STATUS_MASK BITFIELD(8, 8) |
1106 | 1106 | ||
1107 | /* | 1107 | /* |
1108 | * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL, | 1108 | * Used by PRM_LDO_SRAM_CORE_CTRL, PRM_LDO_SRAM_IVA_CTRL, |
1109 | * PRM_LDO_SRAM_MPU_CTRL | 1109 | * PRM_LDO_SRAM_MPU_CTRL |
1110 | */ | 1110 | */ |
1111 | #define OMAP4430_SRAM_IN_TRANSITION_SHIFT (1 << 9) | 1111 | #define OMAP4430_SRAM_IN_TRANSITION_SHIFT 9 |
1112 | #define OMAP4430_SRAM_IN_TRANSITION_MASK BITFIELD(9, 9) | 1112 | #define OMAP4430_SRAM_IN_TRANSITION_MASK BITFIELD(9, 9) |
1113 | 1113 | ||
1114 | /* Used by PRM_VC_CFG_I2C_MODE */ | 1114 | /* Used by PRM_VC_CFG_I2C_MODE */ |
1115 | #define OMAP4430_SRMODEEN_SHIFT (1 << 4) | 1115 | #define OMAP4430_SRMODEEN_SHIFT 4 |
1116 | #define OMAP4430_SRMODEEN_MASK BITFIELD(4, 4) | 1116 | #define OMAP4430_SRMODEEN_MASK BITFIELD(4, 4) |
1117 | 1117 | ||
1118 | /* Used by PRM_VOLTSETUP_WARMRESET */ | 1118 | /* Used by PRM_VOLTSETUP_WARMRESET */ |
1119 | #define OMAP4430_STABLE_COUNT_SHIFT (1 << 0) | 1119 | #define OMAP4430_STABLE_COUNT_SHIFT 0 |
1120 | #define OMAP4430_STABLE_COUNT_MASK BITFIELD(0, 5) | 1120 | #define OMAP4430_STABLE_COUNT_MASK BITFIELD(0, 5) |
1121 | 1121 | ||
1122 | /* Used by PRM_VOLTSETUP_WARMRESET */ | 1122 | /* Used by PRM_VOLTSETUP_WARMRESET */ |
1123 | #define OMAP4430_STABLE_PRESCAL_SHIFT (1 << 8) | 1123 | #define OMAP4430_STABLE_PRESCAL_SHIFT 8 |
1124 | #define OMAP4430_STABLE_PRESCAL_MASK BITFIELD(8, 9) | 1124 | #define OMAP4430_STABLE_PRESCAL_MASK BITFIELD(8, 9) |
1125 | 1125 | ||
1126 | /* Used by PM_IVAHD_PWRSTCTRL */ | 1126 | /* Used by PM_IVAHD_PWRSTCTRL */ |
1127 | #define OMAP4430_TCM1_MEM_ONSTATE_SHIFT (1 << 20) | 1127 | #define OMAP4430_TCM1_MEM_ONSTATE_SHIFT 20 |
1128 | #define OMAP4430_TCM1_MEM_ONSTATE_MASK BITFIELD(20, 21) | 1128 | #define OMAP4430_TCM1_MEM_ONSTATE_MASK BITFIELD(20, 21) |
1129 | 1129 | ||
1130 | /* Used by PM_IVAHD_PWRSTCTRL */ | 1130 | /* Used by PM_IVAHD_PWRSTCTRL */ |
1131 | #define OMAP4430_TCM1_MEM_RETSTATE_SHIFT (1 << 10) | 1131 | #define OMAP4430_TCM1_MEM_RETSTATE_SHIFT 10 |
1132 | #define OMAP4430_TCM1_MEM_RETSTATE_MASK BITFIELD(10, 10) | 1132 | #define OMAP4430_TCM1_MEM_RETSTATE_MASK BITFIELD(10, 10) |
1133 | 1133 | ||
1134 | /* Used by PM_IVAHD_PWRSTST */ | 1134 | /* Used by PM_IVAHD_PWRSTST */ |
1135 | #define OMAP4430_TCM1_MEM_STATEST_SHIFT (1 << 8) | 1135 | #define OMAP4430_TCM1_MEM_STATEST_SHIFT 8 |
1136 | #define OMAP4430_TCM1_MEM_STATEST_MASK BITFIELD(8, 9) | 1136 | #define OMAP4430_TCM1_MEM_STATEST_MASK BITFIELD(8, 9) |
1137 | 1137 | ||
1138 | /* Used by PM_IVAHD_PWRSTCTRL */ | 1138 | /* Used by PM_IVAHD_PWRSTCTRL */ |
1139 | #define OMAP4430_TCM2_MEM_ONSTATE_SHIFT (1 << 22) | 1139 | #define OMAP4430_TCM2_MEM_ONSTATE_SHIFT 22 |
1140 | #define OMAP4430_TCM2_MEM_ONSTATE_MASK BITFIELD(22, 23) | 1140 | #define OMAP4430_TCM2_MEM_ONSTATE_MASK BITFIELD(22, 23) |
1141 | 1141 | ||
1142 | /* Used by PM_IVAHD_PWRSTCTRL */ | 1142 | /* Used by PM_IVAHD_PWRSTCTRL */ |
1143 | #define OMAP4430_TCM2_MEM_RETSTATE_SHIFT (1 << 11) | 1143 | #define OMAP4430_TCM2_MEM_RETSTATE_SHIFT 11 |
1144 | #define OMAP4430_TCM2_MEM_RETSTATE_MASK BITFIELD(11, 11) | 1144 | #define OMAP4430_TCM2_MEM_RETSTATE_MASK BITFIELD(11, 11) |
1145 | 1145 | ||
1146 | /* Used by PM_IVAHD_PWRSTST */ | 1146 | /* Used by PM_IVAHD_PWRSTST */ |
1147 | #define OMAP4430_TCM2_MEM_STATEST_SHIFT (1 << 10) | 1147 | #define OMAP4430_TCM2_MEM_STATEST_SHIFT 10 |
1148 | #define OMAP4430_TCM2_MEM_STATEST_MASK BITFIELD(10, 11) | 1148 | #define OMAP4430_TCM2_MEM_STATEST_MASK BITFIELD(10, 11) |
1149 | 1149 | ||
1150 | /* Used by RM_TESLA_RSTST */ | 1150 | /* Used by RM_TESLA_RSTST */ |
1151 | #define OMAP4430_TESLASS_EMU_RSTST_SHIFT (1 << 2) | 1151 | #define OMAP4430_TESLASS_EMU_RSTST_SHIFT 2 |
1152 | #define OMAP4430_TESLASS_EMU_RSTST_MASK BITFIELD(2, 2) | 1152 | #define OMAP4430_TESLASS_EMU_RSTST_MASK BITFIELD(2, 2) |
1153 | 1153 | ||
1154 | /* Used by RM_TESLA_RSTST */ | 1154 | /* Used by RM_TESLA_RSTST */ |
1155 | #define OMAP4430_TESLA_DSP_EMU_REQ_RSTST_SHIFT (1 << 3) | 1155 | #define OMAP4430_TESLA_DSP_EMU_REQ_RSTST_SHIFT 3 |
1156 | #define OMAP4430_TESLA_DSP_EMU_REQ_RSTST_MASK BITFIELD(3, 3) | 1156 | #define OMAP4430_TESLA_DSP_EMU_REQ_RSTST_MASK BITFIELD(3, 3) |
1157 | 1157 | ||
1158 | /* Used by PM_TESLA_PWRSTCTRL */ | 1158 | /* Used by PM_TESLA_PWRSTCTRL */ |
1159 | #define OMAP4430_TESLA_EDMA_ONSTATE_SHIFT (1 << 20) | 1159 | #define OMAP4430_TESLA_EDMA_ONSTATE_SHIFT 20 |
1160 | #define OMAP4430_TESLA_EDMA_ONSTATE_MASK BITFIELD(20, 21) | 1160 | #define OMAP4430_TESLA_EDMA_ONSTATE_MASK BITFIELD(20, 21) |
1161 | 1161 | ||
1162 | /* Used by PM_TESLA_PWRSTCTRL */ | 1162 | /* Used by PM_TESLA_PWRSTCTRL */ |
1163 | #define OMAP4430_TESLA_EDMA_RETSTATE_SHIFT (1 << 10) | 1163 | #define OMAP4430_TESLA_EDMA_RETSTATE_SHIFT 10 |
1164 | #define OMAP4430_TESLA_EDMA_RETSTATE_MASK BITFIELD(10, 10) | 1164 | #define OMAP4430_TESLA_EDMA_RETSTATE_MASK BITFIELD(10, 10) |
1165 | 1165 | ||
1166 | /* Used by PM_TESLA_PWRSTST */ | 1166 | /* Used by PM_TESLA_PWRSTST */ |
1167 | #define OMAP4430_TESLA_EDMA_STATEST_SHIFT (1 << 8) | 1167 | #define OMAP4430_TESLA_EDMA_STATEST_SHIFT 8 |
1168 | #define OMAP4430_TESLA_EDMA_STATEST_MASK BITFIELD(8, 9) | 1168 | #define OMAP4430_TESLA_EDMA_STATEST_MASK BITFIELD(8, 9) |
1169 | 1169 | ||
1170 | /* Used by PM_TESLA_PWRSTCTRL */ | 1170 | /* Used by PM_TESLA_PWRSTCTRL */ |
1171 | #define OMAP4430_TESLA_L1_ONSTATE_SHIFT (1 << 16) | 1171 | #define OMAP4430_TESLA_L1_ONSTATE_SHIFT 16 |
1172 | #define OMAP4430_TESLA_L1_ONSTATE_MASK BITFIELD(16, 17) | 1172 | #define OMAP4430_TESLA_L1_ONSTATE_MASK BITFIELD(16, 17) |
1173 | 1173 | ||
1174 | /* Used by PM_TESLA_PWRSTCTRL */ | 1174 | /* Used by PM_TESLA_PWRSTCTRL */ |
1175 | #define OMAP4430_TESLA_L1_RETSTATE_SHIFT (1 << 8) | 1175 | #define OMAP4430_TESLA_L1_RETSTATE_SHIFT 8 |
1176 | #define OMAP4430_TESLA_L1_RETSTATE_MASK BITFIELD(8, 8) | 1176 | #define OMAP4430_TESLA_L1_RETSTATE_MASK BITFIELD(8, 8) |
1177 | 1177 | ||
1178 | /* Used by PM_TESLA_PWRSTST */ | 1178 | /* Used by PM_TESLA_PWRSTST */ |
1179 | #define OMAP4430_TESLA_L1_STATEST_SHIFT (1 << 4) | 1179 | #define OMAP4430_TESLA_L1_STATEST_SHIFT 4 |
1180 | #define OMAP4430_TESLA_L1_STATEST_MASK BITFIELD(4, 5) | 1180 | #define OMAP4430_TESLA_L1_STATEST_MASK BITFIELD(4, 5) |
1181 | 1181 | ||
1182 | /* Used by PM_TESLA_PWRSTCTRL */ | 1182 | /* Used by PM_TESLA_PWRSTCTRL */ |
1183 | #define OMAP4430_TESLA_L2_ONSTATE_SHIFT (1 << 18) | 1183 | #define OMAP4430_TESLA_L2_ONSTATE_SHIFT 18 |
1184 | #define OMAP4430_TESLA_L2_ONSTATE_MASK BITFIELD(18, 19) | 1184 | #define OMAP4430_TESLA_L2_ONSTATE_MASK BITFIELD(18, 19) |
1185 | 1185 | ||
1186 | /* Used by PM_TESLA_PWRSTCTRL */ | 1186 | /* Used by PM_TESLA_PWRSTCTRL */ |
1187 | #define OMAP4430_TESLA_L2_RETSTATE_SHIFT (1 << 9) | 1187 | #define OMAP4430_TESLA_L2_RETSTATE_SHIFT 9 |
1188 | #define OMAP4430_TESLA_L2_RETSTATE_MASK BITFIELD(9, 9) | 1188 | #define OMAP4430_TESLA_L2_RETSTATE_MASK BITFIELD(9, 9) |
1189 | 1189 | ||
1190 | /* Used by PM_TESLA_PWRSTST */ | 1190 | /* Used by PM_TESLA_PWRSTST */ |
1191 | #define OMAP4430_TESLA_L2_STATEST_SHIFT (1 << 6) | 1191 | #define OMAP4430_TESLA_L2_STATEST_SHIFT 6 |
1192 | #define OMAP4430_TESLA_L2_STATEST_MASK BITFIELD(6, 7) | 1192 | #define OMAP4430_TESLA_L2_STATEST_MASK BITFIELD(6, 7) |
1193 | 1193 | ||
1194 | /* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */ | 1194 | /* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */ |
1195 | #define OMAP4430_TIMEOUT_SHIFT (1 << 0) | 1195 | #define OMAP4430_TIMEOUT_SHIFT 0 |
1196 | #define OMAP4430_TIMEOUT_MASK BITFIELD(0, 15) | 1196 | #define OMAP4430_TIMEOUT_MASK BITFIELD(0, 15) |
1197 | 1197 | ||
1198 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ | 1198 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ |
1199 | #define OMAP4430_TIMEOUTEN_SHIFT (1 << 3) | 1199 | #define OMAP4430_TIMEOUTEN_SHIFT 3 |
1200 | #define OMAP4430_TIMEOUTEN_MASK BITFIELD(3, 3) | 1200 | #define OMAP4430_TIMEOUTEN_MASK BITFIELD(3, 3) |
1201 | 1201 | ||
1202 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1202 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1203 | #define OMAP4430_TRANSITION_EN_SHIFT (1 << 8) | 1203 | #define OMAP4430_TRANSITION_EN_SHIFT 8 |
1204 | #define OMAP4430_TRANSITION_EN_MASK BITFIELD(8, 8) | 1204 | #define OMAP4430_TRANSITION_EN_MASK BITFIELD(8, 8) |
1205 | 1205 | ||
1206 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1206 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1207 | #define OMAP4430_TRANSITION_ST_SHIFT (1 << 8) | 1207 | #define OMAP4430_TRANSITION_ST_SHIFT 8 |
1208 | #define OMAP4430_TRANSITION_ST_MASK BITFIELD(8, 8) | 1208 | #define OMAP4430_TRANSITION_ST_MASK BITFIELD(8, 8) |
1209 | 1209 | ||
1210 | /* Used by PRM_VC_VAL_BYPASS */ | 1210 | /* Used by PRM_VC_VAL_BYPASS */ |
1211 | #define OMAP4430_VALID_SHIFT (1 << 24) | 1211 | #define OMAP4430_VALID_SHIFT 24 |
1212 | #define OMAP4430_VALID_MASK BITFIELD(24, 24) | 1212 | #define OMAP4430_VALID_MASK BITFIELD(24, 24) |
1213 | 1213 | ||
1214 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1214 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1215 | #define OMAP4430_VC_BYPASSACK_EN_SHIFT (1 << 14) | 1215 | #define OMAP4430_VC_BYPASSACK_EN_SHIFT 14 |
1216 | #define OMAP4430_VC_BYPASSACK_EN_MASK BITFIELD(14, 14) | 1216 | #define OMAP4430_VC_BYPASSACK_EN_MASK BITFIELD(14, 14) |
1217 | 1217 | ||
1218 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1218 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1219 | #define OMAP4430_VC_BYPASSACK_ST_SHIFT (1 << 14) | 1219 | #define OMAP4430_VC_BYPASSACK_ST_SHIFT 14 |
1220 | #define OMAP4430_VC_BYPASSACK_ST_MASK BITFIELD(14, 14) | 1220 | #define OMAP4430_VC_BYPASSACK_ST_MASK BITFIELD(14, 14) |
1221 | 1221 | ||
1222 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1222 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1223 | #define OMAP4430_VC_IVA_VPACK_EN_SHIFT (1 << 30) | 1223 | #define OMAP4430_VC_IVA_VPACK_EN_SHIFT 30 |
1224 | #define OMAP4430_VC_IVA_VPACK_EN_MASK BITFIELD(30, 30) | 1224 | #define OMAP4430_VC_IVA_VPACK_EN_MASK BITFIELD(30, 30) |
1225 | 1225 | ||
1226 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1226 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1227 | #define OMAP4430_VC_IVA_VPACK_ST_SHIFT (1 << 30) | 1227 | #define OMAP4430_VC_IVA_VPACK_ST_SHIFT 30 |
1228 | #define OMAP4430_VC_IVA_VPACK_ST_MASK BITFIELD(30, 30) | 1228 | #define OMAP4430_VC_IVA_VPACK_ST_MASK BITFIELD(30, 30) |
1229 | 1229 | ||
1230 | /* Used by PRM_IRQENABLE_MPU_2 */ | 1230 | /* Used by PRM_IRQENABLE_MPU_2 */ |
1231 | #define OMAP4430_VC_MPU_VPACK_EN_SHIFT (1 << 6) | 1231 | #define OMAP4430_VC_MPU_VPACK_EN_SHIFT 6 |
1232 | #define OMAP4430_VC_MPU_VPACK_EN_MASK BITFIELD(6, 6) | 1232 | #define OMAP4430_VC_MPU_VPACK_EN_MASK BITFIELD(6, 6) |
1233 | 1233 | ||
1234 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 1234 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
1235 | #define OMAP4430_VC_MPU_VPACK_ST_SHIFT (1 << 6) | 1235 | #define OMAP4430_VC_MPU_VPACK_ST_SHIFT 6 |
1236 | #define OMAP4430_VC_MPU_VPACK_ST_MASK BITFIELD(6, 6) | 1236 | #define OMAP4430_VC_MPU_VPACK_ST_MASK BITFIELD(6, 6) |
1237 | 1237 | ||
1238 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1238 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1239 | #define OMAP4430_VC_RAERR_EN_SHIFT (1 << 12) | 1239 | #define OMAP4430_VC_RAERR_EN_SHIFT 12 |
1240 | #define OMAP4430_VC_RAERR_EN_MASK BITFIELD(12, 12) | 1240 | #define OMAP4430_VC_RAERR_EN_MASK BITFIELD(12, 12) |
1241 | 1241 | ||
1242 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1242 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1243 | #define OMAP4430_VC_RAERR_ST_SHIFT (1 << 12) | 1243 | #define OMAP4430_VC_RAERR_ST_SHIFT 12 |
1244 | #define OMAP4430_VC_RAERR_ST_MASK BITFIELD(12, 12) | 1244 | #define OMAP4430_VC_RAERR_ST_MASK BITFIELD(12, 12) |
1245 | 1245 | ||
1246 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1246 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1247 | #define OMAP4430_VC_SAERR_EN_SHIFT (1 << 11) | 1247 | #define OMAP4430_VC_SAERR_EN_SHIFT 11 |
1248 | #define OMAP4430_VC_SAERR_EN_MASK BITFIELD(11, 11) | 1248 | #define OMAP4430_VC_SAERR_EN_MASK BITFIELD(11, 11) |
1249 | 1249 | ||
1250 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1250 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1251 | #define OMAP4430_VC_SAERR_ST_SHIFT (1 << 11) | 1251 | #define OMAP4430_VC_SAERR_ST_SHIFT 11 |
1252 | #define OMAP4430_VC_SAERR_ST_MASK BITFIELD(11, 11) | 1252 | #define OMAP4430_VC_SAERR_ST_MASK BITFIELD(11, 11) |
1253 | 1253 | ||
1254 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1254 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1255 | #define OMAP4430_VC_TOERR_EN_SHIFT (1 << 13) | 1255 | #define OMAP4430_VC_TOERR_EN_SHIFT 13 |
1256 | #define OMAP4430_VC_TOERR_EN_MASK BITFIELD(13, 13) | 1256 | #define OMAP4430_VC_TOERR_EN_MASK BITFIELD(13, 13) |
1257 | 1257 | ||
1258 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1258 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1259 | #define OMAP4430_VC_TOERR_ST_SHIFT (1 << 13) | 1259 | #define OMAP4430_VC_TOERR_ST_SHIFT 13 |
1260 | #define OMAP4430_VC_TOERR_ST_MASK BITFIELD(13, 13) | 1260 | #define OMAP4430_VC_TOERR_ST_MASK BITFIELD(13, 13) |
1261 | 1261 | ||
1262 | /* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */ | 1262 | /* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */ |
1263 | #define OMAP4430_VDDMAX_SHIFT (1 << 24) | 1263 | #define OMAP4430_VDDMAX_SHIFT 24 |
1264 | #define OMAP4430_VDDMAX_MASK BITFIELD(24, 31) | 1264 | #define OMAP4430_VDDMAX_MASK BITFIELD(24, 31) |
1265 | 1265 | ||
1266 | /* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */ | 1266 | /* Used by PRM_VP_CORE_VLIMITTO, PRM_VP_IVA_VLIMITTO, PRM_VP_MPU_VLIMITTO */ |
1267 | #define OMAP4430_VDDMIN_SHIFT (1 << 16) | 1267 | #define OMAP4430_VDDMIN_SHIFT 16 |
1268 | #define OMAP4430_VDDMIN_MASK BITFIELD(16, 23) | 1268 | #define OMAP4430_VDDMIN_MASK BITFIELD(16, 23) |
1269 | 1269 | ||
1270 | /* Used by PRM_VOLTCTRL */ | 1270 | /* Used by PRM_VOLTCTRL */ |
1271 | #define OMAP4430_VDD_CORE_I2C_DISABLE_SHIFT (1 << 12) | 1271 | #define OMAP4430_VDD_CORE_I2C_DISABLE_SHIFT 12 |
1272 | #define OMAP4430_VDD_CORE_I2C_DISABLE_MASK BITFIELD(12, 12) | 1272 | #define OMAP4430_VDD_CORE_I2C_DISABLE_MASK BITFIELD(12, 12) |
1273 | 1273 | ||
1274 | /* Used by PRM_RSTST */ | 1274 | /* Used by PRM_RSTST */ |
1275 | #define OMAP4430_VDD_CORE_VOLT_MGR_RST_SHIFT (1 << 8) | 1275 | #define OMAP4430_VDD_CORE_VOLT_MGR_RST_SHIFT 8 |
1276 | #define OMAP4430_VDD_CORE_VOLT_MGR_RST_MASK BITFIELD(8, 8) | 1276 | #define OMAP4430_VDD_CORE_VOLT_MGR_RST_MASK BITFIELD(8, 8) |
1277 | 1277 | ||
1278 | /* Used by PRM_VOLTCTRL */ | 1278 | /* Used by PRM_VOLTCTRL */ |
1279 | #define OMAP4430_VDD_IVA_I2C_DISABLE_SHIFT (1 << 14) | 1279 | #define OMAP4430_VDD_IVA_I2C_DISABLE_SHIFT 14 |
1280 | #define OMAP4430_VDD_IVA_I2C_DISABLE_MASK BITFIELD(14, 14) | 1280 | #define OMAP4430_VDD_IVA_I2C_DISABLE_MASK BITFIELD(14, 14) |
1281 | 1281 | ||
1282 | /* Used by PRM_VOLTCTRL */ | 1282 | /* Used by PRM_VOLTCTRL */ |
1283 | #define OMAP4430_VDD_IVA_PRESENCE_SHIFT (1 << 9) | 1283 | #define OMAP4430_VDD_IVA_PRESENCE_SHIFT 9 |
1284 | #define OMAP4430_VDD_IVA_PRESENCE_MASK BITFIELD(9, 9) | 1284 | #define OMAP4430_VDD_IVA_PRESENCE_MASK BITFIELD(9, 9) |
1285 | 1285 | ||
1286 | /* Used by PRM_RSTST */ | 1286 | /* Used by PRM_RSTST */ |
1287 | #define OMAP4430_VDD_IVA_VOLT_MGR_RST_SHIFT (1 << 7) | 1287 | #define OMAP4430_VDD_IVA_VOLT_MGR_RST_SHIFT 7 |
1288 | #define OMAP4430_VDD_IVA_VOLT_MGR_RST_MASK BITFIELD(7, 7) | 1288 | #define OMAP4430_VDD_IVA_VOLT_MGR_RST_MASK BITFIELD(7, 7) |
1289 | 1289 | ||
1290 | /* Used by PRM_VOLTCTRL */ | 1290 | /* Used by PRM_VOLTCTRL */ |
1291 | #define OMAP4430_VDD_MPU_I2C_DISABLE_SHIFT (1 << 13) | 1291 | #define OMAP4430_VDD_MPU_I2C_DISABLE_SHIFT 13 |
1292 | #define OMAP4430_VDD_MPU_I2C_DISABLE_MASK BITFIELD(13, 13) | 1292 | #define OMAP4430_VDD_MPU_I2C_DISABLE_MASK BITFIELD(13, 13) |
1293 | 1293 | ||
1294 | /* Used by PRM_VOLTCTRL */ | 1294 | /* Used by PRM_VOLTCTRL */ |
1295 | #define OMAP4430_VDD_MPU_PRESENCE_SHIFT (1 << 8) | 1295 | #define OMAP4430_VDD_MPU_PRESENCE_SHIFT 8 |
1296 | #define OMAP4430_VDD_MPU_PRESENCE_MASK BITFIELD(8, 8) | 1296 | #define OMAP4430_VDD_MPU_PRESENCE_MASK BITFIELD(8, 8) |
1297 | 1297 | ||
1298 | /* Used by PRM_RSTST */ | 1298 | /* Used by PRM_RSTST */ |
1299 | #define OMAP4430_VDD_MPU_VOLT_MGR_RST_SHIFT (1 << 6) | 1299 | #define OMAP4430_VDD_MPU_VOLT_MGR_RST_SHIFT 6 |
1300 | #define OMAP4430_VDD_MPU_VOLT_MGR_RST_MASK BITFIELD(6, 6) | 1300 | #define OMAP4430_VDD_MPU_VOLT_MGR_RST_MASK BITFIELD(6, 6) |
1301 | 1301 | ||
1302 | /* Used by PRM_VC_VAL_SMPS_RA_VOL */ | 1302 | /* Used by PRM_VC_VAL_SMPS_RA_VOL */ |
1303 | #define OMAP4430_VOLRA_VDD_CORE_L_SHIFT (1 << 0) | 1303 | #define OMAP4430_VOLRA_VDD_CORE_L_SHIFT 0 |
1304 | #define OMAP4430_VOLRA_VDD_CORE_L_MASK BITFIELD(0, 7) | 1304 | #define OMAP4430_VOLRA_VDD_CORE_L_MASK BITFIELD(0, 7) |
1305 | 1305 | ||
1306 | /* Used by PRM_VC_VAL_SMPS_RA_VOL */ | 1306 | /* Used by PRM_VC_VAL_SMPS_RA_VOL */ |
1307 | #define OMAP4430_VOLRA_VDD_IVA_L_SHIFT (1 << 8) | 1307 | #define OMAP4430_VOLRA_VDD_IVA_L_SHIFT 8 |
1308 | #define OMAP4430_VOLRA_VDD_IVA_L_MASK BITFIELD(8, 15) | 1308 | #define OMAP4430_VOLRA_VDD_IVA_L_MASK BITFIELD(8, 15) |
1309 | 1309 | ||
1310 | /* Used by PRM_VC_VAL_SMPS_RA_VOL */ | 1310 | /* Used by PRM_VC_VAL_SMPS_RA_VOL */ |
1311 | #define OMAP4430_VOLRA_VDD_MPU_L_SHIFT (1 << 16) | 1311 | #define OMAP4430_VOLRA_VDD_MPU_L_SHIFT 16 |
1312 | #define OMAP4430_VOLRA_VDD_MPU_L_MASK BITFIELD(16, 23) | 1312 | #define OMAP4430_VOLRA_VDD_MPU_L_MASK BITFIELD(16, 23) |
1313 | 1313 | ||
1314 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ | 1314 | /* Used by PRM_VP_CORE_CONFIG, PRM_VP_IVA_CONFIG, PRM_VP_MPU_CONFIG */ |
1315 | #define OMAP4430_VPENABLE_SHIFT (1 << 0) | 1315 | #define OMAP4430_VPENABLE_SHIFT 0 |
1316 | #define OMAP4430_VPENABLE_MASK BITFIELD(0, 0) | 1316 | #define OMAP4430_VPENABLE_MASK BITFIELD(0, 0) |
1317 | 1317 | ||
1318 | /* Used by PRM_VP_CORE_STATUS, PRM_VP_IVA_STATUS, PRM_VP_MPU_STATUS */ | 1318 | /* Used by PRM_VP_CORE_STATUS, PRM_VP_IVA_STATUS, PRM_VP_MPU_STATUS */ |
1319 | #define OMAP4430_VPINIDLE_SHIFT (1 << 0) | 1319 | #define OMAP4430_VPINIDLE_SHIFT 0 |
1320 | #define OMAP4430_VPINIDLE_MASK BITFIELD(0, 0) | 1320 | #define OMAP4430_VPINIDLE_MASK BITFIELD(0, 0) |
1321 | 1321 | ||
1322 | /* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_IVA_VOLTAGE, PRM_VP_MPU_VOLTAGE */ | 1322 | /* Used by PRM_VP_CORE_VOLTAGE, PRM_VP_IVA_VOLTAGE, PRM_VP_MPU_VOLTAGE */ |
1323 | #define OMAP4430_VPVOLTAGE_SHIFT (1 << 0) | 1323 | #define OMAP4430_VPVOLTAGE_SHIFT 0 |
1324 | #define OMAP4430_VPVOLTAGE_MASK BITFIELD(0, 7) | 1324 | #define OMAP4430_VPVOLTAGE_MASK BITFIELD(0, 7) |
1325 | 1325 | ||
1326 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1326 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1327 | #define OMAP4430_VP_CORE_EQVALUE_EN_SHIFT (1 << 20) | 1327 | #define OMAP4430_VP_CORE_EQVALUE_EN_SHIFT 20 |
1328 | #define OMAP4430_VP_CORE_EQVALUE_EN_MASK BITFIELD(20, 20) | 1328 | #define OMAP4430_VP_CORE_EQVALUE_EN_MASK BITFIELD(20, 20) |
1329 | 1329 | ||
1330 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1330 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1331 | #define OMAP4430_VP_CORE_EQVALUE_ST_SHIFT (1 << 20) | 1331 | #define OMAP4430_VP_CORE_EQVALUE_ST_SHIFT 20 |
1332 | #define OMAP4430_VP_CORE_EQVALUE_ST_MASK BITFIELD(20, 20) | 1332 | #define OMAP4430_VP_CORE_EQVALUE_ST_MASK BITFIELD(20, 20) |
1333 | 1333 | ||
1334 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1334 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1335 | #define OMAP4430_VP_CORE_MAXVDD_EN_SHIFT (1 << 18) | 1335 | #define OMAP4430_VP_CORE_MAXVDD_EN_SHIFT 18 |
1336 | #define OMAP4430_VP_CORE_MAXVDD_EN_MASK BITFIELD(18, 18) | 1336 | #define OMAP4430_VP_CORE_MAXVDD_EN_MASK BITFIELD(18, 18) |
1337 | 1337 | ||
1338 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1338 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1339 | #define OMAP4430_VP_CORE_MAXVDD_ST_SHIFT (1 << 18) | 1339 | #define OMAP4430_VP_CORE_MAXVDD_ST_SHIFT 18 |
1340 | #define OMAP4430_VP_CORE_MAXVDD_ST_MASK BITFIELD(18, 18) | 1340 | #define OMAP4430_VP_CORE_MAXVDD_ST_MASK BITFIELD(18, 18) |
1341 | 1341 | ||
1342 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1342 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1343 | #define OMAP4430_VP_CORE_MINVDD_EN_SHIFT (1 << 17) | 1343 | #define OMAP4430_VP_CORE_MINVDD_EN_SHIFT 17 |
1344 | #define OMAP4430_VP_CORE_MINVDD_EN_MASK BITFIELD(17, 17) | 1344 | #define OMAP4430_VP_CORE_MINVDD_EN_MASK BITFIELD(17, 17) |
1345 | 1345 | ||
1346 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1346 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1347 | #define OMAP4430_VP_CORE_MINVDD_ST_SHIFT (1 << 17) | 1347 | #define OMAP4430_VP_CORE_MINVDD_ST_SHIFT 17 |
1348 | #define OMAP4430_VP_CORE_MINVDD_ST_MASK BITFIELD(17, 17) | 1348 | #define OMAP4430_VP_CORE_MINVDD_ST_MASK BITFIELD(17, 17) |
1349 | 1349 | ||
1350 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1350 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1351 | #define OMAP4430_VP_CORE_NOSMPSACK_EN_SHIFT (1 << 19) | 1351 | #define OMAP4430_VP_CORE_NOSMPSACK_EN_SHIFT 19 |
1352 | #define OMAP4430_VP_CORE_NOSMPSACK_EN_MASK BITFIELD(19, 19) | 1352 | #define OMAP4430_VP_CORE_NOSMPSACK_EN_MASK BITFIELD(19, 19) |
1353 | 1353 | ||
1354 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1354 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1355 | #define OMAP4430_VP_CORE_NOSMPSACK_ST_SHIFT (1 << 19) | 1355 | #define OMAP4430_VP_CORE_NOSMPSACK_ST_SHIFT 19 |
1356 | #define OMAP4430_VP_CORE_NOSMPSACK_ST_MASK BITFIELD(19, 19) | 1356 | #define OMAP4430_VP_CORE_NOSMPSACK_ST_MASK BITFIELD(19, 19) |
1357 | 1357 | ||
1358 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1358 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1359 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_EN_SHIFT (1 << 16) | 1359 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_EN_SHIFT 16 |
1360 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_EN_MASK BITFIELD(16, 16) | 1360 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_EN_MASK BITFIELD(16, 16) |
1361 | 1361 | ||
1362 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1362 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1363 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_ST_SHIFT (1 << 16) | 1363 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_ST_SHIFT 16 |
1364 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_ST_MASK BITFIELD(16, 16) | 1364 | #define OMAP4430_VP_CORE_OPPCHANGEDONE_ST_MASK BITFIELD(16, 16) |
1365 | 1365 | ||
1366 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1366 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1367 | #define OMAP4430_VP_CORE_TRANXDONE_EN_SHIFT (1 << 21) | 1367 | #define OMAP4430_VP_CORE_TRANXDONE_EN_SHIFT 21 |
1368 | #define OMAP4430_VP_CORE_TRANXDONE_EN_MASK BITFIELD(21, 21) | 1368 | #define OMAP4430_VP_CORE_TRANXDONE_EN_MASK BITFIELD(21, 21) |
1369 | 1369 | ||
1370 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1370 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1371 | #define OMAP4430_VP_CORE_TRANXDONE_ST_SHIFT (1 << 21) | 1371 | #define OMAP4430_VP_CORE_TRANXDONE_ST_SHIFT 21 |
1372 | #define OMAP4430_VP_CORE_TRANXDONE_ST_MASK BITFIELD(21, 21) | 1372 | #define OMAP4430_VP_CORE_TRANXDONE_ST_MASK BITFIELD(21, 21) |
1373 | 1373 | ||
1374 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1374 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1375 | #define OMAP4430_VP_IVA_EQVALUE_EN_SHIFT (1 << 28) | 1375 | #define OMAP4430_VP_IVA_EQVALUE_EN_SHIFT 28 |
1376 | #define OMAP4430_VP_IVA_EQVALUE_EN_MASK BITFIELD(28, 28) | 1376 | #define OMAP4430_VP_IVA_EQVALUE_EN_MASK BITFIELD(28, 28) |
1377 | 1377 | ||
1378 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1378 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1379 | #define OMAP4430_VP_IVA_EQVALUE_ST_SHIFT (1 << 28) | 1379 | #define OMAP4430_VP_IVA_EQVALUE_ST_SHIFT 28 |
1380 | #define OMAP4430_VP_IVA_EQVALUE_ST_MASK BITFIELD(28, 28) | 1380 | #define OMAP4430_VP_IVA_EQVALUE_ST_MASK BITFIELD(28, 28) |
1381 | 1381 | ||
1382 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1382 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1383 | #define OMAP4430_VP_IVA_MAXVDD_EN_SHIFT (1 << 26) | 1383 | #define OMAP4430_VP_IVA_MAXVDD_EN_SHIFT 26 |
1384 | #define OMAP4430_VP_IVA_MAXVDD_EN_MASK BITFIELD(26, 26) | 1384 | #define OMAP4430_VP_IVA_MAXVDD_EN_MASK BITFIELD(26, 26) |
1385 | 1385 | ||
1386 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1386 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1387 | #define OMAP4430_VP_IVA_MAXVDD_ST_SHIFT (1 << 26) | 1387 | #define OMAP4430_VP_IVA_MAXVDD_ST_SHIFT 26 |
1388 | #define OMAP4430_VP_IVA_MAXVDD_ST_MASK BITFIELD(26, 26) | 1388 | #define OMAP4430_VP_IVA_MAXVDD_ST_MASK BITFIELD(26, 26) |
1389 | 1389 | ||
1390 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1390 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1391 | #define OMAP4430_VP_IVA_MINVDD_EN_SHIFT (1 << 25) | 1391 | #define OMAP4430_VP_IVA_MINVDD_EN_SHIFT 25 |
1392 | #define OMAP4430_VP_IVA_MINVDD_EN_MASK BITFIELD(25, 25) | 1392 | #define OMAP4430_VP_IVA_MINVDD_EN_MASK BITFIELD(25, 25) |
1393 | 1393 | ||
1394 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1394 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1395 | #define OMAP4430_VP_IVA_MINVDD_ST_SHIFT (1 << 25) | 1395 | #define OMAP4430_VP_IVA_MINVDD_ST_SHIFT 25 |
1396 | #define OMAP4430_VP_IVA_MINVDD_ST_MASK BITFIELD(25, 25) | 1396 | #define OMAP4430_VP_IVA_MINVDD_ST_MASK BITFIELD(25, 25) |
1397 | 1397 | ||
1398 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1398 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1399 | #define OMAP4430_VP_IVA_NOSMPSACK_EN_SHIFT (1 << 27) | 1399 | #define OMAP4430_VP_IVA_NOSMPSACK_EN_SHIFT 27 |
1400 | #define OMAP4430_VP_IVA_NOSMPSACK_EN_MASK BITFIELD(27, 27) | 1400 | #define OMAP4430_VP_IVA_NOSMPSACK_EN_MASK BITFIELD(27, 27) |
1401 | 1401 | ||
1402 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1402 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1403 | #define OMAP4430_VP_IVA_NOSMPSACK_ST_SHIFT (1 << 27) | 1403 | #define OMAP4430_VP_IVA_NOSMPSACK_ST_SHIFT 27 |
1404 | #define OMAP4430_VP_IVA_NOSMPSACK_ST_MASK BITFIELD(27, 27) | 1404 | #define OMAP4430_VP_IVA_NOSMPSACK_ST_MASK BITFIELD(27, 27) |
1405 | 1405 | ||
1406 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1406 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1407 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_EN_SHIFT (1 << 24) | 1407 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_EN_SHIFT 24 |
1408 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_EN_MASK BITFIELD(24, 24) | 1408 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_EN_MASK BITFIELD(24, 24) |
1409 | 1409 | ||
1410 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1410 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1411 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_ST_SHIFT (1 << 24) | 1411 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_ST_SHIFT 24 |
1412 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_ST_MASK BITFIELD(24, 24) | 1412 | #define OMAP4430_VP_IVA_OPPCHANGEDONE_ST_MASK BITFIELD(24, 24) |
1413 | 1413 | ||
1414 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ | 1414 | /* Used by PRM_IRQENABLE_DUCATI, PRM_IRQENABLE_MPU */ |
1415 | #define OMAP4430_VP_IVA_TRANXDONE_EN_SHIFT (1 << 29) | 1415 | #define OMAP4430_VP_IVA_TRANXDONE_EN_SHIFT 29 |
1416 | #define OMAP4430_VP_IVA_TRANXDONE_EN_MASK BITFIELD(29, 29) | 1416 | #define OMAP4430_VP_IVA_TRANXDONE_EN_MASK BITFIELD(29, 29) |
1417 | 1417 | ||
1418 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ | 1418 | /* Used by PRM_IRQSTATUS_DUCATI, PRM_IRQSTATUS_MPU */ |
1419 | #define OMAP4430_VP_IVA_TRANXDONE_ST_SHIFT (1 << 29) | 1419 | #define OMAP4430_VP_IVA_TRANXDONE_ST_SHIFT 29 |
1420 | #define OMAP4430_VP_IVA_TRANXDONE_ST_MASK BITFIELD(29, 29) | 1420 | #define OMAP4430_VP_IVA_TRANXDONE_ST_MASK BITFIELD(29, 29) |
1421 | 1421 | ||
1422 | /* Used by PRM_IRQENABLE_MPU_2 */ | 1422 | /* Used by PRM_IRQENABLE_MPU_2 */ |
1423 | #define OMAP4430_VP_MPU_EQVALUE_EN_SHIFT (1 << 4) | 1423 | #define OMAP4430_VP_MPU_EQVALUE_EN_SHIFT 4 |
1424 | #define OMAP4430_VP_MPU_EQVALUE_EN_MASK BITFIELD(4, 4) | 1424 | #define OMAP4430_VP_MPU_EQVALUE_EN_MASK BITFIELD(4, 4) |
1425 | 1425 | ||
1426 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 1426 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
1427 | #define OMAP4430_VP_MPU_EQVALUE_ST_SHIFT (1 << 4) | 1427 | #define OMAP4430_VP_MPU_EQVALUE_ST_SHIFT 4 |
1428 | #define OMAP4430_VP_MPU_EQVALUE_ST_MASK BITFIELD(4, 4) | 1428 | #define OMAP4430_VP_MPU_EQVALUE_ST_MASK BITFIELD(4, 4) |
1429 | 1429 | ||
1430 | /* Used by PRM_IRQENABLE_MPU_2 */ | 1430 | /* Used by PRM_IRQENABLE_MPU_2 */ |
1431 | #define OMAP4430_VP_MPU_MAXVDD_EN_SHIFT (1 << 2) | 1431 | #define OMAP4430_VP_MPU_MAXVDD_EN_SHIFT 2 |
1432 | #define OMAP4430_VP_MPU_MAXVDD_EN_MASK BITFIELD(2, 2) | 1432 | #define OMAP4430_VP_MPU_MAXVDD_EN_MASK BITFIELD(2, 2) |
1433 | 1433 | ||
1434 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 1434 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
1435 | #define OMAP4430_VP_MPU_MAXVDD_ST_SHIFT (1 << 2) | 1435 | #define OMAP4430_VP_MPU_MAXVDD_ST_SHIFT 2 |
1436 | #define OMAP4430_VP_MPU_MAXVDD_ST_MASK BITFIELD(2, 2) | 1436 | #define OMAP4430_VP_MPU_MAXVDD_ST_MASK BITFIELD(2, 2) |
1437 | 1437 | ||
1438 | /* Used by PRM_IRQENABLE_MPU_2 */ | 1438 | /* Used by PRM_IRQENABLE_MPU_2 */ |
1439 | #define OMAP4430_VP_MPU_MINVDD_EN_SHIFT (1 << 1) | 1439 | #define OMAP4430_VP_MPU_MINVDD_EN_SHIFT 1 |
1440 | #define OMAP4430_VP_MPU_MINVDD_EN_MASK BITFIELD(1, 1) | 1440 | #define OMAP4430_VP_MPU_MINVDD_EN_MASK BITFIELD(1, 1) |
1441 | 1441 | ||
1442 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 1442 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
1443 | #define OMAP4430_VP_MPU_MINVDD_ST_SHIFT (1 << 1) | 1443 | #define OMAP4430_VP_MPU_MINVDD_ST_SHIFT 1 |
1444 | #define OMAP4430_VP_MPU_MINVDD_ST_MASK BITFIELD(1, 1) | 1444 | #define OMAP4430_VP_MPU_MINVDD_ST_MASK BITFIELD(1, 1) |
1445 | 1445 | ||
1446 | /* Used by PRM_IRQENABLE_MPU_2 */ | 1446 | /* Used by PRM_IRQENABLE_MPU_2 */ |
1447 | #define OMAP4430_VP_MPU_NOSMPSACK_EN_SHIFT (1 << 3) | 1447 | #define OMAP4430_VP_MPU_NOSMPSACK_EN_SHIFT 3 |
1448 | #define OMAP4430_VP_MPU_NOSMPSACK_EN_MASK BITFIELD(3, 3) | 1448 | #define OMAP4430_VP_MPU_NOSMPSACK_EN_MASK BITFIELD(3, 3) |
1449 | 1449 | ||
1450 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 1450 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
1451 | #define OMAP4430_VP_MPU_NOSMPSACK_ST_SHIFT (1 << 3) | 1451 | #define OMAP4430_VP_MPU_NOSMPSACK_ST_SHIFT 3 |
1452 | #define OMAP4430_VP_MPU_NOSMPSACK_ST_MASK BITFIELD(3, 3) | 1452 | #define OMAP4430_VP_MPU_NOSMPSACK_ST_MASK BITFIELD(3, 3) |
1453 | 1453 | ||
1454 | /* Used by PRM_IRQENABLE_MPU_2 */ | 1454 | /* Used by PRM_IRQENABLE_MPU_2 */ |
1455 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_EN_SHIFT (1 << 0) | 1455 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_EN_SHIFT 0 |
1456 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_EN_MASK BITFIELD(0, 0) | 1456 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_EN_MASK BITFIELD(0, 0) |
1457 | 1457 | ||
1458 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 1458 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
1459 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_ST_SHIFT (1 << 0) | 1459 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_ST_SHIFT 0 |
1460 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_ST_MASK BITFIELD(0, 0) | 1460 | #define OMAP4430_VP_MPU_OPPCHANGEDONE_ST_MASK BITFIELD(0, 0) |
1461 | 1461 | ||
1462 | /* Used by PRM_IRQENABLE_MPU_2 */ | 1462 | /* Used by PRM_IRQENABLE_MPU_2 */ |
1463 | #define OMAP4430_VP_MPU_TRANXDONE_EN_SHIFT (1 << 5) | 1463 | #define OMAP4430_VP_MPU_TRANXDONE_EN_SHIFT 5 |
1464 | #define OMAP4430_VP_MPU_TRANXDONE_EN_MASK BITFIELD(5, 5) | 1464 | #define OMAP4430_VP_MPU_TRANXDONE_EN_MASK BITFIELD(5, 5) |
1465 | 1465 | ||
1466 | /* Used by PRM_IRQSTATUS_MPU_2 */ | 1466 | /* Used by PRM_IRQSTATUS_MPU_2 */ |
1467 | #define OMAP4430_VP_MPU_TRANXDONE_ST_SHIFT (1 << 5) | 1467 | #define OMAP4430_VP_MPU_TRANXDONE_ST_SHIFT 5 |
1468 | #define OMAP4430_VP_MPU_TRANXDONE_ST_MASK BITFIELD(5, 5) | 1468 | #define OMAP4430_VP_MPU_TRANXDONE_ST_MASK BITFIELD(5, 5) |
1469 | 1469 | ||
1470 | /* Used by PRM_SRAM_COUNT */ | 1470 | /* Used by PRM_SRAM_COUNT */ |
1471 | #define OMAP4430_VSETUPCNT_VALUE_SHIFT (1 << 8) | 1471 | #define OMAP4430_VSETUPCNT_VALUE_SHIFT 8 |
1472 | #define OMAP4430_VSETUPCNT_VALUE_MASK BITFIELD(8, 15) | 1472 | #define OMAP4430_VSETUPCNT_VALUE_MASK BITFIELD(8, 15) |
1473 | 1473 | ||
1474 | /* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_IVA_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */ | 1474 | /* Used by PRM_VP_CORE_VSTEPMAX, PRM_VP_IVA_VSTEPMAX, PRM_VP_MPU_VSTEPMAX */ |
1475 | #define OMAP4430_VSTEPMAX_SHIFT (1 << 0) | 1475 | #define OMAP4430_VSTEPMAX_SHIFT 0 |
1476 | #define OMAP4430_VSTEPMAX_MASK BITFIELD(0, 7) | 1476 | #define OMAP4430_VSTEPMAX_MASK BITFIELD(0, 7) |
1477 | 1477 | ||
1478 | /* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_IVA_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */ | 1478 | /* Used by PRM_VP_CORE_VSTEPMIN, PRM_VP_IVA_VSTEPMIN, PRM_VP_MPU_VSTEPMIN */ |
1479 | #define OMAP4430_VSTEPMIN_SHIFT (1 << 0) | 1479 | #define OMAP4430_VSTEPMIN_SHIFT 0 |
1480 | #define OMAP4430_VSTEPMIN_MASK BITFIELD(0, 7) | 1480 | #define OMAP4430_VSTEPMIN_MASK BITFIELD(0, 7) |
1481 | 1481 | ||
1482 | /* Used by PRM_MODEM_IF_CTRL */ | 1482 | /* Used by PRM_MODEM_IF_CTRL */ |
1483 | #define OMAP4430_WAKE_MODEM_SHIFT (1 << 0) | 1483 | #define OMAP4430_WAKE_MODEM_SHIFT 0 |
1484 | #define OMAP4430_WAKE_MODEM_MASK BITFIELD(0, 0) | 1484 | #define OMAP4430_WAKE_MODEM_MASK BITFIELD(0, 0) |
1485 | 1485 | ||
1486 | /* Used by PM_DSS_DSS_WKDEP */ | 1486 | /* Used by PM_DSS_DSS_WKDEP */ |
1487 | #define OMAP4430_WKUPDEP_DISPC_DUCATI_SHIFT (1 << 1) | 1487 | #define OMAP4430_WKUPDEP_DISPC_DUCATI_SHIFT 1 |
1488 | #define OMAP4430_WKUPDEP_DISPC_DUCATI_MASK BITFIELD(1, 1) | 1488 | #define OMAP4430_WKUPDEP_DISPC_DUCATI_MASK BITFIELD(1, 1) |
1489 | 1489 | ||
1490 | /* Used by PM_DSS_DSS_WKDEP */ | 1490 | /* Used by PM_DSS_DSS_WKDEP */ |
1491 | #define OMAP4430_WKUPDEP_DISPC_MPU_SHIFT (1 << 0) | 1491 | #define OMAP4430_WKUPDEP_DISPC_MPU_SHIFT 0 |
1492 | #define OMAP4430_WKUPDEP_DISPC_MPU_MASK BITFIELD(0, 0) | 1492 | #define OMAP4430_WKUPDEP_DISPC_MPU_MASK BITFIELD(0, 0) |
1493 | 1493 | ||
1494 | /* Used by PM_DSS_DSS_WKDEP */ | 1494 | /* Used by PM_DSS_DSS_WKDEP */ |
1495 | #define OMAP4430_WKUPDEP_DISPC_SDMA_SHIFT (1 << 3) | 1495 | #define OMAP4430_WKUPDEP_DISPC_SDMA_SHIFT 3 |
1496 | #define OMAP4430_WKUPDEP_DISPC_SDMA_MASK BITFIELD(3, 3) | 1496 | #define OMAP4430_WKUPDEP_DISPC_SDMA_MASK BITFIELD(3, 3) |
1497 | 1497 | ||
1498 | /* Used by PM_DSS_DSS_WKDEP */ | 1498 | /* Used by PM_DSS_DSS_WKDEP */ |
1499 | #define OMAP4430_WKUPDEP_DISPC_TESLA_SHIFT (1 << 2) | 1499 | #define OMAP4430_WKUPDEP_DISPC_TESLA_SHIFT 2 |
1500 | #define OMAP4430_WKUPDEP_DISPC_TESLA_MASK BITFIELD(2, 2) | 1500 | #define OMAP4430_WKUPDEP_DISPC_TESLA_MASK BITFIELD(2, 2) |
1501 | 1501 | ||
1502 | /* Used by PM_ABE_DMIC_WKDEP */ | 1502 | /* Used by PM_ABE_DMIC_WKDEP */ |
1503 | #define OMAP4430_WKUPDEP_DMIC_DMA_SDMA_SHIFT (1 << 7) | 1503 | #define OMAP4430_WKUPDEP_DMIC_DMA_SDMA_SHIFT 7 |
1504 | #define OMAP4430_WKUPDEP_DMIC_DMA_SDMA_MASK BITFIELD(7, 7) | 1504 | #define OMAP4430_WKUPDEP_DMIC_DMA_SDMA_MASK BITFIELD(7, 7) |
1505 | 1505 | ||
1506 | /* Used by PM_ABE_DMIC_WKDEP */ | 1506 | /* Used by PM_ABE_DMIC_WKDEP */ |
1507 | #define OMAP4430_WKUPDEP_DMIC_DMA_TESLA_SHIFT (1 << 6) | 1507 | #define OMAP4430_WKUPDEP_DMIC_DMA_TESLA_SHIFT 6 |
1508 | #define OMAP4430_WKUPDEP_DMIC_DMA_TESLA_MASK BITFIELD(6, 6) | 1508 | #define OMAP4430_WKUPDEP_DMIC_DMA_TESLA_MASK BITFIELD(6, 6) |
1509 | 1509 | ||
1510 | /* Used by PM_ABE_DMIC_WKDEP */ | 1510 | /* Used by PM_ABE_DMIC_WKDEP */ |
1511 | #define OMAP4430_WKUPDEP_DMIC_IRQ_MPU_SHIFT (1 << 0) | 1511 | #define OMAP4430_WKUPDEP_DMIC_IRQ_MPU_SHIFT 0 |
1512 | #define OMAP4430_WKUPDEP_DMIC_IRQ_MPU_MASK BITFIELD(0, 0) | 1512 | #define OMAP4430_WKUPDEP_DMIC_IRQ_MPU_MASK BITFIELD(0, 0) |
1513 | 1513 | ||
1514 | /* Used by PM_ABE_DMIC_WKDEP */ | 1514 | /* Used by PM_ABE_DMIC_WKDEP */ |
1515 | #define OMAP4430_WKUPDEP_DMIC_IRQ_TESLA_SHIFT (1 << 2) | 1515 | #define OMAP4430_WKUPDEP_DMIC_IRQ_TESLA_SHIFT 2 |
1516 | #define OMAP4430_WKUPDEP_DMIC_IRQ_TESLA_MASK BITFIELD(2, 2) | 1516 | #define OMAP4430_WKUPDEP_DMIC_IRQ_TESLA_MASK BITFIELD(2, 2) |
1517 | 1517 | ||
1518 | /* Used by PM_L4PER_DMTIMER10_WKDEP */ | 1518 | /* Used by PM_L4PER_DMTIMER10_WKDEP */ |
1519 | #define OMAP4430_WKUPDEP_DMTIMER10_MPU_SHIFT (1 << 0) | 1519 | #define OMAP4430_WKUPDEP_DMTIMER10_MPU_SHIFT 0 |
1520 | #define OMAP4430_WKUPDEP_DMTIMER10_MPU_MASK BITFIELD(0, 0) | 1520 | #define OMAP4430_WKUPDEP_DMTIMER10_MPU_MASK BITFIELD(0, 0) |
1521 | 1521 | ||
1522 | /* Used by PM_L4PER_DMTIMER11_WKDEP */ | 1522 | /* Used by PM_L4PER_DMTIMER11_WKDEP */ |
1523 | #define OMAP4430_WKUPDEP_DMTIMER11_DUCATI_SHIFT (1 << 1) | 1523 | #define OMAP4430_WKUPDEP_DMTIMER11_DUCATI_SHIFT 1 |
1524 | #define OMAP4430_WKUPDEP_DMTIMER11_DUCATI_MASK BITFIELD(1, 1) | 1524 | #define OMAP4430_WKUPDEP_DMTIMER11_DUCATI_MASK BITFIELD(1, 1) |
1525 | 1525 | ||
1526 | /* Used by PM_L4PER_DMTIMER11_WKDEP */ | 1526 | /* Used by PM_L4PER_DMTIMER11_WKDEP */ |
1527 | #define OMAP4430_WKUPDEP_DMTIMER11_MPU_SHIFT (1 << 0) | 1527 | #define OMAP4430_WKUPDEP_DMTIMER11_MPU_SHIFT 0 |
1528 | #define OMAP4430_WKUPDEP_DMTIMER11_MPU_MASK BITFIELD(0, 0) | 1528 | #define OMAP4430_WKUPDEP_DMTIMER11_MPU_MASK BITFIELD(0, 0) |
1529 | 1529 | ||
1530 | /* Used by PM_L4PER_DMTIMER2_WKDEP */ | 1530 | /* Used by PM_L4PER_DMTIMER2_WKDEP */ |
1531 | #define OMAP4430_WKUPDEP_DMTIMER2_MPU_SHIFT (1 << 0) | 1531 | #define OMAP4430_WKUPDEP_DMTIMER2_MPU_SHIFT 0 |
1532 | #define OMAP4430_WKUPDEP_DMTIMER2_MPU_MASK BITFIELD(0, 0) | 1532 | #define OMAP4430_WKUPDEP_DMTIMER2_MPU_MASK BITFIELD(0, 0) |
1533 | 1533 | ||
1534 | /* Used by PM_L4PER_DMTIMER3_WKDEP */ | 1534 | /* Used by PM_L4PER_DMTIMER3_WKDEP */ |
1535 | #define OMAP4430_WKUPDEP_DMTIMER3_DUCATI_SHIFT (1 << 1) | 1535 | #define OMAP4430_WKUPDEP_DMTIMER3_DUCATI_SHIFT 1 |
1536 | #define OMAP4430_WKUPDEP_DMTIMER3_DUCATI_MASK BITFIELD(1, 1) | 1536 | #define OMAP4430_WKUPDEP_DMTIMER3_DUCATI_MASK BITFIELD(1, 1) |
1537 | 1537 | ||
1538 | /* Used by PM_L4PER_DMTIMER3_WKDEP */ | 1538 | /* Used by PM_L4PER_DMTIMER3_WKDEP */ |
1539 | #define OMAP4430_WKUPDEP_DMTIMER3_MPU_SHIFT (1 << 0) | 1539 | #define OMAP4430_WKUPDEP_DMTIMER3_MPU_SHIFT 0 |
1540 | #define OMAP4430_WKUPDEP_DMTIMER3_MPU_MASK BITFIELD(0, 0) | 1540 | #define OMAP4430_WKUPDEP_DMTIMER3_MPU_MASK BITFIELD(0, 0) |
1541 | 1541 | ||
1542 | /* Used by PM_L4PER_DMTIMER4_WKDEP */ | 1542 | /* Used by PM_L4PER_DMTIMER4_WKDEP */ |
1543 | #define OMAP4430_WKUPDEP_DMTIMER4_DUCATI_SHIFT (1 << 1) | 1543 | #define OMAP4430_WKUPDEP_DMTIMER4_DUCATI_SHIFT 1 |
1544 | #define OMAP4430_WKUPDEP_DMTIMER4_DUCATI_MASK BITFIELD(1, 1) | 1544 | #define OMAP4430_WKUPDEP_DMTIMER4_DUCATI_MASK BITFIELD(1, 1) |
1545 | 1545 | ||
1546 | /* Used by PM_L4PER_DMTIMER4_WKDEP */ | 1546 | /* Used by PM_L4PER_DMTIMER4_WKDEP */ |
1547 | #define OMAP4430_WKUPDEP_DMTIMER4_MPU_SHIFT (1 << 0) | 1547 | #define OMAP4430_WKUPDEP_DMTIMER4_MPU_SHIFT 0 |
1548 | #define OMAP4430_WKUPDEP_DMTIMER4_MPU_MASK BITFIELD(0, 0) | 1548 | #define OMAP4430_WKUPDEP_DMTIMER4_MPU_MASK BITFIELD(0, 0) |
1549 | 1549 | ||
1550 | /* Used by PM_L4PER_DMTIMER9_WKDEP */ | 1550 | /* Used by PM_L4PER_DMTIMER9_WKDEP */ |
1551 | #define OMAP4430_WKUPDEP_DMTIMER9_DUCATI_SHIFT (1 << 1) | 1551 | #define OMAP4430_WKUPDEP_DMTIMER9_DUCATI_SHIFT 1 |
1552 | #define OMAP4430_WKUPDEP_DMTIMER9_DUCATI_MASK BITFIELD(1, 1) | 1552 | #define OMAP4430_WKUPDEP_DMTIMER9_DUCATI_MASK BITFIELD(1, 1) |
1553 | 1553 | ||
1554 | /* Used by PM_L4PER_DMTIMER9_WKDEP */ | 1554 | /* Used by PM_L4PER_DMTIMER9_WKDEP */ |
1555 | #define OMAP4430_WKUPDEP_DMTIMER9_MPU_SHIFT (1 << 0) | 1555 | #define OMAP4430_WKUPDEP_DMTIMER9_MPU_SHIFT 0 |
1556 | #define OMAP4430_WKUPDEP_DMTIMER9_MPU_MASK BITFIELD(0, 0) | 1556 | #define OMAP4430_WKUPDEP_DMTIMER9_MPU_MASK BITFIELD(0, 0) |
1557 | 1557 | ||
1558 | /* Used by PM_DSS_DSS_WKDEP */ | 1558 | /* Used by PM_DSS_DSS_WKDEP */ |
1559 | #define OMAP4430_WKUPDEP_DSI1_DUCATI_SHIFT (1 << 5) | 1559 | #define OMAP4430_WKUPDEP_DSI1_DUCATI_SHIFT 5 |
1560 | #define OMAP4430_WKUPDEP_DSI1_DUCATI_MASK BITFIELD(5, 5) | 1560 | #define OMAP4430_WKUPDEP_DSI1_DUCATI_MASK BITFIELD(5, 5) |
1561 | 1561 | ||
1562 | /* Used by PM_DSS_DSS_WKDEP */ | 1562 | /* Used by PM_DSS_DSS_WKDEP */ |
1563 | #define OMAP4430_WKUPDEP_DSI1_MPU_SHIFT (1 << 4) | 1563 | #define OMAP4430_WKUPDEP_DSI1_MPU_SHIFT 4 |
1564 | #define OMAP4430_WKUPDEP_DSI1_MPU_MASK BITFIELD(4, 4) | 1564 | #define OMAP4430_WKUPDEP_DSI1_MPU_MASK BITFIELD(4, 4) |
1565 | 1565 | ||
1566 | /* Used by PM_DSS_DSS_WKDEP */ | 1566 | /* Used by PM_DSS_DSS_WKDEP */ |
1567 | #define OMAP4430_WKUPDEP_DSI1_SDMA_SHIFT (1 << 7) | 1567 | #define OMAP4430_WKUPDEP_DSI1_SDMA_SHIFT 7 |
1568 | #define OMAP4430_WKUPDEP_DSI1_SDMA_MASK BITFIELD(7, 7) | 1568 | #define OMAP4430_WKUPDEP_DSI1_SDMA_MASK BITFIELD(7, 7) |
1569 | 1569 | ||
1570 | /* Used by PM_DSS_DSS_WKDEP */ | 1570 | /* Used by PM_DSS_DSS_WKDEP */ |
1571 | #define OMAP4430_WKUPDEP_DSI1_TESLA_SHIFT (1 << 6) | 1571 | #define OMAP4430_WKUPDEP_DSI1_TESLA_SHIFT 6 |
1572 | #define OMAP4430_WKUPDEP_DSI1_TESLA_MASK BITFIELD(6, 6) | 1572 | #define OMAP4430_WKUPDEP_DSI1_TESLA_MASK BITFIELD(6, 6) |
1573 | 1573 | ||
1574 | /* Used by PM_DSS_DSS_WKDEP */ | 1574 | /* Used by PM_DSS_DSS_WKDEP */ |
1575 | #define OMAP4430_WKUPDEP_DSI2_DUCATI_SHIFT (1 << 9) | 1575 | #define OMAP4430_WKUPDEP_DSI2_DUCATI_SHIFT 9 |
1576 | #define OMAP4430_WKUPDEP_DSI2_DUCATI_MASK BITFIELD(9, 9) | 1576 | #define OMAP4430_WKUPDEP_DSI2_DUCATI_MASK BITFIELD(9, 9) |
1577 | 1577 | ||
1578 | /* Used by PM_DSS_DSS_WKDEP */ | 1578 | /* Used by PM_DSS_DSS_WKDEP */ |
1579 | #define OMAP4430_WKUPDEP_DSI2_MPU_SHIFT (1 << 8) | 1579 | #define OMAP4430_WKUPDEP_DSI2_MPU_SHIFT 8 |
1580 | #define OMAP4430_WKUPDEP_DSI2_MPU_MASK BITFIELD(8, 8) | 1580 | #define OMAP4430_WKUPDEP_DSI2_MPU_MASK BITFIELD(8, 8) |
1581 | 1581 | ||
1582 | /* Used by PM_DSS_DSS_WKDEP */ | 1582 | /* Used by PM_DSS_DSS_WKDEP */ |
1583 | #define OMAP4430_WKUPDEP_DSI2_SDMA_SHIFT (1 << 11) | 1583 | #define OMAP4430_WKUPDEP_DSI2_SDMA_SHIFT 11 |
1584 | #define OMAP4430_WKUPDEP_DSI2_SDMA_MASK BITFIELD(11, 11) | 1584 | #define OMAP4430_WKUPDEP_DSI2_SDMA_MASK BITFIELD(11, 11) |
1585 | 1585 | ||
1586 | /* Used by PM_DSS_DSS_WKDEP */ | 1586 | /* Used by PM_DSS_DSS_WKDEP */ |
1587 | #define OMAP4430_WKUPDEP_DSI2_TESLA_SHIFT (1 << 10) | 1587 | #define OMAP4430_WKUPDEP_DSI2_TESLA_SHIFT 10 |
1588 | #define OMAP4430_WKUPDEP_DSI2_TESLA_MASK BITFIELD(10, 10) | 1588 | #define OMAP4430_WKUPDEP_DSI2_TESLA_MASK BITFIELD(10, 10) |
1589 | 1589 | ||
1590 | /* Used by PM_WKUP_GPIO1_WKDEP */ | 1590 | /* Used by PM_WKUP_GPIO1_WKDEP */ |
1591 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_DUCATI_SHIFT (1 << 1) | 1591 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_DUCATI_SHIFT 1 |
1592 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_DUCATI_MASK BITFIELD(1, 1) | 1592 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_DUCATI_MASK BITFIELD(1, 1) |
1593 | 1593 | ||
1594 | /* Used by PM_WKUP_GPIO1_WKDEP */ | 1594 | /* Used by PM_WKUP_GPIO1_WKDEP */ |
1595 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_MPU_SHIFT (1 << 0) | 1595 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_MPU_SHIFT 0 |
1596 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_MPU_MASK BITFIELD(0, 0) | 1596 | #define OMAP4430_WKUPDEP_GPIO1_IRQ1_MPU_MASK BITFIELD(0, 0) |
1597 | 1597 | ||
1598 | /* Used by PM_WKUP_GPIO1_WKDEP */ | 1598 | /* Used by PM_WKUP_GPIO1_WKDEP */ |
1599 | #define OMAP4430_WKUPDEP_GPIO1_IRQ2_TESLA_SHIFT (1 << 6) | 1599 | #define OMAP4430_WKUPDEP_GPIO1_IRQ2_TESLA_SHIFT 6 |
1600 | #define OMAP4430_WKUPDEP_GPIO1_IRQ2_TESLA_MASK BITFIELD(6, 6) | 1600 | #define OMAP4430_WKUPDEP_GPIO1_IRQ2_TESLA_MASK BITFIELD(6, 6) |
1601 | 1601 | ||
1602 | /* Used by PM_L4PER_GPIO2_WKDEP */ | 1602 | /* Used by PM_L4PER_GPIO2_WKDEP */ |
1603 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_DUCATI_SHIFT (1 << 1) | 1603 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_DUCATI_SHIFT 1 |
1604 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_DUCATI_MASK BITFIELD(1, 1) | 1604 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_DUCATI_MASK BITFIELD(1, 1) |
1605 | 1605 | ||
1606 | /* Used by PM_L4PER_GPIO2_WKDEP */ | 1606 | /* Used by PM_L4PER_GPIO2_WKDEP */ |
1607 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_MPU_SHIFT (1 << 0) | 1607 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_MPU_SHIFT 0 |
1608 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_MPU_MASK BITFIELD(0, 0) | 1608 | #define OMAP4430_WKUPDEP_GPIO2_IRQ1_MPU_MASK BITFIELD(0, 0) |
1609 | 1609 | ||
1610 | /* Used by PM_L4PER_GPIO2_WKDEP */ | 1610 | /* Used by PM_L4PER_GPIO2_WKDEP */ |
1611 | #define OMAP4430_WKUPDEP_GPIO2_IRQ2_TESLA_SHIFT (1 << 6) | 1611 | #define OMAP4430_WKUPDEP_GPIO2_IRQ2_TESLA_SHIFT 6 |
1612 | #define OMAP4430_WKUPDEP_GPIO2_IRQ2_TESLA_MASK BITFIELD(6, 6) | 1612 | #define OMAP4430_WKUPDEP_GPIO2_IRQ2_TESLA_MASK BITFIELD(6, 6) |
1613 | 1613 | ||
1614 | /* Used by PM_L4PER_GPIO3_WKDEP */ | 1614 | /* Used by PM_L4PER_GPIO3_WKDEP */ |
1615 | #define OMAP4430_WKUPDEP_GPIO3_IRQ1_MPU_SHIFT (1 << 0) | 1615 | #define OMAP4430_WKUPDEP_GPIO3_IRQ1_MPU_SHIFT 0 |
1616 | #define OMAP4430_WKUPDEP_GPIO3_IRQ1_MPU_MASK BITFIELD(0, 0) | 1616 | #define OMAP4430_WKUPDEP_GPIO3_IRQ1_MPU_MASK BITFIELD(0, 0) |
1617 | 1617 | ||
1618 | /* Used by PM_L4PER_GPIO3_WKDEP */ | 1618 | /* Used by PM_L4PER_GPIO3_WKDEP */ |
1619 | #define OMAP4430_WKUPDEP_GPIO3_IRQ2_TESLA_SHIFT (1 << 6) | 1619 | #define OMAP4430_WKUPDEP_GPIO3_IRQ2_TESLA_SHIFT 6 |
1620 | #define OMAP4430_WKUPDEP_GPIO3_IRQ2_TESLA_MASK BITFIELD(6, 6) | 1620 | #define OMAP4430_WKUPDEP_GPIO3_IRQ2_TESLA_MASK BITFIELD(6, 6) |
1621 | 1621 | ||
1622 | /* Used by PM_L4PER_GPIO4_WKDEP */ | 1622 | /* Used by PM_L4PER_GPIO4_WKDEP */ |
1623 | #define OMAP4430_WKUPDEP_GPIO4_IRQ1_MPU_SHIFT (1 << 0) | 1623 | #define OMAP4430_WKUPDEP_GPIO4_IRQ1_MPU_SHIFT 0 |
1624 | #define OMAP4430_WKUPDEP_GPIO4_IRQ1_MPU_MASK BITFIELD(0, 0) | 1624 | #define OMAP4430_WKUPDEP_GPIO4_IRQ1_MPU_MASK BITFIELD(0, 0) |
1625 | 1625 | ||
1626 | /* Used by PM_L4PER_GPIO4_WKDEP */ | 1626 | /* Used by PM_L4PER_GPIO4_WKDEP */ |
1627 | #define OMAP4430_WKUPDEP_GPIO4_IRQ2_TESLA_SHIFT (1 << 6) | 1627 | #define OMAP4430_WKUPDEP_GPIO4_IRQ2_TESLA_SHIFT 6 |
1628 | #define OMAP4430_WKUPDEP_GPIO4_IRQ2_TESLA_MASK BITFIELD(6, 6) | 1628 | #define OMAP4430_WKUPDEP_GPIO4_IRQ2_TESLA_MASK BITFIELD(6, 6) |
1629 | 1629 | ||
1630 | /* Used by PM_L4PER_GPIO5_WKDEP */ | 1630 | /* Used by PM_L4PER_GPIO5_WKDEP */ |
1631 | #define OMAP4430_WKUPDEP_GPIO5_IRQ1_MPU_SHIFT (1 << 0) | 1631 | #define OMAP4430_WKUPDEP_GPIO5_IRQ1_MPU_SHIFT 0 |
1632 | #define OMAP4430_WKUPDEP_GPIO5_IRQ1_MPU_MASK BITFIELD(0, 0) | 1632 | #define OMAP4430_WKUPDEP_GPIO5_IRQ1_MPU_MASK BITFIELD(0, 0) |
1633 | 1633 | ||
1634 | /* Used by PM_L4PER_GPIO5_WKDEP */ | 1634 | /* Used by PM_L4PER_GPIO5_WKDEP */ |
1635 | #define OMAP4430_WKUPDEP_GPIO5_IRQ2_TESLA_SHIFT (1 << 6) | 1635 | #define OMAP4430_WKUPDEP_GPIO5_IRQ2_TESLA_SHIFT 6 |
1636 | #define OMAP4430_WKUPDEP_GPIO5_IRQ2_TESLA_MASK BITFIELD(6, 6) | 1636 | #define OMAP4430_WKUPDEP_GPIO5_IRQ2_TESLA_MASK BITFIELD(6, 6) |
1637 | 1637 | ||
1638 | /* Used by PM_L4PER_GPIO6_WKDEP */ | 1638 | /* Used by PM_L4PER_GPIO6_WKDEP */ |
1639 | #define OMAP4430_WKUPDEP_GPIO6_IRQ1_MPU_SHIFT (1 << 0) | 1639 | #define OMAP4430_WKUPDEP_GPIO6_IRQ1_MPU_SHIFT 0 |
1640 | #define OMAP4430_WKUPDEP_GPIO6_IRQ1_MPU_MASK BITFIELD(0, 0) | 1640 | #define OMAP4430_WKUPDEP_GPIO6_IRQ1_MPU_MASK BITFIELD(0, 0) |
1641 | 1641 | ||
1642 | /* Used by PM_L4PER_GPIO6_WKDEP */ | 1642 | /* Used by PM_L4PER_GPIO6_WKDEP */ |
1643 | #define OMAP4430_WKUPDEP_GPIO6_IRQ2_TESLA_SHIFT (1 << 6) | 1643 | #define OMAP4430_WKUPDEP_GPIO6_IRQ2_TESLA_SHIFT 6 |
1644 | #define OMAP4430_WKUPDEP_GPIO6_IRQ2_TESLA_MASK BITFIELD(6, 6) | 1644 | #define OMAP4430_WKUPDEP_GPIO6_IRQ2_TESLA_MASK BITFIELD(6, 6) |
1645 | 1645 | ||
1646 | /* Used by PM_DSS_DSS_WKDEP */ | 1646 | /* Used by PM_DSS_DSS_WKDEP */ |
1647 | #define OMAP4430_WKUPDEP_HDMIDMA_SDMA_SHIFT (1 << 19) | 1647 | #define OMAP4430_WKUPDEP_HDMIDMA_SDMA_SHIFT 19 |
1648 | #define OMAP4430_WKUPDEP_HDMIDMA_SDMA_MASK BITFIELD(19, 19) | 1648 | #define OMAP4430_WKUPDEP_HDMIDMA_SDMA_MASK BITFIELD(19, 19) |
1649 | 1649 | ||
1650 | /* Used by PM_DSS_DSS_WKDEP */ | 1650 | /* Used by PM_DSS_DSS_WKDEP */ |
1651 | #define OMAP4430_WKUPDEP_HDMIIRQ_DUCATI_SHIFT (1 << 13) | 1651 | #define OMAP4430_WKUPDEP_HDMIIRQ_DUCATI_SHIFT 13 |
1652 | #define OMAP4430_WKUPDEP_HDMIIRQ_DUCATI_MASK BITFIELD(13, 13) | 1652 | #define OMAP4430_WKUPDEP_HDMIIRQ_DUCATI_MASK BITFIELD(13, 13) |
1653 | 1653 | ||
1654 | /* Used by PM_DSS_DSS_WKDEP */ | 1654 | /* Used by PM_DSS_DSS_WKDEP */ |
1655 | #define OMAP4430_WKUPDEP_HDMIIRQ_MPU_SHIFT (1 << 12) | 1655 | #define OMAP4430_WKUPDEP_HDMIIRQ_MPU_SHIFT 12 |
1656 | #define OMAP4430_WKUPDEP_HDMIIRQ_MPU_MASK BITFIELD(12, 12) | 1656 | #define OMAP4430_WKUPDEP_HDMIIRQ_MPU_MASK BITFIELD(12, 12) |
1657 | 1657 | ||
1658 | /* Used by PM_DSS_DSS_WKDEP */ | 1658 | /* Used by PM_DSS_DSS_WKDEP */ |
1659 | #define OMAP4430_WKUPDEP_HDMIIRQ_TESLA_SHIFT (1 << 14) | 1659 | #define OMAP4430_WKUPDEP_HDMIIRQ_TESLA_SHIFT 14 |
1660 | #define OMAP4430_WKUPDEP_HDMIIRQ_TESLA_MASK BITFIELD(14, 14) | 1660 | #define OMAP4430_WKUPDEP_HDMIIRQ_TESLA_MASK BITFIELD(14, 14) |
1661 | 1661 | ||
1662 | /* Used by PM_L4PER_HECC1_WKDEP */ | 1662 | /* Used by PM_L4PER_HECC1_WKDEP */ |
1663 | #define OMAP4430_WKUPDEP_HECC1_MPU_SHIFT (1 << 0) | 1663 | #define OMAP4430_WKUPDEP_HECC1_MPU_SHIFT 0 |
1664 | #define OMAP4430_WKUPDEP_HECC1_MPU_MASK BITFIELD(0, 0) | 1664 | #define OMAP4430_WKUPDEP_HECC1_MPU_MASK BITFIELD(0, 0) |
1665 | 1665 | ||
1666 | /* Used by PM_L4PER_HECC2_WKDEP */ | 1666 | /* Used by PM_L4PER_HECC2_WKDEP */ |
1667 | #define OMAP4430_WKUPDEP_HECC2_MPU_SHIFT (1 << 0) | 1667 | #define OMAP4430_WKUPDEP_HECC2_MPU_SHIFT 0 |
1668 | #define OMAP4430_WKUPDEP_HECC2_MPU_MASK BITFIELD(0, 0) | 1668 | #define OMAP4430_WKUPDEP_HECC2_MPU_MASK BITFIELD(0, 0) |
1669 | 1669 | ||
1670 | /* Used by PM_L3INIT_HSI_WKDEP */ | 1670 | /* Used by PM_L3INIT_HSI_WKDEP */ |
1671 | #define OMAP4430_WKUPDEP_HSI_DSP_TESLA_SHIFT (1 << 6) | 1671 | #define OMAP4430_WKUPDEP_HSI_DSP_TESLA_SHIFT 6 |
1672 | #define OMAP4430_WKUPDEP_HSI_DSP_TESLA_MASK BITFIELD(6, 6) | 1672 | #define OMAP4430_WKUPDEP_HSI_DSP_TESLA_MASK BITFIELD(6, 6) |
1673 | 1673 | ||
1674 | /* Used by PM_L3INIT_HSI_WKDEP */ | 1674 | /* Used by PM_L3INIT_HSI_WKDEP */ |
1675 | #define OMAP4430_WKUPDEP_HSI_MCU_DUCATI_SHIFT (1 << 1) | 1675 | #define OMAP4430_WKUPDEP_HSI_MCU_DUCATI_SHIFT 1 |
1676 | #define OMAP4430_WKUPDEP_HSI_MCU_DUCATI_MASK BITFIELD(1, 1) | 1676 | #define OMAP4430_WKUPDEP_HSI_MCU_DUCATI_MASK BITFIELD(1, 1) |
1677 | 1677 | ||
1678 | /* Used by PM_L3INIT_HSI_WKDEP */ | 1678 | /* Used by PM_L3INIT_HSI_WKDEP */ |
1679 | #define OMAP4430_WKUPDEP_HSI_MCU_MPU_SHIFT (1 << 0) | 1679 | #define OMAP4430_WKUPDEP_HSI_MCU_MPU_SHIFT 0 |
1680 | #define OMAP4430_WKUPDEP_HSI_MCU_MPU_MASK BITFIELD(0, 0) | 1680 | #define OMAP4430_WKUPDEP_HSI_MCU_MPU_MASK BITFIELD(0, 0) |
1681 | 1681 | ||
1682 | /* Used by PM_L4PER_I2C1_WKDEP */ | 1682 | /* Used by PM_L4PER_I2C1_WKDEP */ |
1683 | #define OMAP4430_WKUPDEP_I2C1_DMA_SDMA_SHIFT (1 << 7) | 1683 | #define OMAP4430_WKUPDEP_I2C1_DMA_SDMA_SHIFT 7 |
1684 | #define OMAP4430_WKUPDEP_I2C1_DMA_SDMA_MASK BITFIELD(7, 7) | 1684 | #define OMAP4430_WKUPDEP_I2C1_DMA_SDMA_MASK BITFIELD(7, 7) |
1685 | 1685 | ||
1686 | /* Used by PM_L4PER_I2C1_WKDEP */ | 1686 | /* Used by PM_L4PER_I2C1_WKDEP */ |
1687 | #define OMAP4430_WKUPDEP_I2C1_IRQ_DUCATI_SHIFT (1 << 1) | 1687 | #define OMAP4430_WKUPDEP_I2C1_IRQ_DUCATI_SHIFT 1 |
1688 | #define OMAP4430_WKUPDEP_I2C1_IRQ_DUCATI_MASK BITFIELD(1, 1) | 1688 | #define OMAP4430_WKUPDEP_I2C1_IRQ_DUCATI_MASK BITFIELD(1, 1) |
1689 | 1689 | ||
1690 | /* Used by PM_L4PER_I2C1_WKDEP */ | 1690 | /* Used by PM_L4PER_I2C1_WKDEP */ |
1691 | #define OMAP4430_WKUPDEP_I2C1_IRQ_MPU_SHIFT (1 << 0) | 1691 | #define OMAP4430_WKUPDEP_I2C1_IRQ_MPU_SHIFT 0 |
1692 | #define OMAP4430_WKUPDEP_I2C1_IRQ_MPU_MASK BITFIELD(0, 0) | 1692 | #define OMAP4430_WKUPDEP_I2C1_IRQ_MPU_MASK BITFIELD(0, 0) |
1693 | 1693 | ||
1694 | /* Used by PM_L4PER_I2C2_WKDEP */ | 1694 | /* Used by PM_L4PER_I2C2_WKDEP */ |
1695 | #define OMAP4430_WKUPDEP_I2C2_DMA_SDMA_SHIFT (1 << 7) | 1695 | #define OMAP4430_WKUPDEP_I2C2_DMA_SDMA_SHIFT 7 |
1696 | #define OMAP4430_WKUPDEP_I2C2_DMA_SDMA_MASK BITFIELD(7, 7) | 1696 | #define OMAP4430_WKUPDEP_I2C2_DMA_SDMA_MASK BITFIELD(7, 7) |
1697 | 1697 | ||
1698 | /* Used by PM_L4PER_I2C2_WKDEP */ | 1698 | /* Used by PM_L4PER_I2C2_WKDEP */ |
1699 | #define OMAP4430_WKUPDEP_I2C2_IRQ_DUCATI_SHIFT (1 << 1) | 1699 | #define OMAP4430_WKUPDEP_I2C2_IRQ_DUCATI_SHIFT 1 |
1700 | #define OMAP4430_WKUPDEP_I2C2_IRQ_DUCATI_MASK BITFIELD(1, 1) | 1700 | #define OMAP4430_WKUPDEP_I2C2_IRQ_DUCATI_MASK BITFIELD(1, 1) |
1701 | 1701 | ||
1702 | /* Used by PM_L4PER_I2C2_WKDEP */ | 1702 | /* Used by PM_L4PER_I2C2_WKDEP */ |
1703 | #define OMAP4430_WKUPDEP_I2C2_IRQ_MPU_SHIFT (1 << 0) | 1703 | #define OMAP4430_WKUPDEP_I2C2_IRQ_MPU_SHIFT 0 |
1704 | #define OMAP4430_WKUPDEP_I2C2_IRQ_MPU_MASK BITFIELD(0, 0) | 1704 | #define OMAP4430_WKUPDEP_I2C2_IRQ_MPU_MASK BITFIELD(0, 0) |
1705 | 1705 | ||
1706 | /* Used by PM_L4PER_I2C3_WKDEP */ | 1706 | /* Used by PM_L4PER_I2C3_WKDEP */ |
1707 | #define OMAP4430_WKUPDEP_I2C3_DMA_SDMA_SHIFT (1 << 7) | 1707 | #define OMAP4430_WKUPDEP_I2C3_DMA_SDMA_SHIFT 7 |
1708 | #define OMAP4430_WKUPDEP_I2C3_DMA_SDMA_MASK BITFIELD(7, 7) | 1708 | #define OMAP4430_WKUPDEP_I2C3_DMA_SDMA_MASK BITFIELD(7, 7) |
1709 | 1709 | ||
1710 | /* Used by PM_L4PER_I2C3_WKDEP */ | 1710 | /* Used by PM_L4PER_I2C3_WKDEP */ |
1711 | #define OMAP4430_WKUPDEP_I2C3_IRQ_DUCATI_SHIFT (1 << 1) | 1711 | #define OMAP4430_WKUPDEP_I2C3_IRQ_DUCATI_SHIFT 1 |
1712 | #define OMAP4430_WKUPDEP_I2C3_IRQ_DUCATI_MASK BITFIELD(1, 1) | 1712 | #define OMAP4430_WKUPDEP_I2C3_IRQ_DUCATI_MASK BITFIELD(1, 1) |
1713 | 1713 | ||
1714 | /* Used by PM_L4PER_I2C3_WKDEP */ | 1714 | /* Used by PM_L4PER_I2C3_WKDEP */ |
1715 | #define OMAP4430_WKUPDEP_I2C3_IRQ_MPU_SHIFT (1 << 0) | 1715 | #define OMAP4430_WKUPDEP_I2C3_IRQ_MPU_SHIFT 0 |
1716 | #define OMAP4430_WKUPDEP_I2C3_IRQ_MPU_MASK BITFIELD(0, 0) | 1716 | #define OMAP4430_WKUPDEP_I2C3_IRQ_MPU_MASK BITFIELD(0, 0) |
1717 | 1717 | ||
1718 | /* Used by PM_L4PER_I2C4_WKDEP */ | 1718 | /* Used by PM_L4PER_I2C4_WKDEP */ |
1719 | #define OMAP4430_WKUPDEP_I2C4_DMA_SDMA_SHIFT (1 << 7) | 1719 | #define OMAP4430_WKUPDEP_I2C4_DMA_SDMA_SHIFT 7 |
1720 | #define OMAP4430_WKUPDEP_I2C4_DMA_SDMA_MASK BITFIELD(7, 7) | 1720 | #define OMAP4430_WKUPDEP_I2C4_DMA_SDMA_MASK BITFIELD(7, 7) |
1721 | 1721 | ||
1722 | /* Used by PM_L4PER_I2C4_WKDEP */ | 1722 | /* Used by PM_L4PER_I2C4_WKDEP */ |
1723 | #define OMAP4430_WKUPDEP_I2C4_IRQ_DUCATI_SHIFT (1 << 1) | 1723 | #define OMAP4430_WKUPDEP_I2C4_IRQ_DUCATI_SHIFT 1 |
1724 | #define OMAP4430_WKUPDEP_I2C4_IRQ_DUCATI_MASK BITFIELD(1, 1) | 1724 | #define OMAP4430_WKUPDEP_I2C4_IRQ_DUCATI_MASK BITFIELD(1, 1) |
1725 | 1725 | ||
1726 | /* Used by PM_L4PER_I2C4_WKDEP */ | 1726 | /* Used by PM_L4PER_I2C4_WKDEP */ |
1727 | #define OMAP4430_WKUPDEP_I2C4_IRQ_MPU_SHIFT (1 << 0) | 1727 | #define OMAP4430_WKUPDEP_I2C4_IRQ_MPU_SHIFT 0 |
1728 | #define OMAP4430_WKUPDEP_I2C4_IRQ_MPU_MASK BITFIELD(0, 0) | 1728 | #define OMAP4430_WKUPDEP_I2C4_IRQ_MPU_MASK BITFIELD(0, 0) |
1729 | 1729 | ||
1730 | /* Used by PM_L4PER_I2C5_WKDEP */ | 1730 | /* Used by PM_L4PER_I2C5_WKDEP */ |
1731 | #define OMAP4430_WKUPDEP_I2C5_DMA_SDMA_SHIFT (1 << 7) | 1731 | #define OMAP4430_WKUPDEP_I2C5_DMA_SDMA_SHIFT 7 |
1732 | #define OMAP4430_WKUPDEP_I2C5_DMA_SDMA_MASK BITFIELD(7, 7) | 1732 | #define OMAP4430_WKUPDEP_I2C5_DMA_SDMA_MASK BITFIELD(7, 7) |
1733 | 1733 | ||
1734 | /* Used by PM_L4PER_I2C5_WKDEP */ | 1734 | /* Used by PM_L4PER_I2C5_WKDEP */ |
1735 | #define OMAP4430_WKUPDEP_I2C5_IRQ_MPU_SHIFT (1 << 0) | 1735 | #define OMAP4430_WKUPDEP_I2C5_IRQ_MPU_SHIFT 0 |
1736 | #define OMAP4430_WKUPDEP_I2C5_IRQ_MPU_MASK BITFIELD(0, 0) | 1736 | #define OMAP4430_WKUPDEP_I2C5_IRQ_MPU_MASK BITFIELD(0, 0) |
1737 | 1737 | ||
1738 | /* Used by PM_WKUP_KEYBOARD_WKDEP */ | 1738 | /* Used by PM_WKUP_KEYBOARD_WKDEP */ |
1739 | #define OMAP4430_WKUPDEP_KEYBOARD_MPU_SHIFT (1 << 0) | 1739 | #define OMAP4430_WKUPDEP_KEYBOARD_MPU_SHIFT 0 |
1740 | #define OMAP4430_WKUPDEP_KEYBOARD_MPU_MASK BITFIELD(0, 0) | 1740 | #define OMAP4430_WKUPDEP_KEYBOARD_MPU_MASK BITFIELD(0, 0) |
1741 | 1741 | ||
1742 | /* Used by PM_ABE_MCASP_WKDEP */ | 1742 | /* Used by PM_ABE_MCASP_WKDEP */ |
1743 | #define OMAP4430_WKUPDEP_MCASP1_DMA_SDMA_SHIFT (1 << 7) | 1743 | #define OMAP4430_WKUPDEP_MCASP1_DMA_SDMA_SHIFT 7 |
1744 | #define OMAP4430_WKUPDEP_MCASP1_DMA_SDMA_MASK BITFIELD(7, 7) | 1744 | #define OMAP4430_WKUPDEP_MCASP1_DMA_SDMA_MASK BITFIELD(7, 7) |
1745 | 1745 | ||
1746 | /* Used by PM_ABE_MCASP_WKDEP */ | 1746 | /* Used by PM_ABE_MCASP_WKDEP */ |
1747 | #define OMAP4430_WKUPDEP_MCASP1_DMA_TESLA_SHIFT (1 << 6) | 1747 | #define OMAP4430_WKUPDEP_MCASP1_DMA_TESLA_SHIFT 6 |
1748 | #define OMAP4430_WKUPDEP_MCASP1_DMA_TESLA_MASK BITFIELD(6, 6) | 1748 | #define OMAP4430_WKUPDEP_MCASP1_DMA_TESLA_MASK BITFIELD(6, 6) |
1749 | 1749 | ||
1750 | /* Used by PM_ABE_MCASP_WKDEP */ | 1750 | /* Used by PM_ABE_MCASP_WKDEP */ |
1751 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_MPU_SHIFT (1 << 0) | 1751 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_MPU_SHIFT 0 |
1752 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_MPU_MASK BITFIELD(0, 0) | 1752 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_MPU_MASK BITFIELD(0, 0) |
1753 | 1753 | ||
1754 | /* Used by PM_ABE_MCASP_WKDEP */ | 1754 | /* Used by PM_ABE_MCASP_WKDEP */ |
1755 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_TESLA_SHIFT (1 << 2) | 1755 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_TESLA_SHIFT 2 |
1756 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_TESLA_MASK BITFIELD(2, 2) | 1756 | #define OMAP4430_WKUPDEP_MCASP1_IRQ_TESLA_MASK BITFIELD(2, 2) |
1757 | 1757 | ||
1758 | /* Used by PM_L4PER_MCASP2_WKDEP */ | 1758 | /* Used by PM_L4PER_MCASP2_WKDEP */ |
1759 | #define OMAP4430_WKUPDEP_MCASP2_DMA_SDMA_SHIFT (1 << 7) | 1759 | #define OMAP4430_WKUPDEP_MCASP2_DMA_SDMA_SHIFT 7 |
1760 | #define OMAP4430_WKUPDEP_MCASP2_DMA_SDMA_MASK BITFIELD(7, 7) | 1760 | #define OMAP4430_WKUPDEP_MCASP2_DMA_SDMA_MASK BITFIELD(7, 7) |
1761 | 1761 | ||
1762 | /* Used by PM_L4PER_MCASP2_WKDEP */ | 1762 | /* Used by PM_L4PER_MCASP2_WKDEP */ |
1763 | #define OMAP4430_WKUPDEP_MCASP2_DMA_TESLA_SHIFT (1 << 6) | 1763 | #define OMAP4430_WKUPDEP_MCASP2_DMA_TESLA_SHIFT 6 |
1764 | #define OMAP4430_WKUPDEP_MCASP2_DMA_TESLA_MASK BITFIELD(6, 6) | 1764 | #define OMAP4430_WKUPDEP_MCASP2_DMA_TESLA_MASK BITFIELD(6, 6) |
1765 | 1765 | ||
1766 | /* Used by PM_L4PER_MCASP2_WKDEP */ | 1766 | /* Used by PM_L4PER_MCASP2_WKDEP */ |
1767 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_MPU_SHIFT (1 << 0) | 1767 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_MPU_SHIFT 0 |
1768 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_MPU_MASK BITFIELD(0, 0) | 1768 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_MPU_MASK BITFIELD(0, 0) |
1769 | 1769 | ||
1770 | /* Used by PM_L4PER_MCASP2_WKDEP */ | 1770 | /* Used by PM_L4PER_MCASP2_WKDEP */ |
1771 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_TESLA_SHIFT (1 << 2) | 1771 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_TESLA_SHIFT 2 |
1772 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_TESLA_MASK BITFIELD(2, 2) | 1772 | #define OMAP4430_WKUPDEP_MCASP2_IRQ_TESLA_MASK BITFIELD(2, 2) |
1773 | 1773 | ||
1774 | /* Used by PM_L4PER_MCASP3_WKDEP */ | 1774 | /* Used by PM_L4PER_MCASP3_WKDEP */ |
1775 | #define OMAP4430_WKUPDEP_MCASP3_DMA_SDMA_SHIFT (1 << 7) | 1775 | #define OMAP4430_WKUPDEP_MCASP3_DMA_SDMA_SHIFT 7 |
1776 | #define OMAP4430_WKUPDEP_MCASP3_DMA_SDMA_MASK BITFIELD(7, 7) | 1776 | #define OMAP4430_WKUPDEP_MCASP3_DMA_SDMA_MASK BITFIELD(7, 7) |
1777 | 1777 | ||
1778 | /* Used by PM_L4PER_MCASP3_WKDEP */ | 1778 | /* Used by PM_L4PER_MCASP3_WKDEP */ |
1779 | #define OMAP4430_WKUPDEP_MCASP3_DMA_TESLA_SHIFT (1 << 6) | 1779 | #define OMAP4430_WKUPDEP_MCASP3_DMA_TESLA_SHIFT 6 |
1780 | #define OMAP4430_WKUPDEP_MCASP3_DMA_TESLA_MASK BITFIELD(6, 6) | 1780 | #define OMAP4430_WKUPDEP_MCASP3_DMA_TESLA_MASK BITFIELD(6, 6) |
1781 | 1781 | ||
1782 | /* Used by PM_L4PER_MCASP3_WKDEP */ | 1782 | /* Used by PM_L4PER_MCASP3_WKDEP */ |
1783 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_MPU_SHIFT (1 << 0) | 1783 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_MPU_SHIFT 0 |
1784 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_MPU_MASK BITFIELD(0, 0) | 1784 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_MPU_MASK BITFIELD(0, 0) |
1785 | 1785 | ||
1786 | /* Used by PM_L4PER_MCASP3_WKDEP */ | 1786 | /* Used by PM_L4PER_MCASP3_WKDEP */ |
1787 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_TESLA_SHIFT (1 << 2) | 1787 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_TESLA_SHIFT 2 |
1788 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_TESLA_MASK BITFIELD(2, 2) | 1788 | #define OMAP4430_WKUPDEP_MCASP3_IRQ_TESLA_MASK BITFIELD(2, 2) |
1789 | 1789 | ||
1790 | /* Used by PM_ABE_MCBSP1_WKDEP */ | 1790 | /* Used by PM_ABE_MCBSP1_WKDEP */ |
1791 | #define OMAP4430_WKUPDEP_MCBSP1_MPU_SHIFT (1 << 0) | 1791 | #define OMAP4430_WKUPDEP_MCBSP1_MPU_SHIFT 0 |
1792 | #define OMAP4430_WKUPDEP_MCBSP1_MPU_MASK BITFIELD(0, 0) | 1792 | #define OMAP4430_WKUPDEP_MCBSP1_MPU_MASK BITFIELD(0, 0) |
1793 | 1793 | ||
1794 | /* Used by PM_ABE_MCBSP1_WKDEP */ | 1794 | /* Used by PM_ABE_MCBSP1_WKDEP */ |
1795 | #define OMAP4430_WKUPDEP_MCBSP1_SDMA_SHIFT (1 << 3) | 1795 | #define OMAP4430_WKUPDEP_MCBSP1_SDMA_SHIFT 3 |
1796 | #define OMAP4430_WKUPDEP_MCBSP1_SDMA_MASK BITFIELD(3, 3) | 1796 | #define OMAP4430_WKUPDEP_MCBSP1_SDMA_MASK BITFIELD(3, 3) |
1797 | 1797 | ||
1798 | /* Used by PM_ABE_MCBSP1_WKDEP */ | 1798 | /* Used by PM_ABE_MCBSP1_WKDEP */ |
1799 | #define OMAP4430_WKUPDEP_MCBSP1_TESLA_SHIFT (1 << 2) | 1799 | #define OMAP4430_WKUPDEP_MCBSP1_TESLA_SHIFT 2 |
1800 | #define OMAP4430_WKUPDEP_MCBSP1_TESLA_MASK BITFIELD(2, 2) | 1800 | #define OMAP4430_WKUPDEP_MCBSP1_TESLA_MASK BITFIELD(2, 2) |
1801 | 1801 | ||
1802 | /* Used by PM_ABE_MCBSP2_WKDEP */ | 1802 | /* Used by PM_ABE_MCBSP2_WKDEP */ |
1803 | #define OMAP4430_WKUPDEP_MCBSP2_MPU_SHIFT (1 << 0) | 1803 | #define OMAP4430_WKUPDEP_MCBSP2_MPU_SHIFT 0 |
1804 | #define OMAP4430_WKUPDEP_MCBSP2_MPU_MASK BITFIELD(0, 0) | 1804 | #define OMAP4430_WKUPDEP_MCBSP2_MPU_MASK BITFIELD(0, 0) |
1805 | 1805 | ||
1806 | /* Used by PM_ABE_MCBSP2_WKDEP */ | 1806 | /* Used by PM_ABE_MCBSP2_WKDEP */ |
1807 | #define OMAP4430_WKUPDEP_MCBSP2_SDMA_SHIFT (1 << 3) | 1807 | #define OMAP4430_WKUPDEP_MCBSP2_SDMA_SHIFT 3 |
1808 | #define OMAP4430_WKUPDEP_MCBSP2_SDMA_MASK BITFIELD(3, 3) | 1808 | #define OMAP4430_WKUPDEP_MCBSP2_SDMA_MASK BITFIELD(3, 3) |
1809 | 1809 | ||
1810 | /* Used by PM_ABE_MCBSP2_WKDEP */ | 1810 | /* Used by PM_ABE_MCBSP2_WKDEP */ |
1811 | #define OMAP4430_WKUPDEP_MCBSP2_TESLA_SHIFT (1 << 2) | 1811 | #define OMAP4430_WKUPDEP_MCBSP2_TESLA_SHIFT 2 |
1812 | #define OMAP4430_WKUPDEP_MCBSP2_TESLA_MASK BITFIELD(2, 2) | 1812 | #define OMAP4430_WKUPDEP_MCBSP2_TESLA_MASK BITFIELD(2, 2) |
1813 | 1813 | ||
1814 | /* Used by PM_ABE_MCBSP3_WKDEP */ | 1814 | /* Used by PM_ABE_MCBSP3_WKDEP */ |
1815 | #define OMAP4430_WKUPDEP_MCBSP3_MPU_SHIFT (1 << 0) | 1815 | #define OMAP4430_WKUPDEP_MCBSP3_MPU_SHIFT 0 |
1816 | #define OMAP4430_WKUPDEP_MCBSP3_MPU_MASK BITFIELD(0, 0) | 1816 | #define OMAP4430_WKUPDEP_MCBSP3_MPU_MASK BITFIELD(0, 0) |
1817 | 1817 | ||
1818 | /* Used by PM_ABE_MCBSP3_WKDEP */ | 1818 | /* Used by PM_ABE_MCBSP3_WKDEP */ |
1819 | #define OMAP4430_WKUPDEP_MCBSP3_SDMA_SHIFT (1 << 3) | 1819 | #define OMAP4430_WKUPDEP_MCBSP3_SDMA_SHIFT 3 |
1820 | #define OMAP4430_WKUPDEP_MCBSP3_SDMA_MASK BITFIELD(3, 3) | 1820 | #define OMAP4430_WKUPDEP_MCBSP3_SDMA_MASK BITFIELD(3, 3) |
1821 | 1821 | ||
1822 | /* Used by PM_ABE_MCBSP3_WKDEP */ | 1822 | /* Used by PM_ABE_MCBSP3_WKDEP */ |
1823 | #define OMAP4430_WKUPDEP_MCBSP3_TESLA_SHIFT (1 << 2) | 1823 | #define OMAP4430_WKUPDEP_MCBSP3_TESLA_SHIFT 2 |
1824 | #define OMAP4430_WKUPDEP_MCBSP3_TESLA_MASK BITFIELD(2, 2) | 1824 | #define OMAP4430_WKUPDEP_MCBSP3_TESLA_MASK BITFIELD(2, 2) |
1825 | 1825 | ||
1826 | /* Used by PM_L4PER_MCBSP4_WKDEP */ | 1826 | /* Used by PM_L4PER_MCBSP4_WKDEP */ |
1827 | #define OMAP4430_WKUPDEP_MCBSP4_MPU_SHIFT (1 << 0) | 1827 | #define OMAP4430_WKUPDEP_MCBSP4_MPU_SHIFT 0 |
1828 | #define OMAP4430_WKUPDEP_MCBSP4_MPU_MASK BITFIELD(0, 0) | 1828 | #define OMAP4430_WKUPDEP_MCBSP4_MPU_MASK BITFIELD(0, 0) |
1829 | 1829 | ||
1830 | /* Used by PM_L4PER_MCBSP4_WKDEP */ | 1830 | /* Used by PM_L4PER_MCBSP4_WKDEP */ |
1831 | #define OMAP4430_WKUPDEP_MCBSP4_SDMA_SHIFT (1 << 3) | 1831 | #define OMAP4430_WKUPDEP_MCBSP4_SDMA_SHIFT 3 |
1832 | #define OMAP4430_WKUPDEP_MCBSP4_SDMA_MASK BITFIELD(3, 3) | 1832 | #define OMAP4430_WKUPDEP_MCBSP4_SDMA_MASK BITFIELD(3, 3) |
1833 | 1833 | ||
1834 | /* Used by PM_L4PER_MCBSP4_WKDEP */ | 1834 | /* Used by PM_L4PER_MCBSP4_WKDEP */ |
1835 | #define OMAP4430_WKUPDEP_MCBSP4_TESLA_SHIFT (1 << 2) | 1835 | #define OMAP4430_WKUPDEP_MCBSP4_TESLA_SHIFT 2 |
1836 | #define OMAP4430_WKUPDEP_MCBSP4_TESLA_MASK BITFIELD(2, 2) | 1836 | #define OMAP4430_WKUPDEP_MCBSP4_TESLA_MASK BITFIELD(2, 2) |
1837 | 1837 | ||
1838 | /* Used by PM_L4PER_MCSPI1_WKDEP */ | 1838 | /* Used by PM_L4PER_MCSPI1_WKDEP */ |
1839 | #define OMAP4430_WKUPDEP_MCSPI1_DUCATI_SHIFT (1 << 1) | 1839 | #define OMAP4430_WKUPDEP_MCSPI1_DUCATI_SHIFT 1 |
1840 | #define OMAP4430_WKUPDEP_MCSPI1_DUCATI_MASK BITFIELD(1, 1) | 1840 | #define OMAP4430_WKUPDEP_MCSPI1_DUCATI_MASK BITFIELD(1, 1) |
1841 | 1841 | ||
1842 | /* Used by PM_L4PER_MCSPI1_WKDEP */ | 1842 | /* Used by PM_L4PER_MCSPI1_WKDEP */ |
1843 | #define OMAP4430_WKUPDEP_MCSPI1_MPU_SHIFT (1 << 0) | 1843 | #define OMAP4430_WKUPDEP_MCSPI1_MPU_SHIFT 0 |
1844 | #define OMAP4430_WKUPDEP_MCSPI1_MPU_MASK BITFIELD(0, 0) | 1844 | #define OMAP4430_WKUPDEP_MCSPI1_MPU_MASK BITFIELD(0, 0) |
1845 | 1845 | ||
1846 | /* Used by PM_L4PER_MCSPI1_WKDEP */ | 1846 | /* Used by PM_L4PER_MCSPI1_WKDEP */ |
1847 | #define OMAP4430_WKUPDEP_MCSPI1_SDMA_SHIFT (1 << 3) | 1847 | #define OMAP4430_WKUPDEP_MCSPI1_SDMA_SHIFT 3 |
1848 | #define OMAP4430_WKUPDEP_MCSPI1_SDMA_MASK BITFIELD(3, 3) | 1848 | #define OMAP4430_WKUPDEP_MCSPI1_SDMA_MASK BITFIELD(3, 3) |
1849 | 1849 | ||
1850 | /* Used by PM_L4PER_MCSPI1_WKDEP */ | 1850 | /* Used by PM_L4PER_MCSPI1_WKDEP */ |
1851 | #define OMAP4430_WKUPDEP_MCSPI1_TESLA_SHIFT (1 << 2) | 1851 | #define OMAP4430_WKUPDEP_MCSPI1_TESLA_SHIFT 2 |
1852 | #define OMAP4430_WKUPDEP_MCSPI1_TESLA_MASK BITFIELD(2, 2) | 1852 | #define OMAP4430_WKUPDEP_MCSPI1_TESLA_MASK BITFIELD(2, 2) |
1853 | 1853 | ||
1854 | /* Used by PM_L4PER_MCSPI2_WKDEP */ | 1854 | /* Used by PM_L4PER_MCSPI2_WKDEP */ |
1855 | #define OMAP4430_WKUPDEP_MCSPI2_DUCATI_SHIFT (1 << 1) | 1855 | #define OMAP4430_WKUPDEP_MCSPI2_DUCATI_SHIFT 1 |
1856 | #define OMAP4430_WKUPDEP_MCSPI2_DUCATI_MASK BITFIELD(1, 1) | 1856 | #define OMAP4430_WKUPDEP_MCSPI2_DUCATI_MASK BITFIELD(1, 1) |
1857 | 1857 | ||
1858 | /* Used by PM_L4PER_MCSPI2_WKDEP */ | 1858 | /* Used by PM_L4PER_MCSPI2_WKDEP */ |
1859 | #define OMAP4430_WKUPDEP_MCSPI2_MPU_SHIFT (1 << 0) | 1859 | #define OMAP4430_WKUPDEP_MCSPI2_MPU_SHIFT 0 |
1860 | #define OMAP4430_WKUPDEP_MCSPI2_MPU_MASK BITFIELD(0, 0) | 1860 | #define OMAP4430_WKUPDEP_MCSPI2_MPU_MASK BITFIELD(0, 0) |
1861 | 1861 | ||
1862 | /* Used by PM_L4PER_MCSPI2_WKDEP */ | 1862 | /* Used by PM_L4PER_MCSPI2_WKDEP */ |
1863 | #define OMAP4430_WKUPDEP_MCSPI2_SDMA_SHIFT (1 << 3) | 1863 | #define OMAP4430_WKUPDEP_MCSPI2_SDMA_SHIFT 3 |
1864 | #define OMAP4430_WKUPDEP_MCSPI2_SDMA_MASK BITFIELD(3, 3) | 1864 | #define OMAP4430_WKUPDEP_MCSPI2_SDMA_MASK BITFIELD(3, 3) |
1865 | 1865 | ||
1866 | /* Used by PM_L4PER_MCSPI3_WKDEP */ | 1866 | /* Used by PM_L4PER_MCSPI3_WKDEP */ |
1867 | #define OMAP4430_WKUPDEP_MCSPI3_MPU_SHIFT (1 << 0) | 1867 | #define OMAP4430_WKUPDEP_MCSPI3_MPU_SHIFT 0 |
1868 | #define OMAP4430_WKUPDEP_MCSPI3_MPU_MASK BITFIELD(0, 0) | 1868 | #define OMAP4430_WKUPDEP_MCSPI3_MPU_MASK BITFIELD(0, 0) |
1869 | 1869 | ||
1870 | /* Used by PM_L4PER_MCSPI3_WKDEP */ | 1870 | /* Used by PM_L4PER_MCSPI3_WKDEP */ |
1871 | #define OMAP4430_WKUPDEP_MCSPI3_SDMA_SHIFT (1 << 3) | 1871 | #define OMAP4430_WKUPDEP_MCSPI3_SDMA_SHIFT 3 |
1872 | #define OMAP4430_WKUPDEP_MCSPI3_SDMA_MASK BITFIELD(3, 3) | 1872 | #define OMAP4430_WKUPDEP_MCSPI3_SDMA_MASK BITFIELD(3, 3) |
1873 | 1873 | ||
1874 | /* Used by PM_L4PER_MCSPI4_WKDEP */ | 1874 | /* Used by PM_L4PER_MCSPI4_WKDEP */ |
1875 | #define OMAP4430_WKUPDEP_MCSPI4_MPU_SHIFT (1 << 0) | 1875 | #define OMAP4430_WKUPDEP_MCSPI4_MPU_SHIFT 0 |
1876 | #define OMAP4430_WKUPDEP_MCSPI4_MPU_MASK BITFIELD(0, 0) | 1876 | #define OMAP4430_WKUPDEP_MCSPI4_MPU_MASK BITFIELD(0, 0) |
1877 | 1877 | ||
1878 | /* Used by PM_L4PER_MCSPI4_WKDEP */ | 1878 | /* Used by PM_L4PER_MCSPI4_WKDEP */ |
1879 | #define OMAP4430_WKUPDEP_MCSPI4_SDMA_SHIFT (1 << 3) | 1879 | #define OMAP4430_WKUPDEP_MCSPI4_SDMA_SHIFT 3 |
1880 | #define OMAP4430_WKUPDEP_MCSPI4_SDMA_MASK BITFIELD(3, 3) | 1880 | #define OMAP4430_WKUPDEP_MCSPI4_SDMA_MASK BITFIELD(3, 3) |
1881 | 1881 | ||
1882 | /* Used by PM_L3INIT_MMC1_WKDEP */ | 1882 | /* Used by PM_L3INIT_MMC1_WKDEP */ |
1883 | #define OMAP4430_WKUPDEP_MMC1_DUCATI_SHIFT (1 << 1) | 1883 | #define OMAP4430_WKUPDEP_MMC1_DUCATI_SHIFT 1 |
1884 | #define OMAP4430_WKUPDEP_MMC1_DUCATI_MASK BITFIELD(1, 1) | 1884 | #define OMAP4430_WKUPDEP_MMC1_DUCATI_MASK BITFIELD(1, 1) |
1885 | 1885 | ||
1886 | /* Used by PM_L3INIT_MMC1_WKDEP */ | 1886 | /* Used by PM_L3INIT_MMC1_WKDEP */ |
1887 | #define OMAP4430_WKUPDEP_MMC1_MPU_SHIFT (1 << 0) | 1887 | #define OMAP4430_WKUPDEP_MMC1_MPU_SHIFT 0 |
1888 | #define OMAP4430_WKUPDEP_MMC1_MPU_MASK BITFIELD(0, 0) | 1888 | #define OMAP4430_WKUPDEP_MMC1_MPU_MASK BITFIELD(0, 0) |
1889 | 1889 | ||
1890 | /* Used by PM_L3INIT_MMC1_WKDEP */ | 1890 | /* Used by PM_L3INIT_MMC1_WKDEP */ |
1891 | #define OMAP4430_WKUPDEP_MMC1_SDMA_SHIFT (1 << 3) | 1891 | #define OMAP4430_WKUPDEP_MMC1_SDMA_SHIFT 3 |
1892 | #define OMAP4430_WKUPDEP_MMC1_SDMA_MASK BITFIELD(3, 3) | 1892 | #define OMAP4430_WKUPDEP_MMC1_SDMA_MASK BITFIELD(3, 3) |
1893 | 1893 | ||
1894 | /* Used by PM_L3INIT_MMC1_WKDEP */ | 1894 | /* Used by PM_L3INIT_MMC1_WKDEP */ |
1895 | #define OMAP4430_WKUPDEP_MMC1_TESLA_SHIFT (1 << 2) | 1895 | #define OMAP4430_WKUPDEP_MMC1_TESLA_SHIFT 2 |
1896 | #define OMAP4430_WKUPDEP_MMC1_TESLA_MASK BITFIELD(2, 2) | 1896 | #define OMAP4430_WKUPDEP_MMC1_TESLA_MASK BITFIELD(2, 2) |
1897 | 1897 | ||
1898 | /* Used by PM_L3INIT_MMC2_WKDEP */ | 1898 | /* Used by PM_L3INIT_MMC2_WKDEP */ |
1899 | #define OMAP4430_WKUPDEP_MMC2_DUCATI_SHIFT (1 << 1) | 1899 | #define OMAP4430_WKUPDEP_MMC2_DUCATI_SHIFT 1 |
1900 | #define OMAP4430_WKUPDEP_MMC2_DUCATI_MASK BITFIELD(1, 1) | 1900 | #define OMAP4430_WKUPDEP_MMC2_DUCATI_MASK BITFIELD(1, 1) |
1901 | 1901 | ||
1902 | /* Used by PM_L3INIT_MMC2_WKDEP */ | 1902 | /* Used by PM_L3INIT_MMC2_WKDEP */ |
1903 | #define OMAP4430_WKUPDEP_MMC2_MPU_SHIFT (1 << 0) | 1903 | #define OMAP4430_WKUPDEP_MMC2_MPU_SHIFT 0 |
1904 | #define OMAP4430_WKUPDEP_MMC2_MPU_MASK BITFIELD(0, 0) | 1904 | #define OMAP4430_WKUPDEP_MMC2_MPU_MASK BITFIELD(0, 0) |
1905 | 1905 | ||
1906 | /* Used by PM_L3INIT_MMC2_WKDEP */ | 1906 | /* Used by PM_L3INIT_MMC2_WKDEP */ |
1907 | #define OMAP4430_WKUPDEP_MMC2_SDMA_SHIFT (1 << 3) | 1907 | #define OMAP4430_WKUPDEP_MMC2_SDMA_SHIFT 3 |
1908 | #define OMAP4430_WKUPDEP_MMC2_SDMA_MASK BITFIELD(3, 3) | 1908 | #define OMAP4430_WKUPDEP_MMC2_SDMA_MASK BITFIELD(3, 3) |
1909 | 1909 | ||
1910 | /* Used by PM_L3INIT_MMC2_WKDEP */ | 1910 | /* Used by PM_L3INIT_MMC2_WKDEP */ |
1911 | #define OMAP4430_WKUPDEP_MMC2_TESLA_SHIFT (1 << 2) | 1911 | #define OMAP4430_WKUPDEP_MMC2_TESLA_SHIFT 2 |
1912 | #define OMAP4430_WKUPDEP_MMC2_TESLA_MASK BITFIELD(2, 2) | 1912 | #define OMAP4430_WKUPDEP_MMC2_TESLA_MASK BITFIELD(2, 2) |
1913 | 1913 | ||
1914 | /* Used by PM_L3INIT_MMC6_WKDEP */ | 1914 | /* Used by PM_L3INIT_MMC6_WKDEP */ |
1915 | #define OMAP4430_WKUPDEP_MMC6_DUCATI_SHIFT (1 << 1) | 1915 | #define OMAP4430_WKUPDEP_MMC6_DUCATI_SHIFT 1 |
1916 | #define OMAP4430_WKUPDEP_MMC6_DUCATI_MASK BITFIELD(1, 1) | 1916 | #define OMAP4430_WKUPDEP_MMC6_DUCATI_MASK BITFIELD(1, 1) |
1917 | 1917 | ||
1918 | /* Used by PM_L3INIT_MMC6_WKDEP */ | 1918 | /* Used by PM_L3INIT_MMC6_WKDEP */ |
1919 | #define OMAP4430_WKUPDEP_MMC6_MPU_SHIFT (1 << 0) | 1919 | #define OMAP4430_WKUPDEP_MMC6_MPU_SHIFT 0 |
1920 | #define OMAP4430_WKUPDEP_MMC6_MPU_MASK BITFIELD(0, 0) | 1920 | #define OMAP4430_WKUPDEP_MMC6_MPU_MASK BITFIELD(0, 0) |
1921 | 1921 | ||
1922 | /* Used by PM_L3INIT_MMC6_WKDEP */ | 1922 | /* Used by PM_L3INIT_MMC6_WKDEP */ |
1923 | #define OMAP4430_WKUPDEP_MMC6_TESLA_SHIFT (1 << 2) | 1923 | #define OMAP4430_WKUPDEP_MMC6_TESLA_SHIFT 2 |
1924 | #define OMAP4430_WKUPDEP_MMC6_TESLA_MASK BITFIELD(2, 2) | 1924 | #define OMAP4430_WKUPDEP_MMC6_TESLA_MASK BITFIELD(2, 2) |
1925 | 1925 | ||
1926 | /* Used by PM_L4PER_MMCSD3_WKDEP */ | 1926 | /* Used by PM_L4PER_MMCSD3_WKDEP */ |
1927 | #define OMAP4430_WKUPDEP_MMCSD3_DUCATI_SHIFT (1 << 1) | 1927 | #define OMAP4430_WKUPDEP_MMCSD3_DUCATI_SHIFT 1 |
1928 | #define OMAP4430_WKUPDEP_MMCSD3_DUCATI_MASK BITFIELD(1, 1) | 1928 | #define OMAP4430_WKUPDEP_MMCSD3_DUCATI_MASK BITFIELD(1, 1) |
1929 | 1929 | ||
1930 | /* Used by PM_L4PER_MMCSD3_WKDEP */ | 1930 | /* Used by PM_L4PER_MMCSD3_WKDEP */ |
1931 | #define OMAP4430_WKUPDEP_MMCSD3_MPU_SHIFT (1 << 0) | 1931 | #define OMAP4430_WKUPDEP_MMCSD3_MPU_SHIFT 0 |
1932 | #define OMAP4430_WKUPDEP_MMCSD3_MPU_MASK BITFIELD(0, 0) | 1932 | #define OMAP4430_WKUPDEP_MMCSD3_MPU_MASK BITFIELD(0, 0) |
1933 | 1933 | ||
1934 | /* Used by PM_L4PER_MMCSD3_WKDEP */ | 1934 | /* Used by PM_L4PER_MMCSD3_WKDEP */ |
1935 | #define OMAP4430_WKUPDEP_MMCSD3_SDMA_SHIFT (1 << 3) | 1935 | #define OMAP4430_WKUPDEP_MMCSD3_SDMA_SHIFT 3 |
1936 | #define OMAP4430_WKUPDEP_MMCSD3_SDMA_MASK BITFIELD(3, 3) | 1936 | #define OMAP4430_WKUPDEP_MMCSD3_SDMA_MASK BITFIELD(3, 3) |
1937 | 1937 | ||
1938 | /* Used by PM_L4PER_MMCSD4_WKDEP */ | 1938 | /* Used by PM_L4PER_MMCSD4_WKDEP */ |
1939 | #define OMAP4430_WKUPDEP_MMCSD4_DUCATI_SHIFT (1 << 1) | 1939 | #define OMAP4430_WKUPDEP_MMCSD4_DUCATI_SHIFT 1 |
1940 | #define OMAP4430_WKUPDEP_MMCSD4_DUCATI_MASK BITFIELD(1, 1) | 1940 | #define OMAP4430_WKUPDEP_MMCSD4_DUCATI_MASK BITFIELD(1, 1) |
1941 | 1941 | ||
1942 | /* Used by PM_L4PER_MMCSD4_WKDEP */ | 1942 | /* Used by PM_L4PER_MMCSD4_WKDEP */ |
1943 | #define OMAP4430_WKUPDEP_MMCSD4_MPU_SHIFT (1 << 0) | 1943 | #define OMAP4430_WKUPDEP_MMCSD4_MPU_SHIFT 0 |
1944 | #define OMAP4430_WKUPDEP_MMCSD4_MPU_MASK BITFIELD(0, 0) | 1944 | #define OMAP4430_WKUPDEP_MMCSD4_MPU_MASK BITFIELD(0, 0) |
1945 | 1945 | ||
1946 | /* Used by PM_L4PER_MMCSD4_WKDEP */ | 1946 | /* Used by PM_L4PER_MMCSD4_WKDEP */ |
1947 | #define OMAP4430_WKUPDEP_MMCSD4_SDMA_SHIFT (1 << 3) | 1947 | #define OMAP4430_WKUPDEP_MMCSD4_SDMA_SHIFT 3 |
1948 | #define OMAP4430_WKUPDEP_MMCSD4_SDMA_MASK BITFIELD(3, 3) | 1948 | #define OMAP4430_WKUPDEP_MMCSD4_SDMA_MASK BITFIELD(3, 3) |
1949 | 1949 | ||
1950 | /* Used by PM_L4PER_MMCSD5_WKDEP */ | 1950 | /* Used by PM_L4PER_MMCSD5_WKDEP */ |
1951 | #define OMAP4430_WKUPDEP_MMCSD5_DUCATI_SHIFT (1 << 1) | 1951 | #define OMAP4430_WKUPDEP_MMCSD5_DUCATI_SHIFT 1 |
1952 | #define OMAP4430_WKUPDEP_MMCSD5_DUCATI_MASK BITFIELD(1, 1) | 1952 | #define OMAP4430_WKUPDEP_MMCSD5_DUCATI_MASK BITFIELD(1, 1) |
1953 | 1953 | ||
1954 | /* Used by PM_L4PER_MMCSD5_WKDEP */ | 1954 | /* Used by PM_L4PER_MMCSD5_WKDEP */ |
1955 | #define OMAP4430_WKUPDEP_MMCSD5_MPU_SHIFT (1 << 0) | 1955 | #define OMAP4430_WKUPDEP_MMCSD5_MPU_SHIFT 0 |
1956 | #define OMAP4430_WKUPDEP_MMCSD5_MPU_MASK BITFIELD(0, 0) | 1956 | #define OMAP4430_WKUPDEP_MMCSD5_MPU_MASK BITFIELD(0, 0) |
1957 | 1957 | ||
1958 | /* Used by PM_L4PER_MMCSD5_WKDEP */ | 1958 | /* Used by PM_L4PER_MMCSD5_WKDEP */ |
1959 | #define OMAP4430_WKUPDEP_MMCSD5_SDMA_SHIFT (1 << 3) | 1959 | #define OMAP4430_WKUPDEP_MMCSD5_SDMA_SHIFT 3 |
1960 | #define OMAP4430_WKUPDEP_MMCSD5_SDMA_MASK BITFIELD(3, 3) | 1960 | #define OMAP4430_WKUPDEP_MMCSD5_SDMA_MASK BITFIELD(3, 3) |
1961 | 1961 | ||
1962 | /* Used by PM_L3INIT_PCIESS_WKDEP */ | 1962 | /* Used by PM_L3INIT_PCIESS_WKDEP */ |
1963 | #define OMAP4430_WKUPDEP_PCIESS_MPU_SHIFT (1 << 0) | 1963 | #define OMAP4430_WKUPDEP_PCIESS_MPU_SHIFT 0 |
1964 | #define OMAP4430_WKUPDEP_PCIESS_MPU_MASK BITFIELD(0, 0) | 1964 | #define OMAP4430_WKUPDEP_PCIESS_MPU_MASK BITFIELD(0, 0) |
1965 | 1965 | ||
1966 | /* Used by PM_L3INIT_PCIESS_WKDEP */ | 1966 | /* Used by PM_L3INIT_PCIESS_WKDEP */ |
1967 | #define OMAP4430_WKUPDEP_PCIESS_TESLA_SHIFT (1 << 2) | 1967 | #define OMAP4430_WKUPDEP_PCIESS_TESLA_SHIFT 2 |
1968 | #define OMAP4430_WKUPDEP_PCIESS_TESLA_MASK BITFIELD(2, 2) | 1968 | #define OMAP4430_WKUPDEP_PCIESS_TESLA_MASK BITFIELD(2, 2) |
1969 | 1969 | ||
1970 | /* Used by PM_ABE_PDM_WKDEP */ | 1970 | /* Used by PM_ABE_PDM_WKDEP */ |
1971 | #define OMAP4430_WKUPDEP_PDM_DMA_SDMA_SHIFT (1 << 7) | 1971 | #define OMAP4430_WKUPDEP_PDM_DMA_SDMA_SHIFT 7 |
1972 | #define OMAP4430_WKUPDEP_PDM_DMA_SDMA_MASK BITFIELD(7, 7) | 1972 | #define OMAP4430_WKUPDEP_PDM_DMA_SDMA_MASK BITFIELD(7, 7) |
1973 | 1973 | ||
1974 | /* Used by PM_ABE_PDM_WKDEP */ | 1974 | /* Used by PM_ABE_PDM_WKDEP */ |
1975 | #define OMAP4430_WKUPDEP_PDM_DMA_TESLA_SHIFT (1 << 6) | 1975 | #define OMAP4430_WKUPDEP_PDM_DMA_TESLA_SHIFT 6 |
1976 | #define OMAP4430_WKUPDEP_PDM_DMA_TESLA_MASK BITFIELD(6, 6) | 1976 | #define OMAP4430_WKUPDEP_PDM_DMA_TESLA_MASK BITFIELD(6, 6) |
1977 | 1977 | ||
1978 | /* Used by PM_ABE_PDM_WKDEP */ | 1978 | /* Used by PM_ABE_PDM_WKDEP */ |
1979 | #define OMAP4430_WKUPDEP_PDM_IRQ_MPU_SHIFT (1 << 0) | 1979 | #define OMAP4430_WKUPDEP_PDM_IRQ_MPU_SHIFT 0 |
1980 | #define OMAP4430_WKUPDEP_PDM_IRQ_MPU_MASK BITFIELD(0, 0) | 1980 | #define OMAP4430_WKUPDEP_PDM_IRQ_MPU_MASK BITFIELD(0, 0) |
1981 | 1981 | ||
1982 | /* Used by PM_ABE_PDM_WKDEP */ | 1982 | /* Used by PM_ABE_PDM_WKDEP */ |
1983 | #define OMAP4430_WKUPDEP_PDM_IRQ_TESLA_SHIFT (1 << 2) | 1983 | #define OMAP4430_WKUPDEP_PDM_IRQ_TESLA_SHIFT 2 |
1984 | #define OMAP4430_WKUPDEP_PDM_IRQ_TESLA_MASK BITFIELD(2, 2) | 1984 | #define OMAP4430_WKUPDEP_PDM_IRQ_TESLA_MASK BITFIELD(2, 2) |
1985 | 1985 | ||
1986 | /* Used by PM_WKUP_RTC_WKDEP */ | 1986 | /* Used by PM_WKUP_RTC_WKDEP */ |
1987 | #define OMAP4430_WKUPDEP_RTC_MPU_SHIFT (1 << 0) | 1987 | #define OMAP4430_WKUPDEP_RTC_MPU_SHIFT 0 |
1988 | #define OMAP4430_WKUPDEP_RTC_MPU_MASK BITFIELD(0, 0) | 1988 | #define OMAP4430_WKUPDEP_RTC_MPU_MASK BITFIELD(0, 0) |
1989 | 1989 | ||
1990 | /* Used by PM_L3INIT_SATA_WKDEP */ | 1990 | /* Used by PM_L3INIT_SATA_WKDEP */ |
1991 | #define OMAP4430_WKUPDEP_SATA_MPU_SHIFT (1 << 0) | 1991 | #define OMAP4430_WKUPDEP_SATA_MPU_SHIFT 0 |
1992 | #define OMAP4430_WKUPDEP_SATA_MPU_MASK BITFIELD(0, 0) | 1992 | #define OMAP4430_WKUPDEP_SATA_MPU_MASK BITFIELD(0, 0) |
1993 | 1993 | ||
1994 | /* Used by PM_L3INIT_SATA_WKDEP */ | 1994 | /* Used by PM_L3INIT_SATA_WKDEP */ |
1995 | #define OMAP4430_WKUPDEP_SATA_TESLA_SHIFT (1 << 2) | 1995 | #define OMAP4430_WKUPDEP_SATA_TESLA_SHIFT 2 |
1996 | #define OMAP4430_WKUPDEP_SATA_TESLA_MASK BITFIELD(2, 2) | 1996 | #define OMAP4430_WKUPDEP_SATA_TESLA_MASK BITFIELD(2, 2) |
1997 | 1997 | ||
1998 | /* Used by PM_ABE_SLIMBUS_WKDEP */ | 1998 | /* Used by PM_ABE_SLIMBUS_WKDEP */ |
1999 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_SDMA_SHIFT (1 << 7) | 1999 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_SDMA_SHIFT 7 |
2000 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_SDMA_MASK BITFIELD(7, 7) | 2000 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_SDMA_MASK BITFIELD(7, 7) |
2001 | 2001 | ||
2002 | /* Used by PM_ABE_SLIMBUS_WKDEP */ | 2002 | /* Used by PM_ABE_SLIMBUS_WKDEP */ |
2003 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_TESLA_SHIFT (1 << 6) | 2003 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_TESLA_SHIFT 6 |
2004 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_TESLA_MASK BITFIELD(6, 6) | 2004 | #define OMAP4430_WKUPDEP_SLIMBUS1_DMA_TESLA_MASK BITFIELD(6, 6) |
2005 | 2005 | ||
2006 | /* Used by PM_ABE_SLIMBUS_WKDEP */ | 2006 | /* Used by PM_ABE_SLIMBUS_WKDEP */ |
2007 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_MPU_SHIFT (1 << 0) | 2007 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_MPU_SHIFT 0 |
2008 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_MPU_MASK BITFIELD(0, 0) | 2008 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_MPU_MASK BITFIELD(0, 0) |
2009 | 2009 | ||
2010 | /* Used by PM_ABE_SLIMBUS_WKDEP */ | 2010 | /* Used by PM_ABE_SLIMBUS_WKDEP */ |
2011 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_TESLA_SHIFT (1 << 2) | 2011 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_TESLA_SHIFT 2 |
2012 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_TESLA_MASK BITFIELD(2, 2) | 2012 | #define OMAP4430_WKUPDEP_SLIMBUS1_IRQ_TESLA_MASK BITFIELD(2, 2) |
2013 | 2013 | ||
2014 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ | 2014 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ |
2015 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_SDMA_SHIFT (1 << 7) | 2015 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_SDMA_SHIFT 7 |
2016 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_SDMA_MASK BITFIELD(7, 7) | 2016 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_SDMA_MASK BITFIELD(7, 7) |
2017 | 2017 | ||
2018 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ | 2018 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ |
2019 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_TESLA_SHIFT (1 << 6) | 2019 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_TESLA_SHIFT 6 |
2020 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_TESLA_MASK BITFIELD(6, 6) | 2020 | #define OMAP4430_WKUPDEP_SLIMBUS2_DMA_TESLA_MASK BITFIELD(6, 6) |
2021 | 2021 | ||
2022 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ | 2022 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ |
2023 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_MPU_SHIFT (1 << 0) | 2023 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_MPU_SHIFT 0 |
2024 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_MPU_MASK BITFIELD(0, 0) | 2024 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_MPU_MASK BITFIELD(0, 0) |
2025 | 2025 | ||
2026 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ | 2026 | /* Used by PM_L4PER_SLIMBUS2_WKDEP */ |
2027 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_TESLA_SHIFT (1 << 2) | 2027 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_TESLA_SHIFT 2 |
2028 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_TESLA_MASK BITFIELD(2, 2) | 2028 | #define OMAP4430_WKUPDEP_SLIMBUS2_IRQ_TESLA_MASK BITFIELD(2, 2) |
2029 | 2029 | ||
2030 | /* Used by PM_ALWON_SR_CORE_WKDEP */ | 2030 | /* Used by PM_ALWON_SR_CORE_WKDEP */ |
2031 | #define OMAP4430_WKUPDEP_SR_CORE_DUCATI_SHIFT (1 << 1) | 2031 | #define OMAP4430_WKUPDEP_SR_CORE_DUCATI_SHIFT 1 |
2032 | #define OMAP4430_WKUPDEP_SR_CORE_DUCATI_MASK BITFIELD(1, 1) | 2032 | #define OMAP4430_WKUPDEP_SR_CORE_DUCATI_MASK BITFIELD(1, 1) |
2033 | 2033 | ||
2034 | /* Used by PM_ALWON_SR_CORE_WKDEP */ | 2034 | /* Used by PM_ALWON_SR_CORE_WKDEP */ |
2035 | #define OMAP4430_WKUPDEP_SR_CORE_MPU_SHIFT (1 << 0) | 2035 | #define OMAP4430_WKUPDEP_SR_CORE_MPU_SHIFT 0 |
2036 | #define OMAP4430_WKUPDEP_SR_CORE_MPU_MASK BITFIELD(0, 0) | 2036 | #define OMAP4430_WKUPDEP_SR_CORE_MPU_MASK BITFIELD(0, 0) |
2037 | 2037 | ||
2038 | /* Used by PM_ALWON_SR_IVA_WKDEP */ | 2038 | /* Used by PM_ALWON_SR_IVA_WKDEP */ |
2039 | #define OMAP4430_WKUPDEP_SR_IVA_DUCATI_SHIFT (1 << 1) | 2039 | #define OMAP4430_WKUPDEP_SR_IVA_DUCATI_SHIFT 1 |
2040 | #define OMAP4430_WKUPDEP_SR_IVA_DUCATI_MASK BITFIELD(1, 1) | 2040 | #define OMAP4430_WKUPDEP_SR_IVA_DUCATI_MASK BITFIELD(1, 1) |
2041 | 2041 | ||
2042 | /* Used by PM_ALWON_SR_IVA_WKDEP */ | 2042 | /* Used by PM_ALWON_SR_IVA_WKDEP */ |
2043 | #define OMAP4430_WKUPDEP_SR_IVA_MPU_SHIFT (1 << 0) | 2043 | #define OMAP4430_WKUPDEP_SR_IVA_MPU_SHIFT 0 |
2044 | #define OMAP4430_WKUPDEP_SR_IVA_MPU_MASK BITFIELD(0, 0) | 2044 | #define OMAP4430_WKUPDEP_SR_IVA_MPU_MASK BITFIELD(0, 0) |
2045 | 2045 | ||
2046 | /* Used by PM_ALWON_SR_MPU_WKDEP */ | 2046 | /* Used by PM_ALWON_SR_MPU_WKDEP */ |
2047 | #define OMAP4430_WKUPDEP_SR_MPU_MPU_SHIFT (1 << 0) | 2047 | #define OMAP4430_WKUPDEP_SR_MPU_MPU_SHIFT 0 |
2048 | #define OMAP4430_WKUPDEP_SR_MPU_MPU_MASK BITFIELD(0, 0) | 2048 | #define OMAP4430_WKUPDEP_SR_MPU_MPU_MASK BITFIELD(0, 0) |
2049 | 2049 | ||
2050 | /* Used by PM_WKUP_TIMER12_WKDEP */ | 2050 | /* Used by PM_WKUP_TIMER12_WKDEP */ |
2051 | #define OMAP4430_WKUPDEP_TIMER12_MPU_SHIFT (1 << 0) | 2051 | #define OMAP4430_WKUPDEP_TIMER12_MPU_SHIFT 0 |
2052 | #define OMAP4430_WKUPDEP_TIMER12_MPU_MASK BITFIELD(0, 0) | 2052 | #define OMAP4430_WKUPDEP_TIMER12_MPU_MASK BITFIELD(0, 0) |
2053 | 2053 | ||
2054 | /* Used by PM_WKUP_TIMER1_WKDEP */ | 2054 | /* Used by PM_WKUP_TIMER1_WKDEP */ |
2055 | #define OMAP4430_WKUPDEP_TIMER1_MPU_SHIFT (1 << 0) | 2055 | #define OMAP4430_WKUPDEP_TIMER1_MPU_SHIFT 0 |
2056 | #define OMAP4430_WKUPDEP_TIMER1_MPU_MASK BITFIELD(0, 0) | 2056 | #define OMAP4430_WKUPDEP_TIMER1_MPU_MASK BITFIELD(0, 0) |
2057 | 2057 | ||
2058 | /* Used by PM_ABE_TIMER5_WKDEP */ | 2058 | /* Used by PM_ABE_TIMER5_WKDEP */ |
2059 | #define OMAP4430_WKUPDEP_TIMER5_MPU_SHIFT (1 << 0) | 2059 | #define OMAP4430_WKUPDEP_TIMER5_MPU_SHIFT 0 |
2060 | #define OMAP4430_WKUPDEP_TIMER5_MPU_MASK BITFIELD(0, 0) | 2060 | #define OMAP4430_WKUPDEP_TIMER5_MPU_MASK BITFIELD(0, 0) |
2061 | 2061 | ||
2062 | /* Used by PM_ABE_TIMER5_WKDEP */ | 2062 | /* Used by PM_ABE_TIMER5_WKDEP */ |
2063 | #define OMAP4430_WKUPDEP_TIMER5_TESLA_SHIFT (1 << 2) | 2063 | #define OMAP4430_WKUPDEP_TIMER5_TESLA_SHIFT 2 |
2064 | #define OMAP4430_WKUPDEP_TIMER5_TESLA_MASK BITFIELD(2, 2) | 2064 | #define OMAP4430_WKUPDEP_TIMER5_TESLA_MASK BITFIELD(2, 2) |
2065 | 2065 | ||
2066 | /* Used by PM_ABE_TIMER6_WKDEP */ | 2066 | /* Used by PM_ABE_TIMER6_WKDEP */ |
2067 | #define OMAP4430_WKUPDEP_TIMER6_MPU_SHIFT (1 << 0) | 2067 | #define OMAP4430_WKUPDEP_TIMER6_MPU_SHIFT 0 |
2068 | #define OMAP4430_WKUPDEP_TIMER6_MPU_MASK BITFIELD(0, 0) | 2068 | #define OMAP4430_WKUPDEP_TIMER6_MPU_MASK BITFIELD(0, 0) |
2069 | 2069 | ||
2070 | /* Used by PM_ABE_TIMER6_WKDEP */ | 2070 | /* Used by PM_ABE_TIMER6_WKDEP */ |
2071 | #define OMAP4430_WKUPDEP_TIMER6_TESLA_SHIFT (1 << 2) | 2071 | #define OMAP4430_WKUPDEP_TIMER6_TESLA_SHIFT 2 |
2072 | #define OMAP4430_WKUPDEP_TIMER6_TESLA_MASK BITFIELD(2, 2) | 2072 | #define OMAP4430_WKUPDEP_TIMER6_TESLA_MASK BITFIELD(2, 2) |
2073 | 2073 | ||
2074 | /* Used by PM_ABE_TIMER7_WKDEP */ | 2074 | /* Used by PM_ABE_TIMER7_WKDEP */ |
2075 | #define OMAP4430_WKUPDEP_TIMER7_MPU_SHIFT (1 << 0) | 2075 | #define OMAP4430_WKUPDEP_TIMER7_MPU_SHIFT 0 |
2076 | #define OMAP4430_WKUPDEP_TIMER7_MPU_MASK BITFIELD(0, 0) | 2076 | #define OMAP4430_WKUPDEP_TIMER7_MPU_MASK BITFIELD(0, 0) |
2077 | 2077 | ||
2078 | /* Used by PM_ABE_TIMER7_WKDEP */ | 2078 | /* Used by PM_ABE_TIMER7_WKDEP */ |
2079 | #define OMAP4430_WKUPDEP_TIMER7_TESLA_SHIFT (1 << 2) | 2079 | #define OMAP4430_WKUPDEP_TIMER7_TESLA_SHIFT 2 |
2080 | #define OMAP4430_WKUPDEP_TIMER7_TESLA_MASK BITFIELD(2, 2) | 2080 | #define OMAP4430_WKUPDEP_TIMER7_TESLA_MASK BITFIELD(2, 2) |
2081 | 2081 | ||
2082 | /* Used by PM_ABE_TIMER8_WKDEP */ | 2082 | /* Used by PM_ABE_TIMER8_WKDEP */ |
2083 | #define OMAP4430_WKUPDEP_TIMER8_MPU_SHIFT (1 << 0) | 2083 | #define OMAP4430_WKUPDEP_TIMER8_MPU_SHIFT 0 |
2084 | #define OMAP4430_WKUPDEP_TIMER8_MPU_MASK BITFIELD(0, 0) | 2084 | #define OMAP4430_WKUPDEP_TIMER8_MPU_MASK BITFIELD(0, 0) |
2085 | 2085 | ||
2086 | /* Used by PM_ABE_TIMER8_WKDEP */ | 2086 | /* Used by PM_ABE_TIMER8_WKDEP */ |
2087 | #define OMAP4430_WKUPDEP_TIMER8_TESLA_SHIFT (1 << 2) | 2087 | #define OMAP4430_WKUPDEP_TIMER8_TESLA_SHIFT 2 |
2088 | #define OMAP4430_WKUPDEP_TIMER8_TESLA_MASK BITFIELD(2, 2) | 2088 | #define OMAP4430_WKUPDEP_TIMER8_TESLA_MASK BITFIELD(2, 2) |
2089 | 2089 | ||
2090 | /* Used by PM_L4PER_UART1_WKDEP */ | 2090 | /* Used by PM_L4PER_UART1_WKDEP */ |
2091 | #define OMAP4430_WKUPDEP_UART1_MPU_SHIFT (1 << 0) | 2091 | #define OMAP4430_WKUPDEP_UART1_MPU_SHIFT 0 |
2092 | #define OMAP4430_WKUPDEP_UART1_MPU_MASK BITFIELD(0, 0) | 2092 | #define OMAP4430_WKUPDEP_UART1_MPU_MASK BITFIELD(0, 0) |
2093 | 2093 | ||
2094 | /* Used by PM_L4PER_UART1_WKDEP */ | 2094 | /* Used by PM_L4PER_UART1_WKDEP */ |
2095 | #define OMAP4430_WKUPDEP_UART1_SDMA_SHIFT (1 << 3) | 2095 | #define OMAP4430_WKUPDEP_UART1_SDMA_SHIFT 3 |
2096 | #define OMAP4430_WKUPDEP_UART1_SDMA_MASK BITFIELD(3, 3) | 2096 | #define OMAP4430_WKUPDEP_UART1_SDMA_MASK BITFIELD(3, 3) |
2097 | 2097 | ||
2098 | /* Used by PM_L4PER_UART2_WKDEP */ | 2098 | /* Used by PM_L4PER_UART2_WKDEP */ |
2099 | #define OMAP4430_WKUPDEP_UART2_MPU_SHIFT (1 << 0) | 2099 | #define OMAP4430_WKUPDEP_UART2_MPU_SHIFT 0 |
2100 | #define OMAP4430_WKUPDEP_UART2_MPU_MASK BITFIELD(0, 0) | 2100 | #define OMAP4430_WKUPDEP_UART2_MPU_MASK BITFIELD(0, 0) |
2101 | 2101 | ||
2102 | /* Used by PM_L4PER_UART2_WKDEP */ | 2102 | /* Used by PM_L4PER_UART2_WKDEP */ |
2103 | #define OMAP4430_WKUPDEP_UART2_SDMA_SHIFT (1 << 3) | 2103 | #define OMAP4430_WKUPDEP_UART2_SDMA_SHIFT 3 |
2104 | #define OMAP4430_WKUPDEP_UART2_SDMA_MASK BITFIELD(3, 3) | 2104 | #define OMAP4430_WKUPDEP_UART2_SDMA_MASK BITFIELD(3, 3) |
2105 | 2105 | ||
2106 | /* Used by PM_L4PER_UART3_WKDEP */ | 2106 | /* Used by PM_L4PER_UART3_WKDEP */ |
2107 | #define OMAP4430_WKUPDEP_UART3_DUCATI_SHIFT (1 << 1) | 2107 | #define OMAP4430_WKUPDEP_UART3_DUCATI_SHIFT 1 |
2108 | #define OMAP4430_WKUPDEP_UART3_DUCATI_MASK BITFIELD(1, 1) | 2108 | #define OMAP4430_WKUPDEP_UART3_DUCATI_MASK BITFIELD(1, 1) |
2109 | 2109 | ||
2110 | /* Used by PM_L4PER_UART3_WKDEP */ | 2110 | /* Used by PM_L4PER_UART3_WKDEP */ |
2111 | #define OMAP4430_WKUPDEP_UART3_MPU_SHIFT (1 << 0) | 2111 | #define OMAP4430_WKUPDEP_UART3_MPU_SHIFT 0 |
2112 | #define OMAP4430_WKUPDEP_UART3_MPU_MASK BITFIELD(0, 0) | 2112 | #define OMAP4430_WKUPDEP_UART3_MPU_MASK BITFIELD(0, 0) |
2113 | 2113 | ||
2114 | /* Used by PM_L4PER_UART3_WKDEP */ | 2114 | /* Used by PM_L4PER_UART3_WKDEP */ |
2115 | #define OMAP4430_WKUPDEP_UART3_SDMA_SHIFT (1 << 3) | 2115 | #define OMAP4430_WKUPDEP_UART3_SDMA_SHIFT 3 |
2116 | #define OMAP4430_WKUPDEP_UART3_SDMA_MASK BITFIELD(3, 3) | 2116 | #define OMAP4430_WKUPDEP_UART3_SDMA_MASK BITFIELD(3, 3) |
2117 | 2117 | ||
2118 | /* Used by PM_L4PER_UART3_WKDEP */ | 2118 | /* Used by PM_L4PER_UART3_WKDEP */ |
2119 | #define OMAP4430_WKUPDEP_UART3_TESLA_SHIFT (1 << 2) | 2119 | #define OMAP4430_WKUPDEP_UART3_TESLA_SHIFT 2 |
2120 | #define OMAP4430_WKUPDEP_UART3_TESLA_MASK BITFIELD(2, 2) | 2120 | #define OMAP4430_WKUPDEP_UART3_TESLA_MASK BITFIELD(2, 2) |
2121 | 2121 | ||
2122 | /* Used by PM_L4PER_UART4_WKDEP */ | 2122 | /* Used by PM_L4PER_UART4_WKDEP */ |
2123 | #define OMAP4430_WKUPDEP_UART4_MPU_SHIFT (1 << 0) | 2123 | #define OMAP4430_WKUPDEP_UART4_MPU_SHIFT 0 |
2124 | #define OMAP4430_WKUPDEP_UART4_MPU_MASK BITFIELD(0, 0) | 2124 | #define OMAP4430_WKUPDEP_UART4_MPU_MASK BITFIELD(0, 0) |
2125 | 2125 | ||
2126 | /* Used by PM_L4PER_UART4_WKDEP */ | 2126 | /* Used by PM_L4PER_UART4_WKDEP */ |
2127 | #define OMAP4430_WKUPDEP_UART4_SDMA_SHIFT (1 << 3) | 2127 | #define OMAP4430_WKUPDEP_UART4_SDMA_SHIFT 3 |
2128 | #define OMAP4430_WKUPDEP_UART4_SDMA_MASK BITFIELD(3, 3) | 2128 | #define OMAP4430_WKUPDEP_UART4_SDMA_MASK BITFIELD(3, 3) |
2129 | 2129 | ||
2130 | /* Used by PM_L3INIT_UNIPRO1_WKDEP */ | 2130 | /* Used by PM_L3INIT_UNIPRO1_WKDEP */ |
2131 | #define OMAP4430_WKUPDEP_UNIPRO1_DUCATI_SHIFT (1 << 1) | 2131 | #define OMAP4430_WKUPDEP_UNIPRO1_DUCATI_SHIFT 1 |
2132 | #define OMAP4430_WKUPDEP_UNIPRO1_DUCATI_MASK BITFIELD(1, 1) | 2132 | #define OMAP4430_WKUPDEP_UNIPRO1_DUCATI_MASK BITFIELD(1, 1) |
2133 | 2133 | ||
2134 | /* Used by PM_L3INIT_UNIPRO1_WKDEP */ | 2134 | /* Used by PM_L3INIT_UNIPRO1_WKDEP */ |
2135 | #define OMAP4430_WKUPDEP_UNIPRO1_MPU_SHIFT (1 << 0) | 2135 | #define OMAP4430_WKUPDEP_UNIPRO1_MPU_SHIFT 0 |
2136 | #define OMAP4430_WKUPDEP_UNIPRO1_MPU_MASK BITFIELD(0, 0) | 2136 | #define OMAP4430_WKUPDEP_UNIPRO1_MPU_MASK BITFIELD(0, 0) |
2137 | 2137 | ||
2138 | /* Used by PM_L3INIT_USB_HOST_WKDEP */ | 2138 | /* Used by PM_L3INIT_USB_HOST_WKDEP */ |
2139 | #define OMAP4430_WKUPDEP_USB_HOST_DUCATI_SHIFT (1 << 1) | 2139 | #define OMAP4430_WKUPDEP_USB_HOST_DUCATI_SHIFT 1 |
2140 | #define OMAP4430_WKUPDEP_USB_HOST_DUCATI_MASK BITFIELD(1, 1) | 2140 | #define OMAP4430_WKUPDEP_USB_HOST_DUCATI_MASK BITFIELD(1, 1) |
2141 | 2141 | ||
2142 | /* Used by PM_L3INIT_USB_HOST_FS_WKDEP */ | 2142 | /* Used by PM_L3INIT_USB_HOST_FS_WKDEP */ |
2143 | #define OMAP4430_WKUPDEP_USB_HOST_FS_DUCATI_SHIFT (1 << 1) | 2143 | #define OMAP4430_WKUPDEP_USB_HOST_FS_DUCATI_SHIFT 1 |
2144 | #define OMAP4430_WKUPDEP_USB_HOST_FS_DUCATI_MASK BITFIELD(1, 1) | 2144 | #define OMAP4430_WKUPDEP_USB_HOST_FS_DUCATI_MASK BITFIELD(1, 1) |
2145 | 2145 | ||
2146 | /* Used by PM_L3INIT_USB_HOST_FS_WKDEP */ | 2146 | /* Used by PM_L3INIT_USB_HOST_FS_WKDEP */ |
2147 | #define OMAP4430_WKUPDEP_USB_HOST_FS_MPU_SHIFT (1 << 0) | 2147 | #define OMAP4430_WKUPDEP_USB_HOST_FS_MPU_SHIFT 0 |
2148 | #define OMAP4430_WKUPDEP_USB_HOST_FS_MPU_MASK BITFIELD(0, 0) | 2148 | #define OMAP4430_WKUPDEP_USB_HOST_FS_MPU_MASK BITFIELD(0, 0) |
2149 | 2149 | ||
2150 | /* Used by PM_L3INIT_USB_HOST_WKDEP */ | 2150 | /* Used by PM_L3INIT_USB_HOST_WKDEP */ |
2151 | #define OMAP4430_WKUPDEP_USB_HOST_MPU_SHIFT (1 << 0) | 2151 | #define OMAP4430_WKUPDEP_USB_HOST_MPU_SHIFT 0 |
2152 | #define OMAP4430_WKUPDEP_USB_HOST_MPU_MASK BITFIELD(0, 0) | 2152 | #define OMAP4430_WKUPDEP_USB_HOST_MPU_MASK BITFIELD(0, 0) |
2153 | 2153 | ||
2154 | /* Used by PM_L3INIT_USB_OTG_WKDEP */ | 2154 | /* Used by PM_L3INIT_USB_OTG_WKDEP */ |
2155 | #define OMAP4430_WKUPDEP_USB_OTG_DUCATI_SHIFT (1 << 1) | 2155 | #define OMAP4430_WKUPDEP_USB_OTG_DUCATI_SHIFT 1 |
2156 | #define OMAP4430_WKUPDEP_USB_OTG_DUCATI_MASK BITFIELD(1, 1) | 2156 | #define OMAP4430_WKUPDEP_USB_OTG_DUCATI_MASK BITFIELD(1, 1) |
2157 | 2157 | ||
2158 | /* Used by PM_L3INIT_USB_OTG_WKDEP */ | 2158 | /* Used by PM_L3INIT_USB_OTG_WKDEP */ |
2159 | #define OMAP4430_WKUPDEP_USB_OTG_MPU_SHIFT (1 << 0) | 2159 | #define OMAP4430_WKUPDEP_USB_OTG_MPU_SHIFT 0 |
2160 | #define OMAP4430_WKUPDEP_USB_OTG_MPU_MASK BITFIELD(0, 0) | 2160 | #define OMAP4430_WKUPDEP_USB_OTG_MPU_MASK BITFIELD(0, 0) |
2161 | 2161 | ||
2162 | /* Used by PM_L3INIT_USB_TLL_WKDEP */ | 2162 | /* Used by PM_L3INIT_USB_TLL_WKDEP */ |
2163 | #define OMAP4430_WKUPDEP_USB_TLL_DUCATI_SHIFT (1 << 1) | 2163 | #define OMAP4430_WKUPDEP_USB_TLL_DUCATI_SHIFT 1 |
2164 | #define OMAP4430_WKUPDEP_USB_TLL_DUCATI_MASK BITFIELD(1, 1) | 2164 | #define OMAP4430_WKUPDEP_USB_TLL_DUCATI_MASK BITFIELD(1, 1) |
2165 | 2165 | ||
2166 | /* Used by PM_L3INIT_USB_TLL_WKDEP */ | 2166 | /* Used by PM_L3INIT_USB_TLL_WKDEP */ |
2167 | #define OMAP4430_WKUPDEP_USB_TLL_MPU_SHIFT (1 << 0) | 2167 | #define OMAP4430_WKUPDEP_USB_TLL_MPU_SHIFT 0 |
2168 | #define OMAP4430_WKUPDEP_USB_TLL_MPU_MASK BITFIELD(0, 0) | 2168 | #define OMAP4430_WKUPDEP_USB_TLL_MPU_MASK BITFIELD(0, 0) |
2169 | 2169 | ||
2170 | /* Used by PM_WKUP_USIM_WKDEP */ | 2170 | /* Used by PM_WKUP_USIM_WKDEP */ |
2171 | #define OMAP4430_WKUPDEP_USIM_MPU_SHIFT (1 << 0) | 2171 | #define OMAP4430_WKUPDEP_USIM_MPU_SHIFT 0 |
2172 | #define OMAP4430_WKUPDEP_USIM_MPU_MASK BITFIELD(0, 0) | 2172 | #define OMAP4430_WKUPDEP_USIM_MPU_MASK BITFIELD(0, 0) |
2173 | 2173 | ||
2174 | /* Used by PM_WKUP_USIM_WKDEP */ | 2174 | /* Used by PM_WKUP_USIM_WKDEP */ |
2175 | #define OMAP4430_WKUPDEP_USIM_SDMA_SHIFT (1 << 3) | 2175 | #define OMAP4430_WKUPDEP_USIM_SDMA_SHIFT 3 |
2176 | #define OMAP4430_WKUPDEP_USIM_SDMA_MASK BITFIELD(3, 3) | 2176 | #define OMAP4430_WKUPDEP_USIM_SDMA_MASK BITFIELD(3, 3) |
2177 | 2177 | ||
2178 | /* Used by PM_WKUP_WDT2_WKDEP */ | 2178 | /* Used by PM_WKUP_WDT2_WKDEP */ |
2179 | #define OMAP4430_WKUPDEP_WDT2_DUCATI_SHIFT (1 << 1) | 2179 | #define OMAP4430_WKUPDEP_WDT2_DUCATI_SHIFT 1 |
2180 | #define OMAP4430_WKUPDEP_WDT2_DUCATI_MASK BITFIELD(1, 1) | 2180 | #define OMAP4430_WKUPDEP_WDT2_DUCATI_MASK BITFIELD(1, 1) |
2181 | 2181 | ||
2182 | /* Used by PM_WKUP_WDT2_WKDEP */ | 2182 | /* Used by PM_WKUP_WDT2_WKDEP */ |
2183 | #define OMAP4430_WKUPDEP_WDT2_MPU_SHIFT (1 << 0) | 2183 | #define OMAP4430_WKUPDEP_WDT2_MPU_SHIFT 0 |
2184 | #define OMAP4430_WKUPDEP_WDT2_MPU_MASK BITFIELD(0, 0) | 2184 | #define OMAP4430_WKUPDEP_WDT2_MPU_MASK BITFIELD(0, 0) |
2185 | 2185 | ||
2186 | /* Used by PM_ABE_WDT3_WKDEP */ | 2186 | /* Used by PM_ABE_WDT3_WKDEP */ |
2187 | #define OMAP4430_WKUPDEP_WDT3_MPU_SHIFT (1 << 0) | 2187 | #define OMAP4430_WKUPDEP_WDT3_MPU_SHIFT 0 |
2188 | #define OMAP4430_WKUPDEP_WDT3_MPU_MASK BITFIELD(0, 0) | 2188 | #define OMAP4430_WKUPDEP_WDT3_MPU_MASK BITFIELD(0, 0) |
2189 | 2189 | ||
2190 | /* Used by PM_L3INIT_HSI_WKDEP */ | 2190 | /* Used by PM_L3INIT_HSI_WKDEP */ |
2191 | #define OMAP4430_WKUPDEP_WGM_HSI_WAKE_MPU_SHIFT (1 << 8) | 2191 | #define OMAP4430_WKUPDEP_WGM_HSI_WAKE_MPU_SHIFT 8 |
2192 | #define OMAP4430_WKUPDEP_WGM_HSI_WAKE_MPU_MASK BITFIELD(8, 8) | 2192 | #define OMAP4430_WKUPDEP_WGM_HSI_WAKE_MPU_MASK BITFIELD(8, 8) |
2193 | 2193 | ||
2194 | /* Used by PM_L3INIT_XHPI_WKDEP */ | 2194 | /* Used by PM_L3INIT_XHPI_WKDEP */ |
2195 | #define OMAP4430_WKUPDEP_XHPI_DUCATI_SHIFT (1 << 1) | 2195 | #define OMAP4430_WKUPDEP_XHPI_DUCATI_SHIFT 1 |
2196 | #define OMAP4430_WKUPDEP_XHPI_DUCATI_MASK BITFIELD(1, 1) | 2196 | #define OMAP4430_WKUPDEP_XHPI_DUCATI_MASK BITFIELD(1, 1) |
2197 | 2197 | ||
2198 | /* Used by PRM_IO_PMCTRL */ | 2198 | /* Used by PRM_IO_PMCTRL */ |
2199 | #define OMAP4430_WUCLK_CTRL_SHIFT (1 << 8) | 2199 | #define OMAP4430_WUCLK_CTRL_SHIFT 8 |
2200 | #define OMAP4430_WUCLK_CTRL_MASK BITFIELD(8, 8) | 2200 | #define OMAP4430_WUCLK_CTRL_MASK BITFIELD(8, 8) |
2201 | 2201 | ||
2202 | /* Used by PRM_IO_PMCTRL */ | 2202 | /* Used by PRM_IO_PMCTRL */ |
2203 | #define OMAP4430_WUCLK_STATUS_SHIFT (1 << 9) | 2203 | #define OMAP4430_WUCLK_STATUS_SHIFT 9 |
2204 | #define OMAP4430_WUCLK_STATUS_MASK BITFIELD(9, 9) | 2204 | #define OMAP4430_WUCLK_STATUS_MASK BITFIELD(9, 9) |
2205 | #endif | 2205 | #endif |
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h index ea050ce188a7..5fba2aa8932c 100644 --- a/arch/arm/mach-omap2/prm.h +++ b/arch/arm/mach-omap2/prm.h | |||
@@ -24,6 +24,8 @@ | |||
24 | OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg)) | 24 | OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg)) |
25 | #define OMAP44XX_PRM_REGADDR(module, reg) \ | 25 | #define OMAP44XX_PRM_REGADDR(module, reg) \ |
26 | OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (module) + (reg)) | 26 | OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE + (module) + (reg)) |
27 | #define OMAP44XX_CHIRONSS_REGADDR(module, reg) \ | ||
28 | OMAP2_L4_IO_ADDRESS(OMAP4430_CHIRONSS_BASE + (module) + (reg)) | ||
27 | 29 | ||
28 | #include "prm44xx.h" | 30 | #include "prm44xx.h" |
29 | 31 | ||
@@ -177,9 +179,11 @@ | |||
177 | 179 | ||
178 | /* Registers appearing on both 24xx and 34xx */ | 180 | /* Registers appearing on both 24xx and 34xx */ |
179 | 181 | ||
180 | #define RM_RSTCTRL 0x0050 | 182 | #define OMAP2_RM_RSTCTRL 0x0050 |
181 | #define RM_RSTTIME 0x0054 | 183 | #define OMAP2_RM_RSTTIME 0x0054 |
182 | #define RM_RSTST 0x0058 | 184 | #define OMAP2_RM_RSTST 0x0058 |
185 | #define OMAP2_PM_PWSTCTRL 0x00e0 | ||
186 | #define OMAP2_PM_PWSTST 0x00e4 | ||
183 | 187 | ||
184 | #define PM_WKEN 0x00a0 | 188 | #define PM_WKEN 0x00a0 |
185 | #define PM_WKEN1 PM_WKEN | 189 | #define PM_WKEN1 PM_WKEN |
@@ -189,8 +193,6 @@ | |||
189 | #define PM_EVGENCTRL 0x00d4 | 193 | #define PM_EVGENCTRL 0x00d4 |
190 | #define PM_EVGENONTIM 0x00d8 | 194 | #define PM_EVGENONTIM 0x00d8 |
191 | #define PM_EVGENOFFTIM 0x00dc | 195 | #define PM_EVGENOFFTIM 0x00dc |
192 | #define PM_PWSTCTRL 0x00e0 | ||
193 | #define PM_PWSTST 0x00e4 | ||
194 | 196 | ||
195 | /* Omap2 specific registers */ | 197 | /* Omap2 specific registers */ |
196 | #define OMAP24XX_PM_WKEN2 0x00a4 | 198 | #define OMAP24XX_PM_WKEN2 0x00a4 |
@@ -218,6 +220,13 @@ | |||
218 | #define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8 | 220 | #define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8 |
219 | #define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc | 221 | #define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc |
220 | 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 | |||
221 | 230 | ||
222 | #ifndef __ASSEMBLER__ | 231 | #ifndef __ASSEMBLER__ |
223 | 232 | ||
diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h index 89be97f0589d..adb2558bb121 100644 --- a/arch/arm/mach-omap2/prm44xx.h +++ b/arch/arm/mach-omap2/prm44xx.h | |||
@@ -386,26 +386,26 @@ | |||
386 | 386 | ||
387 | 387 | ||
388 | /* CHIRON_PRCM.CHIRONSS_OCP_SOCKET_PRCM register offsets */ | 388 | /* CHIRON_PRCM.CHIRONSS_OCP_SOCKET_PRCM register offsets */ |
389 | #define OMAP4430_REVISION_PRCM OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_OCP_SOCKET_PRCM_MOD, 0x0000) | 389 | #define OMAP4430_REVISION_PRCM OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_OCP_SOCKET_PRCM_MOD, 0x0000) |
390 | 390 | ||
391 | /* CHIRON_PRCM.CHIRONSS_DEVICE_PRM register offsets */ | 391 | /* CHIRON_PRCM.CHIRONSS_DEVICE_PRM register offsets */ |
392 | #define OMAP4430_CHIRON_PRCM_PRM_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_DEVICE_PRM_MOD, 0x0000) | 392 | #define OMAP4430_CHIRON_PRCM_PRM_RSTST OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_DEVICE_PRM_MOD, 0x0000) |
393 | 393 | ||
394 | /* CHIRON_PRCM.CHIRONSS_CPU0 register offsets */ | 394 | /* CHIRON_PRCM.CHIRONSS_CPU0 register offsets */ |
395 | #define OMAP4430_PM_PDA_CPU0_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0000) | 395 | #define OMAP4430_PM_PDA_CPU0_PWRSTCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0000) |
396 | #define OMAP4430_PM_PDA_CPU0_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0004) | 396 | #define OMAP4430_PM_PDA_CPU0_PWRSTST OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0004) |
397 | #define OMAP4430_RM_PDA_CPU0_CPU0_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0008) | 397 | #define OMAP4430_RM_PDA_CPU0_CPU0_CONTEXT OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0008) |
398 | #define OMAP4430_RM_PDA_CPU0_CPU0_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x000c) | 398 | #define OMAP4430_RM_PDA_CPU0_CPU0_RSTCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x000c) |
399 | #define OMAP4430_RM_PDA_CPU0_CPU0_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0010) | 399 | #define OMAP4430_RM_PDA_CPU0_CPU0_RSTST OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0010) |
400 | #define OMAP4430_CM_PDA_CPU0_CPU0_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0014) | 400 | #define OMAP4430_CM_PDA_CPU0_CPU0_CLKCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0014) |
401 | #define OMAP4430_CM_PDA_CPU0_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0018) | 401 | #define OMAP4430_CM_PDA_CPU0_CLKSTCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU0_MOD, 0x0018) |
402 | 402 | ||
403 | /* CHIRON_PRCM.CHIRONSS_CPU1 register offsets */ | 403 | /* CHIRON_PRCM.CHIRONSS_CPU1 register offsets */ |
404 | #define OMAP4430_PM_PDA_CPU1_PWRSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0000) | 404 | #define OMAP4430_PM_PDA_CPU1_PWRSTCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0000) |
405 | #define OMAP4430_PM_PDA_CPU1_PWRSTST OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0004) | 405 | #define OMAP4430_PM_PDA_CPU1_PWRSTST OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0004) |
406 | #define OMAP4430_RM_PDA_CPU1_CPU1_CONTEXT OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0008) | 406 | #define OMAP4430_RM_PDA_CPU1_CPU1_CONTEXT OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0008) |
407 | #define OMAP4430_RM_PDA_CPU1_CPU1_RSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x000c) | 407 | #define OMAP4430_RM_PDA_CPU1_CPU1_RSTCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x000c) |
408 | #define OMAP4430_RM_PDA_CPU1_CPU1_RSTST OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0010) | 408 | #define OMAP4430_RM_PDA_CPU1_CPU1_RSTST OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0010) |
409 | #define OMAP4430_CM_PDA_CPU1_CPU1_CLKCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0014) | 409 | #define OMAP4430_CM_PDA_CPU1_CPU1_CLKCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0014) |
410 | #define OMAP4430_CM_PDA_CPU1_CLKSTCTRL OMAP44XX_PRM_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0018) | 410 | #define OMAP4430_CM_PDA_CPU1_CLKSTCTRL OMAP44XX_CHIRONSS_REGADDR(OMAP4430_CHIRONSS_CHIRONSS_CPU1_MOD, 0x0018) |
411 | #endif | 411 | #endif |
diff --git a/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h b/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h new file mode 100644 index 000000000000..cd4352917022 --- /dev/null +++ b/arch/arm/mach-omap2/sdram-numonyx-m65kxxxxam.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * SDRC register values for the Numonyx M65KXXXXAM | ||
3 | * | ||
4 | * Copyright (C) 2009 Integration Software and Electronic Engineering. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM | ||
12 | #define __ARCH_ARM_MACH_OMAP2_SDRAM_NUMONYX_M65KXXXXAM | ||
13 | |||
14 | #include <plat/sdrc.h> | ||
15 | |||
16 | /* Numonyx M65KXXXXAM */ | ||
17 | static struct omap_sdrc_params m65kxxxxam_sdrc_params[] = { | ||
18 | [0] = { | ||
19 | .rate = 200000000, | ||
20 | .actim_ctrla = 0xe321d4c6, | ||
21 | .actim_ctrlb = 0x00022328, | ||
22 | .rfr_ctrl = 0x0005e601, | ||
23 | .mr = 0x00000032, | ||
24 | }, | ||
25 | [1] = { | ||
26 | .rate = 166000000, | ||
27 | .actim_ctrla = 0xba9dc485, | ||
28 | .actim_ctrlb = 0x00022321, | ||
29 | .rfr_ctrl = 0x0004dc01, | ||
30 | .mr = 0x00000032, | ||
31 | }, | ||
32 | [2] = { | ||
33 | .rate = 133000000, | ||
34 | .actim_ctrla = 0x9a19b485, | ||
35 | .actim_ctrlb = 0x0002231b, | ||
36 | .rfr_ctrl = 0x0003de01, | ||
37 | .mr = 0x00000032, | ||
38 | }, | ||
39 | [3] = { | ||
40 | .rate = 83000000, | ||
41 | .actim_ctrla = 0x594ca242, | ||
42 | .actim_ctrlb = 0x00022310, | ||
43 | .rfr_ctrl = 0x00025501, | ||
44 | .mr = 0x00000032, | ||
45 | }, | ||
46 | [4] = { | ||
47 | .rate = 0 | ||
48 | }, | ||
49 | }; | ||
50 | |||
51 | #endif | ||
diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c index cbfbd142e946..4c65f5628b39 100644 --- a/arch/arm/mach-omap2/sdrc.c +++ b/arch/arm/mach-omap2/sdrc.c | |||
@@ -119,8 +119,15 @@ int omap2_sdrc_get_params(unsigned long r, | |||
119 | 119 | ||
120 | void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals) | 120 | void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals) |
121 | { | 121 | { |
122 | omap2_sdrc_base = omap2_globals->sdrc; | 122 | /* Static mapping, never released */ |
123 | omap2_sms_base = omap2_globals->sms; | 123 | if (omap2_globals->sdrc) { |
124 | omap2_sdrc_base = ioremap(omap2_globals->sdrc, SZ_64K); | ||
125 | WARN_ON(!omap2_sdrc_base); | ||
126 | } | ||
127 | if (omap2_globals->sms) { | ||
128 | omap2_sms_base = ioremap(omap2_globals->sms, SZ_64K); | ||
129 | WARN_ON(!omap2_sms_base); | ||
130 | } | ||
124 | } | 131 | } |
125 | 132 | ||
126 | /** | 133 | /** |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 19805a7de06c..b79bc8926cc9 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/serial_reg.h> | 23 | #include <linux/serial_reg.h> |
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/delay.h> | ||
26 | 27 | ||
27 | #include <plat/common.h> | 28 | #include <plat/common.h> |
28 | #include <plat/board.h> | 29 | #include <plat/board.h> |
@@ -36,7 +37,13 @@ | |||
36 | #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52 | 37 | #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52 |
37 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ | 38 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ |
38 | 39 | ||
39 | #define DEFAULT_TIMEOUT (5 * HZ) | 40 | /* |
41 | * NOTE: By default the serial timeout is disabled as it causes lost characters | ||
42 | * over the serial ports. This means that the UART clocks will stay on until | ||
43 | * disabled via sysfs. This also causes that any deeper omap sleep states are | ||
44 | * blocked. | ||
45 | */ | ||
46 | #define DEFAULT_TIMEOUT 0 | ||
40 | 47 | ||
41 | struct omap_uart_state { | 48 | struct omap_uart_state { |
42 | int num; | 49 | int num; |
@@ -74,7 +81,6 @@ static LIST_HEAD(uart_list); | |||
74 | 81 | ||
75 | static struct plat_serial8250_port serial_platform_data0[] = { | 82 | static struct plat_serial8250_port serial_platform_data0[] = { |
76 | { | 83 | { |
77 | .mapbase = OMAP_UART1_BASE, | ||
78 | .irq = 72, | 84 | .irq = 72, |
79 | .flags = UPF_BOOT_AUTOCONF, | 85 | .flags = UPF_BOOT_AUTOCONF, |
80 | .iotype = UPIO_MEM, | 86 | .iotype = UPIO_MEM, |
@@ -87,7 +93,6 @@ static struct plat_serial8250_port serial_platform_data0[] = { | |||
87 | 93 | ||
88 | static struct plat_serial8250_port serial_platform_data1[] = { | 94 | static struct plat_serial8250_port serial_platform_data1[] = { |
89 | { | 95 | { |
90 | .mapbase = OMAP_UART2_BASE, | ||
91 | .irq = 73, | 96 | .irq = 73, |
92 | .flags = UPF_BOOT_AUTOCONF, | 97 | .flags = UPF_BOOT_AUTOCONF, |
93 | .iotype = UPIO_MEM, | 98 | .iotype = UPIO_MEM, |
@@ -100,7 +105,6 @@ static struct plat_serial8250_port serial_platform_data1[] = { | |||
100 | 105 | ||
101 | static struct plat_serial8250_port serial_platform_data2[] = { | 106 | static struct plat_serial8250_port serial_platform_data2[] = { |
102 | { | 107 | { |
103 | .mapbase = OMAP_UART3_BASE, | ||
104 | .irq = 74, | 108 | .irq = 74, |
105 | .flags = UPF_BOOT_AUTOCONF, | 109 | .flags = UPF_BOOT_AUTOCONF, |
106 | .iotype = UPIO_MEM, | 110 | .iotype = UPIO_MEM, |
@@ -111,10 +115,9 @@ static struct plat_serial8250_port serial_platform_data2[] = { | |||
111 | } | 115 | } |
112 | }; | 116 | }; |
113 | 117 | ||
114 | #ifdef CONFIG_ARCH_OMAP4 | 118 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
115 | static struct plat_serial8250_port serial_platform_data3[] = { | 119 | static struct plat_serial8250_port serial_platform_data3[] = { |
116 | { | 120 | { |
117 | .mapbase = OMAP_UART4_BASE, | ||
118 | .irq = 70, | 121 | .irq = 70, |
119 | .flags = UPF_BOOT_AUTOCONF, | 122 | .flags = UPF_BOOT_AUTOCONF, |
120 | .iotype = UPIO_MEM, | 123 | .iotype = UPIO_MEM, |
@@ -124,7 +127,33 @@ static struct plat_serial8250_port serial_platform_data3[] = { | |||
124 | .flags = 0 | 127 | .flags = 0 |
125 | } | 128 | } |
126 | }; | 129 | }; |
130 | |||
131 | static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals) | ||
132 | { | ||
133 | serial_platform_data3[0].mapbase = omap2_globals->uart4_phys; | ||
134 | } | ||
135 | #else | ||
136 | static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals) | ||
137 | { | ||
138 | } | ||
127 | #endif | 139 | #endif |
140 | |||
141 | void __init omap2_set_globals_uart(struct omap_globals *omap2_globals) | ||
142 | { | ||
143 | serial_platform_data0[0].mapbase = omap2_globals->uart1_phys; | ||
144 | serial_platform_data1[0].mapbase = omap2_globals->uart2_phys; | ||
145 | serial_platform_data2[0].mapbase = omap2_globals->uart3_phys; | ||
146 | if (cpu_is_omap3630() || cpu_is_omap44xx()) | ||
147 | omap2_set_globals_uart4(omap2_globals); | ||
148 | } | ||
149 | |||
150 | static inline unsigned int __serial_read_reg(struct uart_port *up, | ||
151 | int offset) | ||
152 | { | ||
153 | offset <<= up->regshift; | ||
154 | return (unsigned int)__raw_readb(up->membase + offset); | ||
155 | } | ||
156 | |||
128 | static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, | 157 | static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, |
129 | int offset) | 158 | int offset) |
130 | { | 159 | { |
@@ -132,6 +161,13 @@ static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, | |||
132 | return (unsigned int)__raw_readb(up->membase + offset); | 161 | return (unsigned int)__raw_readb(up->membase + offset); |
133 | } | 162 | } |
134 | 163 | ||
164 | static inline void __serial_write_reg(struct uart_port *up, int offset, | ||
165 | int value) | ||
166 | { | ||
167 | offset <<= up->regshift; | ||
168 | __raw_writeb(value, up->membase + offset); | ||
169 | } | ||
170 | |||
135 | static inline void serial_write_reg(struct plat_serial8250_port *p, int offset, | 171 | static inline void serial_write_reg(struct plat_serial8250_port *p, int offset, |
136 | int value) | 172 | int value) |
137 | { | 173 | { |
@@ -415,7 +451,8 @@ static void omap_uart_idle_init(struct omap_uart_state *uart) | |||
415 | uart->timeout = DEFAULT_TIMEOUT; | 451 | uart->timeout = DEFAULT_TIMEOUT; |
416 | setup_timer(&uart->timer, omap_uart_idle_timer, | 452 | setup_timer(&uart->timer, omap_uart_idle_timer, |
417 | (unsigned long) uart); | 453 | (unsigned long) uart); |
418 | mod_timer(&uart->timer, jiffies + uart->timeout); | 454 | if (uart->timeout) |
455 | mod_timer(&uart->timer, jiffies + uart->timeout); | ||
419 | omap_uart_smart_idle_enable(uart, 0); | 456 | omap_uart_smart_idle_enable(uart, 0); |
420 | 457 | ||
421 | if (cpu_is_omap34xx()) { | 458 | if (cpu_is_omap34xx()) { |
@@ -560,7 +597,7 @@ static struct omap_uart_state omap_uart[] = { | |||
560 | }, | 597 | }, |
561 | }, | 598 | }, |
562 | }, | 599 | }, |
563 | #ifdef CONFIG_ARCH_OMAP4 | 600 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) |
564 | { | 601 | { |
565 | .pdev = { | 602 | .pdev = { |
566 | .name = "serial8250", | 603 | .name = "serial8250", |
@@ -583,13 +620,28 @@ static unsigned int serial_in_override(struct uart_port *up, int offset) | |||
583 | { | 620 | { |
584 | if (UART_RX == offset) { | 621 | if (UART_RX == offset) { |
585 | unsigned int lsr; | 622 | unsigned int lsr; |
586 | lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR); | 623 | lsr = __serial_read_reg(up, UART_LSR); |
587 | if (!(lsr & UART_LSR_DR)) | 624 | if (!(lsr & UART_LSR_DR)) |
588 | return -EPERM; | 625 | return -EPERM; |
589 | } | 626 | } |
590 | return serial_read_reg(omap_uart[up->line].p, offset); | 627 | |
628 | return __serial_read_reg(up, offset); | ||
591 | } | 629 | } |
592 | 630 | ||
631 | static void serial_out_override(struct uart_port *up, int offset, int value) | ||
632 | { | ||
633 | unsigned int status, tmout = 10000; | ||
634 | |||
635 | status = __serial_read_reg(up, UART_LSR); | ||
636 | while (!(status & UART_LSR_THRE)) { | ||
637 | /* Wait up to 10ms for the character(s) to be sent. */ | ||
638 | if (--tmout == 0) | ||
639 | break; | ||
640 | udelay(1); | ||
641 | status = __serial_read_reg(up, UART_LSR); | ||
642 | } | ||
643 | __serial_write_reg(up, offset, value); | ||
644 | } | ||
593 | void __init omap_serial_early_init(void) | 645 | void __init omap_serial_early_init(void) |
594 | { | 646 | { |
595 | int i; | 647 | int i; |
@@ -686,15 +738,19 @@ void __init omap_serial_init_port(int port) | |||
686 | DEV_CREATE_FILE(dev, &dev_attr_sleep_timeout); | 738 | DEV_CREATE_FILE(dev, &dev_attr_sleep_timeout); |
687 | } | 739 | } |
688 | 740 | ||
689 | /* omap44xx: Never read empty UART fifo | 741 | /* |
690 | * omap3xxx: Never read empty UART fifo on UARTs | 742 | * omap44xx: Never read empty UART fifo |
691 | * with IP rev >=0x52 | 743 | * omap3xxx: Never read empty UART fifo on UARTs |
692 | */ | 744 | * with IP rev >=0x52 |
693 | if (cpu_is_omap44xx()) | 745 | */ |
694 | uart->p->serial_in = serial_in_override; | 746 | if (cpu_is_omap44xx()) { |
695 | else if ((serial_read_reg(uart->p, UART_OMAP_MVER) & 0xFF) | 747 | uart->p->serial_in = serial_in_override; |
696 | >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) | 748 | uart->p->serial_out = serial_out_override; |
697 | uart->p->serial_in = serial_in_override; | 749 | } else if ((serial_read_reg(uart->p, UART_OMAP_MVER) & 0xFF) |
750 | >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) { | ||
751 | uart->p->serial_in = serial_in_override; | ||
752 | uart->p->serial_out = serial_out_override; | ||
753 | } | ||
698 | } | 754 | } |
699 | 755 | ||
700 | /** | 756 | /** |
@@ -706,8 +762,13 @@ void __init omap_serial_init_port(int port) | |||
706 | */ | 762 | */ |
707 | void __init omap_serial_init(void) | 763 | void __init omap_serial_init(void) |
708 | { | 764 | { |
709 | int i; | 765 | int i, nr_ports; |
766 | |||
767 | if (!(cpu_is_omap3630() || cpu_is_omap4430())) | ||
768 | nr_ports = 3; | ||
769 | else | ||
770 | nr_ports = ARRAY_SIZE(omap_uart); | ||
710 | 771 | ||
711 | for (i = 0; i < ARRAY_SIZE(omap_uart); i++) | 772 | for (i = 0; i < nr_ports; i++) |
712 | omap_serial_init_port(i); | 773 | omap_serial_init_port(i); |
713 | } | 774 | } |
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 15268f8b61de..d522cd70bf53 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -33,12 +33,14 @@ | |||
33 | #include "prm.h" | 33 | #include "prm.h" |
34 | #include "sdrc.h" | 34 | #include "sdrc.h" |
35 | 35 | ||
36 | #define SDRC_SCRATCHPAD_SEM_V 0xfa00291c | ||
37 | |||
36 | #define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \ | 38 | #define PM_PREPWSTST_CORE_V OMAP34XX_PRM_REGADDR(CORE_MOD, \ |
37 | OMAP3430_PM_PREPWSTST) | 39 | OMAP3430_PM_PREPWSTST) |
38 | #define PM_PREPWSTST_CORE_P 0x48306AE8 | 40 | #define PM_PREPWSTST_CORE_P 0x48306AE8 |
39 | #define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ | 41 | #define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ |
40 | OMAP3430_PM_PREPWSTST) | 42 | OMAP3430_PM_PREPWSTST) |
41 | #define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + PM_PWSTCTRL | 43 | #define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + OMAP2_PM_PWSTCTRL |
42 | #define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1) | 44 | #define CM_IDLEST1_CORE_V OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST1) |
43 | #define SRAM_BASE_P 0x40200000 | 45 | #define SRAM_BASE_P 0x40200000 |
44 | #define CONTROL_STAT 0x480022F0 | 46 | #define CONTROL_STAT 0x480022F0 |
@@ -57,6 +59,37 @@ | |||
57 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) | 59 | #define SDRC_DLLA_STATUS_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) |
58 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) | 60 | #define SDRC_DLLA_CTRL_V OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL) |
59 | 61 | ||
62 | .text | ||
63 | /* Function to aquire the semaphore in scratchpad */ | ||
64 | ENTRY(lock_scratchpad_sem) | ||
65 | stmfd sp!, {lr} @ save registers on stack | ||
66 | wait_sem: | ||
67 | mov r0,#1 | ||
68 | ldr r1, sdrc_scratchpad_sem | ||
69 | wait_loop: | ||
70 | ldr r2, [r1] @ load the lock value | ||
71 | cmp r2, r0 @ is the lock free ? | ||
72 | beq wait_loop @ not free... | ||
73 | swp r2, r0, [r1] @ semaphore free so lock it and proceed | ||
74 | cmp r2, r0 @ did we succeed ? | ||
75 | beq wait_sem @ no - try again | ||
76 | ldmfd sp!, {pc} @ restore regs and return | ||
77 | sdrc_scratchpad_sem: | ||
78 | .word SDRC_SCRATCHPAD_SEM_V | ||
79 | ENTRY(lock_scratchpad_sem_sz) | ||
80 | .word . - lock_scratchpad_sem | ||
81 | |||
82 | .text | ||
83 | /* Function to release the scratchpad semaphore */ | ||
84 | ENTRY(unlock_scratchpad_sem) | ||
85 | stmfd sp!, {lr} @ save registers on stack | ||
86 | ldr r3, sdrc_scratchpad_sem | ||
87 | mov r2,#0 | ||
88 | str r2,[r3] | ||
89 | ldmfd sp!, {pc} @ restore regs and return | ||
90 | ENTRY(unlock_scratchpad_sem_sz) | ||
91 | .word . - unlock_scratchpad_sem | ||
92 | |||
60 | .text | 93 | .text |
61 | /* Function call to get the restore pointer for resume from OFF */ | 94 | /* Function call to get the restore pointer for resume from OFF */ |
62 | ENTRY(get_restore_pointer) | 95 | ENTRY(get_restore_pointer) |
@@ -245,24 +278,45 @@ restore: | |||
245 | mov r1, #0 @ set task id for ROM code in r1 | 278 | mov r1, #0 @ set task id for ROM code in r1 |
246 | mov r2, #4 @ set some flags in r2, r6 | 279 | mov r2, #4 @ set some flags in r2, r6 |
247 | mov r6, #0xff | 280 | mov r6, #0xff |
248 | adr r3, write_aux_control_params @ r3 points to parameters | 281 | ldr r4, scratchpad_base |
282 | ldr r3, [r4, #0xBC] @ r3 points to parameters | ||
249 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | 283 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier |
250 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier | 284 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier |
251 | .word 0xE1600071 @ call SMI monitor (smi #1) | 285 | .word 0xE1600071 @ call SMI monitor (smi #1) |
252 | 286 | ||
287 | #ifdef CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE | ||
288 | /* Restore L2 aux control register */ | ||
289 | @ set service ID for PPA | ||
290 | mov r0, #CONFIG_OMAP3_L2_AUX_SECURE_SERVICE_SET_ID | ||
291 | mov r12, r0 @ copy service ID in r12 | ||
292 | mov r1, #0 @ set task ID for ROM code in r1 | ||
293 | mov r2, #4 @ set some flags in r2, r6 | ||
294 | mov r6, #0xff | ||
295 | ldr r4, scratchpad_base | ||
296 | ldr r3, [r4, #0xBC] | ||
297 | adds r3, r3, #8 @ r3 points to parameters | ||
298 | mcr p15, 0, r0, c7, c10, 4 @ data write barrier | ||
299 | mcr p15, 0, r0, c7, c10, 5 @ data memory barrier | ||
300 | .word 0xE1600071 @ call SMI monitor (smi #1) | ||
301 | #endif | ||
253 | b logic_l1_restore | 302 | b logic_l1_restore |
254 | l2_inv_api_params: | 303 | l2_inv_api_params: |
255 | .word 0x1, 0x00 | 304 | .word 0x1, 0x00 |
256 | write_aux_control_params: | ||
257 | .word 0x1, 0x72 | ||
258 | l2_inv_gp: | 305 | l2_inv_gp: |
259 | /* Execute smi to invalidate L2 cache */ | 306 | /* Execute smi to invalidate L2 cache */ |
260 | mov r12, #0x1 @ set up to invalide L2 | 307 | mov r12, #0x1 @ set up to invalide L2 |
261 | smi: .word 0xE1600070 @ Call SMI monitor (smieq) | 308 | smi: .word 0xE1600070 @ Call SMI monitor (smieq) |
262 | /* Write to Aux control register to set some bits */ | 309 | /* Write to Aux control register to set some bits */ |
263 | mov r0, #0x72 | 310 | ldr r4, scratchpad_base |
311 | ldr r3, [r4,#0xBC] | ||
312 | ldr r0, [r3,#4] | ||
264 | mov r12, #0x3 | 313 | mov r12, #0x3 |
265 | .word 0xE1600070 @ Call SMI monitor (smieq) | 314 | .word 0xE1600070 @ Call SMI monitor (smieq) |
315 | ldr r4, scratchpad_base | ||
316 | ldr r3, [r4,#0xBC] | ||
317 | ldr r0, [r3,#12] | ||
318 | mov r12, #0x2 | ||
319 | .word 0xE1600070 @ Call SMI monitor (smieq) | ||
266 | logic_l1_restore: | 320 | logic_l1_restore: |
267 | mov r1, #0 | 321 | mov r1, #0 |
268 | /* Invalidate all instruction caches to PoU | 322 | /* Invalidate all instruction caches to PoU |
@@ -271,6 +325,7 @@ logic_l1_restore: | |||
271 | 325 | ||
272 | ldr r4, scratchpad_base | 326 | ldr r4, scratchpad_base |
273 | ldr r3, [r4,#0xBC] | 327 | ldr r3, [r4,#0xBC] |
328 | adds r3, r3, #16 | ||
274 | ldmia r3!, {r4-r6} | 329 | ldmia r3!, {r4-r6} |
275 | mov sp, r4 | 330 | mov sp, r4 |
276 | msr spsr_cxsf, r5 | 331 | msr spsr_cxsf, r5 |
@@ -387,6 +442,11 @@ usettbr0: | |||
387 | save_context_wfi: | 442 | save_context_wfi: |
388 | /*b save_context_wfi*/ @ enable to debug save code | 443 | /*b save_context_wfi*/ @ enable to debug save code |
389 | mov r8, r0 /* Store SDRAM address in r8 */ | 444 | mov r8, r0 /* Store SDRAM address in r8 */ |
445 | mrc p15, 0, r5, c1, c0, 1 @ Read Auxiliary Control Register | ||
446 | mov r4, #0x1 @ Number of parameters for restore call | ||
447 | stmia r8!, {r4-r5} @ Push parameters for restore call | ||
448 | mrc p15, 1, r5, c9, c0, 2 @ Read L2 AUX ctrl register | ||
449 | stmia r8!, {r4-r5} @ Push parameters for restore call | ||
390 | /* Check what that target sleep state is:stored in r1*/ | 450 | /* Check what that target sleep state is:stored in r1*/ |
391 | /* 1 - Only L1 and logic lost */ | 451 | /* 1 - Only L1 and logic lost */ |
392 | /* 2 - Only L2 lost */ | 452 | /* 2 - Only L2 lost */ |
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index cd04deaa88c5..74fbed8491f2 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c | |||
@@ -85,8 +85,6 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode, | |||
85 | case CLOCK_EVT_MODE_PERIODIC: | 85 | case CLOCK_EVT_MODE_PERIODIC: |
86 | period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ; | 86 | period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ; |
87 | period -= 1; | 87 | period -= 1; |
88 | if (cpu_is_omap44xx()) | ||
89 | period = 0xff; /* FIXME: */ | ||
90 | omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period); | 88 | omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period); |
91 | break; | 89 | break; |
92 | case CLOCK_EVT_MODE_ONESHOT: | 90 | case CLOCK_EVT_MODE_ONESHOT: |
@@ -150,9 +148,6 @@ static void __init omap2_gp_clockevent_init(void) | |||
150 | "timer-gp: omap_dm_timer_set_source() failed\n"); | 148 | "timer-gp: omap_dm_timer_set_source() failed\n"); |
151 | 149 | ||
152 | tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); | 150 | tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); |
153 | if (cpu_is_omap44xx()) | ||
154 | /* Assuming 32kHz clk is driving GPT1 */ | ||
155 | tick_rate = 32768; /* FIXME: */ | ||
156 | 151 | ||
157 | pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n", | 152 | pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n", |
158 | gptimer_id, tick_rate); | 153 | gptimer_id, tick_rate); |
diff --git a/arch/arm/mach-omap2/timer-mpu.c b/arch/arm/mach-omap2/timer-mpu.c index c1a650a9910f..954682e64399 100644 --- a/arch/arm/mach-omap2/timer-mpu.c +++ b/arch/arm/mach-omap2/timer-mpu.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | void __cpuinit local_timer_setup(struct clock_event_device *evt) | 29 | void __cpuinit local_timer_setup(struct clock_event_device *evt) |
30 | { | 30 | { |
31 | evt->irq = INT_44XX_LOCALTIMER_IRQ; | 31 | evt->irq = OMAP44XX_IRQ_LOCALTIMER; |
32 | twd_timer_setup(evt); | 32 | twd_timer_setup(evt); |
33 | } | 33 | } |
34 | 34 | ||
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index a80441dd19b8..6d41fa7b2ce8 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -47,70 +47,11 @@ static struct resource musb_resources[] = { | |||
47 | }, | 47 | }, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static int clk_on; | ||
51 | |||
52 | static int musb_set_clock(struct clk *clk, int state) | ||
53 | { | ||
54 | if (state) { | ||
55 | if (clk_on > 0) | ||
56 | return -ENODEV; | ||
57 | |||
58 | clk_enable(clk); | ||
59 | clk_on = 1; | ||
60 | } else { | ||
61 | if (clk_on == 0) | ||
62 | return -ENODEV; | ||
63 | |||
64 | clk_disable(clk); | ||
65 | clk_on = 0; | ||
66 | } | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static struct musb_hdrc_eps_bits musb_eps[] = { | ||
72 | { "ep1_tx", 10, }, | ||
73 | { "ep1_rx", 10, }, | ||
74 | { "ep2_tx", 9, }, | ||
75 | { "ep2_rx", 9, }, | ||
76 | { "ep3_tx", 3, }, | ||
77 | { "ep3_rx", 3, }, | ||
78 | { "ep4_tx", 3, }, | ||
79 | { "ep4_rx", 3, }, | ||
80 | { "ep5_tx", 3, }, | ||
81 | { "ep5_rx", 3, }, | ||
82 | { "ep6_tx", 3, }, | ||
83 | { "ep6_rx", 3, }, | ||
84 | { "ep7_tx", 3, }, | ||
85 | { "ep7_rx", 3, }, | ||
86 | { "ep8_tx", 2, }, | ||
87 | { "ep8_rx", 2, }, | ||
88 | { "ep9_tx", 2, }, | ||
89 | { "ep9_rx", 2, }, | ||
90 | { "ep10_tx", 2, }, | ||
91 | { "ep10_rx", 2, }, | ||
92 | { "ep11_tx", 2, }, | ||
93 | { "ep11_rx", 2, }, | ||
94 | { "ep12_tx", 2, }, | ||
95 | { "ep12_rx", 2, }, | ||
96 | { "ep13_tx", 2, }, | ||
97 | { "ep13_rx", 2, }, | ||
98 | { "ep14_tx", 2, }, | ||
99 | { "ep14_rx", 2, }, | ||
100 | { "ep15_tx", 2, }, | ||
101 | { "ep15_rx", 2, }, | ||
102 | }; | ||
103 | |||
104 | static struct musb_hdrc_config musb_config = { | 50 | static struct musb_hdrc_config musb_config = { |
105 | .multipoint = 1, | 51 | .multipoint = 1, |
106 | .dyn_fifo = 1, | 52 | .dyn_fifo = 1, |
107 | .soft_con = 1, | ||
108 | .dma = 1, | ||
109 | .num_eps = 16, | 53 | .num_eps = 16, |
110 | .dma_channels = 7, | ||
111 | .dma_req_chan = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3), | ||
112 | .ram_bits = 12, | 54 | .ram_bits = 12, |
113 | .eps_bits = musb_eps, | ||
114 | }; | 55 | }; |
115 | 56 | ||
116 | static struct musb_hdrc_platform_data musb_plat = { | 57 | static struct musb_hdrc_platform_data musb_plat = { |
@@ -122,7 +63,6 @@ static struct musb_hdrc_platform_data musb_plat = { | |||
122 | .mode = MUSB_PERIPHERAL, | 63 | .mode = MUSB_PERIPHERAL, |
123 | #endif | 64 | #endif |
124 | /* .clock is set dynamically */ | 65 | /* .clock is set dynamically */ |
125 | .set_clock = musb_set_clock, | ||
126 | .config = &musb_config, | 66 | .config = &musb_config, |
127 | 67 | ||
128 | /* REVISIT charge pump on TWL4030 can supply up to | 68 | /* REVISIT charge pump on TWL4030 can supply up to |
@@ -146,28 +86,34 @@ static struct platform_device musb_device = { | |||
146 | .resource = musb_resources, | 86 | .resource = musb_resources, |
147 | }; | 87 | }; |
148 | 88 | ||
149 | void __init usb_musb_init(void) | 89 | void __init usb_musb_init(struct omap_musb_board_data *board_data) |
150 | { | 90 | { |
151 | if (cpu_is_omap243x()) | 91 | if (cpu_is_omap243x()) { |
152 | musb_resources[0].start = OMAP243X_HS_BASE; | 92 | musb_resources[0].start = OMAP243X_HS_BASE; |
153 | else | 93 | } else if (cpu_is_omap34xx()) { |
154 | musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; | 94 | musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; |
155 | musb_resources[0].end = musb_resources[0].start + SZ_8K - 1; | 95 | } else if (cpu_is_omap44xx()) { |
96 | musb_resources[0].start = OMAP44XX_HSUSB_OTG_BASE; | ||
97 | musb_resources[1].start = OMAP44XX_IRQ_HS_USB_MC_N; | ||
98 | musb_resources[2].start = OMAP44XX_IRQ_HS_USB_DMA_N; | ||
99 | } | ||
100 | musb_resources[0].end = musb_resources[0].start + SZ_4K - 1; | ||
156 | 101 | ||
157 | /* | 102 | /* |
158 | * REVISIT: This line can be removed once all the platforms using | 103 | * REVISIT: This line can be removed once all the platforms using |
159 | * musb_core.c have been converted to use use clkdev. | 104 | * musb_core.c have been converted to use use clkdev. |
160 | */ | 105 | */ |
161 | musb_plat.clock = "ick"; | 106 | musb_plat.clock = "ick"; |
107 | musb_plat.board_data = board_data; | ||
108 | musb_plat.power = board_data->power >> 1; | ||
109 | musb_plat.mode = board_data->mode; | ||
162 | 110 | ||
163 | if (platform_device_register(&musb_device) < 0) { | 111 | if (platform_device_register(&musb_device) < 0) |
164 | printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); | 112 | printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); |
165 | return; | ||
166 | } | ||
167 | } | 113 | } |
168 | 114 | ||
169 | #else | 115 | #else |
170 | void __init usb_musb_init(void) | 116 | void __init usb_musb_init(struct omap_musb_board_data *board_data) |
171 | { | 117 | { |
172 | } | 118 | } |
173 | #endif /* CONFIG_USB_MUSB_SOC */ | 119 | #endif /* CONFIG_USB_MUSB_SOC */ |