omap_hwmod.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /*
  2. * omap_hwmod macros, structures
  3. *
  4. * Copyright (C) 2009-2010 Nokia Corporation
  5. * Paul Walmsley
  6. *
  7. * Created in collaboration with (alphabetical order): Benoît Cousson,
  8. * Kevin Hilman, Tony Lindgren, Rajendra Nayak, Vikram Pandita, Sakari
  9. * Poussa, Anand Sawant, Santosh Shilimkar, Richard Woodruff
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. *
  15. * These headers and macros are used to define OMAP on-chip module
  16. * data and their integration with other OMAP modules and Linux.
  17. *
  18. * References:
  19. * - OMAP2420 Multimedia Processor Silicon Revision 2.1.1, 2.2 (SWPU064)
  20. * - OMAP2430 Multimedia Device POP Silicon Revision 2.1 (SWPU090)
  21. * - OMAP34xx Multimedia Device Silicon Revision 3.1 (SWPU108)
  22. * - OMAP4430 Multimedia Device Silicon Revision 1.0 (SWPU140)
  23. * - Open Core Protocol Specification 2.2
  24. *
  25. * To do:
  26. * - add interconnect error log structures
  27. * - add pinmuxing
  28. * - init_conn_id_bit (CONNID_BIT_VECTOR)
  29. * - implement default hwmod SMS/SDRC flags?
  30. *
  31. */
  32. #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
  33. #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_HWMOD_H
  34. #include <linux/kernel.h>
  35. #include <linux/list.h>
  36. #include <linux/ioport.h>
  37. #include <plat/cpu.h>
  38. struct omap_device;
  39. extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1;
  40. extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2;
  41. /*
  42. * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant
  43. * with the original PRCM protocol defined for OMAP2420
  44. */
  45. #define SYSC_TYPE1_MIDLEMODE_SHIFT 12
  46. #define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT)
  47. #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8
  48. #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT)
  49. #define SYSC_TYPE1_SIDLEMODE_SHIFT 3
  50. #define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT)
  51. #define SYSC_TYPE1_ENAWAKEUP_SHIFT 2
  52. #define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT)
  53. #define SYSC_TYPE1_SOFTRESET_SHIFT 1
  54. #define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT)
  55. #define SYSC_TYPE1_AUTOIDLE_SHIFT 0
  56. #define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT)
  57. /*
  58. * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant
  59. * with the new PRCM protocol defined for new OMAP4 IPs.
  60. */
  61. #define SYSC_TYPE2_SOFTRESET_SHIFT 0
  62. #define SYSC_TYPE2_SOFTRESET_MASK (1 << SYSC_TYPE2_SOFTRESET_SHIFT)
  63. #define SYSC_TYPE2_SIDLEMODE_SHIFT 2
  64. #define SYSC_TYPE2_SIDLEMODE_MASK (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT)
  65. #define SYSC_TYPE2_MIDLEMODE_SHIFT 4
  66. #define SYSC_TYPE2_MIDLEMODE_MASK (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT)
  67. /* OCP SYSSTATUS bit shifts/masks */
  68. #define SYSS_RESETDONE_SHIFT 0
  69. #define SYSS_RESETDONE_MASK (1 << SYSS_RESETDONE_SHIFT)
  70. /* Master standby/slave idle mode flags */
  71. #define HWMOD_IDLEMODE_FORCE (1 << 0)
  72. #define HWMOD_IDLEMODE_NO (1 << 1)
  73. #define HWMOD_IDLEMODE_SMART (1 << 2)
  74. /**
  75. * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
  76. * @name: name of the IRQ channel (module local name)
  77. * @irq_ch: IRQ channel ID
  78. *
  79. * @name should be something short, e.g., "tx" or "rx". It is for use
  80. * by platform_get_resource_byname(). It is defined locally to the
  81. * hwmod.
  82. */
  83. struct omap_hwmod_irq_info {
  84. const char *name;
  85. u16 irq;
  86. };
  87. /**
  88. * struct omap_hwmod_dma_info - DMA channels used by the hwmod
  89. * @name: name of the DMA channel (module local name)
  90. * @dma_ch: DMA channel ID
  91. *
  92. * @name should be something short, e.g., "tx" or "rx". It is for use
  93. * by platform_get_resource_byname(). It is defined locally to the
  94. * hwmod.
  95. */
  96. struct omap_hwmod_dma_info {
  97. const char *name;
  98. u16 dma_ch;
  99. };
  100. /**
  101. * struct omap_hwmod_opt_clk - optional clocks used by this hwmod
  102. * @role: "sys", "32k", "tv", etc -- for use in clk_get()
  103. * @clk: opt clock: OMAP clock name
  104. * @_clk: pointer to the struct clk (filled in at runtime)
  105. *
  106. * The module's interface clock and main functional clock should not
  107. * be added as optional clocks.
  108. */
  109. struct omap_hwmod_opt_clk {
  110. const char *role;
  111. const char *clk;
  112. struct clk *_clk;
  113. };
  114. /* omap_hwmod_omap2_firewall.flags bits */
  115. #define OMAP_FIREWALL_L3 (1 << 0)
  116. #define OMAP_FIREWALL_L4 (1 << 1)
  117. /**
  118. * struct omap_hwmod_omap2_firewall - OMAP2/3 device firewall data
  119. * @l3_perm_bit: bit shift for L3_PM_*_PERMISSION_*
  120. * @l4_fw_region: L4 firewall region ID
  121. * @l4_prot_group: L4 protection group ID
  122. * @flags: (see omap_hwmod_omap2_firewall.flags macros above)
  123. */
  124. struct omap_hwmod_omap2_firewall {
  125. u8 l3_perm_bit;
  126. u8 l4_fw_region;
  127. u8 l4_prot_group;
  128. u8 flags;
  129. };
  130. /*
  131. * omap_hwmod_addr_space.flags bits
  132. *
  133. * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
  134. * ADDR_TYPE_RT: Address space contains module register target data.
  135. */
  136. #define ADDR_MAP_ON_INIT (1 << 0)
  137. #define ADDR_TYPE_RT (1 << 1)
  138. /**
  139. * struct omap_hwmod_addr_space - MPU address space handled by the hwmod
  140. * @pa_start: starting physical address
  141. * @pa_end: ending physical address
  142. * @flags: (see omap_hwmod_addr_space.flags macros above)
  143. *
  144. * Address space doesn't necessarily follow physical interconnect
  145. * structure. GPMC is one example.
  146. */
  147. struct omap_hwmod_addr_space {
  148. u32 pa_start;
  149. u32 pa_end;
  150. u8 flags;
  151. };
  152. /*
  153. * omap_hwmod_ocp_if.user bits: these indicate the initiators that use this
  154. * interface to interact with the hwmod. Used to add sleep dependencies
  155. * when the module is enabled or disabled.
  156. */
  157. #define OCP_USER_MPU (1 << 0)
  158. #define OCP_USER_SDMA (1 << 1)
  159. /* omap_hwmod_ocp_if.flags bits */
  160. #define OCPIF_SWSUP_IDLE (1 << 0)
  161. #define OCPIF_CAN_BURST (1 << 1)
  162. /**
  163. * struct omap_hwmod_ocp_if - OCP interface data
  164. * @master: struct omap_hwmod that initiates OCP transactions on this link
  165. * @slave: struct omap_hwmod that responds to OCP transactions on this link
  166. * @addr: address space associated with this link
  167. * @clk: interface clock: OMAP clock name
  168. * @_clk: pointer to the interface struct clk (filled in at runtime)
  169. * @fw: interface firewall data
  170. * @addr_cnt: ARRAY_SIZE(@addr)
  171. * @width: OCP data width
  172. * @thread_cnt: number of threads
  173. * @max_burst_len: maximum burst length in @width sized words (0 if unlimited)
  174. * @user: initiators using this interface (see OCP_USER_* macros above)
  175. * @flags: OCP interface flags (see OCPIF_* macros above)
  176. *
  177. * It may also be useful to add a tag_cnt field for OCP2.x devices.
  178. *
  179. * Parameter names beginning with an underscore are managed internally by
  180. * the omap_hwmod code and should not be set during initialization.
  181. */
  182. struct omap_hwmod_ocp_if {
  183. struct omap_hwmod *master;
  184. struct omap_hwmod *slave;
  185. struct omap_hwmod_addr_space *addr;
  186. const char *clk;
  187. struct clk *_clk;
  188. union {
  189. struct omap_hwmod_omap2_firewall omap2;
  190. } fw;
  191. u8 addr_cnt;
  192. u8 width;
  193. u8 thread_cnt;
  194. u8 max_burst_len;
  195. u8 user;
  196. u8 flags;
  197. };
  198. /* Macros for use in struct omap_hwmod_sysconfig */
  199. /* Flags for use in omap_hwmod_sysconfig.idlemodes */
  200. #define MASTER_STANDBY_SHIFT 2
  201. #define SLAVE_IDLE_SHIFT 0
  202. #define SIDLE_FORCE (HWMOD_IDLEMODE_FORCE << SLAVE_IDLE_SHIFT)
  203. #define SIDLE_NO (HWMOD_IDLEMODE_NO << SLAVE_IDLE_SHIFT)
  204. #define SIDLE_SMART (HWMOD_IDLEMODE_SMART << SLAVE_IDLE_SHIFT)
  205. #define MSTANDBY_FORCE (HWMOD_IDLEMODE_FORCE << MASTER_STANDBY_SHIFT)
  206. #define MSTANDBY_NO (HWMOD_IDLEMODE_NO << MASTER_STANDBY_SHIFT)
  207. #define MSTANDBY_SMART (HWMOD_IDLEMODE_SMART << MASTER_STANDBY_SHIFT)
  208. /* omap_hwmod_sysconfig.sysc_flags capability flags */
  209. #define SYSC_HAS_AUTOIDLE (1 << 0)
  210. #define SYSC_HAS_SOFTRESET (1 << 1)
  211. #define SYSC_HAS_ENAWAKEUP (1 << 2)
  212. #define SYSC_HAS_EMUFREE (1 << 3)
  213. #define SYSC_HAS_CLOCKACTIVITY (1 << 4)
  214. #define SYSC_HAS_SIDLEMODE (1 << 5)
  215. #define SYSC_HAS_MIDLEMODE (1 << 6)
  216. #define SYSS_MISSING (1 << 7)
  217. #define SYSC_NO_CACHE (1 << 8) /* XXX SW flag, belongs elsewhere */
  218. /* omap_hwmod_sysconfig.clockact flags */
  219. #define CLOCKACT_TEST_BOTH 0x0
  220. #define CLOCKACT_TEST_MAIN 0x1
  221. #define CLOCKACT_TEST_ICLK 0x2
  222. #define CLOCKACT_TEST_NONE 0x3
  223. /**
  224. * struct omap_hwmod_sysc_fields - hwmod OCP_SYSCONFIG register field offsets.
  225. * @midle_shift: Offset of the midle bit
  226. * @clkact_shift: Offset of the clockactivity bit
  227. * @sidle_shift: Offset of the sidle bit
  228. * @enwkup_shift: Offset of the enawakeup bit
  229. * @srst_shift: Offset of the softreset bit
  230. * @autoidle_shift: Offset of the autoidle bit
  231. */
  232. struct omap_hwmod_sysc_fields {
  233. u8 midle_shift;
  234. u8 clkact_shift;
  235. u8 sidle_shift;
  236. u8 enwkup_shift;
  237. u8 srst_shift;
  238. u8 autoidle_shift;
  239. };
  240. /**
  241. * struct omap_hwmod_class_sysconfig - hwmod class OCP_SYS* data
  242. * @rev_offs: IP block revision register offset (from module base addr)
  243. * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
  244. * @syss_offs: OCP_SYSSTATUS register offset (from module base addr)
  245. * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART}
  246. * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported
  247. * @clockact: the default value of the module CLOCKACTIVITY bits
  248. *
  249. * @clockact describes to the module which clocks are likely to be
  250. * disabled when the PRCM issues its idle request to the module. Some
  251. * modules have separate clockdomains for the interface clock and main
  252. * functional clock, and can check whether they should acknowledge the
  253. * idle request based on the internal module functionality that has
  254. * been associated with the clocks marked in @clockact. This field is
  255. * only used if HWMOD_SET_DEFAULT_CLOCKACT is set (see below)
  256. *
  257. * @sysc_fields: structure containing the offset positions of various bits in
  258. * SYSCONFIG register. This can be populated using omap_hwmod_sysc_type1 or
  259. * omap_hwmod_sysc_type2 defined in omap_hwmod_common_data.c depending on
  260. * whether the device ip is compliant with the original PRCM protocol
  261. * defined for OMAP2420 or the new PRCM protocol for new OMAP4 IPs.
  262. * If the device follows a different scheme for the sysconfig register ,
  263. * then this field has to be populated with the correct offset structure.
  264. */
  265. struct omap_hwmod_class_sysconfig {
  266. u16 rev_offs;
  267. u16 sysc_offs;
  268. u16 syss_offs;
  269. u16 sysc_flags;
  270. u8 idlemodes;
  271. u8 clockact;
  272. struct omap_hwmod_sysc_fields *sysc_fields;
  273. };
  274. /**
  275. * struct omap_hwmod_omap2_prcm - OMAP2/3-specific PRCM data
  276. * @module_offs: PRCM submodule offset from the start of the PRM/CM
  277. * @prcm_reg_id: PRCM register ID (e.g., 3 for CM_AUTOIDLE3)
  278. * @module_bit: register bit shift for AUTOIDLE, WKST, WKEN, GRPSEL regs
  279. * @idlest_reg_id: IDLEST register ID (e.g., 3 for CM_IDLEST3)
  280. * @idlest_idle_bit: register bit shift for CM_IDLEST slave idle bit
  281. * @idlest_stdby_bit: register bit shift for CM_IDLEST master standby bit
  282. *
  283. * @prcm_reg_id and @module_bit are specific to the AUTOIDLE, WKST,
  284. * WKEN, GRPSEL registers. In an ideal world, no extra information
  285. * would be needed for IDLEST information, but alas, there are some
  286. * exceptions, so @idlest_reg_id, @idlest_idle_bit, @idlest_stdby_bit
  287. * are needed for the IDLEST registers (c.f. 2430 I2CHS, 3430 USBHOST)
  288. */
  289. struct omap_hwmod_omap2_prcm {
  290. s16 module_offs;
  291. u8 prcm_reg_id;
  292. u8 module_bit;
  293. u8 idlest_reg_id;
  294. u8 idlest_idle_bit;
  295. u8 idlest_stdby_bit;
  296. };
  297. /**
  298. * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
  299. * @clkctrl_reg: PRCM address of the clock control register
  300. * @submodule_wkdep_bit: bit shift of the WKDEP range
  301. */
  302. struct omap_hwmod_omap4_prcm {
  303. void __iomem *clkctrl_reg;
  304. u8 submodule_wkdep_bit;
  305. };
  306. /*
  307. * omap_hwmod.flags definitions
  308. *
  309. * HWMOD_SWSUP_SIDLE: omap_hwmod code should manually bring module in and out
  310. * of idle, rather than relying on module smart-idle
  311. * HWMOD_SWSUP_MSTDBY: omap_hwmod code should manually bring module in and out
  312. * of standby, rather than relying on module smart-standby
  313. * HWMOD_INIT_NO_RESET: don't reset this module at boot - important for
  314. * SDRAM controller, etc.
  315. * HWMOD_INIT_NO_IDLE: don't idle this module at boot - important for SDRAM
  316. * controller, etc.
  317. * HWMOD_NO_AUTOIDLE: disable module autoidle (OCP_SYSCONFIG.AUTOIDLE)
  318. * when module is enabled, rather than the default, which is to
  319. * enable autoidle
  320. * HWMOD_SET_DEFAULT_CLOCKACT: program CLOCKACTIVITY bits at startup
  321. * HWMOD_NO_IDLEST : this module does not have idle status - this is the case
  322. * only for few initiator modules on OMAP2 & 3.
  323. */
  324. #define HWMOD_SWSUP_SIDLE (1 << 0)
  325. #define HWMOD_SWSUP_MSTANDBY (1 << 1)
  326. #define HWMOD_INIT_NO_RESET (1 << 2)
  327. #define HWMOD_INIT_NO_IDLE (1 << 3)
  328. #define HWMOD_NO_OCP_AUTOIDLE (1 << 4)
  329. #define HWMOD_SET_DEFAULT_CLOCKACT (1 << 5)
  330. #define HWMOD_NO_IDLEST (1 << 6)
  331. /*
  332. * omap_hwmod._int_flags definitions
  333. * These are for internal use only and are managed by the omap_hwmod code.
  334. *
  335. * _HWMOD_NO_MPU_PORT: no path exists for the MPU to write to this module
  336. * _HWMOD_WAKEUP_ENABLED: set when the omap_hwmod code has enabled ENAWAKEUP
  337. * _HWMOD_SYSCONFIG_LOADED: set when the OCP_SYSCONFIG value has been cached
  338. */
  339. #define _HWMOD_NO_MPU_PORT (1 << 0)
  340. #define _HWMOD_WAKEUP_ENABLED (1 << 1)
  341. #define _HWMOD_SYSCONFIG_LOADED (1 << 2)
  342. /*
  343. * omap_hwmod._state definitions
  344. *
  345. * INITIALIZED: reset (optionally), initialized, enabled, disabled
  346. * (optionally)
  347. *
  348. *
  349. */
  350. #define _HWMOD_STATE_UNKNOWN 0
  351. #define _HWMOD_STATE_REGISTERED 1
  352. #define _HWMOD_STATE_CLKS_INITED 2
  353. #define _HWMOD_STATE_INITIALIZED 3
  354. #define _HWMOD_STATE_ENABLED 4
  355. #define _HWMOD_STATE_IDLE 5
  356. #define _HWMOD_STATE_DISABLED 6
  357. /**
  358. * struct omap_hwmod_class - the type of an IP block
  359. * @name: name of the hwmod_class
  360. * @sysc: device SYSCONFIG/SYSSTATUS register data
  361. * @rev: revision of the IP class
  362. *
  363. * Represent the class of a OMAP hardware "modules" (e.g. timer,
  364. * smartreflex, gpio, uart...)
  365. */
  366. struct omap_hwmod_class {
  367. const char *name;
  368. struct omap_hwmod_class_sysconfig *sysc;
  369. u32 rev;
  370. };
  371. /**
  372. * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks)
  373. * @name: name of the hwmod
  374. * @class: struct omap_hwmod_class * to the class of this hwmod
  375. * @od: struct omap_device currently associated with this hwmod (internal use)
  376. * @mpu_irqs: ptr to an array of MPU IRQs (see also mpu_irqs_cnt)
  377. * @sdma_chs: ptr to an array of SDMA channel IDs (see also sdma_chs_cnt)
  378. * @prcm: PRCM data pertaining to this hwmod
  379. * @main_clk: main clock: OMAP clock name
  380. * @_clk: pointer to the main struct clk (filled in at runtime)
  381. * @opt_clks: other device clocks that drivers can request (0..*)
  382. * @masters: ptr to array of OCP ifs that this hwmod can initiate on
  383. * @slaves: ptr to array of OCP ifs that this hwmod can respond on
  384. * @dev_attr: arbitrary device attributes that can be passed to the driver
  385. * @_sysc_cache: internal-use hwmod flags
  386. * @_mpu_rt_va: cached register target start address (internal use)
  387. * @_mpu_port_index: cached MPU register target slave ID (internal use)
  388. * @msuspendmux_reg_id: CONTROL_MSUSPENDMUX register ID (1-6)
  389. * @msuspendmux_shift: CONTROL_MSUSPENDMUX register bit shift
  390. * @mpu_irqs_cnt: number of @mpu_irqs
  391. * @sdma_chs_cnt: number of @sdma_chs
  392. * @opt_clks_cnt: number of @opt_clks
  393. * @master_cnt: number of @master entries
  394. * @slaves_cnt: number of @slave entries
  395. * @response_lat: device OCP response latency (in interface clock cycles)
  396. * @_int_flags: internal-use hwmod flags
  397. * @_state: internal-use hwmod state
  398. * @flags: hwmod flags (documented below)
  399. * @omap_chip: OMAP chips this hwmod is present on
  400. * @node: list node for hwmod list (internal use)
  401. *
  402. * @main_clk refers to this module's "main clock," which for our
  403. * purposes is defined as "the functional clock needed for register
  404. * accesses to complete." Modules may not have a main clock if the
  405. * interface clock also serves as a main clock.
  406. *
  407. * Parameter names beginning with an underscore are managed internally by
  408. * the omap_hwmod code and should not be set during initialization.
  409. */
  410. struct omap_hwmod {
  411. const char *name;
  412. struct omap_hwmod_class *class;
  413. struct omap_device *od;
  414. struct omap_hwmod_irq_info *mpu_irqs;
  415. struct omap_hwmod_dma_info *sdma_chs;
  416. union {
  417. struct omap_hwmod_omap2_prcm omap2;
  418. struct omap_hwmod_omap4_prcm omap4;
  419. } prcm;
  420. const char *main_clk;
  421. struct clk *_clk;
  422. struct omap_hwmod_opt_clk *opt_clks;
  423. struct omap_hwmod_ocp_if **masters; /* connect to *_IA */
  424. struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */
  425. void *dev_attr;
  426. u32 _sysc_cache;
  427. void __iomem *_mpu_rt_va;
  428. struct list_head node;
  429. u16 flags;
  430. u8 _mpu_port_index;
  431. u8 msuspendmux_reg_id;
  432. u8 msuspendmux_shift;
  433. u8 response_lat;
  434. u8 mpu_irqs_cnt;
  435. u8 sdma_chs_cnt;
  436. u8 opt_clks_cnt;
  437. u8 masters_cnt;
  438. u8 slaves_cnt;
  439. u8 hwmods_cnt;
  440. u8 _int_flags;
  441. u8 _state;
  442. const struct omap_chip_id omap_chip;
  443. };
  444. int omap_hwmod_init(struct omap_hwmod **ohs);
  445. int omap_hwmod_register(struct omap_hwmod *oh);
  446. int omap_hwmod_unregister(struct omap_hwmod *oh);
  447. struct omap_hwmod *omap_hwmod_lookup(const char *name);
  448. int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
  449. void *data);
  450. int omap_hwmod_late_init(u8 skip_setup_idle);
  451. int omap_hwmod_enable(struct omap_hwmod *oh);
  452. int _omap_hwmod_enable(struct omap_hwmod *oh);
  453. int omap_hwmod_idle(struct omap_hwmod *oh);
  454. int _omap_hwmod_idle(struct omap_hwmod *oh);
  455. int omap_hwmod_shutdown(struct omap_hwmod *oh);
  456. int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
  457. int omap_hwmod_disable_clocks(struct omap_hwmod *oh);
  458. int omap_hwmod_set_slave_idlemode(struct omap_hwmod *oh, u8 idlemode);
  459. int omap_hwmod_reset(struct omap_hwmod *oh);
  460. void omap_hwmod_ocp_barrier(struct omap_hwmod *oh);
  461. void omap_hwmod_writel(u32 v, struct omap_hwmod *oh, u16 reg_offs);
  462. u32 omap_hwmod_readl(struct omap_hwmod *oh, u16 reg_offs);
  463. int omap_hwmod_count_resources(struct omap_hwmod *oh);
  464. int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
  465. struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
  466. void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
  467. int omap_hwmod_add_initiator_dep(struct omap_hwmod *oh,
  468. struct omap_hwmod *init_oh);
  469. int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
  470. struct omap_hwmod *init_oh);
  471. int omap_hwmod_set_clockact_both(struct omap_hwmod *oh);
  472. int omap_hwmod_set_clockact_main(struct omap_hwmod *oh);
  473. int omap_hwmod_set_clockact_iclk(struct omap_hwmod *oh);
  474. int omap_hwmod_set_clockact_none(struct omap_hwmod *oh);
  475. int omap_hwmod_enable_wakeup(struct omap_hwmod *oh);
  476. int omap_hwmod_disable_wakeup(struct omap_hwmod *oh);
  477. int omap_hwmod_for_each_by_class(const char *classname,
  478. int (*fn)(struct omap_hwmod *oh,
  479. void *user),
  480. void *user);
  481. /*
  482. * Chip variant-specific hwmod init routines - XXX should be converted
  483. * to use initcalls once the initial boot ordering is straightened out
  484. */
  485. extern int omap2420_hwmod_init(void);
  486. extern int omap2430_hwmod_init(void);
  487. extern int omap3xxx_hwmod_init(void);
  488. #endif