blob: e87c0cb5d9c32953fe1d7eaa1547bcc77d92038f [file] [log] [blame]
Stefan Roesea8a11a92008-06-06 15:54:31 +02001/*
Detlev Zundelc8355b92009-09-02 17:24:57 +02002 * (C) Copyright 2008, 2009
Stefan Roesea8a11a92008-06-06 15:54:31 +02003 * Stefan Roese, DENX Software Engineering, sr@denx.de.
4 *
5 * Common configuration options for all AMCC boards
6 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Stefan Roesea8a11a92008-06-06 15:54:31 +02008 */
9
10#ifndef __AMCC_COMMON_H
11#define __AMCC_COMMON_H
12
Anatolij Gustschin5db75232015-03-28 16:49:47 +010013
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020014#define CONFIG_SYS_SDRAM_BASE 0x00000000 /* _must_ be 0 */
Wolfgang Denk14d0a022010-10-07 21:51:12 +020015#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE /* Start of U-Boot */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020016#define CONFIG_SYS_MONITOR_LEN (0xFFFFFFFF - CONFIG_SYS_MONITOR_BASE + 1)
17#define CONFIG_SYS_MALLOC_LEN (1 << 20) /* Reserved for malloc */
Stefan Roesea8a11a92008-06-06 15:54:31 +020018
19/*
20 * UART
21 */
Stefan Roese550650d2010-09-20 16:05:31 +020022#define CONFIG_SYS_NS16550
23#define CONFIG_SYS_NS16550_SERIAL
Simon Glass0e7806d2015-02-07 11:51:46 -070024#ifndef CONFIG_DM_SERIAL
Stefan Roese550650d2010-09-20 16:05:31 +020025#define CONFIG_SYS_NS16550_REG_SIZE 1
26#define CONFIG_SYS_NS16550_CLK get_serial_clock()
Simon Glass0e7806d2015-02-07 11:51:46 -070027#endif
Stefan Roese550650d2010-09-20 16:05:31 +020028#define CONFIG_BAUDRATE 115200
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020029#define CONFIG_SYS_BAUDRATE_TABLE \
Stefan Roesea8a11a92008-06-06 15:54:31 +020030 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
31
32/*
33 * I2C
34 */
Dirk Eibach880540d2013-04-25 02:40:01 +000035#define CONFIG_SYS_I2C
36#define CONFIG_SYS_I2C_PPC4XX
37#define CONFIG_SYS_I2C_PPC4XX_CH0
38#define CONFIG_SYS_I2C_PPC4XX_SLAVE_0 0x7F
Stefan Roesea8a11a92008-06-06 15:54:31 +020039
40/*
41 * Ethernet/EMAC/PHY
42 */
Ben Warren96e21f82008-10-27 23:50:15 -070043#define CONFIG_PPC4xx_EMAC
Stefan Roesea8a11a92008-06-06 15:54:31 +020044#define CONFIG_MII /* MII PHY management */
Stefan Roesea8a11a92008-06-06 15:54:31 +020045#define CONFIG_NETCONSOLE /* include NetConsole support */
46#if defined(CONFIG_440)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020047#define CONFIG_SYS_RX_ETH_BUFFER 32 /* number of eth rx buffers */
Stefan Roesea8a11a92008-06-06 15:54:31 +020048#else
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020049#define CONFIG_SYS_RX_ETH_BUFFER 16 /* number of eth rx buffers */
Stefan Roesea8a11a92008-06-06 15:54:31 +020050#endif
51
52/*
53 * Commands
54 */
Stefan Roesea8a11a92008-06-06 15:54:31 +020055#define CONFIG_CMD_ASKENV
56#if defined(CONFIG_440)
57#define CONFIG_CMD_CACHE
58#endif
59#define CONFIG_CMD_DHCP
60#define CONFIG_CMD_DIAG
61#define CONFIG_CMD_EEPROM
Wolfgang Denk3f9315c2013-03-23 23:50:38 +000062#define CONFIG_CMD_GREPENV
Stefan Roesea8a11a92008-06-06 15:54:31 +020063#define CONFIG_CMD_I2C
64#define CONFIG_CMD_IRQ
65#define CONFIG_CMD_MII
Stefan Roesea8a11a92008-06-06 15:54:31 +020066#define CONFIG_CMD_PING
67#define CONFIG_CMD_REGINFO
68
69/*
70 * Miscellaneous configurable options
71 */
72#define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020073#define CONFIG_SYS_LONGHELP /* undef to save memory */
Stefan Roesea8a11a92008-06-06 15:54:31 +020074#if defined(CONFIG_CMD_KGDB)
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020075#define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */
Stefan Roesea8a11a92008-06-06 15:54:31 +020076#else
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020077#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
Stefan Roesea8a11a92008-06-06 15:54:31 +020078#endif
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020079#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
80#define CONFIG_SYS_MAXARGS 16 /* max number of command args */
81#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
Stefan Roesea8a11a92008-06-06 15:54:31 +020082
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020083#define CONFIG_SYS_MEMTEST_START 0x0400000 /* memtest works on */
84#define CONFIG_SYS_MEMTEST_END 0x0C00000 /* 4 ... 12 MB in DRAM */
Stefan Roesea8a11a92008-06-06 15:54:31 +020085
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020086#define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */
87#define CONFIG_SYS_EXTBDINFO /* To use extended board_into (bd_t) */
Stefan Roesea8a11a92008-06-06 15:54:31 +020088
Stefan Roesea8a11a92008-06-06 15:54:31 +020089#define CONFIG_CMDLINE_EDITING /* add command line history */
90#define CONFIG_AUTO_COMPLETE /* add autocompletion support */
91#define CONFIG_LOOPW /* enable loopw command */
92#define CONFIG_MX_CYCLIC /* enable mdc/mwc commands */
93#define CONFIG_ZERO_BOOTDELAY_CHECK /* check for keypress on bootdelay==0 */
94#define CONFIG_VERSION_VARIABLE /* include version env variable */
Wolfgang Denkc88840a2013-03-23 23:50:37 +000095#define CONFIG_SYS_CONSOLE_INFO_QUIET /* don't print console @ startup*/
Stefan Roesea8a11a92008-06-06 15:54:31 +020096
Wolfgang Denkc88840a2013-03-23 23:50:37 +000097#define CONFIG_SYS_HUSH_PARSER /* Use the HUSH parser */
Stefan Roesea8a11a92008-06-06 15:54:31 +020098
99#define CONFIG_LOADS_ECHO /* echo on for serial download */
Wolfgang Denkc88840a2013-03-23 23:50:37 +0000100#define CONFIG_SYS_LOADS_BAUD_CHANGE /* allow baudrate change */
Stefan Roesea8a11a92008-06-06 15:54:31 +0200101
102/*
103 * BOOTP options
104 */
105#define CONFIG_BOOTP_BOOTFILESIZE
106#define CONFIG_BOOTP_BOOTPATH
107#define CONFIG_BOOTP_GATEWAY
108#define CONFIG_BOOTP_HOSTNAME
109#define CONFIG_BOOTP_SUBNETMASK
110
111/*
112 * For booting Linux, the board info and command line data
Stefan Roese6942efc2009-07-28 10:50:32 +0200113 * have to be in the first 16 MB of memory, since this is
114 * the maximum mapped by the 40x Linux kernel during initialization.
Stefan Roesea8a11a92008-06-06 15:54:31 +0200115 */
Stefan Roese6942efc2009-07-28 10:50:32 +0200116#define CONFIG_SYS_BOOTMAPSZ (16 << 20) /* Initial Memory map for Linux */
117#define CONFIG_SYS_BOOTM_LEN (16 << 20) /* Increase max gunzip size */
Stefan Roesea8a11a92008-06-06 15:54:31 +0200118
119/*
120 * Internal Definitions
121 */
122#if defined(CONFIG_CMD_KGDB)
123#define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port*/
Stefan Roesea8a11a92008-06-06 15:54:31 +0200124#endif
125
126/*
127 * Pass open firmware flat tree
128 */
129#define CONFIG_OF_LIBFDT
130#define CONFIG_OF_BOARD_SETUP
Stefan Roese92b89642009-10-16 10:01:09 +0200131/* Update size in "reg" property of NOR FLASH device tree nodes */
132#define CONFIG_FDT_FIXUP_NOR_FLASH_SIZE
Stefan Roesea8a11a92008-06-06 15:54:31 +0200133
134/*
135 * Booting and default environment
136 */
137#define CONFIG_PREBOOT "echo;" \
138 "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
139 "echo"
140#define CONFIG_BOOTCOMMAND "run flash_self"
141
142/*
143 * Only very few boards have default console not on ttyS0 (like Taishan)
144 */
145#if !defined(CONFIG_USE_TTY)
146#define CONFIG_USE_TTY ttyS0
147#endif
148
149/*
Adam Grahamf09f09d2008-10-08 10:12:53 -0700150 * Only very few boards have default netdev not set to eth0 (like Arches)
151 */
152#if !defined(CONFIG_USE_NETDEV)
153#define CONFIG_USE_NETDEV eth0
154#endif
155
156/*
Stefan Roesea8a11a92008-06-06 15:54:31 +0200157 * Only some 4xx PPC's are equipped with an FPU
158 */
159#if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
160 defined(CONFIG_460EX) || defined(CONFIG_460GT)
161#define CONFIG_AMCC_DEF_ENV_ROOTPATH "rootpath=/opt/eldk/ppc_4xxFP\0"
162#else
163#define CONFIG_AMCC_DEF_ENV_ROOTPATH "rootpath=/opt/eldk/ppc_4xx\0"
164#endif
165
166/*
167 * Only some boards need to extend the bootargs by some additional
168 * parameters (like Makalu)
169 */
170#if !defined(CONFIG_ADDMISC)
171#define CONFIG_ADDMISC "addmisc=setenv bootargs ${bootargs}\0"
172#endif
173
Stefan Roesea8a11a92008-06-06 15:54:31 +0200174/*
175 * General common environment variables shared on all AMCC eval boards
176 */
177#define CONFIG_AMCC_DEF_ENV \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200178 "netdev=" __stringify(CONFIG_USE_NETDEV) "\0" \
Stefan Roesea8a11a92008-06-06 15:54:31 +0200179 "nfsargs=setenv bootargs root=/dev/nfs rw " \
180 "nfsroot=${serverip}:${rootpath}\0" \
181 "ramargs=setenv bootargs root=/dev/ram rw\0" \
182 "addip=setenv bootargs ${bootargs} " \
183 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
184 ":${hostname}:${netdev}:off panic=1\0" \
185 "addtty=setenv bootargs ${bootargs}" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200186 " console=" __stringify(CONFIG_USE_TTY) ",${baudrate}\0" \
Stefan Roesea8a11a92008-06-06 15:54:31 +0200187 CONFIG_ADDMISC \
188 "initrd_high=30000000\0" \
Stefan Roese27dd5f82009-07-28 10:56:03 +0200189 "kernel_addr_r=1000000\0" \
190 "fdt_addr_r=1800000\0" \
191 "ramdisk_addr_r=1900000\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200192 "hostname=" __stringify(CONFIG_HOSTNAME) "\0" \
193 "bootfile=" __stringify(CONFIG_HOSTNAME) "/uImage\0" \
194 "ramdisk_file=" __stringify(CONFIG_HOSTNAME) "/uRamdisk\0" \
Stefan Roesea8a11a92008-06-06 15:54:31 +0200195 CONFIG_AMCC_DEF_ENV_ROOTPATH
196
197/*
198 * Default environment for arch/powerpc booting
199 * for boards that are ported to arch/powerpc
200 */
201#define CONFIG_AMCC_DEF_ENV_POWERPC \
202 "flash_self=run ramargs addip addtty addmisc;" \
203 "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
204 "flash_nfs=run nfsargs addip addtty addmisc;" \
205 "bootm ${kernel_addr} - ${fdt_addr}\0" \
206 "net_nfs=tftp ${kernel_addr_r} ${bootfile}; " \
207 "tftp ${fdt_addr_r} ${fdt_file}; " \
208 "run nfsargs addip addtty addmisc;" \
209 "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \
Adam Grahamf09f09d2008-10-08 10:12:53 -0700210 "net_self_load=tftp ${kernel_addr_r} ${bootfile};" \
211 "tftp ${fdt_addr_r} ${fdt_file};" \
212 "tftp ${ramdisk_addr_r} ${ramdisk_file};\0" \
213 "net_self=run net_self_load;" \
214 "run ramargs addip addtty addmisc;" \
215 "bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200216 "fdt_file=" __stringify(CONFIG_HOSTNAME) "/" __stringify(CONFIG_HOSTNAME) ".dtb\0"
Stefan Roesea8a11a92008-06-06 15:54:31 +0200217
218/*
219 * Default environment for arch/ppc booting,
220 * for boards that are not ported to arch/powerpc yet
221 */
222#define CONFIG_AMCC_DEF_ENV_PPC \
223 "flash_self=run ramargs addip addtty addmisc;" \
224 "bootm ${kernel_addr} ${ramdisk_addr}\0" \
225 "flash_nfs=run nfsargs addip addtty addmisc;" \
226 "bootm ${kernel_addr}\0" \
227 "net_nfs=tftp ${kernel_addr_r} ${bootfile};" \
228 "run nfsargs addip addtty addmisc;" \
229 "bootm ${kernel_addr_r}\0"
230
231/*
232 * Default environment for arch/ppc booting (old version),
233 * for boards that are ported to arch/ppc and arch/powerpc
234 */
235#define CONFIG_AMCC_DEF_ENV_PPC_OLD \
236 "flash_self_old=run ramargs addip addtty addmisc;" \
237 "bootm ${kernel_addr} ${ramdisk_addr}\0" \
238 "flash_nfs_old=run nfsargs addip addtty addmisc;" \
239 "bootm ${kernel_addr}\0" \
240 "net_nfs_old=tftp ${kernel_addr_r} ${bootfile};" \
241 "run nfsargs addip addtty addmisc;" \
242 "bootm ${kernel_addr_r}\0"
243
244#define CONFIG_AMCC_DEF_ENV_NOR_UPD \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200245 "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.bin\0" \
Detlev Zundelc8355b92009-09-02 17:24:57 +0200246 "load=tftp 200000 ${u-boot}\0" \
Marek Vasut93ea89f2012-09-23 17:41:23 +0200247 "update=protect off " __stringify(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;" \
248 "era " __stringify(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;" \
249 "cp.b ${fileaddr} " __stringify(CONFIG_SYS_MONITOR_BASE) " ${filesize}\0" \
Stefan Roesea8a11a92008-06-06 15:54:31 +0200250 "upd=run load update\0" \
251
Stefan Roesea8a11a92008-06-06 15:54:31 +0200252#endif /* __AMCC_COMMON_H */