[U-Boot] [PATCH 1/3] arm: atmel: sama5d3: add spi spl boot support
Bo Shen
voice.shen at atmel.com
Tue Dec 10 02:51:00 CET 2013
Hi Andreas,
On 12/09/2013 06:28 PM, Andreas Bießmann wrote:
> 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 at 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.
Unfortunately, we don't have this mechanism.
The BootRom has a boot sequence, detect one by one. More information
please reference sama5d3 datasheet on page 65, figure 12-2. NVM
Bootloader Sequence Diagram.
http://www.atmel.com/images/atmel_11121_32-bit-cortex-a5-microcontroller_sama5d3_datasheet.pdf
> 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.
As the most Atmel SoC based boards support some of these boot mode, so
it can keep minimal code for these boards. So, if we move this to board
code, I think every should copy this code.
> Any other suggestions?
>
> Best regards
>
> Andreas Bießmann
>
Best Regards,
Bo Shen
More information about the U-Boot
mailing list