4bed7ae2673039df02ee7d2d654eeb866b2c8faa
[platform/kernel/u-boot.git] / include / configs / netstal-common.h
1 /*
2  * (C) Copyright 2008
3  * Niklaus Giger, Netstal Maschinen AG, niklaus.giger@netstal.com
4  * adapted from amcc-common.h by
5  * (C) Copyright 2008
6  *  * Stefan Roese, DENX Software Engineering, sr@denx.de.
7  *
8  * Common configuration options for all Netstal boards
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License as
12  * published by the Free Software Foundation; either version 2 of
13  * the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23  * MA 02111-1307 USA
24  */
25
26 #ifndef __NETSTAL_COMMON_H
27 #define __NETSTAL_COMMON_H
28
29 #define CONFIG_SYS_SDRAM_BASE           0x00000000      /* _must_ be 0          */
30 #define CONFIG_SYS_MONITOR_BASE TEXT_BASE       /* Start of U-Boot      */
31 #define CONFIG_SYS_MONITOR_LEN          (320 * 1024)    /* Reserve 320 kB for Monitor   */
32 #define CONFIG_SYS_MALLOC_LEN           (256 * 1024)    /* Reserve 256 kB for malloc() */
33
34 /*
35  * UART
36  */
37 #define CONFIG_SERIAL_MULTI
38 #define CONFIG_SYS_BAUDRATE_TABLE  \
39     {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
40
41 /*
42  * I2C
43  */
44 #define CONFIG_HARD_I2C         1       /* I2C with hardware support */
45 #define CONFIG_SYS_I2C_SPEED            400000  /* I2C speed and slave address  */
46 #define CONFIG_SYS_I2C_SLAVE            0x7F
47
48 /* This is the 7bit address of the device, not including P. */
49 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
50 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
51
52 /* The EEPROM can do 16byte ( 1 << 4 ) page writes. */
53 #define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW     0x07
54 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4
55 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10
56 #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE
57
58 /*
59  * Ethernet/EMAC/PHY
60  */
61 #define CONFIG_PPC4xx_EMAC
62 #define CONFIG_MII                      /* MII PHY management           */
63 #define CONFIG_PHY_ADDR         1       /* PHY address                  */
64 #define CONFIG_NET_MULTI        1
65 #if defined(CONFIG_440)
66 #define CONFIG_NETCONSOLE               /* include NetConsole support   */
67 #define CONFIG_SYS_RX_ETH_BUFFER        32      /* number of eth rx buffers     */
68 #else
69 #define CONFIG_SYS_RX_ETH_BUFFER        16      /* number of eth rx buffers     */
70 #endif
71 #define CONFIG_HAS_ETH0
72
73 /*
74  * Commands
75  */
76 #include <config_cmd_default.h>
77
78 #define CONFIG_CMD_ASKENV
79 #if defined(CONFIG_440)
80 #define CONFIG_CMD_CACHE
81 #endif
82 #define CONFIG_CMD_DHCP
83 #define CONFIG_CMD_DIAG
84 #define CONFIG_CMD_EEPROM
85 #define CONFIG_CMD_ELF
86 #define CONFIG_CMD_I2C
87 #define CONFIG_CMD_IRQ
88 #define CONFIG_CMD_MII
89 #define CONFIG_CMD_NET
90 #define CONFIG_CMD_NFS
91 #define CONFIG_CMD_PING
92 #define CONFIG_CMD_REGINFO
93 #define CONFIG_BOOT_RETRY_TIME 30
94 #define CONFIG_RESET_TO_RETRY
95 /*
96  * Miscellaneous configurable options
97  */
98 #define CONFIG_BOOTDELAY        1       /* autoboot after 1 second      */
99 #define CONFIG_SYS_LONGHELP                     /* undef to save memory         */
100 #define CONFIG_SYS_PROMPT               "=> "   /* Monitor Command Prompt       */
101 #if defined(CONFIG_CMD_KGDB)
102 #define CONFIG_SYS_CBSIZE               1024    /* Console I/O Buffer Size      */
103 #else
104 #define CONFIG_SYS_CBSIZE               256     /* Console I/O Buffer Size      */
105 #endif
106 #define CONFIG_SYS_PBSIZE               (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
107 #define CONFIG_SYS_MAXARGS              16      /* max number of command args   */
108 #define CONFIG_SYS_BARGSIZE             CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size  */
109
110 #define CONFIG_SYS_MEMTEST_START        0x0400000 /* memtest works on           */
111 #define CONFIG_SYS_MEMTEST_END          0x0C00000 /* 4 ... 12 MB in DRAM        */
112
113 #define CONFIG_SYS_LOAD_ADDR            0x100000  /* default load address       */
114 #define CONFIG_SYS_EXTBDINFO                    /* To use extended board_into (bd_t) */
115
116 #define CONFIG_SYS_HZ                   1000    /* decrementer freq: 1 ms ticks */
117
118 #define CONFIG_CMDLINE_EDITING          /* add command line history     */
119 #define CONFIG_AUTO_COMPLETE            /* add autocompletion support   */
120 #define CONFIG_LOOPW                    /* enable loopw command         */
121 #define CONFIG_MX_CYCLIC                /* enable mdc/mwc commands      */
122 #define CONFIG_ZERO_BOOTDELAY_CHECK     /* check for keypress on bootdelay==0 */
123 #define CONFIG_VERSION_VARIABLE         /* include version env variable */
124 #define CONFIG_SYS_CONSOLE_INFO_QUIET           /* don't print console @ startup*/
125
126 #define CONFIG_SYS_HUSH_PARSER                  /* Use the HUSH parser          */
127 #ifdef  CONFIG_SYS_HUSH_PARSER
128 #define CONFIG_SYS_PROMPT_HUSH_PS2      "> "
129 #endif
130
131 #define CONFIG_LOADS_ECHO               /* echo on for serial download  */
132 #define CONFIG_SYS_LOADS_BAUD_CHANGE            /* allow baudrate change        */
133
134 /*
135  * BOOTP options
136  */
137 #define CONFIG_BOOTP_BOOTFILESIZE
138 #define CONFIG_BOOTP_BOOTPATH
139 #define CONFIG_BOOTP_GATEWAY
140 #define CONFIG_BOOTP_HOSTNAME
141 #define CONFIG_BOOTP_SUBNETMASK
142
143 /*
144  * For booting Linux, the board info and command line data
145  * have to be in the first 8 MB of memory, since this is
146  * the maximum mapped by the Linux kernel during initialization.
147  */
148 #define CONFIG_SYS_BOOTMAPSZ            (8 << 20) /* Initial Memory map for Linux */
149
150 /*
151  * Internal Definitions
152  */
153 #if defined(CONFIG_CMD_KGDB)
154 #define CONFIG_KGDB_BAUDRATE    230400  /* speed to run kgdb serial port*/
155 #define CONFIG_KGDB_SER_INDEX   2       /* which serial port to use     */
156 #endif
157
158 /*
159  * Pass open firmware flat tree
160  */
161 #define CONFIG_OF_LIBFDT
162 #define CONFIG_OF_BOARD_SETUP
163
164 /*
165  * Booting and default environment
166  */
167 #define CONFIG_PREBOOT  "echo;" \
168         "echo Type \"run net_nfs\" to mount root filesystem over NFS;" \
169         "echo"
170 #define CONFIG_BOOTCOMMAND      "run vx"
171
172 /*
173  * Only very few boards have default console not on ttyS0 (like Taishan)
174  */
175 #if !defined(CONFIG_USE_TTY)
176 #define CONFIG_USE_TTY  ttyS0
177 #endif
178
179 /*
180  * Only some 4xx PPC's are equipped with an FPU
181  */
182 #if defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
183     defined(CONFIG_460EX) || defined(CONFIG_460GT)
184 #define CONFIG_NETSTAL_DEF_ENV_ROOTPATH "rootpath=/opt/eldk/ppc_4xxFP\0"
185 #else
186 #define CONFIG_NETSTAL_DEF_ENV_ROOTPATH "rootpath=/opt/eldk/ppc_4xx\0"
187 #endif
188
189 /*
190  * Only some boards need to extend the bootargs by some additional
191  * parameters (like Makalu)
192  */
193 #if !defined(CONFIG_ADDMISC)
194 #define CONFIG_ADDMISC  "addmisc=setenv bootargs ${bootargs}\0"
195 #endif
196
197 #define xstr(s) str(s)
198 #define str(s)  #s
199
200 /* Setup some values for the default environment variables */
201 #define CONFIG_SERVERIP         172.25.1.1
202 #define CONFIG_ETHADDR      00:60:13:00:00:00   /* Netstal Machines AG MAC */
203 #define CONFIG_OVERWRITE_ETHADDR_ONCE
204
205 #define CONFIG_SYS_TFTP_LOADADDR        0x01000000
206 #define CONFIG_SYS_VXWORKS_ADD_PARAMS   "u=dpu pw=netstal8752"
207 #define CONFIG_SYS_VXWORKS_SERVERNAME   "c"
208 /*
209  * General common environment variables shared by all boards produced by Netstal Maschinen
210  */
211 #define CONFIG_NETSTAL_DEF_ENV                                          \
212         "netdev=eth0\0"                                                 \
213         "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
214                 "nfsroot=${serverip}:${rootpath}\0"                     \
215         "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
216         "addip=setenv bootargs ${bootargs} "                            \
217                 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
218                 ":${hostname}:${netdev}:off panic=1\0"                  \
219         "addtty=setenv bootargs ${bootargs}"                            \
220                 " console=" xstr(CONFIG_USE_TTY) ",${baudrate}\0"       \
221         CONFIG_ADDMISC                                                  \
222         "initrd_high=30000000\0"                                        \
223         "kernel_addr_r=400000\0"                                        \
224         "fdt_addr_r=800000\0"                                           \
225         "hostname=" xstr(CONFIG_HOSTNAME) "\0"                          \
226         "bootfile=" xstr(CONFIG_HOSTNAME) "/uImage\0"                   \
227         "uload=tftp " xstr(CONFIG_SYS_TFTP_LOADADDR) " "                \
228                 xstr(CONFIG_HOSTNAME) "/u-boot.bin\0"                   \
229         "vx_rom=" xstr(CONFIG_HOSTNAME) "/"                             \
230                 xstr(CONFIG_HOSTNAME) "_vx_rom\0"                       \
231         "update=protect off " xstr(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;"\
232                 "era " xstr(CONFIG_SYS_MONITOR_BASE) " FFFFFFFF;"       \
233                 "cp.b ${fileaddr} "xstr(CONFIG_SYS_MONITOR_BASE)        \
234                 " ${filesize}; setenv filesize\0"                       \
235         "upd=run uload update\0"                                        \
236         "vx=setenv bootfile ${vx_rom}; tftp "                           \
237                 xstr(CONFIG_SYS_TFTP_LOADADDR) "; bootvx\0"             \
238         CONFIG_NETSTAL_DEF_ENV_ROOTPATH
239
240 /*
241  * Default environment for arch/powerpc booting
242  * for boards that are ported to arch/powerpc
243  */
244 #define CONFIG_NETSTAL_DEF_ENV_POWERPC                                  \
245         "flash_self=run ramargs addip addtty addmisc;"                  \
246                 "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"    \
247         "flash_nfs=run nfsargs addip addtty addmisc;"                   \
248                 "bootm ${kernel_addr} - ${fdt_addr}\0"                  \
249         "net_nfs=tftp ${kernel_addr_r} ${bootfile}; "                   \
250                 "tftp ${fdt_addr_r} ${fdt_file}; "                      \
251                 "run nfsargs addip addtty addmisc;"                     \
252                 "bootm ${kernel_addr_r} - ${fdt_addr_r}\0"              \
253         "fdt_file=" xstr(CONFIG_HOSTNAME) "/" xstr(CONFIG_HOSTNAME) ".dtb\0"
254
255 #endif /* __NETSTAL_COMMON_H */