Wojtek Skulski | 028f90c | 2010-09-27 18:21:59 -0400 | [diff] [blame] | 1 | /* U-boot for BlackVME. (C) Wojtek Skulski 2010. |
| 2 | * The board includes ADSP-BF561 rev. 0.5, |
| 3 | * 32-bit SDRAM (2 * MT48LC16M16A2TG or MT48LC32M16A2TG), |
| 4 | * Gigabit Ether AX88180 (ASIX) + 88E1111 rev. B2 (Marvell), |
| 5 | * SPI boot flash on PF2 (M25P64 8MB, or M25P128 16 MB), |
| 6 | * FPGA boot flash on PF3 (M25P64 8MB, or M25P128 16 MB), |
| 7 | * Spartan6-LX150 (memory-mapped; both PPIs also connected). |
| 8 | * See http://www.skutek.com |
| 9 | */ |
| 10 | |
| 11 | #ifndef __CONFIG_BLACKVME_H__ |
| 12 | #define __CONFIG_BLACKVME_H__ |
| 13 | |
| 14 | #include <asm/config-pre.h> |
| 15 | |
| 16 | /* Debugging: Set these options if you're having problems |
| 17 | * #define CONFIG_DEBUG_EARLY_SERIAL |
| 18 | * #define DEBUG |
| 19 | * #define CONFIG_DEBUG_DUMP |
| 20 | * #define CONFIG_DEBUG_DUMP_SYMS |
| 21 | * CONFIG_PANIC_HANG means that the board will not auto-reboot |
| 22 | */ |
| 23 | #define CONFIG_PANIC_HANG 0 |
| 24 | |
| 25 | /* CPU Options */ |
Mike Frysinger | 5b0c128 | 2010-12-23 14:58:37 -0500 | [diff] [blame] | 26 | #define CONFIG_BFIN_CPU bf561-0.5 |
| 27 | #define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER |
Wojtek Skulski | 028f90c | 2010-09-27 18:21:59 -0400 | [diff] [blame] | 28 | |
| 29 | /* |
| 30 | * CLOCK SETTINGS CAVEAT |
| 31 | * You CANNOT just change the clock settings, esp. the SCLK. |
| 32 | * The SDRAM timing, SPI baud, and the serial UART baud |
| 33 | * use SCLK frequency to set their own frequencies. Therefore, |
| 34 | * if you change the SCLK_DIV, you may also have to adjust |
| 35 | * SDRAM refresh and other timings. |
| 36 | * -------------------------------------------------------------- |
| 37 | * CCLK = (CLKIN * VCO_MULT) / CCLK_DIV |
| 38 | * 25 * 8 / 1 = 200 MHz |
| 39 | * 25 * 16 / 1 = 400 MHz |
| 40 | * 25 * 24 / 1 = 600 MHz |
| 41 | * SCLK = (CLKIN * VCO_MULT) / SCLK_DIV |
| 42 | * 25 * 8 / 2 = 100 MHz |
| 43 | * 25 * 24 / 6 = 100 MHz |
| 44 | * 25 * 24 / 5 = 120 MHz |
| 45 | * 25 * 16 / 3 = 133 MHz |
| 46 | * 25 MHz because the oscillator also feeds the ether chip. |
| 47 | * CONFIG_CLKIN_HZ is 25 MHz written in Hz |
| 48 | * CLKIN_HALF controls the DF bit in PLL_CTL |
| 49 | * 0 = CLKIN 1 = CLKIN / 2 |
| 50 | * PLL_BYPASS controls the BYPASS bit in PLL_CTL |
| 51 | * 0 = do not bypass 1 = bypass PLL |
| 52 | * VCO_MULT = MSEL (multiplier) in PLL_CTL |
| 53 | * Values can range from 0-63 (where 0 means 64) |
| 54 | * CCLK_DIV = core clock divider (1, 2, 4, or 8 ONLY) |
| 55 | * SCLK_DIV = system clock divider, 1 to 15 |
| 56 | */ |
| 57 | #define CONFIG_CLKIN_HZ 25000000 |
| 58 | #define CONFIG_CLKIN_HALF 0 |
| 59 | #define CONFIG_PLL_BYPASS 0 |
| 60 | #define CONFIG_VCO_MULT 8 |
| 61 | #define CONFIG_CCLK_DIV 1 |
| 62 | #define CONFIG_SCLK_DIV 2 |
| 63 | |
| 64 | /* |
| 65 | * Ether chip in async memory space AMS3, same as BF561-EZ-KIT. |
| 66 | * Used in 32-bit mode. 16-bit mode not supported. |
| 67 | * http://docs.blackfin.uclinux.org/doku.php?id=hw:cards:ax88180 |
| 68 | */ |
| 69 | /* |
| 70 | * Network settings using a dedicated 2nd ether card in PC |
| 71 | * Windows will automatically acquire IP of that card |
| 72 | * Then use the dedicated card IP + 1 for the board |
| 73 | * http://docs.blackfin.uclinux.org/doku.php?id=setting_up_the_network |
| 74 | */ |
| 75 | #define CONFIG_NET_MULTI |
| 76 | |
| 77 | #define CONFIG_DRIVER_AX88180 1 |
| 78 | #define AX88180_BASE 0x2c000000 |
| 79 | #define CONFIG_CMD_MII /* enable probing PHY */ |
| 80 | |
| 81 | #ifdef CONFIG_NET_MULTI /* also used as the network enabler */ |
| 82 | # define CONFIG_HOSTNAME blackvme /* Bfin board */ |
| 83 | # define CONFIG_IPADDR 169.254.144.145 /* Bfin board */ |
| 84 | # define CONFIG_GATEWAYIP 169.254.144.144 /* dedic card */ |
| 85 | # define CONFIG_SERVERIP 169.254.144.144 /* tftp server */ |
| 86 | # define CONFIG_NETMASK 255.255.255.0 |
| 87 | # define CONFIG_ROOTPATH /export/uClinux-dist/romfs /*NFS*/ |
| 88 | # define CFG_AUTOLOAD "no" |
| 89 | # define CONFIG_CMD_DHCP |
| 90 | # define CONFIG_CMD_PING |
| 91 | # define CONFIG_ENV_OVERWRITE 1 /* enable changing MAC at runtime */ |
| 92 | /* Comment out hardcoded MAC to enable MAC storage in EEPROM */ |
| 93 | /* # define CONFIG_ETHADDR ff:ee:dd:cc:bb:aa */ |
| 94 | #endif |
| 95 | |
| 96 | /* |
| 97 | * SDRAM settings & memory map |
| 98 | */ |
| 99 | |
| 100 | #define CONFIG_MEM_SIZE 64 /* 128, 64, 32, 16 */ |
| 101 | #define CONFIG_MEM_ADD_WDTH 9 /* 8, 9, 10, 11 */ |
| 102 | /* |
| 103 | * SDRAM reference page |
| 104 | * http://docs.blackfin.uclinux.org/doku.php?id=bfin:sdram |
| 105 | * NOTE: BlackVME populates only SDRAM bank 0 |
| 106 | */ |
| 107 | /* CONFIG_EBIU_SDBCTL_VAL bank ctrl may be needed in future */ |
| 108 | #define CONFIG_EBIU_SDGCTL_VAL 0x91114d /* global control */ |
| 109 | #define CONFIG_EBIU_SDRRC_VAL 0x306 /* refresh rate */ |
| 110 | |
| 111 | /* Async memory global settings. (ASRAM, not SDRAM) |
| 112 | * HRM page 16-10. Global ASRAM control = 0x3F. Six lower bits = 1 |
| 113 | * CLKOUT enabled, all async banks enabled, core has priority |
| 114 | * bank 0&1 16 bit (FPGA) |
| 115 | * bank 2&3 32 bit (ether and USB chips) |
| 116 | */ |
| 117 | #define CONFIG_EBIU_AMGCTL_VAL 0x3F /* ASRAM setup */ |
| 118 | |
| 119 | /* Async mem timing: BF561 HRM page 16-12 and 16-15. |
| 120 | * Default values 0xFFC2 FFC2 are the slowest supported. |
| 121 | * Example settings of CONFIG_EBIU_AMBCTL1_VAL |
| 122 | * 1. EZ-KIT settings: 0xFFC2 7BB0 |
| 123 | * 2. Bank 3 good timing for AX88180 @ 125MHz = 0x8850 xxxx |
| 124 | * See the following page: |
| 125 | * http://docs.blackfin.uclinux.org/doku.php?id=hw:cards:ax88180 |
| 126 | * 3. Bank 3 timing for AX88180 @ SCLK = 100 MHz: |
| 127 | * AX88180 WEN = 5 clocks REN 6 clocks @ SCLK = 100 MHz |
| 128 | * One extra clock needed because AX88180 is asynchronous to CPU. |
| 129 | */ |
Wolfgang Denk | 1136f69 | 2010-10-27 22:48:30 +0200 | [diff] [blame] | 130 | /* bank 1 0 */ |
Wojtek Skulski | 028f90c | 2010-09-27 18:21:59 -0400 | [diff] [blame] | 131 | #define CONFIG_EBIU_AMBCTL0_VAL 0xFFC2FFC2 |
Wolfgang Denk | 1136f69 | 2010-10-27 22:48:30 +0200 | [diff] [blame] | 132 | /* bank 3 2 */ |
Wojtek Skulski | 028f90c | 2010-09-27 18:21:59 -0400 | [diff] [blame] | 133 | #define CONFIG_EBIU_AMBCTL1_VAL 0xFFC2FFC2 |
| 134 | |
| 135 | /* memory layout */ |
| 136 | |
| 137 | #define CONFIG_SYS_MONITOR_LEN (256 << 10) |
| 138 | #define CONFIG_SYS_MALLOC_LEN (384 << 10) |
| 139 | |
| 140 | /* |
| 141 | * Serial SPI Flash |
| 142 | * For the M25P64 SCK should be kept < 15 MHz |
| 143 | */ |
| 144 | #define CONFIG_BFIN_SPI |
| 145 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
| 146 | #define CONFIG_ENV_OFFSET 0x40000 |
| 147 | #define CONFIG_ENV_SIZE 0x2000 |
| 148 | #define CONFIG_ENV_SECT_SIZE 0x40000 |
| 149 | |
| 150 | #define CONFIG_ENV_SPI_MAX_HZ 15000000 |
| 151 | #define CONFIG_SF_DEFAULT_SPEED 15000000 |
| 152 | #define CONFIG_SPI_FLASH |
| 153 | #define CONFIG_SPI_FLASH_STMICRO |
| 154 | |
| 155 | /* |
| 156 | * Interactive command settings |
| 157 | */ |
| 158 | |
| 159 | #define CONFIG_SYS_LONGHELP 1 |
| 160 | #define CONFIG_CMDLINE_EDITING 1 |
| 161 | #define CONFIG_AUTO_COMPLETE 1 |
| 162 | |
| 163 | #include <config_cmd_default.h> |
| 164 | |
| 165 | #define CONFIG_CMD_BOOTLDR |
| 166 | #define CONFIG_CMD_CACHE |
| 167 | #define CONFIG_CMD_CPLBINFO |
| 168 | #define CONFIG_CMD_SF |
| 169 | #define CONFIG_CMD_ELF |
| 170 | |
| 171 | /* |
| 172 | * Default: boot from SPI flash. |
| 173 | * "sfboot" is a composite command defined in extra settings |
| 174 | */ |
| 175 | #define CONFIG_BOOTDELAY 5 |
| 176 | #define CONFIG_BOOTCOMMAND "run sfboot" |
| 177 | |
| 178 | /* |
| 179 | * Console settings |
| 180 | */ |
| 181 | #define CONFIG_BAUDRATE 57600 |
| 182 | #define CONFIG_LOADS_ECHO 1 |
| 183 | #define CONFIG_UART_CONSOLE 0 |
| 184 | |
| 185 | /* |
| 186 | * U-Boot environment variables. Use "printenv" to examine. |
| 187 | * http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:env |
| 188 | */ |
| 189 | #define CONFIG_BOOTARGS \ |
| 190 | "root=/dev/mtdblock0 rw " \ |
| 191 | "clkin_hz=" MK_STR(CONFIG_CLKIN_HZ) " " \ |
| 192 | "earlyprintk=serial,uart0," \ |
| 193 | MK_STR(CONFIG_BAUDRATE) " " \ |
| 194 | "console=ttyBF0," MK_STR(CONFIG_BAUDRATE) " " |
| 195 | |
| 196 | /* Convenience env variables & commands. |
| 197 | * Reserve kernstart = 0x20000 = 128 kB for U-Boot. |
| 198 | * Reserve kernarea = 0x500000 = 5 MB for kernel (reasonable size). |
| 199 | * U-Boot image is saved at flash offset=0. |
| 200 | * Kernel image is saved at flash offset=$kernstart. |
| 201 | * Instructions. Ksave takes about a minute to complete. |
| 202 | * 1. Update U-Boot: run uget; run usave |
| 203 | * 2. Update kernel: run kget; run ksave |
| 204 | * After updating U-Boot also update the kernel per above instructions |
| 205 | * to make the saved environment consistent with the flash. |
| 206 | */ |
| 207 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 208 | "kernstart=0x20000\0" \ |
| 209 | "kernarea=0x500000\0" \ |
| 210 | "uget=tftp u-boot.ldr\0" \ |
| 211 | "kget=tftp uImage\0" \ |
| 212 | "usave=sf probe 2; " \ |
| 213 | "sf erase 0 $(kernstart); " \ |
| 214 | "sf write $(fileaddr) 0 $(filesize)\0" \ |
| 215 | "ksave=sf probe 2; " \ |
| 216 | "saveenv; " \ |
| 217 | "echo Now patiently wait for the prompt...; " \ |
| 218 | "sf erase $(kernstart) $(kernarea); " \ |
| 219 | "sf write $(fileaddr) $(kernstart) $(filesize)\0" \ |
| 220 | "sfboot=sf probe 2; " \ |
| 221 | "sf read $(loadaddr) $(kernstart) $(filesize); " \ |
| 222 | "run addip; bootm\0" \ |
| 223 | "addip=setenv bootargs $(bootargs) " \ |
| 224 | "ip=$(ipaddr):$(serverip):$(gatewayip):" \ |
| 225 | "$(netmask):$(hostname):eth0:off\0" |
| 226 | |
| 227 | /* |
| 228 | * Soft I2C settings (BF561 does not have hard I2C) |
| 229 | * PF12,13 on SPI connector 0. |
| 230 | */ |
| 231 | #ifdef CONFIG_SOFT_I2C |
| 232 | # define CONFIG_CMD_I2C |
| 233 | # define CONFIG_SOFT_I2C_GPIO_SCL GPIO_PF12 |
| 234 | # define CONFIG_SOFT_I2C_GPIO_SDA GPIO_PF13 |
| 235 | # define CONFIG_SYS_I2C_SPEED 50000 |
| 236 | # define CONFIG_SYS_I2C_SLAVE 0xFE |
| 237 | #endif |
| 238 | |
| 239 | /* |
| 240 | * No Parallel Flash on this board |
| 241 | */ |
| 242 | #define CONFIG_SYS_NO_FLASH |
| 243 | #undef CONFIG_CMD_IMLS |
| 244 | #undef CONFIG_CMD_JFFS2 |
| 245 | #undef CONFIG_CMD_FLASH |
| 246 | |
| 247 | #endif |