mt_reg_base.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("MediaTek Software") are
  4. * protected under relevant copyright laws. The information contained herein
  5. * is confidential and proprietary to MediaTek Inc. and/or its licensors.
  6. * Without the prior written permission of MediaTek inc. and/or its licensors,
  7. * any reproduction, modification, use or disclosure of MediaTek Software,
  8. * and information contained herein, in whole or in part, shall be strictly prohibited.
  9. */
  10. /* MediaTek Inc. (C) 2015. All rights reserved.
  11. *
  12. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  13. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  14. * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON
  15. * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  18. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  19. * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  20. * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
  21. * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
  22. * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
  23. * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
  24. * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  25. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
  26. * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  27. * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  28. * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
  29. * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  30. */
  31. #ifndef __MT_REG_BASE
  32. #define __MT_REG_BASE
  33. #define BOOTROM_BASE (0x00000000)
  34. #define BOOTSRAM_BASE (0x00100000)
  35. #define IO_PHYS (0x10000000)
  36. // APB Module cksys
  37. #define CKSYS_BASE (0x10000000)
  38. #define TOPCKGEN_BASE (0x10000000)
  39. // APB Module infracfg_ao
  40. #define INFRACFG_AO_BASE (0x10001000)
  41. #define IOCFG_RM_BASE (0x11C20000)
  42. #define IOCFG_BR_BASE (0x11D10000)
  43. #define IOCFG_BL_BASE (0x11E20000)
  44. #define IOCFG_LB_BASE (0x11E70000)
  45. #define IOCFG_RT_BASE (0x11EA0000)
  46. #define IOCFG_LT_BASE (0x11F20000)
  47. #define IOCFG_TL_BASE (0x11F30000)
  48. #define PERICFG_BASE (0x10003000)
  49. // APB Module dramc
  50. #define DRAMC0_BASE (0x10230000)
  51. // APB Module gpio
  52. #define GPIO_BASE (0x10005000)
  53. // APB Module sleep
  54. #define SLEEP_BASE (0x10006000)
  55. // APB Module dvfsrc
  56. #define DVFSRC_BASE (0x10012000)
  57. // APB Module toprgu
  58. #define TOPRGU_BASE (0x10007000)
  59. // APB Module apxgpt
  60. #define APXGPT_BASE (0x10008000)
  61. // APB Module rsvd
  62. #define RSVD_BASE (0x10009000)
  63. // APB Module sej
  64. #define SEJ_BASE (0x1000A000)
  65. // APB Module ap_cirq_eint
  66. #define APIRQ_BASE (0x1000B000)
  67. // APB Module smi
  68. //#define SMI_COMMON_AO_BASE (0x10211000)
  69. // APB Module pmic_wrap
  70. #define PWRAP_BASE (0x1000D000)
  71. // APB Module device_apc_ao
  72. #define DEVAPC_AO_BASE (0x1000E000)
  73. // APB Module ddrphy
  74. #define DDRPHY_BASE (0x10236000)
  75. // APB Module kp
  76. #define KP_BASE (0x10010000)
  77. // APB Module DRAMC1_BASE
  78. //#define DRAMC1_BASE (0x10011000)
  79. // APB Module DDRPHY1_BASE
  80. //#define DDRPHY1_BASE (0x10012000)
  81. #define SECURITY_AO_BASE (0x1001a000)
  82. // APB Module md32
  83. //#define MD32_BASE (0x10058000)
  84. // APB Module dbgapb
  85. #define DBGAPB_BASE (0x0D000000)
  86. // APB Module dbgao
  87. #define DBGAO_BASE (0x0D010000)
  88. #define DBG_MON_LATCH_CON (0x0D01A100)
  89. #define INFRA_AO_MON_0 (0x0D01A104)
  90. #define INFRA_AO_MON_1 (0x0D01A108)
  91. #define INFRA_AO_MON_2 (0x0D01A10C)
  92. #define INFRA_AO_MON_3 (0x0D01A110)
  93. // APB Module mcucfg
  94. #define MCUCFG_BASE (0x0C530000)
  95. // APB Module ca7mcucfg
  96. //#define CA7MCUCFG_BASE (0x10200000)
  97. // APB Module infracfg
  98. #define INFRACFG_BASE (0x1020E000)
  99. // APB Module sramrom
  100. #define SRAMROM_BASE (0x10214000)
  101. // APB Module emi
  102. #define EMI_BASE (0x10219000)
  103. // APB Module sys_cirq
  104. #define SYS_CIRQ_BASE (0x10204000)
  105. // APB Module mm_iommu
  106. #define M4U_BASE (0x10220000)
  107. // APB Module efusec
  108. #define EFUSEC_BASE (0x11C10000)
  109. // APB Module device_apc
  110. #define DEVAPC_BASE (0x10207000)
  111. // APB Module bus_dbg_tracker_cfg
  112. #define BUS_DBG_BASE (0x10208000)
  113. // APB Module apmixed
  114. #define APMIXED_BASE (0x1000C000)
  115. // APB Module fhctl
  116. #define FHCTL_BASE (0x1000CE00)
  117. // APB Module ccif
  118. #define AP_CCIF0_BASE (0x10209000)
  119. // APB Module ccif
  120. #define MD_CCIF0_BASE (0x1020A000)
  121. // APB Module gpio1
  122. //#define GPIO1_BASE (0x1020C000)
  123. // APB Module infra_mbist
  124. #define INFRA_MBIST_BASE (0x1020D000)
  125. // APB Module dramc_conf_nao
  126. #define DRAMC_NAO_BASE (0x10234000)
  127. // APB Module trng
  128. #define TRNG_BASE (0x1020F000)
  129. // APB Module gcpu
  130. //#define GCPU_BASE (0x10210000)
  131. // APB Module gcpu_ns
  132. //#define GCPU_NS_BASE (0x10211000)
  133. // APB Module gcpu_ns
  134. #define GCE_BASE (0x10228000)
  135. // APB Module dramc_conf_nao
  136. //#define DRAMC1_NAO_BASE (0x1033C000)
  137. // APB Module perisys_iommu
  138. #define PERISYS_IOMMU_BASE (0x10220000)
  139. // APB Module mipi_tx_config
  140. #define MIPI_TX0_BASE (0x11E50000)
  141. #define MIPI_TX1_BASE (0x10216000)
  142. // MIPI TX Config
  143. #define MIPI_TX_CONFIG_BASE (0x11E50000)
  144. // APB Module mipi_rx_ana_csi0
  145. #define MIPI_RX_ANA_CSI0_BASE (0x10217000)
  146. // APB Module mipi_rx_ana_csi1
  147. #define MIPI_RX_ANA_CSI1_BASE (0x10218000)
  148. // APB Module mipi_rx_ana_csi2
  149. //#define MIPI_RX_ANA_CSI2_BASE (0x10219000)
  150. // APB Module ca9
  151. //#define CA9_BASE (0x10220000)
  152. // APB Module gce
  153. #define GCE_BASE (0x10228000)
  154. // APB Module cq_dma
  155. #define CQ_DMA_BASE (0x10212000)
  156. // adsp
  157. #define ADSP_BASE (0x10600000)
  158. // APB Module ap_dma
  159. #define AP_DMA_BASE (0x11000000)
  160. // APB Module auxadc
  161. #define AUXADC_BASE (0x11001000)
  162. // APB Module uart
  163. #define AP_UART0_BASE (0x11002000)
  164. // APB Module uart
  165. #define AP_UART1_BASE (0x11003000)
  166. // APB Module uart
  167. #define AP_UART2_BASE (0x11004000)
  168. // APB Module pwm
  169. #define PWM_BASE (0x11006000)
  170. // APB Module spi
  171. #define SPI1_BASE (0x11010000)
  172. // APB Module therm_ctrl
  173. #define THERM_CTRL_BASE (0x1100B000)
  174. // APB Module btif
  175. #define BTIF_BASE (0x1100C000)
  176. // APB Module nfi
  177. //#define NFI_BASE (0x1100D000)
  178. // APB Module nfiecc
  179. //#define NFIECC_BASE (0x1100E000)
  180. // APB Module nli_arb
  181. //#define NLI_ARB_BASE (0x1100F000)
  182. // APB Module usb2
  183. #define USB_BASE (0x11200000)
  184. // APB Module usb_sif
  185. #define USBSIF_BASE (0x11210000)
  186. // APB Module audio
  187. #define AUDIO_BASE (0x11210000)
  188. #define MSDC0_TOP_BASE (0x11F50000)
  189. #define MSDC1_TOP_BASE (0x11E10000)
  190. // APB Module msdc
  191. //#define MSDC_TOP_BASE (0x104D0000)
  192. // APB Module msdc
  193. #define MSDC0_BASE (0x11230000)
  194. // APB Module msdc
  195. #define MSDC1_BASE (0x11240000)
  196. // APB Module msdc
  197. #define MSDC2_BASE (0x11250000)
  198. // APB Module msdc
  199. #define MSDC3_BASE (0x11260000)
  200. // APB Module USB_1p
  201. //#define ICUSB_BASE (0x11270000)
  202. // APB Module ssusb_top
  203. #define USB3_BASE (0x11200000)
  204. // APB Module ssusb_top_sif
  205. #define USB3_SIF_BASE (0x11E40000)
  206. // APB Module ssusb_top_sif2
  207. #define USB3_SIF2_BASE (0x11290000)
  208. // APB Module mfg_top
  209. #define MFGCFG_BASE (0x13000000)
  210. // APB Module han
  211. //#define HAN_BASE (0x13000000)
  212. // APB Module mmsys_config
  213. #define MMSYS_CONFIG_BASE (0x14000000)
  214. // APB Module mdp_rdma
  215. #define MDP_RDMA0_BASE (0x14001000)
  216. // APB Module mdp_rdma
  217. #define MDP_RDMA1_BASE (0x14002000)
  218. // APB Module mdp_rsz
  219. #define MDP_RSZ0_BASE (0x14003000)
  220. // APB Module mdp_rsz
  221. #define MDP_RSZ1_BASE (0x14004000)
  222. // APB Module mdp_rsz
  223. //#define MDP_RSZ2_BASE (0x14005000)
  224. // APB Module disp_wdma
  225. #define MDP_WDMA_BASE (0x14006000)
  226. // APB Module mdp_wrot
  227. #define MDP_WROT0_BASE (0x14005000)
  228. // APB Module mdp_wrot
  229. #define MDP_WROT1_BASE (0x14020000)
  230. // APB Module mdp_tdshp
  231. #define MDP_TDSHP0_BASE (0x14007000)
  232. // APB Module mdp_tdshp
  233. #define MDP_TDSHP1_BASE (0x14031000)
  234. // APB Module mdp_tdshp
  235. //#define MDP_CROP_BASE (0x1400b000)
  236. // DISPSYS
  237. #define OVL0_BASE (0x14008000)
  238. #define OVL1_BASE (0)
  239. #define DISP_OVL0_2L_BASE (0x14009000)
  240. #define DISP_OVL1_2L_BASE (0x1400A000)
  241. #define DISP_RDMA0_BASE (0x1400B000)
  242. #define DISP_RDMA1_BASE (0x1400C000)
  243. #define DISP_WDMA0_BASE (0x1400D000)
  244. #define DISP_WDMA1_BASE (0)
  245. #define DISP_UFOE_BASE (0)
  246. //#define DISP_SPLIT0_BASE (0)
  247. #define DSI0_BASE (0x14014000)
  248. #define DSI1_BASE (0)
  249. #define MM_MUTEX_BASE (0x14016000)
  250. // PQ and AAL
  251. #define COLOR0_BASE (0x1400E000)
  252. //#define COLOR1_BASE (0x14015000)
  253. #define CCORR0_BASE (0x1400F000)
  254. //#define CCORR1_BASE (0x14017000)
  255. #define DISP_AAL0_BASE (0x14010000)
  256. //#define DISP_AAL1_BASE (0x14019000)
  257. #define DISP_GAMMA0_BASE (0x14011000)
  258. //#define DISP_GAMMA1_BASE (0x1401B000)
  259. //#define DISP_OD_BASE (0x1401C000)
  260. #define DITHER0_BASE (0x14012000)
  261. //#define DITHER1_BASE (0x1401E000)
  262. // APB Module disp_dpi
  263. #define DPI_BASE (0x14015000)
  264. // APB Module disp_postmask
  265. #define DISP_POSTMASK_BASE (0x14021000)
  266. // APB Module disp_pwm
  267. #define DISP_PWM0_BASE (0x1100E000)
  268. // APB Module smi_larb0
  269. #define SMI_LARB0_BASE (0x14017000)
  270. // APB Module smi_larb5
  271. #define SMI_LARB1_BASE (0x14018000)
  272. // APB Module smi_larb
  273. #define SMI_LARB2_BASE (0x16010000)
  274. // APB Module smi
  275. #define SMI_COMMON_BASE (0x14019000)
  276. // APB Module smi_larb
  277. #define SMI_LARB5_BASE (0x1502F000)
  278. // APB Module fake_eng
  279. //#define FAKE_ENG_BASE (0x15002000)
  280. // APB Module imgsys
  281. #define IMGSYS_BASE (0x15020000)
  282. // APB Module cam1
  283. #define CAM1_BASE (0x1A003000)
  284. // APB Module cam2
  285. #define CAM2_BASE (0x1A004000)
  286. // APB Module cam3
  287. #define CAM3_BASE (0x1A005000)
  288. // APB Module cam4
  289. #define CAM4_BASE (0x1A006000)
  290. // APB Module camsv
  291. #define CAMSV_BASE (0x1a050000)
  292. // APB Module camsv_top
  293. #define CAMSV_TOP_BASE (0x1a050000)
  294. // APB Module csi2
  295. #define CSI2_BASE (0x1A040000)
  296. // APB Module seninf
  297. #define SENINF_BASE (0x1A040000)
  298. // APB Module seninf_tg
  299. #define SENINF_TG_BASE (0x1A040000)
  300. // APB Module seninf_top
  301. #define SENINF_TOP_BASE (0x1A040000)
  302. // APB Module seninf_mux
  303. #define SENINF_MUX_BASE (0x1A040000)
  304. // APB Module mipi_rx_config
  305. #define MIPI_RX_CONFIG_BASE (0x10217000)
  306. // APB Module scam
  307. #define SCAM_BASE (0x1A044000)
  308. // APB Module ncsi2
  309. //#define NCSI2_BASE (0x15008000)
  310. // APB Module ccir656
  311. #define CCIR656_BASE (0x1A044000)
  312. // APB Module n3d_ctl
  313. //#define N3D_CTL_BASE (0x15008000)
  314. // APB Module fdvt
  315. #define FDVT_BASE (0x1502B000)
  316. // APB Module vdecsys_config
  317. #define VDEC_GCON_BASE (0x16000000)
  318. // APB Module vdtop
  319. #define VDEC_BASE (0x16020000)
  320. // APB Module vdtop
  321. #define VDTOP_BASE (0x16025000)
  322. // APB Module vld
  323. #define VLD_BASE (0x16020000)
  324. // APB Module vld_top
  325. //#define VLD_TOP_BASE (0x16021800)
  326. // APB Module mc
  327. #define MC_BASE (0x16021000)
  328. // APB Module avc_vld
  329. #define AVC_VLD_BASE (0x16022000)
  330. // APB Module avc_mv
  331. #define AVC_MV_BASE (0x16023000)
  332. // APB Module vdec_pp
  333. #define VDEC_PP_BASE (0x16024000)
  334. // APB Module hevc_vld
  335. #define HEVC_VLD_BASE (0x16028000)
  336. // APB Module vp8_vld
  337. #define VP8_VLD_BASE (0x16027800)
  338. // APB Module vp6
  339. #define VP6_BASE (0x16026000)
  340. // APB Module vld2
  341. #define VLD2_BASE (0x16026800)
  342. // APB Module mc_vmmu
  343. //#define MC_VMMU_BASE (0x16028000)
  344. // APB Module pp_vmmu
  345. //#define PP_VMMU_BASE (0x16029000)
  346. // APB Module mjc_config
  347. #define MJC_CONFIG_BASE (0x12000000)
  348. // APB Module mjc_top
  349. #define MJC_TOP_BASE (0x12001000)
  350. // APB Module venc_config
  351. #define VENC_GCON_BASE (0x17000000)
  352. // APB Module smi_larb
  353. #define SMI_LARB3_BASE (0x1A002000)
  354. // APB Module venc
  355. #define VENC_BASE (0x17020000)
  356. // APB Module jpgenc
  357. #define JPGENC_BASE (0x17030000)
  358. // APB Module jpgdec
  359. //#define JPGDEC_BASE (0x18004000)
  360. // APB Module audiosys
  361. //#define AUDIOSYS_BASE (0x11220000)
  362. // rtc
  363. #define RTC_BASE (0x2800)
  364. //Marcos add for early porting
  365. //#define SYSRAM_BASE (0x19000000)
  366. #define GIC_DIST_BASE (0x0C000000)
  367. #define GIC_REDIS_BASE (0x0C040000)
  368. //#define GIC_CPU_BASE (CA9_BASE + 0x2000)
  369. #if defined(MACH_FPGA)
  370. // FPGA only
  371. //#define DEVINFO_BASE (0x10001000)
  372. #endif
  373. /* hardware version register */
  374. #define VER_BASE 0x08000000
  375. #define APHW_CODE (VER_BASE)
  376. #define APHW_SUBCODE (VER_BASE + 0x04)
  377. #define APHW_VER (VER_BASE + 0x08)
  378. #define APSW_VER (VER_BASE + 0x0C)
  379. ////////////////////////////////////////
  380. /* Other define */
  381. #define NON_BOOTABLE 0
  382. #define RAW_BOOT 1
  383. #define FAT_BOOT 2
  384. #define CONFIG_STACKSIZE (128*1024) /* regular stack */
  385. // xuecheng, define this because we use zlib for boot logo compression
  386. #define CONFIG_ZLIB 1
  387. /*MTK Memory layout configuration*/
  388. #define MAX_NR_BANK 4
  389. #define DRAM_PHY_ADDR 0x40000000
  390. #define RIL_SIZE 0
  391. #define CFG_RAMDISK_LOAD_ADDR (DRAM_PHY_ADDR + 0x4000000)
  392. #define CFG_BOOTIMG_LOAD_ADDR (DRAM_PHY_ADDR + 0x8000)
  393. #define CFG_BOOTARGS_ADDR (DRAM_PHY_ADDR + 0x100)
  394. #define CFG_FACTORY_NAME "factory.img"
  395. #define HAVE_LK_TEXT_MENU
  396. #ifdef CONFIG_MTK_USB_UNIQUE_SERIAL
  397. #define EFUSE_CTR_BASE 0x10206000 /* IO_PHYS + 0x01019000 */
  398. //#define PDN_CTR 0xC0001020 /* IO_PHYS + 0x00001020 */
  399. #define SERIAL_KEY_HI (EFUSE_CTR_BASE + 0x0144)
  400. #define SERIAL_KEY_LO (EFUSE_CTR_BASE + 0x0140)
  401. #endif
  402. //ALPS00427972, implement the analog register formula
  403. //Add here for eFuse, chip version checking -> analog register calibration
  404. #define M_HW_RES3 0x10009170
  405. //#define M_HW_RES3_PHY IO_PHYS+M_HW_RES3
  406. #define RG_USB20_TERM_VREF_SEL_MASK 0xE000 //0b 1110,0000,0000,0000 15~13
  407. #define RG_USB20_CLKREF_REF_MASK 0x1C00 //0b 0001,1100,0000,0000 12~10
  408. #define RG_USB20_VRT_VREF_SEL_MASK 0x0380 //0b 0000,0011,1000,0000 9~7
  409. //ALPS00427972, implement the analog register formula
  410. #endif