rom_def.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  1. #ifndef _ROM_DEF
  2. #define _ROM_DEF
  3. /*** ***********************************************************
  4. * rom_def.h
  5. *
  6. * 1. define all hw regsiter & system define here
  7. * 2. compiler option please refer CCopts.h
  8. *
  9. ************************************************************************/
  10. /* REGs 0xbe00000x */
  11. #define SysAuxRegAddr 0xbe000000
  12. #define RevisionID_MMIOAddr 0xbe000005
  13. #define RevisionID_A0 0x10
  14. #define RevisionID_A1 0x11
  15. #define RevisionID_B0 0x20
  16. #define RevisionID_C0 0x30
  17. #define RevisionID_C1 0x31
  18. #define RevisionID_CA 0x38
  19. #define PowerSequence_HWSetAddress 0xbe000008
  20. #define PowerSequence_SetMainPowerOnBit (1<<0)
  21. #define PowerSequence_ReadMainPowerOKBit (1<<1)
  22. #define PowerSequence_SelectMainClk (1<<4)//(1<<2)
  23. #define PowerSequence_MainPowerResetStatus (1<<3)
  24. #define PowerSequence_SetDRAMS3ContrlBit (1<<29)//(1<<4)
  25. #define PowerSequence_SW_STM_EnableBit (1<<5)
  26. #define PowerSequence_SW_WarmWatchDog_ExpiredBit (1<<6)
  27. #if P330_8051
  28. #define PowerSequence_P330 (1<<11)
  29. #endif
  30. #define PowerSequence_Runtime_UpdateBit (1<<12)//(1<<7) // change CPU freq without Reset
  31. #define PwrRegsOffsetA 0xa
  32. #define AUX_R_SW_VDET_ENA (1<<1)
  33. #define AUX_R_LDO_AUX_VCTL (2<<2) //0=1v, 1=1.05v, 2=1.1v, 3=ivdd (531 a1)
  34. #define HWDevResetMMIO 0xbe00000c
  35. #define CPU1_RSTN_Bit (1<<31)
  36. #define UMCR_DIV_SYNR_RSTN_Bit (1<<30)
  37. #define SPI_RST_Bit (1<<0)
  38. #define R_i2c_rst (1<<2)
  39. #define R_i2c_MASTER_MAIN_rst (1<<6)
  40. #if P330_8051
  41. #define AUX_R_CPU0_RST (1<<26)
  42. #endif
  43. #define Aux_r_usbpll_rst (1<<23)
  44. #define R_usb_utmi_rst (1<<22)
  45. #define R_usb_rst (1<<18)
  46. #define R_vip_rst (1<<14)
  47. #define R_umc_rst (1<<13)
  48. #define R_ca_rst (1<<20)
  49. /*REGs 0xbe00001x */
  50. #define SPI_CTL_REG 0xbe000010
  51. #define SPI_Encrypt (1<<1)
  52. #define OFFSET_2 0x02
  53. #define SPI_CS1_DRV (1<<4)
  54. #define SPI_CS0_DRV (1<<3)
  55. #define SPI_DO_DRV (1<<2)
  56. #define SPI_DI_DRV (1<<1)
  57. #define SPI_CK_DRV (1<<0)
  58. #define UART_RX_REG 0xbe000014
  59. #define UART_RX_PULLUPJ (1<<1)
  60. #define UART_RX_PULLLOW (1<<2)
  61. /*REGs 0xbe00002x */
  62. #define DBG_PM (0x20)
  63. #define R_F24576K_CLKDIV_RSTN (15)
  64. #define R_F24576K_DIV (16)
  65. /*REGs 0xbe00003x */
  66. #define R_AUX_MISC 0xbe000034
  67. #if (CONFIG_CHIPID == 0x330)
  68. #define AUX_R_LVDS_INI_PD 0xfff //[11-0] 365 Aux-domain LVDS Power-Down bit; set '1' to power-down the LVDS
  69. #endif
  70. #define R_AUX_MISC_38 0xbe000038
  71. #define AUX_R_SEL_24M_AS_PWMCLK (1<<1)
  72. #define R_AUX_YPPFBI_AS_GPIO (1<<6) //1: Enable YPPFBI[1:0] as GPIO[44:43]
  73. #define SoftMMIO_UpdateMode 0xbe00003c
  74. #define Mode_F4_update 0x20
  75. #define Mode_F3_update 0x30
  76. #define Mode_F5_update 0x50
  77. #define Mode_F6_update 0x60
  78. #define Mode_OTA_update 0x70
  79. #define Mode_PWR_update 0x80
  80. #define Mode_PowerPlusKeypad_update 0x90
  81. /*REGs 0xbe00004x */
  82. #if C0_count_delay
  83. #define c0count_per_msec_reg 0xbe000040
  84. #endif
  85. #define P8051_CEC_HANDLER_reg 0xbe000044
  86. // 0xbe000044, not use, /kernel/linux/drivers/net/sis190.c
  87. // 0xbe000048, not use, /kernel/linux/arch/mips/sis358/suspend.h
  88. #define SISPTF_REGISTER 0xbe00004c // STORE_MSG_TO_USB
  89. /*REGs 0xbe00005x */
  90. #define SoftwareMMIO_PowerSequenceStatus 0xbe000054
  91. #define reserve_54_0 (1<<0) //not use
  92. #define P330_Enable_OffEvent (1<<3)
  93. #define PowerSequence_EntryOffEventFlag (1<<4)
  94. #define SoftwareMMIO_PowerSequencesetACPlugIn 0xbe000055
  95. /* AC Plug -in */
  96. #define ACPlugIn_CheckFirstTimebit (1<<0)
  97. /* Bootrin menu SoftwareMMIO_PowerSequencesetACPlugIn[3..1] */
  98. #define SoftwareMMIO_BootingMenu_CommandMask (0xf<<1)
  99. #define BootingMenu_RunDebugShell (8<<1)
  100. #define BootingMenu_DDRChange (7<<1)
  101. #define BootingMenu_PanelSelection_Command (6<<1)
  102. #define BootingMenu_UpdatedFlash_Command (5<<1)
  103. #define BootingMenu_WiteMMIO_Command (4<<1)
  104. #define BootingMenu_DramType_Command (3<<1)
  105. #define BootingMenu_Memory_Command (2<<1)
  106. #define BootingMenu_LoadLinux_Command (1<<1)
  107. /*REGs 0xbe000058[0]~[17] */
  108. #define REG_528 0xbe000058
  109. #define RTC_REG_526 0xbe0f0526
  110. /*REGs 0xbe00006x */
  111. #define KMF_BR_NORFLASH_ADDRESS (0xbe000068) // 8051 will search kmf/bootrom share data flash addrss
  112. /*REGs 0xbe00008x */
  113. #if Multi_Panelset
  114. #define Multi_Panelset_Reg 0xbe000084
  115. #endif
  116. #if RTC_REG_enable
  117. #define Kmf_Data_RTC_REG_L (0xbe000088)
  118. #define Kmf_Data_RTC_REG_H (0xbe00008c)
  119. #endif
  120. /* REGs 0xbe0000dx */
  121. #define SIS326_PwrSeqHWStatus_MMIOReg 0xBE0000DC
  122. #define SIS326_PwrSeqHWStatus_AuxCPU0Ready 0x0000ffff
  123. #define SIS326_PwrSeqHWStatus_MainPwrReady 0x000f0000
  124. #define SIS326_PwrSeqHWStatus_MainPLLReady 0x00f00000
  125. #define SIS326_PwrSeqHWStatus_MainPLLLockReady 0x00100000
  126. #define SIS326_PwrSeqHWStatus_MCLKDLLReady 0x00200000
  127. #define SIS326_PwrSeqHWStatus_MainPowerOk 0x00020000
  128. #define SIS326_PwrSeqHWStatus_CPU1MemReady 0x0f000000
  129. #define SIS326_PwrSeqHWStatus_VIPAudioReady 0xf0000000
  130. #define SIS326_PwrSeqHWStatus_AuxCPU0Ready_Value 0x00007777
  131. #define SIS326_PwrSeqHWStatus_MainPwrReady_Value 0x76477777//0x00077777
  132. #define SIS326_PwrSeqHWStatus_MainCLKSReady_Value 0x00577777 //0x00777777
  133. #define SIS326_PwrSeqHWStatus_UMCResetOK_Value 0x05577777 //0x05777777
  134. //#define SIS326_PwrSeqHWStatus_CPU1MemReady_Value 0x07777777
  135. #define SIS326_PwrSeqHWStatus_CPU1MemReady_Value 0x05577777 //0x05777777 // for A0 version : CPU1 reset invert
  136. #define SIS326_PwrSeqHWStatus_CPU1MemReady_Mask 0x07777777 // for A0 version : CPU1 reset invert
  137. #define SIS326_PwrSeqHWStatus_VIPAudioReady_Value 0x77577777//0x77777777
  138. /* REGs 0xbe00010x */
  139. #define R_StartAddress 0xbe000100
  140. #define R_StartAddress_100 0xbe000100
  141. #define R_Clk_MMIO_0x4 0x04 // Main PLL
  142. #define R_Clk_MMIO_0x8 0x08 // Main DIV
  143. #define R_Clk_MMIO_0xc 0x0c // TSIO_CTRL & ICLK_DIV
  144. #define R_Clk_MMIO_0x10 0x10
  145. #define R_Clk_MMIO_0x14 0x14
  146. #define R_Clk_MMIO_0x18 0x18
  147. #define R_Clk_MMIO_0x1c 0x1C
  148. #define R_Clk_MMIO_0x20 0x20
  149. #define R_Clk_MMIO_0x4c 0x4c //Main cpu Clock
  150. #define SIFCLK_DIV_466 (0x18<<16) //Audio
  151. #define SIFCLK_DIV_533 (0x1C<<16) //Audio
  152. #define SIFCLK_DIV_608 (0x20<<16)
  153. #define SIFCLK_DIV_663 (0x23<<16)
  154. #define SIFCLK_DIV_700 (0x25<<16)
  155. #define SIFCLK_DIV_740 (0x27<<16)
  156. #define SIFCLK_DIV_9861_750 (0x27<<16) // 1.5G / DIV
  157. #if Media_TV_Only //media TV
  158. #define SIFCLK_DIV_MEDIA_480 (0x19<<16) //Audio
  159. #define SIFCLK_DIV_MEDIA_497 (0x1a<<16) //Audio
  160. #define SIFCLK_DIV_MEDIA_516 (0x1b<<16)
  161. #endif
  162. #define VCLK_DIV (4<<16)
  163. #define VCLK_DIV_800 (3<<16)
  164. #define VCLK_DIV_1008 (3<<16) //SiS9565 H.265
  165. #define VCLK_DIV_1179 (4<<16)
  166. #define VCLK_DIV_1352 (5<<16) //org(5<<16) 2011.08.17 H/W recommend
  167. #define VCLK_DIV_1548 (6<<16) //SiS9861 H.264
  168. #ifdef CONFIG_PLL_FRACTIONAL_MODE
  169. #define YPP_ADC_DIV (0x1d<<16)
  170. #else
  171. #define YPP_ADC_DIV (0x1d<<16)
  172. #endif
  173. #define NFCLK_DIV_RSTN (0x1<<31)
  174. #define NFCLK_DIV_800 (0xe<<24)
  175. #define NFCLK_DIV_1008 (0xe<<24)//(0xb<<24)
  176. #define NFCLK_DIV_1179 (0xe<<24)
  177. #define NFCLK_DIV_1352 (0x10<<24)
  178. #define NFCLK_DIV_1548 (0xa<<24)
  179. #define CARDRCLK_DIV_800 0x15
  180. #define CARDRCLK_DIV_1008 0x15
  181. #define CARDRCLK_DIV_1179 0x15
  182. #define CARDRCLK_DIV_1352 0x1a
  183. #define CARDRCLK_DIV_1548 0x1f
  184. #define BCRCLK_DIV_9861 0x1f
  185. #define R_BLTCLK_DIV 24
  186. #define BLTCLK_DIV_83 (0x83)
  187. #define BLTCLK_DIV_84 (0x84)
  188. #define BLTCLK_DIV_85 (0x85)
  189. #define BLTCLK_DIV_86 (0x86)
  190. #define MIAN_DIV 0xbe000108
  191. #define CCLK_DIV_330_4 (0x03)
  192. #define CCLK_DIV_330_3 (0x02)
  193. #define CCLK_DIV_330_2 (0x01)
  194. /* DDR-800 CPU0 DIV */
  195. #define CCLK_DIV_330_800_405 (0x01) //811/(1+1)=405.504MHz
  196. /* DDR-1008 CPU0 DIV */
  197. #define CCLK_DIV_330_1008_252 (0x03) //1008/(3+1)=252.0MHz
  198. #define CCLK_DIV_330_1008_336 (0x02) //1008/(2+1)=336.0MHz
  199. /* DDR-1179 CPU0 DIV */
  200. #define CCLK_DIV_330_1179_236 (0x04) //1179/(4+1)=235.8MHz
  201. #define CCLK_DIV_330_1179_295 (0x03) //1179/(3+1)=294.75MHz
  202. #define CCLK_DIV_330_1179_393 (0x02) //1179/(2+1)=393MHz
  203. /* DDR-1352 CPU0 DIV */
  204. #define CCLK_DIV_330_1352_225 (0x05) //1352/(5+1)=225.3MHz
  205. #define CCLK_DIV_330_1352_270 (0x04) //1352/(4+1)=270.4MHz
  206. #define CCLK_DIV_330_1352_338 (0x03) //1352/(3+1)=338.0MHz
  207. #define CCLK_DIV_330_1352_450 (0x02) //1352/(2+1)=450.6MHz
  208. /* DDR-1400 CPU0 DIV */
  209. #define CCLK_DIV_330_1400_350 (0x03) //1400.832/(3+1)=350.208MHz
  210. /* DDR-1548 CPU0 DIV */
  211. #define CCLK_DIV_330_1548_221 (0x06) //1548/(6+1)=221.143MHz
  212. #define CCLK_DIV_VALID (1<<7)
  213. #define CCLK_DIV_MAIN_RST (1<<5)
  214. /* 0xbe000108[6:0] CPUCLK_POST_DIV */
  215. #define CPU_CLK_DIV_RSTN (1<<7)
  216. /* 0xbe000108[14:8] MMIOCLK_POST_DIV */
  217. #define MMIO_CLK_DIV_9 (0x8<<8) //[14~8]
  218. #define MMIO_CLK_DIV_10 (0x9<<8) //[14~8]
  219. #define MMIO_CLK_DIV_11 (0xa<<8) //[14~8]
  220. #define MMIO_CLK_DIV_12 (0xb<<8) //[14~8]
  221. /* 0xbe000108[16:20] ECLK_POST_DIV */
  222. #define ECLK_DIV_9 (0x8<<16) //[22~16]
  223. #define ECLK_DIV_12 (0xb<<16) //[22~16]
  224. /* 0xbe000108[23] R_CPU_CLK_MUX_SEL */
  225. #define R_CPU_CLK_MUX_SEL (0x1<<23)
  226. /* 0xbe000108[28:24] SPICLK_POST_DIV */
  227. #ifdef CONFIG_SUPPORT_ROMTER
  228. #define SPICLK_DIV_9 (0x1f<<24) //[30~24]
  229. #define SPICLK_DIV_800 (0x1f<<24)
  230. #define SPICLK_DIV_1008 (0x1f<<24) //[30~24]
  231. #define SPICLK_DIV_1179 (0x1f<<24)
  232. #define SPICLK_DIV_1352 (0x1f<<24)
  233. #define SPICLK_DIV_1400 (0x1f<<24)
  234. #define SPICLK_DIV_1548 (0x1f<<24)
  235. #else
  236. #define SPICLK_DIV_9 (0x8<<24) //[30~24]
  237. #define SPICLK_DIV_12 (0xb<<24) //[30~24]
  238. #define SPICLK_DIV_800 (0x7<<24)
  239. #define SPICLK_DIV_1008 (0xa<<24) //[30~24]
  240. #define SPICLK_DIV_1179 (0xb<<24)
  241. #define SPICLK_DIV_1352 (0xc<<24)
  242. #define SPICLK_DIV_1400 (0xc<<24)
  243. #define SPICLK_DIV_1548 (0xf<<24)
  244. #endif
  245. #define ICLK_DIV_Mask (0x1ff<<0) // be00010c bit[8:0]
  246. #define ICLK_DIV_Reset1 (1<<12) //SiS365 Option be00010c bit[12]
  247. #define ICLK_DIV_Reset2 (1<<13) //SiS365 Option be00010c bit[13]
  248. #define ICLK_DIV_Reset3 (1<<9) //SiS365 Option be00010c bit[9]
  249. #define ICLK_RSTN (1 << 23) // be0001b0 bit[23]
  250. #define R_IPCLK_DIV (24)
  251. #define IPCLK_DIV_800 (0x04)
  252. #define IPCLK_DIV_5 (0x04)
  253. #define IPCLK_DIV_1008 (0x05)
  254. #define IPCLK_DIV_1179 (0x05)
  255. #define IPCLK_DIV_1352 (0x06)
  256. #define IPCLK_DIV_1548 (0x08)
  257. #define VIPX2ICLK_DIV_5 (0x04)
  258. #define VIPX2ICLK_DIV_800 (0x04)
  259. #define VIPX2ICLK_DIV_1008 (0x05)
  260. #define VIPX2ICLK_DIV_1179 (0x05)
  261. #define VIPX2ICLK_DIV_1352 (0x06)
  262. #define VIPX2ICLK_DIV_1548 (0x08)
  263. /* REGs 0xbe00011x */
  264. #define CLKFrq_Detection_SetAddr 0xbe000113 //clk det
  265. #if (CONFIG_CHIPID == 0x131) || (CONFIG_CHIPID == 0x8506) || (CONFIG_CHIPID == 0x6710)
  266. #define CLKFrq_CPU0_Detection 0xba//0x10
  267. #define CLKFrq_CPU1_Detection 0x18//0x92
  268. #define CLKFrq_ECLK_Detection 0x28
  269. #define CLKFrq_LVDSDCLK_Detection 0x58
  270. #define CLKFrq_MCLK_Detection 0x38//0xA0 is for the AUDIOCLK
  271. #define CLKFrq_SPICLK_Detection 0xF8
  272. #define CLKFrq_MMIOCLK_Detection 0x3a
  273. #define CLKFrq_HSD_CLK_Detection 0xca
  274. #else
  275. #define CLKFrq_CPU0_Detection 0xb2//0x10
  276. #define CLKFrq_CPU1_Detection 0x10//0x92
  277. #define CLKFrq_ECLK_Detection 0x20
  278. #define CLKFrq_LVDSDCLK_Detection 0x50
  279. #define CLKFrq_MCLK_Detection 0x30//0xA0 is for the AUDIOCLK
  280. #define CLKFrq_SPICLK_Detection 0xF0
  281. #define CLKFrq_MMIOCLK_Detection 0x32
  282. #define CLKFrq_HSD_CLK_Detection 0xc2
  283. #endif
  284. #define R_LVDS_PHY 0x1c
  285. #define R_BLTCLK_DIV_RSTN (31)
  286. #define R_LVDS_PWDL (1<<13) // MainPwr-domain LVDS(L) Power-Down bit; 0: normal, 1: power down
  287. #define R_LVDS_PWDR (1<<12) // MainPwr-domain LVDS(R) Power-Down bit; 0: normal, 1: power down
  288. #define R_LVDS_PLL 0xbe000120 //LVDS_PLL
  289. #define R_LVDS_PLL_PWDN (1<<26) //LVDS_PLL_PWDN
  290. #define R_AU_DIVA_DIVB 0x30
  291. #define SIFCLK_POST_DIV (0x1ff<<16)
  292. /* REGs 0xbe00012x */
  293. #define R_LVDS_Mapping 0x24
  294. #define R_HDMI_TEST 0x2c
  295. #define R_VCLK_div_rstn (1<<25)
  296. /* REGs 0xbe00013x */
  297. #define R_Audio_IO_Reg 0x3c
  298. #define R_I2S_MCKO_OEJ (1<<0)
  299. #define R_I2S_OEJ (1<<8)
  300. #define R_I2S_SD0_OEJ (1<<18)
  301. /* REGs 0xbe000130 */
  302. #define AU_BRCLK_POST_DIV (0)
  303. #define R_AU_DIVA_RSTN (11)
  304. /* REGs 0xbe00014x */
  305. #define R_ROSC_MMIO 0xbe000140
  306. #define R_ROSC_ENA (1<<0)
  307. /* REGs 0xbe00015x */
  308. #define R_DDRDLL_TSIO 0x54
  309. #define MCLK_DIV_YPP200M 0x58
  310. #define MCLK_DIV_YPP200M_RSTN (1<<7)
  311. /* REGs 0xbe00018x */
  312. #define R_GTJ 0x80
  313. #define R_GTJ_I2SMCK (1<<21)
  314. #define R_MEMSDM 0x88
  315. #define R_AUDIO 0x88
  316. #define R_MCLK 0x8c
  317. #define MCLK_DIV_5 (4)
  318. #define MCLK_DIV_6 (5)
  319. #define MCLK_DIV_7 (6)
  320. #define MCLK_DIV_8 (7)
  321. #define R_MCLK_DIV_RSTN (11)
  322. #define R_APLL_DIVATV_DIV (16)
  323. #define R_URCLK_DIV (16)
  324. #define R_URCLK_DIV_RSTN (23)
  325. #define R_APLL_DIVATV_RSTN (24)
  326. /* REGs 0xbe00019x */
  327. #define DMOD 0x94
  328. #define R_EN_DMJTAG (1<<18)
  329. #define GMAC 0xbe000198
  330. #define R_XRMII50M_OEJ (1<<9)
  331. #define GMACIO_DRVP (0x01<<16)
  332. #define GMACIO_DRVN (0x01<<24)
  333. /* REGs 0xbe0001ax */
  334. #define MEMPLL 0xa4
  335. #define R_MEM_SDMMAX 0xa8
  336. #define PLL_PHY 0xac
  337. #define U_MEM_DIV_RSTN (1<<13)
  338. #define R_LVDS_PLL_PWDN (1<<26) //LVDS_PLL_PWDN
  339. #define R_MAIN_CLKDIV_RSTN (1<<31)
  340. /* REGs 0xbe0001bx */
  341. #define R_IPCLK 0xb4
  342. #define R_CPUPLL 0xb8
  343. #define CPUPLL_MUL_9861_750 0xc322202c//0xc966203b //0xe788003c //750MHz
  344. #define CPUPLL_MUL_9861_884 0xc9662023 // (35+1)*24.576 = 884.736
  345. #define CPUBCLK 0xbc
  346. #define R_CPLL_PDIV_RSTN (1 << 2)
  347. #define R_CPLL_RSTN (1 << 1)
  348. #define R_CPLL_PWDN (1 << 0)
  349. #define R_MAIN2CPLL_SEL (1 << 14)
  350. #define CPUBCLK_POST_DIV (16)
  351. #define CPUCLK_DIV_2 (0x01)
  352. #define CPUCLK_DIV_3 (0x02)
  353. #define CPUCLK_DIV_4 (0x03)
  354. #define CPUCLK_DIV_5 (0x04)
  355. #define CPUBCLK_DIV_RST (0x01<<23)
  356. #define R_MAIN2CPLL_RST (1<<15)
  357. /* REGs 0xbe0001cx */
  358. #define CLKFrq_Detection_GetValueaddr 0xbe0001c0 //clk det
  359. #define R_StartAddress_200 0xbe000200
  360. /* REGs 0xbe00021x */
  361. /* REGs 0xbe00022x */
  362. #define R_HSDCLK_SDCLK_DLY 0xbe000220
  363. #define R_HSDCLKDLY_RST (1<<22)
  364. #define R_HSDCLKDLY_ENA (1<<20)
  365. #define R_HDMITX 0x28
  366. #define U_DEMOD_49M_DIV 0x2c
  367. #define U_DEMOD_49M_DIV_RSTN (1<<8)
  368. /* REGs 0xbe00024x */
  369. #define R_DPLL 0x40
  370. #define R_VDEC_ROSCK_DIV2 (1<<31)
  371. #define R_VDEC_SEL_ROSCK (1<<30)
  372. #define R_VDEC_ROSCK_CTRL_RSTN (1<<29)
  373. #define R_VDEC_ROSCK_RSTN (1<<28)
  374. #define R_UCCP_ROSCK_CTRL_RSTN (1<<13)
  375. #define R_UCCP_ROSCK_RSTN (1<<12)
  376. #define R_UCCP_ROSCK_TGT (0x1ff)
  377. #define R_VDEC 0x42
  378. #define R_CCLK_ROSCK 0x44
  379. #define R_CCLKB_SEL_ROSCK (1<<15)
  380. #define R_CCLKA_SEL_ROSCK (1<<14)
  381. #define R_CCLKA_ROSCK_CTRL_RSTN (1<<13)
  382. #define R_CCLKA_ROSCK_RSTN (1<<12)
  383. #define R_CCLKA_ROSCK_TGT (0x1ff)
  384. #define R_LDO 0x4c
  385. #define R_LDO_Mask (0xff)
  386. #define R_CPU_LDO_PWDE_ENJ (1<<7)
  387. #define R_CPU_LDO_PWD_ENJ (1<<6)
  388. #define R_LVDS_LDO_PWDE_ENJ (1<<3)
  389. #define R_LVDS_LDO_PWD_ENJ (1<<2)
  390. #define R_MEM_LDO_PWDE_ENJ (1<<1)
  391. #define R_MEM_LDO_PWD_ENJ (1<<0)
  392. /* REGs 0xbe00025x */
  393. #define R_LVDS_CH0 0x58
  394. #define R_LDO_BGDIV_Mask (0xf<<28)
  395. #if (CONFIG_CHIPID == 0x131) || (CONFIG_CHIPID == 0x8506) || (CONFIG_CHIPID == 0x6710)
  396. #define R_LDO_BGDIV (0xa<<28)
  397. #elif (CONFIG_CHIPID != 0x330)
  398. #define R_LDO_BGDIV (0x2<<28)
  399. #else
  400. #define R_LDO_BGDIV (0x9<<28) // make VBG12OUT=1.2V for MEMPLL working under the correct voltage
  401. #endif
  402. #define R_LDO_BGDIVB_Mask (0xf<<24)
  403. #if (CONFIG_CHIPID == 0x131) || (CONFIG_CHIPID == 0x8506) || (CONFIG_CHIPID == 0x6710)
  404. #define R_LDO_BGDIVB (0x8<<24)
  405. #else
  406. #define R_LDO_BGDIVB (0xc<<24)
  407. #endif
  408. #if (CONFIG_CHIPID != 0x330)
  409. #if (CONFIG_CHIPID != 0x533)
  410. #define R_LVDS_PDCTL 0x25c //0xbe00025c
  411. #else
  412. #define R_LVDS_PDCTL 0xec //0xbe0000ec
  413. #endif
  414. #define _R_LVDS_PD 0x3fff //[13-0] LVDS Power-Down bit
  415. #endif
  416. /* REGs 0xbe0100xx */
  417. #define HOST_MMIO_Address 0xbe010000
  418. #define CPU1_Initoffset 0x00c
  419. #define DDRA_Size_Offset 0x130
  420. #define HOST_CHA_DRAM_NA 0x0
  421. #define HOST_CHA_DRAM_64M 0x01
  422. #define HOST_CHA_DRAM_128M 0x02
  423. #define HOST_CHA_DRAM_256M 0x04
  424. #define HOST_CHA_DRAM_512M 0x08
  425. #if(CONFIG_DRAMSIZE == 128)
  426. #define HOST_CHA_DRAM_SIZE HOST_CHA_DRAM_128M //set CHA 512M for shadow memory.(0x9axx)
  427. #elif(CONFIG_DRAMSIZE == 64)
  428. #define HOST_CHA_DRAM_SIZE HOST_CHA_DRAM_64M //set CHA 512M for shadow memory.(0x9axx)
  429. #elif(CONFIG_DRAMSIZE == 256)
  430. #define HOST_CHA_DRAM_SIZE HOST_CHA_DRAM_256M //set CHA 512M for shadow memory.(0x9axx)
  431. #endif
  432. #define CPU0_InterruptRequestEnable1_MMIOAddress 0xbe010100
  433. #define CPU0_InterruptRequestEnable2_MMIOAddress 0xbe010104
  434. #define CEC_INT_Enablebit (1 << (34 - 32))
  435. #define HDMI_INT_Enablebit (1 << (35 - 32))
  436. #define GPIO_INT_Enablebit (1 << (44 - 32))
  437. #define IRQ_CPU0_CNT (1 << (47 - 32))
  438. #define UART_INT_Enablebit (1 << (53 - 32))
  439. #define IR_INT_Enablebit (1 << (59 - 32)) //(1<<(42-32))
  440. #define IRQ_TIMER0 (1 << (61 - 32))
  441. #define IRQ_AUDIO_SW (1 << (63 - 32))
  442. #define CPU1_InterruptRequestEnable1_MMIOAddress 0xbe010108
  443. #define CPU1_InterruptRequestEnable2_MMIOAddress 0xbe01010C
  444. /* Virtual Interrupt and Priority */
  445. #define CPU_InterruptPriority1_MMIOAddress 0xbe010110
  446. #define CPU_InterruptPriority2_MMIOAddress 0xbe010114
  447. /* Software Controller Interrupt . i.e. driving Interrupt by software */
  448. #define CPU0_SWControllerInterrupt1_MMIOAddress 0xbe010118
  449. #define CPU0_SWControllerInterrupt2_MMIOAddress 0xbe01011C
  450. #define CPU1_SWControllerInterrupt1_MMIOAddress 0xbe010120
  451. #define CPU1_SWControllerInterrupt2_MMIOAddress 0xbe010124
  452. /* Shadow set setting */
  453. #define Interrupt_ShadowSet_EICSS_MMIOAddress 0xbe010128
  454. #define CPU0_ShadowSet_EICSS 1
  455. #define CPU1_ShadowSet_EICSS (1<<8)
  456. /*Memory CTL */
  457. #define MEMORY_CTL_REG_BASE 0xbe020000
  458. #define r_chX_cke_ena (1<<4) //CKE mode :0: force low / 1: normal
  459. /*REGs 0xbe02xxxx */
  460. #define DRAM_330_size_reg 0xbe020910
  461. /*REGs 0xbe06xxxx */
  462. #define EDID_BaseAddress 0xbe060000
  463. #define EDID_slave0_ID 0xbe060024
  464. /*REGs 0xbe0axxxx */
  465. #define FlashMMIO_BaseAddress 0xbe0a0000
  466. #define FlashMMIO_FlashEndaddr 0xbe0a00c0
  467. #define FlashMMIO_Status 0xbe0a0080
  468. #define FlashMMIO_INTDriverBit (1<<7)
  469. #define FlashMMIO_DRAMAddr 0xbe0a0060
  470. #define FlashMMIO_FlashAddr 0xbe0a0040
  471. #define FlashMMIO_Command 0xbe0a0020
  472. #define FlashMMIO_Fired 0xbe0a00e0
  473. #define FlashMMIO_DefaultValue 0x00000018
  474. #define FlashMMIO_ReadID 0x05170018
  475. #define FlashMMIO_DMA_FtoD 0x0b170018
  476. #define FlashMMIO_DMA_DtoF 0x0a170018
  477. #define FlashMMIO_Erase 0x03170018
  478. #define FlashMMIO_ChipErase 0x04170018
  479. #define FlashMMIO_NullOperation 0x00170018
  480. #define FlashMMIO_ClearINT 0x00170098
  481. #define FlashMMIO_Protect_ClearINT 0x00100098
  482. #define FlashMMIO_UnProtect_ClearINT 0x00170098
  483. #define FlashMMIO_ProtectSection ((0x0e)<<8)
  484. /* 0xbe0a:0020[14..8]
  485. 0x0e: All
  486. 0x0c: Upper 1/2 flashsize
  487. 0x0a: Upper 1/4 flashsize
  488. 0x08: Upper 1/8 flashsize
  489. 0x06: Upper 1/16 flashsize
  490. 0x04: Upper 1/32 flashsize
  491. 0x02: Upper 1/64 flashsize
  492. 0x00: None
  493. */
  494. #define FlashMMIO_ProtectCMD (0x06104018+ FlashMMIO_ProtectSection)
  495. #define FlashMMIO_UnProtectCMD 0x06170018
  496. #define FlashMMIO_ProtectCMD_Part1 (0x06100018+ FlashMMIO_ProtectSection)
  497. #define FlashMMIO_ProtectCMD_Part2 (0x06104018+ FlashMMIO_ProtectSection)
  498. #define FlashMMIO_UnProtectCMD_Part1 0x06170e18
  499. #define FlashMMIO_UnProtectCMD_Part2 0x06170018
  500. #define FlashMMIO_ProtectCheck_Part1 0x07170018 // Magic add for NOR flash protect check
  501. // Data Flash
  502. #define FlashMMIO_DataFlash_ProtectSection ((0x0e)<<8)
  503. /* 0xbe0a:0020[14..8]
  504. 0x0e: All
  505. 0x0c: Upper 1/2 flashsize
  506. 0x0a: Upper 1/4 flashsize
  507. 0x08: Upper 1/8 flashsize
  508. 0x06: Upper 1/16 flashsize
  509. 0x04: Upper 1/32 flashsize
  510. 0x02: Upper 1/64 flashsize
  511. 0x00: None
  512. */
  513. #define FlashMMIO_DataFlash_ProtectCMD (0x06204018+FlashMMIO_DataFlash_ProtectSection)
  514. #define FlashMMIO_DataFlash_ProtectCMD_Part1 (0x06200018+FlashMMIO_DataFlash_ProtectSection)
  515. #define FlashMMIO_DataFlash_ProtectCMD_Part2 (0x06204018+FlashMMIO_DataFlash_ProtectSection)
  516. #define FlashMMIO_DataFlash_UnProtectCMD 0x06270018
  517. #define FlashMMIO_DataFlash_UnProtectCMD_Part1 0x06270e18
  518. #define FlashMMIO_DataFlash_UnProtectCMD_Part2 0x06270018
  519. #define FlashMMIO_DataFlash_DMA_FtoD 0x0b270018
  520. #define FlashMMIO_DataFlash_DMA_DtoF 0x0a270018
  521. #define FlashMMIO_DataFlash_Erase 0x03270018
  522. #define FlashMMIO_DataFlash_ChipErase 0x04270018
  523. #define FlashMMIO_DataFlash_NullOperation 0x00270018
  524. #define FlashMMIO_DataFlash_ClearINT 0x00270098
  525. #define FlashMMIO_DataFlash_Protect_ClearINT 0x00200098
  526. #define FlashMMIO_DataFlash_UnProtect_ClearINT 0x00270098
  527. #define FlashMMIO_DataFlash_ReadID 0x05270018
  528. #define FlashMMIO_DataFlash_DefaultValue 0x00000018
  529. /*REGs 0xbe0dxxxx */
  530. #define UART_BASE 0xbe0d0000
  531. #define UART_00 0x00
  532. #define UART_04 0x04
  533. #define UART_08 0x08
  534. #define UART_09 0x09
  535. #define UartTxPushLow (1<<6)
  536. #define UART_0c 0x0c
  537. #define UART_10 0x10
  538. #define UART_14 0x14
  539. #define UART_18 0x18
  540. #define UART_1c 0x1c
  541. /*REGs 0xbe0f010x */
  542. #define PWM0_PeriodReg 0xbe0f0100
  543. #define PWM1_PeriodReg 0xbe0f0108
  544. #define PWM2_BackLightLevel_PeriodReg 0xbe0f0110
  545. #define PWM3_BackLightLevel_PeriodReg 0Xbe0f0118
  546. #define PWM0_CtrlReg 0xbe0f0104
  547. #define PWM1_CtrlReg 0xbe0f010c
  548. #define PWM2_BackLightLevel_CtrlReg 0xbe0f0114
  549. #define PWM3_BackLightLevel_CtrlReg 0xbe0f011c
  550. #define PWM_Enable_Bit (1 << 31) // 0: disable pwm, 1: enable pwm
  551. #define PWM_Inverse_Bit (1 << 30) // set 1 to inverse the pwm output waveform
  552. #define PWM_Duty_Mask 0x3fffffff // 1 unit = 40.69 ns (using 24.576MHz clock)
  553. // NOTE : The LED Light twinkle frequency = PWM_Period_Value / PWM_Duty_Value
  554. #define PWM3_Reserved_PeriodReg 0xbe0f0118
  555. #define PWM3_Reserved_CtrlReg 0xbe0f011c
  556. /*REGs 0xbe0f020x */
  557. #define TMR0_CtrlReg 0xbe0f0200
  558. #define TMR1_CtrlReg 0xbe0f0204
  559. #define TMR2_CtrlReg 0xbe0f0208
  560. #define TMR_Active_EN (1<<31)
  561. #define TMR_AutoLoad_EN (1<<30)
  562. #define TMR_Int_EN (1<<29)
  563. #define TMR_IntClear (1<<28)
  564. #define TMR2_CountOutReg 0xbe0f0210
  565. /*REGs 0xbe0f030x */
  566. #define WDT_MMIO 0xbe0f0000
  567. #define WDT0_Control_Offset 0x300
  568. #define WDT0_DisableBit (1<<31)
  569. #define WDT0_RefreshBit (1<<30)
  570. #define WDT1_RefreshBit (1<<29)
  571. #define WDT2_RefreshBit (1<<28)
  572. #define WDT1_Control_Offset 0x304
  573. #define WDT1_EnableBit (1<<31)
  574. #define WDT1_TimeoutSelBit (3<<29)
  575. #define WDT1_TimeoutSel (3<<29) /* 1:Warm Reset, 2:Cold Reset, 3: RTC Reset*/
  576. #define WDT1_WarmReset 0x20000000 // (1<<29)
  577. #define WDT1_ColdReset 0x40000000 // (2<<29)
  578. #define WDT1_RTCReset 0x60000000 // (3<<29)
  579. #define WDT1_CountDownValueBit (0x1fffffff<<0)
  580. #define WDT1_CountDownValue (0x100<<0) /* Unit: u(s) , 1u~6 hours*/
  581. #define WDT2_Control_Offset 0x308
  582. #define WDT2_EnableBit (1<<31)
  583. #define WDT2_TimeoutSelBit (3<<29)
  584. #define WDT2_TimeoutSel (3<<29) /* 1:Warm Reset, 2:Cold Reset, 3: RTC Reset*/
  585. #define WDT2_WarmReset 0x20000000 // (1<<29)
  586. #define WDT2_ColdReset 0x40000000 // (2<<29)
  587. #define WDT2_RTCReset 0x60000000 // (3<<29)
  588. #define WDT2_CountDownValueBit (0x1fffffff<<0)
  589. #define WDT2_CountDownValue (0x100<<0) /* Unit: m(s) , 1m to 6.2 days*/
  590. #define WDT3_Control_Offset 0x30C
  591. #define WDT3_WarmReset 0xD123ABCD
  592. #define WDT3_ColdReset 0xE123ABCE
  593. #define WDT3_RTCReset 0xF123ABCF
  594. /*REGs 0xbe0f050x */
  595. #define RTC_REG_500 0xbe0f0500 //free now
  596. #define RTC_REG_504 0xbe0f0504 //freenow
  597. #define RTC_REG_508 0xbe0f0508 //free now
  598. #define RTC_REG_50c 0xbe0f050c //free now
  599. /* REGs 0xbe0f051x */
  600. #define UMF_flag 0xbe0f0510
  601. #define CEC_data0 0x0
  602. #define CEC_data1 0x1
  603. #define RTC_WakeUpdata 0x2 //free now.
  604. #define UMF_flag_Misc 0x3 //free now.
  605. #define RebootCounter 0xbe0f0514
  606. #define RTC_REG_518 0xbe0f0518//free now
  607. #define RTC_REG_51c 0xbe0f051c//free now
  608. /* REGs 0xbe0f052x */
  609. #define Aux_Non_Volatitle_Address 0xbe0f0520
  610. #define WDT_ColdRest_Flag (1<<0)
  611. #define UMF_USB_update (1<<1) //UMF will set 1 and do USB-update
  612. #define WDT_ColdRest (1<<2) //1:ColdRest/0:No ColdRest
  613. #define OTA_update_flag (1<<3)
  614. #define AC_PlugIn_FirstTime (1<<4) //for UMF to check AC_PlugIn_FirstTime or not
  615. #define PowerSequence_WaitVGASyncEnableFlag (1<<5) //UMF set this flag if idle power off @ PC source
  616. #define BootingMenu_1Time_Enable (1<<6)//F2
  617. #define AutoPowerOn_1Time_Enable (1<<7)
  618. #define OnEvent_INT_Status_MMIOAddress 0xbe0f0521
  619. #define Special_FileBit0 (1<<0)
  620. #define Special_FileBit1 (1<<1)
  621. #define OnEvent_INT_OnEventStatusBit (1<<7) //==> 0X set by the UMF if the Kernel turns off normally
  622. #define OnEvent_INT_VGASyncDrivingBit (1<<6) // set by the UMF if the Kernel turns off from the VGA (PC mode) source normally, but.. why we need this?
  623. #define OffEvent_INT_Status_MMIOAddress 0xbe0f0522
  624. #define OffEvent_INT_OnEventStatusBit (1<<7) // set to record the power-on request; checked and read by both the BootROM & the UMF
  625. #define OffEvent_INT_VGASyncDrivingBit (1<<6) // set to record the VGA-WakeUp request; checked and read by the UMF
  626. #define OffEvent_INT_CECDrivingBit (1<<5)
  627. #define OffEvent_INT_AndroidUpdate_DrivingBit (1<<4)
  628. #define OffEvent_INT_RTCWakeUpDrivingBit (1<<3)
  629. #define OffEvent_INT_PWRBTNDrivingBit (1<<2)
  630. #define OffEvent_INT_UARTDrivingBit (1<<1) // Press 'F1' to trigger the "Pwr-On-with-Default-Setting" mode
  631. #define OffEvent_INT_IRDrivingBit (1<<0)
  632. #define RTC_REG_523 0xbe0f0523
  633. #define SilentUpdate (1<<0) // silence power check booting
  634. #define CEC_8051_OneTouchPlayEnable (1<<1) //8051 enable one touch play if set
  635. #define SpecialFileCheckBit (1<<2) // silence power check booting
  636. #define FAC_UPDTAE_AP_Bit (1<<3) // silence power check booting
  637. #define DirectBootAfterUpdate (1<<4) // if update success then direct bootup
  638. #define AGING_TEST_DONE_BIT (1<<5) // if aging test done than set this bit
  639. #define IO_on_USB_BIT (1<<6) // if boot by L1, read/write data on usb (not flash)
  640. #define FAC_REMOTE (1<<7)
  641. #define RTC_REG_524 0xbe0f0524
  642. #define CodeCompleteCheckBit (1<<0) //
  643. //#define EnforceResetBit (1<<1) //
  644. #define RebootDoneBit (1<<2) //
  645. #define MIPSStandbyModeBit (1<<3)
  646. #define Keypad0CheckBit (1<<4)
  647. #define Keypad1CheckBit (1<<5)
  648. #define KeypadIntCheckBit (1<<6)
  649. #define RTC_REG_526 0xbe0f0526
  650. #define HdmiAWakeup (1<<0) //
  651. #define HdmiBWakeup (1<<1) //
  652. #define HdmiCWakeup (1<<2) //
  653. #define BootingLogo (1<<3) //
  654. #define UsingNand (1<<4)
  655. #define NandSysUpdate (1<<5)
  656. #define VGAWakeup (1<<6)
  657. #define AC_FACTORY (1<<7)
  658. #define PowerSequence_ModeMask 0x6
  659. #ifdef CONFIG_SUPPORT_SYSTEM_STANDBYTIME
  660. #define RTC_REG_527 0xbe0f0527
  661. /* [0:7] 1 bytes for store offtime ; time conut unit:30 minutes */
  662. #endif
  663. /* REGs 0xbe13xxxx */
  664. #define USB_MMIO_StartAddr 0xbe138000
  665. #define USB_OHCI_IOConfig_Value 0x00002000
  666. #define USB_PHY0 0xbe0001ac
  667. #define USB_PHY 0xbe0001b4
  668. #define USB_XHCI_OPTION 0xbe00024c
  669. /* USB EHCI I/O configuration */ // 20080520
  670. #define USB_EHCI_IOConfig1_MMIOAddr 0xbe128044
  671. #define USB_EHCI_IOConfig1_Value 0x08000060
  672. #define USB_EHCI_IOConfig2_MMIOAddr 0xbe128048
  673. #define USB_EHCI_IOConfig2_Value 0x0c35296f//0x003AADD6//0x0012ADD6
  674. #define USB_EHCI_IOConfig3_MMIOAddr 0xbe12804c
  675. #define USB_EHCI_IOConfig3_Value 0x0000e370
  676. #if (CONFIG_CHIPID == 0x131 || CONFIG_CHIPID == 0x8506 || CONFIG_CHIPID == 0x6710)
  677. #define USB_HOST_CLK 0x00007530//30MHz
  678. #endif
  679. /* REGs 0xbe1cxxxx */
  680. #define BRVIP_BASE_ADDRESS 0xbe1c0000
  681. /* FLASH 0xbc000000 */
  682. #define CodeFlash_Redir_BaseAddress 0xBC000000
  683. #define SysConfigs 0xbc000000 //SysCon_Cur_FlashStarAddr
  684. #define SysCon_DRAMFrq 0x28
  685. #define SysCon_MCLK_DIV 0x29
  686. #define SysCon_CPUBCLK 0x2a
  687. #define SysCon_TGT 0x2b
  688. #define SysCon_MEMPLL 0x2c
  689. #define SysCon_CPLL 0x30
  690. #define SysCon_SSC1 0x34
  691. #define SysCon_SSC2 0x36
  692. #define SysCon_MAIN_DIV 0x38
  693. #define SysCon_R_ICLK_POST_DIV 0x3c
  694. #define SysCon_R_IPCLK_DIV 0x3d
  695. #define SysCon_R_CARDRCLK_DIV 0x3e
  696. #define SysCon_R_BLTCLK_DIV 0x3f
  697. #define SysCon_PHY_00 0x40
  698. #define SysCon_PHY_04 0x44
  699. #define SysCon_PHY_08 0x48
  700. #define SysCon_PHY_0c 0x4c
  701. #define SysCon_PHY_10 0x50
  702. #define SysCon_PHY_14 0x54
  703. #define SysCon_PHY_18 0x58
  704. #define SysCon_PHY_1C 0x5c
  705. #define SysCon_MCTL_00 0x60
  706. #define SysCon_MCTL_04 0x64
  707. #define SysCon_MCTL_110 0x68
  708. #define SysCon_MCTL_200 0x6c
  709. #define SysCon_MCTL_208 0x70
  710. #define SysCon_MCTL_210 0x74
  711. #define SysCon_MCTL_20f 0x78
  712. #define SysCon_PHY_16 0x79
  713. #define SysCon_EDQS_LOOP 0x7a
  714. #define SysCon_MCTL_300 0x7c
  715. /* FLASH 0xbc010000 */
  716. #define VersionAddress 0xBC010020 /* version @ 8051 */
  717. #if 0
  718. #define OptionData_StartAddr 0xbc040080
  719. #define OptionData_LED_PWM_Addr (OptionData_StartAddr + 0x1e5)
  720. #define OptionData_LED_PWM_INV_Offset 7
  721. #define OptionData_LED_GPIO_Addr (OptionData_StartAddr + 0x1e4)
  722. #define OptionData_LED_GPIO_INV_Offset 7
  723. #define Custom_IR_StartAddr (OptionData_StartAddr)
  724. #define Custom_IR_Protocol 0x0 /* Byte: */
  725. #define Custom_IR_Pwr0Addr 0x1 /* Byte: */
  726. #define Custom_IR_Pwr0Data 0x2 /* Byte: */
  727. #define Custom_IR_Pwr1Addr 0x3 /* Byte: */
  728. #define Custom_IR_Pwr1Data 0x4 /* Byte: */
  729. #if IR_EXTEND
  730. #define Custom_IR_Pwr0Addr_ 0x5 /* Byte: */
  731. #define Custom_IR_Pwr1Addr_ 0x6 /* Byte: */
  732. #endif
  733. #define Custom_LED_StartAddr (OptionData_StartAddr + 0x499)
  734. #define Custom_LED_ShadowAddr (OptionData_ShadowAddr + 0x499)
  735. #define Custom_LED_EntryOFF 0x0 /* Byte: */
  736. #define Custom_LED_OFF 0x2 /* Byte: */
  737. #define Custom_LED_EntryOn 0x4 /* Byte: */
  738. #define Custom_LED_SysCon_LED_Custom_LED_DPMSON 0x5 /* Byte: */
  739. #define Custom_LED_LogoOn 0x6 /* Byte: */
  740. #define Custom_LED_EntryLinux 0x8 /* Byte: */
  741. #define Custom_LED_AllReady 0xa /* Byte: */
  742. #define Custom_LED_ColorMask 0xc0 //0xf0 ?
  743. #define Custom_LED_Green 0x80
  744. #define Custom_LED_Red 0x40
  745. #define Custom_LED_Orange (Custom_LED_Green | Custom_LED_Red)
  746. #define Custom_LED_PeriodLevelMask 0x0f
  747. #define Custom_LED_PeriodLevelMax Custom_LED_PeriodLevelMask
  748. #define Custom_HDMI_info (OptionData_StartAddr + 0x4c3)
  749. #define Custom_HDMISwitchMap 0x0 /* Byte: */
  750. #define Custom_HDMIPortMap 0x1 /* WORD: */
  751. #endif
  752. /* FLASH 0xbc080000 */
  753. //#define KMFBR_ShareData_StartAddress 0xbc085400
  754. /* FLASH 0xbc0d0000 */
  755. /* Dram: 0xa0000000 */
  756. //audio comq buffer, overlap bootrom code. carefuly use it. gaia
  757. #define CMDQ_INFO_ADDR (0xa0000200) //#define SISCMDQ_INFO_ADDR (0xba00d800)
  758. #define AUDIO_RESERVED_MEM_reg_reg 0xbe090200 //2013.09.24 audio rom get reserve memory address from this reg
  759. /* Dram: Shadow 0x9a000000 (please remove it later)*/
  760. #define CPU0_ISR_Address_cached 0x80050000
  761. #define CPU1_ISR_Address_cached 0x80051000
  762. #define CPU0_ISR_Address 0xa0050000
  763. #define CPU1_ISR_Address 0xa0051000
  764. /* Dram: Shadow 0x9a010000 (please remove it later)*/
  765. #define RESERV 0xa0052000
  766. #define RESERV2 0xa0052004
  767. /* Dram: Shadow 0x9a010000 (please remove it later)*/
  768. /* CPU1 Ready Flag */
  769. #define CPU_SyncStatus 0xa0052100//0xba010148
  770. #define CPU1_Status_AudioCodeReady (1<<0)
  771. #define CPU1_Status_EnterLinux (1<<1) //
  772. #define CPU1_Status_LoadKernelReady (1<<2) // Magic 2011.10.03
  773. #define CPU1_Status_MoveKernelFromNandOK (1<<3) // TH 2012.0515
  774. #define CPU1_Status_SecondLogoDisplay (1<<4)
  775. #define MEMSIZE_INFO_ADDR 0xa0052108//0xba026078 // the address of the memory size info (which is saved by the BootLoader/BootROM)
  776. #define PANELSIZE_INFO_ADDR 0xa0052109//0xba026079 // the address of the panel size info (which is saved by the BootLoader/BootROM)
  777. #define BOARD_INFO_ADDR 0xa005210b//0xba02607b // the address of the board info (which is saved by the BootLoader/BootROM)
  778. #define PROJECTID_ADDR 0xa005210c//0xba02607c // the address of the Project ID of current kernel version (which is saved by the BootLoader/BootROM)
  779. //#define AUDIO_RESMEM_ADDR 0xa0032110//0xba026090// the address of the data - "Address of the Reserved Memory for the AudioROM"
  780. #define AUDIO_RESMEM_DEFAULT_ADDR (RMEM_START_ADDR+0xa0000000) // default uncached address of the reserved memory for the AudioROM
  781. #define CPU1_ShutdownSync 0xa0052114//0xba026094
  782. #define KNL_INITRD_ADDR 0xa005211c//0xba02609c //(SysCon_Cur_MemStarAddr + SysCon_KNL_InitRDAddr) // the address of the unpacked initramfs cpio data for the Kernel
  783. #define LOGO_SHOW_BUF_SIZE 5888*1200//8294400 //2015.11.18 (1920 x 1080) x 4 = 8294400 , totally four buffers, Y,U,V,UV
  784. #define LOGO_SHOW_BUF (((CONFIG_DRAMSIZE)*1024*1024)-LOGO_SHOW_BUF_SIZE + 0xa0000000)//0xa3753000 // default address of the unpacked initramfs cpio data for the Kernel
  785. /* INITRD | LOGO_BUF ( |<END>*/
  786. #define BootParameter_AudioAddress 0xa0052120//0xba011000
  787. #define BootParameter_AudioStatus 0x0
  788. #define BootParameter_AudioMemStartaddress 0x4
  789. #define BootParameter_AudioMemUsingSize 0x8
  790. #define BootParameter_AudioISREntryAddress 0xc
  791. #define BootParameter_AudioROM_GP 0x10
  792. #define BootParameter_AudioROM_SP 0x14
  793. /* Dram: Shadow 0x9a020000 (please remove it later)*/
  794. #define OptionData_ShadowAddr 0xa0052200//0x9a062000
  795. #define OptionData_Size SPI_OPTION_DATA_SIZE
  796. #define OptionData_GPIO_ShadowAddr (OptionData_ShadowAddr + 0xa4) //SysCon_Cur_FlashStarAddr
  797. #define OptionData_GPIO_USAGE_ShadowAddr (OptionData_GPIO_ShadowAddr + 0x100)
  798. #define GPIO_MainEnable (1<<5)
  799. #define GPIO_MainMode (1<<6)
  800. #define GPIO_MainValue (1<<7)
  801. #define GPIO_MainInternalPU (1<<0)
  802. #define GPIO_MainInternalPD (1<<1)
  803. #define Option_IRset_ShadowAddr (OptionData_ShadowAddr + 72) // 0~71 Aus GPIO table
  804. #if 0
  805. #define Option_GreenLED_ShadowAddr (Option_IRset_ShadowAddr + 0x90)
  806. #define Option_RedLED_ShadowAddr (Option_IRset_ShadowAddr + 0x91)
  807. #define Option_LEDOnStatus_ShadowAddr (Option_IRset_ShadowAddr + 0x92)
  808. #define Option_LEDOffStatus_ShadowAddr (Option_IRset_ShadowAddr + 0x93)
  809. #define Option_PanelPWROnGPIONum_ShadowAddr (Option_IRset_ShadowAddr + 0x94)
  810. #define Option_PanelBackLightGPIONum_ShadowAddr (Option_IRset_ShadowAddr + 0x95)
  811. #define Option_PanelPWMNum_ShadowAddr (Option_IRset_ShadowAddr + 0x96)
  812. #define Option_DVD_IROUT_GPIO_NO (Option_IRset_ShadowAddr + 0x97)
  813. #endif
  814. #define PanelSet_ShadowAddress 0xa0053000//0xba062c00
  815. //todo: tel drive, do it self #define SPI_HDCPKEY_SHADOWADDR 0x9a069800
  816. #define kernel_header_ShadowAddress 0xa0053800//0xba076200
  817. #define KMFBR_ShareData_ShadowAddress 0xa0053880//0xba076000 //todo, search algorithm
  818. #if 0
  819. #define AlarmAddr0 0x0c
  820. #define UMF_EnableUARTA (KMFBR_ShareData_ShadowAddress + 0x09) // 0xbc0ba009 // 2011.11.10
  821. #define UMF_HideBootLogo (24) // hide logo while HideBootLogo==0x62
  822. #define UMF_LVDSEnable (25)
  823. #define UMF_LVDSFormat (0x1c) // 1c-3f
  824. #define UMF_PwmFreq (0x40)
  825. #endif
  826. /* VIP Table */
  827. #define VipTable_ShadowAddress (KMFBR_ShareData_ShadowAddress + 256)//0xa0054000
  828. #define VipTable_ShadowSize (160*1024)
  829. /* Gamma Table */
  830. #define GammaTable_ShaodwAddress (VipTable_ShadowAddress+VipTable_ShadowSize)//0xa0072000
  831. #define GammaTable_ShaodwSize (13*1024)
  832. /* ColorLUT Table */
  833. #define ColorLUTTable_ShadowAddress (GammaTable_ShaodwAddress+GammaTable_ShaodwSize)//0xa0075400
  834. #define ColorLUTTable_ShaodwSize (256*1024)
  835. #define SPI_EDID_ShadowAddress (ColorLUTTable_ShadowAddress + ColorLUTTable_ShaodwSize)//0xa00c5400
  836. #define SPI_EDID_ShaodwSize (1*1024)
  837. #define SPI_HDCPKEY_ShadowAddress (SPI_EDID_ShadowAddress + SPI_EDID_ShaodwSize)//0xa00c5800
  838. #define SPI_HDCPKEY_ShaodwSize (1*1024)
  839. #define SPI_Custable_ShadowAddress (SPI_HDCPKEY_ShadowAddress + SPI_HDCPKEY_ShaodwSize)//0xa00c5c00
  840. #ifndef CONFIG_GCOV_KERNEL_SUPPORT
  841. #ifdef CONFIG_CHIP_8501
  842. #define SIM_MALLOC_POOL1_START 0xa0700000 //after kernel (about 9M)
  843. #else
  844. #define SIM_MALLOC_POOL1_START 0xa0a00000 //after kernel (about 9M)
  845. #endif
  846. #else
  847. #define SIM_MALLOC_POOL1_START 0xa0d00000
  848. #endif
  849. #ifdef CONFIG_SUPPORT_TCON
  850. #define SIM_MALLOC_POOL2_START 0xa1300000 //skip 0xa0100000 + knl core size (about 6M) + audio rom (1.5M) + TCON (1.5M)
  851. #else
  852. #define SIM_MALLOC_POOL2_START 0xa1200000 //skip 0xa0100000 + knl core size (about 6M) + audio rom (2M)
  853. #endif
  854. #define SIM_MALLOC_POOL1_SIZE (0xa1000000 - SIM_MALLOC_POOL1_START) //before audio rom
  855. #define AudioInitStartEntryAddress 0x81000000//0x9a0f0000 // cached
  856. /* MIPS flash address */
  857. #define Booting_BaseAddress 0xBFC00000
  858. #define Booting_CachedBaseAddress 0x9FC00000
  859. #define Shadow_NonCacheBaseAddress 0xBA000000
  860. #define Shadow_BaseAddress 0x9A000000
  861. #define DMA512M_Mask 0x1fffffff //MIPS 512M limit mask (CHIP >= 9565 )
  862. //#define _sp (0x80000000+2048) //2k
  863. #define _ROUND_UP( dividend, divisor ) ( ( (dividend) + (divisor-1) ) / (divisor) )
  864. #define ROUND_64K_ALIGNMENT( dividend ) ( _ROUND_UP( dividend, 64*1024 )*64*1024 )
  865. #define __cpu0 __attribute__((__section__(".cpu0.text")))
  866. #define __cpu0_data __attribute__((__section__(".cpu0.data")))
  867. #endif