* [RFC PATCH v2 1/2] ARM: kernel: update cpuinfo to print SoC model name
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 ` Ruslan Bilovol
2013-01-30 5:48 ` Nishanth Menon
2013-01-30 0:38 ` [RFC PATCH v2 2/2] ARM: OMAP4: setup SoC model name during ID initialisation Ruslan Bilovol
2013-01-30 6:00 ` [RFC PATCH v2 0/2] ARM: update cpuinfo to print SoC model name Santosh Shilimkar
2 siblings, 1 reply; 5+ messages in thread
From: Ruslan Bilovol @ 2013-01-30 0:38 UTC (permalink / raw)
To: linux-arm-kernel
Currently, reading /proc/cpuinfo provides userspace with CPU ID of
the CPU carrying out the read from the file.
Userspace using this information may decide what module
to load or how to configure some specific (and processor-depended)
settings or so.
However, since really different SoCs can share same ARM core,
this information currently is not so useful.
For example, TI OMAP4460 and OMAP4470 SoCs show the same
information in the /proc/cpuinfo whereas they are different.
Since in most cases ARM CPU is a part of some system on a chip (SoC),
the "cpuinfo" file looks like exactly that place, where this
information have to be displayed.
So added new line "SoC name" in the "cpuinfo" output for system
on a chip name. It is placed between CPU information and machine
information, so the file structure looks gracefully (CPU-SoC-Hardware)
Example:
/ # 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/include/asm/setup.h | 1 +
arch/arm/kernel/setup.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index c50f056..621df40 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -52,5 +52,6 @@ extern struct meminfo meminfo;
extern int arm_add_memory(phys_addr_t start, phys_addr_t size);
extern void early_print(const char *str, ...);
extern void dump_machine_table(void);
+extern void set_soc_model_name(char *name);
#endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 3f6cbb2..bb3805f 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -134,6 +134,7 @@ char elf_platform[ELF_PLATFORM_SIZE];
EXPORT_SYMBOL(elf_platform);
static const char *cpu_name;
+static const char *soc_name;
static const char *machine_name;
static char __initdata cmd_line[COMMAND_LINE_SIZE];
struct machine_desc *machine_desc __initdata;
@@ -493,6 +494,11 @@ static void __init setup_processor(void)
cpu_init();
}
+void set_soc_model_name(char *name)
+{
+ soc_name = name;
+}
+
void __init dump_machine_table(void)
{
struct machine_desc *p;
@@ -902,6 +908,9 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "CPU revision\t: %d\n\n", cpuid & 15);
}
+ if (soc_name)
+ seq_printf(m, "SoC name\t: %s\n\n", soc_name);
+
seq_printf(m, "Hardware\t: %s\n", machine_name);
seq_printf(m, "Revision\t: %04x\n", system_rev);
seq_printf(m, "Serial\t\t: %08x%08x\n",
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* [RFC PATCH v2 2/2] ARM: OMAP4: setup SoC model name during ID initialisation
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 0:38 ` Ruslan Bilovol
2013-01-30 6:00 ` [RFC PATCH v2 0/2] ARM: update cpuinfo to print SoC model name Santosh Shilimkar
2 siblings, 0 replies; 5+ messages in thread
From: Ruslan Bilovol @ 2013-01-30 0:38 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply related [flat|nested] 5+ messages in thread