omap_hwmod_2xxx_ipblock_data.c 17 KB

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