
Hi Bo,
On 12/02/2013 04:24 AM, Bo Shen wrote:
Add SPI SPL boot support for sama5d3xek board.
Signed-off-by: Bo Shen voice.shen@atmel.com
arch/arm/cpu/at91-common/spl.c | 2 ++ arch/arm/include/asm/arch-at91/spl.h | 2 ++ board/atmel/sama5d3xek/sama5d3xek.c | 2 ++ include/configs/sama5d3xek.h | 11 +++++++++++ 4 files changed, 17 insertions(+)
diff --git a/arch/arm/cpu/at91-common/spl.c b/arch/arm/cpu/at91-common/spl.c index 37c0cc4..2598e09 100644 --- a/arch/arm/cpu/at91-common/spl.c +++ b/arch/arm/cpu/at91-common/spl.c @@ -52,6 +52,8 @@ u32 spl_boot_device(void) { #ifdef CONFIG_SYS_USE_MMC return BOOT_DEVICE_MMC1; +#elif CONFIG_SYS_USE_SERIALFLASH
- return BOOT_DEVICE_SPI;
#endif return BOOT_DEVICE_NONE; }
I'm not really happy with this solution. We will get a ifdef-nightmare here for each specific SPL implementation.
Could you please check with your ROM developers if there is some way to get the boot source? I know Ti guys have implemented some function parameter to tell that to the next running code in ROM. I can't believe Atmel has nothing comparable. The last resort could be to add some proprietary parameter to the SPL that we could read then and return the correct value in spl_boot_device() depending on that that stored value ... quite ugly but I think it is better than clutter this place with a lot of ifdef's.
Another solution could be to move this function to board code.
Any other suggestions?
Best regards
Andreas Bießmann