[U-Boot] [PATCH] arm: zynq: Add compile time boot mode override

Michal Simek michal.simek at xilinx.com
Thu Aug 28 14:57:40 CEST 2014


On 08/28/2014 02:51 PM, Peter Crosthwaite wrote:
> On Thu, Aug 28, 2014 at 9:58 PM, Michal Simek <michal.simek at xilinx.com> wrote:
>> On 08/28/2014 01:02 PM, Peter Crosthwaite wrote:
>>> Ping!
>>>
>>> On Wed, Aug 20, 2014 at 10:14 PM, Peter Crosthwaite
>>> <crosthwaitepeter at gmail.com> wrote:
>>>> To better enable debug of u-boot itself (in particular SPL). To debug
>>>> u-boot you want to put your board in JTAG boot mode for quick recompile
>>>> and elf downloads via the JTAG debugger. Yet you may still want to boot
>>>> from a persistent storage media (SD or QSPI). Allow override of the
>>>> boot mode pins to facilitate this.
>>>>
>>>> Signed-off-by: Peter Crosthwaite <crosthwaite.peter at gmail.com>
>>>> ---
>>>>  arch/arm/cpu/armv7/zynq/slcr.c | 4 ++++
>>>>  doc/README.zynq                | 6 ++++++
>>>>  2 files changed, 10 insertions(+)
>>>>
>>>> diff --git a/arch/arm/cpu/armv7/zynq/slcr.c b/arch/arm/cpu/armv7/zynq/slcr.c
>>>> index 934ccc3..26e02b8 100644
>>>> --- a/arch/arm/cpu/armv7/zynq/slcr.c
>>>> +++ b/arch/arm/cpu/armv7/zynq/slcr.c
>>>> @@ -155,8 +155,12 @@ void zynq_slcr_devcfg_enable(void)
>>>>
>>>>  u32 zynq_slcr_get_boot_mode(void)
>>>>  {
>>>> +#ifdef CONFIG_ZYNQ_BM_FORCE
>>>> +       return CONFIG_ZYNQ_BM_FORCE;
>>>> +#else
>>>>         /* Get the bootmode register value */
>>>>         return readl(&slcr_base->boot_mode);
>>>> +#endif
>>>>  }
>>>>
>>>>  u32 zynq_slcr_get_idcode(void)
>>>> diff --git a/doc/README.zynq b/doc/README.zynq
>>>> index 043c970..70be7ae 100644
>>>> --- a/doc/README.zynq
>>>> +++ b/doc/README.zynq
>>>> @@ -52,6 +52,12 @@ board_late_init() will read the bootmode values using slcr bootmode register
>>>>  at runtime and assign the modeboot variable to specific bootmode string which
>>>>  is intern used in autoboot.
>>>>
>>>> +This value can be overridden at compile time with the define
>>>> +CONFIG_ZYNQ_BM_FORCE. This is useful for debugging a u-boot elf downloaded
>>>> +over JTAG. E.g. The board will be jumpered for ZYNQ_BM_JTAG, but you can
>>>> +force u-boot to attempt an SD or QSPI boot should that be what you want to
>>>> +debug.
>>>> +
>>
>> I understand the purpose of this patch but I don't think it is useful to add and support this option.
>> Someone else could come with reading GPIO for this purpose, etc which is just the same case.
>>
>> I am happy to add the patch which shows bootmode register content or any ? : logic around
>> in debug() print but adding new CONFIG_ option is just too much.
>> (Also every new config option should be properly documented).
>>
> 
> I'm not sure what this adds? Where does the debug print get involved?

I expect when you start to debug things the first thing you do is #define DEBUG which
convert all debug() to printf() and you can see more verbose logs. From that logs you
will see what SPL does and having one log about choosing boot mode can be helpful.

> 
>> The second option is to setup spl_boot_device in arch zynq as weak function and overwrite it.
>> Then you can setup whatever you like in your board file.
>>
> 
> Sounds like the winning compromise.

Great. Please send the patch for it.

Thanks,
Michal

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140828/124b80be/attachment.pgp>


More information about the U-Boot mailing list