All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <eduardo.valentin@nokia.com>
To: LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Linux-OMAP <linux-omap@vger.kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	ext Tony Lindgren <tony@atomide.com>,
	ext Kevin Hilman <khilman@deeprootsystems.com>,
	Peter De-Schrijver <Peter.De-Schrijver@nokia.com>,
	santosh.shilimkar@ti.com, Ambresh <a0393775@ti.com>,
	felipe.balbi@nokia.com,
	Eduardo Valentin <eduardo.valentin@nokia.com>
Subject: [PATCHv4 3/4] mach-omap1: export omap1 info under /proc/socinfo
Date: Mon, 10 May 2010 13:37:36 +0300	[thread overview]
Message-ID: <1273487857-32281-4-git-send-email-eduardo.valentin@nokia.com> (raw)
In-Reply-To: <1273487857-32281-1-git-send-email-eduardo.valentin@nokia.com>

From: Eduardo Valentin <eduardo.valentin@nokia.com>

Report OMAP name and rev under /proc/socinfo node.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
 arch/arm/mach-omap1/id.c |   45 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index a0e3560..917892b 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/seq_file.h>
 #include <plat/cpu.h>
 
 #define OMAP_DIE_ID_0		0xfffe1800
@@ -118,9 +119,12 @@ static u8 __init omap_get_die_rev(void)
 	return die_rev;
 }
 
+#define SOCINFO_SZ		128
+static char socinfo[SOCINFO_SZ];
+
 void __init omap_check_revision(void)
 {
-	int i;
+	int i, sz;
 	u16 jtag_id;
 	u8 die_rev;
 	u32 omap_id;
@@ -194,11 +198,40 @@ void __init omap_check_revision(void)
 		printk(KERN_INFO "Unknown OMAP cpu type: 0x%02x\n", cpu_type);
 	}
 
-	printk(KERN_INFO "OMAP%04x", omap_revision >> 16);
+	sz = snprintf(socinfo, SOCINFO_SZ, "OMAP%04x", omap_revision >> 16);
 	if ((omap_revision >> 8) & 0xff)
-		printk(KERN_INFO "%x", (omap_revision >> 8) & 0xff);
-	printk(KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n",
-	       die_rev, omap_revision & 0xff, system_serial_low,
-	       system_serial_high);
+		snprintf(socinfo + sz, SOCINFO_SZ - sz, "%x",
+						(omap_revision >> 8) & 0xff);
+	pr_info("%s revision %i handled as %02xxx id: %08x%08x\n",
+		socinfo, die_rev, omap_revision & 0xff, system_serial_low,
+		system_serial_high);
+}
+
+static int c_show(struct seq_file *m, void *v)
+{
+	seq_printf(m, "SoC\t: %s\n", socinfo);
+
+	return 0;
+}
+
+static void *c_start(struct seq_file *m, loff_t *pos)
+{
+	return *pos < 1 ? (void *)1 : NULL;
 }
 
+static void *c_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	++*pos;
+	return NULL;
+}
+
+static void c_stop(struct seq_file *m, void *v)
+{
+}
+
+const struct seq_operations socinfo_op = {
+	.start	= c_start,
+	.next	= c_next,
+	.stop	= c_stop,
+	.show	= c_show
+};
-- 
1.7.0.4.361.g8b5fe.dirty


WARNING: multiple messages have this Message-ID (diff)
From: Eduardo Valentin <eduardo.valentin@nokia.com>
To: LKML <linux-kernel@vger.kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Linux-OMAP <linux-omap@vger.kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>,
	ext Tony Lindgren <tony@atomide.com>,
	Peter De-Schrijver <Peter.De-Schrijver@nokia.com>,
	Eduardo Valentin <eduardo.valentin@nokia.com>,
	Ambresh <a0393775@ti.com>,
	ext Kevin Hilman <khilman@deeprootsystems.com>,
	santosh.shilimkar@ti.com,
	Andrew Morton <akpm@linux-foundation.org>,
	felipe.balbi@nokia.com
Subject: [PATCHv4 3/4] mach-omap1: export omap1 info under /proc/socinfo
Date: Mon, 10 May 2010 13:37:36 +0300	[thread overview]
Message-ID: <1273487857-32281-4-git-send-email-eduardo.valentin@nokia.com> (raw)
In-Reply-To: <1273487857-32281-1-git-send-email-eduardo.valentin@nokia.com>

From: Eduardo Valentin <eduardo.valentin@nokia.com>

