[U-Boot] [PATCH] imx_common: check for Serial Downloader in spl_boot_device

Stefano Babic sbabic at denx.de
Mon Dec 7 15:24:36 CET 2015


Hi Eric,

On 07/12/2015 15:08, Eric Nelson wrote:

>> I agree with you, in fact it does not work  - but I do not see a way to
>> inform the ROM that next time it should run with USB as boot device.
>> From the fusemap, I tried to set BOOT_CFG4 as 0x40 ("Reserved for serial
>> ROM"), and fixing BOOT_CFG1 to 0x30, but it was only a try. In fact, we
>> need to change BMODE from internal to serial, and I do not see a way in
>> the "official" documentation.
>>
> 
> It doesn't help that all of this is undocumented :), but reverse-
> engineering the bmode command

:-)

> 
> The "bmode usb" command sets gpr9 to 1, which isn't used for anything
> else, so something like this will work:
> 
> diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c
> index 28217d2..54f22e6 100644
> --- a/arch/arm/imx-common/spl.c
> +++ b/arch/arm/imx-common/spl.c
> @@ -26,8 +26,10 @@ u32 spl_boot_device(void)
>          * Check for BMODE if serial downloader is enabled
>          * BOOT_MODE - see IMX6DQRM Table 8-1
>          */
> -       if ((bmode >> 24) == 0x01) /* Serial Downloader */
> +       if (((bmode >> 24) == 0x01) /* Serial Downloader */
> +           || (gpr10_boot && (1 == reg)))
>                 return BOOT_DEVICE_UART;
> 
> AFAIK, there isn't any other way to get a value of 1 into GPR9,
> so the test is safe.
> 

This is a nice trick - I cannot see as well any combination for
obtaining a 0x01 in GPR9.

> Secondarily, since the low four bits are discarded in the switch(),
> this prevents an almost-always-wrong interpretation of 1 as
> OneNAND/NOR (I think there are very few if any i.MX6 boards using
> OneNAND or NOR for boot).

Agree.

I add your proposal in V2, thanks !

Best regards,
Stefano



-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================


More information about the U-Boot mailing list