public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] arm: atmel: sama5d3: add spi spl boot support
Date: Tue, 10 Dec 2013 09:51:00 +0800	[thread overview]
Message-ID: <52A67384.5020003@atmel.com> (raw)
In-Reply-To: <52A59B4E.10409@gmail.com>

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@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

  reply	other threads:[~2013-12-10  1:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02  3:24 [U-Boot] [PATCH 0/3] arm: atmel: sama5d3: add spi and nand spl boot support Bo Shen
2013-12-02  3:24 ` [U-Boot] [PATCH 1/3] arm: atmel: sama5d3: add spi " Bo Shen
2013-12-09 10:28   ` Andreas Bießmann
2013-12-10  1:51     ` Bo Shen [this message]
2013-12-02  3:24 ` [U-Boot] [PATCH 2/3] mtd: nand: atmel: prepare for nand " Bo Shen
2014-02-28  0:35   ` Scott Wood
2014-03-03  2:41     ` Bo Shen
2014-03-03  5:07       ` Bo Shen
2013-12-02  3:24 ` [U-Boot] [PATCH 3/3] arm: atmel: sama5d3: add " Bo Shen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52A67384.5020003@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox