Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2008 |
| 3 | * Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | #ifndef __CONFIG_KEYMILE_H |
| 25 | #define __CONFIG_KEYMILE_H |
| 26 | |
| 27 | /* Do boardspecific init for all boards */ |
| 28 | #define CONFIG_BOARD_EARLY_INIT_R 1 |
| 29 | |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 30 | #define CONFIG_BOOTCOUNT_LIMIT |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 31 | |
| 32 | /* |
| 33 | * Command line configuration. |
| 34 | */ |
| 35 | #include <config_cmd_default.h> |
| 36 | |
| 37 | #define CONFIG_CMD_ASKENV |
| 38 | #define CONFIG_CMD_DHCP |
| 39 | #define CONFIG_CMD_ECHO |
| 40 | #define CONFIG_CMD_IMMAP |
| 41 | #define CONFIG_CMD_MII |
| 42 | #define CONFIG_CMD_PING |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 43 | #define CONFIG_CMD_DTT |
| 44 | #define CONFIG_CMD_EEPROM |
| 45 | #define CONFIG_CMD_I2C |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 46 | #define CONFIG_CMD_JFFS2 |
| 47 | #define CONFIG_JFFS2_CMDLINE |
Heiko Schocher | dc71b24 | 2009-07-09 12:04:18 +0200 | [diff] [blame] | 48 | #define CONFIG_CMD_MTDPARTS |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 49 | |
| 50 | #undef CONFIG_WATCHDOG /* disable platform specific watchdog */ |
| 51 | |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 52 | #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ |
| 53 | #undef CONFIG_BOOTARGS /* the boot command will set bootargs */ |
| 54 | |
| 55 | /* |
| 56 | * Miscellaneous configurable options |
| 57 | */ |
| 58 | #define CONFIG_SYS_HUSH_PARSER |
| 59 | #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " |
| 60 | #define CONFIG_SYS_LONGHELP /* undef to save memory */ |
| 61 | #define CONFIG_SYS_PROMPT "=> " /* Monitor Command Prompt */ |
| 62 | #if defined(CONFIG_CMD_KGDB) |
| 63 | #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ |
| 64 | #else |
| 65 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ |
| 66 | #endif |
| 67 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */ |
| 68 | #define CONFIG_SYS_MAXARGS 16 /* max number of command args */ |
| 69 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */ |
| 70 | #define CONFIG_CMDLINE_EDITING 1 /* add command line history */ |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 71 | #define CONFIG_AUTO_COMPLETE /* add autocompletion support */ |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 72 | |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 73 | #define CONFIG_HUSH_INIT_VAR 1 |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 74 | |
| 75 | #define CONFIG_SYS_ALT_MEMTEST /* memory test, takes time */ |
| 76 | #define CONFIG_SYS_MEMTEST_START 0x00100000 /* memtest works on */ |
| 77 | #define CONFIG_SYS_MEMTEST_END 0x00f00000 /* 1 ... 15 MB in DRAM */ |
| 78 | |
| 79 | #define CONFIG_SYS_LOAD_ADDR 0x100000 /* default load address */ |
| 80 | |
| 81 | #define CONFIG_SYS_HZ 1000 /* decrementer freq: 1 ms ticks */ |
| 82 | |
| 83 | #define CONFIG_BAUDRATE 115200 |
| 84 | #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } |
| 85 | |
| 86 | #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ |
| 87 | #define CONFIG_SYS_LOADS_BAUD_CHANGE 1 /* allow baudrate change */ |
| 88 | |
| 89 | /* |
| 90 | * How to get access to the slot ID. Put this here to make it easy |
| 91 | * to modify in a centralized location. This is used in the HDLC |
| 92 | * driver to set the MAC. |
| 93 | */ |
| 94 | #define CONFIG_CHECK_ETHERNET_PRESENT 1 |
| 95 | #define CONFIG_SYS_SLOT_ID_BASE CONFIG_SYS_PIGGY_BASE |
| 96 | #define CONFIG_SYS_SLOT_ID_OFF (0x07) /* register offset */ |
| 97 | #define CONFIG_SYS_SLOT_ID_MASK (0x3f) /* mask for slot ID bits */ |
| 98 | |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 99 | #define CONFIG_I2C_MULTI_BUS 1 |
Heiko Schocher | dc71b24 | 2009-07-09 12:04:18 +0200 | [diff] [blame] | 100 | #define CONFIG_SYS_MAX_I2C_BUS 1 |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 101 | #define CONFIG_SYS_I2C_INIT_BOARD 1 |
| 102 | #define CONFIG_I2C_MUX 1 |
| 103 | |
| 104 | /* EEprom support */ |
| 105 | #define CONFIG_SYS_I2C_MULTI_EEPROMS 1 |
| 106 | #define CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE |
| 107 | #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 |
| 108 | #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 |
| 109 | |
| 110 | /* Support the IVM EEprom */ |
| 111 | #define CONFIG_SYS_IVM_EEPROM_ADR 0x50 |
| 112 | #define CONFIG_SYS_IVM_EEPROM_MAX_LEN 0x400 |
| 113 | #define CONFIG_SYS_IVM_EEPROM_PAGE_LEN 0x100 |
| 114 | |
| 115 | #define CONFIG_SYS_FLASH_PROTECTION 1 |
| 116 | |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 117 | /* |
| 118 | * BOOTP options |
| 119 | */ |
| 120 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 121 | #define CONFIG_BOOTP_BOOTPATH |
| 122 | #define CONFIG_BOOTP_GATEWAY |
| 123 | #define CONFIG_BOOTP_HOSTNAME |
| 124 | |
Heiko Schocher | dc71b24 | 2009-07-09 12:04:18 +0200 | [diff] [blame] | 125 | #define CONFIG_ENV_SIZE 0x04000 /* Size of Environment */ |
| 126 | |
Heiko Schocher | 4897ee3 | 2010-01-07 08:55:50 +0100 | [diff] [blame] | 127 | #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) |
Heiko Schocher | dc71b24 | 2009-07-09 12:04:18 +0200 | [diff] [blame] | 128 | |
Heiko Schocher | dc71b24 | 2009-07-09 12:04:18 +0200 | [diff] [blame] | 129 | /* UBI Support for all Keymile boards */ |
| 130 | #define CONFIG_CMD_UBI |
| 131 | #define CONFIG_RBTREE |
| 132 | #define CONFIG_MTD_PARTITIONS |
| 133 | #define CONFIG_FLASH_CFI_MTD |
| 134 | #define CONFIG_MTD_DEVICE |
| 135 | #define CONFIG_MTD_CONCAT |
| 136 | |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 137 | /* define this to use the keymile's io muxing feature */ |
| 138 | /*#define CONFIG_IO_MUXING */ |
| 139 | |
| 140 | #ifdef CONFIG_IO_MUXING |
| 141 | #define CONFIG_KM_DEF_ENV_IOMUX \ |
Heiko Schocher | 48690d8 | 2010-07-20 17:45:02 +0200 | [diff] [blame^] | 142 | "nc=setenv ethact HDLC \0" \ |
| 143 | "nce=setenv ethact SCC \0" \ |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 144 | "stderr=serial,nc \0" \ |
| 145 | "stdin=serial,nc \0" \ |
| 146 | "stdout=serial,nc \0" \ |
| 147 | "tftpsrcp=69 \0" \ |
| 148 | "tftpdstp=69 \0" |
| 149 | #else |
| 150 | #define CONFIG_KM_DEF_ENV_IOMUX \ |
| 151 | "stderr=serial \0" \ |
| 152 | "stdin=serial \0" \ |
| 153 | "stdout=serial \0" |
| 154 | #endif |
| 155 | |
| 156 | #ifndef CONFIG_KM_DEF_ENV_PRIVATE |
| 157 | #define CONFIG_KM_DEF_ENV_PRIVATE \ |
| 158 | "kmprivate=empty\0" |
| 159 | #endif |
| 160 | |
| 161 | #define xstr(s) str(s) |
| 162 | #define str(s) #s |
| 163 | |
| 164 | #ifndef CONFIG_KM_DEF_ENV |
| 165 | #define CONFIG_KM_DEF_ENV \ |
| 166 | "netdev=eth0\0" \ |
| 167 | "u-boot_addr_r=100000\0" \ |
| 168 | "kernel_addr_r=200000\0" \ |
| 169 | "fdt_addr_r=600000\0" \ |
| 170 | "ram_ws=800000 \0" \ |
Peter Tyser | 3202d33 | 2009-09-16 21:38:10 -0500 | [diff] [blame] | 171 | "script_ws=780000 \0" \ |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 172 | "fdt_file=" xstr(CONFIG_HOSTNAME) "/" \ |
| 173 | xstr(CONFIG_HOSTNAME) ".dtb\0" \ |
| 174 | "u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.bin \0" \ |
| 175 | "kernel_file=" xstr(CONFIG_HOSTNAME) "/uImage \0" \ |
| 176 | "load=tftp ${u-boot_addr_r} ${u-boot}\0" \ |
| 177 | "update=protect off " xstr(BOOTFLASH_START) " +${filesize};" \ |
| 178 | "erase " xstr(BOOTFLASH_START) " +${filesize};" \ |
| 179 | "cp.b ${u-boot_addr_r} " xstr(BOOTFLASH_START) \ |
| 180 | " ${filesize};" \ |
| 181 | "protect on " xstr(BOOTFLASH_START) " +${filesize}\0" \ |
| 182 | "load_fdt=tftp ${fdt_addr_r} ${fdt_file}; " \ |
| 183 | "setenv actual_fdt_addr ${fdt_addr_r} \0" \ |
| 184 | "load_kernel=tftp ${kernel_addr_r} ${kernel_file}; " \ |
| 185 | "setenv actual_kernel_addr ${kernel_addr_r} \0" \ |
| 186 | "ramargs=setenv bootargs root=/dev/ram rw\0" \ |
| 187 | "nfsargs=setenv bootargs root=/dev/nfs rw " \ |
| 188 | "nfsroot=${serverip}:${rootpath}\0" \ |
| 189 | "mtdargs=setenv bootargs root=${actual_rootfs} rw " \ |
| 190 | "rootfstype=jffs2 \0" \ |
| 191 | "altmtdargs=setenv bootargs root=${backup_rootfs} rw " \ |
| 192 | "rootfstype=jffs2 \0" \ |
| 193 | "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \ |
| 194 | "addip=setenv bootargs ${bootargs} " \ |
| 195 | "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \ |
| 196 | ":${hostname}:${netdev}:off panic=1\0" \ |
| 197 | "addboardid=setenv bootargs ${bootargs} " \ |
| 198 | "hwKey=${IVM_HWKey} boardId=0x${IVM_BoardId} \0" \ |
| 199 | "addpram=setenv bootargs ${bootargs} " \ |
| 200 | "mem=${mem} pram=${pram}\0" \ |
| 201 | "pram=" xstr(CONFIG_PRAM) "k\0" \ |
| 202 | "net_nfs=tftp ${kernel_addr_r} ${kernel_file}; " \ |
| 203 | "tftp ${fdt_addr_r} ${fdt_file}; " \ |
| 204 | "run nfsargs addip addcon addboardid addpram;" \ |
| 205 | "bootm ${kernel_addr_r} - ${fdt_addr_r}\0" \ |
| 206 | "net_self=tftp ${kernel_addr_r} ${kernel_file}; " \ |
| 207 | "tftp ${fdt_addr_r} ${fdt_file}; " \ |
| 208 | "tftp ${ramdisk_addr} ${ramdisk_file}; " \ |
| 209 | "run ramargs addip addboardid addpram; " \ |
| 210 | "bootm ${kernel_addr_r} ${ramdisk_addr} ${fdt_addr_r}\0"\ |
| 211 | "flash_nfs=run nfsargs addip addcon;" \ |
| 212 | "bootm ${kernel_addr} - ${fdt_addr}\0" \ |
| 213 | "flash_self=run ramargs addip addcon addboardid addpram;" \ |
| 214 | "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \ |
| 215 | "bootcmd=run mtdargs addip addcon addboardid addpram; " \ |
| 216 | "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \0" \ |
| 217 | "altbootcmd=run altmtdargs addip addcon addboardid addpram; " \ |
| 218 | "bootm ${backup_kernel_addr} - ${backup_fdt_addr} \0" \ |
| 219 | "actual0=setenv actual_bank 0; setenv actual_kernel_addr " \ |
| 220 | "${bank0_kernel_addr}; " \ |
| 221 | "setenv actual_fdt_addr ${bank0_fdt_addr}; " \ |
| 222 | "setenv actual_rootfs ${bank0_rootfs} \0" \ |
| 223 | "actual1=setenv actual_bank 1; setenv actual_kernel_addr " \ |
| 224 | "${bank1_kernel_addr}; " \ |
| 225 | "setenv actual_fdt_addr ${bank1_fdt_addr}; " \ |
| 226 | "setenv actual_rootfs ${bank1_rootfs} \0" \ |
| 227 | "backup0=setenv backup_bank 0; setenv backup_kernel_addr " \ |
| 228 | "${bank0_kernel_addr}; " \ |
| 229 | "setenv backup_fdt_addr ${bank0_fdt_addr}; " \ |
| 230 | "setenv backup_rootfs ${bank0_rootfs} \0" \ |
| 231 | "backup1=setenv backup_bank 1; setenv backup_kernel_addr " \ |
| 232 | "${bank1_kernel_addr}; " \ |
| 233 | "setenv backup_fdt_addr ${bank1_fdt_addr}; " \ |
| 234 | "setenv backup_rootfs ${bank1_rootfs} \0" \ |
| 235 | "setbank0=run actual0 backup1 \0" \ |
| 236 | "setbank1=run actual1 backup0 \0" \ |
| 237 | "release=setenv bootcmd " \ |
| 238 | "\'run mtdargs addip addcon addboardid addpram;" \ |
| 239 | "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \ |
| 240 | "saveenv \0" \ |
| 241 | "develop=setenv bootcmd " \ |
| 242 | "\'run nfsargs addip addcon addboardid addpram;" \ |
| 243 | "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \ |
| 244 | "saveenv \0" \ |
| 245 | "developall=setenv bootcmd " \ |
| 246 | "\'run load_fdt load_kernel nfsargs " \ |
| 247 | "addip addcon addboardid addpram; " \ |
| 248 | "bootm ${actual_kernel_addr} - ${actual_fdt_addr} \'; " \ |
| 249 | "saveenv \0" \ |
| 250 | "set_new_esw_script=setenv new_esw_script " \ |
| 251 | "new_esw_0x${IVM_BoardId}_0x${IVM_HWKey}.scr \0" \ |
| 252 | "new_esw=run set_new_esw_script; " \ |
Peter Tyser | 3202d33 | 2009-09-16 21:38:10 -0500 | [diff] [blame] | 253 | "tftp ${script_ws} ${new_esw_script}; " \ |
| 254 | "iminfo ${script_ws}; source ${script_ws} \0" \ |
Heiko Schocher | 364123d | 2009-03-12 07:37:18 +0100 | [diff] [blame] | 255 | "bootlimit=0 \0" \ |
| 256 | CONFIG_KM_DEF_ENV_IOMUX \ |
| 257 | CONFIG_KM_DEF_ENV_PRIVATE \ |
| 258 | "" |
| 259 | #endif /* CONFIG_KM_DEF_ENV */ |
| 260 | |
| 261 | #define CONFIG_VERSION_VARIABLE /* include version env variable */ |
| 262 | |
Heiko Schocher | 1e8f4e7 | 2008-11-20 09:59:09 +0100 | [diff] [blame] | 263 | #endif /* __CONFIG_KEYMILE_H */ |