recovery: update is modified to support various image
[kernel/u-boot.git] / include / configs / s5pc1xx_universal.h
1 /*
2  * Copyright (C) 2009 Samsung Electronics
3  * Minkyu Kang <mk7.kang@samsung.com>
4  *
5  * Configuation settings for the SAMSUNG Universal (s5pc100) board.
6  *
7  * See file CREDITS for list of people who contributed to this
8  * project.
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License as
12  * published by the Free Software Foundation; either version 2 of
13  * the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23  * MA 02111-1307 USA
24  */
25
26 #ifndef __CONFIG_H
27 #define __CONFIG_H
28
29 /*
30  * High Level Configuration Options
31  * (easy to change)
32  */
33 #define CONFIG_ARMCORTEXA8      1       /* This is an ARM V7 CPU core */
34 #define CONFIG_SAMSUNG          1       /* in a SAMSUNG core */
35 #define CONFIG_S5PC1XX          1       /* which is in a S5PC1XX Family */
36 #define CONFIG_S5PC100          1       /* which is in a S5PC100 */
37 #define CONFIG_S5PC110          1       /* which is in a S5PC110 */
38 #define CONFIG_UNIVERSAL        1       /* working with Universal */
39 #define CONFIG_MACH_AQUILA      1       /* working with Aquila */
40 #define CONFIG_RECOVERY         1       /* working with recovery block */
41
42 #include <asm/arch/cpu.h>               /* get chip and board defs */
43
44 #define CONFIG_ARCH_CPU_INIT
45
46 #define CONFIG_SYS_SDRAM_BASE   0x30000000
47
48 /* input clock of PLL: Universal has 12MHz/24MHz input clock at S5PC100/C110 */
49 #define CONFIG_SYS_CLK_FREQ_C100        12000000
50 #define CONFIG_SYS_CLK_FREQ_C110        24000000
51
52 #define CONFIG_MEMORY_UPPER_CODE
53
54 #define CONFIG_SETUP_MEMORY_TAGS
55 #define CONFIG_CMDLINE_TAG
56 #define CONFIG_INITRD_TAG
57 #define CONFIG_REVISION_TAG
58
59 /* Clock Defines */
60 #define V_OSCK          26000000        /* Clock output from T2 */
61 #define V_SCLK          (V_OSCK >> 1)
62
63 /*
64  * Architecture magic and machine type
65  */
66 #define MACH_TYPE       3000
67
68 #define CONFIG_DISPLAY_CPUINFO
69
70 #undef CONFIG_SKIP_RELOCATE_UBOOT
71
72 /*
73  * Size of malloc() pool
74  */
75 #define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + 1024 * 1024)
76 #define CONFIG_SYS_GBL_DATA_SIZE        128     /* size in bytes for initial data */
77
78 /*
79  * select serial console configuration
80  */
81 #define CONFIG_SERIAL_MULTI     1
82 #define CONFIG_SERIAL2          1       /* we use SERIAL 2 on S5PC100 */
83
84 /* MMC */
85 #define CONFIG_GENERIC_MMC      1
86 #define CONFIG_MMC              1
87 #define CONFIG_S5PC1XX_MMC      1
88 #define CONFIG_MMC_INDEX        0
89
90 #define CONFIG_SYS_HUSH_PARSER          /* use "hush" command parser    */
91 #ifdef CONFIG_SYS_HUSH_PARSER
92 #define CONFIG_SYS_PROMPT_HUSH_PS2      "> "
93 #endif
94
95 #define CONFIG_CMDLINE_EDITING
96
97 #define CONFIG_BAUDRATE         115200
98
99 /* It should define before config_cmd_default.h */
100 #define CONFIG_SYS_NO_FLASH             1
101 /***********************************************************
102  * Command definition
103  ***********************************************************/
104 #include <config_cmd_default.h>
105
106 #undef CONFIG_CMD_BOOTD
107 #undef CONFIG_CMD_CONSOLE
108 #undef CONFIG_CMD_ECHO
109 #undef CONFIG_CMD_FPGA
110 #undef CONFIG_CMD_ITEST
111 #undef CONFIG_CMD_FLASH
112 #undef CONFIG_CMD_IMLS
113 #undef CONFIG_CMD_LOADB
114 #undef CONFIG_CMD_LOADS
115 #undef CONFIG_CMD_NAND
116 #undef CONFIG_CMD_MISC
117 #undef CONFIG_CMD_NFS
118 #undef CONFIG_CMD_SOURCE
119 #undef CONFIG_CMD_XIMG
120 #define CONFIG_CMD_CACHE
121 #define CONFIG_CMD_REGINFO
122 #define CONFIG_CMD_ONENAND
123 #define CONFIG_CMD_MTDPARTS
124 #define CONFIG_CMD_MTDPARTS_LITE
125 #define CONFIG_CMD_I2C
126 #define CONFIG_CMD_MMC
127 #define CONFIG_CMD_SLEEP
128 #define CONFIG_CMD_PMIC
129 #define CONFIG_CMD_DEVICE_POWER
130
131 /* disabled commands */
132 //#define CONFIG_CMD_GPIO
133
134 #undef CONFIG_CRC16
135 #undef CONFIG_XYZMODEM
136
137 #define CONFIG_SYS_64BIT_VSPRINTF       1
138
139 #define CONFIG_BOOTDELAY                1
140
141 #define CONFIG_ZERO_BOOTDELAY_CHECK
142
143 /* To enable UBI command */
144 #if 0
145 #define CONFIG_CMD_UBI
146 #define CONFIG_RBTREE
147 #define CONFIG_CMD_UBIFS
148 #define CONFIG_LZO
149 #endif
150
151 /* To use the TFTPBOOT over USB, Please enable the CONFIG_CMD_NET */
152 #undef CONFIG_CMD_NET
153
154 #ifdef CONFIG_CMD_NET
155 /* Ethernet */
156 #define CONFIG_NET_MULTI                1
157 #define CONFIG_NET_RETRY_COUNT          2
158 #define CONFIG_NET_DO_NOT_TRY_ANOTHER   1
159
160 /* NFS support in Ethernet over USB is broken */
161
162 /* Configure Ethernet over USB */
163 #define CONFIG_USB_ETH_RNDIS            1
164 #define CONFIG_USB_GADGET               1
165 #define CONFIG_USB_GADGET_S3C_UDC_OTG           1
166 #define CONFIG_USB_GADGET_DUALSPEED     1
167 #define CONFIG_USB_ETHER                1
168 #define CONFIG_USBNET_MANUFACTURER      "S5PC1xx U-Boot"
169 /* ethaddr settings can be overruled via environment settings */
170 #define CONFIG_USBNET_DEV_ADDR          "8e:28:0f:fa:3c:39"
171 #define CONFIG_USBNET_HOST_ADDR         "0a:fa:63:8b:e8:0a"
172 #define CONFIG_USB_CDC_VENDOR_ID        0x0525
173 #define CONFIG_USB_CDC_PRODUCT_ID       0xa4a1
174 #define CONFIG_USB_RNDIS_VENDOR_ID      0x0525
175 #define CONFIG_USB_RNDIS_PRODUCT_ID     0xa4a2
176
177 #endif
178
179 #define CONFIG_NETMASK          255.255.255.0
180 #define CONFIG_IPADDR           192.168.129.3
181 #define CONFIG_SERVERIP         192.168.129.1
182 #define CONFIG_GATEWAYIP        192.168.129.1
183 #define CONFIG_ETHADDR          8e:28:0f:fa:3c:39
184
185 #define CONFIG_MTD_DEVICE
186 #define CONFIG_MTD_PARTITIONS
187
188 /* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
189 #define MTDIDS_DEFAULT          "onenand0=samsung-onenand"
190 #define MTDPARTS_DEFAULT        "mtdparts=samsung-onenand:1m(bootloader)"\
191                                 ",128k(params)"\
192                                 ",2816k(config)"\
193                                 ",8m(csa)"\
194                                 ",7m(kernel)"\
195                                 ",1m(log)"\
196                                 ",12m(modem)"\
197                                 ",60m(qboot)"\
198                                 ",-(UBI)\0"
199
200 #define MTDPARTS_DEFAULT_4KB    "mtdparts=samsung-onenand:1m(bootloader)"\
201                                 ",256k(params)"\
202                                 ",2816k(config)"\
203                                 ",8m(csa)"\
204                                 ",7m(kernel)"\
205                                 ",1m(log)"\
206                                 ",12m(modem)"\
207                                 ",60m(qboot)"\
208                                 ",-(UBI)\0"
209
210 #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
211
212 #define CONFIG_BOOTCOMMAND      "run ubifsboot"
213
214 #define CONFIG_DEFAULT_CONSOLE  "console=ttySAC2,115200n8\0"
215
216 #define CONFIG_RAMDISK_BOOT     "root=/dev/ram0 rw rootfstype=ext2" \
217                 " ${console} ${meminfo}"
218
219 #define CONFIG_COMMON_BOOT      "${console} ${meminfo} ${mtdparts}"
220
221 #define CONFIG_BOOTARGS "root=/dev/mtdblock8 ubi.mtd=8 ubi.mtd=3 ubi.mtd=6" \
222                 " rootfstype=cramfs " CONFIG_COMMON_BOOT
223
224 #define CONFIG_UPDATEB  "updateb=onenand erase 0x0 0x100000;" \
225                         " onenand write 0x32008000 0x0 0x100000\0"
226
227 #define CONFIG_UBI_MTD  " ubi.mtd=${ubiblock} ubi.mtd=3 ubi.mtd=6"
228
229 #define CONFIG_UBIFS_OPTION     "rootflags=bulk_read,no_chk_data_crc"
230
231 #define CONFIG_ENV_OVERWRITE
232 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
233 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
234         CONFIG_UPDATEB \
235         "updatek=onenand erase 0xc00000 0x600000;" \
236         " onenand write 0x31008000 0xc00000 0x600000\0" \
237         "updateu=onenand erase 0x01560000 0x1eaa0000;" \
238         " onenand write 0x32000000 0x1260000 0x8C0000\0" \
239         "bootk=onenand read 0x30007FC0 0xc00000 0x600000;" \
240         " bootm 0x30007FC0\0" \
241         "flashboot=set bootargs root=/dev/mtdblock${bootblock}" \
242          " rootfstype=${rootfstype}" \
243          CONFIG_UBI_MTD " ${opts} ${lcdinfo} " CONFIG_COMMON_BOOT "; run bootk\0" \
244         "ubifsboot=set bootargs root=ubi0!rootfs rootfstype=ubifs " \
245          CONFIG_UBIFS_OPTION CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \
246          CONFIG_COMMON_BOOT "; run bootk\0" \
247         "tftpboot=set bootargs root=ubi0!rootfs rootfstype=ubifs " \
248          CONFIG_UBIFS_OPTION CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \
249          CONFIG_COMMON_BOOT "; tftp 0x30007FC0 uImage; bootm 0x30007FC0\0" \
250         "boottrace=setenv opts initcall_debug; run bootcmd\0" \
251         "android=set bootargs root=ubi0!ramdisk " CONFIG_UBI_MTD \
252          " rootfstype=ubifs init=/init.sh " CONFIG_COMMON_BOOT "; run bootk\0" \
253         "nfsboot=set bootargs root=/dev/nfs rw " CONFIG_UBI_MTD \
254          " nfsroot=${nfsroot},nolock,tcp ip=${ipaddr}:${serverip}:${gatewayip}:" \
255          "${netmask}:generic:usb0:off " CONFIG_COMMON_BOOT "; run bootk\0" \
256         "ramboot=set bootargs " CONFIG_RAMDISK_BOOT \
257          " initrd=0x33000000,8M ramdisk=8192\0" \
258         "mmcboot=set bootargs root=${mmcblk} rootfstype=${rootfstype}" \
259          CONFIG_UBI_MTD " ${opts} ${lcdinfo} " CONFIG_COMMON_BOOT "; run bootk\0" \
260         "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
261         "verify=n\0" \
262         "rootfstype=cramfs\0" \
263         "console=" CONFIG_DEFAULT_CONSOLE \
264         "mtdparts=" MTDPARTS_DEFAULT \
265         "meminfo=mem=80M mem=128M@0x40000000\0" \
266         "nfsroot=/nfsroot/arm\0" \
267         "mmcblk=/dev/mmcblk1p1\0" \
268         "bootblock=9\0" \
269         "ubiblock=8\0" \
270         "ubi=enabled\0" \
271         "opts=always_resume=1"
272
273 /*
274  * Miscellaneous configurable options
275  */
276 #define CONFIG_SYS_LONGHELP     /* undef to save memory */
277 #define CONFIG_SYS_PROMPT       "Universal # "  /* Monitor Command Prompt */
278 #define CONFIG_SYS_CBSIZE       256     /* Console I/O Buffer Size */
279 #define CONFIG_SYS_PBSIZE       384     /* Print Buffer Size */
280 #define CONFIG_SYS_MAXARGS      16      /* max number of command args */
281 #define CONFIG_SYS_BARGSIZE     CONFIG_SYS_CBSIZE       /* Boot Argument Buffer Size */
282
283 #define CONFIG_SYS_MEMTEST_START        CONFIG_SYS_SDRAM_BASE   /* memtest works on           */
284 #define CONFIG_SYS_MEMTEST_END          (CONFIG_SYS_SDRAM_BASE + 0x5000000)
285
286 #define CONFIG_SYS_LOAD_ADDR            (CONFIG_SYS_SDRAM_BASE + 0x4000000)
287 #define CONFIG_SYS_BOOT_ADDR            (CONFIG_SYS_SDRAM_BASE + 0x4800000)
288
289 #define CONFIG_SYS_HZ                   1000
290
291 /* valid baudrates */
292 #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }
293
294 /*-----------------------------------------------------------------------
295  * Stack sizes
296  *
297  * The stack sizes are set up in start.S using the settings below
298  */
299 #define CONFIG_STACKSIZE        (256 << 10)     /* regular stack 256KB */
300
301 /*******************************
302  Support Clock Settings(APLL)
303  *******************************
304  ARMCLK         HCLKD0          PCLKD0
305  -------------------------------
306  667            166                     83
307  600            150                     75
308  533            133                     66
309  500            166                     66
310  467            117                     59
311  400            100                     50
312  *******************************/
313
314 #define CONFIG_CLK_667_166_83
315 /*#define CONFIG_CLK_666_166_66*/
316 /*#define CONFIG_CLK_600_150_75*/
317 /*#define CONFIG_CLK_533_133_66*/
318 /*#define CONFIG_CLK_500_166_66*/
319 /*#define CONFIG_CLK_467_117_59*/
320 /*#define CONFIG_CLK_400_100_50*/
321
322 /* Universal has 2 banks of DRAM, but swap the bank */
323 #define CONFIG_NR_DRAM_BANKS    2
324 #define PHYS_SDRAM_1            CONFIG_SYS_SDRAM_BASE   /* OneDRAM Bank #0 */
325 #define PHYS_SDRAM_1_SIZE       (80 << 20)              /* 80 MB in Bank #0 */
326 #define S5PC100_PHYS_SDRAM_2    0x38000000              /* mDDR DMC0 Bank #1 */
327 #define S5PC110_PHYS_SDRAM_2    0x40000000              /* mDDR DMC1 Bank #0 */
328 #define PHYS_SDRAM_2_SIZE       (128 << 20)             /* 128 MB in Bank #1 */
329
330
331 #define CONFIG_SYS_MONITOR_BASE 0x00000000
332
333 /*-----------------------------------------------------------------------
334  * FLASH and environment organization
335  */
336
337 #define CONFIG_SYS_MONITOR_LEN          (256 << 10)     /* Reserve 2 sectors */
338
339 /* OneNAND IPL uses 8KiB */
340 #define CONFIG_ONENAND_START_PAGE       4
341
342 /* IPL + RECOVERY + U-BOOT */
343 #define CONFIG_RECOVERY_UBOOT_BLOCK     1
344 #define CONFIG_RECOVERY_BOOT_BLOCKS     4
345
346 #define CONFIG_ENV_IS_IN_ONENAND        1
347 #define CONFIG_ENV_SIZE                 (256 << 10)     /* 256 KiB, 0x40000 */
348 #define CONFIG_ENV_ADDR                 (1 << 20)       /* 1 MB, 0x100000 */
349
350 #define CONFIG_RECOVERY_SIZE            (768 << 10)     /* 768 KiB, 0xC0000 */
351 #define CONFIG_RECOVERY_ADDR            (256 << 10)     /* 256 KiB, 0x40000 */
352
353 #define CONFIG_USE_ONENAND_BOARD_INIT
354 #define CONFIG_SAMSUNG_ONENAND          1
355 #define CONFIG_SYS_ONENAND_BASE         0xB0000000
356
357 #define CONFIG_DOS_PARTITION    1
358
359 #define CONFIG_MISC_INIT_R
360
361 /* I2C */
362 #if 0
363 #define CONFIG_DRIVER_S5PC1XX_I2C
364 #define CONFIG_HARD_I2C         1
365 #define CONFIG_SYS_I2C_SPEED    50000
366 #define CONFIG_SYS_I2C_SLAVE    0xFE
367 #define CONFIG_SYS_I2C_0        1
368 #else
369 #include <i2c-gpio.h>
370 #define CONFIG_SOFT_I2C         1
371 #define CONFIG_SYS_I2C_INIT_BOARD
372 #define CONFIG_SYS_I2C_SPEED    50000
373 #define CONFIG_I2C_MULTI_BUS
374 #define CONFIG_SYS_MAX_I2C_BUS  7
375 #endif
376
377 /* USB Downloader */
378 #define CONFIG_CMD_USBDOWN
379 #define CONFIG_SAMSUNG_USB
380 #define CONFIG_OTG_CLK_OSCC
381 #define CONFIG_SYS_DOWN_ADDR    CONFIG_SYS_SDRAM_BASE
382 #define CONFIG_RAMDISK_ADDR     (CONFIG_SYS_SDRAM_BASE + 0x03000000)
383
384 /* LCD */
385 #if 1           /* For LCD test */
386 #define CONFIG_LCD              1
387 #define CONFIG_FB_RESERVED_MEM  0x42504000
388 #define CONFIG_S5PC1XXFB        1
389 #define CONFIG_S6E63M0          1
390 #define CONFIG_S6D16A0X         1
391 #define CONFIG_CMD_BMP
392 #endif
393
394 #if 0
395 #define CONFIG_CMD_EXT2                 1
396 #define CONFIG_CMD_ONENAND_EXT2         1
397 #endif
398
399 /* Insert bmp animation compressed */
400 #define CONFIG_VIDEO_BMP_GZIP
401 #ifndef CONFIG_SYS_VIDEO_LOGO_MAX_SIZE
402 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE  (250*250*4)
403 #endif
404
405 #endif  /* __CONFIG_H */