diff mbox

[U-Boot,v1,1/2] imx: fix USB boot mode detection for i.MX 6UL and 6ULL

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

Commit Message

Stefan Agner Aug. 16, 2017, 12:49 a.m. UTC
From: Stefan Agner <stefan.agner@toradex.com>

Add the reserved boot mode used in the bmode command for i.MX 6UL
and 6ULL as introduced in commit 3fd9579085fa ("imx: mx6ull: fix USB
bmode for i.MX 6UL and 6ULL").

Also replace BMODE_UART with BMODE_RESERVED, which is more appropriate.
Commit 96aac843b68d ("imx: Use IMX6_BMODE_* macros instead of numericals")
added macros for boot modes, in the process the reserved boot mode got
named BMODE_UART. We use the reserved boot mode in the bmode command to
let the boot ROM enter serial downloader recovery mode. But this is only
a side effect, the actual boot mode is reserved...

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
---
Afaik there is no board yet using SPL on 6UL/ULL...

 arch/arm/include/asm/mach-imx/sys_proto.h | 7 ++++++-
 arch/arm/mach-imx/spl.c                   | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

Comments

Stefano Babic Aug. 25, 2017, 11:32 a.m. UTC | #1
On 16/08/2017 02:49, Stefan Agner wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
> 
> Add the reserved boot mode used in the bmode command for i.MX 6UL
> and 6ULL as introduced in commit 3fd9579085fa ("imx: mx6ull: fix USB
> bmode for i.MX 6UL and 6ULL").
> 
> Also replace BMODE_UART with BMODE_RESERVED, which is more appropriate.
> Commit 96aac843b68d ("imx: Use IMX6_BMODE_* macros instead of numericals")
> added macros for boot modes, in the process the reserved boot mode got
> named BMODE_UART. We use the reserved boot mode in the bmode command to
> let the boot ROM enter serial downloader recovery mode. But this is only
> a side effect, the actual boot mode is reserved...
> 
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> ---
> Afaik there is no board yet using SPL on 6UL/ULL...

Not yet...

> 
>  arch/arm/include/asm/mach-imx/sys_proto.h | 7 ++++++-
>  arch/arm/mach-imx/spl.c                   | 2 +-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
> index 046df6291a..d94c095118 100644
> --- a/arch/arm/include/asm/mach-imx/sys_proto.h
> +++ b/arch/arm/include/asm/mach-imx/sys_proto.h
> @@ -69,8 +69,13 @@ enum imx6_bmode_emi {
>  
>  enum imx6_bmode {
>  	IMX6_BMODE_EMI,
> -	IMX6_BMODE_UART,
> +#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
> +	IMX6_BMODE_QSPI,
> +	IMX6_BMODE_RESERVED,
> +#else
> +	IMX6_BMODE_RESERVED,
>  	IMX6_BMODE_SATA,
> +#endif
>  	IMX6_BMODE_SERIAL_ROM,
>  	IMX6_BMODE_SD,
>  	IMX6_BMODE_ESD,
> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> index 75698c48ea..836b334fa9 100644
> --- a/arch/arm/mach-imx/spl.c
> +++ b/arch/arm/mach-imx/spl.c
> @@ -42,7 +42,7 @@ u32 spl_boot_device(void)
>  		break;
>  		}
>  	/* Reserved: Used to force Serial Downloader */
> -	case IMX6_BMODE_UART:
> +	case IMX6_BMODE_RESERVED:
>  		return BOOT_DEVICE_UART;
>  	/* SATA: See 8.5.4, Table 8-20 */
>  	case IMX6_BMODE_SATA:
> 

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

Best regards,
Stefano Babic
Sébastien Szymanski Aug. 26, 2017, 7:28 a.m. UTC | #2
Hello,

> 
> On 25 Aug 2017, at 13:32, Stefano Babic <sbabic@denx.de> wrote:
> 
> On 16/08/2017 02:49, Stefan Agner wrote:
>> From: Stefan Agner <stefan.agner@toradex.com>
>> 
>> Add the reserved boot mode used in the bmode command for i.MX 6UL
>> and 6ULL as introduced in commit 3fd9579085fa ("imx: mx6ull: fix USB
>> bmode for i.MX 6UL and 6ULL").
>> 
>> Also replace BMODE_UART with BMODE_RESERVED, which is more appropriate.
>> Commit 96aac843b68d ("imx: Use IMX6_BMODE_* macros instead of numericals")
>> added macros for boot modes, in the process the reserved boot mode got
>> named BMODE_UART. We use the reserved boot mode in the bmode command to
>> let the boot ROM enter serial downloader recovery mode. But this is only
>> a side effect, the actual boot mode is reserved...
>> 
>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
>> ---
>> Afaik there is no board yet using SPL on 6UL/ULL...
> 
> Not yet…

?

There are boards in the tree using SPL on i.MX6UL. OPOS6UL is one of them.

Regards,
Sébastien Szymanski

> 
>> 
>> arch/arm/include/asm/mach-imx/sys_proto.h | 7 ++++++-
>> arch/arm/mach-imx/spl.c                   | 2 +-
>> 2 files changed, 7 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
>> index 046df6291a..d94c095118 100644
>> --- a/arch/arm/include/asm/mach-imx/sys_proto.h
>> +++ b/arch/arm/include/asm/mach-imx/sys_proto.h
>> @@ -69,8 +69,13 @@ enum imx6_bmode_emi {
>> 
>> enum imx6_bmode {
>> 	IMX6_BMODE_EMI,
>> -	IMX6_BMODE_UART,
>> +#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
>> +	IMX6_BMODE_QSPI,
>> +	IMX6_BMODE_RESERVED,
>> +#else
>> +	IMX6_BMODE_RESERVED,
>> 	IMX6_BMODE_SATA,
>> +#endif
>> 	IMX6_BMODE_SERIAL_ROM,
>> 	IMX6_BMODE_SD,
>> 	IMX6_BMODE_ESD,
>> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
>> index 75698c48ea..836b334fa9 100644
>> --- a/arch/arm/mach-imx/spl.c
>> +++ b/arch/arm/mach-imx/spl.c
>> @@ -42,7 +42,7 @@ u32 spl_boot_device(void)
>> 		break;
>> 		}
>> 	/* Reserved: Used to force Serial Downloader */
>> -	case IMX6_BMODE_UART:
>> +	case IMX6_BMODE_RESERVED:
>> 		return BOOT_DEVICE_UART;
>> 	/* SATA: See 8.5.4, Table 8-20 */
>> 	case IMX6_BMODE_SATA:
>> 
> 
> Applied to u-boot-imx, -master, thanks !
> 
> Best regards,
> Stefano Babic
> 
> 
> -- 
> =====================================================================
> 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@denx.de
> =====================================================================
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Jagan Teki Aug. 26, 2017, 7:31 a.m. UTC | #3
On Sat, Aug 26, 2017 at 12:58 PM, Sébastien Szymanski
<sebastien.szymanski@armadeus.com> wrote:
> Hello,
>
>>
>> On 25 Aug 2017, at 13:32, Stefano Babic <sbabic@denx.de> wrote:
>>
>> On 16/08/2017 02:49, Stefan Agner wrote:
>>> From: Stefan Agner <stefan.agner@toradex.com>
>>>
>>> Add the reserved boot mode used in the bmode command for i.MX 6UL
>>> and 6ULL as introduced in commit 3fd9579085fa ("imx: mx6ull: fix USB
>>> bmode for i.MX 6UL and 6ULL").
>>>
>>> Also replace BMODE_UART with BMODE_RESERVED, which is more appropriate.
>>> Commit 96aac843b68d ("imx: Use IMX6_BMODE_* macros instead of numericals")
>>> added macros for boot modes, in the process the reserved boot mode got
>>> named BMODE_UART. We use the reserved boot mode in the bmode command to
>>> let the boot ROM enter serial downloader recovery mode. But this is only
>>> a side effect, the actual boot mode is reserved...
>>>
>>> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
>>> ---
>>> Afaik there is no board yet using SPL on 6UL/ULL...
>>
>> Not yet…
>
> ?
>
> There are boards in the tree using SPL on i.MX6UL. OPOS6UL is one of them.

Engicam GEAM6 and IS.IoT uses SPL both are i.MX6UL
Stefano Babic Aug. 29, 2017, 8:11 a.m. UTC | #4
Hi Stefan,

On 16/08/2017 02:49, Stefan Agner wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
> 
> Add the reserved boot mode used in the bmode command for i.MX 6UL
> and 6ULL as introduced in commit 3fd9579085fa ("imx: mx6ull: fix USB
> bmode for i.MX 6UL and 6ULL").
> 
> Also replace BMODE_UART with BMODE_RESERVED, which is more appropriate.
> Commit 96aac843b68d ("imx: Use IMX6_BMODE_* macros instead of numericals")
> added macros for boot modes, in the process the reserved boot mode got
> named BMODE_UART. We use the reserved boot mode in the bmode command to
> let the boot ROM enter serial downloader recovery mode. But this is only
> a side effect, the actual boot mode is reserved...
> 
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> ---

I applied it, but it breaks due the #ifdef in sys_proto.h that hides
some symbols as IMX6_BMODE_SATA. Could you take a look before I send my
PR to Tom ?

Thanks,
Stefano

> Afaik there is no board yet using SPL on 6UL/ULL...
> 
>  arch/arm/include/asm/mach-imx/sys_proto.h | 7 ++++++-
>  arch/arm/mach-imx/spl.c                   | 2 +-
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
> index 046df6291a..d94c095118 100644
> --- a/arch/arm/include/asm/mach-imx/sys_proto.h
> +++ b/arch/arm/include/asm/mach-imx/sys_proto.h
> @@ -69,8 +69,13 @@ enum imx6_bmode_emi {
>  
>  enum imx6_bmode {
>  	IMX6_BMODE_EMI,
> -	IMX6_BMODE_UART,
> +#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
> +	IMX6_BMODE_QSPI,
> +	IMX6_BMODE_RESERVED,
> +#else
> +	IMX6_BMODE_RESERVED,
>  	IMX6_BMODE_SATA,
> +#endif
>  	IMX6_BMODE_SERIAL_ROM,
>  	IMX6_BMODE_SD,
>  	IMX6_BMODE_ESD,
> diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> index 75698c48ea..836b334fa9 100644
> --- a/arch/arm/mach-imx/spl.c
> +++ b/arch/arm/mach-imx/spl.c
> @@ -42,7 +42,7 @@ u32 spl_boot_device(void)
>  		break;
>  		}
>  	/* Reserved: Used to force Serial Downloader */
> -	case IMX6_BMODE_UART:
> +	case IMX6_BMODE_RESERVED:
>  		return BOOT_DEVICE_UART;
>  	/* SATA: See 8.5.4, Table 8-20 */
>  	case IMX6_BMODE_SATA:
>
diff mbox

Patch

diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index 046df6291a..d94c095118 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -69,8 +69,13 @@  enum imx6_bmode_emi {
 
 enum imx6_bmode {
 	IMX6_BMODE_EMI,
-	IMX6_BMODE_UART,
+#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL)
+	IMX6_BMODE_QSPI,
+	IMX6_BMODE_RESERVED,
+#else
+	IMX6_BMODE_RESERVED,
 	IMX6_BMODE_SATA,
+#endif
 	IMX6_BMODE_SERIAL_ROM,
 	IMX6_BMODE_SD,
 	IMX6_BMODE_ESD,
diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index 75698c48ea..836b334fa9 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -42,7 +42,7 @@  u32 spl_boot_device(void)
 		break;
 		}
 	/* Reserved: Used to force Serial Downloader */
-	case IMX6_BMODE_UART:
+	case IMX6_BMODE_RESERVED:
 		return BOOT_DEVICE_UART;
 	/* SATA: See 8.5.4, Table 8-20 */
 	case IMX6_BMODE_SATA: