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