1
0

am335x.h 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846
  1. /*++
  2. Copyright (c) 2015 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. am335x.h
  5. Abstract:
  6. This header contains hardware definitions for the TI AM335x SoCs.
  7. Author:
  8. Evan Green 6-Jan-2015
  9. --*/
  10. //
  11. // ------------------------------------------------------------------- Includes
  12. //
  13. //
  14. // --------------------------------------------------------------------- Macros
  15. //
  16. #define AM335_PAD_GPMC_AD(_Index) (0x800 + ((_Index) * 4))
  17. #define AM335_PAD_GPMC_A(_Index) (0x840 + ((_Index) * 4))
  18. #define AM335_PAD_LCD_DATA(_Index) (0x8A0 + ((_Index) * 4))
  19. #define AM335_PAD_UART_RXD(_Index) (0x970 + ((_Index) * 0x10))
  20. #define AM335_PAD_UART_TXD(_Index) (0x974 + ((_Index) * 0x10))
  21. #define AM335_SOC_CONTROL_DDR_CMD_IO_CONTROL(_Index) (0x1404 + ((_Index) * 4))
  22. #define AM335_SOC_CONTROL_DDR_DATA_IO_CONTROL(_Index) (0x1440 + ((_Index) * 4))
  23. #define AM335_PAD_MUXCODE(_Code) (_Code)
  24. //
  25. // These macros access interrupt controller registers.
  26. //
  27. #define AM335_INTC_LINE_TO_INDEX(_Line) ((_Line) >> 5)
  28. #define AM335_INTC_LINE_TO_MASK(_Line) (1 << ((_Line) & 0x1F))
  29. #define AM335_INTC_MASK(_Index) (Am335IntcMask + ((_Index) * 0x20))
  30. #define AM335_INTC_MASK_CLEAR(_Index) (Am335IntcMaskClear + ((_Index) * 0x20))
  31. #define AM335_INTC_MASK_SET(_Index) (Am335IntcMaskSet + ((_Index) * 0x20))
  32. #define AM335_INTC_LINE(_Line) (Am335IntcLine + ((_Line) * 0x4))
  33. //
  34. // This macro fills in the bits of the raster timing 0 register given a number
  35. // of pixels per line (which is the horizontal resolution minus one).
  36. //
  37. #define AM335_LCD_RESOLUTION_X_TO_TIMING_0(_PixelsPerLine) \
  38. (((_PixelsPerLine) & 0x000003F0) | (((_PixelsPerLine) & 0x00000400) >> 7))
  39. //
  40. // These macros convert a vertical lines per panel to timing 1 and 2 values.
  41. // Lines per panel is the vertical resolution minus one.
  42. //
  43. #define AM335_LCD_RESOLUTION_Y_TO_TIMING_1(_LinesPerPanel) \
  44. ((_LinesPerPanel) & 0x000003FF)
  45. #define AM335_LCD_RESOLUTION_Y_TO_TIMING_2(_LinesPerPanel) \
  46. ((((_LinesPerPanel) & 0x00000400) >> 10) << \
  47. AM335_LCD_RASTER_TIMING_2_LINES_PER_PANEL_BIT_10_SHIFT)
  48. //
  49. // ---------------------------------------------------------------- Definitions
  50. //
  51. //
  52. // Define the number of timers in the SoC.
  53. //
  54. #define AM335X_TIMER_COUNT 8
  55. //
  56. // Define attributes of the timers.
  57. //
  58. #define AM335_TIMER_BIT_WIDTH 32
  59. #define AM335_TIMER_FREQUENCY_32KHZ 32768
  60. #define AM335_TIMER_CONTROLLER_SIZE 0x1000
  61. #define AM335_WATCHDOG_SIZE 0x1000
  62. //
  63. // Define the size of the interrupt controller register space.
  64. //
  65. #define AM335_INTC_CONTROLLER_SIZE 0x1000
  66. //
  67. // Define the number of unique interrupt priorities in the INTC controller.
  68. //
  69. #define AM335_INTC_PRIORITY_COUNT 63
  70. #define AM335_MAX_INTERRUPT_LINES (32 * 4)
  71. #define AM335_MAX_INTERRUPT_LINE_BLOCKS \
  72. AM335_INTC_LINE_TO_INDEX(AM335_MAX_INTERRUPT_LINES)
  73. //
  74. // Define the fixed 32.768kHz frequency floating around the SoC in various
  75. // locations.
  76. //
  77. #define AM335_32KHZ_FREQUENCY 32768
  78. //
  79. // Define the interrupt map.
  80. //
  81. #define AM335_IRQ_DMTIMER0 66
  82. #define AM335_IRQ_DMTIMER1 67
  83. #define AM335_IRQ_DMTIMER2 68
  84. #define AM335_IRQ_DMTIMER3 69
  85. #define AM335_IRQ_DMTIMER4 92
  86. #define AM335_IRQ_DMTIMER5 93
  87. #define AM335_IRQ_DMTIMER6 94
  88. #define AM335_IRQ_DMTIMER7 95
  89. //
  90. // Define peripheral bases.
  91. //
  92. #define AM335_OCMC_BASE 0x40300000
  93. #define AM335_PRCM_REGISTERS 0x44E00000
  94. #define AM335_DMTIMER0_BASE 0x44E05000
  95. #define AM335_GPIO_0_BASE 0x44E07000
  96. #define AM335_UART_0_BASE 0x44E09000
  97. #define AM335_UART_1_BASE 0x44E0A000
  98. #define AM335_I2C_0_BASE 0x44E0B000
  99. #define AM335_SOC_CONTROL_REGISTERS 0x44E10000
  100. #define AM335_DMTIMER1_BASE 0x44E31000
  101. #define AM335_WATCHDOG_BASE 0x44E35000
  102. #define AM335_RTC_BASE 0x44E3E000
  103. #define AM335_DMTIMER2_BASE 0x48040000
  104. #define AM335_DMTIMER3_BASE 0x48042000
  105. #define AM335_DMTIMER4_BASE 0x48044000
  106. #define AM335_DMTIMER5_BASE 0x48046000
  107. #define AM335_DMTIMER6_BASE 0x48048000
  108. #define AM335_DMTIMER7_BASE 0x4804A000
  109. #define AM335_GPIO_1_BASE 0x4804C000
  110. #define AM335_HSMMC_0_BASE 0x48060000
  111. #define AM335_GPIO_2_BASE 0x481AC000
  112. #define AM335_GPIO_3_BASE 0x481AE000
  113. #define AM335_HSMMC_1_BASE 0x481D8000
  114. #define AM335_INTC_BASE 0x48200000
  115. #define AM335_LCD_REGISTERS 0x4830E000
  116. #define AM335_EMIF_0_REGISTERS 0x4C000000
  117. #define AM335_CORTEX_M3_CODE_SIZE 0x4000
  118. #define AM335_CORTEX_M3_DATA_SIZE 0x2000
  119. #define AM335_MAILBOX_SIZE 0x1000
  120. #define AM335_RTC_SIZE 0x1000
  121. #define AM335_OCMC_SIZE 0x10000
  122. #define AM335_EMIF_SIZE 0x1000
  123. //
  124. // Define PRCM offsets.
  125. //
  126. #define AM335_PRCM_SIZE 0x2000
  127. #define AM335_CM_PER_OFFSET 0x0000
  128. #define AM335_CM_WAKEUP_OFFSET 0x0400
  129. #define AM335_CM_DPLL_OFFSET 0x0500
  130. #define AM335_CM_MPU_OFFSET 0x0600
  131. #define AM335_CM_DEVICE_OFFSET 0x0700
  132. #define AM335_CM_RTC_OFFSET 0x0800
  133. #define AM335_CM_GFX_OFFSET 0x0900
  134. #define AM335_CM_CEFUSE_OFFSET 0x0A00
  135. #define AM335_PRM_IRQ_OFFSET 0x0B00
  136. #define AM335_PRM_PER_OFFSET 0x0C00
  137. #define AM335_PRM_WAKEUP_OFFSET 0x0D00
  138. #define AM335_PRM_MPU_OFFSET 0x0E00
  139. #define AM335_PRM_DEVICE_OFFSET 0x0F00
  140. #define AM335_PRM_RTC_OFFSET 0x1000
  141. #define AM335_PRM_GFX_OFFSET 0x1100
  142. #define AM335_PRM_CEFUSE_OFFSET 0x1200
  143. #define AM335_CM_PER_REGISTERS (AM335_PRCM_REGISTERS + AM335_CM_PER_OFFSET)
  144. #define AM335_CM_WAKEUP_REGISTERS \
  145. (AM335_PRCM_REGISTERS + AM335_CM_WAKEUP_OFFSET)
  146. #define AM335_SOC_CM_DPLL_REGISTERS \
  147. (AM335_PRCM_REGISTERS + AM335_CM_DPLL_OFFSET)
  148. #define AM335_PRM_DEVICE_REGISTERS \
  149. (AM335_PRCM_REGISTERS + AM335_PRM_DEVICE_OFFSET)
  150. //
  151. // CM wakeup registers.
  152. //
  153. #define AM335_CM_WAKEUP_CLOCK_STATE_CONTROL 0x000
  154. #define AM335_CM_WAKEUP_CONTROL_CLOCK_CONTROL 0x004
  155. #define AM335_CM_WAKEUP_L4WKUP_CLOCK_CONTROL 0x00C
  156. #define AM335_CM_WAKEUP_TIMER0_CLOCK_CONTROL 0x10
  157. #define AM335_CM_WAKEUP_L3_AON_CLOCK_STATE_CONTROL 0x018
  158. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_MPU 0x020
  159. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_MPU 0x02C
  160. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_DDR 0x034
  161. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DDR 0x040
  162. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_DISP 0x048
  163. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DISP 0x054
  164. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_CORE 0x05C
  165. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_CORE 0x068
  166. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_PER 0x070
  167. #define AM335_CM_WAKEUP_CLOCK_DCO_LDO_DPLL_PER 0x7C
  168. #define AM335_CM_WAKEUP_DIV_M4_DPLL_CORE 0x080
  169. #define AM335_CM_WAKEUP_DIV_M5_DPLL_CORE 0x084
  170. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_MPU 0x088
  171. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_PER 0x08C
  172. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_CORE 0x090
  173. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_DDR 0x094
  174. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_DISP 0x098
  175. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_PER 0x09C
  176. #define AM335_CM_WAKEUP_DIV_M2_DPLL_DDR 0x0A0
  177. #define AM335_CM_WAKEUP_DIV_M2_DPLL_DISP 0x0A4
  178. #define AM335_CM_WAKEUP_DIV_M2_DPLL_MPU 0x0A8
  179. #define AM335_CM_WAKEUP_DIV_M2_DPLL_PER 0x0AC
  180. #define AM335_CM_WAKEUP_UART0_CLOCK_CONTROL 0x0B4
  181. #define AM335_CM_WAKEUP_I2C0_CLOCK_CONTROL 0x0B8
  182. #define AM335_CM_WAKEUP_TIMER1_CLOCK_CONTROL 0x0C4
  183. #define AM335_CM_WAKEUP_L4WKUP_AON_CLOCK_STATE_CONTROL 0x0CC
  184. #define AM335_CM_WAKEUP_DIV_M6_DPLL_CORE 0x0D8
  185. //
  186. // CM wakeup clock state control register bits.
  187. //
  188. #define AM335_CM_WAKEUP_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  189. #define AM335_CM_WAKEUP_CLOCK_STATE_TRANSITION_MASK 0x00000003
  190. #define AM335_CM_WAKEUP_CLOCK_STATE_L4WAKEUP_ACTIVE 0x00000004
  191. #define AM335_CM_WAKEUP_CLOCK_STATE_I2C0_ACTIVE 0x00000800
  192. #define AM335_CM_WAKEUP_CLOCK_STATE_UART0_ACTIVE 0x00001000
  193. //
  194. // CM wakeup control clock control bits.
  195. //
  196. #define AM335_CM_WAKEUP_CONTROL_CLOCK_ENABLE 0x00000002
  197. #define AM335_CM_WAKEUP_CONTROL_CLOCK_MODE_MASK 0x00000003
  198. #define AM335_CM_WAKEUP_CONTROL_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  199. #define AM335_CM_WAKEUP_CONTROL_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  200. //
  201. // CM wakeup L4 wakeup clock control register bits.
  202. //
  203. #define AM335_CM_WAKEUP_L4WKUP_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  204. #define AM335_CM_WAKEUP_L4WKUP_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  205. //
  206. // CM wakeup L3 always on clock state register bits.
  207. //
  208. #define AM335_CM_WAKEUP_L3_AON_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  209. #define AM335_CM_WAKEUP_L3_AON_CLOCK_STATE_TRANSITION_MASK 0x00000003
  210. #define AM335_CM_WAKEUP_L3_AON_CLOCK_STATE_ACTIVE 0x00000008
  211. //
  212. // CM wakeup UART0 clock control register bits.
  213. //
  214. #define AM335_CM_WAKEUP_UART0_CONTROL_CLOCK_ENABLE 0x00000002
  215. #define AM335_CM_WAKEUP_UART0_CLOCK_MODE_MASK 0x00000003
  216. #define AM335_CM_WAKEUP_UART0_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  217. #define AM335_CM_WAKEUP_UART0_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  218. //
  219. // CM wakeup I2C0 clock control register bits.
  220. //
  221. #define AM335_CM_WAKEUP_I2C0_CONTROL_CLOCK_ENABLE 0x00000002
  222. #define AM335_CM_WAKEUP_I2C0_CLOCK_MODE_MASK 0x00000003
  223. #define AM335_CM_WAKEUP_I2C0_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  224. #define AM335_CM_WAKEUP_I2C0_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  225. //
  226. // CM wakeup L4 wakeup always on clock state register bits.
  227. //
  228. #define AM335_CM_WAKEUP_L4WKUP_AON_CLOCK_STATE_ACTIVE 0x00000004
  229. //
  230. // CM Wakeup DDR PLL clock mode register bits.
  231. //
  232. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_DDR_ENABLE_MN_BYPASS 0x00000004
  233. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_DDR_ENABLE 0x0000007
  234. //
  235. // CM Wakeup DDR PLL idle status register bits.
  236. //
  237. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_DDR_MN_BYPASS 0x00000100
  238. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_DDR_CLOCK 0x00000001
  239. //
  240. // CM Wakeup MPU PLL clock select register bits.
  241. //
  242. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DDR_DIV_MASK 0x0000007F
  243. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DDR_DIV_SHIFT 0
  244. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DDR_MULT_MASK 0x0007FF00
  245. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DDR_MULT_SHIFT 8
  246. //
  247. // CM Wakeup MPU PLL M2 divisor register bits.
  248. //
  249. #define AM335_CM_WAKEUP_DIV_M2_DPLL_DDR_CLOCK_OUT_MASK 0x0000001F
  250. //
  251. // CM Wakeup PER PLL clock mode register bits.
  252. //
  253. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_PER_ENABLE_MN_BYPASS 0x00000004
  254. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_PER_ENABLE 0x0000007
  255. //
  256. // CM Wakeup PER PLL idle status register bits.
  257. //
  258. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_PER_MN_BYPASS 0x00000100
  259. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_PER_CLOCK 0x00000001
  260. //
  261. // CM Wakeup PER PLL clock select register bits.
  262. //
  263. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_PER_MULT_SHIFT 8
  264. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_PER_DIV_SHIFT 0
  265. //
  266. // CM Wakeup PER PLL M2 divider register bits.
  267. //
  268. #define AM335_CM_WAKEUP_DIV_M2_DPLL_PER_CLOCK_OUT_DIV_MASK 0x0000007F
  269. #define AM335_CM_WAKEUP_DIV_M2_DPLL_PER_CLOCK_OUT_DIV_SHIFT 0
  270. //
  271. // CM Wakeup CORE PLL clock mode register bits.
  272. //
  273. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_CORE_ENABLE_MN_BYPASS 0x00000004
  274. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_CORE_ENABLE 0x0000007
  275. //
  276. // CM Wakeup CORE PLL idle status register bits.
  277. //
  278. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_CORE_MN_BYPASS 0x00000100
  279. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_CORE_CLOCK 0x00000001
  280. //
  281. // CM Wakeup CORE PLL clock select register bits.
  282. //
  283. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_CORE_DIV_SHIFT 0
  284. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_CORE_MULT_SHIFT 8
  285. //
  286. // CM Wakeup CORE PLL M4 divider register bits.
  287. //
  288. #define AM335_CM_WAKEUP_DIV_M4_DPLL_CORE_HSDIVIDER_CLOCK_OUT1_DIV_MASK \
  289. 0x0000001F
  290. #define AM335_CM_WAKEUP_DIV_M4_DPLL_CORE_HSDIVIDER_CLOCK_OUT1_DIV_SHIFT 0
  291. //
  292. // CM Wakeup CORE PLL M5 divider register bits.
  293. //
  294. #define AM335_CM_WAKEUP_DIV_M5_DPLL_CORE_HSDIVIDER_CLOCK_OUT2_DIV_MASK \
  295. 0x0000001F
  296. #define AM335_CM_WAKEUP_DIV_M5_DPLL_CORE_HSDIVIDER_CLOCK_OUT2_DIV_SHIFT 0
  297. //
  298. // CM Wakeup CORE PLL M6 divider register bits.
  299. //
  300. #define AM335_CM_WAKEUP_DIV_M6_DPLL_CORE_HSDIVIDER_CLOCK_OUT3_DIV_MASK \
  301. 0x0000001F
  302. #define AM335_CM_WAKEUP_DIV_M6_DPLL_CORE_HSDIVIDER_CLOCK_OUT3_DIV_SHIFT 0
  303. //
  304. // Define CM DPLL registers.
  305. //
  306. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER7 0x04
  307. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER2 0x08
  308. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER3 0x0C
  309. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER4 0x10
  310. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER5 0x18
  311. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER6 0x1C
  312. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER1 0x28
  313. #define AM335_CM_DPLL_CLOCK_SELECT_LCD 0x34
  314. //
  315. // CM DPLL clock select timer register bits (any timer except 1).
  316. //
  317. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER_MASK 0x00000003
  318. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER_TCLKIN 0x0
  319. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER_SYSTEM_CLOCK 0x1
  320. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER_32KHZ 0x2
  321. #define AM335_CM_PER_TIMER2_CLOCK_ENABLE 0x00000002
  322. #define AM335_CM_WAKEUP_TIMER0_CLOCK_ENABLE 0x00000002
  323. //
  324. // CM Wakeup Timer1 PLL clock select register bits.
  325. //
  326. #define AM335_CM_DPLL_CLOCK_SELECT_TIMER1_32KHZ 0x00000001
  327. //
  328. // Define CM PER registers.
  329. //
  330. #define AM335_CM_PER_L4LS_CLOCK_STATE_CONTROL 0x000
  331. #define AM335_CM_PER_L3S_CLOCK_STATE_CONTROL 0x004
  332. #define AM335_CM_PER_L4FW_CLOCK_STATE_CONTROL 0x008
  333. #define AM335_CM_PER_L3_CLOCK_STATE_CONTROL 0x00C
  334. #define AM335_CM_PER_CPGMAC0_CLOCK_CONTROL 0x014
  335. #define AM335_CM_PER_LCD_CLOCK_CONTROL 0x018
  336. #define AM335_CM_PER_USB0_CLOCK_CONTROL 0x1C
  337. #define AM335_CM_PER_TPTC0_CLOCK_CONTROL 0x024
  338. #define AM335_CM_PER_EMIF_CLOCK_CONTROL 0x028
  339. #define AM335_CM_PER_MMC0_CLOCK_CONTROL 0x03C
  340. #define AM335_CM_PER_L4LS_CLOCK_CONTROL 0x060
  341. #define AM335_CM_PER_L4FW_CLOCK_CONTROL 0x064
  342. #define AM335_CM_PER_TIMER7_CLOCK_CONTROL 0x07C
  343. #define AM335_CM_PER_TIMER2_CLOCK_CONTROL 0x080
  344. #define AM335_CM_PER_TIMER3_CLOCK_CONTROL 0x084
  345. #define AM335_CM_PER_TIMER4_CLOCK_CONTROL 0x088
  346. #define AM335_CM_PER_GPIO1_CLOCK_CONTROL 0x0AC
  347. #define AM335_CM_PER_TPCC_CLOCK_CONTROL 0x0BC
  348. #define AM335_CM_PER_MMC1_CLOCK_CONTROL 0x0F4
  349. #define AM335_CM_PER_CPSW_CLOCK_STATE_CONTROL 0x144
  350. #define AM335_CM_PER_EMIF_FW_CLOCK_CONTROL 0x0D0
  351. #define AM335_CM_PER_L3_INSTR_CLOCK_CONTROL 0x0DC
  352. #define AM335_CM_PER_L3_CLOCK_CONTROL 0x0E0
  353. #define AM335_CM_PER_TIMER5_CLOCK_CONTROL 0x0EC
  354. #define AM335_CM_PER_TIMER6_CLOCK_CONTROL 0x0F0
  355. #define AM335_CM_PER_TPTC1_CLOCK_CONTROL 0x0FC
  356. #define AM335_CM_PER_TPTC2_CLOCK_CONTROL 0x100
  357. #define AM335_CM_PER_MAILBOX_CLOCK_CONTROL 0x110
  358. #define AM335_CM_PER_L4HS_CLOCK_CONTROL 0x120
  359. #define AM335_CM_PER_OCPWP_L3_CLOCK_STATE_CONTROL 0x12C
  360. //
  361. // CM Per MMC0 clock control register bits.
  362. //
  363. #define AM335_CM_PER_MMC0_CLOCK_ENABLE 0x00000002
  364. //
  365. // CM Per MMC0 clock control register bits.
  366. //
  367. #define AM335_CM_PER_MMC1_CLOCK_ENABLE 0x00000002
  368. //
  369. // L4LS clock state control register bits.
  370. //
  371. #define AM335_CM_PER_L4LS_CLOCK_STATE_ACTIVITY_GPIO1 (1 << 19)
  372. #define AM335_CM_PER_L4LS_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  373. //
  374. // L4FW clock state control register bits.
  375. //
  376. #define AM335_CM_PER_L4FW_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  377. //
  378. // TPTC0 clock control register bits.
  379. //
  380. #define AM335_CM_PER_TPTC0_CLOCK_ENABLE 0x00000002
  381. //
  382. // TPTC1 clock control register bits.
  383. //
  384. #define AM335_CM_PER_TPTC1_CLOCK_ENABLE 0x00000002
  385. //
  386. // TPTC2 clock control register bits.
  387. //
  388. #define AM335_CM_PER_TPTC2_CLOCK_ENABLE 0x00000002
  389. //
  390. // GPIO1 CM PER Clock control register bits.
  391. //
  392. #define AM335_CM_PER_GPIO1_CLOCK_ENABLE 0x2
  393. #define AM335_CM_PER_GPIO1_CLOCK_MODE_MASK 0x3
  394. #define AM335_CM_PER_GPIO1_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  395. #define AM335_CM_PER_GPIO1_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  396. #define AM335_CM_PER_GPIO1_CLOCK_FUNCTIONAL_CLOCK_ENABLE (1 << 18)
  397. //
  398. // TPCC CM PER Clock control register bits.
  399. //
  400. #define AM335_CM_PER_TPCC_CLOCK_ENABLE 0x2
  401. #define AM335_CM_PER_TPCC_CLOCK_MODE_MASK 0x3
  402. #define AM335_CM_PER_TPCC_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  403. #define AM335_CM_PER_TPCC_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  404. #define AM335_CM_PER_TPCC_CLOCK_FUNCTIONAL_CLOCK_ENABLE (1 << 18)
  405. //
  406. // L3 clock control register bits.
  407. //
  408. #define AM335_CM_PER_L3_CLOCK_ENABLE 0x00000002
  409. #define AM335_CM_PER_L3_CLOCK_MODE_MASK 0x00000003
  410. #define AM335_CM_PER_L3_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  411. #define AM335_CM_PER_L3_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  412. //
  413. // CM Per CPGMAC0 clock control register bits.
  414. //
  415. #define AM335_CM_PER_CPGMAC0_CLOCK_ENABLE 0x00000002
  416. #define AM335_CM_PER_CPGMAC0_CLOCK_IDLE_STATE_FUNCTIONAL 0x00000000
  417. #define AM335_CM_PER_CPGMAC0_CLOCK_IDLE_STATE_MASK 0x00030000
  418. //
  419. // L3 Instr clock control bits.
  420. //
  421. #define AM335_CM_PER_L3_INSTR_CLOCK_ENABLE 0x00000002
  422. #define AM335_CM_PER_L3_INSTR_CLOCK_MODE_MASK 0x00000003
  423. #define AM335_CM_PER_L3_INSTR_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  424. #define AM335_CM_PER_L3_INSTR_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  425. //
  426. // LCD clock control register bits.
  427. //
  428. #define AM335_CM_PER_LCD_CLOCK_ENABLE 0x00000002
  429. #define AM335_CM_PER_LCD_CLOCK_MODE_MASK 0x00000003
  430. //
  431. // USB0 clock control register bits.
  432. //
  433. #define AM335_CM_PER_USB0_CLOCK_ENABLE 0x00000002
  434. #define AM335_CM_PER_USB0_CLOCK_MODE_MASK 0x00000003
  435. //
  436. // Mailbox clock control register bits.
  437. //
  438. #define AM335_CM_PER_MAILBOX_CLOCK_ENABLE 0x00000002
  439. #define AM335_CM_PER_MAILBOX_CLOCK_MODE_MASK 0x00000003
  440. //
  441. // CM PER EMIF Fw clock control register bits.
  442. //
  443. #define AM335_CM_PER_EMIF_FW_CLOCK_MODE_MASK 0x00000003
  444. #define AM335_CM_PER_EMIF_FW_CLOCK_ENABLE 0x00000002
  445. //
  446. // CM PER EMIF Fw clock control register bits.
  447. //
  448. #define AM335_CM_PER_EMIF_CLOCK_MODE_MASK 0x00000003
  449. #define AM335_CM_PER_EMIF_CLOCK_ENABLE 0x00000002
  450. //
  451. // L3 clock state control register bits.
  452. //
  453. #define AM335_CM_PER_L3_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  454. #define AM335_CM_PER_L3_CLOCK_STATE_TRANSITION_MASK 0x00000003
  455. #define AM335_CM_PER_L3_CLOCK_STATE_EMIF_ACTIVE 0x00000004
  456. #define AM335_CM_PER_L3_CLOCK_STATE_ACTIVE 0x00000010
  457. //
  458. // OCPWP L3 clock state register bits.
  459. //
  460. #define AM335_CM_PER_OCPWP_L3_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  461. #define AM335_CM_PER_OCPWP_L3_CLOCK_STATE_TRANSITION_MASK 0x00000003
  462. #define AM335_CM_PER_OCPWP_L3_CLOCK_STATE_ACTIVE 0x00000010
  463. //
  464. // L3S clock state register bits.
  465. //
  466. #define AM335_CM_PER_L3S_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  467. #define AM335_CM_PER_L3S_CLOCK_STATE_TRANSITION_MASK 0x00000003
  468. #define AM335_CM_PER_L3S_CLOCK_STATE_ACTIVE 0x00000008
  469. //
  470. // L4LS clock control register bits.
  471. //
  472. #define AM335_CM_PER_L4LS_CLOCK_ENABLE 0x00000002
  473. #define AM335_CM_PER_L4LS_CLOCK_MODE_MASK 0x00000003
  474. #define AM335_CM_PER_L4LS_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  475. #define AM335_CM_PER_L4LS_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  476. //
  477. // L4FW clock control register bits.
  478. //
  479. #define AM335_CM_PER_L4FW_CLOCK_ENABLE 0x00000002
  480. #define AM335_CM_PER_L4FW_CLOCK_MODE_MASK 0x00000003
  481. #define AM335_CM_PER_L4FW_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  482. #define AM335_CM_PER_L4FW_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  483. //
  484. // CM Per CPSW clock state control register bits.
  485. //
  486. #define AM335_CM_PER_CPSW_CLOCK_STATE_SOFTWARE_WAKEUP 0x00000002
  487. #define AM335_CM_PER_CPSW_CLOCK_STATE_CPSW_125MHZ_GCLK 0x00000010
  488. //
  489. // L4HS clock control register bits.
  490. //
  491. #define AM335_CM_PER_L4HS_CLOCK_ENABLE 0x00000002
  492. #define AM335_CM_PER_L4HS_CLOCK_MODE_MASK 0x00000003
  493. #define AM335_CM_PER_L4HS_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  494. #define AM335_CM_PER_L4HS_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  495. //
  496. // CM Wakeup L4FW clock control register bits.
  497. //
  498. #define AM335_CM_WAKEUP_L4FW_CLOCK_ENABLE 0x00000002
  499. #define AM335_CM_WAKEUP_L4FW_CLOCK_MODE_MASK 0x00000003
  500. #define AM335_CM_WAKEUP_L4FW_CLOCK_IDLE_STATE_FUNCTIONAL (0x0 << 16)
  501. #define AM335_CM_WAKEUP_L4FW_CLOCK_IDLE_STATE_MASK (0x3 << 16)
  502. //
  503. // CM DPLL LCD clock select register bits.
  504. //
  505. #define AM335_CM_DPLL_CLOCK_SELECT_LCD_DISP_PLL_CLKOUT_M2 0x0
  506. #define AM335_CM_DPLL_CLOCK_SELECT_LCD_CORE_PLL_CLKOUT_M5 0x1
  507. #define AM335_CM_DPLL_CLOCK_SELECT_LCD_PER_PLL_CLKOUT_M2 0x2
  508. //
  509. // Define EMIF registers.
  510. //
  511. #define AM335_EMIF_SDRAM_CONFIG 0x08
  512. #define AM335_EMIF_SDRAM_REF_CONTROL 0x10
  513. #define AM335_EMIF_SDRAM_REF_CONTROL_SHADOW 0x14
  514. #define AM335_EMIF_SDRAM_TIM_1 0x18
  515. #define AM335_EMIF_SDRAM_TIM_1_SHADOW 0x1C
  516. #define AM335_EMIF_SDRAM_TIM_2 0x20
  517. #define AM335_EMIF_SDRAM_TIM_2_SHADOW 0x24
  518. #define AM335_EMIF_SDRAM_TIM_3 0x28
  519. #define AM335_EMIF_SDRAM_TIM_3_SHADOW 0x2C
  520. #define AM335_EMIF_ZQ_CONFIG 0xC8
  521. #define AM335_EMIF_DDR_PHY_CONTROL_1 0xE4
  522. #define AM335_EMIF_DDR_PHY_CONTROL_1_SHADOW 0xE8
  523. #define AM335_EMIF_DDR_PHY_CONTROL_2 0xEC
  524. //
  525. // DDR3 CKE control register definitions.
  526. //
  527. #define AM335_DDR3_CONTROL_DDR_CKE_CONTROL 0x00000001
  528. //
  529. // Define SoC control registers.
  530. //
  531. #define AM335_SOC_CONTROL_STATUS 0x0040
  532. #define AM335_SOC_CONTROL_SECURE_EMIF_SDRAM_CONFIG 0x0110
  533. #define AM335_SOC_CONTROL_DEVICE_ID 0x0600
  534. #define AM335_SOC_CONTROL_USB_CONTROL1 0x628
  535. #define AM335_SOC_CONTROL_MAC_ID0_LOW 0x0630
  536. #define AM335_SOC_CONTROL_MAC_ID0_HIGH 0x0634
  537. #define AM335_SOC_CONTROL_MAC_ID1_LOW 0x0638
  538. #define AM335_SOC_CONTROL_MAC_ID1_HIGH 0x063C
  539. #define AM335_SOC_CONTROL_GMII_SEL 0x650
  540. #define AM335_SOC_CONTROL_EFUSE_SMA 0x07FC
  541. #define AM335_SOC_CONTROL_CONF_GPMC_AD0 0x800
  542. #define AM335_SOC_CONTROL_CONF_GPMC_AD1 0x804
  543. #define AM335_SOC_CONTROL_CONF_GPMC_AD2 0x808
  544. #define AM335_SOC_CONTROL_CONF_GPMC_AD3 0x80C
  545. #define AM335_SOC_CONTROL_CONF_GPMC_AD4 0x810
  546. #define AM335_SOC_CONTROL_CONF_GPMC_AD5 0x814
  547. #define AM335_SOC_CONTROL_CONF_GPMC_AD6 0x818
  548. #define AM335_SOC_CONTROL_CONF_GPMC_AD7 0x81C
  549. #define AM335_SOC_CONTROL_CONF_GPMC_CSN1 0x880
  550. #define AM335_SOC_CONTROL_CONF_GPMC_CSN2 0x884
  551. #define AM335_SOC_CONTROL_CONF_LCD_VSYNC 0x8E0
  552. #define AM335_SOC_CONTROL_CONF_LCD_HSYNC 0x8E4
  553. #define AM335_SOC_CONTROL_CONF_LCD_PCLK 0x8E8
  554. #define AM335_SOC_CONTROL_CONF_LCD_AC_BIAS_EN 0x8EC
  555. #define AM335_SOC_CONTROL_CONF_MMC0_DAT3 0x8F0
  556. #define AM335_SOC_CONTROL_CONF_MMC0_DAT2 0x8F4
  557. #define AM335_SOC_CONTROL_CONF_MMC0_DAT1 0x8F8
  558. #define AM335_SOC_CONTROL_CONF_MMC0_DAT0 0x8FC
  559. #define AM335_SOC_CONTROL_CONF_MMC0_CLK 0x900
  560. #define AM335_SOC_CONTROL_CONF_MMC0_CMD 0x904
  561. #define AM335_SOC_CONTROL_CONF_MII1_COL 0x908
  562. #define AM335_SOC_CONTROL_CONF_MII1_CRS 0x90C
  563. #define AM335_SOC_CONTROL_CONF_MII1_RXERR 0x910
  564. #define AM335_SOC_CONTROL_CONF_MII1_TXEN 0x914
  565. #define AM335_SOC_CONTROL_CONF_MII1_RXDV 0x918
  566. #define AM335_SOC_CONTROL_CONF_MII1_TXD3 0x91C
  567. #define AM335_SOC_CONTROL_CONF_MII1_TXD2 0x920
  568. #define AM335_SOC_CONTROL_CONF_MII1_TXD1 0x924
  569. #define AM335_SOC_CONTROL_CONF_MII1_TXD0 0x928
  570. #define AM335_SOC_CONTROL_CONF_MII1_TXCLK 0x92C
  571. #define AM335_SOC_CONTROL_CONF_MII1_RXCLK 0x930
  572. #define AM335_SOC_CONTROL_CONF_MII1_RXD3 0x934
  573. #define AM335_SOC_CONTROL_CONF_MII1_RXD2 0x938
  574. #define AM335_SOC_CONTROL_CONF_MII1_RXD1 0x93C
  575. #define AM335_SOC_CONTROL_CONF_MII1_RXD0 0x940
  576. #define AM335_SOC_CONTROL_CONF_RMII1_REFCLK 0x944
  577. #define AM335_SOC_CONTROL_CONF_MDIO_DATA 0x948
  578. #define AM335_SOC_CONTROL_CONF_MDIO_CLK 0x94C
  579. #define AM335_SOC_CONTROL_CONF_SPI0_CS1 0x960
  580. #define AM335_SOC_CONTROL_I2C0_SDA 0x0988
  581. #define AM335_SOC_CONTROL_I2C0_SCL 0x098C
  582. #define AM335_SOC_CONTROL_CONF_XDMA_EVENT_INTR0 0x9B0
  583. #define AM335_SOC_CONTROL_VTP_CONTROL 0x0E0C
  584. #define AM335_SOC_CONTROL_DDR_IO_CONTROL 0x0E04
  585. #define AM335_SOC_CONTROL_DDR_CKE_CONTROL 0x131C
  586. //
  587. // Define SoC control status register bits.
  588. //
  589. #define AM335_SOC_STATUS_SYSBOOT0_MASK 0x000000FF
  590. //
  591. // Define USB0/1 control register bits.
  592. //
  593. #define AM335_SOC_USB_CONTROL_SESSION_END_DETECT 0x00100000
  594. #define AM335_SOC_USB_CONTROL_VBUS_DETECT 0x00080000
  595. #define AM335_SOC_USB_CONTROL_OTG_PHY_POWER_DOWN 0x00000002
  596. #define AM335_SOC_USB_CONTROL_CM_PHY_POWER_DOWN 0x00000001
  597. //
  598. // Define UART0 RXD pad control register bits.
  599. //
  600. #define AM335_SOC_CONTROL_UART0_RXD_PULLUP 0x00000010
  601. #define AM335_SOC_CONTROL_UART0_RXD_RX_ACTIVE 0x00000020
  602. //
  603. // Define UART0 TXD pad control register bits.
  604. //
  605. #define AM335_SOC_CONTROL_UART0_TXD_PULLUP 0x00000010
  606. //
  607. // Generic SoC control pad configuration register bits.
  608. //
  609. #define AM335_SOC_CONF_MUX_MMODE_SHIFT 0
  610. #define AM335_SOC_CONF_MUX_PUDEN_SHIFT 3
  611. #define AM335_SOC_CONF_MUX_PUTYPESEL_SHIFT 4
  612. #define AM335_SOC_CONF_MUX_RXACTIVE_SHIFT 5
  613. #define AM335_SOC_CONF_MUX_SLEWCTRL_SHIFT 6
  614. //
  615. // SoC control VTP control register bits (used for DDR initialization).
  616. //
  617. #define AM335_SOC_CONTROL_VTP_CONTROL_CLRZ 0x00000001
  618. #define AM335_SOC_CONTROL_VTP_CONTROL_READY 0x00000020
  619. #define AM335_SOC_CONTROL_VTP_CONTROL_ENABLE 0x00000040
  620. //
  621. // Define GPIO registers.
  622. //
  623. #define AM335_GPIO_CONFIGURATION 0x010
  624. #define AM335_GPIO_SYSTEM_STATUS 0x114
  625. #define AM335_GPIO_CONTROL 0x130
  626. #define AM335_GPIO_OUTPUT_ENABLE 0x134
  627. #define AM335_GPIO_CLEAR_DATA_OUT 0x190
  628. #define AM335_GPIO_SET_DATA_OUT 0x194
  629. //
  630. // Define GPIO system configuration register bits.
  631. //
  632. #define AM335_GPIO_CONFIGURATION_RESET_DONE 0x00000001
  633. #define AM335_GPIO_CONFIGURATION_SOFT_RESET 0x00000002
  634. //
  635. // Define GPIO control register bits.
  636. //
  637. #define AM335_GPIO_CONTROL_DISABLE_MODULE 0x00000001
  638. //
  639. // Define AM335 timer register bits.
  640. //
  641. //
  642. // Idle bits.
  643. //
  644. #define AM335_TIMER_IDLEMODE_NOIDLE 0x00000004
  645. #define AM335_TIMER_IDLEMODE_SMART 0x00000008
  646. //
  647. // Mode bits.
  648. //
  649. #define AM335_TIMER_STARTED 0x00000001
  650. #define AM335_TIMER_OVERFLOW_TRIGGER 0x00000400
  651. #define AM335_TIMER_OVERFLOW_AND_MATCH_TRIGGER 0x00000800
  652. #define AM335_TIMER_COMPARE_ENABLED 0x00000040
  653. #define AM335_TIMER_AUTORELOAD 0x00000002
  654. //
  655. // Interrupt enable bits.
  656. //
  657. #define AM335_TIMER_MATCH_INTERRUPT 0x00000001
  658. #define AM335_TIMER_OVERFLOW_INTERRUPT 0x00000002
  659. #define AM335_TIMER_INTERRUPT_MASK 0x7
  660. //
  661. // Define AM335 interrupt controller register bits.
  662. //
  663. //
  664. // Interrupt system configuration register bits.
  665. //
  666. #define AM335_INTC_SYSTEM_CONFIG_AUTO_IDLE 0x00000001
  667. #define AM335_INTC_SYSTEM_CONFIG_SOFT_RESET 0x00000002
  668. //
  669. // Interrupt system status register bits.
  670. //
  671. #define AM335_INTC_SYSTEM_STATUS_RESET_DONE 0x00000001
  672. //
  673. // Interrupt sorted IRQ/FIQ register bits.
  674. //
  675. #define AM335_INTC_SORTED_ACTIVE_MASK 0x0000007F
  676. #define AM335_INTC_SORTED_SPURIOUS 0x00000080
  677. //
  678. // Protection register bits.
  679. //
  680. #define AM335_INTC_PROTECTION_ENABLE 0x00000001
  681. //
  682. // Idle register bits.
  683. //
  684. #define AM335_INTC_IDLE_INPUT_AUTO_GATING 0x00000002
  685. //
  686. // Interrupt line register bits.
  687. //
  688. #define AM335_INTC_LINE_IRQ 0x00000000
  689. #define AM335_INTC_LINE_FIQ 0x00000001
  690. #define AM335_INTC_LINE_PRIORITY_SHIFT 2
  691. //
  692. // Interrupt control register bits.
  693. //
  694. #define AM335_INTC_CONTROL_NEW_IRQ_AGREEMENT 0x00000001
  695. #define AM335_INTC_CONTROL_NEW_FIQ_AGREEMENT 0x00000002
  696. //
  697. // Define PRM Device registers.
  698. //
  699. #define AM335_PRM_DEVICE_RESET_CONTROL 0x00
  700. //
  701. // Define PRM Device Reset Control register bits.
  702. //
  703. #define AM335_PRM_DEVICE_RESET_CONTROL_WARM_RESET 0x00000001
  704. #define AM335_PRM_DEVICE_RESET_CONTROL_COLD_RESET 0x00000002
  705. //
  706. // Define UART registers.
  707. //
  708. #define AM335_UART_RBR 0x00
  709. #define AM335_UART_THR 0x00
  710. #define AM335_UART_DLL 0x00
  711. #define AM335_UART_IER 0x04
  712. #define AM335_UART_DLM 0x04
  713. #define AM335_UART_FCR 0x08
  714. #define AM335_UART_IIR 0x08
  715. #define AM335_UART_LCR 0x0C
  716. #define AM335_UART_MCR 0x10
  717. #define AM335_UART_LSR 0x14
  718. #define AM335_UART_MSR 0x18
  719. #define AM335_UART_SCR 0x1C
  720. #define AM335_UART_MDR1 0x20
  721. #define AM335_UART_SYSTEM_CONTROL 0x54
  722. #define AM335_UART_SYSTEM_STATUS 0x58
  723. //
  724. // Define UART system control register bits.
  725. //
  726. #define AM335_UART_SYSTEM_CONTROL_RESET 0x00000002
  727. //
  728. // Define UART system status register bits.
  729. //
  730. #define AM335_UART_SYSTEM_STATUS_RESET_DONE 0x00000001
  731. //
  732. // SoC control definitions
  733. //
  734. #define AM335_SOC_CONTROL_SIZE 0x2000
  735. //
  736. // Define SoC control device ID register bits.
  737. //
  738. #define AM335_SOC_CONTROL_DEVICE_ID_REVISION_SHIFT 0x1C
  739. #define AM335_SOC_DEVICE_VERSION_1_0 0
  740. #define AM335_SOC_DEVICE_VERSION_2_0 1
  741. #define AM335_SOC_DEVICE_VERSION_2_1 2
  742. //
  743. // EFuse bit for OPP100 275MHz, 1.1v.
  744. //
  745. #define AM335_EFUSE_OPP100_275_MASK 0x00000001
  746. #define AM335_EFUSE_OPP100_275 0
  747. //
  748. // EFuse bit for OPP100 500MHz, 1.1v.
  749. //
  750. #define AM335_EFUSE_OPP100_500_MASK 0x00000002
  751. #define AM335_EFUSE_OPP100_500 1
  752. //
  753. // EFuse bit for OPP100 600MHz, 1.2v.
  754. //
  755. #define AM335_EFUSE_OPP120_600_MASK 0x00000004
  756. #define AM335_EFUSE_OPP120_600 2
  757. //
  758. // EFuse bit for OPP Turbo 720MHz, 1.26v.
  759. //
  760. #define AM335_EFUSE_OPPTB_720_MASK 0x00000008
  761. #define AM335_EFUSE_OPPTB_720 3
  762. //
  763. // EFuse bit for OPP50 300MHz, 1.1v.
  764. //
  765. #define AM335_EFUSE_OPP50_300_MASK 0x00000010
  766. #define AM335_EFUSE_OPP50_300 4
  767. //
  768. // EFuse bit for OPP100 300MHz, 1.1v.
  769. //
  770. #define AM335_EFUSE_OPP100_300_MASK 0x00000020
  771. #define AM335_EFUSE_OPP100_300 5
  772. //
  773. // EFuse bit for OPP100 600MHz, 1.1v.
  774. //
  775. #define AM335_EFUSE_OPP100_600_MASK 0x00000040
  776. #define AM335_EFUSE_OPP100_600 6
  777. //
  778. // EFuse bit for OPP120 700MHz, 1.2v.
  779. //
  780. #define AM335_EFUSE_OPP120_720_MASK 0x00000080
  781. #define AM335_EFUSE_OPP120_720 7
  782. //
  783. // EFuse bit for OPP Turbo 800MHz, 1.26v.
  784. //
  785. #define AM335_EFUSE_OPPTB_800_MASK 0x00000100
  786. #define AM335_EFUSE_OPPTB_800 8
  787. //
  788. // EFuse bit for OPP Turbo 1000MHz, 1.325v.
  789. //
  790. #define AM335_EFUSE_OPPNT_1000_MASK 0x00000200
  791. #define AM335_EFUSE_OPPNT_1000 9
  792. #define AM335_SOC_CONTROL_EFUSE_OPP_MASK 0x00001FFF
  793. #define AM335_EFUSE_OPP_MAX (AM335_EFUSE_OPPNT_1000 + 1)
  794. //
  795. // Define types of OPP.
  796. //
  797. #define AM335_OPP_NONE 0
  798. #define AM335_OPP50 1
  799. #define AM335_OPP100 2
  800. #define AM335_OPP120 3
  801. #define AM335_OPP_SR_TURBO 4
  802. #define AM335_OPP_NITRO 5
  803. //
  804. // MPU PLL configurations.
  805. //
  806. #define AM335_MPU_PLL_M_275MHZ 275
  807. #define AM335_MPU_PLL_M_300MHZ 300
  808. #define AM335_MPU_PLL_M_500MHZ 500
  809. #define AM335_MPU_PLL_M_600MHZ 600
  810. #define AM335_MPU_PLL_M_720MHZ 720
  811. #define AM335_MPU_PLL_M_800MHZ 800
  812. #define AM335_MPU_PLL_M_1000MHZ 1000
  813. //
  814. // Define PMIC voltage configurations.
  815. //
  816. #define AM335_PMIC_VOLTAGE_950MV TPS65217_DCDC_VOLTAGE_950MV
  817. #define AM335_PMIC_VOLTAGE_1100MV TPS65217_DCDC_VOLTAGE_1100MV
  818. #define AM335_PMIC_VOLTAGE_1200MV TPS65217_DCDC_VOLTAGE_1200MV
  819. #define AM335_PMIC_VOLTAGE_1260MV TPS65217_DCDC_VOLTAGE_1275MV
  820. #define AM335_PMIC_VOLTAGE_1325MV 0x11
  821. //
  822. // Define TPS65217 PMIC registers.
  823. //
  824. #define TPS65217_POWER_PATH 0x01
  825. #define TPS65217_STATUS 0x0A
  826. #define TPS65217_PASSWORD 0x0B
  827. #define TPS65217_PGOOD 0x0C
  828. #define TPS65217_DEFDCDC2 0x0F
  829. #define TPS65217_DEFSLEW 0x11
  830. #define TPS65217_DEFLS1 0x14
  831. #define TPS65217_DEFLS2 0x15
  832. //
  833. // Define PMIC power path register bits.
  834. //
  835. #define TPS65217_POWER_PATH_USB_INPUT_CURRENT_LIMIT_MASK 0x03
  836. #define TPS65217_POWER_PATH_USB_INPUT_CURRENT_LIMIT_100MA 0x00
  837. #define TPS65217_POWER_PATH_USB_INPUT_CURRENT_LIMIT_500MA 0x01
  838. #define TPS65217_POWER_PATH_USB_INPUT_CURRENT_LIMIT_1300MA 0x02
  839. #define TPS65217_POWER_PATH_USB_INPUT_CURRENT_LIMIT_1800MA 0x03
  840. #define TPS65217_DCDC_VOLTAGE_1275MV 0x0F
  841. #define TPS65217_DCDC_VOLTAGE_1200MV 0x0C
  842. #define TPS65217_DCDC_VOLTAGE_1100MV 0x08
  843. #define TPS65217_DCDC_VOLTAGE_950MV 0x02
  844. #define TPS65217_PROTECTION_NONE 0
  845. #define TPS65217_PROTECTION_LEVEL_1 1
  846. #define TPS65217_PROTECTION_LEVEL_2 2
  847. #define TPS65217_PASSWORD_UNLOCK 0x7D
  848. #define TPS65217_DCDC_GO 0x80
  849. #define TPS65217_LDO_VOLTAGE_OUT_1_8 0x06
  850. #define TPS65217_LDO_VOLTAGE_OUT_3_3 0x1F
  851. #define TPS65217_LDO_MASK 0x1F
  852. //
  853. // Define DDR PHY control registers.
  854. //
  855. #define AM335_DDR_PHY_REGISTERS (AM335_SOC_CONTROL_REGISTERS + 0x2000)
  856. #define AM335_DDR_CMD0_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x01C)
  857. #define AM335_DDR_CMD0_SLAVE_FORCE_0 (AM335_DDR_PHY_REGISTERS + 0x020)
  858. #define AM335_DDR_CMD0_SLAVE_DELAY_0 (AM335_DDR_PHY_REGISTERS + 0x024)
  859. #define AM335_DDR_CMD0_LOCK_DIFF_0 (AM335_DDR_PHY_REGISTERS + 0x028)
  860. #define AM335_DDR_CMD0_INVERT_CLKOUT_0 (AM335_DDR_PHY_REGISTERS + 0x02C)
  861. #define AM335_DDR_CMD1_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x050)
  862. #define AM335_DDR_CMD1_SLAVE_FORCE_0 (AM335_DDR_PHY_REGISTERS + 0x054)
  863. #define AM335_DDR_CMD1_SLAVE_DELAY_0 (AM335_DDR_PHY_REGISTERS + 0x058)
  864. #define AM335_DDR_CMD1_LOCK_DIFF_0 (AM335_DDR_PHY_REGISTERS + 0x5C)
  865. #define AM335_DDR_CMD1_INVERT_CLKOUT_0 (AM335_DDR_PHY_REGISTERS + 0x060)
  866. #define AM335_DDR_CMD2_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x084)
  867. #define AM335_DDR_CMD2_SLAVE_FORCE_0 (AM335_DDR_PHY_REGISTERS + 0x088)
  868. #define AM335_DDR_CMD2_SLAVE_DELAY_0 (AM335_DDR_PHY_REGISTERS + 0x08C)
  869. #define AM335_DDR_CMD2_LOCK_DIFF_0 (AM335_DDR_PHY_REGISTERS + 0x090)
  870. #define AM335_DDR_CMD2_INVERT_CLKOUT_0 (AM335_DDR_PHY_REGISTERS + 0x094)
  871. #define AM335_DDR_DATA0_RD_DQS_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x0C8)
  872. #define AM335_DDR_DATA0_RD_DQS_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x0CC)
  873. #define AM335_DDR_DATA0_WR_DQS_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x0DC)
  874. #define AM335_DDR_DATA0_WR_DQS_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x0E0)
  875. #define AM335_DDR_DATA0_WRLVL_INIT_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x0F0)
  876. #define AM335_DDR_DATA0_WRLVL_INIT_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x0F4)
  877. #define AM335_DDR_DATA0_GATELVL_INIT_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x0FC)
  878. #define AM335_DDR_DATA0_GATELVL_INIT_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x100)
  879. #define AM335_DDR_DATA0_FIFO_WE_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x108)
  880. #define AM335_DDR_DATA0_FIFO_WE_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x10C)
  881. #define AM335_DDR_DATA0_WR_DATA_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x120)
  882. #define AM335_DDR_DATA0_WR_DATA_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x124)
  883. #define AM335_DDR_DATA0_USE_RANK0_DELAYS_0 (AM335_DDR_PHY_REGISTERS + 0x134)
  884. #define AM335_DDR_DATA0_LOCK_DIFF_0 (AM335_DDR_PHY_REGISTERS + 0x138)
  885. #define AM335_DDR_DATA1_RD_DQS_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x16C)
  886. #define AM335_DDR_DATA1_RD_DQS_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x170)
  887. #define AM335_DDR_DATA1_WR_DQS_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x180)
  888. #define AM335_DDR_DATA1_WR_DQS_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x184)
  889. #define AM335_DDR_DATA1_WRLVL_INIT_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x194)
  890. #define AM335_DDR_DATA1_WRLVL_INIT_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x198)
  891. #define AM335_DDR_DATA1_GATELVL_INIT_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x1A0)
  892. #define AM335_DDR_DATA1_GATELVL_INIT_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x1A4)
  893. #define AM335_DDR_DATA1_FIFO_WE_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x1AC)
  894. #define AM335_DDR_DATA1_FIFO_WE_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x1B0)
  895. #define AM335_DDR_DATA1_WR_DATA_SLAVE_RATIO_0 (AM335_DDR_PHY_REGISTERS + 0x1C4)
  896. #define AM335_DDR_DATA1_WR_DATA_SLAVE_RATIO_1 (AM335_DDR_PHY_REGISTERS + 0x1C8)
  897. #define AM335_DDR_DATA1_USE_RANK0_DELAYS_0 (AM335_DDR_PHY_REGISTERS + 0x1D8)
  898. #define AM335_DDR_DATA1_LOCK_DIFF_0 (AM335_DDR_PHY_REGISTERS + 0x1DC)
  899. //
  900. // Define DDR3 parameters. These are specific to the BeagleBone Black, and
  901. // there needs to be a different set for the BeagleBone (white).
  902. //
  903. #define AM335_DDR3_CMD0_SLAVE_RATIO_0 0x80
  904. #define AM335_DDR3_CMD0_INVERT_CLKOUT_0 0x0
  905. #define AM335_DDR3_CMD1_SLAVE_RATIO_0 0x80
  906. #define AM335_DDR3_CMD1_INVERT_CLKOUT_0 0x0
  907. #define AM335_DDR3_CMD2_SLAVE_RATIO_0 0x80
  908. #define AM335_DDR3_CMD2_INVERT_CLKOUT_0 0x0
  909. #define AM335_DDR3_DATA0_RD_DQS_SLAVE_RATIO_0 0x38
  910. #define AM335_DDR3_DATA0_WR_DQS_SLAVE_RATIO_0 0x44
  911. #define AM335_DDR3_DATA0_FIFO_WE_SLAVE_RATIO_0 0x94
  912. #define AM335_DDR3_DATA0_WR_DATA_SLAVE_RATIO_0 0x7D
  913. #define AM335_DDR3_DATA0_RD_DQS_SLAVE_RATIO_1 0x38
  914. #define AM335_DDR3_DATA0_WR_DQS_SLAVE_RATIO_1 0x44
  915. #define AM335_DDR3_DATA0_FIFO_WE_SLAVE_RATIO_1 0x94
  916. #define AM335_DDR3_DATA0_WR_DATA_SLAVE_RATIO_1 0x7D
  917. #define AM335_DDR3_CONTROL_DDR_CMD_IOCTRL_0 0x18B
  918. #define AM335_DDR3_CONTROL_DDR_CMD_IOCTRL_1 0x18B
  919. #define AM335_DDR3_CONTROL_DDR_CMD_IOCTRL_2 0x18B
  920. #define AM335_DDR3_CONTROL_DDR_DATA_IOCTRL_0 0x18B
  921. #define AM335_DDR3_CONTROL_DDR_DATA_IOCTRL_1 0x18B
  922. #define AM335_DDR3_CONTROL_DDR_IO_CTRL 0xEFFFFFFF
  923. #define AM335_DDR3_EMIF_DDR_PHY_CTRL_1 0x06
  924. #define AM335_DDR3_EMIF_DDR_PHY_CTRL_1_DY_PWRDN 0x00100000
  925. #define AM335_DDR3_EMIF_DDR_PHY_CTRL_1_SHDW 0x06
  926. #define AM335_DDR3_EMIF_DDR_PHY_CTRL_1_SHDW_DY_PWRDN 0x00100000
  927. #define AM335_DDR3_EMIF_DDR_PHY_CTRL_2 0x06
  928. #define AM335_DDR3_EMIF_SDRAM_TIM_1 0x0AAAD4DB
  929. #define AM335_DDR3_EMIF_SDRAM_TIM_1_SHDW 0x0AAAD4DB
  930. #define AM335_DDR3_EMIF_SDRAM_TIM_2 0x266B7FDA
  931. #define AM335_DDR3_EMIF_SDRAM_TIM_2_SHDW 0x266B7FDA
  932. #define AM335_DDR3_EMIF_SDRAM_TIM_3 0x501F867F
  933. #define AM335_DDR3_EMIF_SDRAM_TIM_3_SHDW 0x501F867F
  934. #define AM335_DDR3_EMIF_SDRAM_REF_CTRL_VAL1 0x00000C30
  935. #define AM335_DDR3_EMIF_SDRAM_REF_CTRL_SHDW_VAL1 0x00000C30
  936. #define AM335_DDR3_EMIF_ZQ_CONFIG_VAL 0x50074BE4
  937. //
  938. // Termination = 1 RZQ / 4
  939. // Dynamic ODT = 2 RZQ / 2
  940. // SDRAM Drive = 0 RZQ / 6
  941. // CWL = 0 CAS write latency of 5
  942. // CL = 2 CAS latency of 5
  943. // Row Size = 7 16 row bits
  944. // Page Size = 2 10 column bits
  945. //
  946. #define AM335_DDR3_EMIF_SDRAM_CONFIG 0x61C04BB2
  947. //
  948. // CM Wakeup MPU PLL clock mode register bits.
  949. //
  950. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_MPU_ENABLE_MN_BYPASS 0x00000004
  951. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_MPU_ENABLE 0x00000007
  952. //
  953. // CM Wakeup MPU PLL idle status register bits.
  954. //
  955. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_MPU_CLOCK 0x00000001
  956. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_MPU_MN_BYPASS 0x00000100
  957. //
  958. // CM Wakeup MPU PLL clock select register bits.
  959. //
  960. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_MPU_DIV_MASK 0x0000007F
  961. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_MPU_DIV_SHIFT 0
  962. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_MPU_MULT_MASK 0x0007FF00
  963. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_MPU_MULT_SHIFT 8
  964. //
  965. // CM Wakeup MPU PLL M2 divisor register bits.
  966. //
  967. #define AM335_CM_WAKEUP_DIV_M2_DPLL_MPU_CLOCK_OUT_MASK 0x0000001F
  968. //
  969. // CM Wakeup Display PLL clock mode register bits.
  970. //
  971. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_DISP_ENABLE_MN_BYPASS 0x00000004
  972. #define AM335_CM_WAKEUP_CLOCK_MODE_DPLL_DISP_ENABLE 0x0000007
  973. //
  974. // CM Wakeup DCO LDO Peripheral DPLL register bits.
  975. //
  976. #define AM335_CM_WAKEUP_DCO_LDO_PER_DPLL_GATE_CONTROL 0x00000100
  977. //
  978. // CM Wakeup Display PLL idle status register bits.
  979. //
  980. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_DISP_MN_BYPASS 0x00000100
  981. #define AM335_CM_WAKEUP_IDLE_STATUS_DPLL_DISP_CLOCK 0x00000001
  982. //
  983. // CM Wakeup Display PLL clock select register bits.
  984. //
  985. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DISP_DIV_MASK 0x0000007F
  986. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DISP_DIV_SHIFT 0
  987. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DISP_MULT_MASK 0x0007FF00
  988. #define AM335_CM_WAKEUP_CLOCK_SELECT_DPLL_DISP_MULT_SHIFT 8
  989. //
  990. // CM Wakeup Display PLL M2 divider register bits.
  991. //
  992. #define AM335_CM_WAKEUP_DIV_M2_DPLL_DISP_CLOCK_OUT_MASK 0x0000001F
  993. //
  994. // Hardcoded PLL values.
  995. //
  996. #define AM335_MPU_PLL_N 23
  997. #define AM335_MPU_PLL_M2 1
  998. #define AM335_CORE_PLL_M 1000
  999. #define AM335_CORE_PLL_N 23
  1000. #define AM335_CORE_PLL_HSDIVIDER_M4 10
  1001. #define AM335_CORE_PLL_HSDIVIDER_M5 8
  1002. #define AM335_CORE_PLL_HSDIVIDER_M6 4
  1003. #define AM335_PER_PLL_M 960
  1004. #define AM335_PER_PLL_N 23
  1005. #define AM335_PER_PLL_M2 5
  1006. #define AM335_DDR_PLL_M_DDR2 266
  1007. #define AM335_DDR_PLL_M_DDR3 303
  1008. #define AM335_DDR_PLL_N 23
  1009. #define AM335_DDR_PLL_M2 1
  1010. #define AM335_DISP_PLL_M 25
  1011. #define AM335_DISP_PLL_N 2
  1012. #define AM335_DISP_PLL_M2 1
  1013. //
  1014. // Define PRM wake up reset control register bits.
  1015. //
  1016. #define AM335_RM_WAKEUP_RESET_CONTROL_RESET_CORTEX_M3 (1 << 3)
  1017. //
  1018. // Define SOC Control M3 TXEV End of interrupt bits.
  1019. //
  1020. #define AM335_CONTROL_M3_TXEV_EOI_ENABLE 0x00000000
  1021. #define AM335_CONTROL_M3_TXEV_EOI 0x00000001
  1022. //
  1023. // Define the size of the entire USB subsystem region.
  1024. //
  1025. #define AM335_USB_REGION_SIZE 0x8000
  1026. //
  1027. // Define register offsets within the USB subsystem.
  1028. //
  1029. #define AM3_USB_USBSS_OFFSET 0x0000
  1030. #define AM3_USB_USB0_OFFSET 0x1000
  1031. #define AM3_USB_USB0_PHY_OFFSET 0x1300
  1032. #define AM3_USB_USB0_CORE_OFFSET 0x1400
  1033. #define AM3_USB_USB1_OFFSET 0x1800
  1034. #define AM3_USB_USB1_PHY_OFFSET 0x1B00
  1035. #define AM3_USB_USB1_CORE_OFFSET 0x1C00
  1036. #define AM3_USB_CPPI_DMA_OFFSET 0x2000
  1037. #define AM3_USB_CPPI_DMA_SCHEDULER_OFFSET 0x3000
  1038. //
  1039. // USBSS sysconfig register bits
  1040. //
  1041. #define AM335_USBSS_SYSCONFIG_SOFT_RESET 0x00000001
  1042. //
  1043. // Define EMIF power control registers.
  1044. //
  1045. #define AM335_EMIF_POWER_CONTROL_SELF_REFRESH_64 (0x3 << 4)
  1046. #define AM335_EMIF_POWER_CONTROL_SELF_REFRESH_8192 (0xA << 4)
  1047. #define AM335_EMIF_POWER_CONTROL_CLOCK_STOP (0x1 << 8)
  1048. #define AM335_EMIF_POWER_CONTROL_SELF_REFRESH (0x2 << 8)
  1049. #define AM335_EMIF_POWER_CONTROL_POWER_DOWN (0x4 << 8)
  1050. //
  1051. // LCD controller registers.
  1052. //
  1053. #define AM335_LCD_CONTROL 0x04
  1054. #define AM335_LCD_STATUS 0x08
  1055. #define AM335_LCD_LIDD_CONTROL 0x0C
  1056. #define AM335_LCD_LIDD_CS0_CONF 0x10
  1057. #define AM335_LCD_LIDD_CS0_ADDR 0x14
  1058. #define AM335_LCD_LIDD_CS0_DATA 0x18
  1059. #define AM335_LCD_LIDD_CS1_CONF 0x1C
  1060. #define AM335_LCD_LIDD_CS1_ADDR 0x20
  1061. #define AM335_LCD_LIDD_CS1_DATA 0x24
  1062. #define AM335_LCD_RASTER_CONTROL 0x28
  1063. #define AM335_LCD_RASTER_TIMING_0 0x2C
  1064. #define AM335_LCD_RASTER_TIMING_1 0x30
  1065. #define AM335_LCD_RASTER_TIMING_2 0x34
  1066. #define AM335_LCD_SUBPANEL 0x38
  1067. #define AM335_LCD_SUBPANEL2 0x3C
  1068. #define AM335_LCD_DMA_CONTROL 0x40
  1069. #define AM335_LCD_FB0_BASE 0x44
  1070. #define AM335_LCD_FB0_CEILING 0x48
  1071. #define AM335_LCD_FB1_BASE 0x4C
  1072. #define AM335_LCD_FB1_CEILING 0x50
  1073. #define AM335_LCD_SYSTEM_CONFIG 0x54
  1074. #define AM335_LCD_IRQSTATUS_RAW 0x58
  1075. #define AM335_LCD_IRQSTATUS 0x5C
  1076. #define AM335_LCD_IRQENABLE_SET 0x60
  1077. #define AM335_LCD_IRQENABLE_CLEAR 0x64
  1078. #define AM335_LCD_IRQEOI_VECTOR 0x68
  1079. #define AM335_LCD_CLOCK_ENABLE 0x6C
  1080. #define AM335_LCD_CLOCK_RESET 0x70
  1081. //
  1082. // LCD clock enable register bits.
  1083. //
  1084. #define AM335_LCD_CLOCK_ENABLE_CORE 0x00000001
  1085. #define AM335_LCD_CLOCK_ENABLE_LIDD 0x00000002
  1086. #define AM335_LCD_CLOCK_ENABLE_DMA 0x00000004
  1087. //
  1088. // LCD raster control register bits.
  1089. //
  1090. #define AM335_LCD_RASTER_CONTROL_ENABLE 0x00000001
  1091. #define AM335_LCD_RASTER_CONTROL_TFT 0x00000080
  1092. #define AM335_LCD_RASTER_CONTROL_FIFO_DMA_DELAY_MASK 0x000FF000
  1093. #define AM335_LCD_RASTER_CONTROL_FIFO_DMA_DELAY_SHIFT 12
  1094. #define AM335_LCD_RASTER_CONTROL_PALETTE_LOAD_MASK 0x00300000
  1095. #define AM335_LCD_RASTER_CONTROL_PALETTE_LOAD_DATA_ONLY 0x00200000
  1096. #define AM335_LCD_RASTER_CONTROL_TFT24 0x02000000
  1097. #define AM335_LCD_RASTER_CONTROL_TFT24_UNPACKED 0x04000000
  1098. //
  1099. // LCD control register bits.
  1100. //
  1101. #define AM335_LCD_CONTROL_RASTER_MODE 0x00000001
  1102. #define AM335_LCD_CONTROL_DIVISOR_SHIFT 8
  1103. //
  1104. // LCD DMA control register bits.
  1105. //
  1106. #define AM335_LCD_DMA_BURST_SIZE_16 (0x4 << 4)
  1107. #define AM335_LCD_DMA_FIFO_THRESHOLD_8 (0x0 << 8)
  1108. //
  1109. // General LCD timing definitions.
  1110. //
  1111. #define AM335_LCD_RASTER_TIMING_PORCH_LOW_MASK 0xFF
  1112. #define AM335_LCD_RASTER_TIMING_PORCH_HIGH_SHIFT 8
  1113. #define AM335_LCD_RASTER_TIMING_PORCH_HIGH_MASK 0x3
  1114. #define AM335_LCD_RASTER_TIMING_HSYNC_HIGH_SHIFT 6
  1115. #define AM335_LCD_RASTER_TIMING_HSYNC_HIGH_MASK 0xF
  1116. //
  1117. // LCD timing 0 register bits.
  1118. //
  1119. #define AM335_LCD_RASTER_TIMING_0_HSYNC_SHIFT 10
  1120. #define AM335_LCD_RASTER_TIMING_0_HORIZONTAL_FRONT_PORCH_SHIFT 16
  1121. #define AM335_LCD_RASTER_TIMING_0_HORIZONTAL_BACK_PORCH_SHIFT 24
  1122. #define AM335_LCD_RASTER_TIMING_0_HSYNC_MASK 0x3F
  1123. //
  1124. // LCD timing 1 register bits.
  1125. //
  1126. #define AM335_LCD_RASTER_TIMING_1_VSYNC_SHIFT 10
  1127. #define AM335_LCD_RASTER_TIMING_1_VERTICAL_FRONT_PORCH_SHIFT 16
  1128. #define AM335_LCD_RASTER_TIMING_1_VERTICAL_BACK_PORCH_SHIFT 24
  1129. //
  1130. // LCD Raster timing 2 register bits.
  1131. //
  1132. #define AM335_LCD_RASTER_TIMING_2_INVERT_VERTICAL_SYNC 0x00100000
  1133. #define AM335_LCD_RASTER_TIMING_2_INVERT_HORIZONTAL_SYNC 0x00200000
  1134. #define AM335_LCD_RASTER_TIMING_2_SYNC_CONTROL 0x02000000
  1135. #define AM335_LCD_RASTER_TIMING_2_AC_BIAS_FREQUENCY_SHIFT 8
  1136. #define AM335_LCD_RASTER_TIMING_2_LINES_PER_PANEL_BIT_10_SHIFT 26
  1137. #define AM335_LCD_RASTER_TIMING_2_LINES_PER_PANEL_BIT_10 0x04000000
  1138. #define AM335_LCD_RASTER_TIMING_2_HORIZONTAL_FRONT_PORCH_HIGH_SHIFT 0
  1139. #define AM335_LCD_RASTER_TIMING_2_HORIZONTAL_BACK_PORCH_HIGH_SHIFT 4
  1140. #define AM335_LCD_RASTER_TIMING_2_HORIZONTAL_SYNC_HIGH_SHIFT 27
  1141. //
  1142. // LCD system configuration register bits.
  1143. //
  1144. #define AM335_LCD_SYSTEM_CONFIG_STANDBY_SMART (0x2 << 4)
  1145. #define AM335_LCD_SYSTEM_CONFIG_IDLE_SMART (0x2 << 2)
  1146. //
  1147. // LCD clock reset register bits.
  1148. //
  1149. #define AM335_LCD_CLOCK_RESET_MAIN 0x00000008
  1150. //
  1151. // Define Ethernet PORT register offsets.
  1152. //
  1153. #define AM335_CPSW_PORT_REGISTERS 0x4A100100
  1154. #define AM335_CPSW_PORT1_SOURCE_ADDRESS_LOW 0x120
  1155. #define AM335_CPSW_PORT1_SOURCE_ADDRESS_HIGH 0x124
  1156. #define AM335_CPSW_PORT2_SOURCE_ADDRESS_LOW 0x220
  1157. #define AM335_CPSW_PORT2_SOURCE_ADDRESS_HIGH 0x224
  1158. //
  1159. // Define RTC control register bits.
  1160. //
  1161. #define AM335_RTC_CONTROL_RUN 0x00000001
  1162. #define AM335_RTC_CONTROL_ROUND_30S 0x00000002
  1163. #define AM335_RTC_CONTROL_AUTO_COMPENSATION 0x00000004
  1164. #define AM335_RTC_CONTROL_12_HOUR_MODE 0x00000008
  1165. #define AM335_RTC_CONTROL_TEST_MODE 0x00000010
  1166. #define AM335_RTC_CONTROL_SET_32_MOUNTER 0x00000020
  1167. #define AM335_RTC_CONTROL_RTC_DISABLE 0x00000040
  1168. //
  1169. // Define RTC status register bits.
  1170. //
  1171. #define AM335_RTC_STATUS_BUSY 0x00000001
  1172. #define AM335_RTC_STATUS_RUN 0x00000002
  1173. #define AM335_RTC_STATUS_SECOND_EVENT 0x00000004
  1174. #define AM335_RTC_STATUS_MINUTE_EVENT 0x00000008
  1175. #define AM335_RTC_STATUS_HOUR_EVENT 0x00000010
  1176. #define AM335_RTC_STATUS_DAY_EVENT 0x00000020
  1177. #define AM335_RTC_STATUS_ALARM 0x00000040
  1178. #define AM335_RTC_STATUS_ALARM2 0x00000080
  1179. //
  1180. // Define RTC interrupt enable bits.
  1181. //
  1182. #define AM335_RTC_INTERRUPT_EVERY_SECOND 0x0
  1183. #define AM335_RTC_INTERRUPT_EVERY_MINUTE 0x1
  1184. #define AM335_RTC_INTERRUPT_EVERY_HOUR 0x2
  1185. #define AM335_RTC_INTERRUPT_EVERY_DAY 0x3
  1186. #define AM335_RTC_INTERRUPT_EVERY_MASK 0x3
  1187. #define AM335_RTC_INTERRUPT_TIMER 0x00000004
  1188. #define AM335_RTC_INTERRUPT_ALARM 0x00000008
  1189. #define AM335_RTC_INTERRUPT_ALARM2 0x00000010
  1190. #define AM335_RTC_HOURS_PM 0x80
  1191. //
  1192. // Define RTC system configuration register bits.
  1193. //
  1194. #define AM335_RTC_SYS_CONFIG_IDLE_MODE_FORCE_IDLE 0x0
  1195. #define AM335_RTC_SYS_CONFIG_IDLE_MODE_NO_IDLE 0x1
  1196. #define AM335_RTC_SYS_CONFIG_IDLE_MODE_SMART 0x2
  1197. #define AM335_RTC_SYS_CONFIG_IDLE_MODE_SMART_WAKEUP 0x3
  1198. //
  1199. // Define the kick values to write to enable write access to the RTC.
  1200. //
  1201. #define AM335_RTC_KICK0_KEY 0x83E70B13
  1202. #define AM335_RTC_KICK1_KEY 0x95A4F1E0
  1203. //
  1204. // Define RTC oscillator register bits.
  1205. //
  1206. #define AM335_RTC_OSCILLATOR_SW1 0x00000001
  1207. #define AM335_RTC_OSCILLATOR_SW2 0x00000002
  1208. #define AM335_RTC_OSCILLATOR_EXTERNAL_RESISTOR 0x00000004
  1209. #define AM335_RTC_OSCILLATOR_SOURCE_EXTERNAL 0x00000008
  1210. #define AM335_RTC_OSCILLATOR_DISABLE_OSCILLATOR 0x00000010
  1211. #define AM335_RTC_OSCILLATOR_ENABLE 0x00000040
  1212. #define AM335_WATCHDOG_FREQUENCY 32768
  1213. //
  1214. // Define the number of 32kHz clock ticks per interrupt. A value of 512 creates
  1215. // a timer rate of 15.625ms, or about 64 interrupts per second.
  1216. //
  1217. #define BEAGLEBONE_TIMER_TICK_COUNT 512
  1218. //
  1219. // Idle bits.
  1220. //
  1221. #define AM335_TIMER_IDLEMODE_NOIDLE 0x00000004
  1222. #define AM335_TIMER_IDLEMODE_SMART 0x00000008
  1223. //
  1224. // Mode bits.
  1225. //
  1226. #define AM335_TIMER_STARTED 0x00000001
  1227. #define AM335_TIMER_OVERFLOW_TRIGGER 0x00000400
  1228. #define AM335_TIMER_OVERFLOW_AND_MATCH_TRIGGER 0x00000800
  1229. #define AM335_TIMER_COMPARE_ENABLED 0x00000040
  1230. #define AM335_TIMER_AUTORELOAD 0x00000002
  1231. //
  1232. // Interrupt enable bits.
  1233. //
  1234. #define AM335_TIMER_MATCH_INTERRUPT 0x00000001
  1235. #define AM335_TIMER_OVERFLOW_INTERRUPT 0x00000002
  1236. #define AM335_TIMER_INTERRUPT_MASK 0x7
  1237. //
  1238. // Define the two step sequence needed for disabling or enabling the watchdog
  1239. // timer.
  1240. //
  1241. #define AM335_WATCHDOG_DISABLE1 0x0000AAAA
  1242. #define AM335_WATCHDOG_DISABLE2 0x00005555
  1243. #define AM335_WATCHDOG_ENABLE1 0x0000BBBB
  1244. #define AM335_WATCHDOG_ENABLE2 0x00004444
  1245. #define AM335_WATCHDOG_INTERRUPT_OVERFLOW 0x00000001
  1246. #define AM335_WATCHDOG_INTERRUPT_DELAY 0x00000002
  1247. //
  1248. // I2C system status register bits.
  1249. //
  1250. #define AM335_I2C_SYSTEM_STATUS_RESET_DONE 0x00000001
  1251. //
  1252. // Define the I2C slave address of the TPS65217 PMIC.
  1253. //
  1254. #define AM335_TPS65217_I2C_ADDRESS 0x24
  1255. //
  1256. // Define I2C control register bits.
  1257. //
  1258. #define AM335_I2C_CONTROL_START (1 << 0)
  1259. #define AM335_I2C_CONTROL_STOP (1 << 1)
  1260. #define AM335_I2C_CONTROL_EXPAND_OWN_ADDRESS_3 (1 << 4)
  1261. #define AM335_I2C_CONTROL_EXPAND_OWN_ADDRESS_2 (1 << 5)
  1262. #define AM335_I2C_CONTROL_EXPAND_OWN_ADDRESS_1 (1 << 6)
  1263. #define AM335_I2C_CONTROL_EXPAND_OWN_ADDRESS_0 (1 << 7)
  1264. #define AM335_I2C_CONTROL_EXPAND_SLAVE_ADDRESS (1 << 8)
  1265. #define AM335_I2C_CONTROL_TRANSMIT (1 << 9)
  1266. #define AM335_I2C_CONTROL_MASTER (1 << 10)
  1267. #define AM335_I2C_CONTROL_START_BYTE_MODE (1 << 11)
  1268. #define AM335_I2C_CONTROL_ENABLE (1 << 15)
  1269. //
  1270. // I2C system control register bits.
  1271. //
  1272. #define AM335_I2C_SYSTEM_CONTROL_AUTO_IDLE 0x00000001
  1273. #define AM335_I2C_SYSTEM_CONTROL_SOFT_RESET 0x00000002
  1274. //
  1275. // Define I2C buffer (FIFO) control bits.
  1276. //
  1277. #define AM335_I2C_BUFFER_TX_THRESHOLD_SHIFT 0
  1278. #define AM335_I2C_BUFFER_TX_FIFO_CLEAR (1 << 6)
  1279. #define AM335_I2C_BUFFER_TX_DMA_ENABLE (1 << 7)
  1280. #define AM335_I2C_BUFFER_RX_THRESHOLD_SHIFT 8
  1281. #define AM335_I2C_BUFFER_RX_FIFO_CLEAR (1 << 14)
  1282. #define AM335_I2C_BUFFER_RX_DMA_ENABLE (1 << 15)
  1283. //
  1284. // Define buffer status register bits.
  1285. //
  1286. #define AM335_I2C_BUFFER_STATUS_TX_MASK (0x3F << 0)
  1287. #define AM335_I2C_BUFFER_STATUS_TX_SHIFT 0
  1288. #define AM335_I2C_BUFFER_STATUS_RX_MASK (0x3F << 8)
  1289. #define AM335_I2C_BUFFER_STATUS_RX_SHIFT 8
  1290. #define AM335_I2C_BUFFER_STATUS_DEPTH_8 (0x0 << 14)
  1291. #define AM335_I2C_BUFFER_STATUS_DEPTH_16 (0x1 << 14)
  1292. #define AM335_I2C_BUFFER_STATUS_DEPTH_32 (0x2 << 14)
  1293. #define AM335_I2C_BUFFER_STATUS_DEPTH_64 (0x3 << 14)
  1294. #define AM335_I2C_BUFFER_STATUS_DEPTH_MASK (0x3 << 14)
  1295. #define AM335_I2C_MAX_FIFO_DEPTH 64
  1296. //
  1297. // Define I2C interrupt status/enable register bits.
  1298. //
  1299. #define AM335_I2C_INTERRUPT_ARBITRATION_LOST 0x00000001
  1300. #define AM335_I2C_INTERRUPT_NACK 0x00000002
  1301. #define AM335_I2C_INTERRUPT_ACCESS_READY 0x00000004
  1302. #define AM335_I2C_INTERRUPT_RX_READY 0x00000008
  1303. #define AM335_I2C_INTERRUPT_TX_READY 0x00000010
  1304. #define AM335_I2C_INTERRUPT_GENERAL_CALL 0x00000020
  1305. #define AM335_I2C_INTERRUPT_START 0x00000040
  1306. #define AM335_I2C_INTERRUPT_ACCESS_ERROR 0x00000080
  1307. #define AM335_I2C_INTERRUPT_BUS_FREE 0x00000100
  1308. #define AM335_I2C_INTERRUPT_ADDRESS_RECOGNIZED 0x00000200
  1309. #define AM335_I2C_INTERRUPT_TX_UNDERFLOW 0x00000400
  1310. #define AM335_I2C_INTERRUPT_RX_OVERFLOW 0x00000800
  1311. #define AM335_I2C_INTERRUPT_BUS_BUSY 0x00001000
  1312. #define AM335_I2C_INTERRUPT_RX_DRAIN 0x00002000
  1313. #define AM335_I2C_INTERRUPT_TX_DRAIN 0x00004000
  1314. #define AM335_I2C_INTERRUPT_ERROR_MASK \
  1315. (AM335_I2C_INTERRUPT_ACCESS_ERROR | AM335_I2C_INTERRUPT_RX_OVERFLOW)
  1316. #define AM335_I2C_INTERRUPT_DEFAULT_MASK \
  1317. (AM335_I2C_INTERRUPT_NACK | AM335_I2C_INTERRUPT_ACCESS_ERROR)
  1318. #define AM335_I2C_INTERRUPT_STATUS_MASK 0x000007FF
  1319. //
  1320. // Define internal I2C parameters (recommended convention).
  1321. //
  1322. #define AM335_I2C_SYSTEM_CLOCK_SPEED 48000000
  1323. #define AM335_I2C_INTERNAL_CLOCK_SPEED 12000000
  1324. #define AM335_I2C_OUTPUT_CLOCK_SPEED 100000
  1325. //
  1326. // ------------------------------------------------------ Data Type Definitions
  1327. //
  1328. //
  1329. // Define the DM timer register offsets.
  1330. //
  1331. typedef enum _AM335_DM_TIMER_REGISTER {
  1332. Am335TimerId = 0x00,
  1333. Am335TimerOcpConfig = 0x10,
  1334. Am335TimerEndOfInterrupt = 0x14,
  1335. Am335TimerRawInterruptStatus = 0x24,
  1336. Am335TimerInterruptStatus = 0x28,
  1337. Am335TimerInterruptEnableSet = 0x2C,
  1338. Am335TimerInterruptEnableClear = 0x30,
  1339. Am335TimerInterruptWakeEnable = 0x34,
  1340. Am335TimerControl = 0x38,
  1341. Am335TimerCount = 0x3C,
  1342. Am335TimerLoad = 0x40,
  1343. Am335TimerTrigger = 0x44,
  1344. Am335TimerWritePosting = 0x48,
  1345. Am335TimerMatch = 0x4C,
  1346. Am335TimerCapture1 = 0x50,
  1347. Am335TimerSynchronousInterfaceControl = 0x54,
  1348. Am335TimerCapture2 = 0x58
  1349. } AM335_DM_TIMER_REGISTER, *PAM335_DM_TIMER_REGISTER;
  1350. //
  1351. // Define INTC register offsets.
  1352. //
  1353. typedef enum _AM335_INTC_REGISTER {
  1354. Am335IntcRevision = 0x000,
  1355. Am335IntcSystemConfig = 0x010,
  1356. Am335IntcSystemStatus = 0x014,
  1357. Am335IntcSortedIrq = 0x040,
  1358. Am335IntcSortedFiq = 0x044,
  1359. Am335IntcControl = 0x048,
  1360. Am335IntcProtection = 0x04C,
  1361. Am335IntcIdle = 0x050,
  1362. Am335IntcIrqPriority = 0x060,
  1363. Am335IntcFiqPriority = 0x064,
  1364. Am335IntcThreshold = 0x068,
  1365. Am335IntcMask = 0x084,
  1366. Am335IntcMaskClear = 0x088,
  1367. Am335IntcMaskSet = 0x08C,
  1368. Am335IntcLine = 0x100,
  1369. } AM335_INTC_REGISTER, *PAM335_INTC_REGISTER;
  1370. //
  1371. // Define the watchdog timer registers, offsets in bytes.
  1372. //
  1373. typedef enum _AM335_WATCHDOG_REGISTER {
  1374. Am335WatchdogRevision = 0x00,
  1375. Am335WatchdogInterfaceConfiguration = 0x10,
  1376. Am335WatchdogInterfaceStatus = 0x14,
  1377. Am335WatchdogInterruptStatus = 0x18,
  1378. Am335WatchdogInterruptEnable = 0x1C,
  1379. Am335WatchdogWakeEventEnable = 0x20,
  1380. Am335WatchdogPrescaler = 0x24,
  1381. Am335WatchdogCurrentCount = 0x28,
  1382. Am335WatchdogLoadCount = 0x2C,
  1383. Am335WatchdogTrigger = 0x30,
  1384. Am335WatchdogWritePostStatus = 0x34,
  1385. Am335WatchdogDelay = 0x44,
  1386. Am335WatchdogStartStop = 0x48,
  1387. Am335WatchdogRawInterruptStatus = 0x54,
  1388. Am335WatchdogInterruptEnableSet = 0x5C,
  1389. Am335WatchdogInterruptEnableClear = 0x60,
  1390. Am335WatchdogWakeEnable = 0x64
  1391. } AM335_WATCHDOG_REGISTER, *PAM335_WATCHDOG_REGISTER;
  1392. typedef enum _AM335_RTC_REGISTER {
  1393. Am335RtcSeconds = 0x00,
  1394. Am335RtcMinutes = 0x04,
  1395. Am335RtcHours = 0x08,
  1396. Am335RtcDays = 0x0C,
  1397. Am335RtcMonths = 0x10,
  1398. Am335RtcYears = 0x14,
  1399. Am335RtcWeekdays = 0x18,
  1400. Am335RtcAlarmSeconds = 0x20,
  1401. Am335RtcAlarmMinutes = 0x24,
  1402. Am335RtcAlarmHours = 0x28,
  1403. Am335RtcAlarmDays = 0x2C,
  1404. Am335RtcAlarmMonths = 0x30,
  1405. Am335RtcAlarmYears = 0x34,
  1406. Am335RtcControl = 0x40,
  1407. Am335RtcStatus = 0x44,
  1408. Am335RtcInterruptEnable = 0x48,
  1409. Am335RtcCompensationLow = 0x4C,
  1410. Am335RtcCompensationHigh = 0x50,
  1411. Am335RtcOscillator = 0x54,
  1412. Am335RtcScratch0 = 0x60,
  1413. Am335RtcScratch1 = 0x64,
  1414. Am335RtcScratch2 = 0x68,
  1415. Am335RtcKick0 = 0x6C,
  1416. Am335RtcKick1 = 0x70,
  1417. Am335RtcRevision = 0x74,
  1418. Am335RtcSysConfig = 0x78,
  1419. Am335RtcWakeEnable = 0x7C,
  1420. Am335RtcAlarm2Seconds = 0x80,
  1421. Am335RtcAlarm2Minutes = 0x84,
  1422. Am335RtcAlarm2Hours = 0x88,
  1423. Am335RtcAlarm2Days = 0x8C,
  1424. Am335RtcAlarm2Months = 0x90,
  1425. Am335RtcAlarm2Years = 0x94,
  1426. Am335RtcPmic = 0x98,
  1427. Am335RtcDebounce = 0x9C
  1428. } AM335_RTC_REGISTER, *PAM335_RTC_REGISTER;
  1429. typedef enum _AM335_I2C_REGISTER {
  1430. Am3I2cRevisionLow = 0x00,
  1431. Am3I2cRevisionHigh = 0x04,
  1432. Am3I2cSysControl = 0x10,
  1433. Am3I2cInterruptStatusRaw = 0x24,
  1434. Am3I2cInterruptStatus = 0x28,
  1435. Am3I2cInterruptEnableSet = 0x2C,
  1436. Am3I2cInterruptEnableClear = 0x30,
  1437. Am3I2cWakeEnable = 0x34,
  1438. Am3I2cDmaRxEnableSet = 0x38,
  1439. Am3I2cDmaTxEnableSet = 0x3C,
  1440. Am3I2cDmaRxEnableClear = 0x40,
  1441. Am3I2cDmaTxEnableClear = 0x44,
  1442. Am3I2cDmaRxWakeEnable = 0x48,
  1443. Am3I2cDmaTxWakeEnable = 0x4C,
  1444. Am3I2cSysStatus = 0x90,
  1445. Am3I2cBuffer = 0x94,
  1446. Am3I2cCount = 0x98,
  1447. Am3I2cData = 0x9C,
  1448. Am3I2cControl = 0xA4,
  1449. Am3I2cOwnAddress = 0xA8,
  1450. Am3I2cSlaveAddress = 0xAC,
  1451. Am3I2cPrescale = 0xB0,
  1452. Am3I2cSclLowTime = 0xB4,
  1453. Am3I2cSclHighTime = 0xB8,
  1454. Am3I2cSysTest = 0xBC,
  1455. Am3I2cBufferStatus = 0xC0,
  1456. Am3I2cOwnAddress1 = 0xC4,
  1457. Am3I2cOwnAddress2 = 0xC8,
  1458. Am3I2cOwnAddress3 = 0xCC,
  1459. Am3I2cActiveOwnAddress = 0xD0,
  1460. Am3I2cClockBlock = 0xD4,
  1461. } AM335_I2C_REGISTER, *PAM335_I2C_REGISTER;
  1462. //
  1463. // -------------------------------------------------------------------- Globals
  1464. //
  1465. //
  1466. // -------------------------------------------------------- Function Prototypes
  1467. //