tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / include / configs / native_openphone.h
1 /*
2  * (C) Copyright 2009 DENX Software Engineering
3  * Author: John Rigby <jrigby@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18  * MA 02111-1307 USA
19  */
20
21 #ifndef __CONFIG_H
22 #define __CONFIG_H
23 //only used in fdl2 .in uart download, the debug infors  from  serial will break the download process.
24 #define CONFIG_FDL2_PRINT  0    
25 #define BOOT_NATIVE_LINUX (1)
26
27 #define CONFIG_SILENT_CONSOLE
28 #define CONFIG_GPIOLIB 1
29 //#define NAND_DEBUG  
30 //#define DEBUG
31 #define U_BOOT_SPRD_VER 1
32 /*#define SPRD_EVM_TAG_ON 1*/
33 #ifdef SPRD_EVM_TAG_ON
34 #define SPRD_EVM_ADDR_START 0x40006000
35 #define SPRD_EVM_TAG(_x) (*(((unsigned long *)SPRD_EVM_ADDR_START)+_x) = *(volatile unsigned long *)0x87003004)
36 #endif
37 #define CONFIG_L2_OFF                   1
38
39 #define BOOT_DEBUG 1
40
41 #define CONFIG_YAFFS2 1
42
43 #define BOOT_PART "boot"
44 //#define BOOT_PART "kernel"
45 #define RECOVERY_PART "recovery"
46 /*
47  * SPREADTRUM BIGPHONE board - SoC Configuration
48  */
49
50 #define CONFIG_SC8810
51 #define CONFIG_SC8810_OPENPHONE
52
53 #ifdef CONFIG_SC8810
54 #define CONFIG_SC8810_OPENPHONE
55 #define CHIP_ENDIAN_LITTLE
56 #define SC8800S_LITTLE_ENDIAN FALSE
57 #define _LITTLE_ENDIAN 1
58 #define EXT_MEM_TYPE_DDR 1
59 #endif
60
61 #define BB_DRAM_TYPE_256MB_32BIT
62 #define  CONFIG_MTD_NAND_SC8810 1
63
64 #define CONFIG_SYS_HZ                   1000
65 #define CONFIG_SPRD_TIMER_CLK           1000 /*32768*/
66
67 //#define CONFIG_SYS_HUSH_PARSER
68
69 #ifdef CONFIG_SYS_HUSH_PARSER
70 #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
71 #endif
72
73 #define FIXNV_SIZE              (64 * 1024)
74 #define MODEM_SIZE              (8 * 1024 * 1024)
75 #define CONFIG_SPL_LOAD_LEN (0x4000)
76
77
78 /*#define CMDLINE_NEED_CONV */
79
80 #define WATCHDOG_LOAD_VALUE     0x4000
81 #define CONFIG_SYS_STACK_SIZE   0x400
82
83 //#define       CONFIG_SYS_MONITOR_LEN          (256 << 10)     /* 256 kB for U-Boot */
84
85 /* NAND BOOT is the only boot method */
86 #define CONFIG_NAND_U_BOOT
87 #define DYNAMIC_CRC_TABLE
88 /* Start copying real U-boot from the second page */
89 #define CONFIG_SYS_NAND_U_BOOT_OFFS     0x40000
90 #define CONFIG_SYS_NAND_U_BOOT_SIZE     0x64000
91 #define RAM_TYPPE_IS_SDRAM      0
92
93 /* Load U-Boot to this address */
94 #define CONFIG_SYS_NAND_U_BOOT_DST      0x00f00000
95 #define CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_NAND_U_BOOT_DST
96 #ifdef CONFIG_NAND_SPL
97 #define CONFIG_SYS_SDRAM_BASE    0x00000000
98 #define CONFIG_SYS_INIT_SP_ADDR     \
99         (CONFIG_SYS_SDRAM_BASE + 0x4000)
100
101 #define CONFIG_SYS_NAND_SPARE_SIZE      64
102 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128 * 1024)
103 #define CONFIG_SYS_NAND_PAGE_COUNT      64
104 #define CONFIG_SYS_NAND_SIZE            (128 * 1024 * 1024)
105 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   0
106
107 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
108
109 #else
110 #define CONFIG_MMU_TABLE_ADDR (0x40000000)
111
112 #define CONFIG_SYS_SDRAM_BASE 0x00000000
113 #define CONFIG_SYS_INIT_SP_ADDR     \
114         (CONFIG_SYS_SDRAM_BASE + 0x1000 - GENERATED_GBL_DATA_SIZE)
115
116 #define CONFIG_SKIP_LOWLEVEL_INIT
117 #endif
118
119 #define CONFIG_SYS_NAND_PAGE_SIZE       2048
120 /* Size of the block protected by one OOB (Spare Area in Samsung terminology) */
121 #define CONFIG_SYS_NAND_ECCSIZE 512
122 /* Number of ECC bytes per OOB - S3C6400 calculates 4 bytes ECC in 1-bit mode */
123 #define CONFIG_SYS_NAND_ECCBYTES        4
124 /* Number of ECC-blocks per NAND page */
125 #define CONFIG_SYS_NAND_ECCSTEPS        (CONFIG_SYS_NAND_PAGE_SIZE / CONFIG_SYS_NAND_ECCSIZE)
126 /* 2 bit correct, sc8810 support 1, 2, 4, 8, 12,14, 24 */
127 #define CONFIG_SYS_NAND_ECC_MODE        2
128 #define CONFIG_SYS_SPL_ECC_POS          8
129 /* Size of a single OOB region */
130 #define CONFIG_SYS_NAND_OOBSIZE 64
131 /* Number of ECC bytes per page */
132 #define CONFIG_SYS_NAND_ECCTOTAL        (CONFIG_SYS_NAND_ECCBYTES * CONFIG_SYS_NAND_ECCSTEPS)
133 /* ECC byte positions */
134 #define CONFIG_SYS_NAND_ECCPOS          {40, 41, 42, 43, 44, 45, 46, 47, \
135                                  48, 49, 50, 51, 52, 53, 54, 55, \
136                                  56, 57, 58, 59, 60, 61, 62, 63}
137
138 #define CONFIG_HW_WATCHDOG
139
140 #define CONFIG_DISPLAY_CPUINFO
141
142 #define CONFIG_CMDLINE_TAG              1       /* enable passing of ATAGs */
143 #define CONFIG_SETUP_MEMORY_TAGS        1
144 #define CONFIG_INITRD_TAG               1
145
146 /*
147  * Memory Info
148  */
149 /* malloc() len */
150 #define CONFIG_SYS_MALLOC_LEN           (2 << 20)       /* 1 MiB */
151 /*
152  * Board has 2 32MB banks of DRAM but there is a bug when using
153  * both so only the first is configured
154  */
155 #define CONFIG_NR_DRAM_BANKS    1
156
157 #define PHYS_SDRAM_1            0x00000000
158 #define PHYS_SDRAM_1_SIZE       0x10000000
159 #if (CONFIG_NR_DRAM_BANKS == 2)
160 #define PHYS_SDRAM_2            0x90000000
161 #define PHYS_SDRAM_2_SIZE       0x02000000
162 #endif
163 /* 8MB DRAM test */
164 #define CONFIG_SYS_MEMTEST_START        PHYS_SDRAM_1
165 #define CONFIG_SYS_MEMTEST_END          (PHYS_SDRAM_1+0x0800000)
166 #define CONFIG_STACKSIZE        (256 * 1024)    /* regular stack */
167
168 /*
169  * Serial Info
170  */
171 #define CONFIG_SPRD_UART                1
172 #define CONFIG_SYS_SC8800X_UART1        1
173 #define CONFIG_CONS_INDEX       1       /* use UART0 for console */
174 #define CONFIG_BAUDRATE         115200  /* Default baud rate */
175 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }
176
177 /*
178  * Flash & Environment
179  */
180 /* No NOR flash present */
181 #define CONFIG_SYS_MONITOR_LEN ((CONFIG_SYS_NAND_U_BOOT_OFFS)+(CONFIG_SYS_NAND_U_BOOT_SIZE))
182 #define CONFIG_SYS_NO_FLASH     1
183 #define CONFIG_ENV_IS_NOWHERE
184 #define CONFIG_ENV_SIZE         (128 * 1024)    
185 /*
186 #define CONFIG_ENV_IS_IN_NAND
187 #define CONFIG_ENV_OFFSET       CONFIG_SYS_MONITOR_LEN
188 #define CONFIG_ENV_OFFSET_REDUND        (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
189 */
190
191 /* NAND */
192 #define CONFIG_NAND_SC8810
193 #define CONFIG_SPRD_NAND_REGS_BASE      (0x60000000)
194 #define CONFIG_SYS_MAX_NAND_DEVICE      1
195 #define CONFIG_SYS_NAND_BASE            (0x60000000)
196 //#define CONFIG_JFFS2_NAND
197 //#define CONFIG_SPRD_NAND_HWECC
198 #define CONFIG_SYS_NAND_HW_ECC
199 #define CONFIG_SYS_NAND_LARGEPAGE
200 //#define CONFIG_SYS_NAND_5_ADDR_CYCLE
201
202 #define CONFIG_SYS_64BIT_VSPRINTF
203
204 #define CONFIG_CMD_MTDPARTS
205 #define CONFIG_MTD_PARTITIONS
206 #define CONFIG_MTD_DEVICE
207 #define CONFIG_CMD_UBI
208 #define CONFIG_RBTREE
209
210 /* U-Boot general configuration */
211 #define CONFIG_SYS_PROMPT       "=> "   /* Monitor Command Prompt */
212 #define CONFIG_SYS_CBSIZE       1024    /* Console I/O Buffer Size  */
213 /* Print buffer sz */
214 #define CONFIG_SYS_PBSIZE       (CONFIG_SYS_CBSIZE + \
215                 sizeof(CONFIG_SYS_PROMPT) + 16)
216 #define CONFIG_SYS_MAXARGS      32      /* max number of command args */
217 /* Boot Argument Buffer Size */
218 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE
219 #define CONFIG_CMDLINE_EDITING
220 #define CONFIG_SYS_LONGHELP
221
222 /* support OS choose */
223 #undef CONFIG_BOOTM_NETBSD 
224 #undef CONFIG_BOOTM_RTEMS
225
226 /* U-Boot commands */
227 #include <config_cmd_default.h>
228 #define CONFIG_CMD_NAND
229 #undef CONFIG_CMD_FPGA
230 #undef CONFIG_CMD_LOADS
231 #undef CONFIG_CMD_NET
232 #undef CONFIG_CMD_NFS
233 #undef CONFIG_CMD_SETGETDCR
234
235 #define CONFIG_ENV_OVERWRITE
236
237 #ifdef SPRD_EVM_TAG_ON
238 #define CONFIG_BOOTDELAY        0
239 #else
240 #define CONFIG_BOOTDELAY        0
241 #define CONFIG_ZERO_BOOTDELAY_CHECK
242 #endif
243
244 #define CONFIG_LOADADDR         0x01000000      /* loadaddr env var */
245 #define CONFIG_SYS_LOAD_ADDR    CONFIG_LOADADDR
246
247 #define xstr(s) str(s)
248 #define str(s)  #s
249
250 #define MTDIDS_DEFAULT "nand0=sprd-nand"
251 #ifdef CONFIG_G2PHONE
252 #define MTDPARTS_DEFAULT "mtdparts=sprd-nand:384k@256k(boot),256k(params),6m(kernel),6m(ramdisk),6m(recovery),70m(system),30m(userdata),7m(cache)"
253 #define CONFIG_BOOTARGS "mem=64M console=ttyS1,115200n8 init=/init "MTDPARTS_DEFAULT
254 #elif defined CONFIG_SC8810_OPENPHONE
255 /*#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)"*/
256 //#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)"
257 //#define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),512k(2ndbl),128k(params),512k(vmjaluna),10m(modem),10m(boot)"
258 #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),200m(system),230m(userdata),20m(cache),256k(misc),1m(boot_logo),1m(fastboot_logo),3840k(productinfo),512k(kpanic)"
259 #ifdef RAM512M
260 #define CONFIG_BOOTARGS "mem=512M console=ttyS1,115200n8 init=/init " MTDPARTS_DEFAULT
261 #else
262 #define CONFIG_BOOTARGS "mem=256M console=ttyS1,115200n8 init=/init " MTDPARTS_DEFAULT
263 #endif
264 #endif
265
266 #define COPY_LINUX_KERNEL_SIZE  (0x600000)
267 #define LINUX_INITRD_NAME       "modem"
268
269 #define CONFIG_BOOTCOMMAND "cboot normal"
270 #define CONFIG_EXTRA_ENV_SETTINGS                               ""      
271
272 #ifdef CONFIG_CMD_NET
273 #define CONFIG_IPADDR 192.168.10.2
274 #define CONFIG_SERVERIP 192.168.10.5
275 #define CONFIG_NETMASK 255.255.255.0
276 #define CONFIG_USBNET_DEVADDR 26:03:ee:00:87:9f
277 #define CONFIG_USBNET_HOSTADDR 9a:04:c7:d6:30:d0
278
279
280 #define CONFIG_NET_MULTI
281 #define CONFIG_CMD_DNS
282 #define CONFIG_CMD_NFS
283 #define CONFIG_CMD_RARP
284 #define CONFIG_CMD_PING
285 /*#define CONFIG_CMD_SNTP */
286 #endif
287
288 #define CONFIG_USB_GADGET_SC8800G
289 #define CONFIG_USB_DWC
290 #define CONFIG_USB_GADGET_DUALSPEED
291 //#define CONFIG_USB_ETHER
292 #define CONFIG_CMD_FASTBOOT
293 #define SCRATCH_ADDR    0x1000000
294 #define FB_DOWNLOAD_BUF_SIZE (150*1024*1024)
295
296 #define CONFIG_MODEM_CALIBERATE
297 /*
298 #define CONFIG_UPDATE_TFTP
299 #define CONFIG_FIT
300 #define CONFIG_OF_LIBFDT
301 #define CONFIG_SYS_MAX_FLASH_BANKS 1
302 #define CONFIG_SYS_MAX_FLASH_SECT 128
303 */
304 #define CONFIG_LCD
305 #ifdef CONFIG_LCD
306 #define CONFIG_SPLASH_SCREEN
307 #define LCD_BPP LCD_COLOR16
308 #define CONFIG_LCD_HVGA   1
309 //#define CONFIG_LCD_WVGA   1
310 //#define CONFIG_LCD_INFO
311 //#define LCD_TEST_PATTERN
312 //#define CONFIG_LCD_LOGO
313 #define CONFIG_SYS_WHITE_ON_BLACK
314 #define CONFIG_LCD_HX8357_1
315 #ifdef LCD_TEST_PATTERN
316 #define CONSOLE_COLOR_RED 0xf800 
317 #define CONSOLE_COLOR_GREEN 0x07e0
318 #define CONSOLE_COLOR_YELLOW 0x07e0
319 #define CONSOLE_COLOR_BLUE 0x001f
320 #define CONSOLE_COLOR_MAGENTA 0x001f
321 #define CONSOLE_COLOR_CYAN 0x001f
322 #endif
323 #endif // CONFIG_LCD
324
325 #define CALIBRATE_ENUM_MS 15000
326 #define CALIBRATE_IO_MS 10000
327
328 #define LOW_BAT_VOL            3500 /*phone battery voltage low than this value will not boot up*/
329 #define LOW_BAT_VOL_CHG        3300    //3.3V charger connect
330
331 #define PWR_KEY_DETECT_CNT 12 /*this should match the count of boot_pwr_check() function */
332 #define ALARM_LEAD_SET_MS 0 /* time set for alarm boot in advancd */
333
334 #endif /* __CONFIG_H */