Report OMAP name and rev under /proc/socinfo node.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
 arch/arm/mach-omap1/id.c |   45 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index a0e3560..917892b 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/seq_file.h>
 #include <plat/cpu.h>
 
 #define OMAP_DIE_ID_0		0xfffe1800
@@ -118,9 +119,12 @@ static u8 __init omap_get_die_rev(void)
 	return die_rev;
 }
 
+#define SOCINFO_SZ		128
+static char socinfo[SOCINFO_SZ];
+
 void __init omap_check_revision(void)
 {
-	int i;
+	int i, sz;
 	u16 jtag_id;
 	u8 die_rev;
 	u32 omap_id;
@@ -194,11 +198,40 @@ void __init omap_check_revision(void)
 		printk(KERN_INFO "Unknown OMAP cpu type: 0x%02x\n", cpu_type);
 	}
 
-	printk(KERN_INFO "OMAP%04x", omap_revision >> 16);
+	sz = snprintf(socinfo, SOCINFO_SZ, "OMAP%04x", omap_revision >> 16);
 	if ((omap_revision >> 8) & 0xff)
-		printk(KERN_INFO "%x", (omap_revision >> 8) & 0xff);
-	printk(KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n",
-	       die_rev, omap_revision & 0xff, system_serial_low,
-	       system_serial_high);
+		snprintf(socinfo + sz, SOCINFO_SZ - sz, "%x",
+						(omap_revision >> 8) & 0xff);
+	pr_info("%s revision %i handled as %02xxx id: %08x%08x\n",
+		socinfo, die_rev, omap_revision & 0xff, system_serial_low,
+		system_serial_high);
+}
+
+static int c_show(struct seq_file *m, void *v)
+{
+	seq_printf(m, "SoC\t: %s\n", socinfo);
+
+	return 0;
+}
+
+static void *c_start(struct seq_file *m, loff_t *pos)
+{
+	return *pos < 1 ? (void *)1 : NULL;
 }
 
+static void *c_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	++*pos;
+	return NULL;
+}
+
+static void c_stop(struct seq_file *m, void *v)
+{
+}
+
+const struct seq_operations socinfo_op = {
+	.start	= c_start,
+	.next	= c_next,
+	.stop	= c_stop,
+	.show	= c_show
+};
-- 
1.7.0.4.361.g8b5fe.dirty

WARNING: multiple messages have this Message-ID (diff)
From: eduardo.valentin@nokia.com (Eduardo Valentin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv4 3/4] mach-omap1: export omap1 info under /proc/socinfo
Date: Mon, 10 May 2010 13:37:36 +0300	[thread overview]
Message-ID: <1273487857-32281-4-git-send-email-eduardo.valentin@nokia.com> (raw)
In-Reply-To: <1273487857-32281-1-git-send-email-eduardo.valentin@nokia.com>

From: Eduardo Valentin <eduardo.valentin@nokia.com>

Report OMAP name and rev under /proc/socinfo node.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
 arch/arm/mach-omap1/id.c |   45 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index a0e3560..917892b 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/seq_file.h>
 #include <plat/cpu.h>
 
 #define OMAP_DIE_ID_0		0xfffe1800
@@ -118,9 +119,12 @@ static u8 __init omap_get_die_rev(void)
 	return die_rev;
 }
 
+#define SOCINFO_SZ		128
+static char socinfo[SOCINFO_SZ];
+
 void __init omap_check_revision(void)
 {
-	int i;
+	int i, sz;
 	u16 jtag_id;
 	u8 die_rev;
 	u32 omap_id;
@@ -194,11 +198,40 @@ void __init omap_check_revision(void)
 		printk(KERN_INFO "Unknown OMAP cpu type: 0x%02x\n", cpu_type);
 	}
 
-	printk(KERN_INFO "OMAP%04x", omap_revision >> 16);
+	sz = snprintf(socinfo, SOCINFO_SZ, "OMAP%04x", omap_revision >> 16);
 	if ((omap_revision >> 8) & 0xff)
-		printk(KERN_INFO "%x", (omap_revision >> 8) & 0xff);
-	printk(KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n",
-	       die_rev, omap_revision & 0xff, system_serial_low,
-	       system_serial_high);
+		snprintf(socinfo + sz, SOCINFO_SZ - sz, "%x",
+						(omap_revision >> 8) & 0xff);
+	pr_info("%s revision %i handled as %02xxx id: %08x%08x\n",
+		socinfo, die_rev, omap_revision & 0xff, system_serial_low,
+		system_serial_high);
+}
+
+static int c_show(struct seq_file *m, void *v)
+{
+	seq_printf(m, "SoC\t: %s\n", socinfo);
+
+	return 0;
+}
+
+static void *c_start(struct seq_file *m, loff_t *pos)
+{
+	return *pos < 1 ? (void *)1 : NULL;
 }
 
