blob: 4149a2947144b47101c56070b36b54086df9eec2 [file] [log] [blame]
Mike Frysinger62d2a232008-06-01 09:09:48 -04001/*
2 * U-Boot - Common settings for Analog Devices boards
3 */
4
5#ifndef __CONFIG_BFIN_ADI_COMMON_H__
6#define __CONFIG_BFIN_ADI_COMMON_H__
7
8/*
9 * Command Settings
10 */
11#ifndef _CONFIG_CMD_DEFAULT_H
12# include <config_cmd_default.h>
13# if ADI_CMDS_NETWORK
14# define CONFIG_CMD_DHCP
15# define CONFIG_CMD_PING
16# ifdef CONFIG_BFIN_MAC
17# define CONFIG_CMD_MII
18# endif
19# else
20# undef CONFIG_CMD_BOOTD
21# undef CONFIG_CMD_NET
22# undef CONFIG_CMD_NFS
23# endif
24# ifdef CONFIG_LIBATA
25# define CONFIG_CMD_FAT
26# define CONFIG_CMD_SATA
27# define CONFIG_DOS_PARTITION
28# endif
29# ifdef CONFIG_MMC
30# define CONFIG_CMD_FAT
31# define CONFIG_CMD_MMC
32# define CONFIG_DOS_PARTITION
33# endif
34# ifdef CONFIG_USB
35# define CONFIG_CMD_EXT2
36# define CONFIG_CMD_FAT
37# define CONFIG_CMD_USB
38# define CONFIG_CMD_USB_STORAGE
39# define CONFIG_DOS_PARTITION
40# endif
41# ifdef CONFIG_POST
42# define CONFIG_CMD_DIAG
43# endif
44# ifdef CONFIG_RTC_BFIN
45# define CONFIG_CMD_DATE
46# endif
47# ifdef CONFIG_SPI
48# define CONFIG_CMD_EEPROM
49# endif
50# if defined(CONFIG_BFIN_SPI) || defined(CONFIG_SOFT_SPI)
51# define CONFIG_CMD_SPI
52# endif
53# ifdef CONFIG_SPI_FLASH
54# define CONFIG_CMD_SF
55# endif
56# if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
57# define CONFIG_CMD_I2C
58# endif
59# ifdef CONFIG_SYS_NO_FLASH
60# undef CONFIG_CMD_FLASH
61# undef CONFIG_CMD_IMLS
62# else
63# define CONFIG_CMD_JFFS2
64# endif
65# define CONFIG_CMD_BOOTLDR
66# define CONFIG_CMD_CACHE
67# define CONFIG_CMD_CPLBINFO
68# define CONFIG_CMD_ELF
69# define CONFIG_ELF_SIMPLE_LOAD
70# define CONFIG_CMD_REGINFO
71# define CONFIG_CMD_STRINGS
72# if defined(__ADSPBF51x__) || defined(__ADSPBF52x__) || defined(__ADSPBF54x__)
73# define CONFIG_CMD_OTP
Mike Frysinger7c8e97f2008-11-27 16:50:32 -050074# define CONFIG_CMD_SPIBOOTLDR
Mike Frysinger62d2a232008-06-01 09:09:48 -040075# endif
76#endif
77
78/*
79 * Console Settings
80 */
81#define CONFIG_SYS_LONGHELP 1
82#define CONFIG_CMDLINE_EDITING 1
83#define CONFIG_AUTO_COMPLETE 1
84#define CONFIG_LOADS_ECHO 1
85#define CONFIG_JTAG_CONSOLE
86#ifndef CONFIG_BAUDRATE
87# define CONFIG_BAUDRATE 57600
88#endif
89
90/*
91 * Debug Settings
92 */
93#define CONFIG_ENV_OVERWRITE 1
94#define CONFIG_DEBUG_DUMP 1
Mike Frysingera46fbba2009-05-20 04:35:14 -040095#define CONFIG_KALLSYMS 1
Mike Frysinger62d2a232008-06-01 09:09:48 -040096#define CONFIG_PANIC_HANG 1
97
98/*
99 * Env Settings
100 */
101#if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART)
102# define CONFIG_BOOTDELAY -1
103#else
104# define CONFIG_BOOTDELAY 5
105#endif
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400106#ifndef CONFIG_BOOTCOMMAND
107# define CONFIG_BOOTCOMMAND "run ramboot"
108#endif
Mike Frysinger62d2a232008-06-01 09:09:48 -0400109#ifdef CONFIG_VIDEO
110# define CONFIG_BOOTARGS_VIDEO "console=tty0 "
111#else
112# define CONFIG_BOOTARGS_VIDEO ""
113#endif
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400114#ifndef CONFIG_BOOTARGS_ROOT
115# define CONFIG_BOOTARGS_ROOT "/dev/mtdblock0 rw"
116#endif
Mike Frysinger62d2a232008-06-01 09:09:48 -0400117#define CONFIG_BOOTARGS \
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400118 "root=" CONFIG_BOOTARGS_ROOT " " \
Mike Frysingera66097a2008-12-09 13:47:39 -0500119 "clkin_hz=" MK_STR(CONFIG_CLKIN_HZ) " " \
Mike Frysinger62d2a232008-06-01 09:09:48 -0400120 "earlyprintk=" \
121 "serial," \
122 "uart" MK_STR(CONFIG_UART_CONSOLE) "," \
123 MK_STR(CONFIG_BAUDRATE) " " \
124 CONFIG_BOOTARGS_VIDEO \
125 "console=ttyBF0," MK_STR(CONFIG_BAUDRATE)
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400126#if defined(CONFIG_CMD_NAND)
127# define NAND_ENV_SETTINGS \
128 "nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
129 "nandboot=" \
130 "nand read $(loadaddr) 0x20000 0x100000;" \
131 "run nandargs;" \
132 "bootm" \
133 "\0"
134#else
135# define NAND_ENV_SETTINGS
136#endif
Mike Frysinger62d2a232008-06-01 09:09:48 -0400137#if defined(CONFIG_CMD_NET)
138# if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
139# define UBOOT_ENV_FILE "u-boot.bin"
140# else
141# define UBOOT_ENV_FILE "u-boot.ldr"
142# endif
143# if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
144# ifdef CONFIG_SPI
145# define UBOOT_ENV_UPDATE \
146 "eeprom write $(loadaddr) 0x0 $(filesize)"
147# else
148# define UBOOT_ENV_UPDATE \
149 "sf probe " MK_STR(BFIN_BOOT_SPI_SSEL) ";" \
150 "sf erase 0 0x40000;" \
151 "sf write $(loadaddr) 0 $(filesize)"
152# endif
153# elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
154# define UBOOT_ENV_UPDATE \
155 "nand unlock 0 0x40000;" \
156 "nand erase 0 0x40000;" \
157 "nand write $(loadaddr) 0 0x40000"
158# else
159# define UBOOT_ENV_UPDATE \
160 "protect off 0x20000000 0x2003FFFF;" \
161 "erase 0x20000000 0x2003FFFF;" \
162 "cp.b $(loadaddr) 0x20000000 $(filesize)"
163# endif
164# define NETWORK_ENV_SETTINGS \
165 "ubootfile=" UBOOT_ENV_FILE "\0" \
166 "update=" \
167 "tftp $(loadaddr) $(ubootfile);" \
168 UBOOT_ENV_UPDATE \
169 "\0" \
170 "addip=set bootargs $(bootargs) " \
171 "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):" \
172 "$(hostname):eth0:off" \
173 "\0" \
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400174 \
175 "ramfile=uImage\0" \
Mike Frysinger62d2a232008-06-01 09:09:48 -0400176 "ramargs=set bootargs " CONFIG_BOOTARGS "\0" \
177 "ramboot=" \
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400178 "tftp $(loadaddr) $(ramfile);" \
Mike Frysinger62d2a232008-06-01 09:09:48 -0400179 "run ramargs;" \
180 "run addip;" \
181 "bootm" \
182 "\0" \
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400183 \
184 "nfsfile=vmImage\0" \
Mike Frysinger62d2a232008-06-01 09:09:48 -0400185 "nfsargs=set bootargs " \
186 "root=/dev/nfs rw " \
187 "nfsroot=$(serverip):$(rootpath),tcp,nfsvers=3" \
188 "\0" \
189 "nfsboot=" \
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400190 "tftp $(loadaddr) $(nfsfile);" \
Mike Frysinger62d2a232008-06-01 09:09:48 -0400191 "run nfsargs;" \
192 "run addip;" \
193 "bootm" \
194 "\0"
195#else
196# define NETWORK_ENV_SETTINGS
197#endif
198#define CONFIG_EXTRA_ENV_SETTINGS \
Mike Frysingera76bd0d2009-04-13 05:52:45 -0400199 NAND_ENV_SETTINGS \
Mike Frysinger62d2a232008-06-01 09:09:48 -0400200 NETWORK_ENV_SETTINGS \
201 "flashboot=bootm 0x20100000\0"
202
203/*
204 * Network Settings
205 */
206#ifdef CONFIG_CMD_NET
207# define CONFIG_IPADDR 192.168.0.15
208# define CONFIG_NETMASK 255.255.255.0
209# define CONFIG_GATEWAYIP 192.168.0.1
210# define CONFIG_SERVERIP 192.168.0.2
211# define CONFIG_ROOTPATH /romfs
212# ifdef CONFIG_CMD_DHCP
213# ifndef CONFIG_SYS_AUTOLOAD
214# define CONFIG_SYS_AUTOLOAD "no"
215# endif
216# endif
217# define CONFIG_NET_RETRY_COUNT 20
218#endif
219
Mike Frysinger07145b42009-04-24 17:11:47 -0400220/*
221 * Misc Settings
222 */
223#define CONFIG_LZMA
224
Mike Frysinger62d2a232008-06-01 09:09:48 -0400225#endif