omap_hwmod_3xxx_data.c 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965
  1. /*
  2. * omap_hwmod_3xxx_data.c - hardware modules present on the OMAP3xxx chips
  3. *
  4. * Copyright (C) 2009-2011 Nokia Corporation
  5. * Copyright (C) 2012 Texas Instruments, Inc.
  6. * Paul Walmsley
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. *
  12. * The data in this file should be completely autogeneratable from
  13. * the TI hardware database or other technical documentation.
  14. *
  15. * XXX these should be marked initdata for multi-OMAP kernels
  16. */
  17. #include <linux/platform_data/i2c-omap.h>
  18. #include <linux/power/smartreflex.h>
  19. #include <linux/platform_data/hsmmc-omap.h>
  20. #include <linux/omap-dma.h>
  21. #include "l3_3xxx.h"
  22. #include "l4_3xxx.h"
  23. #include "soc.h"
  24. #include "omap_hwmod.h"
  25. #include "omap_hwmod_common_data.h"
  26. #include "prm-regbits-34xx.h"
  27. #include "cm-regbits-34xx.h"
  28. #include "i2c.h"
  29. #include "wd_timer.h"
  30. #include "serial.h"
  31. /*
  32. * OMAP3xxx hardware module integration data
  33. *
  34. * All of the data in this section should be autogeneratable from the
  35. * TI hardware database or other technical documentation. Data that
  36. * is driver-specific or driver-kernel integration-specific belongs
  37. * elsewhere.
  38. */
  39. #define AM35XX_IPSS_USBOTGSS_BASE 0x5C040000
  40. /*
  41. * IP blocks
  42. */
  43. /* L3 */
  44. static struct omap_hwmod omap3xxx_l3_main_hwmod = {
  45. .name = "l3_main",
  46. .class = &l3_hwmod_class,
  47. .flags = HWMOD_NO_IDLEST,
  48. };
  49. /* L4 CORE */
  50. static struct omap_hwmod omap3xxx_l4_core_hwmod = {
  51. .name = "l4_core",
  52. .class = &l4_hwmod_class,
  53. .flags = HWMOD_NO_IDLEST,
  54. };
  55. /* L4 PER */
  56. static struct omap_hwmod omap3xxx_l4_per_hwmod = {
  57. .name = "l4_per",
  58. .class = &l4_hwmod_class,
  59. .flags = HWMOD_NO_IDLEST,
  60. };
  61. /* L4 WKUP */
  62. static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
  63. .name = "l4_wkup",
  64. .class = &l4_hwmod_class,
  65. .flags = HWMOD_NO_IDLEST,
  66. };
  67. /* L4 SEC */
  68. static struct omap_hwmod omap3xxx_l4_sec_hwmod = {
  69. .name = "l4_sec",
  70. .class = &l4_hwmod_class,
  71. .flags = HWMOD_NO_IDLEST,
  72. };
  73. /* MPU */
  74. static struct omap_hwmod omap3xxx_mpu_hwmod = {
  75. .name = "mpu",
  76. .class = &mpu_hwmod_class,
  77. .main_clk = "arm_fck",
  78. };
  79. /* IVA2 (IVA2) */
  80. static struct omap_hwmod_rst_info omap3xxx_iva_resets[] = {
  81. { .name = "logic", .rst_shift = 0, .st_shift = 8 },
  82. { .name = "seq0", .rst_shift = 1, .st_shift = 9 },
  83. { .name = "seq1", .rst_shift = 2, .st_shift = 10 },
  84. };
  85. static struct omap_hwmod omap3xxx_iva_hwmod = {
  86. .name = "iva",
  87. .class = &iva_hwmod_class,
  88. .clkdm_name = "iva2_clkdm",
  89. .rst_lines = omap3xxx_iva_resets,
  90. .rst_lines_cnt = ARRAY_SIZE(omap3xxx_iva_resets),
  91. .main_clk = "iva2_ck",
  92. .prcm = {
  93. .omap2 = {
  94. .module_offs = OMAP3430_IVA2_MOD,
  95. .idlest_reg_id = 1,
  96. .idlest_idle_bit = OMAP3430_ST_IVA2_SHIFT,
  97. },
  98. },
  99. };
  100. /*
  101. * 'debugss' class
  102. * debug and emulation sub system
  103. */
  104. static struct omap_hwmod_class omap3xxx_debugss_hwmod_class = {
  105. .name = "debugss",
  106. };
  107. /* debugss */
  108. static struct omap_hwmod omap3xxx_debugss_hwmod = {
  109. .name = "debugss",
  110. .class = &omap3xxx_debugss_hwmod_class,
  111. .clkdm_name = "emu_clkdm",
  112. .main_clk = "emu_src_ck",
  113. .flags = HWMOD_NO_IDLEST,
  114. };
  115. /* timer class */
  116. static struct omap_hwmod_class_sysconfig omap3xxx_timer_sysc = {
  117. .rev_offs = 0x0000,
  118. .sysc_offs = 0x0010,
  119. .syss_offs = 0x0014,
  120. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
  121. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  122. SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE |
  123. SYSS_HAS_RESET_STATUS),
  124. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  125. .sysc_fields = &omap_hwmod_sysc_type1,
  126. };
  127. static struct omap_hwmod_class omap3xxx_timer_hwmod_class = {
  128. .name = "timer",
  129. .sysc = &omap3xxx_timer_sysc,
  130. };
  131. /* timer1 */
  132. static struct omap_hwmod omap3xxx_timer1_hwmod = {
  133. .name = "timer1",
  134. .main_clk = "gpt1_fck",
  135. .prcm = {
  136. .omap2 = {
  137. .module_offs = WKUP_MOD,
  138. .idlest_reg_id = 1,
  139. .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT,
  140. },
  141. },
  142. .class = &omap3xxx_timer_hwmod_class,
  143. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  144. };
  145. /* timer2 */
  146. static struct omap_hwmod omap3xxx_timer2_hwmod = {
  147. .name = "timer2",
  148. .main_clk = "gpt2_fck",
  149. .prcm = {
  150. .omap2 = {
  151. .module_offs = OMAP3430_PER_MOD,
  152. .idlest_reg_id = 1,
  153. .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT,
  154. },
  155. },
  156. .class = &omap3xxx_timer_hwmod_class,
  157. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  158. };
  159. /* timer3 */
  160. static struct omap_hwmod omap3xxx_timer3_hwmod = {
  161. .name = "timer3",
  162. .main_clk = "gpt3_fck",
  163. .prcm = {
  164. .omap2 = {
  165. .module_offs = OMAP3430_PER_MOD,
  166. .idlest_reg_id = 1,
  167. .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT,
  168. },
  169. },
  170. .class = &omap3xxx_timer_hwmod_class,
  171. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  172. };
  173. /* timer4 */
  174. static struct omap_hwmod omap3xxx_timer4_hwmod = {
  175. .name = "timer4",
  176. .main_clk = "gpt4_fck",
  177. .prcm = {
  178. .omap2 = {
  179. .module_offs = OMAP3430_PER_MOD,
  180. .idlest_reg_id = 1,
  181. .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT,
  182. },
  183. },
  184. .class = &omap3xxx_timer_hwmod_class,
  185. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  186. };
  187. /* timer5 */
  188. static struct omap_hwmod omap3xxx_timer5_hwmod = {
  189. .name = "timer5",
  190. .main_clk = "gpt5_fck",
  191. .prcm = {
  192. .omap2 = {
  193. .module_offs = OMAP3430_PER_MOD,
  194. .idlest_reg_id = 1,
  195. .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT,
  196. },
  197. },
  198. .class = &omap3xxx_timer_hwmod_class,
  199. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  200. };
  201. /* timer6 */
  202. static struct omap_hwmod omap3xxx_timer6_hwmod = {
  203. .name = "timer6",
  204. .main_clk = "gpt6_fck",
  205. .prcm = {
  206. .omap2 = {
  207. .module_offs = OMAP3430_PER_MOD,
  208. .idlest_reg_id = 1,
  209. .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT,
  210. },
  211. },
  212. .class = &omap3xxx_timer_hwmod_class,
  213. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  214. };
  215. /* timer7 */
  216. static struct omap_hwmod omap3xxx_timer7_hwmod = {
  217. .name = "timer7",
  218. .main_clk = "gpt7_fck",
  219. .prcm = {
  220. .omap2 = {
  221. .module_offs = OMAP3430_PER_MOD,
  222. .idlest_reg_id = 1,
  223. .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT,
  224. },
  225. },
  226. .class = &omap3xxx_timer_hwmod_class,
  227. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  228. };
  229. /* timer8 */
  230. static struct omap_hwmod omap3xxx_timer8_hwmod = {
  231. .name = "timer8",
  232. .main_clk = "gpt8_fck",
  233. .prcm = {
  234. .omap2 = {
  235. .module_offs = OMAP3430_PER_MOD,
  236. .idlest_reg_id = 1,
  237. .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT,
  238. },
  239. },
  240. .class = &omap3xxx_timer_hwmod_class,
  241. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  242. };
  243. /* timer9 */
  244. static struct omap_hwmod omap3xxx_timer9_hwmod = {
  245. .name = "timer9",
  246. .main_clk = "gpt9_fck",
  247. .prcm = {
  248. .omap2 = {
  249. .module_offs = OMAP3430_PER_MOD,
  250. .idlest_reg_id = 1,
  251. .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT,
  252. },
  253. },
  254. .class = &omap3xxx_timer_hwmod_class,
  255. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  256. };
  257. /* timer10 */
  258. static struct omap_hwmod omap3xxx_timer10_hwmod = {
  259. .name = "timer10",
  260. .main_clk = "gpt10_fck",
  261. .prcm = {
  262. .omap2 = {
  263. .module_offs = CORE_MOD,
  264. .idlest_reg_id = 1,
  265. .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT,
  266. },
  267. },
  268. .class = &omap3xxx_timer_hwmod_class,
  269. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  270. };
  271. /* timer11 */
  272. static struct omap_hwmod omap3xxx_timer11_hwmod = {
  273. .name = "timer11",
  274. .main_clk = "gpt11_fck",
  275. .prcm = {
  276. .omap2 = {
  277. .module_offs = CORE_MOD,
  278. .idlest_reg_id = 1,
  279. .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT,
  280. },
  281. },
  282. .class = &omap3xxx_timer_hwmod_class,
  283. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  284. };
  285. /* timer12 */
  286. static struct omap_hwmod omap3xxx_timer12_hwmod = {
  287. .name = "timer12",
  288. .main_clk = "gpt12_fck",
  289. .prcm = {
  290. .omap2 = {
  291. .module_offs = WKUP_MOD,
  292. .idlest_reg_id = 1,
  293. .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT,
  294. },
  295. },
  296. .class = &omap3xxx_timer_hwmod_class,
  297. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  298. };
  299. /*
  300. * 'wd_timer' class
  301. * 32-bit watchdog upward counter that generates a pulse on the reset pin on
  302. * overflow condition
  303. */
  304. static struct omap_hwmod_class_sysconfig omap3xxx_wd_timer_sysc = {
  305. .rev_offs = 0x0000,
  306. .sysc_offs = 0x0010,
  307. .syss_offs = 0x0014,
  308. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_EMUFREE |
  309. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  310. SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
  311. SYSS_HAS_RESET_STATUS),
  312. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  313. .sysc_fields = &omap_hwmod_sysc_type1,
  314. };
  315. /* I2C common */
  316. static struct omap_hwmod_class_sysconfig i2c_sysc = {
  317. .rev_offs = 0x00,
  318. .sysc_offs = 0x20,
  319. .syss_offs = 0x10,
  320. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  321. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  322. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  323. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  324. .sysc_fields = &omap_hwmod_sysc_type1,
  325. };
  326. static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = {
  327. .name = "wd_timer",
  328. .sysc = &omap3xxx_wd_timer_sysc,
  329. .pre_shutdown = &omap2_wd_timer_disable,
  330. .reset = &omap2_wd_timer_reset,
  331. };
  332. static struct omap_hwmod omap3xxx_wd_timer2_hwmod = {
  333. .name = "wd_timer2",
  334. .class = &omap3xxx_wd_timer_hwmod_class,
  335. .main_clk = "wdt2_fck",
  336. .prcm = {
  337. .omap2 = {
  338. .module_offs = WKUP_MOD,
  339. .idlest_reg_id = 1,
  340. .idlest_idle_bit = OMAP3430_ST_WDT2_SHIFT,
  341. },
  342. },
  343. /*
  344. * XXX: Use software supervised mode, HW supervised smartidle seems to
  345. * block CORE power domain idle transitions. Maybe a HW bug in wdt2?
  346. */
  347. .flags = HWMOD_SWSUP_SIDLE,
  348. };
  349. /* UART1 */
  350. static struct omap_hwmod omap3xxx_uart1_hwmod = {
  351. .name = "uart1",
  352. .main_clk = "uart1_fck",
  353. .flags = DEBUG_TI81XXUART1_FLAGS | HWMOD_SWSUP_SIDLE,
  354. .prcm = {
  355. .omap2 = {
  356. .module_offs = CORE_MOD,
  357. .idlest_reg_id = 1,
  358. .idlest_idle_bit = OMAP3430_EN_UART1_SHIFT,
  359. },
  360. },
  361. .class = &omap2_uart_class,
  362. };
  363. /* UART2 */
  364. static struct omap_hwmod omap3xxx_uart2_hwmod = {
  365. .name = "uart2",
  366. .main_clk = "uart2_fck",
  367. .flags = DEBUG_TI81XXUART2_FLAGS | HWMOD_SWSUP_SIDLE,
  368. .prcm = {
  369. .omap2 = {
  370. .module_offs = CORE_MOD,
  371. .idlest_reg_id = 1,
  372. .idlest_idle_bit = OMAP3430_EN_UART2_SHIFT,
  373. },
  374. },
  375. .class = &omap2_uart_class,
  376. };
  377. /* UART3 */
  378. static struct omap_hwmod omap3xxx_uart3_hwmod = {
  379. .name = "uart3",
  380. .main_clk = "uart3_fck",
  381. .flags = DEBUG_OMAP3UART3_FLAGS | DEBUG_TI81XXUART3_FLAGS |
  382. HWMOD_SWSUP_SIDLE,
  383. .prcm = {
  384. .omap2 = {
  385. .module_offs = OMAP3430_PER_MOD,
  386. .idlest_reg_id = 1,
  387. .idlest_idle_bit = OMAP3430_EN_UART3_SHIFT,
  388. },
  389. },
  390. .class = &omap2_uart_class,
  391. };
  392. /* UART4 */
  393. static struct omap_hwmod omap36xx_uart4_hwmod = {
  394. .name = "uart4",
  395. .main_clk = "uart4_fck",
  396. .flags = DEBUG_OMAP3UART4_FLAGS | HWMOD_SWSUP_SIDLE,
  397. .prcm = {
  398. .omap2 = {
  399. .module_offs = OMAP3430_PER_MOD,
  400. .idlest_reg_id = 1,
  401. .idlest_idle_bit = OMAP3630_EN_UART4_SHIFT,
  402. },
  403. },
  404. .class = &omap2_uart_class,
  405. };
  406. /*
  407. * XXX AM35xx UART4 cannot complete its softreset without uart1_fck or
  408. * uart2_fck being enabled. So we add uart1_fck as an optional clock,
  409. * below, and set the HWMOD_CONTROL_OPT_CLKS_IN_RESET. This really
  410. * should not be needed. The functional clock structure of the AM35xx
  411. * UART4 is extremely unclear and opaque; it is unclear what the role
  412. * of uart1/2_fck is for the UART4. Any clarification from either
  413. * empirical testing or the AM3505/3517 hardware designers would be
  414. * most welcome.
  415. */
  416. static struct omap_hwmod_opt_clk am35xx_uart4_opt_clks[] = {
  417. { .role = "softreset_uart1_fck", .clk = "uart1_fck" },
  418. };
  419. static struct omap_hwmod am35xx_uart4_hwmod = {
  420. .name = "uart4",
  421. .main_clk = "uart4_fck",
  422. .prcm = {
  423. .omap2 = {
  424. .module_offs = CORE_MOD,
  425. .idlest_reg_id = 1,
  426. .idlest_idle_bit = AM35XX_ST_UART4_SHIFT,
  427. },
  428. },
  429. .opt_clks = am35xx_uart4_opt_clks,
  430. .opt_clks_cnt = ARRAY_SIZE(am35xx_uart4_opt_clks),
  431. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  432. .class = &omap2_uart_class,
  433. };
  434. static struct omap_hwmod_class i2c_class = {
  435. .name = "i2c",
  436. .sysc = &i2c_sysc,
  437. .rev = OMAP_I2C_IP_VERSION_1,
  438. .reset = &omap_i2c_reset,
  439. };
  440. /* dss */
  441. static struct omap_hwmod_opt_clk dss_opt_clks[] = {
  442. /*
  443. * The DSS HW needs all DSS clocks enabled during reset. The dss_core
  444. * driver does not use these clocks.
  445. */
  446. { .role = "sys_clk", .clk = "dss2_alwon_fck" },
  447. { .role = "tv_clk", .clk = "dss_tv_fck" },
  448. /* required only on OMAP3430 */
  449. { .role = "tv_dac_clk", .clk = "dss_96m_fck" },
  450. };
  451. static struct omap_hwmod omap3430es1_dss_core_hwmod = {
  452. .name = "dss_core",
  453. .class = &omap2_dss_hwmod_class,
  454. .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
  455. .prcm = {
  456. .omap2 = {
  457. .module_offs = OMAP3430_DSS_MOD,
  458. .idlest_reg_id = 1,
  459. },
  460. },
  461. .opt_clks = dss_opt_clks,
  462. .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
  463. .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  464. };
  465. static struct omap_hwmod omap3xxx_dss_core_hwmod = {
  466. .name = "dss_core",
  467. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  468. .class = &omap2_dss_hwmod_class,
  469. .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
  470. .prcm = {
  471. .omap2 = {
  472. .module_offs = OMAP3430_DSS_MOD,
  473. .idlest_reg_id = 1,
  474. .idlest_idle_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT,
  475. },
  476. },
  477. .opt_clks = dss_opt_clks,
  478. .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
  479. };
  480. /*
  481. * 'dispc' class
  482. * display controller
  483. */
  484. static struct omap_hwmod_class_sysconfig omap3_dispc_sysc = {
  485. .rev_offs = 0x0000,
  486. .sysc_offs = 0x0010,
  487. .syss_offs = 0x0014,
  488. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
  489. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  490. SYSC_HAS_ENAWAKEUP),
  491. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  492. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  493. .sysc_fields = &omap_hwmod_sysc_type1,
  494. };
  495. static struct omap_hwmod_class omap3_dispc_hwmod_class = {
  496. .name = "dispc",
  497. .sysc = &omap3_dispc_sysc,
  498. };
  499. static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
  500. .name = "dss_dispc",
  501. .class = &omap3_dispc_hwmod_class,
  502. .main_clk = "dss1_alwon_fck",
  503. .prcm = {
  504. .omap2 = {
  505. .module_offs = OMAP3430_DSS_MOD,
  506. },
  507. },
  508. .flags = HWMOD_NO_IDLEST,
  509. .dev_attr = &omap2_3_dss_dispc_dev_attr,
  510. };
  511. /*
  512. * 'dsi' class
  513. * display serial interface controller
  514. */
  515. static struct omap_hwmod_class_sysconfig omap3xxx_dsi_sysc = {
  516. .rev_offs = 0x0000,
  517. .sysc_offs = 0x0010,
  518. .syss_offs = 0x0014,
  519. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
  520. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  521. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  522. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  523. .sysc_fields = &omap_hwmod_sysc_type1,
  524. };
  525. static struct omap_hwmod_class omap3xxx_dsi_hwmod_class = {
  526. .name = "dsi",
  527. .sysc = &omap3xxx_dsi_sysc,
  528. };
  529. /* dss_dsi1 */
  530. static struct omap_hwmod_opt_clk dss_dsi1_opt_clks[] = {
  531. { .role = "sys_clk", .clk = "dss2_alwon_fck" },
  532. };
  533. static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = {
  534. .name = "dss_dsi1",
  535. .class = &omap3xxx_dsi_hwmod_class,
  536. .main_clk = "dss1_alwon_fck",
  537. .prcm = {
  538. .omap2 = {
  539. .module_offs = OMAP3430_DSS_MOD,
  540. },
  541. },
  542. .opt_clks = dss_dsi1_opt_clks,
  543. .opt_clks_cnt = ARRAY_SIZE(dss_dsi1_opt_clks),
  544. .flags = HWMOD_NO_IDLEST,
  545. };
  546. static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
  547. { .role = "ick", .clk = "dss_ick" },
  548. };
  549. static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
  550. .name = "dss_rfbi",
  551. .class = &omap2_rfbi_hwmod_class,
  552. .main_clk = "dss1_alwon_fck",
  553. .prcm = {
  554. .omap2 = {
  555. .module_offs = OMAP3430_DSS_MOD,
  556. },
  557. },
  558. .opt_clks = dss_rfbi_opt_clks,
  559. .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
  560. .flags = HWMOD_NO_IDLEST,
  561. };
  562. static struct omap_hwmod_opt_clk dss_venc_opt_clks[] = {
  563. /* required only on OMAP3430 */
  564. { .role = "tv_dac_clk", .clk = "dss_96m_fck" },
  565. };
  566. static struct omap_hwmod omap3xxx_dss_venc_hwmod = {
  567. .name = "dss_venc",
  568. .class = &omap2_venc_hwmod_class,
  569. .main_clk = "dss_tv_fck",
  570. .prcm = {
  571. .omap2 = {
  572. .module_offs = OMAP3430_DSS_MOD,
  573. },
  574. },
  575. .opt_clks = dss_venc_opt_clks,
  576. .opt_clks_cnt = ARRAY_SIZE(dss_venc_opt_clks),
  577. .flags = HWMOD_NO_IDLEST,
  578. };
  579. /* I2C1 */
  580. static struct omap_hwmod omap3xxx_i2c1_hwmod = {
  581. .name = "i2c1",
  582. .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
  583. .main_clk = "i2c1_fck",
  584. .prcm = {
  585. .omap2 = {
  586. .module_offs = CORE_MOD,
  587. .idlest_reg_id = 1,
  588. .idlest_idle_bit = OMAP3430_ST_I2C1_SHIFT,
  589. },
  590. },
  591. .class = &i2c_class,
  592. };
  593. /* I2C2 */
  594. static struct omap_hwmod omap3xxx_i2c2_hwmod = {
  595. .name = "i2c2",
  596. .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
  597. .main_clk = "i2c2_fck",
  598. .prcm = {
  599. .omap2 = {
  600. .module_offs = CORE_MOD,
  601. .idlest_reg_id = 1,
  602. .idlest_idle_bit = OMAP3430_ST_I2C2_SHIFT,
  603. },
  604. },
  605. .class = &i2c_class,
  606. };
  607. /* I2C3 */
  608. static struct omap_hwmod omap3xxx_i2c3_hwmod = {
  609. .name = "i2c3",
  610. .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
  611. .main_clk = "i2c3_fck",
  612. .prcm = {
  613. .omap2 = {
  614. .module_offs = CORE_MOD,
  615. .idlest_reg_id = 1,
  616. .idlest_idle_bit = OMAP3430_ST_I2C3_SHIFT,
  617. },
  618. },
  619. .class = &i2c_class,
  620. };
  621. /*
  622. * 'gpio' class
  623. * general purpose io module
  624. */
  625. static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
  626. .rev_offs = 0x0000,
  627. .sysc_offs = 0x0010,
  628. .syss_offs = 0x0014,
  629. .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
  630. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  631. SYSS_HAS_RESET_STATUS),
  632. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  633. .sysc_fields = &omap_hwmod_sysc_type1,
  634. };
  635. static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
  636. .name = "gpio",
  637. .sysc = &omap3xxx_gpio_sysc,
  638. .rev = 1,
  639. };
  640. /* gpio1 */
  641. static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
  642. { .role = "dbclk", .clk = "gpio1_dbck", },
  643. };
  644. static struct omap_hwmod omap3xxx_gpio1_hwmod = {
  645. .name = "gpio1",
  646. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  647. .main_clk = "gpio1_ick",
  648. .opt_clks = gpio1_opt_clks,
  649. .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
  650. .prcm = {
  651. .omap2 = {
  652. .module_offs = WKUP_MOD,
  653. .idlest_reg_id = 1,
  654. .idlest_idle_bit = OMAP3430_ST_GPIO1_SHIFT,
  655. },
  656. },
  657. .class = &omap3xxx_gpio_hwmod_class,
  658. };
  659. /* gpio2 */
  660. static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
  661. { .role = "dbclk", .clk = "gpio2_dbck", },
  662. };
  663. static struct omap_hwmod omap3xxx_gpio2_hwmod = {
  664. .name = "gpio2",
  665. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  666. .main_clk = "gpio2_ick",
  667. .opt_clks = gpio2_opt_clks,
  668. .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
  669. .prcm = {
  670. .omap2 = {
  671. .module_offs = OMAP3430_PER_MOD,
  672. .idlest_reg_id = 1,
  673. .idlest_idle_bit = OMAP3430_ST_GPIO2_SHIFT,
  674. },
  675. },
  676. .class = &omap3xxx_gpio_hwmod_class,
  677. };
  678. /* gpio3 */
  679. static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
  680. { .role = "dbclk", .clk = "gpio3_dbck", },
  681. };
  682. static struct omap_hwmod omap3xxx_gpio3_hwmod = {
  683. .name = "gpio3",
  684. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  685. .main_clk = "gpio3_ick",
  686. .opt_clks = gpio3_opt_clks,
  687. .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
  688. .prcm = {
  689. .omap2 = {
  690. .module_offs = OMAP3430_PER_MOD,
  691. .idlest_reg_id = 1,
  692. .idlest_idle_bit = OMAP3430_ST_GPIO3_SHIFT,
  693. },
  694. },
  695. .class = &omap3xxx_gpio_hwmod_class,
  696. };
  697. /* gpio4 */
  698. static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
  699. { .role = "dbclk", .clk = "gpio4_dbck", },
  700. };
  701. static struct omap_hwmod omap3xxx_gpio4_hwmod = {
  702. .name = "gpio4",
  703. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  704. .main_clk = "gpio4_ick",
  705. .opt_clks = gpio4_opt_clks,
  706. .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
  707. .prcm = {
  708. .omap2 = {
  709. .module_offs = OMAP3430_PER_MOD,
  710. .idlest_reg_id = 1,
  711. .idlest_idle_bit = OMAP3430_ST_GPIO4_SHIFT,
  712. },
  713. },
  714. .class = &omap3xxx_gpio_hwmod_class,
  715. };
  716. /* gpio5 */
  717. static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
  718. { .role = "dbclk", .clk = "gpio5_dbck", },
  719. };
  720. static struct omap_hwmod omap3xxx_gpio5_hwmod = {
  721. .name = "gpio5",
  722. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  723. .main_clk = "gpio5_ick",
  724. .opt_clks = gpio5_opt_clks,
  725. .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
  726. .prcm = {
  727. .omap2 = {
  728. .module_offs = OMAP3430_PER_MOD,
  729. .idlest_reg_id = 1,
  730. .idlest_idle_bit = OMAP3430_ST_GPIO5_SHIFT,
  731. },
  732. },
  733. .class = &omap3xxx_gpio_hwmod_class,
  734. };
  735. /* gpio6 */
  736. static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
  737. { .role = "dbclk", .clk = "gpio6_dbck", },
  738. };
  739. static struct omap_hwmod omap3xxx_gpio6_hwmod = {
  740. .name = "gpio6",
  741. .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
  742. .main_clk = "gpio6_ick",
  743. .opt_clks = gpio6_opt_clks,
  744. .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
  745. .prcm = {
  746. .omap2 = {
  747. .module_offs = OMAP3430_PER_MOD,
  748. .idlest_reg_id = 1,
  749. .idlest_idle_bit = OMAP3430_ST_GPIO6_SHIFT,
  750. },
  751. },
  752. .class = &omap3xxx_gpio_hwmod_class,
  753. };
  754. /* dma attributes */
  755. static struct omap_dma_dev_attr dma_dev_attr = {
  756. .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
  757. IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
  758. .lch_count = 32,
  759. };
  760. static struct omap_hwmod_class_sysconfig omap3xxx_dma_sysc = {
  761. .rev_offs = 0x0000,
  762. .sysc_offs = 0x002c,
  763. .syss_offs = 0x0028,
  764. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
  765. SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
  766. SYSC_HAS_EMUFREE | SYSC_HAS_AUTOIDLE |
  767. SYSS_HAS_RESET_STATUS),
  768. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  769. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  770. .sysc_fields = &omap_hwmod_sysc_type1,
  771. };
  772. static struct omap_hwmod_class omap3xxx_dma_hwmod_class = {
  773. .name = "dma",
  774. .sysc = &omap3xxx_dma_sysc,
  775. };
  776. /* dma_system */
  777. static struct omap_hwmod omap3xxx_dma_system_hwmod = {
  778. .name = "dma",
  779. .class = &omap3xxx_dma_hwmod_class,
  780. .main_clk = "core_l3_ick",
  781. .prcm = {
  782. .omap2 = {
  783. .module_offs = CORE_MOD,
  784. .idlest_reg_id = 1,
  785. .idlest_idle_bit = OMAP3430_ST_SDMA_SHIFT,
  786. },
  787. },
  788. .dev_attr = &dma_dev_attr,
  789. .flags = HWMOD_NO_IDLEST,
  790. };
  791. /*
  792. * 'mcbsp' class
  793. * multi channel buffered serial port controller
  794. */
  795. static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sysc = {
  796. .sysc_offs = 0x008c,
  797. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP |
  798. SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
  799. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  800. .sysc_fields = &omap_hwmod_sysc_type1,
  801. };
  802. static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = {
  803. .name = "mcbsp",
  804. .sysc = &omap3xxx_mcbsp_sysc,
  805. };
  806. /* McBSP functional clock mapping */
  807. static struct omap_hwmod_opt_clk mcbsp15_opt_clks[] = {
  808. { .role = "pad_fck", .clk = "mcbsp_clks" },
  809. { .role = "prcm_fck", .clk = "core_96m_fck" },
  810. };
  811. static struct omap_hwmod_opt_clk mcbsp234_opt_clks[] = {
  812. { .role = "pad_fck", .clk = "mcbsp_clks" },
  813. { .role = "prcm_fck", .clk = "per_96m_fck" },
  814. };
  815. /* mcbsp1 */
  816. static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
  817. .name = "mcbsp1",
  818. .class = &omap3xxx_mcbsp_hwmod_class,
  819. .main_clk = "mcbsp1_fck",
  820. .prcm = {
  821. .omap2 = {
  822. .module_offs = CORE_MOD,
  823. .idlest_reg_id = 1,
  824. .idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT,
  825. },
  826. },
  827. .opt_clks = mcbsp15_opt_clks,
  828. .opt_clks_cnt = ARRAY_SIZE(mcbsp15_opt_clks),
  829. };
  830. /* mcbsp2 */
  831. static struct omap_hwmod omap3xxx_mcbsp2_hwmod = {
  832. .name = "mcbsp2",
  833. .class = &omap3xxx_mcbsp_hwmod_class,
  834. .main_clk = "mcbsp2_fck",
  835. .prcm = {
  836. .omap2 = {
  837. .module_offs = OMAP3430_PER_MOD,
  838. .idlest_reg_id = 1,
  839. .idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT,
  840. },
  841. },
  842. .opt_clks = mcbsp234_opt_clks,
  843. .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks),
  844. };
  845. /* mcbsp3 */
  846. static struct omap_hwmod omap3xxx_mcbsp3_hwmod = {
  847. .name = "mcbsp3",
  848. .class = &omap3xxx_mcbsp_hwmod_class,
  849. .main_clk = "mcbsp3_fck",
  850. .prcm = {
  851. .omap2 = {
  852. .module_offs = OMAP3430_PER_MOD,
  853. .idlest_reg_id = 1,
  854. .idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT,
  855. },
  856. },
  857. .opt_clks = mcbsp234_opt_clks,
  858. .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks),
  859. };
  860. /* mcbsp4 */
  861. static struct omap_hwmod omap3xxx_mcbsp4_hwmod = {
  862. .name = "mcbsp4",
  863. .class = &omap3xxx_mcbsp_hwmod_class,
  864. .main_clk = "mcbsp4_fck",
  865. .prcm = {
  866. .omap2 = {
  867. .module_offs = OMAP3430_PER_MOD,
  868. .idlest_reg_id = 1,
  869. .idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT,
  870. },
  871. },
  872. .opt_clks = mcbsp234_opt_clks,
  873. .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks),
  874. };
  875. /* mcbsp5 */
  876. static struct omap_hwmod omap3xxx_mcbsp5_hwmod = {
  877. .name = "mcbsp5",
  878. .class = &omap3xxx_mcbsp_hwmod_class,
  879. .main_clk = "mcbsp5_fck",
  880. .prcm = {
  881. .omap2 = {
  882. .module_offs = CORE_MOD,
  883. .idlest_reg_id = 1,
  884. .idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT,
  885. },
  886. },
  887. .opt_clks = mcbsp15_opt_clks,
  888. .opt_clks_cnt = ARRAY_SIZE(mcbsp15_opt_clks),
  889. };
  890. /* 'mcbsp sidetone' class */
  891. static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sidetone_sysc = {
  892. .sysc_offs = 0x0010,
  893. .sysc_flags = SYSC_HAS_AUTOIDLE,
  894. .sysc_fields = &omap_hwmod_sysc_type1,
  895. };
  896. static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = {
  897. .name = "mcbsp_sidetone",
  898. .sysc = &omap3xxx_mcbsp_sidetone_sysc,
  899. };
  900. /* mcbsp2_sidetone */
  901. static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = {
  902. .name = "mcbsp2_sidetone",
  903. .class = &omap3xxx_mcbsp_sidetone_hwmod_class,
  904. .main_clk = "mcbsp2_ick",
  905. .flags = HWMOD_NO_IDLEST,
  906. };
  907. /* mcbsp3_sidetone */
  908. static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = {
  909. .name = "mcbsp3_sidetone",
  910. .class = &omap3xxx_mcbsp_sidetone_hwmod_class,
  911. .main_clk = "mcbsp3_ick",
  912. .flags = HWMOD_NO_IDLEST,
  913. };
  914. /* SR common */
  915. static struct omap_hwmod_class_sysconfig omap34xx_sr_sysc = {
  916. .sysc_offs = 0x24,
  917. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_NO_CACHE),
  918. .sysc_fields = &omap34xx_sr_sysc_fields,
  919. };
  920. static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = {
  921. .name = "smartreflex",
  922. .sysc = &omap34xx_sr_sysc,
  923. .rev = 1,
  924. };
  925. static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
  926. .sysc_offs = 0x38,
  927. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  928. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
  929. SYSC_NO_CACHE),
  930. .sysc_fields = &omap36xx_sr_sysc_fields,
  931. };
  932. static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
  933. .name = "smartreflex",
  934. .sysc = &omap36xx_sr_sysc,
  935. .rev = 2,
  936. };
  937. /* SR1 */
  938. static struct omap_smartreflex_dev_attr sr1_dev_attr = {
  939. .sensor_voltdm_name = "mpu_iva",
  940. };
  941. static struct omap_hwmod omap34xx_sr1_hwmod = {
  942. .name = "smartreflex_mpu_iva",
  943. .class = &omap34xx_smartreflex_hwmod_class,
  944. .main_clk = "sr1_fck",
  945. .prcm = {
  946. .omap2 = {
  947. .module_offs = WKUP_MOD,
  948. .idlest_reg_id = 1,
  949. .idlest_idle_bit = OMAP3430_EN_SR1_SHIFT,
  950. },
  951. },
  952. .dev_attr = &sr1_dev_attr,
  953. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  954. };
  955. static struct omap_hwmod omap36xx_sr1_hwmod = {
  956. .name = "smartreflex_mpu_iva",
  957. .class = &omap36xx_smartreflex_hwmod_class,
  958. .main_clk = "sr1_fck",
  959. .prcm = {
  960. .omap2 = {
  961. .module_offs = WKUP_MOD,
  962. .idlest_reg_id = 1,
  963. .idlest_idle_bit = OMAP3430_EN_SR1_SHIFT,
  964. },
  965. },
  966. .dev_attr = &sr1_dev_attr,
  967. };
  968. /* SR2 */
  969. static struct omap_smartreflex_dev_attr sr2_dev_attr = {
  970. .sensor_voltdm_name = "core",
  971. };
  972. static struct omap_hwmod omap34xx_sr2_hwmod = {
  973. .name = "smartreflex_core",
  974. .class = &omap34xx_smartreflex_hwmod_class,
  975. .main_clk = "sr2_fck",
  976. .prcm = {
  977. .omap2 = {
  978. .module_offs = WKUP_MOD,
  979. .idlest_reg_id = 1,
  980. .idlest_idle_bit = OMAP3430_EN_SR2_SHIFT,
  981. },
  982. },
  983. .dev_attr = &sr2_dev_attr,
  984. .flags = HWMOD_SET_DEFAULT_CLOCKACT,
  985. };
  986. static struct omap_hwmod omap36xx_sr2_hwmod = {
  987. .name = "smartreflex_core",
  988. .class = &omap36xx_smartreflex_hwmod_class,
  989. .main_clk = "sr2_fck",
  990. .prcm = {
  991. .omap2 = {
  992. .module_offs = WKUP_MOD,
  993. .idlest_reg_id = 1,
  994. .idlest_idle_bit = OMAP3430_EN_SR2_SHIFT,
  995. },
  996. },
  997. .dev_attr = &sr2_dev_attr,
  998. };
  999. /*
  1000. * 'mailbox' class
  1001. * mailbox module allowing communication between the on-chip processors
  1002. * using a queued mailbox-interrupt mechanism.
  1003. */
  1004. static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = {
  1005. .rev_offs = 0x000,
  1006. .sysc_offs = 0x010,
  1007. .syss_offs = 0x014,
  1008. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1009. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  1010. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1011. .sysc_fields = &omap_hwmod_sysc_type1,
  1012. };
  1013. static struct omap_hwmod_class omap3xxx_mailbox_hwmod_class = {
  1014. .name = "mailbox",
  1015. .sysc = &omap3xxx_mailbox_sysc,
  1016. };
  1017. static struct omap_hwmod omap3xxx_mailbox_hwmod = {
  1018. .name = "mailbox",
  1019. .class = &omap3xxx_mailbox_hwmod_class,
  1020. .main_clk = "mailboxes_ick",
  1021. .prcm = {
  1022. .omap2 = {
  1023. .module_offs = CORE_MOD,
  1024. .idlest_reg_id = 1,
  1025. .idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT,
  1026. },
  1027. },
  1028. };
  1029. /*
  1030. * 'mcspi' class
  1031. * multichannel serial port interface (mcspi) / master/slave synchronous serial
  1032. * bus
  1033. */
  1034. static struct omap_hwmod_class_sysconfig omap34xx_mcspi_sysc = {
  1035. .rev_offs = 0x0000,
  1036. .sysc_offs = 0x0010,
  1037. .syss_offs = 0x0014,
  1038. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1039. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  1040. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  1041. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1042. .sysc_fields = &omap_hwmod_sysc_type1,
  1043. };
  1044. static struct omap_hwmod_class omap34xx_mcspi_class = {
  1045. .name = "mcspi",
  1046. .sysc = &omap34xx_mcspi_sysc,
  1047. };
  1048. /* mcspi1 */
  1049. static struct omap_hwmod omap34xx_mcspi1 = {
  1050. .name = "mcspi1",
  1051. .main_clk = "mcspi1_fck",
  1052. .prcm = {
  1053. .omap2 = {
  1054. .module_offs = CORE_MOD,
  1055. .idlest_reg_id = 1,
  1056. .idlest_idle_bit = OMAP3430_ST_MCSPI1_SHIFT,
  1057. },
  1058. },
  1059. .class = &omap34xx_mcspi_class,
  1060. };
  1061. /* mcspi2 */
  1062. static struct omap_hwmod omap34xx_mcspi2 = {
  1063. .name = "mcspi2",
  1064. .main_clk = "mcspi2_fck",
  1065. .prcm = {
  1066. .omap2 = {
  1067. .module_offs = CORE_MOD,
  1068. .idlest_reg_id = 1,
  1069. .idlest_idle_bit = OMAP3430_ST_MCSPI2_SHIFT,
  1070. },
  1071. },
  1072. .class = &omap34xx_mcspi_class,
  1073. };
  1074. /* mcspi3 */
  1075. static struct omap_hwmod omap34xx_mcspi3 = {
  1076. .name = "mcspi3",
  1077. .main_clk = "mcspi3_fck",
  1078. .prcm = {
  1079. .omap2 = {
  1080. .module_offs = CORE_MOD,
  1081. .idlest_reg_id = 1,
  1082. .idlest_idle_bit = OMAP3430_ST_MCSPI3_SHIFT,
  1083. },
  1084. },
  1085. .class = &omap34xx_mcspi_class,
  1086. };
  1087. /* mcspi4 */
  1088. static struct omap_hwmod omap34xx_mcspi4 = {
  1089. .name = "mcspi4",
  1090. .main_clk = "mcspi4_fck",
  1091. .prcm = {
  1092. .omap2 = {
  1093. .module_offs = CORE_MOD,
  1094. .idlest_reg_id = 1,
  1095. .idlest_idle_bit = OMAP3430_ST_MCSPI4_SHIFT,
  1096. },
  1097. },
  1098. .class = &omap34xx_mcspi_class,
  1099. };
  1100. /* usbhsotg */
  1101. static struct omap_hwmod_class_sysconfig omap3xxx_usbhsotg_sysc = {
  1102. .rev_offs = 0x0400,
  1103. .sysc_offs = 0x0404,
  1104. .syss_offs = 0x0408,
  1105. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
  1106. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  1107. SYSC_HAS_AUTOIDLE),
  1108. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  1109. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  1110. .sysc_fields = &omap_hwmod_sysc_type1,
  1111. };
  1112. static struct omap_hwmod_class usbotg_class = {
  1113. .name = "usbotg",
  1114. .sysc = &omap3xxx_usbhsotg_sysc,
  1115. };
  1116. /* usb_otg_hs */
  1117. static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
  1118. .name = "usb_otg_hs",
  1119. .main_clk = "hsotgusb_ick",
  1120. .prcm = {
  1121. .omap2 = {
  1122. .module_offs = CORE_MOD,
  1123. .idlest_reg_id = 1,
  1124. .idlest_idle_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT,
  1125. },
  1126. },
  1127. .class = &usbotg_class,
  1128. /*
  1129. * Erratum ID: i479 idle_req / idle_ack mechanism potentially
  1130. * broken when autoidle is enabled
  1131. * workaround is to disable the autoidle bit at module level.
  1132. *
  1133. * Enabling the device in any other MIDLEMODE setting but force-idle
  1134. * causes core_pwrdm not enter idle states at least on OMAP3630.
  1135. * Note that musb has OTG_FORCESTDBY register that controls MSTANDBY
  1136. * signal when MIDLEMODE is set to force-idle.
  1137. */
  1138. .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE |
  1139. HWMOD_FORCE_MSTANDBY | HWMOD_RECONFIG_IO_CHAIN,
  1140. };
  1141. /* usb_otg_hs */
  1142. static struct omap_hwmod_class am35xx_usbotg_class = {
  1143. .name = "am35xx_usbotg",
  1144. };
  1145. static struct omap_hwmod am35xx_usbhsotg_hwmod = {
  1146. .name = "am35x_otg_hs",
  1147. .main_clk = "hsotgusb_fck",
  1148. .class = &am35xx_usbotg_class,
  1149. .flags = HWMOD_NO_IDLEST,
  1150. };
  1151. /* MMC/SD/SDIO common */
  1152. static struct omap_hwmod_class_sysconfig omap34xx_mmc_sysc = {
  1153. .rev_offs = 0x1fc,
  1154. .sysc_offs = 0x10,
  1155. .syss_offs = 0x14,
  1156. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1157. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  1158. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  1159. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1160. .sysc_fields = &omap_hwmod_sysc_type1,
  1161. };
  1162. static struct omap_hwmod_class omap34xx_mmc_class = {
  1163. .name = "mmc",
  1164. .sysc = &omap34xx_mmc_sysc,
  1165. };
  1166. /* MMC/SD/SDIO1 */
  1167. static struct omap_hwmod_opt_clk omap34xx_mmc1_opt_clks[] = {
  1168. { .role = "dbck", .clk = "omap_32k_fck", },
  1169. };
  1170. static struct omap_hsmmc_dev_attr mmc1_dev_attr = {
  1171. .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
  1172. };
  1173. /* See 35xx errata 2.1.1.128 in SPRZ278F */
  1174. static struct omap_hsmmc_dev_attr mmc1_pre_es3_dev_attr = {
  1175. .flags = (OMAP_HSMMC_SUPPORTS_DUAL_VOLT |
  1176. OMAP_HSMMC_BROKEN_MULTIBLOCK_READ),
  1177. };
  1178. static struct omap_hwmod omap3xxx_pre_es3_mmc1_hwmod = {
  1179. .name = "mmc1",
  1180. .opt_clks = omap34xx_mmc1_opt_clks,
  1181. .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks),
  1182. .main_clk = "mmchs1_fck",
  1183. .prcm = {
  1184. .omap2 = {
  1185. .module_offs = CORE_MOD,
  1186. .idlest_reg_id = 1,
  1187. .idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT,
  1188. },
  1189. },
  1190. .dev_attr = &mmc1_pre_es3_dev_attr,
  1191. .class = &omap34xx_mmc_class,
  1192. };
  1193. static struct omap_hwmod omap3xxx_es3plus_mmc1_hwmod = {
  1194. .name = "mmc1",
  1195. .opt_clks = omap34xx_mmc1_opt_clks,
  1196. .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc1_opt_clks),
  1197. .main_clk = "mmchs1_fck",
  1198. .prcm = {
  1199. .omap2 = {
  1200. .module_offs = CORE_MOD,
  1201. .idlest_reg_id = 1,
  1202. .idlest_idle_bit = OMAP3430_ST_MMC1_SHIFT,
  1203. },
  1204. },
  1205. .dev_attr = &mmc1_dev_attr,
  1206. .class = &omap34xx_mmc_class,
  1207. };
  1208. /* MMC/SD/SDIO2 */
  1209. static struct omap_hwmod_opt_clk omap34xx_mmc2_opt_clks[] = {
  1210. { .role = "dbck", .clk = "omap_32k_fck", },
  1211. };
  1212. /* See 35xx errata 2.1.1.128 in SPRZ278F */
  1213. static struct omap_hsmmc_dev_attr mmc2_pre_es3_dev_attr = {
  1214. .flags = OMAP_HSMMC_BROKEN_MULTIBLOCK_READ,
  1215. };
  1216. static struct omap_hwmod omap3xxx_pre_es3_mmc2_hwmod = {
  1217. .name = "mmc2",
  1218. .opt_clks = omap34xx_mmc2_opt_clks,
  1219. .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks),
  1220. .main_clk = "mmchs2_fck",
  1221. .prcm = {
  1222. .omap2 = {
  1223. .module_offs = CORE_MOD,
  1224. .idlest_reg_id = 1,
  1225. .idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT,
  1226. },
  1227. },
  1228. .dev_attr = &mmc2_pre_es3_dev_attr,
  1229. .class = &omap34xx_mmc_class,
  1230. };
  1231. static struct omap_hwmod omap3xxx_es3plus_mmc2_hwmod = {
  1232. .name = "mmc2",
  1233. .opt_clks = omap34xx_mmc2_opt_clks,
  1234. .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc2_opt_clks),
  1235. .main_clk = "mmchs2_fck",
  1236. .prcm = {
  1237. .omap2 = {
  1238. .module_offs = CORE_MOD,
  1239. .idlest_reg_id = 1,
  1240. .idlest_idle_bit = OMAP3430_ST_MMC2_SHIFT,
  1241. },
  1242. },
  1243. .class = &omap34xx_mmc_class,
  1244. };
  1245. /* MMC/SD/SDIO3 */
  1246. static struct omap_hwmod_opt_clk omap34xx_mmc3_opt_clks[] = {
  1247. { .role = "dbck", .clk = "omap_32k_fck", },
  1248. };
  1249. static struct omap_hwmod omap3xxx_mmc3_hwmod = {
  1250. .name = "mmc3",
  1251. .opt_clks = omap34xx_mmc3_opt_clks,
  1252. .opt_clks_cnt = ARRAY_SIZE(omap34xx_mmc3_opt_clks),
  1253. .main_clk = "mmchs3_fck",
  1254. .prcm = {
  1255. .omap2 = {
  1256. .module_offs = CORE_MOD,
  1257. .idlest_reg_id = 1,
  1258. .idlest_idle_bit = OMAP3430_ST_MMC3_SHIFT,
  1259. },
  1260. },
  1261. .class = &omap34xx_mmc_class,
  1262. };
  1263. /*
  1264. * 'usb_host_hs' class
  1265. * high-speed multi-port usb host controller
  1266. */
  1267. static struct omap_hwmod_class_sysconfig omap3xxx_usb_host_hs_sysc = {
  1268. .rev_offs = 0x0000,
  1269. .sysc_offs = 0x0010,
  1270. .syss_offs = 0x0014,
  1271. .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
  1272. SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
  1273. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
  1274. SYSS_HAS_RESET_STATUS),
  1275. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
  1276. MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
  1277. .sysc_fields = &omap_hwmod_sysc_type1,
  1278. };
  1279. static struct omap_hwmod_class omap3xxx_usb_host_hs_hwmod_class = {
  1280. .name = "usb_host_hs",
  1281. .sysc = &omap3xxx_usb_host_hs_sysc,
  1282. };
  1283. static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
  1284. .name = "usb_host_hs",
  1285. .class = &omap3xxx_usb_host_hs_hwmod_class,
  1286. .clkdm_name = "usbhost_clkdm",
  1287. .main_clk = "usbhost_48m_fck",
  1288. .prcm = {
  1289. .omap2 = {
  1290. .module_offs = OMAP3430ES2_USBHOST_MOD,
  1291. .idlest_reg_id = 1,
  1292. .idlest_idle_bit = OMAP3430ES2_ST_USBHOST_IDLE_SHIFT,
  1293. },
  1294. },
  1295. /*
  1296. * Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
  1297. * id: i660
  1298. *
  1299. * Description:
  1300. * In the following configuration :
  1301. * - USBHOST module is set to smart-idle mode
  1302. * - PRCM asserts idle_req to the USBHOST module ( This typically
  1303. * happens when the system is going to a low power mode : all ports
  1304. * have been suspended, the master part of the USBHOST module has
  1305. * entered the standby state, and SW has cut the functional clocks)
  1306. * - an USBHOST interrupt occurs before the module is able to answer
  1307. * idle_ack, typically a remote wakeup IRQ.
  1308. * Then the USB HOST module will enter a deadlock situation where it
  1309. * is no more accessible nor functional.
  1310. *
  1311. * Workaround:
  1312. * Don't use smart idle; use only force idle, hence HWMOD_SWSUP_SIDLE
  1313. */
  1314. /*
  1315. * Errata: USB host EHCI may stall when entering smart-standby mode
  1316. * Id: i571
  1317. *
  1318. * Description:
  1319. * When the USBHOST module is set to smart-standby mode, and when it is
  1320. * ready to enter the standby state (i.e. all ports are suspended and
  1321. * all attached devices are in suspend mode), then it can wrongly assert
  1322. * the Mstandby signal too early while there are still some residual OCP
  1323. * transactions ongoing. If this condition occurs, the internal state
  1324. * machine may go to an undefined state and the USB link may be stuck
  1325. * upon the next resume.
  1326. *
  1327. * Workaround:
  1328. * Don't use smart standby; use only force standby,
  1329. * hence HWMOD_SWSUP_MSTANDBY
  1330. */
  1331. .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY,
  1332. };
  1333. /*
  1334. * 'usb_tll_hs' class
  1335. * usb_tll_hs module is the adapter on the usb_host_hs ports
  1336. */
  1337. static struct omap_hwmod_class_sysconfig omap3xxx_usb_tll_hs_sysc = {
  1338. .rev_offs = 0x0000,
  1339. .sysc_offs = 0x0010,
  1340. .syss_offs = 0x0014,
  1341. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1342. SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
  1343. SYSC_HAS_AUTOIDLE),
  1344. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1345. .sysc_fields = &omap_hwmod_sysc_type1,
  1346. };
  1347. static struct omap_hwmod_class omap3xxx_usb_tll_hs_hwmod_class = {
  1348. .name = "usb_tll_hs",
  1349. .sysc = &omap3xxx_usb_tll_hs_sysc,
  1350. };
  1351. static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = {
  1352. .name = "usb_tll_hs",
  1353. .class = &omap3xxx_usb_tll_hs_hwmod_class,
  1354. .clkdm_name = "core_l4_clkdm",
  1355. .main_clk = "usbtll_fck",
  1356. .prcm = {
  1357. .omap2 = {
  1358. .module_offs = CORE_MOD,
  1359. .idlest_reg_id = 3,
  1360. .idlest_idle_bit = OMAP3430ES2_ST_USBTLL_SHIFT,
  1361. },
  1362. },
  1363. };
  1364. static struct omap_hwmod omap3xxx_hdq1w_hwmod = {
  1365. .name = "hdq1w",
  1366. .main_clk = "hdq_fck",
  1367. .prcm = {
  1368. .omap2 = {
  1369. .module_offs = CORE_MOD,
  1370. .idlest_reg_id = 1,
  1371. .idlest_idle_bit = OMAP3430_ST_HDQ_SHIFT,
  1372. },
  1373. },
  1374. .class = &omap2_hdq1w_class,
  1375. };
  1376. /* SAD2D */
  1377. static struct omap_hwmod_rst_info omap3xxx_sad2d_resets[] = {
  1378. { .name = "rst_modem_pwron_sw", .rst_shift = 0 },
  1379. { .name = "rst_modem_sw", .rst_shift = 1 },
  1380. };
  1381. static struct omap_hwmod_class omap3xxx_sad2d_class = {
  1382. .name = "sad2d",
  1383. };
  1384. static struct omap_hwmod omap3xxx_sad2d_hwmod = {
  1385. .name = "sad2d",
  1386. .rst_lines = omap3xxx_sad2d_resets,
  1387. .rst_lines_cnt = ARRAY_SIZE(omap3xxx_sad2d_resets),
  1388. .main_clk = "sad2d_ick",
  1389. .prcm = {
  1390. .omap2 = {
  1391. .module_offs = CORE_MOD,
  1392. .idlest_reg_id = 1,
  1393. .idlest_idle_bit = OMAP3430_ST_SAD2D_SHIFT,
  1394. },
  1395. },
  1396. .class = &omap3xxx_sad2d_class,
  1397. };
  1398. /*
  1399. * '32K sync counter' class
  1400. * 32-bit ordinary counter, clocked by the falling edge of the 32 khz clock
  1401. */
  1402. static struct omap_hwmod_class_sysconfig omap3xxx_counter_sysc = {
  1403. .rev_offs = 0x0000,
  1404. .sysc_offs = 0x0004,
  1405. .sysc_flags = SYSC_HAS_SIDLEMODE,
  1406. .idlemodes = (SIDLE_FORCE | SIDLE_NO),
  1407. .sysc_fields = &omap_hwmod_sysc_type1,
  1408. };
  1409. static struct omap_hwmod_class omap3xxx_counter_hwmod_class = {
  1410. .name = "counter",
  1411. .sysc = &omap3xxx_counter_sysc,
  1412. };
  1413. static struct omap_hwmod omap3xxx_counter_32k_hwmod = {
  1414. .name = "counter_32k",
  1415. .class = &omap3xxx_counter_hwmod_class,
  1416. .clkdm_name = "wkup_clkdm",
  1417. .flags = HWMOD_SWSUP_SIDLE,
  1418. .main_clk = "wkup_32k_fck",
  1419. .prcm = {
  1420. .omap2 = {
  1421. .module_offs = WKUP_MOD,
  1422. .idlest_reg_id = 1,
  1423. .idlest_idle_bit = OMAP3430_ST_32KSYNC_SHIFT,
  1424. },
  1425. },
  1426. };
  1427. /*
  1428. * 'gpmc' class
  1429. * general purpose memory controller
  1430. */
  1431. static struct omap_hwmod_class_sysconfig omap3xxx_gpmc_sysc = {
  1432. .rev_offs = 0x0000,
  1433. .sysc_offs = 0x0010,
  1434. .syss_offs = 0x0014,
  1435. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
  1436. SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
  1437. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1438. .sysc_fields = &omap_hwmod_sysc_type1,
  1439. };
  1440. static struct omap_hwmod_class omap3xxx_gpmc_hwmod_class = {
  1441. .name = "gpmc",
  1442. .sysc = &omap3xxx_gpmc_sysc,
  1443. };
  1444. static struct omap_hwmod omap3xxx_gpmc_hwmod = {
  1445. .name = "gpmc",
  1446. .class = &omap3xxx_gpmc_hwmod_class,
  1447. .clkdm_name = "core_l3_clkdm",
  1448. .main_clk = "gpmc_fck",
  1449. /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
  1450. .flags = HWMOD_NO_IDLEST | DEBUG_OMAP_GPMC_HWMOD_FLAGS,
  1451. };
  1452. /*
  1453. * interfaces
  1454. */
  1455. /* L3 -> L4_CORE interface */
  1456. static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
  1457. .master = &omap3xxx_l3_main_hwmod,
  1458. .slave = &omap3xxx_l4_core_hwmod,
  1459. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1460. };
  1461. /* L3 -> L4_PER interface */
  1462. static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_per = {
  1463. .master = &omap3xxx_l3_main_hwmod,
  1464. .slave = &omap3xxx_l4_per_hwmod,
  1465. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1466. };
  1467. /* MPU -> L3 interface */
  1468. static struct omap_hwmod_ocp_if omap3xxx_mpu__l3_main = {
  1469. .master = &omap3xxx_mpu_hwmod,
  1470. .slave = &omap3xxx_l3_main_hwmod,
  1471. .user = OCP_USER_MPU,
  1472. };
  1473. /* l3 -> debugss */
  1474. static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_debugss = {
  1475. .master = &omap3xxx_l3_main_hwmod,
  1476. .slave = &omap3xxx_debugss_hwmod,
  1477. .user = OCP_USER_MPU,
  1478. };
  1479. /* DSS -> l3 */
  1480. static struct omap_hwmod_ocp_if omap3430es1_dss__l3 = {
  1481. .master = &omap3430es1_dss_core_hwmod,
  1482. .slave = &omap3xxx_l3_main_hwmod,
  1483. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1484. };
  1485. static struct omap_hwmod_ocp_if omap3xxx_dss__l3 = {
  1486. .master = &omap3xxx_dss_core_hwmod,
  1487. .slave = &omap3xxx_l3_main_hwmod,
  1488. .fw = {
  1489. .omap2 = {
  1490. .l3_perm_bit = OMAP3_L3_CORE_FW_INIT_ID_DSS,
  1491. .flags = OMAP_FIREWALL_L3,
  1492. },
  1493. },
  1494. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1495. };
  1496. /* l3_core -> usbhsotg interface */
  1497. static struct omap_hwmod_ocp_if omap3xxx_usbhsotg__l3 = {
  1498. .master = &omap3xxx_usbhsotg_hwmod,
  1499. .slave = &omap3xxx_l3_main_hwmod,
  1500. .clk = "core_l3_ick",
  1501. .user = OCP_USER_MPU,
  1502. };
  1503. /* l3_core -> am35xx_usbhsotg interface */
  1504. static struct omap_hwmod_ocp_if am35xx_usbhsotg__l3 = {
  1505. .master = &am35xx_usbhsotg_hwmod,
  1506. .slave = &omap3xxx_l3_main_hwmod,
  1507. .clk = "hsotgusb_ick",
  1508. .user = OCP_USER_MPU,
  1509. };
  1510. /* l3_core -> sad2d interface */
  1511. static struct omap_hwmod_ocp_if omap3xxx_sad2d__l3 = {
  1512. .master = &omap3xxx_sad2d_hwmod,
  1513. .slave = &omap3xxx_l3_main_hwmod,
  1514. .clk = "core_l3_ick",
  1515. .user = OCP_USER_MPU,
  1516. };
  1517. /* L4_CORE -> L4_WKUP interface */
  1518. static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = {
  1519. .master = &omap3xxx_l4_core_hwmod,
  1520. .slave = &omap3xxx_l4_wkup_hwmod,
  1521. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1522. };
  1523. /* L4 CORE -> MMC1 interface */
  1524. static struct omap_hwmod_ocp_if omap3xxx_l4_core__pre_es3_mmc1 = {
  1525. .master = &omap3xxx_l4_core_hwmod,
  1526. .slave = &omap3xxx_pre_es3_mmc1_hwmod,
  1527. .clk = "mmchs1_ick",
  1528. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1529. .flags = OMAP_FIREWALL_L4,
  1530. };
  1531. static struct omap_hwmod_ocp_if omap3xxx_l4_core__es3plus_mmc1 = {
  1532. .master = &omap3xxx_l4_core_hwmod,
  1533. .slave = &omap3xxx_es3plus_mmc1_hwmod,
  1534. .clk = "mmchs1_ick",
  1535. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1536. .flags = OMAP_FIREWALL_L4,
  1537. };
  1538. /* L4 CORE -> MMC2 interface */
  1539. static struct omap_hwmod_ocp_if omap3xxx_l4_core__pre_es3_mmc2 = {
  1540. .master = &omap3xxx_l4_core_hwmod,
  1541. .slave = &omap3xxx_pre_es3_mmc2_hwmod,
  1542. .clk = "mmchs2_ick",
  1543. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1544. .flags = OMAP_FIREWALL_L4,
  1545. };
  1546. static struct omap_hwmod_ocp_if omap3xxx_l4_core__es3plus_mmc2 = {
  1547. .master = &omap3xxx_l4_core_hwmod,
  1548. .slave = &omap3xxx_es3plus_mmc2_hwmod,
  1549. .clk = "mmchs2_ick",
  1550. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1551. .flags = OMAP_FIREWALL_L4,
  1552. };
  1553. /* L4 CORE -> MMC3 interface */
  1554. static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmc3 = {
  1555. .master = &omap3xxx_l4_core_hwmod,
  1556. .slave = &omap3xxx_mmc3_hwmod,
  1557. .clk = "mmchs3_ick",
  1558. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1559. .flags = OMAP_FIREWALL_L4,
  1560. };
  1561. /* L4 CORE -> UART1 interface */
  1562. static struct omap_hwmod_ocp_if omap3_l4_core__uart1 = {
  1563. .master = &omap3xxx_l4_core_hwmod,
  1564. .slave = &omap3xxx_uart1_hwmod,
  1565. .clk = "uart1_ick",
  1566. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1567. };
  1568. /* L4 CORE -> UART2 interface */
  1569. static struct omap_hwmod_ocp_if omap3_l4_core__uart2 = {
  1570. .master = &omap3xxx_l4_core_hwmod,
  1571. .slave = &omap3xxx_uart2_hwmod,
  1572. .clk = "uart2_ick",
  1573. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1574. };
  1575. /* L4 PER -> UART3 interface */
  1576. static struct omap_hwmod_ocp_if omap3_l4_per__uart3 = {
  1577. .master = &omap3xxx_l4_per_hwmod,
  1578. .slave = &omap3xxx_uart3_hwmod,
  1579. .clk = "uart3_ick",
  1580. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1581. };
  1582. /* L4 PER -> UART4 interface */
  1583. static struct omap_hwmod_ocp_if omap36xx_l4_per__uart4 = {
  1584. .master = &omap3xxx_l4_per_hwmod,
  1585. .slave = &omap36xx_uart4_hwmod,
  1586. .clk = "uart4_ick",
  1587. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1588. };
  1589. /* AM35xx: L4 CORE -> UART4 interface */
  1590. static struct omap_hwmod_ocp_if am35xx_l4_core__uart4 = {
  1591. .master = &omap3xxx_l4_core_hwmod,
  1592. .slave = &am35xx_uart4_hwmod,
  1593. .clk = "uart4_ick",
  1594. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1595. };
  1596. /* L4 CORE -> I2C1 interface */
  1597. static struct omap_hwmod_ocp_if omap3_l4_core__i2c1 = {
  1598. .master = &omap3xxx_l4_core_hwmod,
  1599. .slave = &omap3xxx_i2c1_hwmod,
  1600. .clk = "i2c1_ick",
  1601. .fw = {
  1602. .omap2 = {
  1603. .l4_fw_region = OMAP3_L4_CORE_FW_I2C1_REGION,
  1604. .l4_prot_group = 7,
  1605. .flags = OMAP_FIREWALL_L4,
  1606. },
  1607. },
  1608. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1609. };
  1610. /* L4 CORE -> I2C2 interface */
  1611. static struct omap_hwmod_ocp_if omap3_l4_core__i2c2 = {
  1612. .master = &omap3xxx_l4_core_hwmod,
  1613. .slave = &omap3xxx_i2c2_hwmod,
  1614. .clk = "i2c2_ick",
  1615. .fw = {
  1616. .omap2 = {
  1617. .l4_fw_region = OMAP3_L4_CORE_FW_I2C2_REGION,
  1618. .l4_prot_group = 7,
  1619. .flags = OMAP_FIREWALL_L4,
  1620. },
  1621. },
  1622. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1623. };
  1624. /* L4 CORE -> I2C3 interface */
  1625. static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = {
  1626. .master = &omap3xxx_l4_core_hwmod,
  1627. .slave = &omap3xxx_i2c3_hwmod,
  1628. .clk = "i2c3_ick",
  1629. .fw = {
  1630. .omap2 = {
  1631. .l4_fw_region = OMAP3_L4_CORE_FW_I2C3_REGION,
  1632. .l4_prot_group = 7,
  1633. .flags = OMAP_FIREWALL_L4,
  1634. },
  1635. },
  1636. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1637. };
  1638. /* L4 CORE -> SR1 interface */
  1639. static struct omap_hwmod_ocp_if omap34xx_l4_core__sr1 = {
  1640. .master = &omap3xxx_l4_core_hwmod,
  1641. .slave = &omap34xx_sr1_hwmod,
  1642. .clk = "sr_l4_ick",
  1643. .user = OCP_USER_MPU,
  1644. };
  1645. static struct omap_hwmod_ocp_if omap36xx_l4_core__sr1 = {
  1646. .master = &omap3xxx_l4_core_hwmod,
  1647. .slave = &omap36xx_sr1_hwmod,
  1648. .clk = "sr_l4_ick",
  1649. .user = OCP_USER_MPU,
  1650. };
  1651. /* L4 CORE -> SR2 interface */
  1652. static struct omap_hwmod_ocp_if omap34xx_l4_core__sr2 = {
  1653. .master = &omap3xxx_l4_core_hwmod,
  1654. .slave = &omap34xx_sr2_hwmod,
  1655. .clk = "sr_l4_ick",
  1656. .user = OCP_USER_MPU,
  1657. };
  1658. static struct omap_hwmod_ocp_if omap36xx_l4_core__sr2 = {
  1659. .master = &omap3xxx_l4_core_hwmod,
  1660. .slave = &omap36xx_sr2_hwmod,
  1661. .clk = "sr_l4_ick",
  1662. .user = OCP_USER_MPU,
  1663. };
  1664. /* l4_core -> usbhsotg */
  1665. static struct omap_hwmod_ocp_if omap3xxx_l4_core__usbhsotg = {
  1666. .master = &omap3xxx_l4_core_hwmod,
  1667. .slave = &omap3xxx_usbhsotg_hwmod,
  1668. .clk = "l4_ick",
  1669. .user = OCP_USER_MPU,
  1670. };
  1671. /* l4_core -> usbhsotg */
  1672. static struct omap_hwmod_ocp_if am35xx_l4_core__usbhsotg = {
  1673. .master = &omap3xxx_l4_core_hwmod,
  1674. .slave = &am35xx_usbhsotg_hwmod,
  1675. .clk = "hsotgusb_ick",
  1676. .user = OCP_USER_MPU,
  1677. };
  1678. /* L4_WKUP -> L4_SEC interface */
  1679. static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__l4_sec = {
  1680. .master = &omap3xxx_l4_wkup_hwmod,
  1681. .slave = &omap3xxx_l4_sec_hwmod,
  1682. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1683. };
  1684. /* IVA2 <- L3 interface */
  1685. static struct omap_hwmod_ocp_if omap3xxx_l3__iva = {
  1686. .master = &omap3xxx_l3_main_hwmod,
  1687. .slave = &omap3xxx_iva_hwmod,
  1688. .clk = "core_l3_ick",
  1689. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1690. };
  1691. /* l4_wkup -> timer1 */
  1692. static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__timer1 = {
  1693. .master = &omap3xxx_l4_wkup_hwmod,
  1694. .slave = &omap3xxx_timer1_hwmod,
  1695. .clk = "gpt1_ick",
  1696. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1697. };
  1698. /* l4_per -> timer2 */
  1699. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer2 = {
  1700. .master = &omap3xxx_l4_per_hwmod,
  1701. .slave = &omap3xxx_timer2_hwmod,
  1702. .clk = "gpt2_ick",
  1703. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1704. };
  1705. /* l4_per -> timer3 */
  1706. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer3 = {
  1707. .master = &omap3xxx_l4_per_hwmod,
  1708. .slave = &omap3xxx_timer3_hwmod,
  1709. .clk = "gpt3_ick",
  1710. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1711. };
  1712. /* l4_per -> timer4 */
  1713. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer4 = {
  1714. .master = &omap3xxx_l4_per_hwmod,
  1715. .slave = &omap3xxx_timer4_hwmod,
  1716. .clk = "gpt4_ick",
  1717. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1718. };
  1719. /* l4_per -> timer5 */
  1720. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer5 = {
  1721. .master = &omap3xxx_l4_per_hwmod,
  1722. .slave = &omap3xxx_timer5_hwmod,
  1723. .clk = "gpt5_ick",
  1724. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1725. };
  1726. /* l4_per -> timer6 */
  1727. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer6 = {
  1728. .master = &omap3xxx_l4_per_hwmod,
  1729. .slave = &omap3xxx_timer6_hwmod,
  1730. .clk = "gpt6_ick",
  1731. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1732. };
  1733. /* l4_per -> timer7 */
  1734. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer7 = {
  1735. .master = &omap3xxx_l4_per_hwmod,
  1736. .slave = &omap3xxx_timer7_hwmod,
  1737. .clk = "gpt7_ick",
  1738. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1739. };
  1740. /* l4_per -> timer8 */
  1741. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer8 = {
  1742. .master = &omap3xxx_l4_per_hwmod,
  1743. .slave = &omap3xxx_timer8_hwmod,
  1744. .clk = "gpt8_ick",
  1745. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1746. };
  1747. /* l4_per -> timer9 */
  1748. static struct omap_hwmod_ocp_if omap3xxx_l4_per__timer9 = {
  1749. .master = &omap3xxx_l4_per_hwmod,
  1750. .slave = &omap3xxx_timer9_hwmod,
  1751. .clk = "gpt9_ick",
  1752. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1753. };
  1754. /* l4_core -> timer10 */
  1755. static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer10 = {
  1756. .master = &omap3xxx_l4_core_hwmod,
  1757. .slave = &omap3xxx_timer10_hwmod,
  1758. .clk = "gpt10_ick",
  1759. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1760. };
  1761. /* l4_core -> timer11 */
  1762. static struct omap_hwmod_ocp_if omap3xxx_l4_core__timer11 = {
  1763. .master = &omap3xxx_l4_core_hwmod,
  1764. .slave = &omap3xxx_timer11_hwmod,
  1765. .clk = "gpt11_ick",
  1766. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1767. };
  1768. /* l4_core -> timer12 */
  1769. static struct omap_hwmod_ocp_if omap3xxx_l4_sec__timer12 = {
  1770. .master = &omap3xxx_l4_sec_hwmod,
  1771. .slave = &omap3xxx_timer12_hwmod,
  1772. .clk = "gpt12_ick",
  1773. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1774. };
  1775. /* l4_wkup -> wd_timer2 */
  1776. static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__wd_timer2 = {
  1777. .master = &omap3xxx_l4_wkup_hwmod,
  1778. .slave = &omap3xxx_wd_timer2_hwmod,
  1779. .clk = "wdt2_ick",
  1780. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1781. };
  1782. /* l4_core -> dss */
  1783. static struct omap_hwmod_ocp_if omap3430es1_l4_core__dss = {
  1784. .master = &omap3xxx_l4_core_hwmod,
  1785. .slave = &omap3430es1_dss_core_hwmod,
  1786. .clk = "dss_ick",
  1787. .fw = {
  1788. .omap2 = {
  1789. .l4_fw_region = OMAP3ES1_L4_CORE_FW_DSS_CORE_REGION,
  1790. .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
  1791. .flags = OMAP_FIREWALL_L4,
  1792. },
  1793. },
  1794. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1795. };
  1796. static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss = {
  1797. .master = &omap3xxx_l4_core_hwmod,
  1798. .slave = &omap3xxx_dss_core_hwmod,
  1799. .clk = "dss_ick",
  1800. .fw = {
  1801. .omap2 = {
  1802. .l4_fw_region = OMAP3_L4_CORE_FW_DSS_CORE_REGION,
  1803. .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
  1804. .flags = OMAP_FIREWALL_L4,
  1805. },
  1806. },
  1807. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1808. };
  1809. /* l4_core -> dss_dispc */
  1810. static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dispc = {
  1811. .master = &omap3xxx_l4_core_hwmod,
  1812. .slave = &omap3xxx_dss_dispc_hwmod,
  1813. .clk = "dss_ick",
  1814. .fw = {
  1815. .omap2 = {
  1816. .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DISPC_REGION,
  1817. .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
  1818. .flags = OMAP_FIREWALL_L4,
  1819. },
  1820. },
  1821. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1822. };
  1823. /* l4_core -> dss_dsi1 */
  1824. static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_dsi1 = {
  1825. .master = &omap3xxx_l4_core_hwmod,
  1826. .slave = &omap3xxx_dss_dsi1_hwmod,
  1827. .clk = "dss_ick",
  1828. .fw = {
  1829. .omap2 = {
  1830. .l4_fw_region = OMAP3_L4_CORE_FW_DSS_DSI_REGION,
  1831. .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
  1832. .flags = OMAP_FIREWALL_L4,
  1833. },
  1834. },
  1835. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1836. };
  1837. /* l4_core -> dss_rfbi */
  1838. static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_rfbi = {
  1839. .master = &omap3xxx_l4_core_hwmod,
  1840. .slave = &omap3xxx_dss_rfbi_hwmod,
  1841. .clk = "dss_ick",
  1842. .fw = {
  1843. .omap2 = {
  1844. .l4_fw_region = OMAP3_L4_CORE_FW_DSS_RFBI_REGION,
  1845. .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP ,
  1846. .flags = OMAP_FIREWALL_L4,
  1847. },
  1848. },
  1849. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1850. };
  1851. /* l4_core -> dss_venc */
  1852. static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = {
  1853. .master = &omap3xxx_l4_core_hwmod,
  1854. .slave = &omap3xxx_dss_venc_hwmod,
  1855. .clk = "dss_ick",
  1856. .fw = {
  1857. .omap2 = {
  1858. .l4_fw_region = OMAP3_L4_CORE_FW_DSS_VENC_REGION,
  1859. .l4_prot_group = OMAP3_L4_CORE_FW_DSS_PROT_GROUP,
  1860. .flags = OMAP_FIREWALL_L4,
  1861. },
  1862. },
  1863. .flags = OCPIF_SWSUP_IDLE,
  1864. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1865. };
  1866. /* l4_wkup -> gpio1 */
  1867. static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__gpio1 = {
  1868. .master = &omap3xxx_l4_wkup_hwmod,
  1869. .slave = &omap3xxx_gpio1_hwmod,
  1870. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1871. };
  1872. /* l4_per -> gpio2 */
  1873. static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio2 = {
  1874. .master = &omap3xxx_l4_per_hwmod,
  1875. .slave = &omap3xxx_gpio2_hwmod,
  1876. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1877. };
  1878. /* l4_per -> gpio3 */
  1879. static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio3 = {
  1880. .master = &omap3xxx_l4_per_hwmod,
  1881. .slave = &omap3xxx_gpio3_hwmod,
  1882. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1883. };
  1884. /*
  1885. * 'mmu' class
  1886. * The memory management unit performs virtual to physical address translation
  1887. * for its requestors.
  1888. */
  1889. static struct omap_hwmod_class_sysconfig mmu_sysc = {
  1890. .rev_offs = 0x000,
  1891. .sysc_offs = 0x010,
  1892. .syss_offs = 0x014,
  1893. .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
  1894. SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
  1895. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  1896. .sysc_fields = &omap_hwmod_sysc_type1,
  1897. };
  1898. static struct omap_hwmod_class omap3xxx_mmu_hwmod_class = {
  1899. .name = "mmu",
  1900. .sysc = &mmu_sysc,
  1901. };
  1902. /* mmu isp */
  1903. static struct omap_hwmod omap3xxx_mmu_isp_hwmod;
  1904. /* l4_core -> mmu isp */
  1905. static struct omap_hwmod_ocp_if omap3xxx_l4_core__mmu_isp = {
  1906. .master = &omap3xxx_l4_core_hwmod,
  1907. .slave = &omap3xxx_mmu_isp_hwmod,
  1908. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1909. };
  1910. static struct omap_hwmod omap3xxx_mmu_isp_hwmod = {
  1911. .name = "mmu_isp",
  1912. .class = &omap3xxx_mmu_hwmod_class,
  1913. .main_clk = "cam_ick",
  1914. .flags = HWMOD_NO_IDLEST,
  1915. };
  1916. /* mmu iva */
  1917. static struct omap_hwmod omap3xxx_mmu_iva_hwmod;
  1918. static struct omap_hwmod_rst_info omap3xxx_mmu_iva_resets[] = {
  1919. { .name = "mmu", .rst_shift = 1, .st_shift = 9 },
  1920. };
  1921. /* l3_main -> iva mmu */
  1922. static struct omap_hwmod_ocp_if omap3xxx_l3_main__mmu_iva = {
  1923. .master = &omap3xxx_l3_main_hwmod,
  1924. .slave = &omap3xxx_mmu_iva_hwmod,
  1925. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1926. };
  1927. static struct omap_hwmod omap3xxx_mmu_iva_hwmod = {
  1928. .name = "mmu_iva",
  1929. .class = &omap3xxx_mmu_hwmod_class,
  1930. .clkdm_name = "iva2_clkdm",
  1931. .rst_lines = omap3xxx_mmu_iva_resets,
  1932. .rst_lines_cnt = ARRAY_SIZE(omap3xxx_mmu_iva_resets),
  1933. .main_clk = "iva2_ck",
  1934. .prcm = {
  1935. .omap2 = {
  1936. .module_offs = OMAP3430_IVA2_MOD,
  1937. .idlest_reg_id = 1,
  1938. .idlest_idle_bit = OMAP3430_ST_IVA2_SHIFT,
  1939. },
  1940. },
  1941. .flags = HWMOD_NO_IDLEST,
  1942. };
  1943. /* l4_per -> gpio4 */
  1944. static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio4 = {
  1945. .master = &omap3xxx_l4_per_hwmod,
  1946. .slave = &omap3xxx_gpio4_hwmod,
  1947. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1948. };
  1949. /* l4_per -> gpio5 */
  1950. static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio5 = {
  1951. .master = &omap3xxx_l4_per_hwmod,
  1952. .slave = &omap3xxx_gpio5_hwmod,
  1953. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1954. };
  1955. /* l4_per -> gpio6 */
  1956. static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio6 = {
  1957. .master = &omap3xxx_l4_per_hwmod,
  1958. .slave = &omap3xxx_gpio6_hwmod,
  1959. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1960. };
  1961. /* dma_system -> L3 */
  1962. static struct omap_hwmod_ocp_if omap3xxx_dma_system__l3 = {
  1963. .master = &omap3xxx_dma_system_hwmod,
  1964. .slave = &omap3xxx_l3_main_hwmod,
  1965. .clk = "core_l3_ick",
  1966. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1967. };
  1968. /* l4_cfg -> dma_system */
  1969. static struct omap_hwmod_ocp_if omap3xxx_l4_core__dma_system = {
  1970. .master = &omap3xxx_l4_core_hwmod,
  1971. .slave = &omap3xxx_dma_system_hwmod,
  1972. .clk = "core_l4_ick",
  1973. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1974. };
  1975. /* l4_core -> mcbsp1 */
  1976. static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp1 = {
  1977. .master = &omap3xxx_l4_core_hwmod,
  1978. .slave = &omap3xxx_mcbsp1_hwmod,
  1979. .clk = "mcbsp1_ick",
  1980. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1981. };
  1982. /* l4_per -> mcbsp2 */
  1983. static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2 = {
  1984. .master = &omap3xxx_l4_per_hwmod,
  1985. .slave = &omap3xxx_mcbsp2_hwmod,
  1986. .clk = "mcbsp2_ick",
  1987. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1988. };
  1989. /* l4_per -> mcbsp3 */
  1990. static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3 = {
  1991. .master = &omap3xxx_l4_per_hwmod,
  1992. .slave = &omap3xxx_mcbsp3_hwmod,
  1993. .clk = "mcbsp3_ick",
  1994. .user = OCP_USER_MPU | OCP_USER_SDMA,
  1995. };
  1996. /* l4_per -> mcbsp4 */
  1997. static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp4 = {
  1998. .master = &omap3xxx_l4_per_hwmod,
  1999. .slave = &omap3xxx_mcbsp4_hwmod,
  2000. .clk = "mcbsp4_ick",
  2001. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2002. };
  2003. /* l4_core -> mcbsp5 */
  2004. static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp5 = {
  2005. .master = &omap3xxx_l4_core_hwmod,
  2006. .slave = &omap3xxx_mcbsp5_hwmod,
  2007. .clk = "mcbsp5_ick",
  2008. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2009. };
  2010. /* l4_per -> mcbsp2_sidetone */
  2011. static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2_sidetone = {
  2012. .master = &omap3xxx_l4_per_hwmod,
  2013. .slave = &omap3xxx_mcbsp2_sidetone_hwmod,
  2014. .clk = "mcbsp2_ick",
  2015. .user = OCP_USER_MPU,
  2016. };
  2017. /* l4_per -> mcbsp3_sidetone */
  2018. static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = {
  2019. .master = &omap3xxx_l4_per_hwmod,
  2020. .slave = &omap3xxx_mcbsp3_sidetone_hwmod,
  2021. .clk = "mcbsp3_ick",
  2022. .user = OCP_USER_MPU,
  2023. };
  2024. /* l4_core -> mailbox */
  2025. static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = {
  2026. .master = &omap3xxx_l4_core_hwmod,
  2027. .slave = &omap3xxx_mailbox_hwmod,
  2028. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2029. };
  2030. /* l4 core -> mcspi1 interface */
  2031. static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi1 = {
  2032. .master = &omap3xxx_l4_core_hwmod,
  2033. .slave = &omap34xx_mcspi1,
  2034. .clk = "mcspi1_ick",
  2035. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2036. };
  2037. /* l4 core -> mcspi2 interface */
  2038. static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi2 = {
  2039. .master = &omap3xxx_l4_core_hwmod,
  2040. .slave = &omap34xx_mcspi2,
  2041. .clk = "mcspi2_ick",
  2042. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2043. };
  2044. /* l4 core -> mcspi3 interface */
  2045. static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi3 = {
  2046. .master = &omap3xxx_l4_core_hwmod,
  2047. .slave = &omap34xx_mcspi3,
  2048. .clk = "mcspi3_ick",
  2049. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2050. };
  2051. /* l4 core -> mcspi4 interface */
  2052. static struct omap_hwmod_ocp_if omap34xx_l4_core__mcspi4 = {
  2053. .master = &omap3xxx_l4_core_hwmod,
  2054. .slave = &omap34xx_mcspi4,
  2055. .clk = "mcspi4_ick",
  2056. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2057. };
  2058. static struct omap_hwmod_ocp_if omap3xxx_usb_host_hs__l3_main_2 = {
  2059. .master = &omap3xxx_usb_host_hs_hwmod,
  2060. .slave = &omap3xxx_l3_main_hwmod,
  2061. .clk = "core_l3_ick",
  2062. .user = OCP_USER_MPU,
  2063. };
  2064. static struct omap_hwmod_ocp_if omap3xxx_l4_core__usb_host_hs = {
  2065. .master = &omap3xxx_l4_core_hwmod,
  2066. .slave = &omap3xxx_usb_host_hs_hwmod,
  2067. .clk = "usbhost_ick",
  2068. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2069. };
  2070. static struct omap_hwmod_ocp_if omap3xxx_l4_core__usb_tll_hs = {
  2071. .master = &omap3xxx_l4_core_hwmod,
  2072. .slave = &omap3xxx_usb_tll_hs_hwmod,
  2073. .clk = "usbtll_ick",
  2074. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2075. };
  2076. /* l4_core -> hdq1w interface */
  2077. static struct omap_hwmod_ocp_if omap3xxx_l4_core__hdq1w = {
  2078. .master = &omap3xxx_l4_core_hwmod,
  2079. .slave = &omap3xxx_hdq1w_hwmod,
  2080. .clk = "hdq_ick",
  2081. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2082. .flags = OMAP_FIREWALL_L4 | OCPIF_SWSUP_IDLE,
  2083. };
  2084. /* l4_wkup -> 32ksync_counter */
  2085. static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__counter_32k = {
  2086. .master = &omap3xxx_l4_wkup_hwmod,
  2087. .slave = &omap3xxx_counter_32k_hwmod,
  2088. .clk = "omap_32ksync_ick",
  2089. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2090. };
  2091. /* am35xx has Davinci MDIO & EMAC */
  2092. static struct omap_hwmod_class am35xx_mdio_class = {
  2093. .name = "davinci_mdio",
  2094. };
  2095. static struct omap_hwmod am35xx_mdio_hwmod = {
  2096. .name = "davinci_mdio",
  2097. .class = &am35xx_mdio_class,
  2098. .flags = HWMOD_NO_IDLEST,
  2099. };
  2100. /*
  2101. * XXX Should be connected to an IPSS hwmod, not the L3 directly;
  2102. * but this will probably require some additional hwmod core support,
  2103. * so is left as a future to-do item.
  2104. */
  2105. static struct omap_hwmod_ocp_if am35xx_mdio__l3 = {
  2106. .master = &am35xx_mdio_hwmod,
  2107. .slave = &omap3xxx_l3_main_hwmod,
  2108. .clk = "emac_fck",
  2109. .user = OCP_USER_MPU,
  2110. };
  2111. /* l4_core -> davinci mdio */
  2112. /*
  2113. * XXX Should be connected to an IPSS hwmod, not the L4_CORE directly;
  2114. * but this will probably require some additional hwmod core support,
  2115. * so is left as a future to-do item.
  2116. */
  2117. static struct omap_hwmod_ocp_if am35xx_l4_core__mdio = {
  2118. .master = &omap3xxx_l4_core_hwmod,
  2119. .slave = &am35xx_mdio_hwmod,
  2120. .clk = "emac_fck",
  2121. .user = OCP_USER_MPU,
  2122. };
  2123. static struct omap_hwmod_class am35xx_emac_class = {
  2124. .name = "davinci_emac",
  2125. };
  2126. static struct omap_hwmod am35xx_emac_hwmod = {
  2127. .name = "davinci_emac",
  2128. .class = &am35xx_emac_class,
  2129. /*
  2130. * According to Mark Greer, the MPU will not return from WFI
  2131. * when the EMAC signals an interrupt.
  2132. * http://www.spinics.net/lists/arm-kernel/msg174734.html
  2133. */
  2134. .flags = (HWMOD_NO_IDLEST | HWMOD_BLOCK_WFI),
  2135. };
  2136. /* l3_core -> davinci emac interface */
  2137. /*
  2138. * XXX Should be connected to an IPSS hwmod, not the L3 directly;
  2139. * but this will probably require some additional hwmod core support,
  2140. * so is left as a future to-do item.
  2141. */
  2142. static struct omap_hwmod_ocp_if am35xx_emac__l3 = {
  2143. .master = &am35xx_emac_hwmod,
  2144. .slave = &omap3xxx_l3_main_hwmod,
  2145. .clk = "emac_ick",
  2146. .user = OCP_USER_MPU,
  2147. };
  2148. /* l4_core -> davinci emac */
  2149. /*
  2150. * XXX Should be connected to an IPSS hwmod, not the L4_CORE directly;
  2151. * but this will probably require some additional hwmod core support,
  2152. * so is left as a future to-do item.
  2153. */
  2154. static struct omap_hwmod_ocp_if am35xx_l4_core__emac = {
  2155. .master = &omap3xxx_l4_core_hwmod,
  2156. .slave = &am35xx_emac_hwmod,
  2157. .clk = "emac_ick",
  2158. .user = OCP_USER_MPU,
  2159. };
  2160. static struct omap_hwmod_ocp_if omap3xxx_l3_main__gpmc = {
  2161. .master = &omap3xxx_l3_main_hwmod,
  2162. .slave = &omap3xxx_gpmc_hwmod,
  2163. .clk = "core_l3_ick",
  2164. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2165. };
  2166. /* l4_core -> SHAM2 (SHA1/MD5) (similar to omap24xx) */
  2167. static struct omap_hwmod_class_sysconfig omap3_sham_sysc = {
  2168. .rev_offs = 0x5c,
  2169. .sysc_offs = 0x60,
  2170. .syss_offs = 0x64,
  2171. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
  2172. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  2173. .sysc_fields = &omap3_sham_sysc_fields,
  2174. };
  2175. static struct omap_hwmod_class omap3xxx_sham_class = {
  2176. .name = "sham",
  2177. .sysc = &omap3_sham_sysc,
  2178. };
  2179. static struct omap_hwmod omap3xxx_sham_hwmod = {
  2180. .name = "sham",
  2181. .main_clk = "sha12_ick",
  2182. .prcm = {
  2183. .omap2 = {
  2184. .module_offs = CORE_MOD,
  2185. .idlest_reg_id = 1,
  2186. .idlest_idle_bit = OMAP3430_ST_SHA12_SHIFT,
  2187. },
  2188. },
  2189. .class = &omap3xxx_sham_class,
  2190. };
  2191. static struct omap_hwmod_ocp_if omap3xxx_l4_core__sham = {
  2192. .master = &omap3xxx_l4_core_hwmod,
  2193. .slave = &omap3xxx_sham_hwmod,
  2194. .clk = "sha12_ick",
  2195. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2196. };
  2197. /* l4_core -> AES */
  2198. static struct omap_hwmod_class_sysconfig omap3_aes_sysc = {
  2199. .rev_offs = 0x44,
  2200. .sysc_offs = 0x48,
  2201. .syss_offs = 0x4c,
  2202. .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
  2203. SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
  2204. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  2205. .sysc_fields = &omap3xxx_aes_sysc_fields,
  2206. };
  2207. static struct omap_hwmod_class omap3xxx_aes_class = {
  2208. .name = "aes",
  2209. .sysc = &omap3_aes_sysc,
  2210. };
  2211. static struct omap_hwmod omap3xxx_aes_hwmod = {
  2212. .name = "aes",
  2213. .main_clk = "aes2_ick",
  2214. .prcm = {
  2215. .omap2 = {
  2216. .module_offs = CORE_MOD,
  2217. .idlest_reg_id = 1,
  2218. .idlest_idle_bit = OMAP3430_ST_AES2_SHIFT,
  2219. },
  2220. },
  2221. .class = &omap3xxx_aes_class,
  2222. };
  2223. static struct omap_hwmod_ocp_if omap3xxx_l4_core__aes = {
  2224. .master = &omap3xxx_l4_core_hwmod,
  2225. .slave = &omap3xxx_aes_hwmod,
  2226. .clk = "aes2_ick",
  2227. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2228. };
  2229. /*
  2230. * 'ssi' class
  2231. * synchronous serial interface (multichannel and full-duplex serial if)
  2232. */
  2233. static struct omap_hwmod_class_sysconfig omap34xx_ssi_sysc = {
  2234. .rev_offs = 0x0000,
  2235. .sysc_offs = 0x0010,
  2236. .syss_offs = 0x0014,
  2237. .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_MIDLEMODE |
  2238. SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
  2239. .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
  2240. .sysc_fields = &omap_hwmod_sysc_type1,
  2241. };
  2242. static struct omap_hwmod_class omap3xxx_ssi_hwmod_class = {
  2243. .name = "ssi",
  2244. .sysc = &omap34xx_ssi_sysc,
  2245. };
  2246. static struct omap_hwmod omap3xxx_ssi_hwmod = {
  2247. .name = "ssi",
  2248. .class = &omap3xxx_ssi_hwmod_class,
  2249. .clkdm_name = "core_l4_clkdm",
  2250. .main_clk = "ssi_ssr_fck",
  2251. .prcm = {
  2252. .omap2 = {
  2253. .module_offs = CORE_MOD,
  2254. .idlest_reg_id = 1,
  2255. .idlest_idle_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT,
  2256. },
  2257. },
  2258. };
  2259. /* L4 CORE -> SSI */
  2260. static struct omap_hwmod_ocp_if omap3xxx_l4_core__ssi = {
  2261. .master = &omap3xxx_l4_core_hwmod,
  2262. .slave = &omap3xxx_ssi_hwmod,
  2263. .clk = "ssi_ick",
  2264. .user = OCP_USER_MPU | OCP_USER_SDMA,
  2265. };
  2266. static struct omap_hwmod_ocp_if *omap3xxx_hwmod_ocp_ifs[] __initdata = {
  2267. &omap3xxx_l3_main__l4_core,
  2268. &omap3xxx_l3_main__l4_per,
  2269. &omap3xxx_mpu__l3_main,
  2270. &omap3xxx_l3_main__l4_debugss,
  2271. &omap3xxx_l4_core__l4_wkup,
  2272. &omap3xxx_l4_core__mmc3,
  2273. &omap3_l4_core__uart1,
  2274. &omap3_l4_core__uart2,
  2275. &omap3_l4_per__uart3,
  2276. &omap3_l4_core__i2c1,
  2277. &omap3_l4_core__i2c2,
  2278. &omap3_l4_core__i2c3,
  2279. &omap3xxx_l4_wkup__l4_sec,
  2280. &omap3xxx_l4_wkup__timer1,
  2281. &omap3xxx_l4_per__timer2,
  2282. &omap3xxx_l4_per__timer3,
  2283. &omap3xxx_l4_per__timer4,
  2284. &omap3xxx_l4_per__timer5,
  2285. &omap3xxx_l4_per__timer6,
  2286. &omap3xxx_l4_per__timer7,
  2287. &omap3xxx_l4_per__timer8,
  2288. &omap3xxx_l4_per__timer9,
  2289. &omap3xxx_l4_core__timer10,
  2290. &omap3xxx_l4_core__timer11,
  2291. &omap3xxx_l4_wkup__wd_timer2,
  2292. &omap3xxx_l4_wkup__gpio1,
  2293. &omap3xxx_l4_per__gpio2,
  2294. &omap3xxx_l4_per__gpio3,
  2295. &omap3xxx_l4_per__gpio4,
  2296. &omap3xxx_l4_per__gpio5,
  2297. &omap3xxx_l4_per__gpio6,
  2298. &omap3xxx_dma_system__l3,
  2299. &omap3xxx_l4_core__dma_system,
  2300. &omap3xxx_l4_core__mcbsp1,
  2301. &omap3xxx_l4_per__mcbsp2,
  2302. &omap3xxx_l4_per__mcbsp3,
  2303. &omap3xxx_l4_per__mcbsp4,
  2304. &omap3xxx_l4_core__mcbsp5,
  2305. &omap3xxx_l4_per__mcbsp2_sidetone,
  2306. &omap3xxx_l4_per__mcbsp3_sidetone,
  2307. &omap34xx_l4_core__mcspi1,
  2308. &omap34xx_l4_core__mcspi2,
  2309. &omap34xx_l4_core__mcspi3,
  2310. &omap34xx_l4_core__mcspi4,
  2311. &omap3xxx_l4_wkup__counter_32k,
  2312. &omap3xxx_l3_main__gpmc,
  2313. NULL,
  2314. };
  2315. /* GP-only hwmod links */
  2316. static struct omap_hwmod_ocp_if *omap34xx_gp_hwmod_ocp_ifs[] __initdata = {
  2317. &omap3xxx_l4_sec__timer12,
  2318. NULL,
  2319. };
  2320. static struct omap_hwmod_ocp_if *omap36xx_gp_hwmod_ocp_ifs[] __initdata = {
  2321. &omap3xxx_l4_sec__timer12,
  2322. NULL,
  2323. };
  2324. static struct omap_hwmod_ocp_if *am35xx_gp_hwmod_ocp_ifs[] __initdata = {
  2325. &omap3xxx_l4_sec__timer12,
  2326. NULL,
  2327. };
  2328. /* crypto hwmod links */
  2329. static struct omap_hwmod_ocp_if *omap34xx_sham_hwmod_ocp_ifs[] __initdata = {
  2330. &omap3xxx_l4_core__sham,
  2331. NULL,
  2332. };
  2333. static struct omap_hwmod_ocp_if *omap34xx_aes_hwmod_ocp_ifs[] __initdata = {
  2334. &omap3xxx_l4_core__aes,
  2335. NULL,
  2336. };
  2337. static struct omap_hwmod_ocp_if *omap36xx_sham_hwmod_ocp_ifs[] __initdata = {
  2338. &omap3xxx_l4_core__sham,
  2339. NULL
  2340. };
  2341. static struct omap_hwmod_ocp_if *omap36xx_aes_hwmod_ocp_ifs[] __initdata = {
  2342. &omap3xxx_l4_core__aes,
  2343. NULL
  2344. };
  2345. /*
  2346. * Apparently the SHA/MD5 and AES accelerator IP blocks are
  2347. * only present on some AM35xx chips, and no one knows which
  2348. * ones. See
  2349. * http://www.spinics.net/lists/arm-kernel/msg215466.html So
  2350. * if you need these IP blocks on an AM35xx, try uncommenting
  2351. * the following lines.
  2352. */
  2353. static struct omap_hwmod_ocp_if *am35xx_sham_hwmod_ocp_ifs[] __initdata = {
  2354. /* &omap3xxx_l4_core__sham, */
  2355. NULL
  2356. };
  2357. static struct omap_hwmod_ocp_if *am35xx_aes_hwmod_ocp_ifs[] __initdata = {
  2358. /* &omap3xxx_l4_core__aes, */
  2359. NULL,
  2360. };
  2361. /* 3430ES1-only hwmod links */
  2362. static struct omap_hwmod_ocp_if *omap3430es1_hwmod_ocp_ifs[] __initdata = {
  2363. &omap3430es1_dss__l3,
  2364. &omap3430es1_l4_core__dss,
  2365. NULL,
  2366. };
  2367. /* 3430ES2+-only hwmod links */
  2368. static struct omap_hwmod_ocp_if *omap3430es2plus_hwmod_ocp_ifs[] __initdata = {
  2369. &omap3xxx_dss__l3,
  2370. &omap3xxx_l4_core__dss,
  2371. &omap3xxx_usbhsotg__l3,
  2372. &omap3xxx_l4_core__usbhsotg,
  2373. &omap3xxx_usb_host_hs__l3_main_2,
  2374. &omap3xxx_l4_core__usb_host_hs,
  2375. &omap3xxx_l4_core__usb_tll_hs,
  2376. NULL,
  2377. };
  2378. /* <= 3430ES3-only hwmod links */
  2379. static struct omap_hwmod_ocp_if *omap3430_pre_es3_hwmod_ocp_ifs[] __initdata = {
  2380. &omap3xxx_l4_core__pre_es3_mmc1,
  2381. &omap3xxx_l4_core__pre_es3_mmc2,
  2382. NULL,
  2383. };
  2384. /* 3430ES3+-only hwmod links */
  2385. static struct omap_hwmod_ocp_if *omap3430_es3plus_hwmod_ocp_ifs[] __initdata = {
  2386. &omap3xxx_l4_core__es3plus_mmc1,
  2387. &omap3xxx_l4_core__es3plus_mmc2,
  2388. NULL,
  2389. };
  2390. /* 34xx-only hwmod links (all ES revisions) */
  2391. static struct omap_hwmod_ocp_if *omap34xx_hwmod_ocp_ifs[] __initdata = {
  2392. &omap3xxx_l3__iva,
  2393. &omap34xx_l4_core__sr1,
  2394. &omap34xx_l4_core__sr2,
  2395. &omap3xxx_l4_core__mailbox,
  2396. &omap3xxx_l4_core__hdq1w,
  2397. &omap3xxx_sad2d__l3,
  2398. &omap3xxx_l4_core__mmu_isp,
  2399. &omap3xxx_l3_main__mmu_iva,
  2400. &omap3xxx_l4_core__ssi,
  2401. NULL,
  2402. };
  2403. /* 36xx-only hwmod links (all ES revisions) */
  2404. static struct omap_hwmod_ocp_if *omap36xx_hwmod_ocp_ifs[] __initdata = {
  2405. &omap3xxx_l3__iva,
  2406. &omap36xx_l4_per__uart4,
  2407. &omap3xxx_dss__l3,
  2408. &omap3xxx_l4_core__dss,
  2409. &omap36xx_l4_core__sr1,
  2410. &omap36xx_l4_core__sr2,
  2411. &omap3xxx_usbhsotg__l3,
  2412. &omap3xxx_l4_core__usbhsotg,
  2413. &omap3xxx_l4_core__mailbox,
  2414. &omap3xxx_usb_host_hs__l3_main_2,
  2415. &omap3xxx_l4_core__usb_host_hs,
  2416. &omap3xxx_l4_core__usb_tll_hs,
  2417. &omap3xxx_l4_core__es3plus_mmc1,
  2418. &omap3xxx_l4_core__es3plus_mmc2,
  2419. &omap3xxx_l4_core__hdq1w,
  2420. &omap3xxx_sad2d__l3,
  2421. &omap3xxx_l4_core__mmu_isp,
  2422. &omap3xxx_l3_main__mmu_iva,
  2423. &omap3xxx_l4_core__ssi,
  2424. NULL,
  2425. };
  2426. static struct omap_hwmod_ocp_if *am35xx_hwmod_ocp_ifs[] __initdata = {
  2427. &omap3xxx_dss__l3,
  2428. &omap3xxx_l4_core__dss,
  2429. &am35xx_usbhsotg__l3,
  2430. &am35xx_l4_core__usbhsotg,
  2431. &am35xx_l4_core__uart4,
  2432. &omap3xxx_usb_host_hs__l3_main_2,
  2433. &omap3xxx_l4_core__usb_host_hs,
  2434. &omap3xxx_l4_core__usb_tll_hs,
  2435. &omap3xxx_l4_core__es3plus_mmc1,
  2436. &omap3xxx_l4_core__es3plus_mmc2,
  2437. &omap3xxx_l4_core__hdq1w,
  2438. &am35xx_mdio__l3,
  2439. &am35xx_l4_core__mdio,
  2440. &am35xx_emac__l3,
  2441. &am35xx_l4_core__emac,
  2442. NULL,
  2443. };
  2444. static struct omap_hwmod_ocp_if *omap3xxx_dss_hwmod_ocp_ifs[] __initdata = {
  2445. &omap3xxx_l4_core__dss_dispc,
  2446. &omap3xxx_l4_core__dss_dsi1,
  2447. &omap3xxx_l4_core__dss_rfbi,
  2448. &omap3xxx_l4_core__dss_venc,
  2449. NULL,
  2450. };
  2451. /**
  2452. * omap3xxx_hwmod_is_hs_ip_block_usable - is a security IP block accessible?
  2453. * @bus: struct device_node * for the top-level OMAP DT data
  2454. * @dev_name: device name used in the DT file
  2455. *
  2456. * Determine whether a "secure" IP block @dev_name is usable by Linux.
  2457. * There doesn't appear to be a 100% reliable way to determine this,
  2458. * so we rely on heuristics. If @bus is null, meaning there's no DT
  2459. * data, then we only assume the IP block is accessible if the OMAP is
  2460. * fused as a 'general-purpose' SoC. If however DT data is present,
  2461. * test to see if the IP block is described in the DT data and set to
  2462. * 'status = "okay"'. If so then we assume the ODM has configured the
  2463. * OMAP firewalls to allow access to the IP block.
  2464. *
  2465. * Return: 0 if device named @dev_name is not likely to be accessible,
  2466. * or 1 if it is likely to be accessible.
  2467. */
  2468. static bool __init omap3xxx_hwmod_is_hs_ip_block_usable(struct device_node *bus,
  2469. const char *dev_name)
  2470. {
  2471. struct device_node *node;
  2472. bool available;
  2473. if (!bus)
  2474. return omap_type() == OMAP2_DEVICE_TYPE_GP;
  2475. node = of_get_child_by_name(bus, dev_name);
  2476. available = of_device_is_available(node);
  2477. of_node_put(node);
  2478. return available;
  2479. }
  2480. int __init omap3xxx_hwmod_init(void)
  2481. {
  2482. int r;
  2483. struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL, **h_sham = NULL;
  2484. struct omap_hwmod_ocp_if **h_aes = NULL;
  2485. struct device_node *bus;
  2486. unsigned int rev;
  2487. omap_hwmod_init();
  2488. /* Register hwmod links common to all OMAP3 */
  2489. r = omap_hwmod_register_links(omap3xxx_hwmod_ocp_ifs);
  2490. if (r < 0)
  2491. return r;
  2492. rev = omap_rev();
  2493. /*
  2494. * Register hwmod links common to individual OMAP3 families, all
  2495. * silicon revisions (e.g., 34xx, or AM3505/3517, or 36xx)
  2496. * All possible revisions should be included in this conditional.
  2497. */
  2498. if (rev == OMAP3430_REV_ES1_0 || rev == OMAP3430_REV_ES2_0 ||
  2499. rev == OMAP3430_REV_ES2_1 || rev == OMAP3430_REV_ES3_0 ||
  2500. rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2) {
  2501. h = omap34xx_hwmod_ocp_ifs;
  2502. h_gp = omap34xx_gp_hwmod_ocp_ifs;
  2503. h_sham = omap34xx_sham_hwmod_ocp_ifs;
  2504. h_aes = omap34xx_aes_hwmod_ocp_ifs;
  2505. } else if (rev == AM35XX_REV_ES1_0 || rev == AM35XX_REV_ES1_1) {
  2506. h = am35xx_hwmod_ocp_ifs;
  2507. h_gp = am35xx_gp_hwmod_ocp_ifs;
  2508. h_sham = am35xx_sham_hwmod_ocp_ifs;
  2509. h_aes = am35xx_aes_hwmod_ocp_ifs;
  2510. } else if (rev == OMAP3630_REV_ES1_0 || rev == OMAP3630_REV_ES1_1 ||
  2511. rev == OMAP3630_REV_ES1_2) {
  2512. h = omap36xx_hwmod_ocp_ifs;
  2513. h_gp = omap36xx_gp_hwmod_ocp_ifs;
  2514. h_sham = omap36xx_sham_hwmod_ocp_ifs;
  2515. h_aes = omap36xx_aes_hwmod_ocp_ifs;
  2516. } else {
  2517. WARN(1, "OMAP3 hwmod family init: unknown chip type\n");
  2518. return -EINVAL;
  2519. }
  2520. r = omap_hwmod_register_links(h);
  2521. if (r < 0)
  2522. return r;
  2523. /* Register GP-only hwmod links. */
  2524. if (h_gp && omap_type() == OMAP2_DEVICE_TYPE_GP) {
  2525. r = omap_hwmod_register_links(h_gp);
  2526. if (r < 0)
  2527. return r;
  2528. }
  2529. /*
  2530. * Register crypto hwmod links only if they are not disabled in DT.
  2531. * If DT information is missing, enable them only for GP devices.
  2532. */
  2533. bus = of_find_node_by_name(NULL, "ocp");
  2534. if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
  2535. r = omap_hwmod_register_links(h_sham);
  2536. if (r < 0)
  2537. goto put_node;
  2538. }
  2539. if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
  2540. r = omap_hwmod_register_links(h_aes);
  2541. if (r < 0)
  2542. goto put_node;
  2543. }
  2544. of_node_put(bus);
  2545. /*
  2546. * Register hwmod links specific to certain ES levels of a
  2547. * particular family of silicon (e.g., 34xx ES1.0)
  2548. */
  2549. h = NULL;
  2550. if (rev == OMAP3430_REV_ES1_0) {
  2551. h = omap3430es1_hwmod_ocp_ifs;
  2552. } else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 ||
  2553. rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 ||
  2554. rev == OMAP3430_REV_ES3_1_2) {
  2555. h = omap3430es2plus_hwmod_ocp_ifs;
  2556. }
  2557. if (h) {
  2558. r = omap_hwmod_register_links(h);
  2559. if (r < 0)
  2560. return r;
  2561. }
  2562. h = NULL;
  2563. if (rev == OMAP3430_REV_ES1_0 || rev == OMAP3430_REV_ES2_0 ||
  2564. rev == OMAP3430_REV_ES2_1) {
  2565. h = omap3430_pre_es3_hwmod_ocp_ifs;
  2566. } else if (rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 ||
  2567. rev == OMAP3430_REV_ES3_1_2) {
  2568. h = omap3430_es3plus_hwmod_ocp_ifs;
  2569. }
  2570. if (h)
  2571. r = omap_hwmod_register_links(h);
  2572. if (r < 0)
  2573. return r;
  2574. /*
  2575. * DSS code presumes that dss_core hwmod is handled first,
  2576. * _before_ any other DSS related hwmods so register common
  2577. * DSS hwmod links last to ensure that dss_core is already
  2578. * registered. Otherwise some change things may happen, for
  2579. * ex. if dispc is handled before dss_core and DSS is enabled
  2580. * in bootloader DISPC will be reset with outputs enabled
  2581. * which sometimes leads to unrecoverable L3 error. XXX The
  2582. * long-term fix to this is to ensure hwmods are set up in
  2583. * dependency order in the hwmod core code.
  2584. */
  2585. r = omap_hwmod_register_links(omap3xxx_dss_hwmod_ocp_ifs);
  2586. return r;
  2587. put_node:
  2588. of_node_put(bus);
  2589. return r;
  2590. }