Marek Vasut | 22cc6f5 | 2016-02-11 14:13:38 +0100 | [diff] [blame] | 1 | /* |
| 2 | * DENX MA5D4 configuration |
| 3 | * Copyright (C) 2015 Marek Vasut <marex@denx.de> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #ifndef __MA5D4EVK_CONFIG_H__ |
| 9 | #define __MA5D4EVK_CONFIG_H__ |
| 10 | |
| 11 | #define CONFIG_SYS_NO_FLASH |
| 12 | |
| 13 | #define CONFIG_FIT |
| 14 | |
| 15 | #define CONFIG_TIMESTAMP /* Print image info with timestamp */ |
| 16 | |
| 17 | #include "at91-sama5_common.h" |
| 18 | #undef CONFIG_BOOTARGS |
| 19 | #define CONFIG_SYS_USE_SERIALFLASH 1 |
| 20 | |
| 21 | /* |
| 22 | * U-Boot Commands |
| 23 | */ |
| 24 | #define CONFIG_DOS_PARTITION |
| 25 | #define CONFIG_FAT_WRITE |
| 26 | /*#define CONFIG_LCD*/ |
| 27 | |
| 28 | #define CONFIG_CMD_ASKENV |
| 29 | #define CONFIG_CMD_CACHE |
| 30 | #define CONFIG_CMD_DHCP |
| 31 | #define CONFIG_CMD_EXT4 |
| 32 | #define CONFIG_CMD_EXT4_WRITE |
| 33 | #define CONFIG_CMD_FAT |
| 34 | #define CONFIG_CMD_FS_GENERIC |
| 35 | #define CONFIG_CMD_GREPENV |
| 36 | #define CONFIG_CMD_MII |
| 37 | #define CONFIG_CMD_MMC |
| 38 | #define CONFIG_CMD_PING |
| 39 | #define CONFIG_CMD_SF |
| 40 | #define CONFIG_CMD_USB |
| 41 | |
| 42 | /* |
| 43 | * Memory configurations |
| 44 | */ |
| 45 | #define CONFIG_NR_DRAM_BANKS 1 |
| 46 | #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_DDRCS |
| 47 | #define CONFIG_SYS_SDRAM_SIZE 0x10000000 |
| 48 | |
| 49 | #ifdef CONFIG_SPL_BUILD |
| 50 | #define CONFIG_SYS_INIT_SP_ADDR 0x210000 |
| 51 | #else |
| 52 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 53 | (CONFIG_SYS_SDRAM_BASE + 4 * 1024 - GENERATED_GBL_DATA_SIZE) |
| 54 | #endif |
| 55 | |
| 56 | /* |
| 57 | * Environment |
| 58 | */ |
| 59 | #define CONFIG_ENV_IS_IN_SPI_FLASH |
| 60 | #define CONFIG_SYS_REDUNDAND_ENVIRONMENT |
| 61 | #define CONFIG_ENV_OFFSET 0x8000 |
| 62 | #define CONFIG_ENV_SIZE 0x4000 |
| 63 | #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) |
| 64 | #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE |
| 65 | #define CONFIG_ENV_SECT_SIZE 0x1000 |
| 66 | |
| 67 | /* |
| 68 | * U-Boot general configurations |
| 69 | */ |
| 70 | #define CONFIG_VERSION_VARIABLE /* U-BOOT version */ |
| 71 | |
| 72 | /* |
| 73 | * Serial Driver |
| 74 | */ |
| 75 | #define CONFIG_ATMEL_USART |
| 76 | #define CONFIG_USART_BASE ATMEL_BASE_USART0 |
| 77 | #define CONFIG_USART_ID ATMEL_ID_USART0 |
| 78 | |
| 79 | /* |
| 80 | * Ethernet |
| 81 | */ |
| 82 | #ifdef CONFIG_CMD_NET |
| 83 | #define CONFIG_MACB |
| 84 | #define CONFIG_RMII |
| 85 | #define CONFIG_NET_RETRY_COUNT 20 |
| 86 | #define CONFIG_MACB_SEARCH_PHY |
| 87 | #define CONFIG_ARP_TIMEOUT 200UL |
| 88 | #define CONFIG_IP_DEFRAG |
| 89 | #endif |
| 90 | |
| 91 | /* |
| 92 | * LCD |
| 93 | */ |
| 94 | #ifdef CONFIG_LCD |
| 95 | #define CONFIG_CMD_BMP |
| 96 | #define CONFIG_BMP_16BPP |
| 97 | #define CONFIG_BMP_24BPP |
| 98 | #define CONFIG_BMP_32BPP |
| 99 | #define LCD_BPP LCD_COLOR16 |
| 100 | #define LCD_OUTPUT_BPP 24 |
| 101 | #define CONFIG_ATMEL_HLCD |
| 102 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV |
| 103 | #endif |
| 104 | |
| 105 | /* |
| 106 | * SD/MMC |
| 107 | */ |
| 108 | #ifdef CONFIG_CMD_MMC |
| 109 | #define CONFIG_MMC |
| 110 | #define CONFIG_GENERIC_MMC |
| 111 | #define CONFIG_GENERIC_ATMEL_MCI |
| 112 | #endif |
| 113 | |
| 114 | /* |
| 115 | * SPI NOR (boot memory) |
| 116 | */ |
| 117 | #ifdef CONFIG_CMD_SF |
| 118 | #define CONFIG_ATMEL_SPI |
| 119 | #define CONFIG_ATMEL_SPI0 |
| 120 | #define CONFIG_SPI_FLASH_ATMEL |
| 121 | #define CONFIG_SF_DEFAULT_BUS 0 |
| 122 | #define CONFIG_SF_DEFAULT_CS 0 |
| 123 | #define CONFIG_SF_DEFAULT_SPEED 30000000 |
| 124 | #endif |
| 125 | |
| 126 | /* |
| 127 | * USB |
| 128 | */ |
| 129 | #ifdef CONFIG_CMD_USB |
| 130 | #define CONFIG_USB_EHCI |
| 131 | #define CONFIG_USB_EHCI_ATMEL |
| 132 | #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3 |
| 133 | #define CONFIG_USB_STORAGE |
| 134 | |
| 135 | /* USB device */ |
| 136 | #define CONFIG_USB_GADGET |
| 137 | #define CONFIG_USB_GADGET_DUALSPEED |
| 138 | #define CONFIG_USB_GADGET_ATMEL_USBA |
| 139 | #define CONFIG_USB_ETHER |
| 140 | #define CONFIG_USB_ETH_RNDIS |
| 141 | #define CONFIG_USBNET_MANUFACTURER "DENX" |
| 142 | #endif |
| 143 | |
| 144 | /* |
| 145 | * Boot Linux |
| 146 | */ |
| 147 | #define CONFIG_CMDLINE_TAG |
| 148 | #define CONFIG_INITRD_TAG |
| 149 | #define CONFIG_SETUP_MEMORY_TAGS |
| 150 | #define CONFIG_BOOTDELAY 3 |
| 151 | #define CONFIG_BOOTFILE "fitImage" |
| 152 | #define CONFIG_BOOTARGS "console=ttyS3,115200" |
| 153 | #define CONFIG_LOADADDR 0x20800000 |
| 154 | #define CONFIG_BOOTCOMMAND "run mmc_mmc" |
| 155 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 156 | #define CONFIG_OF_LIBFDT |
| 157 | |
| 158 | /* |
| 159 | * Extra Environments |
| 160 | */ |
| 161 | #define CONFIG_PREBOOT "run try_bootscript" |
| 162 | #define CONFIG_HOSTNAME ma5d4evk |
| 163 | |
| 164 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 165 | "consdev=ttyS3\0" \ |
| 166 | "baudrate=115200\0" \ |
| 167 | "bootscript=boot.scr\0" \ |
| 168 | "bootdev=/dev/mmcblk1p1\0" \ |
| 169 | "bootpart=1:1\0" \ |
| 170 | "rootdev=/dev/mmcblk1p2\0" \ |
| 171 | "netdev=eth0\0" \ |
| 172 | "kernel_addr_r=0x22000000\0" \ |
| 173 | "update_spi_firmware_spl_addr=0x21000000\0" \ |
| 174 | "update_spi_firmware_spl_filename=boot.bin\0" \ |
| 175 | "update_spi_firmware_addr=0x22000000\0" \ |
| 176 | "update_spi_firmware_filename=u-boot.img\0" \ |
| 177 | "update_spi_firmware=" /* Update the SPI flash firmware */ \ |
| 178 | "if sf probe ; then " \ |
| 179 | "if tftp ${update_spi_firmware_spl_addr} " \ |
| 180 | "${update_spi_firmware_spl_filename} ; then " \ |
| 181 | "setenv update_spi_firmware_spl_filesize ${filesize} ; "\ |
| 182 | "if tftp ${update_spi_firmware_addr} " \ |
| 183 | "${update_spi_firmware_filename} ; then " \ |
| 184 | "setenv update_spi_firmware_filesize ${filesize} ; " \ |
| 185 | "sf update ${update_spi_firmware_spl_addr} 0x0 " \ |
| 186 | "${update_spi_firmware_spl_filesize} ; " \ |
| 187 | "sf update ${update_spi_firmware_addr} 0x10000 " \ |
| 188 | "${update_spi_firmware_filesize} ; " \ |
| 189 | "fi ; " \ |
| 190 | "fi ; " \ |
| 191 | "fi\0" \ |
| 192 | "addcons=" \ |
| 193 | "setenv bootargs ${bootargs} " \ |
| 194 | "console=${consdev},${baudrate}\0" \ |
| 195 | "addip=" \ |
| 196 | "setenv bootargs ${bootargs} " \ |
| 197 | "ip=${ipaddr}:${serverip}:${gatewayip}:" \ |
| 198 | "${netmask}:${hostname}:${netdev}:off\0" \ |
| 199 | "addmisc=" \ |
| 200 | "setenv bootargs ${bootargs} ${miscargs}\0" \ |
| 201 | "addargs=run addcons addmisc\0" \ |
| 202 | "mmcload=" \ |
| 203 | "mmc rescan ; " \ |
| 204 | "load mmc ${bootpart} ${kernel_addr_r} ${bootfile}\0" \ |
| 205 | "netload=" \ |
| 206 | "tftp ${kernel_addr_r} ${hostname}/${bootfile}\0" \ |
| 207 | "miscargs=nohlt panic=1\0" \ |
| 208 | "mmcargs=setenv bootargs root=${rootdev} rw rootwait\0" \ |
| 209 | "nfsargs=" \ |
| 210 | "setenv bootargs root=/dev/nfs rw " \ |
| 211 | "nfsroot=${serverip}:${rootpath},v3,tcp\0" \ |
| 212 | "mmc_mmc=" \ |
| 213 | "run mmcload mmcargs addargs ; " \ |
| 214 | "bootm ${kernel_addr_r}\0" \ |
| 215 | "mmc_nfs=" \ |
| 216 | "run mmcload nfsargs addip addargs ; " \ |
| 217 | "bootm ${kernel_addr_r}\0" \ |
| 218 | "net_mmc=" \ |
| 219 | "run netload mmcargs addargs ; " \ |
| 220 | "bootm ${kernel_addr_r}\0" \ |
| 221 | "net_nfs=" \ |
| 222 | "run netload nfsargs addip addargs ; " \ |
| 223 | "bootm ${kernel_addr_r}\0" \ |
| 224 | "try_bootscript=" \ |
| 225 | "mmc rescan;" \ |
| 226 | "if test -e mmc ${bootpart} ${bootscript} ; then " \ |
| 227 | "if load mmc ${bootpart} ${kernel_addr_r} ${bootscript};"\ |
| 228 | "then ; " \ |
| 229 | "echo Running bootscript... ; " \ |
| 230 | "source ${kernel_addr_r} ; " \ |
| 231 | "fi ; " \ |
| 232 | "fi\0" |
| 233 | /* SPL */ |
| 234 | #define CONFIG_SPL_FRAMEWORK |
| 235 | #define CONFIG_SPL_TEXT_BASE 0x200000 |
| 236 | #define CONFIG_SPL_MAX_SIZE 0x10000 |
| 237 | #define CONFIG_SPL_BSS_START_ADDR 0x20000000 |
| 238 | #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 |
| 239 | #define CONFIG_SYS_SPL_MALLOC_START 0x20080000 |
| 240 | #define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 |
| 241 | |
| 242 | #define CONFIG_SPL_LIBCOMMON_SUPPORT |
| 243 | #define CONFIG_SPL_LIBGENERIC_SUPPORT |
| 244 | #define CONFIG_SPL_GPIO_SUPPORT |
| 245 | #define CONFIG_SPL_SERIAL_SUPPORT |
| 246 | |
| 247 | #define CONFIG_SPL_BOARD_INIT |
| 248 | #define CONFIG_SYS_MONITOR_LEN (512 << 10) |
| 249 | |
| 250 | #define CONFIG_SPL_SPI_SUPPORT |
| 251 | #define CONFIG_SPL_SPI_FLASH_SUPPORT |
| 252 | #define CONFIG_SPL_SPI_LOAD |
| 253 | #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x10000 |
| 254 | |
| 255 | #endif /* __MA5D4EVK_CONFIG_H__ */ |