blob: 609e2397ea47d72772223383d7885b1240a75136 [file] [log] [blame]
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001/*
2 * DM81xx hwmod data.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/platform_data/gpio-omap.h>
19#include <linux/platform_data/hsmmc-omap.h>
20#include <linux/platform_data/spi-omap2-mcspi.h>
21#include <plat/dmtimer.h>
22
23#include "omap_hwmod_common_data.h"
24#include "cm81xx.h"
25#include "ti81xx.h"
26#include "wd_timer.h"
27
28/*
29 * DM816X hardware modules integration data
30 *
31 * Note: This is incomplete and at present, not generated from h/w database.
32 */
33
34/*
Tony Lindgren7e1b11d2015-07-16 01:55:58 -070035 * Common alwon .clkctrl_offs from dm814x TRM "Table 2-278. CM_ALWON REGISTERS"
36 * also dm816x TRM 18.7.17 CM_ALWON device register values minus 0x1400.
Tony Lindgren4d38bd12015-01-26 09:26:32 -080037 */
Tony Lindgren7e1b11d2015-07-16 01:55:58 -070038#define DM81XX_CM_ALWON_MCASP0_CLKCTRL 0x140
39#define DM81XX_CM_ALWON_MCASP1_CLKCTRL 0x144
40#define DM81XX_CM_ALWON_MCASP2_CLKCTRL 0x148
41#define DM81XX_CM_ALWON_MCBSP_CLKCTRL 0x14c
42#define DM81XX_CM_ALWON_UART_0_CLKCTRL 0x150
43#define DM81XX_CM_ALWON_UART_1_CLKCTRL 0x154
44#define DM81XX_CM_ALWON_UART_2_CLKCTRL 0x158
45#define DM81XX_CM_ALWON_GPIO_0_CLKCTRL 0x15c
46#define DM81XX_CM_ALWON_GPIO_1_CLKCTRL 0x160
47#define DM81XX_CM_ALWON_I2C_0_CLKCTRL 0x164
48#define DM81XX_CM_ALWON_I2C_1_CLKCTRL 0x168
49#define DM81XX_CM_ALWON_WDTIMER_CLKCTRL 0x18c
50#define DM81XX_CM_ALWON_SPI_CLKCTRL 0x190
51#define DM81XX_CM_ALWON_MAILBOX_CLKCTRL 0x194
52#define DM81XX_CM_ALWON_SPINBOX_CLKCTRL 0x198
53#define DM81XX_CM_ALWON_MMUDATA_CLKCTRL 0x19c
54#define DM81XX_CM_ALWON_MMUCFG_CLKCTRL 0x1a8
55#define DM81XX_CM_ALWON_CONTROL_CLKCTRL 0x1c4
56#define DM81XX_CM_ALWON_GPMC_CLKCTRL 0x1d0
57#define DM81XX_CM_ALWON_ETHERNET_0_CLKCTRL 0x1d4
58#define DM81XX_CM_ALWON_L3_CLKCTRL 0x1e4
59#define DM81XX_CM_ALWON_L4HS_CLKCTRL 0x1e8
60#define DM81XX_CM_ALWON_L4LS_CLKCTRL 0x1ec
61#define DM81XX_CM_ALWON_RTC_CLKCTRL 0x1f0
62#define DM81XX_CM_ALWON_TPCC_CLKCTRL 0x1f4
63#define DM81XX_CM_ALWON_TPTC0_CLKCTRL 0x1f8
64#define DM81XX_CM_ALWON_TPTC1_CLKCTRL 0x1fc
65#define DM81XX_CM_ALWON_TPTC2_CLKCTRL 0x200
66#define DM81XX_CM_ALWON_TPTC3_CLKCTRL 0x204
67
68/* Registers specific to dm814x */
69#define DM814X_CM_ALWON_MCASP_3_4_5_CLKCTRL 0x16c
70#define DM814X_CM_ALWON_ATL_CLKCTRL 0x170
71#define DM814X_CM_ALWON_MLB_CLKCTRL 0x174
72#define DM814X_CM_ALWON_PATA_CLKCTRL 0x178
73#define DM814X_CM_ALWON_UART_3_CLKCTRL 0x180
74#define DM814X_CM_ALWON_UART_4_CLKCTRL 0x184
75#define DM814X_CM_ALWON_UART_5_CLKCTRL 0x188
76#define DM814X_CM_ALWON_OCM_0_CLKCTRL 0x1b4
77#define DM814X_CM_ALWON_VCP_CLKCTRL 0x1b8
78#define DM814X_CM_ALWON_MPU_CLKCTRL 0x1dc
79#define DM814X_CM_ALWON_DEBUGSS_CLKCTRL 0x1e0
80#define DM814X_CM_ALWON_DCAN_0_1_CLKCTRL 0x218
81#define DM814X_CM_ALWON_MMCHS_0_CLKCTRL 0x21c
82#define DM814X_CM_ALWON_MMCHS_1_CLKCTRL 0x220
83#define DM814X_CM_ALWON_MMCHS_2_CLKCTRL 0x224
84#define DM814X_CM_ALWON_CUST_EFUSE_CLKCTRL 0x228
85
86/* Registers specific to dm816x */
Tony Lindgren4d38bd12015-01-26 09:26:32 -080087#define DM816X_DM_ALWON_BASE 0x1400
Tony Lindgren4d38bd12015-01-26 09:26:32 -080088#define DM816X_CM_ALWON_TIMER_1_CLKCTRL (0x1570 - DM816X_DM_ALWON_BASE)
89#define DM816X_CM_ALWON_TIMER_2_CLKCTRL (0x1574 - DM816X_DM_ALWON_BASE)
90#define DM816X_CM_ALWON_TIMER_3_CLKCTRL (0x1578 - DM816X_DM_ALWON_BASE)
91#define DM816X_CM_ALWON_TIMER_4_CLKCTRL (0x157c - DM816X_DM_ALWON_BASE)
92#define DM816X_CM_ALWON_TIMER_5_CLKCTRL (0x1580 - DM816X_DM_ALWON_BASE)
93#define DM816X_CM_ALWON_TIMER_6_CLKCTRL (0x1584 - DM816X_DM_ALWON_BASE)
94#define DM816X_CM_ALWON_TIMER_7_CLKCTRL (0x1588 - DM816X_DM_ALWON_BASE)
Tony Lindgren4d38bd12015-01-26 09:26:32 -080095#define DM816X_CM_ALWON_SDIO_CLKCTRL (0x15b0 - DM816X_DM_ALWON_BASE)
96#define DM816X_CM_ALWON_OCMC_0_CLKCTRL (0x15b4 - DM816X_DM_ALWON_BASE)
97#define DM816X_CM_ALWON_OCMC_1_CLKCTRL (0x15b8 - DM816X_DM_ALWON_BASE)
Tony Lindgren4d38bd12015-01-26 09:26:32 -080098#define DM816X_CM_ALWON_ETHERNET_1_CLKCTRL (0x15d8 - DM816X_DM_ALWON_BASE)
99#define DM816X_CM_ALWON_MPU_CLKCTRL (0x15dc - DM816X_DM_ALWON_BASE)
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800100#define DM816X_CM_ALWON_SR_0_CLKCTRL (0x1608 - DM816X_DM_ALWON_BASE)
101#define DM816X_CM_ALWON_SR_1_CLKCTRL (0x160c - DM816X_DM_ALWON_BASE)
102
103/*
104 * The default .clkctrl_offs field is offset from CM_DEFAULT, that's
105 * TRM 18.7.6 CM_DEFAULT device register values minus 0x500
106 */
Tony Lindgrenf53850b2015-12-22 15:40:01 -0800107#define DM81XX_CM_DEFAULT_OFFSET 0x500
108#define DM81XX_CM_DEFAULT_USB_CLKCTRL (0x558 - DM81XX_CM_DEFAULT_OFFSET)
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800109
110/* L3 Interconnect entries clocked at 125, 250 and 500MHz */
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700111static struct omap_hwmod dm81xx_alwon_l3_slow_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800112 .name = "alwon_l3_slow",
113 .clkdm_name = "alwon_l3s_clkdm",
114 .class = &l3_hwmod_class,
115 .flags = HWMOD_NO_IDLEST,
116};
117
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700118static struct omap_hwmod dm81xx_default_l3_slow_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800119 .name = "default_l3_slow",
120 .clkdm_name = "default_l3_slow_clkdm",
121 .class = &l3_hwmod_class,
122 .flags = HWMOD_NO_IDLEST,
123};
124
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700125static struct omap_hwmod dm81xx_alwon_l3_med_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800126 .name = "l3_med",
127 .clkdm_name = "alwon_l3_med_clkdm",
128 .class = &l3_hwmod_class,
129 .flags = HWMOD_NO_IDLEST,
130};
131
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700132static struct omap_hwmod dm81xx_alwon_l3_fast_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800133 .name = "l3_fast",
134 .clkdm_name = "alwon_l3_fast_clkdm",
135 .class = &l3_hwmod_class,
136 .flags = HWMOD_NO_IDLEST,
137};
138
139/*
140 * L4 standard peripherals, see TRM table 1-12 for devices using this.
141 * See TRM table 1-73 for devices using the 125MHz SYSCLK6 clock.
142 */
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700143static struct omap_hwmod dm81xx_l4_ls_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800144 .name = "l4_ls",
145 .clkdm_name = "alwon_l3s_clkdm",
146 .class = &l4_hwmod_class,
Neil Armstrong29f5b342015-11-13 17:29:53 +0100147 .flags = HWMOD_NO_IDLEST,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800148};
149
150/*
151 * L4 high-speed peripherals. For devices using this, please see the TRM
152 * table 1-13. On dm816x, only EMAC, MDIO and SATA use this. See also TRM
153 * table 1-73 for devices using 250MHz SYSCLK5 clock.
154 */
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700155static struct omap_hwmod dm81xx_l4_hs_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800156 .name = "l4_hs",
157 .clkdm_name = "alwon_l3_med_clkdm",
158 .class = &l4_hwmod_class,
Neil Armstrong29f5b342015-11-13 17:29:53 +0100159 .flags = HWMOD_NO_IDLEST,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800160};
161
162/* L3 slow -> L4 ls peripheral interface running at 125MHz */
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700163static struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__l4_ls = {
164 .master = &dm81xx_alwon_l3_slow_hwmod,
165 .slave = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800166 .user = OCP_USER_MPU,
167};
168
169/* L3 med -> L4 fast peripheral interface running at 250MHz */
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700170static struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__l4_hs = {
171 .master = &dm81xx_alwon_l3_med_hwmod,
172 .slave = &dm81xx_l4_hs_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800173 .user = OCP_USER_MPU,
174};
175
176/* MPU */
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700177static struct omap_hwmod dm814x_mpu_hwmod = {
178 .name = "mpu",
179 .clkdm_name = "alwon_l3s_clkdm",
180 .class = &mpu_hwmod_class,
181 .flags = HWMOD_INIT_NO_IDLE,
182 .main_clk = "mpu_ck",
183 .prcm = {
184 .omap4 = {
185 .clkctrl_offs = DM814X_CM_ALWON_MPU_CLKCTRL,
186 .modulemode = MODULEMODE_SWCTRL,
187 },
188 },
189};
190
191static struct omap_hwmod_ocp_if dm814x_mpu__alwon_l3_slow = {
192 .master = &dm814x_mpu_hwmod,
193 .slave = &dm81xx_alwon_l3_slow_hwmod,
194 .user = OCP_USER_MPU,
195};
196
197/* L3 med peripheral interface running at 200MHz */
198static struct omap_hwmod_ocp_if dm814x_mpu__alwon_l3_med = {
199 .master = &dm814x_mpu_hwmod,
200 .slave = &dm81xx_alwon_l3_med_hwmod,
201 .user = OCP_USER_MPU,
202};
203
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800204static struct omap_hwmod dm816x_mpu_hwmod = {
205 .name = "mpu",
206 .clkdm_name = "alwon_mpu_clkdm",
207 .class = &mpu_hwmod_class,
208 .flags = HWMOD_INIT_NO_IDLE,
209 .main_clk = "mpu_ck",
210 .prcm = {
211 .omap4 = {
212 .clkctrl_offs = DM816X_CM_ALWON_MPU_CLKCTRL,
213 .modulemode = MODULEMODE_SWCTRL,
214 },
215 },
216};
217
218static struct omap_hwmod_ocp_if dm816x_mpu__alwon_l3_slow = {
219 .master = &dm816x_mpu_hwmod,
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700220 .slave = &dm81xx_alwon_l3_slow_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800221 .user = OCP_USER_MPU,
222};
223
224/* L3 med peripheral interface running at 250MHz */
225static struct omap_hwmod_ocp_if dm816x_mpu__alwon_l3_med = {
226 .master = &dm816x_mpu_hwmod,
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700227 .slave = &dm81xx_alwon_l3_med_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800228 .user = OCP_USER_MPU,
229};
230
Tony Lindgrenc5803242016-02-26 11:00:22 -0800231/* RTC */
232static struct omap_hwmod_class_sysconfig ti81xx_rtc_sysc = {
233 .rev_offs = 0x74,
234 .sysc_offs = 0x78,
235 .sysc_flags = SYSC_HAS_SIDLEMODE,
236 .idlemodes = SIDLE_FORCE | SIDLE_NO |
237 SIDLE_SMART | SIDLE_SMART_WKUP,
238 .sysc_fields = &omap_hwmod_sysc_type3,
239};
240
241static struct omap_hwmod_class ti81xx_rtc_hwmod_class = {
242 .name = "rtc",
243 .sysc = &ti81xx_rtc_sysc,
244};
245
246struct omap_hwmod ti81xx_rtc_hwmod = {
247 .name = "rtc",
248 .class = &ti81xx_rtc_hwmod_class,
249 .clkdm_name = "alwon_l3s_clkdm",
250 .flags = HWMOD_NO_IDLEST,
251 .main_clk = "sysclk18_ck",
252 .prcm = {
253 .omap4 = {
254 .clkctrl_offs = DM81XX_CM_ALWON_RTC_CLKCTRL,
255 .modulemode = MODULEMODE_SWCTRL,
256 },
257 },
258};
259
260static struct omap_hwmod_ocp_if ti81xx_l4_ls__rtc = {
261 .master = &dm81xx_l4_ls_hwmod,
262 .slave = &ti81xx_rtc_hwmod,
263 .clk = "sysclk6_ck",
264 .user = OCP_USER_MPU,
265};
266
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800267/* UART common */
268static struct omap_hwmod_class_sysconfig uart_sysc = {
269 .rev_offs = 0x50,
270 .sysc_offs = 0x54,
271 .syss_offs = 0x58,
272 .sysc_flags = SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
273 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
274 SYSS_HAS_RESET_STATUS,
275 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
276 MSTANDBY_SMART_WKUP,
277 .sysc_fields = &omap_hwmod_sysc_type1,
278};
279
280static struct omap_hwmod_class uart_class = {
281 .name = "uart",
282 .sysc = &uart_sysc,
283};
284
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700285static struct omap_hwmod dm81xx_uart1_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800286 .name = "uart1",
287 .clkdm_name = "alwon_l3s_clkdm",
288 .main_clk = "sysclk10_ck",
289 .prcm = {
290 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700291 .clkctrl_offs = DM81XX_CM_ALWON_UART_0_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800292 .modulemode = MODULEMODE_SWCTRL,
293 },
294 },
295 .class = &uart_class,
296 .flags = DEBUG_TI81XXUART1_FLAGS,
297};
298
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700299static struct omap_hwmod_ocp_if dm81xx_l4_ls__uart1 = {
300 .master = &dm81xx_l4_ls_hwmod,
301 .slave = &dm81xx_uart1_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800302 .clk = "sysclk6_ck",
303 .user = OCP_USER_MPU,
304};
305
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700306static struct omap_hwmod dm81xx_uart2_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800307 .name = "uart2",
308 .clkdm_name = "alwon_l3s_clkdm",
309 .main_clk = "sysclk10_ck",
310 .prcm = {
311 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700312 .clkctrl_offs = DM81XX_CM_ALWON_UART_1_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800313 .modulemode = MODULEMODE_SWCTRL,
314 },
315 },
316 .class = &uart_class,
317 .flags = DEBUG_TI81XXUART2_FLAGS,
318};
319
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700320static struct omap_hwmod_ocp_if dm81xx_l4_ls__uart2 = {
321 .master = &dm81xx_l4_ls_hwmod,
322 .slave = &dm81xx_uart2_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800323 .clk = "sysclk6_ck",
324 .user = OCP_USER_MPU,
325};
326
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700327static struct omap_hwmod dm81xx_uart3_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800328 .name = "uart3",
329 .clkdm_name = "alwon_l3s_clkdm",
330 .main_clk = "sysclk10_ck",
331 .prcm = {
332 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700333 .clkctrl_offs = DM81XX_CM_ALWON_UART_2_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800334 .modulemode = MODULEMODE_SWCTRL,
335 },
336 },
337 .class = &uart_class,
338 .flags = DEBUG_TI81XXUART3_FLAGS,
339};
340
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700341static struct omap_hwmod_ocp_if dm81xx_l4_ls__uart3 = {
342 .master = &dm81xx_l4_ls_hwmod,
343 .slave = &dm81xx_uart3_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800344 .clk = "sysclk6_ck",
345 .user = OCP_USER_MPU,
346};
347
348static struct omap_hwmod_class_sysconfig wd_timer_sysc = {
349 .rev_offs = 0x0,
350 .sysc_offs = 0x10,
351 .syss_offs = 0x14,
352 .sysc_flags = SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
353 SYSS_HAS_RESET_STATUS,
354 .sysc_fields = &omap_hwmod_sysc_type1,
355};
356
357static struct omap_hwmod_class wd_timer_class = {
358 .name = "wd_timer",
359 .sysc = &wd_timer_sysc,
360 .pre_shutdown = &omap2_wd_timer_disable,
361 .reset = &omap2_wd_timer_reset,
362};
363
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700364static struct omap_hwmod dm81xx_wd_timer_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800365 .name = "wd_timer",
366 .clkdm_name = "alwon_l3s_clkdm",
367 .main_clk = "sysclk18_ck",
368 .flags = HWMOD_NO_IDLEST,
369 .prcm = {
370 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700371 .clkctrl_offs = DM81XX_CM_ALWON_WDTIMER_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800372 .modulemode = MODULEMODE_SWCTRL,
373 },
374 },
375 .class = &wd_timer_class,
376};
377
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700378static struct omap_hwmod_ocp_if dm81xx_l4_ls__wd_timer1 = {
379 .master = &dm81xx_l4_ls_hwmod,
380 .slave = &dm81xx_wd_timer_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800381 .clk = "sysclk6_ck",
382 .user = OCP_USER_MPU,
383};
384
385/* I2C common */
386static struct omap_hwmod_class_sysconfig i2c_sysc = {
387 .rev_offs = 0x0,
388 .sysc_offs = 0x10,
389 .syss_offs = 0x90,
390 .sysc_flags = SYSC_HAS_SIDLEMODE |
391 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
392 SYSC_HAS_AUTOIDLE,
393 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
394 .sysc_fields = &omap_hwmod_sysc_type1,
395};
396
397static struct omap_hwmod_class i2c_class = {
398 .name = "i2c",
399 .sysc = &i2c_sysc,
400};
401
402static struct omap_hwmod dm81xx_i2c1_hwmod = {
403 .name = "i2c1",
404 .clkdm_name = "alwon_l3s_clkdm",
405 .main_clk = "sysclk10_ck",
406 .prcm = {
407 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700408 .clkctrl_offs = DM81XX_CM_ALWON_I2C_0_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800409 .modulemode = MODULEMODE_SWCTRL,
410 },
411 },
412 .class = &i2c_class,
413};
414
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700415static struct omap_hwmod_ocp_if dm81xx_l4_ls__i2c1 = {
416 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800417 .slave = &dm81xx_i2c1_hwmod,
418 .clk = "sysclk6_ck",
419 .user = OCP_USER_MPU,
420};
421
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700422static struct omap_hwmod dm81xx_i2c2_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800423 .name = "i2c2",
424 .clkdm_name = "alwon_l3s_clkdm",
425 .main_clk = "sysclk10_ck",
426 .prcm = {
427 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700428 .clkctrl_offs = DM81XX_CM_ALWON_I2C_1_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800429 .modulemode = MODULEMODE_SWCTRL,
430 },
431 },
432 .class = &i2c_class,
433};
434
435static struct omap_hwmod_class_sysconfig dm81xx_elm_sysc = {
436 .rev_offs = 0x0000,
437 .sysc_offs = 0x0010,
438 .syss_offs = 0x0014,
439 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
440 SYSC_HAS_SOFTRESET |
441 SYSS_HAS_RESET_STATUS,
442 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
443 .sysc_fields = &omap_hwmod_sysc_type1,
444};
445
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700446static struct omap_hwmod_ocp_if dm81xx_l4_ls__i2c2 = {
447 .master = &dm81xx_l4_ls_hwmod,
448 .slave = &dm81xx_i2c2_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800449 .clk = "sysclk6_ck",
450 .user = OCP_USER_MPU,
451};
452
453static struct omap_hwmod_class dm81xx_elm_hwmod_class = {
454 .name = "elm",
455 .sysc = &dm81xx_elm_sysc,
456};
457
458static struct omap_hwmod dm81xx_elm_hwmod = {
459 .name = "elm",
460 .clkdm_name = "alwon_l3s_clkdm",
461 .class = &dm81xx_elm_hwmod_class,
462 .main_clk = "sysclk6_ck",
463};
464
465static struct omap_hwmod_ocp_if dm81xx_l4_ls__elm = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700466 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800467 .slave = &dm81xx_elm_hwmod,
468 .user = OCP_USER_MPU,
469};
470
471static struct omap_hwmod_class_sysconfig dm81xx_gpio_sysc = {
472 .rev_offs = 0x0000,
473 .sysc_offs = 0x0010,
474 .syss_offs = 0x0114,
475 .sysc_flags = SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
476 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
477 SYSS_HAS_RESET_STATUS,
478 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
479 SIDLE_SMART_WKUP,
480 .sysc_fields = &omap_hwmod_sysc_type1,
481};
482
483static struct omap_hwmod_class dm81xx_gpio_hwmod_class = {
484 .name = "gpio",
485 .sysc = &dm81xx_gpio_sysc,
486 .rev = 2,
487};
488
489static struct omap_gpio_dev_attr gpio_dev_attr = {
490 .bank_width = 32,
491 .dbck_flag = true,
492};
493
494static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
495 { .role = "dbclk", .clk = "sysclk18_ck" },
496};
497
498static struct omap_hwmod dm81xx_gpio1_hwmod = {
499 .name = "gpio1",
500 .clkdm_name = "alwon_l3s_clkdm",
501 .class = &dm81xx_gpio_hwmod_class,
502 .main_clk = "sysclk6_ck",
503 .prcm = {
504 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700505 .clkctrl_offs = DM81XX_CM_ALWON_GPIO_0_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800506 .modulemode = MODULEMODE_SWCTRL,
507 },
508 },
509 .opt_clks = gpio1_opt_clks,
510 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
511 .dev_attr = &gpio_dev_attr,
512};
513
514static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio1 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700515 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800516 .slave = &dm81xx_gpio1_hwmod,
517 .user = OCP_USER_MPU,
518};
519
520static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
521 { .role = "dbclk", .clk = "sysclk18_ck" },
522};
523
524static struct omap_hwmod dm81xx_gpio2_hwmod = {
525 .name = "gpio2",
526 .clkdm_name = "alwon_l3s_clkdm",
527 .class = &dm81xx_gpio_hwmod_class,
528 .main_clk = "sysclk6_ck",
529 .prcm = {
530 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700531 .clkctrl_offs = DM81XX_CM_ALWON_GPIO_1_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800532 .modulemode = MODULEMODE_SWCTRL,
533 },
534 },
535 .opt_clks = gpio2_opt_clks,
536 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
537 .dev_attr = &gpio_dev_attr,
538};
539
540static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio2 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700541 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800542 .slave = &dm81xx_gpio2_hwmod,
543 .user = OCP_USER_MPU,
544};
545
546static struct omap_hwmod_class_sysconfig dm81xx_gpmc_sysc = {
547 .rev_offs = 0x0,
548 .sysc_offs = 0x10,
549 .syss_offs = 0x14,
550 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
551 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS,
552 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
553 .sysc_fields = &omap_hwmod_sysc_type1,
554};
555
556static struct omap_hwmod_class dm81xx_gpmc_hwmod_class = {
557 .name = "gpmc",
558 .sysc = &dm81xx_gpmc_sysc,
559};
560
561static struct omap_hwmod dm81xx_gpmc_hwmod = {
562 .name = "gpmc",
563 .clkdm_name = "alwon_l3s_clkdm",
564 .class = &dm81xx_gpmc_hwmod_class,
565 .main_clk = "sysclk6_ck",
Tony Lindgren63aa9452015-06-01 19:22:10 -0600566 /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
567 .flags = DEBUG_OMAP_GPMC_HWMOD_FLAGS,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800568 .prcm = {
569 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700570 .clkctrl_offs = DM81XX_CM_ALWON_GPMC_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800571 .modulemode = MODULEMODE_SWCTRL,
572 },
573 },
574};
575
Sekhar Norif734a9b2015-07-11 20:29:15 +0530576static struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__gpmc = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700577 .master = &dm81xx_alwon_l3_slow_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800578 .slave = &dm81xx_gpmc_hwmod,
579 .user = OCP_USER_MPU,
580};
581
582static struct omap_hwmod_class_sysconfig dm81xx_usbhsotg_sysc = {
583 .rev_offs = 0x0,
584 .sysc_offs = 0x10,
585 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
586 SYSC_HAS_SOFTRESET,
587 .idlemodes = SIDLE_SMART | MSTANDBY_FORCE | MSTANDBY_SMART,
588 .sysc_fields = &omap_hwmod_sysc_type2,
589};
590
591static struct omap_hwmod_class dm81xx_usbotg_class = {
592 .name = "usbotg",
593 .sysc = &dm81xx_usbhsotg_sysc,
594};
595
Tony Lindgrenf53850b2015-12-22 15:40:01 -0800596static struct omap_hwmod dm814x_usbss_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800597 .name = "usb_otg_hs",
598 .clkdm_name = "default_l3_slow_clkdm",
Tony Lindgrenf53850b2015-12-22 15:40:01 -0800599 .main_clk = "pll260dcoclkldo", /* 481c5260.adpll.dcoclkldo */
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800600 .prcm = {
601 .omap4 = {
Tony Lindgrenf53850b2015-12-22 15:40:01 -0800602 .clkctrl_offs = DM81XX_CM_DEFAULT_USB_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800603 .modulemode = MODULEMODE_SWCTRL,
604 },
605 },
606 .class = &dm81xx_usbotg_class,
607};
608
Tony Lindgrenf53850b2015-12-22 15:40:01 -0800609static struct omap_hwmod_ocp_if dm814x_default_l3_slow__usbss = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700610 .master = &dm81xx_default_l3_slow_hwmod,
Tony Lindgrenf53850b2015-12-22 15:40:01 -0800611 .slave = &dm814x_usbss_hwmod,
612 .clk = "sysclk6_ck",
613 .user = OCP_USER_MPU,
614};
615
616static struct omap_hwmod dm816x_usbss_hwmod = {
617 .name = "usb_otg_hs",
618 .clkdm_name = "default_l3_slow_clkdm",
619 .main_clk = "sysclk6_ck",
620 .prcm = {
621 .omap4 = {
622 .clkctrl_offs = DM81XX_CM_DEFAULT_USB_CLKCTRL,
623 .modulemode = MODULEMODE_SWCTRL,
624 },
625 },
626 .class = &dm81xx_usbotg_class,
627};
628
629static struct omap_hwmod_ocp_if dm816x_default_l3_slow__usbss = {
630 .master = &dm81xx_default_l3_slow_hwmod,
631 .slave = &dm816x_usbss_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800632 .clk = "sysclk6_ck",
633 .user = OCP_USER_MPU,
634};
635
636static struct omap_hwmod_class_sysconfig dm816x_timer_sysc = {
637 .rev_offs = 0x0000,
638 .sysc_offs = 0x0010,
639 .syss_offs = 0x0014,
640 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET,
641 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
642 SIDLE_SMART_WKUP,
643 .sysc_fields = &omap_hwmod_sysc_type2,
644};
645
646static struct omap_hwmod_class dm816x_timer_hwmod_class = {
647 .name = "timer",
648 .sysc = &dm816x_timer_sysc,
649};
650
651static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
652 .timer_capability = OMAP_TIMER_ALWON,
653};
654
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700655static struct omap_hwmod dm814x_timer1_hwmod = {
656 .name = "timer1",
657 .clkdm_name = "alwon_l3s_clkdm",
Tony Lindgrencb4db032015-12-03 12:02:31 -0800658 .main_clk = "timer1_fck",
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700659 .dev_attr = &capability_alwon_dev_attr,
660 .class = &dm816x_timer_hwmod_class,
661 .flags = HWMOD_NO_IDLEST,
662};
663
664static struct omap_hwmod_ocp_if dm814x_l4_ls__timer1 = {
665 .master = &dm81xx_l4_ls_hwmod,
666 .slave = &dm814x_timer1_hwmod,
Tony Lindgrencb4db032015-12-03 12:02:31 -0800667 .clk = "timer1_fck",
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700668 .user = OCP_USER_MPU,
669};
670
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800671static struct omap_hwmod dm816x_timer1_hwmod = {
672 .name = "timer1",
673 .clkdm_name = "alwon_l3s_clkdm",
674 .main_clk = "timer1_fck",
675 .prcm = {
676 .omap4 = {
677 .clkctrl_offs = DM816X_CM_ALWON_TIMER_1_CLKCTRL,
678 .modulemode = MODULEMODE_SWCTRL,
679 },
680 },
681 .dev_attr = &capability_alwon_dev_attr,
682 .class = &dm816x_timer_hwmod_class,
683};
684
685static struct omap_hwmod_ocp_if dm816x_l4_ls__timer1 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700686 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800687 .slave = &dm816x_timer1_hwmod,
688 .clk = "sysclk6_ck",
689 .user = OCP_USER_MPU,
690};
691
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700692static struct omap_hwmod dm814x_timer2_hwmod = {
693 .name = "timer2",
694 .clkdm_name = "alwon_l3s_clkdm",
Tony Lindgrencb4db032015-12-03 12:02:31 -0800695 .main_clk = "timer2_fck",
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700696 .dev_attr = &capability_alwon_dev_attr,
697 .class = &dm816x_timer_hwmod_class,
698 .flags = HWMOD_NO_IDLEST,
699};
700
701static struct omap_hwmod_ocp_if dm814x_l4_ls__timer2 = {
702 .master = &dm81xx_l4_ls_hwmod,
703 .slave = &dm814x_timer2_hwmod,
Tony Lindgrencb4db032015-12-03 12:02:31 -0800704 .clk = "timer2_fck",
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700705 .user = OCP_USER_MPU,
706};
707
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800708static struct omap_hwmod dm816x_timer2_hwmod = {
709 .name = "timer2",
710 .clkdm_name = "alwon_l3s_clkdm",
711 .main_clk = "timer2_fck",
712 .prcm = {
713 .omap4 = {
714 .clkctrl_offs = DM816X_CM_ALWON_TIMER_2_CLKCTRL,
715 .modulemode = MODULEMODE_SWCTRL,
716 },
717 },
718 .dev_attr = &capability_alwon_dev_attr,
719 .class = &dm816x_timer_hwmod_class,
720};
721
722static struct omap_hwmod_ocp_if dm816x_l4_ls__timer2 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700723 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800724 .slave = &dm816x_timer2_hwmod,
725 .clk = "sysclk6_ck",
726 .user = OCP_USER_MPU,
727};
728
729static struct omap_hwmod dm816x_timer3_hwmod = {
730 .name = "timer3",
731 .clkdm_name = "alwon_l3s_clkdm",
732 .main_clk = "timer3_fck",
733 .prcm = {
734 .omap4 = {
735 .clkctrl_offs = DM816X_CM_ALWON_TIMER_3_CLKCTRL,
736 .modulemode = MODULEMODE_SWCTRL,
737 },
738 },
739 .dev_attr = &capability_alwon_dev_attr,
740 .class = &dm816x_timer_hwmod_class,
741};
742
743static struct omap_hwmod_ocp_if dm816x_l4_ls__timer3 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700744 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800745 .slave = &dm816x_timer3_hwmod,
746 .clk = "sysclk6_ck",
747 .user = OCP_USER_MPU,
748};
749
750static struct omap_hwmod dm816x_timer4_hwmod = {
751 .name = "timer4",
752 .clkdm_name = "alwon_l3s_clkdm",
753 .main_clk = "timer4_fck",
754 .prcm = {
755 .omap4 = {
756 .clkctrl_offs = DM816X_CM_ALWON_TIMER_4_CLKCTRL,
757 .modulemode = MODULEMODE_SWCTRL,
758 },
759 },
760 .dev_attr = &capability_alwon_dev_attr,
761 .class = &dm816x_timer_hwmod_class,
762};
763
764static struct omap_hwmod_ocp_if dm816x_l4_ls__timer4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700765 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800766 .slave = &dm816x_timer4_hwmod,
767 .clk = "sysclk6_ck",
768 .user = OCP_USER_MPU,
769};
770
771static struct omap_hwmod dm816x_timer5_hwmod = {
772 .name = "timer5",
773 .clkdm_name = "alwon_l3s_clkdm",
774 .main_clk = "timer5_fck",
775 .prcm = {
776 .omap4 = {
777 .clkctrl_offs = DM816X_CM_ALWON_TIMER_5_CLKCTRL,
778 .modulemode = MODULEMODE_SWCTRL,
779 },
780 },
781 .dev_attr = &capability_alwon_dev_attr,
782 .class = &dm816x_timer_hwmod_class,
783};
784
785static struct omap_hwmod_ocp_if dm816x_l4_ls__timer5 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700786 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800787 .slave = &dm816x_timer5_hwmod,
788 .clk = "sysclk6_ck",
789 .user = OCP_USER_MPU,
790};
791
792static struct omap_hwmod dm816x_timer6_hwmod = {
793 .name = "timer6",
794 .clkdm_name = "alwon_l3s_clkdm",
795 .main_clk = "timer6_fck",
796 .prcm = {
797 .omap4 = {
798 .clkctrl_offs = DM816X_CM_ALWON_TIMER_6_CLKCTRL,
799 .modulemode = MODULEMODE_SWCTRL,
800 },
801 },
802 .dev_attr = &capability_alwon_dev_attr,
803 .class = &dm816x_timer_hwmod_class,
804};
805
806static struct omap_hwmod_ocp_if dm816x_l4_ls__timer6 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700807 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800808 .slave = &dm816x_timer6_hwmod,
809 .clk = "sysclk6_ck",
810 .user = OCP_USER_MPU,
811};
812
813static struct omap_hwmod dm816x_timer7_hwmod = {
814 .name = "timer7",
815 .clkdm_name = "alwon_l3s_clkdm",
816 .main_clk = "timer7_fck",
817 .prcm = {
818 .omap4 = {
819 .clkctrl_offs = DM816X_CM_ALWON_TIMER_7_CLKCTRL,
820 .modulemode = MODULEMODE_SWCTRL,
821 },
822 },
823 .dev_attr = &capability_alwon_dev_attr,
824 .class = &dm816x_timer_hwmod_class,
825};
826
827static struct omap_hwmod_ocp_if dm816x_l4_ls__timer7 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700828 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800829 .slave = &dm816x_timer7_hwmod,
830 .clk = "sysclk6_ck",
831 .user = OCP_USER_MPU,
832};
833
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700834/* CPSW on dm814x */
835static struct omap_hwmod_class_sysconfig dm814x_cpgmac_sysc = {
836 .rev_offs = 0x0,
837 .sysc_offs = 0x8,
838 .syss_offs = 0x4,
839 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
840 SYSS_HAS_RESET_STATUS,
841 .idlemodes = SIDLE_FORCE | SIDLE_NO | MSTANDBY_FORCE |
842 MSTANDBY_NO,
843 .sysc_fields = &omap_hwmod_sysc_type3,
844};
845
846static struct omap_hwmod_class dm814x_cpgmac0_hwmod_class = {
847 .name = "cpgmac0",
848 .sysc = &dm814x_cpgmac_sysc,
849};
850
Tony Lindgren24da7412015-07-23 21:59:18 -0700851static struct omap_hwmod dm814x_cpgmac0_hwmod = {
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700852 .name = "cpgmac0",
853 .class = &dm814x_cpgmac0_hwmod_class,
854 .clkdm_name = "alwon_ethernet_clkdm",
855 .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
856 .main_clk = "cpsw_125mhz_gclk",
857 .prcm = {
858 .omap4 = {
859 .clkctrl_offs = DM81XX_CM_ALWON_ETHERNET_0_CLKCTRL,
860 .modulemode = MODULEMODE_SWCTRL,
861 },
862 },
863};
864
865static struct omap_hwmod_class dm814x_mdio_hwmod_class = {
866 .name = "davinci_mdio",
867};
868
Tony Lindgren24da7412015-07-23 21:59:18 -0700869static struct omap_hwmod dm814x_mdio_hwmod = {
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700870 .name = "davinci_mdio",
871 .class = &dm814x_mdio_hwmod_class,
872 .clkdm_name = "alwon_ethernet_clkdm",
873 .main_clk = "cpsw_125mhz_gclk",
874};
875
876static struct omap_hwmod_ocp_if dm814x_l4_hs__cpgmac0 = {
877 .master = &dm81xx_l4_hs_hwmod,
878 .slave = &dm814x_cpgmac0_hwmod,
879 .clk = "cpsw_125mhz_gclk",
880 .user = OCP_USER_MPU,
881};
882
Tony Lindgren24da7412015-07-23 21:59:18 -0700883static struct omap_hwmod_ocp_if dm814x_cpgmac0__mdio = {
Tony Lindgren0f3ccb22015-07-16 01:55:58 -0700884 .master = &dm814x_cpgmac0_hwmod,
885 .slave = &dm814x_mdio_hwmod,
886 .user = OCP_USER_MPU,
887 .flags = HWMOD_NO_IDLEST,
888};
889
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800890/* EMAC Ethernet */
891static struct omap_hwmod_class_sysconfig dm816x_emac_sysc = {
892 .rev_offs = 0x0,
893 .sysc_offs = 0x4,
894 .sysc_flags = SYSC_HAS_SOFTRESET,
895 .sysc_fields = &omap_hwmod_sysc_type2,
896};
897
898static struct omap_hwmod_class dm816x_emac_hwmod_class = {
899 .name = "emac",
900 .sysc = &dm816x_emac_sysc,
901};
902
903/*
904 * On dm816x the MDIO is within EMAC0. As the MDIO driver is a separate
905 * driver probed before EMAC0, we let MDIO do the clock idling.
906 */
907static struct omap_hwmod dm816x_emac0_hwmod = {
908 .name = "emac0",
909 .clkdm_name = "alwon_ethernet_clkdm",
910 .class = &dm816x_emac_hwmod_class,
Neil Armstrong29f5b342015-11-13 17:29:53 +0100911 .flags = HWMOD_NO_IDLEST,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800912};
913
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700914static struct omap_hwmod_ocp_if dm81xx_l4_hs__emac0 = {
915 .master = &dm81xx_l4_hs_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800916 .slave = &dm816x_emac0_hwmod,
917 .clk = "sysclk5_ck",
918 .user = OCP_USER_MPU,
919};
920
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700921static struct omap_hwmod_class dm81xx_mdio_hwmod_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800922 .name = "davinci_mdio",
923 .sysc = &dm816x_emac_sysc,
924};
925
Tony Lindgren24da7412015-07-23 21:59:18 -0700926static struct omap_hwmod dm81xx_emac0_mdio_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800927 .name = "davinci_mdio",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700928 .class = &dm81xx_mdio_hwmod_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800929 .clkdm_name = "alwon_ethernet_clkdm",
930 .main_clk = "sysclk24_ck",
931 .flags = HWMOD_NO_IDLEST,
932 /*
933 * REVISIT: This should be moved to the emac0_hwmod
934 * once we have a better way to handle device slaves.
935 */
936 .prcm = {
937 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700938 .clkctrl_offs = DM81XX_CM_ALWON_ETHERNET_0_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800939 .modulemode = MODULEMODE_SWCTRL,
940 },
941 },
942};
943
Tony Lindgren24da7412015-07-23 21:59:18 -0700944static struct omap_hwmod_ocp_if dm81xx_emac0__mdio = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700945 .master = &dm81xx_l4_hs_hwmod,
946 .slave = &dm81xx_emac0_mdio_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800947 .user = OCP_USER_MPU,
948};
949
950static struct omap_hwmod dm816x_emac1_hwmod = {
951 .name = "emac1",
952 .clkdm_name = "alwon_ethernet_clkdm",
953 .main_clk = "sysclk24_ck",
954 .flags = HWMOD_NO_IDLEST,
955 .prcm = {
956 .omap4 = {
957 .clkctrl_offs = DM816X_CM_ALWON_ETHERNET_1_CLKCTRL,
958 .modulemode = MODULEMODE_SWCTRL,
959 },
960 },
961 .class = &dm816x_emac_hwmod_class,
962};
963
964static struct omap_hwmod_ocp_if dm816x_l4_hs__emac1 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -0700965 .master = &dm81xx_l4_hs_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800966 .slave = &dm816x_emac1_hwmod,
967 .clk = "sysclk5_ck",
968 .user = OCP_USER_MPU,
969};
970
Tony Lindgrenc757fda2015-12-22 15:39:41 -0800971static struct omap_hwmod_class_sysconfig dm81xx_mmc_sysc = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800972 .rev_offs = 0x0,
973 .sysc_offs = 0x110,
974 .syss_offs = 0x114,
975 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
976 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
977 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS,
978 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
979 .sysc_fields = &omap_hwmod_sysc_type1,
980};
981
Tony Lindgrenc757fda2015-12-22 15:39:41 -0800982static struct omap_hwmod_class dm81xx_mmc_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800983 .name = "mmc",
Tony Lindgrenc757fda2015-12-22 15:39:41 -0800984 .sysc = &dm81xx_mmc_sysc,
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800985};
986
Tony Lindgrenc757fda2015-12-22 15:39:41 -0800987static struct omap_hwmod_opt_clk dm81xx_mmc_opt_clks[] = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -0800988 { .role = "dbck", .clk = "sysclk18_ck", },
989};
990
Tony Lindgrenc757fda2015-12-22 15:39:41 -0800991static struct omap_hsmmc_dev_attr mmc_dev_attr = {
992};
993
994static struct omap_hwmod dm814x_mmc1_hwmod = {
995 .name = "mmc1",
996 .clkdm_name = "alwon_l3s_clkdm",
997 .opt_clks = dm81xx_mmc_opt_clks,
998 .opt_clks_cnt = ARRAY_SIZE(dm81xx_mmc_opt_clks),
999 .main_clk = "sysclk8_ck",
1000 .prcm = {
1001 .omap4 = {
1002 .clkctrl_offs = DM814X_CM_ALWON_MMCHS_0_CLKCTRL,
1003 .modulemode = MODULEMODE_SWCTRL,
1004 },
1005 },
1006 .dev_attr = &mmc_dev_attr,
1007 .class = &dm81xx_mmc_class,
1008};
1009
1010static struct omap_hwmod_ocp_if dm814x_l4_ls__mmc1 = {
1011 .master = &dm81xx_l4_ls_hwmod,
1012 .slave = &dm814x_mmc1_hwmod,
1013 .clk = "sysclk6_ck",
1014 .user = OCP_USER_MPU,
1015 .flags = OMAP_FIREWALL_L4
1016};
1017
1018static struct omap_hwmod dm814x_mmc2_hwmod = {
1019 .name = "mmc2",
1020 .clkdm_name = "alwon_l3s_clkdm",
1021 .opt_clks = dm81xx_mmc_opt_clks,
1022 .opt_clks_cnt = ARRAY_SIZE(dm81xx_mmc_opt_clks),
1023 .main_clk = "sysclk8_ck",
1024 .prcm = {
1025 .omap4 = {
1026 .clkctrl_offs = DM814X_CM_ALWON_MMCHS_1_CLKCTRL,
1027 .modulemode = MODULEMODE_SWCTRL,
1028 },
1029 },
1030 .dev_attr = &mmc_dev_attr,
1031 .class = &dm81xx_mmc_class,
1032};
1033
1034static struct omap_hwmod_ocp_if dm814x_l4_ls__mmc2 = {
1035 .master = &dm81xx_l4_ls_hwmod,
1036 .slave = &dm814x_mmc2_hwmod,
1037 .clk = "sysclk6_ck",
1038 .user = OCP_USER_MPU,
1039 .flags = OMAP_FIREWALL_L4
1040};
1041
1042static struct omap_hwmod dm814x_mmc3_hwmod = {
1043 .name = "mmc3",
1044 .clkdm_name = "alwon_l3_med_clkdm",
1045 .opt_clks = dm81xx_mmc_opt_clks,
1046 .opt_clks_cnt = ARRAY_SIZE(dm81xx_mmc_opt_clks),
1047 .main_clk = "sysclk8_ck",
1048 .prcm = {
1049 .omap4 = {
1050 .clkctrl_offs = DM814X_CM_ALWON_MMCHS_2_CLKCTRL,
1051 .modulemode = MODULEMODE_SWCTRL,
1052 },
1053 },
1054 .dev_attr = &mmc_dev_attr,
1055 .class = &dm81xx_mmc_class,
1056};
1057
1058static struct omap_hwmod_ocp_if dm814x_alwon_l3_med__mmc3 = {
1059 .master = &dm81xx_alwon_l3_med_hwmod,
1060 .slave = &dm814x_mmc3_hwmod,
1061 .clk = "sysclk4_ck",
1062 .user = OCP_USER_MPU,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001063};
1064
1065static struct omap_hwmod dm816x_mmc1_hwmod = {
1066 .name = "mmc1",
1067 .clkdm_name = "alwon_l3s_clkdm",
Tony Lindgrenc757fda2015-12-22 15:39:41 -08001068 .opt_clks = dm81xx_mmc_opt_clks,
1069 .opt_clks_cnt = ARRAY_SIZE(dm81xx_mmc_opt_clks),
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001070 .main_clk = "sysclk10_ck",
1071 .prcm = {
1072 .omap4 = {
1073 .clkctrl_offs = DM816X_CM_ALWON_SDIO_CLKCTRL,
1074 .modulemode = MODULEMODE_SWCTRL,
1075 },
1076 },
Tony Lindgrenc757fda2015-12-22 15:39:41 -08001077 .dev_attr = &mmc_dev_attr,
1078 .class = &dm81xx_mmc_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001079};
1080
1081static struct omap_hwmod_ocp_if dm816x_l4_ls__mmc1 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001082 .master = &dm81xx_l4_ls_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001083 .slave = &dm816x_mmc1_hwmod,
1084 .clk = "sysclk6_ck",
1085 .user = OCP_USER_MPU,
1086 .flags = OMAP_FIREWALL_L4
1087};
1088
1089static struct omap_hwmod_class_sysconfig dm816x_mcspi_sysc = {
1090 .rev_offs = 0x0,
1091 .sysc_offs = 0x110,
1092 .syss_offs = 0x114,
1093 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1094 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
1095 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS,
1096 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
1097 .sysc_fields = &omap_hwmod_sysc_type1,
1098};
1099
1100static struct omap_hwmod_class dm816x_mcspi_class = {
1101 .name = "mcspi",
1102 .sysc = &dm816x_mcspi_sysc,
1103 .rev = OMAP3_MCSPI_REV,
1104};
1105
1106static struct omap2_mcspi_dev_attr dm816x_mcspi1_dev_attr = {
1107 .num_chipselect = 4,
1108};
1109
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001110static struct omap_hwmod dm81xx_mcspi1_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001111 .name = "mcspi1",
1112 .clkdm_name = "alwon_l3s_clkdm",
1113 .main_clk = "sysclk10_ck",
1114 .prcm = {
1115 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001116 .clkctrl_offs = DM81XX_CM_ALWON_SPI_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001117 .modulemode = MODULEMODE_SWCTRL,
1118 },
1119 },
1120 .class = &dm816x_mcspi_class,
1121 .dev_attr = &dm816x_mcspi1_dev_attr,
1122};
1123
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001124static struct omap_hwmod_ocp_if dm81xx_l4_ls__mcspi1 = {
1125 .master = &dm81xx_l4_ls_hwmod,
1126 .slave = &dm81xx_mcspi1_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001127 .clk = "sysclk6_ck",
1128 .user = OCP_USER_MPU,
1129};
1130
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001131static struct omap_hwmod_class_sysconfig dm81xx_mailbox_sysc = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001132 .rev_offs = 0x000,
1133 .sysc_offs = 0x010,
1134 .syss_offs = 0x014,
1135 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1136 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE,
1137 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
1138 .sysc_fields = &omap_hwmod_sysc_type1,
1139};
1140
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001141static struct omap_hwmod_class dm81xx_mailbox_hwmod_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001142 .name = "mailbox",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001143 .sysc = &dm81xx_mailbox_sysc,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001144};
1145
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001146static struct omap_hwmod dm81xx_mailbox_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001147 .name = "mailbox",
1148 .clkdm_name = "alwon_l3s_clkdm",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001149 .class = &dm81xx_mailbox_hwmod_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001150 .main_clk = "sysclk6_ck",
1151 .prcm = {
1152 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001153 .clkctrl_offs = DM81XX_CM_ALWON_MAILBOX_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001154 .modulemode = MODULEMODE_SWCTRL,
1155 },
1156 },
1157};
1158
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001159static struct omap_hwmod_ocp_if dm81xx_l4_ls__mailbox = {
1160 .master = &dm81xx_l4_ls_hwmod,
1161 .slave = &dm81xx_mailbox_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001162 .user = OCP_USER_MPU,
1163};
1164
Neil Armstrong15395692015-10-22 11:18:59 +02001165static struct omap_hwmod_class_sysconfig dm81xx_spinbox_sysc = {
1166 .rev_offs = 0x000,
1167 .sysc_offs = 0x010,
1168 .syss_offs = 0x014,
1169 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
1170 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE,
1171 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
1172 .sysc_fields = &omap_hwmod_sysc_type1,
1173};
1174
1175static struct omap_hwmod_class dm81xx_spinbox_hwmod_class = {
1176 .name = "spinbox",
1177 .sysc = &dm81xx_spinbox_sysc,
1178};
1179
1180static struct omap_hwmod dm81xx_spinbox_hwmod = {
1181 .name = "spinbox",
1182 .clkdm_name = "alwon_l3s_clkdm",
1183 .class = &dm81xx_spinbox_hwmod_class,
1184 .main_clk = "sysclk6_ck",
1185 .prcm = {
1186 .omap4 = {
1187 .clkctrl_offs = DM81XX_CM_ALWON_SPINBOX_CLKCTRL,
1188 .modulemode = MODULEMODE_SWCTRL,
1189 },
1190 },
1191};
1192
1193static struct omap_hwmod_ocp_if dm81xx_l4_ls__spinbox = {
1194 .master = &dm81xx_l4_ls_hwmod,
1195 .slave = &dm81xx_spinbox_hwmod,
1196 .user = OCP_USER_MPU,
1197};
1198
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001199static struct omap_hwmod_class dm81xx_tpcc_hwmod_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001200 .name = "tpcc",
1201};
1202
Tony Lindgren24da7412015-07-23 21:59:18 -07001203static struct omap_hwmod dm81xx_tpcc_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001204 .name = "tpcc",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001205 .class = &dm81xx_tpcc_hwmod_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001206 .clkdm_name = "alwon_l3s_clkdm",
1207 .main_clk = "sysclk4_ck",
1208 .prcm = {
1209 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001210 .clkctrl_offs = DM81XX_CM_ALWON_TPCC_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001211 .modulemode = MODULEMODE_SWCTRL,
1212 },
1213 },
1214};
1215
Tony Lindgren24da7412015-07-23 21:59:18 -07001216static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tpcc = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001217 .master = &dm81xx_alwon_l3_fast_hwmod,
1218 .slave = &dm81xx_tpcc_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001219 .clk = "sysclk4_ck",
1220 .user = OCP_USER_MPU,
1221};
1222
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001223static struct omap_hwmod_addr_space dm81xx_tptc0_addr_space[] = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001224 {
1225 .pa_start = 0x49800000,
1226 .pa_end = 0x49800000 + SZ_8K - 1,
1227 .flags = ADDR_TYPE_RT,
1228 },
1229 { },
1230};
1231
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001232static struct omap_hwmod_class dm81xx_tptc0_hwmod_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001233 .name = "tptc0",
1234};
1235
Tony Lindgren24da7412015-07-23 21:59:18 -07001236static struct omap_hwmod dm81xx_tptc0_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001237 .name = "tptc0",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001238 .class = &dm81xx_tptc0_hwmod_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001239 .clkdm_name = "alwon_l3s_clkdm",
1240 .main_clk = "sysclk4_ck",
1241 .prcm = {
1242 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001243 .clkctrl_offs = DM81XX_CM_ALWON_TPTC0_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001244 .modulemode = MODULEMODE_SWCTRL,
1245 },
1246 },
1247};
1248
Tony Lindgren24da7412015-07-23 21:59:18 -07001249static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc0 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001250 .master = &dm81xx_alwon_l3_fast_hwmod,
1251 .slave = &dm81xx_tptc0_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001252 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001253 .addr = dm81xx_tptc0_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001254 .user = OCP_USER_MPU,
1255};
1256
Tony Lindgren24da7412015-07-23 21:59:18 -07001257static struct omap_hwmod_ocp_if dm81xx_tptc0__alwon_l3_fast = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001258 .master = &dm81xx_tptc0_hwmod,
1259 .slave = &dm81xx_alwon_l3_fast_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001260 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001261 .addr = dm81xx_tptc0_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001262 .user = OCP_USER_MPU,
1263};
1264
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001265static struct omap_hwmod_addr_space dm81xx_tptc1_addr_space[] = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001266 {
1267 .pa_start = 0x49900000,
1268 .pa_end = 0x49900000 + SZ_8K - 1,
1269 .flags = ADDR_TYPE_RT,
1270 },
1271 { },
1272};
1273
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001274static struct omap_hwmod_class dm81xx_tptc1_hwmod_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001275 .name = "tptc1",
1276};
1277
Tony Lindgren24da7412015-07-23 21:59:18 -07001278static struct omap_hwmod dm81xx_tptc1_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001279 .name = "tptc1",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001280 .class = &dm81xx_tptc1_hwmod_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001281 .clkdm_name = "alwon_l3s_clkdm",
1282 .main_clk = "sysclk4_ck",
1283 .prcm = {
1284 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001285 .clkctrl_offs = DM81XX_CM_ALWON_TPTC1_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001286 .modulemode = MODULEMODE_SWCTRL,
1287 },
1288 },
1289};
1290
Tony Lindgren24da7412015-07-23 21:59:18 -07001291static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc1 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001292 .master = &dm81xx_alwon_l3_fast_hwmod,
1293 .slave = &dm81xx_tptc1_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001294 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001295 .addr = dm81xx_tptc1_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001296 .user = OCP_USER_MPU,
1297};
1298
Tony Lindgren24da7412015-07-23 21:59:18 -07001299static struct omap_hwmod_ocp_if dm81xx_tptc1__alwon_l3_fast = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001300 .master = &dm81xx_tptc1_hwmod,
1301 .slave = &dm81xx_alwon_l3_fast_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001302 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001303 .addr = dm81xx_tptc1_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001304 .user = OCP_USER_MPU,
1305};
1306
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001307static struct omap_hwmod_addr_space dm81xx_tptc2_addr_space[] = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001308 {
1309 .pa_start = 0x49a00000,
1310 .pa_end = 0x49a00000 + SZ_8K - 1,
1311 .flags = ADDR_TYPE_RT,
1312 },
1313 { },
1314};
1315
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001316static struct omap_hwmod_class dm81xx_tptc2_hwmod_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001317 .name = "tptc2",
1318};
1319
Tony Lindgren24da7412015-07-23 21:59:18 -07001320static struct omap_hwmod dm81xx_tptc2_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001321 .name = "tptc2",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001322 .class = &dm81xx_tptc2_hwmod_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001323 .clkdm_name = "alwon_l3s_clkdm",
1324 .main_clk = "sysclk4_ck",
1325 .prcm = {
1326 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001327 .clkctrl_offs = DM81XX_CM_ALWON_TPTC2_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001328 .modulemode = MODULEMODE_SWCTRL,
1329 },
1330 },
1331};
1332
Tony Lindgren24da7412015-07-23 21:59:18 -07001333static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc2 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001334 .master = &dm81xx_alwon_l3_fast_hwmod,
1335 .slave = &dm81xx_tptc2_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001336 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001337 .addr = dm81xx_tptc2_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001338 .user = OCP_USER_MPU,
1339};
1340
Tony Lindgren24da7412015-07-23 21:59:18 -07001341static struct omap_hwmod_ocp_if dm81xx_tptc2__alwon_l3_fast = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001342 .master = &dm81xx_tptc2_hwmod,
1343 .slave = &dm81xx_alwon_l3_fast_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001344 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001345 .addr = dm81xx_tptc2_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001346 .user = OCP_USER_MPU,
1347};
1348
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001349static struct omap_hwmod_addr_space dm81xx_tptc3_addr_space[] = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001350 {
1351 .pa_start = 0x49b00000,
1352 .pa_end = 0x49b00000 + SZ_8K - 1,
1353 .flags = ADDR_TYPE_RT,
1354 },
1355 { },
1356};
1357
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001358static struct omap_hwmod_class dm81xx_tptc3_hwmod_class = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001359 .name = "tptc3",
1360};
1361
Tony Lindgren24da7412015-07-23 21:59:18 -07001362static struct omap_hwmod dm81xx_tptc3_hwmod = {
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001363 .name = "tptc3",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001364 .class = &dm81xx_tptc3_hwmod_class,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001365 .clkdm_name = "alwon_l3s_clkdm",
1366 .main_clk = "sysclk4_ck",
1367 .prcm = {
1368 .omap4 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001369 .clkctrl_offs = DM81XX_CM_ALWON_TPTC3_CLKCTRL,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001370 .modulemode = MODULEMODE_SWCTRL,
1371 },
1372 },
1373};
1374
Tony Lindgren24da7412015-07-23 21:59:18 -07001375static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc3 = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001376 .master = &dm81xx_alwon_l3_fast_hwmod,
1377 .slave = &dm81xx_tptc3_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001378 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001379 .addr = dm81xx_tptc3_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001380 .user = OCP_USER_MPU,
1381};
1382
Tony Lindgren24da7412015-07-23 21:59:18 -07001383static struct omap_hwmod_ocp_if dm81xx_tptc3__alwon_l3_fast = {
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001384 .master = &dm81xx_tptc3_hwmod,
1385 .slave = &dm81xx_alwon_l3_fast_hwmod,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001386 .clk = "sysclk4_ck",
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001387 .addr = dm81xx_tptc3_addr_space,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001388 .user = OCP_USER_MPU,
1389};
1390
Tony Lindgren0f3ccb22015-07-16 01:55:58 -07001391/*
1392 * REVISIT: Test and enable the following once clocks work:
Tony Lindgren0f3ccb22015-07-16 01:55:58 -07001393 * dm81xx_l4_ls__mailbox
Tony Lindgren0f3ccb22015-07-16 01:55:58 -07001394 *
1395 * Also note that some devices share a single clkctrl_offs..
1396 * For example, i2c1 and 3 share one, and i2c2 and 4 share one.
1397 */
1398static struct omap_hwmod_ocp_if *dm814x_hwmod_ocp_ifs[] __initdata = {
1399 &dm814x_mpu__alwon_l3_slow,
1400 &dm814x_mpu__alwon_l3_med,
1401 &dm81xx_alwon_l3_slow__l4_ls,
1402 &dm81xx_alwon_l3_slow__l4_hs,
1403 &dm81xx_l4_ls__uart1,
1404 &dm81xx_l4_ls__uart2,
1405 &dm81xx_l4_ls__uart3,
1406 &dm81xx_l4_ls__wd_timer1,
1407 &dm81xx_l4_ls__i2c1,
1408 &dm81xx_l4_ls__i2c2,
Tony Lindgren3022b292015-12-03 12:02:32 -08001409 &dm81xx_l4_ls__gpio1,
1410 &dm81xx_l4_ls__gpio2,
Tony Lindgren0f3ccb22015-07-16 01:55:58 -07001411 &dm81xx_l4_ls__elm,
1412 &dm81xx_l4_ls__mcspi1,
Tony Lindgrenc757fda2015-12-22 15:39:41 -08001413 &dm814x_l4_ls__mmc1,
1414 &dm814x_l4_ls__mmc2,
Tony Lindgrenc5803242016-02-26 11:00:22 -08001415 &ti81xx_l4_ls__rtc,
Tony Lindgren0f3ccb22015-07-16 01:55:58 -07001416 &dm81xx_alwon_l3_fast__tpcc,
1417 &dm81xx_alwon_l3_fast__tptc0,
1418 &dm81xx_alwon_l3_fast__tptc1,
1419 &dm81xx_alwon_l3_fast__tptc2,
1420 &dm81xx_alwon_l3_fast__tptc3,
1421 &dm81xx_tptc0__alwon_l3_fast,
1422 &dm81xx_tptc1__alwon_l3_fast,
1423 &dm81xx_tptc2__alwon_l3_fast,
1424 &dm81xx_tptc3__alwon_l3_fast,
1425 &dm814x_l4_ls__timer1,
1426 &dm814x_l4_ls__timer2,
1427 &dm814x_l4_hs__cpgmac0,
1428 &dm814x_cpgmac0__mdio,
Tony Lindgrenf53850b2015-12-22 15:40:01 -08001429 &dm81xx_alwon_l3_slow__gpmc,
1430 &dm814x_default_l3_slow__usbss,
Tony Lindgrenc757fda2015-12-22 15:39:41 -08001431 &dm814x_alwon_l3_med__mmc3,
Tony Lindgren0f3ccb22015-07-16 01:55:58 -07001432 NULL,
1433};
1434
1435int __init dm814x_hwmod_init(void)
1436{
1437 omap_hwmod_init();
1438 return omap_hwmod_register_links(dm814x_hwmod_ocp_ifs);
1439}
1440
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001441static struct omap_hwmod_ocp_if *dm816x_hwmod_ocp_ifs[] __initdata = {
1442 &dm816x_mpu__alwon_l3_slow,
1443 &dm816x_mpu__alwon_l3_med,
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001444 &dm81xx_alwon_l3_slow__l4_ls,
1445 &dm81xx_alwon_l3_slow__l4_hs,
1446 &dm81xx_l4_ls__uart1,
1447 &dm81xx_l4_ls__uart2,
1448 &dm81xx_l4_ls__uart3,
1449 &dm81xx_l4_ls__wd_timer1,
1450 &dm81xx_l4_ls__i2c1,
1451 &dm81xx_l4_ls__i2c2,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001452 &dm81xx_l4_ls__gpio1,
1453 &dm81xx_l4_ls__gpio2,
1454 &dm81xx_l4_ls__elm,
Tony Lindgrenc5803242016-02-26 11:00:22 -08001455 &ti81xx_l4_ls__rtc,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001456 &dm816x_l4_ls__mmc1,
1457 &dm816x_l4_ls__timer1,
1458 &dm816x_l4_ls__timer2,
1459 &dm816x_l4_ls__timer3,
1460 &dm816x_l4_ls__timer4,
1461 &dm816x_l4_ls__timer5,
1462 &dm816x_l4_ls__timer6,
1463 &dm816x_l4_ls__timer7,
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001464 &dm81xx_l4_ls__mcspi1,
1465 &dm81xx_l4_ls__mailbox,
Neil Armstrong15395692015-10-22 11:18:59 +02001466 &dm81xx_l4_ls__spinbox,
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001467 &dm81xx_l4_hs__emac0,
1468 &dm81xx_emac0__mdio,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001469 &dm816x_l4_hs__emac1,
Tony Lindgren7e1b11d2015-07-16 01:55:58 -07001470 &dm81xx_alwon_l3_fast__tpcc,
1471 &dm81xx_alwon_l3_fast__tptc0,
1472 &dm81xx_alwon_l3_fast__tptc1,
1473 &dm81xx_alwon_l3_fast__tptc2,
1474 &dm81xx_alwon_l3_fast__tptc3,
1475 &dm81xx_tptc0__alwon_l3_fast,
1476 &dm81xx_tptc1__alwon_l3_fast,
1477 &dm81xx_tptc2__alwon_l3_fast,
1478 &dm81xx_tptc3__alwon_l3_fast,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001479 &dm81xx_alwon_l3_slow__gpmc,
Tony Lindgrenf53850b2015-12-22 15:40:01 -08001480 &dm816x_default_l3_slow__usbss,
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001481 NULL,
1482};
1483
Tony Lindgren0f3ccb22015-07-16 01:55:58 -07001484int __init dm816x_hwmod_init(void)
Tony Lindgren4d38bd12015-01-26 09:26:32 -08001485{
1486 omap_hwmod_init();
1487 return omap_hwmod_register_links(dm816x_hwmod_ocp_ifs);
1488}