MINI2440: Auto probe for SDRAM size
[u-boot-openmoko/mini2440.git] / include / configs / mini2440.h
blob6f7f5df2395d6ff801b05ab833c040af11be981e
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
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 #define CONFIG_LL_INIT_NAND_ONLY
38 #define CONFIG_S3C2410_NAND_BOOT 1
39 #define CONFIG_S3C2410_NAND_SKIP_BAD 1
41 #define CFG_UBOOT_SIZE 0x40000 /* size of u-boot, for NAND loading */
44 * High Level Configuration Options
45 * (easy to change)
47 #define CONFIG_ARM920T 1 /* This is an ARM920T Core */
48 #define CONFIG_S3C2440 1 /* in a SAMSUNG S3C2440 SoC */
49 #define CONFIG_MINI2440 1 /* on a MIN2440 Board */
51 #define CONFIG_MINI2440_OVERCLOCK 1 /* use frequencies over 405Mhz */
53 /* input clock of PLL */
54 #define CONFIG_SYS_CLK_FREQ 12000000 /* MINI2440 has 12.0000MHz input clock */
57 #define USE_920T_MMU 1
58 #define CONFIG_USE_IRQ 1 /* Needed for USB device! */
61 * Size of malloc() pool
63 #define CFG_MALLOC_LEN (CFG_ENV_SIZE + 2048*1024)
64 #define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */
67 * Hardware drivers
69 #define CONFIG_DRIVER_DM9000 1
70 #define CONFIG_DRIVER_DM9000_NO_EEPROM 1
71 #define CONFIG_DM9000_BASE 0x20000300
72 #define DM9000_IO CONFIG_DM9000_BASE
73 #define DM9000_DATA (CONFIG_DM9000_BASE+4)
75 #define CONFIG_DRIVER_S3C24X0_I2C 1
76 #if (CONFIG_DRIVER_S3C24X0_I2C)
77 #define CONFIG_HARD_I2C 1
78 #define CFG_I2C_SPEED 100000 /* 100kHz */
79 #define CFG_I2C_SLAVE 0x7f
80 #endif
83 * select serial console configuration
85 #define CONFIG_SERIAL1 1 /* we use SERIAL 1 on MINI2440 */
86 //#define CONFIG_HWFLOW 1
88 /************************************************************
89 * RTC
90 ************************************************************/
91 #define CONFIG_RTC_S3C24X0 1
93 /* allow to overwrite serial and ethaddr */
94 #define CONFIG_ENV_OVERWRITE
96 #define CONFIG_BAUDRATE 115200
98 /***********************************************************
99 * Command definition
100 ***********************************************************/
101 #include <config_cmd_default.h>
103 #undef CONFIG_CMD_FPGA /* FPGA configuration Support */
105 #undef CONFIG_CMD_CACHE
106 #undef CONFIG_CMD_DIAG
107 #undef CONFIG_CMD_ELF
109 #define CONFIG_CMD_DATE
110 #define CONFIG_CMD_DHCP
111 #define CONFIG_CMD_EXT2
112 #define CONFIG_CMD_FAT
113 #define CONFIG_CMD_JFFS2
114 #define CONFIG_CMD_MMC
115 #define CONFIG_CMD_NAND
116 #define CONFIG_CMD_PING
117 #define CONFIG_CMD_PORTIO
118 #define CONFIG_CMD_REGINFO
119 #define CONFIG_CMD_SAVES
121 #if defined(CONFIG_DRIVER_S3C24X0_I2C)
122 #define CONFIG_CMD_I2C /* I2C serial bus support */
123 #endif
125 #define CONFIG_BOOTDELAY 3
126 #define CONFIG_BOOTARGS "root=/dev/mtdblock3 rootfstype=jffs2 console=ttySAC0,115200"
127 #define CONFIG_ETHADDR 08:08:11:18:12:27
128 #define CONFIG_NETMASK 255.255.255.0
129 #define CONFIG_IPADDR 10.0.0.111
130 #define CONFIG_SERVERIP 10.0.0.4
132 #define CONFIG_BOOTCOMMAND ""
134 #define CONFIG_DOS_PARTITION 1
136 #if defined(CONFIG_CMD_KGDB)
137 #define CONFIG_KGDB_BAUDRATE 115200 /* speed to run kgdb serial port */
138 /* what's this ? it's not used anywhere */
139 #define CONFIG_KGDB_SER_INDEX 1 /* which serial port to use */
140 #endif
143 * Miscellaneous configurable options
145 #define CFG_LONGHELP /* undef to save memory */
146 #define CFG_PROMPT "MINI2440 # " /* Monitor Command Prompt */
147 #define CFG_CBSIZE 256 /* Console I/O Buffer Size */
148 #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
149 #define CFG_MAXARGS 32 /* max number of command args */
150 #define CFG_BARGSIZE CFG_CBSIZE /* Boot Argument Buffer Size */
152 #define CFG_MEMTEST_START 0x30000000 /* memtest works on */
153 #define CFG_MEMTEST_END 0x33F00000 /* 63 MB in DRAM */
155 #undef CFG_CLKS_IN_HZ /* everything, incl board info, in Hz */
157 #define CFG_LOAD_ADDR 0x32000000 /* default load address */
159 /* the PWM TImer 4 uses a counter of 15625 for 10 ms, so we need */
160 /* it to wrap 100 times (total 1562500) to get 1 sec. */
161 #define CFG_HZ 1562500
163 /* valid baudrates */
164 #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
166 /*-----------------------------------------------------------------------
167 * Stack sizes
169 * The stack sizes are set up in start.S using the settings below
171 #define CONFIG_STACKSIZE (128*1024) /* regular stack */
172 #ifdef CONFIG_USE_IRQ
173 #define CONFIG_STACKSIZE_IRQ (8*1024) /* IRQ stack */
174 #define CONFIG_STACKSIZE_FIQ (4*1024) /* FIQ stack */
175 #endif
177 #if 1
178 #define CONFIG_USB_OHCI_NEW 1
179 #define CONFIG_CMD_USB 1
181 #define CFG_USB_OHCI_CPU_INIT 1
182 #define CFG_USB_OHCI_REGS_BASE 0x49000000 /* S3C24X0_USB_HOST_BASE */
183 #define CFG_USB_OHCI_SLOT_NAME "s3c2440"
184 #define CFG_USB_OHCI_MAX_ROOT_PORTS 2
185 #endif
187 #if 1
188 #define CONFIG_USB_DEVICE 1
189 #define CONFIG_USB_TTY 1
190 #define CONFIG_USB_STORAGE 1
191 #define CFG_CONSOLE_IS_IN_ENV 1
192 #define CONFIG_USBD_VENDORID 0x1457 /* FIC */
193 #define CONFIG_USBD_PRODUCTID_GSERIAL 0x5120 /* gserial */
194 #define CONFIG_USBD_PRODUCTID_CDCACM 0x511b /* SMDK2440 CDC ACM */
195 #define CONFIG_USBD_MANUFACTURER "MINI2440"
196 #define CONFIG_USBD_PRODUCT_NAME "S3C2440 Bootloader " U_BOOT_VERSION
197 #define CONFIG_USBD_DFU 1
198 #define CONFIG_USBD_DFU_XFER_SIZE 4096
199 #define CONFIG_USBD_DFU_INTERFACE 2
200 //#define CONFIG_USB_DFU_REVISION 0x0100
201 #endif
203 /*-----------------------------------------------------------------------
204 * Physical Memory Map
206 #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
207 #define PHYS_SDRAM_1 0x30000000 /* SDRAM Bank #1 */
209 * startup code now probes, this is no longer needed
211 //#define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */
213 #define PHYS_FLASH_1 0x00000000 /* Flash Bank #1 */
215 #define CFG_FLASH_BASE PHYS_FLASH_1
217 /*-----------------------------------------------------------------------
218 * FLASH and environment organization
221 #define CONFIG_SST_VF1601 1 /* uncomment this if you have a Am29LV160DB flash */
223 #define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
225 #ifdef CONFIG_SST_VF1601
226 #define PHYS_FLASH_SIZE 0x00200000 /* 2MB */
227 #define CFG_MAX_FLASH_SECT (32) /* max number of sectors on one chip */
228 #endif
230 /* timeout values are in ticks */
231 #define CFG_FLASH_ERASE_TOUT (5*CFG_HZ) /* Timeout for Flash Erase */
232 #define CFG_FLASH_WRITE_TOUT (5*CFG_HZ) /* Timeout for Flash Write */
235 * u-boot environmnet
237 #if 1
238 #define CFG_ENV_IS_IN_NAND 1
239 #define CFG_ENV_OFFSET_OOB 1 // dont define for CFG_ENV_IS_IN_FLASH
240 /* This size must be the size of a common denominator for the NAND erase block */
241 #define CFG_ENV_SIZE 0x20000 /* 128k Total Size of Environment Sector */
242 #else
243 #define CFG_ENV_IS_IN_FLASH 1
244 #define CFG_MY_ENV_OFFSET 0X40000
245 #define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_MY_ENV_OFFSET) /* addr of environment */
246 #define CFG_ENV_SIZE 0x10000 /* 64k Total Size of Environment Sector */
247 #endif
248 #define CFG_PREBOOT_OVERRIDE 1
250 #define NAND_MAX_CHIPS 1
251 #define CFG_NAND_BASE 0x4E000000 /* S3C2440_NAND_BASE */
252 #define CFG_MAX_NAND_DEVICE 1
254 #define CONFIG_MMC 1
255 #define CONFIG_MMC_S3C 1 /* Enabling the MMC driver */
256 #define CFG_MMC_BASE 0xff000000
258 #define CONFIG_EXT2 1
260 #define CONFIG_FAT 1
261 #define CONFIG_SUPPORT_VFAT 1
263 #if 1
264 /* JFFS2 driver */
265 #define CONFIG_JFFS2_CMDLINE 1
266 #define CONFIG_JFFS2_NAND 1
267 #define CONFIG_JFFS2_NAND_DEV 0
268 //#define CONFIG_JFFS2_NAND_OFF 0x634000
269 //#define CONFIG_JFFS2_NAND_SIZE 0x39cc000
270 #endif
272 /* ATAG configuration */
273 #define CONFIG_INITRD_TAG 1
274 #define CONFIG_SETUP_MEMORY_TAGS 1
275 #define CONFIG_CMDLINE_TAG 1
276 #if 0
277 #define CONFIG_REVISION_TAG 1
278 #define CONFIG_SERIAL_TAG 1
279 #endif
280 #define CONFIG_CMDLINE_EDITING 1
281 #define CONFIG_AUTO_COMPLETE 1
284 #if 0
285 #define CONFIG_CMD_BMP
286 #define CONFIG_VIDEO
287 #define CONFIG_VIDEO_S3C2410
288 #define CONFIG_VIDEO_LOGO
289 #define CONFIG_CFB_CONSOLE
290 //#define CFG_CONSOLE_IS_IN_ENV
291 //#define CONFIG_CONSOLE_EXTRA_INFO
292 #define CONFIG_VGA_AS_SINGLE_DEVICE
294 #define VIDEO_FB_16BPP_PIXEL_SWAP
295 #define CONFIG_VIDEO_BMP_LOGO
296 #define CONFIG_SPLASH_SCREEN
297 #define CFG_VIDEO_LOGO_MAX_SIZE (240*320+1024+100) /* 100 = slack */
298 #define CONFIG_VIDEO_BMP_GZIP
299 #define CONFIG_CMD_UNZIP
301 #define VIDEO_KBD_INIT_FCT 0
302 #define VIDEO_TSTC_FCT serial_tstc
303 #define VIDEO_GETC_FCT serial_getc
305 #define LCD_VIDEO_ADDR 0x33d00000
306 #endif
308 #define CONFIG_S3C2410_NAND_BBT 1
309 //#define CONFIG_S3C2440_NAND_HWECC 1 /* this works for generation, not verification */
311 #define CFG_NAND_YAFFS_WRITE
312 #define CFG_NAND_YAFFS1_NEW_OOB_LAYOUT
314 #define MTDIDS_DEFAULT "nand0=mini2440-nand"
315 #define MTPDARTS_DEFAULT "mtdparts=mtdparts=mini2440-nand:256k@0(u-boot),128k(env),5m(kernel),-(root)"
316 #define CFG_NAND_DYNPART_MTD_KERNEL_NAME "mini2440-nand"
317 #define CONFIG_NAND_DYNPART 1
319 #define CONFIG_EXTRA_ENV_SETTINGS \
320 "usbtty=cdc_acm\0" \
321 "mtdparts=mtdparts=mini2440-nand:256k@0(u-boot),128k(env),5m(kernel),-(root)\0" \
322 "mini2440=mini2440=0tb\0" \
323 "bootargs_base=console=ttySAC0,115200 noinitrd\0" \
324 "bootargs_init=init=/sbin/init\0" \
325 "root_nand=root=/dev/mtdblock3 rootfstype=jffs2\0" \
326 "root_mmc=root=/dev/mmcblk0p2 rootdelay=2\0" \
327 "root_nfs=/mnt/nfs\0" \
328 "set_root_nfs=setenv root_nfs root=/dev/nfs rw nfsroot=${serverip}:${root_nfs}\0" \
329 "ifconfig_static=run setenv ifconfig ip=${ipaddr}:${serverip}::${netmask}:mini2440:eth0\0" \
330 "ifconfig_dhcp=run setenv ifconfig ip=dhcp\0" \
331 "ifconfig=ip=dhcp\0" \
332 "set_bootargs_mmc=setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_mmc}\0" \
333 "set_bootargs_nand=setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_nand}\0" \
334 "set_bootargs_nfs=run set_root_nfs\; setenv bootargs ${bootargs_base} ${bootargs_init} ${mini2440} ${root_nfs} ${ifconfig}\0" \
337 #endif /* __CONFIG_H */