board.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. #ifndef _BOARD_H
  2. #define _BOARD_H
  3. /********** display configuration **********/
  4. #define LCD_INTERFACE_TTL 0
  5. #define LCD_INTERFACE_LVDS 1
  6. #define LCD_INTERFACE_CPU 2
  7. #define LCD_INTERFACE_MIPI 3
  8. #define LCD_WIRING_MODE_RGB 0
  9. #define LCD_WIRING_MODE_RBG 1
  10. #define LCD_WIRING_MODE_GRB 2
  11. #define LCD_WIRING_MODE_GBR 3
  12. #define LCD_WIRING_MODE_BRG 4
  13. #define LCD_WIRING_MODE_BGR 5
  14. #define LCD_WIRING_BIT_ORDER_MSB 0
  15. #define LCD_WIRING_BIT_ORDER_LSB 1
  16. #define LVDS_PANEL_FORMAT_VESA 0
  17. #define LVDS_PANEL_FORMAT_JEDIA 1
  18. #define LVDS_PANEL_DATA_8BIT 0
  19. #define LVDS_PANEL_DATA_6BIT 1
  20. #define LVDS_CLKEDGE_POSITIVE 0
  21. #define LVDS_CLKEDGE_NEGATIVE 1
  22. #define CPU_PANEL_18BIT_MODE 0
  23. #define CPU_PANEL_16BIT_MODE 1
  24. #define CPU_PANEL_9BIT_MODE 2
  25. #define CPU_PANEL_8BIT_MODE 3
  26. #define LCD_ROTATE_ANGLE_0 0
  27. #define LCD_ROTATE_ANGLE_90 1
  28. #define LCD_ROTATE_ANGLE_180 2
  29. #define LCD_ROTATE_ANGLE_270 3
  30. #define LCD_H_FLIP 0 //水平镜像
  31. #define LCD_V_FLIP 0 //垂直镜像
  32. //#define LCD_CLK_INVERSE //LCD时钟极性反向
  33. #define LCD_ROTATE_ANGLE LCD_ROTATE_ANGLE_0
  34. #define LCD_WIDTH 1920
  35. #define LCD_HEIGHT 720
  36. #define LCD_BPP 32
  37. #define LCD_INTERFACE_TYPE LCD_INTERFACE_LVDS
  38. #define DOUBLE_LVDS_ENABLE 1
  39. #if !DOUBLE_LVDS_ENABLE
  40. #define SINGLE_LVDS_CH0_EN 1
  41. #define SINGLE_LVDS_CH1_EN 0
  42. #endif
  43. #if LCD_INTERFACE_TYPE == LCD_INTERFACE_TTL
  44. #define LCD_WIRING_MODE LCD_WIRING_MODE_RGB
  45. //#define LCD_WIRING_BIT_ORDER LCD_WIRING_BIT_ORDER_LSB
  46. #define LCD_WIRING_BIT_ORDER LCD_WIRING_BIT_ORDER_MSB
  47. #elif LCD_INTERFACE_TYPE == LCD_INTERFACE_LVDS
  48. #define LCD_WIRING_MODE LCD_WIRING_MODE_RGB
  49. #define LCD_WIRING_BIT_ORDER LCD_WIRING_BIT_ORDER_MSB
  50. #define LVDS_PANEL_FORMAT LVDS_PANEL_FORMAT_VESA
  51. #define LVDS_PANEL_DATA LVDS_PANEL_DATA_8BIT
  52. #define LVDS_CLKEDGE LVDS_CLKEDGE_POSITIVE
  53. #define LVDS_SCREEN_RST_GPIO 74
  54. #elif LCD_INTERFACE_TYPE == LCD_INTERFACE_CPU
  55. #define CPU_PANEL_DATA CPU_PANEL_8BIT_MODE
  56. #elif LCD_INTERFACE_TYPE == LCD_INTERFACE_MIPI
  57. #define LCD_WIRING_MODE LCD_WIRING_MODE_RGB
  58. #define LCD_WIRING_BIT_ORDER LCD_WIRING_BIT_ORDER_MSB
  59. #endif
  60. #define FB_SIZE (LCD_WIDTH * LCD_HEIGHT * LCD_BPP / 8)
  61. #define VIDEO_DISPLAY_WIDTH ((LCD_WIDTH + 15) & (~0xF))
  62. #define VIDEO_DISPLAY_HEIGHT ((LCD_HEIGHT + 15) & (~0xF))
  63. #define VIDEO_DISPLAY_BUF_NUM 2
  64. #if (LCD_WIDTH == 1024 && LCD_HEIGHT == 600)
  65. #define LCD_TIMING_VBP 1
  66. #define LCD_TIMING_VFP 1
  67. #define LCD_TIMING_VSW 30
  68. #define LCD_TIMING_HBP 100
  69. #define LCD_TIMING_HFP 100
  70. #define LCD_TIMING_HSW 370
  71. #define LCD_CLK_FREQ 50000000
  72. #elif (LCD_WIDTH == 1920 && LCD_HEIGHT == 720)
  73. #define LCD_TIMING_VBP 11
  74. #define LCD_TIMING_VFP 14
  75. #define LCD_TIMING_VSW 7
  76. #define LCD_TIMING_HBP 38*2
  77. #define LCD_TIMING_HFP 30*2
  78. #define LCD_TIMING_HSW 36*2
  79. #define LCD_CLK_FREQ 96000000
  80. #elif (LCD_WIDTH == 800 && LCD_HEIGHT == 480)
  81. #define LCD_TIMING_VBP 1
  82. #define LCD_TIMING_VFP 1
  83. #define LCD_TIMING_VSW 30
  84. #define LCD_TIMING_HBP 50
  85. #define LCD_TIMING_HFP 50
  86. #define LCD_TIMING_HSW 180
  87. #define LCD_CLK_FREQ 35000000
  88. #elif (LCD_WIDTH == 1280 && LCD_HEIGHT == 720)
  89. #define LCD_TIMING_VBP 5
  90. #define LCD_TIMING_VFP 65
  91. #define LCD_TIMING_VSW 2
  92. #define LCD_TIMING_HBP 16
  93. #define LCD_TIMING_HFP 42
  94. #define LCD_TIMING_HSW 2
  95. #define LCD_CLK_FREQ 60000000
  96. #elif (LCD_WIDTH == 1280 && LCD_HEIGHT == 480)
  97. #define LCD_TIMING_VBP 5
  98. #define LCD_TIMING_VFP 8
  99. #define LCD_TIMING_VSW 3
  100. #define LCD_TIMING_HBP 16
  101. #define LCD_TIMING_HFP 28 //26
  102. #define LCD_TIMING_HSW 12
  103. #define LCD_CLK_FREQ 40000000
  104. #elif (LCD_WIDTH == 480 && LCD_HEIGHT == 1280)
  105. #define LCD_TIMING_VBP 6// 14
  106. #define LCD_TIMING_VFP 6// 16
  107. #define LCD_TIMING_VSW 16// 2
  108. #define LCD_TIMING_HBP 16
  109. #define LCD_TIMING_HFP 36
  110. #define LCD_TIMING_HSW 26
  111. #define LCD_CLK_FREQ 50000000
  112. #else
  113. #error "no lcd timing configuraion."
  114. #endif
  115. /*******************************************/
  116. /************ adc configuration ************/
  117. //#define ADC_TOUCH
  118. //#define ADC_KEY
  119. /*******************************************/
  120. /******* video in configuration *******/
  121. #define VIDEO_DECODER_RN6752
  122. //#define VIDEO_DECODER_MIPI
  123. //#define VIDEO_DECODER_ARK7116M
  124. //#define VIDEO_DECODER_ARK7116
  125. #define VIN_CVBS_PAL 0
  126. #define VIN_CVBS_NTSC 1
  127. #define VIN_AHD_720P_25 2
  128. #define VIN_AHD_720P_30 3
  129. #define VIN_AHD_1080P_25 4
  130. #define VIN_AHD_1080P_30 5
  131. #define VIDEO_IN_FORMAT VIN_AHD_720P_25//VIN_CVBS_NTSC
  132. #if VIDEO_IN_FORMAT == VIN_CVBS_PAL
  133. #define VIN_WIDTH 720
  134. #define VIN_HEIGHT 288
  135. #elif VIDEO_IN_FORMAT == VIN_CVBS_NTSC
  136. #define VIN_WIDTH 720
  137. #define VIN_HEIGHT 240
  138. #elif VIDEO_IN_FORMAT == VIN_AHD_720P_25 || VIDEO_IN_FORMAT == VIN_AHD_720P_30
  139. #define VIN_WIDTH 1280
  140. #define VIN_HEIGHT 720
  141. #elif VIDEO_IN_FORMAT == VIN_AHD_1080P_25 || VIDEO_IN_FORMAT == VIN_AHD_1080P_30
  142. #define VIN_WIDTH 1920
  143. #define VIN_HEIGHT 1080
  144. #endif
  145. #if VIN_WIDTH * VIN_HEIGHT > 0x96000
  146. #define VIN_SMALL_MEM
  147. #endif
  148. /*******************************************/
  149. /************ carback configuration ********/
  150. //#define CARBACK_DETECT
  151. /*******************************************/
  152. /********* touchscreen configuration *******/
  153. //#define TP_SUPPORT
  154. /********* wrap configuration *******/
  155. //#define WRAP_SUPPORT
  156. #ifdef TP_SUPPORT
  157. /* Select one tp IC */
  158. //#define TP_USE_GT9XX
  159. //#define TP_USE_GA657X
  160. //#define TP_USE_FT6336U
  161. /* Config tp parameters */
  162. #define TP_GPIO_INT 4
  163. #define TP_GPIO_RST 5
  164. #define TP_INV_X 0
  165. #define TP_INV_Y 0
  166. #define TP_INV_XY_AXIS 0 //翻转XY轴
  167. #define TP_MT_TOUCH 0 //支持多点触摸
  168. #endif
  169. /*******************************************/
  170. /*********** sdmmc configuration ***********/
  171. #define SDMMC0_SUPPORT
  172. #define SDMMC1_SUPPORT
  173. #if defined(SDMMC0_SUPPORT) || defined(SDMMC1_SUPPORT)
  174. #define SDMMC_SUPPORT
  175. #endif
  176. /*******************************************/
  177. /*********** uart configuration ************/
  178. #define UART_MCU_PORT 3
  179. #define UART_DEBUG_PORT UART_ID0
  180. /*******************************************/
  181. /************ rtc configuration ************/
  182. //#define RTC_SUPPORT
  183. /*******************************************/
  184. /************ remote configuration ************/
  185. //#define REMOTE_SUPPORT
  186. /*******************************************/
  187. /************ pwm capture configuration ************/
  188. //#define PWM_CAP_SUPPORT
  189. /*******************************************/
  190. /************ i2c configuration ************/
  191. #define DW_I2C0_SUPPORT
  192. //#define DW_I2C1_SUPPORT
  193. //#define ANALOG_I2C_SUPPORT
  194. #define I2C_GPIO0_SDA_PIN 66
  195. #define I2C_GPIO0_SCL_PIN 65
  196. /*******************************************/
  197. /************ dw spi configuration ************/
  198. #define DW_SPI0_SUPPORT
  199. #define DW_SPI2_SUPPORT
  200. /*******************************************/
  201. /************ ecspi configuration ************/
  202. #define EC_SPI1_SUPPORT
  203. /*******************************************/
  204. /************ dma configuration ************/
  205. /* the smaller channel has higher priority */
  206. #define SPI0_RX_DMA_CH 0
  207. #define I2S_DMA_RXCH 3
  208. #define I2S_DMA_TXCH 4
  209. #define I2S1_DMA_RXCH I2S_DMA_RXCH
  210. #define I2S1_DMA_TXCH I2S_DMA_TXCH
  211. #define ECSPI_TX_DMA_CH 5
  212. #define ECSPI_RX_DMA_CH 6
  213. /*******************************************/
  214. /************ usb configuration ************/
  215. #define USB_SUPPORT
  216. #define USB_MODE_ID -1
  217. //#define USB_DMA
  218. //#define USB_UVC_SUPPORT
  219. #define CONFIG_USB_DWC2_HOST 1
  220. #define CONFIG_USB_NEW_DWC2_HOST 1
  221. #define CONFIG_USB_DWC2_PERIPHERAL 1
  222. #define CONFIG_USB_NEW_DWC2_GADGET 1
  223. #if USB_MODE_ID && USB_MODE_ID != -1
  224. #define CONFIG_USB_DEVICE_CDC_NCM 1
  225. #endif
  226. /*******************************************/
  227. /************ carlink configuration ************/
  228. #ifdef CARLINK_ENABLE /* define in iar options */
  229. #define WIFI_SUPPORT
  230. #endif
  231. #ifdef WIFI_SUPPORT
  232. #define CARLINK_EY 0
  233. #define CARLINK_EC 1
  234. #define WIFI_RESET_IO 95
  235. #else
  236. #define CARLINK_EY 0
  237. #define CARLINK_EC 0
  238. #endif
  239. #if CARLINK_EY && CARLINK_EC
  240. #error "Do not choose two car links"
  241. #endif
  242. #if CARLINK_EC == 1
  243. #define USE_LWIP 1
  244. #else
  245. #define USE_LWIP 0
  246. #endif
  247. #define BT_RESET_IO 94
  248. #define BT_UART_PORT 1
  249. //#define RELTECK_WIFI_AP_MODE
  250. /*******************************************/
  251. /************ audio configuration ************/
  252. #define I2S_ID0 0
  253. #define I2S_ID1 1
  254. #define I2S_NUMS 2
  255. /* add your adc type */
  256. #define AUDIO_CODEC_ADC_NONE 0 //Not use codec adc ic or no need driver.
  257. #define AUDIO_CODEC_ADC_ES7243E 1 //Use codec adc ic es7243e.
  258. /* add your dac type */
  259. #define AUDIO_CODEC_DAC_NONE 0 //Not use codec adc ic or no need driver.
  260. #define AUDIO_CODEC_DAC_ES8156 1 //Use codec dac ic es8156.
  261. /* choose your audio use type */
  262. //#define AUDIO_REPLAY
  263. //#define AUDIO_RECORD
  264. #ifdef AUDIO_REPLAY
  265. #define AUDIO_REPLAY_I2S I2S_ID0 /* Select i2s id */
  266. #define AUDIO_CODEC_DAC_IC AUDIO_CODEC_DAC_NONE /* Select your codec dac type */
  267. #endif
  268. #ifdef AUDIO_RECORD
  269. #define AUDIO_RECORD_I2S I2S_ID1 /* Select i2s id */
  270. #define AUDIO_CODEC_ADC_IC AUDIO_CODEC_ADC_ES7243E /* Select your codec adc type */
  271. #endif
  272. #ifndef AUDIO_CODEC_DAC_IC
  273. #define AUDIO_CODEC_DAC_IC AUDIO_CODEC_DAC_NONE /* Do not use codec dac by default */
  274. #endif
  275. #ifndef AUDIO_CODEC_ADC_IC
  276. #define AUDIO_CODEC_ADC_IC AUDIO_CODEC_ADC_NONE /* Do not use codec adc by default */
  277. #endif
  278. #if (AUDIO_CODEC_DAC_IC == AUDIO_CODEC_DAC_ES8156)
  279. #define AUDIO_CODEC_DAC_NAME "ES8156"
  280. #else
  281. #define AUDIO_CODEC_DAC_NAME ""
  282. #endif
  283. #if (AUDIO_CODEC_ADC_IC == AUDIO_CODEC_ADC_ES7243E)
  284. #define AUDIO_CODEC_ADC_NAME "ES7243E"
  285. #else
  286. #define AUDIO_CODEC_ADC_NAME ""
  287. #endif
  288. /*******************************************/
  289. /********** mailbox configuration **********/
  290. #define MAILBOX_SUPPORT
  291. /*******************************************/
  292. /************ eth configuration ************/
  293. /*
  294. 系统使用LWIP协议栈还是FREERTOS_TCP协议栈由宏“USE_LWIP”决定
  295. */
  296. //#define ETH_SUPPORT
  297. #define FREERTOS_TCP_ETH_EN 0
  298. #define LWIP_ETH_EN 1
  299. /*******************************************/
  300. /********** romfile configuration **********/
  301. /* 没有定义ROMFILE_USE_SMALL_MEM,romfile内容会全部加载到ddr
  302. * 内存不足时可以定义ROMFILE_USE_SMALL_MEM节省内存使用 */
  303. #define ROMFILE_USE_SMALL_MEM
  304. #ifndef ROMFILE_USE_SMALL_MEM
  305. /* 定义READ_ROMFILE_ONCE,romfile内容会整个一次加载到ddr,如果
  306. * 文件过大会导致启动时间慢 */
  307. //#define READ_ROMFILE_ONCE
  308. #else
  309. /* 缓存在DDR里的文件数,未缓存的文件需要重新从flash里读取 */
  310. #define ROMFILE_CACHE_DEF_SIZE 0
  311. #endif
  312. /*******************************************/
  313. /********** animation configuration **********/
  314. #define ANIMATION_NONE 0
  315. #define ANIMATION_USE_SMALL_MEM 1
  316. #define ANIMATION_NORMAL 2
  317. #define ANIMATION_POLICY ANIMATION_NORMAL
  318. /*********************************************/
  319. /************ flash type configuration ************/
  320. #define SPI_NOR_FLASH 0
  321. #define SPI_NAND_FLASH 1
  322. #define EMMC_FLASH 2
  323. #define DEVICE_TYPE_SELECT EMMC_FLASH
  324. #if DEVICE_TYPE_SELECT != EMMC_FLASH
  325. //#define SPI0_QSPI_MODE
  326. #else
  327. #define DEVICE_PARTITION_NAME "/emmc"
  328. #endif
  329. /*******************************************/
  330. /********** update mode configuration **********/
  331. #define OTA_UPDATE_SUPPORT
  332. #ifdef OTA_UPDATE_SUPPORT
  333. #define IMAGE_RESOURCES_BACKUP
  334. //#define DELTA_UPDATE_SUPPORT
  335. #define MAILBOX_UPDATE_SUPPORT
  336. //#define WIFI_UPDATE_SUPPORT
  337. #if defined(WIFI_UPDATE_SUPPORT) && !defined(USB_SUPPORT)
  338. #error "Error! Should define USB_SUPPORT to support wifi simu update"
  339. #endif
  340. //#define NCM_UPDATE_SUPPORT
  341. #if defined(NCM_UPDATE_SUPPORT) && !CONFIG_USB_DEVICE_CDC_NCM
  342. #error "Error! Should define CONFIG_USB_DEVICE_CDC_NCM=1 to support ncm update"
  343. #endif
  344. //#define NCM_LOG_SUPPORT
  345. #if defined(NCM_LOG_SUPPORT) && !CONFIG_USB_DEVICE_CDC_NCM
  346. #error "Error! Should define CONFIG_USB_DEVICE_CDC_NCM=1 to support ncm log"
  347. #endif
  348. #else
  349. #error "Error! Should define OTA_UPDATE_SUPPORT to support other update options"
  350. #endif
  351. /*********************************************/
  352. /********** update address configuration **********/
  353. #if DEVICE_TYPE_SELECT == SPI_NOR_FLASH
  354. #define MCU_RESERVE_SIZE 0x100000ul //1MB
  355. #define SYSINFO_MAX_SIZE 0x1000 //4KB
  356. #define LOADER_MAX_SIZE 0x8000 //32KB
  357. #define APPFILE_MAX_SIZE 0x200000 //2MB
  358. #define ANIMFILE_MAX_SIZE 0x500000 //5MB
  359. #define ROMFILE_MAX_SIZE 0x1000000 //16MB
  360. #define OTA_MEDIA_SIZE 0xa00000 //10MB
  361. /**********************************************************************************************************************************
  362. spi nor flash address space( 0 address start)-(resources AB backup)
  363. |-----1MB-----|---4KB---|---4KB---|--32KB--|--32KB--|---2MB---|---5MB---|---16MB---|---2MB---|---5MB---|---16MB---|---10MB---|---end
  364. |-------------|---------|---------|--------|--------|---------|---------|----------|---------|---------|----------|----------|
  365. |0 |0x100000 |0x101000 |0x102000|0x10A000|0x112000 |0x312000 | 0x812000 |0x1812000|0x1A12000|0x1F12000 |0x2F12000 |
  366. |MCU reserved | SYSINFO |SYSINFO B| AMTLDR |AMTLDR B| APP | ANIM | ROM | APP B | ANIM B | ROM B | OTA |
  367. |_____________|_________|_________|________|________|_________|_________|__________|_________|_________|__________|__________|
  368. spi nor flash address space( 0 address start)
  369. |-----1MB-----|---4KB---|---4KB---|--32KB--|--32KB--|---2MB---|---5MB---|---16MB---|---2MB---|---5MB---|---end
  370. |-------------|---------|---------|--------|--------|---------|---------|--------- |---------|---------|
  371. |0 |0x100000 |0x101000 |0x102000|0x10A000|0x112000 |0x312000 | 0x812000 |0x1812000|0x1A12000|
  372. |MCU reserved | SYSINFO |SYSINFO B| AMTLDR |AMTLDR B| APP | ANIM | ROM | APP B | OTA |
  373. |_____________|_________|_________|________|________|_________|_________|__________|_________|_________|
  374. ***********************************************************************************************************************************/
  375. #elif DEVICE_TYPE_SELECT == EMMC_FLASH
  376. #define MCU_RESERVE_SIZE 0x1000000ul //16MB
  377. #define SYSINFO_MAX_SIZE 0x80000 //512KB
  378. #define LOADER_MAX_SIZE 0x80000 //512KB
  379. #define APPFILE_MAX_SIZE 0x1000000 //16MB
  380. #define ANIMFILE_MAX_SIZE 0x500000 //5MB
  381. #define ROMFILE_MAX_SIZE 0x8000000 //128MB
  382. #define OTA_MEDIA_SIZE 0x10000000 //256MB
  383. /***********************************************************************************************************************************
  384. emmc address space( 0 address start)-(resources AB backup)
  385. |----16MB-----|---512KB---|---512KB---|---512KB---|---512KB---|---16MB---|---5MB---|---128MB--|---16MB---|---5MB----|---128MB---|--256MB---|---end
  386. |-------------|-----------|-----------|-----------|-----------|----------|---------|----------|----------|----------|-----------|----------|
  387. |0 | 0x1000000 | 0x1080000 | 0x1100000 | 0x1180000 |0x1200000 |0x2200000|0x2700000 |0xA700000 |0xB700000 | 0xBC00000 |0x13C00000|
  388. |MCU reserved | SYSINFO | SYSINFO B | AMTLDR | AMTLDR B | APP | ANIM | ROM | APP B | ANIM B | ROM B | OTA |
  389. |_____________|___________|___________|___________|___________|__________|_________|__________|__________|__________|___________|__________|
  390. emmc address space( 0 address start)
  391. |----16MB-----|---512KB---|---512KB---|---512KB---|---512KB---|---16MB---|---5MB---|---128MB--|---16MB---|--256MB---|---end
  392. |-------------|-----------|-----------|-----------|-----------|----------|---------|----------|----------|----------|
  393. |0 | 0x1000000 | 0x1080000 | 0x1100000 | 0x1180000 |0x1200000 |0x2200000|0x2700000 |0xA700000 |0xB700000 |
  394. |MCU reserved | SYSINFO | SYSINFO B | AMTLDR | AMTLDR B | APP | ANIM | ROM | APP B | OTA |
  395. |_____________|___________|___________|___________|___________|__________|_________|__________|__________|__________|
  396. *************************************************************************************************************************************/
  397. #else
  398. #error "Invalid flash type."
  399. #endif
  400. #define SYSINFO_OFFSET MCU_RESERVE_SIZE
  401. #define SYSINFO_B_OFFSET (SYSINFO_OFFSET + SYSINFO_MAX_SIZE)
  402. #define LOADER_OFFSET (SYSINFO_B_OFFSET + SYSINFO_MAX_SIZE)
  403. #define LOADER_B_OFFSET (LOADER_OFFSET + LOADER_MAX_SIZE)
  404. #define APPFILE_OFFSET (LOADER_B_OFFSET + LOADER_MAX_SIZE)
  405. #define ANIMFILE_OFFSET (APPFILE_OFFSET + APPFILE_MAX_SIZE)
  406. #define ROMFILE_OFFSET (ANIMFILE_OFFSET + ANIMFILE_MAX_SIZE)
  407. #define APPFILE_B_OFFSET (ROMFILE_OFFSET + ROMFILE_MAX_SIZE)
  408. #ifdef IMAGE_RESOURCES_BACKUP
  409. #define ANIMFILE_B_OFFSET (APPFILE_B_OFFSET + APPFILE_MAX_SIZE)
  410. #define ROMFILE_B_OFFSET (ANIMFILE_B_OFFSET + ANIMFILE_MAX_SIZE)
  411. #define OTA_MEDIA_OFFSET (ROMFILE_B_OFFSET + ROMFILE_MAX_SIZE)
  412. #else
  413. #define ANIMFILE_B_OFFSET ANIMFILE_OFFSET
  414. #define ROMFILE_B_OFFSET ROMFILE_OFFSET
  415. #define OTA_MEDIA_OFFSET (APPFILE_B_OFFSET + APPFILE_MAX_SIZE)
  416. #endif
  417. /*********************************************/
  418. /************ DDR config configuration ************/
  419. #define DDR_BASE 0x60000000ul
  420. #define DDR_TOTAL_SIZE 0x8000000 //128MB
  421. #define DDR_DRV_USE_SIZE 0x800000 //8MB
  422. #define DDR_MCU_ACCESS_MODULE_SIZE 0x40000 //256KB
  423. #define DDR_CPU_ACCESS_MODULE_SIZE 0x40000 //256KB
  424. #define DDR_MEDIA_USE_SIZE 0x80000 //512KB
  425. #if DEVICE_TYPE_SELECT == SPI_NOR_FLASH
  426. #define DDR_CAN_UPDATE_SIZE 0x200000 //2MB
  427. #define DDR_RESERVED_SIZE 0x500000 //5MB
  428. #elif DEVICE_TYPE_SELECT == EMMC_FLASH
  429. #define DDR_CAN_UPDATE_SIZE 0x400000 //4MB
  430. #define DDR_RESERVED_SIZE 0x300000 //3MB
  431. #endif
  432. #define DDR_DRV_USE_ADDR (DDR_BASE + DDR_TOTAL_SIZE - DDR_DRV_USE_SIZE)
  433. #define DDR_MCU_ACCESS_MODULE_ADDR (DDR_DRV_USE_ADDR)
  434. #define DDR_CPU_ACCESS_MODULE_ADDR (DDR_MCU_ACCESS_MODULE_ADDR + DDR_MCU_ACCESS_MODULE_SIZE)
  435. #define DDR_MEDIA_USE_ADDR (DDR_CPU_ACCESS_MODULE_ADDR + DDR_CPU_ACCESS_MODULE_SIZE)
  436. #define DDR_CAN_USE_ADDR (DDR_MADIA_USE_ADDR + DDR_MEDIA_USE_SIZE)
  437. /*********************************************************************
  438. spi nor flash DDR address space
  439. |----120MB----|------256KB------|------256KB------|----512KB----|-----2MB-----|-----5MB-----|---end
  440. |-------------|-----------------|-----------------|-------------|-------------|-------------|
  441. |0x60000000 |0x67800000 |0x67840000 |0x67880000 |0x67900000 |0x67B00000 |
  442. |CPU USE |MCU Access module|CPU Access module|Media update |Can update |Reserved |
  443. |_____________|_________________|_________________|_____________|_____________|_____________|
  444. ***********************************************************************
  445. emmc DDR address space
  446. |----120MB----|------256KB------|------256KB------|----512KB----|-----4MB-----|-----3MB-----|---end
  447. |-------------|-----------------|-----------------|-------------|-------------|-------------|
  448. |0x60000000 |0x67800000 |0x67840000 |0x67880000 |0x67900000 |0x67D00000 |
  449. |CPU USE |MCU Access module|CPU Access module|Media update |Can update |Reserved |
  450. |_____________|_________________|_________________|_____________|_____________|_____________|
  451. **********************************************************************/
  452. /*********************************************/
  453. /********** ulog configuration **********/
  454. //#define USE_ULOG
  455. #define ULOG_NAME_MAX 8
  456. #define ULOG_LINE_BUF_SIZE 1024
  457. #define ULOG_OUTPUT_LEVEL
  458. #define ULOG_OUTPUT_TIME
  459. //#define ULOG_TIME_USING_TIMESTAMP
  460. //#define ULOG_OUTPUT_TAG
  461. //#define ULOG_USING_COLOR
  462. #define ULOG_USING_ISR_LOG
  463. #define ULOG_BACKEND_USING_CONSOLE
  464. #define ULOG_EASYFLASH_BACKEND_ENABLE
  465. #ifdef ULOG_EASYFLASH_BACKEND_ENABLE
  466. #define EASYFLASH_LOG
  467. #if DEVICE_TYPE_SELECT != EMMC_FLASH
  468. #define EASYFLASH_LOG_AREA_SIZE 0x100000
  469. #define EASYFLASH_ERASE_GRAN 0x1000
  470. #define EASYFLASH_WRITE_GRAN 0x100
  471. #define EASYFLASH_START_ADDR 0x1700000
  472. #else
  473. #define EASYFLASH_LOG_AREA_SIZE 0x100000
  474. #define EASYFLASH_ERASE_GRAN 0x10000
  475. #define EASYFLASH_WRITE_GRAN 0x200
  476. #define EASYFLASH_START_ADDR 0x60000000
  477. #endif
  478. #endif
  479. //#define ULOG_FILE_BACKEND_ENABLE
  480. #ifdef ULOG_FILE_BACKEND_ENABLE
  481. #if DEVICE_TYPE_SELECT != EMMC_FLASH
  482. #define ULOG_FILE_ROOT_PATH "/sf/logs"
  483. #else
  484. #define ULOG_FILE_ROOT_PATH "/emmc/logs"
  485. #endif
  486. #define ULOG_FILE_NAME_BASE "ulog.log"
  487. #define ULOG_FILE_MAX_NUM 10
  488. #define ULOG_FILE_MAX_SIZE (1024 * 32)
  489. #endif
  490. //#define ULOG_USING_ASYNC_OUTPUT //ulog异步输出
  491. #define ULOG_ASYNC_OUTPUT_BUF_SIZE 32768 //32K
  492. #define ULOG_ASYNC_OUTPUT_THREAD_STACK 2048
  493. #define ULOG_ASYNC_OUTPUT_THREAD_PRIORITY 10
  494. /*********************************************/
  495. #endif