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

Peter Crosthwaite crosthwaitepeter at gmail.com
Thu Aug 28 14:54:54 CEST 2014


On Thu, Aug 28, 2014 at 10:05 PM, Jagan Teki <jagannadh.teki at gmail.com> wrote:
> On 28 August 2014 17:28, 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).
>>
>> 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.
>
> Agreed with Michal, this looks hack to macro, where u can get
> different elf for with and without that macro.
>
> May be we can add one env like "zynq_bm_force" on ENV_SETTINGS of our
> board file for
> selecting the respective bootmode at runtime.
>

That might help for the fuller versions of u-boot but im trying for a
super lightweight SPL (less than 64k for all sections, hopefully 32k)
so the goal was to have all env parsing code paths removed.

Regards,
Peter

> thanks!
> --
> Jagan.


More information about the U-Boot mailing list