tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / include / configs / sp8825ga_openphone.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_SP8825GA_OPENPHONE\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 \r
62 /********** DDR timing configuration for customer begin *************/\r
63 #define CONFIG_DDR_TIMING_CUSTOM FALSE //TRUE or FALSE\r
64 \r
65 // name: CONFIG_LPDDR1_DS\r
66 // description: to config lpddr1 driver strength\r
67 // note: when lpddr2, don't need to set this parameter\r
68 // legal value:  \r
69 // LPDDR1_DS_33_OHM\r
70 // LPDDR1_DS_31_OHM\r
71 // LPDDR1_DS_48_OHM\r
72 // LPDDR1_DS_43_OHM\r
73 // LPDDR1_DS_39_OHM\r
74 // LPDDR1_DS_55_OHM\r
75 // LPDDR1_DS_64_OHM\r
76 #define CONFIG_LPDDR1_DS  LPDDR1_DS_39_OHM \r
77 \r
78 // name: CONFIG_LPDDR2_DS\r
79 // note: to config lpddr2 driver strength, when lpddr1, don't need to set this parameter\r
80 // legal value:  \r
81 // LPDDR2_DS_34_OHM\r
82 // LPDDR2_DS_40_OHM\r
83 // LPDDR2_DS_48_OHM\r
84 // LPDDR2_DS_60_OHM\r
85 // LPDDR2_DS_80_OHM\r
86 #define CONFIG_LPDDR2_DS LPDDR2_DS_40_OHM\r
87 \r
88 // name: CONFIG_BYTEx_PHY_DLY\r
89 // description: to config BYTE0~BYTE3 slave dll phase delay in ddr controller\r
90 // note: when lpddr1, don't need to set this parameter\r
91 // legal value:  \r
92 // SDLL_PHS_DLY_DEF\r
93 // SDLL_PHS_DLY_36\r
94 // SDLL_PHS_DLY_54\r
95 // SDLL_PHS_DLY_72\r
96 // SDLL_PHS_DLY_90\r
97 // SDLL_PHS_DLY_108\r
98 // SDLL_PHS_DLY_126\r
99 // SDLL_PHS_DLY_144\r
100 #define CONFIG_BYTE0_PHS_DLY SDLL_PHS_DLY_DEF\r
101 #define CONFIG_BYTE1_PHS_DLY SDLL_PHS_DLY_DEF\r
102 #define CONFIG_BYTE2_PHS_DLY SDLL_PHS_DLY_DEF\r
103 #define CONFIG_BYTE3_PHS_DLY SDLL_PHS_DLY_DEF\r
104 \r
105 // name: CONFIG_BYTEx_STEP_DLY\r
106 // description: to config BYTE0~BYTE3 dqs step delay in ddr controller\r
107 // note: when lpddr1, don't need to set this parameter\r
108 // legal value:  \r
109 // DQS_STEP_DLY_SUB3,\r
110 // DQS_STEP_DLY_SUB2,\r
111 // DQS_STEP_DLY_SUB1,\r
112 // DQS_STEP_DLY_NOM,\r
113 // DQS_STEP_DLY_DEF,\r
114 // DQS_STEP_DLY_ADD1,\r
115 // DQS_STEP_DLY_ADD2,\r
116 // DQS_STEP_DLY_ADD3,\r
117 // DQS_STEP_DLY_ADD4,\r
118 #define CONFIG_BYTE0_STEP_DLY DQS_STEP_DLY_NOM\r
119 #define CONFIG_BYTE1_STEP_DLY DQS_STEP_DLY_NOM\r
120 #define CONFIG_BYTE2_STEP_DLY DQS_STEP_DLY_NOM\r
121 #define CONFIG_BYTE3_STEP_DLY DQS_STEP_DLY_NOM\r
122 /************* DDR timing configuration for customer end **************/\r
123 \r
124 \r
125 #define CONFIG_RAM512M\r
126 #define BB_DRAM_TYPE_256MB_32BIT\r
127 #define  CONFIG_MTD_NAND_TIGER 1\r
128 //#define  CONFIG_MTD_NAND_SC8810 1\r
129 \r
130 \r
131 \r
132 #define CONFIG_SYS_HZ                   1000\r
133 #define CONFIG_SPRD_TIMER_CLK           1000 /*32768*/\r
134 \r
135 //#define CONFIG_SYS_HUSH_PARSER\r
136 \r
137 #ifdef CONFIG_SYS_HUSH_PARSER\r
138 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "\r
139 #endif\r
140 \r
141 #define FIXNV_SIZE                      (64 * 1024)\r
142 #define MODEM_SIZE              (0x800000)\r
143 #define DSP_SIZE        (0x3E0400) /* 3968K */\r
144 #define VMJALUNA_SIZE       (0x64000) /* 400K */\r
145 #define RUNTIMENV_SIZE      (256 * 1024)\r
146 #define CONFIG_SPL_LOAD_LEN (0x6000)\r
147 \r
148 \r
149 /*#define CMDLINE_NEED_CONV */\r
150 \r
151 #define WATCHDOG_LOAD_VALUE     0x4000\r
152 #define CONFIG_SYS_STACK_SIZE   0x400\r
153 //#define CONFIG_SYS_TEXT_BASZE  0x80f00000\r
154 \r
155 //#define       CONFIG_SYS_MONITOR_LEN          (256 << 10)     /* 256 kB for U-Boot */\r
156 \r
157 /* NAND BOOT is the only boot method */\r
158 #define CONFIG_NAND_U_BOOT\r
159 #define DYNAMIC_CRC_TABLE\r
160 /* Start copying real U-boot from the second page */\r
161 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x40000\r
162 #define CONFIG_SYS_NAND_U_BOOT_SIZE     0x70000\r
163 #define RAM_TYPPE_IS_SDRAM      0\r
164 //#define FPGA_TRACE_DOWNLOAD //for download image from trace\r
165 \r
166 /* Load U-Boot to this address */\r
167 #define CONFIG_SYS_NAND_U_BOOT_DST      0x80f00000\r
168 #define CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_NAND_U_BOOT_DST\r
169 #ifdef CONFIG_NAND_SPL\r
170 #define CONFIG_SYS_SDRAM_BASE 0x80000000\r
171 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x4000)\r
172 #else\r
173 \r
174 #define CONFIG_MMU_TABLE_ADDR (0x00020000)\r
175 #define CONFIG_SYS_SDRAM_BASE 0x80000000\r
176 #define CONFIG_SYS_INIT_SP_ADDR     \\r
177         (CONFIG_SYS_SDRAM_BASE + 0x1000 - GENERATED_GBL_DATA_SIZE)\r
178 \r
179 #define CONFIG_SKIP_LOWLEVEL_INIT\r
180 #endif\r
181 \r
182 #define CONFIG_HW_WATCHDOG\r
183 //#define CONFIG_AUTOBOOT //used for FPGA test, auto boot other image\r
184 //#define CONFIG_DISPLAY_CPUINFO\r
185 \r
186 #define CONFIG_CMDLINE_TAG              1       /* enable passing of ATAGs */\r
187 #define CONFIG_SETUP_MEMORY_TAGS        1\r
188 #define CONFIG_INITRD_TAG               1\r
189 \r
190 /*\r
191  * Memory Info\r
192  */\r
193 /* malloc() len */\r
194 #define CONFIG_SYS_MALLOC_LEN           (2 << 20)       /* 1 MiB */\r
195 /*\r
196  * Board has 2 32MB banks of DRAM but there is a bug when using\r
197  * both so only the first is configured\r
198  */\r
199 #define CONFIG_NR_DRAM_BANKS    1\r
200 \r
201 #define PHYS_SDRAM_1            0x80000000\r
202 #define PHYS_SDRAM_1_SIZE       0x10000000\r
203 #if (CONFIG_NR_DRAM_BANKS == 2)\r
204 #define PHYS_SDRAM_2            0x90000000\r
205 #define PHYS_SDRAM_2_SIZE       0x10000000\r
206 #endif\r
207 /* 8MB DRAM test */\r
208 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1\r
209 #define CONFIG_SYS_MEMTEST_END          (PHYS_SDRAM_1+0x0800000)\r
210 #define CONFIG_STACKSIZE        (256 * 1024)    /* regular stack */\r
211 \r
212 /*\r
213  * Serial Info\r
214  */\r
215 #define CONFIG_SPRD_UART                1\r
216 #define CONFIG_SYS_SC8800X_UART1        1\r
217 #define CONFIG_CONS_INDEX       1       /* use UART0 for console */\r
218 #define CONFIG_BAUDRATE         115200  /* Default baud rate */\r
219 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }\r
220 #define CONFIG_SC8825_SPI\r
221 #define CONFIG_SC8825_I2C\r
222 /*\r
223  * Flash & Environment\r
224  */\r
225 /* No NOR flash present */\r
226 #define CONFIG_SYS_MONITOR_LEN ((CONFIG_SYS_NAND_U_BOOT_OFFS)+(CONFIG_SYS_NAND_U_BOOT_SIZE))\r
227 #define CONFIG_SYS_NO_FLASH     1\r
228 #define CONFIG_ENV_IS_NOWHERE\r
229 #define CONFIG_ENV_SIZE         (128 * 1024)    \r
230 /*\r
231 #define CONFIG_ENV_IS_IN_NAND\r
232 #define CONFIG_ENV_OFFSET       CONFIG_SYS_MONITOR_LEN\r
233 #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)\r
234 */\r
235 \r
236 /* NAND */\r
237 #define CONFIG_NAND_TIGER\r
238 //#define CONFIG_NAND_SC8810\r
239 #define CONFIG_SPRD_NAND_REGS_BASE      (0x21100000)\r
240 #define CONFIG_SYS_MAX_NAND_DEVICE      1\r
241 #define CONFIG_SYS_NAND_BASE            (0x21100000)\r
242 //#define CONFIG_JFFS2_NAND\r
243 //#define CONFIG_SPRD_NAND_HWECC\r
244 #define CONFIG_SYS_NAND_HW_ECC\r
245 #define CONFIG_SYS_NAND_LARGEPAGE\r
246 //#define CONFIG_SYS_NAND_5_ADDR_CYCLE\r
247 \r
248 #define CONFIG_SYS_64BIT_VSPRINTF\r
249 \r
250 #define CONFIG_CMD_MTDPARTS\r
251 #define CONFIG_MTD_PARTITIONS\r
252 #define CONFIG_MTD_DEVICE\r
253 #define CONFIG_CMD_UBI\r
254 #define CONFIG_RBTREE\r
255 \r
256 /* U-Boot general configuration */\r
257 #define CONFIG_SYS_PROMPT       "=> "   /* Monitor Command Prompt */\r
258 #define CONFIG_SYS_CBSIZE       1024    /* Console I/O Buffer Size  */\r
259 /* Print buffer sz */\r
260 #define CONFIG_SYS_PBSIZE       (CONFIG_SYS_CBSIZE + \\r
261                 sizeof(CONFIG_SYS_PROMPT) + 16)\r
262 #define CONFIG_SYS_MAXARGS      32      /* max number of command args */\r
263 /* Boot Argument Buffer Size */\r
264 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE\r
265 #define CONFIG_CMDLINE_EDITING\r
266 #define CONFIG_SYS_LONGHELP\r
267 \r
268 /* support OS choose */\r
269 #undef CONFIG_BOOTM_NETBSD \r
270 #undef CONFIG_BOOTM_RTEMS\r
271 \r
272 /* U-Boot commands */\r
273 #include <config_cmd_default.h>\r
274 #define CONFIG_CMD_NAND\r
275 #undef CONFIG_CMD_FPGA\r
276 #undef CONFIG_CMD_LOADS\r
277 #undef CONFIG_CMD_NET\r
278 #undef CONFIG_CMD_NFS\r
279 #undef CONFIG_CMD_SETGETDCR\r
280 \r
281 #define CONFIG_ENV_OVERWRITE\r
282 \r
283 #ifdef SPRD_EVM_TAG_ON\r
284 #define CONFIG_BOOTDELAY        0\r
285 #else\r
286 #define CONFIG_BOOTDELAY        0\r
287 #define CONFIG_ZERO_BOOTDELAY_CHECK\r
288 #endif\r
289 \r
290 #define CONFIG_LOADADDR         0x81000000      /* loadaddr env var */\r
291 #define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR\r
292 \r
293 #define xstr(s) str(s)\r
294 #define str(s)  #s\r
295 \r
296 #define MTDIDS_DEFAULT "nand0=sprd-nand"\r
297 #ifdef CONFIG_G2PHONE\r
298 #define MTDPARTS_DEFAULT "mtdparts=sprd-nand:384k@256k(boot),256k(params),6m(kernel),6m(ramdisk),6m(recovery),70m(system),30m(userdata),7m(cache)"\r
299 #define CONFIG_BOOTARGS "mem=64M console=ttyS1,115200n8 init=/init "MTDPARTS_DEFAULT\r
300 #elif defined CONFIG_SC8825\r
301 /*#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
302 //#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
303 //#define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),512k(2ndbl),128k(params),512k(vmjaluna),10m(modem),10m(boot)"\r
304 #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
305 #define CONFIG_BOOTARGS "mem=256M console=ttyS1,115200n8 init=/init " MTDPARTS_DEFAULT\r
306 #endif\r
307 \r
308 #define COPY_LINUX_KERNEL_SIZE  (0x600000)\r
309 #define LINUX_INITRD_NAME       "modem"\r
310 \r
311 #define CONFIG_BOOTCOMMAND "cboot normal"\r
312 #define CONFIG_EXTRA_ENV_SETTINGS                               ""      \r
313 \r
314 #ifdef CONFIG_CMD_NET\r
315 #define CONFIG_IPADDR 192.168.10.2\r
316 #define CONFIG_SERVERIP 192.168.10.5\r
317 #define CONFIG_NETMASK 255.255.255.0\r
318 #define CONFIG_USBNET_DEVADDR 26:03:ee:00:87:9f\r
319 #define CONFIG_USBNET_HOSTADDR 9a:04:c7:d6:30:d0\r
320 \r
321 \r
322 #define CONFIG_NET_MULTI\r
323 #define CONFIG_CMD_DNS\r
324 #define CONFIG_CMD_NFS\r
325 #define CONFIG_CMD_RARP\r
326 #define CONFIG_CMD_PING\r
327 /*#define CONFIG_CMD_SNTP */\r
328 #endif\r
329 \r
330 #define CONFIG_USB_CORE_IP_293A\r
331 #define CONFIG_USB_GADGET_SC8800G\r
332 #define CONFIG_USB_DWC\r
333 #define CONFIG_USB_GADGET_DUALSPEED\r
334 //#define CONFIG_USB_ETHER\r
335 #define CONFIG_CMD_FASTBOOT\r
336 #define SCRATCH_ADDR (PHYS_SDRAM_1+0x2000000)\r
337 #define FB_DOWNLOAD_BUF_SIZE (250*1024*1024)\r
338 \r
339 #define CONFIG_MODEM_CALIBERATE\r
340 /*\r
341 #define CONFIG_UPDATE_TFTP\r
342 #define CONFIG_FIT\r
343 #define CONFIG_OF_LIBFDT\r
344 #define CONFIG_SYS_MAX_FLASH_BANKS 1\r
345 #define CONFIG_SYS_MAX_FLASH_SECT 128\r
346 */\r
347 #define CONFIG_LCD\r
348 #ifdef  CONFIG_LCD\r
349 #define CONFIG_SPLASH_SCREEN\r
350 #define LCD_BPP LCD_COLOR16\r
351 //#define CONFIG_LCD_HVGA   1\r
352 //#define CONFIG_LCD_WVGA   1\r
353 #define CONFIG_LCD_QHD 1\r
354 //#define CONFIG_LCD_INFO\r
355 //#define LCD_TEST_PATTERN\r
356 //#define CONFIG_LCD_LOGO\r
357 #define CONFIG_FB_LCD_NT35516_MIPI\r
358 #define CONFIG_SYS_WHITE_ON_BLACK\r
359 #ifdef  LCD_TEST_PATTERN\r
360 #define CONSOLE_COLOR_RED 0xf800 \r
361 #define CONSOLE_COLOR_GREEN 0x07e0\r
362 #define CONSOLE_COLOR_YELLOW 0x07e0\r
363 #define CONSOLE_COLOR_BLUE 0x001f\r
364 #define CONSOLE_COLOR_MAGENTA 0x001f\r
365 #define CONSOLE_COLOR_CYAN 0x001f\r
366 #endif\r
367 #endif // CONFIG_LCD\r
368 \r
369 #define CALIBRATE_ENUM_MS 15000\r
370 #define CALIBRATE_IO_MS 10000\r
371 \r
372 //#define LOW_BAT_ADC_LEVEL 782 /*phone battery adc value low than this value will not boot up*/\r
373 #define LOW_BAT_VOL            3500 /*phone battery voltage low than this value will not boot up*/\r
374 #define LOW_BAT_VOL_CHG        3300    //3.3V charger connect\r
375 \r
376 #define PWR_KEY_DETECT_CNT 12 /*this should match the count of boot_pwr_check() function */\r
377 #define ALARM_LEAD_SET_MS 0 /* time set for alarm boot in advancd */\r
378 #define USB_PHY_TUNE_VALUE 0x44073e33\r
379 \r
380 \r
381 #endif /* __CONFIG_H */\r