From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_Bie=DFmann?= Date: Mon, 09 Dec 2013 11:28:30 +0100 Subject: [U-Boot] [PATCH 1/3] arm: atmel: sama5d3: add spi spl boot support In-Reply-To: <1385954663-7682-2-git-send-email-voice.shen@atmel.com> References: <1385954663-7682-1-git-send-email-voice.shen@atmel.com> <1385954663-7682-2-git-send-email-voice.shen@atmel.com> Message-ID: <52A59B4E.10409@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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