* [PATCHv3 0/4] Adding soc related info into /proc/cpuinfo
@ 2010-04-28 5:51 ` Eduardo Valentin
0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel, Linux-OMAP
Cc: ext Tony Lindgren, ext Kevin Hilman,
\"De-Schrijver Peter (Nokia-D/Helsinki)\",
santosh.shilimkar, felipe.balbi, Eduardo Valentin
Hello all,
And now v3 of this series. Basically a minor change wrt string manipulation.
No need to use strlen in so many places. Previous log for reference:
v2:
Here is the version 2 of this series. Now die id is protected using
same x86 protection mechanism to hide x86 product number. Besides,
a compilation Kconfig option has been added for DIE ID as well.
Here is previous PATCH 0/4 message:
v1:
This series is to continue what has been discussed several weeks ago
wrt IDCODE patch. Original patch was made by Peter and discussion is here:
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg17553.html
So, the conclusion was that IDCODE info is useful even in production systems,
and for that debugfs is not a good choice to export it. One suggestion was to
add it under /proc/cpuinfo. However this entry nowadays exports only ARM related
information.
So this series does the trick by extending the ARM /proc/cpuinfo to include
soc info data. There are a few ways to add a hook for soc specific data. But
I've decided to implement it via the simplest way I found. Basically it is
same thing which is done for system_rev, system_serial_low and system_serial_high.
Then, now we have system_soc_info, which is printed only if there is something
useful there.
As usual, comments are welcome.
BR,
Eduardo Valentin (4):
ARM: Introduce SoC Info into /proc/cpuinfo
mach-omap2: Add SoC info data for OMAP2,3,4 into /proc/cpuinfo
mach-omap1: Add SoC info data for OMAP1 into /proc/cpuinfo
OMAP3: PM: export chip IDCODE, Production ID and Die ID
Documentation/kernel-parameters.txt | 2 +
arch/arm/include/asm/system.h | 2 +
arch/arm/kernel/setup.c | 5 +++
arch/arm/mach-omap1/id.c | 15 ++++++----
arch/arm/mach-omap2/Kconfig | 10 +++++++
arch/arm/mach-omap2/id.c | 51 ++++++++++++++++++++++++++++++----
6 files changed, 73 insertions(+), 12 deletions(-)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 0/4] Adding soc related info into /proc/cpuinfo
@ 2010-04-28 5:51 ` Eduardo Valentin
0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel
Hello all,
And now v3 of this series. Basically a minor change wrt string manipulation.
No need to use strlen in so many places. Previous log for reference:
v2:
Here is the version 2 of this series. Now die id is protected using
same x86 protection mechanism to hide x86 product number. Besides,
a compilation Kconfig option has been added for DIE ID as well.
Here is previous PATCH 0/4 message:
v1:
This series is to continue what has been discussed several weeks ago
wrt IDCODE patch. Original patch was made by Peter and discussion is here:
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg17553.html
So, the conclusion was that IDCODE info is useful even in production systems,
and for that debugfs is not a good choice to export it. One suggestion was to
add it under /proc/cpuinfo. However this entry nowadays exports only ARM related
information.
So this series does the trick by extending the ARM /proc/cpuinfo to include
soc info data. There are a few ways to add a hook for soc specific data. But
I've decided to implement it via the simplest way I found. Basically it is
same thing which is done for system_rev, system_serial_low and system_serial_high.
Then, now we have system_soc_info, which is printed only if there is something
useful there.
As usual, comments are welcome.
BR,
Eduardo Valentin (4):
ARM: Introduce SoC Info into /proc/cpuinfo
mach-omap2: Add SoC info data for OMAP2,3,4 into /proc/cpuinfo
mach-omap1: Add SoC info data for OMAP1 into /proc/cpuinfo
OMAP3: PM: export chip IDCODE, Production ID and Die ID
Documentation/kernel-parameters.txt | 2 +
arch/arm/include/asm/system.h | 2 +
arch/arm/kernel/setup.c | 5 +++
arch/arm/mach-omap1/id.c | 15 ++++++----
arch/arm/mach-omap2/Kconfig | 10 +++++++
arch/arm/mach-omap2/id.c | 51 ++++++++++++++++++++++++++++++----
6 files changed, 73 insertions(+), 12 deletions(-)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 1/4] ARM: Introduce SoC Info into /proc/cpuinfo
2010-04-28 5:51 ` Eduardo Valentin
@ 2010-04-28 5:51 ` Eduardo Valentin
-1 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel, Linux-OMAP
Cc: ext Tony Lindgren, ext Kevin Hilman,
\"De-Schrijver Peter (Nokia-D/Helsinki)\",
santosh.shilimkar, felipe.balbi, Eduardo Valentin
From: Eduardo Valentin <eduardo.valentin@nokia.com>
This patch extends the ARM /proc/cpuinfo to include soc info data.
It is implemented via the same way which is done for
system_rev, system_serial_low and system_serial_high.
Then, now we have system_soc_info, which is printed only
if there is something useful there.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
arch/arm/include/asm/system.h | 2 ++
arch/arm/kernel/setup.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 4ace45e..53a9645 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -71,6 +71,8 @@ struct task_struct;
extern unsigned int system_rev;
extern unsigned int system_serial_low;
extern unsigned int system_serial_high;
+#define SYSTEM_SOC_INFO_SIZE 128
+extern char system_soc_info[SYSTEM_SOC_INFO_SIZE];
extern unsigned int mem_fclk_21285;
struct pt_regs;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c91c77b..025d795 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -85,6 +85,9 @@ EXPORT_SYMBOL(system_serial_low);
unsigned int system_serial_high;
EXPORT_SYMBOL(system_serial_high);
+char system_soc_info[SYSTEM_SOC_INFO_SIZE];
+EXPORT_SYMBOL(system_soc_info);
+
unsigned int elf_hwcap;
EXPORT_SYMBOL(elf_hwcap);
@@ -847,6 +850,8 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "Revision\t: %04x\n", system_rev);
seq_printf(m, "Serial\t\t: %08x%08x\n",
system_serial_high, system_serial_low);
+ if (strlen(system_soc_info))
+ seq_printf(m, "SoC Info\t: %s\n", system_soc_info);
return 0;
}
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCHv3 1/4] ARM: Introduce SoC Info into /proc/cpuinfo
@ 2010-04-28 5:51 ` Eduardo Valentin
0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel
From: Eduardo Valentin <eduardo.valentin@nokia.com>
This patch extends the ARM /proc/cpuinfo to include soc info data.
It is implemented via the same way which is done for
system_rev, system_serial_low and system_serial_high.
Then, now we have system_soc_info, which is printed only
if there is something useful there.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
arch/arm/include/asm/system.h | 2 ++
arch/arm/kernel/setup.c | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 4ace45e..53a9645 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -71,6 +71,8 @@ struct task_struct;
extern unsigned int system_rev;
extern unsigned int system_serial_low;
extern unsigned int system_serial_high;
+#define SYSTEM_SOC_INFO_SIZE 128
+extern char system_soc_info[SYSTEM_SOC_INFO_SIZE];
extern unsigned int mem_fclk_21285;
struct pt_regs;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index c91c77b..025d795 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -85,6 +85,9 @@ EXPORT_SYMBOL(system_serial_low);
unsigned int system_serial_high;
EXPORT_SYMBOL(system_serial_high);
+char system_soc_info[SYSTEM_SOC_INFO_SIZE];
+EXPORT_SYMBOL(system_soc_info);
+
unsigned int elf_hwcap;
EXPORT_SYMBOL(elf_hwcap);
@@ -847,6 +850,8 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "Revision\t: %04x\n", system_rev);
seq_printf(m, "Serial\t\t: %08x%08x\n",
system_serial_high, system_serial_low);
+ if (strlen(system_soc_info))
+ seq_printf(m, "SoC Info\t: %s\n", system_soc_info);
return 0;
}
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCHv3 2/4] mach-omap2: Add SoC info data for OMAP2,3,4 into /proc/cpuinfo
2010-04-28 5:51 ` Eduardo Valentin
@ 2010-04-28 5:51 ` Eduardo Valentin
-1 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel, Linux-OMAP
Cc: ext Tony Lindgren, ext Kevin Hilman,
\"De-Schrijver Peter (Nokia-D/Helsinki)\",
santosh.shilimkar, felipe.balbi, Eduardo Valentin
From: Eduardo Valentin <eduardo.valentin@nokia.com>
Report OMAP2,3,4 data into system_soc_info. Now we get omap
information under /proc/cpuinfo.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
arch/arm/mach-omap2/id.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 37b8a1a..4702ffe 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -104,7 +104,7 @@ static u16 tap_prod_id;
void __init omap24xx_check_revision(void)
{
- int i, j;
+ int i, j, sz;
u32 idcode, prod_id;
u16 hawkeye;
u8 dev_type, rev;
@@ -152,10 +152,12 @@ void __init omap24xx_check_revision(void)
j = i;
}
- pr_info("OMAP%04x", omap_rev() >> 16);
+ sz = snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "OMAP%04x",
+ omap_rev() >> 16);
if ((omap_rev() >> 8) & 0x0f)
- pr_info("ES%x", (omap_rev() >> 12) & 0xf);
- pr_info("\n");
+ snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "ES%x", (omap_rev() >> 12) & 0xf);
+ pr_info("%s\n", system_soc_info);
}
#define OMAP3_CHECK_FEATURE(status,feat) \
@@ -286,7 +288,9 @@ void __init omap4_check_revision(void)
if ((hawkeye == 0xb852) && (rev == 0x0)) {
omap_revision = OMAP4430_REV_ES1_0;
omap_chip.oc |= CHIP_IS_OMAP4430ES1;
- pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name);
+ snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "OMAP%04x %s\n",
+ omap_rev() >> 16, rev_name);
+ pr_info("%s\n", system_soc_info);
return;
}
@@ -356,7 +360,9 @@ void __init omap3_cpuinfo(void)
}
/* Print verbose information */
- pr_info("%s ES%s (", cpu_name, cpu_rev);
+ snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "%s ES%s", cpu_name,
+ cpu_rev);
+ pr_info("%s (", system_soc_info);
OMAP3_SHOW_FEATURE(l2cache);
OMAP3_SHOW_FEATURE(iva);
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCHv3 2/4] mach-omap2: Add SoC info data for OMAP2, 3, 4 into /proc/cpuinfo
@ 2010-04-28 5:51 ` Eduardo Valentin
0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel
From: Eduardo Valentin <eduardo.valentin@nokia.com>
Report OMAP2,3,4 data into system_soc_info. Now we get omap
information under /proc/cpuinfo.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
arch/arm/mach-omap2/id.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 37b8a1a..4702ffe 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -104,7 +104,7 @@ static u16 tap_prod_id;
void __init omap24xx_check_revision(void)
{
- int i, j;
+ int i, j, sz;
u32 idcode, prod_id;
u16 hawkeye;
u8 dev_type, rev;
@@ -152,10 +152,12 @@ void __init omap24xx_check_revision(void)
j = i;
}
- pr_info("OMAP%04x", omap_rev() >> 16);
+ sz = snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "OMAP%04x",
+ omap_rev() >> 16);
if ((omap_rev() >> 8) & 0x0f)
- pr_info("ES%x", (omap_rev() >> 12) & 0xf);
- pr_info("\n");
+ snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "ES%x", (omap_rev() >> 12) & 0xf);
+ pr_info("%s\n", system_soc_info);
}
#define OMAP3_CHECK_FEATURE(status,feat) \
@@ -286,7 +288,9 @@ void __init omap4_check_revision(void)
if ((hawkeye == 0xb852) && (rev == 0x0)) {
omap_revision = OMAP4430_REV_ES1_0;
omap_chip.oc |= CHIP_IS_OMAP4430ES1;
- pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name);
+ snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "OMAP%04x %s\n",
+ omap_rev() >> 16, rev_name);
+ pr_info("%s\n", system_soc_info);
return;
}
@@ -356,7 +360,9 @@ void __init omap3_cpuinfo(void)
}
/* Print verbose information */
- pr_info("%s ES%s (", cpu_name, cpu_rev);
+ snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "%s ES%s", cpu_name,
+ cpu_rev);
+ pr_info("%s (", system_soc_info);
OMAP3_SHOW_FEATURE(l2cache);
OMAP3_SHOW_FEATURE(iva);
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCHv3 3/4] mach-omap1: Add SoC info data for OMAP1 into /proc/cpuinfo
2010-04-28 5:51 ` Eduardo Valentin
@ 2010-04-28 5:51 ` Eduardo Valentin
-1 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel, Linux-OMAP
Cc: ext Tony Lindgren, ext Kevin Hilman,
\"De-Schrijver Peter (Nokia-D/Helsinki)\",
santosh.shilimkar, felipe.balbi, Eduardo Valentin
From: Eduardo Valentin <eduardo.valentin@nokia.com>
Report OMAP data into system_soc_info. Now we get omap
information under /proc/cpuinfo.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
arch/arm/mach-omap1/id.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index a0e3560..9a84347 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -120,7 +120,7 @@ static u8 __init omap_get_die_rev(void)
void __init omap_check_revision(void)
{
- int i;
+ int i, sz;
u16 jtag_id;
u8 die_rev;
u32 omap_id;
@@ -194,11 +194,14 @@ 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(system_soc_info, SYSTEM_SOC_INFO_SIZE, "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(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "%x", (omap_revision >> 8) & 0xff);
+ pr_info("%s revision %i handled as %02xxx id: %08x%08x\n",
+ system_soc_info, die_rev, omap_revision & 0xff,
+ system_serial_low, system_serial_high);
+
}
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCHv3 3/4] mach-omap1: Add SoC info data for OMAP1 into /proc/cpuinfo
@ 2010-04-28 5:51 ` Eduardo Valentin
0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel
From: Eduardo Valentin <eduardo.valentin@nokia.com>
Report OMAP data into system_soc_info. Now we get omap
information under /proc/cpuinfo.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
arch/arm/mach-omap1/id.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index a0e3560..9a84347 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -120,7 +120,7 @@ static u8 __init omap_get_die_rev(void)
void __init omap_check_revision(void)
{
- int i;
+ int i, sz;
u16 jtag_id;
u8 die_rev;
u32 omap_id;
@@ -194,11 +194,14 @@ 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(system_soc_info, SYSTEM_SOC_INFO_SIZE, "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(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "%x", (omap_revision >> 8) & 0xff);
+ pr_info("%s revision %i handled as %02xxx id: %08x%08x\n",
+ system_soc_info, die_rev, omap_revision & 0xff,
+ system_serial_low, system_serial_high);
+
}
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCHv3 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID
2010-04-28 5:51 ` Eduardo Valentin
@ 2010-04-28 5:51 ` Eduardo Valentin
-1 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel, Linux-OMAP
Cc: ext Tony Lindgren, ext Kevin Hilman,
\"De-Schrijver Peter (Nokia-D/Helsinki)\",
santosh.shilimkar, felipe.balbi, Eduardo Valentin
From: Eduardo Valentin <eduardo.valentin@nokia.com>
This patch exports the OMAP3 IDCODE and Production ID to userspace
via /proc/cpuinfo using the system_soc_info.
Die ID is also exported depending on what users pass as kernel
parameter. It is same protection mechanism made for x86 product
number. So, if user passes "omap3_die_id" parameter, it will append
die id code into /proc/cpuinfo as well. A Kconfig option has been
added as well, so it can be configurable during compilation time.
This can be used to track down silicon specific issues. The info is
exported via /proc/cpuinfo because then it can be possible to include this
in corematic dumps.
This is based on Peter De Schrijver patch, which export same info via sysfs.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
Documentation/kernel-parameters.txt | 2 +
arch/arm/mach-omap2/Kconfig | 10 +++++++++
arch/arm/mach-omap2/id.c | 37 +++++++++++++++++++++++++++++++++-
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 839b21b..6a84e6c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1809,6 +1809,8 @@ and is between 256 and 4096 characters. It is defined in the file
waiting for the ACK, so if this is set too high
interrupts *may* be lost!
+ omap3_die_id [OMAP] Append DIE ID info under /proc/cpuinfo
+
omap_mux= [OMAP] Override bootloader pin multiplexing.
Format: <mux_mode0.mode_name=value>...
For example, to override I2C bus2:
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 2455dcc..462c23a 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -169,3 +169,13 @@ config OMAP3_SDRC_AC_TIMING
wish to say no. Selecting yes without understanding what is
going on could result in system crashes;
+config OMAP3_EXPORT_DIE_ID
+ bool "Export DIE ID code under /proc/cpuinfo"
+ depends on ARCH_OMAP3
+ default n
+ help
+ Say Y here if you need DIE ID code to be exported via /proc/cpuinfo
+ in production systems. You will need also to explicitly flag it by
+ appending the "omap3_die_id" parameter to your boot command line.
+
+
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 4702ffe..6fe554b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -76,6 +76,10 @@ EXPORT_SYMBOL(omap_type);
/*----------------------------------------------------------------------------*/
#define OMAP_TAP_IDCODE 0x0204
+#define OMAP_TAP_PROD_ID_0 0x0208
+#define OMAP_TAP_PROD_ID_1 0x020c
+#define OMAP_TAP_PROD_ID_2 0x0210
+#define OMAP_TAP_PROD_ID_3 0x0214
#define OMAP_TAP_DIE_ID_0 0x0218
#define OMAP_TAP_DIE_ID_1 0x021C
#define OMAP_TAP_DIE_ID_2 0x0220
@@ -303,6 +307,7 @@ void __init omap4_check_revision(void)
void __init omap3_cpuinfo(void)
{
+ int sz;
u8 rev = GET_OMAP_REVISION();
char cpu_name[16], cpu_rev[16];
@@ -360,8 +365,8 @@ void __init omap3_cpuinfo(void)
}
/* Print verbose information */
- snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "%s ES%s", cpu_name,
- cpu_rev);
+ sz = snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "%s ES%s",
+ cpu_name, cpu_rev);
pr_info("%s (", system_soc_info);
OMAP3_SHOW_FEATURE(l2cache);
@@ -372,7 +377,35 @@ void __init omap3_cpuinfo(void)
OMAP3_SHOW_FEATURE(192mhz_clk);
printk(")\n");
+
+ /* Append OMAP3 IDCODE and Production ID to system_soc_info */
+ snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "\n\tIDCODE\t: %08x\n\tPr. ID\t: %08x %08x %08x %08x",
+ read_tap_reg(OMAP_TAP_IDCODE),
+ read_tap_reg(OMAP_TAP_PROD_ID_0),
+ read_tap_reg(OMAP_TAP_PROD_ID_1),
+ read_tap_reg(OMAP_TAP_PROD_ID_2),
+ read_tap_reg(OMAP_TAP_PROD_ID_3));
+
+}
+
+#ifdef CONFIG_OMAP3_EXPORT_DIE_ID
+static int __init omap3_die_id_setup(char *s)
+{
+ int sz;
+
+ sz = strlen(system_soc_info);
+ snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "\n\tDie ID\t: %08x %08x %08x %08x",
+ read_tap_reg(OMAP_TAP_DIE_ID_0),
+ read_tap_reg(OMAP_TAP_DIE_ID_1),
+ read_tap_reg(OMAP_TAP_DIE_ID_2),
+ read_tap_reg(OMAP_TAP_DIE_ID_3));
+
+ return 1;
}
+__setup("omap3_die_id", omap3_die_id_setup);
+#endif
/*
* Try to detect the exact revision of the omap we're running on
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCHv3 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID
@ 2010-04-28 5:51 ` Eduardo Valentin
0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-28 5:51 UTC (permalink / raw)
To: linux-arm-kernel
From: Eduardo Valentin <eduardo.valentin@nokia.com>
This patch exports the OMAP3 IDCODE and Production ID to userspace
via /proc/cpuinfo using the system_soc_info.
Die ID is also exported depending on what users pass as kernel
parameter. It is same protection mechanism made for x86 product
number. So, if user passes "omap3_die_id" parameter, it will append
die id code into /proc/cpuinfo as well. A Kconfig option has been
added as well, so it can be configurable during compilation time.
This can be used to track down silicon specific issues. The info is
exported via /proc/cpuinfo because then it can be possible to include this
in corematic dumps.
This is based on Peter De Schrijver patch, which export same info via sysfs.
Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
---
Documentation/kernel-parameters.txt | 2 +
arch/arm/mach-omap2/Kconfig | 10 +++++++++
arch/arm/mach-omap2/id.c | 37 +++++++++++++++++++++++++++++++++-
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 839b21b..6a84e6c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1809,6 +1809,8 @@ and is between 256 and 4096 characters. It is defined in the file
waiting for the ACK, so if this is set too high
interrupts *may* be lost!
+ omap3_die_id [OMAP] Append DIE ID info under /proc/cpuinfo
+
omap_mux= [OMAP] Override bootloader pin multiplexing.
Format: <mux_mode0.mode_name=value>...
For example, to override I2C bus2:
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 2455dcc..462c23a 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -169,3 +169,13 @@ config OMAP3_SDRC_AC_TIMING
wish to say no. Selecting yes without understanding what is
going on could result in system crashes;
+config OMAP3_EXPORT_DIE_ID
+ bool "Export DIE ID code under /proc/cpuinfo"
+ depends on ARCH_OMAP3
+ default n
+ help
+ Say Y here if you need DIE ID code to be exported via /proc/cpuinfo
+ in production systems. You will need also to explicitly flag it by
+ appending the "omap3_die_id" parameter to your boot command line.
+
+
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 4702ffe..6fe554b 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -76,6 +76,10 @@ EXPORT_SYMBOL(omap_type);
/*----------------------------------------------------------------------------*/
#define OMAP_TAP_IDCODE 0x0204
+#define OMAP_TAP_PROD_ID_0 0x0208
+#define OMAP_TAP_PROD_ID_1 0x020c
+#define OMAP_TAP_PROD_ID_2 0x0210
+#define OMAP_TAP_PROD_ID_3 0x0214
#define OMAP_TAP_DIE_ID_0 0x0218
#define OMAP_TAP_DIE_ID_1 0x021C
#define OMAP_TAP_DIE_ID_2 0x0220
@@ -303,6 +307,7 @@ void __init omap4_check_revision(void)
void __init omap3_cpuinfo(void)
{
+ int sz;
u8 rev = GET_OMAP_REVISION();
char cpu_name[16], cpu_rev[16];
@@ -360,8 +365,8 @@ void __init omap3_cpuinfo(void)
}
/* Print verbose information */
- snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "%s ES%s", cpu_name,
- cpu_rev);
+ sz = snprintf(system_soc_info, SYSTEM_SOC_INFO_SIZE, "%s ES%s",
+ cpu_name, cpu_rev);
pr_info("%s (", system_soc_info);
OMAP3_SHOW_FEATURE(l2cache);
@@ -372,7 +377,35 @@ void __init omap3_cpuinfo(void)
OMAP3_SHOW_FEATURE(192mhz_clk);
printk(")\n");
+
+ /* Append OMAP3 IDCODE and Production ID to system_soc_info */
+ snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "\n\tIDCODE\t: %08x\n\tPr. ID\t: %08x %08x %08x %08x",
+ read_tap_reg(OMAP_TAP_IDCODE),
+ read_tap_reg(OMAP_TAP_PROD_ID_0),
+ read_tap_reg(OMAP_TAP_PROD_ID_1),
+ read_tap_reg(OMAP_TAP_PROD_ID_2),
+ read_tap_reg(OMAP_TAP_PROD_ID_3));
+
+}
+
+#ifdef CONFIG_OMAP3_EXPORT_DIE_ID
+static int __init omap3_die_id_setup(char *s)
+{
+ int sz;
+
+ sz = strlen(system_soc_info);
+ snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz,
+ "\n\tDie ID\t: %08x %08x %08x %08x",
+ read_tap_reg(OMAP_TAP_DIE_ID_0),
+ read_tap_reg(OMAP_TAP_DIE_ID_1),
+ read_tap_reg(OMAP_TAP_DIE_ID_2),
+ read_tap_reg(OMAP_TAP_DIE_ID_3));
+
+ return 1;
}
+__setup("omap3_die_id", omap3_die_id_setup);
+#endif
/*
* Try to detect the exact revision of the omap we're running on
--
1.7.0.4.361.g8b5fe.dirty
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCHv3 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID
2010-04-28 5:51 ` Eduardo Valentin
@ 2010-04-28 16:21 ` Kevin Hilman
-1 siblings, 0 replies; 14+ messages in thread
From: Kevin Hilman @ 2010-04-28 16:21 UTC (permalink / raw)
To: Eduardo Valentin
Cc: ext Tony Lindgren, \ De-Schrijver Peter \\ (Nokia-D/Helsinki),
santosh.shilimkar, felipe.balbi, Linux-OMAP, linux-arm-kernel
Eduardo Valentin <eduardo.valentin@nokia.com> writes:
> From: Eduardo Valentin <eduardo.valentin@nokia.com>
>
> This patch exports the OMAP3 IDCODE and Production ID to userspace
> via /proc/cpuinfo using the system_soc_info.
>
> Die ID is also exported depending on what users pass as kernel
> parameter. It is same protection mechanism made for x86 product
> number. So, if user passes "omap3_die_id" parameter, it will append
> die id code into /proc/cpuinfo as well. A Kconfig option has been
> added as well, so it can be configurable during compilation time.
>
> This can be used to track down silicon specific issues. The info is
> exported via /proc/cpuinfo because then it can be possible to include this
> in corematic dumps.
>
> This is based on Peter De Schrijver patch, which export same info via sysfs.
>
> Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Re: $SUBJECT, why the PM: prefix?
Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID
@ 2010-04-28 16:21 ` Kevin Hilman
0 siblings, 0 replies; 14+ messages in thread
From: Kevin Hilman @ 2010-04-28 16:21 UTC (permalink / raw)
To: linux-arm-kernel
Eduardo Valentin <eduardo.valentin@nokia.com> writes:
> From: Eduardo Valentin <eduardo.valentin@nokia.com>
>
> This patch exports the OMAP3 IDCODE and Production ID to userspace
> via /proc/cpuinfo using the system_soc_info.
>
> Die ID is also exported depending on what users pass as kernel
> parameter. It is same protection mechanism made for x86 product
> number. So, if user passes "omap3_die_id" parameter, it will append
> die id code into /proc/cpuinfo as well. A Kconfig option has been
> added as well, so it can be configurable during compilation time.
>
> This can be used to track down silicon specific issues. The info is
> exported via /proc/cpuinfo because then it can be possible to include this
> in corematic dumps.
>
> This is based on Peter De Schrijver patch, which export same info via sysfs.
>
> Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Re: $SUBJECT, why the PM: prefix?
Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv3 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID
2010-04-28 16:21 ` Kevin Hilman
@ 2010-04-30 6:07 ` Eduardo Valentin
-1 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-30 6:07 UTC (permalink / raw)
To: ext Kevin Hilman
Cc: ext Tony Lindgren, De-Schrijver Peter (Nokia-D/Helsinki),
Valentin Eduardo (Nokia-D/Helsinki),
santosh.shilimkar, Balbi Felipe (Nokia-D/Helsinki),
Linux-OMAP, linux-arm-kernel
On Wed, Apr 28, 2010 at 06:21:02PM +0200, ext Kevin Hilman wrote:
> Eduardo Valentin <eduardo.valentin@nokia.com> writes:
>
> > From: Eduardo Valentin <eduardo.valentin@nokia.com>
> >
> > This patch exports the OMAP3 IDCODE and Production ID to userspace
> > via /proc/cpuinfo using the system_soc_info.
> >
> > Die ID is also exported depending on what users pass as kernel
> > parameter. It is same protection mechanism made for x86 product
> > number. So, if user passes "omap3_die_id" parameter, it will append
> > die id code into /proc/cpuinfo as well. A Kconfig option has been
> > added as well, so it can be configurable during compilation time.
> >
> > This can be used to track down silicon specific issues. The info is
> > exported via /proc/cpuinfo because then it can be possible to include this
> > in corematic dumps.
> >
> > This is based on Peter De Schrijver patch, which export same info via sysfs.
> >
> > Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
>
> Re: $SUBJECT, why the PM: prefix?
Yes indeed, no need to be PM bound.
>
> Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv3 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID
@ 2010-04-30 6:07 ` Eduardo Valentin
0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2010-04-30 6:07 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 28, 2010 at 06:21:02PM +0200, ext Kevin Hilman wrote:
> Eduardo Valentin <eduardo.valentin@nokia.com> writes:
>
> > From: Eduardo Valentin <eduardo.valentin@nokia.com>
> >
> > This patch exports the OMAP3 IDCODE and Production ID to userspace
> > via /proc/cpuinfo using the system_soc_info.
> >
> > Die ID is also exported depending on what users pass as kernel
> > parameter. It is same protection mechanism made for x86 product
> > number. So, if user passes "omap3_die_id" parameter, it will append
> > die id code into /proc/cpuinfo as well. A Kconfig option has been
> > added as well, so it can be configurable during compilation time.
> >
> > This can be used to track down silicon specific issues. The info is
> > exported via /proc/cpuinfo because then it can be possible to include this
> > in corematic dumps.
> >
> > This is based on Peter De Schrijver patch, which export same info via sysfs.
> >
> > Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
>
> Re: $SUBJECT, why the PM: prefix?
Yes indeed, no need to be PM bound.
>
> Kevin
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-04-30 6:07 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-28 5:51 [PATCHv3 0/4] Adding soc related info into /proc/cpuinfo Eduardo Valentin
2010-04-28 5:51 ` Eduardo Valentin
2010-04-28 5:51 ` [PATCHv3 1/4] ARM: Introduce SoC Info " Eduardo Valentin
2010-04-28 5:51 ` Eduardo Valentin
2010-04-28 5:51 ` [PATCHv3 2/4] mach-omap2: Add SoC info data for OMAP2,3,4 " Eduardo Valentin
2010-04-28 5:51 ` [PATCHv3 2/4] mach-omap2: Add SoC info data for OMAP2, 3, 4 " Eduardo Valentin
2010-04-28 5:51 ` [PATCHv3 3/4] mach-omap1: Add SoC info data for OMAP1 " Eduardo Valentin
2010-04-28 5:51 ` Eduardo Valentin
2010-04-28 5:51 ` [PATCHv3 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID Eduardo Valentin
2010-04-28 5:51 ` Eduardo Valentin
2010-04-28 16:21 ` Kevin Hilman
2010-04-28 16:21 ` Kevin Hilman
2010-04-30 6:07 ` Eduardo Valentin
2010-04-30 6:07 ` Eduardo Valentin
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.