omap_hwmod_33xx_43xx_ipblock_data.c 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395
  1. /*
  2. *
  3. * Copyright (C) 2013 Texas Instruments Incorporated
  4. *
  5. * Hwmod common for AM335x and AM43x
  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 "i2c.h"
  20. #include "mmc.h"
  21. #include "wd_timer.h"
  22. #include "cm33xx.h"
  23. #include "prm33xx.h"
  24. #include "omap_hwmod_33xx_43xx_common_data.h"
  25. #define CLKCTRL(oh, clkctrl) ((oh).prcm.omap4.clkctrl_offs = (clkctrl))
  26. #define RSTCTRL(oh, rstctrl) ((oh).prcm.omap4.rstctrl_offs = (rstctrl))
  27. #define RSTST(oh, rstst) ((oh).prcm.omap4.rstst_offs = (rstst))
  28. /*
  29. * 'l3' class
  30. * instance(s): l3_main, l3_s, l3_instr
  31. */
  32. static struct omap_hwmod_class am33xx_l3_hwmod_class = {
  33. .name = "l3",
  34. };
  35. struct omap_hwmod am33xx_l3_main_hwmod = {
  36. .name = "l3_main",
  37. .class = &am33xx_l3_hwmod_class,
  38. .clkdm_name = "l3_clkdm",
  39. .flags = HWMOD_INIT_NO_IDLE,
  40. .main_clk = "l3_gclk",
  41. .prcm = {
  42. .omap4 = {
  43. .modulemode = MODULEMODE_SWCTRL,
  44. },
  45. },
  46. };
  47. /* l3_s */
  48. struct omap_hwmod am33xx_l3_s_hwmod = {
  49. .name = "l3_s",
  50. .class = &am33xx_l3_hwmod_class,
  51. .clkdm_name = "l3s_clkdm",
  52. };
  53. /* l3_instr */
  54. struct omap_hwmod am33xx_l3_instr_hwmod = {
  55. .name = "l3_instr",
  56. .class = &am33xx_l3_hwmod_class,
  57. .clkdm_name = "l3_clkdm",
  58. .flags = HWMOD_INIT_NO_IDLE,
  59. .main_clk = "l3_gclk",
  60. .prcm = {
  61. .omap4 = {
  62. .modulemode = MODULEMODE_SWCTRL,
  63. },
  64. },
  65. };
  66. /*
  67. * 'l4' class
  68. * instance(s): l4_ls, l4_hs, l4_wkup, l4_fw
  69. */
  70. struct omap_hwmod_class am33xx_l4_hwmod_class = {
  71. .name = "l4",
  72. };
  73. /* l4_ls */
  74. struct omap_hwmod am33xx_l4_ls_hwmod = {
  75. .name = "l4_ls",
  76. .class = &am33xx_l4_hwmod_class,
  77. .clkdm_name = "l4ls_clkdm",
  78. .flags = HWMOD_INIT_NO_IDLE,
  79. .main_clk = "l4ls_gclk",
  80. .prcm = {
  81. .omap4 = {
  82. .modulemode = MODULEMODE_SWCTRL,
  83. },
  84. },
  85. };
  86. /* l4_wkup */
  87. struct omap_hwmod am33xx_l4_wkup_hwmod = {
  88. .name = "l4_wkup",
  89. .class = &am33xx_l4_hwmod_class,
  90. .clkdm_name = "l4_wkup_clkdm",
  91. .flags = HWMOD_INIT_NO_IDLE,
  92. .prcm = {
  93. .omap4 = {
  94. .modulemode = MODULEMODE_SWCTRL,
  95. },
  96. },
  97. };
  98. /*
  99. * 'mpu' class
  100. */
  101. static struct omap_hwmod_class am33xx_mpu_hwmod_class = {
  102. .name = "mpu",
  103. };
  104. struct omap_hwmod am33xx_mpu_hwmod = {
  105. .name = "mpu",
  106. .class = &am33xx_mpu_hwmod_class,
  107. .clkdm_name = "mpu_clkdm",
  108. .flags = HWMOD_INIT_NO_IDLE,
  109. .main_clk = "dpll_mpu_m2_ck",
  110. .prcm = {
  111. .omap4 = {
  112. .modulemode = MODULEMODE_SWCTRL,
  113. },
  114. },
  115. };
  116. /*
  117. * 'wakeup m3' class
  118. * Wakeup controller sub-system under wakeup domain
  119. */
  120. struct omap_hwmod_class am33xx_wkup_m3_hwmod_class = {
  121. .name = "wkup_m3",
  122. };
  123. /*
  124. * 'pru-icss' class
  125. * Programmable Real-Time Unit and Industrial Communication Subsystem
  126. */
  127. static struct omap_hwmod_class am33xx_pruss_hwmod_class = {
  128. .name = "pruss",
  129. };
  130. static struct omap_hwmod_rst_info am33xx_pruss_resets[] = {
  131. { .name = "pruss", .rst_shift = 1 },
  132. };
  133. /* pru-icss */
  134. /* Pseudo hwmod for reset control purpose only */
  135. struct omap_hwmod am33xx_pruss_hwmod = {
  136. .name = "pruss",
  137. .class = &am33xx_pruss_hwmod_class,
  138. .clkdm_name = "pruss_ocp_clkdm",
  139. .main_clk = "pruss_ocp_gclk",
  140. .prcm = {
  141. .omap4 = {
  142. .modulemode = MODULEMODE_SWCTRL,
  143. },
  144. },
  145. .rst_lines = am33xx_pruss_resets,
  146. .rst_lines_cnt = ARRAY_SIZE(am33xx_pruss_resets),
  147. };
  148. /* gfx */
  149. /* Pseudo hwmod for reset control purpose only */
  150. static struct omap_hwmod_class am33xx_gfx_hwmod_class = {
  151. .name = "gfx",
  152. };
  153. static struct omap_hwmod_rst_info am33xx_gfx_resets[] = {
  154. { .name = "gfx", .rst_shift = 0, .st_shift = 0},
  155. };
  156. struct omap_hwmod am33xx_gfx_hwmod = {
  157. .name = "gfx",
  158. .class = &am33xx_gfx_hwmod_class,
  159. .clkdm_name = "gfx_l3_clkdm",
  160. .main_clk = "gfx_fck_div_ck",
  161. .prcm = {
  162. .omap4 = {
  163. .modulemode = MODULEMODE_SWCTRL,
  164. },
  165. },
  166. .rst_lines = am33xx_gfx_resets,
  167. .rst_lines_cnt = ARRAY_SIZE(am33xx_gfx_resets),
  168. };
  169. /*
  170. * 'prcm' class
  171. * power and reset manager (whole prcm infrastructure)
  172. */
  173. static struct omap_hwmod_class am33xx_prcm_hwmod_class = {
  174. .name = "prcm",
  175. };
  176. /* prcm */
  177. struct omap_hwmod am33xx_prcm_hwmod = {
  178. .name = "prcm",
  179. .class = &am33xx_prcm_hwmod_class,
  180. .clkdm_name = "l4_wkup_clkdm",
  181. };
  182. /*
  183. * 'aes0' class
  184. */
  185. static struct omap_hwmod_class_sysconfig am33xx_aes0_sysc = {
  186. .rev_offs = 0x80,
  187. .sysc_offs = 0x84,
  188. .syss_offs = 0x88,
  189. .sysc_flags = SYSS_HAS_RESET_STATUS,
  190. };
  191. static struct omap_hwmod_class am33xx_aes0_hwmod_class = {
  192. .name = "aes0",
  193. .sysc = &am33xx_aes0_sysc,
  194. };
  195. struct omap_hwmod am33xx_aes0_hwmod = {
  196. .name = "aes",
  197. .class = &am33xx_aes0_hwmod_class,
  198. .clkdm_name = "l3_clkdm",
  199. .main_clk = "aes0_fck",
  200. .prcm = {
  201. .omap4 = {
  202. .modulemode = MODULEMODE_SWCTRL,
  203. },
  204. },
  205. };
  206. /* sha0 HIB2 (the 'P' (public) device) */
  207. static struct omap_hwmod_class_sysconfig am33xx_sha0_sysc = {
  208. .rev_offs = 0x100,
  209. .sysc_offs = 0x110,
  210. .syss_offs = 0x114,
  211. .sysc_flags = SYSS_HAS_RESET_STATUS,
  212. };
  213. static struct omap_hwmod_class am33xx_sha0_hwmod_class = {
  214. .name = "sha0",
  215. .sysc = &am33xx_sha0_sysc,
  216. };
  217. struct omap_hwmod am33xx_sha0_hwmod = {
  218. .name = "sham",
  219. .class = &am33xx_sha0_hwmod_class,
  220. .clkdm_name = "l3_clkdm",
  221. .main_clk = "l3_gclk",
  222. .prcm = {
  223. .omap4 = {
  224. .modulemode = MODULEMODE_SWCTRL,
  225. },
  226. },
  227. };
  228. /* ocmcram */
  229. static struct omap_hwmod_class am33xx_ocmcram_hwmod_class = {
  230. .name = "ocmcram",
  231. };
  232. struct omap_hwmod am33xx_ocmcram_hwmod = {
  233. .name = "ocmcram",
  234. .class = &am33xx_ocmcram_hwmod_class,
  235. .clkdm_name = "l3_clkdm",
  236. .flags = HWMOD_INIT_NO_IDLE,
  237. .main_clk = "l3_gclk",
  238. .prcm = {
  239. .omap4 = {
  240. .modulemode = MODULEMODE_SWCTRL,
  241. },
  242. },
  243. };
  244. /* 'smartreflex' class */
  245. static struct omap_hwmod_class am33xx_smartreflex_hwmod_class = {
  246. .name = "smartreflex",
  247. };
  248. /* smartreflex0 */
  249. struct omap_hwmod am33xx_smartreflex0_hwmod = {
  250. .name = "smartreflex0",
  251. .class = &am33xx_smartreflex_hwmod_class,
  252. .clkdm_name = "l4_wkup_clkdm",
  253. .main_clk = "smartreflex0_fck",
  254. .prcm = {
  255. .omap4 = {
  256. .modulemode = MODULEMODE_SWCTRL,
  257. },
  258. },
  259. };
  260. /* smartreflex1 */
  261. struct omap_hwmod am33xx_smartreflex1_hwmod = {
  262. .name = "smartreflex1",
  263. .class = &am33xx_smartreflex_hwmod_class,
  264. .clkdm_name = "l4_wkup_clkdm",
  265. .main_clk = "smartreflex1_fck",
  266. .prcm = {
  267. .omap4 = {
  268. .modulemode = MODULEMODE_SWCTRL,
  269. },
  270. },
  271. };
  272. /*
  273. * 'control' module class
  274. */
  275. struct omap_hwmod_class am33xx_control_hwmod_class = {
  276. .name = "control",
  277. };
  278. /*
  279. * 'cpgmac' class
  280. * cpsw/cpgmac sub system
  281. */
  282. static struct omap_hwmod_class_sysconfig am33xx_cpgmac_sysc = {
  283. .rev_offs = 0x0,
  284. .sysc_offs = 0x8,
  285. .syss_offs = 0x4,
  286. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
  287. SYSS_HAS_RESET_STATUS),
  288. .idlemodes = (SIDLE_FORCE | SIDLE_NO | MSTANDBY_FORCE |
  289. MSTANDBY_NO),
  290. .sysc_fields = &omap_hwmod_sysc_type3,
  291. };
  292. static struct omap_hwmod_class am33xx_cpgmac0_hwmod_class = {
  293. .name = "cpgmac0",
  294. .sysc = &am33xx_cpgmac_sysc,
  295. };
  296. struct omap_hwmod am33xx_cpgmac0_hwmod = {
  297. .name = "cpgmac0",
  298. .class = &am33xx_cpgmac0_hwmod_class,
  299. .clkdm_name = "cpsw_125mhz_clkdm",
  300. .flags = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
  301. .main_clk = "cpsw_125mhz_gclk",
  302. .mpu_rt_idx = 1,
  303. .prcm = {
  304. .omap4 = {
  305. .modulemode = MODULEMODE_SWCTRL,
  306. },
  307. },
  308. };
  309. /*
  310. * mdio class
  311. */
  312. static struct omap_hwmod_class am33xx_mdio_hwmod_class = {
  313. .name = "davinci_mdio",
  314. };
  315. struct omap_hwmod am33xx_mdio_hwmod = {
  316. .name = "davinci_mdio",
  317. .class = &am33xx_mdio_hwmod_class,
  318. .clkdm_name = "cpsw_125mhz_clkdm",
  319. .main_clk = "cpsw_125mhz_gclk",
  320. };
  321. /*
  322. * dcan class
  323. */
  324. static struct omap_hwmod_class am33xx_dcan_hwmod_class = {
  325. .name = "d_can",
  326. };
  327. /* dcan0 */
  328. struct omap_hwmod am33xx_dcan0_hwmod = {
  329. .name = "d_can0",
  330. .class = &am33xx_dcan_hwmod_class,
  331. .clkdm_name = "l4ls_clkdm",
  332. .main_clk = "dcan0_fck",
  333. .prcm = {
  334. .omap4 = {
  335. .modulemode = MODULEMODE_SWCTRL,
  336. },
  337. },
  338. };
  339. /* dcan1 */
  340. struct omap_hwmod am33xx_dcan1_hwmod = {
  341. .name = "d_can1",
  342. .class = &am33xx_dcan_hwmod_class,
  343. .clkdm_name = "l4ls_clkdm",
  344. .main_clk = "dcan1_fck",
  345. .prcm = {
  346. .omap4 = {
  347. .modulemode = MODULEMODE_SWCTRL,
  348. },
  349. },
  350. };
  351. /* elm */
  352. static struct omap_hwmod_class_sysconfig am33xx_elm_sysc = {
  353. .rev_offs = 0x0000,
  354. .sysc_offs = 0x0010,
  355. .syss_offs = 0x0014,
  356. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  357. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  358. SYSS_HAS_RESET_STATUS),
  359. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  360. .sysc_fields = &omap_hwmod_sysc_type1,
  361. };
  362. static struct omap_hwmod_class am33xx_elm_hwmod_class = {
  363. .name = "elm",
  364. .sysc = &am33xx_elm_sysc,
  365. };
  366. struct omap_hwmod am33xx_elm_hwmod = {
  367. .name = "elm",
  368. .class = &am33xx_elm_hwmod_class,
  369. .clkdm_name = "l4ls_clkdm",
  370. .main_clk = "l4ls_gclk",
  371. .prcm = {
  372. .omap4 = {
  373. .modulemode = MODULEMODE_SWCTRL,
  374. },
  375. },
  376. };
  377. /* pwmss */
  378. static struct omap_hwmod_class_sysconfig am33xx_epwmss_sysc = {
  379. .rev_offs = 0x0,
  380. .sysc_offs = 0x4,
  381. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE),
  382. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  383. SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
  384. MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
  385. .sysc_fields = &omap_hwmod_sysc_type2,
  386. };
  387. struct omap_hwmod_class am33xx_epwmss_hwmod_class = {
  388. .name = "epwmss",
  389. .sysc = &am33xx_epwmss_sysc,
  390. };
  391. static struct omap_hwmod_class am33xx_ecap_hwmod_class = {
  392. .name = "ecap",
  393. };
  394. static struct omap_hwmod_class am33xx_eqep_hwmod_class = {
  395. .name = "eqep",
  396. };
  397. struct omap_hwmod_class am33xx_ehrpwm_hwmod_class = {
  398. .name = "ehrpwm",
  399. };
  400. /* epwmss0 */
  401. struct omap_hwmod am33xx_epwmss0_hwmod = {
  402. .name = "epwmss0",
  403. .class = &am33xx_epwmss_hwmod_class,
  404. .clkdm_name = "l4ls_clkdm",
  405. .main_clk = "l4ls_gclk",
  406. .prcm = {
  407. .omap4 = {
  408. .modulemode = MODULEMODE_SWCTRL,
  409. },
  410. },
  411. };
  412. /* ecap0 */
  413. struct omap_hwmod am33xx_ecap0_hwmod = {
  414. .name = "ecap0",
  415. .class = &am33xx_ecap_hwmod_class,
  416. .clkdm_name = "l4ls_clkdm",
  417. .main_clk = "l4ls_gclk",
  418. };
  419. /* eqep0 */
  420. struct omap_hwmod am33xx_eqep0_hwmod = {
  421. .name = "eqep0",
  422. .class = &am33xx_eqep_hwmod_class,
  423. .clkdm_name = "l4ls_clkdm",
  424. .main_clk = "l4ls_gclk",
  425. };
  426. /* ehrpwm0 */
  427. struct omap_hwmod am33xx_ehrpwm0_hwmod = {
  428. .name = "ehrpwm0",
  429. .class = &am33xx_ehrpwm_hwmod_class,
  430. .clkdm_name = "l4ls_clkdm",
  431. .main_clk = "l4ls_gclk",
  432. };
  433. /* epwmss1 */
  434. struct omap_hwmod am33xx_epwmss1_hwmod = {
  435. .name = "epwmss1",
  436. .class = &am33xx_epwmss_hwmod_class,
  437. .clkdm_name = "l4ls_clkdm",
  438. .main_clk = "l4ls_gclk",
  439. .prcm = {
  440. .omap4 = {
  441. .modulemode = MODULEMODE_SWCTRL,
  442. },
  443. },
  444. };
  445. /* ecap1 */
  446. struct omap_hwmod am33xx_ecap1_hwmod = {
  447. .name = "ecap1",
  448. .class = &am33xx_ecap_hwmod_class,
  449. .clkdm_name = "l4ls_clkdm",
  450. .main_clk = "l4ls_gclk",
  451. };
  452. /* eqep1 */
  453. struct omap_hwmod am33xx_eqep1_hwmod = {
  454. .name = "eqep1",
  455. .class = &am33xx_eqep_hwmod_class,
  456. .clkdm_name = "l4ls_clkdm",
  457. .main_clk = "l4ls_gclk",
  458. };
  459. /* ehrpwm1 */
  460. struct omap_hwmod am33xx_ehrpwm1_hwmod = {
  461. .name = "ehrpwm1",
  462. .class = &am33xx_ehrpwm_hwmod_class,
  463. .clkdm_name = "l4ls_clkdm",
  464. .main_clk = "l4ls_gclk",
  465. };
  466. /* epwmss2 */
  467. struct omap_hwmod am33xx_epwmss2_hwmod = {
  468. .name = "epwmss2",
  469. .class = &am33xx_epwmss_hwmod_class,
  470. .clkdm_name = "l4ls_clkdm",
  471. .main_clk = "l4ls_gclk",
  472. .prcm = {
  473. .omap4 = {
  474. .modulemode = MODULEMODE_SWCTRL,
  475. },
  476. },
  477. };
  478. /* ecap2 */
  479. struct omap_hwmod am33xx_ecap2_hwmod = {
  480. .name = "ecap2",
  481. .class = &am33xx_ecap_hwmod_class,
  482. .clkdm_name = "l4ls_clkdm",
  483. .main_clk = "l4ls_gclk",
  484. };
  485. /* eqep2 */
  486. struct omap_hwmod am33xx_eqep2_hwmod = {
  487. .name = "eqep2",
  488. .class = &am33xx_eqep_hwmod_class,
  489. .clkdm_name = "l4ls_clkdm",
  490. .main_clk = "l4ls_gclk",
  491. };
  492. /* ehrpwm2 */
  493. struct omap_hwmod am33xx_ehrpwm2_hwmod = {
  494. .name = "ehrpwm2",
  495. .class = &am33xx_ehrpwm_hwmod_class,
  496. .clkdm_name = "l4ls_clkdm",
  497. .main_clk = "l4ls_gclk",
  498. };
  499. /*
  500. * 'gpio' class: for gpio 0,1,2,3
  501. */
  502. static struct omap_hwmod_class_sysconfig am33xx_gpio_sysc = {
  503. .rev_offs = 0x0000,
  504. .sysc_offs = 0x0010,
  505. .syss_offs = 0x0114,
  506. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
  507. SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
  508. SYSS_HAS_RESET_STATUS),
  509. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  510. SIDLE_SMART_WKUP),
  511. .sysc_fields = &omap_hwmod_sysc_type1,
  512. };
  513. struct omap_hwmod_class am33xx_gpio_hwmod_class = {
  514. .name = "gpio",
  515. .sysc = &am33xx_gpio_sysc,
  516. .rev = 2,
  517. };
  518. struct omap_gpio_dev_attr gpio_dev_attr = {
  519. .bank_width = 32,
  520. .dbck_flag = true,
  521. };
  522. /* gpio1 */
  523. static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
  524. { .role = "dbclk", .clk = "gpio1_dbclk" },
  525. };
  526. struct omap_hwmod am33xx_gpio1_hwmod = {
  527. .name = "gpio2",
  528. .class = &am33xx_gpio_hwmod_class,
  529. .clkdm_name = "l4ls_clkdm",
  530. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  531. .main_clk = "l4ls_gclk",
  532. .prcm = {
  533. .omap4 = {
  534. .modulemode = MODULEMODE_SWCTRL,
  535. },
  536. },
  537. .opt_clks = gpio1_opt_clks,
  538. .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
  539. .dev_attr = &gpio_dev_attr,
  540. };
  541. /* gpio2 */
  542. static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
  543. { .role = "dbclk", .clk = "gpio2_dbclk" },
  544. };
  545. struct omap_hwmod am33xx_gpio2_hwmod = {
  546. .name = "gpio3",
  547. .class = &am33xx_gpio_hwmod_class,
  548. .clkdm_name = "l4ls_clkdm",
  549. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  550. .main_clk = "l4ls_gclk",
  551. .prcm = {
  552. .omap4 = {
  553. .modulemode = MODULEMODE_SWCTRL,
  554. },
  555. },
  556. .opt_clks = gpio2_opt_clks,
  557. .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
  558. .dev_attr = &gpio_dev_attr,
  559. };
  560. /* gpio3 */
  561. static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
  562. { .role = "dbclk", .clk = "gpio3_dbclk" },
  563. };
  564. struct omap_hwmod am33xx_gpio3_hwmod = {
  565. .name = "gpio4",
  566. .class = &am33xx_gpio_hwmod_class,
  567. .clkdm_name = "l4ls_clkdm",
  568. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  569. .main_clk = "l4ls_gclk",
  570. .prcm = {
  571. .omap4 = {
  572. .modulemode = MODULEMODE_SWCTRL,
  573. },
  574. },
  575. .opt_clks = gpio3_opt_clks,
  576. .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
  577. .dev_attr = &gpio_dev_attr,
  578. };
  579. /* gpmc */
  580. static struct omap_hwmod_class_sysconfig gpmc_sysc = {
  581. .rev_offs = 0x0,
  582. .sysc_offs = 0x10,
  583. .syss_offs = 0x14,
  584. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
  585. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  586. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  587. .sysc_fields = &omap_hwmod_sysc_type1,
  588. };
  589. static struct omap_hwmod_class am33xx_gpmc_hwmod_class = {
  590. .name = "gpmc",
  591. .sysc = &gpmc_sysc,
  592. };
  593. struct omap_hwmod am33xx_gpmc_hwmod = {
  594. .name = "gpmc",
  595. .class = &am33xx_gpmc_hwmod_class,
  596. .clkdm_name = "l3s_clkdm",
  597. .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET),
  598. .main_clk = "l3s_gclk",
  599. .prcm = {
  600. .omap4 = {
  601. .modulemode = MODULEMODE_SWCTRL,
  602. },
  603. },
  604. };
  605. /* 'i2c' class */
  606. static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
  607. .sysc_offs = 0x0010,
  608. .syss_offs = 0x0090,
  609. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
  610. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  611. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  612. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  613. SIDLE_SMART_WKUP),
  614. .sysc_fields = &omap_hwmod_sysc_type1,
  615. };
  616. static struct omap_hwmod_class i2c_class = {
  617. .name = "i2c",
  618. .sysc = &am33xx_i2c_sysc,
  619. .rev = OMAP_I2C_IP_VERSION_2,
  620. .reset = &omap_i2c_reset,
  621. };
  622. static struct omap_i2c_dev_attr i2c_dev_attr = {
  623. .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE,
  624. };
  625. /* i2c1 */
  626. struct omap_hwmod am33xx_i2c1_hwmod = {
  627. .name = "i2c1",
  628. .class = &i2c_class,
  629. .clkdm_name = "l4_wkup_clkdm",
  630. .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
  631. .main_clk = "dpll_per_m2_div4_wkupdm_ck",
  632. .prcm = {
  633. .omap4 = {
  634. .modulemode = MODULEMODE_SWCTRL,
  635. },
  636. },
  637. .dev_attr = &i2c_dev_attr,
  638. };
  639. /* i2c1 */
  640. struct omap_hwmod am33xx_i2c2_hwmod = {
  641. .name = "i2c2",
  642. .class = &i2c_class,
  643. .clkdm_name = "l4ls_clkdm",
  644. .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
  645. .main_clk = "dpll_per_m2_div4_ck",
  646. .prcm = {
  647. .omap4 = {
  648. .modulemode = MODULEMODE_SWCTRL,
  649. },
  650. },
  651. .dev_attr = &i2c_dev_attr,
  652. };
  653. /* i2c3 */
  654. struct omap_hwmod am33xx_i2c3_hwmod = {
  655. .name = "i2c3",
  656. .class = &i2c_class,
  657. .clkdm_name = "l4ls_clkdm",
  658. .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
  659. .main_clk = "dpll_per_m2_div4_ck",
  660. .prcm = {
  661. .omap4 = {
  662. .modulemode = MODULEMODE_SWCTRL,
  663. },
  664. },
  665. .dev_attr = &i2c_dev_attr,
  666. };
  667. /*
  668. * 'mailbox' class
  669. * mailbox module allowing communication between the on-chip processors using a
  670. * queued mailbox-interrupt mechanism.
  671. */
  672. static struct omap_hwmod_class_sysconfig am33xx_mailbox_sysc = {
  673. .rev_offs = 0x0000,
  674. .sysc_offs = 0x0010,
  675. .sysc_flags = (SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
  676. SYSC_HAS_SOFTRESET),
  677. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  678. .sysc_fields = &omap_hwmod_sysc_type2,
  679. };
  680. static struct omap_hwmod_class am33xx_mailbox_hwmod_class = {
  681. .name = "mailbox",
  682. .sysc = &am33xx_mailbox_sysc,
  683. };
  684. struct omap_hwmod am33xx_mailbox_hwmod = {
  685. .name = "mailbox",
  686. .class = &am33xx_mailbox_hwmod_class,
  687. .clkdm_name = "l4ls_clkdm",
  688. .main_clk = "l4ls_gclk",
  689. .prcm = {
  690. .omap4 = {
  691. .modulemode = MODULEMODE_SWCTRL,
  692. },
  693. },
  694. };
  695. /*
  696. * 'mcasp' class
  697. */
  698. static struct omap_hwmod_class_sysconfig am33xx_mcasp_sysc = {
  699. .rev_offs = 0x0,
  700. .sysc_offs = 0x4,
  701. .sysc_flags = SYSC_HAS_SIDLEMODE,
  702. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  703. .sysc_fields = &omap_hwmod_sysc_type3,
  704. };
  705. static struct omap_hwmod_class am33xx_mcasp_hwmod_class = {
  706. .name = "mcasp",
  707. .sysc = &am33xx_mcasp_sysc,
  708. };
  709. /* mcasp0 */
  710. struct omap_hwmod am33xx_mcasp0_hwmod = {
  711. .name = "mcasp0",
  712. .class = &am33xx_mcasp_hwmod_class,
  713. .clkdm_name = "l3s_clkdm",
  714. .main_clk = "mcasp0_fck",
  715. .prcm = {
  716. .omap4 = {
  717. .modulemode = MODULEMODE_SWCTRL,
  718. },
  719. },
  720. };
  721. /* mcasp1 */
  722. struct omap_hwmod am33xx_mcasp1_hwmod = {
  723. .name = "mcasp1",
  724. .class = &am33xx_mcasp_hwmod_class,
  725. .clkdm_name = "l3s_clkdm",
  726. .main_clk = "mcasp1_fck",
  727. .prcm = {
  728. .omap4 = {
  729. .modulemode = MODULEMODE_SWCTRL,
  730. },
  731. },
  732. };
  733. /* 'mmc' class */
  734. static struct omap_hwmod_class_sysconfig am33xx_mmc_sysc = {
  735. .rev_offs = 0x1fc,
  736. .sysc_offs = 0x10,
  737. .syss_offs = 0x14,
  738. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  739. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  740. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  741. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  742. .sysc_fields = &omap_hwmod_sysc_type1,
  743. };
  744. static struct omap_hwmod_class am33xx_mmc_hwmod_class = {
  745. .name = "mmc",
  746. .sysc = &am33xx_mmc_sysc,
  747. };
  748. /* mmc0 */
  749. static struct omap_mmc_dev_attr am33xx_mmc0_dev_attr = {
  750. .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
  751. };
  752. struct omap_hwmod am33xx_mmc0_hwmod = {
  753. .name = "mmc1",
  754. .class = &am33xx_mmc_hwmod_class,
  755. .clkdm_name = "l4ls_clkdm",
  756. .main_clk = "mmc_clk",
  757. .prcm = {
  758. .omap4 = {
  759. .modulemode = MODULEMODE_SWCTRL,
  760. },
  761. },
  762. .dev_attr = &am33xx_mmc0_dev_attr,
  763. };
  764. /* mmc1 */
  765. static struct omap_mmc_dev_attr am33xx_mmc1_dev_attr = {
  766. .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
  767. };
  768. struct omap_hwmod am33xx_mmc1_hwmod = {
  769. .name = "mmc2",
  770. .class = &am33xx_mmc_hwmod_class,
  771. .clkdm_name = "l4ls_clkdm",
  772. .main_clk = "mmc_clk",
  773. .prcm = {
  774. .omap4 = {
  775. .modulemode = MODULEMODE_SWCTRL,
  776. },
  777. },
  778. .dev_attr = &am33xx_mmc1_dev_attr,
  779. };
  780. /* mmc2 */
  781. static struct omap_mmc_dev_attr am33xx_mmc2_dev_attr = {
  782. .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
  783. };
  784. struct omap_hwmod am33xx_mmc2_hwmod = {
  785. .name = "mmc3",
  786. .class = &am33xx_mmc_hwmod_class,
  787. .clkdm_name = "l3s_clkdm",
  788. .main_clk = "mmc_clk",
  789. .prcm = {
  790. .omap4 = {
  791. .modulemode = MODULEMODE_SWCTRL,
  792. },
  793. },
  794. .dev_attr = &am33xx_mmc2_dev_attr,
  795. };
  796. /*
  797. * 'rtc' class
  798. * rtc subsystem
  799. */
  800. static struct omap_hwmod_class_sysconfig am33xx_rtc_sysc = {
  801. .rev_offs = 0x0074,
  802. .sysc_offs = 0x0078,
  803. .sysc_flags = SYSC_HAS_SIDLEMODE,
  804. .idlemodes = (SIDLE_FORCE | SIDLE_NO |
  805. SIDLE_SMART | SIDLE_SMART_WKUP),
  806. .sysc_fields = &omap_hwmod_sysc_type3,
  807. };
  808. static struct omap_hwmod_class am33xx_rtc_hwmod_class = {
  809. .name = "rtc",
  810. .sysc = &am33xx_rtc_sysc,
  811. };
  812. struct omap_hwmod am33xx_rtc_hwmod = {
  813. .name = "rtc",
  814. .class = &am33xx_rtc_hwmod_class,
  815. .clkdm_name = "l4_rtc_clkdm",
  816. .main_clk = "clk_32768_ck",
  817. .prcm = {
  818. .omap4 = {
  819. .modulemode = MODULEMODE_SWCTRL,
  820. },
  821. },
  822. };
  823. /* 'spi' class */
  824. static struct omap_hwmod_class_sysconfig am33xx_mcspi_sysc = {
  825. .rev_offs = 0x0000,
  826. .sysc_offs = 0x0110,
  827. .syss_offs = 0x0114,
  828. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  829. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  830. SYSS_HAS_RESET_STATUS),
  831. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  832. .sysc_fields = &omap_hwmod_sysc_type1,
  833. };
  834. struct omap_hwmod_class am33xx_spi_hwmod_class = {
  835. .name = "mcspi",
  836. .sysc = &am33xx_mcspi_sysc,
  837. .rev = OMAP4_MCSPI_REV,
  838. };
  839. /* spi0 */
  840. struct omap2_mcspi_dev_attr mcspi_attrib = {
  841. .num_chipselect = 2,
  842. };
  843. struct omap_hwmod am33xx_spi0_hwmod = {
  844. .name = "spi0",
  845. .class = &am33xx_spi_hwmod_class,
  846. .clkdm_name = "l4ls_clkdm",
  847. .main_clk = "dpll_per_m2_div4_ck",
  848. .prcm = {
  849. .omap4 = {
  850. .modulemode = MODULEMODE_SWCTRL,
  851. },
  852. },
  853. .dev_attr = &mcspi_attrib,
  854. };
  855. /* spi1 */
  856. struct omap_hwmod am33xx_spi1_hwmod = {
  857. .name = "spi1",
  858. .class = &am33xx_spi_hwmod_class,
  859. .clkdm_name = "l4ls_clkdm",
  860. .main_clk = "dpll_per_m2_div4_ck",
  861. .prcm = {
  862. .omap4 = {
  863. .modulemode = MODULEMODE_SWCTRL,
  864. },
  865. },
  866. .dev_attr = &mcspi_attrib,
  867. };
  868. /*
  869. * 'spinlock' class
  870. * spinlock provides hardware assistance for synchronizing the
  871. * processes running on multiple processors
  872. */
  873. static struct omap_hwmod_class_sysconfig am33xx_spinlock_sysc = {
  874. .rev_offs = 0x0000,
  875. .sysc_offs = 0x0010,
  876. .syss_offs = 0x0014,
  877. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
  878. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  879. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  880. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  881. .sysc_fields = &omap_hwmod_sysc_type1,
  882. };
  883. static struct omap_hwmod_class am33xx_spinlock_hwmod_class = {
  884. .name = "spinlock",
  885. .sysc = &am33xx_spinlock_sysc,
  886. };
  887. struct omap_hwmod am33xx_spinlock_hwmod = {
  888. .name = "spinlock",
  889. .class = &am33xx_spinlock_hwmod_class,
  890. .clkdm_name = "l4ls_clkdm",
  891. .main_clk = "l4ls_gclk",
  892. .prcm = {
  893. .omap4 = {
  894. .modulemode = MODULEMODE_SWCTRL,
  895. },
  896. },
  897. };
  898. /* 'timer 2-7' class */
  899. static struct omap_hwmod_class_sysconfig am33xx_timer_sysc = {
  900. .rev_offs = 0x0000,
  901. .sysc_offs = 0x0010,
  902. .syss_offs = 0x0014,
  903. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
  904. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  905. SIDLE_SMART_WKUP),
  906. .sysc_fields = &omap_hwmod_sysc_type2,
  907. };
  908. struct omap_hwmod_class am33xx_timer_hwmod_class = {
  909. .name = "timer",
  910. .sysc = &am33xx_timer_sysc,
  911. };
  912. /* timer1 1ms */
  913. static struct omap_hwmod_class_sysconfig am33xx_timer1ms_sysc = {
  914. .rev_offs = 0x0000,
  915. .sysc_offs = 0x0010,
  916. .syss_offs = 0x0014,
  917. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  918. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  919. SYSS_HAS_RESET_STATUS),
  920. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  921. .sysc_fields = &omap_hwmod_sysc_type1,
  922. };
  923. static struct omap_hwmod_class am33xx_timer1ms_hwmod_class = {
  924. .name = "timer",
  925. .sysc = &am33xx_timer1ms_sysc,
  926. };
  927. struct omap_hwmod am33xx_timer1_hwmod = {
  928. .name = "timer1",
  929. .class = &am33xx_timer1ms_hwmod_class,
  930. .clkdm_name = "l4_wkup_clkdm",
  931. .main_clk = "timer1_fck",
  932. .prcm = {
  933. .omap4 = {
  934. .modulemode = MODULEMODE_SWCTRL,
  935. },
  936. },
  937. };
  938. struct omap_hwmod am33xx_timer2_hwmod = {
  939. .name = "timer2",
  940. .class = &am33xx_timer_hwmod_class,
  941. .clkdm_name = "l4ls_clkdm",
  942. .main_clk = "timer2_fck",
  943. .prcm = {
  944. .omap4 = {
  945. .modulemode = MODULEMODE_SWCTRL,
  946. },
  947. },
  948. };
  949. struct omap_hwmod am33xx_timer3_hwmod = {
  950. .name = "timer3",
  951. .class = &am33xx_timer_hwmod_class,
  952. .clkdm_name = "l4ls_clkdm",
  953. .main_clk = "timer3_fck",
  954. .prcm = {
  955. .omap4 = {
  956. .modulemode = MODULEMODE_SWCTRL,
  957. },
  958. },
  959. };
  960. struct omap_hwmod am33xx_timer4_hwmod = {
  961. .name = "timer4",
  962. .class = &am33xx_timer_hwmod_class,
  963. .clkdm_name = "l4ls_clkdm",
  964. .main_clk = "timer4_fck",
  965. .prcm = {
  966. .omap4 = {
  967. .modulemode = MODULEMODE_SWCTRL,
  968. },
  969. },
  970. };
  971. struct omap_hwmod am33xx_timer5_hwmod = {
  972. .name = "timer5",
  973. .class = &am33xx_timer_hwmod_class,
  974. .clkdm_name = "l4ls_clkdm",
  975. .main_clk = "timer5_fck",
  976. .prcm = {
  977. .omap4 = {
  978. .modulemode = MODULEMODE_SWCTRL,
  979. },
  980. },
  981. };
  982. struct omap_hwmod am33xx_timer6_hwmod = {
  983. .name = "timer6",
  984. .class = &am33xx_timer_hwmod_class,
  985. .clkdm_name = "l4ls_clkdm",
  986. .main_clk = "timer6_fck",
  987. .prcm = {
  988. .omap4 = {
  989. .modulemode = MODULEMODE_SWCTRL,
  990. },
  991. },
  992. };
  993. struct omap_hwmod am33xx_timer7_hwmod = {
  994. .name = "timer7",
  995. .class = &am33xx_timer_hwmod_class,
  996. .clkdm_name = "l4ls_clkdm",
  997. .main_clk = "timer7_fck",
  998. .prcm = {
  999. .omap4 = {
  1000. .modulemode = MODULEMODE_SWCTRL,
  1001. },
  1002. },
  1003. };
  1004. /* tpcc */
  1005. static struct omap_hwmod_class am33xx_tpcc_hwmod_class = {
  1006. .name = "tpcc",
  1007. };
  1008. struct omap_hwmod am33xx_tpcc_hwmod = {
  1009. .name = "tpcc",
  1010. .class = &am33xx_tpcc_hwmod_class,
  1011. .clkdm_name = "l3_clkdm",
  1012. .main_clk = "l3_gclk",
  1013. .prcm = {
  1014. .omap4 = {
  1015. .modulemode = MODULEMODE_SWCTRL,
  1016. },
  1017. },
  1018. };
  1019. static struct omap_hwmod_class_sysconfig am33xx_tptc_sysc = {
  1020. .rev_offs = 0x0,
  1021. .sysc_offs = 0x10,
  1022. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
  1023. SYSC_HAS_MIDLEMODE),
  1024. .idlemodes = (SIDLE_FORCE | SIDLE_SMART | MSTANDBY_FORCE),
  1025. .sysc_fields = &omap_hwmod_sysc_type2,
  1026. };
  1027. /* 'tptc' class */
  1028. static struct omap_hwmod_class am33xx_tptc_hwmod_class = {
  1029. .name = "tptc",
  1030. .sysc = &am33xx_tptc_sysc,
  1031. };
  1032. /* tptc0 */
  1033. struct omap_hwmod am33xx_tptc0_hwmod = {
  1034. .name = "tptc0",
  1035. .class = &am33xx_tptc_hwmod_class,
  1036. .clkdm_name = "l3_clkdm",
  1037. .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
  1038. .main_clk = "l3_gclk",
  1039. .prcm = {
  1040. .omap4 = {
  1041. .modulemode = MODULEMODE_SWCTRL,
  1042. },
  1043. },
  1044. };
  1045. /* tptc1 */
  1046. struct omap_hwmod am33xx_tptc1_hwmod = {
  1047. .name = "tptc1",
  1048. .class = &am33xx_tptc_hwmod_class,
  1049. .clkdm_name = "l3_clkdm",
  1050. .flags = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
  1051. .main_clk = "l3_gclk",
  1052. .prcm = {
  1053. .omap4 = {
  1054. .modulemode = MODULEMODE_SWCTRL,
  1055. },
  1056. },
  1057. };
  1058. /* tptc2 */
  1059. struct omap_hwmod am33xx_tptc2_hwmod = {
  1060. .name = "tptc2",
  1061. .class = &am33xx_tptc_hwmod_class,
  1062. .clkdm_name = "l3_clkdm",
  1063. .flags = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
  1064. .main_clk = "l3_gclk",
  1065. .prcm = {
  1066. .omap4 = {
  1067. .modulemode = MODULEMODE_SWCTRL,
  1068. },
  1069. },
  1070. };
  1071. /* 'uart' class */
  1072. static struct omap_hwmod_class_sysconfig uart_sysc = {
  1073. .rev_offs = 0x50,
  1074. .sysc_offs = 0x54,
  1075. .syss_offs = 0x58,
  1076. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
  1077. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  1078. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  1079. SIDLE_SMART_WKUP),
  1080. .sysc_fields = &omap_hwmod_sysc_type1,
  1081. };
  1082. static struct omap_hwmod_class uart_class = {
  1083. .name = "uart",
  1084. .sysc = &uart_sysc,
  1085. };
  1086. struct omap_hwmod am33xx_uart1_hwmod = {
  1087. .name = "uart1",
  1088. .class = &uart_class,
  1089. .clkdm_name = "l4_wkup_clkdm",
  1090. .flags = DEBUG_AM33XXUART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
  1091. .main_clk = "dpll_per_m2_div4_wkupdm_ck",
  1092. .prcm = {
  1093. .omap4 = {
  1094. .modulemode = MODULEMODE_SWCTRL,
  1095. },
  1096. },
  1097. };
  1098. struct omap_hwmod am33xx_uart2_hwmod = {
  1099. .name = "uart2",
  1100. .class = &uart_class,
  1101. .clkdm_name = "l4ls_clkdm",
  1102. .flags = HWMOD_SWSUP_SIDLE_ACT,
  1103. .main_clk = "dpll_per_m2_div4_ck",
  1104. .prcm = {
  1105. .omap4 = {
  1106. .modulemode = MODULEMODE_SWCTRL,
  1107. },
  1108. },
  1109. };
  1110. /* uart3 */
  1111. struct omap_hwmod am33xx_uart3_hwmod = {
  1112. .name = "uart3",
  1113. .class = &uart_class,
  1114. .clkdm_name = "l4ls_clkdm",
  1115. .flags = HWMOD_SWSUP_SIDLE_ACT,
  1116. .main_clk = "dpll_per_m2_div4_ck",
  1117. .prcm = {
  1118. .omap4 = {
  1119. .modulemode = MODULEMODE_SWCTRL,
  1120. },
  1121. },
  1122. };
  1123. struct omap_hwmod am33xx_uart4_hwmod = {
  1124. .name = "uart4",
  1125. .class = &uart_class,
  1126. .clkdm_name = "l4ls_clkdm",
  1127. .flags = HWMOD_SWSUP_SIDLE_ACT,
  1128. .main_clk = "dpll_per_m2_div4_ck",
  1129. .prcm = {
  1130. .omap4 = {
  1131. .modulemode = MODULEMODE_SWCTRL,
  1132. },
  1133. },
  1134. };
  1135. struct omap_hwmod am33xx_uart5_hwmod = {
  1136. .name = "uart5",
  1137. .class = &uart_class,
  1138. .clkdm_name = "l4ls_clkdm",
  1139. .flags = HWMOD_SWSUP_SIDLE_ACT,
  1140. .main_clk = "dpll_per_m2_div4_ck",
  1141. .prcm = {
  1142. .omap4 = {
  1143. .modulemode = MODULEMODE_SWCTRL,
  1144. },
  1145. },
  1146. };
  1147. struct omap_hwmod am33xx_uart6_hwmod = {
  1148. .name = "uart6",
  1149. .class = &uart_class,
  1150. .clkdm_name = "l4ls_clkdm",
  1151. .flags = HWMOD_SWSUP_SIDLE_ACT,
  1152. .main_clk = "dpll_per_m2_div4_ck",
  1153. .prcm = {
  1154. .omap4 = {
  1155. .modulemode = MODULEMODE_SWCTRL,
  1156. },
  1157. },
  1158. };
  1159. /* 'wd_timer' class */
  1160. static struct omap_hwmod_class_sysconfig wdt_sysc = {
  1161. .rev_offs = 0x0,
  1162. .sysc_offs = 0x10,
  1163. .syss_offs = 0x14,
  1164. .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SIDLEMODE |
  1165. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  1166. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  1167. SIDLE_SMART_WKUP),
  1168. .sysc_fields = &omap_hwmod_sysc_type1,
  1169. };
  1170. static struct omap_hwmod_class am33xx_wd_timer_hwmod_class = {
  1171. .name = "wd_timer",
  1172. .sysc = &wdt_sysc,
  1173. .pre_shutdown = &omap2_wd_timer_disable,
  1174. };
  1175. /*
  1176. * XXX: device.c file uses hardcoded name for watchdog timer
  1177. * driver "wd_timer2, so we are also using same name as of now...
  1178. */
  1179. struct omap_hwmod am33xx_wd_timer1_hwmod = {
  1180. .name = "wd_timer2",
  1181. .class = &am33xx_wd_timer_hwmod_class,
  1182. .clkdm_name = "l4_wkup_clkdm",
  1183. .flags = HWMOD_SWSUP_SIDLE,
  1184. .main_clk = "wdt1_fck",
  1185. .prcm = {
  1186. .omap4 = {
  1187. .modulemode = MODULEMODE_SWCTRL,
  1188. },
  1189. },
  1190. };
  1191. static void omap_hwmod_am33xx_clkctrl(void)
  1192. {
  1193. CLKCTRL(am33xx_uart2_hwmod, AM33XX_CM_PER_UART1_CLKCTRL_OFFSET);
  1194. CLKCTRL(am33xx_uart3_hwmod, AM33XX_CM_PER_UART2_CLKCTRL_OFFSET);
  1195. CLKCTRL(am33xx_uart4_hwmod, AM33XX_CM_PER_UART3_CLKCTRL_OFFSET);
  1196. CLKCTRL(am33xx_uart5_hwmod, AM33XX_CM_PER_UART4_CLKCTRL_OFFSET);
  1197. CLKCTRL(am33xx_uart6_hwmod, AM33XX_CM_PER_UART5_CLKCTRL_OFFSET);
  1198. CLKCTRL(am33xx_dcan0_hwmod, AM33XX_CM_PER_DCAN0_CLKCTRL_OFFSET);
  1199. CLKCTRL(am33xx_dcan1_hwmod, AM33XX_CM_PER_DCAN1_CLKCTRL_OFFSET);
  1200. CLKCTRL(am33xx_elm_hwmod, AM33XX_CM_PER_ELM_CLKCTRL_OFFSET);
  1201. CLKCTRL(am33xx_epwmss0_hwmod, AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET);
  1202. CLKCTRL(am33xx_epwmss1_hwmod, AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET);
  1203. CLKCTRL(am33xx_epwmss2_hwmod, AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET);
  1204. CLKCTRL(am33xx_gpio1_hwmod, AM33XX_CM_PER_GPIO1_CLKCTRL_OFFSET);
  1205. CLKCTRL(am33xx_gpio2_hwmod, AM33XX_CM_PER_GPIO2_CLKCTRL_OFFSET);
  1206. CLKCTRL(am33xx_gpio3_hwmod, AM33XX_CM_PER_GPIO3_CLKCTRL_OFFSET);
  1207. CLKCTRL(am33xx_i2c2_hwmod, AM33XX_CM_PER_I2C1_CLKCTRL_OFFSET);
  1208. CLKCTRL(am33xx_i2c3_hwmod, AM33XX_CM_PER_I2C2_CLKCTRL_OFFSET);
  1209. CLKCTRL(am33xx_mailbox_hwmod, AM33XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET);
  1210. CLKCTRL(am33xx_mcasp0_hwmod, AM33XX_CM_PER_MCASP0_CLKCTRL_OFFSET);
  1211. CLKCTRL(am33xx_mcasp1_hwmod, AM33XX_CM_PER_MCASP1_CLKCTRL_OFFSET);
  1212. CLKCTRL(am33xx_mmc0_hwmod, AM33XX_CM_PER_MMC0_CLKCTRL_OFFSET);
  1213. CLKCTRL(am33xx_mmc1_hwmod, AM33XX_CM_PER_MMC1_CLKCTRL_OFFSET);
  1214. CLKCTRL(am33xx_spi0_hwmod, AM33XX_CM_PER_SPI0_CLKCTRL_OFFSET);
  1215. CLKCTRL(am33xx_spi1_hwmod, AM33XX_CM_PER_SPI1_CLKCTRL_OFFSET);
  1216. CLKCTRL(am33xx_spinlock_hwmod, AM33XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET);
  1217. CLKCTRL(am33xx_timer2_hwmod, AM33XX_CM_PER_TIMER2_CLKCTRL_OFFSET);
  1218. CLKCTRL(am33xx_timer3_hwmod, AM33XX_CM_PER_TIMER3_CLKCTRL_OFFSET);
  1219. CLKCTRL(am33xx_timer4_hwmod, AM33XX_CM_PER_TIMER4_CLKCTRL_OFFSET);
  1220. CLKCTRL(am33xx_timer5_hwmod, AM33XX_CM_PER_TIMER5_CLKCTRL_OFFSET);
  1221. CLKCTRL(am33xx_timer6_hwmod, AM33XX_CM_PER_TIMER6_CLKCTRL_OFFSET);
  1222. CLKCTRL(am33xx_timer7_hwmod, AM33XX_CM_PER_TIMER7_CLKCTRL_OFFSET);
  1223. CLKCTRL(am33xx_smartreflex0_hwmod,
  1224. AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
  1225. CLKCTRL(am33xx_smartreflex1_hwmod,
  1226. AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
  1227. CLKCTRL(am33xx_uart1_hwmod, AM33XX_CM_WKUP_UART0_CLKCTRL_OFFSET);
  1228. CLKCTRL(am33xx_timer1_hwmod, AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET);
  1229. CLKCTRL(am33xx_i2c1_hwmod, AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET);
  1230. CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET);
  1231. CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
  1232. CLKCTRL(am33xx_mmc2_hwmod, AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET);
  1233. CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
  1234. CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);
  1235. CLKCTRL(am33xx_l4_wkup_hwmod, AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
  1236. CLKCTRL(am33xx_l3_main_hwmod, AM33XX_CM_PER_L3_CLKCTRL_OFFSET);
  1237. CLKCTRL(am33xx_tpcc_hwmod, AM33XX_CM_PER_TPCC_CLKCTRL_OFFSET);
  1238. CLKCTRL(am33xx_tptc0_hwmod, AM33XX_CM_PER_TPTC0_CLKCTRL_OFFSET);
  1239. CLKCTRL(am33xx_tptc1_hwmod, AM33XX_CM_PER_TPTC1_CLKCTRL_OFFSET);
  1240. CLKCTRL(am33xx_tptc2_hwmod, AM33XX_CM_PER_TPTC2_CLKCTRL_OFFSET);
  1241. CLKCTRL(am33xx_gfx_hwmod, AM33XX_CM_GFX_GFX_CLKCTRL_OFFSET);
  1242. CLKCTRL(am33xx_cpgmac0_hwmod, AM33XX_CM_PER_CPGMAC0_CLKCTRL_OFFSET);
  1243. CLKCTRL(am33xx_pruss_hwmod, AM33XX_CM_PER_PRUSS_CLKCTRL_OFFSET);
  1244. CLKCTRL(am33xx_mpu_hwmod , AM33XX_CM_MPU_MPU_CLKCTRL_OFFSET);
  1245. CLKCTRL(am33xx_l3_instr_hwmod , AM33XX_CM_PER_L3_INSTR_CLKCTRL_OFFSET);
  1246. CLKCTRL(am33xx_ocmcram_hwmod , AM33XX_CM_PER_OCMCRAM_CLKCTRL_OFFSET);
  1247. CLKCTRL(am33xx_sha0_hwmod , AM33XX_CM_PER_SHA0_CLKCTRL_OFFSET);
  1248. CLKCTRL(am33xx_aes0_hwmod , AM33XX_CM_PER_AES0_CLKCTRL_OFFSET);
  1249. }
  1250. static void omap_hwmod_am33xx_rst(void)
  1251. {
  1252. RSTCTRL(am33xx_pruss_hwmod, AM33XX_RM_PER_RSTCTRL_OFFSET);
  1253. RSTCTRL(am33xx_gfx_hwmod, AM33XX_RM_GFX_RSTCTRL_OFFSET);
  1254. RSTST(am33xx_gfx_hwmod, AM33XX_RM_GFX_RSTST_OFFSET);
  1255. }
  1256. void omap_hwmod_am33xx_reg(void)
  1257. {
  1258. omap_hwmod_am33xx_clkctrl();
  1259. omap_hwmod_am33xx_rst();
  1260. }