mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/8] ARM: cpuinfo: display the core name and version
Date: Thu, 22 Aug 2013 22:36:55 +0200	[thread overview]
Message-ID: <1377203819-23074-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1377203819-23074-1-git-send-email-s.hauer@pengutronix.de>

From: Jan Luebbe <jlu@pengutronix.de>

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/cpuinfo.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c
index 8aea4b4..260d47b 100644
--- a/arch/arm/cpu/cpuinfo.c
+++ b/arch/arm/cpu/cpuinfo.c
@@ -31,6 +31,12 @@
 #define CPU_ARCH_ARMv6		8
 #define CPU_ARCH_ARMv7		9
 
+#define ARM_CPU_PART_CORTEX_A5      0xC050
+#define ARM_CPU_PART_CORTEX_A7      0xC070
+#define ARM_CPU_PART_CORTEX_A8      0xC080
+#define ARM_CPU_PART_CORTEX_A9      0xC090
+#define ARM_CPU_PART_CORTEX_A15     0xC0F0
+
 static void decode_cache(unsigned long size)
 {
 	int linelen = 1 << ((size & 0x3) + 3);
@@ -154,6 +160,33 @@ static int do_cpuinfo(int argc, char *argv[])
 	printf("implementer: %s\narchitecture: %s\n",
 			implementer, architecture);
 
+	if (cpu_arch == CPU_ARCH_ARMv7) {
+		unsigned int major, minor;
+		char *part;
+		major = (mainid >> 20) & 0xf;
+		minor = mainid & 0xf;
+		switch (mainid & 0xfff0) {
+		case ARM_CPU_PART_CORTEX_A5:
+			part = "Cortex-A5";
+			break;
+		case ARM_CPU_PART_CORTEX_A7:
+			part = "Cortex-A7";
+			break;
+		case ARM_CPU_PART_CORTEX_A8:
+			part = "Cortex-A8";
+			break;
+		case ARM_CPU_PART_CORTEX_A9:
+			part = "Cortex-A9";
+			break;
+		case ARM_CPU_PART_CORTEX_A15:
+			part = "Cortex-A15";
+			break;
+		default:
+			part = "unknown";
+		}
+		printf("core: %s r%up%u\n", part, major, minor);
+	}
+
 	if (cache & (1 << 24)) {
 		/* separate I/D cache */
 		printf("I-cache: ");
-- 
1.8.4.rc3


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

  parent reply	other threads:[~2013-08-22 20:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-22 20:36 [PATCH] OMAP fixes and beaglebone black support Sascha Hauer
2013-08-22 20:36 ` [PATCH 1/8] ARM: am33xx: Add SRAM0 address/size defines Sascha Hauer
2013-08-22 20:36 ` [PATCH 2/8] ARM: omap: fix omap_save_bootinfo Sascha Hauer
2013-08-22 20:36 ` [PATCH 3/8] ARM: am33xx: Make uart0 mux init callable during early init Sascha Hauer
2013-08-22 20:36 ` Sascha Hauer [this message]
2013-08-22 20:36 ` [PATCH 5/8] ARM: am33xx: implement cpu revision decoding Sascha Hauer
2013-08-22 20:36 ` [PATCH 6/8] ARM: am33xx: beaglebone: split out DDR2 init for BB White Sascha Hauer
2013-08-22 20:36 ` [PATCH 7/8] ARM: am33xx: beaglebone: configure I2C EEPROM Sascha Hauer
2013-08-22 20:36 ` [PATCH 8/8] ARM: am33xx: beaglebone: add support for beaglebone black with DDR3 RAM Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377203819-23074-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox