omap_hwmod_33xx_43xx_ipblock_data.c 35 KB

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