Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 1 | /* |
| 2 | * U-boot - Configuration file for BlackStamp board |
| 3 | * Configuration by Ben Matthews for UR LLE using bf533-stamp.h |
| 4 | * as a template |
| 5 | * See http://blackfin.uclinux.org/gf/project/blackstamp/ |
| 6 | */ |
| 7 | |
| 8 | #ifndef __CONFIG_BLACKSTAMP_H__ |
| 9 | #define __CONFIG_BLACKSTAMP_H__ |
| 10 | |
Mike Frysinger | f348ab8 | 2009-04-24 17:22:40 -0400 | [diff] [blame] | 11 | #include <asm/config-pre.h> |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 12 | |
| 13 | /* |
| 14 | * Debugging: Set these options if you're having problems |
| 15 | */ |
| 16 | /* |
| 17 | * #define CONFIG_DEBUG_EARLY_SERIAL |
| 18 | * #define DEBUG |
| 19 | * #define CONFIG_DEBUG_DUMP |
| 20 | * #define CONFIG_DEBUG_DUMP_SYMS |
| 21 | */ |
| 22 | #define CONFIG_PANIC_HANG 0 |
| 23 | |
| 24 | /* CPU Options |
| 25 | * Be sure to set the Silicon Revision Correctly |
| 26 | */ |
Mike Frysinger | fbcf8e8 | 2010-12-23 14:58:37 -0500 | [diff] [blame] | 27 | #define CONFIG_BFIN_CPU bf532-0.5 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 28 | #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER |
| 29 | |
| 30 | /* |
| 31 | * Board settings |
| 32 | */ |
Ben Warren | 7194ab8 | 2009-10-04 22:37:03 -0700 | [diff] [blame] | 33 | #define CONFIG_SMC91111 1 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 34 | #define CONFIG_SMC91111_BASE 0x20300300 |
| 35 | |
| 36 | /* FLASH/ETHERNET uses the same address range |
| 37 | * Depending on what you have the CPLD doing |
| 38 | * this probably isn't needed |
| 39 | */ |
| 40 | #define SHARED_RESOURCES 1 |
| 41 | |
| 42 | /* Is I2C bit-banged? */ |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 43 | |
| 44 | /* |
| 45 | * Clock Settings |
| 46 | * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV |
| 47 | * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV |
| 48 | */ |
| 49 | /* CONFIG_CLKIN_HZ is any value in Hz */ |
| 50 | #define CONFIG_CLKIN_HZ 25000000 |
| 51 | /* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */ |
| 52 | /* 1 = CLKIN / 2 */ |
| 53 | #define CONFIG_CLKIN_HALF 0 |
| 54 | /* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */ |
| 55 | /* 1 = bypass PLL */ |
| 56 | #define CONFIG_PLL_BYPASS 0 |
| 57 | /* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */ |
| 58 | /* Values can range from 0-63 (where 0 means 64) */ |
| 59 | #define CONFIG_VCO_MULT 16 |
| 60 | /* CCLK_DIV controls the core clock divider */ |
| 61 | /* Values can be 1, 2, 4, or 8 ONLY */ |
| 62 | #define CONFIG_CCLK_DIV 1 |
| 63 | /* SCLK_DIV controls the system clock divider */ |
| 64 | /* Values can range from 1-15 */ |
| 65 | #define CONFIG_SCLK_DIV 3 |
| 66 | |
| 67 | /* |
| 68 | * Network settings |
| 69 | */ |
| 70 | |
Ben Warren | 7194ab8 | 2009-10-04 22:37:03 -0700 | [diff] [blame] | 71 | #ifdef CONFIG_SMC91111 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 72 | #define CONFIG_IPADDR 192.168.0.15 |
| 73 | #define CONFIG_NETMASK 255.255.255.0 |
| 74 | #define CONFIG_GATEWAYIP 192.168.0.1 |
| 75 | #define CONFIG_SERVERIP 192.168.0.2 |
| 76 | #define CONFIG_HOSTNAME blackstamp |
Joe Hershberger | 8b3637c | 2011-10-13 13:03:47 +0000 | [diff] [blame] | 77 | #define CONFIG_ROOTPATH "/checkout/uClinux-dist/romfs" |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 78 | #define CONFIG_SYS_AUTOLOAD "no" |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 79 | #endif |
| 80 | |
| 81 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
Mike Frysinger | f8bf54b | 2009-06-25 19:40:28 -0400 | [diff] [blame] | 82 | #define CONFIG_ENV_OFFSET 0x40000 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 83 | #define CONFIG_ENV_SIZE 0x2000 |
| 84 | #define CONFIG_ENV_SECT_SIZE 0x40000 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 85 | |
| 86 | /* |
| 87 | * SDRAM settings & memory map |
| 88 | */ |
| 89 | |
| 90 | #define CONFIG_MEM_SIZE 64 /* 128, 64, 32, 16 */ |
| 91 | #define CONFIG_MEM_ADD_WDTH 10 /* 8, 9, 10, 11 */ |
| 92 | |
| 93 | #define CONFIG_SYS_MONITOR_LEN (256 << 10) |
| 94 | #define CONFIG_SYS_MALLOC_LEN (384 << 10) |
| 95 | |
| 96 | /* |
| 97 | * Command settings |
| 98 | */ |
| 99 | |
| 100 | #define CONFIG_SYS_LONGHELP 1 |
| 101 | #define CONFIG_CMDLINE_EDITING 1 |
| 102 | #define CONFIG_AUTO_COMPLETE 1 |
| 103 | #define CONFIG_ENV_OVERWRITE 1 |
| 104 | |
Ben Warren | 7194ab8 | 2009-10-04 22:37:03 -0700 | [diff] [blame] | 105 | #ifdef CONFIG_SMC91111 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 106 | # define CONFIG_CMD_DHCP |
| 107 | # define CONFIG_CMD_PING |
| 108 | #else |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 109 | #endif |
| 110 | |
Heiko Schocher | ea818db | 2013-01-29 08:53:15 +0100 | [diff] [blame] | 111 | #ifdef CONFIG_SYS_I2C_SOFT |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 112 | # define CONFIG_CMD_I2C |
| 113 | #endif |
| 114 | |
| 115 | #define CONFIG_CMD_BOOTLDR |
| 116 | #define CONFIG_CMD_CACHE |
| 117 | #define CONFIG_CMD_CPLBINFO |
| 118 | #define CONFIG_CMD_DATE |
| 119 | #define CONFIG_CMD_SF |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 120 | |
| 121 | #define CONFIG_BOOTDELAY 5 |
| 122 | #define CONFIG_BOOTCOMMAND "run ramboot" |
| 123 | #define CONFIG_BOOTARGS \ |
| 124 | "root=/dev/mtdblock0 rw " \ |
Marek Vasut | 5368c55 | 2012-09-23 17:41:24 +0200 | [diff] [blame] | 125 | "clkin_hz=" __stringify(CONFIG_CLKIN_HZ) " " \ |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 126 | "earlyprintk=" \ |
| 127 | "serial," \ |
Marek Vasut | 5368c55 | 2012-09-23 17:41:24 +0200 | [diff] [blame] | 128 | "uart" __stringify(CONFIG_UART_CONSOLE) "," \ |
| 129 | __stringify(CONFIG_BAUDRATE) " " \ |
| 130 | "console=ttyBF0," __stringify(CONFIG_BAUDRATE) |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 131 | |
| 132 | #if defined(CONFIG_CMD_NET) |
| 133 | # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_BYPASS) |
| 134 | # define UBOOT_ENV_FILE "u-boot.bin" |
| 135 | # else |
| 136 | # define UBOOT_ENV_FILE "u-boot.ldr" |
| 137 | # endif |
| 138 | # if (CONFIG_BFIN_BOOT_MODE == BFIN_BOOT_SPI_MASTER) |
| 139 | # ifdef CONFIG_SPI |
| 140 | # define UBOOT_ENV_UPDATE \ |
| 141 | "eeprom write $(loadaddr) 0x0 $(filesize)" |
| 142 | # else |
| 143 | # define UBOOT_ENV_UPDATE \ |
Marek Vasut | 5368c55 | 2012-09-23 17:41:24 +0200 | [diff] [blame] | 144 | "sf probe " __stringify(BFIN_BOOT_SPI_SSEL) ";" \ |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 145 | "sf erase 0 0x40000;" \ |
| 146 | "sf write $(loadaddr) 0 $(filesize)" |
| 147 | # endif |
| 148 | # else |
| 149 | # define UBOOT_ENV_UPDATE \ |
| 150 | "protect off 0x20000000 0x2003FFFF;" \ |
| 151 | "erase 0x20000000 0x2003FFFF;" \ |
| 152 | "cp.b $(loadaddr) 0x20000000 $(filesize)" |
| 153 | # endif |
| 154 | # define NETWORK_ENV_SETTINGS \ |
| 155 | "ubootfile=" UBOOT_ENV_FILE "\0" \ |
| 156 | "update=" \ |
| 157 | "tftp $(loadaddr) $(ubootfile);" \ |
| 158 | UBOOT_ENV_UPDATE \ |
| 159 | "\0" \ |
| 160 | "addip=set bootargs $(bootargs) " \ |
| 161 | "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):" \ |
| 162 | "$(hostname):eth0:off" \ |
| 163 | "\0" \ |
| 164 | "ramargs=set bootargs " CONFIG_BOOTARGS "\0" \ |
| 165 | "ramboot=" \ |
| 166 | "tftp $(loadaddr) uImage;" \ |
| 167 | "run ramargs;" \ |
| 168 | "run addip;" \ |
| 169 | "bootm" \ |
| 170 | "\0" \ |
| 171 | "nfsargs=set bootargs " \ |
| 172 | "root=/dev/nfs rw " \ |
| 173 | "nfsroot=$(serverip):$(rootpath),tcp,nfsvers=3" \ |
| 174 | "\0" \ |
| 175 | "nfsboot=" \ |
| 176 | "tftp $(loadaddr) vmImage;" \ |
| 177 | "run nfsargs;" \ |
| 178 | "run addip;" \ |
| 179 | "bootm" \ |
| 180 | "\0" |
| 181 | #else |
| 182 | # define NETWORK_ENV_SETTINGS |
| 183 | #endif |
| 184 | |
| 185 | /* |
| 186 | * Console settings |
| 187 | */ |
| 188 | #define CONFIG_BAUDRATE 57600 |
| 189 | #define CONFIG_LOADS_ECHO 1 |
| 190 | #define CONFIG_UART_CONSOLE 0 |
Sonic Zhang | 7a58eb9 | 2013-11-18 14:50:19 +0800 | [diff] [blame] | 191 | #define CONFIG_BFIN_SERIAL |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 192 | |
| 193 | /* |
| 194 | * I2C settings |
| 195 | * By default PF2 is used as SDA and PF3 as SCL on the Stamp board |
| 196 | * Located on the expansion connector on pins 86/85 |
| 197 | * Note these pins are arbitrarily chosen because we aren't using |
| 198 | * them yet. You can (and probably should) change these values! |
| 199 | */ |
Heiko Schocher | ea818db | 2013-01-29 08:53:15 +0100 | [diff] [blame] | 200 | #ifdef CONFIG_SYS_I2C_SOFT |
Mike Frysinger | beb60e7 | 2010-06-08 16:22:44 -0400 | [diff] [blame] | 201 | #define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF9 |
| 202 | #define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF8 |
Marek Vasut | 90f002a | 2013-08-01 12:32:20 +0200 | [diff] [blame] | 203 | #define CONFIG_SYS_I2C_SOFT_SPEED 50000 |
| 204 | #define CONFIG_SYS_I2C_SOFT_SLAVE 0xFE |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 205 | #endif |
| 206 | |
| 207 | /* |
| 208 | * Miscellaneous configurable options |
| 209 | */ |
| 210 | #define CONFIG_RTC_BFIN 1 |
| 211 | |
| 212 | /* |
| 213 | * Serial Flash Infomation |
| 214 | */ |
| 215 | #define CONFIG_BFIN_SPI |
Mike Frysinger | f8bf54b | 2009-06-25 19:40:28 -0400 | [diff] [blame] | 216 | /* For the M25P64 SCK Should be Kept < 15Mhz */ |
| 217 | #define CONFIG_ENV_SPI_MAX_HZ 15000000 |
| 218 | #define CONFIG_SF_DEFAULT_SPEED 15000000 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 219 | |
| 220 | /* |
| 221 | * FLASH organization and environment definitions |
| 222 | */ |
| 223 | |
| 224 | #define CONFIG_EBIU_AMGCTL_VAL 0xFF |
| 225 | #define CONFIG_EBIU_AMBCTL0_VAL 0xBBC3BBC3 |
| 226 | #define CONFIG_EBIU_AMBCTL1_VAL 0x99B39983 |
| 227 | #define CONFIG_EBIU_SDRRC_VAL 0x268 |
| 228 | #define CONFIG_EBIU_SDGCTL_VAL 0x911109 |
| 229 | |
| 230 | /* Even though Rev C boards have Parallel Flash |
| 231 | * We aren't supporting it. Newer versions of the |
| 232 | * hardware don't support Parallel Flash at all. |
| 233 | */ |
| 234 | #define CONFIG_SYS_NO_FLASH |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 235 | #undef CONFIG_CMD_JFFS2 |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 236 | |
Mike Frysinger | 3088189 | 2008-10-12 23:28:33 -0400 | [diff] [blame] | 237 | #endif |