aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/hwspinlock.txt293
-rw-r--r--MAINTAINERS10
-rw-r--r--arch/arm/configs/omap2plus_defconfig1
-rw-r--r--arch/arm/mach-omap1/Makefile2
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c16
-rw-r--r--arch/arm/mach-omap1/board-fsample.c4
-rw-r--r--arch/arm/mach-omap1/board-h2.c2
-rw-r--r--arch/arm/mach-omap1/board-h3.c2
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c4
-rw-r--r--arch/arm/mach-omap1/board-innovator.c2
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c6
-rw-r--r--arch/arm/mach-omap1/board-palmte.c13
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c107
-rw-r--r--arch/arm/mach-omap1/mcbsp.c333
-rw-r--r--arch/arm/mach-omap1/reset.c25
-rw-r--r--arch/arm/mach-omap2/Kconfig28
-rw-r--r--arch/arm/mach-omap2/Makefile44
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c34
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c113
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c15
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c138
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c14
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c41
-rw-r--r--arch/arm/mach-omap2/board-apollon.c12
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c41
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c13
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c25
-rw-r--r--arch/arm/mach-omap2/board-flash.c34
-rw-r--r--arch/arm/mach-omap2/board-flash.h4
-rw-r--r--arch/arm/mach-omap2/board-generic.c12
-rw-r--r--arch/arm/mach-omap2/board-h4.c14
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c34
-rw-r--r--arch/arm/mach-omap2/board-igep0030.c12
-rw-r--r--arch/arm/mach-omap2/board-ldp.c35
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c20
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c23
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c246
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c9
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c28
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c37
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c20
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c89
-rw-r--r--arch/arm/mach-omap2/board-overo.c16
-rw-r--r--arch/arm/mach-omap2/board-rm680.c10
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c61
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c15
-rw-r--r--arch/arm/mach-omap2/board-rx51.c14
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c62
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c15
-rw-r--r--arch/arm/mach-omap2/board-zoom-peripherals.c6
-rw-r--r--arch/arm/mach-omap2/board-zoom.c19
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_apll.c24
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_dpll.c63
-rw-r--r--arch/arm/mach-omap2/clkt2xxx_osc.c14
-rw-r--r--arch/arm/mach-omap2/clkt_clksel.c2
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c91
-rw-r--r--arch/arm/mach-omap2/clkt_iclk.c82
-rw-r--r--arch/arm/mach-omap2/clock.c28
-rw-r--r--arch/arm/mach-omap2/clock.h21
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c221
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c244
-rw-r--r--arch/arm/mach-omap2/clock2xxx.h8
-rw-r--r--arch/arm/mach-omap2/clock34xx.c29
-rw-r--r--arch/arm/mach-omap2/clock34xx.h5
-rw-r--r--arch/arm/mach-omap2/clock3517.c4
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c3
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c182
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c77
-rw-r--r--arch/arm/mach-omap2/clock_common_data.c6
-rw-r--r--arch/arm/mach-omap2/clockdomain.c439
-rw-r--r--arch/arm/mach-omap2/clockdomain.h70
-rw-r--r--arch/arm/mach-omap2/clockdomain2xxx_3xxx.c274
-rw-r--r--arch/arm/mach-omap2/clockdomain44xx.c137
-rw-r--r--arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c28
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c396
-rw-r--r--arch/arm/mach-omap2/cm-regbits-24xx.h3
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c69
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.h8
-rw-r--r--arch/arm/mach-omap2/cm44xx.h1
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c21
-rw-r--r--arch/arm/mach-omap2/cminst44xx.h6
-rw-r--r--arch/arm/mach-omap2/common.c25
-rw-r--r--arch/arm/mach-omap2/control.h6
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c4
-rw-r--r--arch/arm/mach-omap2/devices.c675
-rw-r--r--arch/arm/mach-omap2/display.c45
-rw-r--r--arch/arm/mach-omap2/dpll44xx.c84
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c7
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c113
-rw-r--r--arch/arm/mach-omap2/gpmc.c56
-rw-r--r--arch/arm/mach-omap2/hsmmc.c421
-rw-r--r--arch/arm/mach-omap2/hwspinlock.c63
-rw-r--r--arch/arm/mach-omap2/id.c64
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S12
-rw-r--r--arch/arm/mach-omap2/include/mach/entry-macro.S13
-rw-r--r--arch/arm/mach-omap2/io.c42
-rw-r--r--arch/arm/mach-omap2/iommu2.c33
-rw-r--r--arch/arm/mach-omap2/irq.c9
-rw-r--r--arch/arm/mach-omap2/mailbox.c74
-rw-r--r--arch/arm/mach-omap2/mcbsp.c231
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c248
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c1305
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c1786
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c2320
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c3201
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.c253
-rw-r--r--arch/arm/mach-omap2/omap_l3_noc.h132
-rw-r--r--arch/arm/mach-omap2/omap_l3_smx.c314
-rw-r--r--arch/arm/mach-omap2/omap_l3_smx.h338
-rw-r--r--arch/arm/mach-omap2/omap_phy_internal.c93
-rw-r--r--arch/arm/mach-omap2/opp2xxx.h2
-rw-r--r--arch/arm/mach-omap2/pm.c6
-rw-r--r--arch/arm/mach-omap2/pm24xx.c77
-rw-r--r--arch/arm/mach-omap2/pm34xx.c128
-rw-r--r--arch/arm/mach-omap2/powerdomain.c43
-rw-r--r--arch/arm/mach-omap2/powerdomain.h19
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c9
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c24
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c38
-rw-r--r--arch/arm/mach-omap2/powerdomains44xx_data.c88
-rw-r--r--arch/arm/mach-omap2/prcm-common.h8
-rw-r--r--arch/arm/mach-omap2/prcm.c5
-rw-r--r--arch/arm/mach-omap2/prcm_mpu44xx.h4
-rw-r--r--arch/arm/mach-omap2/serial.c17
-rw-r--r--arch/arm/mach-omap2/timer-gp.c7
-rw-r--r--arch/arm/mach-omap2/usb-musb.c219
-rw-r--r--arch/arm/plat-omap/clock.c99
-rw-r--r--arch/arm/plat-omap/common.c11
-rw-r--r--arch/arm/plat-omap/counter_32k.c4
-rw-r--r--arch/arm/plat-omap/cpu-omap.c2
-rw-r--r--arch/arm/plat-omap/devices.c10
-rw-r--r--arch/arm/plat-omap/dma.c2
-rw-r--r--arch/arm/plat-omap/dmtimer.c4
-rw-r--r--arch/arm/plat-omap/i2c.c2
-rw-r--r--arch/arm/plat-omap/include/plat/board.h4
-rw-r--r--arch/arm/plat-omap/include/plat/clkdev_omap.h1
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h28
-rw-r--r--arch/arm/plat-omap/include/plat/common.h1
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h44
-rw-r--r--arch/arm/plat-omap/include/plat/display.h11
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h11
-rw-r--r--arch/arm/plat-omap/include/plat/fpga.h92
-rw-r--r--arch/arm/plat-omap/include/plat/gpmc.h18
-rw-r--r--arch/arm/plat-omap/include/plat/hardware.h1
-rw-r--r--arch/arm/plat-omap/include/plat/io.h12
-rw-r--r--arch/arm/plat-omap/include/plat/iommu.h16
-rw-r--r--arch/arm/plat-omap/include/plat/irqs.h11
-rw-r--r--arch/arm/plat-omap/include/plat/l3_2xxx.h20
-rw-r--r--arch/arm/plat-omap/include/plat/l3_3xxx.h20
-rw-r--r--arch/arm/plat-omap/include/plat/l4_2xxx.h24
-rw-r--r--arch/arm/plat-omap/include/plat/l4_3xxx.h10
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h64
-rw-r--r--arch/arm/plat-omap/include/plat/mcspi.h11
-rw-r--r--arch/arm/plat-omap/include/plat/mmc.h29
-rw-r--r--arch/arm/plat-omap/include/plat/multi.h4
-rw-r--r--arch/arm/plat-omap/include/plat/nand.h11
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h17
-rw-r--r--arch/arm/plat-omap/include/plat/onenand.h10
-rw-r--r--arch/arm/plat-omap/include/plat/prcm.h1
-rw-r--r--arch/arm/plat-omap/include/plat/sdrc.h8
-rw-r--r--arch/arm/plat-omap/include/plat/serial.h9
-rw-r--r--arch/arm/plat-omap/include/plat/system.h38
-rw-r--r--arch/arm/plat-omap/include/plat/ti816x.h27
-rw-r--r--arch/arm/plat-omap/include/plat/uncompress.h7
-rw-r--r--arch/arm/plat-omap/include/plat/usb.h4
-rw-r--r--arch/arm/plat-omap/io.c5
-rw-r--r--arch/arm/plat-omap/iommu.c55
-rw-r--r--arch/arm/plat-omap/mcbsp.c203
-rw-r--r--arch/arm/plat-omap/omap_device.c36
-rw-r--r--arch/arm/plat-omap/sram.c20
-rw-r--r--drivers/Kconfig2
-rw-r--r--drivers/Makefile2
-rw-r--r--drivers/hwspinlock/Kconfig22
-rw-r--r--drivers/hwspinlock/Makefile6
-rw-r--r--drivers/hwspinlock/hwspinlock_core.c548
-rw-r--r--drivers/hwspinlock/hwspinlock_internal.h61
-rw-r--r--drivers/hwspinlock/omap_hwspinlock.c231
-rw-r--r--drivers/mmc/host/Kconfig2
-rw-r--r--drivers/mmc/host/omap_hsmmc.c30
-rw-r--r--drivers/mtd/nand/Kconfig17
-rw-r--r--drivers/mtd/nand/omap2.c367
-rw-r--r--drivers/mtd/onenand/omap2.c36
-rw-r--r--drivers/spi/omap2_mcspi.c222
-rw-r--r--drivers/usb/musb/musb_core.c2
-rw-r--r--drivers/usb/musb/musb_core.h6
-rw-r--r--drivers/usb/musb/musbhsdma.h2
-rw-r--r--drivers/usb/otg/isp1301_omap.c2
-rw-r--r--drivers/w1/masters/Kconfig2
-rw-r--r--drivers/watchdog/omap_wdt.c25
-rw-r--r--include/linux/hwspinlock.h292
-rw-r--r--include/linux/i2c/twl.h2
-rw-r--r--include/linux/mtd/onenand_regs.h1
-rw-r--r--sound/soc/omap/omap-mcbsp.c126
-rw-r--r--sound/soc/omap/omap-mcbsp.h4
194 files changed, 16764 insertions, 3653 deletions
diff --git a/Documentation/hwspinlock.txt b/Documentation/hwspinlock.txt
new file mode 100644
index 000000000000..7dcd1a4e726c
--- /dev/null
+++ b/Documentation/hwspinlock.txt
@@ -0,0 +1,293 @@
1Hardware Spinlock Framework
2
31. Introduction
4
5Hardware spinlock modules provide hardware assistance for synchronization
6and mutual exclusion between heterogeneous processors and those not operating
7under a single, shared operating system.
8
9For example, OMAP4 has dual Cortex-A9, dual Cortex-M3 and a C64x+ DSP,
10each of which is running a different Operating System (the master, A9,
11is usually running Linux and the slave processors, the M3 and the DSP,
12are running some flavor of RTOS).
13
14A generic hwspinlock framework allows platform-independent drivers to use
15the hwspinlock device in order to access data structures that are shared
16between remote processors, that otherwise have no alternative mechanism
17to accomplish synchronization and mutual exclusion operations.
18
19This is necessary, for example, for Inter-processor communications:
20on OMAP4, cpu-intensive multimedia tasks are offloaded by the host to the
21remote M3 and/or C64x+ slave processors (by an IPC subsystem called Syslink).
22
23To achieve fast message-based communications, a minimal kernel support
24is needed to deliver messages arriving from a remote processor to the
25appropriate user process.
26
27This communication is based on simple data structures that is shared between
28the remote processors, and access to it is synchronized using the hwspinlock
29module (remote processor directly places new messages in this shared data
30structure).
31
32A common hwspinlock interface makes it possible to have generic, platform-
33independent, drivers.
34
352. User API
36
37 struct hwspinlock *hwspin_lock_request(void);
38 - dynamically assign an hwspinlock and return its address, or NULL
39 in case an unused hwspinlock isn't available. Users of this
40 API will usually want to communicate the lock's id to the remote core
41 before it can be used to achieve synchronization.
42 Can be called from an atomic context (this function will not sleep) but
43 not from within interrupt context.
44
45 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
46 - assign a specific hwspinlock id and return its address, or NULL
47 if that hwspinlock is already in use. Usually board code will
48 be calling this function in order to reserve specific hwspinlock
49 ids for predefined purposes.
50 Can be called from an atomic context (this function will not sleep) but
51 not from within interrupt context.
52
53 int hwspin_lock_free(struct hwspinlock *hwlock);
54 - free a previously-assigned hwspinlock; returns 0 on success, or an
55 appropriate error code on failure (e.g. -EINVAL if the hwspinlock
56 is already free).
57 Can be called from an atomic context (this function will not sleep) but
58 not from within interrupt context.
59
60 int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);
61 - lock a previously-assigned hwspinlock with a timeout limit (specified in
62 msecs). If the hwspinlock is already taken, the function will busy loop
63 waiting for it to be released, but give up when the timeout elapses.
64 Upon a successful return from this function, preemption is disabled so
65 the caller must not sleep, and is advised to release the hwspinlock as
66 soon as possible, in order to minimize remote cores polling on the
67 hardware interconnect.
68 Returns 0 when successful and an appropriate error code otherwise (most
69 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
70 The function will never sleep.
71
72 int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int timeout);
73 - lock a previously-assigned hwspinlock with a timeout limit (specified in
74 msecs). If the hwspinlock is already taken, the function will busy loop
75 waiting for it to be released, but give up when the timeout elapses.
76 Upon a successful return from this function, preemption and the local
77 interrupts are disabled, so the caller must not sleep, and is advised to
78 release the hwspinlock as soon as possible.
79 Returns 0 when successful and an appropriate error code otherwise (most
80 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
81 The function will never sleep.
82
83 int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, unsigned int to,
84 unsigned long *flags);
85 - lock a previously-assigned hwspinlock with a timeout limit (specified in
86 msecs). If the hwspinlock is already taken, the function will busy loop
87 waiting for it to be released, but give up when the timeout elapses.
88 Upon a successful return from this function, preemption is disabled,
89 local interrupts are disabled and their previous state is saved at the
90 given flags placeholder. The caller must not sleep, and is advised to
91 release the hwspinlock as soon as possible.
92 Returns 0 when successful and an appropriate error code otherwise (most
93 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
94 The function will never sleep.
95
96 int hwspin_trylock(struct hwspinlock *hwlock);
97 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
98 it is already taken.
99 Upon a successful return from this function, preemption is disabled so
100 caller must not sleep, and is advised to release the hwspinlock as soon as
101 possible, in order to minimize remote cores polling on the hardware
102 interconnect.
103 Returns 0 on success and an appropriate error code otherwise (most
104 notably -EBUSY if the hwspinlock was already taken).
105 The function will never sleep.
106
107 int hwspin_trylock_irq(struct hwspinlock *hwlock);
108 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
109 it is already taken.
110 Upon a successful return from this function, preemption and the local
111 interrupts are disabled so caller must not sleep, and is advised to
112 release the hwspinlock as soon as possible.
113 Returns 0 on success and an appropriate error code otherwise (most
114 notably -EBUSY if the hwspinlock was already taken).
115 The function will never sleep.
116
117 int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags);
118 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
119 it is already taken.
120 Upon a successful return from this function, preemption is disabled,
121 the local interrupts are disabled and their previous state is saved
122 at the given flags placeholder. The caller must not sleep, and is advised
123 to release the hwspinlock as soon as possible.
124 Returns 0 on success and an appropriate error code otherwise (most
125 notably -EBUSY if the hwspinlock was already taken).
126 The function will never sleep.
127
128 void hwspin_unlock(struct hwspinlock *hwlock);
129 - unlock a previously-locked hwspinlock. Always succeed, and can be called
130 from any context (the function never sleeps). Note: code should _never_
131 unlock an hwspinlock which is already unlocked (there is no protection
132 against this).
133
134 void hwspin_unlock_irq(struct hwspinlock *hwlock);
135 - unlock a previously-locked hwspinlock and enable local interrupts.
136 The caller should _never_ unlock an hwspinlock which is already unlocked.
137 Doing so is considered a bug (there is no protection against this).
138 Upon a successful return from this function, preemption and local
139 interrupts are enabled. This function will never sleep.
140
141 void
142 hwspin_unlock_irqrestore(struct hwspinlock *hwlock, unsigned long *flags);
143 - unlock a previously-locked hwspinlock.
144 The caller should _never_ unlock an hwspinlock which is already unlocked.
145 Doing so is considered a bug (there is no protection against this).
146 Upon a successful return from this function, preemption is reenabled,
147 and the state of the local interrupts is restored to the state saved at
148 the given flags. This function will never sleep.
149
150 int hwspin_lock_get_id(struct hwspinlock *hwlock);
151 - retrieve id number of a given hwspinlock. This is needed when an
152 hwspinlock is dynamically assigned: before it can be used to achieve
153 mutual exclusion with a remote cpu, the id number should be communicated
154 to the remote task with which we want to synchronize.
155 Returns the hwspinlock id number, or -EINVAL if hwlock is null.
156
1573. Typical usage
158
159#include <linux/hwspinlock.h>
160#include <linux/err.h>
161
162int hwspinlock_example1(void)
163{
164 struct hwspinlock *hwlock;
165 int ret;
166
167 /* dynamically assign a hwspinlock */
168 hwlock = hwspin_lock_request();
169 if (!hwlock)
170 ...
171
172 id = hwspin_lock_get_id(hwlock);
173 /* probably need to communicate id to a remote processor now */
174
175 /* take the lock, spin for 1 sec if it's already taken */
176 ret = hwspin_lock_timeout(hwlock, 1000);
177 if (ret)
178 ...
179
180 /*
181 * we took the lock, do our thing now, but do NOT sleep
182 */
183
184 /* release the lock */
185 hwspin_unlock(hwlock);
186
187 /* free the lock */
188 ret = hwspin_lock_free(hwlock);
189 if (ret)
190 ...
191
192 return ret;
193}
194
195int hwspinlock_example2(void)
196{
197 struct hwspinlock *hwlock;
198 int ret;
199
200 /*
201 * assign a specific hwspinlock id - this should be called early
202 * by board init code.
203 */
204 hwlock = hwspin_lock_request_specific(PREDEFINED_LOCK_ID);
205 if (!hwlock)
206 ...
207
208 /* try to take it, but don't spin on it */
209 ret = hwspin_trylock(hwlock);
210 if (!ret) {
211 pr_info("lock is already taken\n");
212 return -EBUSY;
213 }
214
215 /*
216 * we took the lock, do our thing now, but do NOT sleep
217 */
218
219 /* release the lock */
220 hwspin_unlock(hwlock);
221
222 /* free the lock */
223 ret = hwspin_lock_free(hwlock);
224 if (ret)
225 ...
226
227 return ret;
228}
229
230
2314. API for implementors
232
233 int hwspin_lock_register(struct hwspinlock *hwlock);
234 - to be called from the underlying platform-specific implementation, in
235 order to register a new hwspinlock instance. Can be called from an atomic
236 context (this function will not sleep) but not from within interrupt
237 context. Returns 0 on success, or appropriate error code on failure.
238
239 struct hwspinlock *hwspin_lock_unregister(unsigned int id);
240 - to be called from the underlying vendor-specific implementation, in order
241 to unregister an existing (and unused) hwspinlock instance.
242 Can be called from an atomic context (will not sleep) but not from
243 within interrupt context.
244 Returns the address of hwspinlock on success, or NULL on error (e.g.
245 if the hwspinlock is sill in use).
246
2475. struct hwspinlock
248
249This struct represents an hwspinlock instance. It is registered by the
250underlying hwspinlock implementation using the hwspin_lock_register() API.
251
252/**
253 * struct hwspinlock - vendor-specific hwspinlock implementation
254 *
255 * @dev: underlying device, will be used with runtime PM api
256 * @ops: vendor-specific hwspinlock handlers
257 * @id: a global, unique, system-wide, index of the lock.
258 * @lock: initialized and used by hwspinlock core
259 * @owner: underlying implementation module, used to maintain module ref count
260 */
261struct hwspinlock {
262 struct device *dev;
263 const struct hwspinlock_ops *ops;
264 int id;
265 spinlock_t lock;
266 struct module *owner;
267};
268
269The underlying implementation is responsible to assign the dev, ops, id and
270owner members. The lock member, OTOH, is initialized and used by the hwspinlock
271core.
272
2736. Implementation callbacks
274
275There are three possible callbacks defined in 'struct hwspinlock_ops':
276
277struct hwspinlock_ops {
278 int (*trylock)(struct hwspinlock *lock);
279 void (*unlock)(struct hwspinlock *lock);
280 void (*relax)(struct hwspinlock *lock);
281};
282
283The first two callbacks are mandatory:
284
285The ->trylock() callback should make a single attempt to take the lock, and
286return 0 on failure and 1 on success. This callback may _not_ sleep.
287
288The ->unlock() callback releases the lock. It always succeed, and it, too,
289may _not_ sleep.
290
291The ->relax() callback is optional. It is called by hwspinlock core while
292spinning on a lock, and can be used by the underlying implementation to force
293a delay between two successive invocations of ->trylock(). It may _not_ sleep.
diff --git a/MAINTAINERS b/MAINTAINERS
index 8afba6321e24..04ed9565ad85 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4496,6 +4496,16 @@ L: linux-omap@vger.kernel.org
4496S: Maintained 4496S: Maintained
4497F: arch/arm/*omap*/*pm* 4497F: arch/arm/*omap*/*pm*
4498 4498
4499OMAP POWERDOMAIN/CLOCKDOMAIN SOC ADAPTATION LAYER SUPPORT
4500M: Rajendra Nayak <rnayak@ti.com>
4501M: Paul Walmsley <paul@pwsan.com>
4502L: linux-omap@vger.kernel.org
4503S: Maintained
4504F: arch/arm/mach-omap2/powerdomain2xxx_3xxx.c
4505F: arch/arm/mach-omap2/powerdomain44xx.c
4506F: arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
4507F: arch/arm/mach-omap2/clockdomain44xx.c
4508
4499OMAP AUDIO SUPPORT 4509OMAP AUDIO SUPPORT
4500M: Jarkko Nikula <jhnikula@gmail.com> 4510M: Jarkko Nikula <jhnikula@gmail.com>
4501L: alsa-devel@alsa-project.org (subscribers-only) 4511L: alsa-devel@alsa-project.org (subscribers-only)
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index ae890caa17a7..019fb7c67dc3 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -58,6 +58,7 @@ CONFIG_ARM_ERRATA_411920=y
58CONFIG_NO_HZ=y 58CONFIG_NO_HZ=y
59CONFIG_HIGH_RES_TIMERS=y 59CONFIG_HIGH_RES_TIMERS=y
60CONFIG_SMP=y 60CONFIG_SMP=y
61CONFIG_NR_CPUS=2
61# CONFIG_LOCAL_TIMERS is not set 62# CONFIG_LOCAL_TIMERS is not set
62CONFIG_AEABI=y 63CONFIG_AEABI=y
63CONFIG_LEDS=y 64CONFIG_LEDS=y
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index ba6009f27677..af98117043d2 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -4,7 +4,7 @@
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o 6obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o
7obj-y += clock.o clock_data.o opp_data.o 7obj-y += clock.o clock_data.o opp_data.o reset.o
8 8
9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
10 10
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 22cc8c8df6cb..de88c9297b68 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -165,7 +165,7 @@ static struct map_desc ams_delta_io_desc[] __initdata = {
165 } 165 }
166}; 166};
167 167
168static struct omap_lcd_config ams_delta_lcd_config __initdata = { 168static struct omap_lcd_config ams_delta_lcd_config = {
169 .ctrl_name = "internal", 169 .ctrl_name = "internal",
170}; 170};
171 171
@@ -175,7 +175,7 @@ static struct omap_usb_config ams_delta_usb_config __initdata = {
175 .pins[0] = 2, 175 .pins[0] = 2,
176}; 176};
177 177
178static struct omap_board_config_kernel ams_delta_config[] = { 178static struct omap_board_config_kernel ams_delta_config[] __initdata = {
179 { OMAP_TAG_LCD, &ams_delta_lcd_config }, 179 { OMAP_TAG_LCD, &ams_delta_lcd_config },
180}; 180};
181 181
@@ -208,14 +208,14 @@ static const struct matrix_keymap_data ams_delta_keymap_data = {
208 .keymap_size = ARRAY_SIZE(ams_delta_keymap), 208 .keymap_size = ARRAY_SIZE(ams_delta_keymap),
209}; 209};
210 210
211static struct omap_kp_platform_data ams_delta_kp_data = { 211static struct omap_kp_platform_data ams_delta_kp_data __initdata = {
212 .rows = 8, 212 .rows = 8,
213 .cols = 8, 213 .cols = 8,
214 .keymap_data = &ams_delta_keymap_data, 214 .keymap_data = &ams_delta_keymap_data,
215 .delay = 9, 215 .delay = 9,
216}; 216};
217 217
218static struct platform_device ams_delta_kp_device = { 218static struct platform_device ams_delta_kp_device __initdata = {
219 .name = "omap-keypad", 219 .name = "omap-keypad",
220 .id = -1, 220 .id = -1,
221 .dev = { 221 .dev = {
@@ -225,12 +225,12 @@ static struct platform_device ams_delta_kp_device = {
225 .resource = ams_delta_kp_resources, 225 .resource = ams_delta_kp_resources,
226}; 226};
227 227
228static struct platform_device ams_delta_lcd_device = { 228static struct platform_device ams_delta_lcd_device __initdata = {
229 .name = "lcd_ams_delta", 229 .name = "lcd_ams_delta",
230 .id = -1, 230 .id = -1,
231}; 231};
232 232
233static struct platform_device ams_delta_led_device = { 233static struct platform_device ams_delta_led_device __initdata = {
234 .name = "ams-delta-led", 234 .name = "ams-delta-led",
235 .id = -1 235 .id = -1
236}; 236};
@@ -259,7 +259,7 @@ static int ams_delta_camera_power(struct device *dev, int power)
259#define ams_delta_camera_power NULL 259#define ams_delta_camera_power NULL
260#endif 260#endif
261 261
262static struct soc_camera_link __initdata ams_delta_iclink = { 262static struct soc_camera_link ams_delta_iclink = {
263 .bus_id = 0, /* OMAP1 SoC camera bus */ 263 .bus_id = 0, /* OMAP1 SoC camera bus */
264 .i2c_adapter_id = 1, 264 .i2c_adapter_id = 1,
265 .board_info = &ams_delta_camera_board_info[0], 265 .board_info = &ams_delta_camera_board_info[0],
@@ -267,7 +267,7 @@ static struct soc_camera_link __initdata ams_delta_iclink = {
267 .power = ams_delta_camera_power, 267 .power = ams_delta_camera_power,
268}; 268};
269 269
270static struct platform_device ams_delta_camera_device = { 270static struct platform_device ams_delta_camera_device __initdata = {
271 .name = "soc-camera-pdrv", 271 .name = "soc-camera-pdrv",
272 .id = 0, 272 .id = 0,
273 .dev = { 273 .dev = {
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 0efb9dbae44c..87f173d93557 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -287,11 +287,11 @@ static struct platform_device *devices[] __initdata = {
287 &lcd_device, 287 &lcd_device,
288}; 288};
289 289
290static struct omap_lcd_config fsample_lcd_config __initdata = { 290static struct omap_lcd_config fsample_lcd_config = {
291 .ctrl_name = "internal", 291 .ctrl_name = "internal",
292}; 292};
293 293
294static struct omap_board_config_kernel fsample_config[] = { 294static struct omap_board_config_kernel fsample_config[] __initdata = {
295 { OMAP_TAG_LCD, &fsample_lcd_config }, 295 { OMAP_TAG_LCD, &fsample_lcd_config },
296}; 296};
297 297
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 28b84aa9bdba..ba3bd09c4754 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -202,7 +202,7 @@ static int h2_nand_dev_ready(struct mtd_info *mtd)
202 202
203static const char *h2_part_probes[] = { "cmdlinepart", NULL }; 203static const char *h2_part_probes[] = { "cmdlinepart", NULL };
204 204
205struct platform_nand_data h2_nand_platdata = { 205static struct platform_nand_data h2_nand_platdata = {
206 .chip = { 206 .chip = {
207 .nr_chips = 1, 207 .nr_chips = 1,
208 .chip_offset = 0, 208 .chip_offset = 0,
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index dbc8b8d882ba..ac48677672ee 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -204,7 +204,7 @@ static int nand_dev_ready(struct mtd_info *mtd)
204 204
205static const char *part_probes[] = { "cmdlinepart", NULL }; 205static const char *part_probes[] = { "cmdlinepart", NULL };
206 206
207struct platform_nand_data nand_platdata = { 207static struct platform_nand_data nand_platdata = {
208 .chip = { 208 .chip = {
209 .nr_chips = 1, 209 .nr_chips = 1,
210 .chip_offset = 0, 210 .chip_offset = 0,
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index f2c5c585bc83..ba05a51f9408 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -331,7 +331,7 @@ static struct resource htcpld_resources[] = {
331 }, 331 },
332}; 332};
333 333
334struct htcpld_chip_platform_data htcpld_chips[] = { 334static struct htcpld_chip_platform_data htcpld_chips[] = {
335 [0] = { 335 [0] = {
336 .addr = 0x03, 336 .addr = 0x03,
337 .reset = 0x04, 337 .reset = 0x04,
@@ -366,7 +366,7 @@ struct htcpld_chip_platform_data htcpld_chips[] = {
366 }, 366 },
367}; 367};
368 368
369struct htcpld_core_platform_data htcpld_pfdata = { 369static struct htcpld_core_platform_data htcpld_pfdata = {
370 .int_reset_gpio_hi = HTCPLD_GPIO_INT_RESET_HI, 370 .int_reset_gpio_hi = HTCPLD_GPIO_INT_RESET_HI,
371 .int_reset_gpio_lo = HTCPLD_GPIO_INT_RESET_LO, 371 .int_reset_gpio_lo = HTCPLD_GPIO_INT_RESET_LO,
372 .i2c_adapter_id = 1, 372 .i2c_adapter_id = 1,
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index a36e6742bf9b..2d9b8cbd7a14 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -365,7 +365,7 @@ static struct omap_mmc_platform_data mmc1_data = {
365 365
366static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC]; 366static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];
367 367
368void __init innovator_mmc_init(void) 368static void __init innovator_mmc_init(void)
369{ 369{
370 mmc_data[0] = &mmc1_data; 370 mmc_data[0] = &mmc1_data;
371 omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC); 371 omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC);
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index d21f09dc78f4..cfd084926146 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -115,7 +115,7 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
115 .shutdown = mipid_shutdown, 115 .shutdown = mipid_shutdown,
116}; 116};
117 117
118static void mipid_dev_init(void) 118static void __init mipid_dev_init(void)
119{ 119{
120 const struct omap_lcd_config *conf; 120 const struct omap_lcd_config *conf;
121 121
@@ -126,7 +126,7 @@ static void mipid_dev_init(void)
126 } 126 }
127} 127}
128 128
129static void ads7846_dev_init(void) 129static void __init ads7846_dev_init(void)
130{ 130{
131 if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0) 131 if (gpio_request(ADS7846_PENDOWN_GPIO, "ADS7846 pendown") < 0)
132 printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); 132 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
@@ -170,7 +170,7 @@ static struct hwa742_platform_data nokia770_hwa742_platform_data = {
170 .te_connected = 1, 170 .te_connected = 1,
171}; 171};
172 172
173static void hwa742_dev_init(void) 173static void __init hwa742_dev_init(void)
174{ 174{
175 clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL); 175 clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL);
176 omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data); 176 omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index fb51ce6123d8..c9d38f47845f 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -230,19 +230,6 @@ static struct spi_board_info palmte_spi_info[] __initdata = {
230 }, 230 },
231}; 231};
232 232
233static void palmte_headphones_detect(void *data, int state)
234{
235 if (state) {
236 /* Headphones connected, disable speaker */
237 gpio_set_value(PALMTE_SPEAKER_GPIO, 0);
238 printk(KERN_INFO "PM: speaker off\n");
239 } else {
240 /* Headphones unplugged, re-enable speaker */
241 gpio_set_value(PALMTE_SPEAKER_GPIO, 1);
242 printk(KERN_INFO "PM: speaker on\n");
243 }
244}
245
246static void __init palmte_misc_gpio_setup(void) 233static void __init palmte_misc_gpio_setup(void)
247{ 234{
248 /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */ 235 /* Set TSC2102 PINTDAV pin as input (used by TSC2102 driver) */
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 815a69ce821d..bdc0ac8dc21f 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -26,10 +26,12 @@
26#include <linux/smc91x.h> 26#include <linux/smc91x.h>
27 27
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/system.h>
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 33
34#include <plat/board-voiceblue.h>
33#include <plat/common.h> 35#include <plat/common.h>
34#include <mach/gpio.h> 36#include <mach/gpio.h>
35#include <plat/flash.h> 37#include <plat/flash.h>
@@ -163,52 +165,6 @@ static void __init voiceblue_init_irq(void)
163 omap_init_irq(); 165 omap_init_irq();
164} 166}
165 167
166static void __init voiceblue_init(void)
167{
168 /* mux pins for uarts */
169 omap_cfg_reg(UART1_TX);
170 omap_cfg_reg(UART1_RTS);
171 omap_cfg_reg(UART2_TX);
172 omap_cfg_reg(UART2_RTS);
173 omap_cfg_reg(UART3_TX);
174 omap_cfg_reg(UART3_RX);
175
176 /* Watchdog */
177 gpio_request(0, "Watchdog");
178 /* smc91x reset */
179 gpio_request(7, "SMC91x reset");
180 gpio_direction_output(7, 1);
181 udelay(2); /* wait at least 100ns */
182 gpio_set_value(7, 0);
183 mdelay(50); /* 50ms until PHY ready */
184 /* smc91x interrupt pin */
185 gpio_request(8, "SMC91x irq");
186 /* 16C554 reset*/
187 gpio_request(6, "16C554 reset");
188 gpio_direction_output(6, 0);
189 /* 16C554 interrupt pins */
190 gpio_request(12, "16C554 irq");
191 gpio_request(13, "16C554 irq");
192 gpio_request(14, "16C554 irq");
193 gpio_request(15, "16C554 irq");
194 set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
195 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
196 set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
197 set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
198
199 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
200 omap_board_config = voiceblue_config;
201 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
202 omap_serial_init();
203 omap1_usb_init(&voiceblue_usb_config);
204 omap_register_i2c_bus(1, 100, NULL, 0);
205
206 /* There is a good chance board is going up, so enable power LED
207 * (it is connected through invertor) */
208 omap_writeb(0x00, OMAP_LPG1_LCR);
209 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
210}
211
212static void __init voiceblue_map_io(void) 168static void __init voiceblue_map_io(void)
213{ 169{
214 omap1_map_common_io(); 170 omap1_map_common_io();
@@ -275,8 +231,17 @@ void voiceblue_wdt_ping(void)
275 gpio_set_value(0, wdt_gpio_state); 231 gpio_set_value(0, wdt_gpio_state);
276} 232}
277 233
278void voiceblue_reset(void) 234static void voiceblue_reset(char mode, const char *cmd)
279{ 235{
236 /*
237 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
238 * "Global Software Reset Affects Traffic Controller Frequency".
239 */
240 if (cpu_is_omap5912()) {
241 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL);
242 omap_writew(0x8, ARM_RSTCT1);
243 }
244
280 set_bit(MACHINE_REBOOT, &machine_state); 245 set_bit(MACHINE_REBOOT, &machine_state);
281 voiceblue_wdt_enable(); 246 voiceblue_wdt_enable();
282 while (1) ; 247 while (1) ;
@@ -286,6 +251,54 @@ EXPORT_SYMBOL(voiceblue_wdt_enable);
286EXPORT_SYMBOL(voiceblue_wdt_disable); 251EXPORT_SYMBOL(voiceblue_wdt_disable);
287EXPORT_SYMBOL(voiceblue_wdt_ping); 252EXPORT_SYMBOL(voiceblue_wdt_ping);
288 253
254static void __init voiceblue_init(void)
255{
256 /* mux pins for uarts */
257 omap_cfg_reg(UART1_TX);
258 omap_cfg_reg(UART1_RTS);
259 omap_cfg_reg(UART2_TX);
260 omap_cfg_reg(UART2_RTS);
261 omap_cfg_reg(UART3_TX);
262 omap_cfg_reg(UART3_RX);
263
264 /* Watchdog */
265 gpio_request(0, "Watchdog");
266 /* smc91x reset */
267 gpio_request(7, "SMC91x reset");
268 gpio_direction_output(7, 1);
269 udelay(2); /* wait at least 100ns */
270 gpio_set_value(7, 0);
271 mdelay(50); /* 50ms until PHY ready */
272 /* smc91x interrupt pin */
273 gpio_request(8, "SMC91x irq");
274 /* 16C554 reset*/
275 gpio_request(6, "16C554 reset");
276 gpio_direction_output(6, 0);
277 /* 16C554 interrupt pins */
278 gpio_request(12, "16C554 irq");
279 gpio_request(13, "16C554 irq");
280 gpio_request(14, "16C554 irq");
281 gpio_request(15, "16C554 irq");
282 set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING);
283 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
284 set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING);
285 set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING);
286
287 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
288 omap_board_config = voiceblue_config;
289 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
290 omap_serial_init();
291 omap1_usb_init(&voiceblue_usb_config);
292 omap_register_i2c_bus(1, 100, NULL, 0);
293
294 /* There is a good chance board is going up, so enable power LED
295 * (it is connected through invertor) */
296 omap_writeb(0x00, OMAP_LPG1_LCR);
297 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
298
299 arch_reset = voiceblue_reset;
300}
301
289MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") 302MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
290 /* Maintainer: Ladislav Michl <michl@2n.cz> */ 303 /* Maintainer: Ladislav Michl <michl@2n.cz> */
291 .boot_params = 0x10000100, 304 .boot_params = 0x10000100,
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index 820973666f34..d9af9811dedd 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -10,6 +10,7 @@
10 * 10 *
11 * Multichannel mode not supported. 11 * Multichannel mode not supported.
12 */ 12 */
13#include <linux/ioport.h>
13#include <linux/module.h> 14#include <linux/module.h>
14#include <linux/init.h> 15#include <linux/init.h>
15#include <linux/clk.h> 16#include <linux/clk.h>
@@ -78,100 +79,294 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = {
78}; 79};
79 80
80#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 81#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
82struct resource omap7xx_mcbsp_res[][6] = {
83 {
84 {
85 .start = OMAP7XX_MCBSP1_BASE,
86 .end = OMAP7XX_MCBSP1_BASE + SZ_256,
87 .flags = IORESOURCE_MEM,
88 },
89 {
90 .name = "rx",
91 .start = INT_7XX_McBSP1RX,
92 .flags = IORESOURCE_IRQ,
93 },
94 {
95 .name = "tx",
96 .start = INT_7XX_McBSP1TX,
97 .flags = IORESOURCE_IRQ,
98 },
99 {
100 .name = "rx",
101 .start = OMAP_DMA_MCBSP1_RX,
102 .flags = IORESOURCE_DMA,
103 },
104 {
105 .name = "tx",
106 .start = OMAP_DMA_MCBSP1_TX,
107 .flags = IORESOURCE_DMA,
108 },
109 },
110 {
111 {
112 .start = OMAP7XX_MCBSP2_BASE,
113 .end = OMAP7XX_MCBSP2_BASE + SZ_256,
114 .flags = IORESOURCE_MEM,
115 },
116 {
117 .name = "rx",
118 .start = INT_7XX_McBSP2RX,
119 .flags = IORESOURCE_IRQ,
120 },
121 {
122 .name = "tx",
123 .start = INT_7XX_McBSP2TX,
124 .flags = IORESOURCE_IRQ,
125 },
126 {
127 .name = "rx",
128 .start = OMAP_DMA_MCBSP3_RX,
129 .flags = IORESOURCE_DMA,
130 },
131 {
132 .name = "tx",
133 .start = OMAP_DMA_MCBSP3_TX,
134 .flags = IORESOURCE_DMA,
135 },
136 },
137};
138
139#define omap7xx_mcbsp_res_0 omap7xx_mcbsp_res[0]
140
81static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = { 141static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = {
82 { 142 {
83 .phys_base = OMAP7XX_MCBSP1_BASE,
84 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
85 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
86 .rx_irq = INT_7XX_McBSP1RX,
87 .tx_irq = INT_7XX_McBSP1TX,
88 .ops = &omap1_mcbsp_ops, 143 .ops = &omap1_mcbsp_ops,
89 }, 144 },
90 { 145 {
91 .phys_base = OMAP7XX_MCBSP2_BASE,
92 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
93 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
94 .rx_irq = INT_7XX_McBSP2RX,
95 .tx_irq = INT_7XX_McBSP2TX,
96 .ops = &omap1_mcbsp_ops, 146 .ops = &omap1_mcbsp_ops,
97 }, 147 },
98}; 148};
99#define OMAP7XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap7xx_mcbsp_pdata) 149#define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1])
100#define OMAP7XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) 150#define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res)
101#else 151#else
152#define omap7xx_mcbsp_res_0 NULL
102#define omap7xx_mcbsp_pdata NULL 153#define omap7xx_mcbsp_pdata NULL
103#define OMAP7XX_MCBSP_PDATA_SZ 0 154#define OMAP7XX_MCBSP_RES_SZ 0
104#define OMAP7XX_MCBSP_REG_NUM 0 155#define OMAP7XX_MCBSP_COUNT 0
105#endif 156#endif
106 157
107#ifdef CONFIG_ARCH_OMAP15XX 158#ifdef CONFIG_ARCH_OMAP15XX
159struct resource omap15xx_mcbsp_res[][6] = {
160 {
161 {
162 .start = OMAP1510_MCBSP1_BASE,
163 .end = OMAP1510_MCBSP1_BASE + SZ_256,
164 .flags = IORESOURCE_MEM,
165 },
166 {
167 .name = "rx",
168 .start = INT_McBSP1RX,
169 .flags = IORESOURCE_IRQ,
170 },
171 {
172 .name = "tx",
173 .start = INT_McBSP1TX,
174 .flags = IORESOURCE_IRQ,
175 },
176 {
177 .name = "rx",
178 .start = OMAP_DMA_MCBSP1_RX,
179 .flags = IORESOURCE_DMA,
180 },
181 {
182 .name = "tx",
183 .start = OMAP_DMA_MCBSP1_TX,
184 .flags = IORESOURCE_DMA,
185 },
186 },
187 {
188 {
189 .start = OMAP1510_MCBSP2_BASE,
190 .end = OMAP1510_MCBSP2_BASE + SZ_256,
191 .flags = IORESOURCE_MEM,
192 },
193 {
194 .name = "rx",
195 .start = INT_1510_SPI_RX,
196 .flags = IORESOURCE_IRQ,
197 },
198 {
199 .name = "tx",
200 .start = INT_1510_SPI_TX,
201 .flags = IORESOURCE_IRQ,
202 },
203 {
204 .name = "rx",
205 .start = OMAP_DMA_MCBSP2_RX,
206 .flags = IORESOURCE_DMA,
207 },
208 {
209 .name = "tx",
210 .start = OMAP_DMA_MCBSP2_TX,
211 .flags = IORESOURCE_DMA,
212 },
213 },
214 {
215 {
216 .start = OMAP1510_MCBSP3_BASE,
217 .end = OMAP1510_MCBSP3_BASE + SZ_256,
218 .flags = IORESOURCE_MEM,
219 },
220 {
221 .name = "rx",
222 .start = INT_McBSP3RX,
223 .flags = IORESOURCE_IRQ,
224 },
225 {
226 .name = "tx",
227 .start = INT_McBSP3TX,
228 .flags = IORESOURCE_IRQ,
229 },
230 {
231 .name = "rx",
232 .start = OMAP_DMA_MCBSP3_RX,
233 .flags = IORESOURCE_DMA,
234 },
235 {
236 .name = "tx",
237 .start = OMAP_DMA_MCBSP3_TX,
238 .flags = IORESOURCE_DMA,
239 },
240 },
241};
242
243#define omap15xx_mcbsp_res_0 omap15xx_mcbsp_res[0]
244
108static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { 245static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
109 { 246 {
110 .phys_base = OMAP1510_MCBSP1_BASE,
111 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
112 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
113 .rx_irq = INT_McBSP1RX,
114 .tx_irq = INT_McBSP1TX,
115 .ops = &omap1_mcbsp_ops, 247 .ops = &omap1_mcbsp_ops,
116 }, 248 },
117 { 249 {
118 .phys_base = OMAP1510_MCBSP2_BASE,
119 .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
120 .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
121 .rx_irq = INT_1510_SPI_RX,
122 .tx_irq = INT_1510_SPI_TX,
123 .ops = &omap1_mcbsp_ops, 250 .ops = &omap1_mcbsp_ops,
124 }, 251 },
125 { 252 {
126 .phys_base = OMAP1510_MCBSP3_BASE,
127 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
128 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
129 .rx_irq = INT_McBSP3RX,
130 .tx_irq = INT_McBSP3TX,
131 .ops = &omap1_mcbsp_ops, 253 .ops = &omap1_mcbsp_ops,
132 }, 254 },
133}; 255};
134#define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) 256#define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1])
135#define OMAP15XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) 257#define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res)
136#else 258#else
259#define omap15xx_mcbsp_res_0 NULL
137#define omap15xx_mcbsp_pdata NULL 260#define omap15xx_mcbsp_pdata NULL
138#define OMAP15XX_MCBSP_PDATA_SZ 0 261#define OMAP15XX_MCBSP_RES_SZ 0
139#define OMAP15XX_MCBSP_REG_NUM 0 262#define OMAP15XX_MCBSP_COUNT 0
140#endif 263#endif
141 264
142#ifdef CONFIG_ARCH_OMAP16XX 265#ifdef CONFIG_ARCH_OMAP16XX
266struct resource omap16xx_mcbsp_res[][6] = {
267 {
268 {
269 .start = OMAP1610_MCBSP1_BASE,
270 .end = OMAP1610_MCBSP1_BASE + SZ_256,
271 .flags = IORESOURCE_MEM,
272 },
273 {
274 .name = "rx",
275 .start = INT_McBSP1RX,
276 .flags = IORESOURCE_IRQ,
277 },
278 {
279 .name = "tx",
280 .start = INT_McBSP1TX,
281 .flags = IORESOURCE_IRQ,
282 },
283 {
284 .name = "rx",
285 .start = OMAP_DMA_MCBSP1_RX,
286 .flags = IORESOURCE_DMA,
287 },
288 {
289 .name = "tx",
290 .start = OMAP_DMA_MCBSP1_TX,
291 .flags = IORESOURCE_DMA,
292 },
293 },
294 {
295 {
296 .start = OMAP1610_MCBSP2_BASE,
297 .end = OMAP1610_MCBSP2_BASE + SZ_256,
298 .flags = IORESOURCE_MEM,
299 },
300 {
301 .name = "rx",
302 .start = INT_1610_McBSP2_RX,
303 .flags = IORESOURCE_IRQ,
304 },
305 {
306 .name = "tx",
307 .start = INT_1610_McBSP2_TX,
308 .flags = IORESOURCE_IRQ,
309 },
310 {
311 .name = "rx",
312 .start = OMAP_DMA_MCBSP2_RX,
313 .flags = IORESOURCE_DMA,
314 },
315 {
316 .name = "tx",
317 .start = OMAP_DMA_MCBSP2_TX,
318 .flags = IORESOURCE_DMA,
319 },
320 },
321 {
322 {
323 .start = OMAP1610_MCBSP3_BASE,
324 .end = OMAP1610_MCBSP3_BASE + SZ_256,
325 .flags = IORESOURCE_MEM,
326 },
327 {
328 .name = "rx",
329 .start = INT_McBSP3RX,
330 .flags = IORESOURCE_IRQ,
331 },
332 {
333 .name = "tx",
334 .start = INT_McBSP3TX,
335 .flags = IORESOURCE_IRQ,
336 },
337 {
338 .name = "rx",
339 .start = OMAP_DMA_MCBSP3_RX,
340 .flags = IORESOURCE_DMA,
341 },
342 {
343 .name = "tx",
344 .start = OMAP_DMA_MCBSP3_TX,
345 .flags = IORESOURCE_DMA,
346 },
347 },
348};
349
350#define omap16xx_mcbsp_res_0 omap16xx_mcbsp_res[0]
351
143static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { 352static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
144 { 353 {
145 .phys_base = OMAP1610_MCBSP1_BASE,
146 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
147 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
148 .rx_irq = INT_McBSP1RX,
149 .tx_irq = INT_McBSP1TX,
150 .ops = &omap1_mcbsp_ops, 354 .ops = &omap1_mcbsp_ops,
151 }, 355 },
152 { 356 {
153 .phys_base = OMAP1610_MCBSP2_BASE,
154 .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
155 .dma_tx_sync = OMAP_DMA_MCBSP2_TX,
156 .rx_irq = INT_1610_McBSP2_RX,
157 .tx_irq = INT_1610_McBSP2_TX,
158 .ops = &omap1_mcbsp_ops, 357 .ops = &omap1_mcbsp_ops,
159 }, 358 },
160 { 359 {
161 .phys_base = OMAP1610_MCBSP3_BASE,
162 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
163 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
164 .rx_irq = INT_McBSP3RX,
165 .tx_irq = INT_McBSP3TX,
166 .ops = &omap1_mcbsp_ops, 360 .ops = &omap1_mcbsp_ops,
167 }, 361 },
168}; 362};
169#define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) 363#define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1])
170#define OMAP16XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1) 364#define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res)
171#else 365#else
366#define omap16xx_mcbsp_res_0 NULL
172#define omap16xx_mcbsp_pdata NULL 367#define omap16xx_mcbsp_pdata NULL
173#define OMAP16XX_MCBSP_PDATA_SZ 0 368#define OMAP16XX_MCBSP_RES_SZ 0
174#define OMAP16XX_MCBSP_REG_NUM 0 369#define OMAP16XX_MCBSP_COUNT 0
175#endif 370#endif
176 371
177static int __init omap1_mcbsp_init(void) 372static int __init omap1_mcbsp_init(void)
@@ -179,16 +374,12 @@ static int __init omap1_mcbsp_init(void)
179 if (!cpu_class_is_omap1()) 374 if (!cpu_class_is_omap1())
180 return -ENODEV; 375 return -ENODEV;
181 376
182 if (cpu_is_omap7xx()) { 377 if (cpu_is_omap7xx())
183 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ; 378 omap_mcbsp_count = OMAP7XX_MCBSP_COUNT;
184 omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16); 379 else if (cpu_is_omap15xx())
185 } else if (cpu_is_omap15xx()) { 380 omap_mcbsp_count = OMAP15XX_MCBSP_COUNT;
186 omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; 381 else if (cpu_is_omap16xx())
187 omap_mcbsp_cache_size = OMAP15XX_MCBSP_REG_NUM * sizeof(u16); 382 omap_mcbsp_count = OMAP16XX_MCBSP_COUNT;
188 } else if (cpu_is_omap16xx()) {
189 omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ;
190 omap_mcbsp_cache_size = OMAP16XX_MCBSP_REG_NUM * sizeof(u16);
191 }
192 383
193 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), 384 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
194 GFP_KERNEL); 385 GFP_KERNEL);
@@ -196,16 +387,22 @@ static int __init omap1_mcbsp_init(void)
196 return -ENOMEM; 387 return -ENOMEM;
197 388
198 if (cpu_is_omap7xx()) 389 if (cpu_is_omap7xx())
199 omap_mcbsp_register_board_cfg(omap7xx_mcbsp_pdata, 390 omap_mcbsp_register_board_cfg(omap7xx_mcbsp_res_0,
200 OMAP7XX_MCBSP_PDATA_SZ); 391 OMAP7XX_MCBSP_RES_SZ,
392 omap7xx_mcbsp_pdata,
393 OMAP7XX_MCBSP_COUNT);
201 394
202 if (cpu_is_omap15xx()) 395 if (cpu_is_omap15xx())
203 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, 396 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_res_0,
204 OMAP15XX_MCBSP_PDATA_SZ); 397 OMAP15XX_MCBSP_RES_SZ,
398 omap15xx_mcbsp_pdata,
399 OMAP15XX_MCBSP_COUNT);
205 400
206 if (cpu_is_omap16xx()) 401 if (cpu_is_omap16xx())
207 omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, 402 omap_mcbsp_register_board_cfg(omap16xx_mcbsp_res_0,
208 OMAP16XX_MCBSP_PDATA_SZ); 403 OMAP16XX_MCBSP_RES_SZ,
404 omap16xx_mcbsp_pdata,
405 OMAP16XX_MCBSP_COUNT);
209 406
210 return omap_mcbsp_init(); 407 return omap_mcbsp_init();
211} 408}
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
new file mode 100644
index 000000000000..ad951ee69205
--- /dev/null
+++ b/arch/arm/mach-omap1/reset.c
@@ -0,0 +1,25 @@
1/*
2 * OMAP1 reset support
3 */
4#include <linux/kernel.h>
5#include <linux/io.h>
6
7#include <mach/hardware.h>
8#include <mach/system.h>
9#include <plat/prcm.h>
10
11void omap1_arch_reset(char mode, const char *cmd)
12{
13 /*
14 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
15 * "Global Software Reset Affects Traffic Controller Frequency".
16 */
17 if (cpu_is_omap5912()) {
18 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL);
19 omap_writew(0x8, ARM_RSTCT1);
20 }
21
22 omap_writew(1, ARM_RSTCT1);
23}
24
25void (*arch_reset)(char, const char *) = omap1_arch_reset;
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 1a2cf6226a55..b9d8a7b2a862 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -53,25 +53,30 @@ config ARCH_OMAP4
53comment "OMAP Core Type" 53comment "OMAP Core Type"
54 depends on ARCH_OMAP2 54 depends on ARCH_OMAP2
55 55
56config ARCH_OMAP2420 56config SOC_OMAP2420
57 bool "OMAP2420 support" 57 bool "OMAP2420 support"
58 depends on ARCH_OMAP2 58 depends on ARCH_OMAP2
59 default y 59 default y
60 select OMAP_DM_TIMER 60 select OMAP_DM_TIMER
61 select ARCH_OMAP_OTG 61 select ARCH_OMAP_OTG
62 62
63config ARCH_OMAP2430 63config SOC_OMAP2430
64 bool "OMAP2430 support" 64 bool "OMAP2430 support"
65 depends on ARCH_OMAP2 65 depends on ARCH_OMAP2
66 default y 66 default y
67 select ARCH_OMAP_OTG 67 select ARCH_OMAP_OTG
68 68
69config ARCH_OMAP3430 69config SOC_OMAP3430
70 bool "OMAP3430 support" 70 bool "OMAP3430 support"
71 depends on ARCH_OMAP3 71 depends on ARCH_OMAP3
72 default y 72 default y
73 select ARCH_OMAP_OTG 73 select ARCH_OMAP_OTG
74 74
75config SOC_OMAPTI816X
76 bool "TI816X support"
77 depends on ARCH_OMAP3
78 default y
79
75config OMAP_PACKAGE_ZAF 80config OMAP_PACKAGE_ZAF
76 bool 81 bool
77 82
@@ -106,25 +111,25 @@ config MACH_OMAP_GENERIC
106 111
107config MACH_OMAP2_TUSB6010 112config MACH_OMAP2_TUSB6010
108 bool 113 bool
109 depends on ARCH_OMAP2 && ARCH_OMAP2420 114 depends on ARCH_OMAP2 && SOC_OMAP2420
110 default y if MACH_NOKIA_N8X0 115 default y if MACH_NOKIA_N8X0
111 116
112config MACH_OMAP_H4 117config MACH_OMAP_H4
113 bool "OMAP 2420 H4 board" 118 bool "OMAP 2420 H4 board"
114 depends on ARCH_OMAP2420 119 depends on SOC_OMAP2420
115 default y 120 default y
116 select OMAP_PACKAGE_ZAF 121 select OMAP_PACKAGE_ZAF
117 select OMAP_DEBUG_DEVICES 122 select OMAP_DEBUG_DEVICES
118 123
119config MACH_OMAP_APOLLON 124config MACH_OMAP_APOLLON
120 bool "OMAP 2420 Apollon board" 125 bool "OMAP 2420 Apollon board"
121 depends on ARCH_OMAP2420 126 depends on SOC_OMAP2420
122 default y 127 default y
123 select OMAP_PACKAGE_ZAC 128 select OMAP_PACKAGE_ZAC
124 129
125config MACH_OMAP_2430SDP 130config MACH_OMAP_2430SDP
126 bool "OMAP 2430 SDP board" 131 bool "OMAP 2430 SDP board"
127 depends on ARCH_OMAP2430 132 depends on SOC_OMAP2430
128 default y 133 default y
129 select OMAP_PACKAGE_ZAC 134 select OMAP_PACKAGE_ZAC
130 135
@@ -219,7 +224,7 @@ config MACH_NOKIA_N810_WIMAX
219 224
220config MACH_NOKIA_N8X0 225config MACH_NOKIA_N8X0
221 bool "Nokia N800/N810" 226 bool "Nokia N800/N810"
222 depends on ARCH_OMAP2420 227 depends on SOC_OMAP2420
223 default y 228 default y
224 select OMAP_PACKAGE_ZAC 229 select OMAP_PACKAGE_ZAC
225 select MACH_NOKIA_N800 230 select MACH_NOKIA_N800
@@ -294,12 +299,18 @@ config MACH_OMAP_3630SDP
294 default y 299 default y
295 select OMAP_PACKAGE_CBP 300 select OMAP_PACKAGE_CBP
296 301
302config MACH_TI8168EVM
303 bool "TI8168 Evaluation Module"
304 depends on SOC_OMAPTI816X
305 default y
306
297config MACH_OMAP_4430SDP 307config MACH_OMAP_4430SDP
298 bool "OMAP 4430 SDP board" 308 bool "OMAP 4430 SDP board"
299 default y 309 default y
300 depends on ARCH_OMAP4 310 depends on ARCH_OMAP4
301 select OMAP_PACKAGE_CBL 311 select OMAP_PACKAGE_CBL
302 select OMAP_PACKAGE_CBS 312 select OMAP_PACKAGE_CBS
313 select REGULATOR_FIXED_VOLTAGE
303 314
304config MACH_OMAP4_PANDA 315config MACH_OMAP4_PANDA
305 bool "OMAP4 Panda Board" 316 bool "OMAP4 Panda Board"
@@ -307,6 +318,7 @@ config MACH_OMAP4_PANDA
307 depends on ARCH_OMAP4 318 depends on ARCH_OMAP4
308 select OMAP_PACKAGE_CBL 319 select OMAP_PACKAGE_CBL
309 select OMAP_PACKAGE_CBS 320 select OMAP_PACKAGE_CBS
321 select REGULATOR_FIXED_VOLTAGE
310 322
311config OMAP3_EMU 323config OMAP3_EMU
312 bool "OMAP3 debugging peripherals" 324 bool "OMAP3 debugging peripherals"
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 1c0c2b02d870..534d89a60dd9 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -31,8 +31,8 @@ AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
31AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec) 31AFLAGS_omap44xx-smc.o :=-Wa,-march=armv7-a$(plus_sec)
32 32
33# Functions loaded to SRAM 33# Functions loaded to SRAM
34obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o 34obj-$(CONFIG_SOC_OMAP2420) += sram242x.o
35obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o 35obj-$(CONFIG_SOC_OMAP2430) += sram243x.o
36obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o 36obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o
37 37
38AFLAGS_sram242x.o :=-Wa,-march=armv6 38AFLAGS_sram242x.o :=-Wa,-march=armv6
@@ -40,8 +40,8 @@ AFLAGS_sram243x.o :=-Wa,-march=armv6
40AFLAGS_sram34xx.o :=-Wa,-march=armv7-a 40AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
41 41
42# Pin multiplexing 42# Pin multiplexing
43obj-$(CONFIG_ARCH_OMAP2420) += mux2420.o 43obj-$(CONFIG_SOC_OMAP2420) += mux2420.o
44obj-$(CONFIG_ARCH_OMAP2430) += mux2430.o 44obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
45obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o 45obj-$(CONFIG_ARCH_OMAP3) += mux34xx.o
46obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o 46obj-$(CONFIG_ARCH_OMAP4) += mux44xx.o
47 47
@@ -102,39 +102,49 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \
102 102
103# PRCM clockdomain control 103# PRCM clockdomain control
104obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ 104obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
105 clockdomain2xxx_3xxx.o \
105 clockdomains2xxx_3xxx_data.o 106 clockdomains2xxx_3xxx_data.o
106obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ 107obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \
108 clockdomain2xxx_3xxx.o \
107 clockdomains2xxx_3xxx_data.o 109 clockdomains2xxx_3xxx_data.o
108obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ 110obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \
111 clockdomain44xx.o \
109 clockdomains44xx_data.o 112 clockdomains44xx_data.o
113
110# Clock framework 114# Clock framework
111obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \ 115obj-$(CONFIG_ARCH_OMAP2) += $(clock-common) clock2xxx.o \
112 clkt2xxx_sys.o \ 116 clkt2xxx_sys.o \
113 clkt2xxx_dpllcore.o \ 117 clkt2xxx_dpllcore.o \
114 clkt2xxx_virt_prcm_set.o \ 118 clkt2xxx_virt_prcm_set.o \
115 clkt2xxx_apll.o clkt2xxx_osc.o 119 clkt2xxx_apll.o clkt2xxx_osc.o \
116obj-$(CONFIG_ARCH_OMAP2420) += clock2420_data.o 120 clkt2xxx_dpll.o clkt_iclk.o
117obj-$(CONFIG_ARCH_OMAP2430) += clock2430.o clock2430_data.o 121obj-$(CONFIG_SOC_OMAP2420) += clock2420_data.o
122obj-$(CONFIG_SOC_OMAP2430) += clock2430.o clock2430_data.o
118obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \ 123obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) clock3xxx.o \
119 clock34xx.o clkt34xx_dpll3m2.o \ 124 clock34xx.o clkt34xx_dpll3m2.o \
120 clock3517.o clock36xx.o \ 125 clock3517.o clock36xx.o \
121 dpll3xxx.o clock3xxx_data.o 126 dpll3xxx.o clock3xxx_data.o \
127 clkt_iclk.o
122obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \ 128obj-$(CONFIG_ARCH_OMAP4) += $(clock-common) clock44xx_data.o \
123 dpll3xxx.o 129 dpll3xxx.o dpll44xx.o
124 130
125# OMAP2 clock rate set data (old "OPP" data) 131# OMAP2 clock rate set data (old "OPP" data)
126obj-$(CONFIG_ARCH_OMAP2420) += opp2420_data.o 132obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o
127obj-$(CONFIG_ARCH_OMAP2430) += opp2430_data.o 133obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o
128 134
129# hwmod data 135# hwmod data
130obj-$(CONFIG_ARCH_OMAP2420) += omap_hwmod_2420_data.o 136obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2420_data.o
131obj-$(CONFIG_ARCH_OMAP2430) += omap_hwmod_2430_data.o 137obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o
132obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o 138obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o
133obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o 139obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o
134 140
135# EMU peripherals 141# EMU peripherals
136obj-$(CONFIG_OMAP3_EMU) += emu.o 142obj-$(CONFIG_OMAP3_EMU) += emu.o
137 143
144# L3 interconnect
145obj-$(CONFIG_ARCH_OMAP3) += omap_l3_smx.o
146obj-$(CONFIG_ARCH_OMAP4) += omap_l3_noc.o
147
138obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o 148obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
139mailbox_mach-objs := mailbox.o 149mailbox_mach-objs := mailbox.o
140 150
@@ -218,12 +228,14 @@ obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \
218 hsmmc.o \ 228 hsmmc.o \
219 omap_phy_internal.o 229 omap_phy_internal.o
220 230
221obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o 231obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \
232 omap_phy_internal.o \
222 233
223obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o 234obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o
224 235
225obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ 236obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \
226 hsmmc.o 237 hsmmc.o
238obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o
227# Platform specific device init code 239# Platform specific device init code
228usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o 240usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o
229obj-y += $(usbfs-m) $(usbfs-y) 241obj-y += $(usbfs-m) $(usbfs-y)
@@ -242,3 +254,7 @@ obj-y += $(smc91x-m) $(smc91x-y)
242 254
243smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o 255smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o
244obj-y += $(smsc911x-m) $(smsc911x-y) 256obj-y += $(smsc911x-m) $(smsc911x-y)
257obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o
258
259disp-$(CONFIG_OMAP2_DSS) := display.o
260obj-y += $(disp-m) $(disp-y)
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index e0661777f599..1fa6bb896f41 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -22,6 +22,7 @@
22#include <linux/mmc/host.h> 22#include <linux/mmc/host.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/i2c/twl.h> 24#include <linux/i2c/twl.h>
25#include <linux/regulator/machine.h>
25#include <linux/err.h> 26#include <linux/err.h>
26#include <linux/clk.h> 27#include <linux/clk.h>
27#include <linux/io.h> 28#include <linux/io.h>
@@ -139,15 +140,31 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = {
139 {OMAP_TAG_LCD, &sdp2430_lcd_config}, 140 {OMAP_TAG_LCD, &sdp2430_lcd_config},
140}; 141};
141 142
142static void __init omap_2430sdp_init_irq(void) 143static void __init omap_2430sdp_init_early(void)
143{ 144{
144 omap_board_config = sdp2430_config;
145 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
146 omap2_init_common_infrastructure(); 145 omap2_init_common_infrastructure();
147 omap2_init_common_devices(NULL, NULL); 146 omap2_init_common_devices(NULL, NULL);
148 omap_init_irq();
149} 147}
150 148
149static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = {
150 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
151};
152
153/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
154static struct regulator_init_data sdp2430_vmmc1 = {
155 .constraints = {
156 .min_uV = 1850000,
157 .max_uV = 3150000,
158 .valid_modes_mask = REGULATOR_MODE_NORMAL
159 | REGULATOR_MODE_STANDBY,
160 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
161 | REGULATOR_CHANGE_MODE
162 | REGULATOR_CHANGE_STATUS,
163 },
164 .num_consumer_supplies = ARRAY_SIZE(sdp2430_vmmc1_supplies),
165 .consumer_supplies = &sdp2430_vmmc1_supplies[0],
166};
167
151static struct twl4030_gpio_platform_data sdp2430_gpio_data = { 168static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
152 .gpio_base = OMAP_MAX_GPIO_LINES, 169 .gpio_base = OMAP_MAX_GPIO_LINES,
153 .irq_base = TWL4030_GPIO_IRQ_BASE, 170 .irq_base = TWL4030_GPIO_IRQ_BASE,
@@ -160,6 +177,7 @@ static struct twl4030_platform_data sdp2430_twldata = {
160 177
161 /* platform_data for children goes here */ 178 /* platform_data for children goes here */
162 .gpio = &sdp2430_gpio_data, 179 .gpio = &sdp2430_gpio_data,
180 .vmmc1 = &sdp2430_vmmc1,
163}; 181};
164 182
165static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = { 183static struct i2c_board_info __initdata sdp2430_i2c_boardinfo[] = {
@@ -226,6 +244,9 @@ static void __init omap_2430sdp_init(void)
226 244
227 omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); 245 omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC);
228 246
247 omap_board_config = sdp2430_config;
248 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
249
229 omap2430_i2c_init(); 250 omap2430_i2c_init();
230 251
231 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); 252 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
@@ -253,9 +274,10 @@ static void __init omap_2430sdp_map_io(void)
253MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") 274MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
254 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 275 /* Maintainer: Syed Khasim - Texas Instruments Inc */
255 .boot_params = 0x80000100, 276 .boot_params = 0x80000100,
256 .map_io = omap_2430sdp_map_io,
257 .reserve = omap_reserve, 277 .reserve = omap_reserve,
258 .init_irq = omap_2430sdp_init_irq, 278 .map_io = omap_2430sdp_map_io,
279 .init_early = omap_2430sdp_init_early,
280 .init_irq = omap_init_irq,
259 .init_machine = omap_2430sdp_init, 281 .init_machine = omap_2430sdp_init,
260 .timer = &omap_timer, 282 .timer = &omap_timer,
261MACHINE_END 283MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index d4e41ef86aa5..5464bec156ad 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -307,34 +307,16 @@ static struct omap_dss_board_info sdp3430_dss_data = {
307 .default_device = &sdp3430_lcd_device, 307 .default_device = &sdp3430_lcd_device,
308}; 308};
309 309
310static struct platform_device sdp3430_dss_device = { 310static struct regulator_consumer_supply sdp3430_vdda_dac_supply =
311 .name = "omapdss", 311 REGULATOR_SUPPLY("vdda_dac", "omapdss");
312 .id = -1,
313 .dev = {
314 .platform_data = &sdp3430_dss_data,
315 },
316};
317
318static struct regulator_consumer_supply sdp3430_vdda_dac_supply = {
319 .supply = "vdda_dac",
320 .dev = &sdp3430_dss_device.dev,
321};
322
323static struct platform_device *sdp3430_devices[] __initdata = {
324 &sdp3430_dss_device,
325};
326 312
327static struct omap_board_config_kernel sdp3430_config[] __initdata = { 313static struct omap_board_config_kernel sdp3430_config[] __initdata = {
328}; 314};
329 315
330static void __init omap_3430sdp_init_irq(void) 316static void __init omap_3430sdp_init_early(void)
331{ 317{
332 omap_board_config = sdp3430_config;
333 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
334 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
335 omap2_init_common_infrastructure(); 318 omap2_init_common_infrastructure();
336 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL); 319 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
337 omap_init_irq();
338} 320}
339 321
340static int sdp3430_batt_table[] = { 322static int sdp3430_batt_table[] = {
@@ -370,18 +352,6 @@ static struct omap2_hsmmc_info mmc[] = {
370 {} /* Terminator */ 352 {} /* Terminator */
371}; 353};
372 354
373static struct regulator_consumer_supply sdp3430_vmmc1_supply = {
374 .supply = "vmmc",
375};
376
377static struct regulator_consumer_supply sdp3430_vsim_supply = {
378 .supply = "vmmc_aux",
379};
380
381static struct regulator_consumer_supply sdp3430_vmmc2_supply = {
382 .supply = "vmmc",
383};
384
385static int sdp3430_twl_gpio_setup(struct device *dev, 355static int sdp3430_twl_gpio_setup(struct device *dev,
386 unsigned gpio, unsigned ngpio) 356 unsigned gpio, unsigned ngpio)
387{ 357{
@@ -392,13 +362,6 @@ static int sdp3430_twl_gpio_setup(struct device *dev,
392 mmc[1].gpio_cd = gpio + 1; 362 mmc[1].gpio_cd = gpio + 1;
393 omap2_hsmmc_init(mmc); 363 omap2_hsmmc_init(mmc);
394 364
395 /* link regulators to MMC adapters ... we "know" the
396 * regulators will be set up only *after* we return.
397 */
398 sdp3430_vmmc1_supply.dev = mmc[0].dev;
399 sdp3430_vsim_supply.dev = mmc[0].dev;
400 sdp3430_vmmc2_supply.dev = mmc[1].dev;
401
402 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ 365 /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */
403 gpio_request(gpio + 7, "sub_lcd_en_bkl"); 366 gpio_request(gpio + 7, "sub_lcd_en_bkl");
404 gpio_direction_output(gpio + 7, 0); 367 gpio_direction_output(gpio + 7, 0);
@@ -427,6 +390,34 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = {
427 .irq_line = 1, 390 .irq_line = 1,
428}; 391};
429 392
393/* regulator consumer mappings */
394
395/* ads7846 on SPI */
396static struct regulator_consumer_supply sdp3430_vaux3_supplies[] = {
397 REGULATOR_SUPPLY("vcc", "spi1.0"),
398};
399
400static struct regulator_consumer_supply sdp3430_vdda_dac_supplies[] = {
401 REGULATOR_SUPPLY("vdda_dac", "omapdss"),
402};
403
404/* VPLL2 for digital video outputs */
405static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
406 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
407};
408
409static struct regulator_consumer_supply sdp3430_vmmc1_supplies[] = {
410 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
411};
412
413static struct regulator_consumer_supply sdp3430_vsim_supplies[] = {
414 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"),
415};
416
417static struct regulator_consumer_supply sdp3430_vmmc2_supplies[] = {
418 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
419};
420
430/* 421/*
431 * Apply all the fixed voltages since most versions of U-Boot 422 * Apply all the fixed voltages since most versions of U-Boot
432 * don't bother with that initialization. 423 * don't bother with that initialization.
@@ -469,6 +460,8 @@ static struct regulator_init_data sdp3430_vaux3 = {
469 .valid_ops_mask = REGULATOR_CHANGE_MODE 460 .valid_ops_mask = REGULATOR_CHANGE_MODE
470 | REGULATOR_CHANGE_STATUS, 461 | REGULATOR_CHANGE_STATUS,
471 }, 462 },
463 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vaux3_supplies),
464 .consumer_supplies = sdp3430_vaux3_supplies,
472}; 465};
473 466
474/* VAUX4 for OMAP VDD_CSI2 (camera) */ 467/* VAUX4 for OMAP VDD_CSI2 (camera) */
@@ -495,8 +488,8 @@ static struct regulator_init_data sdp3430_vmmc1 = {
495 | REGULATOR_CHANGE_MODE 488 | REGULATOR_CHANGE_MODE
496 | REGULATOR_CHANGE_STATUS, 489 | REGULATOR_CHANGE_STATUS,
497 }, 490 },
498 .num_consumer_supplies = 1, 491 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc1_supplies),
499 .consumer_supplies = &sdp3430_vmmc1_supply, 492 .consumer_supplies = sdp3430_vmmc1_supplies,
500}; 493};
501 494
502/* VMMC2 for MMC2 card */ 495/* VMMC2 for MMC2 card */
@@ -510,8 +503,8 @@ static struct regulator_init_data sdp3430_vmmc2 = {
510 .valid_ops_mask = REGULATOR_CHANGE_MODE 503 .valid_ops_mask = REGULATOR_CHANGE_MODE
511 | REGULATOR_CHANGE_STATUS, 504 | REGULATOR_CHANGE_STATUS,
512 }, 505 },
513 .num_consumer_supplies = 1, 506 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vmmc2_supplies),
514 .consumer_supplies = &sdp3430_vmmc2_supply, 507 .consumer_supplies = sdp3430_vmmc2_supplies,
515}; 508};
516 509
517/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ 510/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */
@@ -525,8 +518,8 @@ static struct regulator_init_data sdp3430_vsim = {
525 | REGULATOR_CHANGE_MODE 518 | REGULATOR_CHANGE_MODE
526 | REGULATOR_CHANGE_STATUS, 519 | REGULATOR_CHANGE_STATUS,
527 }, 520 },
528 .num_consumer_supplies = 1, 521 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vsim_supplies),
529 .consumer_supplies = &sdp3430_vsim_supply, 522 .consumer_supplies = sdp3430_vsim_supplies,
530}; 523};
531 524
532/* VDAC for DSS driving S-Video */ 525/* VDAC for DSS driving S-Video */
@@ -540,16 +533,8 @@ static struct regulator_init_data sdp3430_vdac = {
540 .valid_ops_mask = REGULATOR_CHANGE_MODE 533 .valid_ops_mask = REGULATOR_CHANGE_MODE
541 | REGULATOR_CHANGE_STATUS, 534 | REGULATOR_CHANGE_STATUS,
542 }, 535 },
543 .num_consumer_supplies = 1, 536 .num_consumer_supplies = ARRAY_SIZE(sdp3430_vdda_dac_supplies),
544 .consumer_supplies = &sdp3430_vdda_dac_supply, 537 .consumer_supplies = sdp3430_vdda_dac_supplies,
545};
546
547/* VPLL2 for digital video outputs */
548static struct regulator_consumer_supply sdp3430_vpll2_supplies[] = {
549 {
550 .supply = "vdds_dsi",
551 .dev = &sdp3430_dss_device.dev,
552 }
553}; 538};
554 539
555static struct regulator_init_data sdp3430_vpll2 = { 540static struct regulator_init_data sdp3430_vpll2 = {
@@ -567,9 +552,7 @@ static struct regulator_init_data sdp3430_vpll2 = {
567 .consumer_supplies = sdp3430_vpll2_supplies, 552 .consumer_supplies = sdp3430_vpll2_supplies,
568}; 553};
569 554
570static struct twl4030_codec_audio_data sdp3430_audio = { 555static struct twl4030_codec_audio_data sdp3430_audio;
571 .audio_mclk = 26000000,
572};
573 556
574static struct twl4030_codec_data sdp3430_codec = { 557static struct twl4030_codec_data sdp3430_codec = {
575 .audio_mclk = 26000000, 558 .audio_mclk = 26000000,
@@ -800,8 +783,11 @@ static struct omap_musb_board_data musb_board_data = {
800static void __init omap_3430sdp_init(void) 783static void __init omap_3430sdp_init(void)
801{ 784{
802 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 785 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
786 omap_board_config = sdp3430_config;
787 omap_board_config_size = ARRAY_SIZE(sdp3430_config);
788 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
803 omap3430_i2c_init(); 789 omap3430_i2c_init();
804 platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices)); 790 omap_display_init(&sdp3430_dss_data);
805 if (omap_rev() > OMAP3430_REV_ES1_0) 791 if (omap_rev() > OMAP3430_REV_ES1_0)
806 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; 792 ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2;
807 else 793 else
@@ -813,7 +799,7 @@ static void __init omap_3430sdp_init(void)
813 omap_serial_init(); 799 omap_serial_init();
814 usb_musb_init(&musb_board_data); 800 usb_musb_init(&musb_board_data);
815 board_smc91x_init(); 801 board_smc91x_init();
816 board_flash_init(sdp_flash_partitions, chip_sel_3430); 802 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
817 sdp3430_display_init(); 803 sdp3430_display_init();
818 enable_board_wakeup_source(); 804 enable_board_wakeup_source();
819 usb_ehci_init(&ehci_pdata); 805 usb_ehci_init(&ehci_pdata);
@@ -822,9 +808,10 @@ static void __init omap_3430sdp_init(void)
822MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") 808MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
823 /* Maintainer: Syed Khasim - Texas Instruments Inc */ 809 /* Maintainer: Syed Khasim - Texas Instruments Inc */
824 .boot_params = 0x80000100, 810 .boot_params = 0x80000100,
825 .map_io = omap3_map_io,
826 .reserve = omap_reserve, 811 .reserve = omap_reserve,
827 .init_irq = omap_3430sdp_init_irq, 812 .map_io = omap3_map_io,
813 .init_early = omap_3430sdp_init_early,
814 .init_irq = omap_init_irq,
828 .init_machine = omap_3430sdp_init, 815 .init_machine = omap_3430sdp_init,
829 .timer = &omap_timer, 816 .timer = &omap_timer,
830MACHINE_END 817MACHINE_END
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 62645640f5e4..c4e22b32e47f 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -11,6 +11,7 @@
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/input.h> 12#include <linux/input.h>
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/mtd/nand.h>
14 15
15#include <asm/mach-types.h> 16#include <asm/mach-types.h>
16#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
@@ -69,14 +70,11 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
69static struct omap_board_config_kernel sdp_config[] __initdata = { 70static struct omap_board_config_kernel sdp_config[] __initdata = {
70}; 71};
71 72
72static void __init omap_sdp_init_irq(void) 73static void __init omap_sdp_init_early(void)
73{ 74{
74 omap_board_config = sdp_config;
75 omap_board_config_size = ARRAY_SIZE(sdp_config);
76 omap2_init_common_infrastructure(); 75 omap2_init_common_infrastructure();
77 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, 76 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
78 h8mbx00u0mer0em_sdrc_params); 77 h8mbx00u0mer0em_sdrc_params);
79 omap_init_irq();
80} 78}
81 79
82#ifdef CONFIG_OMAP_MUX 80#ifdef CONFIG_OMAP_MUX
@@ -206,19 +204,22 @@ static struct flash_partitions sdp_flash_partitions[] = {
206static void __init omap_sdp_init(void) 204static void __init omap_sdp_init(void)
207{ 205{
208 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); 206 omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
207 omap_board_config = sdp_config;
208 omap_board_config_size = ARRAY_SIZE(sdp_config);
209 zoom_peripherals_init(); 209 zoom_peripherals_init();
210 zoom_display_init(); 210 zoom_display_init();
211 board_smc91x_init(); 211 board_smc91x_init();
212 board_flash_init(sdp_flash_partitions, chip_sel_sdp); 212 board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
213 enable_board_wakeup_source(); 213 enable_board_wakeup_source();
214 usb_ehci_init(&ehci_pdata); 214 usb_ehci_init(&ehci_pdata);
215} 215}
216 216
217MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") 217MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
218 .boot_params = 0x80000100, 218 .boot_params = 0x80000100,
219 .map_io = omap3_map_io,
220 .reserve = omap_reserve, 219 .reserve = omap_reserve,
221 .init_irq = omap_sdp_init_irq, 220 .map_io = omap3_map_io,
221 .init_early = omap_sdp_init_early,
222 .init_irq = omap_init_irq,
222 .init_machine = omap_sdp_init, 223 .init_machine = omap_sdp_init,
223 .timer = &omap_timer, 224 .timer = &omap_timer,
224MACHINE_END 225MACHINE_END
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 07d1b20b1148..85805d432e38 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -35,6 +35,7 @@
35#include <plat/common.h> 35#include <plat/common.h>
36#include <plat/usb.h> 36#include <plat/usb.h>
37#include <plat/mmc.h> 37#include <plat/mmc.h>
38#include <plat/omap4-keypad.h>
38 39
39#include "mux.h" 40#include "mux.h"
40#include "hsmmc.h" 41#include "hsmmc.h"
@@ -44,10 +45,93 @@
44#define ETH_KS8851_IRQ 34 45#define ETH_KS8851_IRQ 34
45#define ETH_KS8851_POWER_ON 48 46#define ETH_KS8851_POWER_ON 48
46#define ETH_KS8851_QUART 138 47#define ETH_KS8851_QUART 138
47#define OMAP4SDP_MDM_PWR_EN_GPIO 157
48#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184 48#define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO 184
49#define OMAP4_SFH7741_ENABLE_GPIO 188 49#define OMAP4_SFH7741_ENABLE_GPIO 188
50 50
51static const int sdp4430_keymap[] = {
52 KEY(0, 0, KEY_E),
53 KEY(0, 1, KEY_R),
54 KEY(0, 2, KEY_T),
55 KEY(0, 3, KEY_HOME),
56 KEY(0, 4, KEY_F5),
57 KEY(0, 5, KEY_UNKNOWN),
58 KEY(0, 6, KEY_I),
59 KEY(0, 7, KEY_LEFTSHIFT),
60
61 KEY(1, 0, KEY_D),
62 KEY(1, 1, KEY_F),
63 KEY(1, 2, KEY_G),
64 KEY(1, 3, KEY_SEND),
65 KEY(1, 4, KEY_F6),
66 KEY(1, 5, KEY_UNKNOWN),
67 KEY(1, 6, KEY_K),
68 KEY(1, 7, KEY_ENTER),
69
70 KEY(2, 0, KEY_X),
71 KEY(2, 1, KEY_C),
72 KEY(2, 2, KEY_V),
73 KEY(2, 3, KEY_END),
74 KEY(2, 4, KEY_F7),
75 KEY(2, 5, KEY_UNKNOWN),
76 KEY(2, 6, KEY_DOT),
77 KEY(2, 7, KEY_CAPSLOCK),
78
79 KEY(3, 0, KEY_Z),
80 KEY(3, 1, KEY_KPPLUS),
81 KEY(3, 2, KEY_B),
82 KEY(3, 3, KEY_F1),
83 KEY(3, 4, KEY_F8),
84 KEY(3, 5, KEY_UNKNOWN),
85 KEY(3, 6, KEY_O),
86 KEY(3, 7, KEY_SPACE),
87
88 KEY(4, 0, KEY_W),
89 KEY(4, 1, KEY_Y),
90 KEY(4, 2, KEY_U),
91 KEY(4, 3, KEY_F2),
92 KEY(4, 4, KEY_VOLUMEUP),
93 KEY(4, 5, KEY_UNKNOWN),
94 KEY(4, 6, KEY_L),
95 KEY(4, 7, KEY_LEFT),
96
97 KEY(5, 0, KEY_S),
98 KEY(5, 1, KEY_H),
99 KEY(5, 2, KEY_J),
100 KEY(5, 3, KEY_F3),
101 KEY(5, 4, KEY_F9),
102 KEY(5, 5, KEY_VOLUMEDOWN),
103 KEY(5, 6, KEY_M),
104 KEY(5, 7, KEY_RIGHT),
105
106 KEY(6, 0, KEY_Q),
107 KEY(6, 1, KEY_A),
108 KEY(6, 2, KEY_N),
109 KEY(6, 3, KEY_BACK),
110 KEY(6, 4, KEY_BACKSPACE),
111 KEY(6, 5, KEY_UNKNOWN),
112 KEY(6, 6, KEY_P),
113 KEY(6, 7, KEY_UP),
114
115 KEY(7, 0, KEY_PROG1),
116 KEY(7, 1, KEY_PROG2),
117 KEY(7, 2, KEY_PROG3),
118 KEY(7, 3, KEY_PROG4),
119 KEY(7, 4, KEY_F4),
120 KEY(7, 5, KEY_UNKNOWN),
121 KEY(7, 6, KEY_OK),
122 KEY(7, 7, KEY_DOWN),
123};
124
125static struct matrix_keymap_data sdp4430_keymap_data = {
126 .keymap = sdp4430_keymap,
127 .keymap_size = ARRAY_SIZE(sdp4430_keymap),
128};
129
130static struct omap4_keypad_platform_data sdp4430_keypad_data = {
131 .keymap_data = &sdp4430_keymap_data,
132 .rows = 8,
133 .cols = 8,
134};
51static struct gpio_led sdp4430_gpio_leds[] = { 135static struct gpio_led sdp4430_gpio_leds[] = {
52 { 136 {
53 .name = "omap4:green:debug0", 137 .name = "omap4:green:debug0",
@@ -239,28 +323,15 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {
239 { OMAP_TAG_LCD, &sdp4430_lcd_config }, 323 { OMAP_TAG_LCD, &sdp4430_lcd_config },
240}; 324};
241 325
242static void __init omap_4430sdp_init_irq(void) 326static void __init omap_4430sdp_init_early(void)
243{ 327{
244 omap_board_config = sdp4430_config;
245 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
246 omap2_init_common_infrastructure(); 328 omap2_init_common_infrastructure();
247 omap2_init_common_devices(NULL, NULL); 329 omap2_init_common_devices(NULL, NULL);
248#ifdef CONFIG_OMAP_32K_TIMER 330#ifdef CONFIG_OMAP_32K_TIMER
249 omap2_gp_clockevent_set_gptimer(1); 331 omap2_gp_clockevent_set_gptimer(1);
250#endif 332#endif
251 gic_init_irq();
252} 333}
253 334
254static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
255 .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
256 .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
257 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
258 .phy_reset = false,
259 .reset_gpio_port[0] = -EINVAL,
260 .reset_gpio_port[1] = -EINVAL,
261 .reset_gpio_port[2] = -EINVAL,
262};
263
264static struct omap_musb_board_data musb_board_data = { 335static struct omap_musb_board_data musb_board_data = {
265 .interface_type = MUSB_INTERFACE_UTMI, 336 .interface_type = MUSB_INTERFACE_UTMI,
266 .mode = MUSB_OTG, 337 .mode = MUSB_OTG,
@@ -276,11 +347,6 @@ static struct twl4030_usb_data omap4_usbphy_data = {
276 347
277static struct omap2_hsmmc_info mmc[] = { 348static struct omap2_hsmmc_info mmc[] = {
278 { 349 {
279 .mmc = 1,
280 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
281 .gpio_wp = -EINVAL,
282 },
283 {
284 .mmc = 2, 350 .mmc = 2,
285 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 351 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
286 .gpio_cd = -EINVAL, 352 .gpio_cd = -EINVAL,
@@ -288,19 +354,24 @@ static struct omap2_hsmmc_info mmc[] = {
288 .nonremovable = true, 354 .nonremovable = true,
289 .ocr_mask = MMC_VDD_29_30, 355 .ocr_mask = MMC_VDD_29_30,
290 }, 356 },
357 {
358 .mmc = 1,
359 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
360 .gpio_wp = -EINVAL,
361 },
291 {} /* Terminator */ 362 {} /* Terminator */
292}; 363};
293 364
294static struct regulator_consumer_supply sdp4430_vaux_supply[] = { 365static struct regulator_consumer_supply sdp4430_vaux_supply[] = {
295 { 366 {
296 .supply = "vmmc", 367 .supply = "vmmc",
297 .dev_name = "mmci-omap-hs.1", 368 .dev_name = "omap_hsmmc.1",
298 }, 369 },
299}; 370};
300static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { 371static struct regulator_consumer_supply sdp4430_vmmc_supply[] = {
301 { 372 {
302 .supply = "vmmc", 373 .supply = "vmmc",
303 .dev_name = "mmci-omap-hs.0", 374 .dev_name = "omap_hsmmc.0",
304 }, 375 },
305}; 376};
306 377
@@ -434,7 +505,6 @@ static struct regulator_init_data sdp4430_vana = {
434 .constraints = { 505 .constraints = {
435 .min_uV = 2100000, 506 .min_uV = 2100000,
436 .max_uV = 2100000, 507 .max_uV = 2100000,
437 .apply_uV = true,
438 .valid_modes_mask = REGULATOR_MODE_NORMAL 508 .valid_modes_mask = REGULATOR_MODE_NORMAL
439 | REGULATOR_MODE_STANDBY, 509 | REGULATOR_MODE_STANDBY,
440 .valid_ops_mask = REGULATOR_CHANGE_MODE 510 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -446,7 +516,6 @@ static struct regulator_init_data sdp4430_vcxio = {
446 .constraints = { 516 .constraints = {
447 .min_uV = 1800000, 517 .min_uV = 1800000,
448 .max_uV = 1800000, 518 .max_uV = 1800000,
449 .apply_uV = true,
450 .valid_modes_mask = REGULATOR_MODE_NORMAL 519 .valid_modes_mask = REGULATOR_MODE_NORMAL
451 | REGULATOR_MODE_STANDBY, 520 | REGULATOR_MODE_STANDBY,
452 .valid_ops_mask = REGULATOR_CHANGE_MODE 521 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -458,7 +527,6 @@ static struct regulator_init_data sdp4430_vdac = {
458 .constraints = { 527 .constraints = {
459 .min_uV = 1800000, 528 .min_uV = 1800000,
460 .max_uV = 1800000, 529 .max_uV = 1800000,
461 .apply_uV = true,
462 .valid_modes_mask = REGULATOR_MODE_NORMAL 530 .valid_modes_mask = REGULATOR_MODE_NORMAL
463 | REGULATOR_MODE_STANDBY, 531 | REGULATOR_MODE_STANDBY,
464 .valid_ops_mask = REGULATOR_CHANGE_MODE 532 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -570,20 +638,15 @@ static void __init omap_4430sdp_init(void)
570 package = OMAP_PACKAGE_CBL; 638 package = OMAP_PACKAGE_CBL;
571 omap4_mux_init(board_mux, package); 639 omap4_mux_init(board_mux, package);
572 640
641 omap_board_config = sdp4430_config;
642 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
643
573 omap4_i2c_init(); 644 omap4_i2c_init();
574 omap_sfh7741prox_init(); 645 omap_sfh7741prox_init();
575 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); 646 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
576 omap_serial_init(); 647 omap_serial_init();
577 omap4_twl6030_hsmmc_init(mmc); 648 omap4_twl6030_hsmmc_init(mmc);
578 649
579 /* Power on the ULPI PHY */
580 status = gpio_request(OMAP4SDP_MDM_PWR_EN_GPIO, "USBB1 PHY VMDM_3V3");
581 if (status)
582 pr_err("%s: Could not get USBB1 PHY GPIO\n", __func__);
583 else
584 gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1);
585
586 usb_ehci_init(&ehci_pdata);
587 usb_musb_init(&musb_board_data); 650 usb_musb_init(&musb_board_data);
588 651
589 status = omap_ethernet_init(); 652 status = omap_ethernet_init();
@@ -594,6 +657,10 @@ static void __init omap_4430sdp_init(void)
594 spi_register_board_info(sdp4430_spi_board_info, 657 spi_register_board_info(sdp4430_spi_board_info,
595 ARRAY_SIZE(sdp4430_spi_board_info)); 658 ARRAY_SIZE(sdp4430_spi_board_info));
596 } 659 }
660
661 status = omap4_keyboard_init(&sdp4430_keypad_data);
662 if (status)
663 pr_err("Keypad initialization failed: %d\n", status);
597} 664}
598 665
599static void __init omap_4430sdp_map_io(void) 666static void __init omap_4430sdp_map_io(void)
@@ -605,9 +672,10 @@ static void __init omap_4430sdp_map_io(void)
605MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") 672MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
606 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */ 673 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
607 .boot_params = 0x80000100, 674 .boot_params = 0x80000100,
608 .map_io = omap_4430sdp_map_io,
609 .reserve = omap_reserve, 675 .reserve = omap_reserve,
610 .init_irq = omap_4430sdp_init_irq, 676 .map_io = omap_4430sdp_map_io,
677 .init_early = omap_4430sdp_init_early,
678 .init_irq = gic_init_irq,
611 .init_machine = omap_4430sdp_init, 679 .init_machine = omap_4430sdp_init,
612 .timer = &omap_timer, 680 .timer = &omap_timer,
613MACHINE_END 681MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 71acb5ab281c..f53bbb2c3478 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -49,14 +49,10 @@ static struct omap_board_mux board_mux[] __initdata = {
49#define board_mux NULL 49#define board_mux NULL
50#endif 50#endif
51 51
52static void __init am3517_crane_init_irq(void) 52static void __init am3517_crane_init_early(void)
53{ 53{
54 omap_board_config = am3517_crane_config;
55 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
56
57 omap2_init_common_infrastructure(); 54 omap2_init_common_infrastructure();
58 omap2_init_common_devices(NULL, NULL); 55 omap2_init_common_devices(NULL, NULL);
59 omap_init_irq();
60} 56}
61 57
62static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { 58static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
@@ -77,6 +73,9 @@ static void __init am3517_crane_init(void)
77 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 73 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
78 omap_serial_init(); 74 omap_serial_init();
79 75
76 omap_board_config = am3517_crane_config;
77 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
78
80 /* Configure GPIO for EHCI port */ 79 /* Configure GPIO for EHCI port */
81 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { 80 if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {
82 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", 81 pr_err("Can not configure mux for GPIO_USB_NRESET %d\n",
@@ -108,9 +107,10 @@ static void __init am3517_crane_init(void)
108 107
109MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") 108MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
110 .boot_params = 0x80000100, 109 .boot_params = 0x80000100,
111 .map_io = omap3_map_io,
112 .reserve = omap_reserve, 110 .reserve = omap_reserve,
113 .init_irq = am3517_crane_init_irq, 111 .map_io = omap3_map_io,
112 .init_early = am3517_crane_init_early,
113 .init_irq = omap_init_irq,
114 .init_machine = am3517_crane_init, 114 .init_machine = am3517_crane_init,
115 .timer = &omap_timer, 115 .timer = &omap_timer,
116MACHINE_END 116MACHINE_END
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 10d60b7743cf..77541cf59bd4 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -200,6 +200,9 @@ static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
200}; 200};
201static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = { 201static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
202 { 202 {
203 I2C_BOARD_INFO("tlv320aic23", 0x1A),
204 },
205 {
203 I2C_BOARD_INFO("tca6416", 0x21), 206 I2C_BOARD_INFO("tca6416", 0x21),
204 .platform_data = &am3517evm_gpio_expander_info_0, 207 .platform_data = &am3517evm_gpio_expander_info_0,
205 }, 208 },
@@ -378,37 +381,23 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
378 .default_device = &am3517_evm_lcd_device, 381 .default_device = &am3517_evm_lcd_device,
379}; 382};
380 383
381static struct platform_device am3517_evm_dss_device = {
382 .name = "omapdss",
383 .id = -1,
384 .dev = {
385 .platform_data = &am3517_evm_dss_data,
386 },
387};
388
389/* 384/*
390 * Board initialization 385 * Board initialization
391 */ 386 */
392static struct omap_board_config_kernel am3517_evm_config[] __initdata = { 387static void __init am3517_evm_init_early(void)
393};
394
395static struct platform_device *am3517_evm_devices[] __initdata = {
396 &am3517_evm_dss_device,
397};
398
399static void __init am3517_evm_init_irq(void)
400{ 388{
401 omap_board_config = am3517_evm_config;
402 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
403 omap2_init_common_infrastructure(); 389 omap2_init_common_infrastructure();
404 omap2_init_common_devices(NULL, NULL); 390 omap2_init_common_devices(NULL, NULL);
405 omap_init_irq();
406} 391}
407 392
408static struct omap_musb_board_data musb_board_data = { 393static struct omap_musb_board_data musb_board_data = {
409 .interface_type = MUSB_INTERFACE_ULPI, 394 .interface_type = MUSB_INTERFACE_ULPI,
410 .mode = MUSB_OTG, 395 .mode = MUSB_OTG,
411 .power = 500, 396 .power = 500,
397 .set_phy_power = am35x_musb_phy_power,
398 .clear_irq = am35x_musb_clear_irq,
399 .set_mode = am35x_musb_set_mode,
400 .reset = am35x_musb_reset,
412}; 401};
413 402
414static __init void am3517_evm_musb_init(void) 403static __init void am3517_evm_musb_init(void)
@@ -490,14 +479,17 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
490 platform_device_register(&am3517_hecc_device); 479 platform_device_register(&am3517_hecc_device);
491} 480}
492 481
482static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
483};
484
493static void __init am3517_evm_init(void) 485static void __init am3517_evm_init(void)
494{ 486{
487 omap_board_config = am3517_evm_config;
488 omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
495 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 489 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
496 490
497 am3517_evm_i2c_init(); 491 am3517_evm_i2c_init();
498 platform_add_devices(am3517_evm_devices, 492 omap_display_init(&am3517_evm_dss_data);
499 ARRAY_SIZE(am3517_evm_devices));
500
501 omap_serial_init(); 493 omap_serial_init();
502 494
503 /* Configure GPIO for EHCI port */ 495 /* Configure GPIO for EHCI port */
@@ -521,9 +513,10 @@ static void __init am3517_evm_init(void)
521 513
522MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") 514MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
523 .boot_params = 0x80000100, 515 .boot_params = 0x80000100,
524 .map_io = omap3_map_io,
525 .reserve = omap_reserve, 516 .reserve = omap_reserve,
526 .init_irq = am3517_evm_init_irq, 517 .map_io = omap3_map_io,
518 .init_early = am3517_evm_init_early,
519 .init_irq = omap_init_irq,
527 .init_machine = am3517_evm_init, 520 .init_machine = am3517_evm_init,
528 .timer = &omap_timer, 521 .timer = &omap_timer,
529MACHINE_END 522MACHINE_END
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 9f55b68687f7..f4f8374a0298 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -274,13 +274,10 @@ static struct omap_board_config_kernel apollon_config[] __initdata = {
274 { OMAP_TAG_LCD, &apollon_lcd_config }, 274 { OMAP_TAG_LCD, &apollon_lcd_config },
275}; 275};
276 276
277static void __init omap_apollon_init_irq(void) 277static void __init omap_apollon_init_early(void)
278{ 278{
279 omap_board_config = apollon_config;
280 omap_board_config_size = ARRAY_SIZE(apollon_config);
281 omap2_init_common_infrastructure(); 279 omap2_init_common_infrastructure();
282 omap2_init_common_devices(NULL, NULL); 280 omap2_init_common_devices(NULL, NULL);
283 omap_init_irq();
284} 281}
285 282
286static void __init apollon_led_init(void) 283static void __init apollon_led_init(void)
@@ -320,6 +317,8 @@ static void __init omap_apollon_init(void)
320 u32 v; 317 u32 v;
321 318
322 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); 319 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
320 omap_board_config = apollon_config;
321 omap_board_config_size = ARRAY_SIZE(apollon_config);
323 322
324 apollon_init_smc91x(); 323 apollon_init_smc91x();
325 apollon_led_init(); 324 apollon_led_init();
@@ -355,9 +354,10 @@ static void __init omap_apollon_map_io(void)
355MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") 354MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
356 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */ 355 /* Maintainer: Kyungmin Park <kyungmin.park@samsung.com> */
357 .boot_params = 0x80000100, 356 .boot_params = 0x80000100,
358 .map_io = omap_apollon_map_io,
359 .reserve = omap_reserve, 357 .reserve = omap_reserve,
360 .init_irq = omap_apollon_init_irq, 358 .map_io = omap_apollon_map_io,
359 .init_early = omap_apollon_init_early,
360 .init_irq = omap_init_irq,
361 .init_machine = omap_apollon_init, 361 .init_machine = omap_apollon_init,
362 .timer = &omap_timer, 362 .timer = &omap_timer,
363MACHINE_END 363MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index dac141610666..27bea540ccbb 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -401,14 +401,6 @@ static struct omap_dss_board_info cm_t35_dss_data = {
401 .default_device = &cm_t35_dvi_device, 401 .default_device = &cm_t35_dvi_device,
402}; 402};
403 403
404static struct platform_device cm_t35_dss_device = {
405 .name = "omapdss",
406 .id = -1,
407 .dev = {
408 .platform_data = &cm_t35_dss_data,
409 },
410};
411
412static struct omap2_mcspi_device_config tdo24m_mcspi_config = { 404static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
413 .turbo_mode = 0, 405 .turbo_mode = 0,
414 .single_channel = 1, /* 0: slave, 1: master */ 406 .single_channel = 1, /* 0: slave, 1: master */
@@ -468,7 +460,7 @@ static void __init cm_t35_init_display(void)
468 msleep(50); 460 msleep(50);
469 gpio_set_value(lcd_en_gpio, 1); 461 gpio_set_value(lcd_en_gpio, 1);
470 462
471 err = platform_device_register(&cm_t35_dss_device); 463 err = omap_display_init(&cm_t35_dss_data);
472 if (err) { 464 if (err) {
473 pr_err("CM-T35: failed to register DSS device\n"); 465 pr_err("CM-T35: failed to register DSS device\n");
474 goto err_dev_reg; 466 goto err_dev_reg;
@@ -495,15 +487,11 @@ static struct regulator_consumer_supply cm_t35_vsim_supply = {
495 .supply = "vmmc_aux", 487 .supply = "vmmc_aux",
496}; 488};
497 489
498static struct regulator_consumer_supply cm_t35_vdac_supply = { 490static struct regulator_consumer_supply cm_t35_vdac_supply =
499 .supply = "vdda_dac", 491 REGULATOR_SUPPLY("vdda_dac", "omapdss");
500 .dev = &cm_t35_dss_device.dev,
501};
502 492
503static struct regulator_consumer_supply cm_t35_vdvi_supply = { 493static struct regulator_consumer_supply cm_t35_vdvi_supply =
504 .supply = "vdvi", 494 REGULATOR_SUPPLY("vdvi", "omapdss");
505 .dev = &cm_t35_dss_device.dev,
506};
507 495
508/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ 496/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
509static struct regulator_init_data cm_t35_vmmc1 = { 497static struct regulator_init_data cm_t35_vmmc1 = {
@@ -680,18 +668,11 @@ static void __init cm_t35_init_i2c(void)
680 ARRAY_SIZE(cm_t35_i2c_boardinfo)); 668 ARRAY_SIZE(cm_t35_i2c_boardinfo));
681} 669}
682 670
683static struct omap_board_config_kernel cm_t35_config[] __initdata = { 671static void __init cm_t35_init_early(void)
684};
685
686static void __init cm_t35_init_irq(void)
687{ 672{
688 omap_board_config = cm_t35_config;
689 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
690
691 omap2_init_common_infrastructure(); 673 omap2_init_common_infrastructure();
692 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 674 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
693 mt46h32m32lf6_sdrc_params); 675 mt46h32m32lf6_sdrc_params);
694 omap_init_irq();
695} 676}
696 677
697static struct omap_board_mux board_mux[] __initdata = { 678static struct omap_board_mux board_mux[] __initdata = {
@@ -798,8 +779,13 @@ static struct omap_musb_board_data musb_board_data = {
798 .power = 100, 779 .power = 100,
799}; 780};
800 781
782static struct omap_board_config_kernel cm_t35_config[] __initdata = {
783};
784
801static void __init cm_t35_init(void) 785static void __init cm_t35_init(void)
802{ 786{
787 omap_board_config = cm_t35_config;
788 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
803 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 789 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
804 omap_serial_init(); 790 omap_serial_init();
805 cm_t35_init_i2c(); 791 cm_t35_init_i2c();
@@ -815,9 +801,10 @@ static void __init cm_t35_init(void)
815 801
816MACHINE_START(CM_T35, "Compulab CM-T35") 802MACHINE_START(CM_T35, "Compulab CM-T35")
817 .boot_params = 0x80000100, 803 .boot_params = 0x80000100,
818 .map_io = omap3_map_io,
819 .reserve = omap_reserve, 804 .reserve = omap_reserve,
820 .init_irq = cm_t35_init_irq, 805 .map_io = omap3_map_io,
806 .init_early = cm_t35_init_early,
807 .init_irq = omap_init_irq,
821 .init_machine = cm_t35_init, 808 .init_machine = cm_t35_init,
822 .timer = &omap_timer, 809 .timer = &omap_timer,
823MACHINE_END 810MACHINE_END
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 8f9a64d650ee..9da6e8240e8b 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -254,14 +254,10 @@ static inline void cm_t3517_init_nand(void) {}
254static struct omap_board_config_kernel cm_t3517_config[] __initdata = { 254static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
255}; 255};
256 256
257static void __init cm_t3517_init_irq(void) 257static void __init cm_t3517_init_early(void)
258{ 258{
259 omap_board_config = cm_t3517_config;
260 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
261
262 omap2_init_common_infrastructure(); 259 omap2_init_common_infrastructure();
263 omap2_init_common_devices(NULL, NULL); 260 omap2_init_common_devices(NULL, NULL);
264 omap_init_irq();
265} 261}
266 262
267static struct omap_board_mux board_mux[] __initdata = { 263static struct omap_board_mux board_mux[] __initdata = {
@@ -294,6 +290,8 @@ static void __init cm_t3517_init(void)
294{ 290{
295 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 291 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
296 omap_serial_init(); 292 omap_serial_init();
293 omap_board_config = cm_t3517_config;
294 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
297 cm_t3517_init_leds(); 295 cm_t3517_init_leds();
298 cm_t3517_init_nand(); 296 cm_t3517_init_nand();
299 cm_t3517_init_rtc(); 297 cm_t3517_init_rtc();
@@ -303,9 +301,10 @@ static void __init cm_t3517_init(void)
303 301
304MACHINE_START(CM_T3517, "Compulab CM-T3517") 302MACHINE_START(CM_T3517, "Compulab CM-T3517")
305 .boot_params = 0x80000100, 303 .boot_params = 0x80000100,
306 .map_io = omap3_map_io,
307 .reserve = omap_reserve, 304 .reserve = omap_reserve,
308 .init_irq = cm_t3517_init_irq, 305 .map_io = omap3_map_io,
306 .init_early = cm_t3517_init_early,
307 .init_irq = omap_init_irq,
309 .init_machine = cm_t3517_init, 308 .init_machine = cm_t3517_init,
310 .timer = &omap_timer, 309 .timer = &omap_timer,
311MACHINE_END 310MACHINE_END
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 9a2a31e011ce..728f27c5bcb1 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -140,7 +140,7 @@ static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev)
140} 140}
141 141
142static struct regulator_consumer_supply devkit8000_vmmc1_supply = 142static struct regulator_consumer_supply devkit8000_vmmc1_supply =
143 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 143 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
144 144
145 145
146/* ads7846 on SPI */ 146/* ads7846 on SPI */
@@ -195,14 +195,6 @@ static struct omap_dss_board_info devkit8000_dss_data = {
195 .default_device = &devkit8000_lcd_device, 195 .default_device = &devkit8000_lcd_device,
196}; 196};
197 197
198static struct platform_device devkit8000_dss_device = {
199 .name = "omapdss",
200 .id = -1,
201 .dev = {
202 .platform_data = &devkit8000_dss_data,
203 },
204};
205
206static struct regulator_consumer_supply devkit8000_vdda_dac_supply = 198static struct regulator_consumer_supply devkit8000_vdda_dac_supply =
207 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 199 REGULATOR_SUPPLY("vdda_dac", "omapdss");
208 200
@@ -350,9 +342,7 @@ static struct twl4030_usb_data devkit8000_usb_data = {
350 .usb_mode = T2_USB_MODE_ULPI, 342 .usb_mode = T2_USB_MODE_ULPI,
351}; 343};
352 344
353static struct twl4030_codec_audio_data devkit8000_audio_data = { 345static struct twl4030_codec_audio_data devkit8000_audio_data;
354 .audio_mclk = 26000000,
355};
356 346
357static struct twl4030_codec_data devkit8000_codec_data = { 347static struct twl4030_codec_data devkit8000_codec_data = {
358 .audio_mclk = 26000000, 348 .audio_mclk = 26000000,
@@ -456,11 +446,15 @@ static struct platform_device keys_gpio = {
456}; 446};
457 447
458 448
459static void __init devkit8000_init_irq(void) 449static void __init devkit8000_init_early(void)
460{ 450{
461 omap2_init_common_infrastructure(); 451 omap2_init_common_infrastructure();
462 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 452 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
463 mt46h32m32lf6_sdrc_params); 453 mt46h32m32lf6_sdrc_params);
454}
455
456static void __init devkit8000_init_irq(void)
457{
464 omap_init_irq(); 458 omap_init_irq();
465#ifdef CONFIG_OMAP_32K_TIMER 459#ifdef CONFIG_OMAP_32K_TIMER
466 omap2_gp_clockevent_set_gptimer(12); 460 omap2_gp_clockevent_set_gptimer(12);
@@ -575,7 +569,6 @@ static void __init omap_dm9000_init(void)
575} 569}
576 570
577static struct platform_device *devkit8000_devices[] __initdata = { 571static struct platform_device *devkit8000_devices[] __initdata = {
578 &devkit8000_dss_device,
579 &leds_gpio, 572 &leds_gpio,
580 &keys_gpio, 573 &keys_gpio,
581 &omap_dm9000_dev, 574 &omap_dm9000_dev,
@@ -797,6 +790,7 @@ static void __init devkit8000_init(void)
797 platform_add_devices(devkit8000_devices, 790 platform_add_devices(devkit8000_devices,
798 ARRAY_SIZE(devkit8000_devices)); 791 ARRAY_SIZE(devkit8000_devices));
799 792
793 omap_display_init(&devkit8000_dss_data);
800 spi_register_board_info(devkit8000_spi_board_info, 794 spi_register_board_info(devkit8000_spi_board_info,
801 ARRAY_SIZE(devkit8000_spi_board_info)); 795 ARRAY_SIZE(devkit8000_spi_board_info));
802 796
@@ -813,8 +807,9 @@ static void __init devkit8000_init(void)
813 807
814MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") 808MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
815 .boot_params = 0x80000100, 809 .boot_params = 0x80000100,
816 .map_io = omap3_map_io,
817 .reserve = omap_reserve, 810 .reserve = omap_reserve,
811 .map_io = omap3_map_io,
812 .init_early = devkit8000_init_early,
818 .init_irq = devkit8000_init_irq, 813 .init_irq = devkit8000_init_irq,
819 .init_machine = devkit8000_init, 814 .init_machine = devkit8000_init,
820 .timer = &omap_timer, 815 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index fd38c05bb47f..729892fdcf2e 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * board-sdp-flash.c 2 * board-flash.c
3 * Modified from mach-omap2/board-3430sdp-flash.c 3 * Modified from mach-omap2/board-3430sdp-flash.c
4 * 4 *
5 * Copyright (C) 2009 Nokia Corporation 5 * Copyright (C) 2009 Nokia Corporation
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <plat/irqs.h>
19 20
20#include <plat/gpmc.h> 21#include <plat/gpmc.h>
21#include <plat/nand.h> 22#include <plat/nand.h>
@@ -73,11 +74,11 @@ __init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
73 + FLASH_SIZE_SDPV1 - 1; 74 + FLASH_SIZE_SDPV1 - 1;
74 } 75 }
75 if (err < 0) { 76 if (err < 0) {
76 printk(KERN_ERR "NOR: Can't request GPMC CS\n"); 77 pr_err("NOR: Can't request GPMC CS\n");
77 return; 78 return;
78 } 79 }
79 if (platform_device_register(&board_nor_device) < 0) 80 if (platform_device_register(&board_nor_device) < 0)
80 printk(KERN_ERR "Unable to register NOR device\n"); 81 pr_err("Unable to register NOR device\n");
81} 82}
82 83
83#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 84#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
@@ -139,17 +140,21 @@ static struct omap_nand_platform_data board_nand_data = {
139}; 140};
140 141
141void 142void
142__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) 143__init board_nand_init(struct mtd_partition *nand_parts,
144 u8 nr_parts, u8 cs, int nand_type)
143{ 145{
144 board_nand_data.cs = cs; 146 board_nand_data.cs = cs;
145 board_nand_data.parts = nand_parts; 147 board_nand_data.parts = nand_parts;
146 board_nand_data.nr_parts = nr_parts; 148 board_nand_data.nr_parts = nr_parts;
149 board_nand_data.devsize = nand_type;
147 150
151 board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
152 board_nand_data.gpmc_irq = OMAP_GPMC_IRQ_BASE + cs;
148 gpmc_nand_init(&board_nand_data); 153 gpmc_nand_init(&board_nand_data);
149} 154}
150#else 155#else
151void 156void
152__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) 157__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, int nand_type)
153{ 158{
154} 159}
155#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ 160#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
@@ -189,12 +194,12 @@ unmap:
189} 194}
190 195
191/** 196/**
192 * sdp3430_flash_init - Identify devices connected to GPMC and register. 197 * board_flash_init - Identify devices connected to GPMC and register.
193 * 198 *
194 * @return - void. 199 * @return - void.
195 */ 200 */
196void board_flash_init(struct flash_partitions partition_info[], 201void board_flash_init(struct flash_partitions partition_info[],
197 char chip_sel_board[][GPMC_CS_NUM]) 202 char chip_sel_board[][GPMC_CS_NUM], int nand_type)
198{ 203{
199 u8 cs = 0; 204 u8 cs = 0;
200 u8 norcs = GPMC_CS_NUM + 1; 205 u8 norcs = GPMC_CS_NUM + 1;
@@ -208,7 +213,7 @@ void board_flash_init(struct flash_partitions partition_info[],
208 */ 213 */
209 idx = get_gpmc0_type(); 214 idx = get_gpmc0_type();
210 if (idx >= MAX_SUPPORTED_GPMC_CONFIG) { 215 if (idx >= MAX_SUPPORTED_GPMC_CONFIG) {
211 printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs); 216 pr_err("%s: Invalid chip select: %d\n", __func__, cs);
212 return; 217 return;
213 } 218 }
214 config_sel = (unsigned char *)(chip_sel_board[idx]); 219 config_sel = (unsigned char *)(chip_sel_board[idx]);
@@ -232,23 +237,20 @@ void board_flash_init(struct flash_partitions partition_info[],
232 } 237 }
233 238
234 if (norcs > GPMC_CS_NUM) 239 if (norcs > GPMC_CS_NUM)
235 printk(KERN_INFO "NOR: Unable to find configuration " 240 pr_err("NOR: Unable to find configuration in GPMC\n");
236 "in GPMC\n");
237 else 241 else
238 board_nor_init(partition_info[0].parts, 242 board_nor_init(partition_info[0].parts,
239 partition_info[0].nr_parts, norcs); 243 partition_info[0].nr_parts, norcs);
240 244
241 if (onenandcs > GPMC_CS_NUM) 245 if (onenandcs > GPMC_CS_NUM)
242 printk(KERN_INFO "OneNAND: Unable to find configuration " 246 pr_err("OneNAND: Unable to find configuration in GPMC\n");
243 "in GPMC\n");
244 else 247 else
245 board_onenand_init(partition_info[1].parts, 248 board_onenand_init(partition_info[1].parts,
246 partition_info[1].nr_parts, onenandcs); 249 partition_info[1].nr_parts, onenandcs);
247 250
248 if (nandcs > GPMC_CS_NUM) 251 if (nandcs > GPMC_CS_NUM)
249 printk(KERN_INFO "NAND: Unable to find configuration " 252 pr_err("NAND: Unable to find configuration in GPMC\n");
250 "in GPMC\n");
251 else 253 else
252 board_nand_init(partition_info[2].parts, 254 board_nand_init(partition_info[2].parts,
253 partition_info[2].nr_parts, nandcs); 255 partition_info[2].nr_parts, nandcs, nand_type);
254} 256}
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
index 69befe00dd2f..c240a3f8d163 100644
--- a/arch/arm/mach-omap2/board-flash.h
+++ b/arch/arm/mach-omap2/board-flash.h
@@ -25,6 +25,6 @@ struct flash_partitions {
25}; 25};
26 26
27extern void board_flash_init(struct flash_partitions [], 27extern void board_flash_init(struct flash_partitions [],
28 char chip_sel[][GPMC_CS_NUM]); 28 char chip_sel[][GPMC_CS_NUM], int nand_type);
29extern void board_nand_init(struct mtd_partition *nand_parts, 29extern void board_nand_init(struct mtd_partition *nand_parts,
30 u8 nr_parts, u8 cs); 30 u8 nr_parts, u8 cs, int nand_type);
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 0e3d81e09f89..73e3c31e8508 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -33,18 +33,17 @@
33static struct omap_board_config_kernel generic_config[] = { 33static struct omap_board_config_kernel generic_config[] = {
34}; 34};
35 35
36static void __init omap_generic_init_irq(void) 36static void __init omap_generic_init_early(void)
37{ 37{
38 omap_board_config = generic_config;
39 omap_board_config_size = ARRAY_SIZE(generic_config);
40 omap2_init_common_infrastructure(); 38 omap2_init_common_infrastructure();
41 omap2_init_common_devices(NULL, NULL); 39 omap2_init_common_devices(NULL, NULL);
42 omap_init_irq();
43} 40}
44 41
45static void __init omap_generic_init(void) 42static void __init omap_generic_init(void)
46{ 43{
47 omap_serial_init(); 44 omap_serial_init();
45 omap_board_config = generic_config;
46 omap_board_config_size = ARRAY_SIZE(generic_config);
48} 47}
49 48
50static void __init omap_generic_map_io(void) 49static void __init omap_generic_map_io(void)
@@ -68,9 +67,10 @@ static void __init omap_generic_map_io(void)
68MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") 67MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx")
69 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ 68 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
70 .boot_params = 0x80000100, 69 .boot_params = 0x80000100,
71 .map_io = omap_generic_map_io,
72 .reserve = omap_reserve, 70 .reserve = omap_reserve,
73 .init_irq = omap_generic_init_irq, 71 .map_io = omap_generic_map_io,
72 .init_early = omap_generic_init_early,
73 .init_irq = omap_init_irq,
74 .init_machine = omap_generic_init, 74 .init_machine = omap_generic_init,
75 .timer = &omap_timer, 75 .timer = &omap_timer,
76MACHINE_END 76MACHINE_END
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 25cc9dad4b02..7e6bf4fa1535 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -290,12 +290,14 @@ static struct omap_board_config_kernel h4_config[] __initdata = {
290 { OMAP_TAG_LCD, &h4_lcd_config }, 290 { OMAP_TAG_LCD, &h4_lcd_config },
291}; 291};
292 292
293static void __init omap_h4_init_irq(void) 293static void __init omap_h4_init_early(void)
294{ 294{
295 omap_board_config = h4_config;
296 omap_board_config_size = ARRAY_SIZE(h4_config);
297 omap2_init_common_infrastructure(); 295 omap2_init_common_infrastructure();
298 omap2_init_common_devices(NULL, NULL); 296 omap2_init_common_devices(NULL, NULL);
297}
298
299static void __init omap_h4_init_irq(void)
300{
299 omap_init_irq(); 301 omap_init_irq();
300 h4_init_flash(); 302 h4_init_flash();
301} 303}
@@ -330,6 +332,9 @@ static void __init omap_h4_init(void)
330{ 332{
331 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); 333 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF);
332 334
335 omap_board_config = h4_config;
336 omap_board_config_size = ARRAY_SIZE(h4_config);
337
333 /* 338 /*
334 * Make sure the serial ports are muxed on at this point. 339 * Make sure the serial ports are muxed on at this point.
335 * You have to mux them off in device drivers later on 340 * You have to mux them off in device drivers later on
@@ -378,8 +383,9 @@ static void __init omap_h4_map_io(void)
378MACHINE_START(OMAP_H4, "OMAP2420 H4 board") 383MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
379 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ 384 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
380 .boot_params = 0x80000100, 385 .boot_params = 0x80000100,
381 .map_io = omap_h4_map_io,
382 .reserve = omap_reserve, 386 .reserve = omap_reserve,
387 .map_io = omap_h4_map_io,
388 .init_early = omap_h4_init_early,
383 .init_irq = omap_h4_init_irq, 389 .init_irq = omap_h4_init_irq,
384 .init_machine = omap_h4_init, 390 .init_machine = omap_h4_init,
385 .timer = &omap_timer, 391 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 3be85a1f55f4..c4b3c1c47ec6 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -250,7 +250,7 @@ static inline void __init igep2_init_smsc911x(void) { }
250#endif 250#endif
251 251
252static struct regulator_consumer_supply igep2_vmmc1_supply = 252static struct regulator_consumer_supply igep2_vmmc1_supply =
253 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 253 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
254 254
255/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 255/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
256static struct regulator_init_data igep2_vmmc1 = { 256static struct regulator_init_data igep2_vmmc1 = {
@@ -268,7 +268,7 @@ static struct regulator_init_data igep2_vmmc1 = {
268}; 268};
269 269
270static struct regulator_consumer_supply igep2_vio_supply = 270static struct regulator_consumer_supply igep2_vio_supply =
271 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); 271 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
272 272
273static struct regulator_init_data igep2_vio = { 273static struct regulator_init_data igep2_vio = {
274 .constraints = { 274 .constraints = {
@@ -286,7 +286,7 @@ static struct regulator_init_data igep2_vio = {
286}; 286};
287 287
288static struct regulator_consumer_supply igep2_vmmc2_supply = 288static struct regulator_consumer_supply igep2_vmmc2_supply =
289 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 289 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
290 290
291static struct regulator_init_data igep2_vmmc2 = { 291static struct regulator_init_data igep2_vmmc2 = {
292 .constraints = { 292 .constraints = {
@@ -485,18 +485,8 @@ static struct omap_dss_board_info igep2_dss_data = {
485 .default_device = &igep2_dvi_device, 485 .default_device = &igep2_dvi_device,
486}; 486};
487 487
488static struct platform_device igep2_dss_device = { 488static struct regulator_consumer_supply igep2_vpll2_supply =
489 .name = "omapdss", 489 REGULATOR_SUPPLY("vdds_dsi", "omapdss");
490 .id = -1,
491 .dev = {
492 .platform_data = &igep2_dss_data,
493 },
494};
495
496static struct regulator_consumer_supply igep2_vpll2_supply = {
497 .supply = "vdds_dsi",
498 .dev = &igep2_dss_device.dev,
499};
500 490
501static struct regulator_init_data igep2_vpll2 = { 491static struct regulator_init_data igep2_vpll2 = {
502 .constraints = { 492 .constraints = {
@@ -521,21 +511,17 @@ static void __init igep2_display_init(void)
521} 511}
522 512
523static struct platform_device *igep2_devices[] __initdata = { 513static struct platform_device *igep2_devices[] __initdata = {
524 &igep2_dss_device,
525 &igep2_vwlan_device, 514 &igep2_vwlan_device,
526}; 515};
527 516
528static void __init igep2_init_irq(void) 517static void __init igep2_init_early(void)
529{ 518{
530 omap2_init_common_infrastructure(); 519 omap2_init_common_infrastructure();
531 omap2_init_common_devices(m65kxxxxam_sdrc_params, 520 omap2_init_common_devices(m65kxxxxam_sdrc_params,
532 m65kxxxxam_sdrc_params); 521 m65kxxxxam_sdrc_params);
533 omap_init_irq();
534} 522}
535 523
536static struct twl4030_codec_audio_data igep2_audio_data = { 524static struct twl4030_codec_audio_data igep2_audio_data;
537 .audio_mclk = 26000000,
538};
539 525
540static struct twl4030_codec_data igep2_codec_data = { 526static struct twl4030_codec_data igep2_codec_data = {
541 .audio_mclk = 26000000, 527 .audio_mclk = 26000000,
@@ -697,6 +683,7 @@ static void __init igep2_init(void)
697 /* Register I2C busses and drivers */ 683 /* Register I2C busses and drivers */
698 igep2_i2c_init(); 684 igep2_i2c_init();
699 platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); 685 platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
686 omap_display_init(&igep2_dss_data);
700 omap_serial_init(); 687 omap_serial_init();
701 usb_musb_init(&musb_board_data); 688 usb_musb_init(&musb_board_data);
702 usb_ehci_init(&ehci_pdata); 689 usb_ehci_init(&ehci_pdata);
@@ -716,9 +703,10 @@ static void __init igep2_init(void)
716 703
717MACHINE_START(IGEP0020, "IGEP v2 board") 704MACHINE_START(IGEP0020, "IGEP v2 board")
718 .boot_params = 0x80000100, 705 .boot_params = 0x80000100,
719 .map_io = omap3_map_io,
720 .reserve = omap_reserve, 706 .reserve = omap_reserve,
721 .init_irq = igep2_init_irq, 707 .map_io = omap3_map_io,
708 .init_early = igep2_init_early,
709 .init_irq = omap_init_irq,
722 .init_machine = igep2_init, 710 .init_machine = igep2_init,
723 .timer = &omap_timer, 711 .timer = &omap_timer,
724MACHINE_END 712MACHINE_END
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 4dc62a9b9cb2..4273d0672ef6 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -142,7 +142,7 @@ static void __init igep3_flash_init(void) {}
142#endif 142#endif
143 143
144static struct regulator_consumer_supply igep3_vmmc1_supply = 144static struct regulator_consumer_supply igep3_vmmc1_supply =
145 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 145 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
146 146
147/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 147/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
148static struct regulator_init_data igep3_vmmc1 = { 148static struct regulator_init_data igep3_vmmc1 = {
@@ -160,7 +160,7 @@ static struct regulator_init_data igep3_vmmc1 = {
160}; 160};
161 161
162static struct regulator_consumer_supply igep3_vio_supply = 162static struct regulator_consumer_supply igep3_vio_supply =
163 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); 163 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
164 164
165static struct regulator_init_data igep3_vio = { 165static struct regulator_init_data igep3_vio = {
166 .constraints = { 166 .constraints = {
@@ -178,7 +178,7 @@ static struct regulator_init_data igep3_vio = {
178}; 178};
179 179
180static struct regulator_consumer_supply igep3_vmmc2_supply = 180static struct regulator_consumer_supply igep3_vmmc2_supply =
181 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 181 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
182 182
183static struct regulator_init_data igep3_vmmc2 = { 183static struct regulator_init_data igep3_vmmc2 = {
184 .constraints = { 184 .constraints = {
@@ -331,12 +331,11 @@ static struct platform_device *igep3_devices[] __initdata = {
331 &igep3_vwlan_device, 331 &igep3_vwlan_device,
332}; 332};
333 333
334static void __init igep3_init_irq(void) 334static void __init igep3_init_early(void)
335{ 335{
336 omap2_init_common_infrastructure(); 336 omap2_init_common_infrastructure();
337 omap2_init_common_devices(m65kxxxxam_sdrc_params, 337 omap2_init_common_devices(m65kxxxxam_sdrc_params,
338 m65kxxxxam_sdrc_params); 338 m65kxxxxam_sdrc_params);
339 omap_init_irq();
340} 339}
341 340
342static struct twl4030_platform_data igep3_twl4030_pdata = { 341static struct twl4030_platform_data igep3_twl4030_pdata = {
@@ -452,7 +451,8 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
452 .boot_params = 0x80000100, 451 .boot_params = 0x80000100,
453 .reserve = omap_reserve, 452 .reserve = omap_reserve,
454 .map_io = omap3_map_io, 453 .map_io = omap3_map_io,
455 .init_irq = igep3_init_irq, 454 .init_early = igep3_init_early,
455 .init_irq = omap_init_irq,
456 .init_machine = igep3_init, 456 .init_machine = igep3_init,
457 .timer = &omap_timer, 457 .timer = &omap_timer,
458MACHINE_END 458MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e5dc74875f9d..e2ba77957a8c 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -288,13 +288,10 @@ static struct omap_board_config_kernel ldp_config[] __initdata = {
288 { OMAP_TAG_LCD, &ldp_lcd_config }, 288 { OMAP_TAG_LCD, &ldp_lcd_config },
289}; 289};
290 290
291static void __init omap_ldp_init_irq(void) 291static void __init omap_ldp_init_early(void)
292{ 292{
293 omap_board_config = ldp_config;
294 omap_board_config_size = ARRAY_SIZE(ldp_config);
295 omap2_init_common_infrastructure(); 293 omap2_init_common_infrastructure();
296 omap2_init_common_devices(NULL, NULL); 294 omap2_init_common_devices(NULL, NULL);
297 omap_init_irq();
298} 295}
299 296
300static struct twl4030_usb_data ldp_usb_data = { 297static struct twl4030_usb_data ldp_usb_data = {
@@ -330,6 +327,26 @@ static struct regulator_init_data ldp_vmmc1 = {
330 .consumer_supplies = &ldp_vmmc1_supply, 327 .consumer_supplies = &ldp_vmmc1_supply,
331}; 328};
332 329
330/* ads7846 on SPI */
331static struct regulator_consumer_supply ldp_vaux1_supplies[] = {
332 REGULATOR_SUPPLY("vcc", "spi1.0"),
333};
334
335/* VAUX1 */
336static struct regulator_init_data ldp_vaux1 = {
337 .constraints = {
338 .min_uV = 3000000,
339 .max_uV = 3000000,
340 .apply_uV = true,
341 .valid_modes_mask = REGULATOR_MODE_NORMAL
342 | REGULATOR_MODE_STANDBY,
343 .valid_ops_mask = REGULATOR_CHANGE_MODE
344 | REGULATOR_CHANGE_STATUS,
345 },
346 .num_consumer_supplies = ARRAY_SIZE(ldp_vaux1_supplies),
347 .consumer_supplies = ldp_vaux1_supplies,
348};
349
333static struct twl4030_platform_data ldp_twldata = { 350static struct twl4030_platform_data ldp_twldata = {
334 .irq_base = TWL4030_IRQ_BASE, 351 .irq_base = TWL4030_IRQ_BASE,
335 .irq_end = TWL4030_IRQ_END, 352 .irq_end = TWL4030_IRQ_END,
@@ -338,6 +355,7 @@ static struct twl4030_platform_data ldp_twldata = {
338 .madc = &ldp_madc_data, 355 .madc = &ldp_madc_data,
339 .usb = &ldp_usb_data, 356 .usb = &ldp_usb_data,
340 .vmmc1 = &ldp_vmmc1, 357 .vmmc1 = &ldp_vmmc1,
358 .vaux1 = &ldp_vaux1,
341 .gpio = &ldp_gpio_data, 359 .gpio = &ldp_gpio_data,
342 .keypad = &ldp_kp_twl4030_data, 360 .keypad = &ldp_kp_twl4030_data,
343}; 361};
@@ -423,6 +441,8 @@ static struct mtd_partition ldp_nand_partitions[] = {
423static void __init omap_ldp_init(void) 441static void __init omap_ldp_init(void)
424{ 442{
425 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 443 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
444 omap_board_config = ldp_config;
445 omap_board_config_size = ARRAY_SIZE(ldp_config);
426 ldp_init_smsc911x(); 446 ldp_init_smsc911x();
427 omap_i2c_init(); 447 omap_i2c_init();
428 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 448 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
@@ -434,7 +454,7 @@ static void __init omap_ldp_init(void)
434 omap_serial_init(); 454 omap_serial_init();
435 usb_musb_init(&musb_board_data); 455 usb_musb_init(&musb_board_data);
436 board_nand_init(ldp_nand_partitions, 456 board_nand_init(ldp_nand_partitions,
437 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS); 457 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
438 458
439 omap2_hsmmc_init(mmc); 459 omap2_hsmmc_init(mmc);
440 /* link regulators to MMC adapters */ 460 /* link regulators to MMC adapters */
@@ -443,9 +463,10 @@ static void __init omap_ldp_init(void)
443 463
444MACHINE_START(OMAP_LDP, "OMAP LDP board") 464MACHINE_START(OMAP_LDP, "OMAP LDP board")
445 .boot_params = 0x80000100, 465 .boot_params = 0x80000100,
446 .map_io = omap3_map_io,
447 .reserve = omap_reserve, 466 .reserve = omap_reserve,
448 .init_irq = omap_ldp_init_irq, 467 .map_io = omap3_map_io,
468 .init_early = omap_ldp_init_early,
469 .init_irq = omap_init_irq,
449 .init_machine = omap_ldp_init, 470 .init_machine = omap_ldp_init,
450 .timer = &omap_timer, 471 .timer = &omap_timer,
451MACHINE_END 472MACHINE_END
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index f396756872b7..e710cd9e079b 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -536,7 +536,7 @@ static void __init n8x0_mmc_init(void)
536 } 536 }
537 537
538 mmc_data[0] = &mmc1_data; 538 mmc_data[0] = &mmc1_data;
539 omap2_init_mmc(mmc_data, OMAP24XX_NR_MMC); 539 omap242x_init_mmc(mmc_data);
540} 540}
541#else 541#else
542 542
@@ -628,11 +628,10 @@ static void __init n8x0_map_io(void)
628 omap242x_map_common_io(); 628 omap242x_map_common_io();
629} 629}
630 630
631static void __init n8x0_init_irq(void) 631static void __init n8x0_init_early(void)
632{ 632{
633 omap2_init_common_infrastructure(); 633 omap2_init_common_infrastructure();
634 omap2_init_common_devices(NULL, NULL); 634 omap2_init_common_devices(NULL, NULL);
635 omap_init_irq();
636} 635}
637 636
638#ifdef CONFIG_OMAP_MUX 637#ifdef CONFIG_OMAP_MUX
@@ -703,27 +702,30 @@ static void __init n8x0_init_machine(void)
703 702
704MACHINE_START(NOKIA_N800, "Nokia N800") 703MACHINE_START(NOKIA_N800, "Nokia N800")
705 .boot_params = 0x80000100, 704 .boot_params = 0x80000100,
706 .map_io = n8x0_map_io,
707 .reserve = omap_reserve, 705 .reserve = omap_reserve,
708 .init_irq = n8x0_init_irq, 706 .map_io = n8x0_map_io,
707 .init_early = n8x0_init_early,
708 .init_irq = omap_init_irq,
709 .init_machine = n8x0_init_machine, 709 .init_machine = n8x0_init_machine,
710 .timer = &omap_timer, 710 .timer = &omap_timer,
711MACHINE_END 711MACHINE_END
712 712
713MACHINE_START(NOKIA_N810, "Nokia N810") 713MACHINE_START(NOKIA_N810, "Nokia N810")
714 .boot_params = 0x80000100, 714 .boot_params = 0x80000100,
715 .map_io = n8x0_map_io,
716 .reserve = omap_reserve, 715 .reserve = omap_reserve,
717 .init_irq = n8x0_init_irq, 716 .map_io = n8x0_map_io,
717 .init_early = n8x0_init_early,
718 .init_irq = omap_init_irq,
718 .init_machine = n8x0_init_machine, 719 .init_machine = n8x0_init_machine,
719 .timer = &omap_timer, 720 .timer = &omap_timer,
720MACHINE_END 721MACHINE_END
721 722
722MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") 723MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
723 .boot_params = 0x80000100, 724 .boot_params = 0x80000100,
724 .map_io = n8x0_map_io,
725 .reserve = omap_reserve, 725 .reserve = omap_reserve,
726 .init_irq = n8x0_init_irq, 726 .map_io = n8x0_map_io,
727 .init_early = n8x0_init_early,
728 .init_irq = omap_init_irq,
727 .init_machine = n8x0_init_machine, 729 .init_machine = n8x0_init_machine,
728 .timer = &omap_timer, 730 .timer = &omap_timer,
729MACHINE_END 731MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 46d814ab5656..b6752ac5b97e 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -228,14 +228,6 @@ static struct omap_dss_board_info beagle_dss_data = {
228 .default_device = &beagle_dvi_device, 228 .default_device = &beagle_dvi_device,
229}; 229};
230 230
231static struct platform_device beagle_dss_device = {
232 .name = "omapdss",
233 .id = -1,
234 .dev = {
235 .platform_data = &beagle_dss_data,
236 },
237};
238
239static struct regulator_consumer_supply beagle_vdac_supply = 231static struct regulator_consumer_supply beagle_vdac_supply =
240 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 232 REGULATOR_SUPPLY("vdda_dac", "omapdss");
241 233
@@ -435,9 +427,7 @@ static struct twl4030_usb_data beagle_usb_data = {
435 .usb_mode = T2_USB_MODE_ULPI, 427 .usb_mode = T2_USB_MODE_ULPI,
436}; 428};
437 429
438static struct twl4030_codec_audio_data beagle_audio_data = { 430static struct twl4030_codec_audio_data beagle_audio_data;
439 .audio_mclk = 26000000,
440};
441 431
442static struct twl4030_codec_data beagle_codec_data = { 432static struct twl4030_codec_data beagle_codec_data = {
443 .audio_mclk = 26000000, 433 .audio_mclk = 26000000,
@@ -536,11 +526,15 @@ static struct platform_device keys_gpio = {
536 }, 526 },
537}; 527};
538 528
539static void __init omap3_beagle_init_irq(void) 529static void __init omap3_beagle_init_early(void)
540{ 530{
541 omap2_init_common_infrastructure(); 531 omap2_init_common_infrastructure();
542 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 532 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
543 mt46h32m32lf6_sdrc_params); 533 mt46h32m32lf6_sdrc_params);
534}
535
536static void __init omap3_beagle_init_irq(void)
537{
544 omap_init_irq(); 538 omap_init_irq();
545#ifdef CONFIG_OMAP_32K_TIMER 539#ifdef CONFIG_OMAP_32K_TIMER
546 omap2_gp_clockevent_set_gptimer(12); 540 omap2_gp_clockevent_set_gptimer(12);
@@ -550,7 +544,6 @@ static void __init omap3_beagle_init_irq(void)
550static struct platform_device *omap3_beagle_devices[] __initdata = { 544static struct platform_device *omap3_beagle_devices[] __initdata = {
551 &leds_gpio, 545 &leds_gpio,
552 &keys_gpio, 546 &keys_gpio,
553 &beagle_dss_device,
554}; 547};
555 548
556static void __init omap3beagle_flash_init(void) 549static void __init omap3beagle_flash_init(void)
@@ -617,6 +610,7 @@ static void __init omap3_beagle_init(void)
617 omap3_beagle_i2c_init(); 610 omap3_beagle_i2c_init();
618 platform_add_devices(omap3_beagle_devices, 611 platform_add_devices(omap3_beagle_devices,
619 ARRAY_SIZE(omap3_beagle_devices)); 612 ARRAY_SIZE(omap3_beagle_devices));
613 omap_display_init(&beagle_dss_data);
620 omap_serial_init(); 614 omap_serial_init();
621 615
622 omap_mux_init_gpio(170, OMAP_PIN_INPUT); 616 omap_mux_init_gpio(170, OMAP_PIN_INPUT);
@@ -638,8 +632,9 @@ static void __init omap3_beagle_init(void)
638MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") 632MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
639 /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ 633 /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
640 .boot_params = 0x80000100, 634 .boot_params = 0x80000100,
641 .map_io = omap3_map_io,
642 .reserve = omap_reserve, 635 .reserve = omap_reserve,
636 .map_io = omap3_map_io,
637 .init_early = omap3_beagle_init_early,
643 .init_irq = omap3_beagle_init_irq, 638 .init_irq = omap3_beagle_init_irq,
644 .init_machine = omap3_beagle_init, 639 .init_machine = omap3_beagle_init,
645 .timer = &omap_timer, 640 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 323c3809ce39..b65848c59e1d 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -30,6 +30,8 @@
30#include <linux/usb/otg.h> 30#include <linux/usb/otg.h>
31#include <linux/smsc911x.h> 31#include <linux/smsc911x.h>
32 32
33#include <linux/wl12xx.h>
34#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h> 35#include <linux/regulator/machine.h>
34#include <linux/mmc/host.h> 36#include <linux/mmc/host.h>
35 37
@@ -58,6 +60,13 @@
58#define OMAP3EVM_ETHR_ID_REV 0x50 60#define OMAP3EVM_ETHR_ID_REV 0x50
59#define OMAP3EVM_ETHR_GPIO_IRQ 176 61#define OMAP3EVM_ETHR_GPIO_IRQ 176
60#define OMAP3EVM_SMSC911X_CS 5 62#define OMAP3EVM_SMSC911X_CS 5
63/*
64 * Eth Reset signal
65 * 64 = Generation 1 (<=RevD)
66 * 7 = Generation 2 (>=RevE)
67 */
68#define OMAP3EVM_GEN1_ETHR_GPIO_RST 64
69#define OMAP3EVM_GEN2_ETHR_GPIO_RST 7
61 70
62static u8 omap3_evm_version; 71static u8 omap3_evm_version;
63 72
@@ -124,10 +133,15 @@ static struct platform_device omap3evm_smsc911x_device = {
124 133
125static inline void __init omap3evm_init_smsc911x(void) 134static inline void __init omap3evm_init_smsc911x(void)
126{ 135{
127 int eth_cs; 136 int eth_cs, eth_rst;
128 struct clk *l3ck; 137 struct clk *l3ck;
129 unsigned int rate; 138 unsigned int rate;
130 139
140 if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1)
141 eth_rst = OMAP3EVM_GEN1_ETHR_GPIO_RST;
142 else
143 eth_rst = OMAP3EVM_GEN2_ETHR_GPIO_RST;
144
131 eth_cs = OMAP3EVM_SMSC911X_CS; 145 eth_cs = OMAP3EVM_SMSC911X_CS;
132 146
133 l3ck = clk_get(NULL, "l3_ck"); 147 l3ck = clk_get(NULL, "l3_ck");
@@ -136,6 +150,27 @@ static inline void __init omap3evm_init_smsc911x(void)
136 else 150 else
137 rate = clk_get_rate(l3ck); 151 rate = clk_get_rate(l3ck);
138 152
153 /* Configure ethernet controller reset gpio */
154 if (cpu_is_omap3430()) {
155 if (gpio_request(eth_rst, "SMSC911x gpio") < 0) {
156 pr_err(KERN_ERR "Failed to request %d for smsc911x\n",
157 eth_rst);
158 return;
159 }
160
161 if (gpio_direction_output(eth_rst, 1) < 0) {
162 pr_err(KERN_ERR "Failed to set direction of %d for" \
163 " smsc911x\n", eth_rst);
164 return;
165 }
166 /* reset pulse to ethernet controller*/
167 usleep_range(150, 220);
168 gpio_set_value(eth_rst, 0);
169 usleep_range(150, 220);
170 gpio_set_value(eth_rst, 1);
171 usleep_range(1, 2);
172 }
173
139 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) { 174 if (gpio_request(OMAP3EVM_ETHR_GPIO_IRQ, "SMSC911x irq") < 0) {
140 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n", 175 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
141 OMAP3EVM_ETHR_GPIO_IRQ); 176 OMAP3EVM_ETHR_GPIO_IRQ);
@@ -235,9 +270,9 @@ static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev)
235 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0); 270 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0);
236 271
237 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) 272 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
238 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); 273 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
239 else 274 else
240 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); 275 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
241 276
242 lcd_enabled = 1; 277 lcd_enabled = 1;
243 return 0; 278 return 0;
@@ -248,9 +283,9 @@ static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev)
248 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1); 283 gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1);
249 284
250 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) 285 if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
251 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); 286 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
252 else 287 else
253 gpio_set_value(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); 288 gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
254 289
255 lcd_enabled = 0; 290 lcd_enabled = 0;
256} 291}
@@ -289,7 +324,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
289 return -EINVAL; 324 return -EINVAL;
290 } 325 }
291 326
292 gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 1); 327 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 1);
293 328
294 dvi_enabled = 1; 329 dvi_enabled = 1;
295 return 0; 330 return 0;
@@ -297,7 +332,7 @@ static int omap3_evm_enable_dvi(struct omap_dss_device *dssdev)
297 332
298static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev) 333static void omap3_evm_disable_dvi(struct omap_dss_device *dssdev)
299{ 334{
300 gpio_set_value(OMAP3EVM_DVI_PANEL_EN_GPIO, 0); 335 gpio_set_value_cansleep(OMAP3EVM_DVI_PANEL_EN_GPIO, 0);
301 336
302 dvi_enabled = 0; 337 dvi_enabled = 0;
303} 338}
@@ -328,14 +363,6 @@ static struct omap_dss_board_info omap3_evm_dss_data = {
328 .default_device = &omap3_evm_lcd_device, 363 .default_device = &omap3_evm_lcd_device,
329}; 364};
330 365
331static struct platform_device omap3_evm_dss_device = {
332 .name = "omapdss",
333 .id = -1,
334 .dev = {
335 .platform_data = &omap3_evm_dss_data,
336 },
337};
338
339static struct regulator_consumer_supply omap3evm_vmmc1_supply = { 366static struct regulator_consumer_supply omap3evm_vmmc1_supply = {
340 .supply = "vmmc", 367 .supply = "vmmc",
341}; 368};
@@ -381,6 +408,16 @@ static struct omap2_hsmmc_info mmc[] = {
381 .gpio_cd = -EINVAL, 408 .gpio_cd = -EINVAL,
382 .gpio_wp = 63, 409 .gpio_wp = 63,
383 }, 410 },
411#ifdef CONFIG_WL12XX_PLATFORM_DATA
412 {
413 .name = "wl1271",
414 .mmc = 2,
415 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
416 .gpio_wp = -EINVAL,
417 .gpio_cd = -EINVAL,
418 .nonremovable = true,
419 },
420#endif
384 {} /* Terminator */ 421 {} /* Terminator */
385}; 422};
386 423
@@ -411,6 +448,8 @@ static struct platform_device leds_gpio = {
411static int omap3evm_twl_gpio_setup(struct device *dev, 448static int omap3evm_twl_gpio_setup(struct device *dev,
412 unsigned gpio, unsigned ngpio) 449 unsigned gpio, unsigned ngpio)
413{ 450{
451 int r;
452
414 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ 453 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
415 omap_mux_init_gpio(63, OMAP_PIN_INPUT); 454 omap_mux_init_gpio(63, OMAP_PIN_INPUT);
416 mmc[0].gpio_cd = gpio + 0; 455 mmc[0].gpio_cd = gpio + 0;
@@ -426,8 +465,12 @@ static int omap3evm_twl_gpio_setup(struct device *dev,
426 */ 465 */
427 466
428 /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ 467 /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */
429 gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); 468 r = gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL");
430 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); 469 if (!r)
470 r = gpio_direction_output(gpio + TWL4030_GPIO_MAX,
471 (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) ? 1 : 0);
472 if (r)
473 printk(KERN_ERR "failed to get/set lcd_bkl gpio\n");
431 474
432 /* gpio + 7 == DVI Enable */ 475 /* gpio + 7 == DVI Enable */
433 gpio_request(gpio + 7, "EN_DVI"); 476 gpio_request(gpio + 7, "EN_DVI");
@@ -491,19 +534,15 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = {
491 .irq_line = 1, 534 .irq_line = 1,
492}; 535};
493 536
494static struct twl4030_codec_audio_data omap3evm_audio_data = { 537static struct twl4030_codec_audio_data omap3evm_audio_data;
495 .audio_mclk = 26000000,
496};
497 538
498static struct twl4030_codec_data omap3evm_codec_data = { 539static struct twl4030_codec_data omap3evm_codec_data = {
499 .audio_mclk = 26000000, 540 .audio_mclk = 26000000,
500 .audio = &omap3evm_audio_data, 541 .audio = &omap3evm_audio_data,
501}; 542};
502 543
503static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = { 544static struct regulator_consumer_supply omap3_evm_vdda_dac_supply =
504 .supply = "vdda_dac", 545 REGULATOR_SUPPLY("vdda_dac", "omapdss");
505 .dev = &omap3_evm_dss_device.dev,
506};
507 546
508/* VDAC for DSS driving S-Video */ 547/* VDAC for DSS driving S-Video */
509static struct regulator_init_data omap3_evm_vdac = { 548static struct regulator_init_data omap3_evm_vdac = {
@@ -538,6 +577,66 @@ static struct regulator_init_data omap3_evm_vpll2 = {
538 .consumer_supplies = &omap3_evm_vpll2_supply, 577 .consumer_supplies = &omap3_evm_vpll2_supply,
539}; 578};
540 579
580/* ads7846 on SPI */
581static struct regulator_consumer_supply omap3evm_vio_supply =
582 REGULATOR_SUPPLY("vcc", "spi1.0");
583
584/* VIO for ads7846 */
585static struct regulator_init_data omap3evm_vio = {
586 .constraints = {
587 .min_uV = 1800000,
588 .max_uV = 1800000,
589 .apply_uV = true,
590 .valid_modes_mask = REGULATOR_MODE_NORMAL
591 | REGULATOR_MODE_STANDBY,
592 .valid_ops_mask = REGULATOR_CHANGE_MODE
593 | REGULATOR_CHANGE_STATUS,
594 },
595 .num_consumer_supplies = 1,
596 .consumer_supplies = &omap3evm_vio_supply,
597};
598
599#ifdef CONFIG_WL12XX_PLATFORM_DATA
600
601#define OMAP3EVM_WLAN_PMENA_GPIO (150)
602#define OMAP3EVM_WLAN_IRQ_GPIO (149)
603
604static struct regulator_consumer_supply omap3evm_vmmc2_supply =
605 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
606
607/* VMMC2 for driving the WL12xx module */
608static struct regulator_init_data omap3evm_vmmc2 = {
609 .constraints = {
610 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
611 },
612 .num_consumer_supplies = 1,
613 .consumer_supplies = &omap3evm_vmmc2_supply,
614};
615
616static struct fixed_voltage_config omap3evm_vwlan = {
617 .supply_name = "vwl1271",
618 .microvolts = 1800000, /* 1.80V */
619 .gpio = OMAP3EVM_WLAN_PMENA_GPIO,
620 .startup_delay = 70000, /* 70ms */
621 .enable_high = 1,
622 .enabled_at_boot = 0,
623 .init_data = &omap3evm_vmmc2,
624};
625
626static struct platform_device omap3evm_wlan_regulator = {
627 .name = "reg-fixed-voltage",
628 .id = 1,
629 .dev = {
630 .platform_data = &omap3evm_vwlan,
631 },
632};
633
634struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
635 .irq = OMAP_GPIO_IRQ(OMAP3EVM_WLAN_IRQ_GPIO),
636 .board_ref_clock = WL12XX_REFCLOCK_38, /* 38.4 MHz */
637};
638#endif
639
541static struct twl4030_platform_data omap3evm_twldata = { 640static struct twl4030_platform_data omap3evm_twldata = {
542 .irq_base = TWL4030_IRQ_BASE, 641 .irq_base = TWL4030_IRQ_BASE,
543 .irq_end = TWL4030_IRQ_END, 642 .irq_end = TWL4030_IRQ_END,
@@ -550,6 +649,7 @@ static struct twl4030_platform_data omap3evm_twldata = {
550 .codec = &omap3evm_codec_data, 649 .codec = &omap3evm_codec_data,
551 .vdac = &omap3_evm_vdac, 650 .vdac = &omap3_evm_vdac,
552 .vpll2 = &omap3_evm_vpll2, 651 .vpll2 = &omap3_evm_vpll2,
652 .vio = &omap3evm_vio,
553}; 653};
554 654
555static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = { 655static struct i2c_board_info __initdata omap3evm_i2c_boardinfo[] = {
@@ -625,19 +725,12 @@ static struct spi_board_info omap3evm_spi_board_info[] = {
625static struct omap_board_config_kernel omap3_evm_config[] __initdata = { 725static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
626}; 726};
627 727
628static void __init omap3_evm_init_irq(void) 728static void __init omap3_evm_init_early(void)
629{ 729{
630 omap_board_config = omap3_evm_config;
631 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
632 omap2_init_common_infrastructure(); 730 omap2_init_common_infrastructure();
633 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); 731 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
634 omap_init_irq();
635} 732}
636 733
637static struct platform_device *omap3_evm_devices[] __initdata = {
638 &omap3_evm_dss_device,
639};
640
641static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { 734static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
642 735
643 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, 736 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
@@ -652,14 +745,76 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
652}; 745};
653 746
654#ifdef CONFIG_OMAP_MUX 747#ifdef CONFIG_OMAP_MUX
655static struct omap_board_mux board_mux[] __initdata = { 748static struct omap_board_mux omap35x_board_mux[] __initdata = {
749 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP |
750 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
751 OMAP_PIN_OFF_WAKEUPENABLE),
752 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
753 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
754 OMAP_PIN_OFF_WAKEUPENABLE),
755 OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
756 OMAP_PIN_OFF_NONE),
757 OMAP3_MUX(GPMC_WAIT2, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
758 OMAP_PIN_OFF_NONE),
759#ifdef CONFIG_WL12XX_PLATFORM_DATA
760 /* WLAN IRQ - GPIO 149 */
761 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
762
763 /* WLAN POWER ENABLE - GPIO 150 */
764 OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
765
766 /* MMC2 SDIO pin muxes for WL12xx */
767 OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
768 OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
769 OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
770 OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
771 OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
772 OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
773#endif
774 { .reg_offset = OMAP_MUX_TERMINATOR },
775};
776
777static struct omap_board_mux omap36x_board_mux[] __initdata = {
656 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | 778 OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP |
657 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW | 779 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
658 OMAP_PIN_OFF_WAKEUPENABLE), 780 OMAP_PIN_OFF_WAKEUPENABLE),
659 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | 781 OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
660 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), 782 OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
783 OMAP_PIN_OFF_WAKEUPENABLE),
784 /* AM/DM37x EVM: DSS data bus muxed with sys_boot */
785 OMAP3_MUX(DSS_DATA18, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
786 OMAP3_MUX(DSS_DATA19, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
787 OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
788 OMAP3_MUX(DSS_DATA21, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
789 OMAP3_MUX(DSS_DATA22, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
790 OMAP3_MUX(DSS_DATA23, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
791 OMAP3_MUX(SYS_BOOT0, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
792 OMAP3_MUX(SYS_BOOT1, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
793 OMAP3_MUX(SYS_BOOT3, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
794 OMAP3_MUX(SYS_BOOT4, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
795 OMAP3_MUX(SYS_BOOT5, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
796 OMAP3_MUX(SYS_BOOT6, OMAP_MUX_MODE3 | OMAP_PIN_OFF_NONE),
797#ifdef CONFIG_WL12XX_PLATFORM_DATA
798 /* WLAN IRQ - GPIO 149 */
799 OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
800
801 /* WLAN POWER ENABLE - GPIO 150 */
802 OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
803
804 /* MMC2 SDIO pin muxes for WL12xx */
805 OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
806 OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
807 OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
808 OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
809 OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
810 OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
811#endif
812
661 { .reg_offset = OMAP_MUX_TERMINATOR }, 813 { .reg_offset = OMAP_MUX_TERMINATOR },
662}; 814};
815#else
816#define omap35x_board_mux NULL
817#define omap36x_board_mux NULL
663#endif 818#endif
664 819
665static struct omap_musb_board_data musb_board_data = { 820static struct omap_musb_board_data musb_board_data = {
@@ -671,11 +826,18 @@ static struct omap_musb_board_data musb_board_data = {
671static void __init omap3_evm_init(void) 826static void __init omap3_evm_init(void)
672{ 827{
673 omap3_evm_get_revision(); 828 omap3_evm_get_revision();
674 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 829
830 if (cpu_is_omap3630())
831 omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB);
832 else
833 omap3_mux_init(omap35x_board_mux, OMAP_PACKAGE_CBB);
834
835 omap_board_config = omap3_evm_config;
836 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
675 837
676 omap3_evm_i2c_init(); 838 omap3_evm_i2c_init();
677 839
678 platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices)); 840 omap_display_init(&omap3_evm_dss_data);
679 841
680 spi_register_board_info(omap3evm_spi_board_info, 842 spi_register_board_info(omap3evm_spi_board_info,
681 ARRAY_SIZE(omap3evm_spi_board_info)); 843 ARRAY_SIZE(omap3evm_spi_board_info));
@@ -715,14 +877,22 @@ static void __init omap3_evm_init(void)
715 ads7846_dev_init(); 877 ads7846_dev_init();
716 omap3evm_init_smsc911x(); 878 omap3evm_init_smsc911x();
717 omap3_evm_display_init(); 879 omap3_evm_display_init();
880
881#ifdef CONFIG_WL12XX_PLATFORM_DATA
882 /* WL12xx WLAN Init */
883 if (wl12xx_set_platform_data(&omap3evm_wlan_data))
884 pr_err("error setting wl12xx data\n");
885 platform_device_register(&omap3evm_wlan_regulator);
886#endif
718} 887}
719 888
720MACHINE_START(OMAP3EVM, "OMAP3 EVM") 889MACHINE_START(OMAP3EVM, "OMAP3 EVM")
721 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */ 890 /* Maintainer: Syed Mohammed Khasim - Texas Instruments */
722 .boot_params = 0x80000100, 891 .boot_params = 0x80000100,
723 .map_io = omap3_map_io,
724 .reserve = omap_reserve, 892 .reserve = omap_reserve,
725 .init_irq = omap3_evm_init_irq, 893 .map_io = omap3_map_io,
894 .init_early = omap3_evm_init_early,
895 .init_irq = omap_init_irq,
726 .init_machine = omap3_evm_init, 896 .init_machine = omap3_evm_init,
727 .timer = &omap_timer, 897 .timer = &omap_timer,
728MACHINE_END 898MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 15e4b08e99ba..b726943d7c93 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -195,11 +195,10 @@ static inline void __init board_smsc911x_init(void)
195 gpmc_smsc911x_init(&board_smsc911x_data); 195 gpmc_smsc911x_init(&board_smsc911x_data);
196} 196}
197 197
198static void __init omap3logic_init_irq(void) 198static void __init omap3logic_init_early(void)
199{ 199{
200 omap2_init_common_infrastructure(); 200 omap2_init_common_infrastructure();
201 omap2_init_common_devices(NULL, NULL); 201 omap2_init_common_devices(NULL, NULL);
202 omap_init_irq();
203} 202}
204 203
205#ifdef CONFIG_OMAP_MUX 204#ifdef CONFIG_OMAP_MUX
@@ -225,7 +224,8 @@ static void __init omap3logic_init(void)
225MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") 224MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
226 .boot_params = 0x80000100, 225 .boot_params = 0x80000100,
227 .map_io = omap3_map_io, 226 .map_io = omap3_map_io,
228 .init_irq = omap3logic_init_irq, 227 .init_early = omap3logic_init_early,
228 .init_irq = omap_init_irq,
229 .init_machine = omap3logic_init, 229 .init_machine = omap3logic_init,
230 .timer = &omap_timer, 230 .timer = &omap_timer,
231MACHINE_END 231MACHINE_END
@@ -233,7 +233,8 @@ MACHINE_END
233MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") 233MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
234 .boot_params = 0x80000100, 234 .boot_params = 0x80000100,
235 .map_io = omap3_map_io, 235 .map_io = omap3_map_io,
236 .init_irq = omap3logic_init_irq, 236 .init_early = omap3logic_init_early,
237 .init_irq = omap_init_irq,
237 .init_machine = omap3logic_init, 238 .init_machine = omap3logic_init,
238 .timer = &omap_timer, 239 .timer = &omap_timer,
239MACHINE_END 240MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 0b34beded11f..5386a8190ea1 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -253,14 +253,6 @@ static struct omap_dss_board_info pandora_dss_data = {
253 .default_device = &pandora_lcd_device, 253 .default_device = &pandora_lcd_device,
254}; 254};
255 255
256static struct platform_device pandora_dss_device = {
257 .name = "omapdss",
258 .id = -1,
259 .dev = {
260 .platform_data = &pandora_dss_data,
261 },
262};
263
264static void pandora_wl1251_init_card(struct mmc_card *card) 256static void pandora_wl1251_init_card(struct mmc_card *card)
265{ 257{
266 /* 258 /*
@@ -341,13 +333,13 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = {
341}; 333};
342 334
343static struct regulator_consumer_supply pandora_vmmc1_supply = 335static struct regulator_consumer_supply pandora_vmmc1_supply =
344 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 336 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
345 337
346static struct regulator_consumer_supply pandora_vmmc2_supply = 338static struct regulator_consumer_supply pandora_vmmc2_supply =
347 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 339 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
348 340
349static struct regulator_consumer_supply pandora_vmmc3_supply = 341static struct regulator_consumer_supply pandora_vmmc3_supply =
350 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2"); 342 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2");
351 343
352static struct regulator_consumer_supply pandora_vdda_dac_supply = 344static struct regulator_consumer_supply pandora_vdda_dac_supply =
353 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 345 REGULATOR_SUPPLY("vdda_dac", "omapdss");
@@ -524,9 +516,7 @@ static struct twl4030_usb_data omap3pandora_usb_data = {
524 .usb_mode = T2_USB_MODE_ULPI, 516 .usb_mode = T2_USB_MODE_ULPI,
525}; 517};
526 518
527static struct twl4030_codec_audio_data omap3pandora_audio_data = { 519static struct twl4030_codec_audio_data omap3pandora_audio_data;
528 .audio_mclk = 26000000,
529};
530 520
531static struct twl4030_codec_data omap3pandora_codec_data = { 521static struct twl4030_codec_data omap3pandora_codec_data = {
532 .audio_mclk = 26000000, 522 .audio_mclk = 26000000,
@@ -634,12 +624,11 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
634 } 624 }
635}; 625};
636 626
637static void __init omap3pandora_init_irq(void) 627static void __init omap3pandora_init_early(void)
638{ 628{
639 omap2_init_common_infrastructure(); 629 omap2_init_common_infrastructure();
640 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 630 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
641 mt46h32m32lf6_sdrc_params); 631 mt46h32m32lf6_sdrc_params);
642 omap_init_irq();
643} 632}
644 633
645static void __init pandora_wl1251_init(void) 634static void __init pandora_wl1251_init(void)
@@ -677,7 +666,6 @@ fail:
677static struct platform_device *omap3pandora_devices[] __initdata = { 666static struct platform_device *omap3pandora_devices[] __initdata = {
678 &pandora_leds_gpio, 667 &pandora_leds_gpio,
679 &pandora_keys_gpio, 668 &pandora_keys_gpio,
680 &pandora_dss_device,
681 &pandora_vwlan_device, 669 &pandora_vwlan_device,
682}; 670};
683 671
@@ -712,6 +700,7 @@ static void __init omap3pandora_init(void)
712 pandora_wl1251_init(); 700 pandora_wl1251_init();
713 platform_add_devices(omap3pandora_devices, 701 platform_add_devices(omap3pandora_devices,
714 ARRAY_SIZE(omap3pandora_devices)); 702 ARRAY_SIZE(omap3pandora_devices));
703 omap_display_init(&pandora_dss_data);
715 omap_serial_init(); 704 omap_serial_init();
716 spi_register_board_info(omap3pandora_spi_board_info, 705 spi_register_board_info(omap3pandora_spi_board_info,
717 ARRAY_SIZE(omap3pandora_spi_board_info)); 706 ARRAY_SIZE(omap3pandora_spi_board_info));
@@ -727,9 +716,10 @@ static void __init omap3pandora_init(void)
727 716
728MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") 717MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
729 .boot_params = 0x80000100, 718 .boot_params = 0x80000100,
730 .map_io = omap3_map_io,
731 .reserve = omap_reserve, 719 .reserve = omap_reserve,
732 .init_irq = omap3pandora_init_irq, 720 .map_io = omap3_map_io,
721 .init_early = omap3pandora_init_early,
722 .init_irq = omap_init_irq,
733 .init_machine = omap3pandora_init, 723 .init_machine = omap3pandora_init,
734 .timer = &omap_timer, 724 .timer = &omap_timer,
735MACHINE_END 725MACHINE_END
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 2a2dad447e86..15ede8b49815 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -240,14 +240,6 @@ static struct omap_dss_board_info omap3_stalker_dss_data = {
240 .default_device = &omap3_stalker_dvi_device, 240 .default_device = &omap3_stalker_dvi_device,
241}; 241};
242 242
243static struct platform_device omap3_stalker_dss_device = {
244 .name = "omapdss",
245 .id = -1,
246 .dev = {
247 .platform_data = &omap3_stalker_dss_data,
248 },
249};
250
251static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { 243static struct regulator_consumer_supply omap3stalker_vmmc1_supply = {
252 .supply = "vmmc", 244 .supply = "vmmc",
253}; 245};
@@ -439,19 +431,15 @@ static struct twl4030_madc_platform_data omap3stalker_madc_data = {
439 .irq_line = 1, 431 .irq_line = 1,
440}; 432};
441 433
442static struct twl4030_codec_audio_data omap3stalker_audio_data = { 434static struct twl4030_codec_audio_data omap3stalker_audio_data;
443 .audio_mclk = 26000000,
444};
445 435
446static struct twl4030_codec_data omap3stalker_codec_data = { 436static struct twl4030_codec_data omap3stalker_codec_data = {
447 .audio_mclk = 26000000, 437 .audio_mclk = 26000000,
448 .audio = &omap3stalker_audio_data, 438 .audio = &omap3stalker_audio_data,
449}; 439};
450 440
451static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = { 441static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply =
452 .supply = "vdda_dac", 442 REGULATOR_SUPPLY("vdda_dac", "omapdss");
453 .dev = &omap3_stalker_dss_device.dev,
454};
455 443
456/* VDAC for DSS driving S-Video */ 444/* VDAC for DSS driving S-Video */
457static struct regulator_init_data omap3_stalker_vdac = { 445static struct regulator_init_data omap3_stalker_vdac = {
@@ -469,10 +457,8 @@ static struct regulator_init_data omap3_stalker_vdac = {
469}; 457};
470 458
471/* VPLL2 for digital video outputs */ 459/* VPLL2 for digital video outputs */
472static struct regulator_consumer_supply omap3_stalker_vpll2_supply = { 460static struct regulator_consumer_supply omap3_stalker_vpll2_supply =
473 .supply = "vdds_dsi", 461 REGULATOR_SUPPLY("vdds_dsi", "omapdss");
474 .dev = &omap3_stalker_lcd_device.dev,
475};
476 462
477static struct regulator_init_data omap3_stalker_vpll2 = { 463static struct regulator_init_data omap3_stalker_vpll2 = {
478 .constraints = { 464 .constraints = {
@@ -591,12 +577,14 @@ static struct spi_board_info omap3stalker_spi_board_info[] = {
591static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { 577static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
592}; 578};
593 579
594static void __init omap3_stalker_init_irq(void) 580static void __init omap3_stalker_init_early(void)
595{ 581{
596 omap_board_config = omap3_stalker_config;
597 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
598 omap2_init_common_infrastructure(); 582 omap2_init_common_infrastructure();
599 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL); 583 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
584}
585
586static void __init omap3_stalker_init_irq(void)
587{
600 omap_init_irq(); 588 omap_init_irq();
601#ifdef CONFIG_OMAP_32K_TIMER 589#ifdef CONFIG_OMAP_32K_TIMER
602 omap2_gp_clockevent_set_gptimer(12); 590 omap2_gp_clockevent_set_gptimer(12);
@@ -604,7 +592,6 @@ static void __init omap3_stalker_init_irq(void)
604} 592}
605 593
606static struct platform_device *omap3_stalker_devices[] __initdata = { 594static struct platform_device *omap3_stalker_devices[] __initdata = {
607 &omap3_stalker_dss_device,
608 &keys_gpio, 595 &keys_gpio,
609}; 596};
610 597
@@ -638,12 +625,15 @@ static struct omap_musb_board_data musb_board_data = {
638static void __init omap3_stalker_init(void) 625static void __init omap3_stalker_init(void)
639{ 626{
640 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 627 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
628 omap_board_config = omap3_stalker_config;
629 omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);
641 630
642 omap3_stalker_i2c_init(); 631 omap3_stalker_i2c_init();
643 632
644 platform_add_devices(omap3_stalker_devices, 633 platform_add_devices(omap3_stalker_devices,
645 ARRAY_SIZE(omap3_stalker_devices)); 634 ARRAY_SIZE(omap3_stalker_devices));
646 635
636 omap_display_init(&omap3_stalker_dss_data);
647 spi_register_board_info(omap3stalker_spi_board_info, 637 spi_register_board_info(omap3stalker_spi_board_info,
648 ARRAY_SIZE(omap3stalker_spi_board_info)); 638 ARRAY_SIZE(omap3stalker_spi_board_info));
649 639
@@ -666,6 +656,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
666 /* Maintainer: Jason Lam -lzg@ema-tech.com */ 656 /* Maintainer: Jason Lam -lzg@ema-tech.com */
667 .boot_params = 0x80000100, 657 .boot_params = 0x80000100,
668 .map_io = omap3_map_io, 658 .map_io = omap3_map_io,
659 .init_early = omap3_stalker_init_early,
669 .init_irq = omap3_stalker_init_irq, 660 .init_irq = omap3_stalker_init_irq,
670 .init_machine = omap3_stalker_init, 661 .init_machine = omap3_stalker_init,
671 .timer = &omap_timer, 662 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index db1f74fe6c4f..5554f5814aa4 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -252,9 +252,7 @@ static struct twl4030_usb_data touchbook_usb_data = {
252 .usb_mode = T2_USB_MODE_ULPI, 252 .usb_mode = T2_USB_MODE_ULPI,
253}; 253};
254 254
255static struct twl4030_codec_audio_data touchbook_audio_data = { 255static struct twl4030_codec_audio_data touchbook_audio_data;
256 .audio_mclk = 26000000,
257};
258 256
259static struct twl4030_codec_data touchbook_codec_data = { 257static struct twl4030_codec_data touchbook_codec_data = {
260 .audio_mclk = 26000000, 258 .audio_mclk = 26000000,
@@ -415,14 +413,15 @@ static struct omap_board_mux board_mux[] __initdata = {
415}; 413};
416#endif 414#endif
417 415
418static void __init omap3_touchbook_init_irq(void) 416static void __init omap3_touchbook_init_early(void)
419{ 417{
420 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
421 omap_board_config = omap3_touchbook_config;
422 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
423 omap2_init_common_infrastructure(); 418 omap2_init_common_infrastructure();
424 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 419 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
425 mt46h32m32lf6_sdrc_params); 420 mt46h32m32lf6_sdrc_params);
421}
422
423static void __init omap3_touchbook_init_irq(void)
424{
426 omap_init_irq(); 425 omap_init_irq();
427#ifdef CONFIG_OMAP_32K_TIMER 426#ifdef CONFIG_OMAP_32K_TIMER
428 omap2_gp_clockevent_set_gptimer(12); 427 omap2_gp_clockevent_set_gptimer(12);
@@ -510,6 +509,10 @@ static struct omap_musb_board_data musb_board_data = {
510 509
511static void __init omap3_touchbook_init(void) 510static void __init omap3_touchbook_init(void)
512{ 511{
512 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
513 omap_board_config = omap3_touchbook_config;
514 omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
515
513 pm_power_off = omap3_touchbook_poweroff; 516 pm_power_off = omap3_touchbook_poweroff;
514 517
515 omap3_touchbook_i2c_init(); 518 omap3_touchbook_i2c_init();
@@ -538,8 +541,9 @@ static void __init omap3_touchbook_init(void)
538MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") 541MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
539 /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */ 542 /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */
540 .boot_params = 0x80000100, 543 .boot_params = 0x80000100,
541 .map_io = omap3_map_io,
542 .reserve = omap_reserve, 544 .reserve = omap_reserve,
545 .map_io = omap3_map_io,
546 .init_early = omap3_touchbook_init_early,
543 .init_irq = omap3_touchbook_init_irq, 547 .init_irq = omap3_touchbook_init_irq,
544 .init_machine = omap3_touchbook_init, 548 .init_machine = omap3_touchbook_init,
545 .timer = &omap_timer, 549 .timer = &omap_timer,
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index e944025d5ef8..a94ce07be72f 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -26,6 +26,8 @@
26#include <linux/usb/otg.h> 26#include <linux/usb/otg.h>
27#include <linux/i2c/twl.h> 27#include <linux/i2c/twl.h>
28#include <linux/regulator/machine.h> 28#include <linux/regulator/machine.h>
29#include <linux/regulator/fixed.h>
30#include <linux/wl12xx.h>
29 31
30#include <mach/hardware.h> 32#include <mach/hardware.h>
31#include <mach/omap4-common.h> 33#include <mach/omap4-common.h>
@@ -45,6 +47,18 @@
45 47
46#define GPIO_HUB_POWER 1 48#define GPIO_HUB_POWER 1
47#define GPIO_HUB_NRESET 62 49#define GPIO_HUB_NRESET 62
50#define GPIO_WIFI_PMENA 43
51#define GPIO_WIFI_IRQ 53
52
53/* wl127x BT, FM, GPS connectivity chip */
54static int wl1271_gpios[] = {46, -1, -1};
55static struct platform_device wl1271_device = {
56 .name = "kim",
57 .id = -1,
58 .dev = {
59 .platform_data = &wl1271_gpios,
60 },
61};
48 62
49static struct gpio_led gpio_leds[] = { 63static struct gpio_led gpio_leds[] = {
50 { 64 {
@@ -74,13 +88,13 @@ static struct platform_device leds_gpio = {
74 88
75static struct platform_device *panda_devices[] __initdata = { 89static struct platform_device *panda_devices[] __initdata = {
76 &leds_gpio, 90 &leds_gpio,
91 &wl1271_device,
77}; 92};
78 93
79static void __init omap4_panda_init_irq(void) 94static void __init omap4_panda_init_early(void)
80{ 95{
81 omap2_init_common_infrastructure(); 96 omap2_init_common_infrastructure();
82 omap2_init_common_devices(NULL, NULL); 97 omap2_init_common_devices(NULL, NULL);
83 gic_init_irq();
84} 98}
85 99
86static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 100static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
@@ -162,16 +176,62 @@ static struct omap2_hsmmc_info mmc[] = {
162 .gpio_wp = -EINVAL, 176 .gpio_wp = -EINVAL,
163 .gpio_cd = -EINVAL, 177 .gpio_cd = -EINVAL,
164 }, 178 },
179 {
180 .name = "wl1271",
181 .mmc = 5,
182 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
183 .gpio_wp = -EINVAL,
184 .gpio_cd = -EINVAL,
185 .ocr_mask = MMC_VDD_165_195,
186 .nonremovable = true,
187 },
165 {} /* Terminator */ 188 {} /* Terminator */
166}; 189};
167 190
168static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { 191static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
169 { 192 {
170 .supply = "vmmc", 193 .supply = "vmmc",
171 .dev_name = "mmci-omap-hs.0", 194 .dev_name = "omap_hsmmc.0",
195 },
196};
197
198static struct regulator_consumer_supply omap4_panda_vmmc5_supply = {
199 .supply = "vmmc",
200 .dev_name = "omap_hsmmc.4",
201};
202
203static struct regulator_init_data panda_vmmc5 = {
204 .constraints = {
205 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
206 },
207 .num_consumer_supplies = 1,
208 .consumer_supplies = &omap4_panda_vmmc5_supply,
209};
210
211static struct fixed_voltage_config panda_vwlan = {
212 .supply_name = "vwl1271",
213 .microvolts = 1800000, /* 1.8V */
214 .gpio = GPIO_WIFI_PMENA,
215 .startup_delay = 70000, /* 70msec */
216 .enable_high = 1,
217 .enabled_at_boot = 0,
218 .init_data = &panda_vmmc5,
219};
220
221static struct platform_device omap_vwlan_device = {
222 .name = "reg-fixed-voltage",
223 .id = 1,
224 .dev = {
225 .platform_data = &panda_vwlan,
172 }, 226 },
173}; 227};
174 228
229struct wl12xx_platform_data omap_panda_wlan_data __initdata = {
230 .irq = OMAP_GPIO_IRQ(GPIO_WIFI_IRQ),
231 /* PANDA ref clock is 38.4 MHz */
232 .board_ref_clock = 2,
233};
234
175static int omap4_twl6030_hsmmc_late_init(struct device *dev) 235static int omap4_twl6030_hsmmc_late_init(struct device *dev)
176{ 236{
177 int ret = 0; 237 int ret = 0;
@@ -305,7 +365,6 @@ static struct regulator_init_data omap4_panda_vana = {
305 .constraints = { 365 .constraints = {
306 .min_uV = 2100000, 366 .min_uV = 2100000,
307 .max_uV = 2100000, 367 .max_uV = 2100000,
308 .apply_uV = true,
309 .valid_modes_mask = REGULATOR_MODE_NORMAL 368 .valid_modes_mask = REGULATOR_MODE_NORMAL
310 | REGULATOR_MODE_STANDBY, 369 | REGULATOR_MODE_STANDBY,
311 .valid_ops_mask = REGULATOR_CHANGE_MODE 370 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -317,7 +376,6 @@ static struct regulator_init_data omap4_panda_vcxio = {
317 .constraints = { 376 .constraints = {
318 .min_uV = 1800000, 377 .min_uV = 1800000,
319 .max_uV = 1800000, 378 .max_uV = 1800000,
320 .apply_uV = true,
321 .valid_modes_mask = REGULATOR_MODE_NORMAL 379 .valid_modes_mask = REGULATOR_MODE_NORMAL
322 | REGULATOR_MODE_STANDBY, 380 | REGULATOR_MODE_STANDBY,
323 .valid_ops_mask = REGULATOR_CHANGE_MODE 381 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -329,7 +387,6 @@ static struct regulator_init_data omap4_panda_vdac = {
329 .constraints = { 387 .constraints = {
330 .min_uV = 1800000, 388 .min_uV = 1800000,
331 .max_uV = 1800000, 389 .max_uV = 1800000,
332 .apply_uV = true,
333 .valid_modes_mask = REGULATOR_MODE_NORMAL 390 .valid_modes_mask = REGULATOR_MODE_NORMAL
334 | REGULATOR_MODE_STANDBY, 391 | REGULATOR_MODE_STANDBY,
335 .valid_ops_mask = REGULATOR_CHANGE_MODE 392 .valid_ops_mask = REGULATOR_CHANGE_MODE
@@ -391,6 +448,19 @@ static int __init omap4_panda_i2c_init(void)
391 448
392#ifdef CONFIG_OMAP_MUX 449#ifdef CONFIG_OMAP_MUX
393static struct omap_board_mux board_mux[] __initdata = { 450static struct omap_board_mux board_mux[] __initdata = {
451 /* WLAN IRQ - GPIO 53 */
452 OMAP4_MUX(GPMC_NCS3, OMAP_MUX_MODE3 | OMAP_PIN_INPUT),
453 /* WLAN POWER ENABLE - GPIO 43 */
454 OMAP4_MUX(GPMC_A19, OMAP_MUX_MODE3 | OMAP_PIN_OUTPUT),
455 /* WLAN SDIO: MMC5 CMD */
456 OMAP4_MUX(SDMMC5_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
457 /* WLAN SDIO: MMC5 CLK */
458 OMAP4_MUX(SDMMC5_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
459 /* WLAN SDIO: MMC5 DAT[0-3] */
460 OMAP4_MUX(SDMMC5_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
461 OMAP4_MUX(SDMMC5_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
462 OMAP4_MUX(SDMMC5_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
463 OMAP4_MUX(SDMMC5_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
394 { .reg_offset = OMAP_MUX_TERMINATOR }, 464 { .reg_offset = OMAP_MUX_TERMINATOR },
395}; 465};
396#else 466#else
@@ -405,8 +475,12 @@ static void __init omap4_panda_init(void)
405 package = OMAP_PACKAGE_CBL; 475 package = OMAP_PACKAGE_CBL;
406 omap4_mux_init(board_mux, package); 476 omap4_mux_init(board_mux, package);
407 477
478 if (wl12xx_set_platform_data(&omap_panda_wlan_data))
479 pr_err("error setting wl12xx data\n");
480
408 omap4_panda_i2c_init(); 481 omap4_panda_i2c_init();
409 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); 482 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
483 platform_device_register(&omap_vwlan_device);
410 omap_serial_init(); 484 omap_serial_init();
411 omap4_twl6030_hsmmc_init(mmc); 485 omap4_twl6030_hsmmc_init(mmc);
412 omap4_ehci_init(); 486 omap4_ehci_init();
@@ -424,7 +498,8 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
424 .boot_params = 0x80000100, 498 .boot_params = 0x80000100,
425 .reserve = omap_reserve, 499 .reserve = omap_reserve,
426 .map_io = omap4_panda_map_io, 500 .map_io = omap4_panda_map_io,
427 .init_irq = omap4_panda_init_irq, 501 .init_early = omap4_panda_init_early,
502 .init_irq = gic_init_irq,
428 .init_machine = omap4_panda_init, 503 .init_machine = omap4_panda_init,
429 .timer = &omap_timer, 504 .timer = &omap_timer,
430MACHINE_END 505MACHINE_END
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index cb26e5d8268d..60f8db31763c 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -358,9 +358,7 @@ static struct regulator_init_data overo_vmmc1 = {
358 .consumer_supplies = &overo_vmmc1_supply, 358 .consumer_supplies = &overo_vmmc1_supply,
359}; 359};
360 360
361static struct twl4030_codec_audio_data overo_audio_data = { 361static struct twl4030_codec_audio_data overo_audio_data;
362 .audio_mclk = 26000000,
363};
364 362
365static struct twl4030_codec_data overo_codec_data = { 363static struct twl4030_codec_data overo_codec_data = {
366 .audio_mclk = 26000000, 364 .audio_mclk = 26000000,
@@ -409,14 +407,11 @@ static struct omap_board_config_kernel overo_config[] __initdata = {
409 { OMAP_TAG_LCD, &overo_lcd_config }, 407 { OMAP_TAG_LCD, &overo_lcd_config },
410}; 408};
411 409
412static void __init overo_init_irq(void) 410static void __init overo_init_early(void)
413{ 411{
414 omap_board_config = overo_config;
415 omap_board_config_size = ARRAY_SIZE(overo_config);
416 omap2_init_common_infrastructure(); 412 omap2_init_common_infrastructure();
417 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, 413 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
418 mt46h32m32lf6_sdrc_params); 414 mt46h32m32lf6_sdrc_params);
419 omap_init_irq();
420} 415}
421 416
422static struct platform_device *overo_devices[] __initdata = { 417static struct platform_device *overo_devices[] __initdata = {
@@ -449,6 +444,8 @@ static struct omap_musb_board_data musb_board_data = {
449static void __init overo_init(void) 444static void __init overo_init(void)
450{ 445{
451 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 446 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
447 omap_board_config = overo_config;
448 omap_board_config_size = ARRAY_SIZE(overo_config);
452 overo_i2c_init(); 449 overo_i2c_init();
453 platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices)); 450 platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
454 omap_serial_init(); 451 omap_serial_init();
@@ -501,9 +498,10 @@ static void __init overo_init(void)
501 498
502MACHINE_START(OVERO, "Gumstix Overo") 499MACHINE_START(OVERO, "Gumstix Overo")
503 .boot_params = 0x80000100, 500 .boot_params = 0x80000100,
504 .map_io = omap3_map_io,
505 .reserve = omap_reserve, 501 .reserve = omap_reserve,
506 .init_irq = overo_init_irq, 502 .map_io = omap3_map_io,
503 .init_early = overo_init_early,
504 .init_irq = omap_init_irq,
507 .init_machine = overo_init, 505 .init_machine = overo_init,
508 .timer = &omap_timer, 506 .timer = &omap_timer,
509MACHINE_END 507MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 39a71bb8a308..2af8b05e786d 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -33,7 +33,7 @@
33#include "sdram-nokia.h" 33#include "sdram-nokia.h"
34 34
35static struct regulator_consumer_supply rm680_vemmc_consumers[] = { 35static struct regulator_consumer_supply rm680_vemmc_consumers[] = {
36 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), 36 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
37}; 37};
38 38
39/* Fixed regulator for internal eMMC */ 39/* Fixed regulator for internal eMMC */
@@ -138,14 +138,13 @@ static void __init rm680_peripherals_init(void)
138 omap2_hsmmc_init(mmc); 138 omap2_hsmmc_init(mmc);
139} 139}
140 140
141static void __init rm680_init_irq(void) 141static void __init rm680_init_early(void)
142{ 142{
143 struct omap_sdrc_params *sdrc_params; 143 struct omap_sdrc_params *sdrc_params;
144 144
145 omap2_init_common_infrastructure(); 145 omap2_init_common_infrastructure();
146 sdrc_params = nokia_get_sdram_timings(); 146 sdrc_params = nokia_get_sdram_timings();
147 omap2_init_common_devices(sdrc_params, sdrc_params); 147 omap2_init_common_devices(sdrc_params, sdrc_params);
148 omap_init_irq();
149} 148}
150 149
151#ifdef CONFIG_OMAP_MUX 150#ifdef CONFIG_OMAP_MUX
@@ -176,9 +175,10 @@ static void __init rm680_map_io(void)
176 175
177MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") 176MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
178 .boot_params = 0x80000100, 177 .boot_params = 0x80000100,
179 .map_io = rm680_map_io,
180 .reserve = omap_reserve, 178 .reserve = omap_reserve,
181 .init_irq = rm680_init_irq, 179 .map_io = rm680_map_io,
180 .init_early = rm680_init_early,
181 .init_irq = omap_init_irq,
182 .init_machine = rm680_init, 182 .init_machine = rm680_init,
183 .timer = &omap_timer, 183 .timer = &omap_timer,
184MACHINE_END 184MACHINE_END
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index e75e240cad67..5f1900c532ec 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -36,6 +36,8 @@
36 36
37#include <sound/tlv320aic3x.h> 37#include <sound/tlv320aic3x.h>
38#include <sound/tpa6130a2-plat.h> 38#include <sound/tpa6130a2-plat.h>
39#include <media/radio-si4713.h>
40#include <media/si4713.h>
39 41
40#include <../drivers/staging/iio/light/tsl2563.h> 42#include <../drivers/staging/iio/light/tsl2563.h>
41 43
@@ -47,6 +49,8 @@
47 49
48#define RX51_WL1251_POWER_GPIO 87 50#define RX51_WL1251_POWER_GPIO 87
49#define RX51_WL1251_IRQ_GPIO 42 51#define RX51_WL1251_IRQ_GPIO 42
52#define RX51_FMTX_RESET_GPIO 163
53#define RX51_FMTX_IRQ 53
50 54
51/* list all spi devices here */ 55/* list all spi devices here */
52enum { 56enum {
@@ -331,13 +335,13 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
331}; 335};
332 336
333static struct regulator_consumer_supply rx51_vmmc1_supply = 337static struct regulator_consumer_supply rx51_vmmc1_supply =
334 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.0"); 338 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0");
335 339
336static struct regulator_consumer_supply rx51_vaux3_supply = 340static struct regulator_consumer_supply rx51_vaux3_supply =
337 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 341 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
338 342
339static struct regulator_consumer_supply rx51_vsim_supply = 343static struct regulator_consumer_supply rx51_vsim_supply =
340 REGULATOR_SUPPLY("vmmc_aux", "mmci-omap-hs.1"); 344 REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1");
341 345
342static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { 346static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
343 /* tlv320aic3x analog supplies */ 347 /* tlv320aic3x analog supplies */
@@ -348,7 +352,7 @@ static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
348 /* tpa6130a2 */ 352 /* tpa6130a2 */
349 REGULATOR_SUPPLY("Vdd", "2-0060"), 353 REGULATOR_SUPPLY("Vdd", "2-0060"),
350 /* Keep vmmc as last item. It is not iterated for newer boards */ 354 /* Keep vmmc as last item. It is not iterated for newer boards */
351 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"), 355 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"),
352}; 356};
353 357
354static struct regulator_consumer_supply rx51_vio_supplies[] = { 358static struct regulator_consumer_supply rx51_vio_supplies[] = {
@@ -357,10 +361,14 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = {
357 REGULATOR_SUPPLY("DVDD", "2-0018"), 361 REGULATOR_SUPPLY("DVDD", "2-0018"),
358 REGULATOR_SUPPLY("IOVDD", "2-0019"), 362 REGULATOR_SUPPLY("IOVDD", "2-0019"),
359 REGULATOR_SUPPLY("DVDD", "2-0019"), 363 REGULATOR_SUPPLY("DVDD", "2-0019"),
364 /* Si4713 IO supply */
365 REGULATOR_SUPPLY("vio", "2-0063"),
360}; 366};
361 367
362static struct regulator_consumer_supply rx51_vaux1_consumers[] = { 368static struct regulator_consumer_supply rx51_vaux1_consumers[] = {
363 REGULATOR_SUPPLY("vdds_sdi", "omapdss"), 369 REGULATOR_SUPPLY("vdds_sdi", "omapdss"),
370 /* Si4713 supply */
371 REGULATOR_SUPPLY("vdd", "2-0063"),
364}; 372};
365 373
366static struct regulator_consumer_supply rx51_vdac_supply[] = { 374static struct regulator_consumer_supply rx51_vdac_supply[] = {
@@ -511,6 +519,41 @@ static struct regulator_init_data rx51_vio = {
511 .consumer_supplies = rx51_vio_supplies, 519 .consumer_supplies = rx51_vio_supplies,
512}; 520};
513 521
522static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = {
523 .gpio_reset = RX51_FMTX_RESET_GPIO,
524};
525
526static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = {
527 I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH),
528 .platform_data = &rx51_si4713_i2c_data,
529};
530
531static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = {
532 .i2c_bus = 2,
533 .subdev_board_info = &rx51_si4713_board_info,
534};
535
536static struct platform_device rx51_si4713_dev __initdata_or_module = {
537 .name = "radio-si4713",
538 .id = -1,
539 .dev = {
540 .platform_data = &rx51_si4713_data,
541 },
542};
543
544static __init void rx51_init_si4713(void)
545{
546 int err;
547
548 err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq");
549 if (err) {
550 printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err);
551 return;
552 }
553 rx51_si4713_board_info.irq = gpio_to_irq(RX51_FMTX_IRQ);
554 platform_device_register(&rx51_si4713_dev);
555}
556
514static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) 557static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
515{ 558{
516 /* FIXME this gpio setup is just a placeholder for now */ 559 /* FIXME this gpio setup is just a placeholder for now */
@@ -699,6 +742,14 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
699 .resource_config = twl4030_rconfig, 742 .resource_config = twl4030_rconfig,
700}; 743};
701 744
745struct twl4030_codec_vibra_data rx51_vibra_data __initdata = {
746 .coexist = 0,
747};
748
749struct twl4030_codec_data rx51_codec_data __initdata = {
750 .audio_mclk = 26000000,
751 .vibra = &rx51_vibra_data,
752};
702 753
703static struct twl4030_platform_data rx51_twldata __initdata = { 754static struct twl4030_platform_data rx51_twldata __initdata = {
704 .irq_base = TWL4030_IRQ_BASE, 755 .irq_base = TWL4030_IRQ_BASE,
@@ -710,6 +761,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
710 .madc = &rx51_madc_data, 761 .madc = &rx51_madc_data,
711 .usb = &rx51_usb_data, 762 .usb = &rx51_usb_data,
712 .power = &rx51_t2scripts_data, 763 .power = &rx51_t2scripts_data,
764 .codec = &rx51_codec_data,
713 765
714 .vaux1 = &rx51_vaux1, 766 .vaux1 = &rx51_vaux1,
715 .vaux2 = &rx51_vaux2, 767 .vaux2 = &rx51_vaux2,
@@ -921,6 +973,7 @@ void __init rx51_peripherals_init(void)
921 board_smc91x_init(); 973 board_smc91x_init();
922 rx51_add_gpio_keys(); 974 rx51_add_gpio_keys();
923 rx51_init_wl1251(); 975 rx51_init_wl1251();
976 rx51_init_si4713();
924 spi_register_board_info(rx51_peripherals_spi_board_info, 977 spi_register_board_info(rx51_peripherals_spi_board_info,
925 ARRAY_SIZE(rx51_peripherals_spi_board_info)); 978 ARRAY_SIZE(rx51_peripherals_spi_board_info));
926 979
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index acd670054d9a..89a66db8b77d 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -66,18 +66,6 @@ static struct omap_dss_board_info rx51_dss_board_info = {
66 .default_device = &rx51_lcd_device, 66 .default_device = &rx51_lcd_device,
67}; 67};
68 68
69struct platform_device rx51_display_device = {
70 .name = "omapdss",
71 .id = -1,
72 .dev = {
73 .platform_data = &rx51_dss_board_info,
74 },
75};
76
77static struct platform_device *rx51_video_devices[] __initdata = {
78 &rx51_display_device,
79};
80
81static int __init rx51_video_init(void) 69static int __init rx51_video_init(void)
82{ 70{
83 if (!machine_is_nokia_rx51()) 71 if (!machine_is_nokia_rx51())
@@ -95,8 +83,7 @@ static int __init rx51_video_init(void)
95 83
96 gpio_direction_output(RX51_LCD_RESET_GPIO, 1); 84 gpio_direction_output(RX51_LCD_RESET_GPIO, 1);
97 85
98 platform_add_devices(rx51_video_devices, 86 omap_display_init(&rx51_dss_board_info);
99 ARRAY_SIZE(rx51_video_devices));
100 return 0; 87 return 0;
101} 88}
102 89
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index f53fc551c58f..e964895b80e8 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -98,17 +98,13 @@ static struct omap_board_config_kernel rx51_config[] = {
98 { OMAP_TAG_LCD, &rx51_lcd_config }, 98 { OMAP_TAG_LCD, &rx51_lcd_config },
99}; 99};
100 100
101static void __init rx51_init_irq(void) 101static void __init rx51_init_early(void)
102{ 102{
103 struct omap_sdrc_params *sdrc_params; 103 struct omap_sdrc_params *sdrc_params;
104 104
105 omap_board_config = rx51_config;
106 omap_board_config_size = ARRAY_SIZE(rx51_config);
107 omap3_pm_init_cpuidle(rx51_cpuidle_params);
108 omap2_init_common_infrastructure(); 105 omap2_init_common_infrastructure();
109 sdrc_params = nokia_get_sdram_timings(); 106 sdrc_params = nokia_get_sdram_timings();
110 omap2_init_common_devices(sdrc_params, sdrc_params); 107 omap2_init_common_devices(sdrc_params, sdrc_params);
111 omap_init_irq();
112} 108}
113 109
114extern void __init rx51_peripherals_init(void); 110extern void __init rx51_peripherals_init(void);
@@ -128,6 +124,9 @@ static struct omap_musb_board_data musb_board_data = {
128static void __init rx51_init(void) 124static void __init rx51_init(void)
129{ 125{
130 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 126 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
127 omap_board_config = rx51_config;
128 omap_board_config_size = ARRAY_SIZE(rx51_config);
129 omap3_pm_init_cpuidle(rx51_cpuidle_params);
131 omap_serial_init(); 130 omap_serial_init();
132 usb_musb_init(&musb_board_data); 131 usb_musb_init(&musb_board_data);
133 rx51_peripherals_init(); 132 rx51_peripherals_init();
@@ -149,9 +148,10 @@ static void __init rx51_map_io(void)
149MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") 148MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
150 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */ 149 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
151 .boot_params = 0x80000100, 150 .boot_params = 0x80000100,
152 .map_io = rx51_map_io,
153 .reserve = omap_reserve, 151 .reserve = omap_reserve,
154 .init_irq = rx51_init_irq, 152 .map_io = rx51_map_io,
153 .init_early = rx51_init_early,
154 .init_irq = omap_init_irq,
155 .init_machine = rx51_init, 155 .init_machine = rx51_init,
156 .timer = &omap_timer, 156 .timer = &omap_timer,
157MACHINE_END 157MACHINE_END
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
new file mode 100644
index 000000000000..09fa7bfff8d6
--- /dev/null
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -0,0 +1,62 @@
1/*
2 * Code for TI8168 EVM.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#include <linux/kernel.h>
16#include <linux/init.h>
17
18#include <mach/hardware.h>
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22
23#include <plat/irqs.h>
24#include <plat/board.h>
25#include <plat/common.h>
26
27static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
28};
29
30static void __init ti8168_init_early(void)
31{
32 omap2_init_common_infrastructure();
33 omap2_init_common_devices(NULL, NULL);
34}
35
36static void __init ti8168_evm_init_irq(void)
37{
38 omap_init_irq();
39}
40
41static void __init ti8168_evm_init(void)
42{
43 omap_serial_init();
44 omap_board_config = ti8168_evm_config;
45 omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
46}
47
48static void __init ti8168_evm_map_io(void)
49{
50 omap2_set_globals_ti816x();
51 omapti816x_map_common_io();
52}
53
54MACHINE_START(TI8168EVM, "ti8168evm")
55 /* Maintainer: Texas Instruments */
56 .boot_params = 0x80000100,
57 .map_io = ti8168_evm_map_io,
58 .init_early = ti8168_init_early,
59 .init_irq = ti8168_evm_init_irq,
60 .timer = &omap_timer,
61 .init_machine = ti8168_evm_init,
62MACHINE_END
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index 6bcd43657aed..37b84c2b850f 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -130,14 +130,6 @@ static struct omap_dss_board_info zoom_dss_data = {
130 .default_device = &zoom_lcd_device, 130 .default_device = &zoom_lcd_device,
131}; 131};
132 132
133static struct platform_device zoom_dss_device = {
134 .name = "omapdss",
135 .id = -1,
136 .dev = {
137 .platform_data = &zoom_dss_data,
138 },
139};
140
141static struct omap2_mcspi_device_config dss_lcd_mcspi_config = { 133static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
142 .turbo_mode = 1, 134 .turbo_mode = 1,
143 .single_channel = 1, /* 0: slave, 1: master */ 135 .single_channel = 1, /* 0: slave, 1: master */
@@ -153,14 +145,9 @@ static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
153 }, 145 },
154}; 146};
155 147
156static struct platform_device *zoom_display_devices[] __initdata = {
157 &zoom_dss_device,
158};
159
160void __init zoom_display_init(void) 148void __init zoom_display_init(void)
161{ 149{
162 platform_add_devices(zoom_display_devices, 150 omap_display_init(&zoom_dss_data);
163 ARRAY_SIZE(zoom_display_devices));
164 spi_register_board_info(nec_8048_spi_board_info, 151 spi_register_board_info(nec_8048_spi_board_info,
165 ARRAY_SIZE(nec_8048_spi_board_info)); 152 ARRAY_SIZE(nec_8048_spi_board_info));
166 zoom_lcd_panel_init(); 153 zoom_lcd_panel_init();
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index e0e040f34c68..448ab60195d5 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -118,7 +118,7 @@ static struct regulator_consumer_supply zoom_vmmc2_supply = {
118 118
119static struct regulator_consumer_supply zoom_vmmc3_supply = { 119static struct regulator_consumer_supply zoom_vmmc3_supply = {
120 .supply = "vmmc", 120 .supply = "vmmc",
121 .dev_name = "mmci-omap-hs.2", 121 .dev_name = "omap_hsmmc.2",
122}; 122};
123 123
124/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ 124/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */
@@ -322,9 +322,7 @@ static struct twl4030_madc_platform_data zoom_madc_data = {
322 .irq_line = 1, 322 .irq_line = 1,
323}; 323};
324 324
325static struct twl4030_codec_audio_data zoom_audio_data = { 325static struct twl4030_codec_audio_data zoom_audio_data;
326 .audio_mclk = 26000000,
327};
328 326
329static struct twl4030_codec_data zoom_codec_data = { 327static struct twl4030_codec_data zoom_codec_data = {
330 .audio_mclk = 26000000, 328 .audio_mclk = 26000000,
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index e26754c24ee8..7e3f1595d77b 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -16,6 +16,7 @@
16#include <linux/input.h> 16#include <linux/input.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/i2c/twl.h> 18#include <linux/i2c/twl.h>
19#include <linux/mtd/nand.h>
19 20
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
@@ -33,7 +34,7 @@
33 34
34#define ZOOM3_EHCI_RESET_GPIO 64 35#define ZOOM3_EHCI_RESET_GPIO 64
35 36
36static void __init omap_zoom_init_irq(void) 37static void __init omap_zoom_init_early(void)
37{ 38{
38 omap2_init_common_infrastructure(); 39 omap2_init_common_infrastructure();
39 if (machine_is_omap_zoom2()) 40 if (machine_is_omap_zoom2())
@@ -42,8 +43,6 @@ static void __init omap_zoom_init_irq(void)
42 else if (machine_is_omap_zoom3()) 43 else if (machine_is_omap_zoom3())
43 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params, 44 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
44 h8mbx00u0mer0em_sdrc_params); 45 h8mbx00u0mer0em_sdrc_params);
45
46 omap_init_irq();
47} 46}
48 47
49#ifdef CONFIG_OMAP_MUX 48#ifdef CONFIG_OMAP_MUX
@@ -126,8 +125,8 @@ static void __init omap_zoom_init(void)
126 usb_ehci_init(&ehci_pdata); 125 usb_ehci_init(&ehci_pdata);
127 } 126 }
128 127
129 board_nand_init(zoom_nand_partitions, 128 board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
130 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS); 129 ZOOM_NAND_CS, NAND_BUSWIDTH_16);
131 zoom_debugboard_init(); 130 zoom_debugboard_init();
132 zoom_peripherals_init(); 131 zoom_peripherals_init();
133 zoom_display_init(); 132 zoom_display_init();
@@ -135,18 +134,20 @@ static void __init omap_zoom_init(void)
135 134
136MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") 135MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
137 .boot_params = 0x80000100, 136 .boot_params = 0x80000100,
138 .map_io = omap3_map_io,
139 .reserve = omap_reserve, 137 .reserve = omap_reserve,
140 .init_irq = omap_zoom_init_irq, 138 .map_io = omap3_map_io,
139 .init_early = omap_zoom_init_early,
140 .init_irq = omap_init_irq,
141 .init_machine = omap_zoom_init, 141 .init_machine = omap_zoom_init,
142 .timer = &omap_timer, 142 .timer = &omap_timer,
143MACHINE_END 143MACHINE_END
144 144
145MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") 145MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
146 .boot_params = 0x80000100, 146 .boot_params = 0x80000100,
147 .map_io = omap3_map_io,
148 .reserve = omap_reserve, 147 .reserve = omap_reserve,
149 .init_irq = omap_zoom_init_irq, 148 .map_io = omap3_map_io,
149 .init_early = omap_zoom_init_early,
150 .init_irq = omap_init_irq,
150 .init_machine = omap_zoom_init, 151 .init_machine = omap_zoom_init,
151 .timer = &omap_timer, 152 .timer = &omap_timer,
152MACHINE_END 153MACHINE_END
diff --git a/arch/arm/mach-omap2/clkt2xxx_apll.c b/arch/arm/mach-omap2/clkt2xxx_apll.c
index f51cffd1fc53..b19a1f7234ae 100644
--- a/arch/arm/mach-omap2/clkt2xxx_apll.c
+++ b/arch/arm/mach-omap2/clkt2xxx_apll.c
@@ -78,6 +78,26 @@ static int omap2_clk_apll54_enable(struct clk *clk)
78 return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK); 78 return omap2_clk_apll_enable(clk, OMAP24XX_ST_54M_APLL_MASK);
79} 79}
80 80
81static void _apll96_allow_idle(struct clk *clk)
82{
83 omap2xxx_cm_set_apll96_auto_low_power_stop();
84}
85
86static void _apll96_deny_idle(struct clk *clk)
87{
88 omap2xxx_cm_set_apll96_disable_autoidle();
89}
90
91static void _apll54_allow_idle(struct clk *clk)
92{
93 omap2xxx_cm_set_apll54_auto_low_power_stop();
94}
95
96static void _apll54_deny_idle(struct clk *clk)
97{
98 omap2xxx_cm_set_apll54_disable_autoidle();
99}
100
81/* Stop APLL */ 101/* Stop APLL */
82static void omap2_clk_apll_disable(struct clk *clk) 102static void omap2_clk_apll_disable(struct clk *clk)
83{ 103{
@@ -93,11 +113,15 @@ static void omap2_clk_apll_disable(struct clk *clk)
93const struct clkops clkops_apll96 = { 113const struct clkops clkops_apll96 = {
94 .enable = omap2_clk_apll96_enable, 114 .enable = omap2_clk_apll96_enable,
95 .disable = omap2_clk_apll_disable, 115 .disable = omap2_clk_apll_disable,
116 .allow_idle = _apll96_allow_idle,
117 .deny_idle = _apll96_deny_idle,
96}; 118};
97 119
98const struct clkops clkops_apll54 = { 120const struct clkops clkops_apll54 = {
99 .enable = omap2_clk_apll54_enable, 121 .enable = omap2_clk_apll54_enable,
100 .disable = omap2_clk_apll_disable, 122 .disable = omap2_clk_apll_disable,
123 .allow_idle = _apll54_allow_idle,
124 .deny_idle = _apll54_deny_idle,
101}; 125};
102 126
103/* Public functions */ 127/* Public functions */
diff --git a/arch/arm/mach-omap2/clkt2xxx_dpll.c b/arch/arm/mach-omap2/clkt2xxx_dpll.c
new file mode 100644
index 000000000000..1502a7bc20bb
--- /dev/null
+++ b/arch/arm/mach-omap2/clkt2xxx_dpll.c
@@ -0,0 +1,63 @@
1/*
2 * OMAP2-specific DPLL control functions
3 *
4 * Copyright (C) 2011 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/errno.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16
17#include <plat/clock.h>
18
19#include "clock.h"
20#include "cm2xxx_3xxx.h"
21#include "cm-regbits-24xx.h"
22
23/* Private functions */
24
25/**
26 * _allow_idle - enable DPLL autoidle bits
27 * @clk: struct clk * of the DPLL to operate on
28 *
29 * Enable DPLL automatic idle control. The DPLL will enter low-power
30 * stop when its downstream clocks are gated. No return value.
31 * REVISIT: DPLL can optionally enter low-power bypass by writing 0x1
32 * instead. Add some mechanism to optionally enter this mode.
33 */
34static void _allow_idle(struct clk *clk)
35{
36 if (!clk || !clk->dpll_data)
37 return;
38
39 omap2xxx_cm_set_dpll_auto_low_power_stop();
40}
41
42/**
43 * _deny_idle - prevent DPLL from automatically idling
44 * @clk: struct clk * of the DPLL to operate on
45 *
46 * Disable DPLL automatic idle control. No return value.
47 */
48static void _deny_idle(struct clk *clk)
49{
50 if (!clk || !clk->dpll_data)
51 return;
52
53 omap2xxx_cm_set_dpll_disable_autoidle();
54}
55
56
57/* Public data */
58
59const struct clkops clkops_omap2xxx_dpll_ops = {
60 .allow_idle = _allow_idle,
61 .deny_idle = _deny_idle,
62};
63
diff --git a/arch/arm/mach-omap2/clkt2xxx_osc.c b/arch/arm/mach-omap2/clkt2xxx_osc.c
index df7b80506483..c3460928b5e0 100644
--- a/arch/arm/mach-omap2/clkt2xxx_osc.c
+++ b/arch/arm/mach-omap2/clkt2xxx_osc.c
@@ -30,6 +30,13 @@
30#include "prm2xxx_3xxx.h" 30#include "prm2xxx_3xxx.h"
31#include "prm-regbits-24xx.h" 31#include "prm-regbits-24xx.h"
32 32
33/*
34 * XXX This does not actually enable the osc_ck, since the osc_ck must
35 * be running for this function to be called. Instead, this function
36 * is used to disable an autoidle mode on the osc_ck. The existing
37 * clk_enable/clk_disable()-based usecounting for osc_ck should be
38 * replaced with autoidle-based usecounting.
39 */
33static int omap2_enable_osc_ck(struct clk *clk) 40static int omap2_enable_osc_ck(struct clk *clk)
34{ 41{
35 u32 pcc; 42 u32 pcc;
@@ -41,6 +48,13 @@ static int omap2_enable_osc_ck(struct clk *clk)
41 return 0; 48 return 0;
42} 49}
43 50
51/*
52 * XXX This does not actually disable the osc_ck, since doing so would
53 * immediately halt the system. Instead, this function is used to
54 * enable an autoidle mode on the osc_ck. The existing
55 * clk_enable/clk_disable()-based usecounting for osc_ck should be
56 * replaced with autoidle-based usecounting.
57 */
44static void omap2_disable_osc_ck(struct clk *clk) 58static void omap2_disable_osc_ck(struct clk *clk)
45{ 59{
46 u32 pcc; 60 u32 pcc;
diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c
index a781cd6795a4..e25364de028a 100644
--- a/arch/arm/mach-omap2/clkt_clksel.c
+++ b/arch/arm/mach-omap2/clkt_clksel.c
@@ -97,7 +97,7 @@ static u8 _get_div_and_fieldval(struct clk *src_clk, struct clk *clk,
97 u32 *field_val) 97 u32 *field_val)
98{ 98{
99 const struct clksel *clks; 99 const struct clksel *clks;
100 const struct clksel_rate *clkr, *max_clkr; 100 const struct clksel_rate *clkr, *max_clkr = NULL;
101 u8 max_div = 0; 101 u8 max_div = 0;
102 102
103 clks = _get_clksel_by_parent(clk, src_clk); 103 clks = _get_clksel_by_parent(clk, src_clk);
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index acb7ae5b0a25..bcffee001bfa 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -178,12 +178,11 @@ void omap2_init_dpll_parent(struct clk *clk)
178 if (!dd) 178 if (!dd)
179 return; 179 return;
180 180
181 /* Return bypass rate if DPLL is bypassed */
182 v = __raw_readl(dd->control_reg); 181 v = __raw_readl(dd->control_reg);
183 v &= dd->enable_mask; 182 v &= dd->enable_mask;
184 v >>= __ffs(dd->enable_mask); 183 v >>= __ffs(dd->enable_mask);
185 184
186 /* Reparent in case the dpll is in bypass */ 185 /* Reparent the struct clk in case the dpll is in bypass */
187 if (cpu_is_omap24xx()) { 186 if (cpu_is_omap24xx()) {
188 if (v == OMAP2XXX_EN_DPLL_LPBYPASS || 187 if (v == OMAP2XXX_EN_DPLL_LPBYPASS ||
189 v == OMAP2XXX_EN_DPLL_FRBYPASS) 188 v == OMAP2XXX_EN_DPLL_FRBYPASS)
@@ -260,50 +259,22 @@ u32 omap2_get_dpll_rate(struct clk *clk)
260/* DPLL rate rounding code */ 259/* DPLL rate rounding code */
261 260
262/** 261/**
263 * omap2_dpll_set_rate_tolerance: set the error tolerance during rate rounding
264 * @clk: struct clk * of the DPLL
265 * @tolerance: maximum rate error tolerance
266 *
267 * Set the maximum DPLL rate error tolerance for the rate rounding
268 * algorithm. The rate tolerance is an attempt to balance DPLL power
269 * saving (the least divider value "n") vs. rate fidelity (the least
270 * difference between the desired DPLL target rate and the rounded
271 * rate out of the algorithm). So, increasing the tolerance is likely
272 * to decrease DPLL power consumption and increase DPLL rate error.
273 * Returns -EINVAL if provided a null clock ptr or a clk that is not a
274 * DPLL; or 0 upon success.
275 */
276int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance)
277{
278 if (!clk || !clk->dpll_data)
279 return -EINVAL;
280
281 clk->dpll_data->rate_tolerance = tolerance;
282
283 return 0;
284}
285
286/**
287 * omap2_dpll_round_rate - round a target rate for an OMAP DPLL 262 * omap2_dpll_round_rate - round a target rate for an OMAP DPLL
288 * @clk: struct clk * for a DPLL 263 * @clk: struct clk * for a DPLL
289 * @target_rate: desired DPLL clock rate 264 * @target_rate: desired DPLL clock rate
290 * 265 *
291 * Given a DPLL, a desired target rate, and a rate tolerance, round 266 * Given a DPLL and a desired target rate, round the target rate to a
292 * the target rate to a possible, programmable rate for this DPLL. 267 * possible, programmable rate for this DPLL. Attempts to select the
293 * Rate tolerance is assumed to be set by the caller before this 268 * minimum possible n. Stores the computed (m, n) in the DPLL's
294 * function is called. Attempts to select the minimum possible n 269 * dpll_data structure so set_rate() will not need to call this
295 * within the tolerance to reduce power consumption. Stores the 270 * (expensive) function again. Returns ~0 if the target rate cannot
296 * computed (m, n) in the DPLL's dpll_data structure so set_rate() 271 * be rounded, or the rounded rate upon success.
297 * will not need to call this (expensive) function again. Returns ~0
298 * if the target rate cannot be rounded, either because the rate is
299 * too low or because the rate tolerance is set too tightly; or the
300 * rounded rate upon success.
301 */ 272 */
302long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate) 273long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
303{ 274{
304 int m, n, r, e, scaled_max_m; 275 int m, n, r, scaled_max_m;
305 unsigned long scaled_rt_rp, new_rate; 276 unsigned long scaled_rt_rp;
306 int min_e = -1, min_e_m = -1, min_e_n = -1; 277 unsigned long new_rate = 0;
307 struct dpll_data *dd; 278 struct dpll_data *dd;
308 279
309 if (!clk || !clk->dpll_data) 280 if (!clk || !clk->dpll_data)
@@ -311,8 +282,8 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
311 282
312 dd = clk->dpll_data; 283 dd = clk->dpll_data;
313 284
314 pr_debug("clock: starting DPLL round_rate for clock %s, target rate " 285 pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n",
315 "%ld\n", clk->name, target_rate); 286 clk->name, target_rate);
316 287
317 scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR); 288 scaled_rt_rp = target_rate / (dd->clk_ref->rate / DPLL_SCALE_FACTOR);
318 scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR; 289 scaled_max_m = dd->max_multiplier * DPLL_SCALE_FACTOR;
@@ -347,39 +318,23 @@ long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate)
347 if (r == DPLL_MULT_UNDERFLOW) 318 if (r == DPLL_MULT_UNDERFLOW)
348 continue; 319 continue;
349 320
350 e = target_rate - new_rate; 321 pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n",
351 pr_debug("clock: n = %d: m = %d: rate error is %d " 322 clk->name, m, n, new_rate);
352 "(new_rate = %ld)\n", n, m, e, new_rate);
353
354 if (min_e == -1 ||
355 min_e >= (int)(abs(e) - dd->rate_tolerance)) {
356 min_e = e;
357 min_e_m = m;
358 min_e_n = n;
359
360 pr_debug("clock: found new least error %d\n", min_e);
361 323
362 /* We found good settings -- bail out now */ 324 if (target_rate == new_rate) {
363 if (min_e <= dd->rate_tolerance) 325 dd->last_rounded_m = m;
364 break; 326 dd->last_rounded_n = n;
327 dd->last_rounded_rate = target_rate;
328 break;
365 } 329 }
366 } 330 }
367 331
368 if (min_e < 0) { 332 if (target_rate != new_rate) {
369 pr_debug("clock: error: target rate or tolerance too low\n"); 333 pr_debug("clock: %s: cannot round to rate %ld\n", clk->name,
334 target_rate);
370 return ~0; 335 return ~0;
371 } 336 }
372 337
373 dd->last_rounded_m = min_e_m; 338 return target_rate;
374 dd->last_rounded_n = min_e_n;
375 dd->last_rounded_rate = _dpll_compute_new_rate(dd->clk_ref->rate,
376 min_e_m, min_e_n);
377
378 pr_debug("clock: final least error: e = %d, m = %d, n = %d\n",
379 min_e, min_e_m, min_e_n);
380 pr_debug("clock: final rate: %ld (target rate: %ld)\n",
381 dd->last_rounded_rate, target_rate);
382
383 return dd->last_rounded_rate;
384} 339}
385 340
diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c
new file mode 100644
index 000000000000..3d43fba2542f
--- /dev/null
+++ b/arch/arm/mach-omap2/clkt_iclk.c
@@ -0,0 +1,82 @@
1/*
2 * OMAP2/3 interface clock control
3 *
4 * Copyright (C) 2011 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#undef DEBUG
12
13#include <linux/kernel.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16
17#include <plat/clock.h>
18#include <plat/prcm.h>
19
20#include "clock.h"
21#include "clock2xxx.h"
22#include "cm2xxx_3xxx.h"
23#include "cm-regbits-24xx.h"
24
25/* Private functions */
26
27/* XXX */
28void omap2_clkt_iclk_allow_idle(struct clk *clk)
29{
30 u32 v, r;
31
32 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
33
34 v = __raw_readl((__force void __iomem *)r);
35 v |= (1 << clk->enable_bit);
36 __raw_writel(v, (__force void __iomem *)r);
37}
38
39/* XXX */
40void omap2_clkt_iclk_deny_idle(struct clk *clk)
41{
42 u32 v, r;
43
44 r = ((__force u32)clk->enable_reg ^ (CM_AUTOIDLE ^ CM_ICLKEN));
45
46 v = __raw_readl((__force void __iomem *)r);
47 v &= ~(1 << clk->enable_bit);
48 __raw_writel(v, (__force void __iomem *)r);
49}
50
51/* Public data */
52
53const struct clkops clkops_omap2_iclk_dflt_wait = {
54 .enable = omap2_dflt_clk_enable,
55 .disable = omap2_dflt_clk_disable,
56 .find_companion = omap2_clk_dflt_find_companion,
57 .find_idlest = omap2_clk_dflt_find_idlest,
58 .allow_idle = omap2_clkt_iclk_allow_idle,
59 .deny_idle = omap2_clkt_iclk_deny_idle,
60};
61
62const struct clkops clkops_omap2_iclk_dflt = {
63 .enable = omap2_dflt_clk_enable,
64 .disable = omap2_dflt_clk_disable,
65 .allow_idle = omap2_clkt_iclk_allow_idle,
66 .deny_idle = omap2_clkt_iclk_deny_idle,
67};
68
69const struct clkops clkops_omap2_iclk_idle_only = {
70 .allow_idle = omap2_clkt_iclk_allow_idle,
71 .deny_idle = omap2_clkt_iclk_deny_idle,
72};
73
74const struct clkops clkops_omap2_mdmclk_dflt_wait = {
75 .enable = omap2_dflt_clk_enable,
76 .disable = omap2_dflt_clk_disable,
77 .find_companion = omap2_clk_dflt_find_companion,
78 .find_idlest = omap2_clk_dflt_find_idlest,
79 .allow_idle = omap2_clkt_iclk_allow_idle,
80 .deny_idle = omap2_clkt_iclk_deny_idle,
81};
82
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 2a2f15213add..46d03ccc2806 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -261,10 +261,11 @@ void omap2_clk_disable(struct clk *clk)
261 261
262 pr_debug("clock: %s: disabling in hardware\n", clk->name); 262 pr_debug("clock: %s: disabling in hardware\n", clk->name);
263 263
264 clk->ops->disable(clk); 264 if (clk->ops && clk->ops->disable)
265 clk->ops->disable(clk);
265 266
266 if (clk->clkdm) 267 if (clk->clkdm)
267 omap2_clkdm_clk_disable(clk->clkdm, clk); 268 clkdm_clk_disable(clk->clkdm, clk);
268 269
269 if (clk->parent) 270 if (clk->parent)
270 omap2_clk_disable(clk->parent); 271 omap2_clk_disable(clk->parent);
@@ -304,7 +305,7 @@ int omap2_clk_enable(struct clk *clk)
304 } 305 }
305 306
306 if (clk->clkdm) { 307 if (clk->clkdm) {
307 ret = omap2_clkdm_clk_enable(clk->clkdm, clk); 308 ret = clkdm_clk_enable(clk->clkdm, clk);
308 if (ret) { 309 if (ret) {
309 WARN(1, "clock: %s: could not enable clockdomain %s: " 310 WARN(1, "clock: %s: could not enable clockdomain %s: "
310 "%d\n", clk->name, clk->clkdm->name, ret); 311 "%d\n", clk->name, clk->clkdm->name, ret);
@@ -312,17 +313,20 @@ int omap2_clk_enable(struct clk *clk)
312 } 313 }
313 } 314 }
314 315
315 ret = clk->ops->enable(clk); 316 if (clk->ops && clk->ops->enable) {
316 if (ret) { 317 ret = clk->ops->enable(clk);
317 WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); 318 if (ret) {
318 goto oce_err3; 319 WARN(1, "clock: %s: could not enable: %d\n",
320 clk->name, ret);
321 goto oce_err3;
322 }
319 } 323 }
320 324
321 return 0; 325 return 0;
322 326
323oce_err3: 327oce_err3:
324 if (clk->clkdm) 328 if (clk->clkdm)
325 omap2_clkdm_clk_disable(clk->clkdm, clk); 329 clkdm_clk_disable(clk->clkdm, clk);
326oce_err2: 330oce_err2:
327 if (clk->parent) 331 if (clk->parent)
328 omap2_clk_disable(clk->parent); 332 omap2_clk_disable(clk->parent);
@@ -373,10 +377,16 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
373const struct clkops clkops_omap3_noncore_dpll_ops = { 377const struct clkops clkops_omap3_noncore_dpll_ops = {
374 .enable = omap3_noncore_dpll_enable, 378 .enable = omap3_noncore_dpll_enable,
375 .disable = omap3_noncore_dpll_disable, 379 .disable = omap3_noncore_dpll_disable,
380 .allow_idle = omap3_dpll_allow_idle,
381 .deny_idle = omap3_dpll_deny_idle,
376}; 382};
377 383
378#endif 384const struct clkops clkops_omap3_core_dpll_ops = {
385 .allow_idle = omap3_dpll_allow_idle,
386 .deny_idle = omap3_dpll_deny_idle,
387};
379 388
389#endif
380 390
381/* 391/*
382 * OMAP2+ clock reset and init functions 392 * OMAP2+ clock reset and init functions
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 896584e3c4ab..e10ff2b54844 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -2,7 +2,7 @@
2 * linux/arch/arm/mach-omap2/clock.h 2 * linux/arch/arm/mach-omap2/clock.h
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-2011 Nokia Corporation
6 * 6 *
7 * Contacts: 7 * Contacts:
8 * Richard Woodruff <r-woodruff2@ti.com> 8 * Richard Woodruff <r-woodruff2@ti.com>
@@ -18,9 +18,6 @@
18 18
19#include <plat/clock.h> 19#include <plat/clock.h>
20 20
21/* The maximum error between a target DPLL rate and the rounded rate in Hz */
22#define DEFAULT_DPLL_RATE_TOLERANCE 50000
23
24/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ 21/* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */
25#define CORE_CLK_SRC_32K 0x0 22#define CORE_CLK_SRC_32K 0x0
26#define CORE_CLK_SRC_DPLL 0x1 23#define CORE_CLK_SRC_DPLL 0x1
@@ -55,7 +52,6 @@ void omap2_clk_disable(struct clk *clk);
55long omap2_clk_round_rate(struct clk *clk, unsigned long rate); 52long omap2_clk_round_rate(struct clk *clk, unsigned long rate);
56int omap2_clk_set_rate(struct clk *clk, unsigned long rate); 53int omap2_clk_set_rate(struct clk *clk, unsigned long rate);
57int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent); 54int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent);
58int omap2_dpll_set_rate_tolerance(struct clk *clk, unsigned int tolerance);
59long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate); 55long omap2_dpll_round_rate(struct clk *clk, unsigned long target_rate);
60unsigned long omap3_dpll_recalc(struct clk *clk); 56unsigned long omap3_dpll_recalc(struct clk *clk);
61unsigned long omap3_clkoutx2_recalc(struct clk *clk); 57unsigned long omap3_clkoutx2_recalc(struct clk *clk);
@@ -65,6 +61,9 @@ u32 omap3_dpll_autoidle_read(struct clk *clk);
65int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate); 61int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate);
66int omap3_noncore_dpll_enable(struct clk *clk); 62int omap3_noncore_dpll_enable(struct clk *clk);
67void omap3_noncore_dpll_disable(struct clk *clk); 63void omap3_noncore_dpll_disable(struct clk *clk);
64int omap4_dpllmx_gatectrl_read(struct clk *clk);
65void omap4_dpllmx_allow_gatectrl(struct clk *clk);
66void omap4_dpllmx_deny_gatectrl(struct clk *clk);
68 67
69#ifdef CONFIG_OMAP_RESET_CLOCKS 68#ifdef CONFIG_OMAP_RESET_CLOCKS
70void omap2_clk_disable_unused(struct clk *clk); 69void omap2_clk_disable_unused(struct clk *clk);
@@ -83,6 +82,10 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate);
83int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); 82int omap2_clksel_set_rate(struct clk *clk, unsigned long rate);
84int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent); 83int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent);
85 84
85/* clkt_iclk.c public functions */
86extern void omap2_clkt_iclk_allow_idle(struct clk *clk);
87extern void omap2_clkt_iclk_deny_idle(struct clk *clk);
88
86u32 omap2_get_dpll_rate(struct clk *clk); 89u32 omap2_get_dpll_rate(struct clk *clk);
87void omap2_init_dpll_parent(struct clk *clk); 90void omap2_init_dpll_parent(struct clk *clk);
88 91
@@ -136,6 +139,7 @@ extern struct clk *vclk, *sclk;
136extern const struct clksel_rate gpt_32k_rates[]; 139extern const struct clksel_rate gpt_32k_rates[];
137extern const struct clksel_rate gpt_sys_rates[]; 140extern const struct clksel_rate gpt_sys_rates[];
138extern const struct clksel_rate gfx_l3_rates[]; 141extern const struct clksel_rate gfx_l3_rates[];
142extern const struct clksel_rate dsp_ick_rates[];
139 143
140#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ) 144#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ)
141extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); 145extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
@@ -145,6 +149,13 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
145#define omap2_clk_exit_cpufreq_table 0 149#define omap2_clk_exit_cpufreq_table 0
146#endif 150#endif
147 151
152extern const struct clkops clkops_omap2_iclk_dflt_wait;
153extern const struct clkops clkops_omap2_iclk_dflt;
154extern const struct clkops clkops_omap2_iclk_idle_only;
155extern const struct clkops clkops_omap2_mdmclk_dflt_wait;
156extern const struct clkops clkops_omap2xxx_dpll_ops;
148extern const struct clkops clkops_omap3_noncore_dpll_ops; 157extern const struct clkops clkops_omap3_noncore_dpll_ops;
158extern const struct clkops clkops_omap3_core_dpll_ops;
159extern const struct clkops clkops_omap4_dpllmx_ops;
149 160
150#endif 161#endif
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index 0a992bc8d0d8..b6f65d4ac97d 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/clock2420_data.c 2 * OMAP2420 clock data
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation 5 * Copyright (C) 2004-2011 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 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -34,18 +34,15 @@
34/* 34/*
35 * 2420 clock tree. 35 * 2420 clock tree.
36 * 36 *
37 * NOTE:In many cases here we are assigning a 'default' parent. In many 37 * NOTE:In many cases here we are assigning a 'default' parent. In
38 * cases the parent is selectable. The get/set parent calls will also 38 * many cases the parent is selectable. The set parent calls will
39 * switch sources. 39 * also switch sources.
40 *
41 * Many some clocks say always_enabled, but they can be auto idled for
42 * power savings. They will always be available upon clock request.
43 * 40 *
44 * Several sources are given initial rates which may be wrong, this will 41 * Several sources are given initial rates which may be wrong, this will
45 * be fixed up in the init func. 42 * be fixed up in the init func.
46 * 43 *
47 * Things are broadly separated below by clock domains. It is 44 * Things are broadly separated below by clock domains. It is
48 * noteworthy that most periferals have dependencies on multiple clock 45 * noteworthy that most peripherals have dependencies on multiple clock
49 * domains. Many get their interface clocks from the L4 domain, but get 46 * domains. Many get their interface clocks from the L4 domain, but get
50 * functional clocks from fixed sources or other core domain derived 47 * functional clocks from fixed sources or other core domain derived
51 * clocks. 48 * clocks.
@@ -55,7 +52,7 @@
55static struct clk func_32k_ck = { 52static struct clk func_32k_ck = {
56 .name = "func_32k_ck", 53 .name = "func_32k_ck",
57 .ops = &clkops_null, 54 .ops = &clkops_null,
58 .rate = 32000, 55 .rate = 32768,
59 .clkdm_name = "wkup_clkdm", 56 .clkdm_name = "wkup_clkdm",
60}; 57};
61 58
@@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = {
116 .max_multiplier = 1023, 113 .max_multiplier = 1023,
117 .min_divider = 1, 114 .min_divider = 1,
118 .max_divider = 16, 115 .max_divider = 16,
119 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
120}; 116};
121 117
122/* 118/*
@@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = {
125 */ 121 */
126static struct clk dpll_ck = { 122static struct clk dpll_ck = {
127 .name = "dpll_ck", 123 .name = "dpll_ck",
128 .ops = &clkops_null, 124 .ops = &clkops_omap2xxx_dpll_ops,
129 .parent = &sys_ck, /* Can be func_32k also */ 125 .parent = &sys_ck, /* Can be func_32k also */
130 .dpll_data = &dpll_dd, 126 .dpll_data = &dpll_dd,
131 .clkdm_name = "wkup_clkdm", 127 .clkdm_name = "wkup_clkdm",
@@ -455,36 +451,22 @@ static struct clk dsp_fck = {
455 .recalc = &omap2_clksel_recalc, 451 .recalc = &omap2_clksel_recalc,
456}; 452};
457 453
458/* DSP interface clock */ 454static const struct clksel dsp_ick_clksel[] = {
459static const struct clksel_rate dsp_irate_ick_rates[] = { 455 { .parent = &dsp_fck, .rates = dsp_ick_rates },
460 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
461 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
462 { .div = 0 },
463};
464
465static const struct clksel dsp_irate_ick_clksel[] = {
466 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
467 { .parent = NULL } 456 { .parent = NULL }
468}; 457};
469 458
470/* This clock does not exist as such in the TRM. */
471static struct clk dsp_irate_ick = {
472 .name = "dsp_irate_ick",
473 .ops = &clkops_null,
474 .parent = &dsp_fck,
475 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
476 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
477 .clksel = dsp_irate_ick_clksel,
478 .recalc = &omap2_clksel_recalc,
479};
480
481/* 2420 only */
482static struct clk dsp_ick = { 459static struct clk dsp_ick = {
483 .name = "dsp_ick", /* apparently ipi and isp */ 460 .name = "dsp_ick", /* apparently ipi and isp */
484 .ops = &clkops_omap2_dflt_wait, 461 .ops = &clkops_omap2_iclk_dflt_wait,
485 .parent = &dsp_irate_ick, 462 .parent = &dsp_fck,
463 .clkdm_name = "dsp_clkdm",
486 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN), 464 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_ICLKEN),
487 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */ 465 .enable_bit = OMAP2420_EN_DSP_IPI_SHIFT, /* for ipi */
466 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
467 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
468 .clksel = dsp_ick_clksel,
469 .recalc = &omap2_clksel_recalc,
488}; 470};
489 471
490/* 472/*
@@ -579,7 +561,7 @@ static const struct clksel usb_l4_ick_clksel[] = {
579/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ 561/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
580static struct clk usb_l4_ick = { /* FS-USB interface clock */ 562static struct clk usb_l4_ick = { /* FS-USB interface clock */
581 .name = "usb_l4_ick", 563 .name = "usb_l4_ick",
582 .ops = &clkops_omap2_dflt_wait, 564 .ops = &clkops_omap2_iclk_dflt_wait,
583 .parent = &core_l3_ck, 565 .parent = &core_l3_ck,
584 .clkdm_name = "core_l4_clkdm", 566 .clkdm_name = "core_l4_clkdm",
585 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 567 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -661,7 +643,7 @@ static struct clk ssi_ssr_sst_fck = {
661 */ 643 */
662static struct clk ssi_l4_ick = { 644static struct clk ssi_l4_ick = {
663 .name = "ssi_l4_ick", 645 .name = "ssi_l4_ick",
664 .ops = &clkops_omap2_dflt_wait, 646 .ops = &clkops_omap2_iclk_dflt_wait,
665 .parent = &l4_ck, 647 .parent = &l4_ck,
666 .clkdm_name = "core_l4_clkdm", 648 .clkdm_name = "core_l4_clkdm",
667 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 649 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -716,6 +698,7 @@ static struct clk gfx_2d_fck = {
716 .recalc = &omap2_clksel_recalc, 698 .recalc = &omap2_clksel_recalc,
717}; 699};
718 700
701/* This interface clock does not have a CM_AUTOIDLE bit */
719static struct clk gfx_ick = { 702static struct clk gfx_ick = {
720 .name = "gfx_ick", /* From l3 */ 703 .name = "gfx_ick", /* From l3 */
721 .ops = &clkops_omap2_dflt_wait, 704 .ops = &clkops_omap2_dflt_wait,
@@ -763,7 +746,7 @@ static const struct clksel dss1_fck_clksel[] = {
763 746
764static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ 747static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
765 .name = "dss_ick", 748 .name = "dss_ick",
766 .ops = &clkops_omap2_dflt, 749 .ops = &clkops_omap2_iclk_dflt,
767 .parent = &l4_ck, /* really both l3 and l4 */ 750 .parent = &l4_ck, /* really both l3 and l4 */
768 .clkdm_name = "dss_clkdm", 751 .clkdm_name = "dss_clkdm",
769 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 752 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -825,6 +808,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */
825 .recalc = &followparent_recalc, 808 .recalc = &followparent_recalc,
826}; 809};
827 810
811static struct clk wu_l4_ick = {
812 .name = "wu_l4_ick",
813 .ops = &clkops_null,
814 .parent = &sys_ck,
815 .clkdm_name = "wkup_clkdm",
816 .recalc = &followparent_recalc,
817};
818
828/* 819/*
829 * CORE power domain ICLK & FCLK defines. 820 * CORE power domain ICLK & FCLK defines.
830 * Many of the these can have more than one possible parent. Entries 821 * Many of the these can have more than one possible parent. Entries
@@ -845,9 +836,9 @@ static const struct clksel omap24xx_gpt_clksel[] = {
845 836
846static struct clk gpt1_ick = { 837static struct clk gpt1_ick = {
847 .name = "gpt1_ick", 838 .name = "gpt1_ick",
848 .ops = &clkops_omap2_dflt_wait, 839 .ops = &clkops_omap2_iclk_dflt_wait,
849 .parent = &l4_ck, 840 .parent = &wu_l4_ick,
850 .clkdm_name = "core_l4_clkdm", 841 .clkdm_name = "wkup_clkdm",
851 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 842 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
852 .enable_bit = OMAP24XX_EN_GPT1_SHIFT, 843 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
853 .recalc = &followparent_recalc, 844 .recalc = &followparent_recalc,
@@ -871,7 +862,7 @@ static struct clk gpt1_fck = {
871 862
872static struct clk gpt2_ick = { 863static struct clk gpt2_ick = {
873 .name = "gpt2_ick", 864 .name = "gpt2_ick",
874 .ops = &clkops_omap2_dflt_wait, 865 .ops = &clkops_omap2_iclk_dflt_wait,
875 .parent = &l4_ck, 866 .parent = &l4_ck,
876 .clkdm_name = "core_l4_clkdm", 867 .clkdm_name = "core_l4_clkdm",
877 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 868 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -895,7 +886,7 @@ static struct clk gpt2_fck = {
895 886
896static struct clk gpt3_ick = { 887static struct clk gpt3_ick = {
897 .name = "gpt3_ick", 888 .name = "gpt3_ick",
898 .ops = &clkops_omap2_dflt_wait, 889 .ops = &clkops_omap2_iclk_dflt_wait,
899 .parent = &l4_ck, 890 .parent = &l4_ck,
900 .clkdm_name = "core_l4_clkdm", 891 .clkdm_name = "core_l4_clkdm",
901 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 892 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -919,7 +910,7 @@ static struct clk gpt3_fck = {
919 910
920static struct clk gpt4_ick = { 911static struct clk gpt4_ick = {
921 .name = "gpt4_ick", 912 .name = "gpt4_ick",
922 .ops = &clkops_omap2_dflt_wait, 913 .ops = &clkops_omap2_iclk_dflt_wait,
923 .parent = &l4_ck, 914 .parent = &l4_ck,
924 .clkdm_name = "core_l4_clkdm", 915 .clkdm_name = "core_l4_clkdm",
925 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 916 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -943,7 +934,7 @@ static struct clk gpt4_fck = {
943 934
944static struct clk gpt5_ick = { 935static struct clk gpt5_ick = {
945 .name = "gpt5_ick", 936 .name = "gpt5_ick",
946 .ops = &clkops_omap2_dflt_wait, 937 .ops = &clkops_omap2_iclk_dflt_wait,
947 .parent = &l4_ck, 938 .parent = &l4_ck,
948 .clkdm_name = "core_l4_clkdm", 939 .clkdm_name = "core_l4_clkdm",
949 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 940 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -967,7 +958,7 @@ static struct clk gpt5_fck = {
967 958
968static struct clk gpt6_ick = { 959static struct clk gpt6_ick = {
969 .name = "gpt6_ick", 960 .name = "gpt6_ick",
970 .ops = &clkops_omap2_dflt_wait, 961 .ops = &clkops_omap2_iclk_dflt_wait,
971 .parent = &l4_ck, 962 .parent = &l4_ck,
972 .clkdm_name = "core_l4_clkdm", 963 .clkdm_name = "core_l4_clkdm",
973 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 964 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -991,8 +982,9 @@ static struct clk gpt6_fck = {
991 982
992static struct clk gpt7_ick = { 983static struct clk gpt7_ick = {
993 .name = "gpt7_ick", 984 .name = "gpt7_ick",
994 .ops = &clkops_omap2_dflt_wait, 985 .ops = &clkops_omap2_iclk_dflt_wait,
995 .parent = &l4_ck, 986 .parent = &l4_ck,
987 .clkdm_name = "core_l4_clkdm",
996 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 988 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
997 .enable_bit = OMAP24XX_EN_GPT7_SHIFT, 989 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
998 .recalc = &followparent_recalc, 990 .recalc = &followparent_recalc,
@@ -1014,7 +1006,7 @@ static struct clk gpt7_fck = {
1014 1006
1015static struct clk gpt8_ick = { 1007static struct clk gpt8_ick = {
1016 .name = "gpt8_ick", 1008 .name = "gpt8_ick",
1017 .ops = &clkops_omap2_dflt_wait, 1009 .ops = &clkops_omap2_iclk_dflt_wait,
1018 .parent = &l4_ck, 1010 .parent = &l4_ck,
1019 .clkdm_name = "core_l4_clkdm", 1011 .clkdm_name = "core_l4_clkdm",
1020 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1012 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1038,7 +1030,7 @@ static struct clk gpt8_fck = {
1038 1030
1039static struct clk gpt9_ick = { 1031static struct clk gpt9_ick = {
1040 .name = "gpt9_ick", 1032 .name = "gpt9_ick",
1041 .ops = &clkops_omap2_dflt_wait, 1033 .ops = &clkops_omap2_iclk_dflt_wait,
1042 .parent = &l4_ck, 1034 .parent = &l4_ck,
1043 .clkdm_name = "core_l4_clkdm", 1035 .clkdm_name = "core_l4_clkdm",
1044 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1036 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1062,7 +1054,7 @@ static struct clk gpt9_fck = {
1062 1054
1063static struct clk gpt10_ick = { 1055static struct clk gpt10_ick = {
1064 .name = "gpt10_ick", 1056 .name = "gpt10_ick",
1065 .ops = &clkops_omap2_dflt_wait, 1057 .ops = &clkops_omap2_iclk_dflt_wait,
1066 .parent = &l4_ck, 1058 .parent = &l4_ck,
1067 .clkdm_name = "core_l4_clkdm", 1059 .clkdm_name = "core_l4_clkdm",
1068 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1060 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1086,7 +1078,7 @@ static struct clk gpt10_fck = {
1086 1078
1087static struct clk gpt11_ick = { 1079static struct clk gpt11_ick = {
1088 .name = "gpt11_ick", 1080 .name = "gpt11_ick",
1089 .ops = &clkops_omap2_dflt_wait, 1081 .ops = &clkops_omap2_iclk_dflt_wait,
1090 .parent = &l4_ck, 1082 .parent = &l4_ck,
1091 .clkdm_name = "core_l4_clkdm", 1083 .clkdm_name = "core_l4_clkdm",
1092 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1084 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1110,7 +1102,7 @@ static struct clk gpt11_fck = {
1110 1102
1111static struct clk gpt12_ick = { 1103static struct clk gpt12_ick = {
1112 .name = "gpt12_ick", 1104 .name = "gpt12_ick",
1113 .ops = &clkops_omap2_dflt_wait, 1105 .ops = &clkops_omap2_iclk_dflt_wait,
1114 .parent = &l4_ck, 1106 .parent = &l4_ck,
1115 .clkdm_name = "core_l4_clkdm", 1107 .clkdm_name = "core_l4_clkdm",
1116 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1108 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1134,7 +1126,7 @@ static struct clk gpt12_fck = {
1134 1126
1135static struct clk mcbsp1_ick = { 1127static struct clk mcbsp1_ick = {
1136 .name = "mcbsp1_ick", 1128 .name = "mcbsp1_ick",
1137 .ops = &clkops_omap2_dflt_wait, 1129 .ops = &clkops_omap2_iclk_dflt_wait,
1138 .parent = &l4_ck, 1130 .parent = &l4_ck,
1139 .clkdm_name = "core_l4_clkdm", 1131 .clkdm_name = "core_l4_clkdm",
1140 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1132 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1174,7 +1166,7 @@ static struct clk mcbsp1_fck = {
1174 1166
1175static struct clk mcbsp2_ick = { 1167static struct clk mcbsp2_ick = {
1176 .name = "mcbsp2_ick", 1168 .name = "mcbsp2_ick",
1177 .ops = &clkops_omap2_dflt_wait, 1169 .ops = &clkops_omap2_iclk_dflt_wait,
1178 .parent = &l4_ck, 1170 .parent = &l4_ck,
1179 .clkdm_name = "core_l4_clkdm", 1171 .clkdm_name = "core_l4_clkdm",
1180 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1172 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1198,7 +1190,7 @@ static struct clk mcbsp2_fck = {
1198 1190
1199static struct clk mcspi1_ick = { 1191static struct clk mcspi1_ick = {
1200 .name = "mcspi1_ick", 1192 .name = "mcspi1_ick",
1201 .ops = &clkops_omap2_dflt_wait, 1193 .ops = &clkops_omap2_iclk_dflt_wait,
1202 .parent = &l4_ck, 1194 .parent = &l4_ck,
1203 .clkdm_name = "core_l4_clkdm", 1195 .clkdm_name = "core_l4_clkdm",
1204 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1196 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1218,7 +1210,7 @@ static struct clk mcspi1_fck = {
1218 1210
1219static struct clk mcspi2_ick = { 1211static struct clk mcspi2_ick = {
1220 .name = "mcspi2_ick", 1212 .name = "mcspi2_ick",
1221 .ops = &clkops_omap2_dflt_wait, 1213 .ops = &clkops_omap2_iclk_dflt_wait,
1222 .parent = &l4_ck, 1214 .parent = &l4_ck,
1223 .clkdm_name = "core_l4_clkdm", 1215 .clkdm_name = "core_l4_clkdm",
1224 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1216 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1238,7 +1230,7 @@ static struct clk mcspi2_fck = {
1238 1230
1239static struct clk uart1_ick = { 1231static struct clk uart1_ick = {
1240 .name = "uart1_ick", 1232 .name = "uart1_ick",
1241 .ops = &clkops_omap2_dflt_wait, 1233 .ops = &clkops_omap2_iclk_dflt_wait,
1242 .parent = &l4_ck, 1234 .parent = &l4_ck,
1243 .clkdm_name = "core_l4_clkdm", 1235 .clkdm_name = "core_l4_clkdm",
1244 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1236 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1258,7 +1250,7 @@ static struct clk uart1_fck = {
1258 1250
1259static struct clk uart2_ick = { 1251static struct clk uart2_ick = {
1260 .name = "uart2_ick", 1252 .name = "uart2_ick",
1261 .ops = &clkops_omap2_dflt_wait, 1253 .ops = &clkops_omap2_iclk_dflt_wait,
1262 .parent = &l4_ck, 1254 .parent = &l4_ck,
1263 .clkdm_name = "core_l4_clkdm", 1255 .clkdm_name = "core_l4_clkdm",
1264 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1256 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1278,7 +1270,7 @@ static struct clk uart2_fck = {
1278 1270
1279static struct clk uart3_ick = { 1271static struct clk uart3_ick = {
1280 .name = "uart3_ick", 1272 .name = "uart3_ick",
1281 .ops = &clkops_omap2_dflt_wait, 1273 .ops = &clkops_omap2_iclk_dflt_wait,
1282 .parent = &l4_ck, 1274 .parent = &l4_ck,
1283 .clkdm_name = "core_l4_clkdm", 1275 .clkdm_name = "core_l4_clkdm",
1284 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1276 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1298,9 +1290,9 @@ static struct clk uart3_fck = {
1298 1290
1299static struct clk gpios_ick = { 1291static struct clk gpios_ick = {
1300 .name = "gpios_ick", 1292 .name = "gpios_ick",
1301 .ops = &clkops_omap2_dflt_wait, 1293 .ops = &clkops_omap2_iclk_dflt_wait,
1302 .parent = &l4_ck, 1294 .parent = &wu_l4_ick,
1303 .clkdm_name = "core_l4_clkdm", 1295 .clkdm_name = "wkup_clkdm",
1304 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1296 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1305 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, 1297 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1306 .recalc = &followparent_recalc, 1298 .recalc = &followparent_recalc,
@@ -1318,9 +1310,9 @@ static struct clk gpios_fck = {
1318 1310
1319static struct clk mpu_wdt_ick = { 1311static struct clk mpu_wdt_ick = {
1320 .name = "mpu_wdt_ick", 1312 .name = "mpu_wdt_ick",
1321 .ops = &clkops_omap2_dflt_wait, 1313 .ops = &clkops_omap2_iclk_dflt_wait,
1322 .parent = &l4_ck, 1314 .parent = &wu_l4_ick,
1323 .clkdm_name = "core_l4_clkdm", 1315 .clkdm_name = "wkup_clkdm",
1324 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1316 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1325 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, 1317 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1326 .recalc = &followparent_recalc, 1318 .recalc = &followparent_recalc,
@@ -1338,10 +1330,10 @@ static struct clk mpu_wdt_fck = {
1338 1330
1339static struct clk sync_32k_ick = { 1331static struct clk sync_32k_ick = {
1340 .name = "sync_32k_ick", 1332 .name = "sync_32k_ick",
1341 .ops = &clkops_omap2_dflt_wait, 1333 .ops = &clkops_omap2_iclk_dflt_wait,
1342 .parent = &l4_ck, 1334 .parent = &wu_l4_ick,
1335 .clkdm_name = "wkup_clkdm",
1343 .flags = ENABLE_ON_INIT, 1336 .flags = ENABLE_ON_INIT,
1344 .clkdm_name = "core_l4_clkdm",
1345 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1337 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1346 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, 1338 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1347 .recalc = &followparent_recalc, 1339 .recalc = &followparent_recalc,
@@ -1349,9 +1341,9 @@ static struct clk sync_32k_ick = {
1349 1341
1350static struct clk wdt1_ick = { 1342static struct clk wdt1_ick = {
1351 .name = "wdt1_ick", 1343 .name = "wdt1_ick",
1352 .ops = &clkops_omap2_dflt_wait, 1344 .ops = &clkops_omap2_iclk_dflt_wait,
1353 .parent = &l4_ck, 1345 .parent = &wu_l4_ick,
1354 .clkdm_name = "core_l4_clkdm", 1346 .clkdm_name = "wkup_clkdm",
1355 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1347 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1356 .enable_bit = OMAP24XX_EN_WDT1_SHIFT, 1348 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1357 .recalc = &followparent_recalc, 1349 .recalc = &followparent_recalc,
@@ -1359,10 +1351,10 @@ static struct clk wdt1_ick = {
1359 1351
1360static struct clk omapctrl_ick = { 1352static struct clk omapctrl_ick = {
1361 .name = "omapctrl_ick", 1353 .name = "omapctrl_ick",
1362 .ops = &clkops_omap2_dflt_wait, 1354 .ops = &clkops_omap2_iclk_dflt_wait,
1363 .parent = &l4_ck, 1355 .parent = &wu_l4_ick,
1356 .clkdm_name = "wkup_clkdm",
1364 .flags = ENABLE_ON_INIT, 1357 .flags = ENABLE_ON_INIT,
1365 .clkdm_name = "core_l4_clkdm",
1366 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1358 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1367 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, 1359 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1368 .recalc = &followparent_recalc, 1360 .recalc = &followparent_recalc,
@@ -1370,7 +1362,7 @@ static struct clk omapctrl_ick = {
1370 1362
1371static struct clk cam_ick = { 1363static struct clk cam_ick = {
1372 .name = "cam_ick", 1364 .name = "cam_ick",
1373 .ops = &clkops_omap2_dflt, 1365 .ops = &clkops_omap2_iclk_dflt,
1374 .parent = &l4_ck, 1366 .parent = &l4_ck,
1375 .clkdm_name = "core_l4_clkdm", 1367 .clkdm_name = "core_l4_clkdm",
1376 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1368 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1395,7 +1387,7 @@ static struct clk cam_fck = {
1395 1387
1396static struct clk mailboxes_ick = { 1388static struct clk mailboxes_ick = {
1397 .name = "mailboxes_ick", 1389 .name = "mailboxes_ick",
1398 .ops = &clkops_omap2_dflt_wait, 1390 .ops = &clkops_omap2_iclk_dflt_wait,
1399 .parent = &l4_ck, 1391 .parent = &l4_ck,
1400 .clkdm_name = "core_l4_clkdm", 1392 .clkdm_name = "core_l4_clkdm",
1401 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1393 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1405,7 +1397,7 @@ static struct clk mailboxes_ick = {
1405 1397
1406static struct clk wdt4_ick = { 1398static struct clk wdt4_ick = {
1407 .name = "wdt4_ick", 1399 .name = "wdt4_ick",
1408 .ops = &clkops_omap2_dflt_wait, 1400 .ops = &clkops_omap2_iclk_dflt_wait,
1409 .parent = &l4_ck, 1401 .parent = &l4_ck,
1410 .clkdm_name = "core_l4_clkdm", 1402 .clkdm_name = "core_l4_clkdm",
1411 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1403 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1425,7 +1417,7 @@ static struct clk wdt4_fck = {
1425 1417
1426static struct clk wdt3_ick = { 1418static struct clk wdt3_ick = {
1427 .name = "wdt3_ick", 1419 .name = "wdt3_ick",
1428 .ops = &clkops_omap2_dflt_wait, 1420 .ops = &clkops_omap2_iclk_dflt_wait,
1429 .parent = &l4_ck, 1421 .parent = &l4_ck,
1430 .clkdm_name = "core_l4_clkdm", 1422 .clkdm_name = "core_l4_clkdm",
1431 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1423 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1445,7 +1437,7 @@ static struct clk wdt3_fck = {
1445 1437
1446static struct clk mspro_ick = { 1438static struct clk mspro_ick = {
1447 .name = "mspro_ick", 1439 .name = "mspro_ick",
1448 .ops = &clkops_omap2_dflt_wait, 1440 .ops = &clkops_omap2_iclk_dflt_wait,
1449 .parent = &l4_ck, 1441 .parent = &l4_ck,
1450 .clkdm_name = "core_l4_clkdm", 1442 .clkdm_name = "core_l4_clkdm",
1451 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1443 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1465,7 +1457,7 @@ static struct clk mspro_fck = {
1465 1457
1466static struct clk mmc_ick = { 1458static struct clk mmc_ick = {
1467 .name = "mmc_ick", 1459 .name = "mmc_ick",
1468 .ops = &clkops_omap2_dflt_wait, 1460 .ops = &clkops_omap2_iclk_dflt_wait,
1469 .parent = &l4_ck, 1461 .parent = &l4_ck,
1470 .clkdm_name = "core_l4_clkdm", 1462 .clkdm_name = "core_l4_clkdm",
1471 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1463 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1485,7 +1477,7 @@ static struct clk mmc_fck = {
1485 1477
1486static struct clk fac_ick = { 1478static struct clk fac_ick = {
1487 .name = "fac_ick", 1479 .name = "fac_ick",
1488 .ops = &clkops_omap2_dflt_wait, 1480 .ops = &clkops_omap2_iclk_dflt_wait,
1489 .parent = &l4_ck, 1481 .parent = &l4_ck,
1490 .clkdm_name = "core_l4_clkdm", 1482 .clkdm_name = "core_l4_clkdm",
1491 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1483 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1505,7 +1497,7 @@ static struct clk fac_fck = {
1505 1497
1506static struct clk eac_ick = { 1498static struct clk eac_ick = {
1507 .name = "eac_ick", 1499 .name = "eac_ick",
1508 .ops = &clkops_omap2_dflt_wait, 1500 .ops = &clkops_omap2_iclk_dflt_wait,
1509 .parent = &l4_ck, 1501 .parent = &l4_ck,
1510 .clkdm_name = "core_l4_clkdm", 1502 .clkdm_name = "core_l4_clkdm",
1511 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1503 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1525,7 +1517,7 @@ static struct clk eac_fck = {
1525 1517
1526static struct clk hdq_ick = { 1518static struct clk hdq_ick = {
1527 .name = "hdq_ick", 1519 .name = "hdq_ick",
1528 .ops = &clkops_omap2_dflt_wait, 1520 .ops = &clkops_omap2_iclk_dflt_wait,
1529 .parent = &l4_ck, 1521 .parent = &l4_ck,
1530 .clkdm_name = "core_l4_clkdm", 1522 .clkdm_name = "core_l4_clkdm",
1531 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1523 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1545,7 +1537,7 @@ static struct clk hdq_fck = {
1545 1537
1546static struct clk i2c2_ick = { 1538static struct clk i2c2_ick = {
1547 .name = "i2c2_ick", 1539 .name = "i2c2_ick",
1548 .ops = &clkops_omap2_dflt_wait, 1540 .ops = &clkops_omap2_iclk_dflt_wait,
1549 .parent = &l4_ck, 1541 .parent = &l4_ck,
1550 .clkdm_name = "core_l4_clkdm", 1542 .clkdm_name = "core_l4_clkdm",
1551 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1543 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1565,7 +1557,7 @@ static struct clk i2c2_fck = {
1565 1557
1566static struct clk i2c1_ick = { 1558static struct clk i2c1_ick = {
1567 .name = "i2c1_ick", 1559 .name = "i2c1_ick",
1568 .ops = &clkops_omap2_dflt_wait, 1560 .ops = &clkops_omap2_iclk_dflt_wait,
1569 .parent = &l4_ck, 1561 .parent = &l4_ck,
1570 .clkdm_name = "core_l4_clkdm", 1562 .clkdm_name = "core_l4_clkdm",
1571 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1563 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1583,12 +1575,18 @@ static struct clk i2c1_fck = {
1583 .recalc = &followparent_recalc, 1575 .recalc = &followparent_recalc,
1584}; 1576};
1585 1577
1578/*
1579 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1580 * accesses derived from this data.
1581 */
1586static struct clk gpmc_fck = { 1582static struct clk gpmc_fck = {
1587 .name = "gpmc_fck", 1583 .name = "gpmc_fck",
1588 .ops = &clkops_null, /* RMK: missing? */ 1584 .ops = &clkops_omap2_iclk_idle_only,
1589 .parent = &core_l3_ck, 1585 .parent = &core_l3_ck,
1590 .flags = ENABLE_ON_INIT, 1586 .flags = ENABLE_ON_INIT,
1591 .clkdm_name = "core_l3_clkdm", 1587 .clkdm_name = "core_l3_clkdm",
1588 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1589 .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
1592 .recalc = &followparent_recalc, 1590 .recalc = &followparent_recalc,
1593}; 1591};
1594 1592
@@ -1600,17 +1598,38 @@ static struct clk sdma_fck = {
1600 .recalc = &followparent_recalc, 1598 .recalc = &followparent_recalc,
1601}; 1599};
1602 1600
1601/*
1602 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1603 * accesses derived from this data.
1604 */
1603static struct clk sdma_ick = { 1605static struct clk sdma_ick = {
1604 .name = "sdma_ick", 1606 .name = "sdma_ick",
1605 .ops = &clkops_null, /* RMK: missing? */ 1607 .ops = &clkops_omap2_iclk_idle_only,
1606 .parent = &l4_ck, 1608 .parent = &core_l3_ck,
1609 .clkdm_name = "core_l3_clkdm",
1610 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1611 .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
1612 .recalc = &followparent_recalc,
1613};
1614
1615/*
1616 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1617 * accesses derived from this data.
1618 */
1619static struct clk sdrc_ick = {
1620 .name = "sdrc_ick",
1621 .ops = &clkops_omap2_iclk_idle_only,
1622 .parent = &core_l3_ck,
1623 .flags = ENABLE_ON_INIT,
1607 .clkdm_name = "core_l3_clkdm", 1624 .clkdm_name = "core_l3_clkdm",
1625 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1626 .enable_bit = OMAP24XX_AUTO_SDRC_SHIFT,
1608 .recalc = &followparent_recalc, 1627 .recalc = &followparent_recalc,
1609}; 1628};
1610 1629
1611static struct clk vlynq_ick = { 1630static struct clk vlynq_ick = {
1612 .name = "vlynq_ick", 1631 .name = "vlynq_ick",
1613 .ops = &clkops_omap2_dflt_wait, 1632 .ops = &clkops_omap2_iclk_dflt_wait,
1614 .parent = &core_l3_ck, 1633 .parent = &core_l3_ck,
1615 .clkdm_name = "core_l3_clkdm", 1634 .clkdm_name = "core_l3_clkdm",
1616 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1635 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1659,7 +1678,7 @@ static struct clk vlynq_fck = {
1659 1678
1660static struct clk des_ick = { 1679static struct clk des_ick = {
1661 .name = "des_ick", 1680 .name = "des_ick",
1662 .ops = &clkops_omap2_dflt_wait, 1681 .ops = &clkops_omap2_iclk_dflt_wait,
1663 .parent = &l4_ck, 1682 .parent = &l4_ck,
1664 .clkdm_name = "core_l4_clkdm", 1683 .clkdm_name = "core_l4_clkdm",
1665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1684 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1669,7 +1688,7 @@ static struct clk des_ick = {
1669 1688
1670static struct clk sha_ick = { 1689static struct clk sha_ick = {
1671 .name = "sha_ick", 1690 .name = "sha_ick",
1672 .ops = &clkops_omap2_dflt_wait, 1691 .ops = &clkops_omap2_iclk_dflt_wait,
1673 .parent = &l4_ck, 1692 .parent = &l4_ck,
1674 .clkdm_name = "core_l4_clkdm", 1693 .clkdm_name = "core_l4_clkdm",
1675 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1694 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1679,7 +1698,7 @@ static struct clk sha_ick = {
1679 1698
1680static struct clk rng_ick = { 1699static struct clk rng_ick = {
1681 .name = "rng_ick", 1700 .name = "rng_ick",
1682 .ops = &clkops_omap2_dflt_wait, 1701 .ops = &clkops_omap2_iclk_dflt_wait,
1683 .parent = &l4_ck, 1702 .parent = &l4_ck,
1684 .clkdm_name = "core_l4_clkdm", 1703 .clkdm_name = "core_l4_clkdm",
1685 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1704 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1689,7 +1708,7 @@ static struct clk rng_ick = {
1689 1708
1690static struct clk aes_ick = { 1709static struct clk aes_ick = {
1691 .name = "aes_ick", 1710 .name = "aes_ick",
1692 .ops = &clkops_omap2_dflt_wait, 1711 .ops = &clkops_omap2_iclk_dflt_wait,
1693 .parent = &l4_ck, 1712 .parent = &l4_ck,
1694 .clkdm_name = "core_l4_clkdm", 1713 .clkdm_name = "core_l4_clkdm",
1695 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1714 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1699,7 +1718,7 @@ static struct clk aes_ick = {
1699 1718
1700static struct clk pka_ick = { 1719static struct clk pka_ick = {
1701 .name = "pka_ick", 1720 .name = "pka_ick",
1702 .ops = &clkops_omap2_dflt_wait, 1721 .ops = &clkops_omap2_iclk_dflt_wait,
1703 .parent = &l4_ck, 1722 .parent = &l4_ck,
1704 .clkdm_name = "core_l4_clkdm", 1723 .clkdm_name = "core_l4_clkdm",
1705 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1724 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1777,7 +1796,6 @@ static struct omap_clk omap2420_clks[] = {
1777 CLK(NULL, "mpu_ck", &mpu_ck, CK_242X), 1796 CLK(NULL, "mpu_ck", &mpu_ck, CK_242X),
1778 /* dsp domain clocks */ 1797 /* dsp domain clocks */
1779 CLK(NULL, "dsp_fck", &dsp_fck, CK_242X), 1798 CLK(NULL, "dsp_fck", &dsp_fck, CK_242X),
1780 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_242X),
1781 CLK(NULL, "dsp_ick", &dsp_ick, CK_242X), 1799 CLK(NULL, "dsp_ick", &dsp_ick, CK_242X),
1782 CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X), 1800 CLK(NULL, "iva1_ifck", &iva1_ifck, CK_242X),
1783 CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X), 1801 CLK(NULL, "iva1_mpu_int_ifck", &iva1_mpu_int_ifck, CK_242X),
@@ -1797,6 +1815,7 @@ static struct omap_clk omap2420_clks[] = {
1797 /* L4 domain clocks */ 1815 /* L4 domain clocks */
1798 CLK(NULL, "l4_ck", &l4_ck, CK_242X), 1816 CLK(NULL, "l4_ck", &l4_ck, CK_242X),
1799 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X), 1817 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_242X),
1818 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_242X),
1800 /* virtual meta-group clock */ 1819 /* virtual meta-group clock */
1801 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X), 1820 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_242X),
1802 /* general l4 interface ck, multi-parent functional clk */ 1821 /* general l4 interface ck, multi-parent functional clk */
@@ -1869,6 +1888,7 @@ static struct omap_clk omap2420_clks[] = {
1869 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X), 1888 CLK(NULL, "gpmc_fck", &gpmc_fck, CK_242X),
1870 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X), 1889 CLK(NULL, "sdma_fck", &sdma_fck, CK_242X),
1871 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X), 1890 CLK(NULL, "sdma_ick", &sdma_ick, CK_242X),
1891 CLK(NULL, "sdrc_ick", &sdrc_ick, CK_242X),
1872 CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X), 1892 CLK(NULL, "vlynq_ick", &vlynq_ick, CK_242X),
1873 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X), 1893 CLK(NULL, "vlynq_fck", &vlynq_fck, CK_242X),
1874 CLK(NULL, "des_ick", &des_ick, CK_242X), 1894 CLK(NULL, "des_ick", &des_ick, CK_242X),
@@ -1913,6 +1933,9 @@ int __init omap2420_clk_init(void)
1913 omap2_init_clk_clkdm(c->lk.clk); 1933 omap2_init_clk_clkdm(c->lk.clk);
1914 } 1934 }
1915 1935
1936 /* Disable autoidle on all clocks; let the PM code enable it later */
1937 omap_clk_disable_autoidle_all();
1938
1916 /* Check the MPU rate set by bootloader */ 1939 /* Check the MPU rate set by bootloader */
1917 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); 1940 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
1918 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 1941 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index c047dcd007e5..bba018331a71 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/clock2430_data.c 2 * OMAP2430 clock data
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation 5 * Copyright (C) 2004-2011 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 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as 12 * it under the terms of the GNU General Public License version 2 as
@@ -34,18 +34,15 @@
34/* 34/*
35 * 2430 clock tree. 35 * 2430 clock tree.
36 * 36 *
37 * NOTE:In many cases here we are assigning a 'default' parent. In many 37 * NOTE:In many cases here we are assigning a 'default' parent. In
38 * cases the parent is selectable. The get/set parent calls will also 38 * many cases the parent is selectable. The set parent calls will
39 * switch sources. 39 * also switch sources.
40 *
41 * Many some clocks say always_enabled, but they can be auto idled for
42 * power savings. They will always be available upon clock request.
43 * 40 *
44 * Several sources are given initial rates which may be wrong, this will 41 * Several sources are given initial rates which may be wrong, this will
45 * be fixed up in the init func. 42 * be fixed up in the init func.
46 * 43 *
47 * Things are broadly separated below by clock domains. It is 44 * Things are broadly separated below by clock domains. It is
48 * noteworthy that most periferals have dependencies on multiple clock 45 * noteworthy that most peripherals have dependencies on multiple clock
49 * domains. Many get their interface clocks from the L4 domain, but get 46 * domains. Many get their interface clocks from the L4 domain, but get
50 * functional clocks from fixed sources or other core domain derived 47 * functional clocks from fixed sources or other core domain derived
51 * clocks. 48 * clocks.
@@ -55,7 +52,7 @@
55static struct clk func_32k_ck = { 52static struct clk func_32k_ck = {
56 .name = "func_32k_ck", 53 .name = "func_32k_ck",
57 .ops = &clkops_null, 54 .ops = &clkops_null,
58 .rate = 32000, 55 .rate = 32768,
59 .clkdm_name = "wkup_clkdm", 56 .clkdm_name = "wkup_clkdm",
60}; 57};
61 58
@@ -116,7 +113,6 @@ static struct dpll_data dpll_dd = {
116 .max_multiplier = 1023, 113 .max_multiplier = 1023,
117 .min_divider = 1, 114 .min_divider = 1,
118 .max_divider = 16, 115 .max_divider = 16,
119 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
120}; 116};
121 117
122/* 118/*
@@ -125,7 +121,7 @@ static struct dpll_data dpll_dd = {
125 */ 121 */
126static struct clk dpll_ck = { 122static struct clk dpll_ck = {
127 .name = "dpll_ck", 123 .name = "dpll_ck",
128 .ops = &clkops_null, 124 .ops = &clkops_omap2xxx_dpll_ops,
129 .parent = &sys_ck, /* Can be func_32k also */ 125 .parent = &sys_ck, /* Can be func_32k also */
130 .dpll_data = &dpll_dd, 126 .dpll_data = &dpll_dd,
131 .clkdm_name = "wkup_clkdm", 127 .clkdm_name = "wkup_clkdm",
@@ -434,37 +430,23 @@ static struct clk dsp_fck = {
434 .recalc = &omap2_clksel_recalc, 430 .recalc = &omap2_clksel_recalc,
435}; 431};
436 432
437/* DSP interface clock */ 433static const struct clksel dsp_ick_clksel[] = {
438static const struct clksel_rate dsp_irate_ick_rates[] = { 434 { .parent = &dsp_fck, .rates = dsp_ick_rates },
439 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
440 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
441 { .div = 3, .val = 3, .flags = RATE_IN_243X },
442 { .div = 0 },
443};
444
445static const struct clksel dsp_irate_ick_clksel[] = {
446 { .parent = &dsp_fck, .rates = dsp_irate_ick_rates },
447 { .parent = NULL } 435 { .parent = NULL }
448}; 436};
449 437
450/* This clock does not exist as such in the TRM. */
451static struct clk dsp_irate_ick = {
452 .name = "dsp_irate_ick",
453 .ops = &clkops_null,
454 .parent = &dsp_fck,
455 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
456 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
457 .clksel = dsp_irate_ick_clksel,
458 .recalc = &omap2_clksel_recalc,
459};
460
461/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */ 438/* 2430 only - EN_DSP controls both dsp fclk and iclk on 2430 */
462static struct clk iva2_1_ick = { 439static struct clk iva2_1_ick = {
463 .name = "iva2_1_ick", 440 .name = "iva2_1_ick",
464 .ops = &clkops_omap2_dflt_wait, 441 .ops = &clkops_omap2_dflt_wait,
465 .parent = &dsp_irate_ick, 442 .parent = &dsp_fck,
443 .clkdm_name = "dsp_clkdm",
466 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), 444 .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN),
467 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT, 445 .enable_bit = OMAP24XX_CM_FCLKEN_DSP_EN_DSP_SHIFT,
446 .clksel_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_CLKSEL),
447 .clksel_mask = OMAP24XX_CLKSEL_DSP_IF_MASK,
448 .clksel = dsp_ick_clksel,
449 .recalc = &omap2_clksel_recalc,
468}; 450};
469 451
470/* 452/*
@@ -525,7 +507,7 @@ static const struct clksel usb_l4_ick_clksel[] = {
525/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */ 507/* It is unclear from TRM whether usb_l4_ick is really in L3 or L4 clkdm */
526static struct clk usb_l4_ick = { /* FS-USB interface clock */ 508static struct clk usb_l4_ick = { /* FS-USB interface clock */
527 .name = "usb_l4_ick", 509 .name = "usb_l4_ick",
528 .ops = &clkops_omap2_dflt_wait, 510 .ops = &clkops_omap2_iclk_dflt_wait,
529 .parent = &core_l3_ck, 511 .parent = &core_l3_ck,
530 .clkdm_name = "core_l4_clkdm", 512 .clkdm_name = "core_l4_clkdm",
531 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -606,7 +588,7 @@ static struct clk ssi_ssr_sst_fck = {
606 */ 588 */
607static struct clk ssi_l4_ick = { 589static struct clk ssi_l4_ick = {
608 .name = "ssi_l4_ick", 590 .name = "ssi_l4_ick",
609 .ops = &clkops_omap2_dflt_wait, 591 .ops = &clkops_omap2_iclk_dflt_wait,
610 .parent = &l4_ck, 592 .parent = &l4_ck,
611 .clkdm_name = "core_l4_clkdm", 593 .clkdm_name = "core_l4_clkdm",
612 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 594 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -661,6 +643,7 @@ static struct clk gfx_2d_fck = {
661 .recalc = &omap2_clksel_recalc, 643 .recalc = &omap2_clksel_recalc,
662}; 644};
663 645
646/* This interface clock does not have a CM_AUTOIDLE bit */
664static struct clk gfx_ick = { 647static struct clk gfx_ick = {
665 .name = "gfx_ick", /* From l3 */ 648 .name = "gfx_ick", /* From l3 */
666 .ops = &clkops_omap2_dflt_wait, 649 .ops = &clkops_omap2_dflt_wait,
@@ -693,7 +676,7 @@ static const struct clksel mdm_ick_clksel[] = {
693 676
694static struct clk mdm_ick = { /* used both as a ick and fck */ 677static struct clk mdm_ick = { /* used both as a ick and fck */
695 .name = "mdm_ick", 678 .name = "mdm_ick",
696 .ops = &clkops_omap2_dflt_wait, 679 .ops = &clkops_omap2_iclk_dflt_wait,
697 .parent = &core_ck, 680 .parent = &core_ck,
698 .clkdm_name = "mdm_clkdm", 681 .clkdm_name = "mdm_clkdm",
699 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN), 682 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_ICLKEN),
@@ -706,7 +689,7 @@ static struct clk mdm_ick = { /* used both as a ick and fck */
706 689
707static struct clk mdm_osc_ck = { 690static struct clk mdm_osc_ck = {
708 .name = "mdm_osc_ck", 691 .name = "mdm_osc_ck",
709 .ops = &clkops_omap2_dflt_wait, 692 .ops = &clkops_omap2_mdmclk_dflt_wait,
710 .parent = &osc_ck, 693 .parent = &osc_ck,
711 .clkdm_name = "mdm_clkdm", 694 .clkdm_name = "mdm_clkdm",
712 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN), 695 .enable_reg = OMAP_CM_REGADDR(OMAP2430_MDM_MOD, CM_FCLKEN),
@@ -751,7 +734,7 @@ static const struct clksel dss1_fck_clksel[] = {
751 734
752static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */ 735static struct clk dss_ick = { /* Enables both L3,L4 ICLK's */
753 .name = "dss_ick", 736 .name = "dss_ick",
754 .ops = &clkops_omap2_dflt, 737 .ops = &clkops_omap2_iclk_dflt,
755 .parent = &l4_ck, /* really both l3 and l4 */ 738 .parent = &l4_ck, /* really both l3 and l4 */
756 .clkdm_name = "dss_clkdm", 739 .clkdm_name = "dss_clkdm",
757 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 740 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -813,6 +796,14 @@ static struct clk dss_54m_fck = { /* Alt clk used in power management */
813 .recalc = &followparent_recalc, 796 .recalc = &followparent_recalc,
814}; 797};
815 798
799static struct clk wu_l4_ick = {
800 .name = "wu_l4_ick",
801 .ops = &clkops_null,
802 .parent = &sys_ck,
803 .clkdm_name = "wkup_clkdm",
804 .recalc = &followparent_recalc,
805};
806
816/* 807/*
817 * CORE power domain ICLK & FCLK defines. 808 * CORE power domain ICLK & FCLK defines.
818 * Many of the these can have more than one possible parent. Entries 809 * Many of the these can have more than one possible parent. Entries
@@ -833,9 +824,9 @@ static const struct clksel omap24xx_gpt_clksel[] = {
833 824
834static struct clk gpt1_ick = { 825static struct clk gpt1_ick = {
835 .name = "gpt1_ick", 826 .name = "gpt1_ick",
836 .ops = &clkops_omap2_dflt_wait, 827 .ops = &clkops_omap2_iclk_dflt_wait,
837 .parent = &l4_ck, 828 .parent = &wu_l4_ick,
838 .clkdm_name = "core_l4_clkdm", 829 .clkdm_name = "wkup_clkdm",
839 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 830 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
840 .enable_bit = OMAP24XX_EN_GPT1_SHIFT, 831 .enable_bit = OMAP24XX_EN_GPT1_SHIFT,
841 .recalc = &followparent_recalc, 832 .recalc = &followparent_recalc,
@@ -859,7 +850,7 @@ static struct clk gpt1_fck = {
859 850
860static struct clk gpt2_ick = { 851static struct clk gpt2_ick = {
861 .name = "gpt2_ick", 852 .name = "gpt2_ick",
862 .ops = &clkops_omap2_dflt_wait, 853 .ops = &clkops_omap2_iclk_dflt_wait,
863 .parent = &l4_ck, 854 .parent = &l4_ck,
864 .clkdm_name = "core_l4_clkdm", 855 .clkdm_name = "core_l4_clkdm",
865 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 856 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -883,7 +874,7 @@ static struct clk gpt2_fck = {
883 874
884static struct clk gpt3_ick = { 875static struct clk gpt3_ick = {
885 .name = "gpt3_ick", 876 .name = "gpt3_ick",
886 .ops = &clkops_omap2_dflt_wait, 877 .ops = &clkops_omap2_iclk_dflt_wait,
887 .parent = &l4_ck, 878 .parent = &l4_ck,
888 .clkdm_name = "core_l4_clkdm", 879 .clkdm_name = "core_l4_clkdm",
889 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 880 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -907,7 +898,7 @@ static struct clk gpt3_fck = {
907 898
908static struct clk gpt4_ick = { 899static struct clk gpt4_ick = {
909 .name = "gpt4_ick", 900 .name = "gpt4_ick",
910 .ops = &clkops_omap2_dflt_wait, 901 .ops = &clkops_omap2_iclk_dflt_wait,
911 .parent = &l4_ck, 902 .parent = &l4_ck,
912 .clkdm_name = "core_l4_clkdm", 903 .clkdm_name = "core_l4_clkdm",
913 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 904 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -931,7 +922,7 @@ static struct clk gpt4_fck = {
931 922
932static struct clk gpt5_ick = { 923static struct clk gpt5_ick = {
933 .name = "gpt5_ick", 924 .name = "gpt5_ick",
934 .ops = &clkops_omap2_dflt_wait, 925 .ops = &clkops_omap2_iclk_dflt_wait,
935 .parent = &l4_ck, 926 .parent = &l4_ck,
936 .clkdm_name = "core_l4_clkdm", 927 .clkdm_name = "core_l4_clkdm",
937 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 928 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -955,7 +946,7 @@ static struct clk gpt5_fck = {
955 946
956static struct clk gpt6_ick = { 947static struct clk gpt6_ick = {
957 .name = "gpt6_ick", 948 .name = "gpt6_ick",
958 .ops = &clkops_omap2_dflt_wait, 949 .ops = &clkops_omap2_iclk_dflt_wait,
959 .parent = &l4_ck, 950 .parent = &l4_ck,
960 .clkdm_name = "core_l4_clkdm", 951 .clkdm_name = "core_l4_clkdm",
961 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 952 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -979,8 +970,9 @@ static struct clk gpt6_fck = {
979 970
980static struct clk gpt7_ick = { 971static struct clk gpt7_ick = {
981 .name = "gpt7_ick", 972 .name = "gpt7_ick",
982 .ops = &clkops_omap2_dflt_wait, 973 .ops = &clkops_omap2_iclk_dflt_wait,
983 .parent = &l4_ck, 974 .parent = &l4_ck,
975 .clkdm_name = "core_l4_clkdm",
984 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 976 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
985 .enable_bit = OMAP24XX_EN_GPT7_SHIFT, 977 .enable_bit = OMAP24XX_EN_GPT7_SHIFT,
986 .recalc = &followparent_recalc, 978 .recalc = &followparent_recalc,
@@ -1002,7 +994,7 @@ static struct clk gpt7_fck = {
1002 994
1003static struct clk gpt8_ick = { 995static struct clk gpt8_ick = {
1004 .name = "gpt8_ick", 996 .name = "gpt8_ick",
1005 .ops = &clkops_omap2_dflt_wait, 997 .ops = &clkops_omap2_iclk_dflt_wait,
1006 .parent = &l4_ck, 998 .parent = &l4_ck,
1007 .clkdm_name = "core_l4_clkdm", 999 .clkdm_name = "core_l4_clkdm",
1008 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1000 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1026,7 +1018,7 @@ static struct clk gpt8_fck = {
1026 1018
1027static struct clk gpt9_ick = { 1019static struct clk gpt9_ick = {
1028 .name = "gpt9_ick", 1020 .name = "gpt9_ick",
1029 .ops = &clkops_omap2_dflt_wait, 1021 .ops = &clkops_omap2_iclk_dflt_wait,
1030 .parent = &l4_ck, 1022 .parent = &l4_ck,
1031 .clkdm_name = "core_l4_clkdm", 1023 .clkdm_name = "core_l4_clkdm",
1032 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1024 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1050,7 +1042,7 @@ static struct clk gpt9_fck = {
1050 1042
1051static struct clk gpt10_ick = { 1043static struct clk gpt10_ick = {
1052 .name = "gpt10_ick", 1044 .name = "gpt10_ick",
1053 .ops = &clkops_omap2_dflt_wait, 1045 .ops = &clkops_omap2_iclk_dflt_wait,
1054 .parent = &l4_ck, 1046 .parent = &l4_ck,
1055 .clkdm_name = "core_l4_clkdm", 1047 .clkdm_name = "core_l4_clkdm",
1056 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1048 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1074,7 +1066,7 @@ static struct clk gpt10_fck = {
1074 1066
1075static struct clk gpt11_ick = { 1067static struct clk gpt11_ick = {
1076 .name = "gpt11_ick", 1068 .name = "gpt11_ick",
1077 .ops = &clkops_omap2_dflt_wait, 1069 .ops = &clkops_omap2_iclk_dflt_wait,
1078 .parent = &l4_ck, 1070 .parent = &l4_ck,
1079 .clkdm_name = "core_l4_clkdm", 1071 .clkdm_name = "core_l4_clkdm",
1080 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1072 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1098,7 +1090,7 @@ static struct clk gpt11_fck = {
1098 1090
1099static struct clk gpt12_ick = { 1091static struct clk gpt12_ick = {
1100 .name = "gpt12_ick", 1092 .name = "gpt12_ick",
1101 .ops = &clkops_omap2_dflt_wait, 1093 .ops = &clkops_omap2_iclk_dflt_wait,
1102 .parent = &l4_ck, 1094 .parent = &l4_ck,
1103 .clkdm_name = "core_l4_clkdm", 1095 .clkdm_name = "core_l4_clkdm",
1104 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1096 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1122,7 +1114,7 @@ static struct clk gpt12_fck = {
1122 1114
1123static struct clk mcbsp1_ick = { 1115static struct clk mcbsp1_ick = {
1124 .name = "mcbsp1_ick", 1116 .name = "mcbsp1_ick",
1125 .ops = &clkops_omap2_dflt_wait, 1117 .ops = &clkops_omap2_iclk_dflt_wait,
1126 .parent = &l4_ck, 1118 .parent = &l4_ck,
1127 .clkdm_name = "core_l4_clkdm", 1119 .clkdm_name = "core_l4_clkdm",
1128 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1120 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1162,7 +1154,7 @@ static struct clk mcbsp1_fck = {
1162 1154
1163static struct clk mcbsp2_ick = { 1155static struct clk mcbsp2_ick = {
1164 .name = "mcbsp2_ick", 1156 .name = "mcbsp2_ick",
1165 .ops = &clkops_omap2_dflt_wait, 1157 .ops = &clkops_omap2_iclk_dflt_wait,
1166 .parent = &l4_ck, 1158 .parent = &l4_ck,
1167 .clkdm_name = "core_l4_clkdm", 1159 .clkdm_name = "core_l4_clkdm",
1168 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1160 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1186,7 +1178,7 @@ static struct clk mcbsp2_fck = {
1186 1178
1187static struct clk mcbsp3_ick = { 1179static struct clk mcbsp3_ick = {
1188 .name = "mcbsp3_ick", 1180 .name = "mcbsp3_ick",
1189 .ops = &clkops_omap2_dflt_wait, 1181 .ops = &clkops_omap2_iclk_dflt_wait,
1190 .parent = &l4_ck, 1182 .parent = &l4_ck,
1191 .clkdm_name = "core_l4_clkdm", 1183 .clkdm_name = "core_l4_clkdm",
1192 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1184 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1210,7 +1202,7 @@ static struct clk mcbsp3_fck = {
1210 1202
1211static struct clk mcbsp4_ick = { 1203static struct clk mcbsp4_ick = {
1212 .name = "mcbsp4_ick", 1204 .name = "mcbsp4_ick",
1213 .ops = &clkops_omap2_dflt_wait, 1205 .ops = &clkops_omap2_iclk_dflt_wait,
1214 .parent = &l4_ck, 1206 .parent = &l4_ck,
1215 .clkdm_name = "core_l4_clkdm", 1207 .clkdm_name = "core_l4_clkdm",
1216 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1208 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1234,7 +1226,7 @@ static struct clk mcbsp4_fck = {
1234 1226
1235static struct clk mcbsp5_ick = { 1227static struct clk mcbsp5_ick = {
1236 .name = "mcbsp5_ick", 1228 .name = "mcbsp5_ick",
1237 .ops = &clkops_omap2_dflt_wait, 1229 .ops = &clkops_omap2_iclk_dflt_wait,
1238 .parent = &l4_ck, 1230 .parent = &l4_ck,
1239 .clkdm_name = "core_l4_clkdm", 1231 .clkdm_name = "core_l4_clkdm",
1240 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1232 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1258,7 +1250,7 @@ static struct clk mcbsp5_fck = {
1258 1250
1259static struct clk mcspi1_ick = { 1251static struct clk mcspi1_ick = {
1260 .name = "mcspi1_ick", 1252 .name = "mcspi1_ick",
1261 .ops = &clkops_omap2_dflt_wait, 1253 .ops = &clkops_omap2_iclk_dflt_wait,
1262 .parent = &l4_ck, 1254 .parent = &l4_ck,
1263 .clkdm_name = "core_l4_clkdm", 1255 .clkdm_name = "core_l4_clkdm",
1264 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1256 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1278,7 +1270,7 @@ static struct clk mcspi1_fck = {
1278 1270
1279static struct clk mcspi2_ick = { 1271static struct clk mcspi2_ick = {
1280 .name = "mcspi2_ick", 1272 .name = "mcspi2_ick",
1281 .ops = &clkops_omap2_dflt_wait, 1273 .ops = &clkops_omap2_iclk_dflt_wait,
1282 .parent = &l4_ck, 1274 .parent = &l4_ck,
1283 .clkdm_name = "core_l4_clkdm", 1275 .clkdm_name = "core_l4_clkdm",
1284 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1276 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1298,7 +1290,7 @@ static struct clk mcspi2_fck = {
1298 1290
1299static struct clk mcspi3_ick = { 1291static struct clk mcspi3_ick = {
1300 .name = "mcspi3_ick", 1292 .name = "mcspi3_ick",
1301 .ops = &clkops_omap2_dflt_wait, 1293 .ops = &clkops_omap2_iclk_dflt_wait,
1302 .parent = &l4_ck, 1294 .parent = &l4_ck,
1303 .clkdm_name = "core_l4_clkdm", 1295 .clkdm_name = "core_l4_clkdm",
1304 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1296 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1318,7 +1310,7 @@ static struct clk mcspi3_fck = {
1318 1310
1319static struct clk uart1_ick = { 1311static struct clk uart1_ick = {
1320 .name = "uart1_ick", 1312 .name = "uart1_ick",
1321 .ops = &clkops_omap2_dflt_wait, 1313 .ops = &clkops_omap2_iclk_dflt_wait,
1322 .parent = &l4_ck, 1314 .parent = &l4_ck,
1323 .clkdm_name = "core_l4_clkdm", 1315 .clkdm_name = "core_l4_clkdm",
1324 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1316 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1338,7 +1330,7 @@ static struct clk uart1_fck = {
1338 1330
1339static struct clk uart2_ick = { 1331static struct clk uart2_ick = {
1340 .name = "uart2_ick", 1332 .name = "uart2_ick",
1341 .ops = &clkops_omap2_dflt_wait, 1333 .ops = &clkops_omap2_iclk_dflt_wait,
1342 .parent = &l4_ck, 1334 .parent = &l4_ck,
1343 .clkdm_name = "core_l4_clkdm", 1335 .clkdm_name = "core_l4_clkdm",
1344 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1336 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1358,7 +1350,7 @@ static struct clk uart2_fck = {
1358 1350
1359static struct clk uart3_ick = { 1351static struct clk uart3_ick = {
1360 .name = "uart3_ick", 1352 .name = "uart3_ick",
1361 .ops = &clkops_omap2_dflt_wait, 1353 .ops = &clkops_omap2_iclk_dflt_wait,
1362 .parent = &l4_ck, 1354 .parent = &l4_ck,
1363 .clkdm_name = "core_l4_clkdm", 1355 .clkdm_name = "core_l4_clkdm",
1364 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1356 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1378,9 +1370,9 @@ static struct clk uart3_fck = {
1378 1370
1379static struct clk gpios_ick = { 1371static struct clk gpios_ick = {
1380 .name = "gpios_ick", 1372 .name = "gpios_ick",
1381 .ops = &clkops_omap2_dflt_wait, 1373 .ops = &clkops_omap2_iclk_dflt_wait,
1382 .parent = &l4_ck, 1374 .parent = &wu_l4_ick,
1383 .clkdm_name = "core_l4_clkdm", 1375 .clkdm_name = "wkup_clkdm",
1384 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1376 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1385 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT, 1377 .enable_bit = OMAP24XX_EN_GPIOS_SHIFT,
1386 .recalc = &followparent_recalc, 1378 .recalc = &followparent_recalc,
@@ -1398,9 +1390,9 @@ static struct clk gpios_fck = {
1398 1390
1399static struct clk mpu_wdt_ick = { 1391static struct clk mpu_wdt_ick = {
1400 .name = "mpu_wdt_ick", 1392 .name = "mpu_wdt_ick",
1401 .ops = &clkops_omap2_dflt_wait, 1393 .ops = &clkops_omap2_iclk_dflt_wait,
1402 .parent = &l4_ck, 1394 .parent = &wu_l4_ick,
1403 .clkdm_name = "core_l4_clkdm", 1395 .clkdm_name = "wkup_clkdm",
1404 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1396 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1405 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT, 1397 .enable_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
1406 .recalc = &followparent_recalc, 1398 .recalc = &followparent_recalc,
@@ -1418,10 +1410,10 @@ static struct clk mpu_wdt_fck = {
1418 1410
1419static struct clk sync_32k_ick = { 1411static struct clk sync_32k_ick = {
1420 .name = "sync_32k_ick", 1412 .name = "sync_32k_ick",
1421 .ops = &clkops_omap2_dflt_wait, 1413 .ops = &clkops_omap2_iclk_dflt_wait,
1422 .parent = &l4_ck,
1423 .flags = ENABLE_ON_INIT, 1414 .flags = ENABLE_ON_INIT,
1424 .clkdm_name = "core_l4_clkdm", 1415 .parent = &wu_l4_ick,
1416 .clkdm_name = "wkup_clkdm",
1425 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1417 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1426 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT, 1418 .enable_bit = OMAP24XX_EN_32KSYNC_SHIFT,
1427 .recalc = &followparent_recalc, 1419 .recalc = &followparent_recalc,
@@ -1429,9 +1421,9 @@ static struct clk sync_32k_ick = {
1429 1421
1430static struct clk wdt1_ick = { 1422static struct clk wdt1_ick = {
1431 .name = "wdt1_ick", 1423 .name = "wdt1_ick",
1432 .ops = &clkops_omap2_dflt_wait, 1424 .ops = &clkops_omap2_iclk_dflt_wait,
1433 .parent = &l4_ck, 1425 .parent = &wu_l4_ick,
1434 .clkdm_name = "core_l4_clkdm", 1426 .clkdm_name = "wkup_clkdm",
1435 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1427 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1436 .enable_bit = OMAP24XX_EN_WDT1_SHIFT, 1428 .enable_bit = OMAP24XX_EN_WDT1_SHIFT,
1437 .recalc = &followparent_recalc, 1429 .recalc = &followparent_recalc,
@@ -1439,10 +1431,10 @@ static struct clk wdt1_ick = {
1439 1431
1440static struct clk omapctrl_ick = { 1432static struct clk omapctrl_ick = {
1441 .name = "omapctrl_ick", 1433 .name = "omapctrl_ick",
1442 .ops = &clkops_omap2_dflt_wait, 1434 .ops = &clkops_omap2_iclk_dflt_wait,
1443 .parent = &l4_ck,
1444 .flags = ENABLE_ON_INIT, 1435 .flags = ENABLE_ON_INIT,
1445 .clkdm_name = "core_l4_clkdm", 1436 .parent = &wu_l4_ick,
1437 .clkdm_name = "wkup_clkdm",
1446 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1438 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1447 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT, 1439 .enable_bit = OMAP24XX_EN_OMAPCTRL_SHIFT,
1448 .recalc = &followparent_recalc, 1440 .recalc = &followparent_recalc,
@@ -1450,9 +1442,9 @@ static struct clk omapctrl_ick = {
1450 1442
1451static struct clk icr_ick = { 1443static struct clk icr_ick = {
1452 .name = "icr_ick", 1444 .name = "icr_ick",
1453 .ops = &clkops_omap2_dflt_wait, 1445 .ops = &clkops_omap2_iclk_dflt_wait,
1454 .parent = &l4_ck, 1446 .parent = &wu_l4_ick,
1455 .clkdm_name = "core_l4_clkdm", 1447 .clkdm_name = "wkup_clkdm",
1456 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 1448 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
1457 .enable_bit = OMAP2430_EN_ICR_SHIFT, 1449 .enable_bit = OMAP2430_EN_ICR_SHIFT,
1458 .recalc = &followparent_recalc, 1450 .recalc = &followparent_recalc,
@@ -1460,7 +1452,7 @@ static struct clk icr_ick = {
1460 1452
1461static struct clk cam_ick = { 1453static struct clk cam_ick = {
1462 .name = "cam_ick", 1454 .name = "cam_ick",
1463 .ops = &clkops_omap2_dflt, 1455 .ops = &clkops_omap2_iclk_dflt,
1464 .parent = &l4_ck, 1456 .parent = &l4_ck,
1465 .clkdm_name = "core_l4_clkdm", 1457 .clkdm_name = "core_l4_clkdm",
1466 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1458 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1485,7 +1477,7 @@ static struct clk cam_fck = {
1485 1477
1486static struct clk mailboxes_ick = { 1478static struct clk mailboxes_ick = {
1487 .name = "mailboxes_ick", 1479 .name = "mailboxes_ick",
1488 .ops = &clkops_omap2_dflt_wait, 1480 .ops = &clkops_omap2_iclk_dflt_wait,
1489 .parent = &l4_ck, 1481 .parent = &l4_ck,
1490 .clkdm_name = "core_l4_clkdm", 1482 .clkdm_name = "core_l4_clkdm",
1491 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1483 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1495,7 +1487,7 @@ static struct clk mailboxes_ick = {
1495 1487
1496static struct clk wdt4_ick = { 1488static struct clk wdt4_ick = {
1497 .name = "wdt4_ick", 1489 .name = "wdt4_ick",
1498 .ops = &clkops_omap2_dflt_wait, 1490 .ops = &clkops_omap2_iclk_dflt_wait,
1499 .parent = &l4_ck, 1491 .parent = &l4_ck,
1500 .clkdm_name = "core_l4_clkdm", 1492 .clkdm_name = "core_l4_clkdm",
1501 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1493 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1515,7 +1507,7 @@ static struct clk wdt4_fck = {
1515 1507
1516static struct clk mspro_ick = { 1508static struct clk mspro_ick = {
1517 .name = "mspro_ick", 1509 .name = "mspro_ick",
1518 .ops = &clkops_omap2_dflt_wait, 1510 .ops = &clkops_omap2_iclk_dflt_wait,
1519 .parent = &l4_ck, 1511 .parent = &l4_ck,
1520 .clkdm_name = "core_l4_clkdm", 1512 .clkdm_name = "core_l4_clkdm",
1521 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1535,7 +1527,7 @@ static struct clk mspro_fck = {
1535 1527
1536static struct clk fac_ick = { 1528static struct clk fac_ick = {
1537 .name = "fac_ick", 1529 .name = "fac_ick",
1538 .ops = &clkops_omap2_dflt_wait, 1530 .ops = &clkops_omap2_iclk_dflt_wait,
1539 .parent = &l4_ck, 1531 .parent = &l4_ck,
1540 .clkdm_name = "core_l4_clkdm", 1532 .clkdm_name = "core_l4_clkdm",
1541 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1533 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1555,7 +1547,7 @@ static struct clk fac_fck = {
1555 1547
1556static struct clk hdq_ick = { 1548static struct clk hdq_ick = {
1557 .name = "hdq_ick", 1549 .name = "hdq_ick",
1558 .ops = &clkops_omap2_dflt_wait, 1550 .ops = &clkops_omap2_iclk_dflt_wait,
1559 .parent = &l4_ck, 1551 .parent = &l4_ck,
1560 .clkdm_name = "core_l4_clkdm", 1552 .clkdm_name = "core_l4_clkdm",
1561 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1553 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1579,7 +1571,7 @@ static struct clk hdq_fck = {
1579 */ 1571 */
1580static struct clk i2c2_ick = { 1572static struct clk i2c2_ick = {
1581 .name = "i2c2_ick", 1573 .name = "i2c2_ick",
1582 .ops = &clkops_omap2_dflt_wait, 1574 .ops = &clkops_omap2_iclk_dflt_wait,
1583 .parent = &l4_ck, 1575 .parent = &l4_ck,
1584 .clkdm_name = "core_l4_clkdm", 1576 .clkdm_name = "core_l4_clkdm",
1585 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1577 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1603,7 +1595,7 @@ static struct clk i2chs2_fck = {
1603 */ 1595 */
1604static struct clk i2c1_ick = { 1596static struct clk i2c1_ick = {
1605 .name = "i2c1_ick", 1597 .name = "i2c1_ick",
1606 .ops = &clkops_omap2_dflt_wait, 1598 .ops = &clkops_omap2_iclk_dflt_wait,
1607 .parent = &l4_ck, 1599 .parent = &l4_ck,
1608 .clkdm_name = "core_l4_clkdm", 1600 .clkdm_name = "core_l4_clkdm",
1609 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1601 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -1621,12 +1613,18 @@ static struct clk i2chs1_fck = {
1621 .recalc = &followparent_recalc, 1613 .recalc = &followparent_recalc,
1622}; 1614};
1623 1615
1616/*
1617 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1618 * accesses derived from this data.
1619 */
1624static struct clk gpmc_fck = { 1620static struct clk gpmc_fck = {
1625 .name = "gpmc_fck", 1621 .name = "gpmc_fck",
1626 .ops = &clkops_null, /* RMK: missing? */ 1622 .ops = &clkops_omap2_iclk_idle_only,
1627 .parent = &core_l3_ck, 1623 .parent = &core_l3_ck,
1628 .flags = ENABLE_ON_INIT, 1624 .flags = ENABLE_ON_INIT,
1629 .clkdm_name = "core_l3_clkdm", 1625 .clkdm_name = "core_l3_clkdm",
1626 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1627 .enable_bit = OMAP24XX_AUTO_GPMC_SHIFT,
1630 .recalc = &followparent_recalc, 1628 .recalc = &followparent_recalc,
1631}; 1629};
1632 1630
@@ -1638,20 +1636,26 @@ static struct clk sdma_fck = {
1638 .recalc = &followparent_recalc, 1636 .recalc = &followparent_recalc,
1639}; 1637};
1640 1638
1639/*
1640 * The enable_reg/enable_bit in this clock is only used for CM_AUTOIDLE
1641 * accesses derived from this data.
1642 */
1641static struct clk sdma_ick = { 1643static struct clk sdma_ick = {
1642 .name = "sdma_ick", 1644 .name = "sdma_ick",
1643 .ops = &clkops_null, /* RMK: missing? */ 1645 .ops = &clkops_omap2_iclk_idle_only,
1644 .parent = &l4_ck, 1646 .parent = &core_l3_ck,
1645 .clkdm_name = "core_l3_clkdm", 1647 .clkdm_name = "core_l3_clkdm",
1648 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1649 .enable_bit = OMAP24XX_AUTO_SDMA_SHIFT,
1646 .recalc = &followparent_recalc, 1650 .recalc = &followparent_recalc,
1647}; 1651};
1648 1652
1649static struct clk sdrc_ick = { 1653static struct clk sdrc_ick = {
1650 .name = "sdrc_ick", 1654 .name = "sdrc_ick",
1651 .ops = &clkops_omap2_dflt_wait, 1655 .ops = &clkops_omap2_iclk_idle_only,
1652 .parent = &l4_ck, 1656 .parent = &core_l3_ck,
1653 .flags = ENABLE_ON_INIT, 1657 .flags = ENABLE_ON_INIT,
1654 .clkdm_name = "core_l4_clkdm", 1658 .clkdm_name = "core_l3_clkdm",
1655 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 1659 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1656 .enable_bit = OMAP2430_EN_SDRC_SHIFT, 1660 .enable_bit = OMAP2430_EN_SDRC_SHIFT,
1657 .recalc = &followparent_recalc, 1661 .recalc = &followparent_recalc,
@@ -1659,7 +1663,7 @@ static struct clk sdrc_ick = {
1659 1663
1660static struct clk des_ick = { 1664static struct clk des_ick = {
1661 .name = "des_ick", 1665 .name = "des_ick",
1662 .ops = &clkops_omap2_dflt_wait, 1666 .ops = &clkops_omap2_iclk_dflt_wait,
1663 .parent = &l4_ck, 1667 .parent = &l4_ck,
1664 .clkdm_name = "core_l4_clkdm", 1668 .clkdm_name = "core_l4_clkdm",
1665 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1669 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1669,7 +1673,7 @@ static struct clk des_ick = {
1669 1673
1670static struct clk sha_ick = { 1674static struct clk sha_ick = {
1671 .name = "sha_ick", 1675 .name = "sha_ick",
1672 .ops = &clkops_omap2_dflt_wait, 1676 .ops = &clkops_omap2_iclk_dflt_wait,
1673 .parent = &l4_ck, 1677 .parent = &l4_ck,
1674 .clkdm_name = "core_l4_clkdm", 1678 .clkdm_name = "core_l4_clkdm",
1675 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1679 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1679,7 +1683,7 @@ static struct clk sha_ick = {
1679 1683
1680static struct clk rng_ick = { 1684static struct clk rng_ick = {
1681 .name = "rng_ick", 1685 .name = "rng_ick",
1682 .ops = &clkops_omap2_dflt_wait, 1686 .ops = &clkops_omap2_iclk_dflt_wait,
1683 .parent = &l4_ck, 1687 .parent = &l4_ck,
1684 .clkdm_name = "core_l4_clkdm", 1688 .clkdm_name = "core_l4_clkdm",
1685 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1689 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1689,7 +1693,7 @@ static struct clk rng_ick = {
1689 1693
1690static struct clk aes_ick = { 1694static struct clk aes_ick = {
1691 .name = "aes_ick", 1695 .name = "aes_ick",
1692 .ops = &clkops_omap2_dflt_wait, 1696 .ops = &clkops_omap2_iclk_dflt_wait,
1693 .parent = &l4_ck, 1697 .parent = &l4_ck,
1694 .clkdm_name = "core_l4_clkdm", 1698 .clkdm_name = "core_l4_clkdm",
1695 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1699 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1699,7 +1703,7 @@ static struct clk aes_ick = {
1699 1703
1700static struct clk pka_ick = { 1704static struct clk pka_ick = {
1701 .name = "pka_ick", 1705 .name = "pka_ick",
1702 .ops = &clkops_omap2_dflt_wait, 1706 .ops = &clkops_omap2_iclk_dflt_wait,
1703 .parent = &l4_ck, 1707 .parent = &l4_ck,
1704 .clkdm_name = "core_l4_clkdm", 1708 .clkdm_name = "core_l4_clkdm",
1705 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4), 1709 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_ICLKEN4),
@@ -1719,7 +1723,7 @@ static struct clk usb_fck = {
1719 1723
1720static struct clk usbhs_ick = { 1724static struct clk usbhs_ick = {
1721 .name = "usbhs_ick", 1725 .name = "usbhs_ick",
1722 .ops = &clkops_omap2_dflt_wait, 1726 .ops = &clkops_omap2_iclk_dflt_wait,
1723 .parent = &core_l3_ck, 1727 .parent = &core_l3_ck,
1724 .clkdm_name = "core_l3_clkdm", 1728 .clkdm_name = "core_l3_clkdm",
1725 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1729 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1729,7 +1733,7 @@ static struct clk usbhs_ick = {
1729 1733
1730static struct clk mmchs1_ick = { 1734static struct clk mmchs1_ick = {
1731 .name = "mmchs1_ick", 1735 .name = "mmchs1_ick",
1732 .ops = &clkops_omap2_dflt_wait, 1736 .ops = &clkops_omap2_iclk_dflt_wait,
1733 .parent = &l4_ck, 1737 .parent = &l4_ck,
1734 .clkdm_name = "core_l4_clkdm", 1738 .clkdm_name = "core_l4_clkdm",
1735 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1739 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1741,7 +1745,7 @@ static struct clk mmchs1_fck = {
1741 .name = "mmchs1_fck", 1745 .name = "mmchs1_fck",
1742 .ops = &clkops_omap2_dflt_wait, 1746 .ops = &clkops_omap2_dflt_wait,
1743 .parent = &func_96m_ck, 1747 .parent = &func_96m_ck,
1744 .clkdm_name = "core_l3_clkdm", 1748 .clkdm_name = "core_l4_clkdm",
1745 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1749 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1746 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT, 1750 .enable_bit = OMAP2430_EN_MMCHS1_SHIFT,
1747 .recalc = &followparent_recalc, 1751 .recalc = &followparent_recalc,
@@ -1749,7 +1753,7 @@ static struct clk mmchs1_fck = {
1749 1753
1750static struct clk mmchs2_ick = { 1754static struct clk mmchs2_ick = {
1751 .name = "mmchs2_ick", 1755 .name = "mmchs2_ick",
1752 .ops = &clkops_omap2_dflt_wait, 1756 .ops = &clkops_omap2_iclk_dflt_wait,
1753 .parent = &l4_ck, 1757 .parent = &l4_ck,
1754 .clkdm_name = "core_l4_clkdm", 1758 .clkdm_name = "core_l4_clkdm",
1755 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1759 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1761,6 +1765,7 @@ static struct clk mmchs2_fck = {
1761 .name = "mmchs2_fck", 1765 .name = "mmchs2_fck",
1762 .ops = &clkops_omap2_dflt_wait, 1766 .ops = &clkops_omap2_dflt_wait,
1763 .parent = &func_96m_ck, 1767 .parent = &func_96m_ck,
1768 .clkdm_name = "core_l4_clkdm",
1764 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), 1769 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2),
1765 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT, 1770 .enable_bit = OMAP2430_EN_MMCHS2_SHIFT,
1766 .recalc = &followparent_recalc, 1771 .recalc = &followparent_recalc,
@@ -1768,7 +1773,7 @@ static struct clk mmchs2_fck = {
1768 1773
1769static struct clk gpio5_ick = { 1774static struct clk gpio5_ick = {
1770 .name = "gpio5_ick", 1775 .name = "gpio5_ick",
1771 .ops = &clkops_omap2_dflt_wait, 1776 .ops = &clkops_omap2_iclk_dflt_wait,
1772 .parent = &l4_ck, 1777 .parent = &l4_ck,
1773 .clkdm_name = "core_l4_clkdm", 1778 .clkdm_name = "core_l4_clkdm",
1774 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1779 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1788,7 +1793,7 @@ static struct clk gpio5_fck = {
1788 1793
1789static struct clk mdm_intc_ick = { 1794static struct clk mdm_intc_ick = {
1790 .name = "mdm_intc_ick", 1795 .name = "mdm_intc_ick",
1791 .ops = &clkops_omap2_dflt_wait, 1796 .ops = &clkops_omap2_iclk_dflt_wait,
1792 .parent = &l4_ck, 1797 .parent = &l4_ck,
1793 .clkdm_name = "core_l4_clkdm", 1798 .clkdm_name = "core_l4_clkdm",
1794 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1799 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
@@ -1880,7 +1885,6 @@ static struct omap_clk omap2430_clks[] = {
1880 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X), 1885 CLK(NULL, "mpu_ck", &mpu_ck, CK_243X),
1881 /* dsp domain clocks */ 1886 /* dsp domain clocks */
1882 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X), 1887 CLK(NULL, "dsp_fck", &dsp_fck, CK_243X),
1883 CLK(NULL, "dsp_irate_ick", &dsp_irate_ick, CK_243X),
1884 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X), 1888 CLK(NULL, "iva2_1_ick", &iva2_1_ick, CK_243X),
1885 /* GFX domain clocks */ 1889 /* GFX domain clocks */
1886 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X), 1890 CLK(NULL, "gfx_3d_fck", &gfx_3d_fck, CK_243X),
@@ -1901,6 +1905,7 @@ static struct omap_clk omap2430_clks[] = {
1901 /* L4 domain clocks */ 1905 /* L4 domain clocks */
1902 CLK(NULL, "l4_ck", &l4_ck, CK_243X), 1906 CLK(NULL, "l4_ck", &l4_ck, CK_243X),
1903 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X), 1907 CLK(NULL, "ssi_l4_ick", &ssi_l4_ick, CK_243X),
1908 CLK(NULL, "wu_l4_ick", &wu_l4_ick, CK_243X),
1904 /* virtual meta-group clock */ 1909 /* virtual meta-group clock */
1905 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X), 1910 CLK(NULL, "virt_prcm_set", &virt_prcm_set, CK_243X),
1906 /* general l4 interface ck, multi-parent functional clk */ 1911 /* general l4 interface ck, multi-parent functional clk */
@@ -1984,15 +1989,15 @@ static struct omap_clk omap2430_clks[] = {
1984 CLK(NULL, "pka_ick", &pka_ick, CK_243X), 1989 CLK(NULL, "pka_ick", &pka_ick, CK_243X),
1985 CLK(NULL, "usb_fck", &usb_fck, CK_243X), 1990 CLK(NULL, "usb_fck", &usb_fck, CK_243X),
1986 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X), 1991 CLK("musb-omap2430", "ick", &usbhs_ick, CK_243X),
1987 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X), 1992 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_243X),
1988 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X), 1993 CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_243X),
1989 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_243X), 1994 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_243X),
1990 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_243X), 1995 CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_243X),
1991 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X), 1996 CLK(NULL, "gpio5_ick", &gpio5_ick, CK_243X),
1992 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X), 1997 CLK(NULL, "gpio5_fck", &gpio5_fck, CK_243X),
1993 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), 1998 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
1994 CLK("mmci-omap-hs.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), 1999 CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
1995 CLK("mmci-omap-hs.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), 2000 CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
1996}; 2001};
1997 2002
1998/* 2003/*
@@ -2028,6 +2033,9 @@ int __init omap2430_clk_init(void)
2028 omap2_init_clk_clkdm(c->lk.clk); 2033 omap2_init_clk_clkdm(c->lk.clk);
2029 } 2034 }
2030 2035
2036 /* Disable autoidle on all clocks; let the PM code enable it later */
2037 omap_clk_disable_autoidle_all();
2038
2031 /* Check the MPU rate set by bootloader */ 2039 /* Check the MPU rate set by bootloader */
2032 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); 2040 clkrate = omap2xxx_clk_get_core_rate(&dpll_ck);
2033 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 2041 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
diff --git a/arch/arm/mach-omap2/clock2xxx.h b/arch/arm/mach-omap2/clock2xxx.h
index 6a658b890c17..cb6df8ca9e4a 100644
--- a/arch/arm/mach-omap2/clock2xxx.h
+++ b/arch/arm/mach-omap2/clock2xxx.h
@@ -20,16 +20,16 @@ u32 omap2xxx_get_apll_clkin(void);
20u32 omap2xxx_get_sysclkdiv(void); 20u32 omap2xxx_get_sysclkdiv(void);
21void omap2xxx_clk_prepare_for_reboot(void); 21void omap2xxx_clk_prepare_for_reboot(void);
22 22
23#ifdef CONFIG_ARCH_OMAP2420 23#ifdef CONFIG_SOC_OMAP2420
24int omap2420_clk_init(void); 24int omap2420_clk_init(void);
25#else 25#else
26#define omap2420_clk_init() 0 26#define omap2420_clk_init() do { } while(0)
27#endif 27#endif
28 28
29#ifdef CONFIG_ARCH_OMAP2430 29#ifdef CONFIG_SOC_OMAP2430
30int omap2430_clk_init(void); 30int omap2430_clk_init(void);
31#else 31#else
32#define omap2430_clk_init() 0 32#define omap2430_clk_init() do { } while(0)
33#endif 33#endif
34 34
35extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll; 35extern void __iomem *prcm_clksrc_ctrl, *cm_idlest_pll;
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 287abc480924..1fc96b9ee330 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -2,7 +2,7 @@
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-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
8 * Jouni Högander 8 * Jouni Högander
@@ -59,6 +59,15 @@ const struct clkops clkops_omap3430es2_ssi_wait = {
59 .find_companion = omap2_clk_dflt_find_companion, 59 .find_companion = omap2_clk_dflt_find_companion,
60}; 60};
61 61
62const struct clkops clkops_omap3430es2_iclk_ssi_wait = {
63 .enable = omap2_dflt_clk_enable,
64 .disable = omap2_dflt_clk_disable,
65 .find_idlest = omap3430es2_clk_ssi_find_idlest,
66 .find_companion = omap2_clk_dflt_find_companion,
67 .allow_idle = omap2_clkt_iclk_allow_idle,
68 .deny_idle = omap2_clkt_iclk_deny_idle,
69};
70
62/** 71/**
63 * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST 72 * omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST
64 * @clk: struct clk * being enabled 73 * @clk: struct clk * being enabled
@@ -94,6 +103,15 @@ const struct clkops clkops_omap3430es2_dss_usbhost_wait = {
94 .find_companion = omap2_clk_dflt_find_companion, 103 .find_companion = omap2_clk_dflt_find_companion,
95}; 104};
96 105
106const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait = {
107 .enable = omap2_dflt_clk_enable,
108 .disable = omap2_dflt_clk_disable,
109 .find_idlest = omap3430es2_clk_dss_usbhost_find_idlest,
110 .find_companion = omap2_clk_dflt_find_companion,
111 .allow_idle = omap2_clkt_iclk_allow_idle,
112 .deny_idle = omap2_clkt_iclk_deny_idle,
113};
114
97/** 115/**
98 * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB 116 * omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB
99 * @clk: struct clk * being enabled 117 * @clk: struct clk * being enabled
@@ -124,3 +142,12 @@ const struct clkops clkops_omap3430es2_hsotgusb_wait = {
124 .find_idlest = omap3430es2_clk_hsotgusb_find_idlest, 142 .find_idlest = omap3430es2_clk_hsotgusb_find_idlest,
125 .find_companion = omap2_clk_dflt_find_companion, 143 .find_companion = omap2_clk_dflt_find_companion,
126}; 144};
145
146const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait = {
147 .enable = omap2_dflt_clk_enable,
148 .disable = omap2_dflt_clk_disable,
149 .find_idlest = omap3430es2_clk_hsotgusb_find_idlest,
150 .find_companion = omap2_clk_dflt_find_companion,
151 .allow_idle = omap2_clkt_iclk_allow_idle,
152 .deny_idle = omap2_clkt_iclk_deny_idle,
153};
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h
index 628e8de57680..084ba71b2b31 100644
--- a/arch/arm/mach-omap2/clock34xx.h
+++ b/arch/arm/mach-omap2/clock34xx.h
@@ -2,14 +2,17 @@
2 * OMAP34xx clock function prototypes and macros 2 * OMAP34xx clock function prototypes and macros
3 * 3 *
4 * Copyright (C) 2007-2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 */ 6 */
7 7
8#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H 8#ifndef __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
9#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H 9#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H
10 10
11extern const struct clkops clkops_omap3430es2_ssi_wait; 11extern const struct clkops clkops_omap3430es2_ssi_wait;
12extern const struct clkops clkops_omap3430es2_iclk_ssi_wait;
12extern const struct clkops clkops_omap3430es2_hsotgusb_wait; 13extern const struct clkops clkops_omap3430es2_hsotgusb_wait;
14extern const struct clkops clkops_omap3430es2_iclk_hsotgusb_wait;
13extern const struct clkops clkops_omap3430es2_dss_usbhost_wait; 15extern const struct clkops clkops_omap3430es2_dss_usbhost_wait;
16extern const struct clkops clkops_omap3430es2_iclk_dss_usbhost_wait;
14 17
15#endif 18#endif
diff --git a/arch/arm/mach-omap2/clock3517.c b/arch/arm/mach-omap2/clock3517.c
index 74116a3cf099..2e97d08f0e56 100644
--- a/arch/arm/mach-omap2/clock3517.c
+++ b/arch/arm/mach-omap2/clock3517.c
@@ -2,7 +2,7 @@
2 * OMAP3517/3505-specific clock framework functions 2 * OMAP3517/3505-specific clock framework functions
3 * 3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. 4 * Copyright (C) 2010 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2011 Nokia Corporation
6 * 6 *
7 * Ranjith Lohithakshan 7 * Ranjith Lohithakshan
8 * Paul Walmsley 8 * Paul Walmsley
@@ -119,6 +119,8 @@ const struct clkops clkops_am35xx_ipss_wait = {
119 .disable = omap2_dflt_clk_disable, 119 .disable = omap2_dflt_clk_disable,
120 .find_idlest = am35xx_clk_ipss_find_idlest, 120 .find_idlest = am35xx_clk_ipss_find_idlest,
121 .find_companion = omap2_clk_dflt_find_companion, 121 .find_companion = omap2_clk_dflt_find_companion,
122 .allow_idle = omap2_clkt_iclk_allow_idle,
123 .deny_idle = omap2_clkt_iclk_deny_idle,
122}; 124};
123 125
124 126
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index e9f66b6dec18..952c3e01c9eb 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -65,9 +65,6 @@ void __init omap3_clk_lock_dpll5(void)
65 clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST); 65 clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
66 clk_enable(dpll5_clk); 66 clk_enable(dpll5_clk);
67 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 */ 68 /* Program dpll5_m2_clk divider for no division */
72 dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck"); 69 dpll5_m2_clk = clk_get(NULL, "dpll5_m2_ck");
73 clk_enable(dpll5_m2_clk); 70 clk_enable(dpll5_m2_clk);
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index 403a4a1d3f9c..d905ecc7989a 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP3 clock data 2 * OMAP3 clock data
3 * 3 *
4 * Copyright (C) 2007-2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 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
@@ -291,12 +291,11 @@ static struct dpll_data dpll1_dd = {
291 .max_multiplier = OMAP3_MAX_DPLL_MULT, 291 .max_multiplier = OMAP3_MAX_DPLL_MULT,
292 .min_divider = 1, 292 .min_divider = 1,
293 .max_divider = OMAP3_MAX_DPLL_DIV, 293 .max_divider = OMAP3_MAX_DPLL_DIV,
294 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
295}; 294};
296 295
297static struct clk dpll1_ck = { 296static struct clk dpll1_ck = {
298 .name = "dpll1_ck", 297 .name = "dpll1_ck",
299 .ops = &clkops_null, 298 .ops = &clkops_omap3_noncore_dpll_ops,
300 .parent = &sys_ck, 299 .parent = &sys_ck,
301 .dpll_data = &dpll1_dd, 300 .dpll_data = &dpll1_dd,
302 .round_rate = &omap2_dpll_round_rate, 301 .round_rate = &omap2_dpll_round_rate,
@@ -364,7 +363,6 @@ static struct dpll_data dpll2_dd = {
364 .max_multiplier = OMAP3_MAX_DPLL_MULT, 363 .max_multiplier = OMAP3_MAX_DPLL_MULT,
365 .min_divider = 1, 364 .min_divider = 1,
366 .max_divider = OMAP3_MAX_DPLL_DIV, 365 .max_divider = OMAP3_MAX_DPLL_DIV,
367 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
368}; 366};
369 367
370static struct clk dpll2_ck = { 368static struct clk dpll2_ck = {
@@ -424,12 +422,11 @@ static struct dpll_data dpll3_dd = {
424 .max_multiplier = OMAP3_MAX_DPLL_MULT, 422 .max_multiplier = OMAP3_MAX_DPLL_MULT,
425 .min_divider = 1, 423 .min_divider = 1,
426 .max_divider = OMAP3_MAX_DPLL_DIV, 424 .max_divider = OMAP3_MAX_DPLL_DIV,
427 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
428}; 425};
429 426
430static struct clk dpll3_ck = { 427static struct clk dpll3_ck = {
431 .name = "dpll3_ck", 428 .name = "dpll3_ck",
432 .ops = &clkops_null, 429 .ops = &clkops_omap3_core_dpll_ops,
433 .parent = &sys_ck, 430 .parent = &sys_ck,
434 .dpll_data = &dpll3_dd, 431 .dpll_data = &dpll3_dd,
435 .round_rate = &omap2_dpll_round_rate, 432 .round_rate = &omap2_dpll_round_rate,
@@ -583,7 +580,6 @@ static struct dpll_data dpll4_dd_34xx __initdata = {
583 .max_multiplier = OMAP3_MAX_DPLL_MULT, 580 .max_multiplier = OMAP3_MAX_DPLL_MULT,
584 .min_divider = 1, 581 .min_divider = 1,
585 .max_divider = OMAP3_MAX_DPLL_DIV, 582 .max_divider = OMAP3_MAX_DPLL_DIV,
586 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
587}; 583};
588 584
589static struct dpll_data dpll4_dd_3630 __initdata = { 585static struct dpll_data dpll4_dd_3630 __initdata = {
@@ -607,7 +603,6 @@ static struct dpll_data dpll4_dd_3630 __initdata = {
607 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT, 603 .max_multiplier = OMAP3630_MAX_JTYPE_DPLL_MULT,
608 .min_divider = 1, 604 .min_divider = 1,
609 .max_divider = OMAP3_MAX_DPLL_DIV, 605 .max_divider = OMAP3_MAX_DPLL_DIV,
610 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE,
611 .flags = DPLL_J_TYPE 606 .flags = DPLL_J_TYPE
612}; 607};
613 608
@@ -939,7 +934,6 @@ static struct dpll_data dpll5_dd = {
939 .max_multiplier = OMAP3_MAX_DPLL_MULT, 934 .max_multiplier = OMAP3_MAX_DPLL_MULT,
940 .min_divider = 1, 935 .min_divider = 1,
941 .max_divider = OMAP3_MAX_DPLL_DIV, 936 .max_divider = OMAP3_MAX_DPLL_DIV,
942 .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE
943}; 937};
944 938
945static struct clk dpll5_ck = { 939static struct clk dpll5_ck = {
@@ -1205,7 +1199,10 @@ static const struct clksel gfx_l3_clksel[] = {
1205 { .parent = NULL } 1199 { .parent = NULL }
1206}; 1200};
1207 1201
1208/* Virtual parent clock for gfx_l3_ick and gfx_l3_fck */ 1202/*
1203 * Virtual parent clock for gfx_l3_ick and gfx_l3_fck
1204 * This interface clock does not have a CM_AUTOIDLE bit
1205 */
1209static struct clk gfx_l3_ck = { 1206static struct clk gfx_l3_ck = {
1210 .name = "gfx_l3_ck", 1207 .name = "gfx_l3_ck",
1211 .ops = &clkops_omap2_dflt_wait, 1208 .ops = &clkops_omap2_dflt_wait,
@@ -1304,6 +1301,7 @@ static struct clk sgx_fck = {
1304 .round_rate = &omap2_clksel_round_rate 1301 .round_rate = &omap2_clksel_round_rate
1305}; 1302};
1306 1303
1304/* This interface clock does not have a CM_AUTOIDLE bit */
1307static struct clk sgx_ick = { 1305static struct clk sgx_ick = {
1308 .name = "sgx_ick", 1306 .name = "sgx_ick",
1309 .ops = &clkops_omap2_dflt_wait, 1307 .ops = &clkops_omap2_dflt_wait,
@@ -1328,7 +1326,7 @@ static struct clk d2d_26m_fck = {
1328 1326
1329static struct clk modem_fck = { 1327static struct clk modem_fck = {
1330 .name = "modem_fck", 1328 .name = "modem_fck",
1331 .ops = &clkops_omap2_dflt_wait, 1329 .ops = &clkops_omap2_mdmclk_dflt_wait,
1332 .parent = &sys_ck, 1330 .parent = &sys_ck,
1333 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1331 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1334 .enable_bit = OMAP3430_EN_MODEM_SHIFT, 1332 .enable_bit = OMAP3430_EN_MODEM_SHIFT,
@@ -1338,7 +1336,7 @@ static struct clk modem_fck = {
1338 1336
1339static struct clk sad2d_ick = { 1337static struct clk sad2d_ick = {
1340 .name = "sad2d_ick", 1338 .name = "sad2d_ick",
1341 .ops = &clkops_omap2_dflt_wait, 1339 .ops = &clkops_omap2_iclk_dflt_wait,
1342 .parent = &l3_ick, 1340 .parent = &l3_ick,
1343 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1341 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1344 .enable_bit = OMAP3430_EN_SAD2D_SHIFT, 1342 .enable_bit = OMAP3430_EN_SAD2D_SHIFT,
@@ -1348,7 +1346,7 @@ static struct clk sad2d_ick = {
1348 1346
1349static struct clk mad2d_ick = { 1347static struct clk mad2d_ick = {
1350 .name = "mad2d_ick", 1348 .name = "mad2d_ick",
1351 .ops = &clkops_omap2_dflt_wait, 1349 .ops = &clkops_omap2_iclk_dflt_wait,
1352 .parent = &l3_ick, 1350 .parent = &l3_ick,
1353 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 1351 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1354 .enable_bit = OMAP3430_EN_MAD2D_SHIFT, 1352 .enable_bit = OMAP3430_EN_MAD2D_SHIFT,
@@ -1718,7 +1716,7 @@ static struct clk core_l3_ick = {
1718 1716
1719static struct clk hsotgusb_ick_3430es1 = { 1717static struct clk hsotgusb_ick_3430es1 = {
1720 .name = "hsotgusb_ick", 1718 .name = "hsotgusb_ick",
1721 .ops = &clkops_omap2_dflt, 1719 .ops = &clkops_omap2_iclk_dflt,
1722 .parent = &core_l3_ick, 1720 .parent = &core_l3_ick,
1723 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1721 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1724 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, 1722 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
@@ -1728,7 +1726,7 @@ static struct clk hsotgusb_ick_3430es1 = {
1728 1726
1729static struct clk hsotgusb_ick_3430es2 = { 1727static struct clk hsotgusb_ick_3430es2 = {
1730 .name = "hsotgusb_ick", 1728 .name = "hsotgusb_ick",
1731 .ops = &clkops_omap3430es2_hsotgusb_wait, 1729 .ops = &clkops_omap3430es2_iclk_hsotgusb_wait,
1732 .parent = &core_l3_ick, 1730 .parent = &core_l3_ick,
1733 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1731 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1734 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT, 1732 .enable_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
@@ -1736,6 +1734,7 @@ static struct clk hsotgusb_ick_3430es2 = {
1736 .recalc = &followparent_recalc, 1734 .recalc = &followparent_recalc,
1737}; 1735};
1738 1736
1737/* This interface clock does not have a CM_AUTOIDLE bit */
1739static struct clk sdrc_ick = { 1738static struct clk sdrc_ick = {
1740 .name = "sdrc_ick", 1739 .name = "sdrc_ick",
1741 .ops = &clkops_omap2_dflt_wait, 1740 .ops = &clkops_omap2_dflt_wait,
@@ -1767,7 +1766,7 @@ static struct clk security_l3_ick = {
1767 1766
1768static struct clk pka_ick = { 1767static struct clk pka_ick = {
1769 .name = "pka_ick", 1768 .name = "pka_ick",
1770 .ops = &clkops_omap2_dflt_wait, 1769 .ops = &clkops_omap2_iclk_dflt_wait,
1771 .parent = &security_l3_ick, 1770 .parent = &security_l3_ick,
1772 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 1771 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
1773 .enable_bit = OMAP3430_EN_PKA_SHIFT, 1772 .enable_bit = OMAP3430_EN_PKA_SHIFT,
@@ -1786,7 +1785,7 @@ static struct clk core_l4_ick = {
1786 1785
1787static struct clk usbtll_ick = { 1786static struct clk usbtll_ick = {
1788 .name = "usbtll_ick", 1787 .name = "usbtll_ick",
1789 .ops = &clkops_omap2_dflt_wait, 1788 .ops = &clkops_omap2_iclk_dflt_wait,
1790 .parent = &core_l4_ick, 1789 .parent = &core_l4_ick,
1791 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3), 1790 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN3),
1792 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, 1791 .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT,
@@ -1796,7 +1795,7 @@ static struct clk usbtll_ick = {
1796 1795
1797static struct clk mmchs3_ick = { 1796static struct clk mmchs3_ick = {
1798 .name = "mmchs3_ick", 1797 .name = "mmchs3_ick",
1799 .ops = &clkops_omap2_dflt_wait, 1798 .ops = &clkops_omap2_iclk_dflt_wait,
1800 .parent = &core_l4_ick, 1799 .parent = &core_l4_ick,
1801 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1800 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1802 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT, 1801 .enable_bit = OMAP3430ES2_EN_MMC3_SHIFT,
@@ -1807,7 +1806,7 @@ static struct clk mmchs3_ick = {
1807/* Intersystem Communication Registers - chassis mode only */ 1806/* Intersystem Communication Registers - chassis mode only */
1808static struct clk icr_ick = { 1807static struct clk icr_ick = {
1809 .name = "icr_ick", 1808 .name = "icr_ick",
1810 .ops = &clkops_omap2_dflt_wait, 1809 .ops = &clkops_omap2_iclk_dflt_wait,
1811 .parent = &core_l4_ick, 1810 .parent = &core_l4_ick,
1812 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1811 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1813 .enable_bit = OMAP3430_EN_ICR_SHIFT, 1812 .enable_bit = OMAP3430_EN_ICR_SHIFT,
@@ -1817,7 +1816,7 @@ static struct clk icr_ick = {
1817 1816
1818static struct clk aes2_ick = { 1817static struct clk aes2_ick = {
1819 .name = "aes2_ick", 1818 .name = "aes2_ick",
1820 .ops = &clkops_omap2_dflt_wait, 1819 .ops = &clkops_omap2_iclk_dflt_wait,
1821 .parent = &core_l4_ick, 1820 .parent = &core_l4_ick,
1822 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1821 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1823 .enable_bit = OMAP3430_EN_AES2_SHIFT, 1822 .enable_bit = OMAP3430_EN_AES2_SHIFT,
@@ -1827,7 +1826,7 @@ static struct clk aes2_ick = {
1827 1826
1828static struct clk sha12_ick = { 1827static struct clk sha12_ick = {
1829 .name = "sha12_ick", 1828 .name = "sha12_ick",
1830 .ops = &clkops_omap2_dflt_wait, 1829 .ops = &clkops_omap2_iclk_dflt_wait,
1831 .parent = &core_l4_ick, 1830 .parent = &core_l4_ick,
1832 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1831 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1833 .enable_bit = OMAP3430_EN_SHA12_SHIFT, 1832 .enable_bit = OMAP3430_EN_SHA12_SHIFT,
@@ -1837,7 +1836,7 @@ static struct clk sha12_ick = {
1837 1836
1838static struct clk des2_ick = { 1837static struct clk des2_ick = {
1839 .name = "des2_ick", 1838 .name = "des2_ick",
1840 .ops = &clkops_omap2_dflt_wait, 1839 .ops = &clkops_omap2_iclk_dflt_wait,
1841 .parent = &core_l4_ick, 1840 .parent = &core_l4_ick,
1842 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1841 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1843 .enable_bit = OMAP3430_EN_DES2_SHIFT, 1842 .enable_bit = OMAP3430_EN_DES2_SHIFT,
@@ -1847,7 +1846,7 @@ static struct clk des2_ick = {
1847 1846
1848static struct clk mmchs2_ick = { 1847static struct clk mmchs2_ick = {
1849 .name = "mmchs2_ick", 1848 .name = "mmchs2_ick",
1850 .ops = &clkops_omap2_dflt_wait, 1849 .ops = &clkops_omap2_iclk_dflt_wait,
1851 .parent = &core_l4_ick, 1850 .parent = &core_l4_ick,
1852 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1851 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1853 .enable_bit = OMAP3430_EN_MMC2_SHIFT, 1852 .enable_bit = OMAP3430_EN_MMC2_SHIFT,
@@ -1857,7 +1856,7 @@ static struct clk mmchs2_ick = {
1857 1856
1858static struct clk mmchs1_ick = { 1857static struct clk mmchs1_ick = {
1859 .name = "mmchs1_ick", 1858 .name = "mmchs1_ick",
1860 .ops = &clkops_omap2_dflt_wait, 1859 .ops = &clkops_omap2_iclk_dflt_wait,
1861 .parent = &core_l4_ick, 1860 .parent = &core_l4_ick,
1862 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1861 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1863 .enable_bit = OMAP3430_EN_MMC1_SHIFT, 1862 .enable_bit = OMAP3430_EN_MMC1_SHIFT,
@@ -1867,7 +1866,7 @@ static struct clk mmchs1_ick = {
1867 1866
1868static struct clk mspro_ick = { 1867static struct clk mspro_ick = {
1869 .name = "mspro_ick", 1868 .name = "mspro_ick",
1870 .ops = &clkops_omap2_dflt_wait, 1869 .ops = &clkops_omap2_iclk_dflt_wait,
1871 .parent = &core_l4_ick, 1870 .parent = &core_l4_ick,
1872 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1871 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1873 .enable_bit = OMAP3430_EN_MSPRO_SHIFT, 1872 .enable_bit = OMAP3430_EN_MSPRO_SHIFT,
@@ -1877,7 +1876,7 @@ static struct clk mspro_ick = {
1877 1876
1878static struct clk hdq_ick = { 1877static struct clk hdq_ick = {
1879 .name = "hdq_ick", 1878 .name = "hdq_ick",
1880 .ops = &clkops_omap2_dflt_wait, 1879 .ops = &clkops_omap2_iclk_dflt_wait,
1881 .parent = &core_l4_ick, 1880 .parent = &core_l4_ick,
1882 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1881 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1883 .enable_bit = OMAP3430_EN_HDQ_SHIFT, 1882 .enable_bit = OMAP3430_EN_HDQ_SHIFT,
@@ -1887,7 +1886,7 @@ static struct clk hdq_ick = {
1887 1886
1888static struct clk mcspi4_ick = { 1887static struct clk mcspi4_ick = {
1889 .name = "mcspi4_ick", 1888 .name = "mcspi4_ick",
1890 .ops = &clkops_omap2_dflt_wait, 1889 .ops = &clkops_omap2_iclk_dflt_wait,
1891 .parent = &core_l4_ick, 1890 .parent = &core_l4_ick,
1892 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1891 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1893 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT, 1892 .enable_bit = OMAP3430_EN_MCSPI4_SHIFT,
@@ -1897,7 +1896,7 @@ static struct clk mcspi4_ick = {
1897 1896
1898static struct clk mcspi3_ick = { 1897static struct clk mcspi3_ick = {
1899 .name = "mcspi3_ick", 1898 .name = "mcspi3_ick",
1900 .ops = &clkops_omap2_dflt_wait, 1899 .ops = &clkops_omap2_iclk_dflt_wait,
1901 .parent = &core_l4_ick, 1900 .parent = &core_l4_ick,
1902 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1901 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1903 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT, 1902 .enable_bit = OMAP3430_EN_MCSPI3_SHIFT,
@@ -1907,7 +1906,7 @@ static struct clk mcspi3_ick = {
1907 1906
1908static struct clk mcspi2_ick = { 1907static struct clk mcspi2_ick = {
1909 .name = "mcspi2_ick", 1908 .name = "mcspi2_ick",
1910 .ops = &clkops_omap2_dflt_wait, 1909 .ops = &clkops_omap2_iclk_dflt_wait,
1911 .parent = &core_l4_ick, 1910 .parent = &core_l4_ick,
1912 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1911 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1913 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT, 1912 .enable_bit = OMAP3430_EN_MCSPI2_SHIFT,
@@ -1917,7 +1916,7 @@ static struct clk mcspi2_ick = {
1917 1916
1918static struct clk mcspi1_ick = { 1917static struct clk mcspi1_ick = {
1919 .name = "mcspi1_ick", 1918 .name = "mcspi1_ick",
1920 .ops = &clkops_omap2_dflt_wait, 1919 .ops = &clkops_omap2_iclk_dflt_wait,
1921 .parent = &core_l4_ick, 1920 .parent = &core_l4_ick,
1922 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1921 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1923 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT, 1922 .enable_bit = OMAP3430_EN_MCSPI1_SHIFT,
@@ -1927,7 +1926,7 @@ static struct clk mcspi1_ick = {
1927 1926
1928static struct clk i2c3_ick = { 1927static struct clk i2c3_ick = {
1929 .name = "i2c3_ick", 1928 .name = "i2c3_ick",
1930 .ops = &clkops_omap2_dflt_wait, 1929 .ops = &clkops_omap2_iclk_dflt_wait,
1931 .parent = &core_l4_ick, 1930 .parent = &core_l4_ick,
1932 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1931 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1933 .enable_bit = OMAP3430_EN_I2C3_SHIFT, 1932 .enable_bit = OMAP3430_EN_I2C3_SHIFT,
@@ -1937,7 +1936,7 @@ static struct clk i2c3_ick = {
1937 1936
1938static struct clk i2c2_ick = { 1937static struct clk i2c2_ick = {
1939 .name = "i2c2_ick", 1938 .name = "i2c2_ick",
1940 .ops = &clkops_omap2_dflt_wait, 1939 .ops = &clkops_omap2_iclk_dflt_wait,
1941 .parent = &core_l4_ick, 1940 .parent = &core_l4_ick,
1942 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1941 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1943 .enable_bit = OMAP3430_EN_I2C2_SHIFT, 1942 .enable_bit = OMAP3430_EN_I2C2_SHIFT,
@@ -1947,7 +1946,7 @@ static struct clk i2c2_ick = {
1947 1946
1948static struct clk i2c1_ick = { 1947static struct clk i2c1_ick = {
1949 .name = "i2c1_ick", 1948 .name = "i2c1_ick",
1950 .ops = &clkops_omap2_dflt_wait, 1949 .ops = &clkops_omap2_iclk_dflt_wait,
1951 .parent = &core_l4_ick, 1950 .parent = &core_l4_ick,
1952 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1951 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1953 .enable_bit = OMAP3430_EN_I2C1_SHIFT, 1952 .enable_bit = OMAP3430_EN_I2C1_SHIFT,
@@ -1957,7 +1956,7 @@ static struct clk i2c1_ick = {
1957 1956
1958static struct clk uart2_ick = { 1957static struct clk uart2_ick = {
1959 .name = "uart2_ick", 1958 .name = "uart2_ick",
1960 .ops = &clkops_omap2_dflt_wait, 1959 .ops = &clkops_omap2_iclk_dflt_wait,
1961 .parent = &core_l4_ick, 1960 .parent = &core_l4_ick,
1962 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1961 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1963 .enable_bit = OMAP3430_EN_UART2_SHIFT, 1962 .enable_bit = OMAP3430_EN_UART2_SHIFT,
@@ -1967,7 +1966,7 @@ static struct clk uart2_ick = {
1967 1966
1968static struct clk uart1_ick = { 1967static struct clk uart1_ick = {
1969 .name = "uart1_ick", 1968 .name = "uart1_ick",
1970 .ops = &clkops_omap2_dflt_wait, 1969 .ops = &clkops_omap2_iclk_dflt_wait,
1971 .parent = &core_l4_ick, 1970 .parent = &core_l4_ick,
1972 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1971 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1973 .enable_bit = OMAP3430_EN_UART1_SHIFT, 1972 .enable_bit = OMAP3430_EN_UART1_SHIFT,
@@ -1977,7 +1976,7 @@ static struct clk uart1_ick = {
1977 1976
1978static struct clk gpt11_ick = { 1977static struct clk gpt11_ick = {
1979 .name = "gpt11_ick", 1978 .name = "gpt11_ick",
1980 .ops = &clkops_omap2_dflt_wait, 1979 .ops = &clkops_omap2_iclk_dflt_wait,
1981 .parent = &core_l4_ick, 1980 .parent = &core_l4_ick,
1982 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1981 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1983 .enable_bit = OMAP3430_EN_GPT11_SHIFT, 1982 .enable_bit = OMAP3430_EN_GPT11_SHIFT,
@@ -1987,7 +1986,7 @@ static struct clk gpt11_ick = {
1987 1986
1988static struct clk gpt10_ick = { 1987static struct clk gpt10_ick = {
1989 .name = "gpt10_ick", 1988 .name = "gpt10_ick",
1990 .ops = &clkops_omap2_dflt_wait, 1989 .ops = &clkops_omap2_iclk_dflt_wait,
1991 .parent = &core_l4_ick, 1990 .parent = &core_l4_ick,
1992 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 1991 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
1993 .enable_bit = OMAP3430_EN_GPT10_SHIFT, 1992 .enable_bit = OMAP3430_EN_GPT10_SHIFT,
@@ -1997,7 +1996,7 @@ static struct clk gpt10_ick = {
1997 1996
1998static struct clk mcbsp5_ick = { 1997static struct clk mcbsp5_ick = {
1999 .name = "mcbsp5_ick", 1998 .name = "mcbsp5_ick",
2000 .ops = &clkops_omap2_dflt_wait, 1999 .ops = &clkops_omap2_iclk_dflt_wait,
2001 .parent = &core_l4_ick, 2000 .parent = &core_l4_ick,
2002 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2001 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2003 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT, 2002 .enable_bit = OMAP3430_EN_MCBSP5_SHIFT,
@@ -2007,7 +2006,7 @@ static struct clk mcbsp5_ick = {
2007 2006
2008static struct clk mcbsp1_ick = { 2007static struct clk mcbsp1_ick = {
2009 .name = "mcbsp1_ick", 2008 .name = "mcbsp1_ick",
2010 .ops = &clkops_omap2_dflt_wait, 2009 .ops = &clkops_omap2_iclk_dflt_wait,
2011 .parent = &core_l4_ick, 2010 .parent = &core_l4_ick,
2012 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2011 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2013 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT, 2012 .enable_bit = OMAP3430_EN_MCBSP1_SHIFT,
@@ -2017,7 +2016,7 @@ static struct clk mcbsp1_ick = {
2017 2016
2018static struct clk fac_ick = { 2017static struct clk fac_ick = {
2019 .name = "fac_ick", 2018 .name = "fac_ick",
2020 .ops = &clkops_omap2_dflt_wait, 2019 .ops = &clkops_omap2_iclk_dflt_wait,
2021 .parent = &core_l4_ick, 2020 .parent = &core_l4_ick,
2022 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2021 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2023 .enable_bit = OMAP3430ES1_EN_FAC_SHIFT, 2022 .enable_bit = OMAP3430ES1_EN_FAC_SHIFT,
@@ -2027,7 +2026,7 @@ static struct clk fac_ick = {
2027 2026
2028static struct clk mailboxes_ick = { 2027static struct clk mailboxes_ick = {
2029 .name = "mailboxes_ick", 2028 .name = "mailboxes_ick",
2030 .ops = &clkops_omap2_dflt_wait, 2029 .ops = &clkops_omap2_iclk_dflt_wait,
2031 .parent = &core_l4_ick, 2030 .parent = &core_l4_ick,
2032 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2031 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2033 .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT, 2032 .enable_bit = OMAP3430_EN_MAILBOXES_SHIFT,
@@ -2037,7 +2036,7 @@ static struct clk mailboxes_ick = {
2037 2036
2038static struct clk omapctrl_ick = { 2037static struct clk omapctrl_ick = {
2039 .name = "omapctrl_ick", 2038 .name = "omapctrl_ick",
2040 .ops = &clkops_omap2_dflt_wait, 2039 .ops = &clkops_omap2_iclk_dflt_wait,
2041 .parent = &core_l4_ick, 2040 .parent = &core_l4_ick,
2042 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2041 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2043 .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, 2042 .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT,
@@ -2057,7 +2056,7 @@ static struct clk ssi_l4_ick = {
2057 2056
2058static struct clk ssi_ick_3430es1 = { 2057static struct clk ssi_ick_3430es1 = {
2059 .name = "ssi_ick", 2058 .name = "ssi_ick",
2060 .ops = &clkops_omap2_dflt, 2059 .ops = &clkops_omap2_iclk_dflt,
2061 .parent = &ssi_l4_ick, 2060 .parent = &ssi_l4_ick,
2062 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2061 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2063 .enable_bit = OMAP3430_EN_SSI_SHIFT, 2062 .enable_bit = OMAP3430_EN_SSI_SHIFT,
@@ -2067,7 +2066,7 @@ static struct clk ssi_ick_3430es1 = {
2067 2066
2068static struct clk ssi_ick_3430es2 = { 2067static struct clk ssi_ick_3430es2 = {
2069 .name = "ssi_ick", 2068 .name = "ssi_ick",
2070 .ops = &clkops_omap3430es2_ssi_wait, 2069 .ops = &clkops_omap3430es2_iclk_ssi_wait,
2071 .parent = &ssi_l4_ick, 2070 .parent = &ssi_l4_ick,
2072 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2071 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
2073 .enable_bit = OMAP3430_EN_SSI_SHIFT, 2072 .enable_bit = OMAP3430_EN_SSI_SHIFT,
@@ -2085,7 +2084,7 @@ static const struct clksel usb_l4_clksel[] = {
2085 2084
2086static struct clk usb_l4_ick = { 2085static struct clk usb_l4_ick = {
2087 .name = "usb_l4_ick", 2086 .name = "usb_l4_ick",
2088 .ops = &clkops_omap2_dflt_wait, 2087 .ops = &clkops_omap2_iclk_dflt_wait,
2089 .parent = &l4_ick, 2088 .parent = &l4_ick,
2090 .init = &omap2_init_clksel_parent, 2089 .init = &omap2_init_clksel_parent,
2091 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 2090 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
@@ -2107,7 +2106,7 @@ static struct clk security_l4_ick2 = {
2107 2106
2108static struct clk aes1_ick = { 2107static struct clk aes1_ick = {
2109 .name = "aes1_ick", 2108 .name = "aes1_ick",
2110 .ops = &clkops_omap2_dflt_wait, 2109 .ops = &clkops_omap2_iclk_dflt_wait,
2111 .parent = &security_l4_ick2, 2110 .parent = &security_l4_ick2,
2112 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2111 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2113 .enable_bit = OMAP3430_EN_AES1_SHIFT, 2112 .enable_bit = OMAP3430_EN_AES1_SHIFT,
@@ -2116,7 +2115,7 @@ static struct clk aes1_ick = {
2116 2115
2117static struct clk rng_ick = { 2116static struct clk rng_ick = {
2118 .name = "rng_ick", 2117 .name = "rng_ick",
2119 .ops = &clkops_omap2_dflt_wait, 2118 .ops = &clkops_omap2_iclk_dflt_wait,
2120 .parent = &security_l4_ick2, 2119 .parent = &security_l4_ick2,
2121 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2120 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2122 .enable_bit = OMAP3430_EN_RNG_SHIFT, 2121 .enable_bit = OMAP3430_EN_RNG_SHIFT,
@@ -2125,7 +2124,7 @@ static struct clk rng_ick = {
2125 2124
2126static struct clk sha11_ick = { 2125static struct clk sha11_ick = {
2127 .name = "sha11_ick", 2126 .name = "sha11_ick",
2128 .ops = &clkops_omap2_dflt_wait, 2127 .ops = &clkops_omap2_iclk_dflt_wait,
2129 .parent = &security_l4_ick2, 2128 .parent = &security_l4_ick2,
2130 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2129 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2131 .enable_bit = OMAP3430_EN_SHA11_SHIFT, 2130 .enable_bit = OMAP3430_EN_SHA11_SHIFT,
@@ -2134,7 +2133,7 @@ static struct clk sha11_ick = {
2134 2133
2135static struct clk des1_ick = { 2134static struct clk des1_ick = {
2136 .name = "des1_ick", 2135 .name = "des1_ick",
2137 .ops = &clkops_omap2_dflt_wait, 2136 .ops = &clkops_omap2_iclk_dflt_wait,
2138 .parent = &security_l4_ick2, 2137 .parent = &security_l4_ick2,
2139 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2), 2138 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN2),
2140 .enable_bit = OMAP3430_EN_DES1_SHIFT, 2139 .enable_bit = OMAP3430_EN_DES1_SHIFT,
@@ -2195,7 +2194,7 @@ static struct clk dss2_alwon_fck = {
2195static struct clk dss_ick_3430es1 = { 2194static struct clk dss_ick_3430es1 = {
2196 /* Handles both L3 and L4 clocks */ 2195 /* Handles both L3 and L4 clocks */
2197 .name = "dss_ick", 2196 .name = "dss_ick",
2198 .ops = &clkops_omap2_dflt, 2197 .ops = &clkops_omap2_iclk_dflt,
2199 .parent = &l4_ick, 2198 .parent = &l4_ick,
2200 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), 2199 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
2201 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, 2200 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
@@ -2206,7 +2205,7 @@ static struct clk dss_ick_3430es1 = {
2206static struct clk dss_ick_3430es2 = { 2205static struct clk dss_ick_3430es2 = {
2207 /* Handles both L3 and L4 clocks */ 2206 /* Handles both L3 and L4 clocks */
2208 .name = "dss_ick", 2207 .name = "dss_ick",
2209 .ops = &clkops_omap3430es2_dss_usbhost_wait, 2208 .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait,
2210 .parent = &l4_ick, 2209 .parent = &l4_ick,
2211 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN), 2210 .enable_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_ICLKEN),
2212 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT, 2211 .enable_bit = OMAP3430_CM_ICLKEN_DSS_EN_DSS_SHIFT,
@@ -2229,7 +2228,7 @@ static struct clk cam_mclk = {
2229static struct clk cam_ick = { 2228static struct clk cam_ick = {
2230 /* Handles both L3 and L4 clocks */ 2229 /* Handles both L3 and L4 clocks */
2231 .name = "cam_ick", 2230 .name = "cam_ick",
2232 .ops = &clkops_omap2_dflt, 2231 .ops = &clkops_omap2_iclk_dflt,
2233 .parent = &l4_ick, 2232 .parent = &l4_ick,
2234 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN), 2233 .enable_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_ICLKEN),
2235 .enable_bit = OMAP3430_EN_CAM_SHIFT, 2234 .enable_bit = OMAP3430_EN_CAM_SHIFT,
@@ -2272,7 +2271,7 @@ static struct clk usbhost_48m_fck = {
2272static struct clk usbhost_ick = { 2271static struct clk usbhost_ick = {
2273 /* Handles both L3 and L4 clocks */ 2272 /* Handles both L3 and L4 clocks */
2274 .name = "usbhost_ick", 2273 .name = "usbhost_ick",
2275 .ops = &clkops_omap3430es2_dss_usbhost_wait, 2274 .ops = &clkops_omap3430es2_iclk_dss_usbhost_wait,
2276 .parent = &l4_ick, 2275 .parent = &l4_ick,
2277 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN), 2276 .enable_reg = OMAP_CM_REGADDR(OMAP3430ES2_USBHOST_MOD, CM_ICLKEN),
2278 .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT, 2277 .enable_bit = OMAP3430ES2_EN_USBHOST_SHIFT,
@@ -2372,7 +2371,7 @@ static struct clk wkup_l4_ick = {
2372/* Never specifically named in the TRM, so we have to infer a likely name */ 2371/* Never specifically named in the TRM, so we have to infer a likely name */
2373static struct clk usim_ick = { 2372static struct clk usim_ick = {
2374 .name = "usim_ick", 2373 .name = "usim_ick",
2375 .ops = &clkops_omap2_dflt_wait, 2374 .ops = &clkops_omap2_iclk_dflt_wait,
2376 .parent = &wkup_l4_ick, 2375 .parent = &wkup_l4_ick,
2377 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2376 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2378 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT, 2377 .enable_bit = OMAP3430ES2_EN_USIMOCP_SHIFT,
@@ -2382,7 +2381,7 @@ static struct clk usim_ick = {
2382 2381
2383static struct clk wdt2_ick = { 2382static struct clk wdt2_ick = {
2384 .name = "wdt2_ick", 2383 .name = "wdt2_ick",
2385 .ops = &clkops_omap2_dflt_wait, 2384 .ops = &clkops_omap2_iclk_dflt_wait,
2386 .parent = &wkup_l4_ick, 2385 .parent = &wkup_l4_ick,
2387 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2386 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2388 .enable_bit = OMAP3430_EN_WDT2_SHIFT, 2387 .enable_bit = OMAP3430_EN_WDT2_SHIFT,
@@ -2392,7 +2391,7 @@ static struct clk wdt2_ick = {
2392 2391
2393static struct clk wdt1_ick = { 2392static struct clk wdt1_ick = {
2394 .name = "wdt1_ick", 2393 .name = "wdt1_ick",
2395 .ops = &clkops_omap2_dflt_wait, 2394 .ops = &clkops_omap2_iclk_dflt_wait,
2396 .parent = &wkup_l4_ick, 2395 .parent = &wkup_l4_ick,
2397 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2396 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2398 .enable_bit = OMAP3430_EN_WDT1_SHIFT, 2397 .enable_bit = OMAP3430_EN_WDT1_SHIFT,
@@ -2402,7 +2401,7 @@ static struct clk wdt1_ick = {
2402 2401
2403static struct clk gpio1_ick = { 2402static struct clk gpio1_ick = {
2404 .name = "gpio1_ick", 2403 .name = "gpio1_ick",
2405 .ops = &clkops_omap2_dflt_wait, 2404 .ops = &clkops_omap2_iclk_dflt_wait,
2406 .parent = &wkup_l4_ick, 2405 .parent = &wkup_l4_ick,
2407 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2406 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2408 .enable_bit = OMAP3430_EN_GPIO1_SHIFT, 2407 .enable_bit = OMAP3430_EN_GPIO1_SHIFT,
@@ -2412,7 +2411,7 @@ static struct clk gpio1_ick = {
2412 2411
2413static struct clk omap_32ksync_ick = { 2412static struct clk omap_32ksync_ick = {
2414 .name = "omap_32ksync_ick", 2413 .name = "omap_32ksync_ick",
2415 .ops = &clkops_omap2_dflt_wait, 2414 .ops = &clkops_omap2_iclk_dflt_wait,
2416 .parent = &wkup_l4_ick, 2415 .parent = &wkup_l4_ick,
2417 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2416 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2418 .enable_bit = OMAP3430_EN_32KSYNC_SHIFT, 2417 .enable_bit = OMAP3430_EN_32KSYNC_SHIFT,
@@ -2423,7 +2422,7 @@ static struct clk omap_32ksync_ick = {
2423/* XXX This clock no longer exists in 3430 TRM rev F */ 2422/* XXX This clock no longer exists in 3430 TRM rev F */
2424static struct clk gpt12_ick = { 2423static struct clk gpt12_ick = {
2425 .name = "gpt12_ick", 2424 .name = "gpt12_ick",
2426 .ops = &clkops_omap2_dflt_wait, 2425 .ops = &clkops_omap2_iclk_dflt_wait,
2427 .parent = &wkup_l4_ick, 2426 .parent = &wkup_l4_ick,
2428 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2427 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2429 .enable_bit = OMAP3430_EN_GPT12_SHIFT, 2428 .enable_bit = OMAP3430_EN_GPT12_SHIFT,
@@ -2433,7 +2432,7 @@ static struct clk gpt12_ick = {
2433 2432
2434static struct clk gpt1_ick = { 2433static struct clk gpt1_ick = {
2435 .name = "gpt1_ick", 2434 .name = "gpt1_ick",
2436 .ops = &clkops_omap2_dflt_wait, 2435 .ops = &clkops_omap2_iclk_dflt_wait,
2437 .parent = &wkup_l4_ick, 2436 .parent = &wkup_l4_ick,
2438 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN), 2437 .enable_reg = OMAP_CM_REGADDR(WKUP_MOD, CM_ICLKEN),
2439 .enable_bit = OMAP3430_EN_GPT1_SHIFT, 2438 .enable_bit = OMAP3430_EN_GPT1_SHIFT,
@@ -2663,7 +2662,7 @@ static struct clk per_l4_ick = {
2663 2662
2664static struct clk gpio6_ick = { 2663static struct clk gpio6_ick = {
2665 .name = "gpio6_ick", 2664 .name = "gpio6_ick",
2666 .ops = &clkops_omap2_dflt_wait, 2665 .ops = &clkops_omap2_iclk_dflt_wait,
2667 .parent = &per_l4_ick, 2666 .parent = &per_l4_ick,
2668 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2667 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2669 .enable_bit = OMAP3430_EN_GPIO6_SHIFT, 2668 .enable_bit = OMAP3430_EN_GPIO6_SHIFT,
@@ -2673,7 +2672,7 @@ static struct clk gpio6_ick = {
2673 2672
2674static struct clk gpio5_ick = { 2673static struct clk gpio5_ick = {
2675 .name = "gpio5_ick", 2674 .name = "gpio5_ick",
2676 .ops = &clkops_omap2_dflt_wait, 2675 .ops = &clkops_omap2_iclk_dflt_wait,
2677 .parent = &per_l4_ick, 2676 .parent = &per_l4_ick,
2678 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2677 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2679 .enable_bit = OMAP3430_EN_GPIO5_SHIFT, 2678 .enable_bit = OMAP3430_EN_GPIO5_SHIFT,
@@ -2683,7 +2682,7 @@ static struct clk gpio5_ick = {
2683 2682
2684static struct clk gpio4_ick = { 2683static struct clk gpio4_ick = {
2685 .name = "gpio4_ick", 2684 .name = "gpio4_ick",
2686 .ops = &clkops_omap2_dflt_wait, 2685 .ops = &clkops_omap2_iclk_dflt_wait,
2687 .parent = &per_l4_ick, 2686 .parent = &per_l4_ick,
2688 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2687 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2689 .enable_bit = OMAP3430_EN_GPIO4_SHIFT, 2688 .enable_bit = OMAP3430_EN_GPIO4_SHIFT,
@@ -2693,7 +2692,7 @@ static struct clk gpio4_ick = {
2693 2692
2694static struct clk gpio3_ick = { 2693static struct clk gpio3_ick = {
2695 .name = "gpio3_ick", 2694 .name = "gpio3_ick",
2696 .ops = &clkops_omap2_dflt_wait, 2695 .ops = &clkops_omap2_iclk_dflt_wait,
2697 .parent = &per_l4_ick, 2696 .parent = &per_l4_ick,
2698 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2697 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2699 .enable_bit = OMAP3430_EN_GPIO3_SHIFT, 2698 .enable_bit = OMAP3430_EN_GPIO3_SHIFT,
@@ -2703,7 +2702,7 @@ static struct clk gpio3_ick = {
2703 2702
2704static struct clk gpio2_ick = { 2703static struct clk gpio2_ick = {
2705 .name = "gpio2_ick", 2704 .name = "gpio2_ick",
2706 .ops = &clkops_omap2_dflt_wait, 2705 .ops = &clkops_omap2_iclk_dflt_wait,
2707 .parent = &per_l4_ick, 2706 .parent = &per_l4_ick,
2708 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2707 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2709 .enable_bit = OMAP3430_EN_GPIO2_SHIFT, 2708 .enable_bit = OMAP3430_EN_GPIO2_SHIFT,
@@ -2713,7 +2712,7 @@ static struct clk gpio2_ick = {
2713 2712
2714static struct clk wdt3_ick = { 2713static struct clk wdt3_ick = {
2715 .name = "wdt3_ick", 2714 .name = "wdt3_ick",
2716 .ops = &clkops_omap2_dflt_wait, 2715 .ops = &clkops_omap2_iclk_dflt_wait,
2717 .parent = &per_l4_ick, 2716 .parent = &per_l4_ick,
2718 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2717 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2719 .enable_bit = OMAP3430_EN_WDT3_SHIFT, 2718 .enable_bit = OMAP3430_EN_WDT3_SHIFT,
@@ -2723,7 +2722,7 @@ static struct clk wdt3_ick = {
2723 2722
2724static struct clk uart3_ick = { 2723static struct clk uart3_ick = {
2725 .name = "uart3_ick", 2724 .name = "uart3_ick",
2726 .ops = &clkops_omap2_dflt_wait, 2725 .ops = &clkops_omap2_iclk_dflt_wait,
2727 .parent = &per_l4_ick, 2726 .parent = &per_l4_ick,
2728 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2727 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2729 .enable_bit = OMAP3430_EN_UART3_SHIFT, 2728 .enable_bit = OMAP3430_EN_UART3_SHIFT,
@@ -2733,7 +2732,7 @@ static struct clk uart3_ick = {
2733 2732
2734static struct clk uart4_ick = { 2733static struct clk uart4_ick = {
2735 .name = "uart4_ick", 2734 .name = "uart4_ick",
2736 .ops = &clkops_omap2_dflt_wait, 2735 .ops = &clkops_omap2_iclk_dflt_wait,
2737 .parent = &per_l4_ick, 2736 .parent = &per_l4_ick,
2738 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2737 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2739 .enable_bit = OMAP3630_EN_UART4_SHIFT, 2738 .enable_bit = OMAP3630_EN_UART4_SHIFT,
@@ -2743,7 +2742,7 @@ static struct clk uart4_ick = {
2743 2742
2744static struct clk gpt9_ick = { 2743static struct clk gpt9_ick = {
2745 .name = "gpt9_ick", 2744 .name = "gpt9_ick",
2746 .ops = &clkops_omap2_dflt_wait, 2745 .ops = &clkops_omap2_iclk_dflt_wait,
2747 .parent = &per_l4_ick, 2746 .parent = &per_l4_ick,
2748 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2747 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2749 .enable_bit = OMAP3430_EN_GPT9_SHIFT, 2748 .enable_bit = OMAP3430_EN_GPT9_SHIFT,
@@ -2753,7 +2752,7 @@ static struct clk gpt9_ick = {
2753 2752
2754static struct clk gpt8_ick = { 2753static struct clk gpt8_ick = {
2755 .name = "gpt8_ick", 2754 .name = "gpt8_ick",
2756 .ops = &clkops_omap2_dflt_wait, 2755 .ops = &clkops_omap2_iclk_dflt_wait,
2757 .parent = &per_l4_ick, 2756 .parent = &per_l4_ick,
2758 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2757 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2759 .enable_bit = OMAP3430_EN_GPT8_SHIFT, 2758 .enable_bit = OMAP3430_EN_GPT8_SHIFT,
@@ -2763,7 +2762,7 @@ static struct clk gpt8_ick = {
2763 2762
2764static struct clk gpt7_ick = { 2763static struct clk gpt7_ick = {
2765 .name = "gpt7_ick", 2764 .name = "gpt7_ick",
2766 .ops = &clkops_omap2_dflt_wait, 2765 .ops = &clkops_omap2_iclk_dflt_wait,
2767 .parent = &per_l4_ick, 2766 .parent = &per_l4_ick,
2768 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2767 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2769 .enable_bit = OMAP3430_EN_GPT7_SHIFT, 2768 .enable_bit = OMAP3430_EN_GPT7_SHIFT,
@@ -2773,7 +2772,7 @@ static struct clk gpt7_ick = {
2773 2772
2774static struct clk gpt6_ick = { 2773static struct clk gpt6_ick = {
2775 .name = "gpt6_ick", 2774 .name = "gpt6_ick",
2776 .ops = &clkops_omap2_dflt_wait, 2775 .ops = &clkops_omap2_iclk_dflt_wait,
2777 .parent = &per_l4_ick, 2776 .parent = &per_l4_ick,
2778 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2777 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2779 .enable_bit = OMAP3430_EN_GPT6_SHIFT, 2778 .enable_bit = OMAP3430_EN_GPT6_SHIFT,
@@ -2783,7 +2782,7 @@ static struct clk gpt6_ick = {
2783 2782
2784static struct clk gpt5_ick = { 2783static struct clk gpt5_ick = {
2785 .name = "gpt5_ick", 2784 .name = "gpt5_ick",
2786 .ops = &clkops_omap2_dflt_wait, 2785 .ops = &clkops_omap2_iclk_dflt_wait,
2787 .parent = &per_l4_ick, 2786 .parent = &per_l4_ick,
2788 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2787 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2789 .enable_bit = OMAP3430_EN_GPT5_SHIFT, 2788 .enable_bit = OMAP3430_EN_GPT5_SHIFT,
@@ -2793,7 +2792,7 @@ static struct clk gpt5_ick = {
2793 2792
2794static struct clk gpt4_ick = { 2793static struct clk gpt4_ick = {
2795 .name = "gpt4_ick", 2794 .name = "gpt4_ick",
2796 .ops = &clkops_omap2_dflt_wait, 2795 .ops = &clkops_omap2_iclk_dflt_wait,
2797 .parent = &per_l4_ick, 2796 .parent = &per_l4_ick,
2798 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2797 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2799 .enable_bit = OMAP3430_EN_GPT4_SHIFT, 2798 .enable_bit = OMAP3430_EN_GPT4_SHIFT,
@@ -2803,7 +2802,7 @@ static struct clk gpt4_ick = {
2803 2802
2804static struct clk gpt3_ick = { 2803static struct clk gpt3_ick = {
2805 .name = "gpt3_ick", 2804 .name = "gpt3_ick",
2806 .ops = &clkops_omap2_dflt_wait, 2805 .ops = &clkops_omap2_iclk_dflt_wait,
2807 .parent = &per_l4_ick, 2806 .parent = &per_l4_ick,
2808 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2807 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2809 .enable_bit = OMAP3430_EN_GPT3_SHIFT, 2808 .enable_bit = OMAP3430_EN_GPT3_SHIFT,
@@ -2813,7 +2812,7 @@ static struct clk gpt3_ick = {
2813 2812
2814static struct clk gpt2_ick = { 2813static struct clk gpt2_ick = {
2815 .name = "gpt2_ick", 2814 .name = "gpt2_ick",
2816 .ops = &clkops_omap2_dflt_wait, 2815 .ops = &clkops_omap2_iclk_dflt_wait,
2817 .parent = &per_l4_ick, 2816 .parent = &per_l4_ick,
2818 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2817 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2819 .enable_bit = OMAP3430_EN_GPT2_SHIFT, 2818 .enable_bit = OMAP3430_EN_GPT2_SHIFT,
@@ -2823,7 +2822,7 @@ static struct clk gpt2_ick = {
2823 2822
2824static struct clk mcbsp2_ick = { 2823static struct clk mcbsp2_ick = {
2825 .name = "mcbsp2_ick", 2824 .name = "mcbsp2_ick",
2826 .ops = &clkops_omap2_dflt_wait, 2825 .ops = &clkops_omap2_iclk_dflt_wait,
2827 .parent = &per_l4_ick, 2826 .parent = &per_l4_ick,
2828 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2827 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2829 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT, 2828 .enable_bit = OMAP3430_EN_MCBSP2_SHIFT,
@@ -2833,7 +2832,7 @@ static struct clk mcbsp2_ick = {
2833 2832
2834static struct clk mcbsp3_ick = { 2833static struct clk mcbsp3_ick = {
2835 .name = "mcbsp3_ick", 2834 .name = "mcbsp3_ick",
2836 .ops = &clkops_omap2_dflt_wait, 2835 .ops = &clkops_omap2_iclk_dflt_wait,
2837 .parent = &per_l4_ick, 2836 .parent = &per_l4_ick,
2838 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2837 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2839 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT, 2838 .enable_bit = OMAP3430_EN_MCBSP3_SHIFT,
@@ -2843,7 +2842,7 @@ static struct clk mcbsp3_ick = {
2843 2842
2844static struct clk mcbsp4_ick = { 2843static struct clk mcbsp4_ick = {
2845 .name = "mcbsp4_ick", 2844 .name = "mcbsp4_ick",
2846 .ops = &clkops_omap2_dflt_wait, 2845 .ops = &clkops_omap2_iclk_dflt_wait,
2847 .parent = &per_l4_ick, 2846 .parent = &per_l4_ick,
2848 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN), 2847 .enable_reg = OMAP_CM_REGADDR(OMAP3430_PER_MOD, CM_ICLKEN),
2849 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT, 2848 .enable_bit = OMAP3430_EN_MCBSP4_SHIFT,
@@ -3186,7 +3185,7 @@ static struct clk vpfe_fck = {
3186 */ 3185 */
3187static struct clk uart4_ick_am35xx = { 3186static struct clk uart4_ick_am35xx = {
3188 .name = "uart4_ick", 3187 .name = "uart4_ick",
3189 .ops = &clkops_omap2_dflt_wait, 3188 .ops = &clkops_omap2_iclk_dflt_wait,
3190 .parent = &core_l4_ick, 3189 .parent = &core_l4_ick,
3191 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), 3190 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1),
3192 .enable_bit = AM35XX_EN_UART4_SHIFT, 3191 .enable_bit = AM35XX_EN_UART4_SHIFT,
@@ -3290,10 +3289,10 @@ static struct omap_clk omap3xxx_clks[] = {
3290 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX), 3289 CLK("omap-mcbsp.1", "prcm_fck", &core_96m_fck, CK_3XXX),
3291 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX), 3290 CLK("omap-mcbsp.5", "prcm_fck", &core_96m_fck, CK_3XXX),
3292 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX), 3291 CLK(NULL, "core_96m_fck", &core_96m_fck, CK_3XXX),
3293 CLK("mmci-omap-hs.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3292 CLK("omap_hsmmc.2", "fck", &mmchs3_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3294 CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX), 3293 CLK("omap_hsmmc.1", "fck", &mmchs2_fck, CK_3XXX),
3295 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX), 3294 CLK(NULL, "mspro_fck", &mspro_fck, CK_34XX | CK_36XX),
3296 CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_3XXX), 3295 CLK("omap_hsmmc.0", "fck", &mmchs1_fck, CK_3XXX),
3297 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX), 3296 CLK("omap_i2c.3", "fck", &i2c3_fck, CK_3XXX),
3298 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX), 3297 CLK("omap_i2c.2", "fck", &i2c2_fck, CK_3XXX),
3299 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX), 3298 CLK("omap_i2c.1", "fck", &i2c1_fck, CK_3XXX),
@@ -3323,13 +3322,13 @@ static struct omap_clk omap3xxx_clks[] = {
3323 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX), 3322 CLK(NULL, "core_l4_ick", &core_l4_ick, CK_3XXX),
3324 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3323 CLK(NULL, "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3325 CLK("ehci-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3324 CLK("ehci-omap.0", "usbtll_ick", &usbtll_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3326 CLK("mmci-omap-hs.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), 3325 CLK("omap_hsmmc.2", "ick", &mmchs3_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX),
3327 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX), 3326 CLK(NULL, "icr_ick", &icr_ick, CK_34XX | CK_36XX),
3328 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX), 3327 CLK("omap-aes", "ick", &aes2_ick, CK_34XX | CK_36XX),
3329 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX), 3328 CLK("omap-sham", "ick", &sha12_ick, CK_34XX | CK_36XX),
3330 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX), 3329 CLK(NULL, "des2_ick", &des2_ick, CK_34XX | CK_36XX),
3331 CLK("mmci-omap-hs.1", "ick", &mmchs2_ick, CK_3XXX), 3330 CLK("omap_hsmmc.1", "ick", &mmchs2_ick, CK_3XXX),
3332 CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_3XXX), 3331 CLK("omap_hsmmc.0", "ick", &mmchs1_ick, CK_3XXX),
3333 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX), 3332 CLK(NULL, "mspro_ick", &mspro_ick, CK_34XX | CK_36XX),
3334 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX), 3333 CLK("omap_hdq.0", "ick", &hdq_ick, CK_3XXX),
3335 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX), 3334 CLK("omap2_mcspi.4", "ick", &mcspi4_ick, CK_3XXX),
@@ -3471,6 +3470,9 @@ int __init omap3xxx_clk_init(void)
3471 } else if (cpu_is_omap3630()) { 3470 } else if (cpu_is_omap3630()) {
3472 cpu_mask = (RATE_IN_34XX | RATE_IN_36XX); 3471 cpu_mask = (RATE_IN_34XX | RATE_IN_36XX);
3473 cpu_clkflg = CK_36XX; 3472 cpu_clkflg = CK_36XX;
3473 } else if (cpu_is_ti816x()) {
3474 cpu_mask = RATE_IN_TI816X;
3475 cpu_clkflg = CK_TI816X;
3474 } else if (cpu_is_omap34xx()) { 3476 } else if (cpu_is_omap34xx()) {
3475 if (omap_rev() == OMAP3430_REV_ES1_0) { 3477 if (omap_rev() == OMAP3430_REV_ES1_0) {
3476 cpu_mask = RATE_IN_3430ES1; 3478 cpu_mask = RATE_IN_3430ES1;
@@ -3535,6 +3537,9 @@ int __init omap3xxx_clk_init(void)
3535 omap2_init_clk_clkdm(c->lk.clk); 3537 omap2_init_clk_clkdm(c->lk.clk);
3536 } 3538 }
3537 3539
3540 /* Disable autoidle on all clocks; let the PM code enable it later */
3541 omap_clk_disable_autoidle_all();
3542
3538 recalculate_root_clocks(); 3543 recalculate_root_clocks();
3539 3544
3540 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", 3545 pr_info("Clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
@@ -3548,9 +3553,10 @@ int __init omap3xxx_clk_init(void)
3548 clk_enable_init_clocks(); 3553 clk_enable_init_clocks();
3549 3554
3550 /* 3555 /*
3551 * Lock DPLL5 and put it in autoidle. 3556 * Lock DPLL5 -- here only until other device init code can
3557 * handle this
3552 */ 3558 */
3553 if (omap_rev() >= OMAP3430_REV_ES2_0) 3559 if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0))
3554 omap3_clk_lock_dpll5(); 3560 omap3_clk_lock_dpll5();
3555 3561
3556 /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */ 3562 /* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index de9ec8ddd2ae..f1fedb71ae08 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -278,8 +278,10 @@ static struct clk dpll_abe_ck = {
278static struct clk dpll_abe_x2_ck = { 278static struct clk dpll_abe_x2_ck = {
279 .name = "dpll_abe_x2_ck", 279 .name = "dpll_abe_x2_ck",
280 .parent = &dpll_abe_ck, 280 .parent = &dpll_abe_ck,
281 .ops = &clkops_null, 281 .flags = CLOCK_CLKOUTX2,
282 .ops = &clkops_omap4_dpllmx_ops,
282 .recalc = &omap3_clkoutx2_recalc, 283 .recalc = &omap3_clkoutx2_recalc,
284 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
283}; 285};
284 286
285static const struct clksel_rate div31_1to31_rates[] = { 287static const struct clksel_rate div31_1to31_rates[] = {
@@ -328,7 +330,7 @@ static struct clk dpll_abe_m2x2_ck = {
328 .clksel = dpll_abe_m2x2_div, 330 .clksel = dpll_abe_m2x2_div,
329 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, 331 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
330 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 332 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
331 .ops = &clkops_null, 333 .ops = &clkops_omap4_dpllmx_ops,
332 .recalc = &omap2_clksel_recalc, 334 .recalc = &omap2_clksel_recalc,
333 .round_rate = &omap2_clksel_round_rate, 335 .round_rate = &omap2_clksel_round_rate,
334 .set_rate = &omap2_clksel_set_rate, 336 .set_rate = &omap2_clksel_set_rate,
@@ -395,7 +397,7 @@ static struct clk dpll_abe_m3x2_ck = {
395 .clksel = dpll_abe_m2x2_div, 397 .clksel = dpll_abe_m2x2_div,
396 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE, 398 .clksel_reg = OMAP4430_CM_DIV_M3_DPLL_ABE,
397 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK, 399 .clksel_mask = OMAP4430_DPLL_CLKOUTHIF_DIV_MASK,
398 .ops = &clkops_null, 400 .ops = &clkops_omap4_dpllmx_ops,
399 .recalc = &omap2_clksel_recalc, 401 .recalc = &omap2_clksel_recalc,
400 .round_rate = &omap2_clksel_round_rate, 402 .round_rate = &omap2_clksel_round_rate,
401 .set_rate = &omap2_clksel_set_rate, 403 .set_rate = &omap2_clksel_set_rate,
@@ -443,13 +445,14 @@ static struct clk dpll_core_ck = {
443 .parent = &sys_clkin_ck, 445 .parent = &sys_clkin_ck,
444 .dpll_data = &dpll_core_dd, 446 .dpll_data = &dpll_core_dd,
445 .init = &omap2_init_dpll_parent, 447 .init = &omap2_init_dpll_parent,
446 .ops = &clkops_null, 448 .ops = &clkops_omap3_core_dpll_ops,
447 .recalc = &omap3_dpll_recalc, 449 .recalc = &omap3_dpll_recalc,
448}; 450};
449 451
450static struct clk dpll_core_x2_ck = { 452static struct clk dpll_core_x2_ck = {
451 .name = "dpll_core_x2_ck", 453 .name = "dpll_core_x2_ck",
452 .parent = &dpll_core_ck, 454 .parent = &dpll_core_ck,
455 .flags = CLOCK_CLKOUTX2,
453 .ops = &clkops_null, 456 .ops = &clkops_null,
454 .recalc = &omap3_clkoutx2_recalc, 457 .recalc = &omap3_clkoutx2_recalc,
455}; 458};
@@ -465,7 +468,7 @@ static struct clk dpll_core_m6x2_ck = {
465 .clksel = dpll_core_m6x2_div, 468 .clksel = dpll_core_m6x2_div,
466 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE, 469 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_CORE,
467 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 470 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
468 .ops = &clkops_null, 471 .ops = &clkops_omap4_dpllmx_ops,
469 .recalc = &omap2_clksel_recalc, 472 .recalc = &omap2_clksel_recalc,
470 .round_rate = &omap2_clksel_round_rate, 473 .round_rate = &omap2_clksel_round_rate,
471 .set_rate = &omap2_clksel_set_rate, 474 .set_rate = &omap2_clksel_set_rate,
@@ -495,7 +498,7 @@ static struct clk dpll_core_m2_ck = {
495 .clksel = dpll_core_m2_div, 498 .clksel = dpll_core_m2_div,
496 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE, 499 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_CORE,
497 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 500 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
498 .ops = &clkops_null, 501 .ops = &clkops_omap4_dpllmx_ops,
499 .recalc = &omap2_clksel_recalc, 502 .recalc = &omap2_clksel_recalc,
500 .round_rate = &omap2_clksel_round_rate, 503 .round_rate = &omap2_clksel_round_rate,
501 .set_rate = &omap2_clksel_set_rate, 504 .set_rate = &omap2_clksel_set_rate,
@@ -515,7 +518,7 @@ static struct clk dpll_core_m5x2_ck = {
515 .clksel = dpll_core_m6x2_div, 518 .clksel = dpll_core_m6x2_div,
516 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE, 519 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_CORE,
517 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 520 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
518 .ops = &clkops_null, 521 .ops = &clkops_omap4_dpllmx_ops,
519 .recalc = &omap2_clksel_recalc, 522 .recalc = &omap2_clksel_recalc,
520 .round_rate = &omap2_clksel_round_rate, 523 .round_rate = &omap2_clksel_round_rate,
521 .set_rate = &omap2_clksel_set_rate, 524 .set_rate = &omap2_clksel_set_rate,
@@ -581,7 +584,7 @@ static struct clk dpll_core_m4x2_ck = {
581 .clksel = dpll_core_m6x2_div, 584 .clksel = dpll_core_m6x2_div,
582 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE, 585 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_CORE,
583 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 586 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
584 .ops = &clkops_null, 587 .ops = &clkops_omap4_dpllmx_ops,
585 .recalc = &omap2_clksel_recalc, 588 .recalc = &omap2_clksel_recalc,
586 .round_rate = &omap2_clksel_round_rate, 589 .round_rate = &omap2_clksel_round_rate,
587 .set_rate = &omap2_clksel_set_rate, 590 .set_rate = &omap2_clksel_set_rate,
@@ -606,7 +609,7 @@ static struct clk dpll_abe_m2_ck = {
606 .clksel = dpll_abe_m2_div, 609 .clksel = dpll_abe_m2_div,
607 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE, 610 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_ABE,
608 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 611 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
609 .ops = &clkops_null, 612 .ops = &clkops_omap4_dpllmx_ops,
610 .recalc = &omap2_clksel_recalc, 613 .recalc = &omap2_clksel_recalc,
611 .round_rate = &omap2_clksel_round_rate, 614 .round_rate = &omap2_clksel_round_rate,
612 .set_rate = &omap2_clksel_set_rate, 615 .set_rate = &omap2_clksel_set_rate,
@@ -632,7 +635,7 @@ static struct clk dpll_core_m7x2_ck = {
632 .clksel = dpll_core_m6x2_div, 635 .clksel = dpll_core_m6x2_div,
633 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE, 636 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_CORE,
634 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 637 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
635 .ops = &clkops_null, 638 .ops = &clkops_omap4_dpllmx_ops,
636 .recalc = &omap2_clksel_recalc, 639 .recalc = &omap2_clksel_recalc,
637 .round_rate = &omap2_clksel_round_rate, 640 .round_rate = &omap2_clksel_round_rate,
638 .set_rate = &omap2_clksel_set_rate, 641 .set_rate = &omap2_clksel_set_rate,
@@ -689,6 +692,7 @@ static struct clk dpll_iva_ck = {
689static struct clk dpll_iva_x2_ck = { 692static struct clk dpll_iva_x2_ck = {
690 .name = "dpll_iva_x2_ck", 693 .name = "dpll_iva_x2_ck",
691 .parent = &dpll_iva_ck, 694 .parent = &dpll_iva_ck,
695 .flags = CLOCK_CLKOUTX2,
692 .ops = &clkops_null, 696 .ops = &clkops_null,
693 .recalc = &omap3_clkoutx2_recalc, 697 .recalc = &omap3_clkoutx2_recalc,
694}; 698};
@@ -704,7 +708,7 @@ static struct clk dpll_iva_m4x2_ck = {
704 .clksel = dpll_iva_m4x2_div, 708 .clksel = dpll_iva_m4x2_div,
705 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA, 709 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_IVA,
706 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 710 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
707 .ops = &clkops_null, 711 .ops = &clkops_omap4_dpllmx_ops,
708 .recalc = &omap2_clksel_recalc, 712 .recalc = &omap2_clksel_recalc,
709 .round_rate = &omap2_clksel_round_rate, 713 .round_rate = &omap2_clksel_round_rate,
710 .set_rate = &omap2_clksel_set_rate, 714 .set_rate = &omap2_clksel_set_rate,
@@ -716,7 +720,7 @@ static struct clk dpll_iva_m5x2_ck = {
716 .clksel = dpll_iva_m4x2_div, 720 .clksel = dpll_iva_m4x2_div,
717 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA, 721 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_IVA,
718 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 722 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
719 .ops = &clkops_null, 723 .ops = &clkops_omap4_dpllmx_ops,
720 .recalc = &omap2_clksel_recalc, 724 .recalc = &omap2_clksel_recalc,
721 .round_rate = &omap2_clksel_round_rate, 725 .round_rate = &omap2_clksel_round_rate,
722 .set_rate = &omap2_clksel_set_rate, 726 .set_rate = &omap2_clksel_set_rate,
@@ -764,7 +768,7 @@ static struct clk dpll_mpu_m2_ck = {
764 .clksel = dpll_mpu_m2_div, 768 .clksel = dpll_mpu_m2_div,
765 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU, 769 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_MPU,
766 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 770 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
767 .ops = &clkops_null, 771 .ops = &clkops_omap4_dpllmx_ops,
768 .recalc = &omap2_clksel_recalc, 772 .recalc = &omap2_clksel_recalc,
769 .round_rate = &omap2_clksel_round_rate, 773 .round_rate = &omap2_clksel_round_rate,
770 .set_rate = &omap2_clksel_set_rate, 774 .set_rate = &omap2_clksel_set_rate,
@@ -837,7 +841,7 @@ static struct clk dpll_per_m2_ck = {
837 .clksel = dpll_per_m2_div, 841 .clksel = dpll_per_m2_div,
838 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, 842 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
839 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 843 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
840 .ops = &clkops_null, 844 .ops = &clkops_omap4_dpllmx_ops,
841 .recalc = &omap2_clksel_recalc, 845 .recalc = &omap2_clksel_recalc,
842 .round_rate = &omap2_clksel_round_rate, 846 .round_rate = &omap2_clksel_round_rate,
843 .set_rate = &omap2_clksel_set_rate, 847 .set_rate = &omap2_clksel_set_rate,
@@ -846,8 +850,10 @@ static struct clk dpll_per_m2_ck = {
846static struct clk dpll_per_x2_ck = { 850static struct clk dpll_per_x2_ck = {
847 .name = "dpll_per_x2_ck", 851 .name = "dpll_per_x2_ck",
848 .parent = &dpll_per_ck, 852 .parent = &dpll_per_ck,
849 .ops = &clkops_null, 853 .flags = CLOCK_CLKOUTX2,
854 .ops = &clkops_omap4_dpllmx_ops,
850 .recalc = &omap3_clkoutx2_recalc, 855 .recalc = &omap3_clkoutx2_recalc,
856 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
851}; 857};
852 858
853static const struct clksel dpll_per_m2x2_div[] = { 859static const struct clksel dpll_per_m2x2_div[] = {
@@ -861,7 +867,7 @@ static struct clk dpll_per_m2x2_ck = {
861 .clksel = dpll_per_m2x2_div, 867 .clksel = dpll_per_m2x2_div,
862 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER, 868 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_PER,
863 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 869 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
864 .ops = &clkops_null, 870 .ops = &clkops_omap4_dpllmx_ops,
865 .recalc = &omap2_clksel_recalc, 871 .recalc = &omap2_clksel_recalc,
866 .round_rate = &omap2_clksel_round_rate, 872 .round_rate = &omap2_clksel_round_rate,
867 .set_rate = &omap2_clksel_set_rate, 873 .set_rate = &omap2_clksel_set_rate,
@@ -887,7 +893,7 @@ static struct clk dpll_per_m4x2_ck = {
887 .clksel = dpll_per_m2x2_div, 893 .clksel = dpll_per_m2x2_div,
888 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER, 894 .clksel_reg = OMAP4430_CM_DIV_M4_DPLL_PER,
889 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK, 895 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT1_DIV_MASK,
890 .ops = &clkops_null, 896 .ops = &clkops_omap4_dpllmx_ops,
891 .recalc = &omap2_clksel_recalc, 897 .recalc = &omap2_clksel_recalc,
892 .round_rate = &omap2_clksel_round_rate, 898 .round_rate = &omap2_clksel_round_rate,
893 .set_rate = &omap2_clksel_set_rate, 899 .set_rate = &omap2_clksel_set_rate,
@@ -899,7 +905,7 @@ static struct clk dpll_per_m5x2_ck = {
899 .clksel = dpll_per_m2x2_div, 905 .clksel = dpll_per_m2x2_div,
900 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER, 906 .clksel_reg = OMAP4430_CM_DIV_M5_DPLL_PER,
901 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK, 907 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT2_DIV_MASK,
902 .ops = &clkops_null, 908 .ops = &clkops_omap4_dpllmx_ops,
903 .recalc = &omap2_clksel_recalc, 909 .recalc = &omap2_clksel_recalc,
904 .round_rate = &omap2_clksel_round_rate, 910 .round_rate = &omap2_clksel_round_rate,
905 .set_rate = &omap2_clksel_set_rate, 911 .set_rate = &omap2_clksel_set_rate,
@@ -911,7 +917,7 @@ static struct clk dpll_per_m6x2_ck = {
911 .clksel = dpll_per_m2x2_div, 917 .clksel = dpll_per_m2x2_div,
912 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER, 918 .clksel_reg = OMAP4430_CM_DIV_M6_DPLL_PER,
913 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK, 919 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT3_DIV_MASK,
914 .ops = &clkops_null, 920 .ops = &clkops_omap4_dpllmx_ops,
915 .recalc = &omap2_clksel_recalc, 921 .recalc = &omap2_clksel_recalc,
916 .round_rate = &omap2_clksel_round_rate, 922 .round_rate = &omap2_clksel_round_rate,
917 .set_rate = &omap2_clksel_set_rate, 923 .set_rate = &omap2_clksel_set_rate,
@@ -923,7 +929,7 @@ static struct clk dpll_per_m7x2_ck = {
923 .clksel = dpll_per_m2x2_div, 929 .clksel = dpll_per_m2x2_div,
924 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER, 930 .clksel_reg = OMAP4430_CM_DIV_M7_DPLL_PER,
925 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK, 931 .clksel_mask = OMAP4430_HSDIVIDER_CLKOUT4_DIV_MASK,
926 .ops = &clkops_null, 932 .ops = &clkops_omap4_dpllmx_ops,
927 .recalc = &omap2_clksel_recalc, 933 .recalc = &omap2_clksel_recalc,
928 .round_rate = &omap2_clksel_round_rate, 934 .round_rate = &omap2_clksel_round_rate,
929 .set_rate = &omap2_clksel_set_rate, 935 .set_rate = &omap2_clksel_set_rate,
@@ -964,6 +970,7 @@ static struct clk dpll_unipro_ck = {
964static struct clk dpll_unipro_x2_ck = { 970static struct clk dpll_unipro_x2_ck = {
965 .name = "dpll_unipro_x2_ck", 971 .name = "dpll_unipro_x2_ck",
966 .parent = &dpll_unipro_ck, 972 .parent = &dpll_unipro_ck,
973 .flags = CLOCK_CLKOUTX2,
967 .ops = &clkops_null, 974 .ops = &clkops_null,
968 .recalc = &omap3_clkoutx2_recalc, 975 .recalc = &omap3_clkoutx2_recalc,
969}; 976};
@@ -979,7 +986,7 @@ static struct clk dpll_unipro_m2x2_ck = {
979 .clksel = dpll_unipro_m2x2_div, 986 .clksel = dpll_unipro_m2x2_div,
980 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO, 987 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_UNIPRO,
981 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK, 988 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_MASK,
982 .ops = &clkops_null, 989 .ops = &clkops_omap4_dpllmx_ops,
983 .recalc = &omap2_clksel_recalc, 990 .recalc = &omap2_clksel_recalc,
984 .round_rate = &omap2_clksel_round_rate, 991 .round_rate = &omap2_clksel_round_rate,
985 .set_rate = &omap2_clksel_set_rate, 992 .set_rate = &omap2_clksel_set_rate,
@@ -1028,7 +1035,8 @@ static struct clk dpll_usb_ck = {
1028static struct clk dpll_usb_clkdcoldo_ck = { 1035static struct clk dpll_usb_clkdcoldo_ck = {
1029 .name = "dpll_usb_clkdcoldo_ck", 1036 .name = "dpll_usb_clkdcoldo_ck",
1030 .parent = &dpll_usb_ck, 1037 .parent = &dpll_usb_ck,
1031 .ops = &clkops_null, 1038 .ops = &clkops_omap4_dpllmx_ops,
1039 .clksel_reg = OMAP4430_CM_CLKDCOLDO_DPLL_USB,
1032 .recalc = &followparent_recalc, 1040 .recalc = &followparent_recalc,
1033}; 1041};
1034 1042
@@ -1043,7 +1051,7 @@ static struct clk dpll_usb_m2_ck = {
1043 .clksel = dpll_usb_m2_div, 1051 .clksel = dpll_usb_m2_div,
1044 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB, 1052 .clksel_reg = OMAP4430_CM_DIV_M2_DPLL_USB,
1045 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK, 1053 .clksel_mask = OMAP4430_DPLL_CLKOUT_DIV_0_6_MASK,
1046 .ops = &clkops_null, 1054 .ops = &clkops_omap4_dpllmx_ops,
1047 .recalc = &omap2_clksel_recalc, 1055 .recalc = &omap2_clksel_recalc,
1048 .round_rate = &omap2_clksel_round_rate, 1056 .round_rate = &omap2_clksel_round_rate,
1049 .set_rate = &omap2_clksel_set_rate, 1057 .set_rate = &omap2_clksel_set_rate,
@@ -3158,11 +3166,11 @@ static struct omap_clk omap44xx_clks[] = {
3158 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X), 3166 CLK("omap2_mcspi.2", "fck", &mcspi2_fck, CK_443X),
3159 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X), 3167 CLK("omap2_mcspi.3", "fck", &mcspi3_fck, CK_443X),
3160 CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X), 3168 CLK("omap2_mcspi.4", "fck", &mcspi4_fck, CK_443X),
3161 CLK("mmci-omap-hs.0", "fck", &mmc1_fck, CK_443X), 3169 CLK("omap_hsmmc.0", "fck", &mmc1_fck, CK_443X),
3162 CLK("mmci-omap-hs.1", "fck", &mmc2_fck, CK_443X), 3170 CLK("omap_hsmmc.1", "fck", &mmc2_fck, CK_443X),
3163 CLK("mmci-omap-hs.2", "fck", &mmc3_fck, CK_443X), 3171 CLK("omap_hsmmc.2", "fck", &mmc3_fck, CK_443X),
3164 CLK("mmci-omap-hs.3", "fck", &mmc4_fck, CK_443X), 3172 CLK("omap_hsmmc.3", "fck", &mmc4_fck, CK_443X),
3165 CLK("mmci-omap-hs.4", "fck", &mmc5_fck, CK_443X), 3173 CLK("omap_hsmmc.4", "fck", &mmc5_fck, CK_443X),
3166 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X), 3174 CLK(NULL, "ocp2scp_usb_phy_phy_48m", &ocp2scp_usb_phy_phy_48m, CK_443X),
3167 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X), 3175 CLK(NULL, "ocp2scp_usb_phy_ick", &ocp2scp_usb_phy_ick, CK_443X),
3168 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X), 3176 CLK(NULL, "ocp_wp_noc_ick", &ocp_wp_noc_ick, CK_443X),
@@ -3245,11 +3253,11 @@ static struct omap_clk omap44xx_clks[] = {
3245 CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), 3253 CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X),
3246 CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), 3254 CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X),
3247 CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X), 3255 CLK("omap_i2c.4", "ick", &dummy_ck, CK_443X),
3248 CLK("mmci-omap-hs.0", "ick", &dummy_ck, CK_443X), 3256 CLK("omap_hsmmc.0", "ick", &dummy_ck, CK_443X),
3249 CLK("mmci-omap-hs.1", "ick", &dummy_ck, CK_443X), 3257 CLK("omap_hsmmc.1", "ick", &dummy_ck, CK_443X),
3250 CLK("mmci-omap-hs.2", "ick", &dummy_ck, CK_443X), 3258 CLK("omap_hsmmc.2", "ick", &dummy_ck, CK_443X),
3251 CLK("mmci-omap-hs.3", "ick", &dummy_ck, CK_443X), 3259 CLK("omap_hsmmc.3", "ick", &dummy_ck, CK_443X),
3252 CLK("mmci-omap-hs.4", "ick", &dummy_ck, CK_443X), 3260 CLK("omap_hsmmc.4", "ick", &dummy_ck, CK_443X),
3253 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X), 3261 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_443X),
3254 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X), 3262 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_443X),
3255 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X), 3263 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_443X),
@@ -3301,6 +3309,9 @@ int __init omap4xxx_clk_init(void)
3301 omap2_init_clk_clkdm(c->lk.clk); 3309 omap2_init_clk_clkdm(c->lk.clk);
3302 } 3310 }
3303 3311
3312 /* Disable autoidle on all clocks; let the PM code enable it later */
3313 omap_clk_disable_autoidle_all();
3314
3304 recalculate_root_clocks(); 3315 recalculate_root_clocks();
3305 3316
3306 /* 3317 /*
diff --git a/arch/arm/mach-omap2/clock_common_data.c b/arch/arm/mach-omap2/clock_common_data.c
index 1cf8131205fa..6424d46be14a 100644
--- a/arch/arm/mach-omap2/clock_common_data.c
+++ b/arch/arm/mach-omap2/clock_common_data.c
@@ -37,3 +37,9 @@ const struct clksel_rate gfx_l3_rates[] = {
37 { .div = 0 } 37 { .div = 0 }
38}; 38};
39 39
40const struct clksel_rate dsp_ick_rates[] = {
41 { .div = 1, .val = 1, .flags = RATE_IN_24XX },
42 { .div = 2, .val = 2, .flags = RATE_IN_24XX },
43 { .div = 3, .val = 3, .flags = RATE_IN_243X },
44 { .div = 0 },
45};
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 58e42f76603f..ab878545bd9b 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -26,17 +26,8 @@
26 26
27#include <linux/bitops.h> 27#include <linux/bitops.h>
28 28
29#include "prm2xxx_3xxx.h"
30#include "prm-regbits-24xx.h"
31#include "cm2xxx_3xxx.h"
32#include "cm-regbits-24xx.h"
33#include "cminst44xx.h"
34#include "prcm44xx.h"
35
36#include <plat/clock.h> 29#include <plat/clock.h>
37#include "powerdomain.h"
38#include "clockdomain.h" 30#include "clockdomain.h"
39#include <plat/prcm.h>
40 31
41/* clkdm_list contains all registered struct clockdomains */ 32/* clkdm_list contains all registered struct clockdomains */
42static LIST_HEAD(clkdm_list); 33static LIST_HEAD(clkdm_list);
@@ -44,6 +35,7 @@ static LIST_HEAD(clkdm_list);
44/* array of clockdomain deps to be added/removed when clkdm in hwsup mode */ 35/* array of clockdomain deps to be added/removed when clkdm in hwsup mode */
45static struct clkdm_autodep *autodeps; 36static struct clkdm_autodep *autodeps;
46 37
38static struct clkdm_ops *arch_clkdm;
47 39
48/* Private functions */ 40/* Private functions */
49 41
@@ -177,11 +169,11 @@ static void _autodep_lookup(struct clkdm_autodep *autodep)
177 * XXX autodeps are deprecated and should be removed at the earliest 169 * XXX autodeps are deprecated and should be removed at the earliest
178 * opportunity 170 * opportunity
179 */ 171 */
180static void _clkdm_add_autodeps(struct clockdomain *clkdm) 172void _clkdm_add_autodeps(struct clockdomain *clkdm)
181{ 173{
182 struct clkdm_autodep *autodep; 174 struct clkdm_autodep *autodep;
183 175
184 if (!autodeps) 176 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS)
185 return; 177 return;
186 178
187 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 179 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
@@ -211,11 +203,11 @@ static void _clkdm_add_autodeps(struct clockdomain *clkdm)
211 * XXX autodeps are deprecated and should be removed at the earliest 203 * XXX autodeps are deprecated and should be removed at the earliest
212 * opportunity 204 * opportunity
213 */ 205 */
214static void _clkdm_del_autodeps(struct clockdomain *clkdm) 206void _clkdm_del_autodeps(struct clockdomain *clkdm)
215{ 207{
216 struct clkdm_autodep *autodep; 208 struct clkdm_autodep *autodep;
217 209
218 if (!autodeps) 210 if (!autodeps || clkdm->flags & CLKDM_NO_AUTODEPS)
219 return; 211 return;
220 212
221 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) { 213 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) {
@@ -235,55 +227,29 @@ static void _clkdm_del_autodeps(struct clockdomain *clkdm)
235} 227}
236 228
237/** 229/**
238 * _enable_hwsup - place a clockdomain into hardware-supervised idle 230 * _resolve_clkdm_deps() - resolve clkdm_names in @clkdm_deps to clkdms
239 * @clkdm: struct clockdomain * 231 * @clkdm: clockdomain that we are resolving dependencies for
240 * 232 * @clkdm_deps: ptr to array of struct clkdm_deps to resolve
241 * Place the clockdomain into hardware-supervised idle mode. No return
242 * value.
243 * 233 *
244 * XXX Should this return an error if the clockdomain does not support 234 * Iterates through @clkdm_deps, looking up the struct clockdomain named by
245 * hardware-supervised idle mode? 235 * clkdm_name and storing the clockdomain pointer in the struct clkdm_dep.
246 */
247static void _enable_hwsup(struct clockdomain *clkdm)
248{
249 if (cpu_is_omap24xx())
250 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
251 clkdm->clktrctrl_mask);
252 else if (cpu_is_omap34xx())
253 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
254 clkdm->clktrctrl_mask);
255 else if (cpu_is_omap44xx())
256 return omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
257 clkdm->cm_inst,
258 clkdm->clkdm_offs);
259 else
260 BUG();
261}
262
263/**
264 * _disable_hwsup - place a clockdomain into software-supervised idle
265 * @clkdm: struct clockdomain *
266 *
267 * Place the clockdomain @clkdm into software-supervised idle mode.
268 * No return value. 236 * No return value.
269 *
270 * XXX Should this return an error if the clockdomain does not support
271 * software-supervised idle mode?
272 */ 237 */
273static void _disable_hwsup(struct clockdomain *clkdm) 238static void _resolve_clkdm_deps(struct clockdomain *clkdm,
239 struct clkdm_dep *clkdm_deps)
274{ 240{
275 if (cpu_is_omap24xx()) 241 struct clkdm_dep *cd;
276 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 242
277 clkdm->clktrctrl_mask); 243 for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) {
278 else if (cpu_is_omap34xx()) 244 if (!omap_chip_is(cd->omap_chip))
279 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs, 245 continue;
280 clkdm->clktrctrl_mask); 246 if (cd->clkdm)
281 else if (cpu_is_omap44xx()) 247 continue;
282 return omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, 248 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
283 clkdm->cm_inst, 249
284 clkdm->clkdm_offs); 250 WARN(!cd->clkdm, "clockdomain: %s: could not find clkdm %s while resolving dependencies - should never happen",
285 else 251 clkdm->name, cd->clkdm_name);
286 BUG(); 252 }
287} 253}
288 254
289/* Public functions */ 255/* Public functions */
@@ -292,6 +258,7 @@ static void _disable_hwsup(struct clockdomain *clkdm)
292 * clkdm_init - set up the clockdomain layer 258 * clkdm_init - set up the clockdomain layer
293 * @clkdms: optional pointer to an array of clockdomains to register 259 * @clkdms: optional pointer to an array of clockdomains to register
294 * @init_autodeps: optional pointer to an array of autodeps to register 260 * @init_autodeps: optional pointer to an array of autodeps to register
261 * @custom_funcs: func pointers for arch specfic implementations
295 * 262 *
296 * Set up internal state. If a pointer to an array of clockdomains 263 * Set up internal state. If a pointer to an array of clockdomains
297 * @clkdms was supplied, loop through the list of clockdomains, 264 * @clkdms was supplied, loop through the list of clockdomains,
@@ -300,12 +267,18 @@ static void _disable_hwsup(struct clockdomain *clkdm)
300 * @init_autodeps was provided, register those. No return value. 267 * @init_autodeps was provided, register those. No return value.
301 */ 268 */
302void clkdm_init(struct clockdomain **clkdms, 269void clkdm_init(struct clockdomain **clkdms,
303 struct clkdm_autodep *init_autodeps) 270 struct clkdm_autodep *init_autodeps,
271 struct clkdm_ops *custom_funcs)
304{ 272{
305 struct clockdomain **c = NULL; 273 struct clockdomain **c = NULL;
306 struct clockdomain *clkdm; 274 struct clockdomain *clkdm;
307 struct clkdm_autodep *autodep = NULL; 275 struct clkdm_autodep *autodep = NULL;
308 276
277 if (!custom_funcs)
278 WARN(1, "No custom clkdm functions registered\n");
279 else
280 arch_clkdm = custom_funcs;
281
309 if (clkdms) 282 if (clkdms)
310 for (c = clkdms; *c; c++) 283 for (c = clkdms; *c; c++)
311 _clkdm_register(*c); 284 _clkdm_register(*c);
@@ -321,11 +294,14 @@ void clkdm_init(struct clockdomain **clkdms,
321 */ 294 */
322 list_for_each_entry(clkdm, &clkdm_list, node) { 295 list_for_each_entry(clkdm, &clkdm_list, node) {
323 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) 296 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
324 omap2_clkdm_wakeup(clkdm); 297 clkdm_wakeup(clkdm);
325 else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO) 298 else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO)
326 omap2_clkdm_deny_idle(clkdm); 299 clkdm_deny_idle(clkdm);
327 300
301 _resolve_clkdm_deps(clkdm, clkdm->wkdep_srcs);
328 clkdm_clear_all_wkdeps(clkdm); 302 clkdm_clear_all_wkdeps(clkdm);
303
304 _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs);
329 clkdm_clear_all_sleepdeps(clkdm); 305 clkdm_clear_all_sleepdeps(clkdm);
330 } 306 }
331} 307}
@@ -422,32 +398,32 @@ struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm)
422int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 398int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
423{ 399{
424 struct clkdm_dep *cd; 400 struct clkdm_dep *cd;
425 401 int ret = 0;
426 if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
427 pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
428 clkdm1->name, clkdm2->name, __func__);
429 return -EINVAL;
430 }
431 402
432 if (!clkdm1 || !clkdm2) 403 if (!clkdm1 || !clkdm2)
433 return -EINVAL; 404 return -EINVAL;
434 405
435 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 406 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
436 if (IS_ERR(cd)) { 407 if (IS_ERR(cd))
408 ret = PTR_ERR(cd);
409
410 if (!arch_clkdm || !arch_clkdm->clkdm_add_wkdep)
411 ret = -EINVAL;
412
413 if (ret) {
437 pr_debug("clockdomain: hardware cannot set/clear wake up of " 414 pr_debug("clockdomain: hardware cannot set/clear wake up of "
438 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 415 "%s when %s wakes up\n", clkdm1->name, clkdm2->name);
439 return PTR_ERR(cd); 416 return ret;
440 } 417 }
441 418
442 if (atomic_inc_return(&cd->wkdep_usecount) == 1) { 419 if (atomic_inc_return(&cd->wkdep_usecount) == 1) {
443 pr_debug("clockdomain: hardware will wake up %s when %s wakes " 420 pr_debug("clockdomain: hardware will wake up %s when %s wakes "
444 "up\n", clkdm1->name, clkdm2->name); 421 "up\n", clkdm1->name, clkdm2->name);
445 422
446 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit), 423 ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2);
447 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
448 } 424 }
449 425
450 return 0; 426 return ret;
451} 427}
452 428
453/** 429/**
@@ -463,32 +439,32 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
463int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 439int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
464{ 440{
465 struct clkdm_dep *cd; 441 struct clkdm_dep *cd;
466 442 int ret = 0;
467 if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
468 pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
469 clkdm1->name, clkdm2->name, __func__);
470 return -EINVAL;
471 }
472 443
473 if (!clkdm1 || !clkdm2) 444 if (!clkdm1 || !clkdm2)
474 return -EINVAL; 445 return -EINVAL;
475 446
476 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 447 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
477 if (IS_ERR(cd)) { 448 if (IS_ERR(cd))
449 ret = PTR_ERR(cd);
450
451 if (!arch_clkdm || !arch_clkdm->clkdm_del_wkdep)
452 ret = -EINVAL;
453
454 if (ret) {
478 pr_debug("clockdomain: hardware cannot set/clear wake up of " 455 pr_debug("clockdomain: hardware cannot set/clear wake up of "
479 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 456 "%s when %s wakes up\n", clkdm1->name, clkdm2->name);
480 return PTR_ERR(cd); 457 return ret;
481 } 458 }
482 459
483 if (atomic_dec_return(&cd->wkdep_usecount) == 0) { 460 if (atomic_dec_return(&cd->wkdep_usecount) == 0) {
484 pr_debug("clockdomain: hardware will no longer wake up %s " 461 pr_debug("clockdomain: hardware will no longer wake up %s "
485 "after %s wakes up\n", clkdm1->name, clkdm2->name); 462 "after %s wakes up\n", clkdm1->name, clkdm2->name);
486 463
487 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 464 ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2);
488 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
489 } 465 }
490 466
491 return 0; 467 return ret;
492} 468}
493 469
494/** 470/**
@@ -508,26 +484,26 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
508int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 484int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
509{ 485{
510 struct clkdm_dep *cd; 486 struct clkdm_dep *cd;
487 int ret = 0;
511 488
512 if (!clkdm1 || !clkdm2) 489 if (!clkdm1 || !clkdm2)
513 return -EINVAL; 490 return -EINVAL;
514 491
515 if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
516 pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
517 clkdm1->name, clkdm2->name, __func__);
518 return -EINVAL;
519 }
520
521 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs); 492 cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
522 if (IS_ERR(cd)) { 493 if (IS_ERR(cd))
494 ret = PTR_ERR(cd);
495
496 if (!arch_clkdm || !arch_clkdm->clkdm_read_wkdep)
497 ret = -EINVAL;
498
499 if (ret) {
523 pr_debug("clockdomain: hardware cannot set/clear wake up of " 500 pr_debug("clockdomain: hardware cannot set/clear wake up of "
524 "%s when %s wakes up\n", clkdm1->name, clkdm2->name); 501 "%s when %s wakes up\n", clkdm1->name, clkdm2->name);
525 return PTR_ERR(cd); 502 return ret;
526 } 503 }
527 504
528 /* XXX It's faster to return the atomic wkdep_usecount */ 505 /* XXX It's faster to return the atomic wkdep_usecount */
529 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP, 506 return arch_clkdm->clkdm_read_wkdep(clkdm1, clkdm2);
530 (1 << clkdm2->dep_bit));
531} 507}
532 508
533/** 509/**
@@ -542,33 +518,13 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
542 */ 518 */
543int clkdm_clear_all_wkdeps(struct clockdomain *clkdm) 519int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
544{ 520{
545 struct clkdm_dep *cd;
546 u32 mask = 0;
547
548 if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
549 pr_err("clockdomain: %s: %s: not yet implemented\n",
550 clkdm->name, __func__);
551 return -EINVAL;
552 }
553
554 if (!clkdm) 521 if (!clkdm)
555 return -EINVAL; 522 return -EINVAL;
556 523
557 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { 524 if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_wkdeps)
558 if (!omap_chip_is(cd->omap_chip)) 525 return -EINVAL;
559 continue;
560
561 if (!cd->clkdm && cd->clkdm_name)
562 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
563
564 /* PRM accesses are slow, so minimize them */
565 mask |= 1 << cd->clkdm->dep_bit;
566 atomic_set(&cd->wkdep_usecount, 0);
567 }
568
569 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs, PM_WKDEP);
570 526
571 return 0; 527 return arch_clkdm->clkdm_clear_all_wkdeps(clkdm);
572} 528}
573 529
574/** 530/**
@@ -586,31 +542,33 @@ int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
586int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 542int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
587{ 543{
588 struct clkdm_dep *cd; 544 struct clkdm_dep *cd;
589 545 int ret = 0;
590 if (!cpu_is_omap34xx())
591 return -EINVAL;
592 546
593 if (!clkdm1 || !clkdm2) 547 if (!clkdm1 || !clkdm2)
594 return -EINVAL; 548 return -EINVAL;
595 549
596 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 550 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
597 if (IS_ERR(cd)) { 551 if (IS_ERR(cd))
552 ret = PTR_ERR(cd);
553
554 if (!arch_clkdm || !arch_clkdm->clkdm_add_sleepdep)
555 ret = -EINVAL;
556
557 if (ret) {
598 pr_debug("clockdomain: hardware cannot set/clear sleep " 558 pr_debug("clockdomain: hardware cannot set/clear sleep "
599 "dependency affecting %s from %s\n", clkdm1->name, 559 "dependency affecting %s from %s\n", clkdm1->name,
600 clkdm2->name); 560 clkdm2->name);
601 return PTR_ERR(cd); 561 return ret;
602 } 562 }
603 563
604 if (atomic_inc_return(&cd->sleepdep_usecount) == 1) { 564 if (atomic_inc_return(&cd->sleepdep_usecount) == 1) {
605 pr_debug("clockdomain: will prevent %s from sleeping if %s " 565 pr_debug("clockdomain: will prevent %s from sleeping if %s "
606 "is active\n", clkdm1->name, clkdm2->name); 566 "is active\n", clkdm1->name, clkdm2->name);
607 567
608 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit), 568 ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2);
609 clkdm1->pwrdm.ptr->prcm_offs,
610 OMAP3430_CM_SLEEPDEP);
611 } 569 }
612 570
613 return 0; 571 return ret;
614} 572}
615 573
616/** 574/**
@@ -628,19 +586,23 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
628int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 586int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
629{ 587{
630 struct clkdm_dep *cd; 588 struct clkdm_dep *cd;
631 589 int ret = 0;
632 if (!cpu_is_omap34xx())
633 return -EINVAL;
634 590
635 if (!clkdm1 || !clkdm2) 591 if (!clkdm1 || !clkdm2)
636 return -EINVAL; 592 return -EINVAL;
637 593
638 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 594 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
639 if (IS_ERR(cd)) { 595 if (IS_ERR(cd))
596 ret = PTR_ERR(cd);
597
598 if (!arch_clkdm || !arch_clkdm->clkdm_del_sleepdep)
599 ret = -EINVAL;
600
601 if (ret) {
640 pr_debug("clockdomain: hardware cannot set/clear sleep " 602 pr_debug("clockdomain: hardware cannot set/clear sleep "
641 "dependency affecting %s from %s\n", clkdm1->name, 603 "dependency affecting %s from %s\n", clkdm1->name,
642 clkdm2->name); 604 clkdm2->name);
643 return PTR_ERR(cd); 605 return ret;
644 } 606 }
645 607
646 if (atomic_dec_return(&cd->sleepdep_usecount) == 0) { 608 if (atomic_dec_return(&cd->sleepdep_usecount) == 0) {
@@ -648,12 +610,10 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
648 "sleeping if %s is active\n", clkdm1->name, 610 "sleeping if %s is active\n", clkdm1->name,
649 clkdm2->name); 611 clkdm2->name);
650 612
651 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit), 613 ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2);
652 clkdm1->pwrdm.ptr->prcm_offs,
653 OMAP3430_CM_SLEEPDEP);
654 } 614 }
655 615
656 return 0; 616 return ret;
657} 617}
658 618
659/** 619/**
@@ -675,25 +635,27 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
675int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2) 635int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
676{ 636{
677 struct clkdm_dep *cd; 637 struct clkdm_dep *cd;
678 638 int ret = 0;
679 if (!cpu_is_omap34xx())
680 return -EINVAL;
681 639
682 if (!clkdm1 || !clkdm2) 640 if (!clkdm1 || !clkdm2)
683 return -EINVAL; 641 return -EINVAL;
684 642
685 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs); 643 cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
686 if (IS_ERR(cd)) { 644 if (IS_ERR(cd))
645 ret = PTR_ERR(cd);
646
647 if (!arch_clkdm || !arch_clkdm->clkdm_read_sleepdep)
648 ret = -EINVAL;
649
650 if (ret) {
687 pr_debug("clockdomain: hardware cannot set/clear sleep " 651 pr_debug("clockdomain: hardware cannot set/clear sleep "
688 "dependency affecting %s from %s\n", clkdm1->name, 652 "dependency affecting %s from %s\n", clkdm1->name,
689 clkdm2->name); 653 clkdm2->name);
690 return PTR_ERR(cd); 654 return ret;
691 } 655 }
692 656
693 /* XXX It's faster to return the atomic sleepdep_usecount */ 657 /* XXX It's faster to return the atomic sleepdep_usecount */
694 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs, 658 return arch_clkdm->clkdm_read_sleepdep(clkdm1, clkdm2);
695 OMAP3430_CM_SLEEPDEP,
696 (1 << clkdm2->dep_bit));
697} 659}
698 660
699/** 661/**
@@ -708,35 +670,17 @@ int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
708 */ 670 */
709int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm) 671int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
710{ 672{
711 struct clkdm_dep *cd;
712 u32 mask = 0;
713
714 if (!cpu_is_omap34xx())
715 return -EINVAL;
716
717 if (!clkdm) 673 if (!clkdm)
718 return -EINVAL; 674 return -EINVAL;
719 675
720 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { 676 if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_sleepdeps)
721 if (!omap_chip_is(cd->omap_chip)) 677 return -EINVAL;
722 continue;
723
724 if (!cd->clkdm && cd->clkdm_name)
725 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
726
727 /* PRM accesses are slow, so minimize them */
728 mask |= 1 << cd->clkdm->dep_bit;
729 atomic_set(&cd->sleepdep_usecount, 0);
730 }
731
732 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
733 OMAP3430_CM_SLEEPDEP);
734 678
735 return 0; 679 return arch_clkdm->clkdm_clear_all_sleepdeps(clkdm);
736} 680}
737 681
738/** 682/**
739 * omap2_clkdm_sleep - force clockdomain sleep transition 683 * clkdm_sleep - force clockdomain sleep transition
740 * @clkdm: struct clockdomain * 684 * @clkdm: struct clockdomain *
741 * 685 *
742 * Instruct the CM to force a sleep transition on the specified 686 * Instruct the CM to force a sleep transition on the specified
@@ -744,7 +688,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
744 * clockdomain does not support software-initiated sleep; 0 upon 688 * clockdomain does not support software-initiated sleep; 0 upon
745 * success. 689 * success.
746 */ 690 */
747int omap2_clkdm_sleep(struct clockdomain *clkdm) 691int clkdm_sleep(struct clockdomain *clkdm)
748{ 692{
749 if (!clkdm) 693 if (!clkdm)
750 return -EINVAL; 694 return -EINVAL;
@@ -755,33 +699,16 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
755 return -EINVAL; 699 return -EINVAL;
756 } 700 }
757 701
758 pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name); 702 if (!arch_clkdm || !arch_clkdm->clkdm_sleep)
759 703 return -EINVAL;
760 if (cpu_is_omap24xx()) {
761
762 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
763 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
764
765 } else if (cpu_is_omap34xx()) {
766
767 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
768 clkdm->clktrctrl_mask);
769
770 } else if (cpu_is_omap44xx()) {
771
772 omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition,
773 clkdm->cm_inst,
774 clkdm->clkdm_offs);
775 704
776 } else { 705 pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name);
777 BUG();
778 };
779 706
780 return 0; 707 return arch_clkdm->clkdm_sleep(clkdm);
781} 708}
782 709
783/** 710/**
784 * omap2_clkdm_wakeup - force clockdomain wakeup transition 711 * clkdm_wakeup - force clockdomain wakeup transition
785 * @clkdm: struct clockdomain * 712 * @clkdm: struct clockdomain *
786 * 713 *
787 * Instruct the CM to force a wakeup transition on the specified 714 * Instruct the CM to force a wakeup transition on the specified
@@ -789,7 +716,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
789 * clockdomain does not support software-controlled wakeup; 0 upon 716 * clockdomain does not support software-controlled wakeup; 0 upon
790 * success. 717 * success.
791 */ 718 */
792int omap2_clkdm_wakeup(struct clockdomain *clkdm) 719int clkdm_wakeup(struct clockdomain *clkdm)
793{ 720{
794 if (!clkdm) 721 if (!clkdm)
795 return -EINVAL; 722 return -EINVAL;
@@ -800,33 +727,16 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
800 return -EINVAL; 727 return -EINVAL;
801 } 728 }
802 729
803 pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name); 730 if (!arch_clkdm || !arch_clkdm->clkdm_wakeup)
804 731 return -EINVAL;
805 if (cpu_is_omap24xx()) {
806
807 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
808 clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
809
810 } else if (cpu_is_omap34xx()) {
811
812 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
813 clkdm->clktrctrl_mask);
814
815 } else if (cpu_is_omap44xx()) {
816
817 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
818 clkdm->cm_inst,
819 clkdm->clkdm_offs);
820 732
821 } else { 733 pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name);
822 BUG();
823 };
824 734
825 return 0; 735 return arch_clkdm->clkdm_wakeup(clkdm);
826} 736}
827 737
828/** 738/**
829 * omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm 739 * clkdm_allow_idle - enable hwsup idle transitions for clkdm
830 * @clkdm: struct clockdomain * 740 * @clkdm: struct clockdomain *
831 * 741 *
832 * Allow the hardware to automatically switch the clockdomain @clkdm into 742 * Allow the hardware to automatically switch the clockdomain @clkdm into
@@ -835,7 +745,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
835 * framework, wkdep/sleepdep autodependencies are added; this is so 745 * framework, wkdep/sleepdep autodependencies are added; this is so
836 * device drivers can read and write to the device. No return value. 746 * device drivers can read and write to the device. No return value.
837 */ 747 */
838void omap2_clkdm_allow_idle(struct clockdomain *clkdm) 748void clkdm_allow_idle(struct clockdomain *clkdm)
839{ 749{
840 if (!clkdm) 750 if (!clkdm)
841 return; 751 return;
@@ -846,27 +756,18 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
846 return; 756 return;
847 } 757 }
848 758
759 if (!arch_clkdm || !arch_clkdm->clkdm_allow_idle)
760 return;
761
849 pr_debug("clockdomain: enabling automatic idle transitions for %s\n", 762 pr_debug("clockdomain: enabling automatic idle transitions for %s\n",
850 clkdm->name); 763 clkdm->name);
851 764
852 /* 765 arch_clkdm->clkdm_allow_idle(clkdm);
853 * XXX This should be removed once TI adds wakeup/sleep
854 * dependency code and data for OMAP4.
855 */
856 if (cpu_is_omap44xx()) {
857 pr_err("clockdomain: %s: OMAP4 wakeup/sleep dependency support: not yet implemented\n", clkdm->name);
858 } else {
859 if (atomic_read(&clkdm->usecount) > 0)
860 _clkdm_add_autodeps(clkdm);
861 }
862
863 _enable_hwsup(clkdm);
864
865 pwrdm_clkdm_state_switch(clkdm); 766 pwrdm_clkdm_state_switch(clkdm);
866} 767}
867 768
868/** 769/**
869 * omap2_clkdm_deny_idle - disable hwsup idle transitions for clkdm 770 * clkdm_deny_idle - disable hwsup idle transitions for clkdm
870 * @clkdm: struct clockdomain * 771 * @clkdm: struct clockdomain *
871 * 772 *
872 * Prevent the hardware from automatically switching the clockdomain 773 * Prevent the hardware from automatically switching the clockdomain
@@ -874,7 +775,7 @@ void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
874 * downstream clocks enabled in the clock framework, wkdep/sleepdep 775 * downstream clocks enabled in the clock framework, wkdep/sleepdep
875 * autodependencies are removed. No return value. 776 * autodependencies are removed. No return value.
876 */ 777 */
877void omap2_clkdm_deny_idle(struct clockdomain *clkdm) 778void clkdm_deny_idle(struct clockdomain *clkdm)
878{ 779{
879 if (!clkdm) 780 if (!clkdm)
880 return; 781 return;
@@ -885,28 +786,20 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
885 return; 786 return;
886 } 787 }
887 788
789 if (!arch_clkdm || !arch_clkdm->clkdm_deny_idle)
790 return;
791
888 pr_debug("clockdomain: disabling automatic idle transitions for %s\n", 792 pr_debug("clockdomain: disabling automatic idle transitions for %s\n",
889 clkdm->name); 793 clkdm->name);
890 794
891 _disable_hwsup(clkdm); 795 arch_clkdm->clkdm_deny_idle(clkdm);
892
893 /*
894 * XXX This should be removed once TI adds wakeup/sleep
895 * dependency code and data for OMAP4.
896 */
897 if (cpu_is_omap44xx()) {
898 pr_err("clockdomain: %s: OMAP4 wakeup/sleep dependency support: not yet implemented\n", clkdm->name);
899 } else {
900 if (atomic_read(&clkdm->usecount) > 0)
901 _clkdm_del_autodeps(clkdm);
902 }
903} 796}
904 797
905 798
906/* Clockdomain-to-clock framework interface code */ 799/* Clockdomain-to-clock framework interface code */
907 800
908/** 801/**
909 * omap2_clkdm_clk_enable - add an enabled downstream clock to this clkdm 802 * clkdm_clk_enable - add an enabled downstream clock to this clkdm
910 * @clkdm: struct clockdomain * 803 * @clkdm: struct clockdomain *
911 * @clk: struct clk * of the enabled downstream clock 804 * @clk: struct clk * of the enabled downstream clock
912 * 805 *
@@ -919,10 +812,8 @@ void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
919 * by on-chip processors. Returns -EINVAL if passed null pointers; 812 * by on-chip processors. Returns -EINVAL if passed null pointers;
920 * returns 0 upon success or if the clockdomain is in hwsup idle mode. 813 * returns 0 upon success or if the clockdomain is in hwsup idle mode.
921 */ 814 */
922int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) 815int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
923{ 816{
924 bool hwsup = false;
925
926 /* 817 /*
927 * XXX Rewrite this code to maintain a list of enabled 818 * XXX Rewrite this code to maintain a list of enabled
928 * downstream clocks for debugging purposes? 819 * downstream clocks for debugging purposes?
@@ -931,6 +822,9 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
931 if (!clkdm || !clk) 822 if (!clkdm || !clk)
932 return -EINVAL; 823 return -EINVAL;
933 824
825 if (!arch_clkdm || !arch_clkdm->clkdm_clk_enable)
826 return -EINVAL;
827
934 if (atomic_inc_return(&clkdm->usecount) > 1) 828 if (atomic_inc_return(&clkdm->usecount) > 1)
935 return 0; 829 return 0;
936 830
@@ -939,31 +833,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
939 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name, 833 pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name,
940 clk->name); 834 clk->name);
941 835
942 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 836 arch_clkdm->clkdm_clk_enable(clkdm);
943
944 if (!clkdm->clktrctrl_mask)
945 return 0;
946
947 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
948 clkdm->clktrctrl_mask);
949
950 } else if (cpu_is_omap44xx()) {
951
952 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
953 clkdm->cm_inst,
954 clkdm->clkdm_offs);
955
956 }
957
958 if (hwsup) {
959 /* Disable HW transitions when we are changing deps */
960 _disable_hwsup(clkdm);
961 _clkdm_add_autodeps(clkdm);
962 _enable_hwsup(clkdm);
963 } else {
964 omap2_clkdm_wakeup(clkdm);
965 }
966
967 pwrdm_wait_transition(clkdm->pwrdm.ptr); 837 pwrdm_wait_transition(clkdm->pwrdm.ptr);
968 pwrdm_clkdm_state_switch(clkdm); 838 pwrdm_clkdm_state_switch(clkdm);
969 839
@@ -971,7 +841,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
971} 841}
972 842
973/** 843/**
974 * omap2_clkdm_clk_disable - remove an enabled downstream clock from this clkdm 844 * clkdm_clk_disable - remove an enabled downstream clock from this clkdm
975 * @clkdm: struct clockdomain * 845 * @clkdm: struct clockdomain *
976 * @clk: struct clk * of the disabled downstream clock 846 * @clk: struct clk * of the disabled downstream clock
977 * 847 *
@@ -984,10 +854,8 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
984 * is enabled; or returns 0 upon success or if the clockdomain is in 854 * is enabled; or returns 0 upon success or if the clockdomain is in
985 * hwsup idle mode. 855 * hwsup idle mode.
986 */ 856 */
987int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk) 857int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
988{ 858{
989 bool hwsup = false;
990
991 /* 859 /*
992 * XXX Rewrite this code to maintain a list of enabled 860 * XXX Rewrite this code to maintain a list of enabled
993 * downstream clocks for debugging purposes? 861 * downstream clocks for debugging purposes?
@@ -996,6 +864,9 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
996 if (!clkdm || !clk) 864 if (!clkdm || !clk)
997 return -EINVAL; 865 return -EINVAL;
998 866
867 if (!arch_clkdm || !arch_clkdm->clkdm_clk_disable)
868 return -EINVAL;
869
999#ifdef DEBUG 870#ifdef DEBUG
1000 if (atomic_read(&clkdm->usecount) == 0) { 871 if (atomic_read(&clkdm->usecount) == 0) {
1001 WARN_ON(1); /* underflow */ 872 WARN_ON(1); /* underflow */
@@ -1011,31 +882,7 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
1011 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name, 882 pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name,
1012 clk->name); 883 clk->name);
1013 884
1014 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 885 arch_clkdm->clkdm_clk_disable(clkdm);
1015
1016 if (!clkdm->clktrctrl_mask)
1017 return 0;
1018
1019 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
1020 clkdm->clktrctrl_mask);
1021
1022 } else if (cpu_is_omap44xx()) {
1023
1024 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
1025 clkdm->cm_inst,
1026 clkdm->clkdm_offs);
1027
1028 }
1029
1030 if (hwsup) {
1031 /* Disable HW transitions when we are changing deps */
1032 _disable_hwsup(clkdm);
1033 _clkdm_del_autodeps(clkdm);
1034 _enable_hwsup(clkdm);
1035 } else {
1036 omap2_clkdm_sleep(clkdm);
1037 }
1038
1039 pwrdm_clkdm_state_switch(clkdm); 886 pwrdm_clkdm_state_switch(clkdm);
1040 887
1041 return 0; 888 return 0;
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index 9b459c26fb85..85b3dce65640 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -4,7 +4,7 @@
4 * OMAP2/3 clockdomain framework functions 4 * OMAP2/3 clockdomain framework functions
5 * 5 *
6 * Copyright (C) 2008 Texas Instruments, Inc. 6 * Copyright (C) 2008 Texas Instruments, Inc.
7 * Copyright (C) 2008-2010 Nokia Corporation 7 * Copyright (C) 2008-2011 Nokia Corporation
8 * 8 *
9 * Paul Walmsley 9 * Paul Walmsley
10 * 10 *
@@ -22,11 +22,19 @@
22#include <plat/clock.h> 22#include <plat/clock.h>
23#include <plat/cpu.h> 23#include <plat/cpu.h>
24 24
25/* Clockdomain capability flags */ 25/*
26 * Clockdomain flags
27 *
28 * XXX Document CLKDM_CAN_* flags
29 *
30 * CLKDM_NO_AUTODEPS: Prevent "autodeps" from being added/removed from this
31 * clockdomain. (Currently, this applies to OMAP3 clockdomains only.)
32 */
26#define CLKDM_CAN_FORCE_SLEEP (1 << 0) 33#define CLKDM_CAN_FORCE_SLEEP (1 << 0)
27#define CLKDM_CAN_FORCE_WAKEUP (1 << 1) 34#define CLKDM_CAN_FORCE_WAKEUP (1 << 1)
28#define CLKDM_CAN_ENABLE_AUTO (1 << 2) 35#define CLKDM_CAN_ENABLE_AUTO (1 << 2)
29#define CLKDM_CAN_DISABLE_AUTO (1 << 3) 36#define CLKDM_CAN_DISABLE_AUTO (1 << 3)
37#define CLKDM_NO_AUTODEPS (1 << 4)
30 38
31#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO) 39#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
32#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP) 40#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
@@ -116,7 +124,42 @@ struct clockdomain {
116 struct list_head node; 124 struct list_head node;
117}; 125};
118 126
119void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps); 127/**
128 * struct clkdm_ops - Arch specfic function implementations
129 * @clkdm_add_wkdep: Add a wakeup dependency between clk domains
130 * @clkdm_del_wkdep: Delete a wakeup dependency between clk domains
131 * @clkdm_read_wkdep: Read wakeup dependency state between clk domains
132 * @clkdm_clear_all_wkdeps: Remove all wakeup dependencies from the clk domain
133 * @clkdm_add_sleepdep: Add a sleep dependency between clk domains
134 * @clkdm_del_sleepdep: Delete a sleep dependency between clk domains
135 * @clkdm_read_sleepdep: Read sleep dependency state between clk domains
136 * @clkdm_clear_all_sleepdeps: Remove all sleep dependencies from the clk domain
137 * @clkdm_sleep: Force a clockdomain to sleep
138 * @clkdm_wakeup: Force a clockdomain to wakeup
139 * @clkdm_allow_idle: Enable hw supervised idle transitions for clock domain
140 * @clkdm_deny_idle: Disable hw supervised idle transitions for clock domain
141 * @clkdm_clk_enable: Put the clkdm in right state for a clock enable
142 * @clkdm_clk_disable: Put the clkdm in right state for a clock disable
143 */
144struct clkdm_ops {
145 int (*clkdm_add_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
146 int (*clkdm_del_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
147 int (*clkdm_read_wkdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
148 int (*clkdm_clear_all_wkdeps)(struct clockdomain *clkdm);
149 int (*clkdm_add_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
150 int (*clkdm_del_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
151 int (*clkdm_read_sleepdep)(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
152 int (*clkdm_clear_all_sleepdeps)(struct clockdomain *clkdm);
153 int (*clkdm_sleep)(struct clockdomain *clkdm);
154 int (*clkdm_wakeup)(struct clockdomain *clkdm);
155 void (*clkdm_allow_idle)(struct clockdomain *clkdm);
156 void (*clkdm_deny_idle)(struct clockdomain *clkdm);
157 int (*clkdm_clk_enable)(struct clockdomain *clkdm);
158 int (*clkdm_clk_disable)(struct clockdomain *clkdm);
159};
160
161void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps,
162 struct clkdm_ops *custom_funcs);
120struct clockdomain *clkdm_lookup(const char *name); 163struct clockdomain *clkdm_lookup(const char *name);
121 164
122int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), 165int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user),
@@ -132,16 +175,23 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
132int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2); 175int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2);
133int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm); 176int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);
134 177
135void omap2_clkdm_allow_idle(struct clockdomain *clkdm); 178void clkdm_allow_idle(struct clockdomain *clkdm);
136void omap2_clkdm_deny_idle(struct clockdomain *clkdm); 179void clkdm_deny_idle(struct clockdomain *clkdm);
137 180
138int omap2_clkdm_wakeup(struct clockdomain *clkdm); 181int clkdm_wakeup(struct clockdomain *clkdm);
139int omap2_clkdm_sleep(struct clockdomain *clkdm); 182int clkdm_sleep(struct clockdomain *clkdm);
140 183
141int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk); 184int clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
142int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk); 185int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
143 186
144extern void __init omap2_clockdomains_init(void); 187extern void __init omap2xxx_clockdomains_init(void);
188extern void __init omap3xxx_clockdomains_init(void);
145extern void __init omap44xx_clockdomains_init(void); 189extern void __init omap44xx_clockdomains_init(void);
190extern void _clkdm_add_autodeps(struct clockdomain *clkdm);
191extern void _clkdm_del_autodeps(struct clockdomain *clkdm);
192
193extern struct clkdm_ops omap2_clkdm_operations;
194extern struct clkdm_ops omap3_clkdm_operations;
195extern struct clkdm_ops omap4_clkdm_operations;
146 196
147#endif 197#endif
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
new file mode 100644
index 000000000000..48d0db7e6069
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -0,0 +1,274 @@
1/*
2 * OMAP2 and OMAP3 clockdomain control
3 *
4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/types.h>
16#include <plat/prcm.h>
17#include "prm.h"
18#include "prm2xxx_3xxx.h"
19#include "cm.h"
20#include "cm2xxx_3xxx.h"
21#include "cm-regbits-24xx.h"
22#include "cm-regbits-34xx.h"
23#include "prm-regbits-24xx.h"
24#include "clockdomain.h"
25
26static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
27 struct clockdomain *clkdm2)
28{
29 omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
30 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
31 return 0;
32}
33
34static int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1,
35 struct clockdomain *clkdm2)
36{
37 omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
38 clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
39 return 0;
40}
41
42static int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
43 struct clockdomain *clkdm2)
44{
45 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
46 PM_WKDEP, (1 << clkdm2->dep_bit));
47}
48
49static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
50{
51 struct clkdm_dep *cd;
52 u32 mask = 0;
53
54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
55 if (!omap_chip_is(cd->omap_chip))
56 continue;
57 if (!cd->clkdm)
58 continue; /* only happens if data is erroneous */
59
60 /* PRM accesses are slow, so minimize them */
61 mask |= 1 << cd->clkdm->dep_bit;
62 atomic_set(&cd->wkdep_usecount, 0);
63 }
64
65 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
66 PM_WKDEP);
67 return 0;
68}
69
70static int omap3_clkdm_add_sleepdep(struct clockdomain *clkdm1,
71 struct clockdomain *clkdm2)
72{
73 omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
74 clkdm1->pwrdm.ptr->prcm_offs,
75 OMAP3430_CM_SLEEPDEP);
76 return 0;
77}
78
79static int omap3_clkdm_del_sleepdep(struct clockdomain *clkdm1,
80 struct clockdomain *clkdm2)
81{
82 omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
83 clkdm1->pwrdm.ptr->prcm_offs,
84 OMAP3430_CM_SLEEPDEP);
85 return 0;
86}
87
88static int omap3_clkdm_read_sleepdep(struct clockdomain *clkdm1,
89 struct clockdomain *clkdm2)
90{
91 return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
92 OMAP3430_CM_SLEEPDEP, (1 << clkdm2->dep_bit));
93}
94
95static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
96{
97 struct clkdm_dep *cd;
98 u32 mask = 0;
99
100 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) {
101 if (!omap_chip_is(cd->omap_chip))
102 continue;
103 if (!cd->clkdm)
104 continue; /* only happens if data is erroneous */
105
106 /* PRM accesses are slow, so minimize them */
107 mask |= 1 << cd->clkdm->dep_bit;
108 atomic_set(&cd->sleepdep_usecount, 0);
109 }
110 omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
111 OMAP3430_CM_SLEEPDEP);
112 return 0;
113}
114
115static int omap2_clkdm_sleep(struct clockdomain *clkdm)
116{
117 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
118 clkdm->pwrdm.ptr->prcm_offs,
119 OMAP2_PM_PWSTCTRL);
120 return 0;
121}
122
123static int omap2_clkdm_wakeup(struct clockdomain *clkdm)
124{
125 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
126 clkdm->pwrdm.ptr->prcm_offs,
127 OMAP2_PM_PWSTCTRL);
128 return 0;
129}
130
131static void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
132{
133 if (atomic_read(&clkdm->usecount) > 0)
134 _clkdm_add_autodeps(clkdm);
135
136 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
137 clkdm->clktrctrl_mask);
138}
139
140static void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
141{
142 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
143 clkdm->clktrctrl_mask);
144
145 if (atomic_read(&clkdm->usecount) > 0)
146 _clkdm_del_autodeps(clkdm);
147}
148
149static void _enable_hwsup(struct clockdomain *clkdm)
150{
151 if (cpu_is_omap24xx())
152 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
153 clkdm->clktrctrl_mask);
154 else if (cpu_is_omap34xx())
155 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
156 clkdm->clktrctrl_mask);
157}
158
159static void _disable_hwsup(struct clockdomain *clkdm)
160{
161 if (cpu_is_omap24xx())
162 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
163 clkdm->clktrctrl_mask);
164 else if (cpu_is_omap34xx())
165 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
166 clkdm->clktrctrl_mask);
167}
168
169
170static int omap2_clkdm_clk_enable(struct clockdomain *clkdm)
171{
172 bool hwsup = false;
173
174 if (!clkdm->clktrctrl_mask)
175 return 0;
176
177 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
178 clkdm->clktrctrl_mask);
179
180 if (hwsup) {
181 /* Disable HW transitions when we are changing deps */
182 _disable_hwsup(clkdm);
183 _clkdm_add_autodeps(clkdm);
184 _enable_hwsup(clkdm);
185 } else {
186 clkdm_wakeup(clkdm);
187 }
188
189 return 0;
190}
191
192static int omap2_clkdm_clk_disable(struct clockdomain *clkdm)
193{
194 bool hwsup = false;
195
196 if (!clkdm->clktrctrl_mask)
197 return 0;
198
199 hwsup = omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
200 clkdm->clktrctrl_mask);
201
202 if (hwsup) {
203 /* Disable HW transitions when we are changing deps */
204 _disable_hwsup(clkdm);
205 _clkdm_del_autodeps(clkdm);
206 _enable_hwsup(clkdm);
207 } else {
208 clkdm_sleep(clkdm);
209 }
210
211 return 0;
212}
213
214static int omap3_clkdm_sleep(struct clockdomain *clkdm)
215{
216 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
217 clkdm->clktrctrl_mask);
218 return 0;
219}
220
221static int omap3_clkdm_wakeup(struct clockdomain *clkdm)
222{
223 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
224 clkdm->clktrctrl_mask);
225 return 0;
226}
227
228static void omap3_clkdm_allow_idle(struct clockdomain *clkdm)
229{
230 if (atomic_read(&clkdm->usecount) > 0)
231 _clkdm_add_autodeps(clkdm);
232
233 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
234 clkdm->clktrctrl_mask);
235}
236
237static void omap3_clkdm_deny_idle(struct clockdomain *clkdm)
238{
239 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
240 clkdm->clktrctrl_mask);
241
242 if (atomic_read(&clkdm->usecount) > 0)
243 _clkdm_del_autodeps(clkdm);
244}
245
246struct clkdm_ops omap2_clkdm_operations = {
247 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
248 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
249 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
250 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
251 .clkdm_sleep = omap2_clkdm_sleep,
252 .clkdm_wakeup = omap2_clkdm_wakeup,
253 .clkdm_allow_idle = omap2_clkdm_allow_idle,
254 .clkdm_deny_idle = omap2_clkdm_deny_idle,
255 .clkdm_clk_enable = omap2_clkdm_clk_enable,
256 .clkdm_clk_disable = omap2_clkdm_clk_disable,
257};
258
259struct clkdm_ops omap3_clkdm_operations = {
260 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
261 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
262 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
263 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
264 .clkdm_add_sleepdep = omap3_clkdm_add_sleepdep,
265 .clkdm_del_sleepdep = omap3_clkdm_del_sleepdep,
266 .clkdm_read_sleepdep = omap3_clkdm_read_sleepdep,
267 .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps,
268 .clkdm_sleep = omap3_clkdm_sleep,
269 .clkdm_wakeup = omap3_clkdm_wakeup,
270 .clkdm_allow_idle = omap3_clkdm_allow_idle,
271 .clkdm_deny_idle = omap3_clkdm_deny_idle,
272 .clkdm_clk_enable = omap2_clkdm_clk_enable,
273 .clkdm_clk_disable = omap2_clkdm_clk_disable,
274};
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c
new file mode 100644
index 000000000000..a1a4ecd26544
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomain44xx.c
@@ -0,0 +1,137 @@
1/*
2 * OMAP4 clockdomain control
3 *
4 * Copyright (C) 2008-2010 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
8 * Rajendra Nayak <rnayak@ti.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include "clockdomain.h"
17#include "cminst44xx.h"
18#include "cm44xx.h"
19
20static int omap4_clkdm_add_wkup_sleep_dep(struct clockdomain *clkdm1,
21 struct clockdomain *clkdm2)
22{
23 omap4_cminst_set_inst_reg_bits((1 << clkdm2->dep_bit),
24 clkdm1->prcm_partition,
25 clkdm1->cm_inst, clkdm1->clkdm_offs +
26 OMAP4_CM_STATICDEP);
27 return 0;
28}
29
30static int omap4_clkdm_del_wkup_sleep_dep(struct clockdomain *clkdm1,
31 struct clockdomain *clkdm2)
32{
33 omap4_cminst_clear_inst_reg_bits((1 << clkdm2->dep_bit),
34 clkdm1->prcm_partition,
35 clkdm1->cm_inst, clkdm1->clkdm_offs +
36 OMAP4_CM_STATICDEP);
37 return 0;
38}
39
40static int omap4_clkdm_read_wkup_sleep_dep(struct clockdomain *clkdm1,
41 struct clockdomain *clkdm2)
42{
43 return omap4_cminst_read_inst_reg_bits(clkdm1->prcm_partition,
44 clkdm1->cm_inst, clkdm1->clkdm_offs +
45 OMAP4_CM_STATICDEP,
46 (1 << clkdm2->dep_bit));
47}
48
49static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
50{
51 struct clkdm_dep *cd;
52 u32 mask = 0;
53
54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
55 if (!omap_chip_is(cd->omap_chip))
56 continue;
57 if (!cd->clkdm)
58 continue; /* only happens if data is erroneous */
59
60 mask |= 1 << cd->clkdm->dep_bit;
61 atomic_set(&cd->wkdep_usecount, 0);
62 }
63
64 omap4_cminst_clear_inst_reg_bits(mask, clkdm->prcm_partition,
65 clkdm->cm_inst, clkdm->clkdm_offs +
66 OMAP4_CM_STATICDEP);
67 return 0;
68}
69
70static int omap4_clkdm_sleep(struct clockdomain *clkdm)
71{
72 omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition,
73 clkdm->cm_inst, clkdm->clkdm_offs);
74 return 0;
75}
76
77static int omap4_clkdm_wakeup(struct clockdomain *clkdm)
78{
79 omap4_cminst_clkdm_force_wakeup(clkdm->prcm_partition,
80 clkdm->cm_inst, clkdm->clkdm_offs);
81 return 0;
82}
83
84static void omap4_clkdm_allow_idle(struct clockdomain *clkdm)
85{
86 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
87 clkdm->cm_inst, clkdm->clkdm_offs);
88}
89
90static void omap4_clkdm_deny_idle(struct clockdomain *clkdm)
91{
92 omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition,
93 clkdm->cm_inst, clkdm->clkdm_offs);
94}
95
96static int omap4_clkdm_clk_enable(struct clockdomain *clkdm)
97{
98 bool hwsup = false;
99
100 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
101 clkdm->cm_inst, clkdm->clkdm_offs);
102
103 if (!hwsup)
104 clkdm_wakeup(clkdm);
105
106 return 0;
107}
108
109static int omap4_clkdm_clk_disable(struct clockdomain *clkdm)
110{
111 bool hwsup = false;
112
113 hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
114 clkdm->cm_inst, clkdm->clkdm_offs);
115
116 if (!hwsup)
117 clkdm_sleep(clkdm);
118
119 return 0;
120}
121
122struct clkdm_ops omap4_clkdm_operations = {
123 .clkdm_add_wkdep = omap4_clkdm_add_wkup_sleep_dep,
124 .clkdm_del_wkdep = omap4_clkdm_del_wkup_sleep_dep,
125 .clkdm_read_wkdep = omap4_clkdm_read_wkup_sleep_dep,
126 .clkdm_clear_all_wkdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
127 .clkdm_add_sleepdep = omap4_clkdm_add_wkup_sleep_dep,
128 .clkdm_del_sleepdep = omap4_clkdm_del_wkup_sleep_dep,
129 .clkdm_read_sleepdep = omap4_clkdm_read_wkup_sleep_dep,
130 .clkdm_clear_all_sleepdeps = omap4_clkdm_clear_all_wkup_sleep_deps,
131 .clkdm_sleep = omap4_clkdm_sleep,
132 .clkdm_wakeup = omap4_clkdm_wakeup,
133 .clkdm_allow_idle = omap4_clkdm_allow_idle,
134 .clkdm_deny_idle = omap4_clkdm_deny_idle,
135 .clkdm_clk_enable = omap4_clkdm_clk_enable,
136 .clkdm_clk_disable = omap4_clkdm_clk_disable,
137};
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
index e4a7133ea3b3..13bde95b6790 100644
--- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
@@ -89,6 +89,8 @@ static struct clkdm_dep gfx_sgx_wkdeps[] = {
89 89
90/* 24XX-specific possible dependencies */ 90/* 24XX-specific possible dependencies */
91 91
92#ifdef CONFIG_ARCH_OMAP2
93
92/* Wakeup dependency source arrays */ 94/* Wakeup dependency source arrays */
93 95
94/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ 96/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
@@ -168,10 +170,11 @@ static struct clkdm_dep core_24xx_wkdeps[] = {
168 { NULL }, 170 { NULL },
169}; 171};
170 172
173#endif /* CONFIG_ARCH_OMAP2 */
171 174
172/* 2430-specific possible wakeup dependencies */ 175/* 2430-specific possible wakeup dependencies */
173 176
174#ifdef CONFIG_ARCH_OMAP2430 177#ifdef CONFIG_SOC_OMAP2430
175 178
176/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ 179/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
177static struct clkdm_dep mdm_2430_wkdeps[] = { 180static struct clkdm_dep mdm_2430_wkdeps[] = {
@@ -194,7 +197,7 @@ static struct clkdm_dep mdm_2430_wkdeps[] = {
194 { NULL }, 197 { NULL },
195}; 198};
196 199
197#endif /* CONFIG_ARCH_OMAP2430 */ 200#endif /* CONFIG_SOC_OMAP2430 */
198 201
199 202
200/* OMAP3-specific possible dependencies */ 203/* OMAP3-specific possible dependencies */
@@ -450,7 +453,7 @@ static struct clockdomain cm_clkdm = {
450 * 2420-only clockdomains 453 * 2420-only clockdomains
451 */ 454 */
452 455
453#if defined(CONFIG_ARCH_OMAP2420) 456#if defined(CONFIG_SOC_OMAP2420)
454 457
455static struct clockdomain mpu_2420_clkdm = { 458static struct clockdomain mpu_2420_clkdm = {
456 .name = "mpu_clkdm", 459 .name = "mpu_clkdm",
@@ -514,14 +517,14 @@ static struct clockdomain dss_2420_clkdm = {
514 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
515}; 518};
516 519
517#endif /* CONFIG_ARCH_OMAP2420 */ 520#endif /* CONFIG_SOC_OMAP2420 */
518 521
519 522
520/* 523/*
521 * 2430-only clockdomains 524 * 2430-only clockdomains
522 */ 525 */
523 526
524#if defined(CONFIG_ARCH_OMAP2430) 527#if defined(CONFIG_SOC_OMAP2430)
525 528
526static struct clockdomain mpu_2430_clkdm = { 529static struct clockdomain mpu_2430_clkdm = {
527 .name = "mpu_clkdm", 530 .name = "mpu_clkdm",
@@ -600,7 +603,7 @@ static struct clockdomain dss_2430_clkdm = {
600 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 603 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
601}; 604};
602 605
603#endif /* CONFIG_ARCH_OMAP2430 */ 606#endif /* CONFIG_SOC_OMAP2430 */
604 607
605 608
606/* 609/*
@@ -811,7 +814,7 @@ static struct clockdomain *clockdomains_omap2[] __initdata = {
811 &cm_clkdm, 814 &cm_clkdm,
812 &prm_clkdm, 815 &prm_clkdm,
813 816
814#ifdef CONFIG_ARCH_OMAP2420 817#ifdef CONFIG_SOC_OMAP2420
815 &mpu_2420_clkdm, 818 &mpu_2420_clkdm,
816 &iva1_2420_clkdm, 819 &iva1_2420_clkdm,
817 &dsp_2420_clkdm, 820 &dsp_2420_clkdm,
@@ -821,7 +824,7 @@ static struct clockdomain *clockdomains_omap2[] __initdata = {
821 &dss_2420_clkdm, 824 &dss_2420_clkdm,
822#endif 825#endif
823 826
824#ifdef CONFIG_ARCH_OMAP2430 827#ifdef CONFIG_SOC_OMAP2430
825 &mpu_2430_clkdm, 828 &mpu_2430_clkdm,
826 &mdm_clkdm, 829 &mdm_clkdm,
827 &dsp_2430_clkdm, 830 &dsp_2430_clkdm,
@@ -854,7 +857,12 @@ static struct clockdomain *clockdomains_omap2[] __initdata = {
854 NULL, 857 NULL,
855}; 858};
856 859
857void __init omap2_clockdomains_init(void) 860void __init omap2xxx_clockdomains_init(void)
861{
862 clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap2_clkdm_operations);
863}
864
865void __init omap3xxx_clockdomains_init(void)
858{ 866{
859 clkdm_init(clockdomains_omap2, clkdm_autodeps); 867 clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap3_clkdm_operations);
860} 868}
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c
index 10622c914abc..a607ec196e8b 100644
--- a/arch/arm/mach-omap2/clockdomains44xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -18,11 +18,6 @@
18 * published by the Free Software Foundation. 18 * published by the Free Software Foundation.
19 */ 19 */
20 20
21/*
22 * To-Do List
23 * -> Populate the Sleep/Wakeup dependencies for the domains
24 */
25
26#include <linux/kernel.h> 21#include <linux/kernel.h>
27#include <linux/io.h> 22#include <linux/io.h>
28 23
@@ -35,6 +30,355 @@
35#include "prcm44xx.h" 30#include "prcm44xx.h"
36#include "prcm_mpu44xx.h" 31#include "prcm_mpu44xx.h"
37 32
33/* Static Dependencies for OMAP4 Clock Domains */
34
35static struct clkdm_dep ducati_wkup_sleep_deps[] = {
36 {
37 .clkdm_name = "abe_clkdm",
38 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
39 },
40 {
41 .clkdm_name = "ivahd_clkdm",
42 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
43 },
44 {
45 .clkdm_name = "l3_1_clkdm",
46 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
47 },
48 {
49 .clkdm_name = "l3_2_clkdm",
50 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
51 },
52 {
53 .clkdm_name = "l3_dss_clkdm",
54 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
55 },
56 {
57 .clkdm_name = "l3_emif_clkdm",
58 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
59 },
60 {
61 .clkdm_name = "l3_gfx_clkdm",
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
63 },
64 {
65 .clkdm_name = "l3_init_clkdm",
66 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
67 },
68 {
69 .clkdm_name = "l4_cfg_clkdm",
70 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
71 },
72 {
73 .clkdm_name = "l4_per_clkdm",
74 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
75 },
76 {
77 .clkdm_name = "l4_secure_clkdm",
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
79 },
80 {
81 .clkdm_name = "l4_wkup_clkdm",
82 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
83 },
84 {
85 .clkdm_name = "tesla_clkdm",
86 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
87 },
88 { NULL },
89};
90
91static struct clkdm_dep iss_wkup_sleep_deps[] = {
92 {
93 .clkdm_name = "ivahd_clkdm",
94 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
95 },
96 {
97 .clkdm_name = "l3_1_clkdm",
98 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
99 },
100 {
101 .clkdm_name = "l3_emif_clkdm",
102 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
103 },
104 { NULL },
105};
106
107static struct clkdm_dep ivahd_wkup_sleep_deps[] = {
108 {
109 .clkdm_name = "l3_1_clkdm",
110 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
111 },
112 {
113 .clkdm_name = "l3_emif_clkdm",
114 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
115 },
116 { NULL },
117};
118
119static struct clkdm_dep l3_d2d_wkup_sleep_deps[] = {
120 {
121 .clkdm_name = "abe_clkdm",
122 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
123 },
124 {
125 .clkdm_name = "ivahd_clkdm",
126 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
127 },
128 {
129 .clkdm_name = "l3_1_clkdm",
130 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
131 },
132 {
133 .clkdm_name = "l3_2_clkdm",
134 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
135 },
136 {
137 .clkdm_name = "l3_emif_clkdm",
138 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
139 },
140 {
141 .clkdm_name = "l3_init_clkdm",
142 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
143 },
144 {
145 .clkdm_name = "l4_cfg_clkdm",
146 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
147 },
148 {
149 .clkdm_name = "l4_per_clkdm",
150 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
151 },
152 { NULL },
153};
154
155static struct clkdm_dep l3_dma_wkup_sleep_deps[] = {
156 {
157 .clkdm_name = "abe_clkdm",
158 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
159 },
160 {
161 .clkdm_name = "ducati_clkdm",
162 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
163 },
164 {
165 .clkdm_name = "ivahd_clkdm",
166 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
167 },
168 {
169 .clkdm_name = "l3_1_clkdm",
170 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
171 },
172 {
173 .clkdm_name = "l3_dss_clkdm",
174 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
175 },
176 {
177 .clkdm_name = "l3_emif_clkdm",
178 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
179 },
180 {
181 .clkdm_name = "l3_init_clkdm",
182 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
183 },
184 {
185 .clkdm_name = "l4_cfg_clkdm",
186 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
187 },
188 {
189 .clkdm_name = "l4_per_clkdm",
190 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
191 },
192 {
193 .clkdm_name = "l4_secure_clkdm",
194 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
195 },
196 {
197 .clkdm_name = "l4_wkup_clkdm",
198 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
199 },
200 { NULL },
201};
202
203static struct clkdm_dep l3_dss_wkup_sleep_deps[] = {
204 {
205 .clkdm_name = "ivahd_clkdm",
206 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
207 },
208 {
209 .clkdm_name = "l3_2_clkdm",
210 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
211 },
212 {
213 .clkdm_name = "l3_emif_clkdm",
214 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
215 },
216 { NULL },
217};
218
219static struct clkdm_dep l3_gfx_wkup_sleep_deps[] = {
220 {
221 .clkdm_name = "ivahd_clkdm",
222 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
223 },
224 {
225 .clkdm_name = "l3_1_clkdm",
226 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
227 },
228 {
229 .clkdm_name = "l3_emif_clkdm",
230 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
231 },
232 { NULL },
233};
234
235static struct clkdm_dep l3_init_wkup_sleep_deps[] = {
236 {
237 .clkdm_name = "abe_clkdm",
238 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
239 },
240 {
241 .clkdm_name = "ivahd_clkdm",
242 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
243 },
244 {
245 .clkdm_name = "l3_emif_clkdm",
246 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
247 },
248 {
249 .clkdm_name = "l4_cfg_clkdm",
250 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
251 },
252 {
253 .clkdm_name = "l4_per_clkdm",
254 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
255 },
256 {
257 .clkdm_name = "l4_secure_clkdm",
258 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
259 },
260 {
261 .clkdm_name = "l4_wkup_clkdm",
262 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
263 },
264 { NULL },
265};
266
267static struct clkdm_dep l4_secure_wkup_sleep_deps[] = {
268 {
269 .clkdm_name = "l3_1_clkdm",
270 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
271 },
272 {
273 .clkdm_name = "l3_emif_clkdm",
274 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
275 },
276 {
277 .clkdm_name = "l4_per_clkdm",
278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
279 },
280 { NULL },
281};
282
283static struct clkdm_dep mpuss_wkup_sleep_deps[] = {
284 {
285 .clkdm_name = "abe_clkdm",
286 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
287 },
288 {
289 .clkdm_name = "ducati_clkdm",
290 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
291 },
292 {
293 .clkdm_name = "ivahd_clkdm",
294 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
295 },
296 {
297 .clkdm_name = "l3_1_clkdm",
298 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
299 },
300 {
301 .clkdm_name = "l3_2_clkdm",
302 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
303 },
304 {
305 .clkdm_name = "l3_dss_clkdm",
306 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
307 },
308 {
309 .clkdm_name = "l3_emif_clkdm",
310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
311 },
312 {
313 .clkdm_name = "l3_gfx_clkdm",
314 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
315 },
316 {
317 .clkdm_name = "l3_init_clkdm",
318 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
319 },
320 {
321 .clkdm_name = "l4_cfg_clkdm",
322 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
323 },
324 {
325 .clkdm_name = "l4_per_clkdm",
326 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
327 },
328 {
329 .clkdm_name = "l4_secure_clkdm",
330 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
331 },
332 {
333 .clkdm_name = "l4_wkup_clkdm",
334 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
335 },
336 {
337 .clkdm_name = "tesla_clkdm",
338 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
339 },
340 { NULL },
341};
342
343static struct clkdm_dep tesla_wkup_sleep_deps[] = {
344 {
345 .clkdm_name = "abe_clkdm",
346 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
347 },
348 {
349 .clkdm_name = "ivahd_clkdm",
350 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
351 },
352 {
353 .clkdm_name = "l3_1_clkdm",
354 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
355 },
356 {
357 .clkdm_name = "l3_2_clkdm",
358 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
359 },
360 {
361 .clkdm_name = "l3_emif_clkdm",
362 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
363 },
364 {
365 .clkdm_name = "l3_init_clkdm",
366 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
367 },
368 {
369 .clkdm_name = "l4_cfg_clkdm",
370 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
371 },
372 {
373 .clkdm_name = "l4_per_clkdm",
374 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
375 },
376 {
377 .clkdm_name = "l4_wkup_clkdm",
378 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
379 },
380 { NULL },
381};
38 382
39static struct clockdomain l4_cefuse_44xx_clkdm = { 383static struct clockdomain l4_cefuse_44xx_clkdm = {
40 .name = "l4_cefuse_clkdm", 384 .name = "l4_cefuse_clkdm",
@@ -52,6 +396,7 @@ static struct clockdomain l4_cfg_44xx_clkdm = {
52 .prcm_partition = OMAP4430_CM2_PARTITION, 396 .prcm_partition = OMAP4430_CM2_PARTITION,
53 .cm_inst = OMAP4430_CM2_CORE_INST, 397 .cm_inst = OMAP4430_CM2_CORE_INST,
54 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, 398 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS,
399 .dep_bit = OMAP4430_L4CFG_STATDEP_SHIFT,
55 .flags = CLKDM_CAN_HWSUP, 400 .flags = CLKDM_CAN_HWSUP,
56 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 401 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
57}; 402};
@@ -62,6 +407,9 @@ static struct clockdomain tesla_44xx_clkdm = {
62 .prcm_partition = OMAP4430_CM1_PARTITION, 407 .prcm_partition = OMAP4430_CM1_PARTITION,
63 .cm_inst = OMAP4430_CM1_TESLA_INST, 408 .cm_inst = OMAP4430_CM1_TESLA_INST,
64 .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS, 409 .clkdm_offs = OMAP4430_CM1_TESLA_TESLA_CDOFFS,
410 .dep_bit = OMAP4430_TESLA_STATDEP_SHIFT,
411 .wkdep_srcs = tesla_wkup_sleep_deps,
412 .sleepdep_srcs = tesla_wkup_sleep_deps,
65 .flags = CLKDM_CAN_HWSUP_SWSUP, 413 .flags = CLKDM_CAN_HWSUP_SWSUP,
66 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 414 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
67}; 415};
@@ -72,6 +420,9 @@ static struct clockdomain l3_gfx_44xx_clkdm = {
72 .prcm_partition = OMAP4430_CM2_PARTITION, 420 .prcm_partition = OMAP4430_CM2_PARTITION,
73 .cm_inst = OMAP4430_CM2_GFX_INST, 421 .cm_inst = OMAP4430_CM2_GFX_INST,
74 .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS, 422 .clkdm_offs = OMAP4430_CM2_GFX_GFX_CDOFFS,
423 .dep_bit = OMAP4430_GFX_STATDEP_SHIFT,
424 .wkdep_srcs = l3_gfx_wkup_sleep_deps,
425 .sleepdep_srcs = l3_gfx_wkup_sleep_deps,
75 .flags = CLKDM_CAN_HWSUP_SWSUP, 426 .flags = CLKDM_CAN_HWSUP_SWSUP,
76 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 427 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
77}; 428};
@@ -82,6 +433,9 @@ static struct clockdomain ivahd_44xx_clkdm = {
82 .prcm_partition = OMAP4430_CM2_PARTITION, 433 .prcm_partition = OMAP4430_CM2_PARTITION,
83 .cm_inst = OMAP4430_CM2_IVAHD_INST, 434 .cm_inst = OMAP4430_CM2_IVAHD_INST,
84 .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS, 435 .clkdm_offs = OMAP4430_CM2_IVAHD_IVAHD_CDOFFS,
436 .dep_bit = OMAP4430_IVAHD_STATDEP_SHIFT,
437 .wkdep_srcs = ivahd_wkup_sleep_deps,
438 .sleepdep_srcs = ivahd_wkup_sleep_deps,
85 .flags = CLKDM_CAN_HWSUP_SWSUP, 439 .flags = CLKDM_CAN_HWSUP_SWSUP,
86 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 440 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
87}; 441};
@@ -92,6 +446,9 @@ static struct clockdomain l4_secure_44xx_clkdm = {
92 .prcm_partition = OMAP4430_CM2_PARTITION, 446 .prcm_partition = OMAP4430_CM2_PARTITION,
93 .cm_inst = OMAP4430_CM2_L4PER_INST, 447 .cm_inst = OMAP4430_CM2_L4PER_INST,
94 .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS, 448 .clkdm_offs = OMAP4430_CM2_L4PER_L4SEC_CDOFFS,
449 .dep_bit = OMAP4430_L4SEC_STATDEP_SHIFT,
450 .wkdep_srcs = l4_secure_wkup_sleep_deps,
451 .sleepdep_srcs = l4_secure_wkup_sleep_deps,
95 .flags = CLKDM_CAN_HWSUP_SWSUP, 452 .flags = CLKDM_CAN_HWSUP_SWSUP,
96 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 453 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
97}; 454};
@@ -102,6 +459,7 @@ static struct clockdomain l4_per_44xx_clkdm = {
102 .prcm_partition = OMAP4430_CM2_PARTITION, 459 .prcm_partition = OMAP4430_CM2_PARTITION,
103 .cm_inst = OMAP4430_CM2_L4PER_INST, 460 .cm_inst = OMAP4430_CM2_L4PER_INST,
104 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, 461 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS,
462 .dep_bit = OMAP4430_L4PER_STATDEP_SHIFT,
105 .flags = CLKDM_CAN_HWSUP_SWSUP, 463 .flags = CLKDM_CAN_HWSUP_SWSUP,
106 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 464 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
107}; 465};
@@ -112,6 +470,7 @@ static struct clockdomain abe_44xx_clkdm = {
112 .prcm_partition = OMAP4430_CM1_PARTITION, 470 .prcm_partition = OMAP4430_CM1_PARTITION,
113 .cm_inst = OMAP4430_CM1_ABE_INST, 471 .cm_inst = OMAP4430_CM1_ABE_INST,
114 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, 472 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS,
473 .dep_bit = OMAP4430_ABE_STATDEP_SHIFT,
115 .flags = CLKDM_CAN_HWSUP_SWSUP, 474 .flags = CLKDM_CAN_HWSUP_SWSUP,
116 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 475 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
117}; 476};
@@ -131,6 +490,9 @@ static struct clockdomain l3_init_44xx_clkdm = {
131 .prcm_partition = OMAP4430_CM2_PARTITION, 490 .prcm_partition = OMAP4430_CM2_PARTITION,
132 .cm_inst = OMAP4430_CM2_L3INIT_INST, 491 .cm_inst = OMAP4430_CM2_L3INIT_INST,
133 .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS, 492 .clkdm_offs = OMAP4430_CM2_L3INIT_L3INIT_CDOFFS,
493 .dep_bit = OMAP4430_L3INIT_STATDEP_SHIFT,
494 .wkdep_srcs = l3_init_wkup_sleep_deps,
495 .sleepdep_srcs = l3_init_wkup_sleep_deps,
134 .flags = CLKDM_CAN_HWSUP_SWSUP, 496 .flags = CLKDM_CAN_HWSUP_SWSUP,
135 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 497 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
136}; 498};
@@ -141,6 +503,8 @@ static struct clockdomain mpuss_44xx_clkdm = {
141 .prcm_partition = OMAP4430_CM1_PARTITION, 503 .prcm_partition = OMAP4430_CM1_PARTITION,
142 .cm_inst = OMAP4430_CM1_MPU_INST, 504 .cm_inst = OMAP4430_CM1_MPU_INST,
143 .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS, 505 .clkdm_offs = OMAP4430_CM1_MPU_MPU_CDOFFS,
506 .wkdep_srcs = mpuss_wkup_sleep_deps,
507 .sleepdep_srcs = mpuss_wkup_sleep_deps,
144 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 508 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
145 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 509 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
146}; 510};
@@ -150,7 +514,7 @@ static struct clockdomain mpu0_44xx_clkdm = {
150 .pwrdm = { .name = "cpu0_pwrdm" }, 514 .pwrdm = { .name = "cpu0_pwrdm" },
151 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 515 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
152 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, 516 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST,
153 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS, 517 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS,
154 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 518 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
155 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 519 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
156}; 520};
@@ -160,7 +524,7 @@ static struct clockdomain mpu1_44xx_clkdm = {
160 .pwrdm = { .name = "cpu1_pwrdm" }, 524 .pwrdm = { .name = "cpu1_pwrdm" },
161 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 525 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
162 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, 526 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST,
163 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS, 527 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS,
164 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 528 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
165 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 529 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
166}; 530};
@@ -171,6 +535,7 @@ static struct clockdomain l3_emif_44xx_clkdm = {
171 .prcm_partition = OMAP4430_CM2_PARTITION, 535 .prcm_partition = OMAP4430_CM2_PARTITION,
172 .cm_inst = OMAP4430_CM2_CORE_INST, 536 .cm_inst = OMAP4430_CM2_CORE_INST,
173 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, 537 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS,
538 .dep_bit = OMAP4430_MEMIF_STATDEP_SHIFT,
174 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 539 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
175 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 540 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
176}; 541};
@@ -191,6 +556,9 @@ static struct clockdomain ducati_44xx_clkdm = {
191 .prcm_partition = OMAP4430_CM2_PARTITION, 556 .prcm_partition = OMAP4430_CM2_PARTITION,
192 .cm_inst = OMAP4430_CM2_CORE_INST, 557 .cm_inst = OMAP4430_CM2_CORE_INST,
193 .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS, 558 .clkdm_offs = OMAP4430_CM2_CORE_DUCATI_CDOFFS,
559 .dep_bit = OMAP4430_DUCATI_STATDEP_SHIFT,
560 .wkdep_srcs = ducati_wkup_sleep_deps,
561 .sleepdep_srcs = ducati_wkup_sleep_deps,
194 .flags = CLKDM_CAN_HWSUP_SWSUP, 562 .flags = CLKDM_CAN_HWSUP_SWSUP,
195 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 563 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
196}; 564};
@@ -201,6 +569,7 @@ static struct clockdomain l3_2_44xx_clkdm = {
201 .prcm_partition = OMAP4430_CM2_PARTITION, 569 .prcm_partition = OMAP4430_CM2_PARTITION,
202 .cm_inst = OMAP4430_CM2_CORE_INST, 570 .cm_inst = OMAP4430_CM2_CORE_INST,
203 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, 571 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS,
572 .dep_bit = OMAP4430_L3_2_STATDEP_SHIFT,
204 .flags = CLKDM_CAN_HWSUP, 573 .flags = CLKDM_CAN_HWSUP,
205 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 574 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
206}; 575};
@@ -211,6 +580,7 @@ static struct clockdomain l3_1_44xx_clkdm = {
211 .prcm_partition = OMAP4430_CM2_PARTITION, 580 .prcm_partition = OMAP4430_CM2_PARTITION,
212 .cm_inst = OMAP4430_CM2_CORE_INST, 581 .cm_inst = OMAP4430_CM2_CORE_INST,
213 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, 582 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS,
583 .dep_bit = OMAP4430_L3_1_STATDEP_SHIFT,
214 .flags = CLKDM_CAN_HWSUP, 584 .flags = CLKDM_CAN_HWSUP,
215 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 585 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
216}; 586};
@@ -221,6 +591,8 @@ static struct clockdomain l3_d2d_44xx_clkdm = {
221 .prcm_partition = OMAP4430_CM2_PARTITION, 591 .prcm_partition = OMAP4430_CM2_PARTITION,
222 .cm_inst = OMAP4430_CM2_CORE_INST, 592 .cm_inst = OMAP4430_CM2_CORE_INST,
223 .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS, 593 .clkdm_offs = OMAP4430_CM2_CORE_D2D_CDOFFS,
594 .wkdep_srcs = l3_d2d_wkup_sleep_deps,
595 .sleepdep_srcs = l3_d2d_wkup_sleep_deps,
224 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 596 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
225 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 597 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
226}; 598};
@@ -231,6 +603,8 @@ static struct clockdomain iss_44xx_clkdm = {
231 .prcm_partition = OMAP4430_CM2_PARTITION, 603 .prcm_partition = OMAP4430_CM2_PARTITION,
232 .cm_inst = OMAP4430_CM2_CAM_INST, 604 .cm_inst = OMAP4430_CM2_CAM_INST,
233 .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, 605 .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS,
606 .wkdep_srcs = iss_wkup_sleep_deps,
607 .sleepdep_srcs = iss_wkup_sleep_deps,
234 .flags = CLKDM_CAN_HWSUP_SWSUP, 608 .flags = CLKDM_CAN_HWSUP_SWSUP,
235 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 609 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
236}; 610};
@@ -241,6 +615,9 @@ static struct clockdomain l3_dss_44xx_clkdm = {
241 .prcm_partition = OMAP4430_CM2_PARTITION, 615 .prcm_partition = OMAP4430_CM2_PARTITION,
242 .cm_inst = OMAP4430_CM2_DSS_INST, 616 .cm_inst = OMAP4430_CM2_DSS_INST,
243 .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS, 617 .clkdm_offs = OMAP4430_CM2_DSS_DSS_CDOFFS,
618 .dep_bit = OMAP4430_DSS_STATDEP_SHIFT,
619 .wkdep_srcs = l3_dss_wkup_sleep_deps,
620 .sleepdep_srcs = l3_dss_wkup_sleep_deps,
244 .flags = CLKDM_CAN_HWSUP_SWSUP, 621 .flags = CLKDM_CAN_HWSUP_SWSUP,
245 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 622 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
246}; 623};
@@ -251,6 +628,7 @@ static struct clockdomain l4_wkup_44xx_clkdm = {
251 .prcm_partition = OMAP4430_PRM_PARTITION, 628 .prcm_partition = OMAP4430_PRM_PARTITION,
252 .cm_inst = OMAP4430_PRM_WKUP_CM_INST, 629 .cm_inst = OMAP4430_PRM_WKUP_CM_INST,
253 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, 630 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS,
631 .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT,
254 .flags = CLKDM_CAN_HWSUP, 632 .flags = CLKDM_CAN_HWSUP,
255 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 633 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
256}; 634};
@@ -271,6 +649,8 @@ static struct clockdomain l3_dma_44xx_clkdm = {
271 .prcm_partition = OMAP4430_CM2_PARTITION, 649 .prcm_partition = OMAP4430_CM2_PARTITION,
272 .cm_inst = OMAP4430_CM2_CORE_INST, 650 .cm_inst = OMAP4430_CM2_CORE_INST,
273 .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS, 651 .clkdm_offs = OMAP4430_CM2_CORE_SDMA_CDOFFS,
652 .wkdep_srcs = l3_dma_wkup_sleep_deps,
653 .sleepdep_srcs = l3_dma_wkup_sleep_deps,
274 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 654 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
275 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 655 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
276}; 656};
@@ -305,5 +685,5 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = {
305 685
306void __init omap44xx_clockdomains_init(void) 686void __init omap44xx_clockdomains_init(void)
307{ 687{
308 clkdm_init(clockdomains_omap44xx, NULL); 688 clkdm_init(clockdomains_omap44xx, NULL, &omap4_clkdm_operations);
309} 689}
diff --git a/arch/arm/mach-omap2/cm-regbits-24xx.h b/arch/arm/mach-omap2/cm-regbits-24xx.h
index d70660e82fe6..686290437568 100644
--- a/arch/arm/mach-omap2/cm-regbits-24xx.h
+++ b/arch/arm/mach-omap2/cm-regbits-24xx.h
@@ -210,8 +210,11 @@
210#define OMAP24XX_AUTO_USB_MASK (1 << 0) 210#define OMAP24XX_AUTO_USB_MASK (1 << 0)
211 211
212/* CM_AUTOIDLE3_CORE */ 212/* CM_AUTOIDLE3_CORE */
213#define OMAP24XX_AUTO_SDRC_SHIFT 2
213#define OMAP24XX_AUTO_SDRC_MASK (1 << 2) 214#define OMAP24XX_AUTO_SDRC_MASK (1 << 2)
215#define OMAP24XX_AUTO_GPMC_SHIFT 1
214#define OMAP24XX_AUTO_GPMC_MASK (1 << 1) 216#define OMAP24XX_AUTO_GPMC_MASK (1 << 1)
217#define OMAP24XX_AUTO_SDMA_SHIFT 0
215#define OMAP24XX_AUTO_SDMA_MASK (1 << 0) 218#define OMAP24XX_AUTO_SDMA_MASK (1 << 0)
216 219
217/* CM_AUTOIDLE4_CORE */ 220/* CM_AUTOIDLE4_CORE */
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
index 96954aa48671..9d0dec806e92 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -25,6 +25,14 @@
25#include "cm-regbits-24xx.h" 25#include "cm-regbits-24xx.h"
26#include "cm-regbits-34xx.h" 26#include "cm-regbits-34xx.h"
27 27
28/* CM_AUTOIDLE_PLL.AUTO_* bit values for DPLLs */
29#define DPLL_AUTOIDLE_DISABLE 0x0
30#define OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP 0x3
31
32/* CM_AUTOIDLE_PLL.AUTO_* bit values for APLLs (OMAP2xxx only) */
33#define OMAP2XXX_APLL_AUTOIDLE_DISABLE 0x0
34#define OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP 0x3
35
28static const u8 cm_idlest_offs[] = { 36static const u8 cm_idlest_offs[] = {
29 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3 37 CM_IDLEST1, CM_IDLEST2, OMAP2430_CM_IDLEST3
30}; 38};
@@ -125,6 +133,67 @@ void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask)
125 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask); 133 _write_clktrctrl(OMAP34XX_CLKSTCTRL_FORCE_WAKEUP, module, mask);
126} 134}
127 135
136/*
137 * DPLL autoidle control
138 */
139
140static void _omap2xxx_set_dpll_autoidle(u8 m)
141{
142 u32 v;
143
144 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
145 v &= ~OMAP24XX_AUTO_DPLL_MASK;
146 v |= m << OMAP24XX_AUTO_DPLL_SHIFT;
147 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE);
148}
149
150void omap2xxx_cm_set_dpll_disable_autoidle(void)
151{
152 _omap2xxx_set_dpll_autoidle(OMAP2XXX_DPLL_AUTOIDLE_LOW_POWER_STOP);
153}
154
155void omap2xxx_cm_set_dpll_auto_low_power_stop(void)
156{
157 _omap2xxx_set_dpll_autoidle(DPLL_AUTOIDLE_DISABLE);
158}
159
160/*
161 * APLL autoidle control
162 */
163
164static void _omap2xxx_set_apll_autoidle(u8 m, u32 mask)
165{
166 u32 v;
167
168 v = omap2_cm_read_mod_reg(PLL_MOD, CM_AUTOIDLE);
169 v &= ~mask;
170 v |= m << __ffs(mask);
171 omap2_cm_write_mod_reg(v, PLL_MOD, CM_AUTOIDLE);
172}
173
174void omap2xxx_cm_set_apll54_disable_autoidle(void)
175{
176 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP,
177 OMAP24XX_AUTO_54M_MASK);
178}
179
180void omap2xxx_cm_set_apll54_auto_low_power_stop(void)
181{
182 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE,
183 OMAP24XX_AUTO_54M_MASK);
184}
185
186void omap2xxx_cm_set_apll96_disable_autoidle(void)
187{
188 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_LOW_POWER_STOP,
189 OMAP24XX_AUTO_96M_MASK);
190}
191
192void omap2xxx_cm_set_apll96_auto_low_power_stop(void)
193{
194 _omap2xxx_set_apll_autoidle(OMAP2XXX_APLL_AUTOIDLE_DISABLE,
195 OMAP24XX_AUTO_96M_MASK);
196}
128 197
129/* 198/*
130 * 199 *
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.h b/arch/arm/mach-omap2/cm2xxx_3xxx.h
index 5e9ea5bd60b9..088bbad73db5 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.h
@@ -122,6 +122,14 @@ extern void omap3xxx_cm_clkdm_disable_hwsup(s16 module, u32 mask);
122extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask); 122extern void omap3xxx_cm_clkdm_force_sleep(s16 module, u32 mask);
123extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask); 123extern void omap3xxx_cm_clkdm_force_wakeup(s16 module, u32 mask);
124 124
125extern void omap2xxx_cm_set_dpll_disable_autoidle(void);
126extern void omap2xxx_cm_set_dpll_auto_low_power_stop(void);
127
128extern void omap2xxx_cm_set_apll54_disable_autoidle(void);
129extern void omap2xxx_cm_set_apll54_auto_low_power_stop(void);
130extern void omap2xxx_cm_set_apll96_disable_autoidle(void);
131extern void omap2xxx_cm_set_apll96_auto_low_power_stop(void);
132
125#endif 133#endif
126 134
127/* CM register bits shared between 24XX and 3430 */ 135/* CM register bits shared between 24XX and 3430 */
diff --git a/arch/arm/mach-omap2/cm44xx.h b/arch/arm/mach-omap2/cm44xx.h
index 48fc3f426fbd..0b87ec82b41c 100644
--- a/arch/arm/mach-omap2/cm44xx.h
+++ b/arch/arm/mach-omap2/cm44xx.h
@@ -21,6 +21,7 @@
21#include "cm.h" 21#include "cm.h"
22 22
23#define OMAP4_CM_CLKSTCTRL 0x0000 23#define OMAP4_CM_CLKSTCTRL 0x0000
24#define OMAP4_CM_STATICDEP 0x0004
24 25
25/* Function prototypes */ 26/* Function prototypes */
26# ifndef __ASSEMBLER__ 27# ifndef __ASSEMBLER__
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index c04bbbea17a5..a482bfa0a954 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -73,6 +73,27 @@ u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, s16 inst,
73 return v; 73 return v;
74} 74}
75 75
76u32 omap4_cminst_set_inst_reg_bits(u32 bits, u8 part, s16 inst, s16 idx)
77{
78 return omap4_cminst_rmw_inst_reg_bits(bits, bits, part, inst, idx);
79}
80
81u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst, s16 idx)
82{
83 return omap4_cminst_rmw_inst_reg_bits(bits, 0x0, part, inst, idx);
84}
85
86u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx, u32 mask)
87{
88 u32 v;
89
90 v = omap4_cminst_read_inst_reg(part, inst, idx);
91 v &= mask;
92 v >>= __ffs(mask);
93
94 return v;
95}
96
76/* 97/*
77 * 98 *
78 */ 99 */
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h
index a6abd0a8cb82..2b32c181a2ee 100644
--- a/arch/arm/mach-omap2/cminst44xx.h
+++ b/arch/arm/mach-omap2/cminst44xx.h
@@ -25,6 +25,12 @@ extern u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx);
25extern void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx); 25extern void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx);
26extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part, 26extern u32 omap4_cminst_rmw_inst_reg_bits(u32 mask, u32 bits, u8 part,
27 s16 inst, s16 idx); 27 s16 inst, s16 idx);
28extern u32 omap4_cminst_set_inst_reg_bits(u32 bits, u8 part, s16 inst,
29 s16 idx);
30extern u32 omap4_cminst_clear_inst_reg_bits(u32 bits, u8 part, s16 inst,
31 s16 idx);
32extern u32 omap4_cminst_read_inst_reg_bits(u8 part, u16 inst, s16 idx,
33 u32 mask);
28 34
29extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg); 35extern int omap4_cm_wait_module_ready(void __iomem *clkctrl_reg);
30 36
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 778929f7e92d..48de4513de49 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -40,7 +40,7 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
40 40
41#endif 41#endif
42 42
43#if defined(CONFIG_ARCH_OMAP2420) 43#if defined(CONFIG_SOC_OMAP2420)
44 44
45static struct omap_globals omap242x_globals = { 45static struct omap_globals omap242x_globals = {
46 .class = OMAP242X_CLASS, 46 .class = OMAP242X_CLASS,
@@ -61,7 +61,7 @@ void __init omap2_set_globals_242x(void)
61} 61}
62#endif 62#endif
63 63
64#if defined(CONFIG_ARCH_OMAP2430) 64#if defined(CONFIG_SOC_OMAP2430)
65 65
66static struct omap_globals omap243x_globals = { 66static struct omap_globals omap243x_globals = {
67 .class = OMAP243X_CLASS, 67 .class = OMAP243X_CLASS,
@@ -108,6 +108,27 @@ void __init omap3_map_io(void)
108 omap2_set_globals_3xxx(); 108 omap2_set_globals_3xxx();
109 omap34xx_map_common_io(); 109 omap34xx_map_common_io();
110} 110}
111
112/*
113 * Adjust TAP register base such that omap3_check_revision accesses the correct
114 * TI816X register for checking device ID (it adds 0x204 to tap base while
115 * TI816X DEVICE ID register is at offset 0x600 from control base).
116 */
117#define TI816X_TAP_BASE (TI816X_CTRL_BASE + \
118 TI816X_CONTROL_DEVICE_ID - 0x204)
119
120static struct omap_globals ti816x_globals = {
121 .class = OMAP343X_CLASS,
122 .tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
123 .ctrl = TI816X_CTRL_BASE,
124 .prm = TI816X_PRCM_BASE,
125 .cm = TI816X_PRCM_BASE,
126};
127
128void __init omap2_set_globals_ti816x(void)
129{
130 __omap2_set_globals(&ti816x_globals);
131}
111#endif 132#endif
112 133
113#if defined(CONFIG_ARCH_OMAP4) 134#if defined(CONFIG_ARCH_OMAP4)
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index f0629ae04102..c2804c1c4efd 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -52,6 +52,9 @@
52#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00 52#define OMAP343X_CONTROL_PADCONFS_WKUP 0xa00
53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60 53#define OMAP343X_CONTROL_GENERAL_WKUP 0xa60
54 54
55/* TI816X spefic control submodules */
56#define TI816X_CONTROL_DEVCONF 0x600
57
55/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */ 58/* Control register offsets - read/write with omap_ctrl_{read,write}{bwl}() */
56 59
57#define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10) 60#define OMAP2_CONTROL_SYSCONFIG (OMAP2_CONTROL_INTERFACE + 0x10)
@@ -241,6 +244,9 @@
241#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250 244#define OMAP3_PADCONF_SAD2D_MSTANDBY 0x250
242#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254 245#define OMAP3_PADCONF_SAD2D_IDLEACK 0x254
243 246
247/* TI816X CONTROL_DEVCONF register offsets */
248#define TI816X_CONTROL_DEVICE_ID (TI816X_CONTROL_DEVCONF + 0x000)
249
244/* 250/*
245 * REVISIT: This list of registers is not comprehensive - there are more 251 * REVISIT: This list of registers is not comprehensive - there are more
246 * that should be added. 252 * that should be added.
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index f7b22a16f385..7cc80715ef12 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -99,14 +99,14 @@ static int omap3_idle_bm_check(void)
99static int _cpuidle_allow_idle(struct powerdomain *pwrdm, 99static int _cpuidle_allow_idle(struct powerdomain *pwrdm,
100 struct clockdomain *clkdm) 100 struct clockdomain *clkdm)
101{ 101{
102 omap2_clkdm_allow_idle(clkdm); 102 clkdm_allow_idle(clkdm);
103 return 0; 103 return 0;
104} 104}
105 105
106static int _cpuidle_deny_idle(struct powerdomain *pwrdm, 106static int _cpuidle_deny_idle(struct powerdomain *pwrdm,
107 struct clockdomain *clkdm) 107 struct clockdomain *clkdm)
108{ 108{
109 omap2_clkdm_deny_idle(clkdm); 109 clkdm_deny_idle(clkdm);
110 return 0; 110 return 0;
111} 111}
112 112
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 2c9c912f2c42..0d2d6a9c303c 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -15,6 +15,7 @@
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/slab.h>
18 19
19#include <mach/hardware.h> 20#include <mach/hardware.h>
20#include <mach/irqs.h> 21#include <mach/irqs.h>
@@ -30,10 +31,75 @@
30#include <plat/dma.h> 31#include <plat/dma.h>
31#include <plat/omap_hwmod.h> 32#include <plat/omap_hwmod.h>
32#include <plat/omap_device.h> 33#include <plat/omap_device.h>
34#include <plat/omap4-keypad.h>
33 35
34#include "mux.h" 36#include "mux.h"
35#include "control.h" 37#include "control.h"
36 38
39#define L3_MODULES_MAX_LEN 12
40#define L3_MODULES 3
41
42static int __init omap3_l3_init(void)
43{
44 int l;
45 struct omap_hwmod *oh;
46 struct omap_device *od;
47 char oh_name[L3_MODULES_MAX_LEN];
48
49 /*
50 * To avoid code running on other OMAPs in
51 * multi-omap builds
52 */
53 if (!(cpu_is_omap34xx()))
54 return -ENODEV;
55
56 l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main");
57
58 oh = omap_hwmod_lookup(oh_name);
59
60 if (!oh)
61 pr_err("could not look up %s\n", oh_name);
62
63 od = omap_device_build("omap_l3_smx", 0, oh, NULL, 0,
64 NULL, 0, 0);
65
66 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
67
68 return PTR_ERR(od);
69}
70postcore_initcall(omap3_l3_init);
71
72static int __init omap4_l3_init(void)
73{
74 int l, i;
75 struct omap_hwmod *oh[3];
76 struct omap_device *od;
77 char oh_name[L3_MODULES_MAX_LEN];
78
79 /*
80 * To avoid code running on other OMAPs in
81 * multi-omap builds
82 */
83 if (!(cpu_is_omap44xx()))
84 return -ENODEV;
85
86 for (i = 0; i < L3_MODULES; i++) {
87 l = snprintf(oh_name, L3_MODULES_MAX_LEN, "l3_main_%d", i+1);
88
89 oh[i] = omap_hwmod_lookup(oh_name);
90 if (!(oh[i]))
91 pr_err("could not look up %s\n", oh_name);
92 }
93
94 od = omap_device_build_ss("omap_l3_noc", 0, oh, 3, NULL,
95 0, NULL, 0, 0);
96
97 WARN(IS_ERR(od), "could not build omap_device for %s\n", oh_name);
98
99 return PTR_ERR(od);
100}
101postcore_initcall(omap4_l3_init);
102
37#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) 103#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
38 104
39static struct resource cam_resources[] = { 105static struct resource cam_resources[] = {
@@ -141,96 +207,70 @@ static inline void omap_init_camera(void)
141} 207}
142#endif 208#endif
143 209
144#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 210struct omap_device_pm_latency omap_keyboard_latency[] = {
145
146#define MBOX_REG_SIZE 0x120
147
148#ifdef CONFIG_ARCH_OMAP2
149static struct resource omap2_mbox_resources[] = {
150 {
151 .start = OMAP24XX_MAILBOX_BASE,
152 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
153 .flags = IORESOURCE_MEM,
154 },
155 {
156 .start = INT_24XX_MAIL_U0_MPU,
157 .flags = IORESOURCE_IRQ,
158 .name = "dsp",
159 },
160 { 211 {
161 .start = INT_24XX_MAIL_U3_MPU, 212 .deactivate_func = omap_device_idle_hwmods,
162 .flags = IORESOURCE_IRQ, 213 .activate_func = omap_device_enable_hwmods,
163 .name = "iva", 214 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
164 }, 215 },
165}; 216};
166static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
167#else
168#define omap2_mbox_resources NULL
169#define omap2_mbox_resources_sz 0
170#endif
171 217
172#ifdef CONFIG_ARCH_OMAP3 218int __init omap4_keyboard_init(struct omap4_keypad_platform_data
173static struct resource omap3_mbox_resources[] = { 219 *sdp4430_keypad_data)
174 { 220{
175 .start = OMAP34XX_MAILBOX_BASE, 221 struct omap_device *od;
176 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, 222 struct omap_hwmod *oh;
177 .flags = IORESOURCE_MEM, 223 struct omap4_keypad_platform_data *keypad_data;
178 }, 224 unsigned int id = -1;
179 { 225 char *oh_name = "kbd";
180 .start = INT_24XX_MAIL_U0_MPU, 226 char *name = "omap4-keypad";
181 .flags = IORESOURCE_IRQ,
182 .name = "dsp",
183 },
184};
185static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
186#else
187#define omap3_mbox_resources NULL
188#define omap3_mbox_resources_sz 0
189#endif
190 227
191#ifdef CONFIG_ARCH_OMAP4 228 oh = omap_hwmod_lookup(oh_name);
229 if (!oh) {
230 pr_err("Could not look up %s\n", oh_name);
231 return -ENODEV;
232 }
192 233
193#define OMAP4_MBOX_REG_SIZE 0x130 234 keypad_data = sdp4430_keypad_data;
194static struct resource omap4_mbox_resources[] = {
195 {
196 .start = OMAP44XX_MAILBOX_BASE,
197 .end = OMAP44XX_MAILBOX_BASE +
198 OMAP4_MBOX_REG_SIZE - 1,
199 .flags = IORESOURCE_MEM,
200 },
201 {
202 .start = OMAP44XX_IRQ_MAIL_U0,
203 .flags = IORESOURCE_IRQ,
204 .name = "mbox",
205 },
206};
207static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
208#else
209#define omap4_mbox_resources NULL
210#define omap4_mbox_resources_sz 0
211#endif
212 235
213static struct platform_device mbox_device = { 236 od = omap_device_build(name, id, oh, keypad_data,
214 .name = "omap-mailbox", 237 sizeof(struct omap4_keypad_platform_data),
215 .id = -1, 238 omap_keyboard_latency,
239 ARRAY_SIZE(omap_keyboard_latency), 0);
240
241 if (IS_ERR(od)) {
242 WARN(1, "Cant build omap_device for %s:%s.\n",
243 name, oh->name);
244 return PTR_ERR(od);
245 }
246
247 return 0;
248}
249
250#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
251static struct omap_device_pm_latency mbox_latencies[] = {
252 [0] = {
253 .activate_func = omap_device_enable_hwmods,
254 .deactivate_func = omap_device_idle_hwmods,
255 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
256 },
216}; 257};
217 258
218static inline void omap_init_mbox(void) 259static inline void omap_init_mbox(void)
219{ 260{
220 if (cpu_is_omap24xx()) { 261 struct omap_hwmod *oh;
221 mbox_device.resource = omap2_mbox_resources; 262 struct omap_device *od;
222 mbox_device.num_resources = omap2_mbox_resources_sz; 263
223 } else if (cpu_is_omap34xx()) { 264 oh = omap_hwmod_lookup("mailbox");
224 mbox_device.resource = omap3_mbox_resources; 265 if (!oh) {
225 mbox_device.num_resources = omap3_mbox_resources_sz; 266 pr_err("%s: unable to find hwmod\n", __func__);
226 } else if (cpu_is_omap44xx()) {
227 mbox_device.resource = omap4_mbox_resources;
228 mbox_device.num_resources = omap4_mbox_resources_sz;
229 } else {
230 pr_err("%s: platform not supported\n", __func__);
231 return; 267 return;
232 } 268 }
233 platform_device_register(&mbox_device); 269
270 od = omap_device_build("omap-mailbox", -1, oh, NULL, 0,
271 mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
272 WARN(IS_ERR(od), "%s: could not build device, err %ld\n",
273 __func__, PTR_ERR(od));
234} 274}
235#else 275#else
236static inline void omap_init_mbox(void) { } 276static inline void omap_init_mbox(void) { }
@@ -279,163 +319,55 @@ static inline void omap_init_audio(void) {}
279 319
280#include <plat/mcspi.h> 320#include <plat/mcspi.h>
281 321
282#define OMAP2_MCSPI1_BASE 0x48098000 322struct omap_device_pm_latency omap_mcspi_latency[] = {
283#define OMAP2_MCSPI2_BASE 0x4809a000 323 [0] = {
284#define OMAP2_MCSPI3_BASE 0x480b8000 324 .deactivate_func = omap_device_idle_hwmods,
285#define OMAP2_MCSPI4_BASE 0x480ba000 325 .activate_func = omap_device_enable_hwmods,
286 326 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
287#define OMAP4_MCSPI1_BASE 0x48098100
288#define OMAP4_MCSPI2_BASE 0x4809a100
289#define OMAP4_MCSPI3_BASE 0x480b8100
290#define OMAP4_MCSPI4_BASE 0x480ba100
291
292static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
293 .num_cs = 4,
294};
295
296static struct resource omap2_mcspi1_resources[] = {
297 {
298 .start = OMAP2_MCSPI1_BASE,
299 .end = OMAP2_MCSPI1_BASE + 0xff,
300 .flags = IORESOURCE_MEM,
301 },
302};
303
304static struct platform_device omap2_mcspi1 = {
305 .name = "omap2_mcspi",
306 .id = 1,
307 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
308 .resource = omap2_mcspi1_resources,
309 .dev = {
310 .platform_data = &omap2_mcspi1_config,
311 },
312};
313
314static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
315 .num_cs = 2,
316};
317
318static struct resource omap2_mcspi2_resources[] = {
319 {
320 .start = OMAP2_MCSPI2_BASE,
321 .end = OMAP2_MCSPI2_BASE + 0xff,
322 .flags = IORESOURCE_MEM,
323 },
324};
325
326static struct platform_device omap2_mcspi2 = {
327 .name = "omap2_mcspi",
328 .id = 2,
329 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
330 .resource = omap2_mcspi2_resources,
331 .dev = {
332 .platform_data = &omap2_mcspi2_config,
333 },
334};
335
336#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
337 defined(CONFIG_ARCH_OMAP4)
338static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
339 .num_cs = 2,
340};
341
342static struct resource omap2_mcspi3_resources[] = {
343 {
344 .start = OMAP2_MCSPI3_BASE,
345 .end = OMAP2_MCSPI3_BASE + 0xff,
346 .flags = IORESOURCE_MEM,
347 },
348};
349
350static struct platform_device omap2_mcspi3 = {
351 .name = "omap2_mcspi",
352 .id = 3,
353 .num_resources = ARRAY_SIZE(omap2_mcspi3_resources),
354 .resource = omap2_mcspi3_resources,
355 .dev = {
356 .platform_data = &omap2_mcspi3_config,
357 },
358};
359#endif
360
361#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
362static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
363 .num_cs = 1,
364};
365
366static struct resource omap2_mcspi4_resources[] = {
367 {
368 .start = OMAP2_MCSPI4_BASE,
369 .end = OMAP2_MCSPI4_BASE + 0xff,
370 .flags = IORESOURCE_MEM,
371 },
372};
373
374static struct platform_device omap2_mcspi4 = {
375 .name = "omap2_mcspi",
376 .id = 4,
377 .num_resources = ARRAY_SIZE(omap2_mcspi4_resources),
378 .resource = omap2_mcspi4_resources,
379 .dev = {
380 .platform_data = &omap2_mcspi4_config,
381 }, 327 },
382}; 328};
383#endif
384 329
385#ifdef CONFIG_ARCH_OMAP4 330static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
386static inline void omap4_mcspi_fixup(void)
387{ 331{
388 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE; 332 struct omap_device *od;
389 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff; 333 char *name = "omap2_mcspi";
390 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE; 334 struct omap2_mcspi_platform_config *pdata;
391 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff; 335 static int spi_num;
392 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE; 336 struct omap2_mcspi_dev_attr *mcspi_attrib = oh->dev_attr;
393 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff; 337
394 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE; 338 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
395 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff; 339 if (!pdata) {
396} 340 pr_err("Memory allocation for McSPI device failed\n");
397#else 341 return -ENOMEM;
398static inline void omap4_mcspi_fixup(void) 342 }
399{
400}
401#endif
402 343
403#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ 344 pdata->num_cs = mcspi_attrib->num_chipselect;
404 defined(CONFIG_ARCH_OMAP4) 345 switch (oh->class->rev) {
405static inline void omap2_mcspi3_init(void) 346 case OMAP2_MCSPI_REV:
406{ 347 case OMAP3_MCSPI_REV:
407 platform_device_register(&omap2_mcspi3); 348 pdata->regs_offset = 0;
408} 349 break;
409#else 350 case OMAP4_MCSPI_REV:
410static inline void omap2_mcspi3_init(void) 351 pdata->regs_offset = OMAP4_MCSPI_REG_OFFSET;
411{ 352 break;
412} 353 default:
413#endif 354 pr_err("Invalid McSPI Revision value\n");
355 return -EINVAL;
356 }
414 357
415#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 358 spi_num++;
416static inline void omap2_mcspi4_init(void) 359 od = omap_device_build(name, spi_num, oh, pdata,
417{ 360 sizeof(*pdata), omap_mcspi_latency,
418 platform_device_register(&omap2_mcspi4); 361 ARRAY_SIZE(omap_mcspi_latency), 0);
419} 362 WARN(IS_ERR(od), "Cant build omap_device for %s:%s\n",
420#else 363 name, oh->name);
421static inline void omap2_mcspi4_init(void) 364 kfree(pdata);
422{ 365 return 0;
423} 366}
424#endif
425 367
426static void omap_init_mcspi(void) 368static void omap_init_mcspi(void)
427{ 369{
428 if (cpu_is_omap44xx()) 370 omap_hwmod_for_each_by_class("mcspi", omap_mcspi_init, NULL);
429 omap4_mcspi_fixup();
430
431 platform_device_register(&omap2_mcspi1);
432 platform_device_register(&omap2_mcspi2);
433
434 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
435 omap2_mcspi3_init();
436
437 if (cpu_is_omap343x() || cpu_is_omap44xx())
438 omap2_mcspi4_init();
439} 371}
440 372
441#else 373#else
@@ -610,117 +542,10 @@ static inline void omap_init_aes(void) { }
610 542
611/*-------------------------------------------------------------------------*/ 543/*-------------------------------------------------------------------------*/
612 544
613#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 545#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
614
615#define MMCHS_SYSCONFIG 0x0010
616#define MMCHS_SYSCONFIG_SWRESET (1 << 1)
617#define MMCHS_SYSSTATUS 0x0014
618#define MMCHS_SYSSTATUS_RESETDONE (1 << 0)
619
620static struct platform_device dummy_pdev = {
621 .dev = {
622 .bus = &platform_bus_type,
623 },
624};
625
626/**
627 * omap_hsmmc_reset() - Full reset of each HS-MMC controller
628 *
629 * Ensure that each MMC controller is fully reset. Controllers
630 * left in an unknown state (by bootloader) may prevent retention
631 * or OFF-mode. This is especially important in cases where the
632 * MMC driver is not enabled, _or_ built as a module.
633 *
634 * In order for reset to work, interface, functional and debounce
635 * clocks must be enabled. The debounce clock comes from func_32k_clk
636 * and is not under SW control, so we only enable i- and f-clocks.
637 **/
638static void __init omap_hsmmc_reset(void)
639{
640 u32 i, nr_controllers;
641 struct clk *iclk, *fclk;
642
643 if (cpu_is_omap242x())
644 return;
645
646 nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC :
647 (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC);
648 546
649 for (i = 0; i < nr_controllers; i++) { 547static inline void omap242x_mmc_mux(struct omap_mmc_platform_data
650 u32 v, base = 0; 548 *mmc_controller)
651 struct device *dev = &dummy_pdev.dev;
652
653 switch (i) {
654 case 0:
655 base = OMAP2_MMC1_BASE;
656 break;
657 case 1:
658 base = OMAP2_MMC2_BASE;
659 break;
660 case 2:
661 base = OMAP3_MMC3_BASE;
662 break;
663 case 3:
664 if (!cpu_is_omap44xx())
665 return;
666 base = OMAP4_MMC4_BASE;
667 break;
668 case 4:
669 if (!cpu_is_omap44xx())
670 return;
671 base = OMAP4_MMC5_BASE;
672 break;
673 }
674
675 if (cpu_is_omap44xx())
676 base += OMAP4_MMC_REG_OFFSET;
677
678 dummy_pdev.id = i;
679 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
680 iclk = clk_get(dev, "ick");
681 if (IS_ERR(iclk))
682 goto err1;
683 if (clk_enable(iclk))
684 goto err2;
685
686 fclk = clk_get(dev, "fck");
687 if (IS_ERR(fclk))
688 goto err3;
689 if (clk_enable(fclk))
690 goto err4;
691
692 omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG);
693 v = omap_readl(base + MMCHS_SYSSTATUS);
694 while (!(omap_readl(base + MMCHS_SYSSTATUS) &
695 MMCHS_SYSSTATUS_RESETDONE))
696 cpu_relax();
697
698 clk_disable(fclk);
699 clk_put(fclk);
700 clk_disable(iclk);
701 clk_put(iclk);
702 }
703 return;
704
705err4:
706 clk_put(fclk);
707err3:
708 clk_disable(iclk);
709err2:
710 clk_put(iclk);
711err1:
712 printk(KERN_WARNING "%s: Unable to enable clocks for MMC%d, "
713 "cannot reset.\n", __func__, i);
714}
715#else
716static inline void omap_hsmmc_reset(void) {}
717#endif
718
719#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
720 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
721
722static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
723 int controller_nr)
724{ 549{
725 if ((mmc_controller->slots[0].switch_pin > 0) && \ 550 if ((mmc_controller->slots[0].switch_pin > 0) && \
726 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) 551 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
@@ -731,163 +556,44 @@ static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
731 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, 556 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
732 OMAP_PIN_INPUT_PULLUP); 557 OMAP_PIN_INPUT_PULLUP);
733 558
734 if (cpu_is_omap2420() && controller_nr == 0) { 559 omap_mux_init_signal("sdmmc_cmd", 0);
735 omap_mux_init_signal("sdmmc_cmd", 0); 560 omap_mux_init_signal("sdmmc_clki", 0);
736 omap_mux_init_signal("sdmmc_clki", 0); 561 omap_mux_init_signal("sdmmc_clko", 0);
737 omap_mux_init_signal("sdmmc_clko", 0); 562 omap_mux_init_signal("sdmmc_dat0", 0);
738 omap_mux_init_signal("sdmmc_dat0", 0); 563 omap_mux_init_signal("sdmmc_dat_dir0", 0);
739 omap_mux_init_signal("sdmmc_dat_dir0", 0); 564 omap_mux_init_signal("sdmmc_cmd_dir", 0);
740 omap_mux_init_signal("sdmmc_cmd_dir", 0); 565 if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) {
741 if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) { 566 omap_mux_init_signal("sdmmc_dat1", 0);
742 omap_mux_init_signal("sdmmc_dat1", 0); 567 omap_mux_init_signal("sdmmc_dat2", 0);
743 omap_mux_init_signal("sdmmc_dat2", 0); 568 omap_mux_init_signal("sdmmc_dat3", 0);
744 omap_mux_init_signal("sdmmc_dat3", 0); 569 omap_mux_init_signal("sdmmc_dat_dir1", 0);
745 omap_mux_init_signal("sdmmc_dat_dir1", 0); 570 omap_mux_init_signal("sdmmc_dat_dir2", 0);
746 omap_mux_init_signal("sdmmc_dat_dir2", 0); 571 omap_mux_init_signal("sdmmc_dat_dir3", 0);
747 omap_mux_init_signal("sdmmc_dat_dir3", 0);
748 }
749
750 /*
751 * Use internal loop-back in MMC/SDIO Module Input Clock
752 * selection
753 */
754 if (mmc_controller->slots[0].internal_clock) {
755 u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
756 v |= (1 << 24);
757 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
758 }
759 } 572 }
760 573
761 if (cpu_is_omap34xx()) { 574 /*
762 if (controller_nr == 0) { 575 * Use internal loop-back in MMC/SDIO Module Input Clock
763 omap_mux_init_signal("sdmmc1_clk", 576 * selection
764 OMAP_PIN_INPUT_PULLUP); 577 */
765 omap_mux_init_signal("sdmmc1_cmd", 578 if (mmc_controller->slots[0].internal_clock) {
766 OMAP_PIN_INPUT_PULLUP); 579 u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
767 omap_mux_init_signal("sdmmc1_dat0", 580 v |= (1 << 24);
768 OMAP_PIN_INPUT_PULLUP); 581 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
769 if (mmc_controller->slots[0].caps &
770 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
771 omap_mux_init_signal("sdmmc1_dat1",
772 OMAP_PIN_INPUT_PULLUP);
773 omap_mux_init_signal("sdmmc1_dat2",
774 OMAP_PIN_INPUT_PULLUP);
775 omap_mux_init_signal("sdmmc1_dat3",
776 OMAP_PIN_INPUT_PULLUP);
777 }
778 if (mmc_controller->slots[0].caps &
779 MMC_CAP_8_BIT_DATA) {
780 omap_mux_init_signal("sdmmc1_dat4",
781 OMAP_PIN_INPUT_PULLUP);
782 omap_mux_init_signal("sdmmc1_dat5",
783 OMAP_PIN_INPUT_PULLUP);
784 omap_mux_init_signal("sdmmc1_dat6",
785 OMAP_PIN_INPUT_PULLUP);
786 omap_mux_init_signal("sdmmc1_dat7",
787 OMAP_PIN_INPUT_PULLUP);
788 }
789 }
790 if (controller_nr == 1) {
791 /* MMC2 */
792 omap_mux_init_signal("sdmmc2_clk",
793 OMAP_PIN_INPUT_PULLUP);
794 omap_mux_init_signal("sdmmc2_cmd",
795 OMAP_PIN_INPUT_PULLUP);
796 omap_mux_init_signal("sdmmc2_dat0",
797 OMAP_PIN_INPUT_PULLUP);
798
799 /*
800 * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed
801 * in the board-*.c files
802 */
803 if (mmc_controller->slots[0].caps &
804 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
805 omap_mux_init_signal("sdmmc2_dat1",
806 OMAP_PIN_INPUT_PULLUP);
807 omap_mux_init_signal("sdmmc2_dat2",
808 OMAP_PIN_INPUT_PULLUP);
809 omap_mux_init_signal("sdmmc2_dat3",
810 OMAP_PIN_INPUT_PULLUP);
811 }
812 if (mmc_controller->slots[0].caps &
813 MMC_CAP_8_BIT_DATA) {
814 omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4",
815 OMAP_PIN_INPUT_PULLUP);
816 omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5",
817 OMAP_PIN_INPUT_PULLUP);
818 omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6",
819 OMAP_PIN_INPUT_PULLUP);
820 omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7",
821 OMAP_PIN_INPUT_PULLUP);
822 }
823 }
824
825 /*
826 * For MMC3 the pins need to be muxed in the board-*.c files
827 */
828 } 582 }
829} 583}
830 584
831void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, 585void __init omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
832 int nr_controllers)
833{ 586{
834 int i; 587 char *name = "mmci-omap";
835 char *name;
836 588
837 for (i = 0; i < nr_controllers; i++) { 589 if (!mmc_data[0]) {
838 unsigned long base, size; 590 pr_err("%s fails: Incomplete platform data\n", __func__);
839 unsigned int irq = 0; 591 return;
840 592 }
841 if (!mmc_data[i])
842 continue;
843
844 omap2_mmc_mux(mmc_data[i], i);
845 593
846 switch (i) { 594 omap242x_mmc_mux(mmc_data[0]);
847 case 0: 595 omap_mmc_add(name, 0, OMAP2_MMC1_BASE, OMAP2420_MMC_SIZE,
848 base = OMAP2_MMC1_BASE; 596 INT_24XX_MMC_IRQ, mmc_data[0]);
849 irq = INT_24XX_MMC_IRQ;
850 break;
851 case 1:
852 base = OMAP2_MMC2_BASE;
853 irq = INT_24XX_MMC2_IRQ;
854 break;
855 case 2:
856 if (!cpu_is_omap44xx() && !cpu_is_omap34xx())
857 return;
858 base = OMAP3_MMC3_BASE;
859 irq = INT_34XX_MMC3_IRQ;
860 break;
861 case 3:
862 if (!cpu_is_omap44xx())
863 return;
864 base = OMAP4_MMC4_BASE;
865 irq = OMAP44XX_IRQ_MMC4;
866 break;
867 case 4:
868 if (!cpu_is_omap44xx())
869 return;
870 base = OMAP4_MMC5_BASE;
871 irq = OMAP44XX_IRQ_MMC5;
872 break;
873 default:
874 continue;
875 }
876
877 if (cpu_is_omap2420()) {
878 size = OMAP2420_MMC_SIZE;
879 name = "mmci-omap";
880 } else if (cpu_is_omap44xx()) {
881 if (i < 3)
882 irq += OMAP44XX_IRQ_GIC_START;
883 size = OMAP4_HSMMC_SIZE;
884 name = "mmci-omap-hs";
885 } else {
886 size = OMAP3_HSMMC_SIZE;
887 name = "mmci-omap-hs";
888 }
889 omap_mmc_add(name, i, base, size, irq, mmc_data[i]);
890 };
891} 597}
892 598
893#endif 599#endif
@@ -895,7 +601,7 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
895/*-------------------------------------------------------------------------*/ 601/*-------------------------------------------------------------------------*/
896 602
897#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE) 603#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
898#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) 604#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430)
899#define OMAP_HDQ_BASE 0x480B2000 605#define OMAP_HDQ_BASE 0x480B2000
900#endif 606#endif
901static struct resource omap_hdq_resources[] = { 607static struct resource omap_hdq_resources[] = {
@@ -961,7 +667,6 @@ static int __init omap2_init_devices(void)
961 * please keep these calls, and their implementations above, 667 * please keep these calls, and their implementations above,
962 * in alphabetical order so they're easier to sort through. 668 * in alphabetical order so they're easier to sort through.
963 */ 669 */
964 omap_hsmmc_reset();
965 omap_init_audio(); 670 omap_init_audio();
966 omap_init_camera(); 671 omap_init_camera();
967 omap_init_mbox(); 672 omap_init_mbox();
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
new file mode 100644
index 000000000000..b18db84b0349
--- /dev/null
+++ b/arch/arm/mach-omap2/display.c
@@ -0,0 +1,45 @@
1/*
2 * OMAP2plus display device setup / initialization.
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Senthilvadivu Guruswamy
6 * Sumit Semwal
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 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/io.h>
22#include <linux/clk.h>
23#include <linux/err.h>
24
25#include <plat/display.h>
26
27static struct platform_device omap_display_device = {
28 .name = "omapdss",
29 .id = -1,
30 .dev = {
31 .platform_data = NULL,
32 },
33};
34
35int __init omap_display_init(struct omap_dss_board_info *board_data)
36{
37 int r = 0;
38 omap_display_device.dev.platform_data = board_data;
39
40 r = platform_device_register(&omap_display_device);
41 if (r < 0)
42 printk(KERN_ERR "Unable to register OMAP-Display device\n");
43
44 return r;
45}
diff --git a/arch/arm/mach-omap2/dpll44xx.c b/arch/arm/mach-omap2/dpll44xx.c
new file mode 100644
index 000000000000..4e4da6160d05
--- /dev/null
+++ b/arch/arm/mach-omap2/dpll44xx.c
@@ -0,0 +1,84 @@
1/*
2 * OMAP4-specific DPLL control functions
3 *
4 * Copyright (C) 2011 Texas Instruments, Inc.
5 * Rajendra Nayak
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/errno.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16#include <linux/bitops.h>
17
18#include <plat/cpu.h>
19#include <plat/clock.h>
20
21#include "clock.h"
22#include "cm-regbits-44xx.h"
23
24/* Supported only on OMAP4 */
25int omap4_dpllmx_gatectrl_read(struct clk *clk)
26{
27 u32 v;
28 u32 mask;
29
30 if (!clk || !clk->clksel_reg || !cpu_is_omap44xx())
31 return -EINVAL;
32
33 mask = clk->flags & CLOCK_CLKOUTX2 ?
34 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
35 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
36
37 v = __raw_readl(clk->clksel_reg);
38 v &= mask;
39 v >>= __ffs(mask);
40
41 return v;
42}
43
44void omap4_dpllmx_allow_gatectrl(struct clk *clk)
45{
46 u32 v;
47 u32 mask;
48
49 if (!clk || !clk->clksel_reg || !cpu_is_omap44xx())
50 return;
51
52 mask = clk->flags & CLOCK_CLKOUTX2 ?
53 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
54 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
55
56 v = __raw_readl(clk->clksel_reg);
57 /* Clear the bit to allow gatectrl */
58 v &= ~mask;
59 __raw_writel(v, clk->clksel_reg);
60}
61
62void omap4_dpllmx_deny_gatectrl(struct clk *clk)
63{
64 u32 v;
65 u32 mask;
66
67 if (!clk || !clk->clksel_reg || !cpu_is_omap44xx())
68 return;
69
70 mask = clk->flags & CLOCK_CLKOUTX2 ?
71 OMAP4430_DPLL_CLKOUTX2_GATE_CTRL_MASK :
72 OMAP4430_DPLL_CLKOUT_GATE_CTRL_MASK;
73
74 v = __raw_readl(clk->clksel_reg);
75 /* Set the bit to deny gatectrl */
76 v |= mask;
77 __raw_writel(v, clk->clksel_reg);
78}
79
80const struct clkops clkops_omap4_dpllmx_ops = {
81 .allow_idle = omap4_dpllmx_allow_gatectrl,
82 .deny_idle = omap4_dpllmx_deny_gatectrl,
83};
84
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 2bb29c160702..c1791d08ae56 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/mtd/nand.h>
15 16
16#include <asm/mach/flash.h> 17#include <asm/mach/flash.h>
17 18
@@ -69,8 +70,10 @@ static int omap2_nand_gpmc_retime(void)
69 t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle); 70 t.wr_cycle = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
70 71
71 /* Configure GPMC */ 72 /* Configure GPMC */
72 gpmc_cs_configure(gpmc_nand_data->cs, 73 if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
73 GPMC_CONFIG_DEV_SIZE, gpmc_nand_data->devsize); 74 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
75 else
76 gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
74 gpmc_cs_configure(gpmc_nand_data->cs, 77 gpmc_cs_configure(gpmc_nand_data->cs,
75 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND); 78 GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
76 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t); 79 err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 3a7d25fb00ef..d776ded9830d 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -94,7 +94,7 @@ static int omap2_onenand_set_async_mode(int cs, void __iomem *onenand_base)
94} 94}
95 95
96static void set_onenand_cfg(void __iomem *onenand_base, int latency, 96static void set_onenand_cfg(void __iomem *onenand_base, int latency,
97 int sync_read, int sync_write, int hf) 97 int sync_read, int sync_write, int hf, int vhf)
98{ 98{
99 u32 reg; 99 u32 reg;
100 100
@@ -114,12 +114,57 @@ static void set_onenand_cfg(void __iomem *onenand_base, int latency,
114 reg |= ONENAND_SYS_CFG1_HF; 114 reg |= ONENAND_SYS_CFG1_HF;
115 else 115 else
116 reg &= ~ONENAND_SYS_CFG1_HF; 116 reg &= ~ONENAND_SYS_CFG1_HF;
117 if (vhf)
118 reg |= ONENAND_SYS_CFG1_VHF;
119 else
120 reg &= ~ONENAND_SYS_CFG1_VHF;
117 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); 121 writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
118} 122}
119 123
124static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg,
125 void __iomem *onenand_base, bool *clk_dep)
126{
127 u16 ver = readw(onenand_base + ONENAND_REG_VERSION_ID);
128 int freq = 0;
129
130 if (cfg->get_freq) {
131 struct onenand_freq_info fi;
132
133 fi.maf_id = readw(onenand_base + ONENAND_REG_MANUFACTURER_ID);
134 fi.dev_id = readw(onenand_base + ONENAND_REG_DEVICE_ID);
135 fi.ver_id = ver;
136 freq = cfg->get_freq(&fi, clk_dep);
137 if (freq)
138 return freq;
139 }
140
141 switch ((ver >> 4) & 0xf) {
142 case 0:
143 freq = 40;
144 break;
145 case 1:
146 freq = 54;
147 break;
148 case 2:
149 freq = 66;
150 break;
151 case 3:
152 freq = 83;
153 break;
154 case 4:
155 freq = 104;
156 break;
157 default:
158 freq = 54;
159 break;
160 }
161
162 return freq;
163}
164
120static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg, 165static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
121 void __iomem *onenand_base, 166 void __iomem *onenand_base,
122 int freq) 167 int *freq_ptr)
123{ 168{
124 struct gpmc_timings t; 169 struct gpmc_timings t;
125 const int t_cer = 15; 170 const int t_cer = 15;
@@ -130,10 +175,11 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
130 const int t_wph = 30; 175 const int t_wph = 30;
131 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo; 176 int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
132 int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency; 177 int tick_ns, div, fclk_offset_ns, fclk_offset, gpmc_clk_ns, latency;
133 int first_time = 0, hf = 0, sync_read = 0, sync_write = 0; 178 int first_time = 0, hf = 0, vhf = 0, sync_read = 0, sync_write = 0;
134 int err, ticks_cez; 179 int err, ticks_cez;
135 int cs = cfg->cs; 180 int cs = cfg->cs, freq = *freq_ptr;
136 u32 reg; 181 u32 reg;
182 bool clk_dep = false;
137 183
138 if (cfg->flags & ONENAND_SYNC_READ) { 184 if (cfg->flags & ONENAND_SYNC_READ) {
139 sync_read = 1; 185 sync_read = 1;
@@ -148,27 +194,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
148 err = omap2_onenand_set_async_mode(cs, onenand_base); 194 err = omap2_onenand_set_async_mode(cs, onenand_base);
149 if (err) 195 if (err)
150 return err; 196 return err;
151 reg = readw(onenand_base + ONENAND_REG_VERSION_ID); 197 freq = omap2_onenand_get_freq(cfg, onenand_base, &clk_dep);
152 switch ((reg >> 4) & 0xf) {
153 case 0:
154 freq = 40;
155 break;
156 case 1:
157 freq = 54;
158 break;
159 case 2:
160 freq = 66;
161 break;
162 case 3:
163 freq = 83;
164 break;
165 case 4:
166 freq = 104;
167 break;
168 default:
169 freq = 54;
170 break;
171 }
172 first_time = 1; 198 first_time = 1;
173 } 199 }
174 200
@@ -180,7 +206,7 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
180 t_avdh = 2; 206 t_avdh = 2;
181 t_ach = 3; 207 t_ach = 3;
182 t_aavdh = 6; 208 t_aavdh = 6;
183 t_rdyo = 9; 209 t_rdyo = 6;
184 break; 210 break;
185 case 83: 211 case 83:
186 min_gpmc_clk_period = 12000; /* 83 MHz */ 212 min_gpmc_clk_period = 12000; /* 83 MHz */
@@ -217,16 +243,36 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
217 gpmc_clk_ns = gpmc_ticks_to_ns(div); 243 gpmc_clk_ns = gpmc_ticks_to_ns(div);
218 if (gpmc_clk_ns < 15) /* >66Mhz */ 244 if (gpmc_clk_ns < 15) /* >66Mhz */
219 hf = 1; 245 hf = 1;
220 if (hf) 246 if (gpmc_clk_ns < 12) /* >83Mhz */
247 vhf = 1;
248 if (vhf)
249 latency = 8;
250 else if (hf)
221 latency = 6; 251 latency = 6;
222 else if (gpmc_clk_ns >= 25) /* 40 MHz*/ 252 else if (gpmc_clk_ns >= 25) /* 40 MHz*/
223 latency = 3; 253 latency = 3;
224 else 254 else
225 latency = 4; 255 latency = 4;
226 256
257 if (clk_dep) {
258 if (gpmc_clk_ns < 12) { /* >83Mhz */
259 t_ces = 3;
260 t_avds = 4;
261 } else if (gpmc_clk_ns < 15) { /* >66Mhz */
262 t_ces = 5;
263 t_avds = 4;
264 } else if (gpmc_clk_ns < 25) { /* >40Mhz */
265 t_ces = 6;
266 t_avds = 5;
267 } else {
268 t_ces = 7;
269 t_avds = 7;
270 }
271 }
272
227 if (first_time) 273 if (first_time)
228 set_onenand_cfg(onenand_base, latency, 274 set_onenand_cfg(onenand_base, latency,
229 sync_read, sync_write, hf); 275 sync_read, sync_write, hf, vhf);
230 276
231 if (div == 1) { 277 if (div == 1) {
232 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2); 278 reg = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG2);
@@ -264,6 +310,9 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
264 /* Read */ 310 /* Read */
265 t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh)); 311 t.adv_rd_off = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_avdh));
266 t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach)); 312 t.oe_on = gpmc_ticks_to_ns(fclk_offset + gpmc_ns_to_ticks(t_ach));
313 /* Force at least 1 clk between AVD High to OE Low */
314 if (t.oe_on <= t.adv_rd_off)
315 t.oe_on = t.adv_rd_off + gpmc_round_ns_to_ticks(1);
267 t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div); 316 t.access = gpmc_ticks_to_ns(fclk_offset + (latency + 1) * div);
268 t.oe_off = t.access + gpmc_round_ns_to_ticks(1); 317 t.oe_off = t.access + gpmc_round_ns_to_ticks(1);
269 t.cs_rd_off = t.oe_off; 318 t.cs_rd_off = t.oe_off;
@@ -317,18 +366,20 @@ static int omap2_onenand_set_sync_mode(struct omap_onenand_platform_data *cfg,
317 if (err) 366 if (err)
318 return err; 367 return err;
319 368
320 set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf); 369 set_onenand_cfg(onenand_base, latency, sync_read, sync_write, hf, vhf);
370
371 *freq_ptr = freq;
321 372
322 return 0; 373 return 0;
323} 374}
324 375
325static int gpmc_onenand_setup(void __iomem *onenand_base, int freq) 376static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
326{ 377{
327 struct device *dev = &gpmc_onenand_device.dev; 378 struct device *dev = &gpmc_onenand_device.dev;
328 379
329 /* Set sync timings in GPMC */ 380 /* Set sync timings in GPMC */
330 if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base, 381 if (omap2_onenand_set_sync_mode(gpmc_onenand_data, onenand_base,
331 freq) < 0) { 382 freq_ptr) < 0) {
332 dev_err(dev, "Unable to set synchronous mode\n"); 383 dev_err(dev, "Unable to set synchronous mode\n");
333 return -EINVAL; 384 return -EINVAL;
334 } 385 }
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 1b7b3e7d02f7..674174365f78 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -14,6 +14,7 @@
14 */ 14 */
15#undef DEBUG 15#undef DEBUG
16 16
17#include <linux/irq.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
18#include <linux/init.h> 19#include <linux/init.h>
19#include <linux/err.h> 20#include <linux/err.h>
@@ -22,6 +23,7 @@
22#include <linux/spinlock.h> 23#include <linux/spinlock.h>
23#include <linux/io.h> 24#include <linux/io.h>
24#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/interrupt.h>
25 27
26#include <asm/mach-types.h> 28#include <asm/mach-types.h>
27#include <plat/gpmc.h> 29#include <plat/gpmc.h>
@@ -58,7 +60,6 @@
58#define GPMC_CHUNK_SHIFT 24 /* 16 MB */ 60#define GPMC_CHUNK_SHIFT 24 /* 16 MB */
59#define GPMC_SECTION_SHIFT 28 /* 128 MB */ 61#define GPMC_SECTION_SHIFT 28 /* 128 MB */
60 62
61#define PREFETCH_FIFOTHRESHOLD (0x40 << 8)
62#define CS_NUM_SHIFT 24 63#define CS_NUM_SHIFT 24
63#define ENABLE_PREFETCH (0x1 << 7) 64#define ENABLE_PREFETCH (0x1 << 7)
64#define DMA_MPU_MODE 2 65#define DMA_MPU_MODE 2
@@ -100,6 +101,8 @@ static void __iomem *gpmc_base;
100 101
101static struct clk *gpmc_l3_clk; 102static struct clk *gpmc_l3_clk;
102 103
104static irqreturn_t gpmc_handle_irq(int irq, void *dev);
105
103static void gpmc_write_reg(int idx, u32 val) 106static void gpmc_write_reg(int idx, u32 val)
104{ 107{
105 __raw_writel(val, gpmc_base + idx); 108 __raw_writel(val, gpmc_base + idx);
@@ -497,6 +500,10 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
497 u32 regval = 0; 500 u32 regval = 0;
498 501
499 switch (cmd) { 502 switch (cmd) {
503 case GPMC_ENABLE_IRQ:
504 gpmc_write_reg(GPMC_IRQENABLE, wval);
505 break;
506
500 case GPMC_SET_IRQ_STATUS: 507 case GPMC_SET_IRQ_STATUS:
501 gpmc_write_reg(GPMC_IRQSTATUS, wval); 508 gpmc_write_reg(GPMC_IRQSTATUS, wval);
502 break; 509 break;
@@ -598,15 +605,19 @@ EXPORT_SYMBOL(gpmc_nand_write);
598/** 605/**
599 * gpmc_prefetch_enable - configures and starts prefetch transfer 606 * gpmc_prefetch_enable - configures and starts prefetch transfer
600 * @cs: cs (chip select) number 607 * @cs: cs (chip select) number
608 * @fifo_th: fifo threshold to be used for read/ write
601 * @dma_mode: dma mode enable (1) or disable (0) 609 * @dma_mode: dma mode enable (1) or disable (0)
602 * @u32_count: number of bytes to be transferred 610 * @u32_count: number of bytes to be transferred
603 * @is_write: prefetch read(0) or write post(1) mode 611 * @is_write: prefetch read(0) or write post(1) mode
604 */ 612 */
605int gpmc_prefetch_enable(int cs, int dma_mode, 613int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
606 unsigned int u32_count, int is_write) 614 unsigned int u32_count, int is_write)
607{ 615{
608 616
609 if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) { 617 if (fifo_th > PREFETCH_FIFOTHRESHOLD_MAX) {
618 pr_err("gpmc: fifo threshold is not supported\n");
619 return -1;
620 } else if (!(gpmc_read_reg(GPMC_PREFETCH_CONTROL))) {
610 /* Set the amount of bytes to be prefetched */ 621 /* Set the amount of bytes to be prefetched */
611 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count); 622 gpmc_write_reg(GPMC_PREFETCH_CONFIG2, u32_count);
612 623
@@ -614,7 +625,7 @@ int gpmc_prefetch_enable(int cs, int dma_mode,
614 * enable the engine. Set which cs is has requested for. 625 * enable the engine. Set which cs is has requested for.
615 */ 626 */
616 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) | 627 gpmc_write_reg(GPMC_PREFETCH_CONFIG1, ((cs << CS_NUM_SHIFT) |
617 PREFETCH_FIFOTHRESHOLD | 628 PREFETCH_FIFOTHRESHOLD(fifo_th) |
618 ENABLE_PREFETCH | 629 ENABLE_PREFETCH |
619 (dma_mode << DMA_MPU_MODE) | 630 (dma_mode << DMA_MPU_MODE) |
620 (0x1 & is_write))); 631 (0x1 & is_write)));
@@ -678,9 +689,10 @@ static void __init gpmc_mem_init(void)
678 } 689 }
679} 690}
680 691
681void __init gpmc_init(void) 692static int __init gpmc_init(void)
682{ 693{
683 u32 l; 694 u32 l, irq;
695 int cs, ret = -EINVAL;
684 char *ck = NULL; 696 char *ck = NULL;
685 697
686 if (cpu_is_omap24xx()) { 698 if (cpu_is_omap24xx()) {
@@ -698,7 +710,7 @@ void __init gpmc_init(void)
698 } 710 }
699 711
700 if (WARN_ON(!ck)) 712 if (WARN_ON(!ck))
701 return; 713 return ret;
702 714
703 gpmc_l3_clk = clk_get(NULL, ck); 715 gpmc_l3_clk = clk_get(NULL, ck);
704 if (IS_ERR(gpmc_l3_clk)) { 716 if (IS_ERR(gpmc_l3_clk)) {
@@ -723,6 +735,36 @@ void __init gpmc_init(void)
723 l |= (0x02 << 3) | (1 << 0); 735 l |= (0x02 << 3) | (1 << 0);
724 gpmc_write_reg(GPMC_SYSCONFIG, l); 736 gpmc_write_reg(GPMC_SYSCONFIG, l);
725 gpmc_mem_init(); 737 gpmc_mem_init();
738
739 /* initalize the irq_chained */
740 irq = OMAP_GPMC_IRQ_BASE;
741 for (cs = 0; cs < GPMC_CS_NUM; cs++) {
742 set_irq_handler(irq, handle_simple_irq);
743 set_irq_flags(irq, IRQF_VALID);
744 irq++;
745 }
746
747 ret = request_irq(INT_34XX_GPMC_IRQ,
748 gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base);
749 if (ret)
750 pr_err("gpmc: irq-%d could not claim: err %d\n",
751 INT_34XX_GPMC_IRQ, ret);
752 return ret;
753}
754postcore_initcall(gpmc_init);
755
756static irqreturn_t gpmc_handle_irq(int irq, void *dev)
757{
758 u8 cs;
759
760 if (irq != INT_34XX_GPMC_IRQ)
761 return IRQ_HANDLED;
762 /* check cs to invoke the irq */
763 cs = ((gpmc_read_reg(GPMC_PREFETCH_CONFIG1)) >> CS_NUM_SHIFT) & 0x7;
764 if (OMAP_GPMC_IRQ_BASE+cs <= OMAP_GPMC_IRQ_END)
765 generic_handle_irq(OMAP_GPMC_IRQ_BASE+cs);
766
767 return IRQ_HANDLED;
726} 768}
727 769
728#ifdef CONFIG_ARCH_OMAP3 770#ifdef CONFIG_ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
index 34272e4863fd..137e1a5f3d85 100644
--- a/arch/arm/mach-omap2/hsmmc.c
+++ b/arch/arm/mach-omap2/hsmmc.c
@@ -16,7 +16,10 @@
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <plat/mmc.h> 17#include <plat/mmc.h>
18#include <plat/omap-pm.h> 18#include <plat/omap-pm.h>
19#include <plat/mux.h>
20#include <plat/omap_device.h>
19 21
22#include "mux.h"
20#include "hsmmc.h" 23#include "hsmmc.h"
21#include "control.h" 24#include "control.h"
22 25
@@ -28,10 +31,6 @@ static u16 control_mmc1;
28 31
29#define HSMMC_NAME_LEN 9 32#define HSMMC_NAME_LEN 9
30 33
31static struct hsmmc_controller {
32 char name[HSMMC_NAME_LEN + 1];
33} hsmmc[OMAP34XX_NR_MMC];
34
35#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM) 34#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
36 35
37static int hsmmc_get_context_loss(struct device *dev) 36static int hsmmc_get_context_loss(struct device *dev)
@@ -204,174 +203,312 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on,
204 return 0; 203 return 0;
205} 204}
206 205
207static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; 206static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller,
208 207 int controller_nr)
209void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
210{ 208{
211 struct omap2_hsmmc_info *c; 209 if ((mmc_controller->slots[0].switch_pin > 0) && \
212 int nr_hsmmc = ARRAY_SIZE(hsmmc_data); 210 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
213 int i; 211 omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
214 u32 reg; 212 OMAP_PIN_INPUT_PULLUP);
215 213 if ((mmc_controller->slots[0].gpio_wp > 0) && \
216 if (!cpu_is_omap44xx()) { 214 (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
217 if (cpu_is_omap2430()) { 215 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
218 control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE; 216 OMAP_PIN_INPUT_PULLUP);
219 control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1; 217 if (cpu_is_omap34xx()) {
220 } else { 218 if (controller_nr == 0) {
221 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE; 219 omap_mux_init_signal("sdmmc1_clk",
222 control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1; 220 OMAP_PIN_INPUT_PULLUP);
223 } 221 omap_mux_init_signal("sdmmc1_cmd",
224 } else { 222 OMAP_PIN_INPUT_PULLUP);
225 control_pbias_offset = 223 omap_mux_init_signal("sdmmc1_dat0",
226 OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE; 224 OMAP_PIN_INPUT_PULLUP);
227 control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1; 225 if (mmc_controller->slots[0].caps &
228 reg = omap4_ctrl_pad_readl(control_mmc1); 226 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
229 reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK | 227 omap_mux_init_signal("sdmmc1_dat1",
230 OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK); 228 OMAP_PIN_INPUT_PULLUP);
231 reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK | 229 omap_mux_init_signal("sdmmc1_dat2",
232 OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK); 230 OMAP_PIN_INPUT_PULLUP);
233 reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK| 231 omap_mux_init_signal("sdmmc1_dat3",
234 OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK | 232 OMAP_PIN_INPUT_PULLUP);
235 OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK); 233 }
236 omap4_ctrl_pad_writel(reg, control_mmc1); 234 if (mmc_controller->slots[0].caps &
237 } 235 MMC_CAP_8_BIT_DATA) {
238 236 omap_mux_init_signal("sdmmc1_dat4",
239 for (c = controllers; c->mmc; c++) { 237 OMAP_PIN_INPUT_PULLUP);
240 struct hsmmc_controller *hc = hsmmc + c->mmc - 1; 238 omap_mux_init_signal("sdmmc1_dat5",
241 struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; 239 OMAP_PIN_INPUT_PULLUP);
242 240 omap_mux_init_signal("sdmmc1_dat6",
243 if (!c->mmc || c->mmc > nr_hsmmc) { 241 OMAP_PIN_INPUT_PULLUP);
244 pr_debug("MMC%d: no such controller\n", c->mmc); 242 omap_mux_init_signal("sdmmc1_dat7",
245 continue; 243 OMAP_PIN_INPUT_PULLUP);
246 } 244 }
247 if (mmc) {
248 pr_debug("MMC%d: already configured\n", c->mmc);
249 continue;
250 } 245 }
251 246 if (controller_nr == 1) {
252 mmc = kzalloc(sizeof(struct omap_mmc_platform_data), 247 /* MMC2 */
253 GFP_KERNEL); 248 omap_mux_init_signal("sdmmc2_clk",
254 if (!mmc) { 249 OMAP_PIN_INPUT_PULLUP);
255 pr_err("Cannot allocate memory for mmc device!\n"); 250 omap_mux_init_signal("sdmmc2_cmd",
256 goto done; 251 OMAP_PIN_INPUT_PULLUP);
252 omap_mux_init_signal("sdmmc2_dat0",
253 OMAP_PIN_INPUT_PULLUP);
254
255 /*
256 * For 8 wire configurations, Lines DAT4, 5, 6 and 7
257 * need to be muxed in the board-*.c files
258 */
259 if (mmc_controller->slots[0].caps &
260 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
261 omap_mux_init_signal("sdmmc2_dat1",
262 OMAP_PIN_INPUT_PULLUP);
263 omap_mux_init_signal("sdmmc2_dat2",
264 OMAP_PIN_INPUT_PULLUP);
265 omap_mux_init_signal("sdmmc2_dat3",
266 OMAP_PIN_INPUT_PULLUP);
267 }
268 if (mmc_controller->slots[0].caps &
269 MMC_CAP_8_BIT_DATA) {
270 omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4",
271 OMAP_PIN_INPUT_PULLUP);
272 omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5",
273 OMAP_PIN_INPUT_PULLUP);
274 omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6",
275 OMAP_PIN_INPUT_PULLUP);
276 omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7",
277 OMAP_PIN_INPUT_PULLUP);
278 }
257 } 279 }
258 280
259 if (c->name) 281 /*
260 strncpy(hc->name, c->name, HSMMC_NAME_LEN); 282 * For MMC3 the pins need to be muxed in the board-*.c files
261 else 283 */
262 snprintf(hc->name, ARRAY_SIZE(hc->name), 284 }
263 "mmc%islot%i", c->mmc, 1); 285}
264 mmc->slots[0].name = hc->name;
265 mmc->nr_slots = 1;
266 mmc->slots[0].caps = c->caps;
267 mmc->slots[0].internal_clock = !c->ext_clock;
268 mmc->dma_mask = 0xffffffff;
269 if (cpu_is_omap44xx())
270 mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
271 else
272 mmc->reg_offset = 0;
273 286
274 mmc->get_context_loss_count = hsmmc_get_context_loss; 287static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
288 struct omap_mmc_platform_data *mmc)
289{
290 char *hc_name;
275 291
276 mmc->slots[0].switch_pin = c->gpio_cd; 292 hc_name = kzalloc(sizeof(char) * (HSMMC_NAME_LEN + 1), GFP_KERNEL);
277 mmc->slots[0].gpio_wp = c->gpio_wp; 293 if (!hc_name) {
294 pr_err("Cannot allocate memory for controller slot name\n");
295 kfree(hc_name);
296 return -ENOMEM;
297 }
278 298
279 mmc->slots[0].remux = c->remux; 299 if (c->name)
280 mmc->slots[0].init_card = c->init_card; 300 strncpy(hc_name, c->name, HSMMC_NAME_LEN);
301 else
302 snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i",
303 c->mmc, 1);
304 mmc->slots[0].name = hc_name;
305 mmc->nr_slots = 1;
306 mmc->slots[0].caps = c->caps;
307 mmc->slots[0].internal_clock = !c->ext_clock;
308 mmc->dma_mask = 0xffffffff;
309 if (cpu_is_omap44xx())
310 mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
311 else
312 mmc->reg_offset = 0;
281 313
282 if (c->cover_only) 314 mmc->get_context_loss_count = hsmmc_get_context_loss;
283 mmc->slots[0].cover = 1;
284 315
285 if (c->nonremovable) 316 mmc->slots[0].switch_pin = c->gpio_cd;
286 mmc->slots[0].nonremovable = 1; 317 mmc->slots[0].gpio_wp = c->gpio_wp;
287 318
288 if (c->power_saving) 319 mmc->slots[0].remux = c->remux;
289 mmc->slots[0].power_saving = 1; 320 mmc->slots[0].init_card = c->init_card;
290 321
291 if (c->no_off) 322 if (c->cover_only)
292 mmc->slots[0].no_off = 1; 323 mmc->slots[0].cover = 1;
293 324
294 if (c->vcc_aux_disable_is_sleep) 325 if (c->nonremovable)
295 mmc->slots[0].vcc_aux_disable_is_sleep = 1; 326 mmc->slots[0].nonremovable = 1;
296 327
297 /* NOTE: MMC slots should have a Vcc regulator set up. 328 if (c->power_saving)
298 * This may be from a TWL4030-family chip, another 329 mmc->slots[0].power_saving = 1;
299 * controllable regulator, or a fixed supply.
300 *
301 * temporary HACK: ocr_mask instead of fixed supply
302 */
303 mmc->slots[0].ocr_mask = c->ocr_mask;
304 330
305 if (cpu_is_omap3517() || cpu_is_omap3505()) 331 if (c->no_off)
306 mmc->slots[0].set_power = nop_mmc_set_power; 332 mmc->slots[0].no_off = 1;
307 else
308 mmc->slots[0].features |= HSMMC_HAS_PBIAS;
309 333
310 if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0)) 334 if (c->vcc_aux_disable_is_sleep)
311 mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET; 335 mmc->slots[0].vcc_aux_disable_is_sleep = 1;
312 336
313 switch (c->mmc) { 337 /*
314 case 1: 338 * NOTE: MMC slots should have a Vcc regulator set up.
315 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) { 339 * This may be from a TWL4030-family chip, another
316 /* on-chip level shifting via PBIAS0/PBIAS1 */ 340 * controllable regulator, or a fixed supply.
317 if (cpu_is_omap44xx()) { 341 *
318 mmc->slots[0].before_set_reg = 342 * temporary HACK: ocr_mask instead of fixed supply
343 */
344 mmc->slots[0].ocr_mask = c->ocr_mask;
345
346 if (cpu_is_omap3517() || cpu_is_omap3505())
347 mmc->slots[0].set_power = nop_mmc_set_power;
348 else
349 mmc->slots[0].features |= HSMMC_HAS_PBIAS;
350
351 if (cpu_is_omap44xx() && (omap_rev() > OMAP4430_REV_ES1_0))
352 mmc->slots[0].features |= HSMMC_HAS_UPDATED_RESET;
353
354 switch (c->mmc) {
355 case 1:
356 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
357 /* on-chip level shifting via PBIAS0/PBIAS1 */
358 if (cpu_is_omap44xx()) {
359 mmc->slots[0].before_set_reg =
319 omap4_hsmmc1_before_set_reg; 360 omap4_hsmmc1_before_set_reg;
320 mmc->slots[0].after_set_reg = 361 mmc->slots[0].after_set_reg =
321 omap4_hsmmc1_after_set_reg; 362 omap4_hsmmc1_after_set_reg;
322 } else { 363 } else {
323 mmc->slots[0].before_set_reg = 364 mmc->slots[0].before_set_reg =
324 omap_hsmmc1_before_set_reg; 365 omap_hsmmc1_before_set_reg;
325 mmc->slots[0].after_set_reg = 366 mmc->slots[0].after_set_reg =
326 omap_hsmmc1_after_set_reg; 367 omap_hsmmc1_after_set_reg;
327 }
328 } 368 }
369 }
329 370
330 /* Omap3630 HSMMC1 supports only 4-bit */ 371 /* OMAP3630 HSMMC1 supports only 4-bit */
331 if (cpu_is_omap3630() && 372 if (cpu_is_omap3630() &&
332 (c->caps & MMC_CAP_8_BIT_DATA)) { 373 (c->caps & MMC_CAP_8_BIT_DATA)) {
333 c->caps &= ~MMC_CAP_8_BIT_DATA; 374 c->caps &= ~MMC_CAP_8_BIT_DATA;
334 c->caps |= MMC_CAP_4_BIT_DATA; 375 c->caps |= MMC_CAP_4_BIT_DATA;
335 mmc->slots[0].caps = c->caps; 376 mmc->slots[0].caps = c->caps;
336 } 377 }
337 break; 378 break;
338 case 2: 379 case 2:
339 if (c->ext_clock) 380 if (c->ext_clock)
340 c->transceiver = 1; 381 c->transceiver = 1;
341 if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) { 382 if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {
342 c->caps &= ~MMC_CAP_8_BIT_DATA; 383 c->caps &= ~MMC_CAP_8_BIT_DATA;
343 c->caps |= MMC_CAP_4_BIT_DATA; 384 c->caps |= MMC_CAP_4_BIT_DATA;
344 }
345 /* FALLTHROUGH */
346 case 3:
347 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
348 /* off-chip level shifting, or none */
349 mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
350 mmc->slots[0].after_set_reg = NULL;
351 }
352 break;
353 default:
354 pr_err("MMC%d configuration not supported!\n", c->mmc);
355 kfree(mmc);
356 continue;
357 } 385 }
358 hsmmc_data[c->mmc - 1] = mmc; 386 /* FALLTHROUGH */
387 case 3:
388 if (mmc->slots[0].features & HSMMC_HAS_PBIAS) {
389 /* off-chip level shifting, or none */
390 mmc->slots[0].before_set_reg = hsmmc23_before_set_reg;
391 mmc->slots[0].after_set_reg = NULL;
392 }
393 break;
394 case 4:
395 case 5:
396 mmc->slots[0].before_set_reg = NULL;
397 mmc->slots[0].after_set_reg = NULL;
398 break;
399 default:
400 pr_err("MMC%d configuration not supported!\n", c->mmc);
401 kfree(hc_name);
402 return -ENODEV;
403 }
404 return 0;
405}
406
407static struct omap_device_pm_latency omap_hsmmc_latency[] = {
408 [0] = {
409 .deactivate_func = omap_device_idle_hwmods,
410 .activate_func = omap_device_enable_hwmods,
411 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
412 },
413 /*
414 * XXX There should also be an entry here to power off/on the
415 * MMC regulators/PBIAS cells, etc.
416 */
417};
418
419#define MAX_OMAP_MMC_HWMOD_NAME_LEN 16
420
421void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
422{
423 struct omap_hwmod *oh;
424 struct omap_device *od;
425 struct omap_device_pm_latency *ohl;
426 char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN];
427 struct omap_mmc_platform_data *mmc_data;
428 struct omap_mmc_dev_attr *mmc_dev_attr;
429 char *name;
430 int l;
431 int ohl_cnt = 0;
432
433 mmc_data = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL);
434 if (!mmc_data) {
435 pr_err("Cannot allocate memory for mmc device!\n");
436 goto done;
359 } 437 }
360 438
361 omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); 439 if (omap_hsmmc_pdata_init(hsmmcinfo, mmc_data) < 0) {
440 pr_err("%s fails!\n", __func__);
441 goto done;
442 }
443 omap_hsmmc_mux(mmc_data, (ctrl_nr - 1));
444
445 name = "omap_hsmmc";
446 ohl = omap_hsmmc_latency;
447 ohl_cnt = ARRAY_SIZE(omap_hsmmc_latency);
448
449 l = snprintf(oh_name, MAX_OMAP_MMC_HWMOD_NAME_LEN,
450 "mmc%d", ctrl_nr);
451 WARN(l >= MAX_OMAP_MMC_HWMOD_NAME_LEN,
452 "String buffer overflow in MMC%d device setup\n", ctrl_nr);
453 oh = omap_hwmod_lookup(oh_name);
454 if (!oh) {
455 pr_err("Could not look up %s\n", oh_name);
456 kfree(mmc_data->slots[0].name);
457 goto done;
458 }
362 459
363 /* pass the device nodes back to board setup code */ 460 if (oh->dev_attr != NULL) {
364 for (c = controllers; c->mmc; c++) { 461 mmc_dev_attr = oh->dev_attr;
365 struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; 462 mmc_data->controller_flags = mmc_dev_attr->flags;
463 }
366 464
367 if (!c->mmc || c->mmc > nr_hsmmc) 465 od = omap_device_build(name, ctrl_nr - 1, oh, mmc_data,
368 continue; 466 sizeof(struct omap_mmc_platform_data), ohl, ohl_cnt, false);
369 c->dev = mmc->dev; 467 if (IS_ERR(od)) {
468 WARN(1, "Cant build omap_device for %s:%s.\n", name, oh->name);
469 kfree(mmc_data->slots[0].name);
470 goto done;
370 } 471 }
472 /*
473 * return device handle to board setup code
474 * required to populate for regulator framework structure
475 */
476 hsmmcinfo->dev = &od->pdev.dev;
371 477
372done: 478done:
373 for (i = 0; i < nr_hsmmc; i++) 479 kfree(mmc_data);
374 kfree(hsmmc_data[i]); 480}
481
482void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)
483{
484 u32 reg;
485
486 if (!cpu_is_omap44xx()) {
487 if (cpu_is_omap2430()) {
488 control_pbias_offset = OMAP243X_CONTROL_PBIAS_LITE;
489 control_devconf1_offset = OMAP243X_CONTROL_DEVCONF1;
490 } else {
491 control_pbias_offset = OMAP343X_CONTROL_PBIAS_LITE;
492 control_devconf1_offset = OMAP343X_CONTROL_DEVCONF1;
493 }
494 } else {
495 control_pbias_offset =
496 OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_PBIASLITE;
497 control_mmc1 = OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MMC1;
498 reg = omap4_ctrl_pad_readl(control_mmc1);
499 reg |= (OMAP4_SDMMC1_PUSTRENGTH_GRP0_MASK |
500 OMAP4_SDMMC1_PUSTRENGTH_GRP1_MASK);
501 reg &= ~(OMAP4_SDMMC1_PUSTRENGTH_GRP2_MASK |
502 OMAP4_SDMMC1_PUSTRENGTH_GRP3_MASK);
503 reg |= (OMAP4_USBC1_DR0_SPEEDCTRL_MASK|
504 OMAP4_SDMMC1_DR1_SPEEDCTRL_MASK |
505 OMAP4_SDMMC1_DR2_SPEEDCTRL_MASK);
506 omap4_ctrl_pad_writel(reg, control_mmc1);
507 }
508
509 for (; controllers->mmc; controllers++)
510 omap_init_hsmmc(controllers, controllers->mmc);
511
375} 512}
376 513
377#endif 514#endif
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
new file mode 100644
index 000000000000..06d4a80660a5
--- /dev/null
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -0,0 +1,63 @@
1/*
2 * OMAP hardware spinlock device initialization
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * Contact: Simon Que <sque@ti.com>
7 * Hari Kanigeri <h-kanigeri2@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/err.h>
22
23#include <plat/omap_hwmod.h>
24#include <plat/omap_device.h>
25
26struct omap_device_pm_latency omap_spinlock_latency[] = {
27 {
28 .deactivate_func = omap_device_idle_hwmods,
29 .activate_func = omap_device_enable_hwmods,
30 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
31 }
32};
33
34int __init hwspinlocks_init(void)
35{
36 int retval = 0;
37 struct omap_hwmod *oh;
38 struct omap_device *od;
39 const char *oh_name = "spinlock";
40 const char *dev_name = "omap_hwspinlock";
41
42 /*
43 * Hwmod lookup will fail in case our platform doesn't support the
44 * hardware spinlock module, so it is safe to run this initcall
45 * on all omaps
46 */
47 oh = omap_hwmod_lookup(oh_name);
48 if (oh == NULL)
49 return -EINVAL;
50
51 od = omap_device_build(dev_name, 0, oh, NULL, 0,
52 omap_spinlock_latency,
53 ARRAY_SIZE(omap_spinlock_latency), false);
54 if (IS_ERR(od)) {
55 pr_err("Can't build omap_device for %s:%s\n", dev_name,
56 oh_name);
57 retval = PTR_ERR(od);
58 }
59
60 return retval;
61}
62/* early board code might need to reserve specific hwspinlock instances */
63postcore_initcall(hwspinlocks_init);
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 5f9086c65e48..3168b17bc264 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -6,7 +6,7 @@
6 * Copyright (C) 2005 Nokia Corporation 6 * Copyright (C) 2005 Nokia Corporation
7 * Written by Tony Lindgren <tony@atomide.com> 7 * Written by Tony Lindgren <tony@atomide.com>
8 * 8 *
9 * Copyright (C) 2009 Texas Instruments 9 * Copyright (C) 2009-11 Texas Instruments
10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> 10 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
@@ -191,12 +191,19 @@ static void __init omap3_check_features(void)
191 if (!cpu_is_omap3505() && !cpu_is_omap3517()) 191 if (!cpu_is_omap3505() && !cpu_is_omap3517())
192 omap3_features |= OMAP3_HAS_IO_WAKEUP; 192 omap3_features |= OMAP3_HAS_IO_WAKEUP;
193 193
194 omap3_features |= OMAP3_HAS_SDRC;
195
194 /* 196 /*
195 * TODO: Get additional info (where applicable) 197 * TODO: Get additional info (where applicable)
196 * e.g. Size of L2 cache. 198 * e.g. Size of L2 cache.
197 */ 199 */
198} 200}
199 201
202static void __init ti816x_check_features(void)
203{
204 omap3_features = OMAP3_HAS_NEON;
205}
206
200static void __init omap3_check_revision(void) 207static void __init omap3_check_revision(void)
201{ 208{
202 u32 cpuid, idcode; 209 u32 cpuid, idcode;
@@ -287,6 +294,20 @@ static void __init omap3_check_revision(void)
287 omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; 294 omap_chip.oc |= CHIP_IS_OMAP3630ES1_2;
288 } 295 }
289 break; 296 break;
297 case 0xb81e:
298 omap_chip.oc = CHIP_IS_TI816X;
299
300 switch (rev) {
301 case 0:
302 omap_revision = TI8168_REV_ES1_0;
303 break;
304 case 1:
305 omap_revision = TI8168_REV_ES1_1;
306 break;
307 default:
308 omap_revision = TI8168_REV_ES1_1;
309 }
310 break;
290 default: 311 default:
291 /* Unknown default to latest silicon rev as default*/ 312 /* Unknown default to latest silicon rev as default*/
292 omap_revision = OMAP3630_REV_ES1_2; 313 omap_revision = OMAP3630_REV_ES1_2;
@@ -307,7 +328,7 @@ static void __init omap4_check_revision(void)
307 */ 328 */
308 idcode = read_tap_reg(OMAP_TAP_IDCODE); 329 idcode = read_tap_reg(OMAP_TAP_IDCODE);
309 hawkeye = (idcode >> 12) & 0xffff; 330 hawkeye = (idcode >> 12) & 0xffff;
310 rev = (idcode >> 28) & 0xff; 331 rev = (idcode >> 28) & 0xf;
311 332
312 /* 333 /*
313 * Few initial ES2.0 samples IDCODE is same as ES1.0 334 * Few initial ES2.0 samples IDCODE is same as ES1.0
@@ -326,22 +347,31 @@ static void __init omap4_check_revision(void)
326 omap_chip.oc |= CHIP_IS_OMAP4430ES1; 347 omap_chip.oc |= CHIP_IS_OMAP4430ES1;
327 break; 348 break;
328 case 1: 349 case 1:
350 default:
329 omap_revision = OMAP4430_REV_ES2_0; 351 omap_revision = OMAP4430_REV_ES2_0;
330 omap_chip.oc |= CHIP_IS_OMAP4430ES2; 352 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
353 }
354 break;
355 case 0xb95c:
356 switch (rev) {
357 case 3:
358 omap_revision = OMAP4430_REV_ES2_1;
359 omap_chip.oc |= CHIP_IS_OMAP4430ES2_1;
331 break; 360 break;
361 case 4:
332 default: 362 default:
333 omap_revision = OMAP4430_REV_ES2_0; 363 omap_revision = OMAP4430_REV_ES2_2;
334 omap_chip.oc |= CHIP_IS_OMAP4430ES2; 364 omap_chip.oc |= CHIP_IS_OMAP4430ES2_2;
335 } 365 }
336 break; 366 break;
337 default: 367 default:
338 /* Unknown default to latest silicon rev as default*/ 368 /* Unknown default to latest silicon rev as default */
339 omap_revision = OMAP4430_REV_ES2_0; 369 omap_revision = OMAP4430_REV_ES2_2;
340 omap_chip.oc |= CHIP_IS_OMAP4430ES2; 370 omap_chip.oc |= CHIP_IS_OMAP4430ES2_2;
341 } 371 }
342 372
343 pr_info("OMAP%04x ES%d.0\n", 373 pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
344 omap_rev() >> 16, ((omap_rev() >> 12) & 0xf) + 1); 374 ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
345} 375}
346 376
347#define OMAP3_SHOW_FEATURE(feat) \ 377#define OMAP3_SHOW_FEATURE(feat) \
@@ -372,6 +402,8 @@ static void __init omap3_cpuinfo(void)
372 /* Already set in omap3_check_revision() */ 402 /* Already set in omap3_check_revision() */
373 strcpy(cpu_name, "AM3505"); 403 strcpy(cpu_name, "AM3505");
374 } 404 }
405 } else if (cpu_is_ti816x()) {
406 strcpy(cpu_name, "TI816X");
375 } else if (omap3_has_iva() && omap3_has_sgx()) { 407 } else if (omap3_has_iva() && omap3_has_sgx()) {
376 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ 408 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
377 strcpy(cpu_name, "OMAP3430/3530"); 409 strcpy(cpu_name, "OMAP3430/3530");
@@ -386,7 +418,7 @@ static void __init omap3_cpuinfo(void)
386 strcpy(cpu_name, "OMAP3503"); 418 strcpy(cpu_name, "OMAP3503");
387 } 419 }
388 420
389 if (cpu_is_omap3630()) { 421 if (cpu_is_omap3630() || cpu_is_ti816x()) {
390 switch (rev) { 422 switch (rev) {
391 case OMAP_REVBITS_00: 423 case OMAP_REVBITS_00:
392 strcpy(cpu_rev, "1.0"); 424 strcpy(cpu_rev, "1.0");
@@ -462,7 +494,13 @@ void __init omap2_check_revision(void)
462 omap24xx_check_revision(); 494 omap24xx_check_revision();
463 } else if (cpu_is_omap34xx()) { 495 } else if (cpu_is_omap34xx()) {
464 omap3_check_revision(); 496 omap3_check_revision();
465 omap3_check_features(); 497
498 /* TI816X doesn't have feature register */
499 if (!cpu_is_ti816x())
500 omap3_check_features();
501 else
502 ti816x_check_features();
503
466 omap3_cpuinfo(); 504 omap3_cpuinfo();
467 return; 505 return;
468 } else if (cpu_is_omap44xx()) { 506 } else if (cpu_is_omap44xx()) {
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
index 6a4d4136002e..e1b0f17b0927 100644
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ b/arch/arm/mach-omap2/include/mach/debug-macro.S
@@ -69,6 +69,12 @@ omap_uart_lsr: .word 0
69 beq 34f @ configure OMAP3UART4 69 beq 34f @ configure OMAP3UART4
70 cmp \rp, #OMAP4UART4 @ only on 44xx 70 cmp \rp, #OMAP4UART4 @ only on 44xx
71 beq 44f @ configure OMAP4UART4 71 beq 44f @ configure OMAP4UART4
72 cmp \rp, #TI816XUART1 @ ti816x UART offsets different
73 beq 81f @ configure UART1
74 cmp \rp, #TI816XUART2 @ ti816x UART offsets different
75 beq 82f @ configure UART2
76 cmp \rp, #TI816XUART3 @ ti816x UART offsets different
77 beq 83f @ configure UART3
72 cmp \rp, #ZOOM_UART @ only on zoom2/3 78 cmp \rp, #ZOOM_UART @ only on zoom2/3
73 beq 95f @ configure ZOOM_UART 79 beq 95f @ configure ZOOM_UART
74 80
@@ -91,6 +97,12 @@ omap_uart_lsr: .word 0
91 b 98f 97 b 98f
9244: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE) 9844: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
93 b 98f 99 b 98f
10081: mov \rp, #UART_OFFSET(TI816X_UART1_BASE)
101 b 98f
10282: mov \rp, #UART_OFFSET(TI816X_UART2_BASE)
103 b 98f
10483: mov \rp, #UART_OFFSET(TI816X_UART3_BASE)
105 b 98f
9495: ldr \rp, =ZOOM_UART_BASE 10695: ldr \rp, =ZOOM_UART_BASE
95 mrc p15, 0, \rv, c1, c0 107 mrc p15, 0, \rv, c1, c0
96 tst \rv, #1 @ MMU enabled? 108 tst \rv, #1 @ MMU enabled?
diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S
index 81985a665cb3..a48690b90990 100644
--- a/arch/arm/mach-omap2/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap2/include/mach/entry-macro.S
@@ -61,6 +61,14 @@
61 bne 9998f 61 bne 9998f
62 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ 62 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
63 cmp \irqnr, #0x0 63 cmp \irqnr, #0x0
64 bne 9998f
65
66 /*
67 * ti816x has additional IRQ pending register. Checking this
68 * register on omap2 & omap3 has no effect (read as 0).
69 */
70 ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
71 cmp \irqnr, #0x0
649998: 729998:
65 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] 73 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
66 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ 74 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
@@ -133,6 +141,11 @@
133 bne 9999f 141 bne 9999f
134 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ 142 ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
135 cmp \irqnr, #0x0 143 cmp \irqnr, #0x0
144#ifdef CONFIG_SOC_OMAPTI816X
145 bne 9999f
146 ldr \irqnr, [\base, #0xf8] /* IRQ pending reg 4 */
147 cmp \irqnr, #0x0
148#endif
1369999: 1499999:
137 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET] 150 ldrne \irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
138 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */ 151 and \irqnr, \irqnr, #ACTIVEIRQ_MASK /* Clear spurious bits */
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index c2032041d26f..441e79d043a7 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -30,7 +30,6 @@
30 30
31#include <plat/sram.h> 31#include <plat/sram.h>
32#include <plat/sdrc.h> 32#include <plat/sdrc.h>
33#include <plat/gpmc.h>
34#include <plat/serial.h> 33#include <plat/serial.h>
35 34
36#include "clock2xxx.h" 35#include "clock2xxx.h"
@@ -66,7 +65,7 @@ static struct map_desc omap24xx_io_desc[] __initdata = {
66 }, 65 },
67}; 66};
68 67
69#ifdef CONFIG_ARCH_OMAP2420 68#ifdef CONFIG_SOC_OMAP2420
70static struct map_desc omap242x_io_desc[] __initdata = { 69static struct map_desc omap242x_io_desc[] __initdata = {
71 { 70 {
72 .virtual = DSP_MEM_2420_VIRT, 71 .virtual = DSP_MEM_2420_VIRT,
@@ -90,7 +89,7 @@ static struct map_desc omap242x_io_desc[] __initdata = {
90 89
91#endif 90#endif
92 91
93#ifdef CONFIG_ARCH_OMAP2430 92#ifdef CONFIG_SOC_OMAP2430
94static struct map_desc omap243x_io_desc[] __initdata = { 93static struct map_desc omap243x_io_desc[] __initdata = {
95 { 94 {
96 .virtual = L4_WK_243X_VIRT, 95 .virtual = L4_WK_243X_VIRT,
@@ -175,6 +174,18 @@ static struct map_desc omap34xx_io_desc[] __initdata = {
175#endif 174#endif
176}; 175};
177#endif 176#endif
177
178#ifdef CONFIG_SOC_OMAPTI816X
179static struct map_desc omapti816x_io_desc[] __initdata = {
180 {
181 .virtual = L4_34XX_VIRT,
182 .pfn = __phys_to_pfn(L4_34XX_PHYS),
183 .length = L4_34XX_SIZE,
184 .type = MT_DEVICE
185 },
186};
187#endif
188
178#ifdef CONFIG_ARCH_OMAP4 189#ifdef CONFIG_ARCH_OMAP4
179static struct map_desc omap44xx_io_desc[] __initdata = { 190static struct map_desc omap44xx_io_desc[] __initdata = {
180 { 191 {
@@ -241,7 +252,7 @@ static void __init _omap2_map_common_io(void)
241 omap_sram_init(); 252 omap_sram_init();
242} 253}
243 254
244#ifdef CONFIG_ARCH_OMAP2420 255#ifdef CONFIG_SOC_OMAP2420
245void __init omap242x_map_common_io(void) 256void __init omap242x_map_common_io(void)
246{ 257{
247 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 258 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
@@ -250,7 +261,7 @@ void __init omap242x_map_common_io(void)
250} 261}
251#endif 262#endif
252 263
253#ifdef CONFIG_ARCH_OMAP2430 264#ifdef CONFIG_SOC_OMAP2430
254void __init omap243x_map_common_io(void) 265void __init omap243x_map_common_io(void)
255{ 266{
256 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); 267 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
@@ -267,6 +278,14 @@ void __init omap34xx_map_common_io(void)
267} 278}
268#endif 279#endif
269 280
281#ifdef CONFIG_SOC_OMAPTI816X
282void __init omapti816x_map_common_io(void)
283{
284 iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc));
285 _omap2_map_common_io();
286}
287#endif
288
270#ifdef CONFIG_ARCH_OMAP4 289#ifdef CONFIG_ARCH_OMAP4
271void __init omap44xx_map_common_io(void) 290void __init omap44xx_map_common_io(void)
272{ 291{
@@ -337,15 +356,15 @@ void __init omap2_init_common_infrastructure(void)
337 356
338 if (cpu_is_omap242x()) { 357 if (cpu_is_omap242x()) {
339 omap2xxx_powerdomains_init(); 358 omap2xxx_powerdomains_init();
340 omap2_clockdomains_init(); 359 omap2xxx_clockdomains_init();
341 omap2420_hwmod_init(); 360 omap2420_hwmod_init();
342 } else if (cpu_is_omap243x()) { 361 } else if (cpu_is_omap243x()) {
343 omap2xxx_powerdomains_init(); 362 omap2xxx_powerdomains_init();
344 omap2_clockdomains_init(); 363 omap2xxx_clockdomains_init();
345 omap2430_hwmod_init(); 364 omap2430_hwmod_init();
346 } else if (cpu_is_omap34xx()) { 365 } else if (cpu_is_omap34xx()) {
347 omap3xxx_powerdomains_init(); 366 omap3xxx_powerdomains_init();
348 omap2_clockdomains_init(); 367 omap3xxx_clockdomains_init();
349 omap3xxx_hwmod_init(); 368 omap3xxx_hwmod_init();
350 } else if (cpu_is_omap44xx()) { 369 } else if (cpu_is_omap44xx()) {
351 omap44xx_powerdomains_init(); 370 omap44xx_powerdomains_init();
@@ -398,15 +417,10 @@ void __init omap2_init_common_infrastructure(void)
398void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, 417void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
399 struct omap_sdrc_params *sdrc_cs1) 418 struct omap_sdrc_params *sdrc_cs1)
400{ 419{
401 omap_serial_early_init(); 420 if (cpu_is_omap24xx() || omap3_has_sdrc()) {
402
403 omap_hwmod_late_init();
404
405 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
406 omap2_sdrc_init(sdrc_cs0, sdrc_cs1); 421 omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
407 _omap2_init_reprogram_sdrc(); 422 _omap2_init_reprogram_sdrc();
408 } 423 }
409 gpmc_init();
410 424
411 omap_irq_base_init(); 425 omap_irq_base_init();
412} 426}
diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c
index 14ee686b6492..adb083e41acd 100644
--- a/arch/arm/mach-omap2/iommu2.c
+++ b/arch/arm/mach-omap2/iommu2.c
@@ -145,35 +145,32 @@ static void omap2_iommu_set_twl(struct iommu *obj, bool on)
145 145
146static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra) 146static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)
147{ 147{
148 int i;
149 u32 stat, da; 148 u32 stat, da;
150 const char *err_msg[] = { 149 u32 errs = 0;
151 "tlb miss",
152 "translation fault",
153 "emulation miss",
154 "table walk fault",
155 "multi hit fault",
156 };
157 150
158 stat = iommu_read_reg(obj, MMU_IRQSTATUS); 151 stat = iommu_read_reg(obj, MMU_IRQSTATUS);
159 stat &= MMU_IRQ_MASK; 152 stat &= MMU_IRQ_MASK;
160 if (!stat) 153 if (!stat) {
154 *ra = 0;
161 return 0; 155 return 0;
156 }
162 157
163 da = iommu_read_reg(obj, MMU_FAULT_AD); 158 da = iommu_read_reg(obj, MMU_FAULT_AD);
164 *ra = da; 159 *ra = da;
165 160
166 dev_err(obj->dev, "%s:\tda:%08x ", __func__, da); 161 if (stat & MMU_IRQ_TLBMISS)
167 162 errs |= OMAP_IOMMU_ERR_TLB_MISS;
168 for (i = 0; i < ARRAY_SIZE(err_msg); i++) { 163 if (stat & MMU_IRQ_TRANSLATIONFAULT)
169 if (stat & (1 << i)) 164 errs |= OMAP_IOMMU_ERR_TRANS_FAULT;
170 printk("%s ", err_msg[i]); 165 if (stat & MMU_IRQ_EMUMISS)
171 } 166 errs |= OMAP_IOMMU_ERR_EMU_MISS;
172 printk("\n"); 167 if (stat & MMU_IRQ_TABLEWALKFAULT)
173 168 errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT;
169 if (stat & MMU_IRQ_MULTIHITFAULT)
170 errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT;
174 iommu_write_reg(obj, stat, MMU_IRQSTATUS); 171 iommu_write_reg(obj, stat, MMU_IRQSTATUS);
175 172
176 return stat; 173 return errs;
177} 174}
178 175
179static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) 176static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr)
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 23049c487c47..bc524b94fd59 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -61,8 +61,6 @@ struct omap3_intc_regs {
61 u32 mir[INTCPS_NR_MIR_REGS]; 61 u32 mir[INTCPS_NR_MIR_REGS];
62}; 62};
63 63
64static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
65
66/* INTC bank register get/set */ 64/* INTC bank register get/set */
67 65
68static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg) 66static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg)
@@ -110,7 +108,7 @@ static void omap_mask_irq(struct irq_data *d)
110 unsigned int irq = d->irq; 108 unsigned int irq = d->irq;
111 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 109 int offset = irq & (~(IRQ_BITS_PER_REG - 1));
112 110
113 if (cpu_is_omap34xx()) { 111 if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
114 int spurious = 0; 112 int spurious = 0;
115 113
116 /* 114 /*
@@ -205,6 +203,9 @@ void __init omap_init_irq(void)
205 203
206 BUG_ON(!base); 204 BUG_ON(!base);
207 205
206 if (cpu_is_ti816x())
207 bank->nr_irqs = 128;
208
208 /* Static mapping, never released */ 209 /* Static mapping, never released */
209 bank->base_reg = ioremap(base, SZ_4K); 210 bank->base_reg = ioremap(base, SZ_4K);
210 if (!bank->base_reg) { 211 if (!bank->base_reg) {
@@ -229,6 +230,8 @@ void __init omap_init_irq(void)
229} 230}
230 231
231#ifdef CONFIG_ARCH_OMAP3 232#ifdef CONFIG_ARCH_OMAP3
233static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)];
234
232void omap_intc_save_context(void) 235void omap_intc_save_context(void)
233{ 236{
234 int ind = 0, i = 0; 237 int ind = 0, i = 0;
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 0a585dfa9874..6e15e3d7c65e 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -14,12 +14,11 @@
14#include <linux/err.h> 14#include <linux/err.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/pm_runtime.h>
17#include <plat/mailbox.h> 18#include <plat/mailbox.h>
18#include <mach/irqs.h> 19#include <mach/irqs.h>
19 20
20#define MAILBOX_REVISION 0x000 21#define MAILBOX_REVISION 0x000
21#define MAILBOX_SYSCONFIG 0x010
22#define MAILBOX_SYSSTATUS 0x014
23#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) 22#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m))
24#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) 23#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m))
25#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) 24#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m))
@@ -33,17 +32,6 @@
33#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m))) 32#define MAILBOX_IRQ_NEWMSG(m) (1 << (2 * (m)))
34#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1)) 33#define MAILBOX_IRQ_NOTFULL(m) (1 << (2 * (m) + 1))
35 34
36/* SYSCONFIG: register bit definition */
37#define AUTOIDLE (1 << 0)
38#define SOFTRESET (1 << 1)
39#define SMARTIDLE (2 << 3)
40#define OMAP4_SOFTRESET (1 << 0)
41#define OMAP4_NOIDLE (1 << 2)
42#define OMAP4_SMARTIDLE (2 << 2)
43
44/* SYSSTATUS: register bit definition */
45#define RESETDONE (1 << 0)
46
47#define MBOX_REG_SIZE 0x120 35#define MBOX_REG_SIZE 0x120
48 36
49#define OMAP4_MBOX_REG_SIZE 0x130 37#define OMAP4_MBOX_REG_SIZE 0x130
@@ -70,8 +58,6 @@ struct omap_mbox2_priv {
70 unsigned long irqdisable; 58 unsigned long irqdisable;
71}; 59};
72 60
73static struct clk *mbox_ick_handle;
74
75static void omap2_mbox_enable_irq(struct omap_mbox *mbox, 61static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
76 omap_mbox_type_t irq); 62 omap_mbox_type_t irq);
77 63
@@ -89,53 +75,13 @@ static inline void mbox_write_reg(u32 val, size_t ofs)
89static int omap2_mbox_startup(struct omap_mbox *mbox) 75static int omap2_mbox_startup(struct omap_mbox *mbox)
90{ 76{
91 u32 l; 77 u32 l;
92 unsigned long timeout;
93 78
94 mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); 79 pm_runtime_enable(mbox->dev->parent);
95 if (IS_ERR(mbox_ick_handle)) { 80 pm_runtime_get_sync(mbox->dev->parent);
96 printk(KERN_ERR "Could not get mailboxes_ick: %ld\n",
97 PTR_ERR(mbox_ick_handle));
98 return PTR_ERR(mbox_ick_handle);
99 }
100 clk_enable(mbox_ick_handle);
101
102 if (cpu_is_omap44xx()) {
103 mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG);
104 timeout = jiffies + msecs_to_jiffies(20);
105 do {
106 l = mbox_read_reg(MAILBOX_SYSCONFIG);
107 if (!(l & OMAP4_SOFTRESET))
108 break;
109 } while (!time_after(jiffies, timeout));
110
111 if (l & OMAP4_SOFTRESET) {
112 pr_err("Can't take mailbox out of reset\n");
113 return -ENODEV;
114 }
115 } else {
116 mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG);
117 timeout = jiffies + msecs_to_jiffies(20);
118 do {
119 l = mbox_read_reg(MAILBOX_SYSSTATUS);
120 if (l & RESETDONE)
121 break;
122 } while (!time_after(jiffies, timeout));
123
124 if (!(l & RESETDONE)) {
125 pr_err("Can't take mailbox out of reset\n");
126 return -ENODEV;
127 }
128 }
129 81
130 l = mbox_read_reg(MAILBOX_REVISION); 82 l = mbox_read_reg(MAILBOX_REVISION);
131 pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); 83 pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f));
132 84
133 if (cpu_is_omap44xx())
134 l = OMAP4_SMARTIDLE;
135 else
136 l = SMARTIDLE | AUTOIDLE;
137 mbox_write_reg(l, MAILBOX_SYSCONFIG);
138
139 omap2_mbox_enable_irq(mbox, IRQ_RX); 85 omap2_mbox_enable_irq(mbox, IRQ_RX);
140 86
141 return 0; 87 return 0;
@@ -143,9 +89,8 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)
143 89
144static void omap2_mbox_shutdown(struct omap_mbox *mbox) 90static void omap2_mbox_shutdown(struct omap_mbox *mbox)
145{ 91{
146 clk_disable(mbox_ick_handle); 92 pm_runtime_put_sync(mbox->dev->parent);
147 clk_put(mbox_ick_handle); 93 pm_runtime_disable(mbox->dev->parent);
148 mbox_ick_handle = NULL;
149} 94}
150 95
151/* Mailbox FIFO handle functions */ 96/* Mailbox FIFO handle functions */
@@ -310,7 +255,7 @@ struct omap_mbox mbox_dsp_info = {
310struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL }; 255struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
311#endif 256#endif
312 257
313#if defined(CONFIG_ARCH_OMAP2420) 258#if defined(CONFIG_SOC_OMAP2420)
314/* IVA */ 259/* IVA */
315static struct omap_mbox2_priv omap2_mbox_iva_priv = { 260static struct omap_mbox2_priv omap2_mbox_iva_priv = {
316 .tx_fifo = { 261 .tx_fifo = {
@@ -398,14 +343,14 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
398 else if (cpu_is_omap34xx()) { 343 else if (cpu_is_omap34xx()) {
399 list = omap3_mboxes; 344 list = omap3_mboxes;
400 345
401 list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 346 list[0]->irq = platform_get_irq(pdev, 0);
402 } 347 }
403#endif 348#endif
404#if defined(CONFIG_ARCH_OMAP2) 349#if defined(CONFIG_ARCH_OMAP2)
405 else if (cpu_is_omap2430()) { 350 else if (cpu_is_omap2430()) {
406 list = omap2_mboxes; 351 list = omap2_mboxes;
407 352
408 list[0]->irq = platform_get_irq_byname(pdev, "dsp"); 353 list[0]->irq = platform_get_irq(pdev, 0);
409 } else if (cpu_is_omap2420()) { 354 } else if (cpu_is_omap2420()) {
410 list = omap2_mboxes; 355 list = omap2_mboxes;
411 356
@@ -417,8 +362,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
417 else if (cpu_is_omap44xx()) { 362 else if (cpu_is_omap44xx()) {
418 list = omap4_mboxes; 363 list = omap4_mboxes;
419 364
420 list[0]->irq = list[1]->irq = 365 list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0);
421 platform_get_irq_byname(pdev, "mbox");
422 } 366 }
423#endif 367#endif
424 else { 368 else {
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index f9c9df5b5ff1..565b9064a328 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -22,10 +22,11 @@
22#include <plat/dma.h> 22#include <plat/dma.h>
23#include <plat/cpu.h> 23#include <plat/cpu.h>
24#include <plat/mcbsp.h> 24#include <plat/mcbsp.h>
25#include <plat/omap_device.h>
26#include <linux/pm_runtime.h>
25 27
26#include "control.h" 28#include "control.h"
27 29
28
29/* McBSP internal signal muxing functions */ 30/* McBSP internal signal muxing functions */
30 31
31void omap2_mcbsp1_mux_clkr_src(u8 mux) 32void omap2_mcbsp1_mux_clkr_src(u8 mux)
@@ -83,7 +84,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
83 return -EINVAL; 84 return -EINVAL;
84 } 85 }
85 86
86 clk_disable(mcbsp->fclk); 87 pm_runtime_put_sync(mcbsp->dev);
87 88
88 r = clk_set_parent(mcbsp->fclk, fck_src); 89 r = clk_set_parent(mcbsp->fclk, fck_src);
89 if (IS_ERR_VALUE(r)) { 90 if (IS_ERR_VALUE(r)) {
@@ -93,7 +94,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
93 return -EINVAL; 94 return -EINVAL;
94 } 95 }
95 96
96 clk_enable(mcbsp->fclk); 97 pm_runtime_get_sync(mcbsp->dev);
97 98
98 clk_put(fck_src); 99 clk_put(fck_src);
99 100
@@ -101,196 +102,70 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
101} 102}
102EXPORT_SYMBOL(omap2_mcbsp_set_clks_src); 103EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
103 104
104 105struct omap_device_pm_latency omap2_mcbsp_latency[] = {
105/* Platform data */
106
107#ifdef CONFIG_ARCH_OMAP2420
108static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
109 { 106 {
110 .phys_base = OMAP24XX_MCBSP1_BASE, 107 .deactivate_func = omap_device_idle_hwmods,
111 .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, 108 .activate_func = omap_device_enable_hwmods,
112 .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, 109 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
113 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
114 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
115 },
116 {
117 .phys_base = OMAP24XX_MCBSP2_BASE,
118 .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
119 .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
120 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
121 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
122 }, 110 },
123}; 111};
124#define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata)
125#define OMAP2420_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
126#else
127#define omap2420_mcbsp_pdata NULL
128#define OMAP2420_MCBSP_PDATA_SZ 0
129#define OMAP2420_MCBSP_REG_NUM 0
130#endif
131 112
132#ifdef CONFIG_ARCH_OMAP2430 113static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
133static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { 114{
134 { 115 int id, count = 1;
135 .phys_base = OMAP24XX_MCBSP1_BASE, 116 char *name = "omap-mcbsp";
136 .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, 117 struct omap_hwmod *oh_device[2];
137 .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, 118 struct omap_mcbsp_platform_data *pdata = NULL;
138 .rx_irq = INT_24XX_MCBSP1_IRQ_RX, 119 struct omap_device *od;
139 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
140 },
141 {
142 .phys_base = OMAP24XX_MCBSP2_BASE,
143 .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
144 .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
145 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
146 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
147 },
148 {
149 .phys_base = OMAP2430_MCBSP3_BASE,
150 .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
151 .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
152 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
153 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
154 },
155 {
156 .phys_base = OMAP2430_MCBSP4_BASE,
157 .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
158 .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
159 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
160 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
161 },
162 {
163 .phys_base = OMAP2430_MCBSP5_BASE,
164 .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
165 .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
166 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
167 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
168 },
169};
170#define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata)
171#define OMAP2430_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
172#else
173#define omap2430_mcbsp_pdata NULL
174#define OMAP2430_MCBSP_PDATA_SZ 0
175#define OMAP2430_MCBSP_REG_NUM 0
176#endif
177 120
178#ifdef CONFIG_ARCH_OMAP3 121 sscanf(oh->name, "mcbsp%d", &id);
179static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
180 {
181 .phys_base = OMAP34XX_MCBSP1_BASE,
182 .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
183 .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
184 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
185 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
186 .buffer_size = 0x80, /* The FIFO has 128 locations */
187 },
188 {
189 .phys_base = OMAP34XX_MCBSP2_BASE,
190 .phys_base_st = OMAP34XX_MCBSP2_ST_BASE,
191 .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
192 .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
193 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
194 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
195 .buffer_size = 0x500, /* The FIFO has 1024 + 256 locations */
196 },
197 {
198 .phys_base = OMAP34XX_MCBSP3_BASE,
199 .phys_base_st = OMAP34XX_MCBSP3_ST_BASE,
200 .dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
201 .dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
202 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
203 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
204 .buffer_size = 0x80, /* The FIFO has 128 locations */
205 },
206 {
207 .phys_base = OMAP34XX_MCBSP4_BASE,
208 .dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
209 .dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
210 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
211 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
212 .buffer_size = 0x80, /* The FIFO has 128 locations */
213 },
214 {
215 .phys_base = OMAP34XX_MCBSP5_BASE,
216 .dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
217 .dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
218 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
219 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
220 .buffer_size = 0x80, /* The FIFO has 128 locations */
221 },
222};
223#define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata)
224#define OMAP34XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1)
225#else
226#define omap34xx_mcbsp_pdata NULL
227#define OMAP34XX_MCBSP_PDATA_SZ 0
228#define OMAP34XX_MCBSP_REG_NUM 0
229#endif
230 122
231static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { 123 pdata = kzalloc(sizeof(struct omap_mcbsp_platform_data), GFP_KERNEL);
232 { 124 if (!pdata) {
233 .phys_base = OMAP44XX_MCBSP1_BASE, 125 pr_err("%s: No memory for mcbsp\n", __func__);
234 .dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX, 126 return -ENOMEM;
235 .dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX, 127 }
236 .tx_irq = OMAP44XX_IRQ_MCBSP1, 128
237 }, 129 pdata->mcbsp_config_type = oh->class->rev;
238 { 130
239 .phys_base = OMAP44XX_MCBSP2_BASE, 131 if (oh->class->rev == MCBSP_CONFIG_TYPE3) {
240 .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX, 132 if (id == 2)
241 .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX, 133 /* The FIFO has 1024 + 256 locations */
242 .tx_irq = OMAP44XX_IRQ_MCBSP2, 134 pdata->buffer_size = 0x500;
243 }, 135 else
244 { 136 /* The FIFO has 128 locations */
245 .phys_base = OMAP44XX_MCBSP3_BASE, 137 pdata->buffer_size = 0x80;
246 .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX, 138 }
247 .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX, 139
248 .tx_irq = OMAP44XX_IRQ_MCBSP3, 140 oh_device[0] = oh;
249 }, 141
250 { 142 if (oh->dev_attr) {
251 .phys_base = OMAP44XX_MCBSP4_BASE, 143 oh_device[1] = omap_hwmod_lookup((
252 .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX, 144 (struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone);
253 .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX, 145 count++;
254 .tx_irq = OMAP44XX_IRQ_MCBSP4, 146 }
255 }, 147 od = omap_device_build_ss(name, id, oh_device, count, pdata,
256}; 148 sizeof(*pdata), omap2_mcbsp_latency,
257#define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) 149 ARRAY_SIZE(omap2_mcbsp_latency), false);
258#define OMAP44XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) 150 kfree(pdata);
151 if (IS_ERR(od)) {
152 pr_err("%s: Cant build omap_device for %s:%s.\n", __func__,
153 name, oh->name);
154 return PTR_ERR(od);
155 }
156 omap_mcbsp_count++;
157 return 0;
158}
259 159
260static int __init omap2_mcbsp_init(void) 160static int __init omap2_mcbsp_init(void)
261{ 161{
262 if (cpu_is_omap2420()) { 162 omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL);
263 omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ;
264 omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16);
265 } else if (cpu_is_omap2430()) {
266 omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ;
267 omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32);
268 } else if (cpu_is_omap34xx()) {
269 omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ;
270 omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32);
271 } else if (cpu_is_omap44xx()) {
272 omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ;
273 omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32);
274 }
275 163
276 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), 164 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
277 GFP_KERNEL); 165 GFP_KERNEL);
278 if (!mcbsp_ptr) 166 if (!mcbsp_ptr)
279 return -ENOMEM; 167 return -ENOMEM;
280 168
281 if (cpu_is_omap2420())
282 omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata,
283 OMAP2420_MCBSP_PDATA_SZ);
284 if (cpu_is_omap2430())
285 omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata,
286 OMAP2430_MCBSP_PDATA_SZ);
287 if (cpu_is_omap34xx())
288 omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata,
289 OMAP34XX_MCBSP_PDATA_SZ);
290 if (cpu_is_omap44xx())
291 omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata,
292 OMAP44XX_MCBSP_PDATA_SZ);
293
294 return omap_mcbsp_init(); 169 return omap_mcbsp_init();
295} 170}
296arch_initcall(omap2_mcbsp_init); 171arch_initcall(omap2_mcbsp_init);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e282e35769fd..e39772beaedd 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * omap_hwmod implementation for OMAP2/3/4 2 * omap_hwmod implementation for OMAP2/3/4
3 * 3 *
4 * Copyright (C) 2009-2010 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * 5 *
6 * Paul Walmsley, Benoît Cousson, Kevin Hilman 6 * Paul Walmsley, Benoît Cousson, Kevin Hilman
7 * 7 *
@@ -162,9 +162,6 @@ static LIST_HEAD(omap_hwmod_list);
162/* mpu_oh: used to add/remove MPU initiator from sleepdep list */ 162/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
163static struct omap_hwmod *mpu_oh; 163static struct omap_hwmod *mpu_oh;
164 164
165/* inited: 0 if omap_hwmod_init() has not yet been called; 1 otherwise */
166static u8 inited;
167
168 165
169/* Private functions */ 166/* Private functions */
170 167
@@ -460,14 +457,18 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
460 * will be accessed by a particular initiator (e.g., if a module will 457 * will be accessed by a particular initiator (e.g., if a module will
461 * be accessed by the IVA, there should be a sleepdep between the IVA 458 * be accessed by the IVA, there should be a sleepdep between the IVA
462 * initiator and the module). Only applies to modules in smart-idle 459 * initiator and the module). Only applies to modules in smart-idle
463 * mode. Returns -EINVAL upon error or passes along 460 * mode. If the clockdomain is marked as not needing autodeps, return
464 * clkdm_add_sleepdep() value upon success. 461 * 0 without doing anything. Otherwise, returns -EINVAL upon error or
462 * passes along clkdm_add_sleepdep() value upon success.
465 */ 463 */
466static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) 464static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
467{ 465{
468 if (!oh->_clk) 466 if (!oh->_clk)
469 return -EINVAL; 467 return -EINVAL;
470 468
469 if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS)
470 return 0;
471
471 return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); 472 return clkdm_add_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);
472} 473}
473 474
@@ -480,14 +481,18 @@ static int _add_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
480 * be accessed by a particular initiator (e.g., if a module will not 481 * be accessed by a particular initiator (e.g., if a module will not
481 * be accessed by the IVA, there should be no sleepdep between the IVA 482 * be accessed by the IVA, there should be no sleepdep between the IVA
482 * initiator and the module). Only applies to modules in smart-idle 483 * initiator and the module). Only applies to modules in smart-idle
483 * mode. Returns -EINVAL upon error or passes along 484 * mode. If the clockdomain is marked as not needing autodeps, return
484 * clkdm_del_sleepdep() value upon success. 485 * 0 without doing anything. Returns -EINVAL upon error or passes
486 * along clkdm_del_sleepdep() value upon success.
485 */ 487 */
486static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh) 488static int _del_initiator_dep(struct omap_hwmod *oh, struct omap_hwmod *init_oh)
487{ 489{
488 if (!oh->_clk) 490 if (!oh->_clk)
489 return -EINVAL; 491 return -EINVAL;
490 492
493 if (oh->_clk->clkdm && oh->_clk->clkdm->flags & CLKDM_NO_AUTODEPS)
494 return 0;
495
491 return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm); 496 return clkdm_del_sleepdep(oh->_clk->clkdm, init_oh->_clk->clkdm);
492} 497}
493 498
@@ -904,18 +909,16 @@ static struct omap_hwmod *_lookup(const char *name)
904 * @oh: struct omap_hwmod * 909 * @oh: struct omap_hwmod *
905 * @data: not used; pass NULL 910 * @data: not used; pass NULL
906 * 911 *
907 * Called by omap_hwmod_late_init() (after omap2_clk_init()). 912 * Called by omap_hwmod_setup_*() (after omap2_clk_init()).
908 * Resolves all clock names embedded in the hwmod. Returns -EINVAL if 913 * Resolves all clock names embedded in the hwmod. Returns 0 on
909 * the omap_hwmod has not yet been registered or if the clocks have 914 * success, or a negative error code on failure.
910 * already been initialized, 0 on success, or a non-zero error on
911 * failure.
912 */ 915 */
913static int _init_clocks(struct omap_hwmod *oh, void *data) 916static int _init_clocks(struct omap_hwmod *oh, void *data)
914{ 917{
915 int ret = 0; 918 int ret = 0;
916 919
917 if (!oh || (oh->_state != _HWMOD_STATE_REGISTERED)) 920 if (oh->_state != _HWMOD_STATE_REGISTERED)
918 return -EINVAL; 921 return 0;
919 922
920 pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name); 923 pr_debug("omap_hwmod: %s: looking up clocks\n", oh->name);
921 924
@@ -1288,6 +1291,42 @@ static int _idle(struct omap_hwmod *oh)
1288} 1291}
1289 1292
1290/** 1293/**
1294 * omap_hwmod_set_ocp_autoidle - set the hwmod's OCP autoidle bit
1295 * @oh: struct omap_hwmod *
1296 * @autoidle: desired AUTOIDLE bitfield value (0 or 1)
1297 *
1298 * Sets the IP block's OCP autoidle bit in hardware, and updates our
1299 * local copy. Intended to be used by drivers that require
1300 * direct manipulation of the AUTOIDLE bits.
1301 * Returns -EINVAL if @oh is null or is not in the ENABLED state, or passes
1302 * along the return value from _set_module_autoidle().
1303 *
1304 * Any users of this function should be scrutinized carefully.
1305 */
1306int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle)
1307{
1308 u32 v;
1309 int retval = 0;
1310 unsigned long flags;
1311
1312 if (!oh || oh->_state != _HWMOD_STATE_ENABLED)
1313 return -EINVAL;
1314
1315 spin_lock_irqsave(&oh->_lock, flags);
1316
1317 v = oh->_sysc_cache;
1318
1319 retval = _set_module_autoidle(oh, autoidle, &v);
1320
1321 if (!retval)
1322 _write_sysconfig(v, oh);
1323
1324 spin_unlock_irqrestore(&oh->_lock, flags);
1325
1326 return retval;
1327}
1328
1329/**
1291 * _shutdown - shutdown an omap_hwmod 1330 * _shutdown - shutdown an omap_hwmod
1292 * @oh: struct omap_hwmod * 1331 * @oh: struct omap_hwmod *
1293 * 1332 *
@@ -1354,14 +1393,16 @@ static int _shutdown(struct omap_hwmod *oh)
1354 * @oh: struct omap_hwmod * 1393 * @oh: struct omap_hwmod *
1355 * 1394 *
1356 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh 1395 * Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh
1357 * OCP_SYSCONFIG register. Returns -EINVAL if the hwmod is in the 1396 * OCP_SYSCONFIG register. Returns 0.
1358 * wrong state or returns 0.
1359 */ 1397 */
1360static int _setup(struct omap_hwmod *oh, void *data) 1398static int _setup(struct omap_hwmod *oh, void *data)
1361{ 1399{
1362 int i, r; 1400 int i, r;
1363 u8 postsetup_state; 1401 u8 postsetup_state;
1364 1402
1403 if (oh->_state != _HWMOD_STATE_CLKS_INITED)
1404 return 0;
1405
1365 /* Set iclk autoidle mode */ 1406 /* Set iclk autoidle mode */
1366 if (oh->slaves_cnt > 0) { 1407 if (oh->slaves_cnt > 0) {
1367 for (i = 0; i < oh->slaves_cnt; i++) { 1408 for (i = 0; i < oh->slaves_cnt; i++) {
@@ -1455,7 +1496,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
1455 */ 1496 */
1456static int __init _register(struct omap_hwmod *oh) 1497static int __init _register(struct omap_hwmod *oh)
1457{ 1498{
1458 int ret, ms_id; 1499 int ms_id;
1459 1500
1460 if (!oh || !oh->name || !oh->class || !oh->class->name || 1501 if (!oh || !oh->name || !oh->class || !oh->class->name ||
1461 (oh->_state != _HWMOD_STATE_UNKNOWN)) 1502 (oh->_state != _HWMOD_STATE_UNKNOWN))
@@ -1467,12 +1508,10 @@ static int __init _register(struct omap_hwmod *oh)
1467 return -EEXIST; 1508 return -EEXIST;
1468 1509
1469 ms_id = _find_mpu_port_index(oh); 1510 ms_id = _find_mpu_port_index(oh);
1470 if (!IS_ERR_VALUE(ms_id)) { 1511 if (!IS_ERR_VALUE(ms_id))
1471 oh->_mpu_port_index = ms_id; 1512 oh->_mpu_port_index = ms_id;
1472 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index); 1513 else
1473 } else {
1474 oh->_int_flags |= _HWMOD_NO_MPU_PORT; 1514 oh->_int_flags |= _HWMOD_NO_MPU_PORT;
1475 }
1476 1515
1477 list_add_tail(&oh->node, &omap_hwmod_list); 1516 list_add_tail(&oh->node, &omap_hwmod_list);
1478 1517
@@ -1480,9 +1519,14 @@ static int __init _register(struct omap_hwmod *oh)
1480 1519
1481 oh->_state = _HWMOD_STATE_REGISTERED; 1520 oh->_state = _HWMOD_STATE_REGISTERED;
1482 1521
1483 ret = 0; 1522 /*
1523 * XXX Rather than doing a strcmp(), this should test a flag
1524 * set in the hwmod data, inserted by the autogenerator code.
1525 */
1526 if (!strcmp(oh->name, MPU_INITIATOR_NAME))
1527 mpu_oh = oh;
1484 1528
1485 return ret; 1529 return 0;
1486} 1530}
1487 1531
1488 1532
@@ -1585,65 +1629,132 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
1585 return ret; 1629 return ret;
1586} 1630}
1587 1631
1588
1589/** 1632/**
1590 * omap_hwmod_init - init omap_hwmod code and register hwmods 1633 * omap_hwmod_register - register an array of hwmods
1591 * @ohs: pointer to an array of omap_hwmods to register 1634 * @ohs: pointer to an array of omap_hwmods to register
1592 * 1635 *
1593 * Intended to be called early in boot before the clock framework is 1636 * Intended to be called early in boot before the clock framework is
1594 * initialized. If @ohs is not null, will register all omap_hwmods 1637 * initialized. If @ohs is not null, will register all omap_hwmods
1595 * listed in @ohs that are valid for this chip. Returns -EINVAL if 1638 * listed in @ohs that are valid for this chip. Returns 0.
1596 * omap_hwmod_init() has already been called or 0 otherwise. 1639 */
1640int __init omap_hwmod_register(struct omap_hwmod **ohs)
1641{
1642 int r, i;
1643
1644 if (!ohs)
1645 return 0;
1646
1647 i = 0;
1648 do {
1649 if (!omap_chip_is(ohs[i]->omap_chip))
1650 continue;
1651
1652 r = _register(ohs[i]);
1653 WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name,
1654 r);
1655 } while (ohs[++i]);
1656
1657 return 0;
1658}
1659
1660/*
1661 * _populate_mpu_rt_base - populate the virtual address for a hwmod
1662 *
1663 * Must be called only from omap_hwmod_setup_*() so ioremap works properly.
1664 * Assumes the caller takes care of locking if needed.
1597 */ 1665 */
1598int __init omap_hwmod_init(struct omap_hwmod **ohs) 1666static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data)
1667{
1668 if (oh->_state != _HWMOD_STATE_REGISTERED)
1669 return 0;
1670
1671 if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
1672 return 0;
1673
1674 oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
1675 if (!oh->_mpu_rt_va)
1676 pr_warning("omap_hwmod: %s found no _mpu_rt_va for %s\n",
1677 __func__, oh->name);
1678
1679 return 0;
1680}
1681
1682/**
1683 * omap_hwmod_setup_one - set up a single hwmod
1684 * @oh_name: const char * name of the already-registered hwmod to set up
1685 *
1686 * Must be called after omap2_clk_init(). Resolves the struct clk
1687 * names to struct clk pointers for each registered omap_hwmod. Also
1688 * calls _setup() on each hwmod. Returns -EINVAL upon error or 0 upon
1689 * success.
1690 */
1691int __init omap_hwmod_setup_one(const char *oh_name)
1599{ 1692{
1600 struct omap_hwmod *oh; 1693 struct omap_hwmod *oh;
1601 int r; 1694 int r;
1602 1695
1603 if (inited) 1696 pr_debug("omap_hwmod: %s: %s\n", oh_name, __func__);
1697
1698 if (!mpu_oh) {
1699 pr_err("omap_hwmod: %s: cannot setup_one: MPU initiator hwmod %s not yet registered\n",
1700 oh_name, MPU_INITIATOR_NAME);
1604 return -EINVAL; 1701 return -EINVAL;
1702 }
1605 1703
1606 inited = 1; 1704 oh = _lookup(oh_name);
1705 if (!oh) {
1706 WARN(1, "omap_hwmod: %s: hwmod not yet registered\n", oh_name);
1707 return -EINVAL;
1708 }
1607 1709
1608 if (!ohs) 1710 if (mpu_oh->_state == _HWMOD_STATE_REGISTERED && oh != mpu_oh)
1609 return 0; 1711 omap_hwmod_setup_one(MPU_INITIATOR_NAME);
1610 1712
1611 oh = *ohs; 1713 r = _populate_mpu_rt_base(oh, NULL);
1612 while (oh) { 1714 if (IS_ERR_VALUE(r)) {
1613 if (omap_chip_is(oh->omap_chip)) { 1715 WARN(1, "omap_hwmod: %s: couldn't set mpu_rt_base\n", oh_name);
1614 r = _register(oh); 1716 return -EINVAL;
1615 WARN(r, "omap_hwmod: %s: _register returned " 1717 }
1616 "%d\n", oh->name, r); 1718
1617 } 1719 r = _init_clocks(oh, NULL);
1618 oh = *++ohs; 1720 if (IS_ERR_VALUE(r)) {
1721 WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh_name);
1722 return -EINVAL;
1619 } 1723 }
1620 1724
1725 _setup(oh, NULL);
1726
1621 return 0; 1727 return 0;
1622} 1728}
1623 1729
1624/** 1730/**
1625 * omap_hwmod_late_init - do some post-clock framework initialization 1731 * omap_hwmod_setup - do some post-clock framework initialization
1626 * 1732 *
1627 * Must be called after omap2_clk_init(). Resolves the struct clk names 1733 * Must be called after omap2_clk_init(). Resolves the struct clk names
1628 * to struct clk pointers for each registered omap_hwmod. Also calls 1734 * to struct clk pointers for each registered omap_hwmod. Also calls
1629 * _setup() on each hwmod. Returns 0. 1735 * _setup() on each hwmod. Returns 0 upon success.
1630 */ 1736 */
1631int omap_hwmod_late_init(void) 1737static int __init omap_hwmod_setup_all(void)
1632{ 1738{
1633 int r; 1739 int r;
1634 1740
1635 /* XXX check return value */ 1741 if (!mpu_oh) {
1636 r = omap_hwmod_for_each(_init_clocks, NULL); 1742 pr_err("omap_hwmod: %s: MPU initiator hwmod %s not yet registered\n",
1637 WARN(r, "omap_hwmod: omap_hwmod_late_init(): _init_clocks failed\n"); 1743 __func__, MPU_INITIATOR_NAME);
1744 return -EINVAL;
1745 }
1746
1747 r = omap_hwmod_for_each(_populate_mpu_rt_base, NULL);
1638 1748
1639 mpu_oh = omap_hwmod_lookup(MPU_INITIATOR_NAME); 1749 r = omap_hwmod_for_each(_init_clocks, NULL);
1640 WARN(!mpu_oh, "omap_hwmod: could not find MPU initiator hwmod %s\n", 1750 WARN(IS_ERR_VALUE(r),
1641 MPU_INITIATOR_NAME); 1751 "omap_hwmod: %s: _init_clocks failed\n", __func__);
1642 1752
1643 omap_hwmod_for_each(_setup, NULL); 1753 omap_hwmod_for_each(_setup, NULL);
1644 1754
1645 return 0; 1755 return 0;
1646} 1756}
1757core_initcall(omap_hwmod_setup_all);
1647 1758
1648/** 1759/**
1649 * omap_hwmod_enable - enable an omap_hwmod 1760 * omap_hwmod_enable - enable an omap_hwmod
@@ -1862,6 +1973,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
1862 os = oh->slaves[i]; 1973 os = oh->slaves[i];
1863 1974
1864 for (j = 0; j < os->addr_cnt; j++) { 1975 for (j = 0; j < os->addr_cnt; j++) {
1976 (res + r)->name = (os->addr + j)->name;
1865 (res + r)->start = (os->addr + j)->pa_start; 1977 (res + r)->start = (os->addr + j)->pa_start;
1866 (res + r)->end = (os->addr + j)->pa_end; 1978 (res + r)->end = (os->addr + j)->pa_end;
1867 (res + r)->flags = IORESOURCE_MEM; 1979 (res + r)->flags = IORESOURCE_MEM;
@@ -2162,11 +2274,11 @@ int omap_hwmod_for_each_by_class(const char *classname,
2162 * @oh: struct omap_hwmod * 2274 * @oh: struct omap_hwmod *
2163 * @state: state that _setup() should leave the hwmod in 2275 * @state: state that _setup() should leave the hwmod in
2164 * 2276 *
2165 * Sets the hwmod state that @oh will enter at the end of _setup() (called by 2277 * Sets the hwmod state that @oh will enter at the end of _setup()
2166 * omap_hwmod_late_init()). Only valid to call between calls to 2278 * (called by omap_hwmod_setup_*()). Only valid to call between
2167 * omap_hwmod_init() and omap_hwmod_late_init(). Returns 0 upon success or 2279 * calling omap_hwmod_register() and omap_hwmod_setup_*(). Returns
2168 * -EINVAL if there is a problem with the arguments or if the hwmod is 2280 * 0 upon success or -EINVAL if there is a problem with the arguments
2169 * in the wrong state. 2281 * or if the hwmod is in the wrong state.
2170 */ 2282 */
2171int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) 2283int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
2172{ 2284{
@@ -2218,3 +2330,29 @@ u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh)
2218 2330
2219 return ret; 2331 return ret;
2220} 2332}
2333
2334/**
2335 * omap_hwmod_no_setup_reset - prevent a hwmod from being reset upon setup
2336 * @oh: struct omap_hwmod *
2337 *
2338 * Prevent the hwmod @oh from being reset during the setup process.
2339 * Intended for use by board-*.c files on boards with devices that
2340 * cannot tolerate being reset. Must be called before the hwmod has
2341 * been set up. Returns 0 upon success or negative error code upon
2342 * failure.
2343 */
2344int omap_hwmod_no_setup_reset(struct omap_hwmod *oh)
2345{
2346 if (!oh)
2347 return -EINVAL;
2348
2349 if (oh->_state != _HWMOD_STATE_REGISTERED) {
2350 pr_err("omap_hwmod: %s: cannot prevent setup reset; in wrong state\n",
2351 oh->name);
2352 return -EINVAL;
2353 }
2354
2355 oh->flags |= HWMOD_INIT_NO_RESET;
2356
2357 return 0;
2358}
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index b85c630b64d6..61e58bd27aec 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -18,6 +18,10 @@
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h> 19#include <plat/i2c.h>
20#include <plat/gpio.h> 20#include <plat/gpio.h>
21#include <plat/mcspi.h>
22#include <plat/dmtimer.h>
23#include <plat/l3_2xxx.h>
24#include <plat/l4_2xxx.h>
21 25
22#include "omap_hwmod_common_data.h" 26#include "omap_hwmod_common_data.h"
23 27
@@ -38,12 +42,18 @@ static struct omap_hwmod omap2420_mpu_hwmod;
38static struct omap_hwmod omap2420_iva_hwmod; 42static struct omap_hwmod omap2420_iva_hwmod;
39static struct omap_hwmod omap2420_l3_main_hwmod; 43static struct omap_hwmod omap2420_l3_main_hwmod;
40static struct omap_hwmod omap2420_l4_core_hwmod; 44static struct omap_hwmod omap2420_l4_core_hwmod;
45static struct omap_hwmod omap2420_dss_core_hwmod;
46static struct omap_hwmod omap2420_dss_dispc_hwmod;
47static struct omap_hwmod omap2420_dss_rfbi_hwmod;
48static struct omap_hwmod omap2420_dss_venc_hwmod;
41static struct omap_hwmod omap2420_wd_timer2_hwmod; 49static struct omap_hwmod omap2420_wd_timer2_hwmod;
42static struct omap_hwmod omap2420_gpio1_hwmod; 50static struct omap_hwmod omap2420_gpio1_hwmod;
43static struct omap_hwmod omap2420_gpio2_hwmod; 51static struct omap_hwmod omap2420_gpio2_hwmod;
44static struct omap_hwmod omap2420_gpio3_hwmod; 52static struct omap_hwmod omap2420_gpio3_hwmod;
45static struct omap_hwmod omap2420_gpio4_hwmod; 53static struct omap_hwmod omap2420_gpio4_hwmod;
46static struct omap_hwmod omap2420_dma_system_hwmod; 54static struct omap_hwmod omap2420_dma_system_hwmod;
55static struct omap_hwmod omap2420_mcspi1_hwmod;
56static struct omap_hwmod omap2420_mcspi2_hwmod;
47 57
48/* L3 -> L4_CORE interface */ 58/* L3 -> L4_CORE interface */
49static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { 59static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
@@ -64,6 +74,19 @@ static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
64 &omap2420_mpu__l3_main, 74 &omap2420_mpu__l3_main,
65}; 75};
66 76
77/* DSS -> l3 */
78static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
79 .master = &omap2420_dss_core_hwmod,
80 .slave = &omap2420_l3_main_hwmod,
81 .fw = {
82 .omap2 = {
83 .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS,
84 .flags = OMAP_FIREWALL_L3,
85 }
86 },
87 .user = OCP_USER_MPU | OCP_USER_SDMA,
88};
89
67/* Master interfaces on the L3 interconnect */ 90/* Master interfaces on the L3 interconnect */
68static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = { 91static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
69 &omap2420_l3_main__l4_core, 92 &omap2420_l3_main__l4_core,
@@ -87,6 +110,44 @@ static struct omap_hwmod omap2420_uart2_hwmod;
87static struct omap_hwmod omap2420_uart3_hwmod; 110static struct omap_hwmod omap2420_uart3_hwmod;
88static struct omap_hwmod omap2420_i2c1_hwmod; 111static struct omap_hwmod omap2420_i2c1_hwmod;
89static struct omap_hwmod omap2420_i2c2_hwmod; 112static struct omap_hwmod omap2420_i2c2_hwmod;
113static struct omap_hwmod omap2420_mcbsp1_hwmod;
114static struct omap_hwmod omap2420_mcbsp2_hwmod;
115
116/* l4 core -> mcspi1 interface */
117static struct omap_hwmod_addr_space omap2420_mcspi1_addr_space[] = {
118 {
119 .pa_start = 0x48098000,
120 .pa_end = 0x480980ff,
121 .flags = ADDR_TYPE_RT,
122 },
123};
124
125static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi1 = {
126 .master = &omap2420_l4_core_hwmod,
127 .slave = &omap2420_mcspi1_hwmod,
128 .clk = "mcspi1_ick",
129 .addr = omap2420_mcspi1_addr_space,
130 .addr_cnt = ARRAY_SIZE(omap2420_mcspi1_addr_space),
131 .user = OCP_USER_MPU | OCP_USER_SDMA,
132};
133
134/* l4 core -> mcspi2 interface */
135static struct omap_hwmod_addr_space omap2420_mcspi2_addr_space[] = {
136 {
137 .pa_start = 0x4809a000,
138 .pa_end = 0x4809a0ff,
139 .flags = ADDR_TYPE_RT,
140 },
141};
142
143static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi2 = {
144 .master = &omap2420_l4_core_hwmod,
145 .slave = &omap2420_mcspi2_hwmod,
146 .clk = "mcspi2_ick",
147 .addr = omap2420_mcspi2_addr_space,
148 .addr_cnt = ARRAY_SIZE(omap2420_mcspi2_addr_space),
149 .user = OCP_USER_MPU | OCP_USER_SDMA,
150};
90 151
91/* L4_CORE -> L4_WKUP interface */ 152/* L4_CORE -> L4_WKUP interface */
92static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { 153static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
@@ -279,6 +340,625 @@ static struct omap_hwmod omap2420_iva_hwmod = {
279 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) 340 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
280}; 341};
281 342
343/* Timer Common */
344static struct omap_hwmod_class_sysconfig omap2420_timer_sysc = {
345 .rev_offs = 0x0000,
346 .sysc_offs = 0x0010,
347 .syss_offs = 0x0014,
348 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
349 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
350 SYSC_HAS_AUTOIDLE),
351 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
352 .sysc_fields = &omap_hwmod_sysc_type1,
353};
354
355static struct omap_hwmod_class omap2420_timer_hwmod_class = {
356 .name = "timer",
357 .sysc = &omap2420_timer_sysc,
358 .rev = OMAP_TIMER_IP_VERSION_1,
359};
360
361/* timer1 */
362static struct omap_hwmod omap2420_timer1_hwmod;
363static struct omap_hwmod_irq_info omap2420_timer1_mpu_irqs[] = {
364 { .irq = 37, },
365};
366
367static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = {
368 {
369 .pa_start = 0x48028000,
370 .pa_end = 0x48028000 + SZ_1K - 1,
371 .flags = ADDR_TYPE_RT
372 },
373};
374
375/* l4_wkup -> timer1 */
376static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = {
377 .master = &omap2420_l4_wkup_hwmod,
378 .slave = &omap2420_timer1_hwmod,
379 .clk = "gpt1_ick",
380 .addr = omap2420_timer1_addrs,
381 .addr_cnt = ARRAY_SIZE(omap2420_timer1_addrs),
382 .user = OCP_USER_MPU | OCP_USER_SDMA,
383};
384
385/* timer1 slave port */
386static struct omap_hwmod_ocp_if *omap2420_timer1_slaves[] = {
387 &omap2420_l4_wkup__timer1,
388};
389
390/* timer1 hwmod */
391static struct omap_hwmod omap2420_timer1_hwmod = {
392 .name = "timer1",
393 .mpu_irqs = omap2420_timer1_mpu_irqs,
394 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer1_mpu_irqs),
395 .main_clk = "gpt1_fck",
396 .prcm = {
397 .omap2 = {
398 .prcm_reg_id = 1,
399 .module_bit = OMAP24XX_EN_GPT1_SHIFT,
400 .module_offs = WKUP_MOD,
401 .idlest_reg_id = 1,
402 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
403 },
404 },
405 .slaves = omap2420_timer1_slaves,
406 .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves),
407 .class = &omap2420_timer_hwmod_class,
408 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
409};
410
411/* timer2 */
412static struct omap_hwmod omap2420_timer2_hwmod;
413static struct omap_hwmod_irq_info omap2420_timer2_mpu_irqs[] = {
414 { .irq = 38, },
415};
416
417static struct omap_hwmod_addr_space omap2420_timer2_addrs[] = {
418 {
419 .pa_start = 0x4802a000,
420 .pa_end = 0x4802a000 + SZ_1K - 1,
421 .flags = ADDR_TYPE_RT
422 },
423};
424
425/* l4_core -> timer2 */
426static struct omap_hwmod_ocp_if omap2420_l4_core__timer2 = {
427 .master = &omap2420_l4_core_hwmod,
428 .slave = &omap2420_timer2_hwmod,
429 .clk = "gpt2_ick",
430 .addr = omap2420_timer2_addrs,
431 .addr_cnt = ARRAY_SIZE(omap2420_timer2_addrs),
432 .user = OCP_USER_MPU | OCP_USER_SDMA,
433};
434
435/* timer2 slave port */
436static struct omap_hwmod_ocp_if *omap2420_timer2_slaves[] = {
437 &omap2420_l4_core__timer2,
438};
439
440/* timer2 hwmod */
441static struct omap_hwmod omap2420_timer2_hwmod = {
442 .name = "timer2",
443 .mpu_irqs = omap2420_timer2_mpu_irqs,
444 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer2_mpu_irqs),
445 .main_clk = "gpt2_fck",
446 .prcm = {
447 .omap2 = {
448 .prcm_reg_id = 1,
449 .module_bit = OMAP24XX_EN_GPT2_SHIFT,
450 .module_offs = CORE_MOD,
451 .idlest_reg_id = 1,
452 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
453 },
454 },
455 .slaves = omap2420_timer2_slaves,
456 .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves),
457 .class = &omap2420_timer_hwmod_class,
458 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
459};
460
461/* timer3 */
462static struct omap_hwmod omap2420_timer3_hwmod;
463static struct omap_hwmod_irq_info omap2420_timer3_mpu_irqs[] = {
464 { .irq = 39, },
465};
466
467static struct omap_hwmod_addr_space omap2420_timer3_addrs[] = {
468 {
469 .pa_start = 0x48078000,
470 .pa_end = 0x48078000 + SZ_1K - 1,
471 .flags = ADDR_TYPE_RT
472 },
473};
474
475/* l4_core -> timer3 */
476static struct omap_hwmod_ocp_if omap2420_l4_core__timer3 = {
477 .master = &omap2420_l4_core_hwmod,
478 .slave = &omap2420_timer3_hwmod,
479 .clk = "gpt3_ick",
480 .addr = omap2420_timer3_addrs,
481 .addr_cnt = ARRAY_SIZE(omap2420_timer3_addrs),
482 .user = OCP_USER_MPU | OCP_USER_SDMA,
483};
484
485/* timer3 slave port */
486static struct omap_hwmod_ocp_if *omap2420_timer3_slaves[] = {
487 &omap2420_l4_core__timer3,
488};
489
490/* timer3 hwmod */
491static struct omap_hwmod omap2420_timer3_hwmod = {
492 .name = "timer3",
493 .mpu_irqs = omap2420_timer3_mpu_irqs,
494 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer3_mpu_irqs),
495 .main_clk = "gpt3_fck",
496 .prcm = {
497 .omap2 = {
498 .prcm_reg_id = 1,
499 .module_bit = OMAP24XX_EN_GPT3_SHIFT,
500 .module_offs = CORE_MOD,
501 .idlest_reg_id = 1,
502 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
503 },
504 },
505 .slaves = omap2420_timer3_slaves,
506 .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves),
507 .class = &omap2420_timer_hwmod_class,
508 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
509};
510
511/* timer4 */
512static struct omap_hwmod omap2420_timer4_hwmod;
513static struct omap_hwmod_irq_info omap2420_timer4_mpu_irqs[] = {
514 { .irq = 40, },
515};
516
517static struct omap_hwmod_addr_space omap2420_timer4_addrs[] = {
518 {
519 .pa_start = 0x4807a000,
520 .pa_end = 0x4807a000 + SZ_1K - 1,
521 .flags = ADDR_TYPE_RT
522 },
523};
524
525/* l4_core -> timer4 */
526static struct omap_hwmod_ocp_if omap2420_l4_core__timer4 = {
527 .master = &omap2420_l4_core_hwmod,
528 .slave = &omap2420_timer4_hwmod,
529 .clk = "gpt4_ick",
530 .addr = omap2420_timer4_addrs,
531 .addr_cnt = ARRAY_SIZE(omap2420_timer4_addrs),
532 .user = OCP_USER_MPU | OCP_USER_SDMA,
533};
534
535/* timer4 slave port */
536static struct omap_hwmod_ocp_if *omap2420_timer4_slaves[] = {
537 &omap2420_l4_core__timer4,
538};
539
540/* timer4 hwmod */
541static struct omap_hwmod omap2420_timer4_hwmod = {
542 .name = "timer4",
543 .mpu_irqs = omap2420_timer4_mpu_irqs,
544 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer4_mpu_irqs),
545 .main_clk = "gpt4_fck",
546 .prcm = {
547 .omap2 = {
548 .prcm_reg_id = 1,
549 .module_bit = OMAP24XX_EN_GPT4_SHIFT,
550 .module_offs = CORE_MOD,
551 .idlest_reg_id = 1,
552 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
553 },
554 },
555 .slaves = omap2420_timer4_slaves,
556 .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves),
557 .class = &omap2420_timer_hwmod_class,
558 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
559};
560
561/* timer5 */
562static struct omap_hwmod omap2420_timer5_hwmod;
563static struct omap_hwmod_irq_info omap2420_timer5_mpu_irqs[] = {
564 { .irq = 41, },
565};
566
567static struct omap_hwmod_addr_space omap2420_timer5_addrs[] = {
568 {
569 .pa_start = 0x4807c000,
570 .pa_end = 0x4807c000 + SZ_1K - 1,
571 .flags = ADDR_TYPE_RT
572 },
573};
574
575/* l4_core -> timer5 */
576static struct omap_hwmod_ocp_if omap2420_l4_core__timer5 = {
577 .master = &omap2420_l4_core_hwmod,
578 .slave = &omap2420_timer5_hwmod,
579 .clk = "gpt5_ick",
580 .addr = omap2420_timer5_addrs,
581 .addr_cnt = ARRAY_SIZE(omap2420_timer5_addrs),
582 .user = OCP_USER_MPU | OCP_USER_SDMA,
583};
584
585/* timer5 slave port */
586static struct omap_hwmod_ocp_if *omap2420_timer5_slaves[] = {
587 &omap2420_l4_core__timer5,
588};
589
590/* timer5 hwmod */
591static struct omap_hwmod omap2420_timer5_hwmod = {
592 .name = "timer5",
593 .mpu_irqs = omap2420_timer5_mpu_irqs,
594 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer5_mpu_irqs),
595 .main_clk = "gpt5_fck",
596 .prcm = {
597 .omap2 = {
598 .prcm_reg_id = 1,
599 .module_bit = OMAP24XX_EN_GPT5_SHIFT,
600 .module_offs = CORE_MOD,
601 .idlest_reg_id = 1,
602 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
603 },
604 },
605 .slaves = omap2420_timer5_slaves,
606 .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves),
607 .class = &omap2420_timer_hwmod_class,
608 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
609};
610
611
612/* timer6 */
613static struct omap_hwmod omap2420_timer6_hwmod;
614static struct omap_hwmod_irq_info omap2420_timer6_mpu_irqs[] = {
615 { .irq = 42, },
616};
617
618static struct omap_hwmod_addr_space omap2420_timer6_addrs[] = {
619 {
620 .pa_start = 0x4807e000,
621 .pa_end = 0x4807e000 + SZ_1K - 1,
622 .flags = ADDR_TYPE_RT
623 },
624};
625
626/* l4_core -> timer6 */
627static struct omap_hwmod_ocp_if omap2420_l4_core__timer6 = {
628 .master = &omap2420_l4_core_hwmod,
629 .slave = &omap2420_timer6_hwmod,
630 .clk = "gpt6_ick",
631 .addr = omap2420_timer6_addrs,
632 .addr_cnt = ARRAY_SIZE(omap2420_timer6_addrs),
633 .user = OCP_USER_MPU | OCP_USER_SDMA,
634};
635
636/* timer6 slave port */
637static struct omap_hwmod_ocp_if *omap2420_timer6_slaves[] = {
638 &omap2420_l4_core__timer6,
639};
640
641/* timer6 hwmod */
642static struct omap_hwmod omap2420_timer6_hwmod = {
643 .name = "timer6",
644 .mpu_irqs = omap2420_timer6_mpu_irqs,
645 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer6_mpu_irqs),
646 .main_clk = "gpt6_fck",
647 .prcm = {
648 .omap2 = {
649 .prcm_reg_id = 1,
650 .module_bit = OMAP24XX_EN_GPT6_SHIFT,
651 .module_offs = CORE_MOD,
652 .idlest_reg_id = 1,
653 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
654 },
655 },
656 .slaves = omap2420_timer6_slaves,
657 .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves),
658 .class = &omap2420_timer_hwmod_class,
659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
660};
661
662/* timer7 */
663static struct omap_hwmod omap2420_timer7_hwmod;
664static struct omap_hwmod_irq_info omap2420_timer7_mpu_irqs[] = {
665 { .irq = 43, },
666};
667
668static struct omap_hwmod_addr_space omap2420_timer7_addrs[] = {
669 {
670 .pa_start = 0x48080000,
671 .pa_end = 0x48080000 + SZ_1K - 1,
672 .flags = ADDR_TYPE_RT
673 },
674};
675
676/* l4_core -> timer7 */
677static struct omap_hwmod_ocp_if omap2420_l4_core__timer7 = {
678 .master = &omap2420_l4_core_hwmod,
679 .slave = &omap2420_timer7_hwmod,
680 .clk = "gpt7_ick",
681 .addr = omap2420_timer7_addrs,
682 .addr_cnt = ARRAY_SIZE(omap2420_timer7_addrs),
683 .user = OCP_USER_MPU | OCP_USER_SDMA,
684};
685
686/* timer7 slave port */
687static struct omap_hwmod_ocp_if *omap2420_timer7_slaves[] = {
688 &omap2420_l4_core__timer7,
689};
690
691/* timer7 hwmod */
692static struct omap_hwmod omap2420_timer7_hwmod = {
693 .name = "timer7",
694 .mpu_irqs = omap2420_timer7_mpu_irqs,
695 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer7_mpu_irqs),
696 .main_clk = "gpt7_fck",
697 .prcm = {
698 .omap2 = {
699 .prcm_reg_id = 1,
700 .module_bit = OMAP24XX_EN_GPT7_SHIFT,
701 .module_offs = CORE_MOD,
702 .idlest_reg_id = 1,
703 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
704 },
705 },
706 .slaves = omap2420_timer7_slaves,
707 .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves),
708 .class = &omap2420_timer_hwmod_class,
709 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
710};
711
712/* timer8 */
713static struct omap_hwmod omap2420_timer8_hwmod;
714static struct omap_hwmod_irq_info omap2420_timer8_mpu_irqs[] = {
715 { .irq = 44, },
716};
717
718static struct omap_hwmod_addr_space omap2420_timer8_addrs[] = {
719 {
720 .pa_start = 0x48082000,
721 .pa_end = 0x48082000 + SZ_1K - 1,
722 .flags = ADDR_TYPE_RT
723 },
724};
725
726/* l4_core -> timer8 */
727static struct omap_hwmod_ocp_if omap2420_l4_core__timer8 = {
728 .master = &omap2420_l4_core_hwmod,
729 .slave = &omap2420_timer8_hwmod,
730 .clk = "gpt8_ick",
731 .addr = omap2420_timer8_addrs,
732 .addr_cnt = ARRAY_SIZE(omap2420_timer8_addrs),
733 .user = OCP_USER_MPU | OCP_USER_SDMA,
734};
735
736/* timer8 slave port */
737static struct omap_hwmod_ocp_if *omap2420_timer8_slaves[] = {
738 &omap2420_l4_core__timer8,
739};
740
741/* timer8 hwmod */
742static struct omap_hwmod omap2420_timer8_hwmod = {
743 .name = "timer8",
744 .mpu_irqs = omap2420_timer8_mpu_irqs,
745 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer8_mpu_irqs),
746 .main_clk = "gpt8_fck",
747 .prcm = {
748 .omap2 = {
749 .prcm_reg_id = 1,
750 .module_bit = OMAP24XX_EN_GPT8_SHIFT,
751 .module_offs = CORE_MOD,
752 .idlest_reg_id = 1,
753 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
754 },
755 },
756 .slaves = omap2420_timer8_slaves,
757 .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves),
758 .class = &omap2420_timer_hwmod_class,
759 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
760};
761
762/* timer9 */
763static struct omap_hwmod omap2420_timer9_hwmod;
764static struct omap_hwmod_irq_info omap2420_timer9_mpu_irqs[] = {
765 { .irq = 45, },
766};
767
768static struct omap_hwmod_addr_space omap2420_timer9_addrs[] = {
769 {
770 .pa_start = 0x48084000,
771 .pa_end = 0x48084000 + SZ_1K - 1,
772 .flags = ADDR_TYPE_RT
773 },
774};
775
776/* l4_core -> timer9 */
777static struct omap_hwmod_ocp_if omap2420_l4_core__timer9 = {
778 .master = &omap2420_l4_core_hwmod,
779 .slave = &omap2420_timer9_hwmod,
780 .clk = "gpt9_ick",
781 .addr = omap2420_timer9_addrs,
782 .addr_cnt = ARRAY_SIZE(omap2420_timer9_addrs),
783 .user = OCP_USER_MPU | OCP_USER_SDMA,
784};
785
786/* timer9 slave port */
787static struct omap_hwmod_ocp_if *omap2420_timer9_slaves[] = {
788 &omap2420_l4_core__timer9,
789};
790
791/* timer9 hwmod */
792static struct omap_hwmod omap2420_timer9_hwmod = {
793 .name = "timer9",
794 .mpu_irqs = omap2420_timer9_mpu_irqs,
795 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer9_mpu_irqs),
796 .main_clk = "gpt9_fck",
797 .prcm = {
798 .omap2 = {
799 .prcm_reg_id = 1,
800 .module_bit = OMAP24XX_EN_GPT9_SHIFT,
801 .module_offs = CORE_MOD,
802 .idlest_reg_id = 1,
803 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
804 },
805 },
806 .slaves = omap2420_timer9_slaves,
807 .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves),
808 .class = &omap2420_timer_hwmod_class,
809 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
810};
811
812/* timer10 */
813static struct omap_hwmod omap2420_timer10_hwmod;
814static struct omap_hwmod_irq_info omap2420_timer10_mpu_irqs[] = {
815 { .irq = 46, },
816};
817
818static struct omap_hwmod_addr_space omap2420_timer10_addrs[] = {
819 {
820 .pa_start = 0x48086000,
821 .pa_end = 0x48086000 + SZ_1K - 1,
822 .flags = ADDR_TYPE_RT
823 },
824};
825
826/* l4_core -> timer10 */
827static struct omap_hwmod_ocp_if omap2420_l4_core__timer10 = {
828 .master = &omap2420_l4_core_hwmod,
829 .slave = &omap2420_timer10_hwmod,
830 .clk = "gpt10_ick",
831 .addr = omap2420_timer10_addrs,
832 .addr_cnt = ARRAY_SIZE(omap2420_timer10_addrs),
833 .user = OCP_USER_MPU | OCP_USER_SDMA,
834};
835
836/* timer10 slave port */
837static struct omap_hwmod_ocp_if *omap2420_timer10_slaves[] = {
838 &omap2420_l4_core__timer10,
839};
840
841/* timer10 hwmod */
842static struct omap_hwmod omap2420_timer10_hwmod = {
843 .name = "timer10",
844 .mpu_irqs = omap2420_timer10_mpu_irqs,
845 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer10_mpu_irqs),
846 .main_clk = "gpt10_fck",
847 .prcm = {
848 .omap2 = {
849 .prcm_reg_id = 1,
850 .module_bit = OMAP24XX_EN_GPT10_SHIFT,
851 .module_offs = CORE_MOD,
852 .idlest_reg_id = 1,
853 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
854 },
855 },
856 .slaves = omap2420_timer10_slaves,
857 .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves),
858 .class = &omap2420_timer_hwmod_class,
859 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
860};
861
862/* timer11 */
863static struct omap_hwmod omap2420_timer11_hwmod;
864static struct omap_hwmod_irq_info omap2420_timer11_mpu_irqs[] = {
865 { .irq = 47, },
866};
867
868static struct omap_hwmod_addr_space omap2420_timer11_addrs[] = {
869 {
870 .pa_start = 0x48088000,
871 .pa_end = 0x48088000 + SZ_1K - 1,
872 .flags = ADDR_TYPE_RT
873 },
874};
875
876/* l4_core -> timer11 */
877static struct omap_hwmod_ocp_if omap2420_l4_core__timer11 = {
878 .master = &omap2420_l4_core_hwmod,
879 .slave = &omap2420_timer11_hwmod,
880 .clk = "gpt11_ick",
881 .addr = omap2420_timer11_addrs,
882 .addr_cnt = ARRAY_SIZE(omap2420_timer11_addrs),
883 .user = OCP_USER_MPU | OCP_USER_SDMA,
884};
885
886/* timer11 slave port */
887static struct omap_hwmod_ocp_if *omap2420_timer11_slaves[] = {
888 &omap2420_l4_core__timer11,
889};
890
891/* timer11 hwmod */
892static struct omap_hwmod omap2420_timer11_hwmod = {
893 .name = "timer11",
894 .mpu_irqs = omap2420_timer11_mpu_irqs,
895 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer11_mpu_irqs),
896 .main_clk = "gpt11_fck",
897 .prcm = {
898 .omap2 = {
899 .prcm_reg_id = 1,
900 .module_bit = OMAP24XX_EN_GPT11_SHIFT,
901 .module_offs = CORE_MOD,
902 .idlest_reg_id = 1,
903 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
904 },
905 },
906 .slaves = omap2420_timer11_slaves,
907 .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves),
908 .class = &omap2420_timer_hwmod_class,
909 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
910};
911
912/* timer12 */
913static struct omap_hwmod omap2420_timer12_hwmod;
914static struct omap_hwmod_irq_info omap2420_timer12_mpu_irqs[] = {
915 { .irq = 48, },
916};
917
918static struct omap_hwmod_addr_space omap2420_timer12_addrs[] = {
919 {
920 .pa_start = 0x4808a000,
921 .pa_end = 0x4808a000 + SZ_1K - 1,
922 .flags = ADDR_TYPE_RT
923 },
924};
925
926/* l4_core -> timer12 */
927static struct omap_hwmod_ocp_if omap2420_l4_core__timer12 = {
928 .master = &omap2420_l4_core_hwmod,
929 .slave = &omap2420_timer12_hwmod,
930 .clk = "gpt12_ick",
931 .addr = omap2420_timer12_addrs,
932 .addr_cnt = ARRAY_SIZE(omap2420_timer12_addrs),
933 .user = OCP_USER_MPU | OCP_USER_SDMA,
934};
935
936/* timer12 slave port */
937static struct omap_hwmod_ocp_if *omap2420_timer12_slaves[] = {
938 &omap2420_l4_core__timer12,
939};
940
941/* timer12 hwmod */
942static struct omap_hwmod omap2420_timer12_hwmod = {
943 .name = "timer12",
944 .mpu_irqs = omap2420_timer12_mpu_irqs,
945 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_timer12_mpu_irqs),
946 .main_clk = "gpt12_fck",
947 .prcm = {
948 .omap2 = {
949 .prcm_reg_id = 1,
950 .module_bit = OMAP24XX_EN_GPT12_SHIFT,
951 .module_offs = CORE_MOD,
952 .idlest_reg_id = 1,
953 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
954 },
955 },
956 .slaves = omap2420_timer12_slaves,
957 .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves),
958 .class = &omap2420_timer_hwmod_class,
959 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
960};
961
282/* l4_wkup -> wd_timer2 */ 962/* l4_wkup -> wd_timer2 */
283static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = { 963static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
284 { 964 {
@@ -470,6 +1150,292 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
470 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420), 1150 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
471}; 1151};
472 1152
1153/*
1154 * 'dss' class
1155 * display sub-system
1156 */
1157
1158static struct omap_hwmod_class_sysconfig omap2420_dss_sysc = {
1159 .rev_offs = 0x0000,
1160 .sysc_offs = 0x0010,
1161 .syss_offs = 0x0014,
1162 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1163 .sysc_fields = &omap_hwmod_sysc_type1,
1164};
1165
1166static struct omap_hwmod_class omap2420_dss_hwmod_class = {
1167 .name = "dss",
1168 .sysc = &omap2420_dss_sysc,
1169};
1170
1171/* dss */
1172static struct omap_hwmod_irq_info omap2420_dss_irqs[] = {
1173 { .irq = 25 },
1174};
1175
1176static struct omap_hwmod_dma_info omap2420_dss_sdma_chs[] = {
1177 { .name = "dispc", .dma_req = 5 },
1178};
1179
1180/* dss */
1181/* dss master ports */
1182static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
1183 &omap2420_dss__l3,
1184};
1185
1186static struct omap_hwmod_addr_space omap2420_dss_addrs[] = {
1187 {
1188 .pa_start = 0x48050000,
1189 .pa_end = 0x480503FF,
1190 .flags = ADDR_TYPE_RT
1191 },
1192};
1193
1194/* l4_core -> dss */
1195static struct omap_hwmod_ocp_if omap2420_l4_core__dss = {
1196 .master = &omap2420_l4_core_hwmod,
1197 .slave = &omap2420_dss_core_hwmod,
1198 .clk = "dss_ick",
1199 .addr = omap2420_dss_addrs,
1200 .addr_cnt = ARRAY_SIZE(omap2420_dss_addrs),
1201 .fw = {
1202 .omap2 = {
1203 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
1204 .flags = OMAP_FIREWALL_L4,
1205 }
1206 },
1207 .user = OCP_USER_MPU | OCP_USER_SDMA,
1208};
1209
1210/* dss slave ports */
1211static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
1212 &omap2420_l4_core__dss,
1213};
1214
1215static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1216 { .role = "tv_clk", .clk = "dss_54m_fck" },
1217 { .role = "sys_clk", .clk = "dss2_fck" },
1218};
1219
1220static struct omap_hwmod omap2420_dss_core_hwmod = {
1221 .name = "dss_core",
1222 .class = &omap2420_dss_hwmod_class,
1223 .main_clk = "dss1_fck", /* instead of dss_fck */
1224 .mpu_irqs = omap2420_dss_irqs,
1225 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_dss_irqs),
1226 .sdma_reqs = omap2420_dss_sdma_chs,
1227 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_dss_sdma_chs),
1228 .prcm = {
1229 .omap2 = {
1230 .prcm_reg_id = 1,
1231 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1232 .module_offs = CORE_MOD,
1233 .idlest_reg_id = 1,
1234 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1235 },
1236 },
1237 .opt_clks = dss_opt_clks,
1238 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1239 .slaves = omap2420_dss_slaves,
1240 .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves),
1241 .masters = omap2420_dss_masters,
1242 .masters_cnt = ARRAY_SIZE(omap2420_dss_masters),
1243 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1244 .flags = HWMOD_NO_IDLEST,
1245};
1246
1247/*
1248 * 'dispc' class
1249 * display controller
1250 */
1251
1252static struct omap_hwmod_class_sysconfig omap2420_dispc_sysc = {
1253 .rev_offs = 0x0000,
1254 .sysc_offs = 0x0010,
1255 .syss_offs = 0x0014,
1256 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
1257 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1258 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1259 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1260 .sysc_fields = &omap_hwmod_sysc_type1,
1261};
1262
1263static struct omap_hwmod_class omap2420_dispc_hwmod_class = {
1264 .name = "dispc",
1265 .sysc = &omap2420_dispc_sysc,
1266};
1267
1268static struct omap_hwmod_addr_space omap2420_dss_dispc_addrs[] = {
1269 {
1270 .pa_start = 0x48050400,
1271 .pa_end = 0x480507FF,
1272 .flags = ADDR_TYPE_RT
1273 },
1274};
1275
1276/* l4_core -> dss_dispc */
1277static struct omap_hwmod_ocp_if omap2420_l4_core__dss_dispc = {
1278 .master = &omap2420_l4_core_hwmod,
1279 .slave = &omap2420_dss_dispc_hwmod,
1280 .clk = "dss_ick",
1281 .addr = omap2420_dss_dispc_addrs,
1282 .addr_cnt = ARRAY_SIZE(omap2420_dss_dispc_addrs),
1283 .fw = {
1284 .omap2 = {
1285 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION,
1286 .flags = OMAP_FIREWALL_L4,
1287 }
1288 },
1289 .user = OCP_USER_MPU | OCP_USER_SDMA,
1290};
1291
1292/* dss_dispc slave ports */
1293static struct omap_hwmod_ocp_if *omap2420_dss_dispc_slaves[] = {
1294 &omap2420_l4_core__dss_dispc,
1295};
1296
1297static struct omap_hwmod omap2420_dss_dispc_hwmod = {
1298 .name = "dss_dispc",
1299 .class = &omap2420_dispc_hwmod_class,
1300 .main_clk = "dss1_fck",
1301 .prcm = {
1302 .omap2 = {
1303 .prcm_reg_id = 1,
1304 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1305 .module_offs = CORE_MOD,
1306 .idlest_reg_id = 1,
1307 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1308 },
1309 },
1310 .slaves = omap2420_dss_dispc_slaves,
1311 .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves),
1312 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1313 .flags = HWMOD_NO_IDLEST,
1314};
1315
1316/*
1317 * 'rfbi' class
1318 * remote frame buffer interface
1319 */
1320
1321static struct omap_hwmod_class_sysconfig omap2420_rfbi_sysc = {
1322 .rev_offs = 0x0000,
1323 .sysc_offs = 0x0010,
1324 .syss_offs = 0x0014,
1325 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1326 SYSC_HAS_AUTOIDLE),
1327 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1328 .sysc_fields = &omap_hwmod_sysc_type1,
1329};
1330
1331static struct omap_hwmod_class omap2420_rfbi_hwmod_class = {
1332 .name = "rfbi",
1333 .sysc = &omap2420_rfbi_sysc,
1334};
1335
1336static struct omap_hwmod_addr_space omap2420_dss_rfbi_addrs[] = {
1337 {
1338 .pa_start = 0x48050800,
1339 .pa_end = 0x48050BFF,
1340 .flags = ADDR_TYPE_RT
1341 },
1342};
1343
1344/* l4_core -> dss_rfbi */
1345static struct omap_hwmod_ocp_if omap2420_l4_core__dss_rfbi = {
1346 .master = &omap2420_l4_core_hwmod,
1347 .slave = &omap2420_dss_rfbi_hwmod,
1348 .clk = "dss_ick",
1349 .addr = omap2420_dss_rfbi_addrs,
1350 .addr_cnt = ARRAY_SIZE(omap2420_dss_rfbi_addrs),
1351 .fw = {
1352 .omap2 = {
1353 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
1354 .flags = OMAP_FIREWALL_L4,
1355 }
1356 },
1357 .user = OCP_USER_MPU | OCP_USER_SDMA,
1358};
1359
1360/* dss_rfbi slave ports */
1361static struct omap_hwmod_ocp_if *omap2420_dss_rfbi_slaves[] = {
1362 &omap2420_l4_core__dss_rfbi,
1363};
1364
1365static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
1366 .name = "dss_rfbi",
1367 .class = &omap2420_rfbi_hwmod_class,
1368 .main_clk = "dss1_fck",
1369 .prcm = {
1370 .omap2 = {
1371 .prcm_reg_id = 1,
1372 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1373 .module_offs = CORE_MOD,
1374 },
1375 },
1376 .slaves = omap2420_dss_rfbi_slaves,
1377 .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves),
1378 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1379 .flags = HWMOD_NO_IDLEST,
1380};
1381
1382/*
1383 * 'venc' class
1384 * video encoder
1385 */
1386
1387static struct omap_hwmod_class omap2420_venc_hwmod_class = {
1388 .name = "venc",
1389};
1390
1391/* dss_venc */
1392static struct omap_hwmod_addr_space omap2420_dss_venc_addrs[] = {
1393 {
1394 .pa_start = 0x48050C00,
1395 .pa_end = 0x48050FFF,
1396 .flags = ADDR_TYPE_RT
1397 },
1398};
1399
1400/* l4_core -> dss_venc */
1401static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = {
1402 .master = &omap2420_l4_core_hwmod,
1403 .slave = &omap2420_dss_venc_hwmod,
1404 .clk = "dss_54m_fck",
1405 .addr = omap2420_dss_venc_addrs,
1406 .addr_cnt = ARRAY_SIZE(omap2420_dss_venc_addrs),
1407 .fw = {
1408 .omap2 = {
1409 .l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION,
1410 .flags = OMAP_FIREWALL_L4,
1411 }
1412 },
1413 .flags = OCPIF_SWSUP_IDLE,
1414 .user = OCP_USER_MPU | OCP_USER_SDMA,
1415};
1416
1417/* dss_venc slave ports */
1418static struct omap_hwmod_ocp_if *omap2420_dss_venc_slaves[] = {
1419 &omap2420_l4_core__dss_venc,
1420};
1421
1422static struct omap_hwmod omap2420_dss_venc_hwmod = {
1423 .name = "dss_venc",
1424 .class = &omap2420_venc_hwmod_class,
1425 .main_clk = "dss1_fck",
1426 .prcm = {
1427 .omap2 = {
1428 .prcm_reg_id = 1,
1429 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1430 .module_offs = CORE_MOD,
1431 },
1432 },
1433 .slaves = omap2420_dss_venc_slaves,
1434 .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves),
1435 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1436 .flags = HWMOD_NO_IDLEST,
1437};
1438
473/* I2C common */ 1439/* I2C common */
474static struct omap_hwmod_class_sysconfig i2c_sysc = { 1440static struct omap_hwmod_class_sysconfig i2c_sysc = {
475 .rev_offs = 0x00, 1441 .rev_offs = 0x00,
@@ -864,16 +1830,342 @@ static struct omap_hwmod omap2420_dma_system_hwmod = {
864 .flags = HWMOD_NO_IDLEST, 1830 .flags = HWMOD_NO_IDLEST,
865}; 1831};
866 1832
1833/*
1834 * 'mailbox' class
1835 * mailbox module allowing communication between the on-chip processors
1836 * using a queued mailbox-interrupt mechanism.
1837 */
1838
1839static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = {
1840 .rev_offs = 0x000,
1841 .sysc_offs = 0x010,
1842 .syss_offs = 0x014,
1843 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1844 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1845 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1846 .sysc_fields = &omap_hwmod_sysc_type1,
1847};
1848
1849static struct omap_hwmod_class omap2420_mailbox_hwmod_class = {
1850 .name = "mailbox",
1851 .sysc = &omap2420_mailbox_sysc,
1852};
1853
1854/* mailbox */
1855static struct omap_hwmod omap2420_mailbox_hwmod;
1856static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
1857 { .name = "dsp", .irq = 26 },
1858 { .name = "iva", .irq = 34 },
1859};
1860
1861static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = {
1862 {
1863 .pa_start = 0x48094000,
1864 .pa_end = 0x480941ff,
1865 .flags = ADDR_TYPE_RT,
1866 },
1867};
1868
1869/* l4_core -> mailbox */
1870static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
1871 .master = &omap2420_l4_core_hwmod,
1872 .slave = &omap2420_mailbox_hwmod,
1873 .addr = omap2420_mailbox_addrs,
1874 .addr_cnt = ARRAY_SIZE(omap2420_mailbox_addrs),
1875 .user = OCP_USER_MPU | OCP_USER_SDMA,
1876};
1877
1878/* mailbox slave ports */
1879static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = {
1880 &omap2420_l4_core__mailbox,
1881};
1882
1883static struct omap_hwmod omap2420_mailbox_hwmod = {
1884 .name = "mailbox",
1885 .class = &omap2420_mailbox_hwmod_class,
1886 .mpu_irqs = omap2420_mailbox_irqs,
1887 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mailbox_irqs),
1888 .main_clk = "mailboxes_ick",
1889 .prcm = {
1890 .omap2 = {
1891 .prcm_reg_id = 1,
1892 .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
1893 .module_offs = CORE_MOD,
1894 .idlest_reg_id = 1,
1895 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
1896 },
1897 },
1898 .slaves = omap2420_mailbox_slaves,
1899 .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves),
1900 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1901};
1902
1903/*
1904 * 'mcspi' class
1905 * multichannel serial port interface (mcspi) / master/slave synchronous serial
1906 * bus
1907 */
1908
1909static struct omap_hwmod_class_sysconfig omap2420_mcspi_sysc = {
1910 .rev_offs = 0x0000,
1911 .sysc_offs = 0x0010,
1912 .syss_offs = 0x0014,
1913 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1914 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
1915 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
1916 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1917 .sysc_fields = &omap_hwmod_sysc_type1,
1918};
1919
1920static struct omap_hwmod_class omap2420_mcspi_class = {
1921 .name = "mcspi",
1922 .sysc = &omap2420_mcspi_sysc,
1923 .rev = OMAP2_MCSPI_REV,
1924};
1925
1926/* mcspi1 */
1927static struct omap_hwmod_irq_info omap2420_mcspi1_mpu_irqs[] = {
1928 { .irq = 65 },
1929};
1930
1931static struct omap_hwmod_dma_info omap2420_mcspi1_sdma_reqs[] = {
1932 { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */
1933 { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */
1934 { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */
1935 { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */
1936 { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */
1937 { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */
1938 { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */
1939 { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */
1940};
1941
1942static struct omap_hwmod_ocp_if *omap2420_mcspi1_slaves[] = {
1943 &omap2420_l4_core__mcspi1,
1944};
1945
1946static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
1947 .num_chipselect = 4,
1948};
1949
1950static struct omap_hwmod omap2420_mcspi1_hwmod = {
1951 .name = "mcspi1_hwmod",
1952 .mpu_irqs = omap2420_mcspi1_mpu_irqs,
1953 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi1_mpu_irqs),
1954 .sdma_reqs = omap2420_mcspi1_sdma_reqs,
1955 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi1_sdma_reqs),
1956 .main_clk = "mcspi1_fck",
1957 .prcm = {
1958 .omap2 = {
1959 .module_offs = CORE_MOD,
1960 .prcm_reg_id = 1,
1961 .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
1962 .idlest_reg_id = 1,
1963 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
1964 },
1965 },
1966 .slaves = omap2420_mcspi1_slaves,
1967 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves),
1968 .class = &omap2420_mcspi_class,
1969 .dev_attr = &omap_mcspi1_dev_attr,
1970 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1971};
1972
1973/* mcspi2 */
1974static struct omap_hwmod_irq_info omap2420_mcspi2_mpu_irqs[] = {
1975 { .irq = 66 },
1976};
1977
1978static struct omap_hwmod_dma_info omap2420_mcspi2_sdma_reqs[] = {
1979 { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */
1980 { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */
1981 { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */
1982 { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */
1983};
1984
1985static struct omap_hwmod_ocp_if *omap2420_mcspi2_slaves[] = {
1986 &omap2420_l4_core__mcspi2,
1987};
1988
1989static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
1990 .num_chipselect = 2,
1991};
1992
1993static struct omap_hwmod omap2420_mcspi2_hwmod = {
1994 .name = "mcspi2_hwmod",
1995 .mpu_irqs = omap2420_mcspi2_mpu_irqs,
1996 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcspi2_mpu_irqs),
1997 .sdma_reqs = omap2420_mcspi2_sdma_reqs,
1998 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcspi2_sdma_reqs),
1999 .main_clk = "mcspi2_fck",
2000 .prcm = {
2001 .omap2 = {
2002 .module_offs = CORE_MOD,
2003 .prcm_reg_id = 1,
2004 .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
2005 .idlest_reg_id = 1,
2006 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
2007 },
2008 },
2009 .slaves = omap2420_mcspi2_slaves,
2010 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves),
2011 .class = &omap2420_mcspi_class,
2012 .dev_attr = &omap_mcspi2_dev_attr,
2013 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
2014};
2015
2016/*
2017 * 'mcbsp' class
2018 * multi channel buffered serial port controller
2019 */
2020
2021static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
2022 .name = "mcbsp",
2023};
2024
2025/* mcbsp1 */
2026static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
2027 { .name = "tx", .irq = 59 },
2028 { .name = "rx", .irq = 60 },
2029};
2030
2031static struct omap_hwmod_dma_info omap2420_mcbsp1_sdma_chs[] = {
2032 { .name = "rx", .dma_req = 32 },
2033 { .name = "tx", .dma_req = 31 },
2034};
2035
2036static struct omap_hwmod_addr_space omap2420_mcbsp1_addrs[] = {
2037 {
2038 .name = "mpu",
2039 .pa_start = 0x48074000,
2040 .pa_end = 0x480740ff,
2041 .flags = ADDR_TYPE_RT
2042 },
2043};
2044
2045/* l4_core -> mcbsp1 */
2046static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = {
2047 .master = &omap2420_l4_core_hwmod,
2048 .slave = &omap2420_mcbsp1_hwmod,
2049 .clk = "mcbsp1_ick",
2050 .addr = omap2420_mcbsp1_addrs,
2051 .addr_cnt = ARRAY_SIZE(omap2420_mcbsp1_addrs),
2052 .user = OCP_USER_MPU | OCP_USER_SDMA,
2053};
2054
2055/* mcbsp1 slave ports */
2056static struct omap_hwmod_ocp_if *omap2420_mcbsp1_slaves[] = {
2057 &omap2420_l4_core__mcbsp1,
2058};
2059
2060static struct omap_hwmod omap2420_mcbsp1_hwmod = {
2061 .name = "mcbsp1",
2062 .class = &omap2420_mcbsp_hwmod_class,
2063 .mpu_irqs = omap2420_mcbsp1_irqs,
2064 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_irqs),
2065 .sdma_reqs = omap2420_mcbsp1_sdma_chs,
2066 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp1_sdma_chs),
2067 .main_clk = "mcbsp1_fck",
2068 .prcm = {
2069 .omap2 = {
2070 .prcm_reg_id = 1,
2071 .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
2072 .module_offs = CORE_MOD,
2073 .idlest_reg_id = 1,
2074 .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
2075 },
2076 },
2077 .slaves = omap2420_mcbsp1_slaves,
2078 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves),
2079 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
2080};
2081
2082/* mcbsp2 */
2083static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = {
2084 { .name = "tx", .irq = 62 },
2085 { .name = "rx", .irq = 63 },
2086};
2087
2088static struct omap_hwmod_dma_info omap2420_mcbsp2_sdma_chs[] = {
2089 { .name = "rx", .dma_req = 34 },
2090 { .name = "tx", .dma_req = 33 },
2091};
2092
2093static struct omap_hwmod_addr_space omap2420_mcbsp2_addrs[] = {
2094 {
2095 .name = "mpu",
2096 .pa_start = 0x48076000,
2097 .pa_end = 0x480760ff,
2098 .flags = ADDR_TYPE_RT
2099 },
2100};
2101
2102/* l4_core -> mcbsp2 */
2103static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = {
2104 .master = &omap2420_l4_core_hwmod,
2105 .slave = &omap2420_mcbsp2_hwmod,
2106 .clk = "mcbsp2_ick",
2107 .addr = omap2420_mcbsp2_addrs,
2108 .addr_cnt = ARRAY_SIZE(omap2420_mcbsp2_addrs),
2109 .user = OCP_USER_MPU | OCP_USER_SDMA,
2110};
2111
2112/* mcbsp2 slave ports */
2113static struct omap_hwmod_ocp_if *omap2420_mcbsp2_slaves[] = {
2114 &omap2420_l4_core__mcbsp2,
2115};
2116
2117static struct omap_hwmod omap2420_mcbsp2_hwmod = {
2118 .name = "mcbsp2",
2119 .class = &omap2420_mcbsp_hwmod_class,
2120 .mpu_irqs = omap2420_mcbsp2_irqs,
2121 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_irqs),
2122 .sdma_reqs = omap2420_mcbsp2_sdma_chs,
2123 .sdma_reqs_cnt = ARRAY_SIZE(omap2420_mcbsp2_sdma_chs),
2124 .main_clk = "mcbsp2_fck",
2125 .prcm = {
2126 .omap2 = {
2127 .prcm_reg_id = 1,
2128 .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
2129 .module_offs = CORE_MOD,
2130 .idlest_reg_id = 1,
2131 .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
2132 },
2133 },
2134 .slaves = omap2420_mcbsp2_slaves,
2135 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves),
2136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
2137};
2138
867static __initdata struct omap_hwmod *omap2420_hwmods[] = { 2139static __initdata struct omap_hwmod *omap2420_hwmods[] = {
868 &omap2420_l3_main_hwmod, 2140 &omap2420_l3_main_hwmod,
869 &omap2420_l4_core_hwmod, 2141 &omap2420_l4_core_hwmod,
870 &omap2420_l4_wkup_hwmod, 2142 &omap2420_l4_wkup_hwmod,
871 &omap2420_mpu_hwmod, 2143 &omap2420_mpu_hwmod,
872 &omap2420_iva_hwmod, 2144 &omap2420_iva_hwmod,
2145
2146 &omap2420_timer1_hwmod,
2147 &omap2420_timer2_hwmod,
2148 &omap2420_timer3_hwmod,
2149 &omap2420_timer4_hwmod,
2150 &omap2420_timer5_hwmod,
2151 &omap2420_timer6_hwmod,
2152 &omap2420_timer7_hwmod,
2153 &omap2420_timer8_hwmod,
2154 &omap2420_timer9_hwmod,
2155 &omap2420_timer10_hwmod,
2156 &omap2420_timer11_hwmod,
2157 &omap2420_timer12_hwmod,
2158
873 &omap2420_wd_timer2_hwmod, 2159 &omap2420_wd_timer2_hwmod,
874 &omap2420_uart1_hwmod, 2160 &omap2420_uart1_hwmod,
875 &omap2420_uart2_hwmod, 2161 &omap2420_uart2_hwmod,
876 &omap2420_uart3_hwmod, 2162 &omap2420_uart3_hwmod,
2163 /* dss class */
2164 &omap2420_dss_core_hwmod,
2165 &omap2420_dss_dispc_hwmod,
2166 &omap2420_dss_rfbi_hwmod,
2167 &omap2420_dss_venc_hwmod,
2168 /* i2c class */
877 &omap2420_i2c1_hwmod, 2169 &omap2420_i2c1_hwmod,
878 &omap2420_i2c2_hwmod, 2170 &omap2420_i2c2_hwmod,
879 2171
@@ -885,10 +2177,21 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
885 2177
886 /* dma_system class*/ 2178 /* dma_system class*/
887 &omap2420_dma_system_hwmod, 2179 &omap2420_dma_system_hwmod,
2180
2181 /* mailbox class */
2182 &omap2420_mailbox_hwmod,
2183
2184 /* mcbsp class */
2185 &omap2420_mcbsp1_hwmod,
2186 &omap2420_mcbsp2_hwmod,
2187
2188 /* mcspi class */
2189 &omap2420_mcspi1_hwmod,
2190 &omap2420_mcspi2_hwmod,
888 NULL, 2191 NULL,
889}; 2192};
890 2193
891int __init omap2420_hwmod_init(void) 2194int __init omap2420_hwmod_init(void)
892{ 2195{
893 return omap_hwmod_init(omap2420_hwmods); 2196 return omap_hwmod_register(omap2420_hwmods);
894} 2197}
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcde13ba..490789a6bed0 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -18,6 +18,11 @@
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h> 19#include <plat/i2c.h>
20#include <plat/gpio.h> 20#include <plat/gpio.h>
21#include <plat/mcbsp.h>
22#include <plat/mcspi.h>
23#include <plat/dmtimer.h>
24#include <plat/mmc.h>
25#include <plat/l3_2xxx.h>
21 26
22#include "omap_hwmod_common_data.h" 27#include "omap_hwmod_common_data.h"
23 28
@@ -38,6 +43,10 @@ static struct omap_hwmod omap2430_mpu_hwmod;
38static struct omap_hwmod omap2430_iva_hwmod; 43static struct omap_hwmod omap2430_iva_hwmod;
39static struct omap_hwmod omap2430_l3_main_hwmod; 44static struct omap_hwmod omap2430_l3_main_hwmod;
40static struct omap_hwmod omap2430_l4_core_hwmod; 45static struct omap_hwmod omap2430_l4_core_hwmod;
46static struct omap_hwmod omap2430_dss_core_hwmod;
47static struct omap_hwmod omap2430_dss_dispc_hwmod;
48static struct omap_hwmod omap2430_dss_rfbi_hwmod;
49static struct omap_hwmod omap2430_dss_venc_hwmod;
41static struct omap_hwmod omap2430_wd_timer2_hwmod; 50static struct omap_hwmod omap2430_wd_timer2_hwmod;
42static struct omap_hwmod omap2430_gpio1_hwmod; 51static struct omap_hwmod omap2430_gpio1_hwmod;
43static struct omap_hwmod omap2430_gpio2_hwmod; 52static struct omap_hwmod omap2430_gpio2_hwmod;
@@ -45,6 +54,16 @@ static struct omap_hwmod omap2430_gpio3_hwmod;
45static struct omap_hwmod omap2430_gpio4_hwmod; 54static struct omap_hwmod omap2430_gpio4_hwmod;
46static struct omap_hwmod omap2430_gpio5_hwmod; 55static struct omap_hwmod omap2430_gpio5_hwmod;
47static struct omap_hwmod omap2430_dma_system_hwmod; 56static struct omap_hwmod omap2430_dma_system_hwmod;
57static struct omap_hwmod omap2430_mcbsp1_hwmod;
58static struct omap_hwmod omap2430_mcbsp2_hwmod;
59static struct omap_hwmod omap2430_mcbsp3_hwmod;
60static struct omap_hwmod omap2430_mcbsp4_hwmod;
61static struct omap_hwmod omap2430_mcbsp5_hwmod;
62static struct omap_hwmod omap2430_mcspi1_hwmod;
63static struct omap_hwmod omap2430_mcspi2_hwmod;
64static struct omap_hwmod omap2430_mcspi3_hwmod;
65static struct omap_hwmod omap2430_mmc1_hwmod;
66static struct omap_hwmod omap2430_mmc2_hwmod;
48 67
49/* L3 -> L4_CORE interface */ 68/* L3 -> L4_CORE interface */
50static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { 69static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
@@ -65,6 +84,19 @@ static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = {
65 &omap2430_mpu__l3_main, 84 &omap2430_mpu__l3_main,
66}; 85};
67 86
87/* DSS -> l3 */
88static struct omap_hwmod_ocp_if omap2430_dss__l3 = {
89 .master = &omap2430_dss_core_hwmod,
90 .slave = &omap2430_l3_main_hwmod,
91 .fw = {
92 .omap2 = {
93 .l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS,
94 .flags = OMAP_FIREWALL_L3,
95 }
96 },
97 .user = OCP_USER_MPU | OCP_USER_SDMA,
98};
99
68/* Master interfaces on the L3 interconnect */ 100/* Master interfaces on the L3 interconnect */
69static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = { 101static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
70 &omap2430_l3_main__l4_core, 102 &omap2430_l3_main__l4_core,
@@ -89,6 +121,16 @@ static struct omap_hwmod omap2430_uart3_hwmod;
89static struct omap_hwmod omap2430_i2c1_hwmod; 121static struct omap_hwmod omap2430_i2c1_hwmod;
90static struct omap_hwmod omap2430_i2c2_hwmod; 122static struct omap_hwmod omap2430_i2c2_hwmod;
91 123
124static struct omap_hwmod omap2430_usbhsotg_hwmod;
125
126/* l3_core -> usbhsotg interface */
127static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = {
128 .master = &omap2430_usbhsotg_hwmod,
129 .slave = &omap2430_l3_main_hwmod,
130 .clk = "core_l3_ck",
131 .user = OCP_USER_MPU,
132};
133
92/* I2C IP block address space length (in bytes) */ 134/* I2C IP block address space length (in bytes) */
93#define OMAP2_I2C_AS_LEN 128 135#define OMAP2_I2C_AS_LEN 128
94 136
@@ -189,6 +231,71 @@ static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
189 .user = OCP_USER_MPU | OCP_USER_SDMA, 231 .user = OCP_USER_MPU | OCP_USER_SDMA,
190}; 232};
191 233
234/*
235* usbhsotg interface data
236*/
237static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = {
238 {
239 .pa_start = OMAP243X_HS_BASE,
240 .pa_end = OMAP243X_HS_BASE + SZ_4K - 1,
241 .flags = ADDR_TYPE_RT
242 },
243};
244
245/* l4_core ->usbhsotg interface */
246static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = {
247 .master = &omap2430_l4_core_hwmod,
248 .slave = &omap2430_usbhsotg_hwmod,
249 .clk = "usb_l4_ick",
250 .addr = omap2430_usbhsotg_addrs,
251 .addr_cnt = ARRAY_SIZE(omap2430_usbhsotg_addrs),
252 .user = OCP_USER_MPU,
253};
254
255static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = {
256 &omap2430_usbhsotg__l3,
257};
258
259static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = {
260 &omap2430_l4_core__usbhsotg,
261};
262
263/* L4 CORE -> MMC1 interface */
264static struct omap_hwmod_addr_space omap2430_mmc1_addr_space[] = {
265 {
266 .pa_start = 0x4809c000,
267 .pa_end = 0x4809c1ff,
268 .flags = ADDR_TYPE_RT,
269 },
270};
271
272static struct omap_hwmod_ocp_if omap2430_l4_core__mmc1 = {
273 .master = &omap2430_l4_core_hwmod,
274 .slave = &omap2430_mmc1_hwmod,
275 .clk = "mmchs1_ick",
276 .addr = omap2430_mmc1_addr_space,
277 .addr_cnt = ARRAY_SIZE(omap2430_mmc1_addr_space),
278 .user = OCP_USER_MPU | OCP_USER_SDMA,
279};
280
281/* L4 CORE -> MMC2 interface */
282static struct omap_hwmod_addr_space omap2430_mmc2_addr_space[] = {
283 {
284 .pa_start = 0x480b4000,
285 .pa_end = 0x480b41ff,
286 .flags = ADDR_TYPE_RT,
287 },
288};
289
290static struct omap_hwmod_ocp_if omap2430_l4_core__mmc2 = {
291 .master = &omap2430_l4_core_hwmod,
292 .slave = &omap2430_mmc2_hwmod,
293 .addr = omap2430_mmc2_addr_space,
294 .clk = "mmchs2_ick",
295 .addr_cnt = ARRAY_SIZE(omap2430_mmc2_addr_space),
296 .user = OCP_USER_MPU | OCP_USER_SDMA,
297};
298
192/* Slave interfaces on the L4_CORE interconnect */ 299/* Slave interfaces on the L4_CORE interconnect */
193static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { 300static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
194 &omap2430_l3_main__l4_core, 301 &omap2430_l3_main__l4_core,
@@ -197,6 +304,8 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
197/* Master interfaces on the L4_CORE interconnect */ 304/* Master interfaces on the L4_CORE interconnect */
198static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { 305static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
199 &omap2430_l4_core__l4_wkup, 306 &omap2430_l4_core__l4_wkup,
307 &omap2430_l4_core__mmc1,
308 &omap2430_l4_core__mmc2,
200}; 309};
201 310
202/* L4 CORE */ 311/* L4 CORE */
@@ -223,6 +332,60 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
223static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = { 332static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
224}; 333};
225 334
335/* l4 core -> mcspi1 interface */
336static struct omap_hwmod_addr_space omap2430_mcspi1_addr_space[] = {
337 {
338 .pa_start = 0x48098000,
339 .pa_end = 0x480980ff,
340 .flags = ADDR_TYPE_RT,
341 },
342};
343
344static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi1 = {
345 .master = &omap2430_l4_core_hwmod,
346 .slave = &omap2430_mcspi1_hwmod,
347 .clk = "mcspi1_ick",
348 .addr = omap2430_mcspi1_addr_space,
349 .addr_cnt = ARRAY_SIZE(omap2430_mcspi1_addr_space),
350 .user = OCP_USER_MPU | OCP_USER_SDMA,
351};
352
353/* l4 core -> mcspi2 interface */
354static struct omap_hwmod_addr_space omap2430_mcspi2_addr_space[] = {
355 {
356 .pa_start = 0x4809a000,
357 .pa_end = 0x4809a0ff,
358 .flags = ADDR_TYPE_RT,
359 },
360};
361
362static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi2 = {
363 .master = &omap2430_l4_core_hwmod,
364 .slave = &omap2430_mcspi2_hwmod,
365 .clk = "mcspi2_ick",
366 .addr = omap2430_mcspi2_addr_space,
367 .addr_cnt = ARRAY_SIZE(omap2430_mcspi2_addr_space),
368 .user = OCP_USER_MPU | OCP_USER_SDMA,
369};
370
371/* l4 core -> mcspi3 interface */
372static struct omap_hwmod_addr_space omap2430_mcspi3_addr_space[] = {
373 {
374 .pa_start = 0x480b8000,
375 .pa_end = 0x480b80ff,
376 .flags = ADDR_TYPE_RT,
377 },
378};
379
380static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = {
381 .master = &omap2430_l4_core_hwmod,
382 .slave = &omap2430_mcspi3_hwmod,
383 .clk = "mcspi3_ick",
384 .addr = omap2430_mcspi3_addr_space,
385 .addr_cnt = ARRAY_SIZE(omap2430_mcspi3_addr_space),
386 .user = OCP_USER_MPU | OCP_USER_SDMA,
387};
388
226/* L4 WKUP */ 389/* L4 WKUP */
227static struct omap_hwmod omap2430_l4_wkup_hwmod = { 390static struct omap_hwmod omap2430_l4_wkup_hwmod = {
228 .name = "l4_wkup", 391 .name = "l4_wkup",
@@ -278,6 +441,624 @@ static struct omap_hwmod omap2430_iva_hwmod = {
278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) 441 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
279}; 442};
280 443
444/* Timer Common */
445static struct omap_hwmod_class_sysconfig omap2430_timer_sysc = {
446 .rev_offs = 0x0000,
447 .sysc_offs = 0x0010,
448 .syss_offs = 0x0014,
449 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
450 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
451 SYSC_HAS_AUTOIDLE),
452 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
453 .sysc_fields = &omap_hwmod_sysc_type1,
454};
455
456static struct omap_hwmod_class omap2430_timer_hwmod_class = {
457 .name = "timer",
458 .sysc = &omap2430_timer_sysc,
459 .rev = OMAP_TIMER_IP_VERSION_1,
460};
461
462/* timer1 */
463static struct omap_hwmod omap2430_timer1_hwmod;
464static struct omap_hwmod_irq_info omap2430_timer1_mpu_irqs[] = {
465 { .irq = 37, },
466};
467
468static struct omap_hwmod_addr_space omap2430_timer1_addrs[] = {
469 {
470 .pa_start = 0x49018000,
471 .pa_end = 0x49018000 + SZ_1K - 1,
472 .flags = ADDR_TYPE_RT
473 },
474};
475
476/* l4_wkup -> timer1 */
477static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = {
478 .master = &omap2430_l4_wkup_hwmod,
479 .slave = &omap2430_timer1_hwmod,
480 .clk = "gpt1_ick",
481 .addr = omap2430_timer1_addrs,
482 .addr_cnt = ARRAY_SIZE(omap2430_timer1_addrs),
483 .user = OCP_USER_MPU | OCP_USER_SDMA,
484};
485
486/* timer1 slave port */
487static struct omap_hwmod_ocp_if *omap2430_timer1_slaves[] = {
488 &omap2430_l4_wkup__timer1,
489};
490
491/* timer1 hwmod */
492static struct omap_hwmod omap2430_timer1_hwmod = {
493 .name = "timer1",
494 .mpu_irqs = omap2430_timer1_mpu_irqs,
495 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer1_mpu_irqs),
496 .main_clk = "gpt1_fck",
497 .prcm = {
498 .omap2 = {
499 .prcm_reg_id = 1,
500 .module_bit = OMAP24XX_EN_GPT1_SHIFT,
501 .module_offs = WKUP_MOD,
502 .idlest_reg_id = 1,
503 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
504 },
505 },
506 .slaves = omap2430_timer1_slaves,
507 .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves),
508 .class = &omap2430_timer_hwmod_class,
509 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
510};
511
512/* timer2 */
513static struct omap_hwmod omap2430_timer2_hwmod;
514static struct omap_hwmod_irq_info omap2430_timer2_mpu_irqs[] = {
515 { .irq = 38, },
516};
517
518static struct omap_hwmod_addr_space omap2430_timer2_addrs[] = {
519 {
520 .pa_start = 0x4802a000,
521 .pa_end = 0x4802a000 + SZ_1K - 1,
522 .flags = ADDR_TYPE_RT
523 },
524};
525
526/* l4_core -> timer2 */
527static struct omap_hwmod_ocp_if omap2430_l4_core__timer2 = {
528 .master = &omap2430_l4_core_hwmod,
529 .slave = &omap2430_timer2_hwmod,
530 .clk = "gpt2_ick",
531 .addr = omap2430_timer2_addrs,
532 .addr_cnt = ARRAY_SIZE(omap2430_timer2_addrs),
533 .user = OCP_USER_MPU | OCP_USER_SDMA,
534};
535
536/* timer2 slave port */
537static struct omap_hwmod_ocp_if *omap2430_timer2_slaves[] = {
538 &omap2430_l4_core__timer2,
539};
540
541/* timer2 hwmod */
542static struct omap_hwmod omap2430_timer2_hwmod = {
543 .name = "timer2",
544 .mpu_irqs = omap2430_timer2_mpu_irqs,
545 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer2_mpu_irqs),
546 .main_clk = "gpt2_fck",
547 .prcm = {
548 .omap2 = {
549 .prcm_reg_id = 1,
550 .module_bit = OMAP24XX_EN_GPT2_SHIFT,
551 .module_offs = CORE_MOD,
552 .idlest_reg_id = 1,
553 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
554 },
555 },
556 .slaves = omap2430_timer2_slaves,
557 .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves),
558 .class = &omap2430_timer_hwmod_class,
559 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
560};
561
562/* timer3 */
563static struct omap_hwmod omap2430_timer3_hwmod;
564static struct omap_hwmod_irq_info omap2430_timer3_mpu_irqs[] = {
565 { .irq = 39, },
566};
567
568static struct omap_hwmod_addr_space omap2430_timer3_addrs[] = {
569 {
570 .pa_start = 0x48078000,
571 .pa_end = 0x48078000 + SZ_1K - 1,
572 .flags = ADDR_TYPE_RT
573 },
574};
575
576/* l4_core -> timer3 */
577static struct omap_hwmod_ocp_if omap2430_l4_core__timer3 = {
578 .master = &omap2430_l4_core_hwmod,
579 .slave = &omap2430_timer3_hwmod,
580 .clk = "gpt3_ick",
581 .addr = omap2430_timer3_addrs,
582 .addr_cnt = ARRAY_SIZE(omap2430_timer3_addrs),
583 .user = OCP_USER_MPU | OCP_USER_SDMA,
584};
585
586/* timer3 slave port */
587static struct omap_hwmod_ocp_if *omap2430_timer3_slaves[] = {
588 &omap2430_l4_core__timer3,
589};
590
591/* timer3 hwmod */
592static struct omap_hwmod omap2430_timer3_hwmod = {
593 .name = "timer3",
594 .mpu_irqs = omap2430_timer3_mpu_irqs,
595 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer3_mpu_irqs),
596 .main_clk = "gpt3_fck",
597 .prcm = {
598 .omap2 = {
599 .prcm_reg_id = 1,
600 .module_bit = OMAP24XX_EN_GPT3_SHIFT,
601 .module_offs = CORE_MOD,
602 .idlest_reg_id = 1,
603 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
604 },
605 },
606 .slaves = omap2430_timer3_slaves,
607 .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves),
608 .class = &omap2430_timer_hwmod_class,
609 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
610};
611
612/* timer4 */
613static struct omap_hwmod omap2430_timer4_hwmod;
614static struct omap_hwmod_irq_info omap2430_timer4_mpu_irqs[] = {
615 { .irq = 40, },
616};
617
618static struct omap_hwmod_addr_space omap2430_timer4_addrs[] = {
619 {
620 .pa_start = 0x4807a000,
621 .pa_end = 0x4807a000 + SZ_1K - 1,
622 .flags = ADDR_TYPE_RT
623 },
624};
625
626/* l4_core -> timer4 */
627static struct omap_hwmod_ocp_if omap2430_l4_core__timer4 = {
628 .master = &omap2430_l4_core_hwmod,
629 .slave = &omap2430_timer4_hwmod,
630 .clk = "gpt4_ick",
631 .addr = omap2430_timer4_addrs,
632 .addr_cnt = ARRAY_SIZE(omap2430_timer4_addrs),
633 .user = OCP_USER_MPU | OCP_USER_SDMA,
634};
635
636/* timer4 slave port */
637static struct omap_hwmod_ocp_if *omap2430_timer4_slaves[] = {
638 &omap2430_l4_core__timer4,
639};
640
641/* timer4 hwmod */
642static struct omap_hwmod omap2430_timer4_hwmod = {
643 .name = "timer4",
644 .mpu_irqs = omap2430_timer4_mpu_irqs,
645 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer4_mpu_irqs),
646 .main_clk = "gpt4_fck",
647 .prcm = {
648 .omap2 = {
649 .prcm_reg_id = 1,
650 .module_bit = OMAP24XX_EN_GPT4_SHIFT,
651 .module_offs = CORE_MOD,
652 .idlest_reg_id = 1,
653 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
654 },
655 },
656 .slaves = omap2430_timer4_slaves,
657 .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves),
658 .class = &omap2430_timer_hwmod_class,
659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
660};
661
662/* timer5 */
663static struct omap_hwmod omap2430_timer5_hwmod;
664static struct omap_hwmod_irq_info omap2430_timer5_mpu_irqs[] = {
665 { .irq = 41, },
666};
667
668static struct omap_hwmod_addr_space omap2430_timer5_addrs[] = {
669 {
670 .pa_start = 0x4807c000,
671 .pa_end = 0x4807c000 + SZ_1K - 1,
672 .flags = ADDR_TYPE_RT
673 },
674};
675
676/* l4_core -> timer5 */
677static struct omap_hwmod_ocp_if omap2430_l4_core__timer5 = {
678 .master = &omap2430_l4_core_hwmod,
679 .slave = &omap2430_timer5_hwmod,
680 .clk = "gpt5_ick",
681 .addr = omap2430_timer5_addrs,
682 .addr_cnt = ARRAY_SIZE(omap2430_timer5_addrs),
683 .user = OCP_USER_MPU | OCP_USER_SDMA,
684};
685
686/* timer5 slave port */
687static struct omap_hwmod_ocp_if *omap2430_timer5_slaves[] = {
688 &omap2430_l4_core__timer5,
689};
690
691/* timer5 hwmod */
692static struct omap_hwmod omap2430_timer5_hwmod = {
693 .name = "timer5",
694 .mpu_irqs = omap2430_timer5_mpu_irqs,
695 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer5_mpu_irqs),
696 .main_clk = "gpt5_fck",
697 .prcm = {
698 .omap2 = {
699 .prcm_reg_id = 1,
700 .module_bit = OMAP24XX_EN_GPT5_SHIFT,
701 .module_offs = CORE_MOD,
702 .idlest_reg_id = 1,
703 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
704 },
705 },
706 .slaves = omap2430_timer5_slaves,
707 .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves),
708 .class = &omap2430_timer_hwmod_class,
709 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
710};
711
712/* timer6 */
713static struct omap_hwmod omap2430_timer6_hwmod;
714static struct omap_hwmod_irq_info omap2430_timer6_mpu_irqs[] = {
715 { .irq = 42, },
716};
717
718static struct omap_hwmod_addr_space omap2430_timer6_addrs[] = {
719 {
720 .pa_start = 0x4807e000,
721 .pa_end = 0x4807e000 + SZ_1K - 1,
722 .flags = ADDR_TYPE_RT
723 },
724};
725
726/* l4_core -> timer6 */
727static struct omap_hwmod_ocp_if omap2430_l4_core__timer6 = {
728 .master = &omap2430_l4_core_hwmod,
729 .slave = &omap2430_timer6_hwmod,
730 .clk = "gpt6_ick",
731 .addr = omap2430_timer6_addrs,
732 .addr_cnt = ARRAY_SIZE(omap2430_timer6_addrs),
733 .user = OCP_USER_MPU | OCP_USER_SDMA,
734};
735
736/* timer6 slave port */
737static struct omap_hwmod_ocp_if *omap2430_timer6_slaves[] = {
738 &omap2430_l4_core__timer6,
739};
740
741/* timer6 hwmod */
742static struct omap_hwmod omap2430_timer6_hwmod = {
743 .name = "timer6",
744 .mpu_irqs = omap2430_timer6_mpu_irqs,
745 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer6_mpu_irqs),
746 .main_clk = "gpt6_fck",
747 .prcm = {
748 .omap2 = {
749 .prcm_reg_id = 1,
750 .module_bit = OMAP24XX_EN_GPT6_SHIFT,
751 .module_offs = CORE_MOD,
752 .idlest_reg_id = 1,
753 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
754 },
755 },
756 .slaves = omap2430_timer6_slaves,
757 .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves),
758 .class = &omap2430_timer_hwmod_class,
759 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
760};
761
762/* timer7 */
763static struct omap_hwmod omap2430_timer7_hwmod;
764static struct omap_hwmod_irq_info omap2430_timer7_mpu_irqs[] = {
765 { .irq = 43, },
766};
767
768static struct omap_hwmod_addr_space omap2430_timer7_addrs[] = {
769 {
770 .pa_start = 0x48080000,
771 .pa_end = 0x48080000 + SZ_1K - 1,
772 .flags = ADDR_TYPE_RT
773 },
774};
775
776/* l4_core -> timer7 */
777static struct omap_hwmod_ocp_if omap2430_l4_core__timer7 = {
778 .master = &omap2430_l4_core_hwmod,
779 .slave = &omap2430_timer7_hwmod,
780 .clk = "gpt7_ick",
781 .addr = omap2430_timer7_addrs,
782 .addr_cnt = ARRAY_SIZE(omap2430_timer7_addrs),
783 .user = OCP_USER_MPU | OCP_USER_SDMA,
784};
785
786/* timer7 slave port */
787static struct omap_hwmod_ocp_if *omap2430_timer7_slaves[] = {
788 &omap2430_l4_core__timer7,
789};
790
791/* timer7 hwmod */
792static struct omap_hwmod omap2430_timer7_hwmod = {
793 .name = "timer7",
794 .mpu_irqs = omap2430_timer7_mpu_irqs,
795 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer7_mpu_irqs),
796 .main_clk = "gpt7_fck",
797 .prcm = {
798 .omap2 = {
799 .prcm_reg_id = 1,
800 .module_bit = OMAP24XX_EN_GPT7_SHIFT,
801 .module_offs = CORE_MOD,
802 .idlest_reg_id = 1,
803 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
804 },
805 },
806 .slaves = omap2430_timer7_slaves,
807 .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves),
808 .class = &omap2430_timer_hwmod_class,
809 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
810};
811
812/* timer8 */
813static struct omap_hwmod omap2430_timer8_hwmod;
814static struct omap_hwmod_irq_info omap2430_timer8_mpu_irqs[] = {
815 { .irq = 44, },
816};
817
818static struct omap_hwmod_addr_space omap2430_timer8_addrs[] = {
819 {
820 .pa_start = 0x48082000,
821 .pa_end = 0x48082000 + SZ_1K - 1,
822 .flags = ADDR_TYPE_RT
823 },
824};
825
826/* l4_core -> timer8 */
827static struct omap_hwmod_ocp_if omap2430_l4_core__timer8 = {
828 .master = &omap2430_l4_core_hwmod,
829 .slave = &omap2430_timer8_hwmod,
830 .clk = "gpt8_ick",
831 .addr = omap2430_timer8_addrs,
832 .addr_cnt = ARRAY_SIZE(omap2430_timer8_addrs),
833 .user = OCP_USER_MPU | OCP_USER_SDMA,
834};
835
836/* timer8 slave port */
837static struct omap_hwmod_ocp_if *omap2430_timer8_slaves[] = {
838 &omap2430_l4_core__timer8,
839};
840
841/* timer8 hwmod */
842static struct omap_hwmod omap2430_timer8_hwmod = {
843 .name = "timer8",
844 .mpu_irqs = omap2430_timer8_mpu_irqs,
845 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer8_mpu_irqs),
846 .main_clk = "gpt8_fck",
847 .prcm = {
848 .omap2 = {
849 .prcm_reg_id = 1,
850 .module_bit = OMAP24XX_EN_GPT8_SHIFT,
851 .module_offs = CORE_MOD,
852 .idlest_reg_id = 1,
853 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
854 },
855 },
856 .slaves = omap2430_timer8_slaves,
857 .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves),
858 .class = &omap2430_timer_hwmod_class,
859 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
860};
861
862/* timer9 */
863static struct omap_hwmod omap2430_timer9_hwmod;
864static struct omap_hwmod_irq_info omap2430_timer9_mpu_irqs[] = {
865 { .irq = 45, },
866};
867
868static struct omap_hwmod_addr_space omap2430_timer9_addrs[] = {
869 {
870 .pa_start = 0x48084000,
871 .pa_end = 0x48084000 + SZ_1K - 1,
872 .flags = ADDR_TYPE_RT
873 },
874};
875
876/* l4_core -> timer9 */
877static struct omap_hwmod_ocp_if omap2430_l4_core__timer9 = {
878 .master = &omap2430_l4_core_hwmod,
879 .slave = &omap2430_timer9_hwmod,
880 .clk = "gpt9_ick",
881 .addr = omap2430_timer9_addrs,
882 .addr_cnt = ARRAY_SIZE(omap2430_timer9_addrs),
883 .user = OCP_USER_MPU | OCP_USER_SDMA,
884};
885
886/* timer9 slave port */
887static struct omap_hwmod_ocp_if *omap2430_timer9_slaves[] = {
888 &omap2430_l4_core__timer9,
889};
890
891/* timer9 hwmod */
892static struct omap_hwmod omap2430_timer9_hwmod = {
893 .name = "timer9",
894 .mpu_irqs = omap2430_timer9_mpu_irqs,
895 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer9_mpu_irqs),
896 .main_clk = "gpt9_fck",
897 .prcm = {
898 .omap2 = {
899 .prcm_reg_id = 1,
900 .module_bit = OMAP24XX_EN_GPT9_SHIFT,
901 .module_offs = CORE_MOD,
902 .idlest_reg_id = 1,
903 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
904 },
905 },
906 .slaves = omap2430_timer9_slaves,
907 .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves),
908 .class = &omap2430_timer_hwmod_class,
909 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
910};
911
912/* timer10 */
913static struct omap_hwmod omap2430_timer10_hwmod;
914static struct omap_hwmod_irq_info omap2430_timer10_mpu_irqs[] = {
915 { .irq = 46, },
916};
917
918static struct omap_hwmod_addr_space omap2430_timer10_addrs[] = {
919 {
920 .pa_start = 0x48086000,
921 .pa_end = 0x48086000 + SZ_1K - 1,
922 .flags = ADDR_TYPE_RT
923 },
924};
925
926/* l4_core -> timer10 */
927static struct omap_hwmod_ocp_if omap2430_l4_core__timer10 = {
928 .master = &omap2430_l4_core_hwmod,
929 .slave = &omap2430_timer10_hwmod,
930 .clk = "gpt10_ick",
931 .addr = omap2430_timer10_addrs,
932 .addr_cnt = ARRAY_SIZE(omap2430_timer10_addrs),
933 .user = OCP_USER_MPU | OCP_USER_SDMA,
934};
935
936/* timer10 slave port */
937static struct omap_hwmod_ocp_if *omap2430_timer10_slaves[] = {
938 &omap2430_l4_core__timer10,
939};
940
941/* timer10 hwmod */
942static struct omap_hwmod omap2430_timer10_hwmod = {
943 .name = "timer10",
944 .mpu_irqs = omap2430_timer10_mpu_irqs,
945 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer10_mpu_irqs),
946 .main_clk = "gpt10_fck",
947 .prcm = {
948 .omap2 = {
949 .prcm_reg_id = 1,
950 .module_bit = OMAP24XX_EN_GPT10_SHIFT,
951 .module_offs = CORE_MOD,
952 .idlest_reg_id = 1,
953 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
954 },
955 },
956 .slaves = omap2430_timer10_slaves,
957 .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves),
958 .class = &omap2430_timer_hwmod_class,
959 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
960};
961
962/* timer11 */
963static struct omap_hwmod omap2430_timer11_hwmod;
964static struct omap_hwmod_irq_info omap2430_timer11_mpu_irqs[] = {
965 { .irq = 47, },
966};
967
968static struct omap_hwmod_addr_space omap2430_timer11_addrs[] = {
969 {
970 .pa_start = 0x48088000,
971 .pa_end = 0x48088000 + SZ_1K - 1,
972 .flags = ADDR_TYPE_RT
973 },
974};
975
976/* l4_core -> timer11 */
977static struct omap_hwmod_ocp_if omap2430_l4_core__timer11 = {
978 .master = &omap2430_l4_core_hwmod,
979 .slave = &omap2430_timer11_hwmod,
980 .clk = "gpt11_ick",
981 .addr = omap2430_timer11_addrs,
982 .addr_cnt = ARRAY_SIZE(omap2430_timer11_addrs),
983 .user = OCP_USER_MPU | OCP_USER_SDMA,
984};
985
986/* timer11 slave port */
987static struct omap_hwmod_ocp_if *omap2430_timer11_slaves[] = {
988 &omap2430_l4_core__timer11,
989};
990
991/* timer11 hwmod */
992static struct omap_hwmod omap2430_timer11_hwmod = {
993 .name = "timer11",
994 .mpu_irqs = omap2430_timer11_mpu_irqs,
995 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer11_mpu_irqs),
996 .main_clk = "gpt11_fck",
997 .prcm = {
998 .omap2 = {
999 .prcm_reg_id = 1,
1000 .module_bit = OMAP24XX_EN_GPT11_SHIFT,
1001 .module_offs = CORE_MOD,
1002 .idlest_reg_id = 1,
1003 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
1004 },
1005 },
1006 .slaves = omap2430_timer11_slaves,
1007 .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves),
1008 .class = &omap2430_timer_hwmod_class,
1009 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
1010};
1011
1012/* timer12 */
1013static struct omap_hwmod omap2430_timer12_hwmod;
1014static struct omap_hwmod_irq_info omap2430_timer12_mpu_irqs[] = {
1015 { .irq = 48, },
1016};
1017
1018static struct omap_hwmod_addr_space omap2430_timer12_addrs[] = {
1019 {
1020 .pa_start = 0x4808a000,
1021 .pa_end = 0x4808a000 + SZ_1K - 1,
1022 .flags = ADDR_TYPE_RT
1023 },
1024};
1025
1026/* l4_core -> timer12 */
1027static struct omap_hwmod_ocp_if omap2430_l4_core__timer12 = {
1028 .master = &omap2430_l4_core_hwmod,
1029 .slave = &omap2430_timer12_hwmod,
1030 .clk = "gpt12_ick",
1031 .addr = omap2430_timer12_addrs,
1032 .addr_cnt = ARRAY_SIZE(omap2430_timer12_addrs),
1033 .user = OCP_USER_MPU | OCP_USER_SDMA,
1034};
1035
1036/* timer12 slave port */
1037static struct omap_hwmod_ocp_if *omap2430_timer12_slaves[] = {
1038 &omap2430_l4_core__timer12,
1039};
1040
1041/* timer12 hwmod */
1042static struct omap_hwmod omap2430_timer12_hwmod = {
1043 .name = "timer12",
1044 .mpu_irqs = omap2430_timer12_mpu_irqs,
1045 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_timer12_mpu_irqs),
1046 .main_clk = "gpt12_fck",
1047 .prcm = {
1048 .omap2 = {
1049 .prcm_reg_id = 1,
1050 .module_bit = OMAP24XX_EN_GPT12_SHIFT,
1051 .module_offs = CORE_MOD,
1052 .idlest_reg_id = 1,
1053 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
1054 },
1055 },
1056 .slaves = omap2430_timer12_slaves,
1057 .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves),
1058 .class = &omap2430_timer_hwmod_class,
1059 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
1060};
1061
281/* l4_wkup -> wd_timer2 */ 1062/* l4_wkup -> wd_timer2 */
282static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { 1063static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = {
283 { 1064 {
@@ -469,6 +1250,267 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
469 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 1250 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
470}; 1251};
471 1252
1253/*
1254 * 'dss' class
1255 * display sub-system
1256 */
1257
1258static struct omap_hwmod_class_sysconfig omap2430_dss_sysc = {
1259 .rev_offs = 0x0000,
1260 .sysc_offs = 0x0010,
1261 .syss_offs = 0x0014,
1262 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1263 .sysc_fields = &omap_hwmod_sysc_type1,
1264};
1265
1266static struct omap_hwmod_class omap2430_dss_hwmod_class = {
1267 .name = "dss",
1268 .sysc = &omap2430_dss_sysc,
1269};
1270
1271/* dss */
1272static struct omap_hwmod_irq_info omap2430_dss_irqs[] = {
1273 { .irq = 25 },
1274};
1275static struct omap_hwmod_dma_info omap2430_dss_sdma_chs[] = {
1276 { .name = "dispc", .dma_req = 5 },
1277};
1278
1279/* dss */
1280/* dss master ports */
1281static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = {
1282 &omap2430_dss__l3,
1283};
1284
1285static struct omap_hwmod_addr_space omap2430_dss_addrs[] = {
1286 {
1287 .pa_start = 0x48050000,
1288 .pa_end = 0x480503FF,
1289 .flags = ADDR_TYPE_RT
1290 },
1291};
1292
1293/* l4_core -> dss */
1294static struct omap_hwmod_ocp_if omap2430_l4_core__dss = {
1295 .master = &omap2430_l4_core_hwmod,
1296 .slave = &omap2430_dss_core_hwmod,
1297 .clk = "dss_ick",
1298 .addr = omap2430_dss_addrs,
1299 .addr_cnt = ARRAY_SIZE(omap2430_dss_addrs),
1300 .user = OCP_USER_MPU | OCP_USER_SDMA,
1301};
1302
1303/* dss slave ports */
1304static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = {
1305 &omap2430_l4_core__dss,
1306};
1307
1308static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1309 { .role = "tv_clk", .clk = "dss_54m_fck" },
1310 { .role = "sys_clk", .clk = "dss2_fck" },
1311};
1312
1313static struct omap_hwmod omap2430_dss_core_hwmod = {
1314 .name = "dss_core",
1315 .class = &omap2430_dss_hwmod_class,
1316 .main_clk = "dss1_fck", /* instead of dss_fck */
1317 .mpu_irqs = omap2430_dss_irqs,
1318 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_dss_irqs),
1319 .sdma_reqs = omap2430_dss_sdma_chs,
1320 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_dss_sdma_chs),
1321 .prcm = {
1322 .omap2 = {
1323 .prcm_reg_id = 1,
1324 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1325 .module_offs = CORE_MOD,
1326 .idlest_reg_id = 1,
1327 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1328 },
1329 },
1330 .opt_clks = dss_opt_clks,
1331 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1332 .slaves = omap2430_dss_slaves,
1333 .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves),
1334 .masters = omap2430_dss_masters,
1335 .masters_cnt = ARRAY_SIZE(omap2430_dss_masters),
1336 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1337 .flags = HWMOD_NO_IDLEST,
1338};
1339
1340/*
1341 * 'dispc' class
1342 * display controller
1343 */
1344
1345static struct omap_hwmod_class_sysconfig omap2430_dispc_sysc = {
1346 .rev_offs = 0x0000,
1347 .sysc_offs = 0x0010,
1348 .syss_offs = 0x0014,
1349 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
1350 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1351 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1352 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1353 .sysc_fields = &omap_hwmod_sysc_type1,
1354};
1355
1356static struct omap_hwmod_class omap2430_dispc_hwmod_class = {
1357 .name = "dispc",
1358 .sysc = &omap2430_dispc_sysc,
1359};
1360
1361static struct omap_hwmod_addr_space omap2430_dss_dispc_addrs[] = {
1362 {
1363 .pa_start = 0x48050400,
1364 .pa_end = 0x480507FF,
1365 .flags = ADDR_TYPE_RT
1366 },
1367};
1368
1369/* l4_core -> dss_dispc */
1370static struct omap_hwmod_ocp_if omap2430_l4_core__dss_dispc = {
1371 .master = &omap2430_l4_core_hwmod,
1372 .slave = &omap2430_dss_dispc_hwmod,
1373 .clk = "dss_ick",
1374 .addr = omap2430_dss_dispc_addrs,
1375 .addr_cnt = ARRAY_SIZE(omap2430_dss_dispc_addrs),
1376 .user = OCP_USER_MPU | OCP_USER_SDMA,
1377};
1378
1379/* dss_dispc slave ports */
1380static struct omap_hwmod_ocp_if *omap2430_dss_dispc_slaves[] = {
1381 &omap2430_l4_core__dss_dispc,
1382};
1383
1384static struct omap_hwmod omap2430_dss_dispc_hwmod = {
1385 .name = "dss_dispc",
1386 .class = &omap2430_dispc_hwmod_class,
1387 .main_clk = "dss1_fck",
1388 .prcm = {
1389 .omap2 = {
1390 .prcm_reg_id = 1,
1391 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1392 .module_offs = CORE_MOD,
1393 .idlest_reg_id = 1,
1394 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
1395 },
1396 },
1397 .slaves = omap2430_dss_dispc_slaves,
1398 .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves),
1399 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1400 .flags = HWMOD_NO_IDLEST,
1401};
1402
1403/*
1404 * 'rfbi' class
1405 * remote frame buffer interface
1406 */
1407
1408static struct omap_hwmod_class_sysconfig omap2430_rfbi_sysc = {
1409 .rev_offs = 0x0000,
1410 .sysc_offs = 0x0010,
1411 .syss_offs = 0x0014,
1412 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1413 SYSC_HAS_AUTOIDLE),
1414 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1415 .sysc_fields = &omap_hwmod_sysc_type1,
1416};
1417
1418static struct omap_hwmod_class omap2430_rfbi_hwmod_class = {
1419 .name = "rfbi",
1420 .sysc = &omap2430_rfbi_sysc,
1421};
1422
1423static struct omap_hwmod_addr_space omap2430_dss_rfbi_addrs[] = {
1424 {
1425 .pa_start = 0x48050800,
1426 .pa_end = 0x48050BFF,
1427 .flags = ADDR_TYPE_RT
1428 },
1429};
1430
1431/* l4_core -> dss_rfbi */
1432static struct omap_hwmod_ocp_if omap2430_l4_core__dss_rfbi = {
1433 .master = &omap2430_l4_core_hwmod,
1434 .slave = &omap2430_dss_rfbi_hwmod,
1435 .clk = "dss_ick",
1436 .addr = omap2430_dss_rfbi_addrs,
1437 .addr_cnt = ARRAY_SIZE(omap2430_dss_rfbi_addrs),
1438 .user = OCP_USER_MPU | OCP_USER_SDMA,
1439};
1440
1441/* dss_rfbi slave ports */
1442static struct omap_hwmod_ocp_if *omap2430_dss_rfbi_slaves[] = {
1443 &omap2430_l4_core__dss_rfbi,
1444};
1445
1446static struct omap_hwmod omap2430_dss_rfbi_hwmod = {
1447 .name = "dss_rfbi",
1448 .class = &omap2430_rfbi_hwmod_class,
1449 .main_clk = "dss1_fck",
1450 .prcm = {
1451 .omap2 = {
1452 .prcm_reg_id = 1,
1453 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1454 .module_offs = CORE_MOD,
1455 },
1456 },
1457 .slaves = omap2430_dss_rfbi_slaves,
1458 .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves),
1459 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1460 .flags = HWMOD_NO_IDLEST,
1461};
1462
1463/*
1464 * 'venc' class
1465 * video encoder
1466 */
1467
1468static struct omap_hwmod_class omap2430_venc_hwmod_class = {
1469 .name = "venc",
1470};
1471
1472/* dss_venc */
1473static struct omap_hwmod_addr_space omap2430_dss_venc_addrs[] = {
1474 {
1475 .pa_start = 0x48050C00,
1476 .pa_end = 0x48050FFF,
1477 .flags = ADDR_TYPE_RT
1478 },
1479};
1480
1481/* l4_core -> dss_venc */
1482static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = {
1483 .master = &omap2430_l4_core_hwmod,
1484 .slave = &omap2430_dss_venc_hwmod,
1485 .clk = "dss_54m_fck",
1486 .addr = omap2430_dss_venc_addrs,
1487 .addr_cnt = ARRAY_SIZE(omap2430_dss_venc_addrs),
1488 .flags = OCPIF_SWSUP_IDLE,
1489 .user = OCP_USER_MPU | OCP_USER_SDMA,
1490};
1491
1492/* dss_venc slave ports */
1493static struct omap_hwmod_ocp_if *omap2430_dss_venc_slaves[] = {
1494 &omap2430_l4_core__dss_venc,
1495};
1496
1497static struct omap_hwmod omap2430_dss_venc_hwmod = {
1498 .name = "dss_venc",
1499 .class = &omap2430_venc_hwmod_class,
1500 .main_clk = "dss1_fck",
1501 .prcm = {
1502 .omap2 = {
1503 .prcm_reg_id = 1,
1504 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
1505 .module_offs = CORE_MOD,
1506 },
1507 },
1508 .slaves = omap2430_dss_venc_slaves,
1509 .slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves),
1510 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1511 .flags = HWMOD_NO_IDLEST,
1512};
1513
472/* I2C common */ 1514/* I2C common */
473static struct omap_hwmod_class_sysconfig i2c_sysc = { 1515static struct omap_hwmod_class_sysconfig i2c_sysc = {
474 .rev_offs = 0x00, 1516 .rev_offs = 0x00,
@@ -919,18 +1961,741 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {
919 .flags = HWMOD_NO_IDLEST, 1961 .flags = HWMOD_NO_IDLEST,
920}; 1962};
921 1963
1964/*
1965 * 'mailbox' class
1966 * mailbox module allowing communication between the on-chip processors
1967 * using a queued mailbox-interrupt mechanism.
1968 */
1969
1970static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = {
1971 .rev_offs = 0x000,
1972 .sysc_offs = 0x010,
1973 .syss_offs = 0x014,
1974 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1975 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1976 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1977 .sysc_fields = &omap_hwmod_sysc_type1,
1978};
1979
1980static struct omap_hwmod_class omap2430_mailbox_hwmod_class = {
1981 .name = "mailbox",
1982 .sysc = &omap2430_mailbox_sysc,
1983};
1984
1985/* mailbox */
1986static struct omap_hwmod omap2430_mailbox_hwmod;
1987static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
1988 { .irq = 26 },
1989};
1990
1991static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = {
1992 {
1993 .pa_start = 0x48094000,
1994 .pa_end = 0x480941ff,
1995 .flags = ADDR_TYPE_RT,
1996 },
1997};
1998
1999/* l4_core -> mailbox */
2000static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = {
2001 .master = &omap2430_l4_core_hwmod,
2002 .slave = &omap2430_mailbox_hwmod,
2003 .addr = omap2430_mailbox_addrs,
2004 .addr_cnt = ARRAY_SIZE(omap2430_mailbox_addrs),
2005 .user = OCP_USER_MPU | OCP_USER_SDMA,
2006};
2007
2008/* mailbox slave ports */
2009static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = {
2010 &omap2430_l4_core__mailbox,
2011};
2012
2013static struct omap_hwmod omap2430_mailbox_hwmod = {
2014 .name = "mailbox",
2015 .class = &omap2430_mailbox_hwmod_class,
2016 .mpu_irqs = omap2430_mailbox_irqs,
2017 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mailbox_irqs),
2018 .main_clk = "mailboxes_ick",
2019 .prcm = {
2020 .omap2 = {
2021 .prcm_reg_id = 1,
2022 .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
2023 .module_offs = CORE_MOD,
2024 .idlest_reg_id = 1,
2025 .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
2026 },
2027 },
2028 .slaves = omap2430_mailbox_slaves,
2029 .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves),
2030 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2031};
2032
2033/*
2034 * 'mcspi' class
2035 * multichannel serial port interface (mcspi) / master/slave synchronous serial
2036 * bus
2037 */
2038
2039static struct omap_hwmod_class_sysconfig omap2430_mcspi_sysc = {
2040 .rev_offs = 0x0000,
2041 .sysc_offs = 0x0010,
2042 .syss_offs = 0x0014,
2043 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
2044 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
2045 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
2046 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2047 .sysc_fields = &omap_hwmod_sysc_type1,
2048};
2049
2050static struct omap_hwmod_class omap2430_mcspi_class = {
2051 .name = "mcspi",
2052 .sysc = &omap2430_mcspi_sysc,
2053 .rev = OMAP2_MCSPI_REV,
2054};
2055
2056/* mcspi1 */
2057static struct omap_hwmod_irq_info omap2430_mcspi1_mpu_irqs[] = {
2058 { .irq = 65 },
2059};
2060
2061static struct omap_hwmod_dma_info omap2430_mcspi1_sdma_reqs[] = {
2062 { .name = "tx0", .dma_req = 35 }, /* DMA_SPI1_TX0 */
2063 { .name = "rx0", .dma_req = 36 }, /* DMA_SPI1_RX0 */
2064 { .name = "tx1", .dma_req = 37 }, /* DMA_SPI1_TX1 */
2065 { .name = "rx1", .dma_req = 38 }, /* DMA_SPI1_RX1 */
2066 { .name = "tx2", .dma_req = 39 }, /* DMA_SPI1_TX2 */
2067 { .name = "rx2", .dma_req = 40 }, /* DMA_SPI1_RX2 */
2068 { .name = "tx3", .dma_req = 41 }, /* DMA_SPI1_TX3 */
2069 { .name = "rx3", .dma_req = 42 }, /* DMA_SPI1_RX3 */
2070};
2071
2072static struct omap_hwmod_ocp_if *omap2430_mcspi1_slaves[] = {
2073 &omap2430_l4_core__mcspi1,
2074};
2075
2076static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
2077 .num_chipselect = 4,
2078};
2079
2080static struct omap_hwmod omap2430_mcspi1_hwmod = {
2081 .name = "mcspi1_hwmod",
2082 .mpu_irqs = omap2430_mcspi1_mpu_irqs,
2083 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi1_mpu_irqs),
2084 .sdma_reqs = omap2430_mcspi1_sdma_reqs,
2085 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi1_sdma_reqs),
2086 .main_clk = "mcspi1_fck",
2087 .prcm = {
2088 .omap2 = {
2089 .module_offs = CORE_MOD,
2090 .prcm_reg_id = 1,
2091 .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
2092 .idlest_reg_id = 1,
2093 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
2094 },
2095 },
2096 .slaves = omap2430_mcspi1_slaves,
2097 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves),
2098 .class = &omap2430_mcspi_class,
2099 .dev_attr = &omap_mcspi1_dev_attr,
2100 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2101};
2102
2103/* mcspi2 */
2104static struct omap_hwmod_irq_info omap2430_mcspi2_mpu_irqs[] = {
2105 { .irq = 66 },
2106};
2107
2108static struct omap_hwmod_dma_info omap2430_mcspi2_sdma_reqs[] = {
2109 { .name = "tx0", .dma_req = 43 }, /* DMA_SPI2_TX0 */
2110 { .name = "rx0", .dma_req = 44 }, /* DMA_SPI2_RX0 */
2111 { .name = "tx1", .dma_req = 45 }, /* DMA_SPI2_TX1 */
2112 { .name = "rx1", .dma_req = 46 }, /* DMA_SPI2_RX1 */
2113};
2114
2115static struct omap_hwmod_ocp_if *omap2430_mcspi2_slaves[] = {
2116 &omap2430_l4_core__mcspi2,
2117};
2118
2119static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
2120 .num_chipselect = 2,
2121};
2122
2123static struct omap_hwmod omap2430_mcspi2_hwmod = {
2124 .name = "mcspi2_hwmod",
2125 .mpu_irqs = omap2430_mcspi2_mpu_irqs,
2126 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi2_mpu_irqs),
2127 .sdma_reqs = omap2430_mcspi2_sdma_reqs,
2128 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi2_sdma_reqs),
2129 .main_clk = "mcspi2_fck",
2130 .prcm = {
2131 .omap2 = {
2132 .module_offs = CORE_MOD,
2133 .prcm_reg_id = 1,
2134 .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
2135 .idlest_reg_id = 1,
2136 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
2137 },
2138 },
2139 .slaves = omap2430_mcspi2_slaves,
2140 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves),
2141 .class = &omap2430_mcspi_class,
2142 .dev_attr = &omap_mcspi2_dev_attr,
2143 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2144};
2145
2146/* mcspi3 */
2147static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = {
2148 { .irq = 91 },
2149};
2150
2151static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = {
2152 { .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */
2153 { .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */
2154 { .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */
2155 { .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */
2156};
2157
2158static struct omap_hwmod_ocp_if *omap2430_mcspi3_slaves[] = {
2159 &omap2430_l4_core__mcspi3,
2160};
2161
2162static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
2163 .num_chipselect = 2,
2164};
2165
2166static struct omap_hwmod omap2430_mcspi3_hwmod = {
2167 .name = "mcspi3_hwmod",
2168 .mpu_irqs = omap2430_mcspi3_mpu_irqs,
2169 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcspi3_mpu_irqs),
2170 .sdma_reqs = omap2430_mcspi3_sdma_reqs,
2171 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcspi3_sdma_reqs),
2172 .main_clk = "mcspi3_fck",
2173 .prcm = {
2174 .omap2 = {
2175 .module_offs = CORE_MOD,
2176 .prcm_reg_id = 2,
2177 .module_bit = OMAP2430_EN_MCSPI3_SHIFT,
2178 .idlest_reg_id = 2,
2179 .idlest_idle_bit = OMAP2430_ST_MCSPI3_SHIFT,
2180 },
2181 },
2182 .slaves = omap2430_mcspi3_slaves,
2183 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves),
2184 .class = &omap2430_mcspi_class,
2185 .dev_attr = &omap_mcspi3_dev_attr,
2186 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2187};
2188
2189/*
2190 * usbhsotg
2191 */
2192static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
2193 .rev_offs = 0x0400,
2194 .sysc_offs = 0x0404,
2195 .syss_offs = 0x0408,
2196 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
2197 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
2198 SYSC_HAS_AUTOIDLE),
2199 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2200 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
2201 .sysc_fields = &omap_hwmod_sysc_type1,
2202};
2203
2204static struct omap_hwmod_class usbotg_class = {
2205 .name = "usbotg",
2206 .sysc = &omap2430_usbhsotg_sysc,
2207};
2208
2209/* usb_otg_hs */
2210static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
2211
2212 { .name = "mc", .irq = 92 },
2213 { .name = "dma", .irq = 93 },
2214};
2215
2216static struct omap_hwmod omap2430_usbhsotg_hwmod = {
2217 .name = "usb_otg_hs",
2218 .mpu_irqs = omap2430_usbhsotg_mpu_irqs,
2219 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_usbhsotg_mpu_irqs),
2220 .main_clk = "usbhs_ick",
2221 .prcm = {
2222 .omap2 = {
2223 .prcm_reg_id = 1,
2224 .module_bit = OMAP2430_EN_USBHS_MASK,
2225 .module_offs = CORE_MOD,
2226 .idlest_reg_id = 1,
2227 .idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT,
2228 },
2229 },
2230 .masters = omap2430_usbhsotg_masters,
2231 .masters_cnt = ARRAY_SIZE(omap2430_usbhsotg_masters),
2232 .slaves = omap2430_usbhsotg_slaves,
2233 .slaves_cnt = ARRAY_SIZE(omap2430_usbhsotg_slaves),
2234 .class = &usbotg_class,
2235 /*
2236 * Erratum ID: i479 idle_req / idle_ack mechanism potentially
2237 * broken when autoidle is enabled
2238 * workaround is to disable the autoidle bit at module level.
2239 */
2240 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
2241 | HWMOD_SWSUP_MSTANDBY,
2242 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
2243};
2244
2245/*
2246 * 'mcbsp' class
2247 * multi channel buffered serial port controller
2248 */
2249
2250static struct omap_hwmod_class_sysconfig omap2430_mcbsp_sysc = {
2251 .rev_offs = 0x007C,
2252 .sysc_offs = 0x008C,
2253 .sysc_flags = (SYSC_HAS_SOFTRESET),
2254 .sysc_fields = &omap_hwmod_sysc_type1,
2255};
2256
2257static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = {
2258 .name = "mcbsp",
2259 .sysc = &omap2430_mcbsp_sysc,
2260 .rev = MCBSP_CONFIG_TYPE2,
2261};
2262
2263/* mcbsp1 */
2264static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = {
2265 { .name = "tx", .irq = 59 },
2266 { .name = "rx", .irq = 60 },
2267 { .name = "ovr", .irq = 61 },
2268 { .name = "common", .irq = 64 },
2269};
2270
2271static struct omap_hwmod_dma_info omap2430_mcbsp1_sdma_chs[] = {
2272 { .name = "rx", .dma_req = 32 },
2273 { .name = "tx", .dma_req = 31 },
2274};
2275
2276static struct omap_hwmod_addr_space omap2430_mcbsp1_addrs[] = {
2277 {
2278 .name = "mpu",
2279 .pa_start = 0x48074000,
2280 .pa_end = 0x480740ff,
2281 .flags = ADDR_TYPE_RT
2282 },
2283};
2284
2285/* l4_core -> mcbsp1 */
2286static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = {
2287 .master = &omap2430_l4_core_hwmod,
2288 .slave = &omap2430_mcbsp1_hwmod,
2289 .clk = "mcbsp1_ick",
2290 .addr = omap2430_mcbsp1_addrs,
2291 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp1_addrs),
2292 .user = OCP_USER_MPU | OCP_USER_SDMA,
2293};
2294
2295/* mcbsp1 slave ports */
2296static struct omap_hwmod_ocp_if *omap2430_mcbsp1_slaves[] = {
2297 &omap2430_l4_core__mcbsp1,
2298};
2299
2300static struct omap_hwmod omap2430_mcbsp1_hwmod = {
2301 .name = "mcbsp1",
2302 .class = &omap2430_mcbsp_hwmod_class,
2303 .mpu_irqs = omap2430_mcbsp1_irqs,
2304 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_irqs),
2305 .sdma_reqs = omap2430_mcbsp1_sdma_chs,
2306 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp1_sdma_chs),
2307 .main_clk = "mcbsp1_fck",
2308 .prcm = {
2309 .omap2 = {
2310 .prcm_reg_id = 1,
2311 .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
2312 .module_offs = CORE_MOD,
2313 .idlest_reg_id = 1,
2314 .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
2315 },
2316 },
2317 .slaves = omap2430_mcbsp1_slaves,
2318 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves),
2319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2320};
2321
2322/* mcbsp2 */
2323static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = {
2324 { .name = "tx", .irq = 62 },
2325 { .name = "rx", .irq = 63 },
2326 { .name = "common", .irq = 16 },
2327};
2328
2329static struct omap_hwmod_dma_info omap2430_mcbsp2_sdma_chs[] = {
2330 { .name = "rx", .dma_req = 34 },
2331 { .name = "tx", .dma_req = 33 },
2332};
2333
2334static struct omap_hwmod_addr_space omap2430_mcbsp2_addrs[] = {
2335 {
2336 .name = "mpu",
2337 .pa_start = 0x48076000,
2338 .pa_end = 0x480760ff,
2339 .flags = ADDR_TYPE_RT
2340 },
2341};
2342
2343/* l4_core -> mcbsp2 */
2344static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = {
2345 .master = &omap2430_l4_core_hwmod,
2346 .slave = &omap2430_mcbsp2_hwmod,
2347 .clk = "mcbsp2_ick",
2348 .addr = omap2430_mcbsp2_addrs,
2349 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp2_addrs),
2350 .user = OCP_USER_MPU | OCP_USER_SDMA,
2351};
2352
2353/* mcbsp2 slave ports */
2354static struct omap_hwmod_ocp_if *omap2430_mcbsp2_slaves[] = {
2355 &omap2430_l4_core__mcbsp2,
2356};
2357
2358static struct omap_hwmod omap2430_mcbsp2_hwmod = {
2359 .name = "mcbsp2",
2360 .class = &omap2430_mcbsp_hwmod_class,
2361 .mpu_irqs = omap2430_mcbsp2_irqs,
2362 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_irqs),
2363 .sdma_reqs = omap2430_mcbsp2_sdma_chs,
2364 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp2_sdma_chs),
2365 .main_clk = "mcbsp2_fck",
2366 .prcm = {
2367 .omap2 = {
2368 .prcm_reg_id = 1,
2369 .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
2370 .module_offs = CORE_MOD,
2371 .idlest_reg_id = 1,
2372 .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
2373 },
2374 },
2375 .slaves = omap2430_mcbsp2_slaves,
2376 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves),
2377 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2378};
2379
2380/* mcbsp3 */
2381static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = {
2382 { .name = "tx", .irq = 89 },
2383 { .name = "rx", .irq = 90 },
2384 { .name = "common", .irq = 17 },
2385};
2386
2387static struct omap_hwmod_dma_info omap2430_mcbsp3_sdma_chs[] = {
2388 { .name = "rx", .dma_req = 18 },
2389 { .name = "tx", .dma_req = 17 },
2390};
2391
2392static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = {
2393 {
2394 .name = "mpu",
2395 .pa_start = 0x4808C000,
2396 .pa_end = 0x4808C0ff,
2397 .flags = ADDR_TYPE_RT
2398 },
2399};
2400
2401/* l4_core -> mcbsp3 */
2402static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = {
2403 .master = &omap2430_l4_core_hwmod,
2404 .slave = &omap2430_mcbsp3_hwmod,
2405 .clk = "mcbsp3_ick",
2406 .addr = omap2430_mcbsp3_addrs,
2407 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp3_addrs),
2408 .user = OCP_USER_MPU | OCP_USER_SDMA,
2409};
2410
2411/* mcbsp3 slave ports */
2412static struct omap_hwmod_ocp_if *omap2430_mcbsp3_slaves[] = {
2413 &omap2430_l4_core__mcbsp3,
2414};
2415
2416static struct omap_hwmod omap2430_mcbsp3_hwmod = {
2417 .name = "mcbsp3",
2418 .class = &omap2430_mcbsp_hwmod_class,
2419 .mpu_irqs = omap2430_mcbsp3_irqs,
2420 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_irqs),
2421 .sdma_reqs = omap2430_mcbsp3_sdma_chs,
2422 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp3_sdma_chs),
2423 .main_clk = "mcbsp3_fck",
2424 .prcm = {
2425 .omap2 = {
2426 .prcm_reg_id = 1,
2427 .module_bit = OMAP2430_EN_MCBSP3_SHIFT,
2428 .module_offs = CORE_MOD,
2429 .idlest_reg_id = 2,
2430 .idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT,
2431 },
2432 },
2433 .slaves = omap2430_mcbsp3_slaves,
2434 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves),
2435 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2436};
2437
2438/* mcbsp4 */
2439static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = {
2440 { .name = "tx", .irq = 54 },
2441 { .name = "rx", .irq = 55 },
2442 { .name = "common", .irq = 18 },
2443};
2444
2445static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = {
2446 { .name = "rx", .dma_req = 20 },
2447 { .name = "tx", .dma_req = 19 },
2448};
2449
2450static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = {
2451 {
2452 .name = "mpu",
2453 .pa_start = 0x4808E000,
2454 .pa_end = 0x4808E0ff,
2455 .flags = ADDR_TYPE_RT
2456 },
2457};
2458
2459/* l4_core -> mcbsp4 */
2460static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = {
2461 .master = &omap2430_l4_core_hwmod,
2462 .slave = &omap2430_mcbsp4_hwmod,
2463 .clk = "mcbsp4_ick",
2464 .addr = omap2430_mcbsp4_addrs,
2465 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp4_addrs),
2466 .user = OCP_USER_MPU | OCP_USER_SDMA,
2467};
2468
2469/* mcbsp4 slave ports */
2470static struct omap_hwmod_ocp_if *omap2430_mcbsp4_slaves[] = {
2471 &omap2430_l4_core__mcbsp4,
2472};
2473
2474static struct omap_hwmod omap2430_mcbsp4_hwmod = {
2475 .name = "mcbsp4",
2476 .class = &omap2430_mcbsp_hwmod_class,
2477 .mpu_irqs = omap2430_mcbsp4_irqs,
2478 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_irqs),
2479 .sdma_reqs = omap2430_mcbsp4_sdma_chs,
2480 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp4_sdma_chs),
2481 .main_clk = "mcbsp4_fck",
2482 .prcm = {
2483 .omap2 = {
2484 .prcm_reg_id = 1,
2485 .module_bit = OMAP2430_EN_MCBSP4_SHIFT,
2486 .module_offs = CORE_MOD,
2487 .idlest_reg_id = 2,
2488 .idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT,
2489 },
2490 },
2491 .slaves = omap2430_mcbsp4_slaves,
2492 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves),
2493 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2494};
2495
2496/* mcbsp5 */
2497static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = {
2498 { .name = "tx", .irq = 81 },
2499 { .name = "rx", .irq = 82 },
2500 { .name = "common", .irq = 19 },
2501};
2502
2503static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = {
2504 { .name = "rx", .dma_req = 22 },
2505 { .name = "tx", .dma_req = 21 },
2506};
2507
2508static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = {
2509 {
2510 .name = "mpu",
2511 .pa_start = 0x48096000,
2512 .pa_end = 0x480960ff,
2513 .flags = ADDR_TYPE_RT
2514 },
2515};
2516
2517/* l4_core -> mcbsp5 */
2518static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = {
2519 .master = &omap2430_l4_core_hwmod,
2520 .slave = &omap2430_mcbsp5_hwmod,
2521 .clk = "mcbsp5_ick",
2522 .addr = omap2430_mcbsp5_addrs,
2523 .addr_cnt = ARRAY_SIZE(omap2430_mcbsp5_addrs),
2524 .user = OCP_USER_MPU | OCP_USER_SDMA,
2525};
2526
2527/* mcbsp5 slave ports */
2528static struct omap_hwmod_ocp_if *omap2430_mcbsp5_slaves[] = {
2529 &omap2430_l4_core__mcbsp5,
2530};
2531
2532static struct omap_hwmod omap2430_mcbsp5_hwmod = {
2533 .name = "mcbsp5",
2534 .class = &omap2430_mcbsp_hwmod_class,
2535 .mpu_irqs = omap2430_mcbsp5_irqs,
2536 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_irqs),
2537 .sdma_reqs = omap2430_mcbsp5_sdma_chs,
2538 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mcbsp5_sdma_chs),
2539 .main_clk = "mcbsp5_fck",
2540 .prcm = {
2541 .omap2 = {
2542 .prcm_reg_id = 1,
2543 .module_bit = OMAP2430_EN_MCBSP5_SHIFT,
2544 .module_offs = CORE_MOD,
2545 .idlest_reg_id = 2,
2546 .idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT,
2547 },
2548 },
2549 .slaves = omap2430_mcbsp5_slaves,
2550 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves),
2551 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2552};
2553
2554/* MMC/SD/SDIO common */
2555
2556static struct omap_hwmod_class_sysconfig omap2430_mmc_sysc = {
2557 .rev_offs = 0x1fc,
2558 .sysc_offs = 0x10,
2559 .syss_offs = 0x14,
2560 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
2561 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
2562 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
2563 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2564 .sysc_fields = &omap_hwmod_sysc_type1,
2565};
2566
2567static struct omap_hwmod_class omap2430_mmc_class = {
2568 .name = "mmc",
2569 .sysc = &omap2430_mmc_sysc,
2570};
2571
2572/* MMC/SD/SDIO1 */
2573
2574static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = {
2575 { .irq = 83 },
2576};
2577
2578static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = {
2579 { .name = "tx", .dma_req = 61 }, /* DMA_MMC1_TX */
2580 { .name = "rx", .dma_req = 62 }, /* DMA_MMC1_RX */
2581};
2582
2583static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = {
2584 { .role = "dbck", .clk = "mmchsdb1_fck" },
2585};
2586
2587static struct omap_hwmod_ocp_if *omap2430_mmc1_slaves[] = {
2588 &omap2430_l4_core__mmc1,
2589};
2590
2591static struct omap_mmc_dev_attr mmc1_dev_attr = {
2592 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
2593};
2594
2595static struct omap_hwmod omap2430_mmc1_hwmod = {
2596 .name = "mmc1",
2597 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
2598 .mpu_irqs = omap2430_mmc1_mpu_irqs,
2599 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc1_mpu_irqs),
2600 .sdma_reqs = omap2430_mmc1_sdma_reqs,
2601 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc1_sdma_reqs),
2602 .opt_clks = omap2430_mmc1_opt_clks,
2603 .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks),
2604 .main_clk = "mmchs1_fck",
2605 .prcm = {
2606 .omap2 = {
2607 .module_offs = CORE_MOD,
2608 .prcm_reg_id = 2,
2609 .module_bit = OMAP2430_EN_MMCHS1_SHIFT,
2610 .idlest_reg_id = 2,
2611 .idlest_idle_bit = OMAP2430_ST_MMCHS1_SHIFT,
2612 },
2613 },
2614 .dev_attr = &mmc1_dev_attr,
2615 .slaves = omap2430_mmc1_slaves,
2616 .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves),
2617 .class = &omap2430_mmc_class,
2618 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2619};
2620
2621/* MMC/SD/SDIO2 */
2622
2623static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = {
2624 { .irq = 86 },
2625};
2626
2627static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = {
2628 { .name = "tx", .dma_req = 47 }, /* DMA_MMC2_TX */
2629 { .name = "rx", .dma_req = 48 }, /* DMA_MMC2_RX */
2630};
2631
2632static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = {
2633 { .role = "dbck", .clk = "mmchsdb2_fck" },
2634};
2635
2636static struct omap_hwmod_ocp_if *omap2430_mmc2_slaves[] = {
2637 &omap2430_l4_core__mmc2,
2638};
2639
2640static struct omap_hwmod omap2430_mmc2_hwmod = {
2641 .name = "mmc2",
2642 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
2643 .mpu_irqs = omap2430_mmc2_mpu_irqs,
2644 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_mmc2_mpu_irqs),
2645 .sdma_reqs = omap2430_mmc2_sdma_reqs,
2646 .sdma_reqs_cnt = ARRAY_SIZE(omap2430_mmc2_sdma_reqs),
2647 .opt_clks = omap2430_mmc2_opt_clks,
2648 .opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks),
2649 .main_clk = "mmchs2_fck",
2650 .prcm = {
2651 .omap2 = {
2652 .module_offs = CORE_MOD,
2653 .prcm_reg_id = 2,
2654 .module_bit = OMAP2430_EN_MMCHS2_SHIFT,
2655 .idlest_reg_id = 2,
2656 .idlest_idle_bit = OMAP2430_ST_MMCHS2_SHIFT,
2657 },
2658 },
2659 .slaves = omap2430_mmc2_slaves,
2660 .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves),
2661 .class = &omap2430_mmc_class,
2662 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2663};
2664
922static __initdata struct omap_hwmod *omap2430_hwmods[] = { 2665static __initdata struct omap_hwmod *omap2430_hwmods[] = {
923 &omap2430_l3_main_hwmod, 2666 &omap2430_l3_main_hwmod,
924 &omap2430_l4_core_hwmod, 2667 &omap2430_l4_core_hwmod,
925 &omap2430_l4_wkup_hwmod, 2668 &omap2430_l4_wkup_hwmod,
926 &omap2430_mpu_hwmod, 2669 &omap2430_mpu_hwmod,
927 &omap2430_iva_hwmod, 2670 &omap2430_iva_hwmod,
2671
2672 &omap2430_timer1_hwmod,
2673 &omap2430_timer2_hwmod,
2674 &omap2430_timer3_hwmod,
2675 &omap2430_timer4_hwmod,
2676 &omap2430_timer5_hwmod,
2677 &omap2430_timer6_hwmod,
2678 &omap2430_timer7_hwmod,
2679 &omap2430_timer8_hwmod,
2680 &omap2430_timer9_hwmod,
2681 &omap2430_timer10_hwmod,
2682 &omap2430_timer11_hwmod,
2683 &omap2430_timer12_hwmod,
2684
928 &omap2430_wd_timer2_hwmod, 2685 &omap2430_wd_timer2_hwmod,
929 &omap2430_uart1_hwmod, 2686 &omap2430_uart1_hwmod,
930 &omap2430_uart2_hwmod, 2687 &omap2430_uart2_hwmod,
931 &omap2430_uart3_hwmod, 2688 &omap2430_uart3_hwmod,
2689 /* dss class */
2690 &omap2430_dss_core_hwmod,
2691 &omap2430_dss_dispc_hwmod,
2692 &omap2430_dss_rfbi_hwmod,
2693 &omap2430_dss_venc_hwmod,
2694 /* i2c class */
932 &omap2430_i2c1_hwmod, 2695 &omap2430_i2c1_hwmod,
933 &omap2430_i2c2_hwmod, 2696 &omap2430_i2c2_hwmod,
2697 &omap2430_mmc1_hwmod,
2698 &omap2430_mmc2_hwmod,
934 2699
935 /* gpio class */ 2700 /* gpio class */
936 &omap2430_gpio1_hwmod, 2701 &omap2430_gpio1_hwmod,
@@ -941,10 +2706,29 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
941 2706
942 /* dma_system class*/ 2707 /* dma_system class*/
943 &omap2430_dma_system_hwmod, 2708 &omap2430_dma_system_hwmod,
2709
2710 /* mcbsp class */
2711 &omap2430_mcbsp1_hwmod,
2712 &omap2430_mcbsp2_hwmod,
2713 &omap2430_mcbsp3_hwmod,
2714 &omap2430_mcbsp4_hwmod,
2715 &omap2430_mcbsp5_hwmod,
2716
2717 /* mailbox class */
2718 &omap2430_mailbox_hwmod,
2719
2720 /* mcspi class */
2721 &omap2430_mcspi1_hwmod,
2722 &omap2430_mcspi2_hwmod,
2723 &omap2430_mcspi3_hwmod,
2724
2725 /* usbotg class*/
2726 &omap2430_usbhsotg_hwmod,
2727
944 NULL, 2728 NULL,
945}; 2729};
946 2730
947int __init omap2430_hwmod_init(void) 2731int __init omap2430_hwmod_init(void)
948{ 2732{
949 return omap_hwmod_init(omap2430_hwmods); 2733 return omap_hwmod_register(omap2430_hwmods);
950} 2734}
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 8d8181334f86..2e275cbcd654 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -18,16 +18,22 @@
18#include <plat/cpu.h> 18#include <plat/cpu.h>
19#include <plat/dma.h> 19#include <plat/dma.h>
20#include <plat/serial.h> 20#include <plat/serial.h>
21#include <plat/l3_3xxx.h>
21#include <plat/l4_3xxx.h> 22#include <plat/l4_3xxx.h>
22#include <plat/i2c.h> 23#include <plat/i2c.h>
23#include <plat/gpio.h> 24#include <plat/gpio.h>
25#include <plat/mmc.h>
24#include <plat/smartreflex.h> 26#include <plat/smartreflex.h>
27#include <plat/mcbsp.h>
28#include <plat/mcspi.h>
29#include <plat/dmtimer.h>
25 30
26#include "omap_hwmod_common_data.h" 31#include "omap_hwmod_common_data.h"
27 32
28#include "prm-regbits-34xx.h" 33#include "prm-regbits-34xx.h"
29#include "cm-regbits-34xx.h" 34#include "cm-regbits-34xx.h"
30#include "wd_timer.h" 35#include "wd_timer.h"
36#include <mach/am35xx.h>
31 37
32/* 38/*
33 * OMAP3xxx hardware module integration data 39 * OMAP3xxx hardware module integration data
@@ -44,6 +50,12 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod;
44static struct omap_hwmod omap3xxx_l4_core_hwmod; 50static struct omap_hwmod omap3xxx_l4_core_hwmod;
45static struct omap_hwmod omap3xxx_l4_per_hwmod; 51static struct omap_hwmod omap3xxx_l4_per_hwmod;
46static struct omap_hwmod omap3xxx_wd_timer2_hwmod; 52static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
53static struct omap_hwmod omap3430es1_dss_core_hwmod;
54static struct omap_hwmod omap3xxx_dss_core_hwmod;
55static struct omap_hwmod omap3xxx_dss_dispc_hwmod;
56static struct omap_hwmod omap3xxx_dss_dsi1_hwmod;
57static struct omap_hwmod omap3xxx_dss_rfbi_hwmod;
58static struct omap_hwmod omap3xxx_dss_venc_hwmod;
47static struct omap_hwmod omap3xxx_i2c1_hwmod; 59static struct omap_hwmod omap3xxx_i2c1_hwmod;
48static struct omap_hwmod omap3xxx_i2c2_hwmod; 60static struct omap_hwmod omap3xxx_i2c2_hwmod;
49static struct omap_hwmod omap3xxx_i2c3_hwmod; 61static struct omap_hwmod omap3xxx_i2c3_hwmod;
@@ -55,9 +67,25 @@ static struct omap_hwmod omap3xxx_gpio5_hwmod;
55static struct omap_hwmod omap3xxx_gpio6_hwmod; 67static struct omap_hwmod omap3xxx_gpio6_hwmod;
56static struct omap_hwmod omap34xx_sr1_hwmod; 68static struct omap_hwmod omap34xx_sr1_hwmod;
57static struct omap_hwmod omap34xx_sr2_hwmod; 69static struct omap_hwmod omap34xx_sr2_hwmod;
70static struct omap_hwmod omap34xx_mcspi1;
71static struct omap_hwmod omap34xx_mcspi2;
72static struct omap_hwmod omap34xx_mcspi3;
73static struct omap_hwmod omap34xx_mcspi4;
74static struct omap_hwmod omap3xxx_mmc1_hwmod;
75static struct omap_hwmod omap3xxx_mmc2_hwmod;
76static struct omap_hwmod omap3xxx_mmc3_hwmod;
77static struct omap_hwmod am35xx_usbhsotg_hwmod;
58 78
59static struct omap_hwmod omap3xxx_dma_system_hwmod; 79static struct omap_hwmod omap3xxx_dma_system_hwmod;
60 80
81static struct omap_hwmod omap3xxx_mcbsp1_hwmod;
82static struct omap_hwmod omap3xxx_mcbsp2_hwmod;
83static struct omap_hwmod omap3xxx_mcbsp3_hwmod;
84static struct omap_hwmod omap3xxx_mcbsp4_hwmod;
85static struct omap_hwmod omap3xxx_mcbsp5_hwmod;
86static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod;
87static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod;
88
61/* L3 -> L4_CORE interface */ 89/* L3 -> L4_CORE interface */
62static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { 90static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
63 .master = &omap3xxx_l3_main_hwmod, 91 .master = &omap3xxx_l3_main_hwmod,
@@ -72,10 +100,26 @@ static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_per = {
72 .user = OCP_USER_MPU | OCP_USER_SDMA, 100 .user = OCP_USER_MPU | OCP_USER_SDMA,
73}; 101};
74 102
103/* L3 taret configuration and error log registers */
104static struct omap_hwmod_irq_info omap3xxx_l3_main_irqs[] = {
105 { .irq = INT_34XX_L3_DBG_IRQ },
106 { .irq = INT_34XX_L3_APP_IRQ },
107};
108
109static struct omap_hwmod_addr_space omap3xxx_l3_main_addrs[] = {
110 {
111 .pa_start = 0x68000000,
112 .pa_end = 0x6800ffff,
113 .flags = ADDR_TYPE_RT,
114 },
115};
116
75/* MPU -> L3 interface */ 117/* MPU -> L3 interface */
76static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = { 118static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = {
77 .master = &omap3xxx_mpu_hwmod, 119 .master = &omap3xxx_mpu_hwmod,
78 .slave = &omap3xxx_l3_main_hwmod, 120 .slave = &omap3xxx_l3_main_hwmod,
121 .addr = omap3xxx_l3_main_addrs,
122 .addr_cnt = ARRAY_SIZE(omap3xxx_l3_main_addrs),
79 .user = OCP_USER_MPU, 123 .user = OCP_USER_MPU,
80}; 124};
81 125
@@ -84,6 +128,19 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_slaves[] = {
84 &omap3xxx_mpu__l3_main, 128 &omap3xxx_mpu__l3_main,
85}; 129};
86 130
131/* DSS -> l3 */
132static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
133 .master = &omap3xxx_dss_core_hwmod,
134 .slave = &omap3xxx_l3_main_hwmod,
135 .fw = {
136 .omap2 = {
137 .l3_perm_bit = OMAP3_L3_CORE_FW_INIT_ID_DSS,
138 .flags = OMAP_FIREWALL_L3,
139 }
140 },
141 .user = OCP_USER_MPU | OCP_USER_SDMA,
142};
143
87/* Master interfaces on the L3 interconnect */ 144/* Master interfaces on the L3 interconnect */
88static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = { 145static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
89 &omap3xxx_l3_main__l4_core, 146 &omap3xxx_l3_main__l4_core,
@@ -94,6 +151,8 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_main_masters[] = {
94static struct omap_hwmod omap3xxx_l3_main_hwmod = { 151static struct omap_hwmod omap3xxx_l3_main_hwmod = {
95 .name = "l3_main", 152 .name = "l3_main",
96 .class = &l3_hwmod_class, 153 .class = &l3_hwmod_class,
154 .mpu_irqs = omap3xxx_l3_main_irqs,
155 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_l3_main_irqs),
97 .masters = omap3xxx_l3_main_masters, 156 .masters = omap3xxx_l3_main_masters,
98 .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), 157 .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters),
99 .slaves = omap3xxx_l3_main_slaves, 158 .slaves = omap3xxx_l3_main_slaves,
@@ -107,7 +166,23 @@ static struct omap_hwmod omap3xxx_uart1_hwmod;
107static struct omap_hwmod omap3xxx_uart2_hwmod; 166static struct omap_hwmod omap3xxx_uart2_hwmod;
108static struct omap_hwmod omap3xxx_uart3_hwmod; 167static struct omap_hwmod omap3xxx_uart3_hwmod;
109static struct omap_hwmod omap3xxx_uart4_hwmod; 168static struct omap_hwmod omap3xxx_uart4_hwmod;
169static struct omap_hwmod omap3xxx_usbhsotg_hwmod;
110 170
171/* l3_core -> usbhsotg interface */
172static struct omap_hwmod_ocp_if omap3xxx_usbhsotg__l3 = {
173 .master = &omap3xxx_usbhsotg_hwmod,
174 .slave = &omap3xxx_l3_main_hwmod,
175 .clk = "core_l3_ick",
176 .user = OCP_USER_MPU,
177};
178
179/* l3_core -> am35xx_usbhsotg interface */
180static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = {
181 .master = &am35xx_usbhsotg_hwmod,
182 .slave = &omap3xxx_l3_main_hwmod,
183 .clk = "core_l3_ick",
184 .user = OCP_USER_MPU,
185};
111/* L4_CORE -> L4_WKUP interface */ 186/* L4_CORE -> L4_WKUP interface */
112static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { 187static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
113 .master = &omap3xxx_l4_core_hwmod, 188 .master = &omap3xxx_l4_core_hwmod,
@@ -115,6 +190,63 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
115 .user = OCP_USER_MPU | OCP_USER_SDMA, 190 .user = OCP_USER_MPU | OCP_USER_SDMA,
116}; 191};
117 192
193/* L4 CORE -> MMC1 interface */
194static struct omap_hwmod_addr_space omap3xxx_mmc1_addr_space[] = {
195 {
196 .pa_start = 0x4809c000,
197 .pa_end = 0x4809c1ff,
198 .flags = ADDR_TYPE_RT,
199 },
200};
201
202static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc1 = {
203 .master = &omap3xxx_l4_core_hwmod,
204 .slave = &omap3xxx_mmc1_hwmod,
205 .clk = "mmchs1_ick",
206 .addr = omap3xxx_mmc1_addr_space,
207 .addr_cnt = ARRAY_SIZE(omap3xxx_mmc1_addr_space),
208 .user = OCP_USER_MPU | OCP_USER_SDMA,
209 .flags = OMAP_FIREWALL_L4
210};
211
212/* L4 CORE -> MMC2 interface */
213static struct omap_hwmod_addr_space omap3xxx_mmc2_addr_space[] = {
214 {
215 .pa_start = 0x480b4000,
216 .pa_end = 0x480b41ff,
217 .flags = ADDR_TYPE_RT,
218 },
219};
220
221static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc2 = {
222 .master = &omap3xxx_l4_core_hwmod,
223 .slave = &omap3xxx_mmc2_hwmod,
224 .clk = "mmchs2_ick",
225 .addr = omap3xxx_mmc2_addr_space,
226 .addr_cnt = ARRAY_SIZE(omap3xxx_mmc2_addr_space),
227 .user = OCP_USER_MPU | OCP_USER_SDMA,
228 .flags = OMAP_FIREWALL_L4
229};
230
231/* L4 CORE -> MMC3 interface */
232static struct omap_hwmod_addr_space omap3xxx_mmc3_addr_space[] = {
233 {
234 .pa_start = 0x480ad000,
235 .pa_end = 0x480ad1ff,
236 .flags = ADDR_TYPE_RT,
237 },
238};
239
240static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc3 = {
241 .master = &omap3xxx_l4_core_hwmod,
242 .slave = &omap3xxx_mmc3_hwmod,
243 .clk = "mmchs3_ick",
244 .addr = omap3xxx_mmc3_addr_space,
245 .addr_cnt = ARRAY_SIZE(omap3xxx_mmc3_addr_space),
246 .user = OCP_USER_MPU | OCP_USER_SDMA,
247 .flags = OMAP_FIREWALL_L4
248};
249
118/* L4 CORE -> UART1 interface */ 250/* L4 CORE -> UART1 interface */
119static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = { 251static struct omap_hwmod_addr_space omap3xxx_uart1_addr_space[] = {
120 { 252 {
@@ -301,29 +433,70 @@ static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = {
301 .user = OCP_USER_MPU, 433 .user = OCP_USER_MPU,
302}; 434};
303 435
436/*
437* usbhsotg interface data
438*/
439
440static struct omap_hwmod_addr_space omap3xxx_usbhsotg_addrs[] = {
441 {
442 .pa_start = OMAP34XX_HSUSB_OTG_BASE,
443 .pa_end = OMAP34XX_HSUSB_OTG_BASE + SZ_4K - 1,
444 .flags = ADDR_TYPE_RT
445 },
446};
447
448/* l4_core -> usbhsotg */
449static struct omap_hwmod_ocp_if omap3xxx_l4_core__usbhsotg = {
450 .master = &omap3xxx_l4_core_hwmod,
451 .slave = &omap3xxx_usbhsotg_hwmod,
452 .clk = "l4_ick",
453 .addr = omap3xxx_usbhsotg_addrs,
454 .addr_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_addrs),
455 .user = OCP_USER_MPU,
456};
457
458static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_masters[] = {
459 &omap3xxx_usbhsotg__l3,
460};
461
462static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_slaves[] = {
463 &omap3xxx_l4_core__usbhsotg,
464};
465
466static struct omap_hwmod_addr_space am35xx_usbhsotg_addrs[] = {
467 {
468 .pa_start = AM35XX_IPSS_USBOTGSS_BASE,
469 .pa_end = AM35XX_IPSS_USBOTGSS_BASE + SZ_4K - 1,
470 .flags = ADDR_TYPE_RT
471 },
472};
473
474/* l4_core -> usbhsotg */
475static struct omap_hwmod_ocp_if am35xx_l4_core__usbhsotg = {
476 .master = &omap3xxx_l4_core_hwmod,
477 .slave = &am35xx_usbhsotg_hwmod,
478 .clk = "l4_ick",
479 .addr = am35xx_usbhsotg_addrs,
480 .addr_cnt = ARRAY_SIZE(am35xx_usbhsotg_addrs),
481 .user = OCP_USER_MPU,
482};
483
484static struct omap_hwmod_ocp_if *am35xx_usbhsotg_masters[] = {
485 &am35xx_usbhsotg__l3,
486};
487
488static struct omap_hwmod_ocp_if *am35xx_usbhsotg_slaves[] = {
489 &am35xx_l4_core__usbhsotg,
490};
304/* Slave interfaces on the L4_CORE interconnect */ 491/* Slave interfaces on the L4_CORE interconnect */
305static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { 492static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = {
306 &omap3xxx_l3_main__l4_core, 493 &omap3xxx_l3_main__l4_core,
307 &omap3_l4_core__sr1,
308 &omap3_l4_core__sr2,
309};
310
311/* Master interfaces on the L4_CORE interconnect */
312static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = {
313 &omap3xxx_l4_core__l4_wkup,
314 &omap3_l4_core__uart1,
315 &omap3_l4_core__uart2,
316 &omap3_l4_core__i2c1,
317 &omap3_l4_core__i2c2,
318 &omap3_l4_core__i2c3,
319}; 494};
320 495
321/* L4 CORE */ 496/* L4 CORE */
322static struct omap_hwmod omap3xxx_l4_core_hwmod = { 497static struct omap_hwmod omap3xxx_l4_core_hwmod = {
323 .name = "l4_core", 498 .name = "l4_core",
324 .class = &l4_hwmod_class, 499 .class = &l4_hwmod_class,
325 .masters = omap3xxx_l4_core_masters,
326 .masters_cnt = ARRAY_SIZE(omap3xxx_l4_core_masters),
327 .slaves = omap3xxx_l4_core_slaves, 500 .slaves = omap3xxx_l4_core_slaves,
328 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), 501 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves),
329 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 502 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -335,18 +508,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_slaves[] = {
335 &omap3xxx_l3_main__l4_per, 508 &omap3xxx_l3_main__l4_per,
336}; 509};
337 510
338/* Master interfaces on the L4_PER interconnect */
339static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = {
340 &omap3_l4_per__uart3,
341 &omap3_l4_per__uart4,
342};
343
344/* L4 PER */ 511/* L4 PER */
345static struct omap_hwmod omap3xxx_l4_per_hwmod = { 512static struct omap_hwmod omap3xxx_l4_per_hwmod = {
346 .name = "l4_per", 513 .name = "l4_per",
347 .class = &l4_hwmod_class, 514 .class = &l4_hwmod_class,
348 .masters = omap3xxx_l4_per_masters,
349 .masters_cnt = ARRAY_SIZE(omap3xxx_l4_per_masters),
350 .slaves = omap3xxx_l4_per_slaves, 515 .slaves = omap3xxx_l4_per_slaves,
351 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), 516 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves),
352 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -358,16 +523,10 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_slaves[] = {
358 &omap3xxx_l4_core__l4_wkup, 523 &omap3xxx_l4_core__l4_wkup,
359}; 524};
360 525
361/* Master interfaces on the L4_WKUP interconnect */
362static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = {
363};
364
365/* L4 WKUP */ 526/* L4 WKUP */
366static struct omap_hwmod omap3xxx_l4_wkup_hwmod = { 527static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
367 .name = "l4_wkup", 528 .name = "l4_wkup",
368 .class = &l4_hwmod_class, 529 .class = &l4_hwmod_class,
369 .masters = omap3xxx_l4_wkup_masters,
370 .masters_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_masters),
371 .slaves = omap3xxx_l4_wkup_slaves, 530 .slaves = omap3xxx_l4_wkup_slaves,
372 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), 531 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves),
373 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 532 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
@@ -417,6 +576,640 @@ static struct omap_hwmod omap3xxx_iva_hwmod = {
417 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) 576 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
418}; 577};
419 578
579/* timer class */
580static struct omap_hwmod_class_sysconfig omap3xxx_timer_1ms_sysc = {
581 .rev_offs = 0x0000,
582 .sysc_offs = 0x0010,
583 .syss_offs = 0x0014,
584 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
585 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
586 SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE),
587 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
588 .sysc_fields = &omap_hwmod_sysc_type1,
589};
590
591static struct omap_hwmod_class omap3xxx_timer_1ms_hwmod_class = {
592 .name = "timer",
593 .sysc = &omap3xxx_timer_1ms_sysc,
594 .rev = OMAP_TIMER_IP_VERSION_1,
595};
596
597static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = {
598 .rev_offs = 0x0000,
599 .sysc_offs = 0x0010,
600 .syss_offs = 0x0014,
601 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
602 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
603 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
604 .sysc_fields = &omap_hwmod_sysc_type1,
605};
606
607static struct omap_hwmod_class omap3xxx_timer_hwmod_class = {
608 .name = "timer",
609 .sysc = &omap3xxx_timer_sysc,
610 .rev = OMAP_TIMER_IP_VERSION_1,
611};
612
613/* timer1 */
614static struct omap_hwmod omap3xxx_timer1_hwmod;
615static struct omap_hwmod_irq_info omap3xxx_timer1_mpu_irqs[] = {
616 { .irq = 37, },
617};
618
619static struct omap_hwmod_addr_space omap3xxx_timer1_addrs[] = {
620 {
621 .pa_start = 0x48318000,
622 .pa_end = 0x48318000 + SZ_1K - 1,
623 .flags = ADDR_TYPE_RT
624 },
625};
626
627/* l4_wkup -> timer1 */
628static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__timer1 = {
629 .master = &omap3xxx_l4_wkup_hwmod,
630 .slave = &omap3xxx_timer1_hwmod,
631 .clk = "gpt1_ick",
632 .addr = omap3xxx_timer1_addrs,
633 .addr_cnt = ARRAY_SIZE(omap3xxx_timer1_addrs),
634 .user = OCP_USER_MPU | OCP_USER_SDMA,
635};
636
637/* timer1 slave port */
638static struct omap_hwmod_ocp_if *omap3xxx_timer1_slaves[] = {
639 &omap3xxx_l4_wkup__timer1,
640};
641
642/* timer1 hwmod */
643static struct omap_hwmod omap3xxx_timer1_hwmod = {
644 .name = "timer1",
645 .mpu_irqs = omap3xxx_timer1_mpu_irqs,
646 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer1_mpu_irqs),
647 .main_clk = "gpt1_fck",
648 .prcm = {
649 .omap2 = {
650 .prcm_reg_id = 1,
651 .module_bit = OMAP3430_EN_GPT1_SHIFT,
652 .module_offs = WKUP_MOD,
653 .idlest_reg_id = 1,
654 .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT,
655 },
656 },
657 .slaves = omap3xxx_timer1_slaves,
658 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves),
659 .class = &omap3xxx_timer_1ms_hwmod_class,
660 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
661};
662
663/* timer2 */
664static struct omap_hwmod omap3xxx_timer2_hwmod;
665static struct omap_hwmod_irq_info omap3xxx_timer2_mpu_irqs[] = {
666 { .irq = 38, },
667};
668
669static struct omap_hwmod_addr_space omap3xxx_timer2_addrs[] = {
670 {
671 .pa_start = 0x49032000,
672 .pa_end = 0x49032000 + SZ_1K - 1,
673 .flags = ADDR_TYPE_RT
674 },
675};
676
677/* l4_per -> timer2 */
678static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer2 = {
679 .master = &omap3xxx_l4_per_hwmod,
680 .slave = &omap3xxx_timer2_hwmod,
681 .clk = "gpt2_ick",
682 .addr = omap3xxx_timer2_addrs,
683 .addr_cnt = ARRAY_SIZE(omap3xxx_timer2_addrs),
684 .user = OCP_USER_MPU | OCP_USER_SDMA,
685};
686
687/* timer2 slave port */
688static struct omap_hwmod_ocp_if *omap3xxx_timer2_slaves[] = {
689 &omap3xxx_l4_per__timer2,
690};
691
692/* timer2 hwmod */
693static struct omap_hwmod omap3xxx_timer2_hwmod = {
694 .name = "timer2",
695 .mpu_irqs = omap3xxx_timer2_mpu_irqs,
696 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer2_mpu_irqs),
697 .main_clk = "gpt2_fck",
698 .prcm = {
699 .omap2 = {
700 .prcm_reg_id = 1,
701 .module_bit = OMAP3430_EN_GPT2_SHIFT,
702 .module_offs = OMAP3430_PER_MOD,
703 .idlest_reg_id = 1,
704 .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT,
705 },
706 },
707 .slaves = omap3xxx_timer2_slaves,
708 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves),
709 .class = &omap3xxx_timer_1ms_hwmod_class,
710 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
711};
712
713/* timer3 */
714static struct omap_hwmod omap3xxx_timer3_hwmod;
715static struct omap_hwmod_irq_info omap3xxx_timer3_mpu_irqs[] = {
716 { .irq = 39, },
717};
718
719static struct omap_hwmod_addr_space omap3xxx_timer3_addrs[] = {
720 {
721 .pa_start = 0x49034000,
722 .pa_end = 0x49034000 + SZ_1K - 1,
723 .flags = ADDR_TYPE_RT
724 },
725};
726
727/* l4_per -> timer3 */
728static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer3 = {
729 .master = &omap3xxx_l4_per_hwmod,
730 .slave = &omap3xxx_timer3_hwmod,
731 .clk = "gpt3_ick",
732 .addr = omap3xxx_timer3_addrs,
733 .addr_cnt = ARRAY_SIZE(omap3xxx_timer3_addrs),
734 .user = OCP_USER_MPU | OCP_USER_SDMA,
735};
736
737/* timer3 slave port */
738static struct omap_hwmod_ocp_if *omap3xxx_timer3_slaves[] = {
739 &omap3xxx_l4_per__timer3,
740};
741
742/* timer3 hwmod */
743static struct omap_hwmod omap3xxx_timer3_hwmod = {
744 .name = "timer3",
745 .mpu_irqs = omap3xxx_timer3_mpu_irqs,
746 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer3_mpu_irqs),
747 .main_clk = "gpt3_fck",
748 .prcm = {
749 .omap2 = {
750 .prcm_reg_id = 1,
751 .module_bit = OMAP3430_EN_GPT3_SHIFT,
752 .module_offs = OMAP3430_PER_MOD,
753 .idlest_reg_id = 1,
754 .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT,
755 },
756 },
757 .slaves = omap3xxx_timer3_slaves,
758 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves),
759 .class = &omap3xxx_timer_hwmod_class,
760 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
761};
762
763/* timer4 */
764static struct omap_hwmod omap3xxx_timer4_hwmod;
765static struct omap_hwmod_irq_info omap3xxx_timer4_mpu_irqs[] = {
766 { .irq = 40, },
767};
768
769static struct omap_hwmod_addr_space omap3xxx_timer4_addrs[] = {
770 {
771 .pa_start = 0x49036000,
772 .pa_end = 0x49036000 + SZ_1K - 1,
773 .flags = ADDR_TYPE_RT
774 },
775};
776
777/* l4_per -> timer4 */
778static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer4 = {
779 .master = &omap3xxx_l4_per_hwmod,
780 .slave = &omap3xxx_timer4_hwmod,
781 .clk = "gpt4_ick",
782 .addr = omap3xxx_timer4_addrs,
783 .addr_cnt = ARRAY_SIZE(omap3xxx_timer4_addrs),
784 .user = OCP_USER_MPU | OCP_USER_SDMA,
785};
786
787/* timer4 slave port */
788static struct omap_hwmod_ocp_if *omap3xxx_timer4_slaves[] = {
789 &omap3xxx_l4_per__timer4,
790};
791
792/* timer4 hwmod */
793static struct omap_hwmod omap3xxx_timer4_hwmod = {
794 .name = "timer4",
795 .mpu_irqs = omap3xxx_timer4_mpu_irqs,
796 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer4_mpu_irqs),
797 .main_clk = "gpt4_fck",
798 .prcm = {
799 .omap2 = {
800 .prcm_reg_id = 1,
801 .module_bit = OMAP3430_EN_GPT4_SHIFT,
802 .module_offs = OMAP3430_PER_MOD,
803 .idlest_reg_id = 1,
804 .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT,
805 },
806 },
807 .slaves = omap3xxx_timer4_slaves,
808 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves),
809 .class = &omap3xxx_timer_hwmod_class,
810 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
811};
812
813/* timer5 */
814static struct omap_hwmod omap3xxx_timer5_hwmod;
815static struct omap_hwmod_irq_info omap3xxx_timer5_mpu_irqs[] = {
816 { .irq = 41, },
817};
818
819static struct omap_hwmod_addr_space omap3xxx_timer5_addrs[] = {
820 {
821 .pa_start = 0x49038000,
822 .pa_end = 0x49038000 + SZ_1K - 1,
823 .flags = ADDR_TYPE_RT
824 },
825};
826
827/* l4_per -> timer5 */
828static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer5 = {
829 .master = &omap3xxx_l4_per_hwmod,
830 .slave = &omap3xxx_timer5_hwmod,
831 .clk = "gpt5_ick",
832 .addr = omap3xxx_timer5_addrs,
833 .addr_cnt = ARRAY_SIZE(omap3xxx_timer5_addrs),
834 .user = OCP_USER_MPU | OCP_USER_SDMA,
835};
836
837/* timer5 slave port */
838static struct omap_hwmod_ocp_if *omap3xxx_timer5_slaves[] = {
839 &omap3xxx_l4_per__timer5,
840};
841
842/* timer5 hwmod */
843static struct omap_hwmod omap3xxx_timer5_hwmod = {
844 .name = "timer5",
845 .mpu_irqs = omap3xxx_timer5_mpu_irqs,
846 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer5_mpu_irqs),
847 .main_clk = "gpt5_fck",
848 .prcm = {
849 .omap2 = {
850 .prcm_reg_id = 1,
851 .module_bit = OMAP3430_EN_GPT5_SHIFT,
852 .module_offs = OMAP3430_PER_MOD,
853 .idlest_reg_id = 1,
854 .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT,
855 },
856 },
857 .slaves = omap3xxx_timer5_slaves,
858 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves),
859 .class = &omap3xxx_timer_hwmod_class,
860 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
861};
862
863/* timer6 */
864static struct omap_hwmod omap3xxx_timer6_hwmod;
865static struct omap_hwmod_irq_info omap3xxx_timer6_mpu_irqs[] = {
866 { .irq = 42, },
867};
868
869static struct omap_hwmod_addr_space omap3xxx_timer6_addrs[] = {
870 {
871 .pa_start = 0x4903A000,
872 .pa_end = 0x4903A000 + SZ_1K - 1,
873 .flags = ADDR_TYPE_RT
874 },
875};
876
877/* l4_per -> timer6 */
878static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer6 = {
879 .master = &omap3xxx_l4_per_hwmod,
880 .slave = &omap3xxx_timer6_hwmod,
881 .clk = "gpt6_ick",
882 .addr = omap3xxx_timer6_addrs,
883 .addr_cnt = ARRAY_SIZE(omap3xxx_timer6_addrs),
884 .user = OCP_USER_MPU | OCP_USER_SDMA,
885};
886
887/* timer6 slave port */
888static struct omap_hwmod_ocp_if *omap3xxx_timer6_slaves[] = {
889 &omap3xxx_l4_per__timer6,
890};
891
892/* timer6 hwmod */
893static struct omap_hwmod omap3xxx_timer6_hwmod = {
894 .name = "timer6",
895 .mpu_irqs = omap3xxx_timer6_mpu_irqs,
896 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer6_mpu_irqs),
897 .main_clk = "gpt6_fck",
898 .prcm = {
899 .omap2 = {
900 .prcm_reg_id = 1,
901 .module_bit = OMAP3430_EN_GPT6_SHIFT,
902 .module_offs = OMAP3430_PER_MOD,
903 .idlest_reg_id = 1,
904 .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT,
905 },
906 },
907 .slaves = omap3xxx_timer6_slaves,
908 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves),
909 .class = &omap3xxx_timer_hwmod_class,
910 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
911};
912
913/* timer7 */
914static struct omap_hwmod omap3xxx_timer7_hwmod;
915static struct omap_hwmod_irq_info omap3xxx_timer7_mpu_irqs[] = {
916 { .irq = 43, },
917};
918
919static struct omap_hwmod_addr_space omap3xxx_timer7_addrs[] = {
920 {
921 .pa_start = 0x4903C000,
922 .pa_end = 0x4903C000 + SZ_1K - 1,
923 .flags = ADDR_TYPE_RT
924 },
925};
926
927/* l4_per -> timer7 */
928static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer7 = {
929 .master = &omap3xxx_l4_per_hwmod,
930 .slave = &omap3xxx_timer7_hwmod,
931 .clk = "gpt7_ick",
932 .addr = omap3xxx_timer7_addrs,
933 .addr_cnt = ARRAY_SIZE(omap3xxx_timer7_addrs),
934 .user = OCP_USER_MPU | OCP_USER_SDMA,
935};
936
937/* timer7 slave port */
938static struct omap_hwmod_ocp_if *omap3xxx_timer7_slaves[] = {
939 &omap3xxx_l4_per__timer7,
940};
941
942/* timer7 hwmod */
943static struct omap_hwmod omap3xxx_timer7_hwmod = {
944 .name = "timer7",
945 .mpu_irqs = omap3xxx_timer7_mpu_irqs,
946 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer7_mpu_irqs),
947 .main_clk = "gpt7_fck",
948 .prcm = {
949 .omap2 = {
950 .prcm_reg_id = 1,
951 .module_bit = OMAP3430_EN_GPT7_SHIFT,
952 .module_offs = OMAP3430_PER_MOD,
953 .idlest_reg_id = 1,
954 .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT,
955 },
956 },
957 .slaves = omap3xxx_timer7_slaves,
958 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves),
959 .class = &omap3xxx_timer_hwmod_class,
960 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
961};
962
963/* timer8 */
964static struct omap_hwmod omap3xxx_timer8_hwmod;
965static struct omap_hwmod_irq_info omap3xxx_timer8_mpu_irqs[] = {
966 { .irq = 44, },
967};
968
969static struct omap_hwmod_addr_space omap3xxx_timer8_addrs[] = {
970 {
971 .pa_start = 0x4903E000,
972 .pa_end = 0x4903E000 + SZ_1K - 1,
973 .flags = ADDR_TYPE_RT
974 },
975};
976
977/* l4_per -> timer8 */
978static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer8 = {
979 .master = &omap3xxx_l4_per_hwmod,
980 .slave = &omap3xxx_timer8_hwmod,
981 .clk = "gpt8_ick",
982 .addr = omap3xxx_timer8_addrs,
983 .addr_cnt = ARRAY_SIZE(omap3xxx_timer8_addrs),
984 .user = OCP_USER_MPU | OCP_USER_SDMA,
985};
986
987/* timer8 slave port */
988static struct omap_hwmod_ocp_if *omap3xxx_timer8_slaves[] = {
989 &omap3xxx_l4_per__timer8,
990};
991
992/* timer8 hwmod */
993static struct omap_hwmod omap3xxx_timer8_hwmod = {
994 .name = "timer8",
995 .mpu_irqs = omap3xxx_timer8_mpu_irqs,
996 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer8_mpu_irqs),
997 .main_clk = "gpt8_fck",
998 .prcm = {
999 .omap2 = {
1000 .prcm_reg_id = 1,
1001 .module_bit = OMAP3430_EN_GPT8_SHIFT,
1002 .module_offs = OMAP3430_PER_MOD,
1003 .idlest_reg_id = 1,
1004 .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT,
1005 },
1006 },
1007 .slaves = omap3xxx_timer8_slaves,
1008 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves),
1009 .class = &omap3xxx_timer_hwmod_class,
1010 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1011};
1012
1013/* timer9 */
1014static struct omap_hwmod omap3xxx_timer9_hwmod;
1015static struct omap_hwmod_irq_info omap3xxx_timer9_mpu_irqs[] = {
1016 { .irq = 45, },
1017};
1018
1019static struct omap_hwmod_addr_space omap3xxx_timer9_addrs[] = {
1020 {
1021 .pa_start = 0x49040000,
1022 .pa_end = 0x49040000 + SZ_1K - 1,
1023 .flags = ADDR_TYPE_RT
1024 },
1025};
1026
1027/* l4_per -> timer9 */
1028static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer9 = {
1029 .master = &omap3xxx_l4_per_hwmod,
1030 .slave = &omap3xxx_timer9_hwmod,
1031 .clk = "gpt9_ick",
1032 .addr = omap3xxx_timer9_addrs,
1033 .addr_cnt = ARRAY_SIZE(omap3xxx_timer9_addrs),
1034 .user = OCP_USER_MPU | OCP_USER_SDMA,
1035};
1036
1037/* timer9 slave port */
1038static struct omap_hwmod_ocp_if *omap3xxx_timer9_slaves[] = {
1039 &omap3xxx_l4_per__timer9,
1040};
1041
1042/* timer9 hwmod */
1043static struct omap_hwmod omap3xxx_timer9_hwmod = {
1044 .name = "timer9",
1045 .mpu_irqs = omap3xxx_timer9_mpu_irqs,
1046 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer9_mpu_irqs),
1047 .main_clk = "gpt9_fck",
1048 .prcm = {
1049 .omap2 = {
1050 .prcm_reg_id = 1,
1051 .module_bit = OMAP3430_EN_GPT9_SHIFT,
1052 .module_offs = OMAP3430_PER_MOD,
1053 .idlest_reg_id = 1,
1054 .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT,
1055 },
1056 },
1057 .slaves = omap3xxx_timer9_slaves,
1058 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves),
1059 .class = &omap3xxx_timer_hwmod_class,
1060 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1061};
1062
1063/* timer10 */
1064static struct omap_hwmod omap3xxx_timer10_hwmod;
1065static struct omap_hwmod_irq_info omap3xxx_timer10_mpu_irqs[] = {
1066 { .irq = 46, },
1067};
1068
1069static struct omap_hwmod_addr_space omap3xxx_timer10_addrs[] = {
1070 {
1071 .pa_start = 0x48086000,
1072 .pa_end = 0x48086000 + SZ_1K - 1,
1073 .flags = ADDR_TYPE_RT
1074 },
1075};
1076
1077/* l4_core -> timer10 */
1078static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer10 = {
1079 .master = &omap3xxx_l4_core_hwmod,
1080 .slave = &omap3xxx_timer10_hwmod,
1081 .clk = "gpt10_ick",
1082 .addr = omap3xxx_timer10_addrs,
1083 .addr_cnt = ARRAY_SIZE(omap3xxx_timer10_addrs),
1084 .user = OCP_USER_MPU | OCP_USER_SDMA,
1085};
1086
1087/* timer10 slave port */
1088static struct omap_hwmod_ocp_if *omap3xxx_timer10_slaves[] = {
1089 &omap3xxx_l4_core__timer10,
1090};
1091
1092/* timer10 hwmod */
1093static struct omap_hwmod omap3xxx_timer10_hwmod = {
1094 .name = "timer10",
1095 .mpu_irqs = omap3xxx_timer10_mpu_irqs,
1096 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer10_mpu_irqs),
1097 .main_clk = "gpt10_fck",
1098 .prcm = {
1099 .omap2 = {
1100 .prcm_reg_id = 1,
1101 .module_bit = OMAP3430_EN_GPT10_SHIFT,
1102 .module_offs = CORE_MOD,
1103 .idlest_reg_id = 1,
1104 .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT,
1105 },
1106 },
1107 .slaves = omap3xxx_timer10_slaves,
1108 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves),
1109 .class = &omap3xxx_timer_1ms_hwmod_class,
1110 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1111};
1112
1113/* timer11 */
1114static struct omap_hwmod omap3xxx_timer11_hwmod;
1115static struct omap_hwmod_irq_info omap3xxx_timer11_mpu_irqs[] = {
1116 { .irq = 47, },
1117};
1118
1119static struct omap_hwmod_addr_space omap3xxx_timer11_addrs[] = {
1120 {
1121 .pa_start = 0x48088000,
1122 .pa_end = 0x48088000 + SZ_1K - 1,
1123 .flags = ADDR_TYPE_RT
1124 },
1125};
1126
1127/* l4_core -> timer11 */
1128static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer11 = {
1129 .master = &omap3xxx_l4_core_hwmod,
1130 .slave = &omap3xxx_timer11_hwmod,
1131 .clk = "gpt11_ick",
1132 .addr = omap3xxx_timer11_addrs,
1133 .addr_cnt = ARRAY_SIZE(omap3xxx_timer11_addrs),
1134 .user = OCP_USER_MPU | OCP_USER_SDMA,
1135};
1136
1137/* timer11 slave port */
1138static struct omap_hwmod_ocp_if *omap3xxx_timer11_slaves[] = {
1139 &omap3xxx_l4_core__timer11,
1140};
1141
1142/* timer11 hwmod */
1143static struct omap_hwmod omap3xxx_timer11_hwmod = {
1144 .name = "timer11",
1145 .mpu_irqs = omap3xxx_timer11_mpu_irqs,
1146 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer11_mpu_irqs),
1147 .main_clk = "gpt11_fck",
1148 .prcm = {
1149 .omap2 = {
1150 .prcm_reg_id = 1,
1151 .module_bit = OMAP3430_EN_GPT11_SHIFT,
1152 .module_offs = CORE_MOD,
1153 .idlest_reg_id = 1,
1154 .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT,
1155 },
1156 },
1157 .slaves = omap3xxx_timer11_slaves,
1158 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves),
1159 .class = &omap3xxx_timer_hwmod_class,
1160 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1161};
1162
1163/* timer12*/
1164static struct omap_hwmod omap3xxx_timer12_hwmod;
1165static struct omap_hwmod_irq_info omap3xxx_timer12_mpu_irqs[] = {
1166 { .irq = 95, },
1167};
1168
1169static struct omap_hwmod_addr_space omap3xxx_timer12_addrs[] = {
1170 {
1171 .pa_start = 0x48304000,
1172 .pa_end = 0x48304000 + SZ_1K - 1,
1173 .flags = ADDR_TYPE_RT
1174 },
1175};
1176
1177/* l4_core -> timer12 */
1178static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer12 = {
1179 .master = &omap3xxx_l4_core_hwmod,
1180 .slave = &omap3xxx_timer12_hwmod,
1181 .clk = "gpt12_ick",
1182 .addr = omap3xxx_timer12_addrs,
1183 .addr_cnt = ARRAY_SIZE(omap3xxx_timer12_addrs),
1184 .user = OCP_USER_MPU | OCP_USER_SDMA,
1185};
1186
1187/* timer12 slave port */
1188static struct omap_hwmod_ocp_if *omap3xxx_timer12_slaves[] = {
1189 &omap3xxx_l4_core__timer12,
1190};
1191
1192/* timer12 hwmod */
1193static struct omap_hwmod omap3xxx_timer12_hwmod = {
1194 .name = "timer12",
1195 .mpu_irqs = omap3xxx_timer12_mpu_irqs,
1196 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_timer12_mpu_irqs),
1197 .main_clk = "gpt12_fck",
1198 .prcm = {
1199 .omap2 = {
1200 .prcm_reg_id = 1,
1201 .module_bit = OMAP3430_EN_GPT12_SHIFT,
1202 .module_offs = WKUP_MOD,
1203 .idlest_reg_id = 1,
1204 .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT,
1205 },
1206 },
1207 .slaves = omap3xxx_timer12_slaves,
1208 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves),
1209 .class = &omap3xxx_timer_hwmod_class,
1210 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1211};
1212
420/* l4_wkup -> wd_timer2 */ 1213/* l4_wkup -> wd_timer2 */
421static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = { 1214static struct omap_hwmod_addr_space omap3xxx_wd_timer2_addrs[] = {
422 { 1215 {
@@ -491,6 +1284,11 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = {
491 .slaves = omap3xxx_wd_timer2_slaves, 1284 .slaves = omap3xxx_wd_timer2_slaves,
492 .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), 1285 .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves),
493 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 1286 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1287 /*
1288 * XXX: Use software supervised mode, HW supervised smartidle seems to
1289 * block CORE power domain idle transitions. Maybe a HW bug in wdt2?
1290 */
1291 .flags = HWMOD_SWSUP_SIDLE,
494}; 1292};
495 1293
496/* UART common */ 1294/* UART common */
@@ -664,6 +1462,411 @@ static struct omap_hwmod_class i2c_class = {
664 .sysc = &i2c_sysc, 1462 .sysc = &i2c_sysc,
665}; 1463};
666 1464
1465/*
1466 * 'dss' class
1467 * display sub-system
1468 */
1469
1470static struct omap_hwmod_class_sysconfig omap3xxx_dss_sysc = {
1471 .rev_offs = 0x0000,
1472 .sysc_offs = 0x0010,
1473 .syss_offs = 0x0014,
1474 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1475 .sysc_fields = &omap_hwmod_sysc_type1,
1476};
1477
1478static struct omap_hwmod_class omap3xxx_dss_hwmod_class = {
1479 .name = "dss",
1480 .sysc = &omap3xxx_dss_sysc,
1481};
1482
1483/* dss */
1484static struct omap_hwmod_irq_info omap3xxx_dss_irqs[] = {
1485 { .irq = 25 },
1486};
1487
1488static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = {
1489 { .name = "dispc", .dma_req = 5 },
1490 { .name = "dsi1", .dma_req = 74 },
1491};
1492
1493/* dss */
1494/* dss master ports */
1495static struct omap_hwmod_ocp_if *omap3xxx_dss_masters[] = {
1496 &omap3xxx_dss__l3,
1497};
1498
1499static struct omap_hwmod_addr_space omap3xxx_dss_addrs[] = {
1500 {
1501 .pa_start = 0x48050000,
1502 .pa_end = 0x480503FF,
1503 .flags = ADDR_TYPE_RT
1504 },
1505};
1506
1507/* l4_core -> dss */
1508static struct omap_hwmod_ocp_if omap3430es1_l4_core__dss = {
1509 .master = &omap3xxx_l4_core_hwmod,
1510 .slave = &omap3430es1_dss_core_hwmod,
1511 .clk = "dss_ick",
1512 .addr = omap3xxx_dss_addrs,
1513 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_addrs),
1514 .fw = {
1515 .omap2 = {
1516 .l4_fw_region = OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION,
1517 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1518 .flags = OMAP_FIREWALL_L4,
1519 }
1520 },
1521 .user = OCP_USER_MPU | OCP_USER_SDMA,
1522};
1523
1524static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
1525 .master = &omap3xxx_l4_core_hwmod,
1526 .slave = &omap3xxx_dss_core_hwmod,
1527 .clk = "dss_ick",
1528 .addr = omap3xxx_dss_addrs,
1529 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_addrs),
1530 .fw = {
1531 .omap2 = {
1532 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_CORE_REGION,
1533 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1534 .flags = OMAP_FIREWALL_L4,
1535 }
1536 },
1537 .user = OCP_USER_MPU | OCP_USER_SDMA,
1538};
1539
1540/* dss slave ports */
1541static struct omap_hwmod_ocp_if *omap3430es1_dss_slaves[] = {
1542 &omap3430es1_l4_core__dss,
1543};
1544
1545static struct omap_hwmod_ocp_if *omap3xxx_dss_slaves[] = {
1546 &omap3xxx_l4_core__dss,
1547};
1548
1549static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1550 { .role = "tv_clk", .clk = "dss_tv_fck" },
1551 { .role = "dssclk", .clk = "dss_96m_fck" },
1552 { .role = "sys_clk", .clk = "dss2_alwon_fck" },
1553};
1554
1555static struct omap_hwmod omap3430es1_dss_core_hwmod = {
1556 .name = "dss_core",
1557 .class = &omap3xxx_dss_hwmod_class,
1558 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
1559 .mpu_irqs = omap3xxx_dss_irqs,
1560 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_dss_irqs),
1561 .sdma_reqs = omap3xxx_dss_sdma_chs,
1562 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_dss_sdma_chs),
1563
1564 .prcm = {
1565 .omap2 = {
1566 .prcm_reg_id = 1,
1567 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1568 .module_offs = OMAP3430_DSS_MOD,
1569 .idlest_reg_id = 1,
1570 .idlest_stdby_bit = OMAP3430ES1_ST_DSS_SHIFT,
1571 },
1572 },
1573 .opt_clks = dss_opt_clks,
1574 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1575 .slaves = omap3430es1_dss_slaves,
1576 .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves),
1577 .masters = omap3xxx_dss_masters,
1578 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
1579 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
1580 .flags = HWMOD_NO_IDLEST,
1581};
1582
1583static struct omap_hwmod omap3xxx_dss_core_hwmod = {
1584 .name = "dss_core",
1585 .class = &omap3xxx_dss_hwmod_class,
1586 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
1587 .mpu_irqs = omap3xxx_dss_irqs,
1588 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_dss_irqs),
1589 .sdma_reqs = omap3xxx_dss_sdma_chs,
1590 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_dss_sdma_chs),
1591
1592 .prcm = {
1593 .omap2 = {
1594 .prcm_reg_id = 1,
1595 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1596 .module_offs = OMAP3430_DSS_MOD,
1597 .idlest_reg_id = 1,
1598 .idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
1599 .idlest_stdby_bit = OMAP3430ES2_ST_DSS_STDBY_SHIFT,
1600 },
1601 },
1602 .opt_clks = dss_opt_clks,
1603 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1604 .slaves = omap3xxx_dss_slaves,
1605 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves),
1606 .masters = omap3xxx_dss_masters,
1607 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
1608 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2 |
1609 CHIP_IS_OMAP3630ES1 | CHIP_GE_OMAP3630ES1_1),
1610};
1611
1612/*
1613 * 'dispc' class
1614 * display controller
1615 */
1616
1617static struct omap_hwmod_class_sysconfig omap3xxx_dispc_sysc = {
1618 .rev_offs = 0x0000,
1619 .sysc_offs = 0x0010,
1620 .syss_offs = 0x0014,
1621 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
1622 SYSC_HAS_MIDLEMODE | SYSC_HAS_ENAWAKEUP |
1623 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1624 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1625 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1626 .sysc_fields = &omap_hwmod_sysc_type1,
1627};
1628
1629static struct omap_hwmod_class omap3xxx_dispc_hwmod_class = {
1630 .name = "dispc",
1631 .sysc = &omap3xxx_dispc_sysc,
1632};
1633
1634static struct omap_hwmod_addr_space omap3xxx_dss_dispc_addrs[] = {
1635 {
1636 .pa_start = 0x48050400,
1637 .pa_end = 0x480507FF,
1638 .flags = ADDR_TYPE_RT
1639 },
1640};
1641
1642/* l4_core -> dss_dispc */
1643static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dispc = {
1644 .master = &omap3xxx_l4_core_hwmod,
1645 .slave = &omap3xxx_dss_dispc_hwmod,
1646 .clk = "dss_ick",
1647 .addr = omap3xxx_dss_dispc_addrs,
1648 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_addrs),
1649 .fw = {
1650 .omap2 = {
1651 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DISPC_REGION,
1652 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1653 .flags = OMAP_FIREWALL_L4,
1654 }
1655 },
1656 .user = OCP_USER_MPU | OCP_USER_SDMA,
1657};
1658
1659/* dss_dispc slave ports */
1660static struct omap_hwmod_ocp_if *omap3xxx_dss_dispc_slaves[] = {
1661 &omap3xxx_l4_core__dss_dispc,
1662};
1663
1664static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
1665 .name = "dss_dispc",
1666 .class = &omap3xxx_dispc_hwmod_class,
1667 .main_clk = "dss1_alwon_fck",
1668 .prcm = {
1669 .omap2 = {
1670 .prcm_reg_id = 1,
1671 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1672 .module_offs = OMAP3430_DSS_MOD,
1673 },
1674 },
1675 .slaves = omap3xxx_dss_dispc_slaves,
1676 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves),
1677 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1678 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1679 CHIP_GE_OMAP3630ES1_1),
1680 .flags = HWMOD_NO_IDLEST,
1681};
1682
1683/*
1684 * 'dsi' class
1685 * display serial interface controller
1686 */
1687
1688static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
1689 .name = "dsi",
1690};
1691
1692/* dss_dsi1 */
1693static struct omap_hwmod_addr_space omap3xxx_dss_dsi1_addrs[] = {
1694 {
1695 .pa_start = 0x4804FC00,
1696 .pa_end = 0x4804FFFF,
1697 .flags = ADDR_TYPE_RT
1698 },
1699};
1700
1701/* l4_core -> dss_dsi1 */
1702static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dsi1 = {
1703 .master = &omap3xxx_l4_core_hwmod,
1704 .slave = &omap3xxx_dss_dsi1_hwmod,
1705 .addr = omap3xxx_dss_dsi1_addrs,
1706 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_addrs),
1707 .fw = {
1708 .omap2 = {
1709 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DSI_REGION,
1710 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1711 .flags = OMAP_FIREWALL_L4,
1712 }
1713 },
1714 .user = OCP_USER_MPU | OCP_USER_SDMA,
1715};
1716
1717/* dss_dsi1 slave ports */
1718static struct omap_hwmod_ocp_if *omap3xxx_dss_dsi1_slaves[] = {
1719 &omap3xxx_l4_core__dss_dsi1,
1720};
1721
1722static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = {
1723 .name = "dss_dsi1",
1724 .class = &omap3xxx_dsi_hwmod_class,
1725 .main_clk = "dss1_alwon_fck",
1726 .prcm = {
1727 .omap2 = {
1728 .prcm_reg_id = 1,
1729 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1730 .module_offs = OMAP3430_DSS_MOD,
1731 },
1732 },
1733 .slaves = omap3xxx_dss_dsi1_slaves,
1734 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves),
1735 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1736 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1737 CHIP_GE_OMAP3630ES1_1),
1738 .flags = HWMOD_NO_IDLEST,
1739};
1740
1741/*
1742 * 'rfbi' class
1743 * remote frame buffer interface
1744 */
1745
1746static struct omap_hwmod_class_sysconfig omap3xxx_rfbi_sysc = {
1747 .rev_offs = 0x0000,
1748 .sysc_offs = 0x0010,
1749 .syss_offs = 0x0014,
1750 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1751 SYSC_HAS_AUTOIDLE),
1752 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1753 .sysc_fields = &omap_hwmod_sysc_type1,
1754};
1755
1756static struct omap_hwmod_class omap3xxx_rfbi_hwmod_class = {
1757 .name = "rfbi",
1758 .sysc = &omap3xxx_rfbi_sysc,
1759};
1760
1761static struct omap_hwmod_addr_space omap3xxx_dss_rfbi_addrs[] = {
1762 {
1763 .pa_start = 0x48050800,
1764 .pa_end = 0x48050BFF,
1765 .flags = ADDR_TYPE_RT
1766 },
1767};
1768
1769/* l4_core -> dss_rfbi */
1770static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_rfbi = {
1771 .master = &omap3xxx_l4_core_hwmod,
1772 .slave = &omap3xxx_dss_rfbi_hwmod,
1773 .clk = "dss_ick",
1774 .addr = omap3xxx_dss_rfbi_addrs,
1775 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_addrs),
1776 .fw = {
1777 .omap2 = {
1778 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_RFBI_REGION,
1779 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP ,
1780 .flags = OMAP_FIREWALL_L4,
1781 }
1782 },
1783 .user = OCP_USER_MPU | OCP_USER_SDMA,
1784};
1785
1786/* dss_rfbi slave ports */
1787static struct omap_hwmod_ocp_if *omap3xxx_dss_rfbi_slaves[] = {
1788 &omap3xxx_l4_core__dss_rfbi,
1789};
1790
1791static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
1792 .name = "dss_rfbi",
1793 .class = &omap3xxx_rfbi_hwmod_class,
1794 .main_clk = "dss1_alwon_fck",
1795 .prcm = {
1796 .omap2 = {
1797 .prcm_reg_id = 1,
1798 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1799 .module_offs = OMAP3430_DSS_MOD,
1800 },
1801 },
1802 .slaves = omap3xxx_dss_rfbi_slaves,
1803 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves),
1804 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1805 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1806 CHIP_GE_OMAP3630ES1_1),
1807 .flags = HWMOD_NO_IDLEST,
1808};
1809
1810/*
1811 * 'venc' class
1812 * video encoder
1813 */
1814
1815static struct omap_hwmod_class omap3xxx_venc_hwmod_class = {
1816 .name = "venc",
1817};
1818
1819/* dss_venc */
1820static struct omap_hwmod_addr_space omap3xxx_dss_venc_addrs[] = {
1821 {
1822 .pa_start = 0x48050C00,
1823 .pa_end = 0x48050FFF,
1824 .flags = ADDR_TYPE_RT
1825 },
1826};
1827
1828/* l4_core -> dss_venc */
1829static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = {
1830 .master = &omap3xxx_l4_core_hwmod,
1831 .slave = &omap3xxx_dss_venc_hwmod,
1832 .clk = "dss_tv_fck",
1833 .addr = omap3xxx_dss_venc_addrs,
1834 .addr_cnt = ARRAY_SIZE(omap3xxx_dss_venc_addrs),
1835 .fw = {
1836 .omap2 = {
1837 .l4_fw_region = OMAP3_L4_CORE_FW_DSS_VENC_REGION,
1838 .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
1839 .flags = OMAP_FIREWALL_L4,
1840 }
1841 },
1842 .flags = OCPIF_SWSUP_IDLE,
1843 .user = OCP_USER_MPU | OCP_USER_SDMA,
1844};
1845
1846/* dss_venc slave ports */
1847static struct omap_hwmod_ocp_if *omap3xxx_dss_venc_slaves[] = {
1848 &omap3xxx_l4_core__dss_venc,
1849};
1850
1851static struct omap_hwmod omap3xxx_dss_venc_hwmod = {
1852 .name = "dss_venc",
1853 .class = &omap3xxx_venc_hwmod_class,
1854 .main_clk = "dss1_alwon_fck",
1855 .prcm = {
1856 .omap2 = {
1857 .prcm_reg_id = 1,
1858 .module_bit = OMAP3430_EN_DSS1_SHIFT,
1859 .module_offs = OMAP3430_DSS_MOD,
1860 },
1861 },
1862 .slaves = omap3xxx_dss_venc_slaves,
1863 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves),
1864 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1865 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1866 CHIP_GE_OMAP3630ES1_1),
1867 .flags = HWMOD_NO_IDLEST,
1868};
1869
667/* I2C1 */ 1870/* I2C1 */
668 1871
669static struct omap_i2c_dev_attr i2c1_dev_attr = { 1872static struct omap_i2c_dev_attr i2c1_dev_attr = {
@@ -1227,6 +2430,437 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = {
1227 .flags = HWMOD_NO_IDLEST, 2430 .flags = HWMOD_NO_IDLEST,
1228}; 2431};
1229 2432
2433/*
2434 * 'mcbsp' class
2435 * multi channel buffered serial port controller
2436 */
2437
2438static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sysc = {
2439 .sysc_offs = 0x008c,
2440 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP |
2441 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
2442 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2443 .sysc_fields = &omap_hwmod_sysc_type1,
2444 .clockact = 0x2,
2445};
2446
2447static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = {
2448 .name = "mcbsp",
2449 .sysc = &omap3xxx_mcbsp_sysc,
2450 .rev = MCBSP_CONFIG_TYPE3,
2451};
2452
2453/* mcbsp1 */
2454static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = {
2455 { .name = "irq", .irq = 16 },
2456 { .name = "tx", .irq = 59 },
2457 { .name = "rx", .irq = 60 },
2458};
2459
2460static struct omap_hwmod_dma_info omap3xxx_mcbsp1_sdma_chs[] = {
2461 { .name = "rx", .dma_req = 32 },
2462 { .name = "tx", .dma_req = 31 },
2463};
2464
2465static struct omap_hwmod_addr_space omap3xxx_mcbsp1_addrs[] = {
2466 {
2467 .name = "mpu",
2468 .pa_start = 0x48074000,
2469 .pa_end = 0x480740ff,
2470 .flags = ADDR_TYPE_RT
2471 },
2472};
2473
2474/* l4_core -> mcbsp1 */
2475static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp1 = {
2476 .master = &omap3xxx_l4_core_hwmod,
2477 .slave = &omap3xxx_mcbsp1_hwmod,
2478 .clk = "mcbsp1_ick",
2479 .addr = omap3xxx_mcbsp1_addrs,
2480 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_addrs),
2481 .user = OCP_USER_MPU | OCP_USER_SDMA,
2482};
2483
2484/* mcbsp1 slave ports */
2485static struct omap_hwmod_ocp_if *omap3xxx_mcbsp1_slaves[] = {
2486 &omap3xxx_l4_core__mcbsp1,
2487};
2488
2489static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
2490 .name = "mcbsp1",
2491 .class = &omap3xxx_mcbsp_hwmod_class,
2492 .mpu_irqs = omap3xxx_mcbsp1_irqs,
2493 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_irqs),
2494 .sdma_reqs = omap3xxx_mcbsp1_sdma_chs,
2495 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_sdma_chs),
2496 .main_clk = "mcbsp1_fck",
2497 .prcm = {
2498 .omap2 = {
2499 .prcm_reg_id = 1,
2500 .module_bit = OMAP3430_EN_MCBSP1_SHIFT,
2501 .module_offs = CORE_MOD,
2502 .idlest_reg_id = 1,
2503 .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT,
2504 },
2505 },
2506 .slaves = omap3xxx_mcbsp1_slaves,
2507 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves),
2508 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2509};
2510
2511/* mcbsp2 */
2512static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = {
2513 { .name = "irq", .irq = 17 },
2514 { .name = "tx", .irq = 62 },
2515 { .name = "rx", .irq = 63 },
2516};
2517
2518static struct omap_hwmod_dma_info omap3xxx_mcbsp2_sdma_chs[] = {
2519 { .name = "rx", .dma_req = 34 },
2520 { .name = "tx", .dma_req = 33 },
2521};
2522
2523static struct omap_hwmod_addr_space omap3xxx_mcbsp2_addrs[] = {
2524 {
2525 .name = "mpu",
2526 .pa_start = 0x49022000,
2527 .pa_end = 0x490220ff,
2528 .flags = ADDR_TYPE_RT
2529 },
2530};
2531
2532/* l4_per -> mcbsp2 */
2533static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2 = {
2534 .master = &omap3xxx_l4_per_hwmod,
2535 .slave = &omap3xxx_mcbsp2_hwmod,
2536 .clk = "mcbsp2_ick",
2537 .addr = omap3xxx_mcbsp2_addrs,
2538 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_addrs),
2539 .user = OCP_USER_MPU | OCP_USER_SDMA,
2540};
2541
2542/* mcbsp2 slave ports */
2543static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_slaves[] = {
2544 &omap3xxx_l4_per__mcbsp2,
2545};
2546
2547static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = {
2548 .sidetone = "mcbsp2_sidetone",
2549};
2550
2551static struct omap_hwmod omap3xxx_mcbsp2_hwmod = {
2552 .name = "mcbsp2",
2553 .class = &omap3xxx_mcbsp_hwmod_class,
2554 .mpu_irqs = omap3xxx_mcbsp2_irqs,
2555 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_irqs),
2556 .sdma_reqs = omap3xxx_mcbsp2_sdma_chs,
2557 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sdma_chs),
2558 .main_clk = "mcbsp2_fck",
2559 .prcm = {
2560 .omap2 = {
2561 .prcm_reg_id = 1,
2562 .module_bit = OMAP3430_EN_MCBSP2_SHIFT,
2563 .module_offs = OMAP3430_PER_MOD,
2564 .idlest_reg_id = 1,
2565 .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT,
2566 },
2567 },
2568 .slaves = omap3xxx_mcbsp2_slaves,
2569 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves),
2570 .dev_attr = &omap34xx_mcbsp2_dev_attr,
2571 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2572};
2573
2574/* mcbsp3 */
2575static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = {
2576 { .name = "irq", .irq = 22 },
2577 { .name = "tx", .irq = 89 },
2578 { .name = "rx", .irq = 90 },
2579};
2580
2581static struct omap_hwmod_dma_info omap3xxx_mcbsp3_sdma_chs[] = {
2582 { .name = "rx", .dma_req = 18 },
2583 { .name = "tx", .dma_req = 17 },
2584};
2585
2586static struct omap_hwmod_addr_space omap3xxx_mcbsp3_addrs[] = {
2587 {
2588 .name = "mpu",
2589 .pa_start = 0x49024000,
2590 .pa_end = 0x490240ff,
2591 .flags = ADDR_TYPE_RT
2592 },
2593};
2594
2595/* l4_per -> mcbsp3 */
2596static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3 = {
2597 .master = &omap3xxx_l4_per_hwmod,
2598 .slave = &omap3xxx_mcbsp3_hwmod,
2599 .clk = "mcbsp3_ick",
2600 .addr = omap3xxx_mcbsp3_addrs,
2601 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_addrs),
2602 .user = OCP_USER_MPU | OCP_USER_SDMA,
2603};
2604
2605/* mcbsp3 slave ports */
2606static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_slaves[] = {
2607 &omap3xxx_l4_per__mcbsp3,
2608};
2609
2610static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = {
2611 .sidetone = "mcbsp3_sidetone",
2612};
2613
2614static struct omap_hwmod omap3xxx_mcbsp3_hwmod = {
2615 .name = "mcbsp3",
2616 .class = &omap3xxx_mcbsp_hwmod_class,
2617 .mpu_irqs = omap3xxx_mcbsp3_irqs,
2618 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_irqs),
2619 .sdma_reqs = omap3xxx_mcbsp3_sdma_chs,
2620 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sdma_chs),
2621 .main_clk = "mcbsp3_fck",
2622 .prcm = {
2623 .omap2 = {
2624 .prcm_reg_id = 1,
2625 .module_bit = OMAP3430_EN_MCBSP3_SHIFT,
2626 .module_offs = OMAP3430_PER_MOD,
2627 .idlest_reg_id = 1,
2628 .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT,
2629 },
2630 },
2631 .slaves = omap3xxx_mcbsp3_slaves,
2632 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves),
2633 .dev_attr = &omap34xx_mcbsp3_dev_attr,
2634 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2635};
2636
2637/* mcbsp4 */
2638static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = {
2639 { .name = "irq", .irq = 23 },
2640 { .name = "tx", .irq = 54 },
2641 { .name = "rx", .irq = 55 },
2642};
2643
2644static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = {
2645 { .name = "rx", .dma_req = 20 },
2646 { .name = "tx", .dma_req = 19 },
2647};
2648
2649static struct omap_hwmod_addr_space omap3xxx_mcbsp4_addrs[] = {
2650 {
2651 .name = "mpu",
2652 .pa_start = 0x49026000,
2653 .pa_end = 0x490260ff,
2654 .flags = ADDR_TYPE_RT
2655 },
2656};
2657
2658/* l4_per -> mcbsp4 */
2659static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp4 = {
2660 .master = &omap3xxx_l4_per_hwmod,
2661 .slave = &omap3xxx_mcbsp4_hwmod,
2662 .clk = "mcbsp4_ick",
2663 .addr = omap3xxx_mcbsp4_addrs,
2664 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_addrs),
2665 .user = OCP_USER_MPU | OCP_USER_SDMA,
2666};
2667
2668/* mcbsp4 slave ports */
2669static struct omap_hwmod_ocp_if *omap3xxx_mcbsp4_slaves[] = {
2670 &omap3xxx_l4_per__mcbsp4,
2671};
2672
2673static struct omap_hwmod omap3xxx_mcbsp4_hwmod = {
2674 .name = "mcbsp4",
2675 .class = &omap3xxx_mcbsp_hwmod_class,
2676 .mpu_irqs = omap3xxx_mcbsp4_irqs,
2677 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_irqs),
2678 .sdma_reqs = omap3xxx_mcbsp4_sdma_chs,
2679 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_sdma_chs),
2680 .main_clk = "mcbsp4_fck",
2681 .prcm = {
2682 .omap2 = {
2683 .prcm_reg_id = 1,
2684 .module_bit = OMAP3430_EN_MCBSP4_SHIFT,
2685 .module_offs = OMAP3430_PER_MOD,
2686 .idlest_reg_id = 1,
2687 .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT,
2688 },
2689 },
2690 .slaves = omap3xxx_mcbsp4_slaves,
2691 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves),
2692 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2693};
2694
2695/* mcbsp5 */
2696static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = {
2697 { .name = "irq", .irq = 27 },
2698 { .name = "tx", .irq = 81 },
2699 { .name = "rx", .irq = 82 },
2700};
2701
2702static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = {
2703 { .name = "rx", .dma_req = 22 },
2704 { .name = "tx", .dma_req = 21 },
2705};
2706
2707static struct omap_hwmod_addr_space omap3xxx_mcbsp5_addrs[] = {
2708 {
2709 .name = "mpu",
2710 .pa_start = 0x48096000,
2711 .pa_end = 0x480960ff,
2712 .flags = ADDR_TYPE_RT
2713 },
2714};
2715
2716/* l4_core -> mcbsp5 */
2717static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp5 = {
2718 .master = &omap3xxx_l4_core_hwmod,
2719 .slave = &omap3xxx_mcbsp5_hwmod,
2720 .clk = "mcbsp5_ick",
2721 .addr = omap3xxx_mcbsp5_addrs,
2722 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_addrs),
2723 .user = OCP_USER_MPU | OCP_USER_SDMA,
2724};
2725
2726/* mcbsp5 slave ports */
2727static struct omap_hwmod_ocp_if *omap3xxx_mcbsp5_slaves[] = {
2728 &omap3xxx_l4_core__mcbsp5,
2729};
2730
2731static struct omap_hwmod omap3xxx_mcbsp5_hwmod = {
2732 .name = "mcbsp5",
2733 .class = &omap3xxx_mcbsp_hwmod_class,
2734 .mpu_irqs = omap3xxx_mcbsp5_irqs,
2735 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_irqs),
2736 .sdma_reqs = omap3xxx_mcbsp5_sdma_chs,
2737 .sdma_reqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_sdma_chs),
2738 .main_clk = "mcbsp5_fck",
2739 .prcm = {
2740 .omap2 = {
2741 .prcm_reg_id = 1,
2742 .module_bit = OMAP3430_EN_MCBSP5_SHIFT,
2743 .module_offs = CORE_MOD,
2744 .idlest_reg_id = 1,
2745 .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT,
2746 },
2747 },
2748 .slaves = omap3xxx_mcbsp5_slaves,
2749 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves),
2750 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2751};
2752/* 'mcbsp sidetone' class */
2753
2754static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sidetone_sysc = {
2755 .sysc_offs = 0x0010,
2756 .sysc_flags = SYSC_HAS_AUTOIDLE,
2757 .sysc_fields = &omap_hwmod_sysc_type1,
2758};
2759
2760static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = {
2761 .name = "mcbsp_sidetone",
2762 .sysc = &omap3xxx_mcbsp_sidetone_sysc,
2763};
2764
2765/* mcbsp2_sidetone */
2766static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = {
2767 { .name = "irq", .irq = 4 },
2768};
2769
2770static struct omap_hwmod_addr_space omap3xxx_mcbsp2_sidetone_addrs[] = {
2771 {
2772 .name = "sidetone",
2773 .pa_start = 0x49028000,
2774 .pa_end = 0x490280ff,
2775 .flags = ADDR_TYPE_RT
2776 },
2777};
2778
2779/* l4_per -> mcbsp2_sidetone */
2780static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2_sidetone = {
2781 .master = &omap3xxx_l4_per_hwmod,
2782 .slave = &omap3xxx_mcbsp2_sidetone_hwmod,
2783 .clk = "mcbsp2_ick",
2784 .addr = omap3xxx_mcbsp2_sidetone_addrs,
2785 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_addrs),
2786 .user = OCP_USER_MPU,
2787};
2788
2789/* mcbsp2_sidetone slave ports */
2790static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_sidetone_slaves[] = {
2791 &omap3xxx_l4_per__mcbsp2_sidetone,
2792};
2793
2794static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = {
2795 .name = "mcbsp2_sidetone",
2796 .class = &omap3xxx_mcbsp_sidetone_hwmod_class,
2797 .mpu_irqs = omap3xxx_mcbsp2_sidetone_irqs,
2798 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_irqs),
2799 .main_clk = "mcbsp2_fck",
2800 .prcm = {
2801 .omap2 = {
2802 .prcm_reg_id = 1,
2803 .module_bit = OMAP3430_EN_MCBSP2_SHIFT,
2804 .module_offs = OMAP3430_PER_MOD,
2805 .idlest_reg_id = 1,
2806 .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT,
2807 },
2808 },
2809 .slaves = omap3xxx_mcbsp2_sidetone_slaves,
2810 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves),
2811 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2812};
2813
2814/* mcbsp3_sidetone */
2815static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = {
2816 { .name = "irq", .irq = 5 },
2817};
2818
2819static struct omap_hwmod_addr_space omap3xxx_mcbsp3_sidetone_addrs[] = {
2820 {
2821 .name = "sidetone",
2822 .pa_start = 0x4902A000,
2823 .pa_end = 0x4902A0ff,
2824 .flags = ADDR_TYPE_RT
2825 },
2826};
2827
2828/* l4_per -> mcbsp3_sidetone */
2829static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = {
2830 .master = &omap3xxx_l4_per_hwmod,
2831 .slave = &omap3xxx_mcbsp3_sidetone_hwmod,
2832 .clk = "mcbsp3_ick",
2833 .addr = omap3xxx_mcbsp3_sidetone_addrs,
2834 .addr_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_addrs),
2835 .user = OCP_USER_MPU,
2836};
2837
2838/* mcbsp3_sidetone slave ports */
2839static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_sidetone_slaves[] = {
2840 &omap3xxx_l4_per__mcbsp3_sidetone,
2841};
2842
2843static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = {
2844 .name = "mcbsp3_sidetone",
2845 .class = &omap3xxx_mcbsp_sidetone_hwmod_class,
2846 .mpu_irqs = omap3xxx_mcbsp3_sidetone_irqs,
2847 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_irqs),
2848 .main_clk = "mcbsp3_fck",
2849 .prcm = {
2850 .omap2 = {
2851 .prcm_reg_id = 1,
2852 .module_bit = OMAP3430_EN_MCBSP3_SHIFT,
2853 .module_offs = OMAP3430_PER_MOD,
2854 .idlest_reg_id = 1,
2855 .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT,
2856 },
2857 },
2858 .slaves = omap3xxx_mcbsp3_sidetone_slaves,
2859 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves),
2860 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2861};
2862
2863
1230/* SR common */ 2864/* SR common */
1231static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { 2865static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = {
1232 .clkact_shift = 20, 2866 .clkact_shift = 20,
@@ -1356,18 +2990,617 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
1356 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), 2990 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
1357}; 2991};
1358 2992
2993/*
2994 * 'mailbox' class
2995 * mailbox module allowing communication between the on-chip processors
2996 * using a queued mailbox-interrupt mechanism.
2997 */
2998
2999static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = {
3000 .rev_offs = 0x000,
3001 .sysc_offs = 0x010,
3002 .syss_offs = 0x014,
3003 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
3004 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
3005 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3006 .sysc_fields = &omap_hwmod_sysc_type1,
3007};
3008
3009static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
3010 .name = "mailbox",
3011 .sysc = &omap3xxx_mailbox_sysc,
3012};
3013
3014static struct omap_hwmod omap3xxx_mailbox_hwmod;
3015static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = {
3016 { .irq = 26 },
3017};
3018
3019static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = {
3020 {
3021 .pa_start = 0x48094000,
3022 .pa_end = 0x480941ff,
3023 .flags = ADDR_TYPE_RT,
3024 },
3025};
3026
3027/* l4_core -> mailbox */
3028static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = {
3029 .master = &omap3xxx_l4_core_hwmod,
3030 .slave = &omap3xxx_mailbox_hwmod,
3031 .addr = omap3xxx_mailbox_addrs,
3032 .addr_cnt = ARRAY_SIZE(omap3xxx_mailbox_addrs),
3033 .user = OCP_USER_MPU | OCP_USER_SDMA,
3034};
3035
3036/* mailbox slave ports */
3037static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = {
3038 &omap3xxx_l4_core__mailbox,
3039};
3040
3041static struct omap_hwmod omap3xxx_mailbox_hwmod = {
3042 .name = "mailbox",
3043 .class = &omap3xxx_mailbox_hwmod_class,
3044 .mpu_irqs = omap3xxx_mailbox_irqs,
3045 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_mailbox_irqs),
3046 .main_clk = "mailboxes_ick",
3047 .prcm = {
3048 .omap2 = {
3049 .prcm_reg_id = 1,
3050 .module_bit = OMAP3430_EN_MAILBOXES_SHIFT,
3051 .module_offs = CORE_MOD,
3052 .idlest_reg_id = 1,
3053 .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
3054 },
3055 },
3056 .slaves = omap3xxx_mailbox_slaves,
3057 .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves),
3058 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3059};
3060
3061/* l4 core -> mcspi1 interface */
3062static struct omap_hwmod_addr_space omap34xx_mcspi1_addr_space[] = {
3063 {
3064 .pa_start = 0x48098000,
3065 .pa_end = 0x480980ff,
3066 .flags = ADDR_TYPE_RT,
3067 },
3068};
3069
3070static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi1 = {
3071 .master = &omap3xxx_l4_core_hwmod,
3072 .slave = &omap34xx_mcspi1,
3073 .clk = "mcspi1_ick",
3074 .addr = omap34xx_mcspi1_addr_space,
3075 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi1_addr_space),
3076 .user = OCP_USER_MPU | OCP_USER_SDMA,
3077};
3078
3079/* l4 core -> mcspi2 interface */
3080static struct omap_hwmod_addr_space omap34xx_mcspi2_addr_space[] = {
3081 {
3082 .pa_start = 0x4809a000,
3083 .pa_end = 0x4809a0ff,
3084 .flags = ADDR_TYPE_RT,
3085 },
3086};
3087
3088static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi2 = {
3089 .master = &omap3xxx_l4_core_hwmod,
3090 .slave = &omap34xx_mcspi2,
3091 .clk = "mcspi2_ick",
3092 .addr = omap34xx_mcspi2_addr_space,
3093 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi2_addr_space),
3094 .user = OCP_USER_MPU | OCP_USER_SDMA,
3095};
3096
3097/* l4 core -> mcspi3 interface */
3098static struct omap_hwmod_addr_space omap34xx_mcspi3_addr_space[] = {
3099 {
3100 .pa_start = 0x480b8000,
3101 .pa_end = 0x480b80ff,
3102 .flags = ADDR_TYPE_RT,
3103 },
3104};
3105
3106static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi3 = {
3107 .master = &omap3xxx_l4_core_hwmod,
3108 .slave = &omap34xx_mcspi3,
3109 .clk = "mcspi3_ick",
3110 .addr = omap34xx_mcspi3_addr_space,
3111 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi3_addr_space),
3112 .user = OCP_USER_MPU | OCP_USER_SDMA,
3113};
3114
3115/* l4 core -> mcspi4 interface */
3116static struct omap_hwmod_addr_space omap34xx_mcspi4_addr_space[] = {
3117 {
3118 .pa_start = 0x480ba000,
3119 .pa_end = 0x480ba0ff,
3120 .flags = ADDR_TYPE_RT,
3121 },
3122};
3123
3124static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi4 = {
3125 .master = &omap3xxx_l4_core_hwmod,
3126 .slave = &omap34xx_mcspi4,
3127 .clk = "mcspi4_ick",
3128 .addr = omap34xx_mcspi4_addr_space,
3129 .addr_cnt = ARRAY_SIZE(omap34xx_mcspi4_addr_space),
3130 .user = OCP_USER_MPU | OCP_USER_SDMA,
3131};
3132
3133/*
3134 * 'mcspi' class
3135 * multichannel serial port interface (mcspi) / master/slave synchronous serial
3136 * bus
3137 */
3138
3139static struct omap_hwmod_class_sysconfig omap34xx_mcspi_sysc = {
3140 .rev_offs = 0x0000,
3141 .sysc_offs = 0x0010,
3142 .syss_offs = 0x0014,
3143 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
3144 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
3145 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
3146 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3147 .sysc_fields = &omap_hwmod_sysc_type1,
3148};
3149
3150static struct omap_hwmod_class omap34xx_mcspi_class = {
3151 .name = "mcspi",
3152 .sysc = &omap34xx_mcspi_sysc,
3153 .rev = OMAP3_MCSPI_REV,
3154};
3155
3156/* mcspi1 */
3157static struct omap_hwmod_irq_info omap34xx_mcspi1_mpu_irqs[] = {
3158 { .name = "irq", .irq = 65 },
3159};
3160
3161static struct omap_hwmod_dma_info omap34xx_mcspi1_sdma_reqs[] = {
3162 { .name = "tx0", .dma_req = 35 },
3163 { .name = "rx0", .dma_req = 36 },
3164 { .name = "tx1", .dma_req = 37 },
3165 { .name = "rx1", .dma_req = 38 },
3166 { .name = "tx2", .dma_req = 39 },
3167 { .name = "rx2", .dma_req = 40 },
3168 { .name = "tx3", .dma_req = 41 },
3169 { .name = "rx3", .dma_req = 42 },
3170};
3171
3172static struct omap_hwmod_ocp_if *omap34xx_mcspi1_slaves[] = {
3173 &omap34xx_l4_core__mcspi1,
3174};
3175
3176static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
3177 .num_chipselect = 4,
3178};
3179
3180static struct omap_hwmod omap34xx_mcspi1 = {
3181 .name = "mcspi1",
3182 .mpu_irqs = omap34xx_mcspi1_mpu_irqs,
3183 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi1_mpu_irqs),
3184 .sdma_reqs = omap34xx_mcspi1_sdma_reqs,
3185 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi1_sdma_reqs),
3186 .main_clk = "mcspi1_fck",
3187 .prcm = {
3188 .omap2 = {
3189 .module_offs = CORE_MOD,
3190 .prcm_reg_id = 1,
3191 .module_bit = OMAP3430_EN_MCSPI1_SHIFT,
3192 .idlest_reg_id = 1,
3193 .idlest_idle_bit = OMAP3430_ST_MCSPI1_SHIFT,
3194 },
3195 },
3196 .slaves = omap34xx_mcspi1_slaves,
3197 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi1_slaves),
3198 .class = &omap34xx_mcspi_class,
3199 .dev_attr = &omap_mcspi1_dev_attr,
3200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3201};
3202
3203/* mcspi2 */
3204static struct omap_hwmod_irq_info omap34xx_mcspi2_mpu_irqs[] = {
3205 { .name = "irq", .irq = 66 },
3206};
3207
3208static struct omap_hwmod_dma_info omap34xx_mcspi2_sdma_reqs[] = {
3209 { .name = "tx0", .dma_req = 43 },
3210 { .name = "rx0", .dma_req = 44 },
3211 { .name = "tx1", .dma_req = 45 },
3212 { .name = "rx1", .dma_req = 46 },
3213};
3214
3215static struct omap_hwmod_ocp_if *omap34xx_mcspi2_slaves[] = {
3216 &omap34xx_l4_core__mcspi2,
3217};
3218
3219static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
3220 .num_chipselect = 2,
3221};
3222
3223static struct omap_hwmod omap34xx_mcspi2 = {
3224 .name = "mcspi2",
3225 .mpu_irqs = omap34xx_mcspi2_mpu_irqs,
3226 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi2_mpu_irqs),
3227 .sdma_reqs = omap34xx_mcspi2_sdma_reqs,
3228 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi2_sdma_reqs),
3229 .main_clk = "mcspi2_fck",
3230 .prcm = {
3231 .omap2 = {
3232 .module_offs = CORE_MOD,
3233 .prcm_reg_id = 1,
3234 .module_bit = OMAP3430_EN_MCSPI2_SHIFT,
3235 .idlest_reg_id = 1,
3236 .idlest_idle_bit = OMAP3430_ST_MCSPI2_SHIFT,
3237 },
3238 },
3239 .slaves = omap34xx_mcspi2_slaves,
3240 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi2_slaves),
3241 .class = &omap34xx_mcspi_class,
3242 .dev_attr = &omap_mcspi2_dev_attr,
3243 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3244};
3245
3246/* mcspi3 */
3247static struct omap_hwmod_irq_info omap34xx_mcspi3_mpu_irqs[] = {
3248 { .name = "irq", .irq = 91 }, /* 91 */
3249};
3250
3251static struct omap_hwmod_dma_info omap34xx_mcspi3_sdma_reqs[] = {
3252 { .name = "tx0", .dma_req = 15 },
3253 { .name = "rx0", .dma_req = 16 },
3254 { .name = "tx1", .dma_req = 23 },
3255 { .name = "rx1", .dma_req = 24 },
3256};
3257
3258static struct omap_hwmod_ocp_if *omap34xx_mcspi3_slaves[] = {
3259 &omap34xx_l4_core__mcspi3,
3260};
3261
3262static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
3263 .num_chipselect = 2,
3264};
3265
3266static struct omap_hwmod omap34xx_mcspi3 = {
3267 .name = "mcspi3",
3268 .mpu_irqs = omap34xx_mcspi3_mpu_irqs,
3269 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi3_mpu_irqs),
3270 .sdma_reqs = omap34xx_mcspi3_sdma_reqs,
3271 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi3_sdma_reqs),
3272 .main_clk = "mcspi3_fck",
3273 .prcm = {
3274 .omap2 = {
3275 .module_offs = CORE_MOD,
3276 .prcm_reg_id = 1,
3277 .module_bit = OMAP3430_EN_MCSPI3_SHIFT,
3278 .idlest_reg_id = 1,
3279 .idlest_idle_bit = OMAP3430_ST_MCSPI3_SHIFT,
3280 },
3281 },
3282 .slaves = omap34xx_mcspi3_slaves,
3283 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi3_slaves),
3284 .class = &omap34xx_mcspi_class,
3285 .dev_attr = &omap_mcspi3_dev_attr,
3286 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3287};
3288
3289/* SPI4 */
3290static struct omap_hwmod_irq_info omap34xx_mcspi4_mpu_irqs[] = {
3291 { .name = "irq", .irq = INT_34XX_SPI4_IRQ }, /* 48 */
3292};
3293
3294static struct omap_hwmod_dma_info omap34xx_mcspi4_sdma_reqs[] = {
3295 { .name = "tx0", .dma_req = 70 }, /* DMA_SPI4_TX0 */
3296 { .name = "rx0", .dma_req = 71 }, /* DMA_SPI4_RX0 */
3297};
3298
3299static struct omap_hwmod_ocp_if *omap34xx_mcspi4_slaves[] = {
3300 &omap34xx_l4_core__mcspi4,
3301};
3302
3303static struct omap2_mcspi_dev_attr omap_mcspi4_dev_attr = {
3304 .num_chipselect = 1,
3305};
3306
3307static struct omap_hwmod omap34xx_mcspi4 = {
3308 .name = "mcspi4",
3309 .mpu_irqs = omap34xx_mcspi4_mpu_irqs,
3310 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mcspi4_mpu_irqs),
3311 .sdma_reqs = omap34xx_mcspi4_sdma_reqs,
3312 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mcspi4_sdma_reqs),
3313 .main_clk = "mcspi4_fck",
3314 .prcm = {
3315 .omap2 = {
3316 .module_offs = CORE_MOD,
3317 .prcm_reg_id = 1,
3318 .module_bit = OMAP3430_EN_MCSPI4_SHIFT,
3319 .idlest_reg_id = 1,
3320 .idlest_idle_bit = OMAP3430_ST_MCSPI4_SHIFT,
3321 },
3322 },
3323 .slaves = omap34xx_mcspi4_slaves,
3324 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi4_slaves),
3325 .class = &omap34xx_mcspi_class,
3326 .dev_attr = &omap_mcspi4_dev_attr,
3327 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3328};
3329
3330/*
3331 * usbhsotg
3332 */
3333static struct omap_hwmod_class_sysconfig omap3xxx_usbhsotg_sysc = {
3334 .rev_offs = 0x0400,
3335 .sysc_offs = 0x0404,
3336 .syss_offs = 0x0408,
3337 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
3338 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
3339 SYSC_HAS_AUTOIDLE),
3340 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3341 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
3342 .sysc_fields = &omap_hwmod_sysc_type1,
3343};
3344
3345static struct omap_hwmod_class usbotg_class = {
3346 .name = "usbotg",
3347 .sysc = &omap3xxx_usbhsotg_sysc,
3348};
3349/* usb_otg_hs */
3350static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = {
3351
3352 { .name = "mc", .irq = 92 },
3353 { .name = "dma", .irq = 93 },
3354};
3355
3356static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
3357 .name = "usb_otg_hs",
3358 .mpu_irqs = omap3xxx_usbhsotg_mpu_irqs,
3359 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_mpu_irqs),
3360 .main_clk = "hsotgusb_ick",
3361 .prcm = {
3362 .omap2 = {
3363 .prcm_reg_id = 1,
3364 .module_bit = OMAP3430_EN_HSOTGUSB_SHIFT,
3365 .module_offs = CORE_MOD,
3366 .idlest_reg_id = 1,
3367 .idlest_idle_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT,
3368 .idlest_stdby_bit = OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT
3369 },
3370 },
3371 .masters = omap3xxx_usbhsotg_masters,
3372 .masters_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_masters),
3373 .slaves = omap3xxx_usbhsotg_slaves,
3374 .slaves_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_slaves),
3375 .class = &usbotg_class,
3376
3377 /*
3378 * Erratum ID: i479 idle_req / idle_ack mechanism potentially
3379 * broken when autoidle is enabled
3380 * workaround is to disable the autoidle bit at module level.
3381 */
3382 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
3383 | HWMOD_SWSUP_MSTANDBY,
3384 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
3385};
3386
3387/* usb_otg_hs */
3388static struct omap_hwmod_irq_info am35xx_usbhsotg_mpu_irqs[] = {
3389
3390 { .name = "mc", .irq = 71 },
3391};
3392
3393static struct omap_hwmod_class am35xx_usbotg_class = {
3394 .name = "am35xx_usbotg",
3395 .sysc = NULL,
3396};
3397
3398static struct omap_hwmod am35xx_usbhsotg_hwmod = {
3399 .name = "am35x_otg_hs",
3400 .mpu_irqs = am35xx_usbhsotg_mpu_irqs,
3401 .mpu_irqs_cnt = ARRAY_SIZE(am35xx_usbhsotg_mpu_irqs),
3402 .main_clk = NULL,
3403 .prcm = {
3404 .omap2 = {
3405 },
3406 },
3407 .masters = am35xx_usbhsotg_masters,
3408 .masters_cnt = ARRAY_SIZE(am35xx_usbhsotg_masters),
3409 .slaves = am35xx_usbhsotg_slaves,
3410 .slaves_cnt = ARRAY_SIZE(am35xx_usbhsotg_slaves),
3411 .class = &am35xx_usbotg_class,
3412 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1)
3413};
3414
3415/* MMC/SD/SDIO common */
3416
3417static struct omap_hwmod_class_sysconfig omap34xx_mmc_sysc = {
3418 .rev_offs = 0x1fc,
3419 .sysc_offs = 0x10,
3420 .syss_offs = 0x14,
3421 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
3422 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
3423 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
3424 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3425 .sysc_fields = &omap_hwmod_sysc_type1,
3426};
3427
3428static struct omap_hwmod_class omap34xx_mmc_class = {
3429 .name = "mmc",
3430 .sysc = &omap34xx_mmc_sysc,
3431};
3432
3433/* MMC/SD/SDIO1 */
3434
3435static struct omap_hwmod_irq_info omap34xx_mmc1_mpu_irqs[] = {
3436 { .irq = 83, },
3437};
3438
3439static struct omap_hwmod_dma_info omap34xx_mmc1_sdma_reqs[] = {
3440 { .name = "tx", .dma_req = 61, },
3441 { .name = "rx", .dma_req = 62, },
3442};
3443
3444static struct omap_hwmod_opt_clk omap34xx_mmc1_opt_clks[] = {
3445 { .role = "dbck", .clk = "omap_32k_fck", },
3446};
3447
3448static struct omap_hwmod_ocp_if *omap3xxx_mmc1_slaves[] = {
3449 &omap3xxx_l4_core__mmc1,
3450};
3451
3452static struct omap_mmc_dev_attr mmc1_dev_attr = {
3453 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
3454};
3455
3456static struct omap_hwmod omap3xxx_mmc1_hwmod = {
3457 .name = "mmc1",
3458 .mpu_irqs = omap34xx_mmc1_mpu_irqs,
3459 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc1_mpu_irqs),
3460 .sdma_reqs = omap34xx_mmc1_sdma_reqs,
3461 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc1_sdma_reqs),
3462 .opt_clks = omap34xx_mmc1_opt_clks,
3463 .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks),
3464 .main_clk = "mmchs1_fck",
3465 .prcm = {
3466 .omap2 = {
3467 .module_offs = CORE_MOD,
3468 .prcm_reg_id = 1,
3469 .module_bit = OMAP3430_EN_MMC1_SHIFT,
3470 .idlest_reg_id = 1,
3471 .idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT,
3472 },
3473 },
3474 .dev_attr = &mmc1_dev_attr,
3475 .slaves = omap3xxx_mmc1_slaves,
3476 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves),
3477 .class = &omap34xx_mmc_class,
3478 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3479};
3480
3481/* MMC/SD/SDIO2 */
3482
3483static struct omap_hwmod_irq_info omap34xx_mmc2_mpu_irqs[] = {
3484 { .irq = INT_24XX_MMC2_IRQ, },
3485};
3486
3487static struct omap_hwmod_dma_info omap34xx_mmc2_sdma_reqs[] = {
3488 { .name = "tx", .dma_req = 47, },
3489 { .name = "rx", .dma_req = 48, },
3490};
3491
3492static struct omap_hwmod_opt_clk omap34xx_mmc2_opt_clks[] = {
3493 { .role = "dbck", .clk = "omap_32k_fck", },
3494};
3495
3496static struct omap_hwmod_ocp_if *omap3xxx_mmc2_slaves[] = {
3497 &omap3xxx_l4_core__mmc2,
3498};
3499
3500static struct omap_hwmod omap3xxx_mmc2_hwmod = {
3501 .name = "mmc2",
3502 .mpu_irqs = omap34xx_mmc2_mpu_irqs,
3503 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc2_mpu_irqs),
3504 .sdma_reqs = omap34xx_mmc2_sdma_reqs,
3505 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc2_sdma_reqs),
3506 .opt_clks = omap34xx_mmc2_opt_clks,
3507 .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks),
3508 .main_clk = "mmchs2_fck",
3509 .prcm = {
3510 .omap2 = {
3511 .module_offs = CORE_MOD,
3512 .prcm_reg_id = 1,
3513 .module_bit = OMAP3430_EN_MMC2_SHIFT,
3514 .idlest_reg_id = 1,
3515 .idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT,
3516 },
3517 },
3518 .slaves = omap3xxx_mmc2_slaves,
3519 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves),
3520 .class = &omap34xx_mmc_class,
3521 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3522};
3523
3524/* MMC/SD/SDIO3 */
3525
3526static struct omap_hwmod_irq_info omap34xx_mmc3_mpu_irqs[] = {
3527 { .irq = 94, },
3528};
3529
3530static struct omap_hwmod_dma_info omap34xx_mmc3_sdma_reqs[] = {
3531 { .name = "tx", .dma_req = 77, },
3532 { .name = "rx", .dma_req = 78, },
3533};
3534
3535static struct omap_hwmod_opt_clk omap34xx_mmc3_opt_clks[] = {
3536 { .role = "dbck", .clk = "omap_32k_fck", },
3537};
3538
3539static struct omap_hwmod_ocp_if *omap3xxx_mmc3_slaves[] = {
3540 &omap3xxx_l4_core__mmc3,
3541};
3542
3543static struct omap_hwmod omap3xxx_mmc3_hwmod = {
3544 .name = "mmc3",
3545 .mpu_irqs = omap34xx_mmc3_mpu_irqs,
3546 .mpu_irqs_cnt = ARRAY_SIZE(omap34xx_mmc3_mpu_irqs),
3547 .sdma_reqs = omap34xx_mmc3_sdma_reqs,
3548 .sdma_reqs_cnt = ARRAY_SIZE(omap34xx_mmc3_sdma_reqs),
3549 .opt_clks = omap34xx_mmc3_opt_clks,
3550 .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc3_opt_clks),
3551 .main_clk = "mmchs3_fck",
3552 .prcm = {
3553 .omap2 = {
3554 .prcm_reg_id = 1,
3555 .module_bit = OMAP3430_EN_MMC3_SHIFT,
3556 .idlest_reg_id = 1,
3557 .idlest_idle_bit = OMAP3430_ST_MMC3_SHIFT,
3558 },
3559 },
3560 .slaves = omap3xxx_mmc3_slaves,
3561 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves),
3562 .class = &omap34xx_mmc_class,
3563 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3564};
3565
1359static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { 3566static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
1360 &omap3xxx_l3_main_hwmod, 3567 &omap3xxx_l3_main_hwmod,
1361 &omap3xxx_l4_core_hwmod, 3568 &omap3xxx_l4_core_hwmod,
1362 &omap3xxx_l4_per_hwmod, 3569 &omap3xxx_l4_per_hwmod,
1363 &omap3xxx_l4_wkup_hwmod, 3570 &omap3xxx_l4_wkup_hwmod,
3571 &omap3xxx_mmc1_hwmod,
3572 &omap3xxx_mmc2_hwmod,
3573 &omap3xxx_mmc3_hwmod,
1364 &omap3xxx_mpu_hwmod, 3574 &omap3xxx_mpu_hwmod,
1365 &omap3xxx_iva_hwmod, 3575 &omap3xxx_iva_hwmod,
3576
3577 &omap3xxx_timer1_hwmod,
3578 &omap3xxx_timer2_hwmod,
3579 &omap3xxx_timer3_hwmod,
3580 &omap3xxx_timer4_hwmod,
3581 &omap3xxx_timer5_hwmod,
3582 &omap3xxx_timer6_hwmod,
3583 &omap3xxx_timer7_hwmod,
3584 &omap3xxx_timer8_hwmod,
3585 &omap3xxx_timer9_hwmod,
3586 &omap3xxx_timer10_hwmod,
3587 &omap3xxx_timer11_hwmod,
3588 &omap3xxx_timer12_hwmod,
3589
1366 &omap3xxx_wd_timer2_hwmod, 3590 &omap3xxx_wd_timer2_hwmod,
1367 &omap3xxx_uart1_hwmod, 3591 &omap3xxx_uart1_hwmod,
1368 &omap3xxx_uart2_hwmod, 3592 &omap3xxx_uart2_hwmod,
1369 &omap3xxx_uart3_hwmod, 3593 &omap3xxx_uart3_hwmod,
1370 &omap3xxx_uart4_hwmod, 3594 &omap3xxx_uart4_hwmod,
3595 /* dss class */
3596 &omap3430es1_dss_core_hwmod,
3597 &omap3xxx_dss_core_hwmod,
3598 &omap3xxx_dss_dispc_hwmod,
3599 &omap3xxx_dss_dsi1_hwmod,
3600 &omap3xxx_dss_rfbi_hwmod,
3601 &omap3xxx_dss_venc_hwmod,
3602
3603 /* i2c class */
1371 &omap3xxx_i2c1_hwmod, 3604 &omap3xxx_i2c1_hwmod,
1372 &omap3xxx_i2c2_hwmod, 3605 &omap3xxx_i2c2_hwmod,
1373 &omap3xxx_i2c3_hwmod, 3606 &omap3xxx_i2c3_hwmod,
@@ -1387,10 +3620,35 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
1387 3620
1388 /* dma_system class*/ 3621 /* dma_system class*/
1389 &omap3xxx_dma_system_hwmod, 3622 &omap3xxx_dma_system_hwmod,
3623
3624 /* mcbsp class */
3625 &omap3xxx_mcbsp1_hwmod,
3626 &omap3xxx_mcbsp2_hwmod,
3627 &omap3xxx_mcbsp3_hwmod,
3628 &omap3xxx_mcbsp4_hwmod,
3629 &omap3xxx_mcbsp5_hwmod,
3630 &omap3xxx_mcbsp2_sidetone_hwmod,
3631 &omap3xxx_mcbsp3_sidetone_hwmod,
3632
3633 /* mailbox class */
3634 &omap3xxx_mailbox_hwmod,
3635
3636 /* mcspi class */
3637 &omap34xx_mcspi1,
3638 &omap34xx_mcspi2,
3639 &omap34xx_mcspi3,
3640 &omap34xx_mcspi4,
3641
3642 /* usbotg class */
3643 &omap3xxx_usbhsotg_hwmod,
3644
3645 /* usbotg for am35x */
3646 &am35xx_usbhsotg_hwmod,
3647
1390 NULL, 3648 NULL,
1391}; 3649};
1392 3650
1393int __init omap3xxx_hwmod_init(void) 3651int __init omap3xxx_hwmod_init(void)
1394{ 3652{
1395 return omap_hwmod_init(omap3xxx_hwmods); 3653 return omap_hwmod_register(omap3xxx_hwmods);
1396} 3654}
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index c2806bd11fbf..3e88dd3f8ef3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Hardware modules present on the OMAP44xx chips 2 * Hardware modules present on the OMAP44xx chips
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2009-2011 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation 5 * Copyright (C) 2009-2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
@@ -24,6 +24,9 @@
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25#include <plat/gpio.h> 25#include <plat/gpio.h>
26#include <plat/dma.h> 26#include <plat/dma.h>
27#include <plat/mcspi.h>
28#include <plat/mcbsp.h>
29#include <plat/mmc.h>
27 30
28#include "omap_hwmod_common_data.h" 31#include "omap_hwmod_common_data.h"
29 32
@@ -40,10 +43,15 @@
40#define OMAP44XX_DMA_REQ_START 1 43#define OMAP44XX_DMA_REQ_START 1
41 44
42/* Backward references (IPs with Bus Master capability) */ 45/* Backward references (IPs with Bus Master capability) */
46static struct omap_hwmod omap44xx_aess_hwmod;
43static struct omap_hwmod omap44xx_dma_system_hwmod; 47static struct omap_hwmod omap44xx_dma_system_hwmod;
44static struct omap_hwmod omap44xx_dmm_hwmod; 48static struct omap_hwmod omap44xx_dmm_hwmod;
45static struct omap_hwmod omap44xx_dsp_hwmod; 49static struct omap_hwmod omap44xx_dsp_hwmod;
50static struct omap_hwmod omap44xx_dss_hwmod;
46static struct omap_hwmod omap44xx_emif_fw_hwmod; 51static struct omap_hwmod omap44xx_emif_fw_hwmod;
52static struct omap_hwmod omap44xx_hsi_hwmod;
53static struct omap_hwmod omap44xx_ipu_hwmod;
54static struct omap_hwmod omap44xx_iss_hwmod;
47static struct omap_hwmod omap44xx_iva_hwmod; 55static struct omap_hwmod omap44xx_iva_hwmod;
48static struct omap_hwmod omap44xx_l3_instr_hwmod; 56static struct omap_hwmod omap44xx_l3_instr_hwmod;
49static struct omap_hwmod omap44xx_l3_main_1_hwmod; 57static struct omap_hwmod omap44xx_l3_main_1_hwmod;
@@ -53,8 +61,11 @@ static struct omap_hwmod omap44xx_l4_abe_hwmod;
53static struct omap_hwmod omap44xx_l4_cfg_hwmod; 61static struct omap_hwmod omap44xx_l4_cfg_hwmod;
54static struct omap_hwmod omap44xx_l4_per_hwmod; 62static struct omap_hwmod omap44xx_l4_per_hwmod;
55static struct omap_hwmod omap44xx_l4_wkup_hwmod; 63static struct omap_hwmod omap44xx_l4_wkup_hwmod;
64static struct omap_hwmod omap44xx_mmc1_hwmod;
65static struct omap_hwmod omap44xx_mmc2_hwmod;
56static struct omap_hwmod omap44xx_mpu_hwmod; 66static struct omap_hwmod omap44xx_mpu_hwmod;
57static struct omap_hwmod omap44xx_mpu_private_hwmod; 67static struct omap_hwmod omap44xx_mpu_private_hwmod;
68static struct omap_hwmod omap44xx_usb_otg_hs_hwmod;
58 69
59/* 70/*
60 * Interconnects omap_hwmod structures 71 * Interconnects omap_hwmod structures
@@ -213,6 +224,14 @@ static struct omap_hwmod_ocp_if omap44xx_dsp__l3_main_1 = {
213 .user = OCP_USER_MPU | OCP_USER_SDMA, 224 .user = OCP_USER_MPU | OCP_USER_SDMA,
214}; 225};
215 226
227/* dss -> l3_main_1 */
228static struct omap_hwmod_ocp_if omap44xx_dss__l3_main_1 = {
229 .master = &omap44xx_dss_hwmod,
230 .slave = &omap44xx_l3_main_1_hwmod,
231 .clk = "l3_div_ck",
232 .user = OCP_USER_MPU | OCP_USER_SDMA,
233};
234
216/* l3_main_2 -> l3_main_1 */ 235/* l3_main_2 -> l3_main_1 */
217static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = { 236static struct omap_hwmod_ocp_if omap44xx_l3_main_2__l3_main_1 = {
218 .master = &omap44xx_l3_main_2_hwmod, 237 .master = &omap44xx_l3_main_2_hwmod,
@@ -229,25 +248,62 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_1 = {
229 .user = OCP_USER_MPU | OCP_USER_SDMA, 248 .user = OCP_USER_MPU | OCP_USER_SDMA,
230}; 249};
231 250
251/* mmc1 -> l3_main_1 */
252static struct omap_hwmod_ocp_if omap44xx_mmc1__l3_main_1 = {
253 .master = &omap44xx_mmc1_hwmod,
254 .slave = &omap44xx_l3_main_1_hwmod,
255 .clk = "l3_div_ck",
256 .user = OCP_USER_MPU | OCP_USER_SDMA,
257};
258
259/* mmc2 -> l3_main_1 */
260static struct omap_hwmod_ocp_if omap44xx_mmc2__l3_main_1 = {
261 .master = &omap44xx_mmc2_hwmod,
262 .slave = &omap44xx_l3_main_1_hwmod,
263 .clk = "l3_div_ck",
264 .user = OCP_USER_MPU | OCP_USER_SDMA,
265};
266
267/* L3 target configuration and error log registers */
268static struct omap_hwmod_irq_info omap44xx_l3_targ_irqs[] = {
269 { .irq = 9 + OMAP44XX_IRQ_GIC_START },
270 { .irq = 10 + OMAP44XX_IRQ_GIC_START },
271};
272
273static struct omap_hwmod_addr_space omap44xx_l3_main_1_addrs[] = {
274 {
275 .pa_start = 0x44000000,
276 .pa_end = 0x44000fff,
277 .flags = ADDR_TYPE_RT,
278 },
279};
280
232/* mpu -> l3_main_1 */ 281/* mpu -> l3_main_1 */
233static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = { 282static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = {
234 .master = &omap44xx_mpu_hwmod, 283 .master = &omap44xx_mpu_hwmod,
235 .slave = &omap44xx_l3_main_1_hwmod, 284 .slave = &omap44xx_l3_main_1_hwmod,
236 .clk = "l3_div_ck", 285 .clk = "l3_div_ck",
286 .addr = omap44xx_l3_main_1_addrs,
287 .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_1_addrs),
237 .user = OCP_USER_MPU | OCP_USER_SDMA, 288 .user = OCP_USER_MPU | OCP_USER_SDMA,
238}; 289};
239 290
240/* l3_main_1 slave ports */ 291/* l3_main_1 slave ports */
241static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = { 292static struct omap_hwmod_ocp_if *omap44xx_l3_main_1_slaves[] = {
242 &omap44xx_dsp__l3_main_1, 293 &omap44xx_dsp__l3_main_1,
294 &omap44xx_dss__l3_main_1,
243 &omap44xx_l3_main_2__l3_main_1, 295 &omap44xx_l3_main_2__l3_main_1,
244 &omap44xx_l4_cfg__l3_main_1, 296 &omap44xx_l4_cfg__l3_main_1,
297 &omap44xx_mmc1__l3_main_1,
298 &omap44xx_mmc2__l3_main_1,
245 &omap44xx_mpu__l3_main_1, 299 &omap44xx_mpu__l3_main_1,
246}; 300};
247 301
248static struct omap_hwmod omap44xx_l3_main_1_hwmod = { 302static struct omap_hwmod omap44xx_l3_main_1_hwmod = {
249 .name = "l3_main_1", 303 .name = "l3_main_1",
250 .class = &omap44xx_l3_hwmod_class, 304 .class = &omap44xx_l3_hwmod_class,
305 .mpu_irqs = omap44xx_l3_targ_irqs,
306 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_l3_targ_irqs),
251 .slaves = omap44xx_l3_main_1_slaves, 307 .slaves = omap44xx_l3_main_1_slaves,
252 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), 308 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves),
253 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 309 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
@@ -262,6 +318,30 @@ static struct omap_hwmod_ocp_if omap44xx_dma_system__l3_main_2 = {
262 .user = OCP_USER_MPU | OCP_USER_SDMA, 318 .user = OCP_USER_MPU | OCP_USER_SDMA,
263}; 319};
264 320
321/* hsi -> l3_main_2 */
322static struct omap_hwmod_ocp_if omap44xx_hsi__l3_main_2 = {
323 .master = &omap44xx_hsi_hwmod,
324 .slave = &omap44xx_l3_main_2_hwmod,
325 .clk = "l3_div_ck",
326 .user = OCP_USER_MPU | OCP_USER_SDMA,
327};
328
329/* ipu -> l3_main_2 */
330static struct omap_hwmod_ocp_if omap44xx_ipu__l3_main_2 = {
331 .master = &omap44xx_ipu_hwmod,
332 .slave = &omap44xx_l3_main_2_hwmod,
333 .clk = "l3_div_ck",
334 .user = OCP_USER_MPU | OCP_USER_SDMA,
335};
336
337/* iss -> l3_main_2 */
338static struct omap_hwmod_ocp_if omap44xx_iss__l3_main_2 = {
339 .master = &omap44xx_iss_hwmod,
340 .slave = &omap44xx_l3_main_2_hwmod,
341 .clk = "l3_div_ck",
342 .user = OCP_USER_MPU | OCP_USER_SDMA,
343};
344
265/* iva -> l3_main_2 */ 345/* iva -> l3_main_2 */
266static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = { 346static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = {
267 .master = &omap44xx_iva_hwmod, 347 .master = &omap44xx_iva_hwmod,
@@ -270,11 +350,21 @@ static struct omap_hwmod_ocp_if omap44xx_iva__l3_main_2 = {
270 .user = OCP_USER_MPU | OCP_USER_SDMA, 350 .user = OCP_USER_MPU | OCP_USER_SDMA,
271}; 351};
272 352
353static struct omap_hwmod_addr_space omap44xx_l3_main_2_addrs[] = {
354 {
355 .pa_start = 0x44800000,
356 .pa_end = 0x44801fff,
357 .flags = ADDR_TYPE_RT,
358 },
359};
360
273/* l3_main_1 -> l3_main_2 */ 361/* l3_main_1 -> l3_main_2 */
274static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = { 362static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_2 = {
275 .master = &omap44xx_l3_main_1_hwmod, 363 .master = &omap44xx_l3_main_1_hwmod,
276 .slave = &omap44xx_l3_main_2_hwmod, 364 .slave = &omap44xx_l3_main_2_hwmod,
277 .clk = "l3_div_ck", 365 .clk = "l3_div_ck",
366 .addr = omap44xx_l3_main_2_addrs,
367 .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_2_addrs),
278 .user = OCP_USER_MPU | OCP_USER_SDMA, 368 .user = OCP_USER_MPU | OCP_USER_SDMA,
279}; 369};
280 370
@@ -286,12 +376,24 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_2 = {
286 .user = OCP_USER_MPU | OCP_USER_SDMA, 376 .user = OCP_USER_MPU | OCP_USER_SDMA,
287}; 377};
288 378
379/* usb_otg_hs -> l3_main_2 */
380static struct omap_hwmod_ocp_if omap44xx_usb_otg_hs__l3_main_2 = {
381 .master = &omap44xx_usb_otg_hs_hwmod,
382 .slave = &omap44xx_l3_main_2_hwmod,
383 .clk = "l3_div_ck",
384 .user = OCP_USER_MPU | OCP_USER_SDMA,
385};
386
289/* l3_main_2 slave ports */ 387/* l3_main_2 slave ports */
290static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { 388static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = {
291 &omap44xx_dma_system__l3_main_2, 389 &omap44xx_dma_system__l3_main_2,
390 &omap44xx_hsi__l3_main_2,
391 &omap44xx_ipu__l3_main_2,
392 &omap44xx_iss__l3_main_2,
292 &omap44xx_iva__l3_main_2, 393 &omap44xx_iva__l3_main_2,
293 &omap44xx_l3_main_1__l3_main_2, 394 &omap44xx_l3_main_1__l3_main_2,
294 &omap44xx_l4_cfg__l3_main_2, 395 &omap44xx_l4_cfg__l3_main_2,
396 &omap44xx_usb_otg_hs__l3_main_2,
295}; 397};
296 398
297static struct omap_hwmod omap44xx_l3_main_2_hwmod = { 399static struct omap_hwmod omap44xx_l3_main_2_hwmod = {
@@ -303,11 +405,21 @@ static struct omap_hwmod omap44xx_l3_main_2_hwmod = {
303}; 405};
304 406
305/* l3_main_3 interface data */ 407/* l3_main_3 interface data */
408static struct omap_hwmod_addr_space omap44xx_l3_main_3_addrs[] = {
409 {
410 .pa_start = 0x45000000,
411 .pa_end = 0x45000fff,
412 .flags = ADDR_TYPE_RT,
413 },
414};
415
306/* l3_main_1 -> l3_main_3 */ 416/* l3_main_1 -> l3_main_3 */
307static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = { 417static struct omap_hwmod_ocp_if omap44xx_l3_main_1__l3_main_3 = {
308 .master = &omap44xx_l3_main_1_hwmod, 418 .master = &omap44xx_l3_main_1_hwmod,
309 .slave = &omap44xx_l3_main_3_hwmod, 419 .slave = &omap44xx_l3_main_3_hwmod,
310 .clk = "l3_div_ck", 420 .clk = "l3_div_ck",
421 .addr = omap44xx_l3_main_3_addrs,
422 .addr_cnt = ARRAY_SIZE(omap44xx_l3_main_3_addrs),
311 .user = OCP_USER_MPU | OCP_USER_SDMA, 423 .user = OCP_USER_MPU | OCP_USER_SDMA,
312}; 424};
313 425
@@ -351,6 +463,14 @@ static struct omap_hwmod_class omap44xx_l4_hwmod_class = {
351}; 463};
352 464
353/* l4_abe interface data */ 465/* l4_abe interface data */
466/* aess -> l4_abe */
467static struct omap_hwmod_ocp_if omap44xx_aess__l4_abe = {
468 .master = &omap44xx_aess_hwmod,
469 .slave = &omap44xx_l4_abe_hwmod,
470 .clk = "ocp_abe_iclk",
471 .user = OCP_USER_MPU | OCP_USER_SDMA,
472};
473
354/* dsp -> l4_abe */ 474/* dsp -> l4_abe */
355static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = { 475static struct omap_hwmod_ocp_if omap44xx_dsp__l4_abe = {
356 .master = &omap44xx_dsp_hwmod, 476 .master = &omap44xx_dsp_hwmod,
@@ -377,6 +497,7 @@ static struct omap_hwmod_ocp_if omap44xx_mpu__l4_abe = {
377 497
378/* l4_abe slave ports */ 498/* l4_abe slave ports */
379static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = { 499static struct omap_hwmod_ocp_if *omap44xx_l4_abe_slaves[] = {
500 &omap44xx_aess__l4_abe,
380 &omap44xx_dsp__l4_abe, 501 &omap44xx_dsp__l4_abe,
381 &omap44xx_l3_main_1__l4_abe, 502 &omap44xx_l3_main_1__l4_abe,
382 &omap44xx_mpu__l4_abe, 503 &omap44xx_mpu__l4_abe,
@@ -494,26 +615,15 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
494 * - They still need to be validated with the driver 615 * - They still need to be validated with the driver
495 * properly adapted to omap_hwmod / omap_device 616 * properly adapted to omap_hwmod / omap_device
496 * 617 *
497 * aess
498 * bandgap
499 * c2c 618 * c2c
500 * c2c_target_fw 619 * c2c_target_fw
501 * cm_core 620 * cm_core
502 * cm_core_aon 621 * cm_core_aon
503 * counter_32k
504 * ctrl_module_core 622 * ctrl_module_core
505 * ctrl_module_pad_core 623 * ctrl_module_pad_core
506 * ctrl_module_pad_wkup 624 * ctrl_module_pad_wkup
507 * ctrl_module_wkup 625 * ctrl_module_wkup
508 * debugss 626 * debugss
509 * dmic
510 * dss
511 * dss_dispc
512 * dss_dsi1
513 * dss_dsi2
514 * dss_hdmi
515 * dss_rfbi
516 * dss_venc
517 * efuse_ctrl_cust 627 * efuse_ctrl_cust
518 * efuse_ctrl_std 628 * efuse_ctrl_std
519 * elm 629 * elm
@@ -524,58 +634,211 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
524 * gpu 634 * gpu
525 * hdq1w 635 * hdq1w
526 * hsi 636 * hsi
527 * ipu
528 * iss
529 * kbd
530 * mailbox
531 * mcasp
532 * mcbsp1
533 * mcbsp2
534 * mcbsp3
535 * mcbsp4
536 * mcpdm
537 * mcspi1
538 * mcspi2
539 * mcspi3
540 * mcspi4
541 * mmc1
542 * mmc2
543 * mmc3
544 * mmc4
545 * mmc5
546 * mpu_c0
547 * mpu_c1
548 * ocmc_ram 637 * ocmc_ram
549 * ocp2scp_usb_phy 638 * ocp2scp_usb_phy
550 * ocp_wp_noc 639 * ocp_wp_noc
551 * prcm
552 * prcm_mpu 640 * prcm_mpu
553 * prm 641 * prm
554 * scrm 642 * scrm
555 * sl2if 643 * sl2if
556 * slimbus1 644 * slimbus1
557 * slimbus2 645 * slimbus2
558 * spinlock
559 * timer1
560 * timer10
561 * timer11
562 * timer2
563 * timer3
564 * timer4
565 * timer5
566 * timer6
567 * timer7
568 * timer8
569 * timer9
570 * usb_host_fs 646 * usb_host_fs
571 * usb_host_hs 647 * usb_host_hs
572 * usb_otg_hs
573 * usb_phy_cm 648 * usb_phy_cm
574 * usb_tll_hs 649 * usb_tll_hs
575 * usim 650 * usim
576 */ 651 */
577 652
578/* 653/*
654 * 'aess' class
655 * audio engine sub system
656 */
657
658static struct omap_hwmod_class_sysconfig omap44xx_aess_sysc = {
659 .rev_offs = 0x0000,
660 .sysc_offs = 0x0010,
661 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE),
662 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
663 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
664 .sysc_fields = &omap_hwmod_sysc_type2,
665};
666
667static struct omap_hwmod_class omap44xx_aess_hwmod_class = {
668 .name = "aess",
669 .sysc = &omap44xx_aess_sysc,
670};
671
672/* aess */
673static struct omap_hwmod_irq_info omap44xx_aess_irqs[] = {
674 { .irq = 99 + OMAP44XX_IRQ_GIC_START },
675};
676
677static struct omap_hwmod_dma_info omap44xx_aess_sdma_reqs[] = {
678 { .name = "fifo0", .dma_req = 100 + OMAP44XX_DMA_REQ_START },
679 { .name = "fifo1", .dma_req = 101 + OMAP44XX_DMA_REQ_START },
680 { .name = "fifo2", .dma_req = 102 + OMAP44XX_DMA_REQ_START },
681 { .name = "fifo3", .dma_req = 103 + OMAP44XX_DMA_REQ_START },
682 { .name = "fifo4", .dma_req = 104 + OMAP44XX_DMA_REQ_START },
683 { .name = "fifo5", .dma_req = 105 + OMAP44XX_DMA_REQ_START },
684 { .name = "fifo6", .dma_req = 106 + OMAP44XX_DMA_REQ_START },
685 { .name = "fifo7", .dma_req = 107 + OMAP44XX_DMA_REQ_START },
686};
687
688/* aess master ports */
689static struct omap_hwmod_ocp_if *omap44xx_aess_masters[] = {
690 &omap44xx_aess__l4_abe,
691};
692
693static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = {
694 {
695 .pa_start = 0x401f1000,
696 .pa_end = 0x401f13ff,
697 .flags = ADDR_TYPE_RT
698 },
699};
700
701/* l4_abe -> aess */
702static struct omap_hwmod_ocp_if omap44xx_l4_abe__aess = {
703 .master = &omap44xx_l4_abe_hwmod,
704 .slave = &omap44xx_aess_hwmod,
705 .clk = "ocp_abe_iclk",
706 .addr = omap44xx_aess_addrs,
707 .addr_cnt = ARRAY_SIZE(omap44xx_aess_addrs),
708 .user = OCP_USER_MPU,
709};
710
711static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = {
712 {
713 .pa_start = 0x490f1000,
714 .pa_end = 0x490f13ff,
715 .flags = ADDR_TYPE_RT
716 },
717};
718
719/* l4_abe -> aess (dma) */
720static struct omap_hwmod_ocp_if omap44xx_l4_abe__aess_dma = {
721 .master = &omap44xx_l4_abe_hwmod,
722 .slave = &omap44xx_aess_hwmod,
723 .clk = "ocp_abe_iclk",
724 .addr = omap44xx_aess_dma_addrs,
725 .addr_cnt = ARRAY_SIZE(omap44xx_aess_dma_addrs),
726 .user = OCP_USER_SDMA,
727};
728
729/* aess slave ports */
730static struct omap_hwmod_ocp_if *omap44xx_aess_slaves[] = {
731 &omap44xx_l4_abe__aess,
732 &omap44xx_l4_abe__aess_dma,
733};
734
735static struct omap_hwmod omap44xx_aess_hwmod = {
736 .name = "aess",
737 .class = &omap44xx_aess_hwmod_class,
738 .mpu_irqs = omap44xx_aess_irqs,
739 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_aess_irqs),
740 .sdma_reqs = omap44xx_aess_sdma_reqs,
741 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_aess_sdma_reqs),
742 .main_clk = "aess_fck",
743 .prcm = {
744 .omap4 = {
745 .clkctrl_reg = OMAP4430_CM1_ABE_AESS_CLKCTRL,
746 },
747 },
748 .slaves = omap44xx_aess_slaves,
749 .slaves_cnt = ARRAY_SIZE(omap44xx_aess_slaves),
750 .masters = omap44xx_aess_masters,
751 .masters_cnt = ARRAY_SIZE(omap44xx_aess_masters),
752 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
753};
754
755/*
756 * 'bandgap' class
757 * bangap reference for ldo regulators
758 */
759
760static struct omap_hwmod_class omap44xx_bandgap_hwmod_class = {
761 .name = "bandgap",
762};
763
764/* bandgap */
765static struct omap_hwmod_opt_clk bandgap_opt_clks[] = {
766 { .role = "fclk", .clk = "bandgap_fclk" },
767};
768
769static struct omap_hwmod omap44xx_bandgap_hwmod = {
770 .name = "bandgap",
771 .class = &omap44xx_bandgap_hwmod_class,
772 .prcm = {
773 .omap4 = {
774 .clkctrl_reg = OMAP4430_CM_WKUP_BANDGAP_CLKCTRL,
775 },
776 },
777 .opt_clks = bandgap_opt_clks,
778 .opt_clks_cnt = ARRAY_SIZE(bandgap_opt_clks),
779 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
780};
781
782/*
783 * 'counter' class
784 * 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock
785 */
786
787static struct omap_hwmod_class_sysconfig omap44xx_counter_sysc = {
788 .rev_offs = 0x0000,
789 .sysc_offs = 0x0004,
790 .sysc_flags = SYSC_HAS_SIDLEMODE,
791 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
792 SIDLE_SMART_WKUP),
793 .sysc_fields = &omap_hwmod_sysc_type1,
794};
795
796static struct omap_hwmod_class omap44xx_counter_hwmod_class = {
797 .name = "counter",
798 .sysc = &omap44xx_counter_sysc,
799};
800
801/* counter_32k */
802static struct omap_hwmod omap44xx_counter_32k_hwmod;
803static struct omap_hwmod_addr_space omap44xx_counter_32k_addrs[] = {
804 {
805 .pa_start = 0x4a304000,
806 .pa_end = 0x4a30401f,
807 .flags = ADDR_TYPE_RT
808 },
809};
810
811/* l4_wkup -> counter_32k */
812static struct omap_hwmod_ocp_if omap44xx_l4_wkup__counter_32k = {
813 .master = &omap44xx_l4_wkup_hwmod,
814 .slave = &omap44xx_counter_32k_hwmod,
815 .clk = "l4_wkup_clk_mux_ck",
816 .addr = omap44xx_counter_32k_addrs,
817 .addr_cnt = ARRAY_SIZE(omap44xx_counter_32k_addrs),
818 .user = OCP_USER_MPU | OCP_USER_SDMA,
819};
820
821/* counter_32k slave ports */
822static struct omap_hwmod_ocp_if *omap44xx_counter_32k_slaves[] = {
823 &omap44xx_l4_wkup__counter_32k,
824};
825
826static struct omap_hwmod omap44xx_counter_32k_hwmod = {
827 .name = "counter_32k",
828 .class = &omap44xx_counter_hwmod_class,
829 .flags = HWMOD_SWSUP_SIDLE,
830 .main_clk = "sys_32k_ck",
831 .prcm = {
832 .omap4 = {
833 .clkctrl_reg = OMAP4430_CM_WKUP_SYNCTIMER_CLKCTRL,
834 },
835 },
836 .slaves = omap44xx_counter_32k_slaves,
837 .slaves_cnt = ARRAY_SIZE(omap44xx_counter_32k_slaves),
838 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
839};
840
841/*
579 * 'dma' class 842 * 'dma' class
580 * dma controller for data exchange between memory to memory (i.e. internal or 843 * dma controller for data exchange between memory to memory (i.e. internal or
581 * external memory) and gp peripherals to memory or memory to gp peripherals 844 * external memory) and gp peripherals to memory or memory to gp peripherals
@@ -662,6 +925,96 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = {
662}; 925};
663 926
664/* 927/*
928 * 'dmic' class
929 * digital microphone controller
930 */
931
932static struct omap_hwmod_class_sysconfig omap44xx_dmic_sysc = {
933 .rev_offs = 0x0000,
934 .sysc_offs = 0x0010,
935 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
936 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
937 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
938 SIDLE_SMART_WKUP),
939 .sysc_fields = &omap_hwmod_sysc_type2,
940};
941
942static struct omap_hwmod_class omap44xx_dmic_hwmod_class = {
943 .name = "dmic",
944 .sysc = &omap44xx_dmic_sysc,
945};
946
947/* dmic */
948static struct omap_hwmod omap44xx_dmic_hwmod;
949static struct omap_hwmod_irq_info omap44xx_dmic_irqs[] = {
950 { .irq = 114 + OMAP44XX_IRQ_GIC_START },
951};
952
953static struct omap_hwmod_dma_info omap44xx_dmic_sdma_reqs[] = {
954 { .dma_req = 66 + OMAP44XX_DMA_REQ_START },
955};
956
957static struct omap_hwmod_addr_space omap44xx_dmic_addrs[] = {
958 {
959 .pa_start = 0x4012e000,
960 .pa_end = 0x4012e07f,
961 .flags = ADDR_TYPE_RT
962 },
963};
964
965/* l4_abe -> dmic */
966static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic = {
967 .master = &omap44xx_l4_abe_hwmod,
968 .slave = &omap44xx_dmic_hwmod,
969 .clk = "ocp_abe_iclk",
970 .addr = omap44xx_dmic_addrs,
971 .addr_cnt = ARRAY_SIZE(omap44xx_dmic_addrs),
972 .user = OCP_USER_MPU,
973};
974
975static struct omap_hwmod_addr_space omap44xx_dmic_dma_addrs[] = {
976 {
977 .pa_start = 0x4902e000,
978 .pa_end = 0x4902e07f,
979 .flags = ADDR_TYPE_RT
980 },
981};
982
983/* l4_abe -> dmic (dma) */
984static struct omap_hwmod_ocp_if omap44xx_l4_abe__dmic_dma = {
985 .master = &omap44xx_l4_abe_hwmod,
986 .slave = &omap44xx_dmic_hwmod,
987 .clk = "ocp_abe_iclk",
988 .addr = omap44xx_dmic_dma_addrs,
989 .addr_cnt = ARRAY_SIZE(omap44xx_dmic_dma_addrs),
990 .user = OCP_USER_SDMA,
991};
992
993/* dmic slave ports */
994static struct omap_hwmod_ocp_if *omap44xx_dmic_slaves[] = {
995 &omap44xx_l4_abe__dmic,
996 &omap44xx_l4_abe__dmic_dma,
997};
998
999static struct omap_hwmod omap44xx_dmic_hwmod = {
1000 .name = "dmic",
1001 .class = &omap44xx_dmic_hwmod_class,
1002 .mpu_irqs = omap44xx_dmic_irqs,
1003 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dmic_irqs),
1004 .sdma_reqs = omap44xx_dmic_sdma_reqs,
1005 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dmic_sdma_reqs),
1006 .main_clk = "dmic_fck",
1007 .prcm = {
1008 .omap4 = {
1009 .clkctrl_reg = OMAP4430_CM1_ABE_DMIC_CLKCTRL,
1010 },
1011 },
1012 .slaves = omap44xx_dmic_slaves,
1013 .slaves_cnt = ARRAY_SIZE(omap44xx_dmic_slaves),
1014 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1015};
1016
1017/*
665 * 'dsp' class 1018 * 'dsp' class
666 * dsp sub-system 1019 * dsp sub-system
667 */ 1020 */
@@ -747,6 +1100,590 @@ static struct omap_hwmod omap44xx_dsp_hwmod = {
747}; 1100};
748 1101
749/* 1102/*
1103 * 'dss' class
1104 * display sub-system
1105 */
1106
1107static struct omap_hwmod_class_sysconfig omap44xx_dss_sysc = {
1108 .rev_offs = 0x0000,
1109 .syss_offs = 0x0014,
1110 .sysc_flags = SYSS_HAS_RESET_STATUS,
1111};
1112
1113static struct omap_hwmod_class omap44xx_dss_hwmod_class = {
1114 .name = "dss",
1115 .sysc = &omap44xx_dss_sysc,
1116};
1117
1118/* dss */
1119/* dss master ports */
1120static struct omap_hwmod_ocp_if *omap44xx_dss_masters[] = {
1121 &omap44xx_dss__l3_main_1,
1122};
1123
1124static struct omap_hwmod_addr_space omap44xx_dss_dma_addrs[] = {
1125 {
1126 .pa_start = 0x58000000,
1127 .pa_end = 0x5800007f,
1128 .flags = ADDR_TYPE_RT
1129 },
1130};
1131
1132/* l3_main_2 -> dss */
1133static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss = {
1134 .master = &omap44xx_l3_main_2_hwmod,
1135 .slave = &omap44xx_dss_hwmod,
1136 .clk = "l3_div_ck",
1137 .addr = omap44xx_dss_dma_addrs,
1138 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dma_addrs),
1139 .user = OCP_USER_SDMA,
1140};
1141
1142static struct omap_hwmod_addr_space omap44xx_dss_addrs[] = {
1143 {
1144 .pa_start = 0x48040000,
1145 .pa_end = 0x4804007f,
1146 .flags = ADDR_TYPE_RT
1147 },
1148};
1149
1150/* l4_per -> dss */
1151static struct omap_hwmod_ocp_if omap44xx_l4_per__dss = {
1152 .master = &omap44xx_l4_per_hwmod,
1153 .slave = &omap44xx_dss_hwmod,
1154 .clk = "l4_div_ck",
1155 .addr = omap44xx_dss_addrs,
1156 .addr_cnt = ARRAY_SIZE(omap44xx_dss_addrs),
1157 .user = OCP_USER_MPU,
1158};
1159
1160/* dss slave ports */
1161static struct omap_hwmod_ocp_if *omap44xx_dss_slaves[] = {
1162 &omap44xx_l3_main_2__dss,
1163 &omap44xx_l4_per__dss,
1164};
1165
1166static struct omap_hwmod_opt_clk dss_opt_clks[] = {
1167 { .role = "sys_clk", .clk = "dss_sys_clk" },
1168 { .role = "tv_clk", .clk = "dss_tv_clk" },
1169 { .role = "dss_clk", .clk = "dss_dss_clk" },
1170 { .role = "video_clk", .clk = "dss_48mhz_clk" },
1171};
1172
1173static struct omap_hwmod omap44xx_dss_hwmod = {
1174 .name = "dss_core",
1175 .class = &omap44xx_dss_hwmod_class,
1176 .main_clk = "dss_fck",
1177 .prcm = {
1178 .omap4 = {
1179 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1180 },
1181 },
1182 .opt_clks = dss_opt_clks,
1183 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
1184 .slaves = omap44xx_dss_slaves,
1185 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_slaves),
1186 .masters = omap44xx_dss_masters,
1187 .masters_cnt = ARRAY_SIZE(omap44xx_dss_masters),
1188 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1189};
1190
1191/*
1192 * 'dispc' class
1193 * display controller
1194 */
1195
1196static struct omap_hwmod_class_sysconfig omap44xx_dispc_sysc = {
1197 .rev_offs = 0x0000,
1198 .sysc_offs = 0x0010,
1199 .syss_offs = 0x0014,
1200 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1201 SYSC_HAS_ENAWAKEUP | SYSC_HAS_MIDLEMODE |
1202 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1203 SYSS_HAS_RESET_STATUS),
1204 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1205 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
1206 .sysc_fields = &omap_hwmod_sysc_type1,
1207};
1208
1209static struct omap_hwmod_class omap44xx_dispc_hwmod_class = {
1210 .name = "dispc",
1211 .sysc = &omap44xx_dispc_sysc,
1212};
1213
1214/* dss_dispc */
1215static struct omap_hwmod omap44xx_dss_dispc_hwmod;
1216static struct omap_hwmod_irq_info omap44xx_dss_dispc_irqs[] = {
1217 { .irq = 25 + OMAP44XX_IRQ_GIC_START },
1218};
1219
1220static struct omap_hwmod_dma_info omap44xx_dss_dispc_sdma_reqs[] = {
1221 { .dma_req = 5 + OMAP44XX_DMA_REQ_START },
1222};
1223
1224static struct omap_hwmod_addr_space omap44xx_dss_dispc_dma_addrs[] = {
1225 {
1226 .pa_start = 0x58001000,
1227 .pa_end = 0x58001fff,
1228 .flags = ADDR_TYPE_RT
1229 },
1230};
1231
1232/* l3_main_2 -> dss_dispc */
1233static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dispc = {
1234 .master = &omap44xx_l3_main_2_hwmod,
1235 .slave = &omap44xx_dss_dispc_hwmod,
1236 .clk = "l3_div_ck",
1237 .addr = omap44xx_dss_dispc_dma_addrs,
1238 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dispc_dma_addrs),
1239 .user = OCP_USER_SDMA,
1240};
1241
1242static struct omap_hwmod_addr_space omap44xx_dss_dispc_addrs[] = {
1243 {
1244 .pa_start = 0x48041000,
1245 .pa_end = 0x48041fff,
1246 .flags = ADDR_TYPE_RT
1247 },
1248};
1249
1250/* l4_per -> dss_dispc */
1251static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = {
1252 .master = &omap44xx_l4_per_hwmod,
1253 .slave = &omap44xx_dss_dispc_hwmod,
1254 .clk = "l4_div_ck",
1255 .addr = omap44xx_dss_dispc_addrs,
1256 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dispc_addrs),
1257 .user = OCP_USER_MPU,
1258};
1259
1260/* dss_dispc slave ports */
1261static struct omap_hwmod_ocp_if *omap44xx_dss_dispc_slaves[] = {
1262 &omap44xx_l3_main_2__dss_dispc,
1263 &omap44xx_l4_per__dss_dispc,
1264};
1265
1266static struct omap_hwmod omap44xx_dss_dispc_hwmod = {
1267 .name = "dss_dispc",
1268 .class = &omap44xx_dispc_hwmod_class,
1269 .mpu_irqs = omap44xx_dss_dispc_irqs,
1270 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dispc_irqs),
1271 .sdma_reqs = omap44xx_dss_dispc_sdma_reqs,
1272 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dispc_sdma_reqs),
1273 .main_clk = "dss_fck",
1274 .prcm = {
1275 .omap4 = {
1276 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1277 },
1278 },
1279 .slaves = omap44xx_dss_dispc_slaves,
1280 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves),
1281 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1282};
1283
1284/*
1285 * 'dsi' class
1286 * display serial interface controller
1287 */
1288
1289static struct omap_hwmod_class_sysconfig omap44xx_dsi_sysc = {
1290 .rev_offs = 0x0000,
1291 .sysc_offs = 0x0010,
1292 .syss_offs = 0x0014,
1293 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1294 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1295 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1296 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1297 .sysc_fields = &omap_hwmod_sysc_type1,
1298};
1299
1300static struct omap_hwmod_class omap44xx_dsi_hwmod_class = {
1301 .name = "dsi",
1302 .sysc = &omap44xx_dsi_sysc,
1303};
1304
1305/* dss_dsi1 */
1306static struct omap_hwmod omap44xx_dss_dsi1_hwmod;
1307static struct omap_hwmod_irq_info omap44xx_dss_dsi1_irqs[] = {
1308 { .irq = 53 + OMAP44XX_IRQ_GIC_START },
1309};
1310
1311static struct omap_hwmod_dma_info omap44xx_dss_dsi1_sdma_reqs[] = {
1312 { .dma_req = 74 + OMAP44XX_DMA_REQ_START },
1313};
1314
1315static struct omap_hwmod_addr_space omap44xx_dss_dsi1_dma_addrs[] = {
1316 {
1317 .pa_start = 0x58004000,
1318 .pa_end = 0x580041ff,
1319 .flags = ADDR_TYPE_RT
1320 },
1321};
1322
1323/* l3_main_2 -> dss_dsi1 */
1324static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi1 = {
1325 .master = &omap44xx_l3_main_2_hwmod,
1326 .slave = &omap44xx_dss_dsi1_hwmod,
1327 .clk = "l3_div_ck",
1328 .addr = omap44xx_dss_dsi1_dma_addrs,
1329 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_dma_addrs),
1330 .user = OCP_USER_SDMA,
1331};
1332
1333static struct omap_hwmod_addr_space omap44xx_dss_dsi1_addrs[] = {
1334 {
1335 .pa_start = 0x48044000,
1336 .pa_end = 0x480441ff,
1337 .flags = ADDR_TYPE_RT
1338 },
1339};
1340
1341/* l4_per -> dss_dsi1 */
1342static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi1 = {
1343 .master = &omap44xx_l4_per_hwmod,
1344 .slave = &omap44xx_dss_dsi1_hwmod,
1345 .clk = "l4_div_ck",
1346 .addr = omap44xx_dss_dsi1_addrs,
1347 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_addrs),
1348 .user = OCP_USER_MPU,
1349};
1350
1351/* dss_dsi1 slave ports */
1352static struct omap_hwmod_ocp_if *omap44xx_dss_dsi1_slaves[] = {
1353 &omap44xx_l3_main_2__dss_dsi1,
1354 &omap44xx_l4_per__dss_dsi1,
1355};
1356
1357static struct omap_hwmod omap44xx_dss_dsi1_hwmod = {
1358 .name = "dss_dsi1",
1359 .class = &omap44xx_dsi_hwmod_class,
1360 .mpu_irqs = omap44xx_dss_dsi1_irqs,
1361 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_irqs),
1362 .sdma_reqs = omap44xx_dss_dsi1_sdma_reqs,
1363 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_sdma_reqs),
1364 .main_clk = "dss_fck",
1365 .prcm = {
1366 .omap4 = {
1367 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1368 },
1369 },
1370 .slaves = omap44xx_dss_dsi1_slaves,
1371 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_slaves),
1372 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1373};
1374
1375/* dss_dsi2 */
1376static struct omap_hwmod omap44xx_dss_dsi2_hwmod;
1377static struct omap_hwmod_irq_info omap44xx_dss_dsi2_irqs[] = {
1378 { .irq = 84 + OMAP44XX_IRQ_GIC_START },
1379};
1380
1381static struct omap_hwmod_dma_info omap44xx_dss_dsi2_sdma_reqs[] = {
1382 { .dma_req = 83 + OMAP44XX_DMA_REQ_START },
1383};
1384
1385static struct omap_hwmod_addr_space omap44xx_dss_dsi2_dma_addrs[] = {
1386 {
1387 .pa_start = 0x58005000,
1388 .pa_end = 0x580051ff,
1389 .flags = ADDR_TYPE_RT
1390 },
1391};
1392
1393/* l3_main_2 -> dss_dsi2 */
1394static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi2 = {
1395 .master = &omap44xx_l3_main_2_hwmod,
1396 .slave = &omap44xx_dss_dsi2_hwmod,
1397 .clk = "l3_div_ck",
1398 .addr = omap44xx_dss_dsi2_dma_addrs,
1399 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_dma_addrs),
1400 .user = OCP_USER_SDMA,
1401};
1402
1403static struct omap_hwmod_addr_space omap44xx_dss_dsi2_addrs[] = {
1404 {
1405 .pa_start = 0x48045000,
1406 .pa_end = 0x480451ff,
1407 .flags = ADDR_TYPE_RT
1408 },
1409};
1410
1411/* l4_per -> dss_dsi2 */
1412static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi2 = {
1413 .master = &omap44xx_l4_per_hwmod,
1414 .slave = &omap44xx_dss_dsi2_hwmod,
1415 .clk = "l4_div_ck",
1416 .addr = omap44xx_dss_dsi2_addrs,
1417 .addr_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_addrs),
1418 .user = OCP_USER_MPU,
1419};
1420
1421/* dss_dsi2 slave ports */
1422static struct omap_hwmod_ocp_if *omap44xx_dss_dsi2_slaves[] = {
1423 &omap44xx_l3_main_2__dss_dsi2,
1424 &omap44xx_l4_per__dss_dsi2,
1425};
1426
1427static struct omap_hwmod omap44xx_dss_dsi2_hwmod = {
1428 .name = "dss_dsi2",
1429 .class = &omap44xx_dsi_hwmod_class,
1430 .mpu_irqs = omap44xx_dss_dsi2_irqs,
1431 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_irqs),
1432 .sdma_reqs = omap44xx_dss_dsi2_sdma_reqs,
1433 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_sdma_reqs),
1434 .main_clk = "dss_fck",
1435 .prcm = {
1436 .omap4 = {
1437 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1438 },
1439 },
1440 .slaves = omap44xx_dss_dsi2_slaves,
1441 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_slaves),
1442 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1443};
1444
1445/*
1446 * 'hdmi' class
1447 * hdmi controller
1448 */
1449
1450static struct omap_hwmod_class_sysconfig omap44xx_hdmi_sysc = {
1451 .rev_offs = 0x0000,
1452 .sysc_offs = 0x0010,
1453 .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
1454 SYSC_HAS_SOFTRESET),
1455 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1456 SIDLE_SMART_WKUP),
1457 .sysc_fields = &omap_hwmod_sysc_type2,
1458};
1459
1460static struct omap_hwmod_class omap44xx_hdmi_hwmod_class = {
1461 .name = "hdmi",
1462 .sysc = &omap44xx_hdmi_sysc,
1463};
1464
1465/* dss_hdmi */
1466static struct omap_hwmod omap44xx_dss_hdmi_hwmod;
1467static struct omap_hwmod_irq_info omap44xx_dss_hdmi_irqs[] = {
1468 { .irq = 101 + OMAP44XX_IRQ_GIC_START },
1469};
1470
1471static struct omap_hwmod_dma_info omap44xx_dss_hdmi_sdma_reqs[] = {
1472 { .dma_req = 75 + OMAP44XX_DMA_REQ_START },
1473};
1474
1475static struct omap_hwmod_addr_space omap44xx_dss_hdmi_dma_addrs[] = {
1476 {
1477 .pa_start = 0x58006000,
1478 .pa_end = 0x58006fff,
1479 .flags = ADDR_TYPE_RT
1480 },
1481};
1482
1483/* l3_main_2 -> dss_hdmi */
1484static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_hdmi = {
1485 .master = &omap44xx_l3_main_2_hwmod,
1486 .slave = &omap44xx_dss_hdmi_hwmod,
1487 .clk = "l3_div_ck",
1488 .addr = omap44xx_dss_hdmi_dma_addrs,
1489 .addr_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_dma_addrs),
1490 .user = OCP_USER_SDMA,
1491};
1492
1493static struct omap_hwmod_addr_space omap44xx_dss_hdmi_addrs[] = {
1494 {
1495 .pa_start = 0x48046000,
1496 .pa_end = 0x48046fff,
1497 .flags = ADDR_TYPE_RT
1498 },
1499};
1500
1501/* l4_per -> dss_hdmi */
1502static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_hdmi = {
1503 .master = &omap44xx_l4_per_hwmod,
1504 .slave = &omap44xx_dss_hdmi_hwmod,
1505 .clk = "l4_div_ck",
1506 .addr = omap44xx_dss_hdmi_addrs,
1507 .addr_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_addrs),
1508 .user = OCP_USER_MPU,
1509};
1510
1511/* dss_hdmi slave ports */
1512static struct omap_hwmod_ocp_if *omap44xx_dss_hdmi_slaves[] = {
1513 &omap44xx_l3_main_2__dss_hdmi,
1514 &omap44xx_l4_per__dss_hdmi,
1515};
1516
1517static struct omap_hwmod omap44xx_dss_hdmi_hwmod = {
1518 .name = "dss_hdmi",
1519 .class = &omap44xx_hdmi_hwmod_class,
1520 .mpu_irqs = omap44xx_dss_hdmi_irqs,
1521 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_irqs),
1522 .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs,
1523 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_sdma_reqs),
1524 .main_clk = "dss_fck",
1525 .prcm = {
1526 .omap4 = {
1527 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1528 },
1529 },
1530 .slaves = omap44xx_dss_hdmi_slaves,
1531 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_slaves),
1532 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1533};
1534
1535/*
1536 * 'rfbi' class
1537 * remote frame buffer interface
1538 */
1539
1540static struct omap_hwmod_class_sysconfig omap44xx_rfbi_sysc = {
1541 .rev_offs = 0x0000,
1542 .sysc_offs = 0x0010,
1543 .syss_offs = 0x0014,
1544 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
1545 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1546 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1547 .sysc_fields = &omap_hwmod_sysc_type1,
1548};
1549
1550static struct omap_hwmod_class omap44xx_rfbi_hwmod_class = {
1551 .name = "rfbi",
1552 .sysc = &omap44xx_rfbi_sysc,
1553};
1554
1555/* dss_rfbi */
1556static struct omap_hwmod omap44xx_dss_rfbi_hwmod;
1557static struct omap_hwmod_dma_info omap44xx_dss_rfbi_sdma_reqs[] = {
1558 { .dma_req = 13 + OMAP44XX_DMA_REQ_START },
1559};
1560
1561static struct omap_hwmod_addr_space omap44xx_dss_rfbi_dma_addrs[] = {
1562 {
1563 .pa_start = 0x58002000,
1564 .pa_end = 0x580020ff,
1565 .flags = ADDR_TYPE_RT
1566 },
1567};
1568
1569/* l3_main_2 -> dss_rfbi */
1570static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_rfbi = {
1571 .master = &omap44xx_l3_main_2_hwmod,
1572 .slave = &omap44xx_dss_rfbi_hwmod,
1573 .clk = "l3_div_ck",
1574 .addr = omap44xx_dss_rfbi_dma_addrs,
1575 .addr_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_dma_addrs),
1576 .user = OCP_USER_SDMA,
1577};
1578
1579static struct omap_hwmod_addr_space omap44xx_dss_rfbi_addrs[] = {
1580 {
1581 .pa_start = 0x48042000,
1582 .pa_end = 0x480420ff,
1583 .flags = ADDR_TYPE_RT
1584 },
1585};
1586
1587/* l4_per -> dss_rfbi */
1588static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_rfbi = {
1589 .master = &omap44xx_l4_per_hwmod,
1590 .slave = &omap44xx_dss_rfbi_hwmod,
1591 .clk = "l4_div_ck",
1592 .addr = omap44xx_dss_rfbi_addrs,
1593 .addr_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_addrs),
1594 .user = OCP_USER_MPU,
1595};
1596
1597/* dss_rfbi slave ports */
1598static struct omap_hwmod_ocp_if *omap44xx_dss_rfbi_slaves[] = {
1599 &omap44xx_l3_main_2__dss_rfbi,
1600 &omap44xx_l4_per__dss_rfbi,
1601};
1602
1603static struct omap_hwmod omap44xx_dss_rfbi_hwmod = {
1604 .name = "dss_rfbi",
1605 .class = &omap44xx_rfbi_hwmod_class,
1606 .sdma_reqs = omap44xx_dss_rfbi_sdma_reqs,
1607 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_sdma_reqs),
1608 .main_clk = "dss_fck",
1609 .prcm = {
1610 .omap4 = {
1611 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1612 },
1613 },
1614 .slaves = omap44xx_dss_rfbi_slaves,
1615 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_slaves),
1616 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1617};
1618
1619/*
1620 * 'venc' class
1621 * video encoder
1622 */
1623
1624static struct omap_hwmod_class omap44xx_venc_hwmod_class = {
1625 .name = "venc",
1626};
1627
1628/* dss_venc */
1629static struct omap_hwmod omap44xx_dss_venc_hwmod;
1630static struct omap_hwmod_addr_space omap44xx_dss_venc_dma_addrs[] = {
1631 {
1632 .pa_start = 0x58003000,
1633 .pa_end = 0x580030ff,
1634 .flags = ADDR_TYPE_RT
1635 },
1636};
1637
1638/* l3_main_2 -> dss_venc */
1639static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_venc = {
1640 .master = &omap44xx_l3_main_2_hwmod,
1641 .slave = &omap44xx_dss_venc_hwmod,
1642 .clk = "l3_div_ck",
1643 .addr = omap44xx_dss_venc_dma_addrs,
1644 .addr_cnt = ARRAY_SIZE(omap44xx_dss_venc_dma_addrs),
1645 .user = OCP_USER_SDMA,
1646};
1647
1648static struct omap_hwmod_addr_space omap44xx_dss_venc_addrs[] = {
1649 {
1650 .pa_start = 0x48043000,
1651 .pa_end = 0x480430ff,
1652 .flags = ADDR_TYPE_RT
1653 },
1654};
1655
1656/* l4_per -> dss_venc */
1657static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_venc = {
1658 .master = &omap44xx_l4_per_hwmod,
1659 .slave = &omap44xx_dss_venc_hwmod,
1660 .clk = "l4_div_ck",
1661 .addr = omap44xx_dss_venc_addrs,
1662 .addr_cnt = ARRAY_SIZE(omap44xx_dss_venc_addrs),
1663 .user = OCP_USER_MPU,
1664};
1665
1666/* dss_venc slave ports */
1667static struct omap_hwmod_ocp_if *omap44xx_dss_venc_slaves[] = {
1668 &omap44xx_l3_main_2__dss_venc,
1669 &omap44xx_l4_per__dss_venc,
1670};
1671
1672static struct omap_hwmod omap44xx_dss_venc_hwmod = {
1673 .name = "dss_venc",
1674 .class = &omap44xx_venc_hwmod_class,
1675 .main_clk = "dss_fck",
1676 .prcm = {
1677 .omap4 = {
1678 .clkctrl_reg = OMAP4430_CM_DSS_DSS_CLKCTRL,
1679 },
1680 },
1681 .slaves = omap44xx_dss_venc_slaves,
1682 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_venc_slaves),
1683 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1684};
1685
1686/*
750 * 'gpio' class 1687 * 'gpio' class
751 * general purpose io module 1688 * general purpose io module
752 */ 1689 */
@@ -1093,6 +2030,83 @@ static struct omap_hwmod omap44xx_gpio6_hwmod = {
1093}; 2030};
1094 2031
1095/* 2032/*
2033 * 'hsi' class
2034 * mipi high-speed synchronous serial interface (multichannel and full-duplex
2035 * serial if)
2036 */
2037
2038static struct omap_hwmod_class_sysconfig omap44xx_hsi_sysc = {
2039 .rev_offs = 0x0000,
2040 .sysc_offs = 0x0010,
2041 .syss_offs = 0x0014,
2042 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_EMUFREE |
2043 SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
2044 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
2045 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2046 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
2047 MSTANDBY_SMART),
2048 .sysc_fields = &omap_hwmod_sysc_type1,
2049};
2050
2051static struct omap_hwmod_class omap44xx_hsi_hwmod_class = {
2052 .name = "hsi",
2053 .sysc = &omap44xx_hsi_sysc,
2054};
2055
2056/* hsi */
2057static struct omap_hwmod_irq_info omap44xx_hsi_irqs[] = {
2058 { .name = "mpu_p1", .irq = 67 + OMAP44XX_IRQ_GIC_START },
2059 { .name = "mpu_p2", .irq = 68 + OMAP44XX_IRQ_GIC_START },
2060 { .name = "mpu_dma", .irq = 71 + OMAP44XX_IRQ_GIC_START },
2061};
2062
2063/* hsi master ports */
2064static struct omap_hwmod_ocp_if *omap44xx_hsi_masters[] = {
2065 &omap44xx_hsi__l3_main_2,
2066};
2067
2068static struct omap_hwmod_addr_space omap44xx_hsi_addrs[] = {
2069 {
2070 .pa_start = 0x4a058000,
2071 .pa_end = 0x4a05bfff,
2072 .flags = ADDR_TYPE_RT
2073 },
2074};
2075
2076/* l4_cfg -> hsi */
2077static struct omap_hwmod_ocp_if omap44xx_l4_cfg__hsi = {
2078 .master = &omap44xx_l4_cfg_hwmod,
2079 .slave = &omap44xx_hsi_hwmod,
2080 .clk = "l4_div_ck",
2081 .addr = omap44xx_hsi_addrs,
2082 .addr_cnt = ARRAY_SIZE(omap44xx_hsi_addrs),
2083 .user = OCP_USER_MPU | OCP_USER_SDMA,
2084};
2085
2086/* hsi slave ports */
2087static struct omap_hwmod_ocp_if *omap44xx_hsi_slaves[] = {
2088 &omap44xx_l4_cfg__hsi,
2089};
2090
2091static struct omap_hwmod omap44xx_hsi_hwmod = {
2092 .name = "hsi",
2093 .class = &omap44xx_hsi_hwmod_class,
2094 .mpu_irqs = omap44xx_hsi_irqs,
2095 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_hsi_irqs),
2096 .main_clk = "hsi_fck",
2097 .prcm = {
2098 .omap4 = {
2099 .clkctrl_reg = OMAP4430_CM_L3INIT_HSI_CLKCTRL,
2100 },
2101 },
2102 .slaves = omap44xx_hsi_slaves,
2103 .slaves_cnt = ARRAY_SIZE(omap44xx_hsi_slaves),
2104 .masters = omap44xx_hsi_masters,
2105 .masters_cnt = ARRAY_SIZE(omap44xx_hsi_masters),
2106 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2107};
2108
2109/*
1096 * 'i2c' class 2110 * 'i2c' class
1097 * multimaster high-speed i2c controller 2111 * multimaster high-speed i2c controller
1098 */ 2112 */
@@ -1326,6 +2340,188 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = {
1326}; 2340};
1327 2341
1328/* 2342/*
2343 * 'ipu' class
2344 * imaging processor unit
2345 */
2346
2347static struct omap_hwmod_class omap44xx_ipu_hwmod_class = {
2348 .name = "ipu",
2349};
2350
2351/* ipu */
2352static struct omap_hwmod_irq_info omap44xx_ipu_irqs[] = {
2353 { .irq = 100 + OMAP44XX_IRQ_GIC_START },
2354};
2355
2356static struct omap_hwmod_rst_info omap44xx_ipu_c0_resets[] = {
2357 { .name = "cpu0", .rst_shift = 0 },
2358};
2359
2360static struct omap_hwmod_rst_info omap44xx_ipu_c1_resets[] = {
2361 { .name = "cpu1", .rst_shift = 1 },
2362};
2363
2364static struct omap_hwmod_rst_info omap44xx_ipu_resets[] = {
2365 { .name = "mmu_cache", .rst_shift = 2 },
2366};
2367
2368/* ipu master ports */
2369static struct omap_hwmod_ocp_if *omap44xx_ipu_masters[] = {
2370 &omap44xx_ipu__l3_main_2,
2371};
2372
2373/* l3_main_2 -> ipu */
2374static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ipu = {
2375 .master = &omap44xx_l3_main_2_hwmod,
2376 .slave = &omap44xx_ipu_hwmod,
2377 .clk = "l3_div_ck",
2378 .user = OCP_USER_MPU | OCP_USER_SDMA,
2379};
2380
2381/* ipu slave ports */
2382static struct omap_hwmod_ocp_if *omap44xx_ipu_slaves[] = {
2383 &omap44xx_l3_main_2__ipu,
2384};
2385
2386/* Pseudo hwmod for reset control purpose only */
2387static struct omap_hwmod omap44xx_ipu_c0_hwmod = {
2388 .name = "ipu_c0",
2389 .class = &omap44xx_ipu_hwmod_class,
2390 .flags = HWMOD_INIT_NO_RESET,
2391 .rst_lines = omap44xx_ipu_c0_resets,
2392 .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_c0_resets),
2393 .prcm = {
2394 .omap4 = {
2395 .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL,
2396 },
2397 },
2398 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2399};
2400
2401/* Pseudo hwmod for reset control purpose only */
2402static struct omap_hwmod omap44xx_ipu_c1_hwmod = {
2403 .name = "ipu_c1",
2404 .class = &omap44xx_ipu_hwmod_class,
2405 .flags = HWMOD_INIT_NO_RESET,
2406 .rst_lines = omap44xx_ipu_c1_resets,
2407 .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_c1_resets),
2408 .prcm = {
2409 .omap4 = {
2410 .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL,
2411 },
2412 },
2413 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2414};
2415
2416static struct omap_hwmod omap44xx_ipu_hwmod = {
2417 .name = "ipu",
2418 .class = &omap44xx_ipu_hwmod_class,
2419 .mpu_irqs = omap44xx_ipu_irqs,
2420 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_ipu_irqs),
2421 .rst_lines = omap44xx_ipu_resets,
2422 .rst_lines_cnt = ARRAY_SIZE(omap44xx_ipu_resets),
2423 .main_clk = "ipu_fck",
2424 .prcm = {
2425 .omap4 = {
2426 .clkctrl_reg = OMAP4430_CM_DUCATI_DUCATI_CLKCTRL,
2427 .rstctrl_reg = OMAP4430_RM_DUCATI_RSTCTRL,
2428 },
2429 },
2430 .slaves = omap44xx_ipu_slaves,
2431 .slaves_cnt = ARRAY_SIZE(omap44xx_ipu_slaves),
2432 .masters = omap44xx_ipu_masters,
2433 .masters_cnt = ARRAY_SIZE(omap44xx_ipu_masters),
2434 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2435};
2436
2437/*
2438 * 'iss' class
2439 * external images sensor pixel data processor
2440 */
2441
2442static struct omap_hwmod_class_sysconfig omap44xx_iss_sysc = {
2443 .rev_offs = 0x0000,
2444 .sysc_offs = 0x0010,
2445 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
2446 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
2447 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2448 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
2449 MSTANDBY_SMART),
2450 .sysc_fields = &omap_hwmod_sysc_type2,
2451};
2452
2453static struct omap_hwmod_class omap44xx_iss_hwmod_class = {
2454 .name = "iss",
2455 .sysc = &omap44xx_iss_sysc,
2456};
2457
2458/* iss */
2459static struct omap_hwmod_irq_info omap44xx_iss_irqs[] = {
2460 { .irq = 24 + OMAP44XX_IRQ_GIC_START },
2461};
2462
2463static struct omap_hwmod_dma_info omap44xx_iss_sdma_reqs[] = {
2464 { .name = "1", .dma_req = 8 + OMAP44XX_DMA_REQ_START },
2465 { .name = "2", .dma_req = 9 + OMAP44XX_DMA_REQ_START },
2466 { .name = "3", .dma_req = 11 + OMAP44XX_DMA_REQ_START },
2467 { .name = "4", .dma_req = 12 + OMAP44XX_DMA_REQ_START },
2468};
2469
2470/* iss master ports */
2471static struct omap_hwmod_ocp_if *omap44xx_iss_masters[] = {
2472 &omap44xx_iss__l3_main_2,
2473};
2474
2475static struct omap_hwmod_addr_space omap44xx_iss_addrs[] = {
2476 {
2477 .pa_start = 0x52000000,
2478 .pa_end = 0x520000ff,
2479 .flags = ADDR_TYPE_RT
2480 },
2481};
2482
2483/* l3_main_2 -> iss */
2484static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iss = {
2485 .master = &omap44xx_l3_main_2_hwmod,
2486 .slave = &omap44xx_iss_hwmod,
2487 .clk = "l3_div_ck",
2488 .addr = omap44xx_iss_addrs,
2489 .addr_cnt = ARRAY_SIZE(omap44xx_iss_addrs),
2490 .user = OCP_USER_MPU | OCP_USER_SDMA,
2491};
2492
2493/* iss slave ports */
2494static struct omap_hwmod_ocp_if *omap44xx_iss_slaves[] = {
2495 &omap44xx_l3_main_2__iss,
2496};
2497
2498static struct omap_hwmod_opt_clk iss_opt_clks[] = {
2499 { .role = "ctrlclk", .clk = "iss_ctrlclk" },
2500};
2501
2502static struct omap_hwmod omap44xx_iss_hwmod = {
2503 .name = "iss",
2504 .class = &omap44xx_iss_hwmod_class,
2505 .mpu_irqs = omap44xx_iss_irqs,
2506 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_iss_irqs),
2507 .sdma_reqs = omap44xx_iss_sdma_reqs,
2508 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_iss_sdma_reqs),
2509 .main_clk = "iss_fck",
2510 .prcm = {
2511 .omap4 = {
2512 .clkctrl_reg = OMAP4430_CM_CAM_ISS_CLKCTRL,
2513 },
2514 },
2515 .opt_clks = iss_opt_clks,
2516 .opt_clks_cnt = ARRAY_SIZE(iss_opt_clks),
2517 .slaves = omap44xx_iss_slaves,
2518 .slaves_cnt = ARRAY_SIZE(omap44xx_iss_slaves),
2519 .masters = omap44xx_iss_masters,
2520 .masters_cnt = ARRAY_SIZE(omap44xx_iss_masters),
2521 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2522};
2523
2524/*
1329 * 'iva' class 2525 * 'iva' class
1330 * multi-standard video encoder/decoder hardware accelerator 2526 * multi-standard video encoder/decoder hardware accelerator
1331 */ 2527 */
@@ -1435,6 +2631,1084 @@ static struct omap_hwmod omap44xx_iva_hwmod = {
1435}; 2631};
1436 2632
1437/* 2633/*
2634 * 'kbd' class
2635 * keyboard controller
2636 */
2637
2638static struct omap_hwmod_class_sysconfig omap44xx_kbd_sysc = {
2639 .rev_offs = 0x0000,
2640 .sysc_offs = 0x0010,
2641 .syss_offs = 0x0014,
2642 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
2643 SYSC_HAS_EMUFREE | SYSC_HAS_ENAWAKEUP |
2644 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
2645 SYSS_HAS_RESET_STATUS),
2646 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2647 .sysc_fields = &omap_hwmod_sysc_type1,
2648};
2649
2650static struct omap_hwmod_class omap44xx_kbd_hwmod_class = {
2651 .name = "kbd",
2652 .sysc = &omap44xx_kbd_sysc,
2653};
2654
2655/* kbd */
2656static struct omap_hwmod omap44xx_kbd_hwmod;
2657static struct omap_hwmod_irq_info omap44xx_kbd_irqs[] = {
2658 { .irq = 120 + OMAP44XX_IRQ_GIC_START },
2659};
2660
2661static struct omap_hwmod_addr_space omap44xx_kbd_addrs[] = {
2662 {
2663 .pa_start = 0x4a31c000,
2664 .pa_end = 0x4a31c07f,
2665 .flags = ADDR_TYPE_RT
2666 },
2667};
2668
2669/* l4_wkup -> kbd */
2670static struct omap_hwmod_ocp_if omap44xx_l4_wkup__kbd = {
2671 .master = &omap44xx_l4_wkup_hwmod,
2672 .slave = &omap44xx_kbd_hwmod,
2673 .clk = "l4_wkup_clk_mux_ck",
2674 .addr = omap44xx_kbd_addrs,
2675 .addr_cnt = ARRAY_SIZE(omap44xx_kbd_addrs),
2676 .user = OCP_USER_MPU | OCP_USER_SDMA,
2677};
2678
2679/* kbd slave ports */
2680static struct omap_hwmod_ocp_if *omap44xx_kbd_slaves[] = {
2681 &omap44xx_l4_wkup__kbd,
2682};
2683
2684static struct omap_hwmod omap44xx_kbd_hwmod = {
2685 .name = "kbd",
2686 .class = &omap44xx_kbd_hwmod_class,
2687 .mpu_irqs = omap44xx_kbd_irqs,
2688 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_kbd_irqs),
2689 .main_clk = "kbd_fck",
2690 .prcm = {
2691 .omap4 = {
2692 .clkctrl_reg = OMAP4430_CM_WKUP_KEYBOARD_CLKCTRL,
2693 },
2694 },
2695 .slaves = omap44xx_kbd_slaves,
2696 .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves),
2697 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2698};
2699
2700/*
2701 * 'mailbox' class
2702 * mailbox module allowing communication between the on-chip processors using a
2703 * queued mailbox-interrupt mechanism.
2704 */
2705
2706static struct omap_hwmod_class_sysconfig omap44xx_mailbox_sysc = {
2707 .rev_offs = 0x0000,
2708 .sysc_offs = 0x0010,
2709 .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
2710 SYSC_HAS_SOFTRESET),
2711 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2712 .sysc_fields = &omap_hwmod_sysc_type2,
2713};
2714
2715static struct omap_hwmod_class omap44xx_mailbox_hwmod_class = {
2716 .name = "mailbox",
2717 .sysc = &omap44xx_mailbox_sysc,
2718};
2719
2720/* mailbox */
2721static struct omap_hwmod omap44xx_mailbox_hwmod;
2722static struct omap_hwmod_irq_info omap44xx_mailbox_irqs[] = {
2723 { .irq = 26 + OMAP44XX_IRQ_GIC_START },
2724};
2725
2726static struct omap_hwmod_addr_space omap44xx_mailbox_addrs[] = {
2727 {
2728 .pa_start = 0x4a0f4000,
2729 .pa_end = 0x4a0f41ff,
2730 .flags = ADDR_TYPE_RT
2731 },
2732};
2733
2734/* l4_cfg -> mailbox */
2735static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mailbox = {
2736 .master = &omap44xx_l4_cfg_hwmod,
2737 .slave = &omap44xx_mailbox_hwmod,
2738 .clk = "l4_div_ck",
2739 .addr = omap44xx_mailbox_addrs,
2740 .addr_cnt = ARRAY_SIZE(omap44xx_mailbox_addrs),
2741 .user = OCP_USER_MPU | OCP_USER_SDMA,
2742};
2743
2744/* mailbox slave ports */
2745static struct omap_hwmod_ocp_if *omap44xx_mailbox_slaves[] = {
2746 &omap44xx_l4_cfg__mailbox,
2747};
2748
2749static struct omap_hwmod omap44xx_mailbox_hwmod = {
2750 .name = "mailbox",
2751 .class = &omap44xx_mailbox_hwmod_class,
2752 .mpu_irqs = omap44xx_mailbox_irqs,
2753 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mailbox_irqs),
2754 .prcm = {
2755 .omap4 = {
2756 .clkctrl_reg = OMAP4430_CM_L4CFG_MAILBOX_CLKCTRL,
2757 },
2758 },
2759 .slaves = omap44xx_mailbox_slaves,
2760 .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves),
2761 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2762};
2763
2764/*
2765 * 'mcbsp' class
2766 * multi channel buffered serial port controller
2767 */
2768
2769static struct omap_hwmod_class_sysconfig omap44xx_mcbsp_sysc = {
2770 .sysc_offs = 0x008c,
2771 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP |
2772 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
2773 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2774 .sysc_fields = &omap_hwmod_sysc_type1,
2775};
2776
2777static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = {
2778 .name = "mcbsp",
2779 .sysc = &omap44xx_mcbsp_sysc,
2780 .rev = MCBSP_CONFIG_TYPE4,
2781};
2782
2783/* mcbsp1 */
2784static struct omap_hwmod omap44xx_mcbsp1_hwmod;
2785static struct omap_hwmod_irq_info omap44xx_mcbsp1_irqs[] = {
2786 { .irq = 17 + OMAP44XX_IRQ_GIC_START },
2787};
2788
2789static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = {
2790 { .name = "tx", .dma_req = 32 + OMAP44XX_DMA_REQ_START },
2791 { .name = "rx", .dma_req = 33 + OMAP44XX_DMA_REQ_START },
2792};
2793
2794static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = {
2795 {
2796 .name = "mpu",
2797 .pa_start = 0x40122000,
2798 .pa_end = 0x401220ff,
2799 .flags = ADDR_TYPE_RT
2800 },
2801};
2802
2803/* l4_abe -> mcbsp1 */
2804static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1 = {
2805 .master = &omap44xx_l4_abe_hwmod,
2806 .slave = &omap44xx_mcbsp1_hwmod,
2807 .clk = "ocp_abe_iclk",
2808 .addr = omap44xx_mcbsp1_addrs,
2809 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_addrs),
2810 .user = OCP_USER_MPU,
2811};
2812
2813static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = {
2814 {
2815 .name = "dma",
2816 .pa_start = 0x49022000,
2817 .pa_end = 0x490220ff,
2818 .flags = ADDR_TYPE_RT
2819 },
2820};
2821
2822/* l4_abe -> mcbsp1 (dma) */
2823static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1_dma = {
2824 .master = &omap44xx_l4_abe_hwmod,
2825 .slave = &omap44xx_mcbsp1_hwmod,
2826 .clk = "ocp_abe_iclk",
2827 .addr = omap44xx_mcbsp1_dma_addrs,
2828 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_dma_addrs),
2829 .user = OCP_USER_SDMA,
2830};
2831
2832/* mcbsp1 slave ports */
2833static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = {
2834 &omap44xx_l4_abe__mcbsp1,
2835 &omap44xx_l4_abe__mcbsp1_dma,
2836};
2837
2838static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
2839 .name = "mcbsp1",
2840 .class = &omap44xx_mcbsp_hwmod_class,
2841 .mpu_irqs = omap44xx_mcbsp1_irqs,
2842 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_irqs),
2843 .sdma_reqs = omap44xx_mcbsp1_sdma_reqs,
2844 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_sdma_reqs),
2845 .main_clk = "mcbsp1_fck",
2846 .prcm = {
2847 .omap4 = {
2848 .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
2849 },
2850 },
2851 .slaves = omap44xx_mcbsp1_slaves,
2852 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves),
2853 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2854};
2855
2856/* mcbsp2 */
2857static struct omap_hwmod omap44xx_mcbsp2_hwmod;
2858static struct omap_hwmod_irq_info omap44xx_mcbsp2_irqs[] = {
2859 { .irq = 22 + OMAP44XX_IRQ_GIC_START },
2860};
2861
2862static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = {
2863 { .name = "tx", .dma_req = 16 + OMAP44XX_DMA_REQ_START },
2864 { .name = "rx", .dma_req = 17 + OMAP44XX_DMA_REQ_START },
2865};
2866
2867static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = {
2868 {
2869 .name = "mpu",
2870 .pa_start = 0x40124000,
2871 .pa_end = 0x401240ff,
2872 .flags = ADDR_TYPE_RT
2873 },
2874};
2875
2876/* l4_abe -> mcbsp2 */
2877static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2 = {
2878 .master = &omap44xx_l4_abe_hwmod,
2879 .slave = &omap44xx_mcbsp2_hwmod,
2880 .clk = "ocp_abe_iclk",
2881 .addr = omap44xx_mcbsp2_addrs,
2882 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_addrs),
2883 .user = OCP_USER_MPU,
2884};
2885
2886static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = {
2887 {
2888 .name = "dma",
2889 .pa_start = 0x49024000,
2890 .pa_end = 0x490240ff,
2891 .flags = ADDR_TYPE_RT
2892 },
2893};
2894
2895/* l4_abe -> mcbsp2 (dma) */
2896static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2_dma = {
2897 .master = &omap44xx_l4_abe_hwmod,
2898 .slave = &omap44xx_mcbsp2_hwmod,
2899 .clk = "ocp_abe_iclk",
2900 .addr = omap44xx_mcbsp2_dma_addrs,
2901 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_dma_addrs),
2902 .user = OCP_USER_SDMA,
2903};
2904
2905/* mcbsp2 slave ports */
2906static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = {
2907 &omap44xx_l4_abe__mcbsp2,
2908 &omap44xx_l4_abe__mcbsp2_dma,
2909};
2910
2911static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
2912 .name = "mcbsp2",
2913 .class = &omap44xx_mcbsp_hwmod_class,
2914 .mpu_irqs = omap44xx_mcbsp2_irqs,
2915 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_irqs),
2916 .sdma_reqs = omap44xx_mcbsp2_sdma_reqs,
2917 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_sdma_reqs),
2918 .main_clk = "mcbsp2_fck",
2919 .prcm = {
2920 .omap4 = {
2921 .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
2922 },
2923 },
2924 .slaves = omap44xx_mcbsp2_slaves,
2925 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves),
2926 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2927};
2928
2929/* mcbsp3 */
2930static struct omap_hwmod omap44xx_mcbsp3_hwmod;
2931static struct omap_hwmod_irq_info omap44xx_mcbsp3_irqs[] = {
2932 { .irq = 23 + OMAP44XX_IRQ_GIC_START },
2933};
2934
2935static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = {
2936 { .name = "tx", .dma_req = 18 + OMAP44XX_DMA_REQ_START },
2937 { .name = "rx", .dma_req = 19 + OMAP44XX_DMA_REQ_START },
2938};
2939
2940static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = {
2941 {
2942 .name = "mpu",
2943 .pa_start = 0x40126000,
2944 .pa_end = 0x401260ff,
2945 .flags = ADDR_TYPE_RT
2946 },
2947};
2948
2949/* l4_abe -> mcbsp3 */
2950static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3 = {
2951 .master = &omap44xx_l4_abe_hwmod,
2952 .slave = &omap44xx_mcbsp3_hwmod,
2953 .clk = "ocp_abe_iclk",
2954 .addr = omap44xx_mcbsp3_addrs,
2955 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_addrs),
2956 .user = OCP_USER_MPU,
2957};
2958
2959static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = {
2960 {
2961 .name = "dma",
2962 .pa_start = 0x49026000,
2963 .pa_end = 0x490260ff,
2964 .flags = ADDR_TYPE_RT
2965 },
2966};
2967
2968/* l4_abe -> mcbsp3 (dma) */
2969static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3_dma = {
2970 .master = &omap44xx_l4_abe_hwmod,
2971 .slave = &omap44xx_mcbsp3_hwmod,
2972 .clk = "ocp_abe_iclk",
2973 .addr = omap44xx_mcbsp3_dma_addrs,
2974 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_dma_addrs),
2975 .user = OCP_USER_SDMA,
2976};
2977
2978/* mcbsp3 slave ports */
2979static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = {
2980 &omap44xx_l4_abe__mcbsp3,
2981 &omap44xx_l4_abe__mcbsp3_dma,
2982};
2983
2984static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
2985 .name = "mcbsp3",
2986 .class = &omap44xx_mcbsp_hwmod_class,
2987 .mpu_irqs = omap44xx_mcbsp3_irqs,
2988 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_irqs),
2989 .sdma_reqs = omap44xx_mcbsp3_sdma_reqs,
2990 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_sdma_reqs),
2991 .main_clk = "mcbsp3_fck",
2992 .prcm = {
2993 .omap4 = {
2994 .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
2995 },
2996 },
2997 .slaves = omap44xx_mcbsp3_slaves,
2998 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves),
2999 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3000};
3001
3002/* mcbsp4 */
3003static struct omap_hwmod omap44xx_mcbsp4_hwmod;
3004static struct omap_hwmod_irq_info omap44xx_mcbsp4_irqs[] = {
3005 { .irq = 16 + OMAP44XX_IRQ_GIC_START },
3006};
3007
3008static struct omap_hwmod_dma_info omap44xx_mcbsp4_sdma_reqs[] = {
3009 { .name = "tx", .dma_req = 30 + OMAP44XX_DMA_REQ_START },
3010 { .name = "rx", .dma_req = 31 + OMAP44XX_DMA_REQ_START },
3011};
3012
3013static struct omap_hwmod_addr_space omap44xx_mcbsp4_addrs[] = {
3014 {
3015 .pa_start = 0x48096000,
3016 .pa_end = 0x480960ff,
3017 .flags = ADDR_TYPE_RT
3018 },
3019};
3020
3021/* l4_per -> mcbsp4 */
3022static struct omap_hwmod_ocp_if omap44xx_l4_per__mcbsp4 = {
3023 .master = &omap44xx_l4_per_hwmod,
3024 .slave = &omap44xx_mcbsp4_hwmod,
3025 .clk = "l4_div_ck",
3026 .addr = omap44xx_mcbsp4_addrs,
3027 .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp4_addrs),
3028 .user = OCP_USER_MPU | OCP_USER_SDMA,
3029};
3030
3031/* mcbsp4 slave ports */
3032static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = {
3033 &omap44xx_l4_per__mcbsp4,
3034};
3035
3036static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
3037 .name = "mcbsp4",
3038 .class = &omap44xx_mcbsp_hwmod_class,
3039 .mpu_irqs = omap44xx_mcbsp4_irqs,
3040 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_irqs),
3041 .sdma_reqs = omap44xx_mcbsp4_sdma_reqs,
3042 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_sdma_reqs),
3043 .main_clk = "mcbsp4_fck",
3044 .prcm = {
3045 .omap4 = {
3046 .clkctrl_reg = OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
3047 },
3048 },
3049 .slaves = omap44xx_mcbsp4_slaves,
3050 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves),
3051 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3052};
3053
3054/*
3055 * 'mcpdm' class
3056 * multi channel pdm controller (proprietary interface with phoenix power
3057 * ic)
3058 */
3059
3060static struct omap_hwmod_class_sysconfig omap44xx_mcpdm_sysc = {
3061 .rev_offs = 0x0000,
3062 .sysc_offs = 0x0010,
3063 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
3064 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
3065 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3066 SIDLE_SMART_WKUP),
3067 .sysc_fields = &omap_hwmod_sysc_type2,
3068};
3069
3070static struct omap_hwmod_class omap44xx_mcpdm_hwmod_class = {
3071 .name = "mcpdm",
3072 .sysc = &omap44xx_mcpdm_sysc,
3073};
3074
3075/* mcpdm */
3076static struct omap_hwmod omap44xx_mcpdm_hwmod;
3077static struct omap_hwmod_irq_info omap44xx_mcpdm_irqs[] = {
3078 { .irq = 112 + OMAP44XX_IRQ_GIC_START },
3079};
3080
3081static struct omap_hwmod_dma_info omap44xx_mcpdm_sdma_reqs[] = {
3082 { .name = "up_link", .dma_req = 64 + OMAP44XX_DMA_REQ_START },
3083 { .name = "dn_link", .dma_req = 65 + OMAP44XX_DMA_REQ_START },
3084};
3085
3086static struct omap_hwmod_addr_space omap44xx_mcpdm_addrs[] = {
3087 {
3088 .pa_start = 0x40132000,
3089 .pa_end = 0x4013207f,
3090 .flags = ADDR_TYPE_RT
3091 },
3092};
3093
3094/* l4_abe -> mcpdm */
3095static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm = {
3096 .master = &omap44xx_l4_abe_hwmod,
3097 .slave = &omap44xx_mcpdm_hwmod,
3098 .clk = "ocp_abe_iclk",
3099 .addr = omap44xx_mcpdm_addrs,
3100 .addr_cnt = ARRAY_SIZE(omap44xx_mcpdm_addrs),
3101 .user = OCP_USER_MPU,
3102};
3103
3104static struct omap_hwmod_addr_space omap44xx_mcpdm_dma_addrs[] = {
3105 {
3106 .pa_start = 0x49032000,
3107 .pa_end = 0x4903207f,
3108 .flags = ADDR_TYPE_RT
3109 },
3110};
3111
3112/* l4_abe -> mcpdm (dma) */
3113static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm_dma = {
3114 .master = &omap44xx_l4_abe_hwmod,
3115 .slave = &omap44xx_mcpdm_hwmod,
3116 .clk = "ocp_abe_iclk",
3117 .addr = omap44xx_mcpdm_dma_addrs,
3118 .addr_cnt = ARRAY_SIZE(omap44xx_mcpdm_dma_addrs),
3119 .user = OCP_USER_SDMA,
3120};
3121
3122/* mcpdm slave ports */
3123static struct omap_hwmod_ocp_if *omap44xx_mcpdm_slaves[] = {
3124 &omap44xx_l4_abe__mcpdm,
3125 &omap44xx_l4_abe__mcpdm_dma,
3126};
3127
3128static struct omap_hwmod omap44xx_mcpdm_hwmod = {
3129 .name = "mcpdm",
3130 .class = &omap44xx_mcpdm_hwmod_class,
3131 .mpu_irqs = omap44xx_mcpdm_irqs,
3132 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcpdm_irqs),
3133 .sdma_reqs = omap44xx_mcpdm_sdma_reqs,
3134 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcpdm_sdma_reqs),
3135 .main_clk = "mcpdm_fck",
3136 .prcm = {
3137 .omap4 = {
3138 .clkctrl_reg = OMAP4430_CM1_ABE_PDM_CLKCTRL,
3139 },
3140 },
3141 .slaves = omap44xx_mcpdm_slaves,
3142 .slaves_cnt = ARRAY_SIZE(omap44xx_mcpdm_slaves),
3143 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3144};
3145
3146/*
3147 * 'mcspi' class
3148 * multichannel serial port interface (mcspi) / master/slave synchronous serial
3149 * bus
3150 */
3151
3152static struct omap_hwmod_class_sysconfig omap44xx_mcspi_sysc = {
3153 .rev_offs = 0x0000,
3154 .sysc_offs = 0x0010,
3155 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
3156 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
3157 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3158 SIDLE_SMART_WKUP),
3159 .sysc_fields = &omap_hwmod_sysc_type2,
3160};
3161
3162static struct omap_hwmod_class omap44xx_mcspi_hwmod_class = {
3163 .name = "mcspi",
3164 .sysc = &omap44xx_mcspi_sysc,
3165 .rev = OMAP4_MCSPI_REV,
3166};
3167
3168/* mcspi1 */
3169static struct omap_hwmod omap44xx_mcspi1_hwmod;
3170static struct omap_hwmod_irq_info omap44xx_mcspi1_irqs[] = {
3171 { .irq = 65 + OMAP44XX_IRQ_GIC_START },
3172};
3173
3174static struct omap_hwmod_dma_info omap44xx_mcspi1_sdma_reqs[] = {
3175 { .name = "tx0", .dma_req = 34 + OMAP44XX_DMA_REQ_START },
3176 { .name = "rx0", .dma_req = 35 + OMAP44XX_DMA_REQ_START },
3177 { .name = "tx1", .dma_req = 36 + OMAP44XX_DMA_REQ_START },
3178 { .name = "rx1", .dma_req = 37 + OMAP44XX_DMA_REQ_START },
3179 { .name = "tx2", .dma_req = 38 + OMAP44XX_DMA_REQ_START },
3180 { .name = "rx2", .dma_req = 39 + OMAP44XX_DMA_REQ_START },
3181 { .name = "tx3", .dma_req = 40 + OMAP44XX_DMA_REQ_START },
3182 { .name = "rx3", .dma_req = 41 + OMAP44XX_DMA_REQ_START },
3183};
3184
3185static struct omap_hwmod_addr_space omap44xx_mcspi1_addrs[] = {
3186 {
3187 .pa_start = 0x48098000,
3188 .pa_end = 0x480981ff,
3189 .flags = ADDR_TYPE_RT
3190 },
3191};
3192
3193/* l4_per -> mcspi1 */
3194static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi1 = {
3195 .master = &omap44xx_l4_per_hwmod,
3196 .slave = &omap44xx_mcspi1_hwmod,
3197 .clk = "l4_div_ck",
3198 .addr = omap44xx_mcspi1_addrs,
3199 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi1_addrs),
3200 .user = OCP_USER_MPU | OCP_USER_SDMA,
3201};
3202
3203/* mcspi1 slave ports */
3204static struct omap_hwmod_ocp_if *omap44xx_mcspi1_slaves[] = {
3205 &omap44xx_l4_per__mcspi1,
3206};
3207
3208/* mcspi1 dev_attr */
3209static struct omap2_mcspi_dev_attr mcspi1_dev_attr = {
3210 .num_chipselect = 4,
3211};
3212
3213static struct omap_hwmod omap44xx_mcspi1_hwmod = {
3214 .name = "mcspi1",
3215 .class = &omap44xx_mcspi_hwmod_class,
3216 .mpu_irqs = omap44xx_mcspi1_irqs,
3217 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi1_irqs),
3218 .sdma_reqs = omap44xx_mcspi1_sdma_reqs,
3219 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi1_sdma_reqs),
3220 .main_clk = "mcspi1_fck",
3221 .prcm = {
3222 .omap4 = {
3223 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI1_CLKCTRL,
3224 },
3225 },
3226 .dev_attr = &mcspi1_dev_attr,
3227 .slaves = omap44xx_mcspi1_slaves,
3228 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi1_slaves),
3229 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3230};
3231
3232/* mcspi2 */
3233static struct omap_hwmod omap44xx_mcspi2_hwmod;
3234static struct omap_hwmod_irq_info omap44xx_mcspi2_irqs[] = {
3235 { .irq = 66 + OMAP44XX_IRQ_GIC_START },
3236};
3237
3238static struct omap_hwmod_dma_info omap44xx_mcspi2_sdma_reqs[] = {
3239 { .name = "tx0", .dma_req = 42 + OMAP44XX_DMA_REQ_START },
3240 { .name = "rx0", .dma_req = 43 + OMAP44XX_DMA_REQ_START },
3241 { .name = "tx1", .dma_req = 44 + OMAP44XX_DMA_REQ_START },
3242 { .name = "rx1", .dma_req = 45 + OMAP44XX_DMA_REQ_START },
3243};
3244
3245static struct omap_hwmod_addr_space omap44xx_mcspi2_addrs[] = {
3246 {
3247 .pa_start = 0x4809a000,
3248 .pa_end = 0x4809a1ff,
3249 .flags = ADDR_TYPE_RT
3250 },
3251};
3252
3253/* l4_per -> mcspi2 */
3254static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi2 = {
3255 .master = &omap44xx_l4_per_hwmod,
3256 .slave = &omap44xx_mcspi2_hwmod,
3257 .clk = "l4_div_ck",
3258 .addr = omap44xx_mcspi2_addrs,
3259 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi2_addrs),
3260 .user = OCP_USER_MPU | OCP_USER_SDMA,
3261};
3262
3263/* mcspi2 slave ports */
3264static struct omap_hwmod_ocp_if *omap44xx_mcspi2_slaves[] = {
3265 &omap44xx_l4_per__mcspi2,
3266};
3267
3268/* mcspi2 dev_attr */
3269static struct omap2_mcspi_dev_attr mcspi2_dev_attr = {
3270 .num_chipselect = 2,
3271};
3272
3273static struct omap_hwmod omap44xx_mcspi2_hwmod = {
3274 .name = "mcspi2",
3275 .class = &omap44xx_mcspi_hwmod_class,
3276 .mpu_irqs = omap44xx_mcspi2_irqs,
3277 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi2_irqs),
3278 .sdma_reqs = omap44xx_mcspi2_sdma_reqs,
3279 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi2_sdma_reqs),
3280 .main_clk = "mcspi2_fck",
3281 .prcm = {
3282 .omap4 = {
3283 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI2_CLKCTRL,
3284 },
3285 },
3286 .dev_attr = &mcspi2_dev_attr,
3287 .slaves = omap44xx_mcspi2_slaves,
3288 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi2_slaves),
3289 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3290};
3291
3292/* mcspi3 */
3293static struct omap_hwmod omap44xx_mcspi3_hwmod;
3294static struct omap_hwmod_irq_info omap44xx_mcspi3_irqs[] = {
3295 { .irq = 91 + OMAP44XX_IRQ_GIC_START },
3296};
3297
3298static struct omap_hwmod_dma_info omap44xx_mcspi3_sdma_reqs[] = {
3299 { .name = "tx0", .dma_req = 14 + OMAP44XX_DMA_REQ_START },
3300 { .name = "rx0", .dma_req = 15 + OMAP44XX_DMA_REQ_START },
3301 { .name = "tx1", .dma_req = 22 + OMAP44XX_DMA_REQ_START },
3302 { .name = "rx1", .dma_req = 23 + OMAP44XX_DMA_REQ_START },
3303};
3304
3305static struct omap_hwmod_addr_space omap44xx_mcspi3_addrs[] = {
3306 {
3307 .pa_start = 0x480b8000,
3308 .pa_end = 0x480b81ff,
3309 .flags = ADDR_TYPE_RT
3310 },
3311};
3312
3313/* l4_per -> mcspi3 */
3314static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi3 = {
3315 .master = &omap44xx_l4_per_hwmod,
3316 .slave = &omap44xx_mcspi3_hwmod,
3317 .clk = "l4_div_ck",
3318 .addr = omap44xx_mcspi3_addrs,
3319 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi3_addrs),
3320 .user = OCP_USER_MPU | OCP_USER_SDMA,
3321};
3322
3323/* mcspi3 slave ports */
3324static struct omap_hwmod_ocp_if *omap44xx_mcspi3_slaves[] = {
3325 &omap44xx_l4_per__mcspi3,
3326};
3327
3328/* mcspi3 dev_attr */
3329static struct omap2_mcspi_dev_attr mcspi3_dev_attr = {
3330 .num_chipselect = 2,
3331};
3332
3333static struct omap_hwmod omap44xx_mcspi3_hwmod = {
3334 .name = "mcspi3",
3335 .class = &omap44xx_mcspi_hwmod_class,
3336 .mpu_irqs = omap44xx_mcspi3_irqs,
3337 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi3_irqs),
3338 .sdma_reqs = omap44xx_mcspi3_sdma_reqs,
3339 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi3_sdma_reqs),
3340 .main_clk = "mcspi3_fck",
3341 .prcm = {
3342 .omap4 = {
3343 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI3_CLKCTRL,
3344 },
3345 },
3346 .dev_attr = &mcspi3_dev_attr,
3347 .slaves = omap44xx_mcspi3_slaves,
3348 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi3_slaves),
3349 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3350};
3351
3352/* mcspi4 */
3353static struct omap_hwmod omap44xx_mcspi4_hwmod;
3354static struct omap_hwmod_irq_info omap44xx_mcspi4_irqs[] = {
3355 { .irq = 48 + OMAP44XX_IRQ_GIC_START },
3356};
3357
3358static struct omap_hwmod_dma_info omap44xx_mcspi4_sdma_reqs[] = {
3359 { .name = "tx0", .dma_req = 69 + OMAP44XX_DMA_REQ_START },
3360 { .name = "rx0", .dma_req = 70 + OMAP44XX_DMA_REQ_START },
3361};
3362
3363static struct omap_hwmod_addr_space omap44xx_mcspi4_addrs[] = {
3364 {
3365 .pa_start = 0x480ba000,
3366 .pa_end = 0x480ba1ff,
3367 .flags = ADDR_TYPE_RT
3368 },
3369};
3370
3371/* l4_per -> mcspi4 */
3372static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi4 = {
3373 .master = &omap44xx_l4_per_hwmod,
3374 .slave = &omap44xx_mcspi4_hwmod,
3375 .clk = "l4_div_ck",
3376 .addr = omap44xx_mcspi4_addrs,
3377 .addr_cnt = ARRAY_SIZE(omap44xx_mcspi4_addrs),
3378 .user = OCP_USER_MPU | OCP_USER_SDMA,
3379};
3380
3381/* mcspi4 slave ports */
3382static struct omap_hwmod_ocp_if *omap44xx_mcspi4_slaves[] = {
3383 &omap44xx_l4_per__mcspi4,
3384};
3385
3386/* mcspi4 dev_attr */
3387static struct omap2_mcspi_dev_attr mcspi4_dev_attr = {
3388 .num_chipselect = 1,
3389};
3390
3391static struct omap_hwmod omap44xx_mcspi4_hwmod = {
3392 .name = "mcspi4",
3393 .class = &omap44xx_mcspi_hwmod_class,
3394 .mpu_irqs = omap44xx_mcspi4_irqs,
3395 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcspi4_irqs),
3396 .sdma_reqs = omap44xx_mcspi4_sdma_reqs,
3397 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcspi4_sdma_reqs),
3398 .main_clk = "mcspi4_fck",
3399 .prcm = {
3400 .omap4 = {
3401 .clkctrl_reg = OMAP4430_CM_L4PER_MCSPI4_CLKCTRL,
3402 },
3403 },
3404 .dev_attr = &mcspi4_dev_attr,
3405 .slaves = omap44xx_mcspi4_slaves,
3406 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi4_slaves),
3407 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3408};
3409
3410/*
3411 * 'mmc' class
3412 * multimedia card high-speed/sd/sdio (mmc/sd/sdio) host controller
3413 */
3414
3415static struct omap_hwmod_class_sysconfig omap44xx_mmc_sysc = {
3416 .rev_offs = 0x0000,
3417 .sysc_offs = 0x0010,
3418 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE |
3419 SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
3420 SYSC_HAS_SOFTRESET),
3421 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3422 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
3423 MSTANDBY_SMART),
3424 .sysc_fields = &omap_hwmod_sysc_type2,
3425};
3426
3427static struct omap_hwmod_class omap44xx_mmc_hwmod_class = {
3428 .name = "mmc",
3429 .sysc = &omap44xx_mmc_sysc,
3430};
3431
3432/* mmc1 */
3433
3434static struct omap_hwmod_irq_info omap44xx_mmc1_irqs[] = {
3435 { .irq = 83 + OMAP44XX_IRQ_GIC_START },
3436};
3437
3438static struct omap_hwmod_dma_info omap44xx_mmc1_sdma_reqs[] = {
3439 { .name = "tx", .dma_req = 60 + OMAP44XX_DMA_REQ_START },
3440 { .name = "rx", .dma_req = 61 + OMAP44XX_DMA_REQ_START },
3441};
3442
3443/* mmc1 master ports */
3444static struct omap_hwmod_ocp_if *omap44xx_mmc1_masters[] = {
3445 &omap44xx_mmc1__l3_main_1,
3446};
3447
3448static struct omap_hwmod_addr_space omap44xx_mmc1_addrs[] = {
3449 {
3450 .pa_start = 0x4809c000,
3451 .pa_end = 0x4809c3ff,
3452 .flags = ADDR_TYPE_RT
3453 },
3454};
3455
3456/* l4_per -> mmc1 */
3457static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc1 = {
3458 .master = &omap44xx_l4_per_hwmod,
3459 .slave = &omap44xx_mmc1_hwmod,
3460 .clk = "l4_div_ck",
3461 .addr = omap44xx_mmc1_addrs,
3462 .addr_cnt = ARRAY_SIZE(omap44xx_mmc1_addrs),
3463 .user = OCP_USER_MPU | OCP_USER_SDMA,
3464};
3465
3466/* mmc1 slave ports */
3467static struct omap_hwmod_ocp_if *omap44xx_mmc1_slaves[] = {
3468 &omap44xx_l4_per__mmc1,
3469};
3470
3471/* mmc1 dev_attr */
3472static struct omap_mmc_dev_attr mmc1_dev_attr = {
3473 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
3474};
3475
3476static struct omap_hwmod omap44xx_mmc1_hwmod = {
3477 .name = "mmc1",
3478 .class = &omap44xx_mmc_hwmod_class,
3479 .mpu_irqs = omap44xx_mmc1_irqs,
3480 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc1_irqs),
3481 .sdma_reqs = omap44xx_mmc1_sdma_reqs,
3482 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc1_sdma_reqs),
3483 .main_clk = "mmc1_fck",
3484 .prcm = {
3485 .omap4 = {
3486 .clkctrl_reg = OMAP4430_CM_L3INIT_MMC1_CLKCTRL,
3487 },
3488 },
3489 .dev_attr = &mmc1_dev_attr,
3490 .slaves = omap44xx_mmc1_slaves,
3491 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves),
3492 .masters = omap44xx_mmc1_masters,
3493 .masters_cnt = ARRAY_SIZE(omap44xx_mmc1_masters),
3494 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3495};
3496
3497/* mmc2 */
3498static struct omap_hwmod_irq_info omap44xx_mmc2_irqs[] = {
3499 { .irq = 86 + OMAP44XX_IRQ_GIC_START },
3500};
3501
3502static struct omap_hwmod_dma_info omap44xx_mmc2_sdma_reqs[] = {
3503 { .name = "tx", .dma_req = 46 + OMAP44XX_DMA_REQ_START },
3504 { .name = "rx", .dma_req = 47 + OMAP44XX_DMA_REQ_START },
3505};
3506
3507/* mmc2 master ports */
3508static struct omap_hwmod_ocp_if *omap44xx_mmc2_masters[] = {
3509 &omap44xx_mmc2__l3_main_1,
3510};
3511
3512static struct omap_hwmod_addr_space omap44xx_mmc2_addrs[] = {
3513 {
3514 .pa_start = 0x480b4000,
3515 .pa_end = 0x480b43ff,
3516 .flags = ADDR_TYPE_RT
3517 },
3518};
3519
3520/* l4_per -> mmc2 */
3521static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc2 = {
3522 .master = &omap44xx_l4_per_hwmod,
3523 .slave = &omap44xx_mmc2_hwmod,
3524 .clk = "l4_div_ck",
3525 .addr = omap44xx_mmc2_addrs,
3526 .addr_cnt = ARRAY_SIZE(omap44xx_mmc2_addrs),
3527 .user = OCP_USER_MPU | OCP_USER_SDMA,
3528};
3529
3530/* mmc2 slave ports */
3531static struct omap_hwmod_ocp_if *omap44xx_mmc2_slaves[] = {
3532 &omap44xx_l4_per__mmc2,
3533};
3534
3535static struct omap_hwmod omap44xx_mmc2_hwmod = {
3536 .name = "mmc2",
3537 .class = &omap44xx_mmc_hwmod_class,
3538 .mpu_irqs = omap44xx_mmc2_irqs,
3539 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc2_irqs),
3540 .sdma_reqs = omap44xx_mmc2_sdma_reqs,
3541 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc2_sdma_reqs),
3542 .main_clk = "mmc2_fck",
3543 .prcm = {
3544 .omap4 = {
3545 .clkctrl_reg = OMAP4430_CM_L3INIT_MMC2_CLKCTRL,
3546 },
3547 },
3548 .slaves = omap44xx_mmc2_slaves,
3549 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc2_slaves),
3550 .masters = omap44xx_mmc2_masters,
3551 .masters_cnt = ARRAY_SIZE(omap44xx_mmc2_masters),
3552 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3553};
3554
3555/* mmc3 */
3556static struct omap_hwmod omap44xx_mmc3_hwmod;
3557static struct omap_hwmod_irq_info omap44xx_mmc3_irqs[] = {
3558 { .irq = 94 + OMAP44XX_IRQ_GIC_START },
3559};
3560
3561static struct omap_hwmod_dma_info omap44xx_mmc3_sdma_reqs[] = {
3562 { .name = "tx", .dma_req = 76 + OMAP44XX_DMA_REQ_START },
3563 { .name = "rx", .dma_req = 77 + OMAP44XX_DMA_REQ_START },
3564};
3565
3566static struct omap_hwmod_addr_space omap44xx_mmc3_addrs[] = {
3567 {
3568 .pa_start = 0x480ad000,
3569 .pa_end = 0x480ad3ff,
3570 .flags = ADDR_TYPE_RT
3571 },
3572};
3573
3574/* l4_per -> mmc3 */
3575static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc3 = {
3576 .master = &omap44xx_l4_per_hwmod,
3577 .slave = &omap44xx_mmc3_hwmod,
3578 .clk = "l4_div_ck",
3579 .addr = omap44xx_mmc3_addrs,
3580 .addr_cnt = ARRAY_SIZE(omap44xx_mmc3_addrs),
3581 .user = OCP_USER_MPU | OCP_USER_SDMA,
3582};
3583
3584/* mmc3 slave ports */
3585static struct omap_hwmod_ocp_if *omap44xx_mmc3_slaves[] = {
3586 &omap44xx_l4_per__mmc3,
3587};
3588
3589static struct omap_hwmod omap44xx_mmc3_hwmod = {
3590 .name = "mmc3",
3591 .class = &omap44xx_mmc_hwmod_class,
3592 .mpu_irqs = omap44xx_mmc3_irqs,
3593 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc3_irqs),
3594 .sdma_reqs = omap44xx_mmc3_sdma_reqs,
3595 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc3_sdma_reqs),
3596 .main_clk = "mmc3_fck",
3597 .prcm = {
3598 .omap4 = {
3599 .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD3_CLKCTRL,
3600 },
3601 },
3602 .slaves = omap44xx_mmc3_slaves,
3603 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc3_slaves),
3604 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3605};
3606
3607/* mmc4 */
3608static struct omap_hwmod omap44xx_mmc4_hwmod;
3609static struct omap_hwmod_irq_info omap44xx_mmc4_irqs[] = {
3610 { .irq = 96 + OMAP44XX_IRQ_GIC_START },
3611};
3612
3613static struct omap_hwmod_dma_info omap44xx_mmc4_sdma_reqs[] = {
3614 { .name = "tx", .dma_req = 56 + OMAP44XX_DMA_REQ_START },
3615 { .name = "rx", .dma_req = 57 + OMAP44XX_DMA_REQ_START },
3616};
3617
3618static struct omap_hwmod_addr_space omap44xx_mmc4_addrs[] = {
3619 {
3620 .pa_start = 0x480d1000,
3621 .pa_end = 0x480d13ff,
3622 .flags = ADDR_TYPE_RT
3623 },
3624};
3625
3626/* l4_per -> mmc4 */
3627static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc4 = {
3628 .master = &omap44xx_l4_per_hwmod,
3629 .slave = &omap44xx_mmc4_hwmod,
3630 .clk = "l4_div_ck",
3631 .addr = omap44xx_mmc4_addrs,
3632 .addr_cnt = ARRAY_SIZE(omap44xx_mmc4_addrs),
3633 .user = OCP_USER_MPU | OCP_USER_SDMA,
3634};
3635
3636/* mmc4 slave ports */
3637static struct omap_hwmod_ocp_if *omap44xx_mmc4_slaves[] = {
3638 &omap44xx_l4_per__mmc4,
3639};
3640
3641static struct omap_hwmod omap44xx_mmc4_hwmod = {
3642 .name = "mmc4",
3643 .class = &omap44xx_mmc_hwmod_class,
3644 .mpu_irqs = omap44xx_mmc4_irqs,
3645 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc4_irqs),
3646 .sdma_reqs = omap44xx_mmc4_sdma_reqs,
3647 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc4_sdma_reqs),
3648 .main_clk = "mmc4_fck",
3649 .prcm = {
3650 .omap4 = {
3651 .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD4_CLKCTRL,
3652 },
3653 },
3654 .slaves = omap44xx_mmc4_slaves,
3655 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc4_slaves),
3656 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3657};
3658
3659/* mmc5 */
3660static struct omap_hwmod omap44xx_mmc5_hwmod;
3661static struct omap_hwmod_irq_info omap44xx_mmc5_irqs[] = {
3662 { .irq = 59 + OMAP44XX_IRQ_GIC_START },
3663};
3664
3665static struct omap_hwmod_dma_info omap44xx_mmc5_sdma_reqs[] = {
3666 { .name = "tx", .dma_req = 58 + OMAP44XX_DMA_REQ_START },
3667 { .name = "rx", .dma_req = 59 + OMAP44XX_DMA_REQ_START },
3668};
3669
3670static struct omap_hwmod_addr_space omap44xx_mmc5_addrs[] = {
3671 {
3672 .pa_start = 0x480d5000,
3673 .pa_end = 0x480d53ff,
3674 .flags = ADDR_TYPE_RT
3675 },
3676};
3677
3678/* l4_per -> mmc5 */
3679static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc5 = {
3680 .master = &omap44xx_l4_per_hwmod,
3681 .slave = &omap44xx_mmc5_hwmod,
3682 .clk = "l4_div_ck",
3683 .addr = omap44xx_mmc5_addrs,
3684 .addr_cnt = ARRAY_SIZE(omap44xx_mmc5_addrs),
3685 .user = OCP_USER_MPU | OCP_USER_SDMA,
3686};
3687
3688/* mmc5 slave ports */
3689static struct omap_hwmod_ocp_if *omap44xx_mmc5_slaves[] = {
3690 &omap44xx_l4_per__mmc5,
3691};
3692
3693static struct omap_hwmod omap44xx_mmc5_hwmod = {
3694 .name = "mmc5",
3695 .class = &omap44xx_mmc_hwmod_class,
3696 .mpu_irqs = omap44xx_mmc5_irqs,
3697 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mmc5_irqs),
3698 .sdma_reqs = omap44xx_mmc5_sdma_reqs,
3699 .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mmc5_sdma_reqs),
3700 .main_clk = "mmc5_fck",
3701 .prcm = {
3702 .omap4 = {
3703 .clkctrl_reg = OMAP4430_CM_L4PER_MMCSD5_CLKCTRL,
3704 },
3705 },
3706 .slaves = omap44xx_mmc5_slaves,
3707 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc5_slaves),
3708 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3709};
3710
3711/*
1438 * 'mpu' class 3712 * 'mpu' class
1439 * mpu sub-system 3713 * mpu sub-system
1440 */ 3714 */
@@ -1639,6 +3913,676 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
1639}; 3913};
1640 3914
1641/* 3915/*
3916 * 'spinlock' class
3917 * spinlock provides hardware assistance for synchronizing the processes
3918 * running on multiple processors
3919 */
3920
3921static struct omap_hwmod_class_sysconfig omap44xx_spinlock_sysc = {
3922 .rev_offs = 0x0000,
3923 .sysc_offs = 0x0010,
3924 .syss_offs = 0x0014,
3925 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
3926 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
3927 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
3928 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
3929 SIDLE_SMART_WKUP),
3930 .sysc_fields = &omap_hwmod_sysc_type1,
3931};
3932
3933static struct omap_hwmod_class omap44xx_spinlock_hwmod_class = {
3934 .name = "spinlock",
3935 .sysc = &omap44xx_spinlock_sysc,
3936};
3937
3938/* spinlock */
3939static struct omap_hwmod omap44xx_spinlock_hwmod;
3940static struct omap_hwmod_addr_space omap44xx_spinlock_addrs[] = {
3941 {
3942 .pa_start = 0x4a0f6000,
3943 .pa_end = 0x4a0f6fff,
3944 .flags = ADDR_TYPE_RT
3945 },
3946};
3947
3948/* l4_cfg -> spinlock */
3949static struct omap_hwmod_ocp_if omap44xx_l4_cfg__spinlock = {
3950 .master = &omap44xx_l4_cfg_hwmod,
3951 .slave = &omap44xx_spinlock_hwmod,
3952 .clk = "l4_div_ck",
3953 .addr = omap44xx_spinlock_addrs,
3954 .addr_cnt = ARRAY_SIZE(omap44xx_spinlock_addrs),
3955 .user = OCP_USER_MPU | OCP_USER_SDMA,
3956};
3957
3958/* spinlock slave ports */
3959static struct omap_hwmod_ocp_if *omap44xx_spinlock_slaves[] = {
3960 &omap44xx_l4_cfg__spinlock,
3961};
3962
3963static struct omap_hwmod omap44xx_spinlock_hwmod = {
3964 .name = "spinlock",
3965 .class = &omap44xx_spinlock_hwmod_class,
3966 .prcm = {
3967 .omap4 = {
3968 .clkctrl_reg = OMAP4430_CM_L4CFG_HW_SEM_CLKCTRL,
3969 },
3970 },
3971 .slaves = omap44xx_spinlock_slaves,
3972 .slaves_cnt = ARRAY_SIZE(omap44xx_spinlock_slaves),
3973 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3974};
3975
3976/*
3977 * 'timer' class
3978 * general purpose timer module with accurate 1ms tick
3979 * This class contains several variants: ['timer_1ms', 'timer']
3980 */
3981
3982static struct omap_hwmod_class_sysconfig omap44xx_timer_1ms_sysc = {
3983 .rev_offs = 0x0000,
3984 .sysc_offs = 0x0010,
3985 .syss_offs = 0x0014,
3986 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
3987 SYSC_HAS_EMUFREE | SYSC_HAS_ENAWAKEUP |
3988 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
3989 SYSS_HAS_RESET_STATUS),
3990 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
3991 .sysc_fields = &omap_hwmod_sysc_type1,
3992};
3993
3994static struct omap_hwmod_class omap44xx_timer_1ms_hwmod_class = {
3995 .name = "timer",
3996 .sysc = &omap44xx_timer_1ms_sysc,
3997};
3998
3999static struct omap_hwmod_class_sysconfig omap44xx_timer_sysc = {
4000 .rev_offs = 0x0000,
4001 .sysc_offs = 0x0010,
4002 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
4003 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
4004 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
4005 SIDLE_SMART_WKUP),
4006 .sysc_fields = &omap_hwmod_sysc_type2,
4007};
4008
4009static struct omap_hwmod_class omap44xx_timer_hwmod_class = {
4010 .name = "timer",
4011 .sysc = &omap44xx_timer_sysc,
4012};
4013
4014/* timer1 */
4015static struct omap_hwmod omap44xx_timer1_hwmod;
4016static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = {
4017 { .irq = 37 + OMAP44XX_IRQ_GIC_START },
4018};
4019
4020static struct omap_hwmod_addr_space omap44xx_timer1_addrs[] = {
4021 {
4022 .pa_start = 0x4a318000,
4023 .pa_end = 0x4a31807f,
4024 .flags = ADDR_TYPE_RT
4025 },
4026};
4027
4028/* l4_wkup -> timer1 */
4029static struct omap_hwmod_ocp_if omap44xx_l4_wkup__timer1 = {
4030 .master = &omap44xx_l4_wkup_hwmod,
4031 .slave = &omap44xx_timer1_hwmod,
4032 .clk = "l4_wkup_clk_mux_ck",
4033 .addr = omap44xx_timer1_addrs,
4034 .addr_cnt = ARRAY_SIZE(omap44xx_timer1_addrs),
4035 .user = OCP_USER_MPU | OCP_USER_SDMA,
4036};
4037
4038/* timer1 slave ports */
4039static struct omap_hwmod_ocp_if *omap44xx_timer1_slaves[] = {
4040 &omap44xx_l4_wkup__timer1,
4041};
4042
4043static struct omap_hwmod omap44xx_timer1_hwmod = {
4044 .name = "timer1",
4045 .class = &omap44xx_timer_1ms_hwmod_class,
4046 .mpu_irqs = omap44xx_timer1_irqs,
4047 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer1_irqs),
4048 .main_clk = "timer1_fck",
4049 .prcm = {
4050 .omap4 = {
4051 .clkctrl_reg = OMAP4430_CM_WKUP_TIMER1_CLKCTRL,
4052 },
4053 },
4054 .slaves = omap44xx_timer1_slaves,
4055 .slaves_cnt = ARRAY_SIZE(omap44xx_timer1_slaves),
4056 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4057};
4058
4059/* timer2 */
4060static struct omap_hwmod omap44xx_timer2_hwmod;
4061static struct omap_hwmod_irq_info omap44xx_timer2_irqs[] = {
4062 { .irq = 38 + OMAP44XX_IRQ_GIC_START },
4063};
4064
4065static struct omap_hwmod_addr_space omap44xx_timer2_addrs[] = {
4066 {
4067 .pa_start = 0x48032000,
4068 .pa_end = 0x4803207f,
4069 .flags = ADDR_TYPE_RT
4070 },
4071};
4072
4073/* l4_per -> timer2 */
4074static struct omap_hwmod_ocp_if omap44xx_l4_per__timer2 = {
4075 .master = &omap44xx_l4_per_hwmod,
4076 .slave = &omap44xx_timer2_hwmod,
4077 .clk = "l4_div_ck",
4078 .addr = omap44xx_timer2_addrs,
4079 .addr_cnt = ARRAY_SIZE(omap44xx_timer2_addrs),
4080 .user = OCP_USER_MPU | OCP_USER_SDMA,
4081};
4082
4083/* timer2 slave ports */
4084static struct omap_hwmod_ocp_if *omap44xx_timer2_slaves[] = {
4085 &omap44xx_l4_per__timer2,
4086};
4087
4088static struct omap_hwmod omap44xx_timer2_hwmod = {
4089 .name = "timer2",
4090 .class = &omap44xx_timer_1ms_hwmod_class,
4091 .mpu_irqs = omap44xx_timer2_irqs,
4092 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer2_irqs),
4093 .main_clk = "timer2_fck",
4094 .prcm = {
4095 .omap4 = {
4096 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER2_CLKCTRL,
4097 },
4098 },
4099 .slaves = omap44xx_timer2_slaves,
4100 .slaves_cnt = ARRAY_SIZE(omap44xx_timer2_slaves),
4101 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4102};
4103
4104/* timer3 */
4105static struct omap_hwmod omap44xx_timer3_hwmod;
4106static struct omap_hwmod_irq_info omap44xx_timer3_irqs[] = {
4107 { .irq = 39 + OMAP44XX_IRQ_GIC_START },
4108};
4109
4110static struct omap_hwmod_addr_space omap44xx_timer3_addrs[] = {
4111 {
4112 .pa_start = 0x48034000,
4113 .pa_end = 0x4803407f,
4114 .flags = ADDR_TYPE_RT
4115 },
4116};
4117
4118/* l4_per -> timer3 */
4119static struct omap_hwmod_ocp_if omap44xx_l4_per__timer3 = {
4120 .master = &omap44xx_l4_per_hwmod,
4121 .slave = &omap44xx_timer3_hwmod,
4122 .clk = "l4_div_ck",
4123 .addr = omap44xx_timer3_addrs,
4124 .addr_cnt = ARRAY_SIZE(omap44xx_timer3_addrs),
4125 .user = OCP_USER_MPU | OCP_USER_SDMA,
4126};
4127
4128/* timer3 slave ports */
4129static struct omap_hwmod_ocp_if *omap44xx_timer3_slaves[] = {
4130 &omap44xx_l4_per__timer3,
4131};
4132
4133static struct omap_hwmod omap44xx_timer3_hwmod = {
4134 .name = "timer3",
4135 .class = &omap44xx_timer_hwmod_class,
4136 .mpu_irqs = omap44xx_timer3_irqs,
4137 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer3_irqs),
4138 .main_clk = "timer3_fck",
4139 .prcm = {
4140 .omap4 = {
4141 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER3_CLKCTRL,
4142 },
4143 },
4144 .slaves = omap44xx_timer3_slaves,
4145 .slaves_cnt = ARRAY_SIZE(omap44xx_timer3_slaves),
4146 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4147};
4148
4149/* timer4 */
4150static struct omap_hwmod omap44xx_timer4_hwmod;
4151static struct omap_hwmod_irq_info omap44xx_timer4_irqs[] = {
4152 { .irq = 40 + OMAP44XX_IRQ_GIC_START },
4153};
4154
4155static struct omap_hwmod_addr_space omap44xx_timer4_addrs[] = {
4156 {
4157 .pa_start = 0x48036000,
4158 .pa_end = 0x4803607f,
4159 .flags = ADDR_TYPE_RT
4160 },
4161};
4162
4163/* l4_per -> timer4 */
4164static struct omap_hwmod_ocp_if omap44xx_l4_per__timer4 = {
4165 .master = &omap44xx_l4_per_hwmod,
4166 .slave = &omap44xx_timer4_hwmod,
4167 .clk = "l4_div_ck",
4168 .addr = omap44xx_timer4_addrs,
4169 .addr_cnt = ARRAY_SIZE(omap44xx_timer4_addrs),
4170 .user = OCP_USER_MPU | OCP_USER_SDMA,
4171};
4172
4173/* timer4 slave ports */
4174static struct omap_hwmod_ocp_if *omap44xx_timer4_slaves[] = {
4175 &omap44xx_l4_per__timer4,
4176};
4177
4178static struct omap_hwmod omap44xx_timer4_hwmod = {
4179 .name = "timer4",
4180 .class = &omap44xx_timer_hwmod_class,
4181 .mpu_irqs = omap44xx_timer4_irqs,
4182 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer4_irqs),
4183 .main_clk = "timer4_fck",
4184 .prcm = {
4185 .omap4 = {
4186 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER4_CLKCTRL,
4187 },
4188 },
4189 .slaves = omap44xx_timer4_slaves,
4190 .slaves_cnt = ARRAY_SIZE(omap44xx_timer4_slaves),
4191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4192};
4193
4194/* timer5 */
4195static struct omap_hwmod omap44xx_timer5_hwmod;
4196static struct omap_hwmod_irq_info omap44xx_timer5_irqs[] = {
4197 { .irq = 41 + OMAP44XX_IRQ_GIC_START },
4198};
4199
4200static struct omap_hwmod_addr_space omap44xx_timer5_addrs[] = {
4201 {
4202 .pa_start = 0x40138000,
4203 .pa_end = 0x4013807f,
4204 .flags = ADDR_TYPE_RT
4205 },
4206};
4207
4208/* l4_abe -> timer5 */
4209static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer5 = {
4210 .master = &omap44xx_l4_abe_hwmod,
4211 .slave = &omap44xx_timer5_hwmod,
4212 .clk = "ocp_abe_iclk",
4213 .addr = omap44xx_timer5_addrs,
4214 .addr_cnt = ARRAY_SIZE(omap44xx_timer5_addrs),
4215 .user = OCP_USER_MPU,
4216};
4217
4218static struct omap_hwmod_addr_space omap44xx_timer5_dma_addrs[] = {
4219 {
4220 .pa_start = 0x49038000,
4221 .pa_end = 0x4903807f,
4222 .flags = ADDR_TYPE_RT
4223 },
4224};
4225
4226/* l4_abe -> timer5 (dma) */
4227static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer5_dma = {
4228 .master = &omap44xx_l4_abe_hwmod,
4229 .slave = &omap44xx_timer5_hwmod,
4230 .clk = "ocp_abe_iclk",
4231 .addr = omap44xx_timer5_dma_addrs,
4232 .addr_cnt = ARRAY_SIZE(omap44xx_timer5_dma_addrs),
4233 .user = OCP_USER_SDMA,
4234};
4235
4236/* timer5 slave ports */
4237static struct omap_hwmod_ocp_if *omap44xx_timer5_slaves[] = {
4238 &omap44xx_l4_abe__timer5,
4239 &omap44xx_l4_abe__timer5_dma,
4240};
4241
4242static struct omap_hwmod omap44xx_timer5_hwmod = {
4243 .name = "timer5",
4244 .class = &omap44xx_timer_hwmod_class,
4245 .mpu_irqs = omap44xx_timer5_irqs,
4246 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer5_irqs),
4247 .main_clk = "timer5_fck",
4248 .prcm = {
4249 .omap4 = {
4250 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER5_CLKCTRL,
4251 },
4252 },
4253 .slaves = omap44xx_timer5_slaves,
4254 .slaves_cnt = ARRAY_SIZE(omap44xx_timer5_slaves),
4255 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4256};
4257
4258/* timer6 */
4259static struct omap_hwmod omap44xx_timer6_hwmod;
4260static struct omap_hwmod_irq_info omap44xx_timer6_irqs[] = {
4261 { .irq = 42 + OMAP44XX_IRQ_GIC_START },
4262};
4263
4264static struct omap_hwmod_addr_space omap44xx_timer6_addrs[] = {
4265 {
4266 .pa_start = 0x4013a000,
4267 .pa_end = 0x4013a07f,
4268 .flags = ADDR_TYPE_RT
4269 },
4270};
4271
4272/* l4_abe -> timer6 */
4273static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer6 = {
4274 .master = &omap44xx_l4_abe_hwmod,
4275 .slave = &omap44xx_timer6_hwmod,
4276 .clk = "ocp_abe_iclk",
4277 .addr = omap44xx_timer6_addrs,
4278 .addr_cnt = ARRAY_SIZE(omap44xx_timer6_addrs),
4279 .user = OCP_USER_MPU,
4280};
4281
4282static struct omap_hwmod_addr_space omap44xx_timer6_dma_addrs[] = {
4283 {
4284 .pa_start = 0x4903a000,
4285 .pa_end = 0x4903a07f,
4286 .flags = ADDR_TYPE_RT
4287 },
4288};
4289
4290/* l4_abe -> timer6 (dma) */
4291static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer6_dma = {
4292 .master = &omap44xx_l4_abe_hwmod,
4293 .slave = &omap44xx_timer6_hwmod,
4294 .clk = "ocp_abe_iclk",
4295 .addr = omap44xx_timer6_dma_addrs,
4296 .addr_cnt = ARRAY_SIZE(omap44xx_timer6_dma_addrs),
4297 .user = OCP_USER_SDMA,
4298};
4299
4300/* timer6 slave ports */
4301static struct omap_hwmod_ocp_if *omap44xx_timer6_slaves[] = {
4302 &omap44xx_l4_abe__timer6,
4303 &omap44xx_l4_abe__timer6_dma,
4304};
4305
4306static struct omap_hwmod omap44xx_timer6_hwmod = {
4307 .name = "timer6",
4308 .class = &omap44xx_timer_hwmod_class,
4309 .mpu_irqs = omap44xx_timer6_irqs,
4310 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer6_irqs),
4311 .main_clk = "timer6_fck",
4312 .prcm = {
4313 .omap4 = {
4314 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER6_CLKCTRL,
4315 },
4316 },
4317 .slaves = omap44xx_timer6_slaves,
4318 .slaves_cnt = ARRAY_SIZE(omap44xx_timer6_slaves),
4319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4320};
4321
4322/* timer7 */
4323static struct omap_hwmod omap44xx_timer7_hwmod;
4324static struct omap_hwmod_irq_info omap44xx_timer7_irqs[] = {
4325 { .irq = 43 + OMAP44XX_IRQ_GIC_START },
4326};
4327
4328static struct omap_hwmod_addr_space omap44xx_timer7_addrs[] = {
4329 {
4330 .pa_start = 0x4013c000,
4331 .pa_end = 0x4013c07f,
4332 .flags = ADDR_TYPE_RT
4333 },
4334};
4335
4336/* l4_abe -> timer7 */
4337static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer7 = {
4338 .master = &omap44xx_l4_abe_hwmod,
4339 .slave = &omap44xx_timer7_hwmod,
4340 .clk = "ocp_abe_iclk",
4341 .addr = omap44xx_timer7_addrs,
4342 .addr_cnt = ARRAY_SIZE(omap44xx_timer7_addrs),
4343 .user = OCP_USER_MPU,
4344};
4345
4346static struct omap_hwmod_addr_space omap44xx_timer7_dma_addrs[] = {
4347 {
4348 .pa_start = 0x4903c000,
4349 .pa_end = 0x4903c07f,
4350 .flags = ADDR_TYPE_RT
4351 },
4352};
4353
4354/* l4_abe -> timer7 (dma) */
4355static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer7_dma = {
4356 .master = &omap44xx_l4_abe_hwmod,
4357 .slave = &omap44xx_timer7_hwmod,
4358 .clk = "ocp_abe_iclk",
4359 .addr = omap44xx_timer7_dma_addrs,
4360 .addr_cnt = ARRAY_SIZE(omap44xx_timer7_dma_addrs),
4361 .user = OCP_USER_SDMA,
4362};
4363
4364/* timer7 slave ports */
4365static struct omap_hwmod_ocp_if *omap44xx_timer7_slaves[] = {
4366 &omap44xx_l4_abe__timer7,
4367 &omap44xx_l4_abe__timer7_dma,
4368};
4369
4370static struct omap_hwmod omap44xx_timer7_hwmod = {
4371 .name = "timer7",
4372 .class = &omap44xx_timer_hwmod_class,
4373 .mpu_irqs = omap44xx_timer7_irqs,
4374 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer7_irqs),
4375 .main_clk = "timer7_fck",
4376 .prcm = {
4377 .omap4 = {
4378 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER7_CLKCTRL,
4379 },
4380 },
4381 .slaves = omap44xx_timer7_slaves,
4382 .slaves_cnt = ARRAY_SIZE(omap44xx_timer7_slaves),
4383 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4384};
4385
4386/* timer8 */
4387static struct omap_hwmod omap44xx_timer8_hwmod;
4388static struct omap_hwmod_irq_info omap44xx_timer8_irqs[] = {
4389 { .irq = 44 + OMAP44XX_IRQ_GIC_START },
4390};
4391
4392static struct omap_hwmod_addr_space omap44xx_timer8_addrs[] = {
4393 {
4394 .pa_start = 0x4013e000,
4395 .pa_end = 0x4013e07f,
4396 .flags = ADDR_TYPE_RT
4397 },
4398};
4399
4400/* l4_abe -> timer8 */
4401static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer8 = {
4402 .master = &omap44xx_l4_abe_hwmod,
4403 .slave = &omap44xx_timer8_hwmod,
4404 .clk = "ocp_abe_iclk",
4405 .addr = omap44xx_timer8_addrs,
4406 .addr_cnt = ARRAY_SIZE(omap44xx_timer8_addrs),
4407 .user = OCP_USER_MPU,
4408};
4409
4410static struct omap_hwmod_addr_space omap44xx_timer8_dma_addrs[] = {
4411 {
4412 .pa_start = 0x4903e000,
4413 .pa_end = 0x4903e07f,
4414 .flags = ADDR_TYPE_RT
4415 },
4416};
4417
4418/* l4_abe -> timer8 (dma) */
4419static struct omap_hwmod_ocp_if omap44xx_l4_abe__timer8_dma = {
4420 .master = &omap44xx_l4_abe_hwmod,
4421 .slave = &omap44xx_timer8_hwmod,
4422 .clk = "ocp_abe_iclk",
4423 .addr = omap44xx_timer8_dma_addrs,
4424 .addr_cnt = ARRAY_SIZE(omap44xx_timer8_dma_addrs),
4425 .user = OCP_USER_SDMA,
4426};
4427
4428/* timer8 slave ports */
4429static struct omap_hwmod_ocp_if *omap44xx_timer8_slaves[] = {
4430 &omap44xx_l4_abe__timer8,
4431 &omap44xx_l4_abe__timer8_dma,
4432};
4433
4434static struct omap_hwmod omap44xx_timer8_hwmod = {
4435 .name = "timer8",
4436 .class = &omap44xx_timer_hwmod_class,
4437 .mpu_irqs = omap44xx_timer8_irqs,
4438 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer8_irqs),
4439 .main_clk = "timer8_fck",
4440 .prcm = {
4441 .omap4 = {
4442 .clkctrl_reg = OMAP4430_CM1_ABE_TIMER8_CLKCTRL,
4443 },
4444 },
4445 .slaves = omap44xx_timer8_slaves,
4446 .slaves_cnt = ARRAY_SIZE(omap44xx_timer8_slaves),
4447 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4448};
4449
4450/* timer9 */
4451static struct omap_hwmod omap44xx_timer9_hwmod;
4452static struct omap_hwmod_irq_info omap44xx_timer9_irqs[] = {
4453 { .irq = 45 + OMAP44XX_IRQ_GIC_START },
4454};
4455
4456static struct omap_hwmod_addr_space omap44xx_timer9_addrs[] = {
4457 {
4458 .pa_start = 0x4803e000,
4459 .pa_end = 0x4803e07f,
4460 .flags = ADDR_TYPE_RT
4461 },
4462};
4463
4464/* l4_per -> timer9 */
4465static struct omap_hwmod_ocp_if omap44xx_l4_per__timer9 = {
4466 .master = &omap44xx_l4_per_hwmod,
4467 .slave = &omap44xx_timer9_hwmod,
4468 .clk = "l4_div_ck",
4469 .addr = omap44xx_timer9_addrs,
4470 .addr_cnt = ARRAY_SIZE(omap44xx_timer9_addrs),
4471 .user = OCP_USER_MPU | OCP_USER_SDMA,
4472};
4473
4474/* timer9 slave ports */
4475static struct omap_hwmod_ocp_if *omap44xx_timer9_slaves[] = {
4476 &omap44xx_l4_per__timer9,
4477};
4478
4479static struct omap_hwmod omap44xx_timer9_hwmod = {
4480 .name = "timer9",
4481 .class = &omap44xx_timer_hwmod_class,
4482 .mpu_irqs = omap44xx_timer9_irqs,
4483 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer9_irqs),
4484 .main_clk = "timer9_fck",
4485 .prcm = {
4486 .omap4 = {
4487 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER9_CLKCTRL,
4488 },
4489 },
4490 .slaves = omap44xx_timer9_slaves,
4491 .slaves_cnt = ARRAY_SIZE(omap44xx_timer9_slaves),
4492 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4493};
4494
4495/* timer10 */
4496static struct omap_hwmod omap44xx_timer10_hwmod;
4497static struct omap_hwmod_irq_info omap44xx_timer10_irqs[] = {
4498 { .irq = 46 + OMAP44XX_IRQ_GIC_START },
4499};
4500
4501static struct omap_hwmod_addr_space omap44xx_timer10_addrs[] = {
4502 {
4503 .pa_start = 0x48086000,
4504 .pa_end = 0x4808607f,
4505 .flags = ADDR_TYPE_RT
4506 },
4507};
4508
4509/* l4_per -> timer10 */
4510static struct omap_hwmod_ocp_if omap44xx_l4_per__timer10 = {
4511 .master = &omap44xx_l4_per_hwmod,
4512 .slave = &omap44xx_timer10_hwmod,
4513 .clk = "l4_div_ck",
4514 .addr = omap44xx_timer10_addrs,
4515 .addr_cnt = ARRAY_SIZE(omap44xx_timer10_addrs),
4516 .user = OCP_USER_MPU | OCP_USER_SDMA,
4517};
4518
4519/* timer10 slave ports */
4520static struct omap_hwmod_ocp_if *omap44xx_timer10_slaves[] = {
4521 &omap44xx_l4_per__timer10,
4522};
4523
4524static struct omap_hwmod omap44xx_timer10_hwmod = {
4525 .name = "timer10",
4526 .class = &omap44xx_timer_1ms_hwmod_class,
4527 .mpu_irqs = omap44xx_timer10_irqs,
4528 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer10_irqs),
4529 .main_clk = "timer10_fck",
4530 .prcm = {
4531 .omap4 = {
4532 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER10_CLKCTRL,
4533 },
4534 },
4535 .slaves = omap44xx_timer10_slaves,
4536 .slaves_cnt = ARRAY_SIZE(omap44xx_timer10_slaves),
4537 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4538};
4539
4540/* timer11 */
4541static struct omap_hwmod omap44xx_timer11_hwmod;
4542static struct omap_hwmod_irq_info omap44xx_timer11_irqs[] = {
4543 { .irq = 47 + OMAP44XX_IRQ_GIC_START },
4544};
4545
4546static struct omap_hwmod_addr_space omap44xx_timer11_addrs[] = {
4547 {
4548 .pa_start = 0x48088000,
4549 .pa_end = 0x4808807f,
4550 .flags = ADDR_TYPE_RT
4551 },
4552};
4553
4554/* l4_per -> timer11 */
4555static struct omap_hwmod_ocp_if omap44xx_l4_per__timer11 = {
4556 .master = &omap44xx_l4_per_hwmod,
4557 .slave = &omap44xx_timer11_hwmod,
4558 .clk = "l4_div_ck",
4559 .addr = omap44xx_timer11_addrs,
4560 .addr_cnt = ARRAY_SIZE(omap44xx_timer11_addrs),
4561 .user = OCP_USER_MPU | OCP_USER_SDMA,
4562};
4563
4564/* timer11 slave ports */
4565static struct omap_hwmod_ocp_if *omap44xx_timer11_slaves[] = {
4566 &omap44xx_l4_per__timer11,
4567};
4568
4569static struct omap_hwmod omap44xx_timer11_hwmod = {
4570 .name = "timer11",
4571 .class = &omap44xx_timer_hwmod_class,
4572 .mpu_irqs = omap44xx_timer11_irqs,
4573 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_timer11_irqs),
4574 .main_clk = "timer11_fck",
4575 .prcm = {
4576 .omap4 = {
4577 .clkctrl_reg = OMAP4430_CM_L4PER_DMTIMER11_CLKCTRL,
4578 },
4579 },
4580 .slaves = omap44xx_timer11_slaves,
4581 .slaves_cnt = ARRAY_SIZE(omap44xx_timer11_slaves),
4582 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4583};
4584
4585/*
1642 * 'uart' class 4586 * 'uart' class
1643 * universal asynchronous receiver/transmitter (uart) 4587 * universal asynchronous receiver/transmitter (uart)
1644 */ 4588 */
@@ -1870,6 +4814,88 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
1870}; 4814};
1871 4815
1872/* 4816/*
4817 * 'usb_otg_hs' class
4818 * high-speed on-the-go universal serial bus (usb_otg_hs) controller
4819 */
4820
4821static struct omap_hwmod_class_sysconfig omap44xx_usb_otg_hs_sysc = {
4822 .rev_offs = 0x0400,
4823 .sysc_offs = 0x0404,
4824 .syss_offs = 0x0408,
4825 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
4826 SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE |
4827 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
4828 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
4829 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
4830 MSTANDBY_SMART),
4831 .sysc_fields = &omap_hwmod_sysc_type1,
4832};
4833
4834static struct omap_hwmod_class omap44xx_usb_otg_hs_hwmod_class = {
4835 .name = "usb_otg_hs",
4836 .sysc = &omap44xx_usb_otg_hs_sysc,
4837};
4838
4839/* usb_otg_hs */
4840static struct omap_hwmod_irq_info omap44xx_usb_otg_hs_irqs[] = {
4841 { .name = "mc", .irq = 92 + OMAP44XX_IRQ_GIC_START },
4842 { .name = "dma", .irq = 93 + OMAP44XX_IRQ_GIC_START },
4843};
4844
4845/* usb_otg_hs master ports */
4846static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_masters[] = {
4847 &omap44xx_usb_otg_hs__l3_main_2,
4848};
4849
4850static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = {
4851 {
4852 .pa_start = 0x4a0ab000,
4853 .pa_end = 0x4a0ab003,
4854 .flags = ADDR_TYPE_RT
4855 },
4856};
4857
4858/* l4_cfg -> usb_otg_hs */
4859static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_otg_hs = {
4860 .master = &omap44xx_l4_cfg_hwmod,
4861 .slave = &omap44xx_usb_otg_hs_hwmod,
4862 .clk = "l4_div_ck",
4863 .addr = omap44xx_usb_otg_hs_addrs,
4864 .addr_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_addrs),
4865 .user = OCP_USER_MPU | OCP_USER_SDMA,
4866};
4867
4868/* usb_otg_hs slave ports */
4869static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_slaves[] = {
4870 &omap44xx_l4_cfg__usb_otg_hs,
4871};
4872
4873static struct omap_hwmod_opt_clk usb_otg_hs_opt_clks[] = {
4874 { .role = "xclk", .clk = "usb_otg_hs_xclk" },
4875};
4876
4877static struct omap_hwmod omap44xx_usb_otg_hs_hwmod = {
4878 .name = "usb_otg_hs",
4879 .class = &omap44xx_usb_otg_hs_hwmod_class,
4880 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
4881 .mpu_irqs = omap44xx_usb_otg_hs_irqs,
4882 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_irqs),
4883 .main_clk = "usb_otg_hs_ick",
4884 .prcm = {
4885 .omap4 = {
4886 .clkctrl_reg = OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL,
4887 },
4888 },
4889 .opt_clks = usb_otg_hs_opt_clks,
4890 .opt_clks_cnt = ARRAY_SIZE(usb_otg_hs_opt_clks),
4891 .slaves = omap44xx_usb_otg_hs_slaves,
4892 .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves),
4893 .masters = omap44xx_usb_otg_hs_masters,
4894 .masters_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_masters),
4895 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4896};
4897
4898/*
1873 * 'wd_timer' class 4899 * 'wd_timer' class
1874 * 32-bit watchdog upward counter that generates a pulse on the reset pin on 4900 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
1875 * overflow condition 4901 * overflow condition
@@ -2024,13 +5050,34 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2024 /* mpu_bus class */ 5050 /* mpu_bus class */
2025 &omap44xx_mpu_private_hwmod, 5051 &omap44xx_mpu_private_hwmod,
2026 5052
5053 /* aess class */
5054/* &omap44xx_aess_hwmod, */
5055
5056 /* bandgap class */
5057 &omap44xx_bandgap_hwmod,
5058
5059 /* counter class */
5060/* &omap44xx_counter_32k_hwmod, */
5061
2027 /* dma class */ 5062 /* dma class */
2028 &omap44xx_dma_system_hwmod, 5063 &omap44xx_dma_system_hwmod,
2029 5064
5065 /* dmic class */
5066 &omap44xx_dmic_hwmod,
5067
2030 /* dsp class */ 5068 /* dsp class */
2031 &omap44xx_dsp_hwmod, 5069 &omap44xx_dsp_hwmod,
2032 &omap44xx_dsp_c0_hwmod, 5070 &omap44xx_dsp_c0_hwmod,
2033 5071
5072 /* dss class */
5073 &omap44xx_dss_hwmod,
5074 &omap44xx_dss_dispc_hwmod,
5075 &omap44xx_dss_dsi1_hwmod,
5076 &omap44xx_dss_dsi2_hwmod,
5077 &omap44xx_dss_hdmi_hwmod,
5078 &omap44xx_dss_rfbi_hwmod,
5079 &omap44xx_dss_venc_hwmod,
5080
2034 /* gpio class */ 5081 /* gpio class */
2035 &omap44xx_gpio1_hwmod, 5082 &omap44xx_gpio1_hwmod,
2036 &omap44xx_gpio2_hwmod, 5083 &omap44xx_gpio2_hwmod,
@@ -2039,17 +5086,56 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2039 &omap44xx_gpio5_hwmod, 5086 &omap44xx_gpio5_hwmod,
2040 &omap44xx_gpio6_hwmod, 5087 &omap44xx_gpio6_hwmod,
2041 5088
5089 /* hsi class */
5090/* &omap44xx_hsi_hwmod, */
5091
2042 /* i2c class */ 5092 /* i2c class */
2043 &omap44xx_i2c1_hwmod, 5093 &omap44xx_i2c1_hwmod,
2044 &omap44xx_i2c2_hwmod, 5094 &omap44xx_i2c2_hwmod,
2045 &omap44xx_i2c3_hwmod, 5095 &omap44xx_i2c3_hwmod,
2046 &omap44xx_i2c4_hwmod, 5096 &omap44xx_i2c4_hwmod,
2047 5097
5098 /* ipu class */
5099 &omap44xx_ipu_hwmod,
5100 &omap44xx_ipu_c0_hwmod,
5101 &omap44xx_ipu_c1_hwmod,
5102
5103 /* iss class */
5104/* &omap44xx_iss_hwmod, */
5105
2048 /* iva class */ 5106 /* iva class */
2049 &omap44xx_iva_hwmod, 5107 &omap44xx_iva_hwmod,
2050 &omap44xx_iva_seq0_hwmod, 5108 &omap44xx_iva_seq0_hwmod,
2051 &omap44xx_iva_seq1_hwmod, 5109 &omap44xx_iva_seq1_hwmod,
2052 5110
5111 /* kbd class */
5112/* &omap44xx_kbd_hwmod, */
5113
5114 /* mailbox class */
5115 &omap44xx_mailbox_hwmod,
5116
5117 /* mcbsp class */
5118 &omap44xx_mcbsp1_hwmod,
5119 &omap44xx_mcbsp2_hwmod,
5120 &omap44xx_mcbsp3_hwmod,
5121 &omap44xx_mcbsp4_hwmod,
5122
5123 /* mcpdm class */
5124/* &omap44xx_mcpdm_hwmod, */
5125
5126 /* mcspi class */
5127 &omap44xx_mcspi1_hwmod,
5128 &omap44xx_mcspi2_hwmod,
5129 &omap44xx_mcspi3_hwmod,
5130 &omap44xx_mcspi4_hwmod,
5131
5132 /* mmc class */
5133 &omap44xx_mmc1_hwmod,
5134 &omap44xx_mmc2_hwmod,
5135 &omap44xx_mmc3_hwmod,
5136 &omap44xx_mmc4_hwmod,
5137 &omap44xx_mmc5_hwmod,
5138
2053 /* mpu class */ 5139 /* mpu class */
2054 &omap44xx_mpu_hwmod, 5140 &omap44xx_mpu_hwmod,
2055 5141
@@ -2058,12 +5144,31 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2058 &omap44xx_smartreflex_iva_hwmod, 5144 &omap44xx_smartreflex_iva_hwmod,
2059 &omap44xx_smartreflex_mpu_hwmod, 5145 &omap44xx_smartreflex_mpu_hwmod,
2060 5146
5147 /* spinlock class */
5148 &omap44xx_spinlock_hwmod,
5149
5150 /* timer class */
5151 &omap44xx_timer1_hwmod,
5152 &omap44xx_timer2_hwmod,
5153 &omap44xx_timer3_hwmod,
5154 &omap44xx_timer4_hwmod,
5155 &omap44xx_timer5_hwmod,
5156 &omap44xx_timer6_hwmod,
5157 &omap44xx_timer7_hwmod,
5158 &omap44xx_timer8_hwmod,
5159 &omap44xx_timer9_hwmod,
5160 &omap44xx_timer10_hwmod,
5161 &omap44xx_timer11_hwmod,
5162
2061 /* uart class */ 5163 /* uart class */
2062 &omap44xx_uart1_hwmod, 5164 &omap44xx_uart1_hwmod,
2063 &omap44xx_uart2_hwmod, 5165 &omap44xx_uart2_hwmod,
2064 &omap44xx_uart3_hwmod, 5166 &omap44xx_uart3_hwmod,
2065 &omap44xx_uart4_hwmod, 5167 &omap44xx_uart4_hwmod,
2066 5168
5169 /* usb_otg_hs class */
5170 &omap44xx_usb_otg_hs_hwmod,
5171
2067 /* wd_timer class */ 5172 /* wd_timer class */
2068 &omap44xx_wd_timer2_hwmod, 5173 &omap44xx_wd_timer2_hwmod,
2069 &omap44xx_wd_timer3_hwmod, 5174 &omap44xx_wd_timer3_hwmod,
@@ -2073,6 +5178,6 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
2073 5178
2074int __init omap44xx_hwmod_init(void) 5179int __init omap44xx_hwmod_init(void)
2075{ 5180{
2076 return omap_hwmod_init(omap44xx_hwmods); 5181 return omap_hwmod_register(omap44xx_hwmods);
2077} 5182}
2078 5183
diff --git a/arch/arm/mach-omap2/omap_l3_noc.c b/arch/arm/mach-omap2/omap_l3_noc.c
new file mode 100644
index 000000000000..82632c24076f
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_noc.c
@@ -0,0 +1,253 @@
1/*
2 * OMAP4XXX L3 Interconnect error handling driver
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * Sricharan <r.sricharan@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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */
23#include <linux/init.h>
24#include <linux/io.h>
25#include <linux/platform_device.h>
26#include <linux/interrupt.h>
27#include <linux/kernel.h>
28#include <linux/slab.h>
29
30#include "omap_l3_noc.h"
31
32/*
33 * Interrupt Handler for L3 error detection.
34 * 1) Identify the L3 clockdomain partition to which the error belongs to.
35 * 2) Identify the slave where the error information is logged
36 * 3) Print the logged information.
37 * 4) Add dump stack to provide kernel trace.
38 *
39 * Two Types of errors :
40 * 1) Custom errors in L3 :
41 * Target like DMM/FW/EMIF generates SRESP=ERR error
42 * 2) Standard L3 error:
43 * - Unsupported CMD.
44 * L3 tries to access target while it is idle
45 * - OCP disconnect.
46 * - Address hole error:
47 * If DSS/ISS/FDIF/USBHOSTFS access a target where they
48 * do not have connectivity, the error is logged in
49 * their default target which is DMM2.
50 *
51 * On High Secure devices, firewall errors are possible and those
52 * can be trapped as well. But the trapping is implemented as part
53 * secure software and hence need not be implemented here.
54 */
55static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
56{
57
58 struct omap4_l3 *l3 = _l3;
59 int inttype, i, j;
60 int err_src = 0;
61 u32 std_err_main_addr, std_err_main, err_reg;
62 u32 base, slave_addr, clear;
63 char *source_name;
64
65 /* Get the Type of interrupt */
66 if (irq == l3->app_irq)
67 inttype = L3_APPLICATION_ERROR;
68 else
69 inttype = L3_DEBUG_ERROR;
70
71 for (i = 0; i < L3_MODULES; i++) {
72 /*
73 * Read the regerr register of the clock domain
74 * to determine the source
75 */
76 base = (u32)l3->l3_base[i];
77 err_reg = readl(base + l3_flagmux[i] + (inttype << 3));
78
79 /* Get the corresponding error and analyse */
80 if (err_reg) {
81 /* Identify the source from control status register */
82 for (j = 0; !(err_reg & (1 << j)); j++)
83 ;
84
85 err_src = j;
86 /* Read the stderrlog_main_source from clk domain */
87 std_err_main_addr = base + (*(l3_targ[i] + err_src));
88 std_err_main = readl(std_err_main_addr);
89
90 switch ((std_err_main & CUSTOM_ERROR)) {
91 case STANDARD_ERROR:
92 source_name =
93 l3_targ_stderrlog_main_name[i][err_src];
94
95 slave_addr = std_err_main_addr +
96 L3_SLAVE_ADDRESS_OFFSET;
97 WARN(true, "L3 standard error: SOURCE:%s at address 0x%x\n",
98 source_name, readl(slave_addr));
99 /* clear the std error log*/
100 clear = std_err_main | CLEAR_STDERR_LOG;
101 writel(clear, std_err_main_addr);
102 break;
103
104 case CUSTOM_ERROR:
105 source_name =
106 l3_targ_stderrlog_main_name[i][err_src];
107
108 WARN(true, "CUSTOM SRESP error with SOURCE:%s\n",
109 source_name);
110 /* clear the std error log*/
111 clear = std_err_main | CLEAR_STDERR_LOG;
112 writel(clear, std_err_main_addr);
113 break;
114
115 default:
116 /* Nothing to be handled here as of now */
117 break;
118 }
119 /* Error found so break the for loop */
120 break;
121 }
122 }
123 return IRQ_HANDLED;
124}
125
126static int __init omap4_l3_probe(struct platform_device *pdev)
127{
128 static struct omap4_l3 *l3;
129 struct resource *res;
130 int ret;
131 int irq;
132
133 l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
134 if (!l3)
135 ret = -ENOMEM;
136
137 platform_set_drvdata(pdev, l3);
138 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
139 if (!res) {
140 dev_err(&pdev->dev, "couldn't find resource 0\n");
141 ret = -ENODEV;
142 goto err1;
143 }
144
145 l3->l3_base[0] = ioremap(res->start, resource_size(res));
146 if (!(l3->l3_base[0])) {
147 dev_err(&pdev->dev, "ioremap failed\n");
148 ret = -ENOMEM;
149 goto err2;
150 }
151
152 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
153 if (!res) {
154 dev_err(&pdev->dev, "couldn't find resource 1\n");
155 ret = -ENODEV;
156 goto err3;
157 }
158
159 l3->l3_base[1] = ioremap(res->start, resource_size(res));
160 if (!(l3->l3_base[1])) {
161 dev_err(&pdev->dev, "ioremap failed\n");
162 ret = -ENOMEM;
163 goto err4;
164 }
165
166 res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
167 if (!res) {
168 dev_err(&pdev->dev, "couldn't find resource 2\n");
169 ret = -ENODEV;
170 goto err5;
171 }
172
173 l3->l3_base[2] = ioremap(res->start, resource_size(res));
174 if (!(l3->l3_base[2])) {
175 dev_err(&pdev->dev, "ioremap failed\n");
176 ret = -ENOMEM;
177 goto err6;
178 }
179
180 /*
181 * Setup interrupt Handlers
182 */
183 irq = platform_get_irq(pdev, 0);
184 ret = request_irq(irq,
185 l3_interrupt_handler,
186 IRQF_DISABLED, "l3-dbg-irq", l3);
187 if (ret) {
188 pr_crit("L3: request_irq failed to register for 0x%x\n",
189 OMAP44XX_IRQ_L3_DBG);
190 goto err7;
191 }
192 l3->debug_irq = irq;
193
194 irq = platform_get_irq(pdev, 1);
195 ret = request_irq(irq,
196 l3_interrupt_handler,
197 IRQF_DISABLED, "l3-app-irq", l3);
198 if (ret) {
199 pr_crit("L3: request_irq failed to register for 0x%x\n",
200 OMAP44XX_IRQ_L3_APP);
201 goto err8;
202 }
203 l3->app_irq = irq;
204
205 goto err0;
206err8:
207err7:
208 iounmap(l3->l3_base[2]);
209err6:
210err5:
211 iounmap(l3->l3_base[1]);
212err4:
213err3:
214 iounmap(l3->l3_base[0]);
215err2:
216err1:
217 kfree(l3);
218err0:
219 return ret;
220}
221
222static int __exit omap4_l3_remove(struct platform_device *pdev)
223{
224 struct omap4_l3 *l3 = platform_get_drvdata(pdev);
225
226 free_irq(l3->app_irq, l3);
227 free_irq(l3->debug_irq, l3);
228 iounmap(l3->l3_base[0]);
229 iounmap(l3->l3_base[1]);
230 iounmap(l3->l3_base[2]);
231 kfree(l3);
232
233 return 0;
234}
235
236static struct platform_driver omap4_l3_driver = {
237 .remove = __exit_p(omap4_l3_remove),
238 .driver = {
239 .name = "omap_l3_noc",
240 },
241};
242
243static int __init omap4_l3_init(void)
244{
245 return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe);
246}
247postcore_initcall_sync(omap4_l3_init);
248
249static void __exit omap4_l3_exit(void)
250{
251 platform_driver_unregister(&omap4_l3_driver);
252}
253module_exit(omap4_l3_exit);
diff --git a/arch/arm/mach-omap2/omap_l3_noc.h b/arch/arm/mach-omap2/omap_l3_noc.h
new file mode 100644
index 000000000000..359b83348aed
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_noc.h
@@ -0,0 +1,132 @@
1 /*
2 * OMAP4XXX L3 Interconnect error handling driver header
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 * sricharan <r.sricharan@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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */
23#ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
24#define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
25
26/*
27 * L3 register offsets
28 */
29#define L3_MODULES 3
30#define CLEAR_STDERR_LOG (1 << 31)
31#define CUSTOM_ERROR 0x2
32#define STANDARD_ERROR 0x0
33#define INBAND_ERROR 0x0
34#define EMIF_KERRLOG_OFFSET 0x10
35#define L3_SLAVE_ADDRESS_OFFSET 0x14
36#define LOGICAL_ADDR_ERRORLOG 0x4
37#define L3_APPLICATION_ERROR 0x0
38#define L3_DEBUG_ERROR 0x1
39
40u32 l3_flagmux[L3_MODULES] = {
41 0x50C,
42 0x100C,
43 0X020C
44};
45
46/*
47 * L3 Target standard Error register offsets
48 */
49u32 l3_targ_stderrlog_main_clk1[] = {
50 0x148, /* DMM1 */
51 0x248, /* DMM2 */
52 0x348, /* ABE */
53 0x448, /* L4CFG */
54 0x648 /* CLK2 PWR DISC */
55};
56
57u32 l3_targ_stderrlog_main_clk2[] = {
58 0x548, /* CORTEX M3 */
59 0x348, /* DSS */
60 0x148, /* GPMC */
61 0x448, /* ISS */
62 0x748, /* IVAHD */
63 0xD48, /* missing in TRM corresponds to AES1*/
64 0x948, /* L4 PER0*/
65 0x248, /* OCMRAM */
66 0x148, /* missing in TRM corresponds to GPMC sERROR*/
67 0x648, /* SGX */
68 0x848, /* SL2 */
69 0x1648, /* C2C */
70 0x1148, /* missing in TRM corresponds PWR DISC CLK1*/
71 0xF48, /* missing in TRM corrsponds to SHA1*/
72 0xE48, /* missing in TRM corresponds to AES2*/
73 0xC48, /* L4 PER3 */
74 0xA48, /* L4 PER1*/
75 0xB48 /* L4 PER2*/
76};
77
78u32 l3_targ_stderrlog_main_clk3[] = {
79 0x0148 /* EMUSS */
80};
81
82char *l3_targ_stderrlog_main_name[L3_MODULES][18] = {
83 {
84 "DMM1",
85 "DMM2",
86 "ABE",
87 "L4CFG",
88 "CLK2 PWR DISC",
89 },
90 {
91 "CORTEX M3" ,
92 "DSS ",
93 "GPMC ",
94 "ISS ",
95 "IVAHD ",
96 "AES1",
97 "L4 PER0",
98 "OCMRAM ",
99 "GPMC sERROR",
100 "SGX ",
101 "SL2 ",
102 "C2C ",
103 "PWR DISC CLK1",
104 "SHA1",
105 "AES2",
106 "L4 PER3",
107 "L4 PER1",
108 "L4 PER2",
109 },
110 {
111 "EMUSS",
112 },
113};
114
115u32 *l3_targ[L3_MODULES] = {
116 l3_targ_stderrlog_main_clk1,
117 l3_targ_stderrlog_main_clk2,
118 l3_targ_stderrlog_main_clk3,
119};
120
121struct omap4_l3 {
122 struct device *dev;
123 struct clk *ick;
124
125 /* memory base */
126 void __iomem *l3_base[4];
127
128 int debug_irq;
129 int app_irq;
130};
131
132#endif
diff --git a/arch/arm/mach-omap2/omap_l3_smx.c b/arch/arm/mach-omap2/omap_l3_smx.c
new file mode 100644
index 000000000000..265bff3acb9e
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_smx.c
@@ -0,0 +1,314 @@
1 /*
2 * OMAP3XXX L3 Interconnect Driver
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Felipe Balbi <balbi@ti.com>
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * Sricharan <r.sricharan@ti.com>
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 as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */
24
25#include <linux/kernel.h>
26#include <linux/slab.h>
27#include <linux/platform_device.h>
28#include <linux/interrupt.h>
29#include <linux/io.h>
30#include "omap_l3_smx.h"
31
32static inline u64 omap3_l3_readll(void __iomem *base, u16 reg)
33{
34 return __raw_readll(base + reg);
35}
36
37static inline void omap3_l3_writell(void __iomem *base, u16 reg, u64 value)
38{
39 __raw_writell(value, base + reg);
40}
41
42static inline enum omap3_l3_code omap3_l3_decode_error_code(u64 error)
43{
44 return (error & 0x0f000000) >> L3_ERROR_LOG_CODE;
45}
46
47static inline u32 omap3_l3_decode_addr(u64 error_addr)
48{
49 return error_addr & 0xffffffff;
50}
51
52static inline unsigned omap3_l3_decode_cmd(u64 error)
53{
54 return (error & 0x07) >> L3_ERROR_LOG_CMD;
55}
56
57static inline enum omap3_l3_initiator_id omap3_l3_decode_initid(u64 error)
58{
59 return (error & 0xff00) >> L3_ERROR_LOG_INITID;
60}
61
62static inline unsigned omap3_l3_decode_req_info(u64 error)
63{
64 return (error >> 32) & 0xffff;
65}
66
67static char *omap3_l3_code_string(u8 code)
68{
69 switch (code) {
70 case OMAP_L3_CODE_NOERROR:
71 return "No Error";
72 case OMAP_L3_CODE_UNSUP_CMD:
73 return "Unsupported Command";
74 case OMAP_L3_CODE_ADDR_HOLE:
75 return "Address Hole";
76 case OMAP_L3_CODE_PROTECT_VIOLATION:
77 return "Protection Violation";
78 case OMAP_L3_CODE_IN_BAND_ERR:
79 return "In-band Error";
80 case OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT:
81 return "Request Timeout Not Accepted";
82 case OMAP_L3_CODE_REQ_TOUT_NO_RESP:
83 return "Request Timeout, no response";
84 default:
85 return "UNKNOWN error";
86 }
87}
88
89static char *omap3_l3_initiator_string(u8 initid)
90{
91 switch (initid) {
92 case OMAP_L3_LCD:
93 return "LCD";
94 case OMAP_L3_SAD2D:
95 return "SAD2D";
96 case OMAP_L3_IA_MPU_SS_1:
97 case OMAP_L3_IA_MPU_SS_2:
98 case OMAP_L3_IA_MPU_SS_3:
99 case OMAP_L3_IA_MPU_SS_4:
100 case OMAP_L3_IA_MPU_SS_5:
101 return "MPU";
102 case OMAP_L3_IA_IVA_SS_1:
103 case OMAP_L3_IA_IVA_SS_2:
104 case OMAP_L3_IA_IVA_SS_3:
105 return "IVA_SS";
106 case OMAP_L3_IA_IVA_SS_DMA_1:
107 case OMAP_L3_IA_IVA_SS_DMA_2:
108 case OMAP_L3_IA_IVA_SS_DMA_3:
109 case OMAP_L3_IA_IVA_SS_DMA_4:
110 case OMAP_L3_IA_IVA_SS_DMA_5:
111 case OMAP_L3_IA_IVA_SS_DMA_6:
112 return "IVA_SS_DMA";
113 case OMAP_L3_IA_SGX:
114 return "SGX";
115 case OMAP_L3_IA_CAM_1:
116 case OMAP_L3_IA_CAM_2:
117 case OMAP_L3_IA_CAM_3:
118 return "CAM";
119 case OMAP_L3_IA_DAP:
120 return "DAP";
121 case OMAP_L3_SDMA_WR_1:
122 case OMAP_L3_SDMA_WR_2:
123 return "SDMA_WR";
124 case OMAP_L3_SDMA_RD_1:
125 case OMAP_L3_SDMA_RD_2:
126 case OMAP_L3_SDMA_RD_3:
127 case OMAP_L3_SDMA_RD_4:
128 return "SDMA_RD";
129 case OMAP_L3_USBOTG:
130 return "USB_OTG";
131 case OMAP_L3_USBHOST:
132 return "USB_HOST";
133 default:
134 return "UNKNOWN Initiator";
135 }
136}
137
138/**
139 * omap3_l3_block_irq - handles a register block's irq
140 * @l3: struct omap3_l3 *
141 * @base: register block base address
142 * @error: L3_ERROR_LOG register of our block
143 *
144 * Called in hard-irq context. Caller should take care of locking
145 *
146 * OMAP36xx TRM gives, on page 2001, Figure 9-10, the Typical Error
147 * Analysis Sequence, we are following that sequence here, please
148 * refer to that Figure for more information on the subject.
149 */
150static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3,
151 u64 error, int error_addr)
152{
153 u8 code = omap3_l3_decode_error_code(error);
154 u8 initid = omap3_l3_decode_initid(error);
155 u8 multi = error & L3_ERROR_LOG_MULTI;
156 u32 address = omap3_l3_decode_addr(error_addr);
157
158 WARN(true, "%s Error seen by %s %s at address %x\n",
159 omap3_l3_code_string(code),
160 omap3_l3_initiator_string(initid),
161 multi ? "Multiple Errors" : "",
162 address);
163
164 return IRQ_HANDLED;
165}
166
167static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
168{
169 struct omap3_l3 *l3 = _l3;
170
171 u64 status, clear;
172 u64 error;
173 u64 error_addr;
174 u64 err_source = 0;
175 void __iomem *base;
176 int int_type;
177
178 irqreturn_t ret = IRQ_NONE;
179
180 if (irq == l3->app_irq)
181 int_type = L3_APPLICATION_ERROR;
182 else
183 int_type = L3_DEBUG_ERROR;
184
185 if (!int_type) {
186 status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0);
187 /*
188 * if we have a timeout error, there's nothing we can
189 * do besides rebooting the board. So let's BUG on any
190 * of such errors and handle the others. timeout error
191 * is severe and not expected to occur.
192 */
193 BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
194 } else {
195 status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1);
196 /* No timeout error for debug sources */
197 }
198
199 base = ((l3->rt) + (*(omap3_l3_bases[int_type] + err_source)));
200
201 /* identify the error source */
202 for (err_source = 0; !(status & (1 << err_source)); err_source++)
203 ;
204 error = omap3_l3_readll(base, L3_ERROR_LOG);
205
206 if (error) {
207 error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR);
208
209 ret |= omap3_l3_block_irq(l3, error, error_addr);
210 }
211
212 /* Clear the status register */
213 clear = ((L3_AGENT_STATUS_CLEAR_IA << int_type) |
214 (L3_AGENT_STATUS_CLEAR_TA));
215
216 omap3_l3_writell(base, L3_AGENT_STATUS, clear);
217
218 /* clear the error log register */
219 omap3_l3_writell(base, L3_ERROR_LOG, error);
220
221 return ret;
222}
223
224static int __init omap3_l3_probe(struct platform_device *pdev)
225{
226 struct omap3_l3 *l3;
227 struct resource *res;
228 int ret;
229 int irq;
230
231 l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
232 if (!l3) {
233 ret = -ENOMEM;
234 goto err0;
235 }
236
237 platform_set_drvdata(pdev, l3);
238
239 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
240 if (!res) {
241 dev_err(&pdev->dev, "couldn't find resource\n");
242 ret = -ENODEV;
243 goto err1;
244 }
245 l3->rt = ioremap(res->start, resource_size(res));
246 if (!(l3->rt)) {
247 dev_err(&pdev->dev, "ioremap failed\n");
248 ret = -ENOMEM;
249 goto err2;
250 }
251
252 irq = platform_get_irq(pdev, 0);
253 ret = request_irq(irq, omap3_l3_app_irq,
254 IRQF_DISABLED | IRQF_TRIGGER_RISING,
255 "l3-debug-irq", l3);
256 if (ret) {
257 dev_err(&pdev->dev, "couldn't request debug irq\n");
258 goto err3;
259 }
260 l3->debug_irq = irq;
261
262 irq = platform_get_irq(pdev, 1);
263 ret = request_irq(irq, omap3_l3_app_irq,
264 IRQF_DISABLED | IRQF_TRIGGER_RISING,
265 "l3-app-irq", l3);
266
267 if (ret) {
268 dev_err(&pdev->dev, "couldn't request app irq\n");
269 goto err4;
270 }
271
272 l3->app_irq = irq;
273 goto err0;
274
275err4:
276err3:
277 iounmap(l3->rt);
278err2:
279err1:
280 kfree(l3);
281err0:
282 return ret;
283}
284
285static int __exit omap3_l3_remove(struct platform_device *pdev)
286{
287 struct omap3_l3 *l3 = platform_get_drvdata(pdev);
288
289 free_irq(l3->app_irq, l3);
290 free_irq(l3->debug_irq, l3);
291 iounmap(l3->rt);
292 kfree(l3);
293
294 return 0;
295}
296
297static struct platform_driver omap3_l3_driver = {
298 .remove = __exit_p(omap3_l3_remove),
299 .driver = {
300 .name = "omap_l3_smx",
301 },
302};
303
304static int __init omap3_l3_init(void)
305{
306 return platform_driver_probe(&omap3_l3_driver, omap3_l3_probe);
307}
308postcore_initcall_sync(omap3_l3_init);
309
310static void __exit omap3_l3_exit(void)
311{
312 platform_driver_unregister(&omap3_l3_driver);
313}
314module_exit(omap3_l3_exit);
diff --git a/arch/arm/mach-omap2/omap_l3_smx.h b/arch/arm/mach-omap2/omap_l3_smx.h
new file mode 100644
index 000000000000..ba2ed9a850cc
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_l3_smx.h
@@ -0,0 +1,338 @@
1 /*
2 * OMAP3XXX L3 Interconnect Driver header
3 *
4 * Copyright (C) 2011 Texas Corporation
5 * Felipe Balbi <balbi@ti.com>
6 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * sricharan <r.sricharan@ti.com>
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 as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */
24#ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
25#define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
26
27/* Register definitions. All 64-bit wide */
28#define L3_COMPONENT 0x000
29#define L3_CORE 0x018
30#define L3_AGENT_CONTROL 0x020
31#define L3_AGENT_STATUS 0x028
32#define L3_ERROR_LOG 0x058
33
34#define L3_ERROR_LOG_MULTI (1 << 31)
35#define L3_ERROR_LOG_SECONDARY (1 << 30)
36
37#define L3_ERROR_LOG_ADDR 0x060
38
39/* Register definitions for Sideband Interconnect */
40#define L3_SI_CONTROL 0x020
41#define L3_SI_FLAG_STATUS_0 0x510
42
43const u64 shift = 1;
44
45#define L3_STATUS_0_MPUIA_BRST (shift << 0)
46#define L3_STATUS_0_MPUIA_RSP (shift << 1)
47#define L3_STATUS_0_MPUIA_INBAND (shift << 2)
48#define L3_STATUS_0_IVAIA_BRST (shift << 6)
49#define L3_STATUS_0_IVAIA_RSP (shift << 7)
50#define L3_STATUS_0_IVAIA_INBAND (shift << 8)
51#define L3_STATUS_0_SGXIA_BRST (shift << 9)
52#define L3_STATUS_0_SGXIA_RSP (shift << 10)
53#define L3_STATUS_0_SGXIA_MERROR (shift << 11)
54#define L3_STATUS_0_CAMIA_BRST (shift << 12)
55#define L3_STATUS_0_CAMIA_RSP (shift << 13)
56#define L3_STATUS_0_CAMIA_INBAND (shift << 14)
57#define L3_STATUS_0_DISPIA_BRST (shift << 15)
58#define L3_STATUS_0_DISPIA_RSP (shift << 16)
59#define L3_STATUS_0_DMARDIA_BRST (shift << 18)
60#define L3_STATUS_0_DMARDIA_RSP (shift << 19)
61#define L3_STATUS_0_DMAWRIA_BRST (shift << 21)
62#define L3_STATUS_0_DMAWRIA_RSP (shift << 22)
63#define L3_STATUS_0_USBOTGIA_BRST (shift << 24)
64#define L3_STATUS_0_USBOTGIA_RSP (shift << 25)
65#define L3_STATUS_0_USBOTGIA_INBAND (shift << 26)
66#define L3_STATUS_0_USBHOSTIA_BRST (shift << 27)
67#define L3_STATUS_0_USBHOSTIA_INBAND (shift << 28)
68#define L3_STATUS_0_SMSTA_REQ (shift << 48)
69#define L3_STATUS_0_GPMCTA_REQ (shift << 49)
70#define L3_STATUS_0_OCMRAMTA_REQ (shift << 50)
71#define L3_STATUS_0_OCMROMTA_REQ (shift << 51)
72#define L3_STATUS_0_IVATA_REQ (shift << 54)
73#define L3_STATUS_0_SGXTA_REQ (shift << 55)
74#define L3_STATUS_0_SGXTA_SERROR (shift << 56)
75#define L3_STATUS_0_GPMCTA_SERROR (shift << 57)
76#define L3_STATUS_0_L4CORETA_REQ (shift << 58)
77#define L3_STATUS_0_L4PERTA_REQ (shift << 59)
78#define L3_STATUS_0_L4EMUTA_REQ (shift << 60)
79#define L3_STATUS_0_MAD2DTA_REQ (shift << 61)
80
81#define L3_STATUS_0_TIMEOUT_MASK (L3_STATUS_0_MPUIA_BRST \
82 | L3_STATUS_0_MPUIA_RSP \
83 | L3_STATUS_0_IVAIA_BRST \
84 | L3_STATUS_0_IVAIA_RSP \
85 | L3_STATUS_0_SGXIA_BRST \
86 | L3_STATUS_0_SGXIA_RSP \
87 | L3_STATUS_0_CAMIA_BRST \
88 | L3_STATUS_0_CAMIA_RSP \
89 | L3_STATUS_0_DISPIA_BRST \
90 | L3_STATUS_0_DISPIA_RSP \
91 | L3_STATUS_0_DMARDIA_BRST \
92 | L3_STATUS_0_DMARDIA_RSP \
93 | L3_STATUS_0_DMAWRIA_BRST \
94 | L3_STATUS_0_DMAWRIA_RSP \
95 | L3_STATUS_0_USBOTGIA_BRST \
96 | L3_STATUS_0_USBOTGIA_RSP \
97 | L3_STATUS_0_USBHOSTIA_BRST \
98 | L3_STATUS_0_SMSTA_REQ \
99 | L3_STATUS_0_GPMCTA_REQ \
100 | L3_STATUS_0_OCMRAMTA_REQ \
101 | L3_STATUS_0_OCMROMTA_REQ \
102 | L3_STATUS_0_IVATA_REQ \
103 | L3_STATUS_0_SGXTA_REQ \
104 | L3_STATUS_0_L4CORETA_REQ \
105 | L3_STATUS_0_L4PERTA_REQ \
106 | L3_STATUS_0_L4EMUTA_REQ \
107 | L3_STATUS_0_MAD2DTA_REQ)
108
109#define L3_SI_FLAG_STATUS_1 0x530
110
111#define L3_STATUS_1_MPU_DATAIA (1 << 0)
112#define L3_STATUS_1_DAPIA0 (1 << 3)
113#define L3_STATUS_1_DAPIA1 (1 << 4)
114#define L3_STATUS_1_IVAIA (1 << 6)
115
116#define L3_PM_ERROR_LOG 0x020
117#define L3_PM_CONTROL 0x028
118#define L3_PM_ERROR_CLEAR_SINGLE 0x030
119#define L3_PM_ERROR_CLEAR_MULTI 0x038
120#define L3_PM_REQ_INFO_PERMISSION(n) (0x048 + (0x020 * n))
121#define L3_PM_READ_PERMISSION(n) (0x050 + (0x020 * n))
122#define L3_PM_WRITE_PERMISSION(n) (0x058 + (0x020 * n))
123#define L3_PM_ADDR_MATCH(n) (0x060 + (0x020 * n))
124
125/* L3 error log bit fields. Common for IA and TA */
126#define L3_ERROR_LOG_CODE 24
127#define L3_ERROR_LOG_INITID 8
128#define L3_ERROR_LOG_CMD 0
129
130/* L3 agent status bit fields. */
131#define L3_AGENT_STATUS_CLEAR_IA 0x10000000
132#define L3_AGENT_STATUS_CLEAR_TA 0x01000000
133
134#define OMAP34xx_IRQ_L3_APP 10
135#define L3_APPLICATION_ERROR 0x0
136#define L3_DEBUG_ERROR 0x1
137
138enum omap3_l3_initiator_id {
139 /* LCD has 1 ID */
140 OMAP_L3_LCD = 29,
141 /* SAD2D has 1 ID */
142 OMAP_L3_SAD2D = 28,
143 /* MPU has 5 IDs */
144 OMAP_L3_IA_MPU_SS_1 = 27,
145 OMAP_L3_IA_MPU_SS_2 = 26,
146 OMAP_L3_IA_MPU_SS_3 = 25,
147 OMAP_L3_IA_MPU_SS_4 = 24,
148 OMAP_L3_IA_MPU_SS_5 = 23,
149 /* IVA2.2 SS has 3 IDs*/
150 OMAP_L3_IA_IVA_SS_1 = 22,
151 OMAP_L3_IA_IVA_SS_2 = 21,
152 OMAP_L3_IA_IVA_SS_3 = 20,
153 /* IVA 2.2 SS DMA has 6 IDS */
154 OMAP_L3_IA_IVA_SS_DMA_1 = 19,
155 OMAP_L3_IA_IVA_SS_DMA_2 = 18,
156 OMAP_L3_IA_IVA_SS_DMA_3 = 17,
157 OMAP_L3_IA_IVA_SS_DMA_4 = 16,
158 OMAP_L3_IA_IVA_SS_DMA_5 = 15,
159 OMAP_L3_IA_IVA_SS_DMA_6 = 14,
160 /* SGX has 1 ID */
161 OMAP_L3_IA_SGX = 13,
162 /* CAM has 3 ID */
163 OMAP_L3_IA_CAM_1 = 12,
164 OMAP_L3_IA_CAM_2 = 11,
165 OMAP_L3_IA_CAM_3 = 10,
166 /* DAP has 1 ID */
167 OMAP_L3_IA_DAP = 9,
168 /* SDMA WR has 2 IDs */
169 OMAP_L3_SDMA_WR_1 = 8,
170 OMAP_L3_SDMA_WR_2 = 7,
171 /* SDMA RD has 4 IDs */
172 OMAP_L3_SDMA_RD_1 = 6,
173 OMAP_L3_SDMA_RD_2 = 5,
174 OMAP_L3_SDMA_RD_3 = 4,
175 OMAP_L3_SDMA_RD_4 = 3,
176 /* HSUSB OTG has 1 ID */
177 OMAP_L3_USBOTG = 2,
178 /* HSUSB HOST has 1 ID */
179 OMAP_L3_USBHOST = 1,
180};
181
182enum omap3_l3_code {
183 OMAP_L3_CODE_NOERROR = 0,
184 OMAP_L3_CODE_UNSUP_CMD = 1,
185 OMAP_L3_CODE_ADDR_HOLE = 2,
186 OMAP_L3_CODE_PROTECT_VIOLATION = 3,
187 OMAP_L3_CODE_IN_BAND_ERR = 4,
188 /* codes 5 and 6 are reserved */
189 OMAP_L3_CODE_REQ_TOUT_NOT_ACCEPT = 7,
190 OMAP_L3_CODE_REQ_TOUT_NO_RESP = 8,
191 /* codes 9 - 15 are also reserved */
192};
193
194struct omap3_l3 {
195 struct device *dev;
196 struct clk *ick;
197
198 /* memory base*/
199 void __iomem *rt;
200
201 int debug_irq;
202 int app_irq;
203
204 /* true when and inband functional error occurs */
205 unsigned inband:1;
206};
207
208/* offsets for l3 agents in order with the Flag status register */
209unsigned int __iomem omap3_l3_app_bases[] = {
210 /* MPU IA */
211 0x1400,
212 0x1400,
213 0x1400,
214 /* RESERVED */
215 0,
216 0,
217 0,
218 /* IVA 2.2 IA */
219 0x1800,
220 0x1800,
221 0x1800,
222 /* SGX IA */
223 0x1c00,
224 0x1c00,
225 /* RESERVED */
226 0,
227 /* CAMERA IA */
228 0x5800,
229 0x5800,
230 0x5800,
231 /* DISPLAY IA */
232 0x5400,
233 0x5400,
234 /* RESERVED */
235 0,
236 /*SDMA RD IA */
237 0x4c00,
238 0x4c00,
239 /* RESERVED */
240 0,
241 /* SDMA WR IA */
242 0x5000,
243 0x5000,
244 /* RESERVED */
245 0,
246 /* USB OTG IA */
247 0x4400,
248 0x4400,
249 0x4400,
250 /* USB HOST IA */
251 0x4000,
252 0x4000,
253 /* RESERVED */
254 0,
255 0,
256 0,
257 0,
258 /* SAD2D IA */
259 0x3000,
260 0x3000,
261 0x3000,
262 /* RESERVED */
263 0,
264 0,
265 0,
266 0,
267 0,
268 0,
269 0,
270 0,
271 0,
272 0,
273 0,
274 0,
275 /* SMA TA */
276 0x2000,
277 /* GPMC TA */
278 0x2400,
279 /* OCM RAM TA */
280 0x2800,
281 /* OCM ROM TA */
282 0x2C00,
283 /* L4 CORE TA */
284 0x6800,
285 /* L4 PER TA */
286 0x6c00,
287 /* IVA 2.2 TA */
288 0x6000,
289 /* SGX TA */
290 0x6400,
291 /* L4 EMU TA */
292 0x7000,
293 /* GPMC TA */
294 0x2400,
295 /* L4 CORE TA */
296 0x6800,
297 /* L4 PER TA */
298 0x6c00,
299 /* L4 EMU TA */
300 0x7000,
301 /* MAD2D TA */
302 0x3400,
303 /* RESERVED */
304 0,
305 0,
306};
307
308unsigned int __iomem omap3_l3_debug_bases[] = {
309 /* MPU DATA IA */
310 0x1400,
311 /* RESERVED */
312 0,
313 0,
314 /* DAP IA */
315 0x5c00,
316 0x5c00,
317 /* RESERVED */
318 0,
319 /* IVA 2.2 IA */
320 0x1800,
321 /* REST RESERVED */
322};
323
324u32 *omap3_l3_bases[] = {
325 omap3_l3_app_bases,
326 omap3_l3_debug_bases,
327};
328
329/*
330 * REVISIT define __raw_readll/__raw_writell here, but move them to
331 * <asm/io.h> at some point
332 */
333#define __raw_writell(v, a) (__chk_io_ptr(a), \
334 *(volatile u64 __force *)(a) = (v))
335#define __raw_readll(a) (__chk_io_ptr(a), \
336 *(volatile u64 __force *)(a))
337
338#endif
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index 745252c60e32..f172ec06c06a 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -29,6 +29,7 @@
29#include <linux/usb.h> 29#include <linux/usb.h>
30 30
31#include <plat/usb.h> 31#include <plat/usb.h>
32#include "control.h"
32 33
33/* OMAP control module register for UTMI PHY */ 34/* OMAP control module register for UTMI PHY */
34#define CONTROL_DEV_CONF 0x300 35#define CONTROL_DEV_CONF 0x300
@@ -147,3 +148,95 @@ int omap4430_phy_exit(struct device *dev)
147 148
148 return 0; 149 return 0;
149} 150}
151
152void am35x_musb_reset(void)
153{
154 u32 regval;
155
156 /* Reset the musb interface */
157 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
158
159 regval |= AM35XX_USBOTGSS_SW_RST;
160 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
161
162 regval &= ~AM35XX_USBOTGSS_SW_RST;
163 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
164
165 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
166}
167
168void am35x_musb_phy_power(u8 on)
169{
170 unsigned long timeout = jiffies + msecs_to_jiffies(100);
171 u32 devconf2;
172
173 if (on) {
174 /*
175 * Start the on-chip PHY and its PLL.
176 */
177 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
178
179 devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
180 devconf2 |= CONF2_PHY_PLLON;
181
182 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
183
184 pr_info(KERN_INFO "Waiting for PHY clock good...\n");
185 while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
186 & CONF2_PHYCLKGD)) {
187 cpu_relax();
188
189 if (time_after(jiffies, timeout)) {
190 pr_err(KERN_ERR "musb PHY clock good timed out\n");
191 break;
192 }
193 }
194 } else {
195 /*
196 * Power down the on-chip PHY.
197 */
198 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
199
200 devconf2 &= ~CONF2_PHY_PLLON;
201 devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN;
202 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
203 }
204}
205
206void am35x_musb_clear_irq(void)
207{
208 u32 regval;
209
210 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
211 regval |= AM35XX_USBOTGSS_INT_CLR;
212 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
213 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
214}
215
216void am35x_musb_set_mode(u8 musb_mode)
217{
218 u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
219
220 devconf2 &= ~CONF2_OTGMODE;
221 switch (musb_mode) {
222#ifdef CONFIG_USB_MUSB_HDRC_HCD
223 case MUSB_HOST: /* Force VBUS valid, ID = 0 */
224 devconf2 |= CONF2_FORCE_HOST;
225 break;
226#endif
227#ifdef CONFIG_USB_GADGET_MUSB_HDRC
228 case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
229 devconf2 |= CONF2_FORCE_DEVICE;
230 break;
231#endif
232#ifdef CONFIG_USB_MUSB_OTG
233 case MUSB_OTG: /* Don't override the VBUS/ID comparators */
234 devconf2 |= CONF2_NO_OVERRIDE;
235 break;
236#endif
237 default:
238 pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode);
239 }
240
241 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
242}
diff --git a/arch/arm/mach-omap2/opp2xxx.h b/arch/arm/mach-omap2/opp2xxx.h
index 38b730550506..8affc66a92c2 100644
--- a/arch/arm/mach-omap2/opp2xxx.h
+++ b/arch/arm/mach-omap2/opp2xxx.h
@@ -418,7 +418,7 @@ struct prcm_config {
418 418
419extern const struct prcm_config omap2420_rate_table[]; 419extern const struct prcm_config omap2420_rate_table[];
420 420
421#ifdef CONFIG_ARCH_OMAP2430 421#ifdef CONFIG_SOC_OMAP2430
422extern const struct prcm_config omap2430_rate_table[]; 422extern const struct prcm_config omap2430_rate_table[];
423#else 423#else
424#define omap2430_rate_table NULL 424#define omap2430_rate_table NULL
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index d5a102c71989..7bb64d8121a7 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -124,7 +124,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
124 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) { 124 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
125 sleep_switch = LOWPOWERSTATE_SWITCH; 125 sleep_switch = LOWPOWERSTATE_SWITCH;
126 } else { 126 } else {
127 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); 127 clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
128 pwrdm_wait_transition(pwrdm); 128 pwrdm_wait_transition(pwrdm);
129 sleep_switch = FORCEWAKEUP_SWITCH; 129 sleep_switch = FORCEWAKEUP_SWITCH;
130 } 130 }
@@ -140,9 +140,9 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
140 switch (sleep_switch) { 140 switch (sleep_switch) {
141 case FORCEWAKEUP_SWITCH: 141 case FORCEWAKEUP_SWITCH:
142 if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO) 142 if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO)
143 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); 143 clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
144 else 144 else
145 omap2_clkdm_sleep(pwrdm->pwrdm_clkdms[0]); 145 clkdm_sleep(pwrdm->pwrdm_clkdms[0]);
146 break; 146 break;
147 case LOWPOWERSTATE_SWITCH: 147 case LOWPOWERSTATE_SWITCH:
148 pwrdm_set_lowpwrstchange(pwrdm); 148 pwrdm_set_lowpwrstchange(pwrdm);
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index 97feb3ab6a69..96907da1910a 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -367,10 +367,10 @@ static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
367 clkdm_clear_all_sleepdeps(clkdm); 367 clkdm_clear_all_sleepdeps(clkdm);
368 368
369 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) 369 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
370 omap2_clkdm_allow_idle(clkdm); 370 clkdm_allow_idle(clkdm);
371 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && 371 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
372 atomic_read(&clkdm->usecount) == 0) 372 atomic_read(&clkdm->usecount) == 0)
373 omap2_clkdm_sleep(clkdm); 373 clkdm_sleep(clkdm);
374 return 0; 374 return 0;
375} 375}
376 376
@@ -379,7 +379,10 @@ static void __init prcm_setup_regs(void)
379 int i, num_mem_banks; 379 int i, num_mem_banks;
380 struct powerdomain *pwrdm; 380 struct powerdomain *pwrdm;
381 381
382 /* Enable autoidle */ 382 /*
383 * Enable autoidle
384 * XXX This should be handled by hwmod code or PRCM init code
385 */
383 omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD, 386 omap2_prm_write_mod_reg(OMAP24XX_AUTOIDLE_MASK, OCP_MOD,
384 OMAP2_PRCM_SYSCONFIG_OFFSET); 387 OMAP2_PRCM_SYSCONFIG_OFFSET);
385 388
@@ -405,11 +408,11 @@ static void __init prcm_setup_regs(void)
405 408
406 pwrdm = clkdm_get_pwrdm(dsp_clkdm); 409 pwrdm = clkdm_get_pwrdm(dsp_clkdm);
407 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); 410 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
408 omap2_clkdm_sleep(dsp_clkdm); 411 clkdm_sleep(dsp_clkdm);
409 412
410 pwrdm = clkdm_get_pwrdm(gfx_clkdm); 413 pwrdm = clkdm_get_pwrdm(gfx_clkdm);
411 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); 414 pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF);
412 omap2_clkdm_sleep(gfx_clkdm); 415 clkdm_sleep(gfx_clkdm);
413 416
414 /* 417 /*
415 * Clear clockdomain wakeup dependencies and enable 418 * Clear clockdomain wakeup dependencies and enable
@@ -418,70 +421,6 @@ static void __init prcm_setup_regs(void)
418 clkdm_for_each(clkdms_setup, NULL); 421 clkdm_for_each(clkdms_setup, NULL);
419 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm); 422 clkdm_add_wkdep(mpu_clkdm, wkup_clkdm);
420 423
421 /* Enable clock autoidle for all domains */
422 omap2_cm_write_mod_reg(OMAP24XX_AUTO_CAM_MASK |
423 OMAP24XX_AUTO_MAILBOXES_MASK |
424 OMAP24XX_AUTO_WDT4_MASK |
425 OMAP2420_AUTO_WDT3_MASK |
426 OMAP24XX_AUTO_MSPRO_MASK |
427 OMAP2420_AUTO_MMC_MASK |
428 OMAP24XX_AUTO_FAC_MASK |
429 OMAP2420_AUTO_EAC_MASK |
430 OMAP24XX_AUTO_HDQ_MASK |
431 OMAP24XX_AUTO_UART2_MASK |
432 OMAP24XX_AUTO_UART1_MASK |
433 OMAP24XX_AUTO_I2C2_MASK |
434 OMAP24XX_AUTO_I2C1_MASK |
435 OMAP24XX_AUTO_MCSPI2_MASK |
436 OMAP24XX_AUTO_MCSPI1_MASK |
437 OMAP24XX_AUTO_MCBSP2_MASK |
438 OMAP24XX_AUTO_MCBSP1_MASK |
439 OMAP24XX_AUTO_GPT12_MASK |
440 OMAP24XX_AUTO_GPT11_MASK |
441 OMAP24XX_AUTO_GPT10_MASK |
442 OMAP24XX_AUTO_GPT9_MASK |
443 OMAP24XX_AUTO_GPT8_MASK |
444 OMAP24XX_AUTO_GPT7_MASK |
445 OMAP24XX_AUTO_GPT6_MASK |
446 OMAP24XX_AUTO_GPT5_MASK |
447 OMAP24XX_AUTO_GPT4_MASK |
448 OMAP24XX_AUTO_GPT3_MASK |
449 OMAP24XX_AUTO_GPT2_MASK |
450 OMAP2420_AUTO_VLYNQ_MASK |
451 OMAP24XX_AUTO_DSS_MASK,
452 CORE_MOD, CM_AUTOIDLE1);
453 omap2_cm_write_mod_reg(OMAP24XX_AUTO_UART3_MASK |
454 OMAP24XX_AUTO_SSI_MASK |
455 OMAP24XX_AUTO_USB_MASK,
456 CORE_MOD, CM_AUTOIDLE2);
457 omap2_cm_write_mod_reg(OMAP24XX_AUTO_SDRC_MASK |
458 OMAP24XX_AUTO_GPMC_MASK |
459 OMAP24XX_AUTO_SDMA_MASK,
460 CORE_MOD, CM_AUTOIDLE3);
461 omap2_cm_write_mod_reg(OMAP24XX_AUTO_PKA_MASK |
462 OMAP24XX_AUTO_AES_MASK |
463 OMAP24XX_AUTO_RNG_MASK |
464 OMAP24XX_AUTO_SHA_MASK |
465 OMAP24XX_AUTO_DES_MASK,
466 CORE_MOD, OMAP24XX_CM_AUTOIDLE4);
467
468 omap2_cm_write_mod_reg(OMAP2420_AUTO_DSP_IPI_MASK, OMAP24XX_DSP_MOD,
469 CM_AUTOIDLE);
470
471 /* Put DPLL and both APLLs into autoidle mode */
472 omap2_cm_write_mod_reg((0x03 << OMAP24XX_AUTO_DPLL_SHIFT) |
473 (0x03 << OMAP24XX_AUTO_96M_SHIFT) |
474 (0x03 << OMAP24XX_AUTO_54M_SHIFT),
475 PLL_MOD, CM_AUTOIDLE);
476
477 omap2_cm_write_mod_reg(OMAP24XX_AUTO_OMAPCTRL_MASK |
478 OMAP24XX_AUTO_WDT1_MASK |
479 OMAP24XX_AUTO_MPU_WDT_MASK |
480 OMAP24XX_AUTO_GPIOS_MASK |
481 OMAP24XX_AUTO_32KSYNC_MASK |
482 OMAP24XX_AUTO_GPT1_MASK,
483 WKUP_MOD, CM_AUTOIDLE);
484
485 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk 424 /* REVISIT: Configure number of 32 kHz clock cycles for sys_clk
486 * stabilisation */ 425 * stabilisation */
487 omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD, 426 omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 2f864e4b085d..3d6a00e07a5b 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -496,7 +496,7 @@ console_still_active:
496 496
497 pwrdm_post_transition(); 497 pwrdm_post_transition();
498 498
499 omap2_clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]); 499 clkdm_allow_idle(mpu_pwrdm->pwrdm_clkdms[0]);
500} 500}
501 501
502int omap3_can_sleep(void) 502int omap3_can_sleep(void)
@@ -688,14 +688,11 @@ static void __init omap3_d2d_idle(void)
688 688
689static void __init prcm_setup_regs(void) 689static void __init prcm_setup_regs(void)
690{ 690{
691 u32 omap3630_auto_uart4_mask = cpu_is_omap3630() ?
692 OMAP3630_AUTO_UART4_MASK : 0;
693 u32 omap3630_en_uart4_mask = cpu_is_omap3630() ? 691 u32 omap3630_en_uart4_mask = cpu_is_omap3630() ?
694 OMAP3630_EN_UART4_MASK : 0; 692 OMAP3630_EN_UART4_MASK : 0;
695 u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ? 693 u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ?
696 OMAP3630_GRPSEL_UART4_MASK : 0; 694 OMAP3630_GRPSEL_UART4_MASK : 0;
697 695
698
699 /* XXX Reset all wkdeps. This should be done when initializing 696 /* XXX Reset all wkdeps. This should be done when initializing
700 * powerdomains */ 697 * powerdomains */
701 omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP); 698 omap2_prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
@@ -710,127 +707,10 @@ static void __init prcm_setup_regs(void)
710 } else 707 } else
711 omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP); 708 omap2_prm_write_mod_reg(0, GFX_MOD, PM_WKDEP);
712 709
713 /* 710 /* XXX This should be handled by hwmod code or SCM init code */
714 * Enable interface clock autoidle for all modules.
715 * Note that in the long run this should be done by clockfw
716 */
717 omap2_cm_write_mod_reg(
718 OMAP3430_AUTO_MODEM_MASK |
719 OMAP3430ES2_AUTO_MMC3_MASK |
720 OMAP3430ES2_AUTO_ICR_MASK |
721 OMAP3430_AUTO_AES2_MASK |
722 OMAP3430_AUTO_SHA12_MASK |
723 OMAP3430_AUTO_DES2_MASK |
724 OMAP3430_AUTO_MMC2_MASK |
725 OMAP3430_AUTO_MMC1_MASK |
726 OMAP3430_AUTO_MSPRO_MASK |
727 OMAP3430_AUTO_HDQ_MASK |
728 OMAP3430_AUTO_MCSPI4_MASK |
729 OMAP3430_AUTO_MCSPI3_MASK |
730 OMAP3430_AUTO_MCSPI2_MASK |
731 OMAP3430_AUTO_MCSPI1_MASK |
732 OMAP3430_AUTO_I2C3_MASK |
733 OMAP3430_AUTO_I2C2_MASK |
734 OMAP3430_AUTO_I2C1_MASK |
735 OMAP3430_AUTO_UART2_MASK |
736 OMAP3430_AUTO_UART1_MASK |
737 OMAP3430_AUTO_GPT11_MASK |
738 OMAP3430_AUTO_GPT10_MASK |
739 OMAP3430_AUTO_MCBSP5_MASK |
740 OMAP3430_AUTO_MCBSP1_MASK |
741 OMAP3430ES1_AUTO_FAC_MASK | /* This is es1 only */
742 OMAP3430_AUTO_MAILBOXES_MASK |
743 OMAP3430_AUTO_OMAPCTRL_MASK |
744 OMAP3430ES1_AUTO_FSHOSTUSB_MASK |
745 OMAP3430_AUTO_HSOTGUSB_MASK |
746 OMAP3430_AUTO_SAD2D_MASK |
747 OMAP3430_AUTO_SSI_MASK,
748 CORE_MOD, CM_AUTOIDLE1);
749
750 omap2_cm_write_mod_reg(
751 OMAP3430_AUTO_PKA_MASK |
752 OMAP3430_AUTO_AES1_MASK |
753 OMAP3430_AUTO_RNG_MASK |
754 OMAP3430_AUTO_SHA11_MASK |
755 OMAP3430_AUTO_DES1_MASK,
756 CORE_MOD, CM_AUTOIDLE2);
757
758 if (omap_rev() > OMAP3430_REV_ES1_0) {
759 omap2_cm_write_mod_reg(
760 OMAP3430_AUTO_MAD2D_MASK |
761 OMAP3430ES2_AUTO_USBTLL_MASK,
762 CORE_MOD, CM_AUTOIDLE3);
763 }
764
765 omap2_cm_write_mod_reg(
766 OMAP3430_AUTO_WDT2_MASK |
767 OMAP3430_AUTO_WDT1_MASK |
768 OMAP3430_AUTO_GPIO1_MASK |
769 OMAP3430_AUTO_32KSYNC_MASK |
770 OMAP3430_AUTO_GPT12_MASK |
771 OMAP3430_AUTO_GPT1_MASK,
772 WKUP_MOD, CM_AUTOIDLE);
773
774 omap2_cm_write_mod_reg(
775 OMAP3430_AUTO_DSS_MASK,
776 OMAP3430_DSS_MOD,
777 CM_AUTOIDLE);
778
779 omap2_cm_write_mod_reg(
780 OMAP3430_AUTO_CAM_MASK,
781 OMAP3430_CAM_MOD,
782 CM_AUTOIDLE);
783
784 omap2_cm_write_mod_reg(
785 omap3630_auto_uart4_mask |
786 OMAP3430_AUTO_GPIO6_MASK |
787 OMAP3430_AUTO_GPIO5_MASK |
788 OMAP3430_AUTO_GPIO4_MASK |
789 OMAP3430_AUTO_GPIO3_MASK |
790 OMAP3430_AUTO_GPIO2_MASK |
791 OMAP3430_AUTO_WDT3_MASK |
792 OMAP3430_AUTO_UART3_MASK |
793 OMAP3430_AUTO_GPT9_MASK |
794 OMAP3430_AUTO_GPT8_MASK |
795 OMAP3430_AUTO_GPT7_MASK |
796 OMAP3430_AUTO_GPT6_MASK |
797 OMAP3430_AUTO_GPT5_MASK |
798 OMAP3430_AUTO_GPT4_MASK |
799 OMAP3430_AUTO_GPT3_MASK |
800 OMAP3430_AUTO_GPT2_MASK |
801 OMAP3430_AUTO_MCBSP4_MASK |
802 OMAP3430_AUTO_MCBSP3_MASK |
803 OMAP3430_AUTO_MCBSP2_MASK,
804 OMAP3430_PER_MOD,
805 CM_AUTOIDLE);
806
807 if (omap_rev() > OMAP3430_REV_ES1_0) {
808 omap2_cm_write_mod_reg(
809 OMAP3430ES2_AUTO_USBHOST_MASK,
810 OMAP3430ES2_USBHOST_MOD,
811 CM_AUTOIDLE);
812 }
813
814 omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG); 711 omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
815 712
816 /* 713 /*
817 * Set all plls to autoidle. This is needed until autoidle is
818 * enabled by clockfw
819 */
820 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT,
821 OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
822 omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT,
823 MPU_MOD,
824 CM_AUTOIDLE2);
825 omap2_cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) |
826 (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT),
827 PLL_MOD,
828 CM_AUTOIDLE);
829 omap2_cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT,
830 PLL_MOD,
831 CM_AUTOIDLE2);
832
833 /*
834 * Enable control of expternal oscillator through 714 * Enable control of expternal oscillator through
835 * sys_clkreq. In the long run clock framework should 715 * sys_clkreq. In the long run clock framework should
836 * take care of this. 716 * take care of this.
@@ -990,10 +870,10 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
990static int __init clkdms_setup(struct clockdomain *clkdm, void *unused) 870static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
991{ 871{
992 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO) 872 if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
993 omap2_clkdm_allow_idle(clkdm); 873 clkdm_allow_idle(clkdm);
994 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP && 874 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
995 atomic_read(&clkdm->usecount) == 0) 875 atomic_read(&clkdm->usecount) == 0)
996 omap2_clkdm_sleep(clkdm); 876 clkdm_sleep(clkdm);
997 return 0; 877 return 0;
998} 878}
999 879
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eaed0df16699..a11be81997c5 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -2,7 +2,7 @@
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-2009 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
8 * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> 8 * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com>
@@ -938,3 +938,44 @@ u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
938 938
939 return count; 939 return count;
940} 940}
941
942/**
943 * pwrdm_can_ever_lose_context - can this powerdomain ever lose context?
944 * @pwrdm: struct powerdomain *
945 *
946 * Given a struct powerdomain * @pwrdm, returns 1 if the powerdomain
947 * can lose either memory or logic context or if @pwrdm is invalid, or
948 * returns 0 otherwise. This function is not concerned with how the
949 * powerdomain registers are programmed (i.e., to go off or not); it's
950 * concerned with whether it's ever possible for this powerdomain to
951 * go off while some other part of the chip is active. This function
952 * assumes that every powerdomain can go to either ON or INACTIVE.
953 */
954bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
955{
956 int i;
957
958 if (IS_ERR_OR_NULL(pwrdm)) {
959 pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
960 __func__);
961 return 1;
962 }
963
964 if (pwrdm->pwrsts & PWRSTS_OFF)
965 return 1;
966
967 if (pwrdm->pwrsts & PWRSTS_RET) {
968 if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
969 return 1;
970
971 for (i = 0; i < pwrdm->banks; i++)
972 if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
973 return 1;
974 }
975
976 for (i = 0; i < pwrdm->banks; i++)
977 if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
978 return 1;
979
980 return 0;
981}
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index c66431edfeb7..027f40bd235d 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -2,7 +2,7 @@
2 * OMAP2/3/4 powerdomain control 2 * OMAP2/3/4 powerdomain control
3 * 3 *
4 * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley 7 * Paul Walmsley
8 * 8 *
@@ -34,17 +34,14 @@
34 34
35/* Powerdomain allowable state bitfields */ 35/* Powerdomain allowable state bitfields */
36#define PWRSTS_ON (1 << PWRDM_POWER_ON) 36#define PWRSTS_ON (1 << PWRDM_POWER_ON)
37#define PWRSTS_INACTIVE (1 << PWRDM_POWER_INACTIVE)
38#define PWRSTS_RET (1 << PWRDM_POWER_RET)
37#define PWRSTS_OFF (1 << PWRDM_POWER_OFF) 39#define PWRSTS_OFF (1 << PWRDM_POWER_OFF)
38#define PWRSTS_OFF_ON ((1 << PWRDM_POWER_OFF) | \
39 (1 << PWRDM_POWER_ON))
40 40
41#define PWRSTS_OFF_RET ((1 << PWRDM_POWER_OFF) | \ 41#define PWRSTS_OFF_ON (PWRSTS_OFF | PWRSTS_ON)
42 (1 << PWRDM_POWER_RET)) 42#define PWRSTS_OFF_RET (PWRSTS_OFF | PWRSTS_RET)
43 43#define PWRSTS_RET_ON (PWRSTS_RET | PWRSTS_ON)
44#define PWRSTS_RET_ON ((1 << PWRDM_POWER_RET) | \ 44#define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON)
45 (1 << PWRDM_POWER_ON))
46
47#define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | (1 << PWRDM_POWER_ON))
48 45
49 46
50/* Powerdomain flags */ 47/* Powerdomain flags */
@@ -165,7 +162,6 @@ struct pwrdm_ops {
165 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); 162 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm);
166}; 163};
167 164
168void pwrdm_fw_init(void);
169void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); 165void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs);
170 166
171struct powerdomain *pwrdm_lookup(const char *name); 167struct powerdomain *pwrdm_lookup(const char *name);
@@ -212,6 +208,7 @@ int pwrdm_pre_transition(void);
212int pwrdm_post_transition(void); 208int pwrdm_post_transition(void);
213int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); 209int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
214u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); 210u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
211bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
215 212
216extern void omap2xxx_powerdomains_init(void); 213extern void omap2xxx_powerdomains_init(void);
217extern void omap3xxx_powerdomains_init(void); 214extern void omap3xxx_powerdomains_init(void);
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
index 5b4dd971320a..4210c3399769 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP2/3 common powerdomain definitions 2 * OMAP2/3 common powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
@@ -62,13 +62,13 @@ struct powerdomain gfx_omap2_pwrdm = {
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | 62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
63 CHIP_IS_OMAP3430ES1), 63 CHIP_IS_OMAP3430ES1),
64 .pwrsts = PWRSTS_OFF_RET_ON, 64 .pwrsts = PWRSTS_OFF_RET_ON,
65 .pwrsts_logic_ret = PWRDM_POWER_RET, 65 .pwrsts_logic_ret = PWRSTS_RET,
66 .banks = 1, 66 .banks = 1,
67 .pwrsts_mem_ret = { 67 .pwrsts_mem_ret = {
68 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 68 [0] = PWRSTS_RET, /* MEMRETSTATE */
69 }, 69 },
70 .pwrsts_mem_on = { 70 .pwrsts_mem_on = {
71 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 71 [0] = PWRSTS_ON, /* MEMONSTATE */
72 }, 72 },
73}; 73};
74 74
@@ -76,4 +76,5 @@ struct powerdomain wkup_omap2_pwrdm = {
76 .name = "wkup_pwrdm", 76 .name = "wkup_pwrdm",
77 .prcm_offs = WKUP_MOD, 77 .prcm_offs = WKUP_MOD,
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430), 78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
79 .pwrsts = PWRSTS_ON,
79}; 80};
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index 9b1a33500577..cc389fb2005d 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP2XXX powerdomain definitions 2 * OMAP2XXX powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008 Texas Instruments, Inc.
5 * Copyright (C) 2007-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
@@ -30,13 +30,13 @@ static struct powerdomain dsp_pwrdm = {
30 .prcm_offs = OMAP24XX_DSP_MOD, 30 .prcm_offs = OMAP24XX_DSP_MOD,
31 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX), 31 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
32 .pwrsts = PWRSTS_OFF_RET_ON, 32 .pwrsts = PWRSTS_OFF_RET_ON,
33 .pwrsts_logic_ret = PWRDM_POWER_RET, 33 .pwrsts_logic_ret = PWRSTS_RET,
34 .banks = 1, 34 .banks = 1,
35 .pwrsts_mem_ret = { 35 .pwrsts_mem_ret = {
36 [0] = PWRDM_POWER_RET, 36 [0] = PWRSTS_RET,
37 }, 37 },
38 .pwrsts_mem_on = { 38 .pwrsts_mem_on = {
39 [0] = PWRDM_POWER_ON, 39 [0] = PWRSTS_ON,
40 }, 40 },
41}; 41};
42 42
@@ -48,10 +48,10 @@ static struct powerdomain mpu_24xx_pwrdm = {
48 .pwrsts_logic_ret = PWRSTS_OFF_RET, 48 .pwrsts_logic_ret = PWRSTS_OFF_RET,
49 .banks = 1, 49 .banks = 1,
50 .pwrsts_mem_ret = { 50 .pwrsts_mem_ret = {
51 [0] = PWRDM_POWER_RET, 51 [0] = PWRSTS_RET,
52 }, 52 },
53 .pwrsts_mem_on = { 53 .pwrsts_mem_on = {
54 [0] = PWRDM_POWER_ON, 54 [0] = PWRSTS_ON,
55 }, 55 },
56}; 56};
57 57
@@ -78,7 +78,7 @@ static struct powerdomain core_24xx_pwrdm = {
78 * 2430-specific powerdomains 78 * 2430-specific powerdomains
79 */ 79 */
80 80
81#ifdef CONFIG_ARCH_OMAP2430 81#ifdef CONFIG_SOC_OMAP2430
82 82
83/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ 83/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */
84 84
@@ -87,17 +87,17 @@ static struct powerdomain mdm_pwrdm = {
87 .prcm_offs = OMAP2430_MDM_MOD, 87 .prcm_offs = OMAP2430_MDM_MOD,
88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
89 .pwrsts = PWRSTS_OFF_RET_ON, 89 .pwrsts = PWRSTS_OFF_RET_ON,
90 .pwrsts_logic_ret = PWRDM_POWER_RET, 90 .pwrsts_logic_ret = PWRSTS_RET,
91 .banks = 1, 91 .banks = 1,
92 .pwrsts_mem_ret = { 92 .pwrsts_mem_ret = {
93 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 93 [0] = PWRSTS_RET, /* MEMRETSTATE */
94 }, 94 },
95 .pwrsts_mem_on = { 95 .pwrsts_mem_on = {
96 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 96 [0] = PWRSTS_ON, /* MEMONSTATE */
97 }, 97 },
98}; 98};
99 99
100#endif /* CONFIG_ARCH_OMAP2430 */ 100#endif /* CONFIG_SOC_OMAP2430 */
101 101
102/* As powerdomains are added or removed above, this list must also be changed */ 102/* As powerdomains are added or removed above, this list must also be changed */
103static struct powerdomain *powerdomains_omap2xxx[] __initdata = { 103static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
@@ -111,7 +111,7 @@ static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
111 &core_24xx_pwrdm, 111 &core_24xx_pwrdm,
112#endif 112#endif
113 113
114#ifdef CONFIG_ARCH_OMAP2430 114#ifdef CONFIG_SOC_OMAP2430
115 &mdm_pwrdm, 115 &mdm_pwrdm,
116#endif 116#endif
117 NULL 117 NULL
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index e1bec562625b..9c9c113788b9 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -2,7 +2,7 @@
2 * OMAP3 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-2010 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
8 * 8 *
@@ -47,10 +47,10 @@ static struct powerdomain iva2_pwrdm = {
47 [3] = PWRSTS_OFF_RET, 47 [3] = PWRSTS_OFF_RET,
48 }, 48 },
49 .pwrsts_mem_on = { 49 .pwrsts_mem_on = {
50 [0] = PWRDM_POWER_ON, 50 [0] = PWRSTS_ON,
51 [1] = PWRDM_POWER_ON, 51 [1] = PWRSTS_ON,
52 [2] = PWRSTS_OFF_ON, 52 [2] = PWRSTS_OFF_ON,
53 [3] = PWRDM_POWER_ON, 53 [3] = PWRSTS_ON,
54 }, 54 },
55}; 55};
56 56
@@ -128,13 +128,13 @@ static struct powerdomain dss_pwrdm = {
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
129 .prcm_offs = OMAP3430_DSS_MOD, 129 .prcm_offs = OMAP3430_DSS_MOD,
130 .pwrsts = PWRSTS_OFF_RET_ON, 130 .pwrsts = PWRSTS_OFF_RET_ON,
131 .pwrsts_logic_ret = PWRDM_POWER_RET, 131 .pwrsts_logic_ret = PWRSTS_RET,
132 .banks = 1, 132 .banks = 1,
133 .pwrsts_mem_ret = { 133 .pwrsts_mem_ret = {
134 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 134 [0] = PWRSTS_RET, /* MEMRETSTATE */
135 }, 135 },
136 .pwrsts_mem_on = { 136 .pwrsts_mem_on = {
137 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 137 [0] = PWRSTS_ON, /* MEMONSTATE */
138 }, 138 },
139}; 139};
140 140
@@ -149,13 +149,13 @@ static struct powerdomain sgx_pwrdm = {
149 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 149 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
150 /* XXX This is accurate for 3430 SGX, but what about GFX? */ 150 /* XXX This is accurate for 3430 SGX, but what about GFX? */
151 .pwrsts = PWRSTS_OFF_ON, 151 .pwrsts = PWRSTS_OFF_ON,
152 .pwrsts_logic_ret = PWRDM_POWER_RET, 152 .pwrsts_logic_ret = PWRSTS_RET,
153 .banks = 1, 153 .banks = 1,
154 .pwrsts_mem_ret = { 154 .pwrsts_mem_ret = {
155 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 155 [0] = PWRSTS_RET, /* MEMRETSTATE */
156 }, 156 },
157 .pwrsts_mem_on = { 157 .pwrsts_mem_on = {
158 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 158 [0] = PWRSTS_ON, /* MEMONSTATE */
159 }, 159 },
160}; 160};
161 161
@@ -164,13 +164,13 @@ static struct powerdomain cam_pwrdm = {
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
165 .prcm_offs = OMAP3430_CAM_MOD, 165 .prcm_offs = OMAP3430_CAM_MOD,
166 .pwrsts = PWRSTS_OFF_RET_ON, 166 .pwrsts = PWRSTS_OFF_RET_ON,
167 .pwrsts_logic_ret = PWRDM_POWER_RET, 167 .pwrsts_logic_ret = PWRSTS_RET,
168 .banks = 1, 168 .banks = 1,
169 .pwrsts_mem_ret = { 169 .pwrsts_mem_ret = {
170 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 170 [0] = PWRSTS_RET, /* MEMRETSTATE */
171 }, 171 },
172 .pwrsts_mem_on = { 172 .pwrsts_mem_on = {
173 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 173 [0] = PWRSTS_ON, /* MEMONSTATE */
174 }, 174 },
175}; 175};
176 176
@@ -182,10 +182,10 @@ static struct powerdomain per_pwrdm = {
182 .pwrsts_logic_ret = PWRSTS_OFF_RET, 182 .pwrsts_logic_ret = PWRSTS_OFF_RET,
183 .banks = 1, 183 .banks = 1,
184 .pwrsts_mem_ret = { 184 .pwrsts_mem_ret = {
185 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 185 [0] = PWRSTS_RET, /* MEMRETSTATE */
186 }, 186 },
187 .pwrsts_mem_on = { 187 .pwrsts_mem_on = {
188 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 188 [0] = PWRSTS_ON, /* MEMONSTATE */
189 }, 189 },
190}; 190};
191 191
@@ -200,7 +200,7 @@ static struct powerdomain neon_pwrdm = {
200 .prcm_offs = OMAP3430_NEON_MOD, 200 .prcm_offs = OMAP3430_NEON_MOD,
201 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 201 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
202 .pwrsts = PWRSTS_OFF_RET_ON, 202 .pwrsts = PWRSTS_OFF_RET_ON,
203 .pwrsts_logic_ret = PWRDM_POWER_RET, 203 .pwrsts_logic_ret = PWRSTS_RET,
204}; 204};
205 205
206static struct powerdomain usbhost_pwrdm = { 206static struct powerdomain usbhost_pwrdm = {
@@ -208,7 +208,7 @@ static struct powerdomain usbhost_pwrdm = {
208 .prcm_offs = OMAP3430ES2_USBHOST_MOD, 208 .prcm_offs = OMAP3430ES2_USBHOST_MOD,
209 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2), 209 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
210 .pwrsts = PWRSTS_OFF_RET_ON, 210 .pwrsts = PWRSTS_OFF_RET_ON,
211 .pwrsts_logic_ret = PWRDM_POWER_RET, 211 .pwrsts_logic_ret = PWRSTS_RET,
212 /* 212 /*
213 * REVISIT: Enabling usb host save and restore mechanism seems to 213 * REVISIT: Enabling usb host save and restore mechanism seems to
214 * leave the usb host domain permanently in ACTIVE mode after 214 * leave the usb host domain permanently in ACTIVE mode after
@@ -218,10 +218,10 @@ static struct powerdomain usbhost_pwrdm = {
218 /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */ 218 /*.flags = PWRDM_HAS_HDWR_SAR,*/ /* for USBHOST ctrlr only */
219 .banks = 1, 219 .banks = 1,
220 .pwrsts_mem_ret = { 220 .pwrsts_mem_ret = {
221 [0] = PWRDM_POWER_RET, /* MEMRETSTATE */ 221 [0] = PWRSTS_RET, /* MEMRETSTATE */
222 }, 222 },
223 .pwrsts_mem_on = { 223 .pwrsts_mem_on = {
224 [0] = PWRDM_POWER_ON, /* MEMONSTATE */ 224 [0] = PWRSTS_ON, /* MEMONSTATE */
225 }, 225 },
226}; 226};
227 227
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c
index 26d7641076d7..c4222c7036a5 100644
--- a/arch/arm/mach-omap2/powerdomains44xx_data.c
+++ b/arch/arm/mach-omap2/powerdomains44xx_data.c
@@ -2,7 +2,7 @@
2 * OMAP4 Power domains framework 2 * OMAP4 Power domains framework
3 * 3 *
4 * Copyright (C) 2009-2010 Texas Instruments, Inc. 4 * Copyright (C) 2009-2010 Texas Instruments, Inc.
5 * Copyright (C) 2009-2010 Nokia Corporation 5 * Copyright (C) 2009-2011 Nokia Corporation
6 * 6 *
7 * Abhijit Pagare (abhijitpagare@ti.com) 7 * Abhijit Pagare (abhijitpagare@ti.com)
8 * Benoit Cousson (b-cousson@ti.com) 8 * Benoit Cousson (b-cousson@ti.com)
@@ -40,18 +40,18 @@ static struct powerdomain core_44xx_pwrdm = {
40 .pwrsts_logic_ret = PWRSTS_OFF_RET, 40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
41 .banks = 5, 41 .banks = 5,
42 .pwrsts_mem_ret = { 42 .pwrsts_mem_ret = {
43 [0] = PWRDM_POWER_OFF, /* core_nret_bank */ 43 [0] = PWRSTS_OFF, /* core_nret_bank */
44 [1] = PWRSTS_OFF_RET, /* core_ocmram */ 44 [1] = PWRSTS_OFF_RET, /* core_ocmram */
45 [2] = PWRDM_POWER_RET, /* core_other_bank */ 45 [2] = PWRSTS_RET, /* core_other_bank */
46 [3] = PWRSTS_OFF_RET, /* ducati_l2ram */ 46 [3] = PWRSTS_OFF_RET, /* ducati_l2ram */
47 [4] = PWRSTS_OFF_RET, /* ducati_unicache */ 47 [4] = PWRSTS_OFF_RET, /* ducati_unicache */
48 }, 48 },
49 .pwrsts_mem_on = { 49 .pwrsts_mem_on = {
50 [0] = PWRDM_POWER_ON, /* core_nret_bank */ 50 [0] = PWRSTS_ON, /* core_nret_bank */
51 [1] = PWRSTS_OFF_RET, /* core_ocmram */ 51 [1] = PWRSTS_OFF_RET, /* core_ocmram */
52 [2] = PWRDM_POWER_ON, /* core_other_bank */ 52 [2] = PWRSTS_ON, /* core_other_bank */
53 [3] = PWRDM_POWER_ON, /* ducati_l2ram */ 53 [3] = PWRSTS_ON, /* ducati_l2ram */
54 [4] = PWRDM_POWER_ON, /* ducati_unicache */ 54 [4] = PWRSTS_ON, /* ducati_unicache */
55 }, 55 },
56 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 56 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
57}; 57};
@@ -65,10 +65,10 @@ static struct powerdomain gfx_44xx_pwrdm = {
65 .pwrsts = PWRSTS_OFF_ON, 65 .pwrsts = PWRSTS_OFF_ON,
66 .banks = 1, 66 .banks = 1,
67 .pwrsts_mem_ret = { 67 .pwrsts_mem_ret = {
68 [0] = PWRDM_POWER_OFF, /* gfx_mem */ 68 [0] = PWRSTS_OFF, /* gfx_mem */
69 }, 69 },
70 .pwrsts_mem_on = { 70 .pwrsts_mem_on = {
71 [0] = PWRDM_POWER_ON, /* gfx_mem */ 71 [0] = PWRSTS_ON, /* gfx_mem */
72 }, 72 },
73 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 73 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
74}; 74};
@@ -80,15 +80,15 @@ static struct powerdomain abe_44xx_pwrdm = {
80 .prcm_partition = OMAP4430_PRM_PARTITION, 80 .prcm_partition = OMAP4430_PRM_PARTITION,
81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
82 .pwrsts = PWRSTS_OFF_RET_ON, 82 .pwrsts = PWRSTS_OFF_RET_ON,
83 .pwrsts_logic_ret = PWRDM_POWER_OFF, 83 .pwrsts_logic_ret = PWRSTS_OFF,
84 .banks = 2, 84 .banks = 2,
85 .pwrsts_mem_ret = { 85 .pwrsts_mem_ret = {
86 [0] = PWRDM_POWER_RET, /* aessmem */ 86 [0] = PWRSTS_RET, /* aessmem */
87 [1] = PWRDM_POWER_OFF, /* periphmem */ 87 [1] = PWRSTS_OFF, /* periphmem */
88 }, 88 },
89 .pwrsts_mem_on = { 89 .pwrsts_mem_on = {
90 [0] = PWRDM_POWER_ON, /* aessmem */ 90 [0] = PWRSTS_ON, /* aessmem */
91 [1] = PWRDM_POWER_ON, /* periphmem */ 91 [1] = PWRSTS_ON, /* periphmem */
92 }, 92 },
93 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 93 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
94}; 94};
@@ -103,10 +103,10 @@ static struct powerdomain dss_44xx_pwrdm = {
103 .pwrsts_logic_ret = PWRSTS_OFF, 103 .pwrsts_logic_ret = PWRSTS_OFF,
104 .banks = 1, 104 .banks = 1,
105 .pwrsts_mem_ret = { 105 .pwrsts_mem_ret = {
106 [0] = PWRDM_POWER_OFF, /* dss_mem */ 106 [0] = PWRSTS_OFF, /* dss_mem */
107 }, 107 },
108 .pwrsts_mem_on = { 108 .pwrsts_mem_on = {
109 [0] = PWRDM_POWER_ON, /* dss_mem */ 109 [0] = PWRSTS_ON, /* dss_mem */
110 }, 110 },
111 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 111 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
112}; 112};
@@ -121,14 +121,14 @@ static struct powerdomain tesla_44xx_pwrdm = {
121 .pwrsts_logic_ret = PWRSTS_OFF_RET, 121 .pwrsts_logic_ret = PWRSTS_OFF_RET,
122 .banks = 3, 122 .banks = 3,
123 .pwrsts_mem_ret = { 123 .pwrsts_mem_ret = {
124 [0] = PWRDM_POWER_RET, /* tesla_edma */ 124 [0] = PWRSTS_RET, /* tesla_edma */
125 [1] = PWRSTS_OFF_RET, /* tesla_l1 */ 125 [1] = PWRSTS_OFF_RET, /* tesla_l1 */
126 [2] = PWRSTS_OFF_RET, /* tesla_l2 */ 126 [2] = PWRSTS_OFF_RET, /* tesla_l2 */
127 }, 127 },
128 .pwrsts_mem_on = { 128 .pwrsts_mem_on = {
129 [0] = PWRDM_POWER_ON, /* tesla_edma */ 129 [0] = PWRSTS_ON, /* tesla_edma */
130 [1] = PWRDM_POWER_ON, /* tesla_l1 */ 130 [1] = PWRSTS_ON, /* tesla_l1 */
131 [2] = PWRDM_POWER_ON, /* tesla_l2 */ 131 [2] = PWRSTS_ON, /* tesla_l2 */
132 }, 132 },
133 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 133 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
134}; 134};
@@ -142,10 +142,10 @@ static struct powerdomain wkup_44xx_pwrdm = {
142 .pwrsts = PWRSTS_ON, 142 .pwrsts = PWRSTS_ON,
143 .banks = 1, 143 .banks = 1,
144 .pwrsts_mem_ret = { 144 .pwrsts_mem_ret = {
145 [0] = PWRDM_POWER_OFF, /* wkup_bank */ 145 [0] = PWRSTS_OFF, /* wkup_bank */
146 }, 146 },
147 .pwrsts_mem_on = { 147 .pwrsts_mem_on = {
148 [0] = PWRDM_POWER_ON, /* wkup_bank */ 148 [0] = PWRSTS_ON, /* wkup_bank */
149 }, 149 },
150}; 150};
151 151
@@ -162,7 +162,7 @@ static struct powerdomain cpu0_44xx_pwrdm = {
162 [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ 162 [0] = PWRSTS_OFF_RET, /* cpu0_l1 */
163 }, 163 },
164 .pwrsts_mem_on = { 164 .pwrsts_mem_on = {
165 [0] = PWRDM_POWER_ON, /* cpu0_l1 */ 165 [0] = PWRSTS_ON, /* cpu0_l1 */
166 }, 166 },
167}; 167};
168 168
@@ -179,7 +179,7 @@ static struct powerdomain cpu1_44xx_pwrdm = {
179 [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ 179 [0] = PWRSTS_OFF_RET, /* cpu1_l1 */
180 }, 180 },
181 .pwrsts_mem_on = { 181 .pwrsts_mem_on = {
182 [0] = PWRDM_POWER_ON, /* cpu1_l1 */ 182 [0] = PWRSTS_ON, /* cpu1_l1 */
183 }, 183 },
184}; 184};
185 185
@@ -192,10 +192,10 @@ static struct powerdomain emu_44xx_pwrdm = {
192 .pwrsts = PWRSTS_OFF_ON, 192 .pwrsts = PWRSTS_OFF_ON,
193 .banks = 1, 193 .banks = 1,
194 .pwrsts_mem_ret = { 194 .pwrsts_mem_ret = {
195 [0] = PWRDM_POWER_OFF, /* emu_bank */ 195 [0] = PWRSTS_OFF, /* emu_bank */
196 }, 196 },
197 .pwrsts_mem_on = { 197 .pwrsts_mem_on = {
198 [0] = PWRDM_POWER_ON, /* emu_bank */ 198 [0] = PWRSTS_ON, /* emu_bank */
199 }, 199 },
200}; 200};
201 201
@@ -211,12 +211,12 @@ static struct powerdomain mpu_44xx_pwrdm = {
211 .pwrsts_mem_ret = { 211 .pwrsts_mem_ret = {
212 [0] = PWRSTS_OFF_RET, /* mpu_l1 */ 212 [0] = PWRSTS_OFF_RET, /* mpu_l1 */
213 [1] = PWRSTS_OFF_RET, /* mpu_l2 */ 213 [1] = PWRSTS_OFF_RET, /* mpu_l2 */
214 [2] = PWRDM_POWER_RET, /* mpu_ram */ 214 [2] = PWRSTS_RET, /* mpu_ram */
215 }, 215 },
216 .pwrsts_mem_on = { 216 .pwrsts_mem_on = {
217 [0] = PWRDM_POWER_ON, /* mpu_l1 */ 217 [0] = PWRSTS_ON, /* mpu_l1 */
218 [1] = PWRDM_POWER_ON, /* mpu_l2 */ 218 [1] = PWRSTS_ON, /* mpu_l2 */
219 [2] = PWRDM_POWER_ON, /* mpu_ram */ 219 [2] = PWRSTS_ON, /* mpu_ram */
220 }, 220 },
221}; 221};
222 222
@@ -227,19 +227,19 @@ static struct powerdomain ivahd_44xx_pwrdm = {
227 .prcm_partition = OMAP4430_PRM_PARTITION, 227 .prcm_partition = OMAP4430_PRM_PARTITION,
228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
229 .pwrsts = PWRSTS_OFF_RET_ON, 229 .pwrsts = PWRSTS_OFF_RET_ON,
230 .pwrsts_logic_ret = PWRDM_POWER_OFF, 230 .pwrsts_logic_ret = PWRSTS_OFF,
231 .banks = 4, 231 .banks = 4,
232 .pwrsts_mem_ret = { 232 .pwrsts_mem_ret = {
233 [0] = PWRDM_POWER_OFF, /* hwa_mem */ 233 [0] = PWRSTS_OFF, /* hwa_mem */
234 [1] = PWRSTS_OFF_RET, /* sl2_mem */ 234 [1] = PWRSTS_OFF_RET, /* sl2_mem */
235 [2] = PWRSTS_OFF_RET, /* tcm1_mem */ 235 [2] = PWRSTS_OFF_RET, /* tcm1_mem */
236 [3] = PWRSTS_OFF_RET, /* tcm2_mem */ 236 [3] = PWRSTS_OFF_RET, /* tcm2_mem */
237 }, 237 },
238 .pwrsts_mem_on = { 238 .pwrsts_mem_on = {
239 [0] = PWRDM_POWER_ON, /* hwa_mem */ 239 [0] = PWRSTS_ON, /* hwa_mem */
240 [1] = PWRDM_POWER_ON, /* sl2_mem */ 240 [1] = PWRSTS_ON, /* sl2_mem */
241 [2] = PWRDM_POWER_ON, /* tcm1_mem */ 241 [2] = PWRSTS_ON, /* tcm1_mem */
242 [3] = PWRDM_POWER_ON, /* tcm2_mem */ 242 [3] = PWRSTS_ON, /* tcm2_mem */
243 }, 243 },
244 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 244 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
245}; 245};
@@ -253,10 +253,10 @@ static struct powerdomain cam_44xx_pwrdm = {
253 .pwrsts = PWRSTS_OFF_ON, 253 .pwrsts = PWRSTS_OFF_ON,
254 .banks = 1, 254 .banks = 1,
255 .pwrsts_mem_ret = { 255 .pwrsts_mem_ret = {
256 [0] = PWRDM_POWER_OFF, /* cam_mem */ 256 [0] = PWRSTS_OFF, /* cam_mem */
257 }, 257 },
258 .pwrsts_mem_on = { 258 .pwrsts_mem_on = {
259 [0] = PWRDM_POWER_ON, /* cam_mem */ 259 [0] = PWRSTS_ON, /* cam_mem */
260 }, 260 },
261 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 261 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
262}; 262};
@@ -271,10 +271,10 @@ static struct powerdomain l3init_44xx_pwrdm = {
271 .pwrsts_logic_ret = PWRSTS_OFF_RET, 271 .pwrsts_logic_ret = PWRSTS_OFF_RET,
272 .banks = 1, 272 .banks = 1,
273 .pwrsts_mem_ret = { 273 .pwrsts_mem_ret = {
274 [0] = PWRDM_POWER_OFF, /* l3init_bank1 */ 274 [0] = PWRSTS_OFF, /* l3init_bank1 */
275 }, 275 },
276 .pwrsts_mem_on = { 276 .pwrsts_mem_on = {
277 [0] = PWRDM_POWER_ON, /* l3init_bank1 */ 277 [0] = PWRSTS_ON, /* l3init_bank1 */
278 }, 278 },
279 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 279 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
280}; 280};
@@ -289,12 +289,12 @@ static struct powerdomain l4per_44xx_pwrdm = {
289 .pwrsts_logic_ret = PWRSTS_OFF_RET, 289 .pwrsts_logic_ret = PWRSTS_OFF_RET,
290 .banks = 2, 290 .banks = 2,
291 .pwrsts_mem_ret = { 291 .pwrsts_mem_ret = {
292 [0] = PWRDM_POWER_OFF, /* nonretained_bank */ 292 [0] = PWRSTS_OFF, /* nonretained_bank */
293 [1] = PWRDM_POWER_RET, /* retained_bank */ 293 [1] = PWRSTS_RET, /* retained_bank */
294 }, 294 },
295 .pwrsts_mem_on = { 295 .pwrsts_mem_on = {
296 [0] = PWRDM_POWER_ON, /* nonretained_bank */ 296 [0] = PWRSTS_ON, /* nonretained_bank */
297 [1] = PWRDM_POWER_ON, /* retained_bank */ 297 [1] = PWRSTS_ON, /* retained_bank */
298 }, 298 },
299 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 299 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
300}; 300};
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 87486f559784..0363dcb0ef93 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -121,6 +121,10 @@
121#define OMAP24XX_ST_MCSPI2_MASK (1 << 18) 121#define OMAP24XX_ST_MCSPI2_MASK (1 << 18)
122#define OMAP24XX_ST_MCSPI1_SHIFT 17 122#define OMAP24XX_ST_MCSPI1_SHIFT 17
123#define OMAP24XX_ST_MCSPI1_MASK (1 << 17) 123#define OMAP24XX_ST_MCSPI1_MASK (1 << 17)
124#define OMAP24XX_ST_MCBSP2_SHIFT 16
125#define OMAP24XX_ST_MCBSP2_MASK (1 << 16)
126#define OMAP24XX_ST_MCBSP1_SHIFT 15
127#define OMAP24XX_ST_MCBSP1_MASK (1 << 15)
124#define OMAP24XX_ST_GPT12_SHIFT 14 128#define OMAP24XX_ST_GPT12_SHIFT 14
125#define OMAP24XX_ST_GPT12_MASK (1 << 14) 129#define OMAP24XX_ST_GPT12_MASK (1 << 14)
126#define OMAP24XX_ST_GPT11_SHIFT 13 130#define OMAP24XX_ST_GPT11_SHIFT 13
@@ -191,6 +195,8 @@
191#define OMAP3430_AUTOIDLE_MASK (1 << 0) 195#define OMAP3430_AUTOIDLE_MASK (1 << 0)
192 196
193/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */ 197/* CM_FCLKEN1_CORE, CM_ICLKEN1_CORE, PM_WKEN1_CORE shared bits */
198#define OMAP3430_EN_MMC3_MASK (1 << 30)
199#define OMAP3430_EN_MMC3_SHIFT 30
194#define OMAP3430_EN_MMC2_MASK (1 << 25) 200#define OMAP3430_EN_MMC2_MASK (1 << 25)
195#define OMAP3430_EN_MMC2_SHIFT 25 201#define OMAP3430_EN_MMC2_SHIFT 25
196#define OMAP3430_EN_MMC1_MASK (1 << 24) 202#define OMAP3430_EN_MMC1_MASK (1 << 24)
@@ -231,6 +237,8 @@
231#define OMAP3430_EN_HSOTGUSB_SHIFT 4 237#define OMAP3430_EN_HSOTGUSB_SHIFT 4
232 238
233/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */ 239/* PM_WKST1_CORE, CM_IDLEST1_CORE shared bits */
240#define OMAP3430_ST_MMC3_SHIFT 30
241#define OMAP3430_ST_MMC3_MASK (1 << 30)
234#define OMAP3430_ST_MMC2_SHIFT 25 242#define OMAP3430_ST_MMC2_SHIFT 25
235#define OMAP3430_ST_MMC2_MASK (1 << 25) 243#define OMAP3430_ST_MMC2_MASK (1 << 25)
236#define OMAP3430_ST_MMC1_SHIFT 24 244#define OMAP3430_ST_MMC1_SHIFT 24
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c
index 679bcd28576e..6be14389e4f3 100644
--- a/arch/arm/mach-omap2/prcm.c
+++ b/arch/arm/mach-omap2/prcm.c
@@ -24,6 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26 26
27#include <mach/system.h>
27#include <plat/common.h> 28#include <plat/common.h>
28#include <plat/prcm.h> 29#include <plat/prcm.h>
29#include <plat/irqs.h> 30#include <plat/irqs.h>
@@ -57,7 +58,7 @@ u32 omap_prcm_get_reset_sources(void)
57EXPORT_SYMBOL(omap_prcm_get_reset_sources); 58EXPORT_SYMBOL(omap_prcm_get_reset_sources);
58 59
59/* Resets clock rates and reboots the system. Only called from system.h */ 60/* Resets clock rates and reboots the system. Only called from system.h */
60void omap_prcm_arch_reset(char mode, const char *cmd) 61static void omap_prcm_arch_reset(char mode, const char *cmd)
61{ 62{
62 s16 prcm_offs = 0; 63 s16 prcm_offs = 0;
63 64
@@ -108,6 +109,8 @@ void omap_prcm_arch_reset(char mode, const char *cmd)
108 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */ 109 omap2_prm_read_mod_reg(prcm_offs, OMAP2_RM_RSTCTRL); /* OCP barrier */
109} 110}
110 111
112void (*arch_reset)(char, const char *) = omap_prcm_arch_reset;
113
111/** 114/**
112 * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness 115 * omap2_cm_wait_idlest - wait for IDLEST bit to indicate module readiness
113 * @reg: physical address of module IDLEST register 116 * @reg: physical address of module IDLEST register
diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h
index 3300ff6e3cfe..d22d1b43bccd 100644
--- a/arch/arm/mach-omap2/prcm_mpu44xx.h
+++ b/arch/arm/mach-omap2/prcm_mpu44xx.h
@@ -38,8 +38,8 @@
38#define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 38#define OMAP4430_PRCM_MPU_CPU1_INST 0x0800
39 39
40/* PRCM_MPU clockdomain register offsets (from instance start) */ 40/* PRCM_MPU clockdomain register offsets (from instance start) */
41#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0018 41#define OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS 0x0018
42#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0018 42#define OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS 0x0018
43 43
44 44
45/* 45/*
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 32e91a9c8b6b..1ac361b7b8cb 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -486,7 +486,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
486 mod_timer(&uart->timer, jiffies + uart->timeout); 486 mod_timer(&uart->timer, jiffies + uart->timeout);
487 omap_uart_smart_idle_enable(uart, 0); 487 omap_uart_smart_idle_enable(uart, 0);
488 488
489 if (cpu_is_omap34xx()) { 489 if (cpu_is_omap34xx() && !cpu_is_ti816x()) {
490 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD; 490 u32 mod = (uart->num > 1) ? OMAP3430_PER_MOD : CORE_MOD;
491 u32 wk_mask = 0; 491 u32 wk_mask = 0;
492 u32 padconf = 0; 492 u32 padconf = 0;
@@ -655,7 +655,7 @@ static void serial_out_override(struct uart_port *up, int offset, int value)
655} 655}
656#endif 656#endif
657 657
658void __init omap_serial_early_init(void) 658static int __init omap_serial_early_init(void)
659{ 659{
660 int i = 0; 660 int i = 0;
661 661
@@ -672,7 +672,7 @@ void __init omap_serial_early_init(void)
672 672
673 uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); 673 uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL);
674 if (WARN_ON(!uart)) 674 if (WARN_ON(!uart))
675 return; 675 return -ENODEV;
676 676
677 uart->oh = oh; 677 uart->oh = oh;
678 uart->num = i++; 678 uart->num = i++;
@@ -680,7 +680,7 @@ void __init omap_serial_early_init(void)
680 num_uarts++; 680 num_uarts++;
681 681
682 /* 682 /*
683 * NOTE: omap_hwmod_init() has not yet been called, 683 * NOTE: omap_hwmod_setup*() has not yet been called,
684 * so no hwmod functions will work yet. 684 * so no hwmod functions will work yet.
685 */ 685 */
686 686
@@ -691,7 +691,10 @@ void __init omap_serial_early_init(void)
691 */ 691 */
692 uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET; 692 uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET;
693 } while (1); 693 } while (1);
694
695 return 0;
694} 696}
697core_initcall(omap_serial_early_init);
695 698
696/** 699/**
697 * omap_serial_init_port() - initialize single serial port 700 * omap_serial_init_port() - initialize single serial port
@@ -759,13 +762,13 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
759 p->private_data = uart; 762 p->private_data = uart;
760 763
761 /* 764 /*
762 * omap44xx: Never read empty UART fifo 765 * omap44xx, ti816x: Never read empty UART fifo
763 * omap3xxx: Never read empty UART fifo on UARTs 766 * omap3xxx: Never read empty UART fifo on UARTs
764 * with IP rev >=0x52 767 * with IP rev >=0x52
765 */ 768 */
766 uart->regshift = p->regshift; 769 uart->regshift = p->regshift;
767 uart->membase = p->membase; 770 uart->membase = p->membase;
768 if (cpu_is_omap44xx()) 771 if (cpu_is_omap44xx() || cpu_is_ti816x())
769 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT; 772 uart->errata |= UART_ERRATA_FIFO_FULL_ABORT;
770 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF) 773 else if ((serial_read_reg(uart, UART_OMAP_MVER) & 0xFF)
771 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV) 774 >= UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV)
@@ -847,7 +850,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
847 } 850 }
848 851
849 /* Enable the MDR1 errata for OMAP3 */ 852 /* Enable the MDR1 errata for OMAP3 */
850 if (cpu_is_omap34xx()) 853 if (cpu_is_omap34xx() && !cpu_is_ti816x())
851 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS; 854 uart->errata |= UART_ERRATA_i202_MDR1_ACCESS;
852} 855}
853 856
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 0fc550e7e482..3b9cf85f4bb9 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -40,10 +40,11 @@
40#include <plat/dmtimer.h> 40#include <plat/dmtimer.h>
41#include <asm/localtimer.h> 41#include <asm/localtimer.h>
42#include <asm/sched_clock.h> 42#include <asm/sched_clock.h>
43#include <plat/common.h>
44#include <plat/omap_hwmod.h>
43 45
44#include "timer-gp.h" 46#include "timer-gp.h"
45 47
46#include <plat/common.h>
47 48
48/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ 49/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
49#define MAX_GPTIMER_ID 12 50#define MAX_GPTIMER_ID 12
@@ -133,9 +134,13 @@ static void __init omap2_gp_clockevent_init(void)
133{ 134{
134 u32 tick_rate; 135 u32 tick_rate;
135 int src; 136 int src;
137 char clockevent_hwmod_name[8]; /* 8 = sizeof("timerXX0") */
136 138
137 inited = 1; 139 inited = 1;
138 140
141 sprintf(clockevent_hwmod_name, "timer%d", gptimer_id);
142 omap_hwmod_setup_one(clockevent_hwmod_name);
143
139 gptimer = omap_dm_timer_request_specific(gptimer_id); 144 gptimer = omap_dm_timer_request_specific(gptimer_id);
140 BUG_ON(gptimer == NULL); 145 BUG_ON(gptimer == NULL);
141 gptimer_wakeup = gptimer; 146 gptimer_wakeup = gptimer;
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 5298949d4b11..a9d4d143086d 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -30,118 +30,11 @@
30#include <mach/irqs.h> 30#include <mach/irqs.h>
31#include <mach/am35xx.h> 31#include <mach/am35xx.h>
32#include <plat/usb.h> 32#include <plat/usb.h>
33#include "control.h" 33#include <plat/omap_device.h>
34#include "mux.h"
34 35
35#if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X) 36#if defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined (CONFIG_USB_MUSB_AM35X)
36 37
37static void am35x_musb_reset(void)
38{
39 u32 regval;
40
41 /* Reset the musb interface */
42 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
43
44 regval |= AM35XX_USBOTGSS_SW_RST;
45 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
46
47 regval &= ~AM35XX_USBOTGSS_SW_RST;
48 omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
49
50 regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
51}
52
53static void am35x_musb_phy_power(u8 on)
54{
55 unsigned long timeout = jiffies + msecs_to_jiffies(100);
56 u32 devconf2;
57
58 if (on) {
59 /*
60 * Start the on-chip PHY and its PLL.
61 */
62 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
63
64 devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
65 devconf2 |= CONF2_PHY_PLLON;
66
67 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
68
69 pr_info(KERN_INFO "Waiting for PHY clock good...\n");
70 while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
71 & CONF2_PHYCLKGD)) {
72 cpu_relax();
73
74 if (time_after(jiffies, timeout)) {
75 pr_err(KERN_ERR "musb PHY clock good timed out\n");
76 break;
77 }
78 }
79 } else {
80 /*
81 * Power down the on-chip PHY.
82 */
83 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
84
85 devconf2 &= ~CONF2_PHY_PLLON;
86 devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN;
87 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
88 }
89}
90
91static void am35x_musb_clear_irq(void)
92{
93 u32 regval;
94
95 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
96 regval |= AM35XX_USBOTGSS_INT_CLR;
97 omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
98 regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
99}
100
101static void am35x_musb_set_mode(u8 musb_mode)
102{
103 u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
104
105 devconf2 &= ~CONF2_OTGMODE;
106 switch (musb_mode) {
107#ifdef CONFIG_USB_MUSB_HDRC_HCD
108 case MUSB_HOST: /* Force VBUS valid, ID = 0 */
109 devconf2 |= CONF2_FORCE_HOST;
110 break;
111#endif
112#ifdef CONFIG_USB_GADGET_MUSB_HDRC
113 case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
114 devconf2 |= CONF2_FORCE_DEVICE;
115 break;
116#endif
117#ifdef CONFIG_USB_MUSB_OTG
118 case MUSB_OTG: /* Don't override the VBUS/ID comparators */
119 devconf2 |= CONF2_NO_OVERRIDE;
120 break;
121#endif
122 default:
123 pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode);
124 }
125
126 omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
127}
128
129static struct resource musb_resources[] = {
130 [0] = { /* start and end set dynamically */
131 .flags = IORESOURCE_MEM,
132 },
133 [1] = { /* general IRQ */
134 .start = INT_243X_HS_USB_MC,
135 .flags = IORESOURCE_IRQ,
136 .name = "mc",
137 },
138 [2] = { /* DMA IRQ */
139 .start = INT_243X_HS_USB_DMA,
140 .flags = IORESOURCE_IRQ,
141 .name = "dma",
142 },
143};
144
145static struct musb_hdrc_config musb_config = { 38static struct musb_hdrc_config musb_config = {
146 .multipoint = 1, 39 .multipoint = 1,
147 .dyn_fifo = 1, 40 .dyn_fifo = 1,
@@ -169,38 +62,65 @@ static struct musb_hdrc_platform_data musb_plat = {
169 62
170static u64 musb_dmamask = DMA_BIT_MASK(32); 63static u64 musb_dmamask = DMA_BIT_MASK(32);
171 64
172static struct platform_device musb_device = { 65static struct omap_device_pm_latency omap_musb_latency[] = {
173 .name = "musb-omap2430", 66 {
174 .id = -1, 67 .deactivate_func = omap_device_idle_hwmods,
175 .dev = { 68 .activate_func = omap_device_enable_hwmods,
176 .dma_mask = &musb_dmamask, 69 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
177 .coherent_dma_mask = DMA_BIT_MASK(32),
178 .platform_data = &musb_plat,
179 }, 70 },
180 .num_resources = ARRAY_SIZE(musb_resources),
181 .resource = musb_resources,
182}; 71};
183 72
73static void usb_musb_mux_init(struct omap_musb_board_data *board_data)
74{
75 switch (board_data->interface_type) {
76 case MUSB_INTERFACE_UTMI:
77 omap_mux_init_signal("usba0_otg_dp", OMAP_PIN_INPUT);
78 omap_mux_init_signal("usba0_otg_dm", OMAP_PIN_INPUT);
79 break;
80 case MUSB_INTERFACE_ULPI:
81 omap_mux_init_signal("usba0_ulpiphy_clk",
82 OMAP_PIN_INPUT_PULLDOWN);
83 omap_mux_init_signal("usba0_ulpiphy_stp",
84 OMAP_PIN_INPUT_PULLDOWN);
85 omap_mux_init_signal("usba0_ulpiphy_dir",
86 OMAP_PIN_INPUT_PULLDOWN);
87 omap_mux_init_signal("usba0_ulpiphy_nxt",
88 OMAP_PIN_INPUT_PULLDOWN);
89 omap_mux_init_signal("usba0_ulpiphy_dat0",
90 OMAP_PIN_INPUT_PULLDOWN);
91 omap_mux_init_signal("usba0_ulpiphy_dat1",
92 OMAP_PIN_INPUT_PULLDOWN);
93 omap_mux_init_signal("usba0_ulpiphy_dat2",
94 OMAP_PIN_INPUT_PULLDOWN);
95 omap_mux_init_signal("usba0_ulpiphy_dat3",
96 OMAP_PIN_INPUT_PULLDOWN);
97 omap_mux_init_signal("usba0_ulpiphy_dat4",
98 OMAP_PIN_INPUT_PULLDOWN);
99 omap_mux_init_signal("usba0_ulpiphy_dat5",
100 OMAP_PIN_INPUT_PULLDOWN);
101 omap_mux_init_signal("usba0_ulpiphy_dat6",
102 OMAP_PIN_INPUT_PULLDOWN);
103 omap_mux_init_signal("usba0_ulpiphy_dat7",
104 OMAP_PIN_INPUT_PULLDOWN);
105 break;
106 default:
107 break;
108 }
109}
110
184void __init usb_musb_init(struct omap_musb_board_data *board_data) 111void __init usb_musb_init(struct omap_musb_board_data *board_data)
185{ 112{
186 if (cpu_is_omap243x()) { 113 struct omap_hwmod *oh;
187 musb_resources[0].start = OMAP243X_HS_BASE; 114 struct omap_device *od;
188 } else if (cpu_is_omap3517() || cpu_is_omap3505()) { 115 struct platform_device *pdev;
189 musb_device.name = "musb-am35x"; 116 struct device *dev;
190 musb_resources[0].start = AM35XX_IPSS_USBOTGSS_BASE; 117 int bus_id = -1;
191 musb_resources[1].start = INT_35XX_USBOTG_IRQ; 118 const char *oh_name, *name;
192 board_data->set_phy_power = am35x_musb_phy_power; 119
193 board_data->clear_irq = am35x_musb_clear_irq; 120 if (cpu_is_omap3517() || cpu_is_omap3505()) {
194 board_data->set_mode = am35x_musb_set_mode;
195 board_data->reset = am35x_musb_reset;
196 } else if (cpu_is_omap34xx()) {
197 musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
198 } else if (cpu_is_omap44xx()) { 121 } else if (cpu_is_omap44xx()) {
199 musb_resources[0].start = OMAP44XX_HSUSB_OTG_BASE; 122 usb_musb_mux_init(board_data);
200 musb_resources[1].start = OMAP44XX_IRQ_HS_USB_MC_N;
201 musb_resources[2].start = OMAP44XX_IRQ_HS_USB_DMA_N;
202 } 123 }
203 musb_resources[0].end = musb_resources[0].start + SZ_4K - 1;
204 124
205 /* 125 /*
206 * REVISIT: This line can be removed once all the platforms using 126 * REVISIT: This line can be removed once all the platforms using
@@ -212,8 +132,35 @@ void __init usb_musb_init(struct omap_musb_board_data *board_data)
212 musb_plat.mode = board_data->mode; 132 musb_plat.mode = board_data->mode;
213 musb_plat.extvbus = board_data->extvbus; 133 musb_plat.extvbus = board_data->extvbus;
214 134
215 if (platform_device_register(&musb_device) < 0) 135 if (cpu_is_omap3517() || cpu_is_omap3505()) {
216 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); 136 oh_name = "am35x_otg_hs";
137 name = "musb-am35x";
138 } else {
139 oh_name = "usb_otg_hs";
140 name = "musb-omap2430";
141 }
142
143 oh = omap_hwmod_lookup(oh_name);
144 if (!oh) {
145 pr_err("Could not look up %s\n", oh_name);
146 return;
147 }
148
149 od = omap_device_build(name, bus_id, oh, &musb_plat,
150 sizeof(musb_plat), omap_musb_latency,
151 ARRAY_SIZE(omap_musb_latency), false);
152 if (IS_ERR(od)) {
153 pr_err("Could not build omap_device for %s %s\n",
154 name, oh_name);
155 return;
156 }
157
158 pdev = &od->pdev;
159 dev = &pdev->dev;
160 get_device(dev);
161 dev->dma_mask = &musb_dmamask;
162 dev->coherent_dma_mask = musb_dmamask;
163 put_device(dev);
217} 164}
218 165
219#else 166#else
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index fc62fb5fc20b..c9122dd6ee8d 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -37,14 +37,16 @@ static struct clk_functions *arch_clock;
37int clk_enable(struct clk *clk) 37int clk_enable(struct clk *clk)
38{ 38{
39 unsigned long flags; 39 unsigned long flags;
40 int ret = 0; 40 int ret;
41 41
42 if (clk == NULL || IS_ERR(clk)) 42 if (clk == NULL || IS_ERR(clk))
43 return -EINVAL; 43 return -EINVAL;
44 44
45 if (!arch_clock || !arch_clock->clk_enable)
46 return -EINVAL;
47
45 spin_lock_irqsave(&clockfw_lock, flags); 48 spin_lock_irqsave(&clockfw_lock, flags);
46 if (arch_clock->clk_enable) 49 ret = arch_clock->clk_enable(clk);
47 ret = arch_clock->clk_enable(clk);
48 spin_unlock_irqrestore(&clockfw_lock, flags); 50 spin_unlock_irqrestore(&clockfw_lock, flags);
49 51
50 return ret; 52 return ret;
@@ -58,6 +60,9 @@ void clk_disable(struct clk *clk)
58 if (clk == NULL || IS_ERR(clk)) 60 if (clk == NULL || IS_ERR(clk))
59 return; 61 return;
60 62
63 if (!arch_clock || !arch_clock->clk_disable)
64 return;
65
61 spin_lock_irqsave(&clockfw_lock, flags); 66 spin_lock_irqsave(&clockfw_lock, flags);
62 if (clk->usecount == 0) { 67 if (clk->usecount == 0) {
63 pr_err("Trying disable clock %s with 0 usecount\n", 68 pr_err("Trying disable clock %s with 0 usecount\n",
@@ -66,8 +71,7 @@ void clk_disable(struct clk *clk)
66 goto out; 71 goto out;
67 } 72 }
68 73
69 if (arch_clock->clk_disable) 74 arch_clock->clk_disable(clk);
70 arch_clock->clk_disable(clk);
71 75
72out: 76out:
73 spin_unlock_irqrestore(&clockfw_lock, flags); 77 spin_unlock_irqrestore(&clockfw_lock, flags);
@@ -77,7 +81,7 @@ EXPORT_SYMBOL(clk_disable);
77unsigned long clk_get_rate(struct clk *clk) 81unsigned long clk_get_rate(struct clk *clk)
78{ 82{
79 unsigned long flags; 83 unsigned long flags;
80 unsigned long ret = 0; 84 unsigned long ret;
81 85
82 if (clk == NULL || IS_ERR(clk)) 86 if (clk == NULL || IS_ERR(clk))
83 return 0; 87 return 0;
@@ -97,14 +101,16 @@ EXPORT_SYMBOL(clk_get_rate);
97long clk_round_rate(struct clk *clk, unsigned long rate) 101long clk_round_rate(struct clk *clk, unsigned long rate)
98{ 102{
99 unsigned long flags; 103 unsigned long flags;
100 long ret = 0; 104 long ret;
101 105
102 if (clk == NULL || IS_ERR(clk)) 106 if (clk == NULL || IS_ERR(clk))
103 return ret; 107 return 0;
108
109 if (!arch_clock || !arch_clock->clk_round_rate)
110 return 0;
104 111
105 spin_lock_irqsave(&clockfw_lock, flags); 112 spin_lock_irqsave(&clockfw_lock, flags);
106 if (arch_clock->clk_round_rate) 113 ret = arch_clock->clk_round_rate(clk, rate);
107 ret = arch_clock->clk_round_rate(clk, rate);
108 spin_unlock_irqrestore(&clockfw_lock, flags); 114 spin_unlock_irqrestore(&clockfw_lock, flags);
109 115
110 return ret; 116 return ret;
@@ -119,14 +125,13 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
119 if (clk == NULL || IS_ERR(clk)) 125 if (clk == NULL || IS_ERR(clk))
120 return ret; 126 return ret;
121 127
128 if (!arch_clock || !arch_clock->clk_set_rate)
129 return ret;
130
122 spin_lock_irqsave(&clockfw_lock, flags); 131 spin_lock_irqsave(&clockfw_lock, flags);
123 if (arch_clock->clk_set_rate) 132 ret = arch_clock->clk_set_rate(clk, rate);
124 ret = arch_clock->clk_set_rate(clk, rate); 133 if (ret == 0)
125 if (ret == 0) {
126 if (clk->recalc)
127 clk->rate = clk->recalc(clk);
128 propagate_rate(clk); 134 propagate_rate(clk);
129 }
130 spin_unlock_irqrestore(&clockfw_lock, flags); 135 spin_unlock_irqrestore(&clockfw_lock, flags);
131 136
132 return ret; 137 return ret;
@@ -141,15 +146,14 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
141 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent)) 146 if (clk == NULL || IS_ERR(clk) || parent == NULL || IS_ERR(parent))
142 return ret; 147 return ret;
143 148
149 if (!arch_clock || !arch_clock->clk_set_parent)
150 return ret;
151
144 spin_lock_irqsave(&clockfw_lock, flags); 152 spin_lock_irqsave(&clockfw_lock, flags);
145 if (clk->usecount == 0) { 153 if (clk->usecount == 0) {
146 if (arch_clock->clk_set_parent) 154 ret = arch_clock->clk_set_parent(clk, parent);
147 ret = arch_clock->clk_set_parent(clk, parent); 155 if (ret == 0)
148 if (ret == 0) {
149 if (clk->recalc)
150 clk->rate = clk->recalc(clk);
151 propagate_rate(clk); 156 propagate_rate(clk);
152 }
153 } else 157 } else
154 ret = -EBUSY; 158 ret = -EBUSY;
155 spin_unlock_irqrestore(&clockfw_lock, flags); 159 spin_unlock_irqrestore(&clockfw_lock, flags);
@@ -335,6 +339,38 @@ struct clk *omap_clk_get_by_name(const char *name)
335 return ret; 339 return ret;
336} 340}
337 341
342int omap_clk_enable_autoidle_all(void)
343{
344 struct clk *c;
345 unsigned long flags;
346
347 spin_lock_irqsave(&clockfw_lock, flags);
348
349 list_for_each_entry(c, &clocks, node)
350 if (c->ops->allow_idle)
351 c->ops->allow_idle(c);
352
353 spin_unlock_irqrestore(&clockfw_lock, flags);
354
355 return 0;
356}
357
358int omap_clk_disable_autoidle_all(void)
359{
360 struct clk *c;
361 unsigned long flags;
362
363 spin_lock_irqsave(&clockfw_lock, flags);
364
365 list_for_each_entry(c, &clocks, node)
366 if (c->ops->deny_idle)
367 c->ops->deny_idle(c);
368
369 spin_unlock_irqrestore(&clockfw_lock, flags);
370
371 return 0;
372}
373
338/* 374/*
339 * Low level helpers 375 * Low level helpers
340 */ 376 */
@@ -367,9 +403,11 @@ void clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
367{ 403{
368 unsigned long flags; 404 unsigned long flags;
369 405
406 if (!arch_clock || !arch_clock->clk_init_cpufreq_table)
407 return;
408
370 spin_lock_irqsave(&clockfw_lock, flags); 409 spin_lock_irqsave(&clockfw_lock, flags);
371 if (arch_clock->clk_init_cpufreq_table) 410 arch_clock->clk_init_cpufreq_table(table);
372 arch_clock->clk_init_cpufreq_table(table);
373 spin_unlock_irqrestore(&clockfw_lock, flags); 411 spin_unlock_irqrestore(&clockfw_lock, flags);
374} 412}
375 413
@@ -377,9 +415,11 @@ void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
377{ 415{
378 unsigned long flags; 416 unsigned long flags;
379 417
418 if (!arch_clock || !arch_clock->clk_exit_cpufreq_table)
419 return;
420
380 spin_lock_irqsave(&clockfw_lock, flags); 421 spin_lock_irqsave(&clockfw_lock, flags);
381 if (arch_clock->clk_exit_cpufreq_table) 422 arch_clock->clk_exit_cpufreq_table(table);
382 arch_clock->clk_exit_cpufreq_table(table);
383 spin_unlock_irqrestore(&clockfw_lock, flags); 423 spin_unlock_irqrestore(&clockfw_lock, flags);
384} 424}
385#endif 425#endif
@@ -397,6 +437,9 @@ static int __init clk_disable_unused(void)
397 struct clk *ck; 437 struct clk *ck;
398 unsigned long flags; 438 unsigned long flags;
399 439
440 if (!arch_clock || !arch_clock->clk_disable_unused)
441 return 0;
442
400 pr_info("clock: disabling unused clocks to save power\n"); 443 pr_info("clock: disabling unused clocks to save power\n");
401 list_for_each_entry(ck, &clocks, node) { 444 list_for_each_entry(ck, &clocks, node) {
402 if (ck->ops == &clkops_null) 445 if (ck->ops == &clkops_null)
@@ -406,14 +449,14 @@ static int __init clk_disable_unused(void)
406 continue; 449 continue;
407 450
408 spin_lock_irqsave(&clockfw_lock, flags); 451 spin_lock_irqsave(&clockfw_lock, flags);
409 if (arch_clock->clk_disable_unused) 452 arch_clock->clk_disable_unused(ck);
410 arch_clock->clk_disable_unused(ck);
411 spin_unlock_irqrestore(&clockfw_lock, flags); 453 spin_unlock_irqrestore(&clockfw_lock, flags);
412 } 454 }
413 455
414 return 0; 456 return 0;
415} 457}
416late_initcall(clk_disable_unused); 458late_initcall(clk_disable_unused);
459late_initcall(omap_clk_enable_autoidle_all);
417#endif 460#endif
418 461
419int __init clk_init(struct clk_functions * custom_clocks) 462int __init clk_init(struct clk_functions * custom_clocks)
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index f04731820301..d9f10a31e604 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -24,10 +24,11 @@
24 24
25#define NO_LENGTH_CHECK 0xffffffff 25#define NO_LENGTH_CHECK 0xffffffff
26 26
27struct omap_board_config_kernel *omap_board_config; 27struct omap_board_config_kernel *omap_board_config __initdata;
28int omap_board_config_size; 28int omap_board_config_size;
29 29
30static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) 30static const void *__init get_config(u16 tag, size_t len,
31 int skip, size_t *len_out)
31{ 32{
32 struct omap_board_config_kernel *kinfo = NULL; 33 struct omap_board_config_kernel *kinfo = NULL;
33 int i; 34 int i;
@@ -49,17 +50,15 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
49 return kinfo->data; 50 return kinfo->data;
50} 51}
51 52
52const void *__omap_get_config(u16 tag, size_t len, int nr) 53const void *__init __omap_get_config(u16 tag, size_t len, int nr)
53{ 54{
54 return get_config(tag, len, nr, NULL); 55 return get_config(tag, len, nr, NULL);
55} 56}
56EXPORT_SYMBOL(__omap_get_config);
57 57
58const void *omap_get_var_config(u16 tag, size_t *len) 58const void *__init omap_get_var_config(u16 tag, size_t *len)
59{ 59{
60 return get_config(tag, NO_LENGTH_CHECK, 0, len); 60 return get_config(tag, NO_LENGTH_CHECK, 0, len);
61} 61}
62EXPORT_SYMBOL(omap_get_var_config);
63 62
64void __init omap_reserve(void) 63void __init omap_reserve(void)
65{ 64{
diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
index 862dda95d61d..f7fed6080190 100644
--- a/arch/arm/plat-omap/counter_32k.c
+++ b/arch/arm/plat-omap/counter_32k.c
@@ -54,7 +54,7 @@ static cycle_t notrace omap16xx_32k_read(struct clocksource *cs)
54#define omap16xx_32k_read NULL 54#define omap16xx_32k_read NULL
55#endif 55#endif
56 56
57#ifdef CONFIG_ARCH_OMAP2420 57#ifdef CONFIG_SOC_OMAP2420
58static cycle_t notrace omap2420_32k_read(struct clocksource *cs) 58static cycle_t notrace omap2420_32k_read(struct clocksource *cs)
59{ 59{
60 return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k; 60 return omap_readl(OMAP2420_32KSYNCT_BASE + 0x10) - offset_32k;
@@ -63,7 +63,7 @@ static cycle_t notrace omap2420_32k_read(struct clocksource *cs)
63#define omap2420_32k_read NULL 63#define omap2420_32k_read NULL
64#endif 64#endif
65 65
66#ifdef CONFIG_ARCH_OMAP2430 66#ifdef CONFIG_SOC_OMAP2430
67static cycle_t notrace omap2430_32k_read(struct clocksource *cs) 67static cycle_t notrace omap2430_32k_read(struct clocksource *cs)
68{ 68{
69 return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k; 69 return omap_readl(OMAP2430_32KSYNCT_BASE + 0x10) - offset_32k;
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index 11c54ec8d47f..da4f68dbba1d 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -101,7 +101,7 @@ static int omap_target(struct cpufreq_policy *policy,
101 return ret; 101 return ret;
102} 102}
103 103
104static int __init omap_cpu_init(struct cpufreq_policy *policy) 104static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
105{ 105{
106 int result = 0; 106 int result = 0;
107 107
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index 10245b837c10..7d9f815cedec 100644
--- a/arch/arm/plat-omap/devices.c
+++ b/arch/arm/plat-omap/devices.c
@@ -35,8 +35,8 @@
35 35
36static struct platform_device **omap_mcbsp_devices; 36static struct platform_device **omap_mcbsp_devices;
37 37
38void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, 38void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
39 int size) 39 struct omap_mcbsp_platform_data *config, int size)
40{ 40{
41 int i; 41 int i;
42 42
@@ -54,6 +54,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
54 new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1); 54 new_mcbsp = platform_device_alloc("omap-mcbsp", i + 1);
55 if (!new_mcbsp) 55 if (!new_mcbsp)
56 continue; 56 continue;
57 platform_device_add_resources(new_mcbsp, &res[i * res_count],
58 res_count);
57 new_mcbsp->dev.platform_data = &config[i]; 59 new_mcbsp->dev.platform_data = &config[i];
58 ret = platform_device_add(new_mcbsp); 60 ret = platform_device_add(new_mcbsp);
59 if (ret) { 61 if (ret) {
@@ -65,8 +67,8 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
65} 67}
66 68
67#else 69#else
68void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, 70void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
69 int size) 71 struct omap_mcbsp_platform_data *config, int size)
70{ } 72{ }
71#endif 73#endif
72 74
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 85363084cc1a..2ec3b5d9f214 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -134,7 +134,7 @@ static inline void omap_enable_channel_irq(int lch);
134 134
135#ifdef CONFIG_ARCH_OMAP15XX 135#ifdef CONFIG_ARCH_OMAP15XX
136/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ 136/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
137int omap_dma_in_1510_mode(void) 137static int omap_dma_in_1510_mode(void)
138{ 138{
139 return enable_1510_mode; 139 return enable_1510_mode;
140} 140}
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 1d706cf63ca0..ee9f6ebba29b 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -342,6 +342,10 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer)
342 l |= 0x02 << 3; /* Set to smart-idle mode */ 342 l |= 0x02 << 3; /* Set to smart-idle mode */
343 l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ 343 l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */
344 344
345 /* Enable autoidle on OMAP2 / OMAP3 */
346 if (cpu_is_omap24xx() || cpu_is_omap34xx())
347 l |= 0x1 << 0;
348
345 /* 349 /*
346 * Enable wake-up on OMAP2 CPUs. 350 * Enable wake-up on OMAP2 CPUs.
347 */ 351 */
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index a4f8003de664..3341ca4703e9 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -112,6 +112,7 @@ static inline int omap1_i2c_add_bus(int bus_id)
112} 112}
113 113
114 114
115#ifdef CONFIG_ARCH_OMAP2PLUS
115/* 116/*
116 * XXX This function is a temporary compatibility wrapper - only 117 * XXX This function is a temporary compatibility wrapper - only
117 * needed until the I2C driver can be converted to call 118 * needed until the I2C driver can be converted to call
@@ -130,7 +131,6 @@ static struct omap_device_pm_latency omap_i2c_latency[] = {
130 }, 131 },
131}; 132};
132 133
133#ifdef CONFIG_ARCH_OMAP2PLUS
134static inline int omap2_i2c_add_bus(int bus_id) 134static inline int omap2_i2c_add_bus(int bus_id)
135{ 135{
136 int l; 136 int l;
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 3cf4fa25ab3d..97126dfd2888 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -151,14 +151,14 @@ struct omap_board_config_kernel {
151 const void *data; 151 const void *data;
152}; 152};
153 153
154extern const void *__omap_get_config(u16 tag, size_t len, int nr); 154extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
155 155
156#define omap_get_config(tag, type) \ 156#define omap_get_config(tag, type) \
157 ((const type *) __omap_get_config((tag), sizeof(type), 0)) 157 ((const type *) __omap_get_config((tag), sizeof(type), 0))
158#define omap_get_nr_config(tag, type, nr) \ 158#define omap_get_nr_config(tag, type, nr) \
159 ((const type *) __omap_get_config((tag), sizeof(type), (nr))) 159 ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
160 160
161extern const void *omap_get_var_config(u16 tag, size_t *len); 161extern const void *__init omap_get_var_config(u16 tag, size_t *len);
162 162
163extern struct omap_board_config_kernel *omap_board_config; 163extern struct omap_board_config_kernel *omap_board_config;
164extern int omap_board_config_size; 164extern int omap_board_config_size;
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h
index 256ab3f1ec8f..f1899a3e4174 100644
--- a/arch/arm/plat-omap/include/plat/clkdev_omap.h
+++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h
@@ -38,6 +38,7 @@ struct omap_clk {
38#define CK_3517 (1 << 9) 38#define CK_3517 (1 << 9)
39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */ 39#define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */
40#define CK_443X (1 << 11) 40#define CK_443X (1 << 11)
41#define CK_TI816X (1 << 12)
41 42
42 43
43#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) 44#define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS)
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 8eb0adab19ea..006e599c6613 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -25,6 +25,8 @@ struct clockdomain;
25 * @disable: fn ptr that enables the current clock in hardware 25 * @disable: fn ptr that enables the current clock in hardware
26 * @find_idlest: function returning the IDLEST register for the clock's IP blk 26 * @find_idlest: function returning the IDLEST register for the clock's IP blk
27 * @find_companion: function returning the "companion" clk reg for the clock 27 * @find_companion: function returning the "companion" clk reg for the clock
28 * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
29 * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
28 * 30 *
29 * A "companion" clk is an accompanying clock to the one being queried 31 * A "companion" clk is an accompanying clock to the one being queried
30 * that must be enabled for the IP module connected to the clock to 32 * that must be enabled for the IP module connected to the clock to
@@ -42,6 +44,8 @@ struct clkops {
42 u8 *, u8 *); 44 u8 *, u8 *);
43 void (*find_companion)(struct clk *, void __iomem **, 45 void (*find_companion)(struct clk *, void __iomem **,
44 u8 *); 46 u8 *);
47 void (*allow_idle)(struct clk *);
48 void (*deny_idle)(struct clk *);
45}; 49};
46 50
47#ifdef CONFIG_ARCH_OMAP2PLUS 51#ifdef CONFIG_ARCH_OMAP2PLUS
@@ -53,6 +57,7 @@ struct clkops {
53#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */ 57#define RATE_IN_3430ES2PLUS (1 << 3) /* 3430 ES >= 2 rates only */
54#define RATE_IN_36XX (1 << 4) 58#define RATE_IN_36XX (1 << 4)
55#define RATE_IN_4430 (1 << 5) 59#define RATE_IN_4430 (1 << 5)
60#define RATE_IN_TI816X (1 << 6)
56 61
57#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X) 62#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
58#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS) 63#define RATE_IN_34XX (RATE_IN_3430ES1 | RATE_IN_3430ES2PLUS)
@@ -104,7 +109,6 @@ struct clksel {
104 * @clk_ref: struct clk pointer to the clock's reference clock input 109 * @clk_ref: struct clk pointer to the clock's reference clock input
105 * @control_reg: register containing the DPLL mode bitfield 110 * @control_reg: register containing the DPLL mode bitfield
106 * @enable_mask: mask of the DPLL mode bitfield in @control_reg 111 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
107 * @rate_tolerance: maximum variance allowed from target rate (in Hz)
108 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate() 112 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
109 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate() 113 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
110 * @max_multiplier: maximum valid non-bypass multiplier value (actual) 114 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
@@ -130,12 +134,9 @@ struct clksel {
130 * XXX Some DPLLs have multiple bypass inputs, so it's not technically 134 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
131 * correct to only have one @clk_bypass pointer. 135 * correct to only have one @clk_bypass pointer.
132 * 136 *
133 * XXX @rate_tolerance should probably be deprecated - currently there
134 * don't seem to be any usecases for DPLL rounding that is not exact.
135 *
136 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m, 137 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
137 * @last_rounded_n) should be separated from the runtime-fixed fields 138 * @last_rounded_n) should be separated from the runtime-fixed fields
138 * and placed into a differenct structure, so that the runtime-fixed data 139 * and placed into a different structure, so that the runtime-fixed data
139 * can be placed into read-only space. 140 * can be placed into read-only space.
140 */ 141 */
141struct dpll_data { 142struct dpll_data {
@@ -146,7 +147,6 @@ struct dpll_data {
146 struct clk *clk_ref; 147 struct clk *clk_ref;
147 void __iomem *control_reg; 148 void __iomem *control_reg;
148 u32 enable_mask; 149 u32 enable_mask;
149 unsigned int rate_tolerance;
150 unsigned long last_rounded_rate; 150 unsigned long last_rounded_rate;
151 u16 last_rounded_m; 151 u16 last_rounded_m;
152 u16 max_multiplier; 152 u16 max_multiplier;
@@ -171,12 +171,24 @@ struct dpll_data {
171 171
172#endif 172#endif
173 173
174/* struct clk.flags possibilities */ 174/*
175 * struct clk.flags possibilities
176 *
177 * XXX document the rest of the clock flags here
178 *
179 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
180 * bits share the same register. This flag allows the
181 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
182 * should be used. This is a temporary solution - a better approach
183 * would be to associate clock type-specific data with the clock,
184 * similar to the struct dpll_data approach.
185 */
175#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ 186#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
176#define CLOCK_IDLE_CONTROL (1 << 1) 187#define CLOCK_IDLE_CONTROL (1 << 1)
177#define CLOCK_NO_IDLE_PARENT (1 << 2) 188#define CLOCK_NO_IDLE_PARENT (1 << 2)
178#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ 189#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
179#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */ 190#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
191#define CLOCK_CLKOUTX2 (1 << 5)
180 192
181/** 193/**
182 * struct clk - OMAP struct clk 194 * struct clk - OMAP struct clk
@@ -292,6 +304,8 @@ extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
292extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); 304extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
293#endif 305#endif
294extern struct clk *omap_clk_get_by_name(const char *name); 306extern struct clk *omap_clk_get_by_name(const char *name);
307extern int omap_clk_enable_autoidle_all(void);
308extern int omap_clk_disable_autoidle_all(void);
295 309
296extern const struct clkops clkops_null; 310extern const struct clkops clkops_null;
297 311
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 29b2afb4288f..1dd97e7461c9 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -66,6 +66,7 @@ void omap2_set_globals_242x(void);
66void omap2_set_globals_243x(void); 66void omap2_set_globals_243x(void);
67void omap2_set_globals_3xxx(void); 67void omap2_set_globals_3xxx(void);
68void omap2_set_globals_443x(void); 68void omap2_set_globals_443x(void);
69void omap2_set_globals_ti816x(void);
69 70
70/* These get called from omap2_set_globals_xxxx(), do not call these */ 71/* These get called from omap2_set_globals_xxxx(), do not call these */
71void omap2_set_globals_tap(struct omap_globals *); 72void omap2_set_globals_tap(struct omap_globals *);
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 3fd8b4055727..8198bb6cdb5e 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2004, 2008 Nokia Corporation 6 * Copyright (C) 2004, 2008 Nokia Corporation
7 * 7 *
8 * Copyright (C) 2009 Texas Instruments. 8 * Copyright (C) 2009-11 Texas Instruments.
9 * 9 *
10 * Written by Tony Lindgren <tony.lindgren@nokia.com> 10 * Written by Tony Lindgren <tony.lindgren@nokia.com>
11 * 11 *
@@ -105,6 +105,12 @@ static inline int is_omap ##subclass (void) \
105 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ 105 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
106} 106}
107 107
108#define IS_TI_SUBCLASS(subclass, id) \
109static inline int is_ti ##subclass (void) \
110{ \
111 return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \
112}
113
108IS_OMAP_CLASS(7xx, 0x07) 114IS_OMAP_CLASS(7xx, 0x07)
109IS_OMAP_CLASS(15xx, 0x15) 115IS_OMAP_CLASS(15xx, 0x15)
110IS_OMAP_CLASS(16xx, 0x16) 116IS_OMAP_CLASS(16xx, 0x16)
@@ -118,6 +124,8 @@ IS_OMAP_SUBCLASS(343x, 0x343)
118IS_OMAP_SUBCLASS(363x, 0x363) 124IS_OMAP_SUBCLASS(363x, 0x363)
119IS_OMAP_SUBCLASS(443x, 0x443) 125IS_OMAP_SUBCLASS(443x, 0x443)
120 126
127IS_TI_SUBCLASS(816x, 0x816)
128
121#define cpu_is_omap7xx() 0 129#define cpu_is_omap7xx() 0
122#define cpu_is_omap15xx() 0 130#define cpu_is_omap15xx() 0
123#define cpu_is_omap16xx() 0 131#define cpu_is_omap16xx() 0
@@ -126,6 +134,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
126#define cpu_is_omap243x() 0 134#define cpu_is_omap243x() 0
127#define cpu_is_omap34xx() 0 135#define cpu_is_omap34xx() 0
128#define cpu_is_omap343x() 0 136#define cpu_is_omap343x() 0
137#define cpu_is_ti816x() 0
129#define cpu_is_omap44xx() 0 138#define cpu_is_omap44xx() 0
130#define cpu_is_omap443x() 0 139#define cpu_is_omap443x() 0
131 140
@@ -170,11 +179,11 @@ IS_OMAP_SUBCLASS(443x, 0x443)
170# undef cpu_is_omap24xx 179# undef cpu_is_omap24xx
171# define cpu_is_omap24xx() is_omap24xx() 180# define cpu_is_omap24xx() is_omap24xx()
172# endif 181# endif
173# if defined (CONFIG_ARCH_OMAP2420) 182# if defined (CONFIG_SOC_OMAP2420)
174# undef cpu_is_omap242x 183# undef cpu_is_omap242x
175# define cpu_is_omap242x() is_omap242x() 184# define cpu_is_omap242x() is_omap242x()
176# endif 185# endif
177# if defined (CONFIG_ARCH_OMAP2430) 186# if defined (CONFIG_SOC_OMAP2430)
178# undef cpu_is_omap243x 187# undef cpu_is_omap243x
179# define cpu_is_omap243x() is_omap243x() 188# define cpu_is_omap243x() is_omap243x()
180# endif 189# endif
@@ -189,11 +198,11 @@ IS_OMAP_SUBCLASS(443x, 0x443)
189# undef cpu_is_omap24xx 198# undef cpu_is_omap24xx
190# define cpu_is_omap24xx() 1 199# define cpu_is_omap24xx() 1
191# endif 200# endif
192# if defined(CONFIG_ARCH_OMAP2420) 201# if defined(CONFIG_SOC_OMAP2420)
193# undef cpu_is_omap242x 202# undef cpu_is_omap242x
194# define cpu_is_omap242x() 1 203# define cpu_is_omap242x() 1
195# endif 204# endif
196# if defined(CONFIG_ARCH_OMAP2430) 205# if defined(CONFIG_SOC_OMAP2430)
197# undef cpu_is_omap243x 206# undef cpu_is_omap243x
198# define cpu_is_omap243x() 1 207# define cpu_is_omap243x() 1
199# endif 208# endif
@@ -201,7 +210,7 @@ IS_OMAP_SUBCLASS(443x, 0x443)
201# undef cpu_is_omap34xx 210# undef cpu_is_omap34xx
202# define cpu_is_omap34xx() 1 211# define cpu_is_omap34xx() 1
203# endif 212# endif
204# if defined(CONFIG_ARCH_OMAP3430) 213# if defined(CONFIG_SOC_OMAP3430)
205# undef cpu_is_omap343x 214# undef cpu_is_omap343x
206# define cpu_is_omap343x() 1 215# define cpu_is_omap343x() 1
207# endif 216# endif
@@ -330,6 +339,7 @@ IS_OMAP_TYPE(3517, 0x3517)
330# undef cpu_is_omap3530 339# undef cpu_is_omap3530
331# undef cpu_is_omap3505 340# undef cpu_is_omap3505
332# undef cpu_is_omap3517 341# undef cpu_is_omap3517
342# undef cpu_is_ti816x
333# define cpu_is_omap3430() is_omap3430() 343# define cpu_is_omap3430() is_omap3430()
334# define cpu_is_omap3503() (cpu_is_omap3430() && \ 344# define cpu_is_omap3503() (cpu_is_omap3430() && \
335 (!omap3_has_iva()) && \ 345 (!omap3_has_iva()) && \
@@ -345,6 +355,7 @@ IS_OMAP_TYPE(3517, 0x3517)
345# define cpu_is_omap3517() is_omap3517() 355# define cpu_is_omap3517() is_omap3517()
346# undef cpu_is_omap3630 356# undef cpu_is_omap3630
347# define cpu_is_omap3630() is_omap363x() 357# define cpu_is_omap3630() is_omap363x()
358# define cpu_is_ti816x() is_ti816x()
348#endif 359#endif
349 360
350# if defined(CONFIG_ARCH_OMAP4) 361# if defined(CONFIG_ARCH_OMAP4)
@@ -389,9 +400,15 @@ IS_OMAP_TYPE(3517, 0x3517)
389#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 8)) 400#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 8))
390#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8)) 401#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8))
391 402
403#define TI816X_CLASS 0x81600034
404#define TI8168_REV_ES1_0 TI816X_CLASS
405#define TI8168_REV_ES1_1 (TI816X_CLASS | (OMAP_REVBITS_01 << 8))
406
392#define OMAP443X_CLASS 0x44300044 407#define OMAP443X_CLASS 0x44300044
393#define OMAP4430_REV_ES1_0 OMAP443X_CLASS 408#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
394#define OMAP4430_REV_ES2_0 0x44301044 409#define OMAP4430_REV_ES2_0 (OMAP443X_CLASS | (0x20 << 8))
410#define OMAP4430_REV_ES2_1 (OMAP443X_CLASS | (0x21 << 8))
411#define OMAP4430_REV_ES2_2 (OMAP443X_CLASS | (0x22 << 8))
395 412
396/* 413/*
397 * omap_chip bits 414 * omap_chip bits
@@ -419,11 +436,16 @@ IS_OMAP_TYPE(3517, 0x3517)
419#define CHIP_IS_OMAP3630ES1_1 (1 << 9) 436#define CHIP_IS_OMAP3630ES1_1 (1 << 9)
420#define CHIP_IS_OMAP3630ES1_2 (1 << 10) 437#define CHIP_IS_OMAP3630ES1_2 (1 << 10)
421#define CHIP_IS_OMAP4430ES2 (1 << 11) 438#define CHIP_IS_OMAP4430ES2 (1 << 11)
439#define CHIP_IS_OMAP4430ES2_1 (1 << 12)
440#define CHIP_IS_OMAP4430ES2_2 (1 << 13)
441#define CHIP_IS_TI816X (1 << 14)
422 442
423#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430) 443#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
424 444
425#define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \ 445#define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \
426 CHIP_IS_OMAP4430ES2) 446 CHIP_IS_OMAP4430ES2 | \
447 CHIP_IS_OMAP4430ES2_1 | \
448 CHIP_IS_OMAP4430ES2_2)
427 449
428/* 450/*
429 * "GE" here represents "greater than or equal to" in terms of ES 451 * "GE" here represents "greater than or equal to" in terms of ES
@@ -455,6 +477,7 @@ extern u32 omap3_features;
455#define OMAP3_HAS_ISP BIT(4) 477#define OMAP3_HAS_ISP BIT(4)
456#define OMAP3_HAS_192MHZ_CLK BIT(5) 478#define OMAP3_HAS_192MHZ_CLK BIT(5)
457#define OMAP3_HAS_IO_WAKEUP BIT(6) 479#define OMAP3_HAS_IO_WAKEUP BIT(6)
480#define OMAP3_HAS_SDRC BIT(7)
458 481
459#define OMAP3_HAS_FEATURE(feat,flag) \ 482#define OMAP3_HAS_FEATURE(feat,flag) \
460static inline unsigned int omap3_has_ ##feat(void) \ 483static inline unsigned int omap3_has_ ##feat(void) \
@@ -469,5 +492,6 @@ OMAP3_HAS_FEATURE(neon, NEON)
469OMAP3_HAS_FEATURE(isp, ISP) 492OMAP3_HAS_FEATURE(isp, ISP)
470OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK) 493OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
471OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP) 494OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
495OMAP3_HAS_FEATURE(sdrc, SDRC)
472 496
473#endif 497#endif
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 537f4e449f50..0f140ecedb01 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -23,6 +23,7 @@
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/kobject.h> 24#include <linux/kobject.h>
25#include <linux/device.h> 25#include <linux/device.h>
26#include <linux/platform_device.h>
26#include <asm/atomic.h> 27#include <asm/atomic.h>
27 28
28#define DISPC_IRQ_FRAMEDONE (1 << 0) 29#define DISPC_IRQ_FRAMEDONE (1 << 0)
@@ -226,6 +227,16 @@ struct omap_dss_board_info {
226 struct omap_dss_device *default_device; 227 struct omap_dss_device *default_device;
227}; 228};
228 229
230#if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS)
231/* Init with the board info */
232extern int omap_display_init(struct omap_dss_board_info *board_data);
233#else
234static inline int omap_display_init(struct omap_dss_board_info *board_data)
235{
236 return 0;
237}
238#endif
239
229struct omap_video_timings { 240struct omap_video_timings {
230 /* Unit: pixels */ 241 /* Unit: pixels */
231 u16 x_res; 242 u16 x_res;
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index dfa3aff9761b..d6c70d2f4030 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -3,6 +3,12 @@
3 * 3 *
4 * OMAP Dual-Mode Timers 4 * OMAP Dual-Mode Timers
5 * 5 *
6 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
7 * Tarun Kanti DebBarma <tarun.kanti@ti.com>
8 * Thara Gopinath <thara@ti.com>
9 *
10 * Platform device conversion and hwmod support.
11 *
6 * Copyright (C) 2005 Nokia Corporation 12 * Copyright (C) 2005 Nokia Corporation
7 * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com> 13 * Author: Lauri Leukkunen <lauri.leukkunen@nokia.com>
8 * PWM and clock framwork support by Timo Teras. 14 * PWM and clock framwork support by Timo Teras.
@@ -44,6 +50,11 @@
44#define OMAP_TIMER_TRIGGER_OVERFLOW 0x01 50#define OMAP_TIMER_TRIGGER_OVERFLOW 0x01
45#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02 51#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02
46 52
53/*
54 * IP revision identifier so that Highlander IP
55 * in OMAP4 can be distinguished.
56 */
57#define OMAP_TIMER_IP_VERSION_1 0x1
47struct omap_dm_timer; 58struct omap_dm_timer;
48extern struct omap_dm_timer *gptimer_wakeup; 59extern struct omap_dm_timer *gptimer_wakeup;
49extern struct sys_timer omap_timer; 60extern struct sys_timer omap_timer;
diff --git a/arch/arm/plat-omap/include/plat/fpga.h b/arch/arm/plat-omap/include/plat/fpga.h
index ae39bcb3f5ba..bd3c6324ae1f 100644
--- a/arch/arm/plat-omap/include/plat/fpga.h
+++ b/arch/arm/plat-omap/include/plat/fpga.h
@@ -30,18 +30,18 @@ extern void omap1510_fpga_init_irq(void);
30 * --------------------------------------------------------------------------- 30 * ---------------------------------------------------------------------------
31 */ 31 */
32/* maps in the FPGA registers and the ETHR registers */ 32/* maps in the FPGA registers and the ETHR registers */
33#define H2P2_DBG_FPGA_BASE IOMEM(0xE8000000) /* VA */ 33#define H2P2_DBG_FPGA_BASE 0xE8000000 /* VA */
34#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */ 34#define H2P2_DBG_FPGA_SIZE SZ_4K /* SIZE */
35#define H2P2_DBG_FPGA_START 0x04000000 /* PA */ 35#define H2P2_DBG_FPGA_START 0x04000000 /* PA */
36 36
37#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300) 37#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
38#define H2P2_DBG_FPGA_FPGA_REV (H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */ 38#define H2P2_DBG_FPGA_FPGA_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x10) /* FPGA Revision */
39#define H2P2_DBG_FPGA_BOARD_REV (H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */ 39#define H2P2_DBG_FPGA_BOARD_REV IOMEM(H2P2_DBG_FPGA_BASE + 0x12) /* Board Revision */
40#define H2P2_DBG_FPGA_GPIO (H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */ 40#define H2P2_DBG_FPGA_GPIO IOMEM(H2P2_DBG_FPGA_BASE + 0x14) /* GPIO outputs */
41#define H2P2_DBG_FPGA_LEDS (H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */ 41#define H2P2_DBG_FPGA_LEDS IOMEM(H2P2_DBG_FPGA_BASE + 0x16) /* LEDs outputs */
42#define H2P2_DBG_FPGA_MISC_INPUTS (H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */ 42#define H2P2_DBG_FPGA_MISC_INPUTS IOMEM(H2P2_DBG_FPGA_BASE + 0x18) /* Misc inputs */
43#define H2P2_DBG_FPGA_LAN_STATUS (H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */ 43#define H2P2_DBG_FPGA_LAN_STATUS IOMEM(H2P2_DBG_FPGA_BASE + 0x1A) /* LAN Status line */
44#define H2P2_DBG_FPGA_LAN_RESET (H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */ 44#define H2P2_DBG_FPGA_LAN_RESET IOMEM(H2P2_DBG_FPGA_BASE + 0x1C) /* LAN Reset line */
45 45
46/* NOTE: most boards don't have a static mapping for the FPGA ... */ 46/* NOTE: most boards don't have a static mapping for the FPGA ... */
47struct h2p2_dbg_fpga { 47struct h2p2_dbg_fpga {
@@ -81,55 +81,55 @@ struct h2p2_dbg_fpga {
81 * OMAP-1510 FPGA 81 * OMAP-1510 FPGA
82 * --------------------------------------------------------------------------- 82 * ---------------------------------------------------------------------------
83 */ 83 */
84#define OMAP1510_FPGA_BASE IOMEM(0xE8000000) /* VA */ 84#define OMAP1510_FPGA_BASE 0xE8000000 /* VA */
85#define OMAP1510_FPGA_SIZE SZ_4K 85#define OMAP1510_FPGA_SIZE SZ_4K
86#define OMAP1510_FPGA_START 0x08000000 /* PA */ 86#define OMAP1510_FPGA_START 0x08000000 /* PA */
87 87
88/* Revision */ 88/* Revision */
89#define OMAP1510_FPGA_REV_LOW (OMAP1510_FPGA_BASE + 0x0) 89#define OMAP1510_FPGA_REV_LOW IOMEM(OMAP1510_FPGA_BASE + 0x0)
90#define OMAP1510_FPGA_REV_HIGH (OMAP1510_FPGA_BASE + 0x1) 90#define OMAP1510_FPGA_REV_HIGH IOMEM(OMAP1510_FPGA_BASE + 0x1)
91 91
92#define OMAP1510_FPGA_LCD_PANEL_CONTROL (OMAP1510_FPGA_BASE + 0x2) 92#define OMAP1510_FPGA_LCD_PANEL_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x2)
93#define OMAP1510_FPGA_LED_DIGIT (OMAP1510_FPGA_BASE + 0x3) 93#define OMAP1510_FPGA_LED_DIGIT IOMEM(OMAP1510_FPGA_BASE + 0x3)
94#define INNOVATOR_FPGA_HID_SPI (OMAP1510_FPGA_BASE + 0x4) 94#define INNOVATOR_FPGA_HID_SPI IOMEM(OMAP1510_FPGA_BASE + 0x4)
95#define OMAP1510_FPGA_POWER (OMAP1510_FPGA_BASE + 0x5) 95#define OMAP1510_FPGA_POWER IOMEM(OMAP1510_FPGA_BASE + 0x5)
96 96
97/* Interrupt status */ 97/* Interrupt status */
98#define OMAP1510_FPGA_ISR_LO (OMAP1510_FPGA_BASE + 0x6) 98#define OMAP1510_FPGA_ISR_LO IOMEM(OMAP1510_FPGA_BASE + 0x6)
99#define OMAP1510_FPGA_ISR_HI (OMAP1510_FPGA_BASE + 0x7) 99#define OMAP1510_FPGA_ISR_HI IOMEM(OMAP1510_FPGA_BASE + 0x7)
100 100
101/* Interrupt mask */ 101/* Interrupt mask */
102#define OMAP1510_FPGA_IMR_LO (OMAP1510_FPGA_BASE + 0x8) 102#define OMAP1510_FPGA_IMR_LO IOMEM(OMAP1510_FPGA_BASE + 0x8)
103#define OMAP1510_FPGA_IMR_HI (OMAP1510_FPGA_BASE + 0x9) 103#define OMAP1510_FPGA_IMR_HI IOMEM(OMAP1510_FPGA_BASE + 0x9)
104 104
105/* Reset registers */ 105/* Reset registers */
106#define OMAP1510_FPGA_HOST_RESET (OMAP1510_FPGA_BASE + 0xa) 106#define OMAP1510_FPGA_HOST_RESET IOMEM(OMAP1510_FPGA_BASE + 0xa)
107#define OMAP1510_FPGA_RST (OMAP1510_FPGA_BASE + 0xb) 107#define OMAP1510_FPGA_RST IOMEM(OMAP1510_FPGA_BASE + 0xb)
108 108
109#define OMAP1510_FPGA_AUDIO (OMAP1510_FPGA_BASE + 0xc) 109#define OMAP1510_FPGA_AUDIO IOMEM(OMAP1510_FPGA_BASE + 0xc)
110#define OMAP1510_FPGA_DIP (OMAP1510_FPGA_BASE + 0xe) 110#define OMAP1510_FPGA_DIP IOMEM(OMAP1510_FPGA_BASE + 0xe)
111#define OMAP1510_FPGA_FPGA_IO (OMAP1510_FPGA_BASE + 0xf) 111#define OMAP1510_FPGA_FPGA_IO IOMEM(OMAP1510_FPGA_BASE + 0xf)
112#define OMAP1510_FPGA_UART1 (OMAP1510_FPGA_BASE + 0x14) 112#define OMAP1510_FPGA_UART1 IOMEM(OMAP1510_FPGA_BASE + 0x14)
113#define OMAP1510_FPGA_UART2 (OMAP1510_FPGA_BASE + 0x15) 113#define OMAP1510_FPGA_UART2 IOMEM(OMAP1510_FPGA_BASE + 0x15)
114#define OMAP1510_FPGA_OMAP1510_STATUS (OMAP1510_FPGA_BASE + 0x16) 114#define OMAP1510_FPGA_OMAP1510_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x16)
115#define OMAP1510_FPGA_BOARD_REV (OMAP1510_FPGA_BASE + 0x18) 115#define OMAP1510_FPGA_BOARD_REV IOMEM(OMAP1510_FPGA_BASE + 0x18)
116#define OMAP1510P1_PPT_DATA (OMAP1510_FPGA_BASE + 0x100) 116#define OMAP1510P1_PPT_DATA IOMEM(OMAP1510_FPGA_BASE + 0x100)
117#define OMAP1510P1_PPT_STATUS (OMAP1510_FPGA_BASE + 0x101) 117#define OMAP1510P1_PPT_STATUS IOMEM(OMAP1510_FPGA_BASE + 0x101)
118#define OMAP1510P1_PPT_CONTROL (OMAP1510_FPGA_BASE + 0x102) 118#define OMAP1510P1_PPT_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x102)
119 119
120#define OMAP1510_FPGA_TOUCHSCREEN (OMAP1510_FPGA_BASE + 0x204) 120#define OMAP1510_FPGA_TOUCHSCREEN IOMEM(OMAP1510_FPGA_BASE + 0x204)
121 121
122#define INNOVATOR_FPGA_INFO (OMAP1510_FPGA_BASE + 0x205) 122#define INNOVATOR_FPGA_INFO IOMEM(OMAP1510_FPGA_BASE + 0x205)
123#define INNOVATOR_FPGA_LCD_BRIGHT_LO (OMAP1510_FPGA_BASE + 0x206) 123#define INNOVATOR_FPGA_LCD_BRIGHT_LO IOMEM(OMAP1510_FPGA_BASE + 0x206)
124#define INNOVATOR_FPGA_LCD_BRIGHT_HI (OMAP1510_FPGA_BASE + 0x207) 124#define INNOVATOR_FPGA_LCD_BRIGHT_HI IOMEM(OMAP1510_FPGA_BASE + 0x207)
125#define INNOVATOR_FPGA_LED_GRN_LO (OMAP1510_FPGA_BASE + 0x208) 125#define INNOVATOR_FPGA_LED_GRN_LO IOMEM(OMAP1510_FPGA_BASE + 0x208)
126#define INNOVATOR_FPGA_LED_GRN_HI (OMAP1510_FPGA_BASE + 0x209) 126#define INNOVATOR_FPGA_LED_GRN_HI IOMEM(OMAP1510_FPGA_BASE + 0x209)
127#define INNOVATOR_FPGA_LED_RED_LO (OMAP1510_FPGA_BASE + 0x20a) 127#define INNOVATOR_FPGA_LED_RED_LO IOMEM(OMAP1510_FPGA_BASE + 0x20a)
128#define INNOVATOR_FPGA_LED_RED_HI (OMAP1510_FPGA_BASE + 0x20b) 128#define INNOVATOR_FPGA_LED_RED_HI IOMEM(OMAP1510_FPGA_BASE + 0x20b)
129#define INNOVATOR_FPGA_CAM_USB_CONTROL (OMAP1510_FPGA_BASE + 0x20c) 129#define INNOVATOR_FPGA_CAM_USB_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20c)
130#define INNOVATOR_FPGA_EXP_CONTROL (OMAP1510_FPGA_BASE + 0x20d) 130#define INNOVATOR_FPGA_EXP_CONTROL IOMEM(OMAP1510_FPGA_BASE + 0x20d)
131#define INNOVATOR_FPGA_ISR2 (OMAP1510_FPGA_BASE + 0x20e) 131#define INNOVATOR_FPGA_ISR2 IOMEM(OMAP1510_FPGA_BASE + 0x20e)
132#define INNOVATOR_FPGA_IMR2 (OMAP1510_FPGA_BASE + 0x210) 132#define INNOVATOR_FPGA_IMR2 IOMEM(OMAP1510_FPGA_BASE + 0x210)
133 133
134#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300) 134#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
135 135
diff --git a/arch/arm/plat-omap/include/plat/gpmc.h b/arch/arm/plat-omap/include/plat/gpmc.h
index 85ded598853e..12b316165037 100644
--- a/arch/arm/plat-omap/include/plat/gpmc.h
+++ b/arch/arm/plat-omap/include/plat/gpmc.h
@@ -41,6 +41,8 @@
41#define GPMC_NAND_ADDRESS 0x0000000b 41#define GPMC_NAND_ADDRESS 0x0000000b
42#define GPMC_NAND_DATA 0x0000000c 42#define GPMC_NAND_DATA 0x0000000c
43 43
44#define GPMC_ENABLE_IRQ 0x0000000d
45
44/* ECC commands */ 46/* ECC commands */
45#define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */ 47#define GPMC_ECC_READ 0 /* Reset Hardware ECC for read */
46#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */ 48#define GPMC_ECC_WRITE 1 /* Reset Hardware ECC for write */
@@ -78,6 +80,19 @@
78#define WR_RD_PIN_MONITORING 0x00600000 80#define WR_RD_PIN_MONITORING 0x00600000
79#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F) 81#define GPMC_PREFETCH_STATUS_FIFO_CNT(val) ((val >> 24) & 0x7F)
80#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff) 82#define GPMC_PREFETCH_STATUS_COUNT(val) (val & 0x00003fff)
83#define GPMC_IRQ_FIFOEVENTENABLE 0x01
84#define GPMC_IRQ_COUNT_EVENT 0x02
85
86#define PREFETCH_FIFOTHRESHOLD_MAX 0x40
87#define PREFETCH_FIFOTHRESHOLD(val) ((val) << 8)
88
89enum omap_ecc {
90 /* 1-bit ecc: stored at end of spare area */
91 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
92 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
93 /* 1-bit ecc: stored at begining of spare area as romcode */
94 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
95};
81 96
82/* 97/*
83 * Note that all values in this struct are in nanoseconds except sync_clk 98 * Note that all values in this struct are in nanoseconds except sync_clk
@@ -130,12 +145,11 @@ extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
130extern void gpmc_cs_free(int cs); 145extern void gpmc_cs_free(int cs);
131extern int gpmc_cs_set_reserved(int cs, int reserved); 146extern int gpmc_cs_set_reserved(int cs, int reserved);
132extern int gpmc_cs_reserved(int cs); 147extern int gpmc_cs_reserved(int cs);
133extern int gpmc_prefetch_enable(int cs, int dma_mode, 148extern int gpmc_prefetch_enable(int cs, int fifo_th, int dma_mode,
134 unsigned int u32_count, int is_write); 149 unsigned int u32_count, int is_write);
135extern int gpmc_prefetch_reset(int cs); 150extern int gpmc_prefetch_reset(int cs);
136extern void omap3_gpmc_save_context(void); 151extern void omap3_gpmc_save_context(void);
137extern void omap3_gpmc_restore_context(void); 152extern void omap3_gpmc_restore_context(void);
138extern void gpmc_init(void);
139extern int gpmc_read_status(int cmd); 153extern int gpmc_read_status(int cmd);
140extern int gpmc_cs_configure(int cs, int cmd, int wval); 154extern int gpmc_cs_configure(int cs, int cmd, int wval);
141extern int gpmc_nand_read(int cs, int cmd); 155extern int gpmc_nand_read(int cs, int cmd);
diff --git a/arch/arm/plat-omap/include/plat/hardware.h b/arch/arm/plat-omap/include/plat/hardware.h
index d5b26adfb890..e87efe1499b8 100644
--- a/arch/arm/plat-omap/include/plat/hardware.h
+++ b/arch/arm/plat-omap/include/plat/hardware.h
@@ -286,5 +286,6 @@
286#include <plat/omap24xx.h> 286#include <plat/omap24xx.h>
287#include <plat/omap34xx.h> 287#include <plat/omap34xx.h>
288#include <plat/omap44xx.h> 288#include <plat/omap44xx.h>
289#include <plat/ti816x.h>
289 290
290#endif /* __ASM_ARCH_OMAP_HARDWARE_H */ 291#endif /* __ASM_ARCH_OMAP_HARDWARE_H */
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index ef4106c13183..d72ec85c97e6 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -259,7 +259,7 @@ struct omap_sdrc_params;
259extern void omap1_map_common_io(void); 259extern void omap1_map_common_io(void);
260extern void omap1_init_common_hw(void); 260extern void omap1_init_common_hw(void);
261 261
262#ifdef CONFIG_ARCH_OMAP2420 262#ifdef CONFIG_SOC_OMAP2420
263extern void omap242x_map_common_io(void); 263extern void omap242x_map_common_io(void);
264#else 264#else
265static inline void omap242x_map_common_io(void) 265static inline void omap242x_map_common_io(void)
@@ -267,7 +267,7 @@ static inline void omap242x_map_common_io(void)
267} 267}
268#endif 268#endif
269 269
270#ifdef CONFIG_ARCH_OMAP2430 270#ifdef CONFIG_SOC_OMAP2430
271extern void omap243x_map_common_io(void); 271extern void omap243x_map_common_io(void);
272#else 272#else
273static inline void omap243x_map_common_io(void) 273static inline void omap243x_map_common_io(void)
@@ -283,6 +283,14 @@ static inline void omap34xx_map_common_io(void)
283} 283}
284#endif 284#endif
285 285
286#ifdef CONFIG_SOC_OMAPTI816X
287extern void omapti816x_map_common_io(void);
288#else
289static inline void omapti816x_map_common_io(void)
290{
291}
292#endif
293
286#ifdef CONFIG_ARCH_OMAP4 294#ifdef CONFIG_ARCH_OMAP4
287extern void omap44xx_map_common_io(void); 295extern void omap44xx_map_common_io(void);
288#else 296#else
diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
index 69230d685538..174f1b9c8c03 100644
--- a/arch/arm/plat-omap/include/plat/iommu.h
+++ b/arch/arm/plat-omap/include/plat/iommu.h
@@ -31,6 +31,7 @@ struct iommu {
31 struct clk *clk; 31 struct clk *clk;
32 void __iomem *regbase; 32 void __iomem *regbase;
33 struct device *dev; 33 struct device *dev;
34 void *isr_priv;
34 35
35 unsigned int refcount; 36 unsigned int refcount;
36 struct mutex iommu_lock; /* global for this whole object */ 37 struct mutex iommu_lock; /* global for this whole object */
@@ -47,7 +48,7 @@ struct iommu {
47 struct list_head mmap; 48 struct list_head mmap;
48 struct mutex mmap_lock; /* protect mmap */ 49 struct mutex mmap_lock; /* protect mmap */
49 50
50 int (*isr)(struct iommu *obj); 51 int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs, void *priv);
51 52
52 void *ctx; /* iommu context: registres saved area */ 53 void *ctx; /* iommu context: registres saved area */
53 u32 da_start; 54 u32 da_start;
@@ -109,6 +110,13 @@ struct iommu_platform_data {
109 u32 da_end; 110 u32 da_end;
110}; 111};
111 112
113/* IOMMU errors */
114#define OMAP_IOMMU_ERR_TLB_MISS (1 << 0)
115#define OMAP_IOMMU_ERR_TRANS_FAULT (1 << 1)
116#define OMAP_IOMMU_ERR_EMU_MISS (1 << 2)
117#define OMAP_IOMMU_ERR_TBLWALK_FAULT (1 << 3)
118#define OMAP_IOMMU_ERR_MULTIHIT_FAULT (1 << 4)
119
112#if defined(CONFIG_ARCH_OMAP1) 120#if defined(CONFIG_ARCH_OMAP1)
113#error "iommu for this processor not implemented yet" 121#error "iommu for this processor not implemented yet"
114#else 122#else
@@ -154,11 +162,17 @@ extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end);
154extern void flush_iotlb_all(struct iommu *obj); 162extern void flush_iotlb_all(struct iommu *obj);
155 163
156extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e); 164extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e);
165extern void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd,
166 u32 **ppte);
157extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova); 167extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova);
158 168
159extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end); 169extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end);
160extern struct iommu *iommu_get(const char *name); 170extern struct iommu *iommu_get(const char *name);
161extern void iommu_put(struct iommu *obj); 171extern void iommu_put(struct iommu *obj);
172extern int iommu_set_isr(const char *name,
173 int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs,
174 void *priv),
175 void *isr_priv);
162 176
163extern void iommu_save_ctx(struct iommu *obj); 177extern void iommu_save_ctx(struct iommu *obj);
164extern void iommu_restore_ctx(struct iommu *obj); 178extern void iommu_restore_ctx(struct iommu *obj);
diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h
index 2910de921c52..d77928370463 100644
--- a/arch/arm/plat-omap/include/plat/irqs.h
+++ b/arch/arm/plat-omap/include/plat/irqs.h
@@ -315,9 +315,12 @@
315#define INT_34XX_SSM_ABORT_IRQ 6 315#define INT_34XX_SSM_ABORT_IRQ 6
316#define INT_34XX_SYS_NIRQ 7 316#define INT_34XX_SYS_NIRQ 7
317#define INT_34XX_D2D_FW_IRQ 8 317#define INT_34XX_D2D_FW_IRQ 8
318#define INT_34XX_L3_DBG_IRQ 9
319#define INT_34XX_L3_APP_IRQ 10
318#define INT_34XX_PRCM_MPU_IRQ 11 320#define INT_34XX_PRCM_MPU_IRQ 11
319#define INT_34XX_MCBSP1_IRQ 16 321#define INT_34XX_MCBSP1_IRQ 16
320#define INT_34XX_MCBSP2_IRQ 17 322#define INT_34XX_MCBSP2_IRQ 17
323#define INT_34XX_GPMC_IRQ 20
321#define INT_34XX_MCBSP3_IRQ 22 324#define INT_34XX_MCBSP3_IRQ 22
322#define INT_34XX_MCBSP4_IRQ 23 325#define INT_34XX_MCBSP4_IRQ 23
323#define INT_34XX_CAM_IRQ 24 326#define INT_34XX_CAM_IRQ 24
@@ -411,7 +414,13 @@
411#define TWL_IRQ_END TWL6030_IRQ_END 414#define TWL_IRQ_END TWL6030_IRQ_END
412#endif 415#endif
413 416
414#define NR_IRQS TWL_IRQ_END 417/* GPMC related */
418#define OMAP_GPMC_IRQ_BASE (TWL_IRQ_END)
419#define OMAP_GPMC_NR_IRQS 7
420#define OMAP_GPMC_IRQ_END (OMAP_GPMC_IRQ_BASE + OMAP_GPMC_NR_IRQS)
421
422
423#define NR_IRQS OMAP_GPMC_IRQ_END
415 424
416#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) 425#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
417 426
diff --git a/arch/arm/plat-omap/include/plat/l3_2xxx.h b/arch/arm/plat-omap/include/plat/l3_2xxx.h
new file mode 100644
index 000000000000..b8b5641379b0
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l3_2xxx.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-omap/include/plat/l3_2xxx.h - L3 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
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 as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_2XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_2XXX_H
15
16/* L3 CONNIDs */
17/* Display Sub system (DSS) */
18#define OMAP2_L3_CORE_FW_CONNID_DSS 8
19
20#endif
diff --git a/arch/arm/plat-omap/include/plat/l3_3xxx.h b/arch/arm/plat-omap/include/plat/l3_3xxx.h
new file mode 100644
index 000000000000..cde1938c5f82
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l3_3xxx.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/plat-omap/include/plat/l3_3xxx.h - L3 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
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 as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_3XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L3_3XXX_H
15
16/* L3 Initiator IDs */
17/* Display Sub system (DSS) */
18#define OMAP3_L3_CORE_FW_INIT_ID_DSS 29
19
20#endif
diff --git a/arch/arm/plat-omap/include/plat/l4_2xxx.h b/arch/arm/plat-omap/include/plat/l4_2xxx.h
new file mode 100644
index 000000000000..3f39cf8a35c6
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/l4_2xxx.h
@@ -0,0 +1,24 @@
1/*
2 * arch/arm/plat-omap/include/plat/l4_2xxx.h - L4 firewall definitions
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 * Sumit Semwal
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 as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 */
13#ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L4_2XXX_H
14#define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_L4_2XXX_H
15
16/* L4 CORE */
17/* Display Sub system (DSS) */
18#define OMAP2420_L4_CORE_FW_DSS_CORE_REGION 28
19#define OMAP2420_L4_CORE_FW_DSS_DISPC_REGION 29
20#define OMAP2420_L4_CORE_FW_DSS_RFBI_REGION 30
21#define OMAP2420_L4_CORE_FW_DSS_VENC_REGION 31
22#define OMAP2420_L4_CORE_FW_DSS_TA_REGION 32
23
24#endif
diff --git a/arch/arm/plat-omap/include/plat/l4_3xxx.h b/arch/arm/plat-omap/include/plat/l4_3xxx.h
index 5e1949375422..881a858b1ffc 100644
--- a/arch/arm/plat-omap/include/plat/l4_3xxx.h
+++ b/arch/arm/plat-omap/include/plat/l4_3xxx.h
@@ -21,4 +21,14 @@
21#define OMAP3_L4_CORE_FW_I2C3_REGION 73 21#define OMAP3_L4_CORE_FW_I2C3_REGION 73
22#define OMAP3_L4_CORE_FW_I2C3_TA_REGION 74 22#define OMAP3_L4_CORE_FW_I2C3_TA_REGION 74
23 23
24/* Display Sub system (DSS) */
25#define OMAP3_L4_CORE_FW_DSS_PROT_GROUP 2
26
27#define OMAP3_L4_CORE_FW_DSS_DSI_REGION 104
28#define OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION 3
29#define OMAP3_L4_CORE_FW_DSS_CORE_REGION 4
30#define OMAP3_L4_CORE_FW_DSS_DISPC_REGION 4
31#define OMAP3_L4_CORE_FW_DSS_RFBI_REGION 5
32#define OMAP3_L4_CORE_FW_DSS_VENC_REGION 6
33#define OMAP3_L4_CORE_FW_DSS_TA_REGION 7
24#endif 34#endif
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index b87d83ccd545..f8f690ab2997 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -37,6 +37,10 @@ static struct platform_device omap_mcbsp##port_nr = { \
37 .id = OMAP_MCBSP##port_nr, \ 37 .id = OMAP_MCBSP##port_nr, \
38} 38}
39 39
40#define MCBSP_CONFIG_TYPE2 0x2
41#define MCBSP_CONFIG_TYPE3 0x3
42#define MCBSP_CONFIG_TYPE4 0x4
43
40#define OMAP7XX_MCBSP1_BASE 0xfffb1000 44#define OMAP7XX_MCBSP1_BASE 0xfffb1000
41#define OMAP7XX_MCBSP2_BASE 0xfffb1800 45#define OMAP7XX_MCBSP2_BASE 0xfffb1800
42 46
@@ -48,32 +52,14 @@ static struct platform_device omap_mcbsp##port_nr = { \
48#define OMAP1610_MCBSP2_BASE 0xfffb1000 52#define OMAP1610_MCBSP2_BASE 0xfffb1000
49#define OMAP1610_MCBSP3_BASE 0xe1017000 53#define OMAP1610_MCBSP3_BASE 0xe1017000
50 54
51#define OMAP24XX_MCBSP1_BASE 0x48074000 55#ifdef CONFIG_ARCH_OMAP1
52#define OMAP24XX_MCBSP2_BASE 0x48076000
53#define OMAP2430_MCBSP3_BASE 0x4808c000
54#define OMAP2430_MCBSP4_BASE 0x4808e000
55#define OMAP2430_MCBSP5_BASE 0x48096000
56
57#define OMAP34XX_MCBSP1_BASE 0x48074000
58#define OMAP34XX_MCBSP2_BASE 0x49022000
59#define OMAP34XX_MCBSP2_ST_BASE 0x49028000
60#define OMAP34XX_MCBSP3_BASE 0x49024000
61#define OMAP34XX_MCBSP3_ST_BASE 0x4902A000
62#define OMAP34XX_MCBSP3_BASE 0x49024000
63#define OMAP34XX_MCBSP4_BASE 0x49026000
64#define OMAP34XX_MCBSP5_BASE 0x48096000
65
66#define OMAP44XX_MCBSP1_BASE 0x49022000
67#define OMAP44XX_MCBSP2_BASE 0x49024000
68#define OMAP44XX_MCBSP3_BASE 0x49026000
69#define OMAP44XX_MCBSP4_BASE 0x48096000
70
71#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
72 56
73#define OMAP_MCBSP_REG_DRR2 0x00 57#define OMAP_MCBSP_REG_DRR2 0x00
74#define OMAP_MCBSP_REG_DRR1 0x02 58#define OMAP_MCBSP_REG_DRR1 0x02
75#define OMAP_MCBSP_REG_DXR2 0x04 59#define OMAP_MCBSP_REG_DXR2 0x04
76#define OMAP_MCBSP_REG_DXR1 0x06 60#define OMAP_MCBSP_REG_DXR1 0x06
61#define OMAP_MCBSP_REG_DRR 0x02
62#define OMAP_MCBSP_REG_DXR 0x06
77#define OMAP_MCBSP_REG_SPCR2 0x08 63#define OMAP_MCBSP_REG_SPCR2 0x08
78#define OMAP_MCBSP_REG_SPCR1 0x0a 64#define OMAP_MCBSP_REG_SPCR1 0x0a
79#define OMAP_MCBSP_REG_RCR2 0x0c 65#define OMAP_MCBSP_REG_RCR2 0x0c
@@ -106,13 +92,6 @@ static struct platform_device omap_mcbsp##port_nr = { \
106#define OMAP_MCBSP_REG_XCCR 0x00 92#define OMAP_MCBSP_REG_XCCR 0x00
107#define OMAP_MCBSP_REG_RCCR 0x00 93#define OMAP_MCBSP_REG_RCCR 0x00
108 94
109#define AUDIO_MCBSP_DATAWRITE (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1)
110#define AUDIO_MCBSP_DATAREAD (OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1)
111
112#define AUDIO_MCBSP OMAP_MCBSP1
113#define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX
114#define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX
115
116#else 95#else
117 96
118#define OMAP_MCBSP_REG_DRR2 0x00 97#define OMAP_MCBSP_REG_DRR2 0x00
@@ -168,13 +147,6 @@ static struct platform_device omap_mcbsp##port_nr = { \
168#define OMAP_ST_REG_SFIRCR 0x28 147#define OMAP_ST_REG_SFIRCR 0x28
169#define OMAP_ST_REG_SSELCR 0x2C 148#define OMAP_ST_REG_SSELCR 0x2C
170 149
171#define AUDIO_MCBSP_DATAWRITE (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1)
172#define AUDIO_MCBSP_DATAREAD (OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1)
173
174#define AUDIO_MCBSP OMAP_MCBSP2
175#define AUDIO_DMA_TX OMAP24XX_DMA_MCBSP2_TX
176#define AUDIO_DMA_RX OMAP24XX_DMA_MCBSP2_RX
177
178#endif 150#endif
179 151
180/************************** McBSP SPCR1 bit definitions ***********************/ 152/************************** McBSP SPCR1 bit definitions ***********************/
@@ -428,8 +400,9 @@ struct omap_mcbsp_platform_data {
428#ifdef CONFIG_ARCH_OMAP3 400#ifdef CONFIG_ARCH_OMAP3
429 /* Sidetone block for McBSP 2 and 3 */ 401 /* Sidetone block for McBSP 2 and 3 */
430 unsigned long phys_base_st; 402 unsigned long phys_base_st;
431 u16 buffer_size;
432#endif 403#endif
404 u16 buffer_size;
405 unsigned int mcbsp_config_type;
433}; 406};
434 407
435struct omap_mcbsp_st_data { 408struct omap_mcbsp_st_data {
@@ -445,6 +418,7 @@ struct omap_mcbsp_st_data {
445struct omap_mcbsp { 418struct omap_mcbsp {
446 struct device *dev; 419 struct device *dev;
447 unsigned long phys_base; 420 unsigned long phys_base;
421 unsigned long phys_dma_base;
448 void __iomem *io_base; 422 void __iomem *io_base;
449 u8 id; 423 u8 id;
450 u8 free; 424 u8 free;
@@ -471,7 +445,6 @@ struct omap_mcbsp {
471 /* Protect the field .free, while checking if the mcbsp is in use */ 445 /* Protect the field .free, while checking if the mcbsp is in use */
472 spinlock_t lock; 446 spinlock_t lock;
473 struct omap_mcbsp_platform_data *pdata; 447 struct omap_mcbsp_platform_data *pdata;
474 struct clk *iclk;
475 struct clk *fclk; 448 struct clk *fclk;
476#ifdef CONFIG_ARCH_OMAP3 449#ifdef CONFIG_ARCH_OMAP3
477 struct omap_mcbsp_st_data *st_data; 450 struct omap_mcbsp_st_data *st_data;
@@ -480,7 +453,17 @@ struct omap_mcbsp {
480 u16 max_rx_thres; 453 u16 max_rx_thres;
481#endif 454#endif
482 void *reg_cache; 455 void *reg_cache;
456 unsigned int mcbsp_config_type;
483}; 457};
458
459/**
460 * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod
461 * @sidetone: name of the sidetone device
462 */
463struct omap_mcbsp_dev_attr {
464 const char *sidetone;
465};
466
484extern struct omap_mcbsp **mcbsp_ptr; 467extern struct omap_mcbsp **mcbsp_ptr;
485extern int omap_mcbsp_count, omap_mcbsp_cache_size; 468extern int omap_mcbsp_count, omap_mcbsp_cache_size;
486 469
@@ -488,8 +471,8 @@ extern int omap_mcbsp_count, omap_mcbsp_cache_size;
488#define id_to_mcbsp_ptr(id) mcbsp_ptr[id]; 471#define id_to_mcbsp_ptr(id) mcbsp_ptr[id];
489 472
490int omap_mcbsp_init(void); 473int omap_mcbsp_init(void);
491void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, 474void omap_mcbsp_register_board_cfg(struct resource *res, int res_count,
492 int size); 475 struct omap_mcbsp_platform_data *config, int size);
493void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config); 476void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg * config);
494#ifdef CONFIG_ARCH_OMAP3 477#ifdef CONFIG_ARCH_OMAP3
495void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold); 478void omap_mcbsp_set_tx_threshold(unsigned int id, u16 threshold);
@@ -539,6 +522,9 @@ int omap_mcbsp_set_io_type(unsigned int id, omap_mcbsp_io_type_t io_type);
539void omap2_mcbsp1_mux_clkr_src(u8 mux); 522void omap2_mcbsp1_mux_clkr_src(u8 mux);
540void omap2_mcbsp1_mux_fsr_src(u8 mux); 523void omap2_mcbsp1_mux_fsr_src(u8 mux);
541 524
525int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream);
526int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream);
527
542#ifdef CONFIG_ARCH_OMAP3 528#ifdef CONFIG_ARCH_OMAP3
543/* Sidetone specific API */ 529/* Sidetone specific API */
544int omap_st_set_chgain(unsigned int id, int channel, s16 chgain); 530int omap_st_set_chgain(unsigned int id, int channel, s16 chgain);
diff --git a/arch/arm/plat-omap/include/plat/mcspi.h b/arch/arm/plat-omap/include/plat/mcspi.h
index 1254e4945b6f..3d51b18131cc 100644
--- a/arch/arm/plat-omap/include/plat/mcspi.h
+++ b/arch/arm/plat-omap/include/plat/mcspi.h
@@ -1,8 +1,19 @@
1#ifndef _OMAP2_MCSPI_H 1#ifndef _OMAP2_MCSPI_H
2#define _OMAP2_MCSPI_H 2#define _OMAP2_MCSPI_H
3 3
4#define OMAP2_MCSPI_REV 0
5#define OMAP3_MCSPI_REV 1
6#define OMAP4_MCSPI_REV 2
7
8#define OMAP4_MCSPI_REG_OFFSET 0x100
9
4struct omap2_mcspi_platform_config { 10struct omap2_mcspi_platform_config {
5 unsigned short num_cs; 11 unsigned short num_cs;
12 unsigned int regs_offset;
13};
14
15struct omap2_mcspi_dev_attr {
16 unsigned short num_chipselect;
6}; 17};
7 18
8struct omap2_mcspi_device_config { 19struct omap2_mcspi_device_config {
diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h
index f57f36abb07e..f38fef9f1310 100644
--- a/arch/arm/plat-omap/include/plat/mmc.h
+++ b/arch/arm/plat-omap/include/plat/mmc.h
@@ -24,25 +24,19 @@
24#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */ 24#define OMAP1_MMC2_BASE 0xfffb7c00 /* omap16xx only */
25 25
26#define OMAP24XX_NR_MMC 2 26#define OMAP24XX_NR_MMC 2
27#define OMAP34XX_NR_MMC 3
28#define OMAP44XX_NR_MMC 5
29#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE 27#define OMAP2420_MMC_SIZE OMAP1_MMC_SIZE
30#define OMAP3_HSMMC_SIZE 0x200
31#define OMAP4_HSMMC_SIZE 0x1000
32#define OMAP2_MMC1_BASE 0x4809c000 28#define OMAP2_MMC1_BASE 0x4809c000
33#define OMAP2_MMC2_BASE 0x480b4000 29
34#define OMAP3_MMC3_BASE 0x480ad000
35#define OMAP4_MMC4_BASE 0x480d1000
36#define OMAP4_MMC5_BASE 0x480d5000
37#define OMAP4_MMC_REG_OFFSET 0x100 30#define OMAP4_MMC_REG_OFFSET 0x100
38#define HSMMC5 (1 << 4)
39#define HSMMC4 (1 << 3)
40#define HSMMC3 (1 << 2)
41#define HSMMC2 (1 << 1)
42#define HSMMC1 (1 << 0)
43 31
44#define OMAP_MMC_MAX_SLOTS 2 32#define OMAP_MMC_MAX_SLOTS 2
45 33
34#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(1)
35
36struct omap_mmc_dev_attr {
37 u8 flags;
38};
39
46struct omap_mmc_platform_data { 40struct omap_mmc_platform_data {
47 /* back-link to device */ 41 /* back-link to device */
48 struct device *dev; 42 struct device *dev;
@@ -71,6 +65,9 @@ struct omap_mmc_platform_data {
71 65
72 u64 dma_mask; 66 u64 dma_mask;
73 67
68 /* Integrating attributes from the omap_hwmod layer */
69 u8 controller_flags;
70
74 /* Register offset deviation */ 71 /* Register offset deviation */
75 u16 reg_offset; 72 u16 reg_offset;
76 73
@@ -159,8 +156,7 @@ extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
159 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) 156 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
160void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data, 157void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
161 int nr_controllers); 158 int nr_controllers);
162void omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, 159void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data);
163 int nr_controllers);
164int omap_mmc_add(const char *name, int id, unsigned long base, 160int omap_mmc_add(const char *name, int id, unsigned long base,
165 unsigned long size, unsigned int irq, 161 unsigned long size, unsigned int irq,
166 struct omap_mmc_platform_data *data); 162 struct omap_mmc_platform_data *data);
@@ -169,8 +165,7 @@ static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
169 int nr_controllers) 165 int nr_controllers)
170{ 166{
171} 167}
172static inline void omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, 168static inline void omap242x_init_mmc(struct omap_mmc_platform_data **mmc_data)
173 int nr_controllers)
174{ 169{
175} 170}
176static inline int omap_mmc_add(const char *name, int id, unsigned long base, 171static inline int omap_mmc_add(const char *name, int id, unsigned long base,
diff --git a/arch/arm/plat-omap/include/plat/multi.h b/arch/arm/plat-omap/include/plat/multi.h
index ffd909fa5287..999ffba2690c 100644
--- a/arch/arm/plat-omap/include/plat/multi.h
+++ b/arch/arm/plat-omap/include/plat/multi.h
@@ -66,7 +66,7 @@
66# error "OMAP1 and OMAP2PLUS can't be selected at the same time" 66# error "OMAP1 and OMAP2PLUS can't be selected at the same time"
67# endif 67# endif
68#endif 68#endif
69#ifdef CONFIG_ARCH_OMAP2420 69#ifdef CONFIG_SOC_OMAP2420
70# ifdef OMAP_NAME 70# ifdef OMAP_NAME
71# undef MULTI_OMAP2 71# undef MULTI_OMAP2
72# define MULTI_OMAP2 72# define MULTI_OMAP2
@@ -74,7 +74,7 @@
74# define OMAP_NAME omap2420 74# define OMAP_NAME omap2420
75# endif 75# endif
76#endif 76#endif
77#ifdef CONFIG_ARCH_OMAP2430 77#ifdef CONFIG_SOC_OMAP2430
78# ifdef OMAP_NAME 78# ifdef OMAP_NAME
79# undef MULTI_OMAP2 79# undef MULTI_OMAP2
80# define MULTI_OMAP2 80# define MULTI_OMAP2
diff --git a/arch/arm/plat-omap/include/plat/nand.h b/arch/arm/plat-omap/include/plat/nand.h
index 6562cd082bb1..d86d1ecf0068 100644
--- a/arch/arm/plat-omap/include/plat/nand.h
+++ b/arch/arm/plat-omap/include/plat/nand.h
@@ -8,8 +8,16 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <plat/gpmc.h>
11#include <linux/mtd/partitions.h> 12#include <linux/mtd/partitions.h>
12 13
14enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */
17 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19};
20
13struct omap_nand_platform_data { 21struct omap_nand_platform_data {
14 unsigned int options; 22 unsigned int options;
15 int cs; 23 int cs;
@@ -20,8 +28,11 @@ struct omap_nand_platform_data {
20 int (*nand_setup)(void); 28 int (*nand_setup)(void);
21 int (*dev_ready)(struct omap_nand_platform_data *); 29 int (*dev_ready)(struct omap_nand_platform_data *);
22 int dma_channel; 30 int dma_channel;
31 int gpmc_irq;
32 enum nand_io xfer_type;
23 unsigned long phys_base; 33 unsigned long phys_base;
24 int devsize; 34 int devsize;
35 enum omap_ecc ecc_opt;
25}; 36};
26 37
27/* minimum size for IO mapping */ 38/* minimum size for IO mapping */
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 1eee85a8abb3..8a1368fbbbd3 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * omap_hwmod macros, structures 2 * omap_hwmod macros, structures
3 * 3 *
4 * Copyright (C) 2009-2010 Nokia Corporation 4 * Copyright (C) 2009-2011 Nokia Corporation
5 * Paul Walmsley 5 * Paul Walmsley
6 * 6 *
7 * Created in collaboration with (alphabetical order): Benoît Cousson, 7 * Created in collaboration with (alphabetical order): Benoît Cousson,
@@ -30,6 +30,7 @@
30#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H 30#define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
31 31
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/init.h>
33#include <linux/list.h> 34#include <linux/list.h>
34#include <linux/ioport.h> 35#include <linux/ioport.h>
35#include <linux/spinlock.h> 36#include <linux/spinlock.h>
@@ -178,7 +179,8 @@ struct omap_hwmod_omap2_firewall {
178#define ADDR_TYPE_RT (1 << 1) 179#define ADDR_TYPE_RT (1 << 1)
179 180
180/** 181/**
181 * struct omap_hwmod_addr_space - MPU address space handled by the hwmod 182 * struct omap_hwmod_addr_space - address space handled by the hwmod
183 * @name: name of the address space
182 * @pa_start: starting physical address 184 * @pa_start: starting physical address
183 * @pa_end: ending physical address 185 * @pa_end: ending physical address
184 * @flags: (see omap_hwmod_addr_space.flags macros above) 186 * @flags: (see omap_hwmod_addr_space.flags macros above)
@@ -187,6 +189,7 @@ struct omap_hwmod_omap2_firewall {
187 * structure. GPMC is one example. 189 * structure. GPMC is one example.
188 */ 190 */
189struct omap_hwmod_addr_space { 191struct omap_hwmod_addr_space {
192 const char *name;
190 u32 pa_start; 193 u32 pa_start;
191 u32 pa_end; 194 u32 pa_end;
192 u8 flags; 195 u8 flags;
@@ -370,8 +373,10 @@ struct omap_hwmod_omap4_prcm {
370 * of standby, rather than relying on module smart-standby 373 * of standby, rather than relying on module smart-standby
371 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for 374 * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
372 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file 375 * SDRAM controller, etc. XXX probably belongs outside the main hwmod file
376 * XXX Should be HWMOD_SETUP_NO_RESET
373 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM 377 * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
374 * controller, etc. XXX probably belongs outside the main hwmod file 378 * controller, etc. XXX probably belongs outside the main hwmod file
379 * XXX Should be HWMOD_SETUP_NO_IDLE
375 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE) 380 * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
376 * when module is enabled, rather than the default, which is to 381 * when module is enabled, rather than the default, which is to
377 * enable autoidle 382 * enable autoidle
@@ -535,11 +540,12 @@ struct omap_hwmod {
535 const struct omap_chip_id omap_chip; 540 const struct omap_chip_id omap_chip;
536}; 541};
537 542
538int omap_hwmod_init(struct omap_hwmod **ohs); 543int omap_hwmod_register(struct omap_hwmod **ohs);
539struct omap_hwmod *omap_hwmod_lookup(const char *name); 544struct omap_hwmod *omap_hwmod_lookup(const char *name);
540int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), 545int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
541 void *data); 546 void *data);
542int omap_hwmod_late_init(void); 547
548int __init omap_hwmod_setup_one(const char *name);
543 549
544int omap_hwmod_enable(struct omap_hwmod *oh); 550int omap_hwmod_enable(struct omap_hwmod *oh);
545int _omap_hwmod_enable(struct omap_hwmod *oh); 551int _omap_hwmod_enable(struct omap_hwmod *oh);
@@ -555,6 +561,7 @@ int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
555int omap_hwmod_disable_clocks(struct omap_hwmod *oh); 561int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
556 562
557int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode); 563int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
564int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle);
558 565
559int omap_hwmod_reset(struct omap_hwmod *oh); 566int omap_hwmod_reset(struct omap_hwmod *oh);
560void omap_hwmod_ocp_barrier(struct omap_hwmod *oh); 567void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
@@ -589,6 +596,8 @@ int omap_hwmod_for_each_by_class(const char *classname,
589int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state); 596int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state);
590u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh); 597u32 omap_hwmod_get_context_loss_count(struct omap_hwmod *oh);
591 598
599int omap_hwmod_no_setup_reset(struct omap_hwmod *oh);
600
592/* 601/*
593 * Chip variant-specific hwmod init routines - XXX should be converted 602 * Chip variant-specific hwmod init routines - XXX should be converted
594 * to use initcalls once the initial boot ordering is straightened out 603 * to use initcalls once the initial boot ordering is straightened out
diff --git a/arch/arm/plat-omap/include/plat/onenand.h b/arch/arm/plat-omap/include/plat/onenand.h
index affe87e9ece7..cbe897ca7f9e 100644
--- a/arch/arm/plat-omap/include/plat/onenand.h
+++ b/arch/arm/plat-omap/include/plat/onenand.h
@@ -15,12 +15,20 @@
15#define ONENAND_SYNC_READ (1 << 0) 15#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1) 16#define ONENAND_SYNC_READWRITE (1 << 1)
17 17
18struct onenand_freq_info {
19 u16 maf_id;
20 u16 dev_id;
21 u16 ver_id;
22};
23
18struct omap_onenand_platform_data { 24struct omap_onenand_platform_data {
19 int cs; 25 int cs;
20 int gpio_irq; 26 int gpio_irq;
21 struct mtd_partition *parts; 27 struct mtd_partition *parts;
22 int nr_parts; 28 int nr_parts;
23 int (*onenand_setup)(void __iomem *, int freq); 29 int (*onenand_setup)(void __iomem *, int *freq_ptr);
30 int (*get_freq)(const struct onenand_freq_info *freq_info,
31 bool *clk_dep);
24 int dma_channel; 32 int dma_channel;
25 u8 flags; 33 u8 flags;
26 u8 regulator_can_sleep; 34 u8 regulator_can_sleep;
diff --git a/arch/arm/plat-omap/include/plat/prcm.h b/arch/arm/plat-omap/include/plat/prcm.h
index 2fdf8c80d390..267f43bb2a4e 100644
--- a/arch/arm/plat-omap/include/plat/prcm.h
+++ b/arch/arm/plat-omap/include/plat/prcm.h
@@ -28,7 +28,6 @@
28#define __ASM_ARM_ARCH_OMAP_PRCM_H 28#define __ASM_ARM_ARCH_OMAP_PRCM_H
29 29
30u32 omap_prcm_get_reset_sources(void); 30u32 omap_prcm_get_reset_sources(void);
31void omap_prcm_arch_reset(char mode, const char *cmd);
32int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, 31int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
33 const char *name); 32 const char *name);
34 33
diff --git a/arch/arm/plat-omap/include/plat/sdrc.h b/arch/arm/plat-omap/include/plat/sdrc.h
index efd87c8dda69..925b12b500dc 100644
--- a/arch/arm/plat-omap/include/plat/sdrc.h
+++ b/arch/arm/plat-omap/include/plat/sdrc.h
@@ -124,8 +124,14 @@ struct omap_sdrc_params {
124 u32 mr; 124 u32 mr;
125}; 125};
126 126
127void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0, 127#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
128void omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
128 struct omap_sdrc_params *sdrc_cs1); 129 struct omap_sdrc_params *sdrc_cs1);
130#else
131static inline void __init omap2_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
132 struct omap_sdrc_params *sdrc_cs1) {};
133#endif
134
129int omap2_sdrc_get_params(unsigned long r, 135int omap2_sdrc_get_params(unsigned long r,
130 struct omap_sdrc_params **sdrc_cs0, 136 struct omap_sdrc_params **sdrc_cs0,
131 struct omap_sdrc_params **sdrc_cs1); 137 struct omap_sdrc_params **sdrc_cs1);
diff --git a/arch/arm/plat-omap/include/plat/serial.h b/arch/arm/plat-omap/include/plat/serial.h
index cec5d56db2eb..8061695aa523 100644
--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -51,6 +51,11 @@
51#define OMAP4_UART3_BASE 0x48020000 51#define OMAP4_UART3_BASE 0x48020000
52#define OMAP4_UART4_BASE 0x4806e000 52#define OMAP4_UART4_BASE 0x4806e000
53 53
54/* TI816X serial ports */
55#define TI816X_UART1_BASE 0x48020000
56#define TI816X_UART2_BASE 0x48022000
57#define TI816X_UART3_BASE 0x48024000
58
54/* External port on Zoom2/3 */ 59/* External port on Zoom2/3 */
55#define ZOOM_UART_BASE 0x10000000 60#define ZOOM_UART_BASE 0x10000000
56#define ZOOM_UART_VIRT 0xfa400000 61#define ZOOM_UART_VIRT 0xfa400000
@@ -81,6 +86,9 @@
81#define OMAP4UART2 OMAP2UART2 86#define OMAP4UART2 OMAP2UART2
82#define OMAP4UART3 43 87#define OMAP4UART3 43
83#define OMAP4UART4 44 88#define OMAP4UART4 44
89#define TI816XUART1 81
90#define TI816XUART2 82
91#define TI816XUART3 83
84#define ZOOM_UART 95 /* Only on zoom2/3 */ 92#define ZOOM_UART 95 /* Only on zoom2/3 */
85 93
86/* This is only used by 8250.c for omap1510 */ 94/* This is only used by 8250.c for omap1510 */
@@ -96,7 +104,6 @@
96 104
97struct omap_board_data; 105struct omap_board_data;
98 106
99extern void __init omap_serial_early_init(void);
100extern void omap_serial_init(void); 107extern void omap_serial_init(void);
101extern void omap_serial_init_port(struct omap_board_data *bdata); 108extern void omap_serial_init_port(struct omap_board_data *bdata);
102extern int omap_uart_can_sleep(void); 109extern int omap_uart_can_sleep(void);
diff --git a/arch/arm/plat-omap/include/plat/system.h b/arch/arm/plat-omap/include/plat/system.h
index d0a119f735b4..c5fa9e929009 100644
--- a/arch/arm/plat-omap/include/plat/system.h
+++ b/arch/arm/plat-omap/include/plat/system.h
@@ -4,48 +4,14 @@
4 */ 4 */
5#ifndef __ASM_ARCH_SYSTEM_H 5#ifndef __ASM_ARCH_SYSTEM_H
6#define __ASM_ARCH_SYSTEM_H 6#define __ASM_ARCH_SYSTEM_H
7#include <linux/clk.h>
8 7
9#include <asm/mach-types.h> 8#include <asm/proc-fns.h>
10#include <mach/hardware.h>
11
12#include <plat/prcm.h>
13
14#ifndef CONFIG_MACH_VOICEBLUE
15#define voiceblue_reset() do {} while (0)
16#else
17extern void voiceblue_reset(void);
18#endif
19 9
20static inline void arch_idle(void) 10static inline void arch_idle(void)
21{ 11{
22 cpu_do_idle(); 12 cpu_do_idle();
23} 13}
24 14
25static inline void omap1_arch_reset(char mode, const char *cmd) 15extern void (*arch_reset)(char, const char *);
26{
27 /*
28 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
29 * "Global Software Reset Affects Traffic Controller Frequency".
30 */
31 if (cpu_is_omap5912()) {
32 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4),
33 DPLL_CTL);
34 omap_writew(0x8, ARM_RSTCT1);
35 }
36
37 if (machine_is_voiceblue())
38 voiceblue_reset();
39 else
40 omap_writew(1, ARM_RSTCT1);
41}
42
43static inline void arch_reset(char mode, const char *cmd)
44{
45 if (!cpu_class_is_omap2())
46 omap1_arch_reset(mode, cmd);
47 else
48 omap_prcm_arch_reset(mode, cmd);
49}
50 16
51#endif 17#endif
diff --git a/arch/arm/plat-omap/include/plat/ti816x.h b/arch/arm/plat-omap/include/plat/ti816x.h
new file mode 100644
index 000000000000..50510f5dda1e
--- /dev/null
+++ b/arch/arm/plat-omap/include/plat/ti816x.h
@@ -0,0 +1,27 @@
1/*
2 * This file contains the address data for various TI816X modules.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __ASM_ARCH_TI816X_H
17#define __ASM_ARCH_TI816X_H
18
19#define L4_SLOW_TI816X_BASE 0x48000000
20
21#define TI816X_SCM_BASE 0x48140000
22#define TI816X_CTRL_BASE TI816X_SCM_BASE
23#define TI816X_PRCM_BASE 0x48180000
24
25#define TI816X_ARM_INTC_BASE 0x48200000
26
27#endif /* __ASM_ARCH_TI816X_H */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index ad98b85cae21..30b891c4a93f 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -93,6 +93,10 @@ static inline void flush(void)
93#define DEBUG_LL_ZOOM(mach) \ 93#define DEBUG_LL_ZOOM(mach) \
94 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART) 94 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
95 95
96#define DEBUG_LL_TI816X(p, mach) \
97 _DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT, \
98 TI816XUART##p)
99
96static inline void __arch_decomp_setup(unsigned long arch_id) 100static inline void __arch_decomp_setup(unsigned long arch_id)
97{ 101{
98 int port = 0; 102 int port = 0;
@@ -166,6 +170,9 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
166 DEBUG_LL_ZOOM(omap_zoom2); 170 DEBUG_LL_ZOOM(omap_zoom2);
167 DEBUG_LL_ZOOM(omap_zoom3); 171 DEBUG_LL_ZOOM(omap_zoom3);
168 172
173 /* TI8168 base boards using UART3 */
174 DEBUG_LL_TI816X(3, ti8168evm);
175
169 } while (0); 176 } while (0);
170} 177}
171 178
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 450a332f1009..077192759afc 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -91,6 +91,10 @@ extern int omap4430_phy_exit(struct device *dev);
91 91
92#endif 92#endif
93 93
94extern void am35x_musb_reset(void);
95extern void am35x_musb_phy_power(u8 on);
96extern void am35x_musb_clear_irq(void);
97extern void am35x_musb_set_mode(u8 musb_mode);
94 98
95/* 99/*
96 * FIXME correct answer depends on hmc_mode, 100 * FIXME correct answer depends on hmc_mode,
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index f1295fafcd31..f1ecfa9fc61d 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -85,7 +85,10 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
85 } 85 }
86#endif 86#endif
87#ifdef CONFIG_ARCH_OMAP3 87#ifdef CONFIG_ARCH_OMAP3
88 if (cpu_is_omap34xx()) { 88 if (cpu_is_ti816x()) {
89 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
90 return XLATE(p, L4_34XX_PHYS, L4_34XX_VIRT);
91 } else if (cpu_is_omap34xx()) {
89 if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE)) 92 if (BETWEEN(p, L3_34XX_PHYS, L3_34XX_SIZE))
90 return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT); 93 return XLATE(p, L3_34XX_PHYS, L3_34XX_VIRT);
91 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE)) 94 if (BETWEEN(p, L4_34XX_PHYS, L4_34XX_SIZE))
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index b1107c08da56..e3eb0380090a 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj)
104 if (!obj) 104 if (!obj)
105 return -EINVAL; 105 return -EINVAL;
106 106
107 if (!arch_iommu)
108 return -ENODEV;
109
107 clk_enable(obj->clk); 110 clk_enable(obj->clk);
108 111
109 err = arch_iommu->enable(obj); 112 err = arch_iommu->enable(obj);
@@ -780,25 +783,19 @@ static void iopgtable_clear_entry_all(struct iommu *obj)
780 */ 783 */
781static irqreturn_t iommu_fault_handler(int irq, void *data) 784static irqreturn_t iommu_fault_handler(int irq, void *data)
782{ 785{
783 u32 stat, da; 786 u32 da, errs;
784 u32 *iopgd, *iopte; 787 u32 *iopgd, *iopte;
785 int err = -EIO;
786 struct iommu *obj = data; 788 struct iommu *obj = data;
787 789
788 if (!obj->refcount) 790 if (!obj->refcount)
789 return IRQ_NONE; 791 return IRQ_NONE;
790 792
791 /* Dynamic loading TLB or PTE */
792 if (obj->isr)
793 err = obj->isr(obj);
794
795 if (!err)
796 return IRQ_HANDLED;
797
798 clk_enable(obj->clk); 793 clk_enable(obj->clk);
799 stat = iommu_report_fault(obj, &da); 794 errs = iommu_report_fault(obj, &da);
800 clk_disable(obj->clk); 795 clk_disable(obj->clk);
801 if (!stat) 796
797 /* Fault callback or TLB/PTE Dynamic loading */
798 if (obj->isr && !obj->isr(obj, da, errs, obj->isr_priv))
802 return IRQ_HANDLED; 799 return IRQ_HANDLED;
803 800
804 iommu_disable(obj); 801 iommu_disable(obj);
@@ -806,15 +803,16 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
806 iopgd = iopgd_offset(obj, da); 803 iopgd = iopgd_offset(obj, da);
807 804
808 if (!iopgd_is_table(*iopgd)) { 805 if (!iopgd_is_table(*iopgd)) {
809 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x\n", __func__, 806 dev_err(obj->dev, "%s: errs:0x%08x da:0x%08x pgd:0x%p "
810 da, iopgd, *iopgd); 807 "*pgd:px%08x\n", obj->name, errs, da, iopgd, *iopgd);
811 return IRQ_NONE; 808 return IRQ_NONE;
812 } 809 }
813 810
814 iopte = iopte_offset(iopgd, da); 811 iopte = iopte_offset(iopgd, da);
815 812
816 dev_err(obj->dev, "%s: da:%08x pgd:%p *pgd:%08x pte:%p *pte:%08x\n", 813 dev_err(obj->dev, "%s: errs:0x%08x da:0x%08x pgd:0x%p *pgd:0x%08x "
817 __func__, da, iopgd, *iopgd, iopte, *iopte); 814 "pte:0x%p *pte:0x%08x\n", obj->name, errs, da, iopgd, *iopgd,
815 iopte, *iopte);
818 816
819 return IRQ_NONE; 817 return IRQ_NONE;
820} 818}
@@ -917,6 +915,33 @@ void iommu_put(struct iommu *obj)
917} 915}
918EXPORT_SYMBOL_GPL(iommu_put); 916EXPORT_SYMBOL_GPL(iommu_put);
919 917
918int iommu_set_isr(const char *name,
919 int (*isr)(struct iommu *obj, u32 da, u32 iommu_errs,
920 void *priv),
921 void *isr_priv)
922{
923 struct device *dev;
924 struct iommu *obj;
925
926 dev = driver_find_device(&omap_iommu_driver.driver, NULL, (void *)name,
927 device_match_by_alias);
928 if (!dev)
929 return -ENODEV;
930
931 obj = to_iommu(dev);
932 mutex_lock(&obj->iommu_lock);
933 if (obj->refcount != 0) {
934 mutex_unlock(&obj->iommu_lock);
935 return -EBUSY;
936 }
937 obj->isr = isr;
938 obj->isr_priv = isr_priv;
939 mutex_unlock(&obj->iommu_lock);
940
941 return 0;
942}
943EXPORT_SYMBOL_GPL(iommu_set_isr);
944
920/* 945/*
921 * OMAP Device MMU(IOMMU) detection 946 * OMAP Device MMU(IOMMU) detection
922 */ 947 */
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index b5a6e178a7f9..d598d9fd65ac 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -27,6 +27,8 @@
27 27
28#include <plat/dma.h> 28#include <plat/dma.h>
29#include <plat/mcbsp.h> 29#include <plat/mcbsp.h>
30#include <plat/omap_device.h>
31#include <linux/pm_runtime.h>
30 32
31/* XXX These "sideways" includes are a sign that something is wrong */ 33/* XXX These "sideways" includes are a sign that something is wrong */
32#include "../mach-omap2/cm2xxx_3xxx.h" 34#include "../mach-omap2/cm2xxx_3xxx.h"
@@ -227,10 +229,83 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config)
227} 229}
228EXPORT_SYMBOL(omap_mcbsp_config); 230EXPORT_SYMBOL(omap_mcbsp_config);
229 231
232/**
233 * omap_mcbsp_dma_params - returns the dma channel number
234 * @id - mcbsp id
235 * @stream - indicates the direction of data flow (rx or tx)
236 *
237 * Returns the dma channel number for the rx channel or tx channel
238 * based on the value of @stream for the requested mcbsp given by @id
239 */
240int omap_mcbsp_dma_ch_params(unsigned int id, unsigned int stream)
241{
242 struct omap_mcbsp *mcbsp;
243
244 if (!omap_mcbsp_check_valid_id(id)) {
245 printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
246 return -ENODEV;
247 }
248 mcbsp = id_to_mcbsp_ptr(id);
249
250 if (stream)
251 return mcbsp->dma_rx_sync;
252 else
253 return mcbsp->dma_tx_sync;
254}
255EXPORT_SYMBOL(omap_mcbsp_dma_ch_params);
256
257/**
258 * omap_mcbsp_dma_reg_params - returns the address of mcbsp data register
259 * @id - mcbsp id
260 * @stream - indicates the direction of data flow (rx or tx)
261 *
262 * Returns the address of mcbsp data transmit register or data receive register
263 * to be used by DMA for transferring/receiving data based on the value of
264 * @stream for the requested mcbsp given by @id
265 */
266int omap_mcbsp_dma_reg_params(unsigned int id, unsigned int stream)
267{
268 struct omap_mcbsp *mcbsp;
269 int data_reg;
270
271 if (!omap_mcbsp_check_valid_id(id)) {
272 printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
273 return -ENODEV;
274 }
275 mcbsp = id_to_mcbsp_ptr(id);
276
277 data_reg = mcbsp->phys_dma_base;
278
279 if (mcbsp->mcbsp_config_type < MCBSP_CONFIG_TYPE2) {
280 if (stream)
281 data_reg += OMAP_MCBSP_REG_DRR1;
282 else
283 data_reg += OMAP_MCBSP_REG_DXR1;
284 } else {
285 if (stream)
286 data_reg += OMAP_MCBSP_REG_DRR;
287 else
288 data_reg += OMAP_MCBSP_REG_DXR;
289 }
290
291 return data_reg;
292}
293EXPORT_SYMBOL(omap_mcbsp_dma_reg_params);
294
230#ifdef CONFIG_ARCH_OMAP3 295#ifdef CONFIG_ARCH_OMAP3
296static struct omap_device *find_omap_device_by_dev(struct device *dev)
297{
298 struct platform_device *pdev = container_of(dev,
299 struct platform_device, dev);
300 return container_of(pdev, struct omap_device, pdev);
301}
302
231static void omap_st_on(struct omap_mcbsp *mcbsp) 303static void omap_st_on(struct omap_mcbsp *mcbsp)
232{ 304{
233 unsigned int w; 305 unsigned int w;
306 struct omap_device *od;
307
308 od = find_omap_device_by_dev(mcbsp->dev);
234 309
235 /* 310 /*
236 * Sidetone uses McBSP ICLK - which must not idle when sidetones 311 * Sidetone uses McBSP ICLK - which must not idle when sidetones
@@ -244,9 +319,6 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
244 w = MCBSP_READ(mcbsp, SSELCR); 319 w = MCBSP_READ(mcbsp, SSELCR);
245 MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN); 320 MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN);
246 321
247 w = MCBSP_ST_READ(mcbsp, SYSCONFIG);
248 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w & ~(ST_AUTOIDLE));
249
250 /* Enable Sidetone from Sidetone Core */ 322 /* Enable Sidetone from Sidetone Core */
251 w = MCBSP_ST_READ(mcbsp, SSELCR); 323 w = MCBSP_ST_READ(mcbsp, SSELCR);
252 MCBSP_ST_WRITE(mcbsp, SSELCR, w | ST_SIDETONEEN); 324 MCBSP_ST_WRITE(mcbsp, SSELCR, w | ST_SIDETONEEN);
@@ -255,13 +327,13 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
255static void omap_st_off(struct omap_mcbsp *mcbsp) 327static void omap_st_off(struct omap_mcbsp *mcbsp)
256{ 328{
257 unsigned int w; 329 unsigned int w;
330 struct omap_device *od;
331
332 od = find_omap_device_by_dev(mcbsp->dev);
258 333
259 w = MCBSP_ST_READ(mcbsp, SSELCR); 334 w = MCBSP_ST_READ(mcbsp, SSELCR);
260 MCBSP_ST_WRITE(mcbsp, SSELCR, w & ~(ST_SIDETONEEN)); 335 MCBSP_ST_WRITE(mcbsp, SSELCR, w & ~(ST_SIDETONEEN));
261 336
262 w = MCBSP_ST_READ(mcbsp, SYSCONFIG);
263 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w | ST_AUTOIDLE);
264
265 w = MCBSP_READ(mcbsp, SSELCR); 337 w = MCBSP_READ(mcbsp, SSELCR);
266 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN)); 338 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
267 339
@@ -273,9 +345,9 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
273static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir) 345static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
274{ 346{
275 u16 val, i; 347 u16 val, i;
348 struct omap_device *od;
276 349
277 val = MCBSP_ST_READ(mcbsp, SYSCONFIG); 350 od = find_omap_device_by_dev(mcbsp->dev);
278 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, val & ~(ST_AUTOIDLE));
279 351
280 val = MCBSP_ST_READ(mcbsp, SSELCR); 352 val = MCBSP_ST_READ(mcbsp, SSELCR);
281 353
@@ -303,9 +375,9 @@ static void omap_st_chgain(struct omap_mcbsp *mcbsp)
303{ 375{
304 u16 w; 376 u16 w;
305 struct omap_mcbsp_st_data *st_data = mcbsp->st_data; 377 struct omap_mcbsp_st_data *st_data = mcbsp->st_data;
378 struct omap_device *od;
306 379
307 w = MCBSP_ST_READ(mcbsp, SYSCONFIG); 380 od = find_omap_device_by_dev(mcbsp->dev);
308 MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w & ~(ST_AUTOIDLE));
309 381
310 w = MCBSP_ST_READ(mcbsp, SSELCR); 382 w = MCBSP_ST_READ(mcbsp, SSELCR);
311 383
@@ -648,48 +720,33 @@ EXPORT_SYMBOL(omap_mcbsp_get_dma_op_mode);
648 720
649static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp) 721static inline void omap34xx_mcbsp_request(struct omap_mcbsp *mcbsp)
650{ 722{
723 struct omap_device *od;
724
725 od = find_omap_device_by_dev(mcbsp->dev);
651 /* 726 /*
652 * Enable wakup behavior, smart idle and all wakeups 727 * Enable wakup behavior, smart idle and all wakeups
653 * REVISIT: some wakeups may be unnecessary 728 * REVISIT: some wakeups may be unnecessary
654 */ 729 */
655 if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 730 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
656 u16 syscon; 731 MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN);
657
658 syscon = MCBSP_READ(mcbsp, SYSCON);
659 syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
660
661 if (mcbsp->dma_op_mode == MCBSP_DMA_MODE_THRESHOLD) {
662 syscon |= (ENAWAKEUP | SIDLEMODE(0x02) |
663 CLOCKACTIVITY(0x02));
664 MCBSP_WRITE(mcbsp, WAKEUPEN, XRDYEN | RRDYEN);
665 } else {
666 syscon |= SIDLEMODE(0x01);
667 }
668
669 MCBSP_WRITE(mcbsp, SYSCON, syscon);
670 } 732 }
671} 733}
672 734
673static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp) 735static inline void omap34xx_mcbsp_free(struct omap_mcbsp *mcbsp)
674{ 736{
737 struct omap_device *od;
738
739 od = find_omap_device_by_dev(mcbsp->dev);
740
675 /* 741 /*
676 * Disable wakup behavior, smart idle and all wakeups 742 * Disable wakup behavior, smart idle and all wakeups
677 */ 743 */
678 if (cpu_is_omap34xx() || cpu_is_omap44xx()) { 744 if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
679 u16 syscon;
680
681 syscon = MCBSP_READ(mcbsp, SYSCON);
682 syscon &= ~(ENAWAKEUP | SIDLEMODE(0x03) | CLOCKACTIVITY(0x03));
683 /* 745 /*
684 * HW bug workaround - If no_idle mode is taken, we need to 746 * HW bug workaround - If no_idle mode is taken, we need to
685 * go to smart_idle before going to always_idle, or the 747 * go to smart_idle before going to always_idle, or the
686 * device will not hit retention anymore. 748 * device will not hit retention anymore.
687 */ 749 */
688 syscon |= SIDLEMODE(0x02);
689 MCBSP_WRITE(mcbsp, SYSCON, syscon);
690
691 syscon &= ~(SIDLEMODE(0x03));
692 MCBSP_WRITE(mcbsp, SYSCON, syscon);
693 750
694 MCBSP_WRITE(mcbsp, WAKEUPEN, 0); 751 MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
695 } 752 }
@@ -764,8 +821,7 @@ int omap_mcbsp_request(unsigned int id)
764 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request) 821 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request)
765 mcbsp->pdata->ops->request(id); 822 mcbsp->pdata->ops->request(id);
766 823
767 clk_enable(mcbsp->iclk); 824 pm_runtime_get_sync(mcbsp->dev);
768 clk_enable(mcbsp->fclk);
769 825
770 /* Do procedure specific to omap34xx arch, if applicable */ 826 /* Do procedure specific to omap34xx arch, if applicable */
771 omap34xx_mcbsp_request(mcbsp); 827 omap34xx_mcbsp_request(mcbsp);
@@ -813,8 +869,7 @@ err_clk_disable:
813 /* Do procedure specific to omap34xx arch, if applicable */ 869 /* Do procedure specific to omap34xx arch, if applicable */
814 omap34xx_mcbsp_free(mcbsp); 870 omap34xx_mcbsp_free(mcbsp);
815 871
816 clk_disable(mcbsp->fclk); 872 pm_runtime_put_sync(mcbsp->dev);
817 clk_disable(mcbsp->iclk);
818 873
819 spin_lock(&mcbsp->lock); 874 spin_lock(&mcbsp->lock);
820 mcbsp->free = true; 875 mcbsp->free = true;
@@ -844,8 +899,7 @@ void omap_mcbsp_free(unsigned int id)
844 /* Do procedure specific to omap34xx arch, if applicable */ 899 /* Do procedure specific to omap34xx arch, if applicable */
845 omap34xx_mcbsp_free(mcbsp); 900 omap34xx_mcbsp_free(mcbsp);
846 901
847 clk_disable(mcbsp->fclk); 902 pm_runtime_put_sync(mcbsp->dev);
848 clk_disable(mcbsp->iclk);
849 903
850 if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) { 904 if (mcbsp->io_type == OMAP_MCBSP_IRQ_IO) {
851 /* Free IRQs */ 905 /* Free IRQs */
@@ -1649,7 +1703,8 @@ static const struct attribute_group sidetone_attr_group = {
1649 1703
1650static int __devinit omap_st_add(struct omap_mcbsp *mcbsp) 1704static int __devinit omap_st_add(struct omap_mcbsp *mcbsp)
1651{ 1705{
1652 struct omap_mcbsp_platform_data *pdata = mcbsp->pdata; 1706 struct platform_device *pdev;
1707 struct resource *res;
1653 struct omap_mcbsp_st_data *st_data; 1708 struct omap_mcbsp_st_data *st_data;
1654 int err; 1709 int err;
1655 1710
@@ -1659,7 +1714,10 @@ static int __devinit omap_st_add(struct omap_mcbsp *mcbsp)
1659 goto err1; 1714 goto err1;
1660 } 1715 }
1661 1716
1662 st_data->io_base_st = ioremap(pdata->phys_base_st, SZ_4K); 1717 pdev = container_of(mcbsp->dev, struct platform_device, dev);
1718
1719 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sidetone");
1720 st_data->io_base_st = ioremap(res->start, resource_size(res));
1663 if (!st_data->io_base_st) { 1721 if (!st_data->io_base_st) {
1664 err = -ENOMEM; 1722 err = -ENOMEM;
1665 goto err2; 1723 goto err2;
@@ -1748,6 +1806,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
1748 struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data; 1806 struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data;
1749 struct omap_mcbsp *mcbsp; 1807 struct omap_mcbsp *mcbsp;
1750 int id = pdev->id - 1; 1808 int id = pdev->id - 1;
1809 struct resource *res;
1751 int ret = 0; 1810 int ret = 0;
1752 1811
1753 if (!pdata) { 1812 if (!pdata) {
@@ -1777,47 +1836,78 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
1777 mcbsp->dma_tx_lch = -1; 1836 mcbsp->dma_tx_lch = -1;
1778 mcbsp->dma_rx_lch = -1; 1837 mcbsp->dma_rx_lch = -1;
1779 1838
1780 mcbsp->phys_base = pdata->phys_base; 1839 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu");
1781 mcbsp->io_base = ioremap(pdata->phys_base, SZ_4K); 1840 if (!res) {
1841 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1842 if (!res) {
1843 dev_err(&pdev->dev, "%s:mcbsp%d has invalid memory"
1844 "resource\n", __func__, pdev->id);
1845 ret = -ENOMEM;
1846 goto exit;
1847 }
1848 }
1849 mcbsp->phys_base = res->start;
1850 omap_mcbsp_cache_size = resource_size(res);
1851 mcbsp->io_base = ioremap(res->start, resource_size(res));
1782 if (!mcbsp->io_base) { 1852 if (!mcbsp->io_base) {
1783 ret = -ENOMEM; 1853 ret = -ENOMEM;
1784 goto err_ioremap; 1854 goto err_ioremap;
1785 } 1855 }
1786 1856
1857 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma");
1858 if (!res)
1859 mcbsp->phys_dma_base = mcbsp->phys_base;
1860 else
1861 mcbsp->phys_dma_base = res->start;
1862
1787 /* Default I/O is IRQ based */ 1863 /* Default I/O is IRQ based */
1788 mcbsp->io_type = OMAP_MCBSP_IRQ_IO; 1864 mcbsp->io_type = OMAP_MCBSP_IRQ_IO;
1789 mcbsp->tx_irq = pdata->tx_irq;
1790 mcbsp->rx_irq = pdata->rx_irq;
1791 mcbsp->dma_rx_sync = pdata->dma_rx_sync;
1792 mcbsp->dma_tx_sync = pdata->dma_tx_sync;
1793 1865
1794 mcbsp->iclk = clk_get(&pdev->dev, "ick"); 1866 mcbsp->tx_irq = platform_get_irq_byname(pdev, "tx");
1795 if (IS_ERR(mcbsp->iclk)) { 1867 mcbsp->rx_irq = platform_get_irq_byname(pdev, "rx");
1796 ret = PTR_ERR(mcbsp->iclk); 1868
1797 dev_err(&pdev->dev, "unable to get ick: %d\n", ret); 1869 /* From OMAP4 there will be a single irq line */
1798 goto err_iclk; 1870 if (mcbsp->tx_irq == -ENXIO)
1871 mcbsp->tx_irq = platform_get_irq(pdev, 0);
1872
1873 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1874 if (!res) {
1875 dev_err(&pdev->dev, "%s:mcbsp%d has invalid rx DMA channel\n",
1876 __func__, pdev->id);
1877 ret = -ENODEV;
1878 goto err_res;
1879 }
1880 mcbsp->dma_rx_sync = res->start;
1881
1882 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1883 if (!res) {
1884 dev_err(&pdev->dev, "%s:mcbsp%d has invalid tx DMA channel\n",
1885 __func__, pdev->id);
1886 ret = -ENODEV;
1887 goto err_res;
1799 } 1888 }
1889 mcbsp->dma_tx_sync = res->start;
1800 1890
1801 mcbsp->fclk = clk_get(&pdev->dev, "fck"); 1891 mcbsp->fclk = clk_get(&pdev->dev, "fck");
1802 if (IS_ERR(mcbsp->fclk)) { 1892 if (IS_ERR(mcbsp->fclk)) {
1803 ret = PTR_ERR(mcbsp->fclk); 1893 ret = PTR_ERR(mcbsp->fclk);
1804 dev_err(&pdev->dev, "unable to get fck: %d\n", ret); 1894 dev_err(&pdev->dev, "unable to get fck: %d\n", ret);
1805 goto err_fclk; 1895 goto err_res;
1806 } 1896 }
1807 1897
1808 mcbsp->pdata = pdata; 1898 mcbsp->pdata = pdata;
1809 mcbsp->dev = &pdev->dev; 1899 mcbsp->dev = &pdev->dev;
1810 mcbsp_ptr[id] = mcbsp; 1900 mcbsp_ptr[id] = mcbsp;
1901 mcbsp->mcbsp_config_type = pdata->mcbsp_config_type;
1811 platform_set_drvdata(pdev, mcbsp); 1902 platform_set_drvdata(pdev, mcbsp);
1903 pm_runtime_enable(mcbsp->dev);
1812 1904
1813 /* Initialize mcbsp properties for OMAP34XX if needed / applicable */ 1905 /* Initialize mcbsp properties for OMAP34XX if needed / applicable */
1814 omap34xx_device_init(mcbsp); 1906 omap34xx_device_init(mcbsp);
1815 1907
1816 return 0; 1908 return 0;
1817 1909
1818err_fclk: 1910err_res:
1819 clk_put(mcbsp->iclk);
1820err_iclk:
1821 iounmap(mcbsp->io_base); 1911 iounmap(mcbsp->io_base);
1822err_ioremap: 1912err_ioremap:
1823 kfree(mcbsp); 1913 kfree(mcbsp);
@@ -1839,7 +1929,6 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
1839 omap34xx_device_exit(mcbsp); 1929 omap34xx_device_exit(mcbsp);
1840 1930
1841 clk_put(mcbsp->fclk); 1931 clk_put(mcbsp->fclk);
1842 clk_put(mcbsp->iclk);
1843 1932
1844 iounmap(mcbsp->io_base); 1933 iounmap(mcbsp->io_base);
1845 kfree(mcbsp); 1934 kfree(mcbsp);
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 57adb270767b..9bbda9acb73b 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -83,9 +83,11 @@
83#include <linux/err.h> 83#include <linux/err.h>
84#include <linux/io.h> 84#include <linux/io.h>
85#include <linux/clk.h> 85#include <linux/clk.h>
86#include <linux/clkdev.h>
86 87
87#include <plat/omap_device.h> 88#include <plat/omap_device.h>
88#include <plat/omap_hwmod.h> 89#include <plat/omap_hwmod.h>
90#include <plat/clock.h>
89 91
90/* These parameters are passed to _omap_device_{de,}activate() */ 92/* These parameters are passed to _omap_device_{de,}activate() */
91#define USE_WAKEUP_LAT 0 93#define USE_WAKEUP_LAT 0
@@ -239,12 +241,12 @@ static inline struct omap_device *_find_by_pdev(struct platform_device *pdev)
239} 241}
240 242
241/** 243/**
242 * _add_optional_clock_alias - Add clock alias for hwmod optional clocks 244 * _add_optional_clock_clkdev - Add clkdev entry for hwmod optional clocks
243 * @od: struct omap_device *od 245 * @od: struct omap_device *od
244 * 246 *
245 * For every optional clock present per hwmod per omap_device, this function 247 * For every optional clock present per hwmod per omap_device, this function
246 * adds an entry in the clocks list of the form <dev-id=dev_name, con-id=role> 248 * adds an entry in the clkdev table of the form <dev-id=dev_name, con-id=role>
247 * if an entry is already present in it with the form <dev-id=NULL, con-id=role> 249 * if it does not exist already.
248 * 250 *
249 * The function is called from inside omap_device_build_ss(), after 251 * The function is called from inside omap_device_build_ss(), after
250 * omap_device_register. 252 * omap_device_register.
@@ -254,25 +256,39 @@ static inline struct omap_device *_find_by_pdev(struct platform_device *pdev)
254 * 256 *
255 * No return value. 257 * No return value.
256 */ 258 */
257static void _add_optional_clock_alias(struct omap_device *od, 259static void _add_optional_clock_clkdev(struct omap_device *od,
258 struct omap_hwmod *oh) 260 struct omap_hwmod *oh)
259{ 261{
260 int i; 262 int i;
261 263
262 for (i = 0; i < oh->opt_clks_cnt; i++) { 264 for (i = 0; i < oh->opt_clks_cnt; i++) {
263 struct omap_hwmod_opt_clk *oc; 265 struct omap_hwmod_opt_clk *oc;
264 int r; 266 struct clk *r;
267 struct clk_lookup *l;
265 268
266 oc = &oh->opt_clks[i]; 269 oc = &oh->opt_clks[i];
267 270
268 if (!oc->_clk) 271 if (!oc->_clk)
269 continue; 272 continue;
270 273
271 r = clk_add_alias(oc->role, dev_name(&od->pdev.dev), 274 r = clk_get_sys(dev_name(&od->pdev.dev), oc->role);
272 (char *)oc->clk, &od->pdev.dev); 275 if (!IS_ERR(r))
273 if (r) 276 continue; /* clkdev entry exists */
274 pr_err("omap_device: %s: clk_add_alias for %s failed\n", 277
278 r = omap_clk_get_by_name((char *)oc->clk);
279 if (IS_ERR(r)) {
280 pr_err("omap_device: %s: omap_clk_get_by_name for %s failed\n",
281 dev_name(&od->pdev.dev), oc->clk);
282 continue;
283 }
284
285 l = clkdev_alloc(r, oc->role, dev_name(&od->pdev.dev));
286 if (!l) {
287 pr_err("omap_device: %s: clkdev_alloc for %s failed\n",
275 dev_name(&od->pdev.dev), oc->role); 288 dev_name(&od->pdev.dev), oc->role);
289 return;
290 }
291 clkdev_add(l);
276 } 292 }
277} 293}
278 294
@@ -480,7 +496,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
480 496
481 for (i = 0; i < oh_cnt; i++) { 497 for (i = 0; i < oh_cnt; i++) {
482 hwmods[i]->od = od; 498 hwmods[i]->od = od;
483 _add_optional_clock_alias(od, hwmods[i]); 499 _add_optional_clock_clkdev(od, hwmods[i]);
484 } 500 }
485 501
486 if (ret) 502 if (ret)
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index e26e50487d60..9d80064e979b 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -312,7 +312,7 @@ u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass)
312} 312}
313#endif 313#endif
314 314
315#ifdef CONFIG_ARCH_OMAP2420 315#ifdef CONFIG_SOC_OMAP2420
316static int __init omap242x_sram_init(void) 316static int __init omap242x_sram_init(void)
317{ 317{
318 _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init, 318 _omap2_sram_ddr_init = omap_sram_push(omap242x_sram_ddr_init,
@@ -333,7 +333,7 @@ static inline int omap242x_sram_init(void)
333} 333}
334#endif 334#endif
335 335
336#ifdef CONFIG_ARCH_OMAP2430 336#ifdef CONFIG_SOC_OMAP2430
337static int __init omap243x_sram_init(void) 337static int __init omap243x_sram_init(void)
338{ 338{
339 _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init, 339 _omap2_sram_ddr_init = omap_sram_push(omap243x_sram_ddr_init,
@@ -405,20 +405,6 @@ static inline int omap34xx_sram_init(void)
405} 405}
406#endif 406#endif
407 407
408#ifdef CONFIG_ARCH_OMAP4
409static int __init omap44xx_sram_init(void)
410{
411 printk(KERN_ERR "FIXME: %s not implemented\n", __func__);
412
413 return -ENODEV;
414}
415#else
416static inline int omap44xx_sram_init(void)
417{
418 return 0;
419}
420#endif
421
422int __init omap_sram_init(void) 408int __init omap_sram_init(void)
423{ 409{
424 omap_detect_sram(); 410 omap_detect_sram();
@@ -432,8 +418,6 @@ int __init omap_sram_init(void)
432 omap243x_sram_init(); 418 omap243x_sram_init();
433 else if (cpu_is_omap34xx()) 419 else if (cpu_is_omap34xx())
434 omap34xx_sram_init(); 420 omap34xx_sram_init();
435 else if (cpu_is_omap44xx())
436 omap44xx_sram_init();
437 421
438 return 0; 422 return 0;
439} 423}
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 9bfb71ff3a6a..177c7d156933 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -117,4 +117,6 @@ source "drivers/staging/Kconfig"
117source "drivers/platform/Kconfig" 117source "drivers/platform/Kconfig"
118 118
119source "drivers/clk/Kconfig" 119source "drivers/clk/Kconfig"
120
121source "drivers/hwspinlock/Kconfig"
120endmenu 122endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index b423bb16c3a8..3f135b6fb014 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -117,3 +117,5 @@ obj-y += platform/
117obj-y += ieee802154/ 117obj-y += ieee802154/
118#common clk code 118#common clk code
119obj-y += clk/ 119obj-y += clk/
120
121obj-$(CONFIG_HWSPINLOCK) += hwspinlock/
diff --git a/drivers/hwspinlock/Kconfig b/drivers/hwspinlock/Kconfig
new file mode 100644
index 000000000000..eb4af28f8567
--- /dev/null
+++ b/drivers/hwspinlock/Kconfig
@@ -0,0 +1,22 @@
1#
2# Generic HWSPINLOCK framework
3#
4
5config HWSPINLOCK
6 tristate "Generic Hardware Spinlock framework"
7 help
8 Say y here to support the generic hardware spinlock framework.
9 You only need to enable this if you have hardware spinlock module
10 on your system (usually only relevant if your system has remote slave
11 coprocessors).
12
13 If unsure, say N.
14
15config HWSPINLOCK_OMAP
16 tristate "OMAP Hardware Spinlock device"
17 depends on HWSPINLOCK && ARCH_OMAP4
18 help
19 Say y here to support the OMAP Hardware Spinlock device (firstly
20 introduced in OMAP4).
21
22 If unsure, say N.
diff --git a/drivers/hwspinlock/Makefile b/drivers/hwspinlock/Makefile
new file mode 100644
index 000000000000..5729a3f7ed3d
--- /dev/null
+++ b/drivers/hwspinlock/Makefile
@@ -0,0 +1,6 @@
1#
2# Generic Hardware Spinlock framework
3#
4
5obj-$(CONFIG_HWSPINLOCK) += hwspinlock_core.o
6obj-$(CONFIG_HWSPINLOCK_OMAP) += omap_hwspinlock.o
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
new file mode 100644
index 000000000000..43a62714b4fb
--- /dev/null
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -0,0 +1,548 @@
1/*
2 * Hardware spinlock framework
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * Contact: Ohad Ben-Cohen <ohad@wizery.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#define pr_fmt(fmt) "%s: " fmt, __func__
19
20#include <linux/kernel.h>
21#include <linux/module.h>
22#include <linux/spinlock.h>
23#include <linux/types.h>
24#include <linux/err.h>
25#include <linux/jiffies.h>
26#include <linux/radix-tree.h>
27#include <linux/hwspinlock.h>
28#include <linux/pm_runtime.h>
29
30#include "hwspinlock_internal.h"
31
32/* radix tree tags */
33#define HWSPINLOCK_UNUSED (0) /* tags an hwspinlock as unused */
34
35/*
36 * A radix tree is used to maintain the available hwspinlock instances.
37 * The tree associates hwspinlock pointers with their integer key id,
38 * and provides easy-to-use API which makes the hwspinlock core code simple
39 * and easy to read.
40 *
41 * Radix trees are quick on lookups, and reasonably efficient in terms of
42 * storage, especially with high density usages such as this framework
43 * requires (a continuous range of integer keys, beginning with zero, is
44 * used as the ID's of the hwspinlock instances).
45 *
46 * The radix tree API supports tagging items in the tree, which this
47 * framework uses to mark unused hwspinlock instances (see the
48 * HWSPINLOCK_UNUSED tag above). As a result, the process of querying the
49 * tree, looking for an unused hwspinlock instance, is now reduced to a
50 * single radix tree API call.
51 */
52static RADIX_TREE(hwspinlock_tree, GFP_KERNEL);
53
54/*
55 * Synchronization of access to the tree is achieved using this spinlock,
56 * as the radix-tree API requires that users provide all synchronisation.
57 */
58static DEFINE_SPINLOCK(hwspinlock_tree_lock);
59
60/**
61 * __hwspin_trylock() - attempt to lock a specific hwspinlock
62 * @hwlock: an hwspinlock which we want to trylock
63 * @mode: controls whether local interrupts are disabled or not
64 * @flags: a pointer where the caller's interrupt state will be saved at (if
65 * requested)
66 *
67 * This function attempts to lock an hwspinlock, and will immediately
68 * fail if the hwspinlock is already taken.
69 *
70 * Upon a successful return from this function, preemption (and possibly
71 * interrupts) is disabled, so the caller must not sleep, and is advised to
72 * release the hwspinlock as soon as possible. This is required in order to
73 * minimize remote cores polling on the hardware interconnect.
74 *
75 * The user decides whether local interrupts are disabled or not, and if yes,
76 * whether he wants their previous state to be saved. It is up to the user
77 * to choose the appropriate @mode of operation, exactly the same way users
78 * should decide between spin_trylock, spin_trylock_irq and
79 * spin_trylock_irqsave.
80 *
81 * Returns 0 if we successfully locked the hwspinlock or -EBUSY if
82 * the hwspinlock was already taken.
83 * This function will never sleep.
84 */
85int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
86{
87 int ret;
88
89 BUG_ON(!hwlock);
90 BUG_ON(!flags && mode == HWLOCK_IRQSTATE);
91
92 /*
93 * This spin_lock{_irq, _irqsave} serves three purposes:
94 *
95 * 1. Disable preemption, in order to minimize the period of time
96 * in which the hwspinlock is taken. This is important in order
97 * to minimize the possible polling on the hardware interconnect
98 * by a remote user of this lock.
99 * 2. Make the hwspinlock SMP-safe (so we can take it from
100 * additional contexts on the local host).
101 * 3. Ensure that in_atomic/might_sleep checks catch potential
102 * problems with hwspinlock usage (e.g. scheduler checks like
103 * 'scheduling while atomic' etc.)
104 */
105 if (mode == HWLOCK_IRQSTATE)
106 ret = spin_trylock_irqsave(&hwlock->lock, *flags);
107 else if (mode == HWLOCK_IRQ)
108 ret = spin_trylock_irq(&hwlock->lock);
109 else
110 ret = spin_trylock(&hwlock->lock);
111
112 /* is lock already taken by another context on the local cpu ? */
113 if (!ret)
114 return -EBUSY;
115
116 /* try to take the hwspinlock device */
117 ret = hwlock->ops->trylock(hwlock);
118
119 /* if hwlock is already taken, undo spin_trylock_* and exit */
120 if (!ret) {
121 if (mode == HWLOCK_IRQSTATE)
122 spin_unlock_irqrestore(&hwlock->lock, *flags);
123 else if (mode == HWLOCK_IRQ)
124 spin_unlock_irq(&hwlock->lock);
125 else
126 spin_unlock(&hwlock->lock);
127
128 return -EBUSY;
129 }
130
131 /*
132 * We can be sure the other core's memory operations
133 * are observable to us only _after_ we successfully take
134 * the hwspinlock, and we must make sure that subsequent memory
135 * operations (both reads and writes) will not be reordered before
136 * we actually took the hwspinlock.
137 *
138 * Note: the implicit memory barrier of the spinlock above is too
139 * early, so we need this additional explicit memory barrier.
140 */
141 mb();
142
143 return 0;
144}
145EXPORT_SYMBOL_GPL(__hwspin_trylock);
146
147/**
148 * __hwspin_lock_timeout() - lock an hwspinlock with timeout limit
149 * @hwlock: the hwspinlock to be locked
150 * @timeout: timeout value in msecs
151 * @mode: mode which controls whether local interrupts are disabled or not
152 * @flags: a pointer to where the caller's interrupt state will be saved at (if
153 * requested)
154 *
155 * This function locks the given @hwlock. If the @hwlock
156 * is already taken, the function will busy loop waiting for it to
157 * be released, but give up after @timeout msecs have elapsed.
158 *
159 * Upon a successful return from this function, preemption is disabled
160 * (and possibly local interrupts, too), so the caller must not sleep,
161 * and is advised to release the hwspinlock as soon as possible.
162 * This is required in order to minimize remote cores polling on the
163 * hardware interconnect.
164 *
165 * The user decides whether local interrupts are disabled or not, and if yes,
166 * whether he wants their previous state to be saved. It is up to the user
167 * to choose the appropriate @mode of operation, exactly the same way users
168 * should decide between spin_lock, spin_lock_irq and spin_lock_irqsave.
169 *
170 * Returns 0 when the @hwlock was successfully taken, and an appropriate
171 * error code otherwise (most notably -ETIMEDOUT if the @hwlock is still
172 * busy after @timeout msecs). The function will never sleep.
173 */
174int __hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to,
175 int mode, unsigned long *flags)
176{
177 int ret;
178 unsigned long expire;
179
180 expire = msecs_to_jiffies(to) + jiffies;
181
182 for (;;) {
183 /* Try to take the hwspinlock */
184 ret = __hwspin_trylock(hwlock, mode, flags);
185 if (ret != -EBUSY)
186 break;
187
188 /*
189 * The lock is already taken, let's check if the user wants
190 * us to try again
191 */
192 if (time_is_before_eq_jiffies(expire))
193 return -ETIMEDOUT;
194
195 /*
196 * Allow platform-specific relax handlers to prevent
197 * hogging the interconnect (no sleeping, though)
198 */
199 if (hwlock->ops->relax)
200 hwlock->ops->relax(hwlock);
201 }
202
203 return ret;
204}
205EXPORT_SYMBOL_GPL(__hwspin_lock_timeout);
206
207/**
208 * __hwspin_unlock() - unlock a specific hwspinlock
209 * @hwlock: a previously-acquired hwspinlock which we want to unlock
210 * @mode: controls whether local interrupts needs to be restored or not
211 * @flags: previous caller's interrupt state to restore (if requested)
212 *
213 * This function will unlock a specific hwspinlock, enable preemption and
214 * (possibly) enable interrupts or restore their previous state.
215 * @hwlock must be already locked before calling this function: it is a bug
216 * to call unlock on a @hwlock that is already unlocked.
217 *
218 * The user decides whether local interrupts should be enabled or not, and
219 * if yes, whether he wants their previous state to be restored. It is up
220 * to the user to choose the appropriate @mode of operation, exactly the
221 * same way users decide between spin_unlock, spin_unlock_irq and
222 * spin_unlock_irqrestore.
223 *
224 * The function will never sleep.
225 */
226void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
227{
228 BUG_ON(!hwlock);
229 BUG_ON(!flags && mode == HWLOCK_IRQSTATE);
230
231 /*
232 * We must make sure that memory operations (both reads and writes),
233 * done before unlocking the hwspinlock, will not be reordered
234 * after the lock is released.
235 *
236 * That's the purpose of this explicit memory barrier.
237 *
238 * Note: the memory barrier induced by the spin_unlock below is too
239 * late; the other core is going to access memory soon after it will
240 * take the hwspinlock, and by then we want to be sure our memory
241 * operations are already observable.
242 */
243 mb();
244
245 hwlock->ops->unlock(hwlock);
246
247 /* Undo the spin_trylock{_irq, _irqsave} called while locking */
248 if (mode == HWLOCK_IRQSTATE)
249 spin_unlock_irqrestore(&hwlock->lock, *flags);
250 else if (mode == HWLOCK_IRQ)
251 spin_unlock_irq(&hwlock->lock);
252 else
253 spin_unlock(&hwlock->lock);
254}
255EXPORT_SYMBOL_GPL(__hwspin_unlock);
256
257/**
258 * hwspin_lock_register() - register a new hw spinlock
259 * @hwlock: hwspinlock to register.
260 *
261 * This function should be called from the underlying platform-specific
262 * implementation, to register a new hwspinlock instance.
263 *
264 * Can be called from an atomic context (will not sleep) but not from
265 * within interrupt context.
266 *
267 * Returns 0 on success, or an appropriate error code on failure
268 */
269int hwspin_lock_register(struct hwspinlock *hwlock)
270{
271 struct hwspinlock *tmp;
272 int ret;
273
274 if (!hwlock || !hwlock->ops ||
275 !hwlock->ops->trylock || !hwlock->ops->unlock) {
276 pr_err("invalid parameters\n");
277 return -EINVAL;
278 }
279
280 spin_lock_init(&hwlock->lock);
281
282 spin_lock(&hwspinlock_tree_lock);
283
284 ret = radix_tree_insert(&hwspinlock_tree, hwlock->id, hwlock);
285 if (ret)
286 goto out;
287
288 /* mark this hwspinlock as available */
289 tmp = radix_tree_tag_set(&hwspinlock_tree, hwlock->id,
290 HWSPINLOCK_UNUSED);
291
292 /* self-sanity check which should never fail */
293 WARN_ON(tmp != hwlock);
294
295out:
296 spin_unlock(&hwspinlock_tree_lock);
297 return ret;
298}
299EXPORT_SYMBOL_GPL(hwspin_lock_register);
300
301/**
302 * hwspin_lock_unregister() - unregister an hw spinlock
303 * @id: index of the specific hwspinlock to unregister
304 *
305 * This function should be called from the underlying platform-specific
306 * implementation, to unregister an existing (and unused) hwspinlock.
307 *
308 * Can be called from an atomic context (will not sleep) but not from
309 * within interrupt context.
310 *
311 * Returns the address of hwspinlock @id on success, or NULL on failure
312 */
313struct hwspinlock *hwspin_lock_unregister(unsigned int id)
314{
315 struct hwspinlock *hwlock = NULL;
316 int ret;
317
318 spin_lock(&hwspinlock_tree_lock);
319
320 /* make sure the hwspinlock is not in use (tag is set) */
321 ret = radix_tree_tag_get(&hwspinlock_tree, id, HWSPINLOCK_UNUSED);
322 if (ret == 0) {
323 pr_err("hwspinlock %d still in use (or not present)\n", id);
324 goto out;
325 }
326
327 hwlock = radix_tree_delete(&hwspinlock_tree, id);
328 if (!hwlock) {
329 pr_err("failed to delete hwspinlock %d\n", id);
330 goto out;
331 }
332
333out:
334 spin_unlock(&hwspinlock_tree_lock);
335 return hwlock;
336}
337EXPORT_SYMBOL_GPL(hwspin_lock_unregister);
338
339/**
340 * __hwspin_lock_request() - tag an hwspinlock as used and power it up
341 *
342 * This is an internal function that prepares an hwspinlock instance
343 * before it is given to the user. The function assumes that
344 * hwspinlock_tree_lock is taken.
345 *
346 * Returns 0 or positive to indicate success, and a negative value to
347 * indicate an error (with the appropriate error code)
348 */
349static int __hwspin_lock_request(struct hwspinlock *hwlock)
350{
351 struct hwspinlock *tmp;
352 int ret;
353
354 /* prevent underlying implementation from being removed */
355 if (!try_module_get(hwlock->owner)) {
356 dev_err(hwlock->dev, "%s: can't get owner\n", __func__);
357 return -EINVAL;
358 }
359
360 /* notify PM core that power is now needed */
361 ret = pm_runtime_get_sync(hwlock->dev);
362 if (ret < 0) {
363 dev_err(hwlock->dev, "%s: can't power on device\n", __func__);
364 return ret;
365 }
366
367 /* mark hwspinlock as used, should not fail */
368 tmp = radix_tree_tag_clear(&hwspinlock_tree, hwlock->id,
369 HWSPINLOCK_UNUSED);
370
371 /* self-sanity check that should never fail */
372 WARN_ON(tmp != hwlock);
373
374 return ret;
375}
376
377/**
378 * hwspin_lock_get_id() - retrieve id number of a given hwspinlock
379 * @hwlock: a valid hwspinlock instance
380 *
381 * Returns the id number of a given @hwlock, or -EINVAL if @hwlock is invalid.
382 */
383int hwspin_lock_get_id(struct hwspinlock *hwlock)
384{
385 if (!hwlock) {
386 pr_err("invalid hwlock\n");
387 return -EINVAL;
388 }
389
390 return hwlock->id;
391}
392EXPORT_SYMBOL_GPL(hwspin_lock_get_id);
393
394/**
395 * hwspin_lock_request() - request an hwspinlock
396 *
397 * This function should be called by users of the hwspinlock device,
398 * in order to dynamically assign them an unused hwspinlock.
399 * Usually the user of this lock will then have to communicate the lock's id
400 * to the remote core before it can be used for synchronization (to get the
401 * id of a given hwlock, use hwspin_lock_get_id()).
402 *
403 * Can be called from an atomic context (will not sleep) but not from
404 * within interrupt context (simply because there is no use case for
405 * that yet).
406 *
407 * Returns the address of the assigned hwspinlock, or NULL on error
408 */
409struct hwspinlock *hwspin_lock_request(void)
410{
411 struct hwspinlock *hwlock;
412 int ret;
413
414 spin_lock(&hwspinlock_tree_lock);
415
416 /* look for an unused lock */
417 ret = radix_tree_gang_lookup_tag(&hwspinlock_tree, (void **)&hwlock,
418 0, 1, HWSPINLOCK_UNUSED);
419 if (ret == 0) {
420 pr_warn("a free hwspinlock is not available\n");
421 hwlock = NULL;
422 goto out;
423 }
424
425 /* sanity check that should never fail */
426 WARN_ON(ret > 1);
427
428 /* mark as used and power up */
429 ret = __hwspin_lock_request(hwlock);
430 if (ret < 0)
431 hwlock = NULL;
432
433out:
434 spin_unlock(&hwspinlock_tree_lock);
435 return hwlock;
436}
437EXPORT_SYMBOL_GPL(hwspin_lock_request);
438
439/**
440 * hwspin_lock_request_specific() - request for a specific hwspinlock
441 * @id: index of the specific hwspinlock that is requested
442 *
443 * This function should be called by users of the hwspinlock module,
444 * in order to assign them a specific hwspinlock.
445 * Usually early board code will be calling this function in order to
446 * reserve specific hwspinlock ids for predefined purposes.
447 *
448 * Can be called from an atomic context (will not sleep) but not from
449 * within interrupt context (simply because there is no use case for
450 * that yet).
451 *
452 * Returns the address of the assigned hwspinlock, or NULL on error
453 */
454struct hwspinlock *hwspin_lock_request_specific(unsigned int id)
455{
456 struct hwspinlock *hwlock;
457 int ret;
458
459 spin_lock(&hwspinlock_tree_lock);
460
461 /* make sure this hwspinlock exists */
462 hwlock = radix_tree_lookup(&hwspinlock_tree, id);
463 if (!hwlock) {
464 pr_warn("hwspinlock %u does not exist\n", id);
465 goto out;
466 }
467
468 /* sanity check (this shouldn't happen) */
469 WARN_ON(hwlock->id != id);
470
471 /* make sure this hwspinlock is unused */
472 ret = radix_tree_tag_get(&hwspinlock_tree, id, HWSPINLOCK_UNUSED);
473 if (ret == 0) {
474 pr_warn("hwspinlock %u is already in use\n", id);
475 hwlock = NULL;
476 goto out;
477 }
478
479 /* mark as used and power up */
480 ret = __hwspin_lock_request(hwlock);
481 if (ret < 0)
482 hwlock = NULL;
483
484out:
485 spin_unlock(&hwspinlock_tree_lock);
486 return hwlock;
487}
488EXPORT_SYMBOL_GPL(hwspin_lock_request_specific);
489
490/**
491 * hwspin_lock_free() - free a specific hwspinlock
492 * @hwlock: the specific hwspinlock to free
493 *
494 * This function mark @hwlock as free again.
495 * Should only be called with an @hwlock that was retrieved from
496 * an earlier call to omap_hwspin_lock_request{_specific}.
497 *
498 * Can be called from an atomic context (will not sleep) but not from
499 * within interrupt context (simply because there is no use case for
500 * that yet).
501 *
502 * Returns 0 on success, or an appropriate error code on failure
503 */
504int hwspin_lock_free(struct hwspinlock *hwlock)
505{
506 struct hwspinlock *tmp;
507 int ret;
508
509 if (!hwlock) {
510 pr_err("invalid hwlock\n");
511 return -EINVAL;
512 }
513
514 spin_lock(&hwspinlock_tree_lock);
515
516 /* make sure the hwspinlock is used */
517 ret = radix_tree_tag_get(&hwspinlock_tree, hwlock->id,
518 HWSPINLOCK_UNUSED);
519 if (ret == 1) {
520 dev_err(hwlock->dev, "%s: hwlock is already free\n", __func__);
521 dump_stack();
522 ret = -EINVAL;
523 goto out;
524 }
525
526 /* notify the underlying device that power is not needed */
527 ret = pm_runtime_put(hwlock->dev);
528 if (ret < 0)
529 goto out;
530
531 /* mark this hwspinlock as available */
532 tmp = radix_tree_tag_set(&hwspinlock_tree, hwlock->id,
533 HWSPINLOCK_UNUSED);
534
535 /* sanity check (this shouldn't happen) */
536 WARN_ON(tmp != hwlock);
537
538 module_put(hwlock->owner);
539
540out:
541 spin_unlock(&hwspinlock_tree_lock);
542 return ret;
543}
544EXPORT_SYMBOL_GPL(hwspin_lock_free);
545
546MODULE_LICENSE("GPL v2");
547MODULE_DESCRIPTION("Hardware spinlock interface");
548MODULE_AUTHOR("Ohad Ben-Cohen <ohad@wizery.com>");
diff --git a/drivers/hwspinlock/hwspinlock_internal.h b/drivers/hwspinlock/hwspinlock_internal.h
new file mode 100644
index 000000000000..69935e6b93e5
--- /dev/null
+++ b/drivers/hwspinlock/hwspinlock_internal.h
@@ -0,0 +1,61 @@
1/*
2 * Hardware spinlocks internal header
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * Contact: Ohad Ben-Cohen <ohad@wizery.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#ifndef __HWSPINLOCK_HWSPINLOCK_H
19#define __HWSPINLOCK_HWSPINLOCK_H
20
21#include <linux/spinlock.h>
22#include <linux/device.h>
23
24/**
25 * struct hwspinlock_ops - platform-specific hwspinlock handlers
26 *
27 * @trylock: make a single attempt to take the lock. returns 0 on
28 * failure and true on success. may _not_ sleep.
29 * @unlock: release the lock. always succeed. may _not_ sleep.
30 * @relax: optional, platform-specific relax handler, called by hwspinlock
31 * core while spinning on a lock, between two successive
32 * invocations of @trylock. may _not_ sleep.
33 */
34struct hwspinlock_ops {
35 int (*trylock)(struct hwspinlock *lock);
36 void (*unlock)(struct hwspinlock *lock);
37 void (*relax)(struct hwspinlock *lock);
38};
39
40/**
41 * struct hwspinlock - this struct represents a single hwspinlock instance
42 *
43 * @dev: underlying device, will be used to invoke runtime PM api
44 * @ops: platform-specific hwspinlock handlers
45 * @id: a global, unique, system-wide, index of the lock.
46 * @lock: initialized and used by hwspinlock core
47 * @owner: underlying implementation module, used to maintain module ref count
48 *
49 * Note: currently simplicity was opted for, but later we can squeeze some
50 * memory bytes by grouping the dev, ops and owner members in a single
51 * per-platform struct, and have all hwspinlocks point at it.
52 */
53struct hwspinlock {
54 struct device *dev;
55 const struct hwspinlock_ops *ops;
56 int id;
57 spinlock_t lock;
58 struct module *owner;
59};
60
61#endif /* __HWSPINLOCK_HWSPINLOCK_H */
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
new file mode 100644
index 000000000000..a8f02734c026
--- /dev/null
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -0,0 +1,231 @@
1/*
2 * OMAP hardware spinlock driver
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * Contact: Simon Que <sque@ti.com>
7 * Hari Kanigeri <h-kanigeri2@ti.com>
8 * Ohad Ben-Cohen <ohad@wizery.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * version 2 as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 */
19
20#include <linux/kernel.h>
21#include <linux/module.h>
22#include <linux/device.h>
23#include <linux/delay.h>
24#include <linux/io.h>
25#include <linux/bitops.h>
26#include <linux/pm_runtime.h>
27#include <linux/slab.h>
28#include <linux/spinlock.h>
29#include <linux/hwspinlock.h>
30#include <linux/platform_device.h>
31
32#include "hwspinlock_internal.h"
33
34/* Spinlock register offsets */
35#define SYSSTATUS_OFFSET 0x0014
36#define LOCK_BASE_OFFSET 0x0800
37
38#define SPINLOCK_NUMLOCKS_BIT_OFFSET (24)
39
40/* Possible values of SPINLOCK_LOCK_REG */
41#define SPINLOCK_NOTTAKEN (0) /* free */
42#define SPINLOCK_TAKEN (1) /* locked */
43
44#define to_omap_hwspinlock(lock) \
45 container_of(lock, struct omap_hwspinlock, lock)
46
47struct omap_hwspinlock {
48 struct hwspinlock lock;
49 void __iomem *addr;
50};
51
52struct omap_hwspinlock_state {
53 int num_locks; /* Total number of locks in system */
54 void __iomem *io_base; /* Mapped base address */
55};
56
57static int omap_hwspinlock_trylock(struct hwspinlock *lock)
58{
59 struct omap_hwspinlock *omap_lock = to_omap_hwspinlock(lock);
60
61 /* attempt to acquire the lock by reading its value */
62 return (SPINLOCK_NOTTAKEN == readl(omap_lock->addr));
63}
64
65static void omap_hwspinlock_unlock(struct hwspinlock *lock)
66{
67 struct omap_hwspinlock *omap_lock = to_omap_hwspinlock(lock);
68
69 /* release the lock by writing 0 to it */
70 writel(SPINLOCK_NOTTAKEN, omap_lock->addr);
71}
72
73/*
74 * relax the OMAP interconnect while spinning on it.
75 *
76 * The specs recommended that the retry delay time will be
77 * just over half of the time that a requester would be
78 * expected to hold the lock.
79 *
80 * The number below is taken from an hardware specs example,
81 * obviously it is somewhat arbitrary.
82 */
83static void omap_hwspinlock_relax(struct hwspinlock *lock)
84{
85 ndelay(50);
86}
87
88static const struct hwspinlock_ops omap_hwspinlock_ops = {
89 .trylock = omap_hwspinlock_trylock,
90 .unlock = omap_hwspinlock_unlock,
91 .relax = omap_hwspinlock_relax,
92};
93
94static int __devinit omap_hwspinlock_probe(struct platform_device *pdev)
95{
96 struct omap_hwspinlock *omap_lock;
97 struct omap_hwspinlock_state *state;
98 struct hwspinlock *lock;
99 struct resource *res;
100 void __iomem *io_base;
101 int i, ret;
102
103 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
104 if (!res)
105 return -ENODEV;
106
107 state = kzalloc(sizeof(*state), GFP_KERNEL);
108 if (!state)
109 return -ENOMEM;
110
111 io_base = ioremap(res->start, resource_size(res));
112 if (!io_base) {
113 ret = -ENOMEM;
114 goto free_state;
115 }
116
117 /* Determine number of locks */
118 i = readl(io_base + SYSSTATUS_OFFSET);
119 i >>= SPINLOCK_NUMLOCKS_BIT_OFFSET;
120
121 /* one of the four lsb's must be set, and nothing else */
122 if (hweight_long(i & 0xf) != 1 || i > 8) {
123 ret = -EINVAL;
124 goto iounmap_base;
125 }
126
127 state->num_locks = i * 32;
128 state->io_base = io_base;
129
130 platform_set_drvdata(pdev, state);
131
132 /*
133 * runtime PM will make sure the clock of this module is
134 * enabled iff at least one lock is requested
135 */
136 pm_runtime_enable(&pdev->dev);
137
138 for (i = 0; i < state->num_locks; i++) {
139 omap_lock = kzalloc(sizeof(*omap_lock), GFP_KERNEL);
140 if (!omap_lock) {
141 ret = -ENOMEM;
142 goto free_locks;
143 }
144
145 omap_lock->lock.dev = &pdev->dev;
146 omap_lock->lock.owner = THIS_MODULE;
147 omap_lock->lock.id = i;
148 omap_lock->lock.ops = &omap_hwspinlock_ops;
149 omap_lock->addr = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i;
150
151 ret = hwspin_lock_register(&omap_lock->lock);
152 if (ret) {
153 kfree(omap_lock);
154 goto free_locks;
155 }
156 }
157
158 return 0;
159
160free_locks:
161 while (--i >= 0) {
162 lock = hwspin_lock_unregister(i);
163 /* this should't happen, but let's give our best effort */
164 if (!lock) {
165 dev_err(&pdev->dev, "%s: cleanups failed\n", __func__);
166 continue;
167 }
168 omap_lock = to_omap_hwspinlock(lock);
169 kfree(omap_lock);
170 }
171 pm_runtime_disable(&pdev->dev);
172iounmap_base:
173 iounmap(io_base);
174free_state:
175 kfree(state);
176 return ret;
177}
178
179static int omap_hwspinlock_remove(struct platform_device *pdev)
180{
181 struct omap_hwspinlock_state *state = platform_get_drvdata(pdev);
182 struct hwspinlock *lock;
183 struct omap_hwspinlock *omap_lock;
184 int i;
185
186 for (i = 0; i < state->num_locks; i++) {
187 lock = hwspin_lock_unregister(i);
188 /* this shouldn't happen at this point. if it does, at least
189 * don't continue with the remove */
190 if (!lock) {
191 dev_err(&pdev->dev, "%s: failed on %d\n", __func__, i);
192 return -EBUSY;
193 }
194
195 omap_lock = to_omap_hwspinlock(lock);
196 kfree(omap_lock);
197 }
198
199 pm_runtime_disable(&pdev->dev);
200 iounmap(state->io_base);
201 kfree(state);
202
203 return 0;
204}
205
206static struct platform_driver omap_hwspinlock_driver = {
207 .probe = omap_hwspinlock_probe,
208 .remove = omap_hwspinlock_remove,
209 .driver = {
210 .name = "omap_hwspinlock",
211 },
212};
213
214static int __init omap_hwspinlock_init(void)
215{
216 return platform_driver_register(&omap_hwspinlock_driver);
217}
218/* board init code might need to reserve hwspinlocks for predefined purposes */
219postcore_initcall(omap_hwspinlock_init);
220
221static void __exit omap_hwspinlock_exit(void)
222{
223 platform_driver_unregister(&omap_hwspinlock_driver);
224}
225module_exit(omap_hwspinlock_exit);
226
227MODULE_LICENSE("GPL v2");
228MODULE_DESCRIPTION("Hardware spinlock driver for OMAP");
229MODULE_AUTHOR("Simon Que <sque@ti.com>");
230MODULE_AUTHOR("Hari Kanigeri <h-kanigeri2@ti.com>");
231MODULE_AUTHOR("Ohad Ben-Cohen <ohad@wizery.com>");
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index afe8c6fa166a..54f91321749a 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -225,7 +225,7 @@ config MMC_OMAP
225 225
226config MMC_OMAP_HS 226config MMC_OMAP_HS
227 tristate "TI OMAP High Speed Multimedia Card Interface support" 227 tristate "TI OMAP High Speed Multimedia Card Interface support"
228 depends on ARCH_OMAP2430 || ARCH_OMAP3 || ARCH_OMAP4 228 depends on SOC_OMAP2430 || ARCH_OMAP3 || ARCH_OMAP4
229 help 229 help
230 This selects the TI OMAP High Speed Multimedia card Interface. 230 This selects the TI OMAP High Speed Multimedia card Interface.
231 If you have an OMAP2430 or OMAP3 board or OMAP4 board with a 231 If you have an OMAP2430 or OMAP3 board or OMAP4 board with a
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 0cf0d89e4183..158c0ee53b2c 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -118,7 +118,7 @@
118 118
119#define MMC_TIMEOUT_MS 20 119#define MMC_TIMEOUT_MS 20
120#define OMAP_MMC_MASTER_CLOCK 96000000 120#define OMAP_MMC_MASTER_CLOCK 96000000
121#define DRIVER_NAME "mmci-omap-hs" 121#define DRIVER_NAME "omap_hsmmc"
122 122
123/* Timeouts for entering power saving states on inactivity, msec */ 123/* Timeouts for entering power saving states on inactivity, msec */
124#define OMAP_MMC_DISABLED_TIMEOUT 100 124#define OMAP_MMC_DISABLED_TIMEOUT 100
@@ -260,7 +260,7 @@ static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on,
260 return ret; 260 return ret;
261} 261}
262 262
263static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on, 263static int omap_hsmmc_235_set_power(struct device *dev, int slot, int power_on,
264 int vdd) 264 int vdd)
265{ 265{
266 struct omap_hsmmc_host *host = 266 struct omap_hsmmc_host *host =
@@ -316,6 +316,12 @@ static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
316 return ret; 316 return ret;
317} 317}
318 318
319static int omap_hsmmc_4_set_power(struct device *dev, int slot, int power_on,
320 int vdd)
321{
322 return 0;
323}
324
319static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep, 325static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep,
320 int vdd, int cardsleep) 326 int vdd, int cardsleep)
321{ 327{
@@ -326,7 +332,7 @@ static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep,
326 return regulator_set_mode(host->vcc, mode); 332 return regulator_set_mode(host->vcc, mode);
327} 333}
328 334
329static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep, 335static int omap_hsmmc_235_set_sleep(struct device *dev, int slot, int sleep,
330 int vdd, int cardsleep) 336 int vdd, int cardsleep)
331{ 337{
332 struct omap_hsmmc_host *host = 338 struct omap_hsmmc_host *host =
@@ -365,6 +371,12 @@ static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep,
365 return regulator_enable(host->vcc_aux); 371 return regulator_enable(host->vcc_aux);
366} 372}
367 373
374static int omap_hsmmc_4_set_sleep(struct device *dev, int slot, int sleep,
375 int vdd, int cardsleep)
376{
377 return 0;
378}
379
368static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) 380static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
369{ 381{
370 struct regulator *reg; 382 struct regulator *reg;
@@ -379,10 +391,14 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
379 break; 391 break;
380 case OMAP_MMC2_DEVID: 392 case OMAP_MMC2_DEVID:
381 case OMAP_MMC3_DEVID: 393 case OMAP_MMC3_DEVID:
394 case OMAP_MMC5_DEVID:
382 /* Off-chip level shifting, or none */ 395 /* Off-chip level shifting, or none */
383 mmc_slot(host).set_power = omap_hsmmc_23_set_power; 396 mmc_slot(host).set_power = omap_hsmmc_235_set_power;
384 mmc_slot(host).set_sleep = omap_hsmmc_23_set_sleep; 397 mmc_slot(host).set_sleep = omap_hsmmc_235_set_sleep;
385 break; 398 break;
399 case OMAP_MMC4_DEVID:
400 mmc_slot(host).set_power = omap_hsmmc_4_set_power;
401 mmc_slot(host).set_sleep = omap_hsmmc_4_set_sleep;
386 default: 402 default:
387 pr_err("MMC%d configuration not supported!\n", host->id); 403 pr_err("MMC%d configuration not supported!\n", host->id);
388 return -EINVAL; 404 return -EINVAL;
@@ -1555,7 +1571,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1555 break; 1571 break;
1556 } 1572 }
1557 1573
1558 if (host->id == OMAP_MMC1_DEVID) { 1574 if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) {
1559 /* Only MMC1 can interface at 3V without some flavor 1575 /* Only MMC1 can interface at 3V without some flavor
1560 * of external transceiver; but they all handle 1.8V. 1576 * of external transceiver; but they all handle 1.8V.
1561 */ 1577 */
@@ -1647,7 +1663,7 @@ static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
1647 u32 hctl, capa, value; 1663 u32 hctl, capa, value;
1648 1664
1649 /* Only MMC1 supports 3.0V */ 1665 /* Only MMC1 supports 3.0V */
1650 if (host->id == OMAP_MMC1_DEVID) { 1666 if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) {
1651 hctl = SDVS30; 1667 hctl = SDVS30;
1652 capa = VS30 | VS18; 1668 capa = VS30 | VS18;
1653 } else { 1669 } else {
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index c89592239bc7..178e2006063d 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -106,23 +106,6 @@ config MTD_NAND_OMAP2
106 help 106 help
107 Support for NAND flash on Texas Instruments OMAP2 and OMAP3 platforms. 107 Support for NAND flash on Texas Instruments OMAP2 and OMAP3 platforms.
108 108
109config MTD_NAND_OMAP_PREFETCH
110 bool "GPMC prefetch support for NAND Flash device"
111 depends on MTD_NAND_OMAP2
112 default y
113 help
114 The NAND device can be accessed for Read/Write using GPMC PREFETCH engine
115 to improve the performance.
116
117config MTD_NAND_OMAP_PREFETCH_DMA
118 depends on MTD_NAND_OMAP_PREFETCH
119 bool "DMA mode"
120 default n
121 help
122 The GPMC PREFETCH engine can be configured eigther in MPU interrupt mode
123 or in DMA interrupt mode.
124 Say y for DMA mode or MPU mode will be used
125
126config MTD_NAND_IDS 109config MTD_NAND_IDS
127 tristate 110 tristate
128 111
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 15682ec8530e..4e33972ad17a 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -11,6 +11,7 @@
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/dma-mapping.h> 12#include <linux/dma-mapping.h>
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/interrupt.h>
14#include <linux/jiffies.h> 15#include <linux/jiffies.h>
15#include <linux/sched.h> 16#include <linux/sched.h>
16#include <linux/mtd/mtd.h> 17#include <linux/mtd/mtd.h>
@@ -24,6 +25,7 @@
24#include <plat/nand.h> 25#include <plat/nand.h>
25 26
26#define DRIVER_NAME "omap2-nand" 27#define DRIVER_NAME "omap2-nand"
28#define OMAP_NAND_TIMEOUT_MS 5000
27 29
28#define NAND_Ecc_P1e (1 << 0) 30#define NAND_Ecc_P1e (1 << 0)
29#define NAND_Ecc_P2e (1 << 1) 31#define NAND_Ecc_P2e (1 << 1)
@@ -96,26 +98,19 @@
96static const char *part_probes[] = { "cmdlinepart", NULL }; 98static const char *part_probes[] = { "cmdlinepart", NULL };
97#endif 99#endif
98 100
99#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH 101/* oob info generated runtime depending on ecc algorithm and layout selected */
100static int use_prefetch = 1; 102static struct nand_ecclayout omap_oobinfo;
101 103/* Define some generic bad / good block scan pattern which are used
102/* "modprobe ... use_prefetch=0" etc */ 104 * while scanning a device for factory marked good / bad blocks
103module_param(use_prefetch, bool, 0); 105 */
104MODULE_PARM_DESC(use_prefetch, "enable/disable use of PREFETCH"); 106static uint8_t scan_ff_pattern[] = { 0xff };
105 107static struct nand_bbt_descr bb_descrip_flashbased = {
106#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA 108 .options = NAND_BBT_SCANEMPTY | NAND_BBT_SCANALLPAGES,
107static int use_dma = 1; 109 .offs = 0,
110 .len = 1,
111 .pattern = scan_ff_pattern,
112};
108 113
109/* "modprobe ... use_dma=0" etc */
110module_param(use_dma, bool, 0);
111MODULE_PARM_DESC(use_dma, "enable/disable use of DMA");
112#else
113static const int use_dma;
114#endif
115#else
116const int use_prefetch;
117static const int use_dma;
118#endif
119 114
120struct omap_nand_info { 115struct omap_nand_info {
121 struct nand_hw_control controller; 116 struct nand_hw_control controller;
@@ -129,6 +124,13 @@ struct omap_nand_info {
129 unsigned long phys_base; 124 unsigned long phys_base;
130 struct completion comp; 125 struct completion comp;
131 int dma_ch; 126 int dma_ch;
127 int gpmc_irq;
128 enum {
129 OMAP_NAND_IO_READ = 0, /* read */
130 OMAP_NAND_IO_WRITE, /* write */
131 } iomode;
132 u_char *buf;
133 int buf_len;
132}; 134};
133 135
134/** 136/**
@@ -256,7 +258,8 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
256 } 258 }
257 259
258 /* configure and start prefetch transfer */ 260 /* configure and start prefetch transfer */
259 ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); 261 ret = gpmc_prefetch_enable(info->gpmc_cs,
262 PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x0);
260 if (ret) { 263 if (ret) {
261 /* PFPW engine is busy, use cpu copy method */ 264 /* PFPW engine is busy, use cpu copy method */
262 if (info->nand.options & NAND_BUSWIDTH_16) 265 if (info->nand.options & NAND_BUSWIDTH_16)
@@ -288,9 +291,10 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
288{ 291{
289 struct omap_nand_info *info = container_of(mtd, 292 struct omap_nand_info *info = container_of(mtd,
290 struct omap_nand_info, mtd); 293 struct omap_nand_info, mtd);
291 uint32_t pref_count = 0, w_count = 0; 294 uint32_t w_count = 0;
292 int i = 0, ret = 0; 295 int i = 0, ret = 0;
293 u16 *p; 296 u16 *p;
297 unsigned long tim, limit;
294 298
295 /* take care of subpage writes */ 299 /* take care of subpage writes */
296 if (len % 2 != 0) { 300 if (len % 2 != 0) {
@@ -300,7 +304,8 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
300 } 304 }
301 305
302 /* configure and start prefetch transfer */ 306 /* configure and start prefetch transfer */
303 ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x1); 307 ret = gpmc_prefetch_enable(info->gpmc_cs,
308 PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1);
304 if (ret) { 309 if (ret) {
305 /* PFPW engine is busy, use cpu copy method */ 310 /* PFPW engine is busy, use cpu copy method */
306 if (info->nand.options & NAND_BUSWIDTH_16) 311 if (info->nand.options & NAND_BUSWIDTH_16)
@@ -316,15 +321,17 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
316 iowrite16(*p++, info->nand.IO_ADDR_W); 321 iowrite16(*p++, info->nand.IO_ADDR_W);
317 } 322 }
318 /* wait for data to flushed-out before reset the prefetch */ 323 /* wait for data to flushed-out before reset the prefetch */
319 do { 324 tim = 0;
320 pref_count = gpmc_read_status(GPMC_PREFETCH_COUNT); 325 limit = (loops_per_jiffy *
321 } while (pref_count); 326 msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
327 while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit))
328 cpu_relax();
329
322 /* disable and stop the PFPW engine */ 330 /* disable and stop the PFPW engine */
323 gpmc_prefetch_reset(info->gpmc_cs); 331 gpmc_prefetch_reset(info->gpmc_cs);
324 } 332 }
325} 333}
326 334
327#ifdef CONFIG_MTD_NAND_OMAP_PREFETCH_DMA
328/* 335/*
329 * omap_nand_dma_cb: callback on the completion of dma transfer 336 * omap_nand_dma_cb: callback on the completion of dma transfer
330 * @lch: logical channel 337 * @lch: logical channel
@@ -348,14 +355,15 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
348{ 355{
349 struct omap_nand_info *info = container_of(mtd, 356 struct omap_nand_info *info = container_of(mtd,
350 struct omap_nand_info, mtd); 357 struct omap_nand_info, mtd);
351 uint32_t prefetch_status = 0;
352 enum dma_data_direction dir = is_write ? DMA_TO_DEVICE : 358 enum dma_data_direction dir = is_write ? DMA_TO_DEVICE :
353 DMA_FROM_DEVICE; 359 DMA_FROM_DEVICE;
354 dma_addr_t dma_addr; 360 dma_addr_t dma_addr;
355 int ret; 361 int ret;
362 unsigned long tim, limit;
356 363
357 /* The fifo depth is 64 bytes. We have a sync at each frame and frame 364 /* The fifo depth is 64 bytes max.
358 * length is 64 bytes. 365 * But configure the FIFO-threahold to 32 to get a sync at each frame
366 * and frame length is 32 bytes.
359 */ 367 */
360 int buf_len = len >> 6; 368 int buf_len = len >> 6;
361 369
@@ -396,9 +404,10 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
396 OMAP24XX_DMA_GPMC, OMAP_DMA_SRC_SYNC); 404 OMAP24XX_DMA_GPMC, OMAP_DMA_SRC_SYNC);
397 } 405 }
398 /* configure and start prefetch transfer */ 406 /* configure and start prefetch transfer */
399 ret = gpmc_prefetch_enable(info->gpmc_cs, 0x1, len, is_write); 407 ret = gpmc_prefetch_enable(info->gpmc_cs,
408 PREFETCH_FIFOTHRESHOLD_MAX, 0x1, len, is_write);
400 if (ret) 409 if (ret)
401 /* PFPW engine is busy, use cpu copy methode */ 410 /* PFPW engine is busy, use cpu copy method */
402 goto out_copy; 411 goto out_copy;
403 412
404 init_completion(&info->comp); 413 init_completion(&info->comp);
@@ -407,10 +416,11 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
407 416
408 /* setup and start DMA using dma_addr */ 417 /* setup and start DMA using dma_addr */
409 wait_for_completion(&info->comp); 418 wait_for_completion(&info->comp);
419 tim = 0;
420 limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
421 while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit))
422 cpu_relax();
410 423
411 do {
412 prefetch_status = gpmc_read_status(GPMC_PREFETCH_COUNT);
413 } while (prefetch_status);
414 /* disable and stop the PFPW engine */ 424 /* disable and stop the PFPW engine */
415 gpmc_prefetch_reset(info->gpmc_cs); 425 gpmc_prefetch_reset(info->gpmc_cs);
416 426
@@ -426,14 +436,6 @@ out_copy:
426 : omap_write_buf8(mtd, (u_char *) addr, len); 436 : omap_write_buf8(mtd, (u_char *) addr, len);
427 return 0; 437 return 0;
428} 438}
429#else
430static void omap_nand_dma_cb(int lch, u16 ch_status, void *data) {}
431static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
432 unsigned int len, int is_write)
433{
434 return 0;
435}
436#endif
437 439
438/** 440/**
439 * omap_read_buf_dma_pref - read data from NAND controller into buffer 441 * omap_read_buf_dma_pref - read data from NAND controller into buffer
@@ -466,6 +468,157 @@ static void omap_write_buf_dma_pref(struct mtd_info *mtd,
466 omap_nand_dma_transfer(mtd, (u_char *) buf, len, 0x1); 468 omap_nand_dma_transfer(mtd, (u_char *) buf, len, 0x1);
467} 469}
468 470
471/*
472 * omap_nand_irq - GMPC irq handler
473 * @this_irq: gpmc irq number
474 * @dev: omap_nand_info structure pointer is passed here
475 */
476static irqreturn_t omap_nand_irq(int this_irq, void *dev)
477{
478 struct omap_nand_info *info = (struct omap_nand_info *) dev;
479 u32 bytes;
480 u32 irq_stat;
481
482 irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
483 bytes = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
484 bytes = bytes & 0xFFFC; /* io in multiple of 4 bytes */
485 if (info->iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
486 if (irq_stat & 0x2)
487 goto done;
488
489 if (info->buf_len && (info->buf_len < bytes))
490 bytes = info->buf_len;
491 else if (!info->buf_len)
492 bytes = 0;
493 iowrite32_rep(info->nand.IO_ADDR_W,
494 (u32 *)info->buf, bytes >> 2);
495 info->buf = info->buf + bytes;
496 info->buf_len -= bytes;
497
498 } else {
499 ioread32_rep(info->nand.IO_ADDR_R,
500 (u32 *)info->buf, bytes >> 2);
501 info->buf = info->buf + bytes;
502
503 if (irq_stat & 0x2)
504 goto done;
505 }
506 gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
507
508 return IRQ_HANDLED;
509
510done:
511 complete(&info->comp);
512 /* disable irq */
513 gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ, 0);
514
515 /* clear status */
516 gpmc_cs_configure(info->gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
517
518 return IRQ_HANDLED;
519}
520
521/*
522 * omap_read_buf_irq_pref - read data from NAND controller into buffer
523 * @mtd: MTD device structure
524 * @buf: buffer to store date
525 * @len: number of bytes to read
526 */
527static void omap_read_buf_irq_pref(struct mtd_info *mtd, u_char *buf, int len)
528{
529 struct omap_nand_info *info = container_of(mtd,
530 struct omap_nand_info, mtd);
531 int ret = 0;
532
533 if (len <= mtd->oobsize) {
534 omap_read_buf_pref(mtd, buf, len);
535 return;
536 }
537
538 info->iomode = OMAP_NAND_IO_READ;
539 info->buf = buf;
540 init_completion(&info->comp);
541
542 /* configure and start prefetch transfer */
543 ret = gpmc_prefetch_enable(info->gpmc_cs,
544 PREFETCH_FIFOTHRESHOLD_MAX/2, 0x0, len, 0x0);
545 if (ret)
546 /* PFPW engine is busy, use cpu copy method */
547 goto out_copy;
548
549 info->buf_len = len;
550 /* enable irq */
551 gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ,
552 (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
553
554 /* waiting for read to complete */
555 wait_for_completion(&info->comp);
556
557 /* disable and stop the PFPW engine */
558 gpmc_prefetch_reset(info->gpmc_cs);
559 return;
560
561out_copy:
562 if (info->nand.options & NAND_BUSWIDTH_16)
563 omap_read_buf16(mtd, buf, len);
564 else
565 omap_read_buf8(mtd, buf, len);
566}
567
568/*
569 * omap_write_buf_irq_pref - write buffer to NAND controller
570 * @mtd: MTD device structure
571 * @buf: data buffer
572 * @len: number of bytes to write
573 */
574static void omap_write_buf_irq_pref(struct mtd_info *mtd,
575 const u_char *buf, int len)
576{
577 struct omap_nand_info *info = container_of(mtd,
578 struct omap_nand_info, mtd);
579 int ret = 0;
580 unsigned long tim, limit;
581
582 if (len <= mtd->oobsize) {
583 omap_write_buf_pref(mtd, buf, len);
584 return;
585 }
586
587 info->iomode = OMAP_NAND_IO_WRITE;
588 info->buf = (u_char *) buf;
589 init_completion(&info->comp);
590
591 /* configure and start prefetch transfer : size=24 */
592 ret = gpmc_prefetch_enable(info->gpmc_cs,
593 (PREFETCH_FIFOTHRESHOLD_MAX * 3) / 8, 0x0, len, 0x1);
594 if (ret)
595 /* PFPW engine is busy, use cpu copy method */
596 goto out_copy;
597
598 info->buf_len = len;
599 /* enable irq */
600 gpmc_cs_configure(info->gpmc_cs, GPMC_ENABLE_IRQ,
601 (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
602
603 /* waiting for write to complete */
604 wait_for_completion(&info->comp);
605 /* wait for data to flushed-out before reset the prefetch */
606 tim = 0;
607 limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
608 while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit))
609 cpu_relax();
610
611 /* disable and stop the PFPW engine */
612 gpmc_prefetch_reset(info->gpmc_cs);
613 return;
614
615out_copy:
616 if (info->nand.options & NAND_BUSWIDTH_16)
617 omap_write_buf16(mtd, buf, len);
618 else
619 omap_write_buf8(mtd, buf, len);
620}
621
469/** 622/**
470 * omap_verify_buf - Verify chip data against buffer 623 * omap_verify_buf - Verify chip data against buffer
471 * @mtd: MTD device structure 624 * @mtd: MTD device structure
@@ -487,8 +640,6 @@ static int omap_verify_buf(struct mtd_info *mtd, const u_char * buf, int len)
487 return 0; 640 return 0;
488} 641}
489 642
490#ifdef CONFIG_MTD_NAND_OMAP_HWECC
491
492/** 643/**
493 * gen_true_ecc - This function will generate true ECC value 644 * gen_true_ecc - This function will generate true ECC value
494 * @ecc_buf: buffer to store ecc code 645 * @ecc_buf: buffer to store ecc code
@@ -708,8 +859,6 @@ static void omap_enable_hwecc(struct mtd_info *mtd, int mode)
708 gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size); 859 gpmc_enable_hwecc(info->gpmc_cs, mode, dev_width, info->nand.ecc.size);
709} 860}
710 861
711#endif
712
713/** 862/**
714 * omap_wait - wait until the command is done 863 * omap_wait - wait until the command is done
715 * @mtd: MTD device structure 864 * @mtd: MTD device structure
@@ -779,6 +928,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
779 struct omap_nand_info *info; 928 struct omap_nand_info *info;
780 struct omap_nand_platform_data *pdata; 929 struct omap_nand_platform_data *pdata;
781 int err; 930 int err;
931 int i, offset;
782 932
783 pdata = pdev->dev.platform_data; 933 pdata = pdev->dev.platform_data;
784 if (pdata == NULL) { 934 if (pdata == NULL) {
@@ -804,7 +954,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
804 info->mtd.name = dev_name(&pdev->dev); 954 info->mtd.name = dev_name(&pdev->dev);
805 info->mtd.owner = THIS_MODULE; 955 info->mtd.owner = THIS_MODULE;
806 956
807 info->nand.options |= pdata->devsize ? NAND_BUSWIDTH_16 : 0; 957 info->nand.options = pdata->devsize;
808 info->nand.options |= NAND_SKIP_BBTSCAN; 958 info->nand.options |= NAND_SKIP_BBTSCAN;
809 959
810 /* NAND write protect off */ 960 /* NAND write protect off */
@@ -842,28 +992,13 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
842 info->nand.chip_delay = 50; 992 info->nand.chip_delay = 50;
843 } 993 }
844 994
845 if (use_prefetch) { 995 switch (pdata->xfer_type) {
846 996 case NAND_OMAP_PREFETCH_POLLED:
847 info->nand.read_buf = omap_read_buf_pref; 997 info->nand.read_buf = omap_read_buf_pref;
848 info->nand.write_buf = omap_write_buf_pref; 998 info->nand.write_buf = omap_write_buf_pref;
849 if (use_dma) { 999 break;
850 err = omap_request_dma(OMAP24XX_DMA_GPMC, "NAND", 1000
851 omap_nand_dma_cb, &info->comp, &info->dma_ch); 1001 case NAND_OMAP_POLLED:
852 if (err < 0) {
853 info->dma_ch = -1;
854 printk(KERN_WARNING "DMA request failed."
855 " Non-dma data transfer mode\n");
856 } else {
857 omap_set_dma_dest_burst_mode(info->dma_ch,
858 OMAP_DMA_DATA_BURST_16);
859 omap_set_dma_src_burst_mode(info->dma_ch,
860 OMAP_DMA_DATA_BURST_16);
861
862 info->nand.read_buf = omap_read_buf_dma_pref;
863 info->nand.write_buf = omap_write_buf_dma_pref;
864 }
865 }
866 } else {
867 if (info->nand.options & NAND_BUSWIDTH_16) { 1002 if (info->nand.options & NAND_BUSWIDTH_16) {
868 info->nand.read_buf = omap_read_buf16; 1003 info->nand.read_buf = omap_read_buf16;
869 info->nand.write_buf = omap_write_buf16; 1004 info->nand.write_buf = omap_write_buf16;
@@ -871,20 +1006,61 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
871 info->nand.read_buf = omap_read_buf8; 1006 info->nand.read_buf = omap_read_buf8;
872 info->nand.write_buf = omap_write_buf8; 1007 info->nand.write_buf = omap_write_buf8;
873 } 1008 }
1009 break;
1010
1011 case NAND_OMAP_PREFETCH_DMA:
1012 err = omap_request_dma(OMAP24XX_DMA_GPMC, "NAND",
1013 omap_nand_dma_cb, &info->comp, &info->dma_ch);
1014 if (err < 0) {
1015 info->dma_ch = -1;
1016 dev_err(&pdev->dev, "DMA request failed!\n");
1017 goto out_release_mem_region;
1018 } else {
1019 omap_set_dma_dest_burst_mode(info->dma_ch,
1020 OMAP_DMA_DATA_BURST_16);
1021 omap_set_dma_src_burst_mode(info->dma_ch,
1022 OMAP_DMA_DATA_BURST_16);
1023
1024 info->nand.read_buf = omap_read_buf_dma_pref;
1025 info->nand.write_buf = omap_write_buf_dma_pref;
1026 }
1027 break;
1028
1029 case NAND_OMAP_PREFETCH_IRQ:
1030 err = request_irq(pdata->gpmc_irq,
1031 omap_nand_irq, IRQF_SHARED, "gpmc-nand", info);
1032 if (err) {
1033 dev_err(&pdev->dev, "requesting irq(%d) error:%d",
1034 pdata->gpmc_irq, err);
1035 goto out_release_mem_region;
1036 } else {
1037 info->gpmc_irq = pdata->gpmc_irq;
1038 info->nand.read_buf = omap_read_buf_irq_pref;
1039 info->nand.write_buf = omap_write_buf_irq_pref;
1040 }
1041 break;
1042
1043 default:
1044 dev_err(&pdev->dev,
1045 "xfer_type(%d) not supported!\n", pdata->xfer_type);
1046 err = -EINVAL;
1047 goto out_release_mem_region;
874 } 1048 }
875 info->nand.verify_buf = omap_verify_buf;
876 1049
877#ifdef CONFIG_MTD_NAND_OMAP_HWECC 1050 info->nand.verify_buf = omap_verify_buf;
878 info->nand.ecc.bytes = 3;
879 info->nand.ecc.size = 512;
880 info->nand.ecc.calculate = omap_calculate_ecc;
881 info->nand.ecc.hwctl = omap_enable_hwecc;
882 info->nand.ecc.correct = omap_correct_data;
883 info->nand.ecc.mode = NAND_ECC_HW;
884 1051
885#else 1052 /* selsect the ecc type */
886 info->nand.ecc.mode = NAND_ECC_SOFT; 1053 if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_DEFAULT)
887#endif 1054 info->nand.ecc.mode = NAND_ECC_SOFT;
1055 else if ((pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW) ||
1056 (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE)) {
1057 info->nand.ecc.bytes = 3;
1058 info->nand.ecc.size = 512;
1059 info->nand.ecc.calculate = omap_calculate_ecc;
1060 info->nand.ecc.hwctl = omap_enable_hwecc;
1061 info->nand.ecc.correct = omap_correct_data;
1062 info->nand.ecc.mode = NAND_ECC_HW;
1063 }
888 1064
889 /* DIP switches on some boards change between 8 and 16 bit 1065 /* DIP switches on some boards change between 8 and 16 bit
890 * bus widths for flash. Try the other width if the first try fails. 1066 * bus widths for flash. Try the other width if the first try fails.
@@ -897,6 +1073,26 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
897 } 1073 }
898 } 1074 }
899 1075
1076 /* rom code layout */
1077 if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE) {
1078
1079 if (info->nand.options & NAND_BUSWIDTH_16)
1080 offset = 2;
1081 else {
1082 offset = 1;
1083 info->nand.badblock_pattern = &bb_descrip_flashbased;
1084 }
1085 omap_oobinfo.eccbytes = 3 * (info->mtd.oobsize/16);
1086 for (i = 0; i < omap_oobinfo.eccbytes; i++)
1087 omap_oobinfo.eccpos[i] = i+offset;
1088
1089 omap_oobinfo.oobfree->offset = offset + omap_oobinfo.eccbytes;
1090 omap_oobinfo.oobfree->length = info->mtd.oobsize -
1091 (offset + omap_oobinfo.eccbytes);
1092
1093 info->nand.ecc.layout = &omap_oobinfo;
1094 }
1095
900#ifdef CONFIG_MTD_PARTITIONS 1096#ifdef CONFIG_MTD_PARTITIONS
901 err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); 1097 err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
902 if (err > 0) 1098 if (err > 0)
@@ -926,9 +1122,12 @@ static int omap_nand_remove(struct platform_device *pdev)
926 mtd); 1122 mtd);
927 1123
928 platform_set_drvdata(pdev, NULL); 1124 platform_set_drvdata(pdev, NULL);
929 if (use_dma) 1125 if (info->dma_ch != -1)
930 omap_free_dma(info->dma_ch); 1126 omap_free_dma(info->dma_ch);
931 1127
1128 if (info->gpmc_irq)
1129 free_irq(info->gpmc_irq, info);
1130
932 /* Release NAND device, its internal structures and partitions */ 1131 /* Release NAND device, its internal structures and partitions */
933 nand_release(&info->mtd); 1132 nand_release(&info->mtd);
934 iounmap(info->nand.IO_ADDR_R); 1133 iounmap(info->nand.IO_ADDR_R);
@@ -947,16 +1146,8 @@ static struct platform_driver omap_nand_driver = {
947 1146
948static int __init omap_nand_init(void) 1147static int __init omap_nand_init(void)
949{ 1148{
950 printk(KERN_INFO "%s driver initializing\n", DRIVER_NAME); 1149 pr_info("%s driver initializing\n", DRIVER_NAME);
951 1150
952 /* This check is required if driver is being
953 * loaded run time as a module
954 */
955 if ((1 == use_dma) && (0 == use_prefetch)) {
956 printk(KERN_INFO"Wrong parameters: 'use_dma' can not be 1 "
957 "without use_prefetch'. Prefetch will not be"
958 " used in either mode (mpu or dma)\n");
959 }
960 return platform_driver_register(&omap_nand_driver); 1151 return platform_driver_register(&omap_nand_driver);
961} 1152}
962 1153
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index ac31f461cc1c..ec26399e3cf2 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -63,7 +63,7 @@ struct omap2_onenand {
63 struct completion dma_done; 63 struct completion dma_done;
64 int dma_channel; 64 int dma_channel;
65 int freq; 65 int freq;
66 int (*setup)(void __iomem *base, int freq); 66 int (*setup)(void __iomem *base, int *freq_ptr);
67 struct regulator *regulator; 67 struct regulator *regulator;
68}; 68};
69 69
@@ -148,11 +148,9 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
148 wait_err("controller error", state, ctrl, intr); 148 wait_err("controller error", state, ctrl, intr);
149 return -EIO; 149 return -EIO;
150 } 150 }
151 if ((intr & intr_flags) != intr_flags) { 151 if ((intr & intr_flags) == intr_flags)
152 wait_err("timeout", state, ctrl, intr); 152 return 0;
153 return -EIO; 153 /* Continue in wait for interrupt branch */
154 }
155 return 0;
156 } 154 }
157 155
158 if (state != FL_READING) { 156 if (state != FL_READING) {
@@ -581,7 +579,7 @@ static int __adjust_timing(struct device *dev, void *data)
581 579
582 /* DMA is not in use so this is all that is needed */ 580 /* DMA is not in use so this is all that is needed */
583 /* Revisit for OMAP3! */ 581 /* Revisit for OMAP3! */
584 ret = c->setup(c->onenand.base, c->freq); 582 ret = c->setup(c->onenand.base, &c->freq);
585 583
586 return ret; 584 return ret;
587} 585}
@@ -673,7 +671,7 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
673 } 671 }
674 672
675 if (pdata->onenand_setup != NULL) { 673 if (pdata->onenand_setup != NULL) {
676 r = pdata->onenand_setup(c->onenand.base, c->freq); 674 r = pdata->onenand_setup(c->onenand.base, &c->freq);
677 if (r < 0) { 675 if (r < 0) {
678 dev_err(&pdev->dev, "Onenand platform setup failed: " 676 dev_err(&pdev->dev, "Onenand platform setup failed: "
679 "%d\n", r); 677 "%d\n", r);
@@ -718,8 +716,8 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
718 } 716 }
719 717
720 dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual " 718 dev_info(&pdev->dev, "initializing on CS%d, phys base 0x%08lx, virtual "
721 "base %p\n", c->gpmc_cs, c->phys_base, 719 "base %p, freq %d MHz\n", c->gpmc_cs, c->phys_base,
722 c->onenand.base); 720 c->onenand.base, c->freq);
723 721
724 c->pdev = pdev; 722 c->pdev = pdev;
725 c->mtd.name = dev_name(&pdev->dev); 723 c->mtd.name = dev_name(&pdev->dev);
@@ -754,24 +752,6 @@ static int __devinit omap2_onenand_probe(struct platform_device *pdev)
754 if ((r = onenand_scan(&c->mtd, 1)) < 0) 752 if ((r = onenand_scan(&c->mtd, 1)) < 0)
755 goto err_release_regulator; 753 goto err_release_regulator;
756 754
757 switch ((c->onenand.version_id >> 4) & 0xf) {
758 case 0:
759 c->freq = 40;
760 break;
761 case 1:
762 c->freq = 54;
763 break;
764 case 2:
765 c->freq = 66;
766 break;
767 case 3:
768 c->freq = 83;
769 break;
770 case 4:
771 c->freq = 104;
772 break;
773 }
774
775#ifdef CONFIG_MTD_PARTITIONS 755#ifdef CONFIG_MTD_PARTITIONS
776 r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0); 756 r = parse_mtd_partitions(&c->mtd, part_probes, &c->parts, 0);
777 if (r > 0) 757 if (r > 0)
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index abb1ffbf3d20..36501adc125d 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2005, 2006 Nokia Corporation 4 * Copyright (C) 2005, 2006 Nokia Corporation
5 * Author: Samuel Ortiz <samuel.ortiz@nokia.com> and 5 * Author: Samuel Ortiz <samuel.ortiz@nokia.com> and
6 * Juha Yrjölä <juha.yrjola@nokia.com> 6 * Juha Yrj�l� <juha.yrjola@nokia.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -33,6 +33,7 @@
33#include <linux/clk.h> 33#include <linux/clk.h>
34#include <linux/io.h> 34#include <linux/io.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/pm_runtime.h>
36 37
37#include <linux/spi/spi.h> 38#include <linux/spi/spi.h>
38 39
@@ -46,7 +47,6 @@
46#define OMAP2_MCSPI_MAX_CTRL 4 47#define OMAP2_MCSPI_MAX_CTRL 4
47 48
48#define OMAP2_MCSPI_REVISION 0x00 49#define OMAP2_MCSPI_REVISION 0x00
49#define OMAP2_MCSPI_SYSCONFIG 0x10
50#define OMAP2_MCSPI_SYSSTATUS 0x14 50#define OMAP2_MCSPI_SYSSTATUS 0x14
51#define OMAP2_MCSPI_IRQSTATUS 0x18 51#define OMAP2_MCSPI_IRQSTATUS 0x18
52#define OMAP2_MCSPI_IRQENABLE 0x1c 52#define OMAP2_MCSPI_IRQENABLE 0x1c
@@ -63,13 +63,6 @@
63 63
64/* per-register bitmasks: */ 64/* per-register bitmasks: */
65 65
66#define OMAP2_MCSPI_SYSCONFIG_SMARTIDLE BIT(4)
67#define OMAP2_MCSPI_SYSCONFIG_ENAWAKEUP BIT(2)
68#define OMAP2_MCSPI_SYSCONFIG_AUTOIDLE BIT(0)
69#define OMAP2_MCSPI_SYSCONFIG_SOFTRESET BIT(1)
70
71#define OMAP2_MCSPI_SYSSTATUS_RESETDONE BIT(0)
72
73#define OMAP2_MCSPI_MODULCTRL_SINGLE BIT(0) 66#define OMAP2_MCSPI_MODULCTRL_SINGLE BIT(0)
74#define OMAP2_MCSPI_MODULCTRL_MS BIT(2) 67#define OMAP2_MCSPI_MODULCTRL_MS BIT(2)
75#define OMAP2_MCSPI_MODULCTRL_STEST BIT(3) 68#define OMAP2_MCSPI_MODULCTRL_STEST BIT(3)
@@ -122,13 +115,12 @@ struct omap2_mcspi {
122 spinlock_t lock; 115 spinlock_t lock;
123 struct list_head msg_queue; 116 struct list_head msg_queue;
124 struct spi_master *master; 117 struct spi_master *master;
125 struct clk *ick;
126 struct clk *fck;
127 /* Virtual base address of the controller */ 118 /* Virtual base address of the controller */
128 void __iomem *base; 119 void __iomem *base;
129 unsigned long phys; 120 unsigned long phys;
130 /* SPI1 has 4 channels, while SPI2 has 2 */ 121 /* SPI1 has 4 channels, while SPI2 has 2 */
131 struct omap2_mcspi_dma *dma_channels; 122 struct omap2_mcspi_dma *dma_channels;
123 struct device *dev;
132}; 124};
133 125
134struct omap2_mcspi_cs { 126struct omap2_mcspi_cs {
@@ -144,7 +136,6 @@ struct omap2_mcspi_cs {
144 * corresponding registers are modified. 136 * corresponding registers are modified.
145 */ 137 */
146struct omap2_mcspi_regs { 138struct omap2_mcspi_regs {
147 u32 sysconfig;
148 u32 modulctrl; 139 u32 modulctrl;
149 u32 wakeupenable; 140 u32 wakeupenable;
150 struct list_head cs; 141 struct list_head cs;
@@ -268,9 +259,6 @@ static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
268 mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL, 259 mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL,
269 omap2_mcspi_ctx[spi_cntrl->bus_num - 1].modulctrl); 260 omap2_mcspi_ctx[spi_cntrl->bus_num - 1].modulctrl);
270 261
271 mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_SYSCONFIG,
272 omap2_mcspi_ctx[spi_cntrl->bus_num - 1].sysconfig);
273
274 mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE, 262 mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE,
275 omap2_mcspi_ctx[spi_cntrl->bus_num - 1].wakeupenable); 263 omap2_mcspi_ctx[spi_cntrl->bus_num - 1].wakeupenable);
276 264
@@ -280,20 +268,12 @@ static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
280} 268}
281static void omap2_mcspi_disable_clocks(struct omap2_mcspi *mcspi) 269static void omap2_mcspi_disable_clocks(struct omap2_mcspi *mcspi)
282{ 270{
283 clk_disable(mcspi->ick); 271 pm_runtime_put_sync(mcspi->dev);
284 clk_disable(mcspi->fck);
285} 272}
286 273
287static int omap2_mcspi_enable_clocks(struct omap2_mcspi *mcspi) 274static int omap2_mcspi_enable_clocks(struct omap2_mcspi *mcspi)
288{ 275{
289 if (clk_enable(mcspi->ick)) 276 return pm_runtime_get_sync(mcspi->dev);
290 return -ENODEV;
291 if (clk_enable(mcspi->fck))
292 return -ENODEV;
293
294 omap2_mcspi_restore_ctx(mcspi);
295
296 return 0;
297} 277}
298 278
299static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit) 279static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit)
@@ -819,8 +799,9 @@ static int omap2_mcspi_setup(struct spi_device *spi)
819 return ret; 799 return ret;
820 } 800 }
821 801
822 if (omap2_mcspi_enable_clocks(mcspi)) 802 ret = omap2_mcspi_enable_clocks(mcspi);
823 return -ENODEV; 803 if (ret < 0)
804 return ret;
824 805
825 ret = omap2_mcspi_setup_transfer(spi, NULL); 806 ret = omap2_mcspi_setup_transfer(spi, NULL);
826 omap2_mcspi_disable_clocks(mcspi); 807 omap2_mcspi_disable_clocks(mcspi);
@@ -863,10 +844,11 @@ static void omap2_mcspi_work(struct work_struct *work)
863 struct omap2_mcspi *mcspi; 844 struct omap2_mcspi *mcspi;
864 845
865 mcspi = container_of(work, struct omap2_mcspi, work); 846 mcspi = container_of(work, struct omap2_mcspi, work);
866 spin_lock_irq(&mcspi->lock);
867 847
868 if (omap2_mcspi_enable_clocks(mcspi)) 848 if (omap2_mcspi_enable_clocks(mcspi) < 0)
869 goto out; 849 return;
850
851 spin_lock_irq(&mcspi->lock);
870 852
871 /* We only enable one channel at a time -- the one whose message is 853 /* We only enable one channel at a time -- the one whose message is
872 * at the head of the queue -- although this controller would gladly 854 * at the head of the queue -- although this controller would gladly
@@ -979,10 +961,9 @@ static void omap2_mcspi_work(struct work_struct *work)
979 spin_lock_irq(&mcspi->lock); 961 spin_lock_irq(&mcspi->lock);
980 } 962 }
981 963
982 omap2_mcspi_disable_clocks(mcspi);
983
984out:
985 spin_unlock_irq(&mcspi->lock); 964 spin_unlock_irq(&mcspi->lock);
965
966 omap2_mcspi_disable_clocks(mcspi);
986} 967}
987 968
988static int omap2_mcspi_transfer(struct spi_device *spi, struct spi_message *m) 969static int omap2_mcspi_transfer(struct spi_device *spi, struct spi_message *m)
@@ -1058,25 +1039,15 @@ static int omap2_mcspi_transfer(struct spi_device *spi, struct spi_message *m)
1058 return 0; 1039 return 0;
1059} 1040}
1060 1041
1061static int __init omap2_mcspi_reset(struct omap2_mcspi *mcspi) 1042static int __init omap2_mcspi_master_setup(struct omap2_mcspi *mcspi)
1062{ 1043{
1063 struct spi_master *master = mcspi->master; 1044 struct spi_master *master = mcspi->master;
1064 u32 tmp; 1045 u32 tmp;
1046 int ret = 0;
1065 1047
1066 if (omap2_mcspi_enable_clocks(mcspi)) 1048 ret = omap2_mcspi_enable_clocks(mcspi);
1067 return -1; 1049 if (ret < 0)
1068 1050 return ret;
1069 mcspi_write_reg(master, OMAP2_MCSPI_SYSCONFIG,
1070 OMAP2_MCSPI_SYSCONFIG_SOFTRESET);
1071 do {
1072 tmp = mcspi_read_reg(master, OMAP2_MCSPI_SYSSTATUS);
1073 } while (!(tmp & OMAP2_MCSPI_SYSSTATUS_RESETDONE));
1074
1075 tmp = OMAP2_MCSPI_SYSCONFIG_AUTOIDLE |
1076 OMAP2_MCSPI_SYSCONFIG_ENAWAKEUP |
1077 OMAP2_MCSPI_SYSCONFIG_SMARTIDLE;
1078 mcspi_write_reg(master, OMAP2_MCSPI_SYSCONFIG, tmp);
1079 omap2_mcspi_ctx[master->bus_num - 1].sysconfig = tmp;
1080 1051
1081 tmp = OMAP2_MCSPI_WAKEUPENABLE_WKEN; 1052 tmp = OMAP2_MCSPI_WAKEUPENABLE_WKEN;
1082 mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE, tmp); 1053 mcspi_write_reg(master, OMAP2_MCSPI_WAKEUPENABLE, tmp);
@@ -1087,91 +1058,26 @@ static int __init omap2_mcspi_reset(struct omap2_mcspi *mcspi)
1087 return 0; 1058 return 0;
1088} 1059}
1089 1060
1090static u8 __initdata spi1_rxdma_id [] = { 1061static int omap_mcspi_runtime_resume(struct device *dev)
1091 OMAP24XX_DMA_SPI1_RX0, 1062{
1092 OMAP24XX_DMA_SPI1_RX1, 1063 struct omap2_mcspi *mcspi;
1093 OMAP24XX_DMA_SPI1_RX2, 1064 struct spi_master *master;
1094 OMAP24XX_DMA_SPI1_RX3,
1095};
1096
1097static u8 __initdata spi1_txdma_id [] = {
1098 OMAP24XX_DMA_SPI1_TX0,
1099 OMAP24XX_DMA_SPI1_TX1,
1100 OMAP24XX_DMA_SPI1_TX2,
1101 OMAP24XX_DMA_SPI1_TX3,
1102};
1103
1104static u8 __initdata spi2_rxdma_id[] = {
1105 OMAP24XX_DMA_SPI2_RX0,
1106 OMAP24XX_DMA_SPI2_RX1,
1107};
1108
1109static u8 __initdata spi2_txdma_id[] = {
1110 OMAP24XX_DMA_SPI2_TX0,
1111 OMAP24XX_DMA_SPI2_TX1,
1112};
1113
1114#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \
1115 || defined(CONFIG_ARCH_OMAP4)
1116static u8 __initdata spi3_rxdma_id[] = {
1117 OMAP24XX_DMA_SPI3_RX0,
1118 OMAP24XX_DMA_SPI3_RX1,
1119};
1120 1065
1121static u8 __initdata spi3_txdma_id[] = { 1066 master = dev_get_drvdata(dev);
1122 OMAP24XX_DMA_SPI3_TX0, 1067 mcspi = spi_master_get_devdata(master);
1123 OMAP24XX_DMA_SPI3_TX1, 1068 omap2_mcspi_restore_ctx(mcspi);
1124};
1125#endif
1126 1069
1127#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4) 1070 return 0;
1128static u8 __initdata spi4_rxdma_id[] = { 1071}
1129 OMAP34XX_DMA_SPI4_RX0,
1130};
1131 1072
1132static u8 __initdata spi4_txdma_id[] = {
1133 OMAP34XX_DMA_SPI4_TX0,
1134};
1135#endif
1136 1073
1137static int __init omap2_mcspi_probe(struct platform_device *pdev) 1074static int __init omap2_mcspi_probe(struct platform_device *pdev)
1138{ 1075{
1139 struct spi_master *master; 1076 struct spi_master *master;
1077 struct omap2_mcspi_platform_config *pdata = pdev->dev.platform_data;
1140 struct omap2_mcspi *mcspi; 1078 struct omap2_mcspi *mcspi;
1141 struct resource *r; 1079 struct resource *r;
1142 int status = 0, i; 1080 int status = 0, i;
1143 const u8 *rxdma_id, *txdma_id;
1144 unsigned num_chipselect;
1145
1146 switch (pdev->id) {
1147 case 1:
1148 rxdma_id = spi1_rxdma_id;
1149 txdma_id = spi1_txdma_id;
1150 num_chipselect = 4;
1151 break;
1152 case 2:
1153 rxdma_id = spi2_rxdma_id;
1154 txdma_id = spi2_txdma_id;
1155 num_chipselect = 2;
1156 break;
1157#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \
1158 || defined(CONFIG_ARCH_OMAP4)
1159 case 3:
1160 rxdma_id = spi3_rxdma_id;
1161 txdma_id = spi3_txdma_id;
1162 num_chipselect = 2;
1163 break;
1164#endif
1165#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
1166 case 4:
1167 rxdma_id = spi4_rxdma_id;
1168 txdma_id = spi4_txdma_id;
1169 num_chipselect = 1;
1170 break;
1171#endif
1172 default:
1173 return -EINVAL;
1174 }
1175 1081
1176 master = spi_alloc_master(&pdev->dev, sizeof *mcspi); 1082 master = spi_alloc_master(&pdev->dev, sizeof *mcspi);
1177 if (master == NULL) { 1083 if (master == NULL) {
@@ -1188,7 +1094,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
1188 master->setup = omap2_mcspi_setup; 1094 master->setup = omap2_mcspi_setup;
1189 master->transfer = omap2_mcspi_transfer; 1095 master->transfer = omap2_mcspi_transfer;
1190 master->cleanup = omap2_mcspi_cleanup; 1096 master->cleanup = omap2_mcspi_cleanup;
1191 master->num_chipselect = num_chipselect; 1097 master->num_chipselect = pdata->num_cs;
1192 1098
1193 dev_set_drvdata(&pdev->dev, master); 1099 dev_set_drvdata(&pdev->dev, master);
1194 1100
@@ -1206,49 +1112,62 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
1206 goto err1; 1112 goto err1;
1207 } 1113 }
1208 1114
1115 r->start += pdata->regs_offset;
1116 r->end += pdata->regs_offset;
1209 mcspi->phys = r->start; 1117 mcspi->phys = r->start;
1210 mcspi->base = ioremap(r->start, r->end - r->start + 1); 1118 mcspi->base = ioremap(r->start, r->end - r->start + 1);
1211 if (!mcspi->base) { 1119 if (!mcspi->base) {
1212 dev_dbg(&pdev->dev, "can't ioremap MCSPI\n"); 1120 dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
1213 status = -ENOMEM; 1121 status = -ENOMEM;
1214 goto err1aa; 1122 goto err2;
1215 } 1123 }
1216 1124
1125 mcspi->dev = &pdev->dev;
1217 INIT_WORK(&mcspi->work, omap2_mcspi_work); 1126 INIT_WORK(&mcspi->work, omap2_mcspi_work);
1218 1127
1219 spin_lock_init(&mcspi->lock); 1128 spin_lock_init(&mcspi->lock);
1220 INIT_LIST_HEAD(&mcspi->msg_queue); 1129 INIT_LIST_HEAD(&mcspi->msg_queue);
1221 INIT_LIST_HEAD(&omap2_mcspi_ctx[master->bus_num - 1].cs); 1130 INIT_LIST_HEAD(&omap2_mcspi_ctx[master->bus_num - 1].cs);
1222 1131
1223 mcspi->ick = clk_get(&pdev->dev, "ick");
1224 if (IS_ERR(mcspi->ick)) {
1225 dev_dbg(&pdev->dev, "can't get mcspi_ick\n");
1226 status = PTR_ERR(mcspi->ick);
1227 goto err1a;
1228 }
1229 mcspi->fck = clk_get(&pdev->dev, "fck");
1230 if (IS_ERR(mcspi->fck)) {
1231 dev_dbg(&pdev->dev, "can't get mcspi_fck\n");
1232 status = PTR_ERR(mcspi->fck);
1233 goto err2;
1234 }
1235
1236 mcspi->dma_channels = kcalloc(master->num_chipselect, 1132 mcspi->dma_channels = kcalloc(master->num_chipselect,
1237 sizeof(struct omap2_mcspi_dma), 1133 sizeof(struct omap2_mcspi_dma),
1238 GFP_KERNEL); 1134 GFP_KERNEL);
1239 1135
1240 if (mcspi->dma_channels == NULL) 1136 if (mcspi->dma_channels == NULL)
1241 goto err3; 1137 goto err2;
1138
1139 for (i = 0; i < master->num_chipselect; i++) {
1140 char dma_ch_name[14];
1141 struct resource *dma_res;
1142
1143 sprintf(dma_ch_name, "rx%d", i);
1144 dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
1145 dma_ch_name);
1146 if (!dma_res) {
1147 dev_dbg(&pdev->dev, "cannot get DMA RX channel\n");
1148 status = -ENODEV;
1149 break;
1150 }
1242 1151
1243 for (i = 0; i < num_chipselect; i++) {
1244 mcspi->dma_channels[i].dma_rx_channel = -1; 1152 mcspi->dma_channels[i].dma_rx_channel = -1;
1245 mcspi->dma_channels[i].dma_rx_sync_dev = rxdma_id[i]; 1153 mcspi->dma_channels[i].dma_rx_sync_dev = dma_res->start;
1154 sprintf(dma_ch_name, "tx%d", i);
1155 dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
1156 dma_ch_name);
1157 if (!dma_res) {
1158 dev_dbg(&pdev->dev, "cannot get DMA TX channel\n");
1159 status = -ENODEV;
1160 break;
1161 }
1162
1246 mcspi->dma_channels[i].dma_tx_channel = -1; 1163 mcspi->dma_channels[i].dma_tx_channel = -1;
1247 mcspi->dma_channels[i].dma_tx_sync_dev = txdma_id[i]; 1164 mcspi->dma_channels[i].dma_tx_sync_dev = dma_res->start;
1248 } 1165 }
1249 1166
1250 if (omap2_mcspi_reset(mcspi) < 0) 1167 pm_runtime_enable(&pdev->dev);
1251 goto err4; 1168
1169 if (status || omap2_mcspi_master_setup(mcspi) < 0)
1170 goto err3;
1252 1171
1253 status = spi_register_master(master); 1172 status = spi_register_master(master);
1254 if (status < 0) 1173 if (status < 0)
@@ -1257,17 +1176,13 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
1257 return status; 1176 return status;
1258 1177
1259err4: 1178err4:
1260 kfree(mcspi->dma_channels); 1179 spi_master_put(master);
1261err3: 1180err3:
1262 clk_put(mcspi->fck); 1181 kfree(mcspi->dma_channels);
1263err2: 1182err2:
1264 clk_put(mcspi->ick);
1265err1a:
1266 iounmap(mcspi->base);
1267err1aa:
1268 release_mem_region(r->start, (r->end - r->start) + 1); 1183 release_mem_region(r->start, (r->end - r->start) + 1);
1184 iounmap(mcspi->base);
1269err1: 1185err1:
1270 spi_master_put(master);
1271 return status; 1186 return status;
1272} 1187}
1273 1188
@@ -1283,9 +1198,7 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
1283 mcspi = spi_master_get_devdata(master); 1198 mcspi = spi_master_get_devdata(master);
1284 dma_channels = mcspi->dma_channels; 1199 dma_channels = mcspi->dma_channels;
1285 1200
1286 clk_put(mcspi->fck); 1201 omap2_mcspi_disable_clocks(mcspi);
1287 clk_put(mcspi->ick);
1288
1289 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1202 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1290 release_mem_region(r->start, (r->end - r->start) + 1); 1203 release_mem_region(r->start, (r->end - r->start) + 1);
1291 1204
@@ -1336,6 +1249,7 @@ static int omap2_mcspi_resume(struct device *dev)
1336 1249
1337static const struct dev_pm_ops omap2_mcspi_pm_ops = { 1250static const struct dev_pm_ops omap2_mcspi_pm_ops = {
1338 .resume = omap2_mcspi_resume, 1251 .resume = omap2_mcspi_resume,
1252 .runtime_resume = omap_mcspi_runtime_resume,
1339}; 1253};
1340 1254
1341static struct platform_driver omap2_mcspi_driver = { 1255static struct platform_driver omap2_mcspi_driver = {
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index c292d5c499e7..e550f35eff0f 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1530,7 +1530,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
1530 1530
1531/*-------------------------------------------------------------------------*/ 1531/*-------------------------------------------------------------------------*/
1532 1532
1533#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) || \ 1533#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430) || \
1534 defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_ARCH_U8500) || \ 1534 defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_ARCH_U8500) || \
1535 defined(CONFIG_ARCH_U5500) 1535 defined(CONFIG_ARCH_U5500)
1536 1536
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index e6400be8a0f8..3fb617ef9e72 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -212,8 +212,8 @@ enum musb_g_ep0_state {
212 * directly with the "flat" model, or after setting up an index register. 212 * directly with the "flat" model, or after setting up an index register.
213 */ 213 */
214 214
215#if defined(CONFIG_ARCH_DAVINCI) || defined(CONFIG_ARCH_OMAP2430) \ 215#if defined(CONFIG_ARCH_DAVINCI) || defined(CONFIG_SOC_OMAP2430) \
216 || defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_BLACKFIN) \ 216 || defined(CONFIG_SOC_OMAP3430) || defined(CONFIG_BLACKFIN) \
217 || defined(CONFIG_ARCH_OMAP4) 217 || defined(CONFIG_ARCH_OMAP4)
218/* REVISIT indexed access seemed to 218/* REVISIT indexed access seemed to
219 * misbehave (on DaVinci) for at least peripheral IN ... 219 * misbehave (on DaVinci) for at least peripheral IN ...
@@ -358,7 +358,7 @@ struct musb_csr_regs {
358 358
359struct musb_context_registers { 359struct musb_context_registers {
360 360
361#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \ 361#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
362 defined(CONFIG_ARCH_OMAP4) 362 defined(CONFIG_ARCH_OMAP4)
363 u32 otg_sysconfig, otg_forcestandby; 363 u32 otg_sysconfig, otg_forcestandby;
364#endif 364#endif
diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h
index 21056c924c74..320fd4afb93f 100644
--- a/drivers/usb/musb/musbhsdma.h
+++ b/drivers/usb/musb/musbhsdma.h
@@ -31,7 +31,7 @@
31 * 31 *
32 */ 32 */
33 33
34#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430) 34#if defined(CONFIG_SOC_OMAP2430) || defined(CONFIG_SOC_OMAP3430)
35#include "omap2430.h" 35#include "omap2430.h"
36#endif 36#endif
37 37
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
index e00fa1b22ecd..8c6fdef61d1c 100644
--- a/drivers/usb/otg/isp1301_omap.c
+++ b/drivers/usb/otg/isp1301_omap.c
@@ -1510,7 +1510,7 @@ isp1301_start_hnp(struct otg_transceiver *dev)
1510 1510
1511/*-------------------------------------------------------------------------*/ 1511/*-------------------------------------------------------------------------*/
1512 1512
1513static int __init 1513static int __devinit
1514isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id) 1514isp1301_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
1515{ 1515{
1516 int status; 1516 int status;
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig
index 80b3b123dd7f..7c608c5ccf84 100644
--- a/drivers/w1/masters/Kconfig
+++ b/drivers/w1/masters/Kconfig
@@ -60,7 +60,7 @@ config W1_MASTER_GPIO
60 60
61config HDQ_MASTER_OMAP 61config HDQ_MASTER_OMAP
62 tristate "OMAP HDQ driver" 62 tristate "OMAP HDQ driver"
63 depends on ARCH_OMAP2430 || ARCH_OMAP3 63 depends on SOC_OMAP2430 || ARCH_OMAP3
64 help 64 help
65 Say Y here if you want support for the 1-wire or HDQ Interface 65 Say Y here if you want support for the 1-wire or HDQ Interface
66 on an OMAP processor. 66 on an OMAP processor.
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 3dd4971160ef..2b4acb86c191 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -124,6 +124,8 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev)
124 u32 pre_margin = GET_WLDR_VAL(timer_margin); 124 u32 pre_margin = GET_WLDR_VAL(timer_margin);
125 void __iomem *base = wdev->base; 125 void __iomem *base = wdev->base;
126 126
127 pm_runtime_get_sync(wdev->dev);
128
127 /* just count up at 32 KHz */ 129 /* just count up at 32 KHz */
128 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) 130 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04)
129 cpu_relax(); 131 cpu_relax();
@@ -131,6 +133,8 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev)
131 __raw_writel(pre_margin, base + OMAP_WATCHDOG_LDR); 133 __raw_writel(pre_margin, base + OMAP_WATCHDOG_LDR);
132 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) 134 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04)
133 cpu_relax(); 135 cpu_relax();
136
137 pm_runtime_put_sync(wdev->dev);
134} 138}
135 139
136/* 140/*
@@ -160,6 +164,8 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
160 omap_wdt_ping(wdev); /* trigger loading of new timeout value */ 164 omap_wdt_ping(wdev); /* trigger loading of new timeout value */
161 omap_wdt_enable(wdev); 165 omap_wdt_enable(wdev);
162 166
167 pm_runtime_put_sync(wdev->dev);
168
163 return nonseekable_open(inode, file); 169 return nonseekable_open(inode, file);
164} 170}
165 171
@@ -171,6 +177,7 @@ static int omap_wdt_release(struct inode *inode, struct file *file)
171 * Shut off the timer unless NOWAYOUT is defined. 177 * Shut off the timer unless NOWAYOUT is defined.
172 */ 178 */
173#ifndef CONFIG_WATCHDOG_NOWAYOUT 179#ifndef CONFIG_WATCHDOG_NOWAYOUT
180 pm_runtime_get_sync(wdev->dev);
174 181
175 omap_wdt_disable(wdev); 182 omap_wdt_disable(wdev);
176 183
@@ -190,9 +197,11 @@ static ssize_t omap_wdt_write(struct file *file, const char __user *data,
190 197
191 /* Refresh LOAD_TIME. */ 198 /* Refresh LOAD_TIME. */
192 if (len) { 199 if (len) {
200 pm_runtime_get_sync(wdev->dev);
193 spin_lock(&wdt_lock); 201 spin_lock(&wdt_lock);
194 omap_wdt_ping(wdev); 202 omap_wdt_ping(wdev);
195 spin_unlock(&wdt_lock); 203 spin_unlock(&wdt_lock);
204 pm_runtime_put_sync(wdev->dev);
196 } 205 }
197 return len; 206 return len;
198} 207}
@@ -224,15 +233,18 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
224 return put_user(omap_prcm_get_reset_sources(), 233 return put_user(omap_prcm_get_reset_sources(),
225 (int __user *)arg); 234 (int __user *)arg);
226 case WDIOC_KEEPALIVE: 235 case WDIOC_KEEPALIVE:
236 pm_runtime_get_sync(wdev->dev);
227 spin_lock(&wdt_lock); 237 spin_lock(&wdt_lock);
228 omap_wdt_ping(wdev); 238 omap_wdt_ping(wdev);
229 spin_unlock(&wdt_lock); 239 spin_unlock(&wdt_lock);
240 pm_runtime_put_sync(wdev->dev);
230 return 0; 241 return 0;
231 case WDIOC_SETTIMEOUT: 242 case WDIOC_SETTIMEOUT:
232 if (get_user(new_margin, (int __user *)arg)) 243 if (get_user(new_margin, (int __user *)arg))
233 return -EFAULT; 244 return -EFAULT;
234 omap_wdt_adjust_timeout(new_margin); 245 omap_wdt_adjust_timeout(new_margin);
235 246
247 pm_runtime_get_sync(wdev->dev);
236 spin_lock(&wdt_lock); 248 spin_lock(&wdt_lock);
237 omap_wdt_disable(wdev); 249 omap_wdt_disable(wdev);
238 omap_wdt_set_timeout(wdev); 250 omap_wdt_set_timeout(wdev);
@@ -240,6 +252,7 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
240 252
241 omap_wdt_ping(wdev); 253 omap_wdt_ping(wdev);
242 spin_unlock(&wdt_lock); 254 spin_unlock(&wdt_lock);
255 pm_runtime_put_sync(wdev->dev);
243 /* Fall */ 256 /* Fall */
244 case WDIOC_GETTIMEOUT: 257 case WDIOC_GETTIMEOUT:
245 return put_user(timer_margin, (int __user *)arg); 258 return put_user(timer_margin, (int __user *)arg);
@@ -345,8 +358,11 @@ static void omap_wdt_shutdown(struct platform_device *pdev)
345{ 358{
346 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); 359 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
347 360
348 if (wdev->omap_wdt_users) 361 if (wdev->omap_wdt_users) {
362 pm_runtime_get_sync(wdev->dev);
349 omap_wdt_disable(wdev); 363 omap_wdt_disable(wdev);
364 pm_runtime_put_sync(wdev->dev);
365 }
350} 366}
351 367
352static int __devexit omap_wdt_remove(struct platform_device *pdev) 368static int __devexit omap_wdt_remove(struct platform_device *pdev)
@@ -381,8 +397,11 @@ static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state)
381{ 397{
382 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); 398 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
383 399
384 if (wdev->omap_wdt_users) 400 if (wdev->omap_wdt_users) {
401 pm_runtime_get_sync(wdev->dev);
385 omap_wdt_disable(wdev); 402 omap_wdt_disable(wdev);
403 pm_runtime_put_sync(wdev->dev);
404 }
386 405
387 return 0; 406 return 0;
388} 407}
@@ -392,8 +411,10 @@ static int omap_wdt_resume(struct platform_device *pdev)
392 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); 411 struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
393 412
394 if (wdev->omap_wdt_users) { 413 if (wdev->omap_wdt_users) {
414 pm_runtime_get_sync(wdev->dev);
395 omap_wdt_enable(wdev); 415 omap_wdt_enable(wdev);
396 omap_wdt_ping(wdev); 416 omap_wdt_ping(wdev);
417 pm_runtime_put_sync(wdev->dev);
397 } 418 }
398 419
399 return 0; 420 return 0;
diff --git a/include/linux/hwspinlock.h b/include/linux/hwspinlock.h
new file mode 100644
index 000000000000..8390efc457eb
--- /dev/null
+++ b/include/linux/hwspinlock.h
@@ -0,0 +1,292 @@
1/*
2 * Hardware spinlock public header
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * Contact: Ohad Ben-Cohen <ohad@wizery.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#ifndef __LINUX_HWSPINLOCK_H
19#define __LINUX_HWSPINLOCK_H
20
21#include <linux/err.h>
22#include <linux/sched.h>
23
24/* hwspinlock mode argument */
25#define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
26#define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
27
28struct hwspinlock;
29
30#if defined(CONFIG_HWSPINLOCK) || defined(CONFIG_HWSPINLOCK_MODULE)
31
32int hwspin_lock_register(struct hwspinlock *lock);
33struct hwspinlock *hwspin_lock_unregister(unsigned int id);
34struct hwspinlock *hwspin_lock_request(void);
35struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
36int hwspin_lock_free(struct hwspinlock *hwlock);
37int hwspin_lock_get_id(struct hwspinlock *hwlock);
38int __hwspin_lock_timeout(struct hwspinlock *, unsigned int, int,
39 unsigned long *);
40int __hwspin_trylock(struct hwspinlock *, int, unsigned long *);
41void __hwspin_unlock(struct hwspinlock *, int, unsigned long *);
42
43#else /* !CONFIG_HWSPINLOCK */
44
45/*
46 * We don't want these functions to fail if CONFIG_HWSPINLOCK is not
47 * enabled. We prefer to silently succeed in this case, and let the
48 * code path get compiled away. This way, if CONFIG_HWSPINLOCK is not
49 * required on a given setup, users will still work.
50 *
51 * The only exception is hwspin_lock_register/hwspin_lock_unregister, with which
52 * we _do_ want users to fail (no point in registering hwspinlock instances if
53 * the framework is not available).
54 *
55 * Note: ERR_PTR(-ENODEV) will still be considered a success for NULL-checking
56 * users. Others, which care, can still check this with IS_ERR.
57 */
58static inline struct hwspinlock *hwspin_lock_request(void)
59{
60 return ERR_PTR(-ENODEV);
61}
62
63static inline struct hwspinlock *hwspin_lock_request_specific(unsigned int id)
64{
65 return ERR_PTR(-ENODEV);
66}
67
68static inline int hwspin_lock_free(struct hwspinlock *hwlock)
69{
70 return 0;
71}
72
73static inline
74int __hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to,
75 int mode, unsigned long *flags)
76{
77 return 0;
78}
79
80static inline
81int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
82{
83 return 0;
84}
85
86static inline
87void __hwspin_unlock(struct hwspinlock *hwlock, int mode, unsigned long *flags)
88{
89 return 0;
90}
91
92static inline int hwspin_lock_get_id(struct hwspinlock *hwlock)
93{
94 return 0;
95}
96
97static inline int hwspin_lock_register(struct hwspinlock *hwlock)
98{
99 return -ENODEV;
100}
101
102static inline struct hwspinlock *hwspin_lock_unregister(unsigned int id)
103{
104 return NULL;
105}
106
107#endif /* !CONFIG_HWSPINLOCK */
108
109/**
110 * hwspin_trylock_irqsave() - try to lock an hwspinlock, disable interrupts
111 * @hwlock: an hwspinlock which we want to trylock
112 * @flags: a pointer to where the caller's interrupt state will be saved at
113 *
114 * This function attempts to lock the underlying hwspinlock, and will
115 * immediately fail if the hwspinlock is already locked.
116 *
117 * Upon a successful return from this function, preemption and local
118 * interrupts are disabled (previous interrupts state is saved at @flags),
119 * so the caller must not sleep, and is advised to release the hwspinlock
120 * as soon as possible.
121 *
122 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
123 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
124 */
125static inline
126int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags)
127{
128 return __hwspin_trylock(hwlock, HWLOCK_IRQSTATE, flags);
129}
130
131/**
132 * hwspin_trylock_irq() - try to lock an hwspinlock, disable interrupts
133 * @hwlock: an hwspinlock which we want to trylock
134 *
135 * This function attempts to lock the underlying hwspinlock, and will
136 * immediately fail if the hwspinlock is already locked.
137 *
138 * Upon a successful return from this function, preemption and local
139 * interrupts are disabled, so the caller must not sleep, and is advised
140 * to release the hwspinlock as soon as possible.
141 *
142 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
143 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
144 */
145static inline int hwspin_trylock_irq(struct hwspinlock *hwlock)
146{
147 return __hwspin_trylock(hwlock, HWLOCK_IRQ, NULL);
148}
149
150/**
151 * hwspin_trylock() - attempt to lock a specific hwspinlock
152 * @hwlock: an hwspinlock which we want to trylock
153 *
154 * This function attempts to lock an hwspinlock, and will immediately fail
155 * if the hwspinlock is already taken.
156 *
157 * Upon a successful return from this function, preemption is disabled,
158 * so the caller must not sleep, and is advised to release the hwspinlock
159 * as soon as possible. This is required in order to minimize remote cores
160 * polling on the hardware interconnect.
161 *
162 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
163 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
164 */
165static inline int hwspin_trylock(struct hwspinlock *hwlock)
166{
167 return __hwspin_trylock(hwlock, 0, NULL);
168}
169
170/**
171 * hwspin_lock_timeout_irqsave() - lock hwspinlock, with timeout, disable irqs
172 * @hwlock: the hwspinlock to be locked
173 * @to: timeout value in msecs
174 * @flags: a pointer to where the caller's interrupt state will be saved at
175 *
176 * This function locks the underlying @hwlock. If the @hwlock
177 * is already taken, the function will busy loop waiting for it to
178 * be released, but give up when @timeout msecs have elapsed.
179 *
180 * Upon a successful return from this function, preemption and local interrupts
181 * are disabled (plus previous interrupt state is saved), so the caller must
182 * not sleep, and is advised to release the hwspinlock as soon as possible.
183 *
184 * Returns 0 when the @hwlock was successfully taken, and an appropriate
185 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
186 * busy after @timeout msecs). The function will never sleep.
187 */
188static inline int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock,
189 unsigned int to, unsigned long *flags)
190{
191 return __hwspin_lock_timeout(hwlock, to, HWLOCK_IRQSTATE, flags);
192}
193
194/**
195 * hwspin_lock_timeout_irq() - lock hwspinlock, with timeout, disable irqs
196 * @hwlock: the hwspinlock to be locked
197 * @to: timeout value in msecs
198 *
199 * This function locks the underlying @hwlock. If the @hwlock
200 * is already taken, the function will busy loop waiting for it to
201 * be released, but give up when @timeout msecs have elapsed.
202 *
203 * Upon a successful return from this function, preemption and local interrupts
204 * are disabled so the caller must not sleep, and is advised to release the
205 * hwspinlock as soon as possible.
206 *
207 * Returns 0 when the @hwlock was successfully taken, and an appropriate
208 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
209 * busy after @timeout msecs). The function will never sleep.
210 */
211static inline
212int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int to)
213{
214 return __hwspin_lock_timeout(hwlock, to, HWLOCK_IRQ, NULL);
215}
216
217/**
218 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit
219 * @hwlock: the hwspinlock to be locked
220 * @to: timeout value in msecs
221 *
222 * This function locks the underlying @hwlock. If the @hwlock
223 * is already taken, the function will busy loop waiting for it to
224 * be released, but give up when @timeout msecs have elapsed.
225 *
226 * Upon a successful return from this function, preemption is disabled
227 * so the caller must not sleep, and is advised to release the hwspinlock
228 * as soon as possible.
229 * This is required in order to minimize remote cores polling on the
230 * hardware interconnect.
231 *
232 * Returns 0 when the @hwlock was successfully taken, and an appropriate
233 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
234 * busy after @timeout msecs). The function will never sleep.
235 */
236static inline
237int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int to)
238{
239 return __hwspin_lock_timeout(hwlock, to, 0, NULL);
240}
241
242/**
243 * hwspin_unlock_irqrestore() - unlock hwspinlock, restore irq state
244 * @hwlock: a previously-acquired hwspinlock which we want to unlock
245 * @flags: previous caller's interrupt state to restore
246 *
247 * This function will unlock a specific hwspinlock, enable preemption and
248 * restore the previous state of the local interrupts. It should be used
249 * to undo, e.g., hwspin_trylock_irqsave().
250 *
251 * @hwlock must be already locked before calling this function: it is a bug
252 * to call unlock on a @hwlock that is already unlocked.
253 */
254static inline void hwspin_unlock_irqrestore(struct hwspinlock *hwlock,
255 unsigned long *flags)
256{
257 __hwspin_unlock(hwlock, HWLOCK_IRQSTATE, flags);
258}
259
260/**
261 * hwspin_unlock_irq() - unlock hwspinlock, enable interrupts
262 * @hwlock: a previously-acquired hwspinlock which we want to unlock
263 *
264 * This function will unlock a specific hwspinlock, enable preemption and
265 * enable local interrupts. Should be used to undo hwspin_lock_irq().
266 *
267 * @hwlock must be already locked (e.g. by hwspin_trylock_irq()) before
268 * calling this function: it is a bug to call unlock on a @hwlock that is
269 * already unlocked.
270 */
271static inline void hwspin_unlock_irq(struct hwspinlock *hwlock)
272{
273 __hwspin_unlock(hwlock, HWLOCK_IRQ, NULL);
274}
275
276/**
277 * hwspin_unlock() - unlock hwspinlock
278 * @hwlock: a previously-acquired hwspinlock which we want to unlock
279 *
280 * This function will unlock a specific hwspinlock and enable preemption
281 * back.
282 *
283 * @hwlock must be already locked (e.g. by hwspin_trylock()) before calling
284 * this function: it is a bug to call unlock on a @hwlock that is already
285 * unlocked.
286 */
287static inline void hwspin_unlock(struct hwspinlock *hwlock)
288{
289 __hwspin_unlock(hwlock, 0, NULL);
290}
291
292#endif /* __LINUX_HWSPINLOCK_H */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 61b9609e55f2..9d88b717111a 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -637,7 +637,6 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
637extern int twl4030_remove_script(u8 flags); 637extern int twl4030_remove_script(u8 flags);
638 638
639struct twl4030_codec_audio_data { 639struct twl4030_codec_audio_data {
640 unsigned int audio_mclk; /* not used, will be removed */
641 unsigned int digimic_delay; /* in ms */ 640 unsigned int digimic_delay; /* in ms */
642 unsigned int ramp_delay_value; 641 unsigned int ramp_delay_value;
643 unsigned int offset_cncl_path; 642 unsigned int offset_cncl_path;
@@ -648,7 +647,6 @@ struct twl4030_codec_audio_data {
648}; 647};
649 648
650struct twl4030_codec_vibra_data { 649struct twl4030_codec_vibra_data {
651 unsigned int audio_mclk;
652 unsigned int coexist; 650 unsigned int coexist;
653}; 651};
654 652
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index cd6f3b431195..d60130f88eed 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -168,6 +168,7 @@
168#define ONENAND_SYS_CFG1_INT (1 << 6) 168#define ONENAND_SYS_CFG1_INT (1 << 6)
169#define ONENAND_SYS_CFG1_IOBE (1 << 5) 169#define ONENAND_SYS_CFG1_IOBE (1 << 5)
170#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4) 170#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4)
171#define ONENAND_SYS_CFG1_VHF (1 << 3)
171#define ONENAND_SYS_CFG1_HF (1 << 2) 172#define ONENAND_SYS_CFG1_HF (1 << 2)
172#define ONENAND_SYS_CFG1_SYNC_WRITE (1 << 1) 173#define ONENAND_SYS_CFG1_SYNC_WRITE (1 << 1)
173 174
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index d203f4da18a0..2175f09e57b6 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -69,110 +69,6 @@ static struct omap_mcbsp_data mcbsp_data[NUM_LINKS];
69 */ 69 */
70static struct omap_pcm_dma_data omap_mcbsp_dai_dma_params[NUM_LINKS][2]; 70static struct omap_pcm_dma_data omap_mcbsp_dai_dma_params[NUM_LINKS][2];
71 71
72#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
73static const int omap1_dma_reqs[][2] = {
74 { OMAP_DMA_MCBSP1_TX, OMAP_DMA_MCBSP1_RX },
75 { OMAP_DMA_MCBSP2_TX, OMAP_DMA_MCBSP2_RX },
76 { OMAP_DMA_MCBSP3_TX, OMAP_DMA_MCBSP3_RX },
77};
78static const unsigned long omap1_mcbsp_port[][2] = {
79 { OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1,
80 OMAP1510_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1 },
81 { OMAP1510_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1,
82 OMAP1510_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1 },
83 { OMAP1510_MCBSP3_BASE + OMAP_MCBSP_REG_DXR1,
84 OMAP1510_MCBSP3_BASE + OMAP_MCBSP_REG_DRR1 },
85};
86#else
87static const int omap1_dma_reqs[][2] = {};
88static const unsigned long omap1_mcbsp_port[][2] = {};
89#endif
90
91#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
92static const int omap24xx_dma_reqs[][2] = {
93 { OMAP24XX_DMA_MCBSP1_TX, OMAP24XX_DMA_MCBSP1_RX },
94 { OMAP24XX_DMA_MCBSP2_TX, OMAP24XX_DMA_MCBSP2_RX },
95#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3)
96 { OMAP24XX_DMA_MCBSP3_TX, OMAP24XX_DMA_MCBSP3_RX },
97 { OMAP24XX_DMA_MCBSP4_TX, OMAP24XX_DMA_MCBSP4_RX },
98 { OMAP24XX_DMA_MCBSP5_TX, OMAP24XX_DMA_MCBSP5_RX },
99#endif
100};
101#else
102static const int omap24xx_dma_reqs[][2] = {};
103#endif
104
105#if defined(CONFIG_ARCH_OMAP4)
106static const int omap44xx_dma_reqs[][2] = {
107 { OMAP44XX_DMA_MCBSP1_TX, OMAP44XX_DMA_MCBSP1_RX },
108 { OMAP44XX_DMA_MCBSP2_TX, OMAP44XX_DMA_MCBSP2_RX },
109 { OMAP44XX_DMA_MCBSP3_TX, OMAP44XX_DMA_MCBSP3_RX },
110 { OMAP44XX_DMA_MCBSP4_TX, OMAP44XX_DMA_MCBSP4_RX },
111};
112#else
113static const int omap44xx_dma_reqs[][2] = {};
114#endif
115
116#if defined(CONFIG_ARCH_OMAP2420)
117static const unsigned long omap2420_mcbsp_port[][2] = {
118 { OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR1,
119 OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR1 },
120 { OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR1,
121 OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR1 },
122};
123#else
124static const unsigned long omap2420_mcbsp_port[][2] = {};
125#endif
126
127#if defined(CONFIG_ARCH_OMAP2430)
128static const unsigned long omap2430_mcbsp_port[][2] = {
129 { OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR,
130 OMAP24XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR },
131 { OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR,
132 OMAP24XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR },
133 { OMAP2430_MCBSP3_BASE + OMAP_MCBSP_REG_DXR,
134 OMAP2430_MCBSP3_BASE + OMAP_MCBSP_REG_DRR },
135 { OMAP2430_MCBSP4_BASE + OMAP_MCBSP_REG_DXR,
136 OMAP2430_MCBSP4_BASE + OMAP_MCBSP_REG_DRR },
137 { OMAP2430_MCBSP5_BASE + OMAP_MCBSP_REG_DXR,
138 OMAP2430_MCBSP5_BASE + OMAP_MCBSP_REG_DRR },
139};
140#else
141static const unsigned long omap2430_mcbsp_port[][2] = {};
142#endif
143
144#if defined(CONFIG_ARCH_OMAP3)
145static const unsigned long omap34xx_mcbsp_port[][2] = {
146 { OMAP34XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR,
147 OMAP34XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR },
148 { OMAP34XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR,
149 OMAP34XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR },
150 { OMAP34XX_MCBSP3_BASE + OMAP_MCBSP_REG_DXR,
151 OMAP34XX_MCBSP3_BASE + OMAP_MCBSP_REG_DRR },
152 { OMAP34XX_MCBSP4_BASE + OMAP_MCBSP_REG_DXR,
153 OMAP34XX_MCBSP4_BASE + OMAP_MCBSP_REG_DRR },
154 { OMAP34XX_MCBSP5_BASE + OMAP_MCBSP_REG_DXR,
155 OMAP34XX_MCBSP5_BASE + OMAP_MCBSP_REG_DRR },
156};
157#else
158static const unsigned long omap34xx_mcbsp_port[][2] = {};
159#endif
160
161#if defined(CONFIG_ARCH_OMAP4)
162static const unsigned long omap44xx_mcbsp_port[][2] = {
163 { OMAP44XX_MCBSP1_BASE + OMAP_MCBSP_REG_DXR,
164 OMAP44XX_MCBSP1_BASE + OMAP_MCBSP_REG_DRR },
165 { OMAP44XX_MCBSP2_BASE + OMAP_MCBSP_REG_DXR,
166 OMAP44XX_MCBSP2_BASE + OMAP_MCBSP_REG_DRR },
167 { OMAP44XX_MCBSP3_BASE + OMAP_MCBSP_REG_DXR,
168 OMAP44XX_MCBSP3_BASE + OMAP_MCBSP_REG_DRR },
169 { OMAP44XX_MCBSP4_BASE + OMAP_MCBSP_REG_DXR,
170 OMAP44XX_MCBSP4_BASE + OMAP_MCBSP_REG_DRR },
171};
172#else
173static const unsigned long omap44xx_mcbsp_port[][2] = {};
174#endif
175
176static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream) 72static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream)
177{ 73{
178 struct snd_soc_pcm_runtime *rtd = substream->private_data; 74 struct snd_soc_pcm_runtime *rtd = substream->private_data;
@@ -346,24 +242,10 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
346 unsigned int format, div, framesize, master; 242 unsigned int format, div, framesize, master;
347 243
348 dma_data = &omap_mcbsp_dai_dma_params[cpu_dai->id][substream->stream]; 244 dma_data = &omap_mcbsp_dai_dma_params[cpu_dai->id][substream->stream];
349 if (cpu_class_is_omap1()) { 245
350 dma = omap1_dma_reqs[bus_id][substream->stream]; 246 dma = omap_mcbsp_dma_ch_params(bus_id, substream->stream);
351 port = omap1_mcbsp_port[bus_id][substream->stream]; 247 port = omap_mcbsp_dma_reg_params(bus_id, substream->stream);
352 } else if (cpu_is_omap2420()) { 248
353 dma = omap24xx_dma_reqs[bus_id][substream->stream];
354 port = omap2420_mcbsp_port[bus_id][substream->stream];
355 } else if (cpu_is_omap2430()) {
356 dma = omap24xx_dma_reqs[bus_id][substream->stream];
357 port = omap2430_mcbsp_port[bus_id][substream->stream];
358 } else if (cpu_is_omap343x()) {
359 dma = omap24xx_dma_reqs[bus_id][substream->stream];
360 port = omap34xx_mcbsp_port[bus_id][substream->stream];
361 } else if (cpu_is_omap44xx()) {
362 dma = omap44xx_dma_reqs[bus_id][substream->stream];
363 port = omap44xx_mcbsp_port[bus_id][substream->stream];
364 } else {
365 return -ENODEV;
366 }
367 switch (params_format(params)) { 249 switch (params_format(params)) {
368 case SNDRV_PCM_FORMAT_S16_LE: 250 case SNDRV_PCM_FORMAT_S16_LE:
369 dma_data->data_type = OMAP_DMA_DATA_TYPE_S16; 251 dma_data->data_type = OMAP_DMA_DATA_TYPE_S16;
diff --git a/sound/soc/omap/omap-mcbsp.h b/sound/soc/omap/omap-mcbsp.h
index 110c106611d3..37dc7211ed3f 100644
--- a/sound/soc/omap/omap-mcbsp.h
+++ b/sound/soc/omap/omap-mcbsp.h
@@ -43,7 +43,7 @@ enum omap_mcbsp_div {
43 OMAP_MCBSP_CLKGDV, /* Sample rate generator divider */ 43 OMAP_MCBSP_CLKGDV, /* Sample rate generator divider */
44}; 44};
45 45
46#if defined(CONFIG_ARCH_OMAP2420) 46#if defined(CONFIG_SOC_OMAP2420)
47#define NUM_LINKS 2 47#define NUM_LINKS 2
48#endif 48#endif
49#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) 49#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
@@ -54,7 +54,7 @@ enum omap_mcbsp_div {
54#undef NUM_LINKS 54#undef NUM_LINKS
55#define NUM_LINKS 4 55#define NUM_LINKS 4
56#endif 56#endif
57#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) 57#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_OMAP2430)
58#undef NUM_LINKS 58#undef NUM_LINKS
59#define NUM_LINKS 5 59#define NUM_LINKS 5
60#endif 60#endif