blob: 5e4003dc986938314f9b0158b2da1805ebcf3d31 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/*
2 * (C) Copyright 2016, ZIXC Corporation.
3 *
4 */
5#ifndef __CONFIG_H
6#define __CONFIG_H
7
8#include "board.h"
9#include "../../downloader/downloader_config.h"
10#include "dma_cfg.h"
11
12/*================================================================= version ======== */
13#define CONFIG_PRINTF 1 /*uart downloader,this should be set to 0*/
14//#ifdef CONFIG_ZX297520V3E_MDL_AB
15#if defined(CONFIG_ZX297520V3E_MDL_AB) || defined(CONFIG_ZX297520V3E_VEHICLE_DC)
16#define VERSION_RELEASE 1
17#else
18#define VERSION_RELEASE 0
19#endif
20#define CONFIG_USB_DL 1
21#define CONFIG_UART_DL 0
22
23/*==================================================================== gpio ======== */
24#define CONFIG_ZX75XX_LED 1
25#define CONFIG_ZX75XX_KEY 1
26
27
28/*==================================================================== pmu ========= */
29#include <module/pmu.h>
30
31
32#define WORK_MODE_AMT 3
33#define WORK_MODE_PRODUCTION 2
34#define WORK_MODE_DEVELOPMENT 1
35#define WORK_MODE_USER 0
36
37
38/*=============================================================== modle config ===== */
39#define CONFIG_MODLE_LCD 0
40
41#define CONFIG_MODLE_CHARGER 0
42#define CONFIG_PMU_LOW_BATTERY 3100
43#define CONFIG_PMU_FULL_BATTERY 4200
44#define CONFIG_MAX_TIME_OUT (20*1000000) /* 20s */
45
46/*=============================================================== cpu & boar ======= */
47#define CONFIG_IDENT_STRING " for ZXIC "
48
49
50/*================================================================ debub & log ===== */
51#define NAND_DOWN_LOAD_CMD 1 /* °æ±¾µÄÏÂÔØ£¬·ÖÇø±í´òÓ¡ */
52#define LOAD_IMAGE_CRC 1 /* °æ±¾µÄУÑé */
53#define LOAD_IMAGE_DEBUG 1
54#define NAND_BAD_DEBUG 1
55#define PRINTF_PARTITION_TABLE 1
56#define TIME_DEBUG 1
57#define ZFTL_DEBUG 1
58#define DENALI_DEBUG 1
59#define SPI_NAND_DEBUG 0
60#define DEBUG 1
61#define CONFIG_DISPLAY_CPUINFO 1
62#define CONFIG_DISPLAY_BOARDINFO 1
63#define CONFIG_MTD_DEBUG 0
64#define CONFIG_MTD_DEBUG_VERBOSE 2
65#define CONFIG_MUTUAL_DEBUG 0 /* µ÷ÊÔʱʹÓã¬ÓÃÓÚ¿ØÖÆÌ¨µÄ½»»¥ */
66
67/*================================================================== mmu =========== */
68#define CONFIG_ENABLE_MMU 1
69#ifdef CONFIG_ZX297520V3T_64M_UBOOT
70#define CONFIG_NAND_DMA_BUF_ADDR 0x23A00000
71#else
72#define CONFIG_NAND_DMA_BUF_ADDR 0x21A00000
73#endif
74
75#define CONFIG_USB_DMA_BUF_ADDR 0x20000000
76#define CONFIG_GMAC_DMA_BUF_ADDR DOWNLOADER_BUFFER_BASE
77
78/*================================================================ cache =========== */
79#define CONFIG_SYS_ICACHE 1
80#define CONFIG_SYS_DCACHE 1
81#if !CONFIG_SYS_ICACHE
82#define CONFIG_SYS_ICACHE_OFF
83#endif
84#if !CONFIG_SYS_DCACHE
85#define CONFIG_SYS_DCACHE_OFF
86#endif
87
88/*================================================================== int =========== */
89#define CONFIG_USE_IRQ 0
90#define CONFIG_STACKSIZE_IRQ (4*1024)
91#define CONFIG_STACKSIZE_FIQ (4*1024)
92#define CONFIG_USE_VIC 0 /* ʹÓÃÖжϿØÖÆÆ÷ */
93#define CONFIG_VIC_BASE 0x0080000B
94#define CONFIG_PERIPORT_SIZE 0x13
95
96#define CFG_TLOAD_MODE 0x87654321 /* ͬ²½ LOADER */
97#define CFG_ZLOAD_MODE 0x12345678 /* ͬ²½ LOADER */
98
99#define CFG_START_MODE_NAND 0x11111111 /* IRAM1 <--> U-BOOT */
100#define CFG_START_MODE_SPI_NAND 0x22222222 /* IRAM1 <--> U-BOOT */
101#define CFG_START_MODE_SDIO 0x33333333 /* IRAM1 <--> U-BOOT */
102#define CFG_START_MODE_EMMC 0x44444444 /* IRAM1 <--> U-BOOT */
103#define CFG_START_MODE_NOR 0x55555555 /* IRAM1 <--> U-BOOT */
104
105
106
107/* ================================================================== iram ========= */
108#define CONFIG_SYS_IRAM_BASE 0x82000000 /* Internal SRAM base address */
109#define CONFIG_SYS_IRAM_SIZE 0x8000 /* 8 KB of internal SRAM memory */
110#define CONFIG_SYS_IRAM_END (CONFIG_SYS_IRAM_BASE + CONFIG_SYS_IRAM_SIZE)
111#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_IRAM_END - GENERATED_GBL_DATA_SIZE)
112
113
114/* ================================================================== ddr ========== */
115#define CONFIG_NR_DRAM_BANKS 1
116#define CONFIG_SYS_SDRAM_BASE 0x20000800 /*2k DDR for soc test*/
117#define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE /* SDRAM Bank #1 */
118
119#ifdef CONFIG_ZX297520V3T_64M_UBOOT
120#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64MB */
121#define CONFIG_SYS_SDRAM_SIZE 0x04000000 /* 64MB in DDR */
122#define CONFIG_SYS_SDRAM_CUTDOWN_SIZE 0x01000000
123#define CONFIG_SYS_SDRAM_IMAGEFS_BASE 0x22300000
124#define CONFIG_SYS_SDRAM_IMAGEFS_END 0x23000000
125#define CONFIG_SYS_SDRAM_IMAGEFS_SIZE (CONFIG_SYS_SDRAM_IMAGEFS_END - CONFIG_SYS_SDRAM_IMAGEFS_BASE)
126#else
127#define PHYS_SDRAM_1_SIZE 0x02000000 /* 32MB */
128#define CONFIG_SYS_SDRAM_SIZE 0x02000000 /* 32MB in DDR */
129#define CONFIG_SYS_SDRAM_IMAGEFS_BASE 0x20C00000
130#define CONFIG_SYS_SDRAM_IMAGEFS_END 0x21400000
131#define CONFIG_SYS_SDRAM_IMAGEFS_SIZE (CONFIG_SYS_SDRAM_IMAGEFS_END - CONFIG_SYS_SDRAM_IMAGEFS_BASE)
132#endif
133
134#define CONFIG_SYS_SDRAM_TEMP_BASE 0x21400000 /* ddrÊý¾Ý°æ±¾ÁÙʱ»º´æµØÖ· */
135#define CONFIG_SYS_SDRAM_TEMP_LZMA 0X21600000 /* »º´æµØÖ·£¬ÓÃÓÚ½âѹ°æ±¾Ê±Ê¹Óà */
136
137#define CONFIG_SYS_SDRAM_UPDATE_ALIGNED_OFFSET 0x5000000 /* 80MB for LocalUpdate Use. */
138
139/* boot ´«µÝ¸økernelµÄÄÚ´æ²ÎÊý*/
140#define CONFIG_SYS_SDRAM32_A9_SIZE 0x01BC0000 //27.75M
141#define CONFIG_SYS_SDRAM32_RECOVERY_A9_SIZE 0x02000000
142
143#ifdef CONFIG_ZX297520V3E_WATCH_CAP
144#define CONFIG_SYS_SDRAM64_A9_SIZE 0x02AC0000 //42.75M
145#else
146#define CONFIG_SYS_SDRAM64_A9_SIZE 0x03BC0000 //59.75M
147#endif
148#define CONFIG_SYS_SDRAM64_RECOVERY_A9_SIZE 0x04000000
149
150#define CONFIG_SYS_SDRAM128_A9_SIZE 0x07BC0000 //123.75M
151#define CONFIG_SYS_SDRAM128_RECOVERY_A9_SIZE 0x08000000
152
153#define CONFIG_SYS_SDRAM256_A9_SIZE 0x0FBC0000 //251S.75M
154#define CONFIG_SYS_SDRAM256_RECOVERY_A9_SIZE 0x10000000
155
156#define AMT_MODE_FLAG 0x544D
157
158
159/* ================================================================= boot ========= */
160#define CONFIG_MACH_TYPE 7523
161#define CONFIG_SETUP_MEMORY_TAGS 1
162#define CONFIG_CMDLINE_TAG 1
163#define CONFIG_INITRD_TAG 1
164
165#define CONFIG_BOOTARGS "" /* partition.c */
166#define CONFIG_BOOTCOMMAND "" /* load_image.c */
167#define CONFIG_CMD_BOOTM
168
169
170/* ================================================================= malloc ======== */
171#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2048 * 1024)/* 2M */
172
173
174/* ================================================================ Command ======== */
175#include <config_cmd_default.h>
176#define CONFIG_CMD_CACHE
177
178/* ============================================================= usb download ====== */
179#define CONFIG_USB_LOAD_MAX_LEN CONFIG_SYS_SDRAM_SIZE-0x400000
180#define CONFIG_USB_LOAD_MAX_PACKET_LEN CONFIG_USB_LOAD_MAX_LEN
181
182
183/* ==================================================================== nand ======= */
184#define CONFIG_NAND 1
185#define CONFIG_CMD_NAND_YAFFS
186#define CONFIG_CMD_NAND
187#define CONFIG_NAND_MTD 1
188#define CONFIG_NAND_DENALI 1
189#define CFG_DENALI_DMA_BUF_SIZE 0x4000 /* 16k */
190#define CFG_DENALI_DMA_BUF_ADDR (CONFIG_SYS_SDRAM_BASE + \
191 CONFIG_SYS_SDRAM_SIZE - \
192 CONFIG_SYS_UBOOT_SIZE - 0x10000 - \
193 CFG_DENALI_DMA_BUF_SIZE)/* TLB 64K */
194#define CONFIG_SYS_MAX_NAND_DEVICE 1
195#define CONFIG_SYS_NAND_BASE 0x0 /* Ò»¿ªÊ¼Ã»ÓÐÒâÒ壬ºóÃæ»¹»á³õʼ»¯ */
196#define CONFIG_BOOT_NAND
197
198
199/* ===================================================================== mtd ======= */
200#define CONFIG_PARTITIONS
201
202/* ================================================================== time ========= */
203#define CONFIG_POWER_ON_DELAY_TIME 3000000 /* 3s */
204#define CONFIG_SYS_HZ 1000
205#if CONFIG_MUTUAL_DEBUG
206#define CONFIG_BOOTDELAY 8
207#else
208#define CONFIG_BOOTDELAY 0
209#endif
210#define CONFIG_ZERO_BOOTDELAY_CHECK
211
212
213/* ============================================================ uboot system ======= */
214#define CONFIG_SYS_UBOOT_SIZE (2 * 1024 * 1024)
215#define CONFIG_SYS_PHY_UBOOT_BASE (CONFIG_SYS_SDRAM_BASE + \
216 CONFIG_SYS_SDRAM_SIZE - \
217 CONFIG_SYS_UBOOT_SIZE - 0x10000)
218#define CONFIG_SYS_LONGHELP
219#define CONFIG_SYS_PROMPT "[ZXIC]# "
220#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
221#define CONFIG_SYS_PBSIZE 512 /* Print Buffer Size */
222#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
223#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
224#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE /* memtest works on */
225#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_SDRAM_SIZE) /* 32MB in DRAM */
226#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE /* default load address */
227
228#define CONFIG_LOADADDR 0x22000000
229
230/* ================================================================= serial ======== */
231#define CONFIG_BAUDRATE 921600
232#define CONFIG_SERIAL1 1 /* we use SERIAL 1 */
233#define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
234#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 921600}
235#ifdef CONFIG_SYS_HUSH_PARSER
236#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
237#endif
238#define CONFIG_AUTO_COMPLETE
239#define CONFIG_CMDLINE_EDITING
240#define CONFIG_ENV_OVERWRITE
241
242
243/* ============================================================== nor flash ======== */
244#define CONFIG_SYS_NO_FLASH
245
246#define CONFIG_CMD_JFFS2
247#define CONFIG_JFFS2_DEV "nand0"
248#define CONFIG_JFFS2_NAND
249/* ================================================================= env =========== */
250#define CONFIG_ENV_IS_NOWHERE 1
251#define CONFIG_ENV_SIZE 0x4000
252#define CONFIG_ENV_OFFSET 0x0040000
253
254#define NoBatteryTempratureVoltage 4000
255
256#define CONFIG_CMD_MII 0
257#define CONFIG_CMD_NET 1
258#define CONFIG_CMD_PING 1
259#define CONFIG_ZX_MDIO 1
260#define CONFIG_CMD_TFTPPUT 1
261
262#define CONFIG_ZTE_CMD 1
263#define CONFIG_CMD_TFTPDOWNER 0
264
265/***************************************************/
266/*ÒÔÏÂÊÇuboot»·¾³±äÁ¿µÄ¶¨Òå*/
267
268#if 1
269//#define CONFIG_ETHADDR 00:02:f7:ef:00:02 //?????macµØÖ·²»È·¶¨
270#define CONFIG_ETHADDR ec:1d:7f:b0:2f:32 //?????macµØÖ·²»È·¶¨
271//#define CONFIG_ETHADDR 00:22:93:4e:d9:dd //?????macµØÖ·²»È·¶¨
272//#define CONFIG_ETHADDR 6c:0b:84:3b:f8:42 //?????macµØÖ·²»È·¶¨
273#define CONFIG_HOSTNAME unknown
274#define CONFIG_NETMASK 255.255.255.0 /*×ÓÍøÑÚÂë*/
275#define CONFIG_IPADDR 192.168.1.1 /*¿ª·¢°åIPµØÖ·*/
276#define CONFIG_SERVERIP 192.168.1.20 /*·þÎñÆ÷IPµØÖ·*/
277#define CONFIG_GATEWAYIP 192.168.1.1 /*Íø¹ØIPµØÖ·*/
278#define CONFIG_BOOTFILE ZX297520V3.bin
279//#define CONFIG_ROOTPATH /opt/nfsroot /*NFS ·þÎñÆ÷¶ËĿ¼*/
280#endif
281#endif /* __CONFIG_H */