All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] imx8m: fix rom version check to unbreak some B0 chips
@ 2019-11-19  8:42 Patrick Wildt
  2019-12-07 15:29 ` Patrick Wildt
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Wildt @ 2019-11-19  8:42 UTC (permalink / raw)
  To: u-boot

Recently the version check was improved to be able to determine that
we're running on SoC revision 2.1.  A check for B0 was tightened so
that it now must equal 0x20 instead of being bigger than 0x20.  On
some B0 chips the value returned is 0x1020 instead of 0x20.  This
means even though it's B0, the check will fail and code relying on
the correct chip revision will make wrong decisions.  There is no
documentation of those bits, but it seems that NXP always uses a
byte to encode the revision.  Thus remove the upper bits to fix the
regression.

Signed-off-by: Patrick Wildt <patrick@blueri.se>

diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 9a203e4736..4d42368057 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -216,6 +216,7 @@ u32 get_cpu_rev(void)
 					readl((void __iomem *)ROM_VERSION_A0);
 				if (rom_version != CHIP_REV_1_0) {
 					rom_version = readl((void __iomem *)ROM_VERSION_B0);
+					rom_version &= 0xff;
 					if (rom_version == CHIP_REV_2_0)
 						reg = CHIP_REV_2_0;
 				}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] imx8m: fix rom version check to unbreak some B0 chips
  2019-11-19  8:42 [U-Boot] imx8m: fix rom version check to unbreak some B0 chips Patrick Wildt
@ 2019-12-07 15:29 ` Patrick Wildt
  2019-12-09 10:52   ` Stefano Babic
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Wildt @ 2019-12-07 15:29 UTC (permalink / raw)
  To: u-boot

Ping?

On Tue, Nov 19, 2019 at 09:42:06AM +0100, Patrick Wildt wrote:
> Recently the version check was improved to be able to determine that
> we're running on SoC revision 2.1.  A check for B0 was tightened so
> that it now must equal 0x20 instead of being bigger than 0x20.  On
> some B0 chips the value returned is 0x1020 instead of 0x20.  This
> means even though it's B0, the check will fail and code relying on
> the correct chip revision will make wrong decisions.  There is no
> documentation of those bits, but it seems that NXP always uses a
> byte to encode the revision.  Thus remove the upper bits to fix the
> regression.
> 
> Signed-off-by: Patrick Wildt <patrick@blueri.se>
> 
> diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
> index 9a203e4736..4d42368057 100644
> --- a/arch/arm/mach-imx/imx8m/soc.c
> +++ b/arch/arm/mach-imx/imx8m/soc.c
> @@ -216,6 +216,7 @@ u32 get_cpu_rev(void)
>  					readl((void __iomem *)ROM_VERSION_A0);
>  				if (rom_version != CHIP_REV_1_0) {
>  					rom_version = readl((void __iomem *)ROM_VERSION_B0);
> +					rom_version &= 0xff;
>  					if (rom_version == CHIP_REV_2_0)
>  						reg = CHIP_REV_2_0;
>  				}
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] imx8m: fix rom version check to unbreak some B0 chips
  2019-12-07 15:29 ` Patrick Wildt
@ 2019-12-09 10:52   ` Stefano Babic
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2019-12-09 10:52 UTC (permalink / raw)
  To: u-boot

On 07/12/19 16:29, Patrick Wildt wrote:
> Ping?
> 
> On Tue, Nov 19, 2019 at 09:42:06AM +0100, Patrick Wildt wrote:
>> Recently the version check was improved to be able to determine that
>> we're running on SoC revision 2.1.  A check for B0 was tightened so
>> that it now must equal 0x20 instead of being bigger than 0x20.  On
>> some B0 chips the value returned is 0x1020 instead of 0x20.  This
>> means even though it's B0, the check will fail and code relying on
>> the correct chip revision will make wrong decisions.  There is no
>> documentation of those bits, but it seems that NXP always uses a
>> byte to encode the revision.  Thus remove the upper bits to fix the
>> regression.
>>
>> Signed-off-by: Patrick Wildt <patrick@blueri.se>
>>

I pick it up for 2020.01, thanks for remind !

Best regards,
Stefano Babic

>> diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
>> index 9a203e4736..4d42368057 100644
>> --- a/arch/arm/mach-imx/imx8m/soc.c
>> +++ b/arch/arm/mach-imx/imx8m/soc.c
>> @@ -216,6 +216,7 @@ u32 get_cpu_rev(void)
>>  					readl((void __iomem *)ROM_VERSION_A0);
>>  				if (rom_version != CHIP_REV_1_0) {
>>  					rom_version = readl((void __iomem *)ROM_VERSION_B0);
>> +					rom_version &= 0xff;
>>  					if (rom_version == CHIP_REV_2_0)
>>  						reg = CHIP_REV_2_0;
>>  				}
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> https://lists.denx.de/listinfo/u-boot


-- 
=====================================================================
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
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-09 10:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19  8:42 [U-Boot] imx8m: fix rom version check to unbreak some B0 chips Patrick Wildt
2019-12-07 15:29 ` Patrick Wildt
2019-12-09 10:52   ` Stefano Babic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.