omap_hwmod_2xxx_ipblock_data.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875
  1. /*
  2. * omap_hwmod_2xxx_ipblock_data.c - common IP block data for OMAP2xxx
  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. #include <linux/platform_data/gpio-omap.h>
  12. #include <linux/omap-dma.h>
  13. #include <plat/dmtimer.h>
  14. #include <linux/platform_data/spi-omap2-mcspi.h>
  15. #include "omap_hwmod.h"
  16. #include "omap_hwmod_common_data.h"
  17. #include "cm-regbits-24xx.h"
  18. #include "prm-regbits-24xx.h"
  19. #include "wd_timer.h"
  20. static struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = {
  21. { .name = "dispc", .dma_req = 5 },
  22. { .dma_req = -1, },
  23. };
  24. /*
  25. * 'dispc' class
  26. * display controller
  27. */
  28. static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
  29. .rev_offs = 0x0000,
  30. .sysc_offs = 0x0010,
  31. .syss_offs = 0x0014,
  32. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
  33. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  34. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  35. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  36. .sysc_fields = &omap_hwmod_sysc_type1,
  37. };
  38. struct omap_hwmod_class omap2_dispc_hwmod_class = {
  39. .name = "dispc",
  40. .sysc = &omap2_dispc_sysc,
  41. };
  42. /* OMAP2xxx Timer Common */
  43. static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
  44. .rev_offs = 0x0000,
  45. .sysc_offs = 0x0010,
  46. .syss_offs = 0x0014,
  47. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
  48. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  49. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  50. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  51. .clockact = CLOCKACT_TEST_ICLK,
  52. .sysc_fields = &omap_hwmod_sysc_type1,
  53. };
  54. struct omap_hwmod_class omap2xxx_timer_hwmod_class = {
  55. .name = "timer",
  56. .sysc = &omap2xxx_timer_sysc,
  57. };
  58. /*
  59. * 'wd_timer' class
  60. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  61. * overflow condition
  62. */
  63. static struct omap_hwmod_class_sysconfig omap2xxx_wd_timer_sysc = {
  64. .rev_offs = 0x0000,
  65. .sysc_offs = 0x0010,
  66. .syss_offs = 0x0014,
  67. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
  68. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  69. .sysc_fields = &omap_hwmod_sysc_type1,
  70. };
  71. struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class = {
  72. .name = "wd_timer",
  73. .sysc = &omap2xxx_wd_timer_sysc,
  74. .pre_shutdown = &omap2_wd_timer_disable,
  75. .reset = &omap2_wd_timer_reset,
  76. };
  77. /*
  78. * 'gpio' class
  79. * general purpose io module
  80. */
  81. static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
  82. .rev_offs = 0x0000,
  83. .sysc_offs = 0x0010,
  84. .syss_offs = 0x0014,
  85. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  86. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  87. SYSS_HAS_RESET_STATUS),
  88. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  89. .sysc_fields = &omap_hwmod_sysc_type1,
  90. };
  91. struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
  92. .name = "gpio",
  93. .sysc = &omap2xxx_gpio_sysc,
  94. .rev = 0,
  95. };
  96. /* system dma */
  97. static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = {
  98. .rev_offs = 0x0000,
  99. .sysc_offs = 0x002c,
  100. .syss_offs = 0x0028,
  101. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
  102. SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
  103. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  104. .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  105. .sysc_fields = &omap_hwmod_sysc_type1,
  106. };
  107. struct omap_hwmod_class omap2xxx_dma_hwmod_class = {
  108. .name = "dma",
  109. .sysc = &omap2xxx_dma_sysc,
  110. };
  111. /*
  112. * 'mailbox' class
  113. * mailbox module allowing communication between the on-chip processors
  114. * using a queued mailbox-interrupt mechanism.
  115. */
  116. static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc = {
  117. .rev_offs = 0x000,
  118. .sysc_offs = 0x010,
  119. .syss_offs = 0x014,
  120. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  121. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  122. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  123. .sysc_fields = &omap_hwmod_sysc_type1,
  124. };
  125. struct omap_hwmod_class omap2xxx_mailbox_hwmod_class = {
  126. .name = "mailbox",
  127. .sysc = &omap2xxx_mailbox_sysc,
  128. };
  129. /*
  130. * 'mcspi' class
  131. * multichannel serial port interface (mcspi) / master/slave synchronous serial
  132. * bus
  133. */
  134. static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc = {
  135. .rev_offs = 0x0000,
  136. .sysc_offs = 0x0010,
  137. .syss_offs = 0x0014,
  138. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  139. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  140. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  141. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  142. .sysc_fields = &omap_hwmod_sysc_type1,
  143. };
  144. struct omap_hwmod_class omap2xxx_mcspi_class = {
  145. .name = "mcspi",
  146. .sysc = &omap2xxx_mcspi_sysc,
  147. .rev = OMAP2_MCSPI_REV,
  148. };
  149. /*
  150. * 'gpmc' class
  151. * general purpose memory controller
  152. */
  153. static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
  154. .rev_offs = 0x0000,
  155. .sysc_offs = 0x0010,
  156. .syss_offs = 0x0014,
  157. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
  158. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  159. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  160. .sysc_fields = &omap_hwmod_sysc_type1,
  161. };
  162. static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
  163. .name = "gpmc",
  164. .sysc = &omap2xxx_gpmc_sysc,
  165. };
  166. /*
  167. * IP blocks
  168. */
  169. /* L3 */
  170. struct omap_hwmod omap2xxx_l3_main_hwmod = {
  171. .name = "l3_main",
  172. .class = &l3_hwmod_class,
  173. .flags = HWMOD_NO_IDLEST,
  174. };
  175. /* L4 CORE */
  176. struct omap_hwmod omap2xxx_l4_core_hwmod = {
  177. .name = "l4_core",
  178. .class = &l4_hwmod_class,
  179. .flags = HWMOD_NO_IDLEST,
  180. };
  181. /* L4 WKUP */
  182. struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
  183. .name = "l4_wkup",
  184. .class = &l4_hwmod_class,
  185. .flags = HWMOD_NO_IDLEST,
  186. };
  187. /* MPU */
  188. struct omap_hwmod omap2xxx_mpu_hwmod = {
  189. .name = "mpu",
  190. .class = &mpu_hwmod_class,
  191. .main_clk = "mpu_ck",
  192. };
  193. /* IVA2 */
  194. struct omap_hwmod omap2xxx_iva_hwmod = {
  195. .name = "iva",
  196. .class = &iva_hwmod_class,
  197. };
  198. /* always-on timers dev attribute */
  199. static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
  200. .timer_capability = OMAP_TIMER_ALWON,
  201. };
  202. /* pwm timers dev attribute */
  203. static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
  204. .timer_capability = OMAP_TIMER_HAS_PWM,
  205. };
  206. /* timers with DSP interrupt dev attribute */
  207. static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
  208. .timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
  209. };
  210. /* timer1 */
  211. struct omap_hwmod omap2xxx_timer1_hwmod = {
  212. .name = "timer1",
  213. .main_clk = "gpt1_fck",
  214. .prcm = {
  215. .omap2 = {
  216. .prcm_reg_id = 1,
  217. .module_bit = OMAP24XX_EN_GPT1_SHIFT,
  218. .module_offs = WKUP_MOD,
  219. .idlest_reg_id = 1,
  220. .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
  221. },
  222. },
  223. .dev_attr = &capability_alwon_dev_attr,
  224. .class = &omap2xxx_timer_hwmod_class,
  225. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  226. };
  227. /* timer2 */
  228. struct omap_hwmod omap2xxx_timer2_hwmod = {
  229. .name = "timer2",
  230. .main_clk = "gpt2_fck",
  231. .prcm = {
  232. .omap2 = {
  233. .prcm_reg_id = 1,
  234. .module_bit = OMAP24XX_EN_GPT2_SHIFT,
  235. .module_offs = CORE_MOD,
  236. .idlest_reg_id = 1,
  237. .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
  238. },
  239. },
  240. .class = &omap2xxx_timer_hwmod_class,
  241. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  242. };
  243. /* timer3 */
  244. struct omap_hwmod omap2xxx_timer3_hwmod = {
  245. .name = "timer3",
  246. .main_clk = "gpt3_fck",
  247. .prcm = {
  248. .omap2 = {
  249. .prcm_reg_id = 1,
  250. .module_bit = OMAP24XX_EN_GPT3_SHIFT,
  251. .module_offs = CORE_MOD,
  252. .idlest_reg_id = 1,
  253. .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
  254. },
  255. },
  256. .class = &omap2xxx_timer_hwmod_class,
  257. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  258. };
  259. /* timer4 */
  260. struct omap_hwmod omap2xxx_timer4_hwmod = {
  261. .name = "timer4",
  262. .main_clk = "gpt4_fck",
  263. .prcm = {
  264. .omap2 = {
  265. .prcm_reg_id = 1,
  266. .module_bit = OMAP24XX_EN_GPT4_SHIFT,
  267. .module_offs = CORE_MOD,
  268. .idlest_reg_id = 1,
  269. .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
  270. },
  271. },
  272. .class = &omap2xxx_timer_hwmod_class,
  273. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  274. };
  275. /* timer5 */
  276. struct omap_hwmod omap2xxx_timer5_hwmod = {
  277. .name = "timer5",
  278. .main_clk = "gpt5_fck",
  279. .prcm = {
  280. .omap2 = {
  281. .prcm_reg_id = 1,
  282. .module_bit = OMAP24XX_EN_GPT5_SHIFT,
  283. .module_offs = CORE_MOD,
  284. .idlest_reg_id = 1,
  285. .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
  286. },
  287. },
  288. .dev_attr = &capability_dsp_dev_attr,
  289. .class = &omap2xxx_timer_hwmod_class,
  290. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  291. };
  292. /* timer6 */
  293. struct omap_hwmod omap2xxx_timer6_hwmod = {
  294. .name = "timer6",
  295. .main_clk = "gpt6_fck",
  296. .prcm = {
  297. .omap2 = {
  298. .prcm_reg_id = 1,
  299. .module_bit = OMAP24XX_EN_GPT6_SHIFT,
  300. .module_offs = CORE_MOD,
  301. .idlest_reg_id = 1,
  302. .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
  303. },
  304. },
  305. .dev_attr = &capability_dsp_dev_attr,
  306. .class = &omap2xxx_timer_hwmod_class,
  307. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  308. };
  309. /* timer7 */
  310. struct omap_hwmod omap2xxx_timer7_hwmod = {
  311. .name = "timer7",
  312. .main_clk = "gpt7_fck",
  313. .prcm = {
  314. .omap2 = {
  315. .prcm_reg_id = 1,
  316. .module_bit = OMAP24XX_EN_GPT7_SHIFT,
  317. .module_offs = CORE_MOD,
  318. .idlest_reg_id = 1,
  319. .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
  320. },
  321. },
  322. .dev_attr = &capability_dsp_dev_attr,
  323. .class = &omap2xxx_timer_hwmod_class,
  324. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  325. };
  326. /* timer8 */
  327. struct omap_hwmod omap2xxx_timer8_hwmod = {
  328. .name = "timer8",
  329. .main_clk = "gpt8_fck",
  330. .prcm = {
  331. .omap2 = {
  332. .prcm_reg_id = 1,
  333. .module_bit = OMAP24XX_EN_GPT8_SHIFT,
  334. .module_offs = CORE_MOD,
  335. .idlest_reg_id = 1,
  336. .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
  337. },
  338. },
  339. .dev_attr = &capability_dsp_dev_attr,
  340. .class = &omap2xxx_timer_hwmod_class,
  341. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  342. };
  343. /* timer9 */
  344. struct omap_hwmod omap2xxx_timer9_hwmod = {
  345. .name = "timer9",
  346. .main_clk = "gpt9_fck",
  347. .prcm = {
  348. .omap2 = {
  349. .prcm_reg_id = 1,
  350. .module_bit = OMAP24XX_EN_GPT9_SHIFT,
  351. .module_offs = CORE_MOD,
  352. .idlest_reg_id = 1,
  353. .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
  354. },
  355. },
  356. .dev_attr = &capability_pwm_dev_attr,
  357. .class = &omap2xxx_timer_hwmod_class,
  358. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  359. };
  360. /* timer10 */
  361. struct omap_hwmod omap2xxx_timer10_hwmod = {
  362. .name = "timer10",
  363. .main_clk = "gpt10_fck",
  364. .prcm = {
  365. .omap2 = {
  366. .prcm_reg_id = 1,
  367. .module_bit = OMAP24XX_EN_GPT10_SHIFT,
  368. .module_offs = CORE_MOD,
  369. .idlest_reg_id = 1,
  370. .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
  371. },
  372. },
  373. .dev_attr = &capability_pwm_dev_attr,
  374. .class = &omap2xxx_timer_hwmod_class,
  375. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  376. };
  377. /* timer11 */
  378. struct omap_hwmod omap2xxx_timer11_hwmod = {
  379. .name = "timer11",
  380. .main_clk = "gpt11_fck",
  381. .prcm = {
  382. .omap2 = {
  383. .prcm_reg_id = 1,
  384. .module_bit = OMAP24XX_EN_GPT11_SHIFT,
  385. .module_offs = CORE_MOD,
  386. .idlest_reg_id = 1,
  387. .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
  388. },
  389. },
  390. .dev_attr = &capability_pwm_dev_attr,
  391. .class = &omap2xxx_timer_hwmod_class,
  392. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  393. };
  394. /* timer12 */
  395. struct omap_hwmod omap2xxx_timer12_hwmod = {
  396. .name = "timer12",
  397. .main_clk = "gpt12_fck",
  398. .prcm = {
  399. .omap2 = {
  400. .prcm_reg_id = 1,
  401. .module_bit = OMAP24XX_EN_GPT12_SHIFT,
  402. .module_offs = CORE_MOD,
  403. .idlest_reg_id = 1,
  404. .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
  405. },
  406. },
  407. .dev_attr = &capability_pwm_dev_attr,
  408. .class = &omap2xxx_timer_hwmod_class,
  409. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  410. };
  411. /* wd_timer2 */
  412. struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
  413. .name = "wd_timer2",
  414. .class = &omap2xxx_wd_timer_hwmod_class,
  415. .main_clk = "mpu_wdt_fck",
  416. .prcm = {
  417. .omap2 = {
  418. .prcm_reg_id = 1,
  419. .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
  420. .module_offs = WKUP_MOD,
  421. .idlest_reg_id = 1,
  422. .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
  423. },
  424. },
  425. };
  426. /* UART1 */
  427. struct omap_hwmod omap2xxx_uart1_hwmod = {
  428. .name = "uart1",
  429. .main_clk = "uart1_fck",
  430. .flags = DEBUG_OMAP2UART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
  431. .prcm = {
  432. .omap2 = {
  433. .module_offs = CORE_MOD,
  434. .prcm_reg_id = 1,
  435. .module_bit = OMAP24XX_EN_UART1_SHIFT,
  436. .idlest_reg_id = 1,
  437. .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
  438. },
  439. },
  440. .class = &omap2_uart_class,
  441. };
  442. /* UART2 */
  443. struct omap_hwmod omap2xxx_uart2_hwmod = {
  444. .name = "uart2",
  445. .main_clk = "uart2_fck",
  446. .flags = DEBUG_OMAP2UART2_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
  447. .prcm = {
  448. .omap2 = {
  449. .module_offs = CORE_MOD,
  450. .prcm_reg_id = 1,
  451. .module_bit = OMAP24XX_EN_UART2_SHIFT,
  452. .idlest_reg_id = 1,
  453. .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
  454. },
  455. },
  456. .class = &omap2_uart_class,
  457. };
  458. /* UART3 */
  459. struct omap_hwmod omap2xxx_uart3_hwmod = {
  460. .name = "uart3",
  461. .main_clk = "uart3_fck",
  462. .flags = DEBUG_OMAP2UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
  463. .prcm = {
  464. .omap2 = {
  465. .module_offs = CORE_MOD,
  466. .prcm_reg_id = 2,
  467. .module_bit = OMAP24XX_EN_UART3_SHIFT,
  468. .idlest_reg_id = 2,
  469. .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
  470. },
  471. },
  472. .class = &omap2_uart_class,
  473. };
  474. /* dss */
  475. static struct omap_hwmod_opt_clk dss_opt_clks[] = {
  476. /*
  477. * The DSS HW needs all DSS clocks enabled during reset. The dss_core
  478. * driver does not use these clocks.
  479. */
  480. { .role = "tv_clk", .clk = "dss_54m_fck" },
  481. { .role = "sys_clk", .clk = "dss2_fck" },
  482. };
  483. struct omap_hwmod omap2xxx_dss_core_hwmod = {
  484. .name = "dss_core",
  485. .class = &omap2_dss_hwmod_class,
  486. .main_clk = "dss1_fck", /* instead of dss_fck */
  487. .sdma_reqs = omap2xxx_dss_sdma_chs,
  488. .prcm = {
  489. .omap2 = {
  490. .prcm_reg_id = 1,
  491. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  492. .module_offs = CORE_MOD,
  493. .idlest_reg_id = 1,
  494. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  495. },
  496. },
  497. .opt_clks = dss_opt_clks,
  498. .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
  499. .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  500. };
  501. struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
  502. .name = "dss_dispc",
  503. .class = &omap2_dispc_hwmod_class,
  504. .mpu_irqs = omap2_dispc_irqs,
  505. .main_clk = "dss1_fck",
  506. .prcm = {
  507. .omap2 = {
  508. .prcm_reg_id = 1,
  509. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  510. .module_offs = CORE_MOD,
  511. .idlest_reg_id = 1,
  512. .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
  513. },
  514. },
  515. .flags = HWMOD_NO_IDLEST,
  516. .dev_attr = &omap2_3_dss_dispc_dev_attr,
  517. };
  518. static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
  519. { .role = "ick", .clk = "dss_ick" },
  520. };
  521. struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
  522. .name = "dss_rfbi",
  523. .class = &omap2_rfbi_hwmod_class,
  524. .main_clk = "dss1_fck",
  525. .prcm = {
  526. .omap2 = {
  527. .prcm_reg_id = 1,
  528. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  529. .module_offs = CORE_MOD,
  530. },
  531. },
  532. .opt_clks = dss_rfbi_opt_clks,
  533. .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
  534. .flags = HWMOD_NO_IDLEST,
  535. };
  536. struct omap_hwmod omap2xxx_dss_venc_hwmod = {
  537. .name = "dss_venc",
  538. .class = &omap2_venc_hwmod_class,
  539. .main_clk = "dss_54m_fck",
  540. .prcm = {
  541. .omap2 = {
  542. .prcm_reg_id = 1,
  543. .module_bit = OMAP24XX_EN_DSS1_SHIFT,
  544. .module_offs = CORE_MOD,
  545. },
  546. },
  547. .flags = HWMOD_NO_IDLEST,
  548. };
  549. /* gpio dev_attr */
  550. struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = {
  551. .bank_width = 32,
  552. .dbck_flag = false,
  553. };
  554. /* gpio1 */
  555. struct omap_hwmod omap2xxx_gpio1_hwmod = {
  556. .name = "gpio1",
  557. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  558. .main_clk = "gpios_fck",
  559. .prcm = {
  560. .omap2 = {
  561. .prcm_reg_id = 1,
  562. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  563. .module_offs = WKUP_MOD,
  564. .idlest_reg_id = 1,
  565. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  566. },
  567. },
  568. .class = &omap2xxx_gpio_hwmod_class,
  569. .dev_attr = &omap2xxx_gpio_dev_attr,
  570. };
  571. /* gpio2 */
  572. struct omap_hwmod omap2xxx_gpio2_hwmod = {
  573. .name = "gpio2",
  574. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  575. .main_clk = "gpios_fck",
  576. .prcm = {
  577. .omap2 = {
  578. .prcm_reg_id = 1,
  579. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  580. .module_offs = WKUP_MOD,
  581. .idlest_reg_id = 1,
  582. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  583. },
  584. },
  585. .class = &omap2xxx_gpio_hwmod_class,
  586. .dev_attr = &omap2xxx_gpio_dev_attr,
  587. };
  588. /* gpio3 */
  589. struct omap_hwmod omap2xxx_gpio3_hwmod = {
  590. .name = "gpio3",
  591. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  592. .main_clk = "gpios_fck",
  593. .prcm = {
  594. .omap2 = {
  595. .prcm_reg_id = 1,
  596. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  597. .module_offs = WKUP_MOD,
  598. .idlest_reg_id = 1,
  599. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  600. },
  601. },
  602. .class = &omap2xxx_gpio_hwmod_class,
  603. .dev_attr = &omap2xxx_gpio_dev_attr,
  604. };
  605. /* gpio4 */
  606. struct omap_hwmod omap2xxx_gpio4_hwmod = {
  607. .name = "gpio4",
  608. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  609. .main_clk = "gpios_fck",
  610. .prcm = {
  611. .omap2 = {
  612. .prcm_reg_id = 1,
  613. .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
  614. .module_offs = WKUP_MOD,
  615. .idlest_reg_id = 1,
  616. .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
  617. },
  618. },
  619. .class = &omap2xxx_gpio_hwmod_class,
  620. .dev_attr = &omap2xxx_gpio_dev_attr,
  621. };
  622. /* mcspi1 */
  623. static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
  624. .num_chipselect = 4,
  625. };
  626. struct omap_hwmod omap2xxx_mcspi1_hwmod = {
  627. .name = "mcspi1",
  628. .main_clk = "mcspi1_fck",
  629. .prcm = {
  630. .omap2 = {
  631. .module_offs = CORE_MOD,
  632. .prcm_reg_id = 1,
  633. .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
  634. .idlest_reg_id = 1,
  635. .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
  636. },
  637. },
  638. .class = &omap2xxx_mcspi_class,
  639. .dev_attr = &omap_mcspi1_dev_attr,
  640. };
  641. /* mcspi2 */
  642. static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
  643. .num_chipselect = 2,
  644. };
  645. struct omap_hwmod omap2xxx_mcspi2_hwmod = {
  646. .name = "mcspi2",
  647. .main_clk = "mcspi2_fck",
  648. .prcm = {
  649. .omap2 = {
  650. .module_offs = CORE_MOD,
  651. .prcm_reg_id = 1,
  652. .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
  653. .idlest_reg_id = 1,
  654. .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
  655. },
  656. },
  657. .class = &omap2xxx_mcspi_class,
  658. .dev_attr = &omap_mcspi2_dev_attr,
  659. };
  660. static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
  661. .name = "counter",
  662. };
  663. struct omap_hwmod omap2xxx_counter_32k_hwmod = {
  664. .name = "counter_32k",
  665. .main_clk = "func_32k_ck",
  666. .prcm = {
  667. .omap2 = {
  668. .module_offs = WKUP_MOD,
  669. .prcm_reg_id = 1,
  670. .module_bit = OMAP24XX_ST_32KSYNC_SHIFT,
  671. .idlest_reg_id = 1,
  672. .idlest_idle_bit = OMAP24XX_ST_32KSYNC_SHIFT,
  673. },
  674. },
  675. .class = &omap2xxx_counter_hwmod_class,
  676. };
  677. /* gpmc */
  678. struct omap_hwmod omap2xxx_gpmc_hwmod = {
  679. .name = "gpmc",
  680. .class = &omap2xxx_gpmc_hwmod_class,
  681. .main_clk = "gpmc_fck",
  682. /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
  683. .flags = HWMOD_NO_IDLEST | DEBUG_OMAP_GPMC_HWMOD_FLAGS,
  684. .prcm = {
  685. .omap2 = {
  686. .prcm_reg_id = 3,
  687. .module_bit = OMAP24XX_EN_GPMC_MASK,
  688. .module_offs = CORE_MOD,
  689. },
  690. },
  691. };
  692. /* RNG */
  693. static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
  694. .rev_offs = 0x3c,
  695. .sysc_offs = 0x40,
  696. .syss_offs = 0x44,
  697. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  698. SYSS_HAS_RESET_STATUS),
  699. .sysc_fields = &omap_hwmod_sysc_type1,
  700. };
  701. static struct omap_hwmod_class omap2_rng_hwmod_class = {
  702. .name = "rng",
  703. .sysc = &omap2_rng_sysc,
  704. };
  705. struct omap_hwmod omap2xxx_rng_hwmod = {
  706. .name = "rng",
  707. .main_clk = "l4_ck",
  708. .prcm = {
  709. .omap2 = {
  710. .module_offs = CORE_MOD,
  711. .prcm_reg_id = 4,
  712. .module_bit = OMAP24XX_EN_RNG_SHIFT,
  713. .idlest_reg_id = 4,
  714. .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
  715. },
  716. },
  717. /*
  718. * XXX The first read from the SYSSTATUS register of the RNG
  719. * after the SYSCONFIG SOFTRESET bit is set triggers an
  720. * imprecise external abort. It's unclear why this happens.
  721. * Until this is analyzed, skip the IP block reset.
  722. */
  723. .flags = HWMOD_INIT_NO_RESET,
  724. .class = &omap2_rng_hwmod_class,
  725. };
  726. /* SHAM */
  727. static struct omap_hwmod_class_sysconfig omap2_sham_sysc = {
  728. .rev_offs = 0x5c,
  729. .sysc_offs = 0x60,
  730. .syss_offs = 0x64,
  731. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  732. SYSS_HAS_RESET_STATUS),
  733. .sysc_fields = &omap_hwmod_sysc_type1,
  734. };
  735. static struct omap_hwmod_class omap2xxx_sham_class = {
  736. .name = "sham",
  737. .sysc = &omap2_sham_sysc,
  738. };
  739. struct omap_hwmod omap2xxx_sham_hwmod = {
  740. .name = "sham",
  741. .main_clk = "l4_ck",
  742. .prcm = {
  743. .omap2 = {
  744. .module_offs = CORE_MOD,
  745. .prcm_reg_id = 4,
  746. .module_bit = OMAP24XX_EN_SHA_SHIFT,
  747. .idlest_reg_id = 4,
  748. .idlest_idle_bit = OMAP24XX_ST_SHA_SHIFT,
  749. },
  750. },
  751. .class = &omap2xxx_sham_class,
  752. };
  753. /* AES */
  754. static struct omap_hwmod_class_sysconfig omap2_aes_sysc = {
  755. .rev_offs = 0x44,
  756. .sysc_offs = 0x48,
  757. .syss_offs = 0x4c,
  758. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  759. SYSS_HAS_RESET_STATUS),
  760. .sysc_fields = &omap_hwmod_sysc_type1,
  761. };
  762. static struct omap_hwmod_class omap2xxx_aes_class = {
  763. .name = "aes",
  764. .sysc = &omap2_aes_sysc,
  765. };
  766. struct omap_hwmod omap2xxx_aes_hwmod = {
  767. .name = "aes",
  768. .main_clk = "l4_ck",
  769. .prcm = {
  770. .omap2 = {
  771. .module_offs = CORE_MOD,
  772. .prcm_reg_id = 4,
  773. .module_bit = OMAP24XX_EN_AES_SHIFT,
  774. .idlest_reg_id = 4,
  775. .idlest_idle_bit = OMAP24XX_ST_AES_SHIFT,
  776. },
  777. },
  778. .class = &omap2xxx_aes_class,
  779. };