Mike Frysinger | 62d2a23 | 2008-06-01 09:09:48 -0400 | [diff] [blame] | 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 | # 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 |
| 74 | # endif |
| 75 | #endif |
| 76 | |
| 77 | /* |
| 78 | * Console Settings |
| 79 | */ |
| 80 | #define CONFIG_SYS_LONGHELP 1 |
| 81 | #define CONFIG_CMDLINE_EDITING 1 |
| 82 | #define CONFIG_AUTO_COMPLETE 1 |
| 83 | #define CONFIG_LOADS_ECHO 1 |
| 84 | #define CONFIG_JTAG_CONSOLE |
| 85 | #ifndef CONFIG_BAUDRATE |
| 86 | # define CONFIG_BAUDRATE 57600 |
| 87 | #endif |
| 88 | |
| 89 | /* |
| 90 | * Debug Settings |
| 91 | */ |
| 92 | #define CONFIG_ENV_OVERWRITE 1 |
| 93 | #define CONFIG_DEBUG_DUMP 1 |
Mike Frysinger | a46fbba | 2009-05-20 04:35:14 -0400 | [diff] [blame^] | 94 | #define CONFIG_KALLSYMS 1 |
Mike Frysinger | 62d2a23 | 2008-06-01 09:09:48 -0400 | [diff] [blame] | 95 | #define CONFIG_PANIC_HANG 1 |
| 96 | |
| 97 | /* |
| 98 | * Env Settings |
| 99 | */ |
| 100 | #if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_UART) |
| 101 | # define CONFIG_BOOTDELAY -1 |
| 102 | #else |
| 103 | # define CONFIG_BOOTDELAY 5 |
| 104 | #endif |
| 105 | #define CONFIG_BOOTCOMMAND "run ramboot" |
| 106 | #ifdef CONFIG_VIDEO |
| 107 | # define CONFIG_BOOTARGS_VIDEO "console=tty0 " |
| 108 | #else |
| 109 | # define CONFIG_BOOTARGS_VIDEO "" |
| 110 | #endif |
| 111 | #define CONFIG_BOOTARGS \ |
| 112 | "root=/dev/mtdblock0 rw " \ |
Mike Frysinger | a66097a | 2008-12-09 13:47:39 -0500 | [diff] [blame] | 113 | "clkin_hz=" MK_STR(CONFIG_CLKIN_HZ) " " \ |
Mike Frysinger | 62d2a23 | 2008-06-01 09:09:48 -0400 | [diff] [blame] | 114 | "earlyprintk=" \ |
| 115 | "serial," \ |
| 116 | "uart" MK_STR(CONFIG_UART_CONSOLE) "," \ |
| 117 | MK_STR(CONFIG_BAUDRATE) " " \ |
| 118 | CONFIG_BOOTARGS_VIDEO \ |
| 119 | "console=ttyBF0," MK_STR(CONFIG_BAUDRATE) |
| 120 | |
| 121 | #if defined(CONFIG_CMD_NET) |
| 122 | # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS) |
| 123 | # define UBOOT_ENV_FILE "u-boot.bin" |
| 124 | # else |
| 125 | # define UBOOT_ENV_FILE "u-boot.ldr" |
| 126 | # endif |
| 127 | # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER) |
| 128 | # ifdef CONFIG_SPI |
| 129 | # define UBOOT_ENV_UPDATE \ |
| 130 | "eeprom write $(loadaddr) 0x0 $(filesize)" |
| 131 | # else |
| 132 | # define UBOOT_ENV_UPDATE \ |
| 133 | "sf probe " MK_STR(BFIN_BOOT_SPI_SSEL) ";" \ |
| 134 | "sf erase 0 0x40000;" \ |
| 135 | "sf write $(loadaddr) 0 $(filesize)" |
| 136 | # endif |
| 137 | # elif (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_NAND) |
| 138 | # define UBOOT_ENV_UPDATE \ |
| 139 | "nand unlock 0 0x40000;" \ |
| 140 | "nand erase 0 0x40000;" \ |
| 141 | "nand write $(loadaddr) 0 0x40000" |
| 142 | # else |
| 143 | # define UBOOT_ENV_UPDATE \ |
| 144 | "protect off 0x20000000 0x2003FFFF;" \ |
| 145 | "erase 0x20000000 0x2003FFFF;" \ |
| 146 | "cp.b $(loadaddr) 0x20000000 $(filesize)" |
| 147 | # endif |
| 148 | # define NETWORK_ENV_SETTINGS \ |
| 149 | "ubootfile=" UBOOT_ENV_FILE "\0" \ |
| 150 | "update=" \ |
| 151 | "tftp $(loadaddr) $(ubootfile);" \ |
| 152 | UBOOT_ENV_UPDATE \ |
| 153 | "\0" \ |
| 154 | "addip=set bootargs $(bootargs) " \ |
| 155 | "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):" \ |
| 156 | "$(hostname):eth0:off" \ |
| 157 | "\0" \ |
| 158 | "ramargs=set bootargs " CONFIG_BOOTARGS "\0" \ |
| 159 | "ramboot=" \ |
| 160 | "tftp $(loadaddr) uImage;" \ |
| 161 | "run ramargs;" \ |
| 162 | "run addip;" \ |
| 163 | "bootm" \ |
| 164 | "\0" \ |
| 165 | "nfsargs=set bootargs " \ |
| 166 | "root=/dev/nfs rw " \ |
| 167 | "nfsroot=$(serverip):$(rootpath),tcp,nfsvers=3" \ |
| 168 | "\0" \ |
| 169 | "nfsboot=" \ |
| 170 | "tftp $(loadaddr) vmImage;" \ |
| 171 | "run nfsargs;" \ |
| 172 | "run addip;" \ |
| 173 | "bootm" \ |
| 174 | "\0" |
| 175 | #else |
| 176 | # define NETWORK_ENV_SETTINGS |
| 177 | #endif |
| 178 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 179 | NETWORK_ENV_SETTINGS \ |
| 180 | "flashboot=bootm 0x20100000\0" |
| 181 | |
| 182 | /* |
| 183 | * Network Settings |
| 184 | */ |
| 185 | #ifdef CONFIG_CMD_NET |
| 186 | # define CONFIG_IPADDR 192.168.0.15 |
| 187 | # define CONFIG_NETMASK 255.255.255.0 |
| 188 | # define CONFIG_GATEWAYIP 192.168.0.1 |
| 189 | # define CONFIG_SERVERIP 192.168.0.2 |
| 190 | # define CONFIG_ROOTPATH /romfs |
| 191 | # ifdef CONFIG_CMD_DHCP |
| 192 | # ifndef CONFIG_SYS_AUTOLOAD |
| 193 | # define CONFIG_SYS_AUTOLOAD "no" |
| 194 | # endif |
| 195 | # endif |
| 196 | # define CONFIG_NET_RETRY_COUNT 20 |
| 197 | #endif |
| 198 | |
| 199 | #endif |