change source file mode to 0644 instead of 0755
[profile/mobile/platform/kernel/u-boot-tm1.git] / include / configs / sp8825ea.h
1 /*\r
2  * (C) Copyright 2009 DENX Software Engineering\r
3  * Author: John Rigby <jrigby@gmail.com>\r
4  *\r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License as\r
7  * published by the Free Software Foundation; either version 2 of\r
8  * the License, or (at your option) any later version.\r
9  *\r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  *\r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,\r
18  * MA 02111-1307 USA\r
19  */\r
20 \r
21 #ifndef __CONFIG_H\r
22 #define __CONFIG_H\r
23 //only used in fdl2 .in uart download, the debug infors  from  serial will break the download process.\r
24 #define CONFIG_FDL2_PRINT  0    \r
25 #define BOOT_NATIVE_LINUX (0)\r
26 \r
27 #define CONFIG_SILENT_CONSOLE\r
28 #define CONFIG_GPIOLIB 1\r
29 //#define NAND_DEBUG  \r
30 //#define DEBUG\r
31 #define U_BOOT_SPRD_VER 1\r
32 /*#define SPRD_EVM_TAG_ON 1*/\r
33 #ifdef SPRD_EVM_TAG_ON\r
34 #define SPRD_EVM_ADDR_START 0x00026000\r
35 #define SPRD_EVM_TAG(_x) (*(((unsigned long *)SPRD_EVM_ADDR_START)+_x) = *(volatile unsigned long *)0x87003004)\r
36 #endif\r
37 #define CONFIG_L2_OFF                   1\r
38 \r
39 #define BOOT_DEBUG 1\r
40 \r
41 #define CONFIG_YAFFS2 1\r
42 \r
43 #define BOOT_PART "boot"\r
44 //#define BOOT_PART "kernel"\r
45 #define RECOVERY_PART "recovery"\r
46 /*\r
47  * SPREADTRUM BIGPHONE board - SoC Configuration\r
48  */\r
49 #define CONFIG_SP8825\r
50 #define CONFIG_SC8825\r
51 #define CONFIG_TIGER\r
52 #define CONFIG_SC8825EA\r
53 \r
54 #ifdef CONFIG_TIGER\r
55 #define CHIP_ENDIAN_LITTLE\r
56 #define SC8800S_LITTLE_ENDIAN FALSE\r
57 #define _LITTLE_ENDIAN 1\r
58 #define EXT_MEM_TYPE_DDR 1\r
59 #endif\r
60 \r
61 /********** DDR timing configuration for customer begin *************/\r
62 #define CONFIG_DDR_TIMING_CUSTOM FALSE //TRUE or FALSE\r
63 \r
64 // name: CONFIG_LPDDR1_DS\r
65 // description: to config lpddr1 driver strength\r
66 // note: when lpddr2, don't need to set this parameter\r
67 // legal value:  \r
68 // LPDDR1_DS_33_OHM\r
69 // LPDDR1_DS_31_OHM\r
70 // LPDDR1_DS_48_OHM\r
71 // LPDDR1_DS_43_OHM\r
72 // LPDDR1_DS_39_OHM\r
73 // LPDDR1_DS_55_OHM\r
74 // LPDDR1_DS_64_OHM\r
75 #define CONFIG_LPDDR1_DS  LPDDR1_DS_39_OHM \r
76 \r
77 // name: CONFIG_LPDDR2_DS\r
78 // note: to config lpddr2 driver strength, when lpddr1, don't need to set this parameter\r
79 // legal value:  \r
80 // LPDDR2_DS_34_OHM\r
81 // LPDDR2_DS_40_OHM\r
82 // LPDDR2_DS_48_OHM\r
83 // LPDDR2_DS_60_OHM\r
84 // LPDDR2_DS_80_OHM\r
85 #define CONFIG_LPDDR2_DS LPDDR2_DS_40_OHM\r
86 \r
87 // name: CONFIG_BYTEx_PHY_DLY\r
88 // description: to config BYTE0~BYTE3 slave dll phase delay in ddr controller\r
89 // note: when lpddr1, don't need to set this parameter\r
90 // legal value:  \r
91 // SDLL_PHS_DLY_DEF\r
92 // SDLL_PHS_DLY_36\r
93 // SDLL_PHS_DLY_54\r
94 // SDLL_PHS_DLY_72\r
95 // SDLL_PHS_DLY_90\r
96 // SDLL_PHS_DLY_108\r
97 // SDLL_PHS_DLY_126\r
98 // SDLL_PHS_DLY_144\r
99 #define CONFIG_BYTE0_PHS_DLY SDLL_PHS_DLY_DEF\r
100 #define CONFIG_BYTE1_PHS_DLY SDLL_PHS_DLY_DEF\r
101 #define CONFIG_BYTE2_PHS_DLY SDLL_PHS_DLY_DEF\r
102 #define CONFIG_BYTE3_PHS_DLY SDLL_PHS_DLY_DEF\r
103 \r
104 // name: CONFIG_BYTEx_STEP_DLY\r
105 // description: to config BYTE0~BYTE3 dqs step delay in ddr controller\r
106 // note: when lpddr1, don't need to set this parameter\r
107 // legal value:  \r
108 // DQS_STEP_DLY_SUB3,\r
109 // DQS_STEP_DLY_SUB2,\r
110 // DQS_STEP_DLY_SUB1,\r
111 // DQS_STEP_DLY_NOM,\r
112 // DQS_STEP_DLY_DEF,\r
113 // DQS_STEP_DLY_ADD1,\r
114 // DQS_STEP_DLY_ADD2,\r
115 // DQS_STEP_DLY_ADD3,\r
116 // DQS_STEP_DLY_ADD4,\r
117 #define CONFIG_BYTE0_STEP_DLY DQS_STEP_DLY_NOM\r
118 #define CONFIG_BYTE1_STEP_DLY DQS_STEP_DLY_NOM\r
119 #define CONFIG_BYTE2_STEP_DLY DQS_STEP_DLY_NOM\r
120 #define CONFIG_BYTE3_STEP_DLY DQS_STEP_DLY_NOM\r
121 /************* DDR timing configuration for customer end **************/\r
122 \r
123 \r
124 \r
125 #define CONFIG_EMMC_BOOT\r
126 #define CONFIG_RAM512M\r
127 \r
128 \r
129 #ifdef  CONFIG_EMMC_BOOT\r
130 #define EMMC_SECTOR_SIZE 512\r
131 #define CONFIG_MMC\r
132 \r
133 //#define CONFIG_TIGER_MMC\r
134 #define CONFIG_UEFI_PARTITION\r
135 #define CONFIG_EFI_PARTITION\r
136 #define CONFIG_EXT4_SPARSE_DOWNLOAD\r
137 //#define CONFIG_EMMC_SPL\r
138 #define CONFIG_SYS_EMMC_U_BOOT_SECTOR_NUM 0x400\r
139 #endif\r
140 \r
141 \r
142 #define BB_DRAM_TYPE_256MB_32BIT\r
143 #define  CONFIG_MTD_NAND_TIGER 1\r
144 //#define  CONFIG_MTD_NAND_SC8810 1\r
145 \r
146 \r
147 \r
148 #define CONFIG_SYS_HZ                   1000\r
149 #define CONFIG_SPRD_TIMER_CLK           1000 /*32768*/\r
150 \r
151 //#define CONFIG_SYS_HUSH_PARSER\r
152 \r
153 #ifdef CONFIG_SYS_HUSH_PARSER\r
154 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "\r
155 #endif\r
156 \r
157 #define FIXNV_SIZE                      (64 * 1024)\r
158 #define MODEM_SIZE              (0x800000)\r
159 #define DSP_SIZE        (0x3E0400) /* 3968K */\r
160 #define VMJALUNA_SIZE       (0x64000) /* 400K */\r
161 #define RUNTIMENV_SIZE      (256 * 1024)\r
162 #define CONFIG_SPL_LOAD_LEN (0x6000)\r
163 \r
164 \r
165 /*#define CMDLINE_NEED_CONV */\r
166 \r
167 #define WATCHDOG_LOAD_VALUE     0x4000\r
168 #define CONFIG_SYS_STACK_SIZE   0x400\r
169 //#define CONFIG_SYS_TEXT_BASZE  0x80f00000\r
170 \r
171 //#define       CONFIG_SYS_MONITOR_LEN          (256 << 10)     /* 256 kB for U-Boot */\r
172 \r
173 /* NAND BOOT is the only boot method */\r
174 #define CONFIG_NAND_U_BOOT\r
175 #define DYNAMIC_CRC_TABLE\r
176 /* Start copying real U-boot from the second page */\r
177 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x40000\r
178 #define CONFIG_SYS_NAND_U_BOOT_SIZE     0x80000\r
179 #define RAM_TYPPE_IS_SDRAM      0\r
180 //#define FPGA_TRACE_DOWNLOAD //for download image from trace\r
181 \r
182 /* Load U-Boot to this address */\r
183 #define CONFIG_SYS_NAND_U_BOOT_DST      0x8f800000\r
184 #define CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_NAND_U_BOOT_DST\r
185 #define CONFIG_SYS_SDRAM_BASE 0x80000000\r
186 #define CONFIG_SYS_SDRAM_END (CONFIG_SYS_SDRAM_BASE + 256*1024*1024)\r
187 \r
188 #ifdef CONFIG_NAND_SPL\r
189 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_END - 0x40000)\r
190 #else\r
191 \r
192 #define CONFIG_MMU_TABLE_ADDR (0x00020000)\r
193 #define CONFIG_SYS_INIT_SP_ADDR     \\r
194         (CONFIG_SYS_SDRAM_END - 0x10000 - GENERATED_GBL_DATA_SIZE)\r
195 \r
196 #define CONFIG_SKIP_LOWLEVEL_INIT\r
197 #endif\r
198 \r
199 #define CONFIG_HW_WATCHDOG\r
200 //#define CONFIG_AUTOBOOT //used for FPGA test, auto boot other image\r
201 //#define CONFIG_DISPLAY_CPUINFO\r
202 \r
203 #define CONFIG_CMDLINE_TAG              1       /* enable passing of ATAGs */\r
204 #define CONFIG_SETUP_MEMORY_TAGS        1\r
205 #define CONFIG_INITRD_TAG               1\r
206 \r
207 /*\r
208  * Memory Info\r
209  */\r
210 /* malloc() len */\r
211 #define CONFIG_SYS_MALLOC_LEN           (2 << 20)       /* 1 MiB */\r
212 /*\r
213  * Board has 2 32MB banks of DRAM but there is a bug when using\r
214  * both so only the first is configured\r
215  */\r
216 #define CONFIG_NR_DRAM_BANKS    1\r
217 \r
218 #define PHYS_SDRAM_1            0x80000000\r
219 #define PHYS_SDRAM_1_SIZE       0x10000000\r
220 #if (CONFIG_NR_DRAM_BANKS == 2)\r
221 #define PHYS_SDRAM_2            0x90000000\r
222 #define PHYS_SDRAM_2_SIZE       0x10000000\r
223 #endif\r
224 /* 8MB DRAM test */\r
225 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1\r
226 #define CONFIG_SYS_MEMTEST_END          (PHYS_SDRAM_1+0x0800000)\r
227 #define CONFIG_STACKSIZE        (256 * 1024)    /* regular stack */\r
228 \r
229 /*\r
230  * Serial Info\r
231  */\r
232 #define CONFIG_SPRD_UART                1\r
233 #define CONFIG_SYS_SC8800X_UART1        1\r
234 #define CONFIG_CONS_INDEX       1       /* use UART0 for console */\r
235 #define CONFIG_BAUDRATE         115200  /* Default baud rate */\r
236 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }\r
237 #define CONFIG_SC8825_SPI\r
238 #define CONFIG_SC8825_I2C\r
239 /*\r
240  * Flash & Environment\r
241  */\r
242 /* No NOR flash present */\r
243 #define CONFIG_SYS_MONITOR_LEN ((CONFIG_SYS_NAND_U_BOOT_OFFS)+(CONFIG_SYS_NAND_U_BOOT_SIZE))\r
244 #define CONFIG_SYS_NO_FLASH     1\r
245 #define CONFIG_ENV_IS_NOWHERE\r
246 #define CONFIG_ENV_SIZE         (128 * 1024)    \r
247 /*\r
248 #define CONFIG_ENV_IS_IN_NAND\r
249 #define CONFIG_ENV_OFFSET       CONFIG_SYS_MONITOR_LEN\r
250 #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)\r
251 */\r
252 \r
253 /* NAND */\r
254 #define CONFIG_NAND_TIGER\r
255 //#define CONFIG_NAND_SC8810\r
256 #define CONFIG_SPRD_NAND_REGS_BASE      (0x21100000)\r
257 #define CONFIG_SYS_MAX_NAND_DEVICE      1\r
258 #define CONFIG_SYS_NAND_BASE            (0x21100000)\r
259 //#define CONFIG_JFFS2_NAND\r
260 //#define CONFIG_SPRD_NAND_HWECC\r
261 #define CONFIG_SYS_NAND_HW_ECC\r
262 #define CONFIG_SYS_NAND_LARGEPAGE\r
263 //#define CONFIG_SYS_NAND_5_ADDR_CYCLE\r
264 \r
265 #define CONFIG_SYS_64BIT_VSPRINTF\r
266 \r
267 #define CONFIG_CMD_MTDPARTS\r
268 #define CONFIG_MTD_PARTITIONS\r
269 #define CONFIG_MTD_DEVICE\r
270 #define CONFIG_CMD_UBI\r
271 #define CONFIG_RBTREE\r
272 \r
273 /* U-Boot general configuration */\r
274 #define CONFIG_SYS_PROMPT       "=> "   /* Monitor Command Prompt */\r
275 #define CONFIG_SYS_CBSIZE       1024    /* Console I/O Buffer Size  */\r
276 /* Print buffer sz */\r
277 #define CONFIG_SYS_PBSIZE       (CONFIG_SYS_CBSIZE + \\r
278                 sizeof(CONFIG_SYS_PROMPT) + 16)\r
279 #define CONFIG_SYS_MAXARGS      32      /* max number of command args */\r
280 /* Boot Argument Buffer Size */\r
281 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE\r
282 #define CONFIG_CMDLINE_EDITING\r
283 #define CONFIG_SYS_LONGHELP\r
284 \r
285 /* support OS choose */\r
286 #undef CONFIG_BOOTM_NETBSD \r
287 #undef CONFIG_BOOTM_RTEMS\r
288 \r
289 /* U-Boot commands */\r
290 #include <config_cmd_default.h>\r
291 #define CONFIG_CMD_NAND\r
292 #undef CONFIG_CMD_FPGA\r
293 #undef CONFIG_CMD_LOADS\r
294 #undef CONFIG_CMD_NET\r
295 #undef CONFIG_CMD_NFS\r
296 #undef CONFIG_CMD_SETGETDCR\r
297 \r
298 #define CONFIG_ENV_OVERWRITE\r
299 \r
300 #ifdef SPRD_EVM_TAG_ON\r
301 #define CONFIG_BOOTDELAY        0\r
302 #else\r
303 #define CONFIG_BOOTDELAY        0\r
304 #define CONFIG_ZERO_BOOTDELAY_CHECK\r
305 #endif\r
306 \r
307 #define CONFIG_LOADADDR         (CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN - 4*1024*1024)    /* loadaddr env var */\r
308 #define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR\r
309 \r
310 #define xstr(s) str(s)\r
311 #define str(s)  #s\r
312 \r
313 #define MTDIDS_DEFAULT "nand0=sprd-nand"\r
314 #ifdef CONFIG_G2PHONE\r
315 #define MTDPARTS_DEFAULT "mtdparts=sprd-nand:384k@256k(boot),256k(params),6m(kernel),6m(ramdisk),6m(recovery),70m(system),30m(userdata),7m(cache)"\r
316 #define CONFIG_BOOTARGS "mem=64M console=ttyS1,115200n8 init=/init "MTDPARTS_DEFAULT\r
317 #elif defined CONFIG_SC8825\r
318 /*#define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),384k(2ndbl),128k(params),512k(vmjaluna),6016k(modem),7680k(kernel),5120k(dsp),1280k(fixnv),2560k(runtimenv),6400k(recovery),100m(system),198m(userdata),1m(boot_logo),1m(fastboot_logo),2m(cache),256k(misc)"*/\r
319 //#define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),512k(2ndbl),128k(params),512k(vmjaluna),10m(modem),10m(boot),5120k(dsp),1280k(fixnv),3840k(backupfixnv),3840k(runtimenv),10m(recovery),150m(system),300m(userdata),1m(boot_logo),1m(fastboot_logo),2m(cache),256k(misc)"\r
320 //#define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),512k(2ndbl),128k(params),512k(vmjaluna),10m(modem),10m(boot)"\r
321 #define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),512k(2ndbl),256k(params),512k(vmjaluna),10m(modem),3840k(fixnv),3840k(backupfixnv),5120k(dsp),3840k(runtimenv),10m(boot),10m(recovery),250m(system),180m(userdata),20m(cache),256k(misc),1m(boot_logo),1m(fastboot_logo),3840k(productinfo),512k(kpanic)"\r
322 #define CONFIG_BOOTARGS "mem=256M console=ttyS1,115200n8 init=/init " MTDPARTS_DEFAULT\r
323 #endif\r
324 \r
325 #define COPY_LINUX_KERNEL_SIZE  (0x600000)\r
326 #define LINUX_INITRD_NAME       "modem"\r
327 \r
328 #define CONFIG_BOOTCOMMAND "cboot normal"\r
329 #define CONFIG_EXTRA_ENV_SETTINGS                               ""      \r
330 \r
331 #ifdef CONFIG_CMD_NET\r
332 #define CONFIG_IPADDR 192.168.10.2\r
333 #define CONFIG_SERVERIP 192.168.10.5\r
334 #define CONFIG_NETMASK 255.255.255.0\r
335 #define CONFIG_USBNET_DEVADDR 26:03:ee:00:87:9f\r
336 #define CONFIG_USBNET_HOSTADDR 9a:04:c7:d6:30:d0\r
337 \r
338 \r
339 #define CONFIG_NET_MULTI\r
340 #define CONFIG_CMD_DNS\r
341 #define CONFIG_CMD_NFS\r
342 #define CONFIG_CMD_RARP\r
343 #define CONFIG_CMD_PING\r
344 /*#define CONFIG_CMD_SNTP */\r
345 #endif\r
346 \r
347 #define CONFIG_USB_CORE_IP_293A\r
348 #define CONFIG_USB_GADGET_SC8800G\r
349 #define CONFIG_USB_DWC\r
350 #define CONFIG_USB_GADGET_DUALSPEED\r
351 //#define CONFIG_USB_ETHER\r
352 #define CONFIG_CMD_FASTBOOT\r
353 #define SCRATCH_ADDR    (CONFIG_SYS_SDRAM_BASE + 0x100000)\r
354 #define FB_DOWNLOAD_BUF_SIZE (250*1024*1024)\r
355 \r
356 #define CONFIG_MODEM_CALIBERATE\r
357 /*\r
358 #define CONFIG_UPDATE_TFTP\r
359 #define CONFIG_FIT\r
360 #define CONFIG_OF_LIBFDT\r
361 #define CONFIG_SYS_MAX_FLASH_BANKS 1\r
362 #define CONFIG_SYS_MAX_FLASH_SECT 128\r
363 */\r
364 #define CONFIG_LCD\r
365 #ifdef  CONFIG_LCD\r
366 #define CONFIG_SPLASH_SCREEN\r
367 #define LCD_BPP LCD_COLOR16\r
368 //#define CONFIG_LCD_HVGA   1\r
369 //#define CONFIG_LCD_WVGA   1\r
370 #define CONFIG_LCD_QHD 1\r
371 //#define CONFIG_LCD_INFO\r
372 //#define LCD_TEST_PATTERN\r
373 //#define CONFIG_LCD_LOGO\r
374 #define CONFIG_FB_LCD_NT35516_MIPI\r
375 #define CONFIG_FB_LCD_OTM8018B_MIPI\r
376 #define CONFIG_SYS_WHITE_ON_BLACK\r
377 #ifdef  LCD_TEST_PATTERN\r
378 #define CONSOLE_COLOR_RED 0xf800 \r
379 #define CONSOLE_COLOR_GREEN 0x07e0\r
380 #define CONSOLE_COLOR_YELLOW 0x07e0\r
381 #define CONSOLE_COLOR_BLUE 0x001f\r
382 #define CONSOLE_COLOR_MAGENTA 0x001f\r
383 #define CONSOLE_COLOR_CYAN 0x001f\r
384 #endif\r
385 #endif // CONFIG_LCD\r
386 \r
387 /*\r
388  * MMC definition\r
389  */\r
390 #define CONFIG_CMD_MMC\r
391 #ifdef CONFIG_CMD_MMC\r
392 #define CONFIG_CMD_FAT                  1\r
393 #define CONFIG_FAT_WRITE        1\r
394 #define CONFIG_GENERIC_MMC              1\r
395 #define CONFIG_SDHCI                    1\r
396 #define CONFIG_SYS_MMC_MAX_BLK_COUNT    0x1000\r
397 #define CONFIG_MMC_SDMA                 1\r
398 #define CONFIG_MV_SDHCI                 1\r
399 #define CONFIG_DOS_PARTITION            1\r
400 #define CONFIG_SYS_MMC_NUM              2\r
401 #define CONFIG_SYS_MMC_BASE             {0x20510000,0x20530000}\r
402 #define CONFIG_SIMLOCK\r
403 #endif\r
404 \r
405 #define CALIBRATE_ENUM_MS 15000\r
406 #define CALIBRATE_IO_MS 10000\r
407 \r
408 //#define LOW_BAT_ADC_LEVEL 782 /*phone battery adc value low than this value will not boot up*/\r
409 #define LOW_BAT_VOL            3500 /*phone battery voltage low than this value will not boot up*/\r
410 #define LOW_BAT_VOL_CHG        3300    //3.3V charger connect\r
411 \r
412 #define PWR_KEY_DETECT_CNT 12 /*this should match the count of boot_pwr_check() function */\r
413 #define ALARM_LEAD_SET_MS 0 /* time set for alarm boot in advancd */\r
414 \r
415 #define CONFIG_CMD_SOUND 1\r
416 #define CONFIG_CMD_FOR_HTC 1\r
417 #define CONFIG_SOUND_CODEC_SPRD 1\r
418 #define CONFIG_SOUND_DAI_VBC 1\r
419 #define USB_PHY_TUNE_VALUE 0x44073e33\r
420 \r
421 #endif /* __CONFIG_H */\r