mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown
@ 2022-06-03  7:24 Ahmad Fatoum
  2022-06-03  7:24 ` [PATCH 2/2] ARM: cpuinfo: detect Cortex-A72 Ahmad Fatoum
  2022-06-07  7:07 ` [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2022-06-03  7:24 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Instead of e.g.

  core: unknown r0p3

We now get

  core: unknown (0x410fd083) r0p3

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/cpu/cpuinfo.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
index a08fc253efbb..5dce34536efc 100644
--- a/arch/arm/cpu/cpuinfo.c
+++ b/arch/arm/cpu/cpuinfo.c
@@ -191,7 +191,7 @@ static int do_cpuinfo(int argc, char *argv[])
 
 	if (cpu_arch >= CPU_ARCH_ARMv7) {
 		unsigned int major, minor;
-		char *part;
+		const char *part = NULL;
 		major = (mainid >> 20) & 0xf;
 		minor = mainid & 0xf;
 		switch (mainid & 0xfff0) {
@@ -217,9 +217,13 @@ static int do_cpuinfo(int argc, char *argv[])
 			part = "Cortex-A57";
 			break;
 		default:
-			part = "unknown";
+			printf("core: unknown (0x%08lx) r%up%u\n",
+			       mainid, major, minor);
+			break;
 		}
-		printf("core: %s r%up%u\n", part, major, minor);
+
+		if (part)
+			printf("core: %s r%up%u\n", part, major, minor);
 	}
 
 	if (cache & (1 << 24)) {
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* [PATCH 2/2] ARM: cpuinfo: detect Cortex-A72
  2022-06-03  7:24 [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown Ahmad Fatoum
@ 2022-06-03  7:24 ` Ahmad Fatoum
  2022-06-07  7:07 ` [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2022-06-03  7:24 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Both the Raspberry Pi 4 as well as the already supported LS1046A feature
a Cortex-A72. Let the cpuinfo command correctly name these cores.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 arch/arm/cpu/cpuinfo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
index 5dce34536efc..8a92432e904f 100644
--- a/arch/arm/cpu/cpuinfo.c
+++ b/arch/arm/cpu/cpuinfo.c
@@ -27,6 +27,7 @@
 #define ARM_CPU_PART_CORTEX_A15     0xC0F0
 #define ARM_CPU_PART_CORTEX_A53	    0xD030
 #define ARM_CPU_PART_CORTEX_A57	    0xD070
+#define ARM_CPU_PART_CORTEX_A72	    0xD080
 
 static void decode_cache(unsigned long size)
 {
@@ -216,6 +217,9 @@ static int do_cpuinfo(int argc, char *argv[])
 		case ARM_CPU_PART_CORTEX_A57:
 			part = "Cortex-A57";
 			break;
+		case ARM_CPU_PART_CORTEX_A72:
+			part = "Cortex-A72";
+			break;
 		default:
 			printf("core: unknown (0x%08lx) r%up%u\n",
 			       mainid, major, minor);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown
  2022-06-03  7:24 [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown Ahmad Fatoum
  2022-06-03  7:24 ` [PATCH 2/2] ARM: cpuinfo: detect Cortex-A72 Ahmad Fatoum
@ 2022-06-07  7:07 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2022-06-07  7:07 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Fri, Jun 03, 2022 at 09:24:35AM +0200, Ahmad Fatoum wrote:
> Instead of e.g.
> 
>   core: unknown r0p3
> 
> We now get
> 
>   core: unknown (0x410fd083) r0p3
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  arch/arm/cpu/cpuinfo.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
> index a08fc253efbb..5dce34536efc 100644
> --- a/arch/arm/cpu/cpuinfo.c
> +++ b/arch/arm/cpu/cpuinfo.c
> @@ -191,7 +191,7 @@ static int do_cpuinfo(int argc, char *argv[])
>  
>  	if (cpu_arch >= CPU_ARCH_ARMv7) {
>  		unsigned int major, minor;
> -		char *part;
> +		const char *part = NULL;
>  		major = (mainid >> 20) & 0xf;
>  		minor = mainid & 0xf;
>  		switch (mainid & 0xfff0) {
> @@ -217,9 +217,13 @@ static int do_cpuinfo(int argc, char *argv[])
>  			part = "Cortex-A57";
>  			break;
>  		default:
> -			part = "unknown";
> +			printf("core: unknown (0x%08lx) r%up%u\n",
> +			       mainid, major, minor);
> +			break;
>  		}
> -		printf("core: %s r%up%u\n", part, major, minor);
> +
> +		if (part)
> +			printf("core: %s r%up%u\n", part, major, minor);
>  	}
>  
>  	if (cache & (1 << 24)) {
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2022-06-07  7:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03  7:24 [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown Ahmad Fatoum
2022-06-03  7:24 ` [PATCH 2/2] ARM: cpuinfo: detect Cortex-A72 Ahmad Fatoum
2022-06-07  7:07 ` [PATCH 1/2] ARM: cpuinfo: print CPU mainid if unknown Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox