soc_regs.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. /*
  2. * Copyright (c) 2019 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file register address define for Actions SoC
  8. */
  9. #ifndef _ACTIONS_SOC_REGS_H_
  10. #define _ACTIONS_SOC_REGS_H_
  11. #include "brom_interface.h"
  12. #define RMU_REG_BASE 0x40000000
  13. #define CMUD_REG_BASE 0x40001000
  14. #define CMUA_REG_BASE 0x40000100
  15. #define PMU_REG_BASE 0x40004000
  16. #define GPIO_REG_BASE 0x40068000
  17. #define DMA_REG_BASE 0x4001c000
  18. #define SDMA_REG_BASE 0x40078000
  19. #define SDMA0_REG_BASE 0x40078100
  20. #define SDMA1_REG_BASE 0x40078200
  21. #define SDMA2_REG_BASE 0x40078300
  22. #define SDMA3_REG_BASE 0x40078400
  23. #define SDMA4_REG_BASE 0x40078500
  24. #define SDMA_LINE0_REG_BASE 0x40078C00
  25. #define SDMA_LINE1_REG_BASE 0x40078C20
  26. #define SDMA_LINE2_REG_BASE 0x40078C40
  27. #define SDMA_LINE3_REG_BASE 0x40078C60
  28. #define SDMA_LINE4_REG_BASE 0x40078C80
  29. #define UART0_REG_BASE 0x40038000
  30. #define UART1_REG_BASE 0x4003C000
  31. #define UART2_REG_BASE 0x40040000
  32. #define MEM_REG_BASE 0x40010000
  33. #define SE_REG_BASE 0x40020000
  34. #define I2C0_REG_BASE 0x40044000
  35. #define I2C1_REG_BASE 0x40048000
  36. #define I2C2_REG_BASE 0x4004c000
  37. #define I2C3_REG_BASE 0x40074000
  38. #define SPI0_REG_BASE 0x40028000
  39. #define SPI1_REG_BASE 0x4002c000
  40. #define SPI2_REG_BASE 0x40030000
  41. #define SPI3_REG_BASE 0x40034000
  42. #define I2CMT0_REG_BASE 0x40088000
  43. #define I2CMT1_REG_BASE 0x4008c000
  44. #define WIC_BASE 0x40090000
  45. #define PPI_BASE 0x40090000
  46. #define DE_REG_BASE 0x4006C000
  47. #define LCDC_REG_BASE 0x40064000
  48. #define GPU_REG_BASE 0x40070000
  49. #define SPIMT0_REG_BASE 0x40080000
  50. #define SPIMT1_REG_BASE 0x40084000
  51. #define JPEG_REG_BASE 0x40094000
  52. #define BTC_REG_BASE 0x01100000
  53. #define SD0_REG_BASE 0x40054000
  54. #define SD1_REG_BASE 0x40058000
  55. #define PWM_REG_BASE 0x40060000
  56. #define PWM_CLK0_BASE 0x40001068
  57. #define HOSC_CTL (CMUA_REG_BASE + 0x00)
  58. #define HOSCLDO_CTL (CMUA_REG_BASE + 0x04)
  59. #define CK64M_CTL (CMUA_REG_BASE + 0x08)
  60. #define LOSC_CTL (CMUA_REG_BASE + 0x10)
  61. #define RC4M_CTL (CMUA_REG_BASE + 0x14)
  62. #define RC192M_CTL (CMUA_REG_BASE + 0x18)
  63. #define AVDDLDO_CTL (CMUA_REG_BASE + 0x1c)
  64. #define COREPLL_CTL (CMUA_REG_BASE + 0x20)
  65. #define RC32K_CTL (CMUA_REG_BASE + 0x64)
  66. #define RC32K_CAL (CMUA_REG_BASE + 0x68)
  67. #define RC32K_COUNT (CMUA_REG_BASE + 0x6C)
  68. /*fix build err, dsp pll not exist*/
  69. #define SPLL_CTL (CMUA_REG_BASE + 0x24)
  70. #define DISPLAYPLL_CTL (CMUA_REG_BASE + 0x30)
  71. #define AUDIOLDO_CTL (CMUA_REG_BASE + 0x1C)
  72. #define AUDIO_PLL0_CTL (CMUA_REG_BASE + 0x28)
  73. #define AUDIO_PLL1_CTL (CMUA_REG_BASE + 0x2C)
  74. #define HOSCOK_CTL (CMUA_REG_BASE + 0x70)
  75. #define HGLFCLK_CTL (CMUA_REG_BASE + 0x74)
  76. #define CMU_SYSCLK (CMUD_REG_BASE+0x0000)
  77. #define CMU_DEVCLKEN0 (CMUD_REG_BASE+0x0004)
  78. #define CMU_DEVCLKEN1 (CMUD_REG_BASE+0x0008)
  79. #define CMU_SD0CLK (CMUD_REG_BASE+0x0010)
  80. #define CMU_SD1CLK (CMUD_REG_BASE+0x0014)
  81. #define CMU_OTFDCLK (CMUD_REG_BASE+0x0018)
  82. #define CMU_JPEGCLK (CMUD_REG_BASE+0x001C)
  83. #define CMU_SPI0CLK (CMUD_REG_BASE+0x0020)
  84. #define CMU_SPI1CLK (CMUD_REG_BASE+0x0024)
  85. #define CMU_SPI2CLK (CMUD_REG_BASE+0x0028)
  86. #define CMU_SPI3CLK (CMUD_REG_BASE+0x002C)
  87. #define CMU_DECLK (CMUD_REG_BASE+0x0030)
  88. #define CMU_LCDCLK (CMUD_REG_BASE+0x0034)
  89. #define CMU_GPUCLK (CMUD_REG_BASE+0x0038)
  90. #define CMU_SECCLK (CMUD_REG_BASE+0x003C)
  91. #define CMU_TIMER0CLK (CMUD_REG_BASE+0x0040)
  92. #define CMU_TIMER1CLK (CMUD_REG_BASE+0x0044)
  93. #define CMU_TIMER2CLK (CMUD_REG_BASE+0x0048)
  94. #define CMU_TIMER3CLK (CMUD_REG_BASE+0x004c)
  95. #define CMU_TIMER4CLK (CMUD_REG_BASE+0x0050)
  96. #define CMU_TIMER5CLK (CMUD_REG_BASE+0x0054)
  97. #define CMU_PWM0CLK (CMUD_REG_BASE+0x0068)
  98. #define CMU_PWM1CLK (CMUD_REG_BASE+0x006C)
  99. #define CMU_PWM2CLK (CMUD_REG_BASE+0x0070)
  100. #define CMU_PWM3CLK (CMUD_REG_BASE+0x0074)
  101. #define CMU_LRADCCLK (CMUD_REG_BASE+0x0078)
  102. #define CMU_I2C0CLK (CMUD_REG_BASE+0x0080)
  103. #define CMU_I2C1CLK (CMUD_REG_BASE+0x0084)
  104. #define CMU_I2C2CLK (CMUD_REG_BASE+0x0088)
  105. #define CMU_I2C3CLK (CMUD_REG_BASE+0x008C)
  106. #define CMU_DSPCLK (CMUD_REG_BASE+0x0090)
  107. #define CMU_DACCLK (CMUD_REG_BASE+0x0098)
  108. #define CMU_ADCCLK (CMUD_REG_BASE+0x009c)
  109. #define CMU_I2STXCLK (CMUD_REG_BASE+0x00A0)
  110. #define CMU_I2SRXCLK (CMUD_REG_BASE+0x00A4)
  111. #define CMU_MEMCLKEN0 (CMUD_REG_BASE+0x00B0)
  112. #define CMU_MEMCLKEN1 (CMUD_REG_BASE+0x00B4)
  113. #define CMU_MEMCLKSRC0 (CMUD_REG_BASE+0x00C0)
  114. #define CMU_MEMCLKSRC1 (CMUD_REG_BASE+0x00C4)
  115. #define CMU_S1CLKCTL (CMUD_REG_BASE+0x00D0)
  116. #define CMU_S1BTCLKCTL (CMUD_REG_BASE+0x00D4)
  117. #define CMU_S2SCLKCTL (CMUD_REG_BASE+0x00DC)
  118. #define CMU_S3CLKCTL (CMUD_REG_BASE+0x00E0)
  119. #define CMU_WDCLK (CMUD_REG_BASE+0x00E4)
  120. #define CMU_GPIOCLKCTL (CMUD_REG_BASE+0x00E8)
  121. #define CMU_PMUWKUPCLKCTL (CMUD_REG_BASE+0x00EC)
  122. #define CMU_DIGITALDEBUG (CMUD_REG_BASE+0x00F0)
  123. #define CMU_TST_CTL (CMUD_REG_BASE+0x00F4)
  124. #define CMU_SPIMT0CLK (CMUD_REG_BASE+0x0100)
  125. #define CMU_SPIMT1CLK (CMUD_REG_BASE+0x0104)
  126. #define CMU_I2CMT0CLK (CMUD_REG_BASE+0x0110)
  127. #define CMU_I2CMT1CLK (CMUD_REG_BASE+0x0114)
  128. #define RMU_MRCR0 (RMU_REG_BASE + 0x00)
  129. #define RMU_MRCR1 (RMU_REG_BASE + 0x04)
  130. #define DSP_VCT_ADDR (RMU_REG_BASE+0x00000080)
  131. #define DSP_STATUS_EXT_CTL (RMU_REG_BASE+0x00000084)
  132. #define GPU_STATUS_EXT_CTL (RMU_REG_BASE+0x00000090)
  133. #define UID0 (RMU_REG_BASE+0x000000A0)
  134. #define UID1 (RMU_REG_BASE+0x000000A4)
  135. #define INTC_BASE 0x40003000
  136. #define INT_TO_DSP (INTC_BASE+0x00000000)
  137. #define INFO_TO_DSP (INTC_BASE+0x00000004)
  138. #define INT_TO_BT_CPU (INTC_BASE+0x00000010)
  139. #define PENDING_FROM_DSP (INTC_BASE+0x00000014)
  140. #define PENDING_FROM_BT_CPU (INTC_BASE+0x0000001C)
  141. #define MEMORY_CTL (MEM_REG_BASE)
  142. #define DSP_PAGE_ADDR0 (MEM_REG_BASE+0x00000080)
  143. #define DSP_PAGE_ADDR1 (MEM_REG_BASE+0x00000084)
  144. #define DSP_PAGE_ADDR2 (MEM_REG_BASE+0x00000088)
  145. #define DSP_PAGE_ADDR3 (MEM_REG_BASE+0x0000008c)
  146. #define WIO0_CTL (GPIO_REG_BASE + 0x300)
  147. #define WIO1_CTL (GPIO_REG_BASE + 0x304)
  148. #define WIO2_CTL (GPIO_REG_BASE + 0x308)
  149. #define WIO3_CTL (GPIO_REG_BASE + 0x30c)
  150. // brom api address
  151. //fpga
  152. //#define SPINOR_API_ADDR (0x00005860) //(0x00005814)
  153. #define SPINOR_API_ADDR (p_brom_api->p_spinor_api)
  154. // Interaction RAM
  155. #define INTER_RAM_ADDR (0x2FF18000)
  156. #define DSP_SHARE_RAM_START_ADDR (0x2FF1A800) /* Confirm with DSP, not reflect in linker.ld, can't change */
  157. #define INTER_RAM_SIZE (DSP_SHARE_RAM_START_ADDR - INTER_RAM_ADDR)
  158. //--------------SPICACHE_Control_Register-------------------------------------------//
  159. //--------------Register Address---------------------------------------//
  160. #define SPICACHE_Control_Register_BASE 0x40014000
  161. #define SPICACHE_CTL (SPICACHE_Control_Register_BASE+0x0000)
  162. #define SPICACHE_INVALIDATE (SPICACHE_Control_Register_BASE+0x0004)
  163. #define SPICACHE_TOTAL_MISS_COUNT (SPICACHE_Control_Register_BASE+0x0010)
  164. #define SPICACHE_TOTAL_HIT_COUNT (SPICACHE_Control_Register_BASE+0x0014)
  165. #define SPICACHE_PROFILE_INDEX_START (SPICACHE_Control_Register_BASE+0x0018)
  166. #define SPICACHE_PROFILE_INDEX_END (SPICACHE_Control_Register_BASE+0x001C)
  167. #define SPICACHE_RANGE_INDEX_MISS_COUNT (SPICACHE_Control_Register_BASE+0x0020)
  168. #define SPICACHE_RANGE_INDEX_HIT_COUNT (SPICACHE_Control_Register_BASE+0x0024)
  169. #define SPICACHE_PROFILE_ADDR_START (SPICACHE_Control_Register_BASE+0x0028)
  170. #define SPICACHE_PROFILE_ADDR_END (SPICACHE_Control_Register_BASE+0x002C)
  171. #define SPICACHE_RANGE_ADDR_MISS_COUNT (SPICACHE_Control_Register_BASE+0x0030)
  172. #define SPICACHE_RANGE_ADDR_HIT_COUNT (SPICACHE_Control_Register_BASE+0x0034)
  173. #define SPICACHE_DMA_READ_COUNT (SPICACHE_Control_Register_BASE+0x0038)
  174. #define SPICACHE_SDMA_READ_COUNT (SPICACHE_Control_Register_BASE+0x003C)
  175. #define SPICACHE_DE_READ_COUNT (SPICACHE_Control_Register_BASE+0x0040)
  176. #define MAPPING_MISS_ADDR (SPICACHE_Control_Register_BASE+0x0060)
  177. #define SPI1_CACHE_REGISTER_BASE 0x40018000
  178. #define SPI1_CACHE_CTL (SPI1_CACHE_REGISTER_BASE+0x0000)
  179. #define SPI1_CACHE_OPERATE (SPI1_CACHE_REGISTER_BASE+0x0004)
  180. #define CACHE_OPERATE_ADDR_START (SPI1_CACHE_REGISTER_BASE+0x0008)
  181. #define CACHE_OPERATE_ADDR_END (SPI1_CACHE_REGISTER_BASE+0x000c)
  182. #define SPI1_CACHE_MCPU_MISS_COUNT (SPI1_CACHE_REGISTER_BASE+0x0010)
  183. #define SPI1_CACHE_MCPU_HIT_COUNT (SPI1_CACHE_REGISTER_BASE+0x0014)
  184. #define SPI1_CACHE_MCPU_WRITEBACK_COUNT (SPI1_CACHE_REGISTER_BASE+0x0018)
  185. #define SPI1_CACHE_DMA_MISS_COUNT (SPI1_CACHE_REGISTER_BASE+0x0028)
  186. #define SPI1_CACHE_DMA_HIT_COUNT (SPI1_CACHE_REGISTER_BASE+0x002c)
  187. #define SPI1_CACHE_DMA_WRITEBACK_COUNT (SPI1_CACHE_REGISTER_BASE+0x0030)
  188. #define SPI1_CACHE_PROFILE_ADDR_START (SPI1_CACHE_REGISTER_BASE+0x003c)
  189. #define SPI1_CACHE_PROFILE_ADDR_END (SPI1_CACHE_REGISTER_BASE+0x0040)
  190. #define SPI1_CACHE_DE_READ_COUNT (SPI1_CACHE_REGISTER_BASE+0x0050)
  191. #define SPI1_CACHE_DE_WRITE_COUNT (SPI1_CACHE_REGISTER_BASE+0x0054)
  192. #define SPI1_CACHE_GPU_READ_COUNT (SPI1_CACHE_REGISTER_BASE+0x0058)
  193. #define SPI1_CACHE_GPU_WRITE_COUNT (SPI1_CACHE_REGISTER_BASE+0x005C)
  194. #define SPI1_CACHE_SDMA_READ_COUNT (SPI1_CACHE_REGISTER_BASE+0x0060)
  195. #define SPI1_CACHE_SDMA_WRITE_COUNT (SPI1_CACHE_REGISTER_BASE+0x0064)
  196. #define SPI1_CACHE_DMAUNCACHE_READ_COUNT (SPI1_CACHE_REGISTER_BASE+0x0068)
  197. #define SPI1_CACHE_DMAUNCACHE_WRITE_COUNT (SPI1_CACHE_REGISTER_BASE+0x006C)
  198. #define SPI1_PSRAM_MAPPING_MISS_ADDR (SPI1_CACHE_REGISTER_BASE+0x0080)
  199. #define SPI1_PSRAM_MASTER_WEIGHT (SPI1_CACHE_REGISTER_BASE+0x0090)
  200. #define SPI1_GPU_CTL (SPI1_CACHE_REGISTER_BASE+0x0094)
  201. //--------------PMUVDD-------------------------------------------//
  202. //--------------Register Address---------------------------------------//
  203. #define PMUVDD_BASE 0x40004000
  204. #define VOUT_CTL0 (PMUVDD_BASE+0x00)
  205. #define VOUT_CTL1_S1 (PMUVDD_BASE+0x04)
  206. #define VOUT_CTL1_S2 (PMUVDD_BASE+0x08)
  207. #define VOUT_CTL1_S3 (PMUVDD_BASE+0X0C)
  208. #define PMU_DET (PMUVDD_BASE+0x10)
  209. #define VOUT_CTL1_S1M (PMUVDD_BASE+0x14)
  210. #define DCDC_VC18_CTL (PMUVDD_BASE+0X20)
  211. #define DCDC_VD12_CTL (PMUVDD_BASE+0X24)
  212. // #define DCDC_VDD_CTL (PMUVDD_BASE+0X28)
  213. #define PWRGATE_DIG (PMUVDD_BASE+0X30)
  214. #define PWRGATE_DIG_ACK (PMUVDD_BASE+0X34)
  215. #define PWRGATE_RAM (PMUVDD_BASE+0X38)
  216. // #define PWRGATE_RAM_ACK (PMUVDD_BASE+0X3C)
  217. #define PMU_INTMASK (PMUVDD_BASE+0X40)
  218. #define RAM_DEEPSLEEP (PMUVDD_BASE+0x44)
  219. #define RAM_LIGHTSLEEP (PMUVDD_BASE+0x48)
  220. //--------------PMUSVCC-------------------------------------------//
  221. //--------------Register Address---------------------------------------//
  222. #define PMUSVCC_BASE 0x40004000
  223. #define CHG_CTL_SVCC (PMUSVCC_BASE+0X100)
  224. #define BDG_CTL_SVCC (PMUSVCC_BASE+0x104)
  225. #define SYSTEM_SET_SVCC (PMUSVCC_BASE+0x108)
  226. #define POWER_CTL_SVCC (PMUSVCC_BASE+0x10C)
  227. #define WKEN_CTL_SVCC (PMUSVCC_BASE+0x110)
  228. #define WAKE_PD_SVCC (PMUSVCC_BASE+0x114)
  229. #define COUNTER8HZ_SVCC (PMUSVCC_BASE+0x118)
  230. #define ALARM8HZ_SVCC (PMUSVCC_BASE+0x11C)
  231. #define REG_BKUP_SVCC (PMUSVCC_BASE+0x120)
  232. #define PMUADC_BASE 0x40004000
  233. #define PMUADC_CTL (PMUADC_BASE+0x200)
  234. #define PMUADC_INTMASK (PMUADC_BASE+0X204)
  235. #define PMUADC_PD (PMUADC_BASE+0X208)
  236. #define PMUADCDIG_CTL (PMUADC_BASE+0X20C)
  237. #define CHARGI_DATA (PMUADC_BASE+0x210)
  238. #define BATADC_DATA (PMUADC_BASE+0x214)
  239. #define DC5VADC_DATA (PMUADC_BASE+0x218)
  240. #define SENSADC_DATA (PMUADC_BASE+0x21C)
  241. #define SVCCADC_DATA (PMUADC_BASE+0x220)
  242. #define LRADC1_DATA (PMUADC_BASE+0x224)
  243. #define VCCI_DATA (PMUADC_BASE+0x228)
  244. #define LRADC2_DATA (PMUADC_BASE+0x22C)
  245. #define LRADC3_DATA (PMUADC_BASE+0x230)
  246. #define LRADC4_DATA (PMUADC_BASE+0x234)
  247. #define LRADC5_DATA (PMUADC_BASE+0x238)
  248. #define LRADC6_DATA (PMUADC_BASE+0x23C)
  249. //--------------EFUSE-------------------------------------------//
  250. #define EFUSE_BASE 0x40008000
  251. #define EFUSE_CTL0 (EFUSE_BASE+0x00)
  252. #define EFUSE_CTL1 (EFUSE_BASE+0x04)
  253. #define EFUSE_CTL2 (EFUSE_BASE+0x08)
  254. #define EFUSE_DATA0 (EFUSE_BASE+0x10)
  255. #define EFUSE_DATA1 (EFUSE_BASE+0x14)
  256. #define EFUSE_DATA2 (EFUSE_BASE+0x18)
  257. #define EFUSE_DATA3 (EFUSE_BASE+0x1C)
  258. #define EFUSE_DATA4 (EFUSE_BASE+0x20)
  259. #define EFUSE_DATA5 (EFUSE_BASE+0x24)
  260. #define EFUSE_DATA6 (EFUSE_BASE+0x28)
  261. #define EFUSE_DATA7 (EFUSE_BASE+0x2C)
  262. #define EFUSE_DATA8 (EFUSE_BASE+0x30)
  263. #define EFUSE_DATA9 (EFUSE_BASE+0x34)
  264. #define EFUSE_DATA10 (EFUSE_BASE+0x38)
  265. #define EFUSE_DATA11 (EFUSE_BASE+0x3C)
  266. #define InterruptController_BASE 0xe000e000
  267. #define NVIC_ISER0 (InterruptController_BASE+0x00000100)
  268. #define NVIC_ISER1 (InterruptController_BASE+0x00000104)
  269. #define NVIC_ICER0 (InterruptController_BASE+0x00000180)
  270. #define NVIC_ICER1 (InterruptController_BASE+0x00000184)
  271. #define NVIC_ISPR0 (InterruptController_BASE+0x00000200)
  272. #define NVIC_ISPR1 (InterruptController_BASE+0x00000204)
  273. #define NVIC_ICPR0 (InterruptController_BASE+0x00000280)
  274. #define NVIC_ICPR1 (InterruptController_BASE+0x00000284)
  275. #define NVIC_IABR0 (InterruptController_BASE+0x00000300)
  276. #define NVIC_IABR1 (InterruptController_BASE+0x00000304)
  277. #define NVIC_IPR0 (InterruptController_BASE+0x00000400)
  278. #define NVIC_IPR1 (InterruptController_BASE+0x00000404)
  279. #define NVIC_IPR2 (InterruptController_BASE+0x00000408)
  280. #define NVIC_IPR3 (InterruptController_BASE+0x0000040c)
  281. #define NVIC_IPR4 (InterruptController_BASE+0x00000410)
  282. #define NVIC_IPR5 (InterruptController_BASE+0x00000414)
  283. #define NVIC_IPR6 (InterruptController_BASE+0x00000418)
  284. #define NVIC_IPR7 (InterruptController_BASE+0x0000041c)
  285. #define NVIC_IPR8 (InterruptController_BASE+0x00000420)
  286. #define NVIC_IPR9 (InterruptController_BASE+0x00000424)
  287. #define TIMER_REGISTER_BASE 0x4000C100
  288. /* For sys tick used */
  289. #define T0_CTL (TIMER_REGISTER_BASE+0x00)
  290. #define T0_VAL (TIMER_REGISTER_BASE+0x04)
  291. #define T0_CNT (TIMER_REGISTER_BASE+0x08)
  292. /* For hrtimer used */
  293. #define T1_CTL (TIMER_REGISTER_BASE+0x20)
  294. #define T1_VAL (TIMER_REGISTER_BASE+0x24)
  295. #define T1_CNT (TIMER_REGISTER_BASE+0x28)
  296. /* For system cycle used */
  297. #define T2_CTL (TIMER_REGISTER_BASE+0x40)
  298. #define T2_VAL (TIMER_REGISTER_BASE+0x44)
  299. #define T2_CNT (TIMER_REGISTER_BASE+0x48)
  300. /* For T3 used */
  301. #define T3_CTL (TIMER_REGISTER_BASE+0x60)
  302. #define T3_VAL (TIMER_REGISTER_BASE+0x64)
  303. #define T3_CNT (TIMER_REGISTER_BASE+0x68)
  304. /* For tws used */
  305. #define T4_CTL (TIMER_REGISTER_BASE+0x80)
  306. #define T4_VAL (TIMER_REGISTER_BASE+0x84)
  307. #define T4_CNT (TIMER_REGISTER_BASE+0x88)
  308. #define T5_CTL (TIMER_REGISTER_BASE+0xA0)
  309. #define T5_VAL (TIMER_REGISTER_BASE+0xA4)
  310. #define T5_CNT (TIMER_REGISTER_BASE+0xA8)
  311. #define RTC_REG_BASE 0x4000C000
  312. #define WD_CTL (RTC_REG_BASE+0x20)
  313. #define HCL_CTL (RTC_REG_BASE+0x1D0)
  314. #define RTC_REMAIN0 (RTC_REG_BASE+0x30)
  315. #define RTC_REMAIN1 (RTC_REG_BASE+0x34)
  316. #define RTC_REMAIN2 (RTC_REG_BASE+0x38)
  317. #define RTC_REMAIN3 (RTC_REG_BASE+0x3C)
  318. #define RTC_REMAIN4 (RTC_REG_BASE+0x40)
  319. #define RTC_REMAIN5 (RTC_REG_BASE+0x44)
  320. /* DAC control register */
  321. #define AUDIO_DAC_REG_BASE 0x4005C000
  322. /* ADC control register */
  323. #define AUDIO_ADC_REG_BASE 0x4005C100
  324. #define ADC_REF_LDO_CTL (AUDIO_ADC_REG_BASE + 0x48)
  325. /* I2STX control register */
  326. #define AUDIO_I2STX0_REG_BASE 0x4005C400
  327. /* I2SRX control register */
  328. #define AUDIO_I2SRX0_REG_BASE 0x4005C500
  329. /*spi0*/
  330. #define SPI0_REGISTER_BASE 0x40028000
  331. #define SPI0_CTL (SPI0_REGISTER_BASE+0x0000)
  332. #define SPI0_DELAYCHAIN (SPI0_REGISTER_BASE+0x0024)
  333. /*spi1*/
  334. #define SPI1_REGISTER_BASE 0x4002C000
  335. #define SPI1_CTL (SPI1_REGISTER_BASE+0x0000)
  336. #define SPI1_DDR_MODE_CTL (SPI1_REGISTER_BASE+0x0018)
  337. #define SPI1_CLKGATING (SPI1_REGISTER_BASE+0x0038)
  338. #define SPI1_DELAYCHAIN (SPI1_REGISTER_BASE+0x003C)
  339. #define SPI1_DQS1_DELAYCHAIN (SPI1_REGISTER_BASE+0x0040)
  340. #define CTK0_BASE 0x4007C000
  341. #define CTK_CTL (CTK0_BASE+0x00)
  342. /* uart */
  343. #define UART0_CTL (UART0_REG_BASE+0x00)
  344. #define UART0_RXDAT (UART0_REG_BASE+0x04)
  345. #define UART0_TXDAT (UART0_REG_BASE+0x08)
  346. #define UART0_STA (UART0_REG_BASE+0x0c)
  347. #define UART0_BR (UART0_REG_BASE+0x10)
  348. #define UART1_CTL (UART1_REG_BASE+0x00)
  349. #define UART1_RXDAT (UART1_REG_BASE+0x04)
  350. #define UART1_TXDAT (UART1_REG_BASE+0x08)
  351. #define UART1_STA (UART1_REG_BASE+0x0c)
  352. #define UART1_BR (UART1_REG_BASE+0x10)
  353. //--------------Bits Location------------------------------------------//
  354. #define HOSC_CTL_HOSC_CAPTUNE_DONE 30
  355. #define HOSC_CTL_HOSC_GMTUNE_DONE 29
  356. #define HOSC_CTL_HOSC_READY 28
  357. #define HOSC_CTL_HOSC_READY_TIME_SET_e 27
  358. #define HOSC_CTL_HOSC_READY_TIME_SET_SHIFT 26
  359. #define HOSC_CTL_HOSC_READY_TIME_SET_MASK (0x3<<26)
  360. #define HOSC_CTL_HOSC_READY_EN 25
  361. #define HOSC_CTL_HOSC_CAP_e 24
  362. #define HOSC_CTL_HOSC_CAP_SHIFT 17
  363. #define HOSC_CTL_HOSC_CAP_MASK (0xFF<<17)
  364. #define HOSC_CTL_HOSC_CAPTUNE_EN 16
  365. #define HOSC_CTL_HOSC_INJECT_EN 15
  366. #define HOSC_CTL_HOSC_AMPLMT_e 14
  367. #define HOSC_CTL_HOSC_AMPLMT_SHIFT 13
  368. #define HOSC_CTL_HOSC_AMPLMT_MASK (0x3<<13)
  369. #define HOSC_CTL_HOSC_AMPLMT_EN 12
  370. #define HOSC_CTL_HOSC_GM_e 11
  371. #define HOSC_CTL_HOSC_GM_SHIFT 9
  372. #define HOSC_CTL_HOSC_GM_MASK (0x7<<9)
  373. #define HOSC_CTL_HOSC_GMTUNE_EN 8
  374. #define HOSC_CTL_HOSC_INJECT_TIME_SET_e 7
  375. #define HOSC_CTL_HOSC_INJECT_TIME_SET_SHIFT 6
  376. #define HOSC_CTL_HOSC_INJECT_TIME_SET_MASK (0x3<<6)
  377. #define HOSC_CTL_HOSC_VDD_SEL 5
  378. #define HOSC_CTL_HOSC_BUF_SEL 4
  379. #define HOSC_CTL_HOSC_GMTUNE_TIME_SET_e 3
  380. #define HOSC_CTL_HOSC_GMTUNE_TIME_SET_SHIFT 2
  381. #define HOSC_CTL_HOSC_GMTUNE_TIME_SET_MASK (0x3<<2)
  382. #define HOSC_CTL_HOSC_CTL1 1
  383. #define HOSC_CTL_HOSC_CTL0 0
  384. #define HOSCLDO_CTL_OSC32M_FRQCAL_e 31
  385. #define HOSCLDO_CTL_OSC32M_FRQCAL_SHIFT 22
  386. #define HOSCLDO_CTL_OSC32M_FRQCAL_MASK (0x3FF<<22)
  387. #define HOSCLDO_CTL_OSC32M_CALDONE 21
  388. #define HOSCLDO_CTL_OSC32M_FRQMSET_e 20
  389. #define HOSCLDO_CTL_OSC32M_FRQMSET_SHIFT 11
  390. #define HOSCLDO_CTL_OSC32M_FRQMSET_MASK (0x3FF<<11)
  391. #define HOSCLDO_CTL_OSC32M_CTL_e 10
  392. #define HOSCLDO_CTL_OSC32M_CTL_SHIFT 9
  393. #define HOSCLDO_CTL_OSC32M_CTL_MASK (0x3<<9)
  394. #define HOSCLDO_CTL_OSC32M_CALMODE 8
  395. #define HOSCLDO_CTL_OSC32M_CALEN 7
  396. #define HOSCLDO_CTL_OSC32M_EN 6
  397. #define HOSCLDO_CTL_OSCVDD0_PD_BIASSET 5
  398. #define HOSCLDO_CTL_OSCVDD0_PD 4
  399. #define HOSCLDO_CTL_OSCVDD0_VSET_e 3
  400. #define HOSCLDO_CTL_OSCVDD0_VSET_SHIFT 2
  401. #define HOSCLDO_CTL_OSCVDD0_VSET_MASK (0x3<<2)
  402. #define HOSCLDO_CTL_OSCVDD0_EN 0
  403. #define AVDDLDO_CTL_AVDD_PD_EN 4
  404. #define AVDDLDO_CTL_AVDD_EN 0
  405. #define PWRGATE_DIG_MAINCPU_PG 31
  406. #define PWRGATE_DIG_RAM0_MAIN_FORCE 30
  407. #define PWRGATE_DIG_RAM_BT_FORCE 29
  408. #define PWRGATE_DIG_BT_PG 28
  409. #define PWRGATE_DIG_BT_FORCE 27
  410. #define PWRGATE_DIG_DSP_AU_PG 26
  411. #define PWRGATE_DIG_GPU_PG 25
  412. #define PWRGATE_DIG_SHARERAM_FORCE 24
  413. #define PWRGATE_DIG_RAM_AUTOSLEEP 23
  414. #define PWRGATE_DIG_RAM_FASTWAKE 22
  415. #define PWRGATE_DIG_DISPLAY_PG 21
  416. #define PWRGATE_DIG_ACK_MAINCPU 31
  417. #define PWRGATE_DIG_ACK_BT 28
  418. #define PWRGATE_DIG_ACK_DSP_AU 26
  419. #define PWRGATE_DIG_ACK_GPU 25
  420. #define PWRGATE_DIG_ACK_DISPLAY 21
  421. #define PWRGATE_DIG_ACK_DSP_GPU_DISP_MASK (0x31<<21)
  422. #define PWRGATE_DIG_ACK_BT_MASK (0x1<<28)
  423. #endif /* _ACTIONS_SOC_REGS_H_ */