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