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