diff mbox

[U-Boot] imx: mx6ull: fix USB bmode for i.MX 6UL and 6ULL

Message ID 20170609201312.9878-1-stefan@agner.ch
State Accepted
Commit 3fd9579085fae691760486f595b9eda228bfc656
Delegated to: Stefano Babic
Headers show

Commit Message

Stefan Agner June 9, 2017, 8:13 p.m. UTC
From: Stefan Agner <stefan.agner@toradex.com>

i.MX 6UL and 6ULL have different boot device capabilities and
use therefor use a different boot device selection table than
other i.MX 6 devices. Particularly, the value which has been
used so far (b0001) is assigned to QSPI boot for these two
devices.

There is no common reserved value for all i.MX 6devices. Use
b0010 for i.MX 6UL and 6ULL via compile time ifdef.

Reported-by: Joël Esponde <joel.esponde@honeywell.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
---
 arch/arm/cpu/armv7/mx6/soc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Fabio Estevam June 9, 2017, 10:09 p.m. UTC | #1
On Fri, Jun 9, 2017 at 5:13 PM, Stefan Agner <stefan@agner.ch> wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
>
> i.MX 6UL and 6ULL have different boot device capabilities and
> use therefor use a different boot device selection table than
> other i.MX 6 devices. Particularly, the value which has been
> used so far (b0001) is assigned to QSPI boot for these two
> devices.
>
> There is no common reserved value for all i.MX 6devices. Use
> b0010 for i.MX 6UL and 6ULL via compile time ifdef.
>
> Reported-by: Joël Esponde <joel.esponde@honeywell.com>
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>

Thanks for the patch.

Joël, could you please test it and reply with your Tested-by?

Thanks
Fabio Estevam June 9, 2017, 10:52 p.m. UTC | #2
On Fri, Jun 9, 2017 at 5:13 PM, Stefan Agner <stefan@agner.ch> wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
>
> i.MX 6UL and 6ULL have different boot device capabilities and
> use therefor use a different boot device selection table than
> other i.MX 6 devices. Particularly, the value which has been
> used so far (b0001) is assigned to QSPI boot for these two
> devices.
>
> There is no common reserved value for all i.MX 6devices. Use
> b0010 for i.MX 6UL and 6ULL via compile time ifdef.
>
> Reported-by: Joël Esponde <joel.esponde@honeywell.com>
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Joël Esponde June 12, 2017, 8:51 a.m. UTC | #3
Hi Stefan,

Why did you take the value 0x20 in the table entry instead of the value 0x00 as it is, for example, in the NXP U-Boot?

Is it because this boot mode does not exist in the iMX6UL SOC?

Joël Esponde
Honeywell | Safety and Productivity Solutions

> -----Message d'origine-----

> De : Fabio Estevam [mailto:festevam@gmail.com]

> Envoyé : samedi 10 juin 2017 00:10

> À : Stefan Agner <stefan@agner.ch>; Esponde, Joel

> <Joel.Esponde@Honeywell.com>

> Cc : Stefano Babic <sbabic@denx.de>; Fabio Estevam

> <fabio.estevam@nxp.com>; Stefan Agner <stefan.agner@toradex.com>; U-

> Boot-Denx <u-boot@lists.denx.de>

> Objet : Re: [U-Boot] [PATCH] imx: mx6ull: fix USB bmode for i.MX 6UL and

> 6ULL

> 

> On Fri, Jun 9, 2017 at 5:13 PM, Stefan Agner <stefan@agner.ch> wrote:

> > From: Stefan Agner <stefan.agner@toradex.com>

> >

> > i.MX 6UL and 6ULL have different boot device capabilities and use

> > therefor use a different boot device selection table than other i.MX 6

> > devices. Particularly, the value which has been used so far (b0001) is

> > assigned to QSPI boot for these two devices.

> >

> > There is no common reserved value for all i.MX 6devices. Use

> > b0010 for i.MX 6UL and 6ULL via compile time ifdef.

> >

> > Reported-by: Joël Esponde <joel.esponde@honeywell.com>

> > Signed-off-by: Stefan Agner <stefan.agner@toradex.com>

> 

> Thanks for the patch.

> 

> Joël, could you please test it and reply with your Tested-by?

> 

> Thanks
Joël Esponde June 12, 2017, 3:27 p.m. UTC | #4
> -----Message d'origine-----

> De : Fabio Estevam [mailto:festevam@gmail.com]

> Envoyé : samedi 10 juin 2017 00:10

> À : Stefan Agner <stefan@agner.ch>; Esponde, Joel

> <Joel.Esponde@Honeywell.com>

> Cc : Stefano Babic <sbabic@denx.de>; Fabio Estevam

> <fabio.estevam@nxp.com>; Stefan Agner <stefan.agner@toradex.com>; U-

> Boot-Denx <u-boot@lists.denx.de>

> Objet : Re: [U-Boot] [PATCH] imx: mx6ull: fix USB bmode for i.MX 6UL and

> 6ULL

> 

> On Fri, Jun 9, 2017 at 5:13 PM, Stefan Agner <stefan@agner.ch> wrote:

> > From: Stefan Agner <stefan.agner@toradex.com>

> >

> > i.MX 6UL and 6ULL have different boot device capabilities and use

> > therefor use a different boot device selection table than other i.MX 6

> > devices. Particularly, the value which has been used so far (b0001) is

