Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Ruslan Bilovol <ruslan.bilovol@ti.com>
To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org, tony@atomide.com,
	linux@arm.linux.org.uk, eduardo.valentin@ti.com
Subject: [RFC PATCH v2 2/2] ARM: OMAP4: setup SoC model name during ID initialisation
Date: Wed, 30 Jan 2013 02:38:57 +0200	[thread overview]
Message-ID: <1359506337-21619-3-git-send-email-ruslan.bilovol@ti.com> (raw)
In-Reply-To: <1359506337-21619-1-git-send-email-ruslan.bilovol@ti.com>

Set up the SoC model name during OMAP ID initialisation
so it will be displayed in /proc/cpuinfo:

/ # cat proc/cpuinfo
[...]
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 10

SoC name        : OMAP4470 ES1.0 HS

Hardware        : OMAP4 Blaze Tablet
Revision        : 20edb4
[...]

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
---
 arch/arm/mach-omap2/id.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 45cc7ed4..b1fba35 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -20,6 +20,7 @@
 #include <linux/io.h>
 
 #include <asm/cputype.h>
+#include <asm/setup.h>
 
 #include "common.h"
 
@@ -33,8 +34,17 @@
 
 static unsigned int omap_revision;
 static const char *cpu_rev;
+static char omap_soc_model_name[80];
 u32 omap_features;
 
+static const char const *omap_types[] = {
+	[OMAP2_DEVICE_TYPE_TEST]	= "TST",
+	[OMAP2_DEVICE_TYPE_EMU]		= "EMU",
+	[OMAP2_DEVICE_TYPE_SEC]		= "HS",
+	[OMAP2_DEVICE_TYPE_GP]		= "GP",
+	[OMAP2_DEVICE_TYPE_BAD]		= "BAD",
+};
+
 unsigned int omap_rev(void)
 {
 	return omap_revision;
@@ -502,8 +512,12 @@ void __init omap4xxx_check_revision(void)
 		omap_revision = OMAP4430_REV_ES2_3;
 	}
 
-	pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
-		((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
+	sprintf(omap_soc_model_name, "OMAP%04x ES%d.%d %s", omap_rev() >> 16,
+			((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf),
+			omap_types[omap_type()]);
+	set_soc_model_name(omap_soc_model_name);
+
+	pr_info("%s\n", omap_soc_model_name);
 }
 
 void __init omap5xxx_check_revision(void)
-- 
1.7.9.5

  parent reply	other threads:[~2013-01-30  0:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30  0:38 [RFC PATCH v2 0/2] ARM: update cpuinfo to print SoC model name Ruslan Bilovol
2013-01-30  0:38 ` [RFC PATCH v2 1/2] ARM: kernel: " Ruslan Bilovol
2013-01-30  5:48   ` Nishanth Menon
2013-01-30  0:38 ` Ruslan Bilovol [this message]
2013-01-30  6:00 ` [RFC PATCH v2 0/2] ARM: " Santosh Shilimkar

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=1359506337-21619-3-git-send-email-ruslan.bilovol@ti.com \
    --to=ruslan.bilovol@ti.com \
    --cc=eduardo.valentin@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=tony@atomide.com \
    /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