diff options
author | Ahmad Fatoum <ahmad@a3f.at> | 2020-03-30 16:39:09 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-05-08 14:52:41 +0200 |
commit | 2e45f03730101082633bd50d3d14ac0eac776de8 (patch) | |
tree | f9d53f5983e3e3c1efcd31db455ff2f77eeb9d14 /arch/arm/mach-stm32mp/init.c | |
parent | 8974b63acff909ca10c0a21d3e3dbe463cbfb191 (diff) | |
download | barebox-2e45f03730101082633bd50d3d14ac0eac776de8.tar.gz barebox-2e45f03730101082633bd50d3d14ac0eac776de8.tar.xz |
ARM: stm32mp: init: detect Revision Z and 800 MHz profiles
Revision A was 0x1000 and B was 0x2000, so I assumed the next would
be revision C valued 0x3000. Alas, it's revision Z with 0x2001...
Change the code accordingly and add detection for the new 800Mhz
profiles.
Code taken from U-Boot commit
cf0818b477 ("stm32mp1: support of STM32MP15x Rev.Z") and
Patch[1] "stm32mp1: add 800 MHz profile support".
[1]: https://st-md-mailman.stormreply.com/pipermail/uboot-stm32/2020-February/002170.html
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-stm32mp/init.c')
-rw-r--r-- | arch/arm/mach-stm32mp/init.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/arch/arm/mach-stm32mp/init.c b/arch/arm/mach-stm32mp/init.c index 6280d94da6..8a50657664 100644 --- a/arch/arm/mach-stm32mp/init.c +++ b/arch/arm/mach-stm32mp/init.c @@ -194,17 +194,29 @@ static int get_cpu_package(u32 *pkg) static int setup_cpu_type(void) { - const char *cputypestr; - const char *cpupkgstr; + const char *cputypestr, *cpupkgstr, *cpurevstr; + u32 pkg; get_cpu_type(&__stm32mp_cputype); switch (__stm32mp_cputype) { + case CPU_STM32MP157Fxx: + cputypestr = "157F"; + break; + case CPU_STM32MP157Dxx: + cputypestr = "157D"; + break; case CPU_STM32MP157Cxx: cputypestr = "157C"; break; case CPU_STM32MP157Axx: cputypestr = "157A"; break; + case CPU_STM32MP153Fxx: + cputypestr = "153F"; + break; + case CPU_STM32MP153Dxx: + cputypestr = "153D"; + break; case CPU_STM32MP153Cxx: cputypestr = "153C"; break; @@ -217,6 +229,12 @@ static int setup_cpu_type(void) case CPU_STM32MP151Axx: cputypestr = "151A"; break; + case CPU_STM32MP151Fxx: + cputypestr = "151F"; + break; + case CPU_STM32MP151Dxx: + cputypestr = "151D"; + break; default: cputypestr = "????"; break; @@ -242,11 +260,24 @@ static int setup_cpu_type(void) } __stm32mp_silicon_revision = get_cpu_revision(); + switch (__stm32mp_silicon_revision) { + case CPU_REV_A: + cpurevstr = "A"; + break; + case CPU_REV_B: + cpurevstr = "B"; + break; + case CPU_REV_Z: + cpurevstr = "Z"; + break; + default: + cpurevstr = "?"; + } pr_debug("cputype = 0x%x, package = 0x%x, revision = 0x%x\n", - __stm32mp_cputype, __stm32mp_package, __stm32mp_silicon_revision); - pr_info("detected STM32MP%s%s Rev.%c\n", cputypestr, cpupkgstr, - (__stm32mp_silicon_revision >> 12) + 'A' - 1); + __stm32mp_cputype, pkg, __stm32mp_silicon_revision); + pr_info("detected STM32MP%s%s Rev.%s\n", cputypestr, cpupkgstr, cpurevstr); + return 0; } |