Fixed tools/env utilities
[u-boot-openmoko/mini2440.git] / include / configs / mini2440.h
blobd2f2efdb7b9a5f6d98cbdaf095f6a7f845faf90f
1 /*
2 * (C) Copyright 2002
3 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
4 * Marius Groeger <mgroeger@sysgo.de>
5 * Gary Jennejohn <gj@denx.de>
6 * David Mueller <d.mueller@elsoft.ch>
8 * (C) Copyright 2009-2010
9 * Michel Pollet <buserror@gmail.com>
11 * Configuation settings for the MINI2440 board.
13 * See file CREDITS for list of people who contributed to this
14 * project.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
32 #ifndef __CONFIG_H
33 #define __CONFIG_H
35 /* If we want to start u-boot directly from within NAND flash
36 * Also use this if loading the bootloader directly via JTAG
37 * Mote that this is incompatible with NOR booting.
39 //#define CONFIG_LL_INIT_NAND_ONLY 1
41 #define CONFIG_S3C2410_NAND_BOOT 1
42 #define CONFIG_S3C2410_NAND_SKIP_BAD 1
44 #define CFG_UBOOT_SIZE 0x40000 /* size of u-boot, for NAND loading */
47 * High Level Configuration Options
48 * (easy to change)
50 #define CONFIG_ARM920T 1 /* This is an ARM920T Core */
51 #define CONFIG_S3C2440 1 /* in a SAMSUNG S3C2440 SoC */
52 #define CONFIG_MINI2440 1 /* on a MIN2440 Board */
55 * It is possible to have u-boot save it's environment in NOR, however,
56 * reember it is incompatible with booting from NAND as the NOR is not
57 * available at that point. So use this only if you use nand as storage
58 * and will never boot from it
60 /* #define CONFIG_MINI2440_NOR_ENV 1 */
62 #define CONFIG_MINI2440_OVERCLOCK 1 /* allow use of frequencies over 405Mhz */
64 /* input clock of PLL */
65 #define CONFIG_SYS_CLK_FREQ 12000000 /* MINI2440 has 12.0000MHz input clock */
68 #define USE_920T_MMU 1
69 //#define CONFIG_USE_IRQ 1 /* Needed for USB device! */
72 * Size of malloc() pool
74 #define CFG_MALLOC_LEN (CFG_ENV_SIZE + 2048*1024)
75 #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
78 * Hardware drivers
80 #define CONFIG_DRIVER_DM9000 1
81 #define CONFIG_DRIVER_DM9000_NO_EEPROM 1
82 #define CONFIG_DM9000_BASE 0x20000300
83 #define DM9000_IO CONFIG_DM9000_BASE
84 #define DM9000_DATA (CONFIG_DM9000_BASE+4)
86 #define CONFIG_DRIVER_S3C24X0_I2C 1
87 #if (CONFIG_DRIVER_S3C24X0_I2C)
88 #define CONFIG_HARD_I2C 1
89 #define CFG_I2C_SPEED 100000 /* 100kHz */
90 #define CFG_I2C_SLAVE 0x7f
92 #define CONFIG_MEGADISPLAY 1
93 #endif
96 * select serial console configuration
98 #define CONFIG_SERIAL1 1 /* we use SERIAL 1 on MINI2440 */
99 //#define CONFIG_HWFLOW 1
101 /************************************************************
102 * RTC
103 ************************************************************/
104 #define CONFIG_RTC_S3C24X0 1
106 /* allow to overwrite serial and ethaddr */
107 #define CONFIG_ENV_OVERWRITE
109 #define CONFIG_BAUDRATE 115200
111 /***********************************************************
112 * Command definition
113 ***********************************************************/
114 #include <config_cmd_default.h>
116 #undef CONFIG_CMD_FPGA /* FPGA configuration Support */
118 #undef CONFIG_CMD_CACHE
119 #undef CONFIG_CMD_DIAG
120 #undef CONFIG_CMD_ELF
122 #define CONFIG_CMD_DATE
123 #define CONFIG_CMD_DHCP
124 #define CONFIG_CMD_EXT2
125 #define CONFIG_CMD_FAT
126 #define CONFIG_CMD_JFFS2
127 #define CONFIG_CMD_MMC
128 #define CONFIG_CMD_NAND
129 #define CONFIG_CMD_PING
130 #define CONFIG_CMD_PORTIO
131 #define CONFIG_CMD_REGINFO
132 #define CONFIG_CMD_SAVES
134 #if defined(CONFIG_DRIVER_S3C24X0_I2C)
135 #define CONFIG_CMD_I2C /* I2C serial bus support */
136 #endif
138 #define CONFIG_BOOTDELAY 3
139 #define CONFIG_BOOTARGS "root=/dev/mtdblock3 rootfstype=jffs2 console=ttySAC0,115200"
140 #define CONFIG_ETHADDR 08:08:11:18:12:27
141 #define CONFIG_NETMASK 255.255.255.0
142 #define CONFIG_IPADDR 10.0.0.111
143 #define CONFIG_SERVERIP 10.0.0.4
145 #define CONFIG_BOOTCOMMAND ""
147 #define CONFIG_DOS_PARTITION 1
149 #if defined(CONFIG_CMD_KGDB)
150 #define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
151 /* what's this ? it's not used anywhere */
152 #define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
153 #endif
156 * Miscellaneous configurable options
158 #define CFG_LONGHELP /* undef to save memory */
159 #define CFG_PROMPT "MINI2440 # " /* Monitor Command Prompt */
160 #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
161 #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
162 #define CFG_MAXARGS 32 /* max number of command args */
163 #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
165 #define CFG_MEMTEST_START 0x30000000 /* memtest works on */
166 #define CFG_MEMTEST_END 0x33F00000 /* 63 MB in DRAM */
168 #undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
170 #define CFG_LOAD_ADDR 0x32000000 /* default load address */
172 /* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
173 /* it to wrap 100 times (total 1562500) to get 1 sec. */
174 #define CFG_HZ 1562500
176 /* valid baudrates */
177 #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
179 /*-----------------------------------------------------------------------
180 * Stack sizes
182 * The stack sizes are set up in start.S using the settings below
184 #define CONFIG_STACKSIZE (128*1024) /* regular stack */
185 #ifdef CONFIG_USE_IRQ
186 #define CONFIG_STACKSIZE_IRQ (8*1024) /* IRQ stack */
187 #define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
188 #endif
190 #if 1
191 #define CONFIG_USB_OHCI_NEW 1
192 #define CONFIG_CMD_USB 1
194 #define CFG_USB_OHCI_CPU_INIT 1
195 #define CFG_USB_OHCI_REGS_BASE 0x49000000 /* S3C24X0_USB_HOST_BASE */
196 #define CFG_USB_OHCI_SLOT_NAME "s3c2440"
197 #define CFG_USB_OHCI_MAX_ROOT_PORTS 2
198 #endif
200 #if 1
201 #define CONFIG_USB_DEVICE 1
202 #define CONFIG_USB_TTY 1
203 #define CONFIG_USB_STORAGE 1
204 #define CFG_CONSOLE_IS_IN_ENV 1
205 #define CONFIG_USBD_VENDORID 0x1457 /* FIC */
206 #define CONFIG_USBD_PRODUCTID_GSERIAL 0x5120 /* gserial */
207 #define CONFIG_USBD_PRODUCTID_CDCACM 0x511b /* SMDK2440 CDC ACM */
208 #define CONFIG_USBD_MANUFACTURER "MINI2440"
209 #define CONFIG_USBD_PRODUCT_NAME "S3C2440 Bootloader " U_BOOT_VERSION
210 #define CONFIG_USBD_DFU 1
211 #define CONFIG_USBD_DFU_XFER_SIZE 4096
212 #define CONFIG_USBD_DFU_INTERFACE 2
213 //#define CONFIG_USB_DFU_REVISION 0x0100
214 #endif
216 /*-----------------------------------------------------------------------
217 * Physical Memory Map
219 #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
220 #define PHYS_SDRAM_1 0x30000000 /* SDRAM Bank #1 */
222 * startup code now probes, this is no longer needed
224 //#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
226 #define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
229 * When booting from NAND, it is impossible to access the lowest addresses
230 * due to the SteppingStone being in the way. Luckily the NOR doesn't really
231 * care about the highest 16 bits of address, so we set the controlers
232 * registers to go and poke over there, instead.
234 #define CFG_FLASH_BASE (0x0000 + PHYS_FLASH_1)
237 * NOR FLASH organization
238 * Now uses the standard CFI interface
240 #define CFG_FLASH_CFI 1
241 #define CFG_FLASH_CFI_DRIVER 1
242 #define CFG_FLASH_CFI_WIDTH FLASH_CFI_16BIT
243 #define CFG_MONITOR_BASE 0x0
244 #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
245 #define CFG_MAX_FLASH_SECT 512 /* 512 * 4096 sectors, or 32 * 64k blocks */
246 #define CONFIG_FLASH_SHOW_PROGRESS 1
249 * u-boot environmnet
251 #ifndef CONFIG_MINI2440_NOR_ENV
252 #define CFG_ENV_IS_IN_NAND 1
253 #define CFG_ENV_OFFSET_OOB 1 // dont define for CFG_ENV_IS_IN_FLASH
254 /* This size must be the size of a common denominator for the NAND erase block */
255 #define CFG_ENV_SIZE 0x20000 /* 128k Total Size of Environment Sector */
256 #else
257 #define CFG_ENV_IS_IN_FLASH 1
258 #define CFG_MY_ENV_OFFSET 0X40000
259 #define CFG_ENV_ADDR (PHYS_FLASH_1 + CFG_MY_ENV_OFFSET) /* addr of environment */
260 #define CFG_ENV_SIZE 0x4000 /* 16k Total Size of Environment Sector */
261 #endif
262 #define CFG_PREBOOT_OVERRIDE 1
264 #define NAND_MAX_CHIPS 1
265 #define CFG_NAND_BASE 0x4E000000 /* S3C2440_NAND_BASE */
266 #define CFG_MAX_NAND_DEVICE 1
268 #define CONFIG_MMC 1
269 #define CONFIG_MMC_S3C 1 /* Enabling the MMC driver */
270 #define CFG_MMC_BASE 0xff000000
272 #define CONFIG_EXT2 1
274 #define CONFIG_FAT 1
275 #define CONFIG_SUPPORT_VFAT 1
277 /* JFFS2 driver */
278 #define CONFIG_JFFS2_CMDLINE 1
279 #define CONFIG_JFFS2_NAND 1
280 #define CONFIG_JFFS2_NAND_DEV 0
282 /* ATAG configuration */
283 #define CONFIG_INITRD_TAG 1
284 #define CONFIG_SETUP_MEMORY_TAGS 1
285 #define CONFIG_CMDLINE_TAG 1
286 #if 0
287 #define CONFIG_REVISION_TAG 1
288 #define CONFIG_SERIAL_TAG 1
289 #endif
290 #define CONFIG_CMDLINE_EDITING 1
291 #define CONFIG_AUTO_COMPLETE 1
293 #define CONFIG_S3C2410_NAND_BBT 1
294 //#define CONFIG_S3C2440_NAND_HWECC 1 /* this works for generation, not verification */
296 #define CFG_NAND_YAFFS_WRITE
297 #define CFG_NAND_YAFFS1_NEW_OOB_LAYOUT
299 #define MTDIDS_DEFAULT "nand0=mini2440-nand"
300 #define MTPDARTS_DEFAULT "mtdparts=mtdparts=mini2440-nand:256k@0(u-boot),128k(env),5m(kernel),-(root)"
301 #define CFG_NAND_DYNPART_MTD_KERNEL_NAME "mini2440-nand"
302 #define CONFIG_NAND_DYNPART 1
304 #define CONFIG_EXTRA_ENV_SETTINGS \
305 "usbtty=cdc_acm\0" \
306 "mtdparts=mtdparts=mini2440-nand:256k@0(u-boot),128k(env),5m(kernel),-(root)\0" \
307 "mini2440=mini2440=0tb\0" \
308 "bootargs_base=console=ttySAC0,115200 noinitrd\0" \
309 "bootargs_init=init=/sbin/init\0" \
310 "root_nand=root=/dev/mtdblock3 rootfstype=jffs2\0" \
311 "root_mmc=root=/dev/mmcblk0p2 rootdelay=2\0" \
312 "root_nfs=/mnt/nfs\0" \
313 "set_root_nfs=setenv root_nfs root=/dev/nfs rw nfsroot=${serverip}:${root_nfs}\0" \
314 "ifconfig_static=run setenv ifconfig ip=${ipaddr}:${serverip}::${netmask}:mini2440:eth0\0" \
315 "ifconfig_dhcp=run setenv ifconfig ip=dhcp\0" \
316 "ifconfig=ip=dhcp\0" \
317 "set_bootargs_mmc=setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_mmc}\0" \
318 "set_bootargs_nand=setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_nand}\0" \
319 "set_bootargs_nfs=run set_root_nfs\; setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_nfs} ${ifconfig}\0" \
322 #endif /* __CONFIG_H */