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