Commit 8a45b0ba87649b1bad459fb235a843f5588a8251

Authored by Bo Shen
Committed by Andreas Bießmann
1 parent 7ca6f36325

arm: atmel: sama5d3: add spi spl boot support

Add SPI SPL boot support for sama5d3xek board.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>

Showing 4 changed files with 17 additions and 0 deletions Side-by-side Diff

arch/arm/cpu/at91-common/spl.c
... ... @@ -52,6 +52,8 @@
52 52 {
53 53 #ifdef CONFIG_SYS_USE_MMC
54 54 return BOOT_DEVICE_MMC1;
  55 +#elif CONFIG_SYS_USE_SERIALFLASH
  56 + return BOOT_DEVICE_SPI;
55 57 #endif
56 58 return BOOT_DEVICE_NONE;
57 59 }
arch/arm/include/asm/arch-at91/spl.h
... ... @@ -14,6 +14,8 @@
14 14 BOOT_DEVICE_MMC1,
15 15 BOOT_DEVICE_MMC2,
16 16 BOOT_DEVICE_MMC2_2,
  17 +#elif CONFIG_SYS_USE_SERIALFLASH
  18 + BOOT_DEVICE_SPI,
17 19 #endif
18 20 };
19 21  
board/atmel/sama5d3xek/sama5d3xek.c
... ... @@ -307,6 +307,8 @@
307 307 {
308 308 #ifdef CONFIG_SYS_USE_MMC
309 309 sama5d3xek_mci_hw_init();
  310 +#elif CONFIG_SYS_USE_SERIALFLASH
  311 + at91_spi0_hw_init(1 << 0);
310 312 #endif
311 313 }
312 314  
include/configs/sama5d3xek.h
... ... @@ -258,6 +258,8 @@
258 258 #define CONFIG_SPL_SERIAL_SUPPORT
259 259  
260 260 #define CONFIG_SPL_BOARD_INIT
  261 +#define CONFIG_SYS_MONITOR_LEN (512 << 10)
  262 +
261 263 #ifdef CONFIG_SYS_USE_MMC
262 264 #define CONFIG_SPL_LDSCRIPT arch/arm/cpu/at91-common/u-boot-spl.lds
263 265 #define CONFIG_SPL_MMC_SUPPORT
... ... @@ -267,6 +269,15 @@
267 269 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
268 270 #define CONFIG_SPL_FAT_SUPPORT
269 271 #define CONFIG_SPL_LIBDISK_SUPPORT
  272 +
  273 +#elif CONFIG_SYS_USE_SERIALFLASH
  274 +#define CONFIG_SPL_SPI_SUPPORT
  275 +#define CONFIG_SPL_SPI_FLASH_SUPPORT
  276 +#define CONFIG_SPL_SPI_LOAD
  277 +#define CONFIG_SPL_SPI_BUS 0
  278 +#define CONFIG_SPL_SPI_CS 0
  279 +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8400
  280 +
270 281 #endif
271 282  
272 283 #endif