> > assigned to QSPI boot for these two devices.

> >

> > There is no common reserved value for all i.MX 6devices. Use

> > b0010 for i.MX 6UL and 6ULL via compile time ifdef.

> >

> > Reported-by: Joël Esponde <joel.esponde@honeywell.com>

> > Signed-off-by: Stefan Agner <stefan.agner@toradex.com>

> 

> Thanks for the patch.

> 

> Joël, could you please test it and reply with your Tested-by?

> 

> Thanks


Tested-by: Joël Esponde <joel.esponde@honeywell.com>


PS: I tested the patch with an iMX6UL and a QSPI flash.
Stefan Agner June 13, 2017, 2:26 a.m. UTC | #5
On 2017-06-12 01:51, Esponde, Joel wrote:
> Hi Stefan,
> 
> Why did you take the value 0x20 in the table entry instead of the
> value 0x00 as it is, for example, in the NXP U-Boot?

0x00 would mean b0000, which is WEIM (OneNAND/NOR flash, which is
probably a likely boot device).

0x20 is no defined boot device, and since it works, it will make sure
that bmode usb works for all users of i.MX 6UL/ULL...

--
Stefan

> 
> Is it because this boot mode does not exist in the iMX6UL SOC?
> 
> Joël Esponde
> Honeywell | Safety and Productivity Solutions
> 
>> -----Message d'origine-----
>> De : Fabio Estevam [mailto:festevam@gmail.com]
>> Envoyé : samedi 10 juin 2017 00:10
>> À : Stefan Agner <stefan@agner.ch>; Esponde, Joel
>> <Joel.Esponde@Honeywell.com>
>> Cc : Stefano Babic <sbabic@denx.de>; Fabio Estevam
>> <fabio.estevam@nxp.com>; Stefan Agner <stefan.agner@toradex.com>; U-
>> Boot-Denx <u-boot@lists.denx.de>
>> Objet : Re: [U-Boot] [PATCH] imx: mx6ull: fix USB bmode for i.MX 6UL and
>> 6ULL
>>
>> On Fri, Jun 9, 2017 at 5:13 PM, Stefan Agner <stefan@agner.ch> wrote:
>> > From: Stefan Agner <stefan.agner@toradex.com>
>> >
>> > i.MX 6UL and 6ULL have different boot device capabilities and use
>> > therefor use a different boot device selection table than other i.MX 6
>> > devices. Particularly, the value which has been used so far (b0001) is
>> > assigned to QSPI boot for these two devices.
>> >
>> > There is no common reserved value for all i.MX 6devices. Use
>> > b0010 for i.MX 6UL and 6ULL via compile time ifdef.
>> >
>> > Reported-by: Joël Esponde <joel.esponde@honeywell.com>
>> > Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
>>
>> Thanks for the patch.
>>
>> Joël, could you please test it and reply with your Tested-by?
>>
>> Thanks
Stefano Babic June 29, 2017, 8:25 a.m. UTC | #6
On 09/06/2017 22:13, Stefan Agner wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
> 
> i.MX 6UL and 6ULL have different boot device capabilities and
> use therefor use a different boot device selection table than
> other i.MX 6 devices. Particularly, the value which has been
> used so far (b0001) is assigned to QSPI boot for these two
> devices.
> 
> There is no common reserved value for all i.MX 6devices. Use
> b0010 for i.MX 6UL and 6ULL via compile time ifdef.
> 
> Reported-by: Joël Esponde <joel.esponde@honeywell.com>
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> ---
>  arch/arm/cpu/armv7/mx6/soc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
> index dd94797514..9416bb8947 100644
> --- a/arch/arm/cpu/armv7/mx6/soc.c
> +++ b/arch/arm/cpu/armv7/mx6/soc.c
> @@ -548,7 +548,11 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
>  const struct boot_mode soc_boot_modes[] = {
>  	{"normal",	MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
>  	/* reserved value should start rom usb */
> +#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
> +	{"usb",		MAKE_CFGVAL(0x20, 0x00, 0x00, 0x00)},
> +#else
>  	{"usb",		MAKE_CFGVAL(0x10, 0x00, 0x00, 0x00)},
> +#endif
>  	{"sata",	MAKE_CFGVAL(0x20, 0x00, 0x00, 0x00)},
>  	{"ecspi1:0",	MAKE_CFGVAL(0x30, 0x00, 0x00, 0x08)},
>  	{"ecspi1:1",	MAKE_CFGVAL(0x30, 0x00, 0x00, 0x18)},
> 

Applied to u-boot-imx, -next, thanks !

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index dd94797514..9416bb8947 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -548,7 +548,11 @@  void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
 const struct boot_mode soc_boot_modes[] = {
 	{"normal",	MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
 	/* reserved value should start rom usb */
+#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
+	{"usb",		MAKE_CFGVAL(0x20, 0x00, 0x00, 0x00)},
+#else
 	{"usb",		MAKE_CFGVAL(0x10, 0x00, 0x00, 0x00)},
+#endif
 	{"sata",	MAKE_CFGVAL(0x20, 0x00, 0x00, 0x00)},
 	{"ecspi1:0",	MAKE_CFGVAL(0x30, 0x00, 0x00, 0x08)},
 	{"ecspi1:1",	MAKE_CFGVAL(0x30, 0x00, 0x00, 0x18)},