mt_reg_base.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. #ifndef __MT_REG_BASE
  2. #define __MT_REG_BASE
  3. #define BOOTROM_BASE (0x00000000)
  4. #define BOOTSRAM_BASE (0x00100000)
  5. #define IO_PHYS (0x10000000)
  6. #define TOPCKGEN_BASE (0x10000000)
  7. #define INTER_SRAM (0x00100000)
  8. // APB Module top_clock_ctrl
  9. #define TOP_CLOCK_CTRL_BASE (0x10000000)
  10. // APB Module infracfg_ao
  11. #define INFRACFG_AO_BASE (0x10001000)
  12. // APB Module kp
  13. #define KP_BASE (0x10002000)
  14. // APB Module pericfg
  15. #define PERICFG_BASE (0x10003000)
  16. // APB Module gpio
  17. #define GPIO_BASE (0x10005000)
  18. // APB Module sleep
  19. #define SLEEP_BASE (0x10006000)
  20. // APB Module toprgu
  21. #define TOPRGU_BASE (0x10007000)
  22. // APB Module apxgpt
  23. #define APXGPT_BASE (0x10008000)
  24. // APB Module efusec
  25. #define EFUSEC_BASE (0x10009000)
  26. // APB Module sej
  27. #define SEJ_BASE (0x1000A000)
  28. // APB Module ap_cirq_eint
  29. #define APIRQ_BASE (0x1000B000)
  30. // APB Module ccif
  31. #define AP_CCIF0_BASE (0x1000C000)
  32. // APB Module aes_top
  33. #define AES_BASE (0x1000E000)
  34. // APB Module pmic_wrap
  35. #define PWRAP_BASE (0x1000F000)
  36. // APB Module device_apc_ao
  37. #define DEVAPC_AO_BASE (0x10010000)
  38. // APB Module mipi_rx_ana
  39. #define MIPI_RX_ANA_BASE (0x10011800)
  40. // APB Module infra_mbist
  41. #define INFRA_MBIST_BASE (0x10012000)
  42. // APB Module io_cfg_t
  43. #define IO_CFG_T_BASE (0x10014000)
  44. // APB Module io_cfg_b
  45. #define IO_CFG_B_BASE (0x10015000)
  46. // APB Module io_cfg_l
  47. #define IO_CFG_L_BASE (0x10016000)
  48. // APB Module io_cfg_r
  49. #define IO_CFG_R_BASE (0x10017000)
  50. // APB Module apmixedsys
  51. #define APMIXEDSYS_BASE (0x10018000)
  52. // APB Module dbgapb
  53. #define DBGAPB_BASE (0x10100000)
  54. // APB Module mcucfg
  55. #define MCUCFG_BASE (0x10200000)
  56. #define CA7MCUCFG_BASE (0x10200000)
  57. // APB Module infracfg
  58. #define INFRACFG_BASE (0x10201000)
  59. // APB Module sys_cirq
  60. #define SYS_CIRQ_BASE (0x10202000)
  61. // APB Module m4u
  62. #define M4U_BASE (0x10203000)
  63. // APB Module nb_mmu
  64. #define NB_MMU0_BASE (0x10203200)
  65. // APB Module nb_mmu
  66. #define NB_MMU1_BASE (0x10203800)
  67. // APB Module device_apc
  68. #define DEVAPC_BASE (0x10204000)
  69. // APB Module bus_dbg_tracker_cfg
  70. #define BUS_DBG_BASE (0x1020B000)
  71. // APB Module emi
  72. #define EMI_BASE (0x10205000)
  73. // APB Module dramc
  74. #define DRAMC_NAO_BASE (0x10206000)
  75. // APB Module dramc_conf
  76. #define DRAMC0_BASE (0x10207000)
  77. // APB Module ddrphy
  78. #define DDRPHY_BASE (0x10208000)
  79. // APB Module sramrom
  80. #define SRAMROM_BASE (0x10209000)
  81. // APB Module gce
  82. #define GCE_BASE (0x1020A000)
  83. // APB Module cq_dma
  84. #define CQ_DMA_BASE (0x1020AC00)
  85. // APB Module bus
  86. #define DBG_TRACKER_BASE (0x1020B000)
  87. // APB Module trng
  88. #define TRNG_BASE (0x1020C000)
  89. // APB Module ca9
  90. #define CA9_BASE (0x10210000)
  91. // APB Module ap_p_dma
  92. #define AP_DMA_BASE (0x11000000)
  93. // APB Module nfi
  94. #define NFI_BASE (0x11001000)
  95. // APB Module nfiecc
  96. #define NFIECC_BASE (0x11002000)
  97. // APB Module auxadc
  98. #define AUXADC_BASE (0x11003000)
  99. // APB Module fhctl
  100. #define FHCTL_BASE (0x11004000)
  101. // APB Module uart
  102. #define AP_UART0_BASE (0x11005000)
  103. // APB Module uart
  104. #define AP_UART1_BASE (0x11006000)
  105. // APB Module uart
  106. #define AP_UART2_BASE (0x11007000)
  107. // add to fix build error, need to review the address
  108. #define AP_UART3_BASE (0x11007000)
  109. // APB Module pwm
  110. #define PWM_BASE (0x11008000)
  111. // APB Module i2c
  112. #define I2C0_BASE (0x11009000)
  113. // APB Module i2c
  114. #define I2C1_BASE (0x1100A000)
  115. // APB Module i2c
  116. #define I2C2_BASE (0x1100B000)
  117. // APB Module spi
  118. #define SPI1_BASE (0x1100C000)
  119. // APB Module therm_ctrl
  120. #define THERM_CTRL_BASE (0x1100D000)
  121. // APB Module btif
  122. #define BTIF_BASE (0x1100E000)
  123. // APB Module disp_pwm
  124. #define DISP_PWM0_BASE (0x1100F000)
  125. // APB Module usb2
  126. #define USB_BASE (0x11100000)
  127. // APB Module usb
  128. #define USBSIF_BASE (0x11110000)
  129. // APB Module msdc
  130. #define MSDC0_BASE (0x11120000)
  131. // APB Module msdc
  132. #define MSDC1_BASE (0x11130000)
  133. // add to fix build error, need to review the address
  134. #define MSDC2_BASE (0x11130000)
  135. // add to fix build error, need to review the address
  136. #define MSDC3_BASE (0x11130000)
  137. // APB Module AHB_MON_ABORT
  138. #define AHBABT_BASE (0x11150000)
  139. // APB Module mfg_top
  140. #define MFGCFG_BASE (0x13000000)
  141. // APB Module mali
  142. #define MALI_BASE (0x13010000)
  143. // APB Module mali_tb_cmd
  144. #define MALI_TB_BASE (0x1301f000)
  145. // APB Module mmsys_config
  146. #define MMSYS_CONFIG_BASE (0x14000000)
  147. // APB Module mdp_rdma
  148. #define MDP_RDMA_BASE (0x14001000)
  149. // APB Module mdp_rsz
  150. #define MDP_RSZ0_BASE (0x14002000)
  151. // APB Module mdp_rsz
  152. #define MDP_RSZ1_BASE (0x14003000)
  153. // APB Module disp_wdma
  154. #define MDP_WDMA_BASE (0x14004000)
  155. // APB Module mdp_wrot
  156. #define MDP_WROT_BASE (0x14005000)
  157. // APB Module mdp_tdshp
  158. #define MDP_TDSHP_BASE (0x14006000)
  159. // APB Module ovl
  160. #define DISP_OVL0_BASE (0x14007000)
  161. // APB Module ovl
  162. #define DISP_OVL1_BASE (0x14008000)
  163. // APB Module disp_rdma
  164. #define DISP_RDMA0_BASE (0x14009000)
  165. // APB Module disp_rdma
  166. #define DISP_RDMA1_BASE (0x1400a000)
  167. // APB Module disp_wdma
  168. #define DISP_WDMA0_BASE (0x1400b000)
  169. // APB Module disp_color_config
  170. #define DISP_COLOR_BASE (0x1400c000)
  171. // APB Module disp_ccorr
  172. #define DISP_CCORR_BASE (0x1400d000)
  173. // APB Module disp_aal
  174. #define DISP_AAL_BASE (0x1400e000)
  175. // APB Module disp_gamma
  176. #define DISP_GAMMA_BASE (0x1400f000)
  177. // APB Module disp_dither
  178. #define DISP_DITHER_BASE (0x14010000)
  179. // APB Module disp_ufoe_config
  180. #define DISP_UFOE_BASE (0x14011000)
  181. // APB Module dsi
  182. #define DSI0_BASE (0x14012000)
  183. // APB Module disp_dpi
  184. #define DPI0_BASE (0x14013000)
  185. // APB Module disp_mutex
  186. #define MM_MUTEX_BASE (0x14015000)
  187. // APB Module smi_larb
  188. #define SMI_LARB0_BASE (0x14016000)
  189. // APB Module smi
  190. #define SMI_COMMON_BASE (0x14017000)
  191. // APB Module mipi_tx_config
  192. #define MIPI_TX0_BASE (0x14018000)
  193. // APB Module disp_wdma
  194. #define DISP_WDMA1_BASE (0x14038000)
  195. // APB Module cam_all
  196. #define CAM_BASE (0x14010000)
  197. // APB Module seninf_top
  198. #define SENINF_TOP_BASE (0x14012000)
  199. // APB Module seninf
  200. #define SENINF_BASE (0x14012000)
  201. // APB Module csi2
  202. #define CSI2_BASE (0x14012000)
  203. // APB Module ncsi2
  204. #define NCSI2_BASE (0x14012000)
  205. // APB Module seninf_tg
  206. #define SENINF_TG_BASE (0x14012000)
  207. // APB Module scam
  208. #define SCAM_BASE (0x14012000)
  209. // APB Module ccir656
  210. #define CCIR656_BASE (0x14012000)
  211. // APB Module mipi_rx_config
  212. #define MIPI_RX_CONFIG_BASE (0x14013000)
  213. // add to fix build error, need to review the address
  214. #define MIPI_RX_ANA_CSI0_BASE (0x14013000)
  215. // add to fix build error, need to review the address
  216. #define MIPI_RX_ANA_CSI1_BASE (0x14013000)
  217. // APB Module venc
  218. #define VENC_BASE (0x14016000)
  219. // APB Module vdec
  220. #define VDEC_BASE (0x14017000)
  221. #define IMGSYS_BASE (0x15000000)
  222. // APB Module smi_larb
  223. #define SMI_LARB2_BASE (0x15001000)
  224. // APB Module smi_larb
  225. #define SMI_LARB3_BASE (0x15001000)
  226. // APB Module mmu
  227. #define SMI_LARB3_MMU_BASE (0x15001800)
  228. // APB Module smi_larb
  229. #define SMI_LARB4_BASE (0x15002000)
  230. // APB Module fake_eng
  231. #define FAKE_ENG_BASE (0x15002000)
  232. // APB Module mmu
  233. #define SMI_LARB4_MMU_BASE (0x15002800)
  234. // APB Module jpgdec
  235. #define JPGDEC_BASE (0x15009000)
  236. // APB Module vdecsys_config
  237. #define VDEC_GCON_BASE (0x16000000)
  238. // APB Module smi_larb
  239. #define SMI_LARB1_BASE (0x16010000)
  240. // APB Module mmu
  241. #define SMI_LARB1_MMU_BASE (0x16010800)
  242. // APB Module vdtop
  243. #define VDTOP_BASE (0x16020000)
  244. // APB Module vld
  245. #define VLD_BASE (0x16021000)
  246. // APB Module vld_top
  247. #define VLD_TOP_BASE (0x16021800)
  248. // APB Module mc
  249. #define MC_BASE (0x16022000)
  250. // APB Module avc_vld
  251. #define AVC_VLD_BASE (0x16023000)
  252. // APB Module avc_mv
  253. #define AVC_MV_BASE (0x16024000)
  254. // APB Module vdec_pp
  255. #define VDEC_PP_BASE (0x16025000)
  256. // APB Module vp8_vld
  257. #define VP8_VLD_BASE (0x16026800)
  258. // APB Module vp6
  259. #define VP6_BASE (0x16027000)
  260. // APB Module vld2
  261. #define VLD2_BASE (0x16027800)
  262. // APB Module mc_vmmu
  263. #define MC_VMMU_BASE (0x16028000)
  264. // APB Module pp_vmmu
  265. #define PP_VMMU_BASE (0x16029000)
  266. // APB Module n3d_ctl
  267. #define N3D_CTL_BASE (0x15000000)
  268. // APB Module fdvt
  269. #define FDVT_BASE (0x1500B000)
  270. // APB Module audiosys
  271. #define AUDIOSYS_BASE (0x11140000)
  272. #define GIC_DIST_BASE (CA9_BASE + 0x1000)
  273. #define GIC_CPU_BASE (CA9_BASE + 0x2000)
  274. //#define IOCFG_L_BASE (0x10016000)
  275. //#define IOCFG_B_BASE (0x10015000)
  276. //#define IOCFG_R_BASE (0x10017000)
  277. //#define IOCFG_T_BASE (0x10014000)
  278. #define RTC_BASE (0x8000)
  279. #define COLOR0_BASE (0x1400C000)
  280. #define CCORR_BASE (0x1400D000)
  281. #define DITHER_BASE (0x14010000)
  282. #define OVL0_BASE (0x1400C000)
  283. /* hardware version register */
  284. #define VER_BASE 0x08000000
  285. #define APHW_CODE (VER_BASE)
  286. #define APHW_SUBCODE (VER_BASE + 0x04)
  287. #define APHW_VER (VER_BASE + 0x08)
  288. #define APSW_VER (VER_BASE + 0x0C)
  289. ////////////////////////////////////////
  290. /* Other define */
  291. #define NON_BOOTABLE 0
  292. #define RAW_BOOT 1
  293. #define FAT_BOOT 2
  294. #define CONFIG_STACKSIZE (128*1024) /* regular stack */
  295. // xuecheng, define this because we use zlib for boot logo compression
  296. #define CONFIG_ZLIB 1
  297. /*MTK Memory layout configuration*/
  298. #define MAX_NR_BANK 4
  299. #define DRAM_PHY_ADDR 0x80000000
  300. #define RIL_SIZE 0
  301. #define CFG_RAMDISK_LOAD_ADDR (DRAM_PHY_ADDR + 0x4000000)
  302. #define CFG_BOOTIMG_LOAD_ADDR (DRAM_PHY_ADDR + 0x8000)
  303. #define CFG_BOOTARGS_ADDR (DRAM_PHY_ADDR + 0x100)
  304. #define CFG_FACTORY_NAME "factory.img"
  305. #define HAVE_LK_TEXT_MENU
  306. #ifdef CONFIG_MTK_USB_UNIQUE_SERIAL
  307. #define EFUSE_CTR_BASE 0x10206000 /* IO_PHYS + 0x01019000 */
  308. //#define PDN_CTR 0xC0001020 /* IO_PHYS + 0x00001020 */
  309. #define SERIAL_KEY_HI (EFUSE_CTR_BASE + 0x0144)
  310. #define SERIAL_KEY_LO (EFUSE_CTR_BASE + 0x0140)
  311. #endif
  312. //ALPS00427972, implement the analog register formula
  313. //Add here for eFuse, chip version checking -> analog register calibration
  314. #define M_HW_RES3 0x10009170
  315. //#define M_HW_RES3_PHY IO_PHYS+M_HW_RES3
  316. #define RG_USB20_TERM_VREF_SEL_MASK 0xE000 //0b 1110,0000,0000,0000 15~13
  317. #define RG_USB20_CLKREF_REF_MASK 0x1C00 //0b 0001,1100,0000,0000 12~10
  318. #define RG_USB20_VRT_VREF_SEL_MASK 0x0380 //0b 0000,0011,1000,0000 9~7
  319. //ALPS00427972, implement the analog register formula
  320. #endif