+static void *c_next(struct seq_file *m, void *v, loff_t *pos)
+{
+	++*pos;
+	return NULL;
+}
+
+static void c_stop(struct seq_file *m, void *v)
+{
+}
+
+const struct seq_operations socinfo_op = {
+	.start	= c_start,
+	.next	= c_next,
+	.stop	= c_stop,
+	.show	= c_show
+};
-- 
1.7.0.4.361.g8b5fe.dirty

  parent reply	other threads:[~2010-05-10 10:37 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10 10:37 [PATCHv4 0/4] Introduce the /proc/socinfo and use it to export OMAP data Eduardo Valentin
2010-05-10 10:37 ` Eduardo Valentin
2010-05-10 10:37 ` [PATCHv4 1/4] procfs: Introduce socinfo under /proc Eduardo Valentin
2010-05-10 10:37   ` Eduardo Valentin
2010-05-10 10:37   ` Eduardo Valentin
2010-05-10 11:13   ` Paul Mundt
2010-05-10 11:13     ` Paul Mundt
2010-05-10 12:35     ` Eduardo Valentin
2010-05-10 12:35       ` Eduardo Valentin
2010-05-10 12:35       ` Eduardo Valentin
2010-05-10 12:39       ` Paul Mundt
2010-05-10 12:39         ` Paul Mundt
2010-05-10 12:39         ` Paul Mundt
2010-05-10 12:55         ` Eduardo Valentin
2010-05-10 12:55           ` Eduardo Valentin
2010-05-10 12:55           ` Eduardo Valentin
2010-05-11  3:14           ` Paul Mundt
2010-05-11  3:14             ` Paul Mundt
2010-05-11  3:14             ` Paul Mundt
2010-05-11  6:21             ` Russell King - ARM Linux
2010-05-11  6:21               ` Russell King - ARM Linux
2010-05-11  6:21               ` Russell King - ARM Linux
2010-05-10 12:54     ` Felipe Balbi
2010-05-10 12:54       ` Felipe Balbi
2010-05-10 12:54       ` Felipe Balbi
2010-05-10 13:08       ` Eduardo Valentin
2010-05-10 13:08         ` Eduardo Valentin
2010-05-10 13:08         ` Eduardo Valentin
2010-05-10 18:15         ` Felipe Balbi
2010-05-10 18:15           ` Felipe Balbi
2010-05-10 18:15           ` Felipe Balbi
2010-05-10 14:22     ` Eduardo Valentin
2010-05-10 14:22       ` Eduardo Valentin
2010-05-10 14:22       ` Eduardo Valentin
2010-05-11  3:11       ` Paul Mundt
2010-05-11  3:11         ` Paul Mundt
2010-05-11  3:11         ` Paul Mundt
2010-05-10 10:37 ` [PATCHv4 2/4] mach-omap2: export omap2 info under /proc/socinfo Eduardo Valentin
2010-05-10 10:37   ` Eduardo Valentin
2010-05-10 10:37 ` Eduardo Valentin [this message]
2010-05-10 10:37   ` [PATCHv4 3/4] mach-omap1: export omap1 " Eduardo Valentin
2010-05-10 10:37   ` Eduardo Valentin
2010-05-10 10:52   ` Russell King - ARM Linux
2010-05-10 10:52     ` Russell King - ARM Linux
2010-05-10 12:13     ` Eduardo Valentin
2010-05-10 12:13       ` Eduardo Valentin
2010-05-10 12:13       ` Eduardo Valentin
2010-05-10 10:37 ` [PATCHv4 4/4] OMAP3: export chip IDCODE, Production ID and Die ID Eduardo Valentin
2010-05-10 10:37   ` Eduardo Valentin
2010-05-10 10:37   ` Eduardo Valentin

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=1273487857-32281-4-git-send-email-eduardo.valentin@nokia.com \
    --to=eduardo.valentin@nokia.com \
    --cc=Peter.De-Schrijver@nokia.com \
    --cc=a0393775@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=felipe.balbi@nokia.com \
    --cc=khilman@deeprootsystems.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=santosh.shilimkar@ti.com \
    --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 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.