omap_hwmod_43xx_data.c 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. /*
  2. * Copyright (C) 2013 Texas Instruments Incorporated
  3. *
  4. * Hwmod present only in AM43x and those that differ other than register
  5. * offsets as compared to AM335x.
  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. #include <linux/platform_data/gpio-omap.h>
  17. #include <linux/platform_data/spi-omap2-mcspi.h>
  18. #include "omap_hwmod.h"
  19. #include "omap_hwmod_33xx_43xx_common_data.h"
  20. #include "prcm43xx.h"
  21. #include "omap_hwmod_common_data.h"
  22. #include "hdq1w.h"
  23. /* IP blocks */
  24. static struct omap_hwmod am43xx_emif_hwmod = {
  25. .name = "emif",
  26. .class = &am33xx_emif_hwmod_class,
  27. .clkdm_name = "emif_clkdm",
  28. .flags = HWMOD_INIT_NO_IDLE,
  29. .main_clk = "dpll_ddr_m2_ck",
  30. .prcm = {
  31. .omap4 = {
  32. .clkctrl_offs = AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET,
  33. .modulemode = MODULEMODE_SWCTRL,
  34. },
  35. },
  36. };
  37. static struct omap_hwmod am43xx_l4_hs_hwmod = {
  38. .name = "l4_hs",
  39. .class = &am33xx_l4_hwmod_class,
  40. .clkdm_name = "l3_clkdm",
  41. .flags = HWMOD_INIT_NO_IDLE,
  42. .main_clk = "l4hs_gclk",
  43. .prcm = {
  44. .omap4 = {
  45. .clkctrl_offs = AM43XX_CM_PER_L4HS_CLKCTRL_OFFSET,
  46. .modulemode = MODULEMODE_SWCTRL,
  47. },
  48. },
  49. };
  50. static struct omap_hwmod_rst_info am33xx_wkup_m3_resets[] = {
  51. { .name = "wkup_m3", .rst_shift = 3, .st_shift = 5 },
  52. };
  53. static struct omap_hwmod am43xx_wkup_m3_hwmod = {
  54. .name = "wkup_m3",
  55. .class = &am33xx_wkup_m3_hwmod_class,
  56. .clkdm_name = "l4_wkup_aon_clkdm",
  57. /* Keep hardreset asserted */
  58. .flags = HWMOD_INIT_NO_RESET | HWMOD_NO_IDLEST,
  59. .main_clk = "sys_clkin_ck",
  60. .prcm = {
  61. .omap4 = {
  62. .clkctrl_offs = AM43XX_CM_WKUP_WKUP_M3_CLKCTRL_OFFSET,
  63. .rstctrl_offs = AM43XX_RM_WKUP_RSTCTRL_OFFSET,
  64. .rstst_offs = AM43XX_RM_WKUP_RSTST_OFFSET,
  65. .modulemode = MODULEMODE_SWCTRL,
  66. },
  67. },
  68. .rst_lines = am33xx_wkup_m3_resets,
  69. .rst_lines_cnt = ARRAY_SIZE(am33xx_wkup_m3_resets),
  70. };
  71. static struct omap_hwmod am43xx_control_hwmod = {
  72. .name = "control",
  73. .class = &am33xx_control_hwmod_class,
  74. .clkdm_name = "l4_wkup_clkdm",
  75. .flags = HWMOD_INIT_NO_IDLE,
  76. .main_clk = "sys_clkin_ck",
  77. .prcm = {
  78. .omap4 = {
  79. .clkctrl_offs = AM43XX_CM_WKUP_CONTROL_CLKCTRL_OFFSET,
  80. .modulemode = MODULEMODE_SWCTRL,
  81. },
  82. },
  83. };
  84. static struct omap_hwmod_opt_clk gpio0_opt_clks[] = {
  85. { .role = "dbclk", .clk = "gpio0_dbclk" },
  86. };
  87. static struct omap_hwmod am43xx_gpio0_hwmod = {
  88. .name = "gpio1",
  89. .class = &am33xx_gpio_hwmod_class,
  90. .clkdm_name = "l4_wkup_clkdm",
  91. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  92. .main_clk = "sys_clkin_ck",
  93. .prcm = {
  94. .omap4 = {
  95. .clkctrl_offs = AM43XX_CM_WKUP_GPIO0_CLKCTRL_OFFSET,
  96. .modulemode = MODULEMODE_SWCTRL,
  97. },
  98. },
  99. .opt_clks = gpio0_opt_clks,
  100. .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks),
  101. .dev_attr = &gpio_dev_attr,
  102. };
  103. static struct omap_hwmod_class_sysconfig am43xx_synctimer_sysc = {
  104. .rev_offs = 0x0,
  105. .sysc_offs = 0x4,
  106. .sysc_flags = SYSC_HAS_SIDLEMODE,
  107. .idlemodes = (SIDLE_FORCE | SIDLE_NO),
  108. .sysc_fields = &omap_hwmod_sysc_type1,
  109. };
  110. static struct omap_hwmod_class am43xx_synctimer_hwmod_class = {
  111. .name = "synctimer",
  112. .sysc = &am43xx_synctimer_sysc,
  113. };
  114. static struct omap_hwmod am43xx_synctimer_hwmod = {
  115. .name = "counter_32k",
  116. .class = &am43xx_synctimer_hwmod_class,
  117. .clkdm_name = "l4_wkup_aon_clkdm",
  118. .flags = HWMOD_SWSUP_SIDLE,
  119. .main_clk = "synctimer_32kclk",
  120. .prcm = {
  121. .omap4 = {
  122. .clkctrl_offs = AM43XX_CM_WKUP_SYNCTIMER_CLKCTRL_OFFSET,
  123. .modulemode = MODULEMODE_SWCTRL,
  124. },
  125. },
  126. };
  127. static struct omap_hwmod am43xx_timer8_hwmod = {
  128. .name = "timer8",
  129. .class = &am33xx_timer_hwmod_class,
  130. .clkdm_name = "l4ls_clkdm",
  131. .main_clk = "timer8_fck",
  132. .prcm = {
  133. .omap4 = {
  134. .clkctrl_offs = AM43XX_CM_PER_TIMER8_CLKCTRL_OFFSET,
  135. .modulemode = MODULEMODE_SWCTRL,
  136. },
  137. },
  138. };
  139. static struct omap_hwmod am43xx_timer9_hwmod = {
  140. .name = "timer9",
  141. .class = &am33xx_timer_hwmod_class,
  142. .clkdm_name = "l4ls_clkdm",
  143. .main_clk = "timer9_fck",
  144. .prcm = {
  145. .omap4 = {
  146. .clkctrl_offs = AM43XX_CM_PER_TIMER9_CLKCTRL_OFFSET,
  147. .modulemode = MODULEMODE_SWCTRL,
  148. },
  149. },
  150. };
  151. static struct omap_hwmod am43xx_timer10_hwmod = {
  152. .name = "timer10",
  153. .class = &am33xx_timer_hwmod_class,
  154. .clkdm_name = "l4ls_clkdm",
  155. .main_clk = "timer10_fck",
  156. .prcm = {
  157. .omap4 = {
  158. .clkctrl_offs = AM43XX_CM_PER_TIMER10_CLKCTRL_OFFSET,
  159. .modulemode = MODULEMODE_SWCTRL,
  160. },
  161. },
  162. };
  163. static struct omap_hwmod am43xx_timer11_hwmod = {
  164. .name = "timer11",
  165. .class = &am33xx_timer_hwmod_class,
  166. .clkdm_name = "l4ls_clkdm",
  167. .main_clk = "timer11_fck",
  168. .prcm = {
  169. .omap4 = {
  170. .clkctrl_offs = AM43XX_CM_PER_TIMER11_CLKCTRL_OFFSET,
  171. .modulemode = MODULEMODE_SWCTRL,
  172. },
  173. },
  174. };
  175. static struct omap_hwmod am43xx_epwmss3_hwmod = {
  176. .name = "epwmss3",
  177. .class = &am33xx_epwmss_hwmod_class,
  178. .clkdm_name = "l4ls_clkdm",
  179. .main_clk = "l4ls_gclk",
  180. .prcm = {
  181. .omap4 = {
  182. .clkctrl_offs = AM43XX_CM_PER_EPWMSS3_CLKCTRL_OFFSET,
  183. .modulemode = MODULEMODE_SWCTRL,
  184. },
  185. },
  186. };
  187. static struct omap_hwmod am43xx_epwmss4_hwmod = {
  188. .name = "epwmss4",
  189. .class = &am33xx_epwmss_hwmod_class,
  190. .clkdm_name = "l4ls_clkdm",
  191. .main_clk = "l4ls_gclk",
  192. .prcm = {
  193. .omap4 = {
  194. .clkctrl_offs = AM43XX_CM_PER_EPWMSS4_CLKCTRL_OFFSET,
  195. .modulemode = MODULEMODE_SWCTRL,
  196. },
  197. },
  198. };
  199. static struct omap_hwmod am43xx_epwmss5_hwmod = {
  200. .name = "epwmss5",
  201. .class = &am33xx_epwmss_hwmod_class,
  202. .clkdm_name = "l4ls_clkdm",
  203. .main_clk = "l4ls_gclk",
  204. .prcm = {
  205. .omap4 = {
  206. .clkctrl_offs = AM43XX_CM_PER_EPWMSS5_CLKCTRL_OFFSET,
  207. .modulemode = MODULEMODE_SWCTRL,
  208. },
  209. },
  210. };
  211. static struct omap_hwmod am43xx_spi2_hwmod = {
  212. .name = "spi2",
  213. .class = &am33xx_spi_hwmod_class,
  214. .clkdm_name = "l4ls_clkdm",
  215. .main_clk = "dpll_per_m2_div4_ck",
  216. .prcm = {
  217. .omap4 = {
  218. .clkctrl_offs = AM43XX_CM_PER_SPI2_CLKCTRL_OFFSET,
  219. .modulemode = MODULEMODE_SWCTRL,
  220. },
  221. },
  222. .dev_attr = &mcspi_attrib,
  223. };
  224. static struct omap_hwmod am43xx_spi3_hwmod = {
  225. .name = "spi3",
  226. .class = &am33xx_spi_hwmod_class,
  227. .clkdm_name = "l4ls_clkdm",
  228. .main_clk = "dpll_per_m2_div4_ck",
  229. .prcm = {
  230. .omap4 = {
  231. .clkctrl_offs = AM43XX_CM_PER_SPI3_CLKCTRL_OFFSET,
  232. .modulemode = MODULEMODE_SWCTRL,
  233. },
  234. },
  235. .dev_attr = &mcspi_attrib,
  236. };
  237. static struct omap_hwmod am43xx_spi4_hwmod = {
  238. .name = "spi4",
  239. .class = &am33xx_spi_hwmod_class,
  240. .clkdm_name = "l4ls_clkdm",
  241. .main_clk = "dpll_per_m2_div4_ck",
  242. .prcm = {
  243. .omap4 = {
  244. .clkctrl_offs = AM43XX_CM_PER_SPI4_CLKCTRL_OFFSET,
  245. .modulemode = MODULEMODE_SWCTRL,
  246. },
  247. },
  248. .dev_attr = &mcspi_attrib,
  249. };
  250. static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
  251. { .role = "dbclk", .clk = "gpio4_dbclk" },
  252. };
  253. static struct omap_hwmod am43xx_gpio4_hwmod = {
  254. .name = "gpio5",
  255. .class = &am33xx_gpio_hwmod_class,
  256. .clkdm_name = "l4ls_clkdm",
  257. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  258. .main_clk = "l4ls_gclk",
  259. .prcm = {
  260. .omap4 = {
  261. .clkctrl_offs = AM43XX_CM_PER_GPIO4_CLKCTRL_OFFSET,
  262. .modulemode = MODULEMODE_SWCTRL,
  263. },
  264. },
  265. .opt_clks = gpio4_opt_clks,
  266. .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
  267. .dev_attr = &gpio_dev_attr,
  268. };
  269. static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
  270. { .role = "dbclk", .clk = "gpio5_dbclk" },
  271. };
  272. static struct omap_hwmod am43xx_gpio5_hwmod = {
  273. .name = "gpio6",
  274. .class = &am33xx_gpio_hwmod_class,
  275. .clkdm_name = "l4ls_clkdm",
  276. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  277. .main_clk = "l4ls_gclk",
  278. .prcm = {
  279. .omap4 = {
  280. .clkctrl_offs = AM43XX_CM_PER_GPIO5_CLKCTRL_OFFSET,
  281. .modulemode = MODULEMODE_SWCTRL,
  282. },
  283. },
  284. .opt_clks = gpio5_opt_clks,
  285. .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
  286. .dev_attr = &gpio_dev_attr,
  287. };
  288. static struct omap_hwmod_class am43xx_ocp2scp_hwmod_class = {
  289. .name = "ocp2scp",
  290. };
  291. static struct omap_hwmod am43xx_ocp2scp0_hwmod = {
  292. .name = "ocp2scp0",
  293. .class = &am43xx_ocp2scp_hwmod_class,
  294. .clkdm_name = "l4ls_clkdm",
  295. .main_clk = "l4ls_gclk",
  296. .prcm = {
  297. .omap4 = {
  298. .clkctrl_offs = AM43XX_CM_PER_USBPHYOCP2SCP0_CLKCTRL_OFFSET,
  299. .modulemode = MODULEMODE_SWCTRL,
  300. },
  301. },
  302. };
  303. static struct omap_hwmod am43xx_ocp2scp1_hwmod = {
  304. .name = "ocp2scp1",
  305. .class = &am43xx_ocp2scp_hwmod_class,
  306. .clkdm_name = "l4ls_clkdm",
  307. .main_clk = "l4ls_gclk",
  308. .prcm = {
  309. .omap4 = {
  310. .clkctrl_offs = AM43XX_CM_PER_USBPHYOCP2SCP1_CLKCTRL_OFFSET,
  311. .modulemode = MODULEMODE_SWCTRL,
  312. },
  313. },
  314. };
  315. static struct omap_hwmod_class_sysconfig am43xx_usb_otg_ss_sysc = {
  316. .rev_offs = 0x0000,
  317. .sysc_offs = 0x0010,
  318. .sysc_flags = (SYSC_HAS_DMADISABLE | SYSC_HAS_MIDLEMODE |
  319. SYSC_HAS_SIDLEMODE),
  320. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  321. SIDLE_SMART_WKUP | MSTANDBY_FORCE |
  322. MSTANDBY_NO | MSTANDBY_SMART |
  323. MSTANDBY_SMART_WKUP),
  324. .sysc_fields = &omap_hwmod_sysc_type2,
  325. };
  326. static struct omap_hwmod_class am43xx_usb_otg_ss_hwmod_class = {
  327. .name = "usb_otg_ss",
  328. .sysc = &am43xx_usb_otg_ss_sysc,
  329. };
  330. static struct omap_hwmod am43xx_usb_otg_ss0_hwmod = {
  331. .name = "usb_otg_ss0",
  332. .class = &am43xx_usb_otg_ss_hwmod_class,
  333. .clkdm_name = "l3s_clkdm",
  334. .main_clk = "l3s_gclk",
  335. .prcm = {
  336. .omap4 = {
  337. .clkctrl_offs = AM43XX_CM_PER_USB_OTG_SS0_CLKCTRL_OFFSET,
  338. .modulemode = MODULEMODE_SWCTRL,
  339. },
  340. },
  341. };
  342. static struct omap_hwmod am43xx_usb_otg_ss1_hwmod = {
  343. .name = "usb_otg_ss1",
  344. .class = &am43xx_usb_otg_ss_hwmod_class,
  345. .clkdm_name = "l3s_clkdm",
  346. .main_clk = "l3s_gclk",
  347. .prcm = {
  348. .omap4 = {
  349. .clkctrl_offs = AM43XX_CM_PER_USB_OTG_SS1_CLKCTRL_OFFSET,
  350. .modulemode = MODULEMODE_SWCTRL,
  351. },
  352. },
  353. };
  354. static struct omap_hwmod_class_sysconfig am43xx_qspi_sysc = {
  355. .sysc_offs = 0x0010,
  356. .sysc_flags = SYSC_HAS_SIDLEMODE,
  357. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  358. SIDLE_SMART_WKUP),
  359. .sysc_fields = &omap_hwmod_sysc_type2,
  360. };
  361. static struct omap_hwmod_class am43xx_qspi_hwmod_class = {
  362. .name = "qspi",
  363. .sysc = &am43xx_qspi_sysc,
  364. };
  365. static struct omap_hwmod am43xx_qspi_hwmod = {
  366. .name = "qspi",
  367. .class = &am43xx_qspi_hwmod_class,
  368. .clkdm_name = "l3s_clkdm",
  369. .main_clk = "l3s_gclk",
  370. .prcm = {
  371. .omap4 = {
  372. .clkctrl_offs = AM43XX_CM_PER_QSPI_CLKCTRL_OFFSET,
  373. .modulemode = MODULEMODE_SWCTRL,
  374. },
  375. },
  376. };
  377. /*
  378. * 'adc/tsc' class
  379. * TouchScreen Controller (Analog-To-Digital Converter)
  380. */
  381. static struct omap_hwmod_class_sysconfig am43xx_adc_tsc_sysc = {
  382. .rev_offs = 0x00,
  383. .sysc_offs = 0x10,
  384. .sysc_flags = SYSC_HAS_SIDLEMODE,
  385. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  386. SIDLE_SMART_WKUP),
  387. .sysc_fields = &omap_hwmod_sysc_type2,
  388. };
  389. static struct omap_hwmod_class am43xx_adc_tsc_hwmod_class = {
  390. .name = "adc_tsc",
  391. .sysc = &am43xx_adc_tsc_sysc,
  392. };
  393. static struct omap_hwmod am43xx_adc_tsc_hwmod = {
  394. .name = "adc_tsc",
  395. .class = &am43xx_adc_tsc_hwmod_class,
  396. .clkdm_name = "l3s_tsc_clkdm",
  397. .main_clk = "adc_tsc_fck",
  398. .prcm = {
  399. .omap4 = {
  400. .clkctrl_offs = AM43XX_CM_WKUP_ADC_TSC_CLKCTRL_OFFSET,
  401. .modulemode = MODULEMODE_SWCTRL,
  402. },
  403. },
  404. };
  405. /* dss */
  406. static struct omap_hwmod am43xx_dss_core_hwmod = {
  407. .name = "dss_core",
  408. .class = &omap2_dss_hwmod_class,
  409. .clkdm_name = "dss_clkdm",
  410. .main_clk = "disp_clk",
  411. .prcm = {
  412. .omap4 = {
  413. .clkctrl_offs = AM43XX_CM_PER_DSS_CLKCTRL_OFFSET,
  414. .modulemode = MODULEMODE_SWCTRL,
  415. },
  416. },
  417. };
  418. /* dispc */
  419. static struct omap_dss_dispc_dev_attr am43xx_dss_dispc_dev_attr = {
  420. .manager_count = 1,
  421. .has_framedonetv_irq = 0
  422. };
  423. static struct omap_hwmod_class_sysconfig am43xx_dispc_sysc = {
  424. .rev_offs = 0x0000,
  425. .sysc_offs = 0x0010,
  426. .syss_offs = 0x0014,
  427. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SOFTRESET |
  428. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  429. SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_MIDLEMODE),
  430. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  431. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  432. .sysc_fields = &omap_hwmod_sysc_type1,
  433. };
  434. static struct omap_hwmod_class am43xx_dispc_hwmod_class = {
  435. .name = "dispc",
  436. .sysc = &am43xx_dispc_sysc,
  437. };
  438. static struct omap_hwmod am43xx_dss_dispc_hwmod = {
  439. .name = "dss_dispc",
  440. .class = &am43xx_dispc_hwmod_class,
  441. .clkdm_name = "dss_clkdm",
  442. .main_clk = "disp_clk",
  443. .prcm = {
  444. .omap4 = {
  445. .clkctrl_offs = AM43XX_CM_PER_DSS_CLKCTRL_OFFSET,
  446. },
  447. },
  448. .dev_attr = &am43xx_dss_dispc_dev_attr,
  449. .parent_hwmod = &am43xx_dss_core_hwmod,
  450. };
  451. /* rfbi */
  452. static struct omap_hwmod am43xx_dss_rfbi_hwmod = {
  453. .name = "dss_rfbi",
  454. .class = &omap2_rfbi_hwmod_class,
  455. .clkdm_name = "dss_clkdm",
  456. .main_clk = "disp_clk",
  457. .prcm = {
  458. .omap4 = {
  459. .clkctrl_offs = AM43XX_CM_PER_DSS_CLKCTRL_OFFSET,
  460. },
  461. },
  462. .parent_hwmod = &am43xx_dss_core_hwmod,
  463. };
  464. /* HDQ1W */
  465. static struct omap_hwmod_class_sysconfig am43xx_hdq1w_sysc = {
  466. .rev_offs = 0x0000,
  467. .sysc_offs = 0x0014,
  468. .syss_offs = 0x0018,
  469. .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  470. .sysc_fields = &omap_hwmod_sysc_type1,
  471. };
  472. static struct omap_hwmod_class am43xx_hdq1w_hwmod_class = {
  473. .name = "hdq1w",
  474. .sysc = &am43xx_hdq1w_sysc,
  475. .reset = &omap_hdq1w_reset,
  476. };
  477. static struct omap_hwmod am43xx_hdq1w_hwmod = {
  478. .name = "hdq1w",
  479. .class = &am43xx_hdq1w_hwmod_class,
  480. .clkdm_name = "l4ls_clkdm",
  481. .prcm = {
  482. .omap4 = {
  483. .clkctrl_offs = AM43XX_CM_PER_HDQ1W_CLKCTRL_OFFSET,
  484. .modulemode = MODULEMODE_SWCTRL,
  485. },
  486. },
  487. };
  488. static struct omap_hwmod_class_sysconfig am43xx_vpfe_sysc = {
  489. .rev_offs = 0x0,
  490. .sysc_offs = 0x104,
  491. .sysc_flags = SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE,
  492. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  493. MSTANDBY_FORCE | MSTANDBY_SMART | MSTANDBY_NO),
  494. .sysc_fields = &omap_hwmod_sysc_type2,
  495. };
  496. static struct omap_hwmod_class am43xx_vpfe_hwmod_class = {
  497. .name = "vpfe",
  498. .sysc = &am43xx_vpfe_sysc,
  499. };
  500. static struct omap_hwmod am43xx_vpfe0_hwmod = {
  501. .name = "vpfe0",
  502. .class = &am43xx_vpfe_hwmod_class,
  503. .clkdm_name = "l3s_clkdm",
  504. .prcm = {
  505. .omap4 = {
  506. .modulemode = MODULEMODE_SWCTRL,
  507. .clkctrl_offs = AM43XX_CM_PER_VPFE0_CLKCTRL_OFFSET,
  508. },
  509. },
  510. };
  511. static struct omap_hwmod am43xx_vpfe1_hwmod = {
  512. .name = "vpfe1",
  513. .class = &am43xx_vpfe_hwmod_class,
  514. .clkdm_name = "l3s_clkdm",
  515. .prcm = {
  516. .omap4 = {
  517. .modulemode = MODULEMODE_SWCTRL,
  518. .clkctrl_offs = AM43XX_CM_PER_VPFE1_CLKCTRL_OFFSET,
  519. },
  520. },
  521. };
  522. /* Interfaces */
  523. static struct omap_hwmod_ocp_if am43xx_l3_main__emif = {
  524. .master = &am33xx_l3_main_hwmod,
  525. .slave = &am43xx_emif_hwmod,
  526. .clk = "dpll_core_m4_ck",
  527. .user = OCP_USER_MPU | OCP_USER_SDMA,
  528. };
  529. static struct omap_hwmod_ocp_if am43xx_l3_main__l4_hs = {
  530. .master = &am33xx_l3_main_hwmod,
  531. .slave = &am43xx_l4_hs_hwmod,
  532. .clk = "l3s_gclk",
  533. .user = OCP_USER_MPU | OCP_USER_SDMA,
  534. };
  535. static struct omap_hwmod_ocp_if am43xx_wkup_m3__l4_wkup = {
  536. .master = &am43xx_wkup_m3_hwmod,
  537. .slave = &am33xx_l4_wkup_hwmod,
  538. .clk = "sys_clkin_ck",
  539. .user = OCP_USER_MPU | OCP_USER_SDMA,
  540. };
  541. static struct omap_hwmod_ocp_if am43xx_l4_wkup__wkup_m3 = {
  542. .master = &am33xx_l4_wkup_hwmod,
  543. .slave = &am43xx_wkup_m3_hwmod,
  544. .clk = "sys_clkin_ck",
  545. .user = OCP_USER_MPU | OCP_USER_SDMA,
  546. };
  547. static struct omap_hwmod_ocp_if am43xx_l3_main__pruss = {
  548. .master = &am33xx_l3_main_hwmod,
  549. .slave = &am33xx_pruss_hwmod,
  550. .clk = "dpll_core_m4_ck",
  551. .user = OCP_USER_MPU,
  552. };
  553. static struct omap_hwmod_ocp_if am43xx_l4_wkup__smartreflex0 = {
  554. .master = &am33xx_l4_wkup_hwmod,
  555. .slave = &am33xx_smartreflex0_hwmod,
  556. .clk = "sys_clkin_ck",
  557. .user = OCP_USER_MPU,
  558. };
  559. static struct omap_hwmod_ocp_if am43xx_l4_wkup__smartreflex1 = {
  560. .master = &am33xx_l4_wkup_hwmod,
  561. .slave = &am33xx_smartreflex1_hwmod,
  562. .clk = "sys_clkin_ck",
  563. .user = OCP_USER_MPU,
  564. };
  565. static struct omap_hwmod_ocp_if am43xx_l4_wkup__control = {
  566. .master = &am33xx_l4_wkup_hwmod,
  567. .slave = &am43xx_control_hwmod,
  568. .clk = "sys_clkin_ck",
  569. .user = OCP_USER_MPU,
  570. };
  571. static struct omap_hwmod_ocp_if am43xx_l4_wkup__i2c1 = {
  572. .master = &am33xx_l4_wkup_hwmod,
  573. .slave = &am33xx_i2c1_hwmod,
  574. .clk = "sys_clkin_ck",
  575. .user = OCP_USER_MPU,
  576. };
  577. static struct omap_hwmod_ocp_if am43xx_l4_wkup__gpio0 = {
  578. .master = &am33xx_l4_wkup_hwmod,
  579. .slave = &am43xx_gpio0_hwmod,
  580. .clk = "sys_clkin_ck",
  581. .user = OCP_USER_MPU | OCP_USER_SDMA,
  582. };
  583. static struct omap_hwmod_ocp_if am43xx_l4_wkup__adc_tsc = {
  584. .master = &am33xx_l4_wkup_hwmod,
  585. .slave = &am43xx_adc_tsc_hwmod,
  586. .clk = "dpll_core_m4_div2_ck",
  587. .user = OCP_USER_MPU,
  588. };
  589. static struct omap_hwmod_ocp_if am43xx_l4_hs__cpgmac0 = {
  590. .master = &am43xx_l4_hs_hwmod,
  591. .slave = &am33xx_cpgmac0_hwmod,
  592. .clk = "cpsw_125mhz_gclk",
  593. .user = OCP_USER_MPU,
  594. };
  595. static struct omap_hwmod_ocp_if am43xx_l4_wkup__timer1 = {
  596. .master = &am33xx_l4_wkup_hwmod,
  597. .slave = &am33xx_timer1_hwmod,
  598. .clk = "sys_clkin_ck",
  599. .user = OCP_USER_MPU,
  600. };
  601. static struct omap_hwmod_ocp_if am43xx_l4_wkup__uart1 = {
  602. .master = &am33xx_l4_wkup_hwmod,
  603. .slave = &am33xx_uart1_hwmod,
  604. .clk = "sys_clkin_ck",
  605. .user = OCP_USER_MPU,
  606. };
  607. static struct omap_hwmod_ocp_if am43xx_l4_wkup__wd_timer1 = {
  608. .master = &am33xx_l4_wkup_hwmod,
  609. .slave = &am33xx_wd_timer1_hwmod,
  610. .clk = "sys_clkin_ck",
  611. .user = OCP_USER_MPU,
  612. };
  613. static struct omap_hwmod_ocp_if am33xx_l4_wkup__synctimer = {
  614. .master = &am33xx_l4_wkup_hwmod,
  615. .slave = &am43xx_synctimer_hwmod,
  616. .clk = "sys_clkin_ck",
  617. .user = OCP_USER_MPU,
  618. };
  619. static struct omap_hwmod_ocp_if am43xx_l4_ls__timer8 = {
  620. .master = &am33xx_l4_ls_hwmod,
  621. .slave = &am43xx_timer8_hwmod,
  622. .clk = "l4ls_gclk",
  623. .user = OCP_USER_MPU,
  624. };
  625. static struct omap_hwmod_ocp_if am43xx_l4_ls__timer9 = {
  626. .master = &am33xx_l4_ls_hwmod,
  627. .slave = &am43xx_timer9_hwmod,
  628. .clk = "l4ls_gclk",
  629. .user = OCP_USER_MPU,
  630. };
  631. static struct omap_hwmod_ocp_if am43xx_l4_ls__timer10 = {
  632. .master = &am33xx_l4_ls_hwmod,
  633. .slave = &am43xx_timer10_hwmod,
  634. .clk = "l4ls_gclk",
  635. .user = OCP_USER_MPU,
  636. };
  637. static struct omap_hwmod_ocp_if am43xx_l4_ls__timer11 = {
  638. .master = &am33xx_l4_ls_hwmod,
  639. .slave = &am43xx_timer11_hwmod,
  640. .clk = "l4ls_gclk",
  641. .user = OCP_USER_MPU,
  642. };
  643. static struct omap_hwmod_ocp_if am43xx_l4_ls__epwmss3 = {
  644. .master = &am33xx_l4_ls_hwmod,
  645. .slave = &am43xx_epwmss3_hwmod,
  646. .clk = "l4ls_gclk",
  647. .user = OCP_USER_MPU,
  648. };
  649. static struct omap_hwmod_ocp_if am43xx_l4_ls__epwmss4 = {
  650. .master = &am33xx_l4_ls_hwmod,
  651. .slave = &am43xx_epwmss4_hwmod,
  652. .clk = "l4ls_gclk",
  653. .user = OCP_USER_MPU,
  654. };
  655. static struct omap_hwmod_ocp_if am43xx_l4_ls__epwmss5 = {
  656. .master = &am33xx_l4_ls_hwmod,
  657. .slave = &am43xx_epwmss5_hwmod,
  658. .clk = "l4ls_gclk",
  659. .user = OCP_USER_MPU,
  660. };
  661. static struct omap_hwmod_ocp_if am43xx_l4_ls__mcspi2 = {
  662. .master = &am33xx_l4_ls_hwmod,
  663. .slave = &am43xx_spi2_hwmod,
  664. .clk = "l4ls_gclk",
  665. .user = OCP_USER_MPU,
  666. };
  667. static struct omap_hwmod_ocp_if am43xx_l4_ls__mcspi3 = {
  668. .master = &am33xx_l4_ls_hwmod,
  669. .slave = &am43xx_spi3_hwmod,
  670. .clk = "l4ls_gclk",
  671. .user = OCP_USER_MPU,
  672. };
  673. static struct omap_hwmod_ocp_if am43xx_l4_ls__mcspi4 = {
  674. .master = &am33xx_l4_ls_hwmod,
  675. .slave = &am43xx_spi4_hwmod,
  676. .clk = "l4ls_gclk",
  677. .user = OCP_USER_MPU,
  678. };
  679. static struct omap_hwmod_ocp_if am43xx_l4_ls__gpio4 = {
  680. .master = &am33xx_l4_ls_hwmod,
  681. .slave = &am43xx_gpio4_hwmod,
  682. .clk = "l4ls_gclk",
  683. .user = OCP_USER_MPU | OCP_USER_SDMA,
  684. };
  685. static struct omap_hwmod_ocp_if am43xx_l4_ls__gpio5 = {
  686. .master = &am33xx_l4_ls_hwmod,
  687. .slave = &am43xx_gpio5_hwmod,
  688. .clk = "l4ls_gclk",
  689. .user = OCP_USER_MPU | OCP_USER_SDMA,
  690. };
  691. static struct omap_hwmod_ocp_if am43xx_l4_ls__ocp2scp0 = {
  692. .master = &am33xx_l4_ls_hwmod,
  693. .slave = &am43xx_ocp2scp0_hwmod,
  694. .clk = "l4ls_gclk",
  695. .user = OCP_USER_MPU,
  696. };
  697. static struct omap_hwmod_ocp_if am43xx_l4_ls__ocp2scp1 = {
  698. .master = &am33xx_l4_ls_hwmod,
  699. .slave = &am43xx_ocp2scp1_hwmod,
  700. .clk = "l4ls_gclk",
  701. .user = OCP_USER_MPU,
  702. };
  703. static struct omap_hwmod_ocp_if am43xx_l3_s__usbotgss0 = {
  704. .master = &am33xx_l3_s_hwmod,
  705. .slave = &am43xx_usb_otg_ss0_hwmod,
  706. .clk = "l3s_gclk",
  707. .user = OCP_USER_MPU | OCP_USER_SDMA,
  708. };
  709. static struct omap_hwmod_ocp_if am43xx_l3_s__usbotgss1 = {
  710. .master = &am33xx_l3_s_hwmod,
  711. .slave = &am43xx_usb_otg_ss1_hwmod,
  712. .clk = "l3s_gclk",
  713. .user = OCP_USER_MPU | OCP_USER_SDMA,
  714. };
  715. static struct omap_hwmod_ocp_if am43xx_l3_s__qspi = {
  716. .master = &am33xx_l3_s_hwmod,
  717. .slave = &am43xx_qspi_hwmod,
  718. .clk = "l3s_gclk",
  719. .user = OCP_USER_MPU | OCP_USER_SDMA,
  720. };
  721. static struct omap_hwmod_ocp_if am43xx_dss__l3_main = {
  722. .master = &am43xx_dss_core_hwmod,
  723. .slave = &am33xx_l3_main_hwmod,
  724. .clk = "l3_gclk",
  725. .user = OCP_USER_MPU | OCP_USER_SDMA,
  726. };
  727. static struct omap_hwmod_ocp_if am43xx_l4_ls__dss = {
  728. .master = &am33xx_l4_ls_hwmod,
  729. .slave = &am43xx_dss_core_hwmod,
  730. .clk = "l4ls_gclk",
  731. .user = OCP_USER_MPU | OCP_USER_SDMA,
  732. };
  733. static struct omap_hwmod_ocp_if am43xx_l4_ls__dss_dispc = {
  734. .master = &am33xx_l4_ls_hwmod,
  735. .slave = &am43xx_dss_dispc_hwmod,
  736. .clk = "l4ls_gclk",
  737. .user = OCP_USER_MPU | OCP_USER_SDMA,
  738. };
  739. static struct omap_hwmod_ocp_if am43xx_l4_ls__dss_rfbi = {
  740. .master = &am33xx_l4_ls_hwmod,
  741. .slave = &am43xx_dss_rfbi_hwmod,
  742. .clk = "l4ls_gclk",
  743. .user = OCP_USER_MPU | OCP_USER_SDMA,
  744. };
  745. static struct omap_hwmod_ocp_if am43xx_l4_ls__hdq1w = {
  746. .master = &am33xx_l4_ls_hwmod,
  747. .slave = &am43xx_hdq1w_hwmod,
  748. .clk = "l4ls_gclk",
  749. .user = OCP_USER_MPU | OCP_USER_SDMA,
  750. };
  751. static struct omap_hwmod_ocp_if am43xx_l3__vpfe0 = {
  752. .master = &am43xx_vpfe0_hwmod,
  753. .slave = &am33xx_l3_main_hwmod,
  754. .clk = "l3_gclk",
  755. .user = OCP_USER_MPU | OCP_USER_SDMA,
  756. };
  757. static struct omap_hwmod_ocp_if am43xx_l3__vpfe1 = {
  758. .master = &am43xx_vpfe1_hwmod,
  759. .slave = &am33xx_l3_main_hwmod,
  760. .clk = "l3_gclk",
  761. .user = OCP_USER_MPU | OCP_USER_SDMA,
  762. };
  763. static struct omap_hwmod_ocp_if am43xx_l4_ls__vpfe0 = {
  764. .master = &am33xx_l4_ls_hwmod,
  765. .slave = &am43xx_vpfe0_hwmod,
  766. .clk = "l4ls_gclk",
  767. .user = OCP_USER_MPU | OCP_USER_SDMA,
  768. };
  769. static struct omap_hwmod_ocp_if am43xx_l4_ls__vpfe1 = {
  770. .master = &am33xx_l4_ls_hwmod,
  771. .slave = &am43xx_vpfe1_hwmod,
  772. .clk = "l4ls_gclk",
  773. .user = OCP_USER_MPU | OCP_USER_SDMA,
  774. };
  775. static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
  776. &am33xx_l4_wkup__synctimer,
  777. &am43xx_l4_ls__timer8,
  778. &am43xx_l4_ls__timer9,
  779. &am43xx_l4_ls__timer10,
  780. &am43xx_l4_ls__timer11,
  781. &am43xx_l4_ls__epwmss3,
  782. &am43xx_l4_ls__epwmss4,
  783. &am43xx_l4_ls__epwmss5,
  784. &am43xx_l4_ls__mcspi2,
  785. &am43xx_l4_ls__mcspi3,
  786. &am43xx_l4_ls__mcspi4,
  787. &am43xx_l4_ls__gpio4,
  788. &am43xx_l4_ls__gpio5,
  789. &am43xx_l3_main__pruss,
  790. &am33xx_mpu__l3_main,
  791. &am33xx_mpu__prcm,
  792. &am33xx_l3_s__l4_ls,
  793. &am33xx_l3_s__l4_wkup,
  794. &am43xx_l3_main__l4_hs,
  795. &am33xx_l3_main__l3_s,
  796. &am33xx_l3_main__l3_instr,
  797. &am33xx_l3_main__gfx,
  798. &am33xx_l3_s__l3_main,
  799. &am43xx_l3_main__emif,
  800. &am33xx_pruss__l3_main,
  801. &am43xx_wkup_m3__l4_wkup,
  802. &am33xx_gfx__l3_main,
  803. &am43xx_l4_wkup__wkup_m3,
  804. &am43xx_l4_wkup__control,
  805. &am43xx_l4_wkup__smartreflex0,
  806. &am43xx_l4_wkup__smartreflex1,
  807. &am43xx_l4_wkup__uart1,
  808. &am43xx_l4_wkup__timer1,
  809. &am43xx_l4_wkup__i2c1,
  810. &am43xx_l4_wkup__gpio0,
  811. &am43xx_l4_wkup__wd_timer1,
  812. &am43xx_l4_wkup__adc_tsc,
  813. &am43xx_l3_s__qspi,
  814. &am33xx_l4_per__dcan0,
  815. &am33xx_l4_per__dcan1,
  816. &am33xx_l4_per__gpio1,
  817. &am33xx_l4_per__gpio2,
  818. &am33xx_l4_per__gpio3,
  819. &am33xx_l4_per__i2c2,
  820. &am33xx_l4_per__i2c3,
  821. &am33xx_l4_per__mailbox,
  822. &am33xx_l4_ls__mcasp0,
  823. &am33xx_l4_ls__mcasp1,
  824. &am33xx_l4_ls__mmc0,
  825. &am33xx_l4_ls__mmc1,
  826. &am33xx_l3_s__mmc2,
  827. &am33xx_l4_ls__timer2,
  828. &am33xx_l4_ls__timer3,
  829. &am33xx_l4_ls__timer4,
  830. &am33xx_l4_ls__timer5,
  831. &am33xx_l4_ls__timer6,
  832. &am33xx_l4_ls__timer7,
  833. &am33xx_l3_main__tpcc,
  834. &am33xx_l4_ls__uart2,
  835. &am33xx_l4_ls__uart3,
  836. &am33xx_l4_ls__uart4,
  837. &am33xx_l4_ls__uart5,
  838. &am33xx_l4_ls__uart6,
  839. &am33xx_l4_ls__spinlock,
  840. &am33xx_l4_ls__elm,
  841. &am33xx_l4_ls__epwmss0,
  842. &am33xx_l4_ls__epwmss1,
  843. &am33xx_l4_ls__epwmss2,
  844. &am33xx_l3_s__gpmc,
  845. &am33xx_l4_ls__mcspi0,
  846. &am33xx_l4_ls__mcspi1,
  847. &am33xx_l3_main__tptc0,
  848. &am33xx_l3_main__tptc1,
  849. &am33xx_l3_main__tptc2,
  850. &am33xx_l3_main__ocmc,
  851. &am43xx_l4_hs__cpgmac0,
  852. &am33xx_cpgmac0__mdio,
  853. &am33xx_l3_main__sha0,
  854. &am33xx_l3_main__aes0,
  855. &am43xx_l4_ls__ocp2scp0,
  856. &am43xx_l4_ls__ocp2scp1,
  857. &am43xx_l3_s__usbotgss0,
  858. &am43xx_l3_s__usbotgss1,
  859. &am43xx_dss__l3_main,
  860. &am43xx_l4_ls__dss,
  861. &am43xx_l4_ls__dss_dispc,
  862. &am43xx_l4_ls__dss_rfbi,
  863. &am43xx_l4_ls__hdq1w,
  864. &am43xx_l3__vpfe0,
  865. &am43xx_l3__vpfe1,
  866. &am43xx_l4_ls__vpfe0,
  867. &am43xx_l4_ls__vpfe1,
  868. NULL,
  869. };
  870. static struct omap_hwmod_ocp_if *am43xx_rtc_hwmod_ocp_ifs[] __initdata = {
  871. &am33xx_l4_wkup__rtc,
  872. NULL,
  873. };
  874. int __init am43xx_hwmod_init(void)
  875. {
  876. int ret;
  877. omap_hwmod_am43xx_reg();
  878. omap_hwmod_init();
  879. ret = omap_hwmod_register_links(am43xx_hwmod_ocp_ifs);
  880. if (!ret && of_machine_is_compatible("ti,am4372"))
  881. ret = omap_hwmod_register_links(am43xx_rtc_hwmod_ocp_ifs);
  882. return ret;
  883. }