Merge branch 'master' of git://git.denx.de/u-boot-samsung
[platform/kernel/u-boot.git] / include / configs / bfin_adi_common.h
1 /*
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 # ifdef ADI_CMDS_NETWORK
13 #  define CONFIG_BOOTP_SUBNETMASK
14 #  define CONFIG_BOOTP_GATEWAY
15 #  define CONFIG_BOOTP_DNS
16 #  define CONFIG_BOOTP_NTPSERVER
17 #  define CONFIG_BOOTP_RANDOM_DELAY
18 #  define CONFIG_KEEP_SERVERADDR
19 #  ifdef CONFIG_BFIN_MAC
20 #  endif
21 # endif
22 # ifdef CONFIG_LIBATA
23 #  define CONFIG_CMD_SATA
24 #  define CONFIG_DOS_PARTITION
25 # endif
26 # ifdef CONFIG_MMC
27 #  define CONFIG_DOS_PARTITION
28 #  define CONFIG_SYS_MMC_MAX_BLK_COUNT 127
29 # endif
30 # ifdef CONFIG_MMC_SPI
31 #  define CONFIG_CMD_MMC_SPI
32 # endif
33 # ifdef CONFIG_USB
34 #  define CONFIG_CMD_USB_STORAGE
35 #  define CONFIG_DOS_PARTITION
36 # endif
37 # if defined(CONFIG_NAND_PLAT) || defined(CONFIG_DRIVER_NAND_BFIN)
38 #  define CONFIG_CMD_NAND
39 #  define CONFIG_CMD_NAND_LOCK_UNLOCK
40 # endif
41 # ifdef CONFIG_POST
42 #  define CONFIG_CMD_DIAG
43 # endif
44 # ifdef CONFIG_RTC_BFIN
45 #  define CONFIG_CMD_DATE
46 #  ifdef ADI_CMDS_NETWORK
47 #  endif
48 # endif
49 # ifdef CONFIG_SPI
50 #  define CONFIG_CMD_EEPROM
51 # endif
52 # if defined(CONFIG_SYS_I2C) || defined(CONFIG_SYS_I2C_SOFT)
53 #  define CONFIG_SOFT_I2C_READ_REPEATED_START
54 # endif
55 # ifndef CONFIG_SYS_NO_FLASH
56 #  define CONFIG_CMD_JFFS2
57 # endif
58 # ifdef CONFIG_CMD_JFFS2
59 #  define CONFIG_JFFS2_SUMMARY
60 # endif
61 # define CONFIG_CMD_BOOTLDR
62 # define CONFIG_CMD_CPLBINFO
63 # define CONFIG_CMD_KGDB
64 # define CONFIG_CMD_LDRINFO
65 # define CONFIG_CMD_REGINFO
66 # define CONFIG_CMD_STRINGS
67 # if defined(__ADSPBF51x__) || defined(__ADSPBF52x__) || defined(__ADSPBF54x__)
68 #  define CONFIG_CMD_OTP
69 #  define CONFIG_CMD_SPIBOOTLDR
70 # endif
71 #endif
72
73 /*
74  * Console Settings
75  */
76 #define CONFIG_SYS_LONGHELP     1
77 #define CONFIG_CMDLINE_EDITING  1
78 #define CONFIG_AUTO_COMPLETE    1
79 #define CONFIG_LOADS_ECHO       1
80 #define CONFIG_JTAG_CONSOLE
81 #define CONFIG_SILENT_CONSOLE
82 #ifndef CONFIG_BAUDRATE
83 # define CONFIG_BAUDRATE        57600
84 #endif
85 #ifdef CONFIG_UART_CONSOLE
86 # define CONFIG_BFIN_SERIAL
87 #endif
88
89 /*
90  * Debug Settings
91  */
92 #define CONFIG_ENV_OVERWRITE    1
93 #define CONFIG_DEBUG_DUMP       1
94 #define CONFIG_KALLSYMS         1
95 #define CONFIG_PANIC_HANG       1
96
97 /*
98  * Env Settings
99  */
100 #ifndef CONFIG_BOOTDELAY
101 # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART)
102 #  define CONFIG_BOOTDELAY      -1
103 # else
104 #  define CONFIG_BOOTDELAY      5
105 # endif
106 #endif
107 #ifndef CONFIG_BOOTCOMMAND
108 # define CONFIG_BOOTCOMMAND     "run ramboot"
109 #endif
110 #ifdef CONFIG_VIDEO
111 # define CONFIG_BOOTARGS_VIDEO "console=tty0 "
112 #else
113 # define CONFIG_BOOTARGS_VIDEO ""
114 #endif
115 #ifndef CONFIG_BOOTARGS_ROOT
116 # define CONFIG_BOOTARGS_ROOT "/dev/mtdblock0 rw"
117 #endif
118 #ifndef FLASHBOOT_ENV_SETTINGS
119 # define FLASHBOOT_ENV_SETTINGS "flashboot=bootm 0x20100000\0"
120 #endif
121 #define CONFIG_BOOTARGS \
122         "root=" CONFIG_BOOTARGS_ROOT " " \
123         "clkin_hz=" __stringify(CONFIG_CLKIN_HZ) " " \
124         "earlyprintk=" \
125                 "serial," \
126                 "uart" __stringify(CONFIG_UART_CONSOLE) "," \
127                 __stringify(CONFIG_BAUDRATE) " " \
128         CONFIG_BOOTARGS_VIDEO \
129         "console=ttyBF" __stringify(CONFIG_UART_CONSOLE) "," \
130                         __stringify(CONFIG_BAUDRATE)
131 #if defined(CONFIG_CMD_NAND)
132 # define NAND_ENV_SETTINGS \
133         "nandargs=set bootargs " CONFIG_BOOTARGS "\0" \
134         "nandboot=" \
135                 "nand read $(loadaddr) 0x20000 0x100000;" \
136                 "run nandargs;" \
137                 "bootm" \
138                 "\0"
139 #else
140 # define NAND_ENV_SETTINGS
141 #endif
142 #if defined(CONFIG_CMD_NET)
143 # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS)
144 #  define UBOOT_ENV_FILE "u-boot.bin"
145 # else
146 #  define UBOOT_ENV_FILE "u-boot.ldr"
147 # endif
148 # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER)
149 #  ifdef CONFIG_SPI
150 #   define UBOOT_ENV_UPDATE \
151                 "eeprom write $(loadaddr) 0x0 $(filesize)"
152 #  else
153 #   ifndef CONFIG_BFIN_SPI_IMG_SIZE
154 #    define CONFIG_BFIN_SPI_IMG_SIZE 0x40000
155 #   endif
156 #   define UBOOT_ENV_UPDATE \
157                 "sf probe " __stringify(BFIN_BOOT_SPI_SSEL) ";" \
158                 "sf erase 0 " __stringify(CONFIG_BFIN_SPI_IMG_SIZE) ";" \
159                 "sf write $(loadaddr) 0 $(filesize)"
160 #  endif
161 # elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND)
162 #  define UBOOT_ENV_UPDATE \
163                 "nand unlock 0 0x40000;" \
164                 "nand erase 0 0x40000;" \
165                 "nand write $(loadaddr) 0 0x40000"
166 # else
167 #  ifndef UBOOT_ENV_UPDATE
168 #   define UBOOT_ENV_UPDATE \
169                 "protect off 0x20000000 +$(filesize);" \
170                 "erase 0x20000000 +$(filesize);" \
171                 "cp.b $(loadaddr) 0x20000000 $(filesize)"
172 #  endif
173 # endif
174 # ifdef CONFIG_NETCONSOLE
175 #  define NETCONSOLE_ENV \
176         "nc=" \
177                 "set ncip ${serverip};" \
178                 "set stdin nc;" \
179                 "set stdout nc;" \
180                 "set stderr nc" \
181                 "\0"
182 # else
183 #  define NETCONSOLE_ENV
184 # endif
185 # define NETWORK_ENV_SETTINGS \
186         NETCONSOLE_ENV \
187         \
188         "ubootfile=" UBOOT_ENV_FILE "\0" \
189         "update=" \
190                 "tftp $(loadaddr) $(ubootfile);" \
191                 UBOOT_ENV_UPDATE \
192                 "\0" \
193         "addip=set bootargs $(bootargs) " \
194                 "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):" \
195                    "$(hostname):eth0:off" \
196                 "\0" \
197         \
198         "ramfile=uImage\0" \
199         "ramargs=set bootargs " CONFIG_BOOTARGS "\0" \
200         "ramboot=" \
201                 "tftp $(loadaddr) $(ramfile);" \
202                 "run ramargs;" \
203                 "run addip;" \
204                 "bootm" \
205                 "\0" \
206         \
207         "nfsfile=vmImage\0" \
208         "nfsargs=set bootargs " \
209                 "root=/dev/nfs rw " \
210                 "nfsroot=$(serverip):$(rootpath),tcp,nfsvers=3" \
211                 "\0" \
212         "nfsboot=" \
213                 "tftp $(loadaddr) $(nfsfile);" \
214                 "run nfsargs;" \
215                 "run addip;" \
216                 "bootm" \
217                 "\0"
218 #else
219 # define NETWORK_ENV_SETTINGS
220 #endif
221 #ifndef BOARD_ENV_SETTINGS
222 # define BOARD_ENV_SETTINGS
223 #endif
224 #define CONFIG_EXTRA_ENV_SETTINGS \
225         NAND_ENV_SETTINGS \
226         NETWORK_ENV_SETTINGS \
227         FLASHBOOT_ENV_SETTINGS \
228         BOARD_ENV_SETTINGS
229
230 /*
231  * Network Settings
232  */
233 #ifdef CONFIG_CMD_NET
234 # define CONFIG_NETMASK         255.255.255.0
235 # ifndef CONFIG_IPADDR
236 #  define CONFIG_IPADDR         192.168.0.15
237 #  define CONFIG_GATEWAYIP      192.168.0.1
238 #  define CONFIG_SERVERIP       192.168.0.2
239 # endif
240 # ifndef CONFIG_ROOTPATH
241 #  define CONFIG_ROOTPATH       "/romfs"
242 # endif
243 # ifdef CONFIG_CMD_DHCP
244 #  ifndef CONFIG_SYS_AUTOLOAD
245 #   define CONFIG_SYS_AUTOLOAD "no"
246 #  endif
247 # endif
248 # define CONFIG_IP_DEFRAG
249 # define CONFIG_NET_RETRY_COUNT 20
250 #endif
251
252 /*
253  * Flash Settings
254  */
255 #define CONFIG_FLASH_SHOW_PROGRESS 45
256
257 /*
258  * SPI Settings
259  */
260 #ifdef CONFIG_SPI_FLASH_ALL
261 #endif
262
263 /*
264  * I2C Settings
265  */
266 #if defined(CONFIG_SYS_I2C) || defined(CONFIG_SYS_I2C_SOFT)
267 # ifndef CONFIG_SYS_I2C_SPEED
268 #  define CONFIG_SYS_I2C_SPEED 50000
269 # endif
270 # ifndef CONFIG_SYS_I2C_SLAVE
271 #  define CONFIG_SYS_I2C_SLAVE 0
272 # endif
273 #endif
274
275 /*
276  * Misc Settings
277  */
278 #ifndef CONFIG_BOARD_SIZE_LIMIT
279 # define CONFIG_BOARD_SIZE_LIMIT $$(( 256 * 1024 ))
280 #endif
281 #define CONFIG_BFIN_SPI_GPIO_CS /* Only matters if BFIN_SPI is enabled */
282 #define CONFIG_LZMA
283 #define CONFIG_MONITOR_IS_IN_RAM
284 #ifdef CONFIG_HW_WATCHDOG
285 # define CONFIG_BFIN_WATCHDOG
286 # ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS
287 #  define CONFIG_WATCHDOG_TIMEOUT_MSECS 5000
288 # endif
289 #endif
290 #ifndef CONFIG_ADI_GPIO2
291 # define CONFIG_ADI_GPIO1
292 #endif
293 #endif