diff mbox

[RFC,1/2] ARM: kernel: update cpuinfo to print CPU model name

Message ID 1359474865-15408-2-git-send-email-ruslan.bilovol@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ruslan Bilovol Jan. 29, 2013, 3:54 p.m. UTC
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.
The "cpuinfo" file looks like exactly that place, where
This information have to be displayed.

So added new line "CPU name" in the "cpuinfo" output for CPU model name

Example:

/ # cat proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 10 (v7l)
BogoMIPS        : 1590.23
Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU name        : OMAP4470 ES1.0 HS
CPU architecture: 7
CPU variant     : 0x2
CPU part        : 0xc09
CPU revision    : 10
[...]

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
---
 arch/arm/include/asm/setup.h |    1 +
 arch/arm/kernel/setup.c      |   10 ++++++++++
 2 files changed, 11 insertions(+)

Comments

Russell King - ARM Linux Jan. 29, 2013, 4:08 p.m. UTC | #1
On Tue, Jan 29, 2013 at 05:54:24PM +0200, Ruslan Bilovol wrote:
> CPU implementer : 0x41
> CPU name        : OMAP4470 ES1.0 HS

Sigh.  No.  Look at what you're doing - look carefully at the above.

"CPU implementer" - 0x41.  That's A.  For ARM Ltd.  ARM Ltd implemented
this CPU.  Did ARM Ltd really implement OMAP4470 ?  I think TI would be
very upset if that were to be the case.

So no, OMAP4470 is _NOT_ a CPU.  It is a SoC.  The CPU inside the SoC is
a collection of ARM Ltd Cortex A9 _CPUs_.

See?  Please, learn what a CPU is as opposed to a SoC.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ruslan Bilovol Jan. 29, 2013, 11:12 p.m. UTC | #2
Hi,

On Tue, Jan 29, 2013 at 6:08 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Jan 29, 2013 at 05:54:24PM +0200, Ruslan Bilovol wrote:
>> CPU implementer : 0x41
>> CPU name        : OMAP4470 ES1.0 HS
>
> Sigh.  No.  Look at what you're doing - look carefully at the above.
>
> "CPU implementer" - 0x41.  That's A.  For ARM Ltd.  ARM Ltd implemented
> this CPU.  Did ARM Ltd really implement OMAP4470 ?  I think TI would be
> very upset if that were to be the case.

Yes, it would be very surprisingly :)

>
> So no, OMAP4470 is _NOT_ a CPU.  It is a SoC.  The CPU inside the SoC is
> a collection of ARM Ltd Cortex A9 _CPUs_.
>
> See?  Please, learn what a CPU is as opposed to a SoC.

Completely agree with you. I will fix this
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Santosh Shilimkar Jan. 30, 2013, 5:52 a.m. UTC | #3
On Wednesday 30 January 2013 04:42 AM, Ruslan Bilovol wrote:
> Hi,
>
> On Tue, Jan 29, 2013 at 6:08 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
>> On Tue, Jan 29, 2013 at 05:54:24PM +0200, Ruslan Bilovol wrote:
>>> CPU implementer : 0x41
>>> CPU name        : OMAP4470 ES1.0 HS
>>
>> Sigh.  No.  Look at what you're doing - look carefully at the above.
>>
>> "CPU implementer" - 0x41.  That's A.  For ARM Ltd.  ARM Ltd implemented
>> this CPU.  Did ARM Ltd really implement OMAP4470 ?  I think TI would be
>> very upset if that were to be the case.
>
> Yes, it would be very surprisingly :)
>
>>
>> So no, OMAP4470 is _NOT_ a CPU.  It is a SoC.  The CPU inside the SoC is
>> a collection of ARM Ltd Cortex A9 _CPUs_.
>>
>> See?  Please, learn what a CPU is as opposed to a SoC.
>
> Completely agree with you. I will fix this
>
Thank god you agreed to drop your current approach. Please elaborate
what you are going to fix and also state what user-space features
changes from OMAP4460 to OMAP4470.

Regards,
Santosh



--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
anish Jan. 30, 2013, 7:42 a.m. UTC | #4
On Wed, Jan 30, 2013 at 11:22 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
> On Wednesday 30 January 2013 04:42 AM, Ruslan Bilovol wrote:
>>
>> Hi,
>>
>> On Tue, Jan 29, 2013 at 6:08 PM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>>>
>>> On Tue, Jan 29, 2013 at 05:54:24PM +0200, Ruslan Bilovol wrote:
>>>>
>>>> CPU implementer : 0x41
>>>> CPU name        : OMAP4470 ES1.0 HS
>>>
>>>
>>> Sigh.  No.  Look at what you're doing - look carefully at the above.
>>>
>>> "CPU implementer" - 0x41.  That's A.  For ARM Ltd.  ARM Ltd implemented
Wouldn't it be nice to display the name rather than hex?I think this would have
definitely occurred to Russell but it is still done this way.I think
there would be
a valid reason for this and it would be nice to know that.

If not then I can cook up a patch.

>>> this CPU.  Did ARM Ltd really implement OMAP4470 ?  I think TI would be
>>> very upset if that were to be the case.
>>
>>
>> Yes, it would be very surprisingly :)
>>
>>>
>>> So no, OMAP4470 is _NOT_ a CPU.  It is a SoC.  The CPU inside the SoC is
>>> a collection of ARM Ltd Cortex A9 _CPUs_.
>>>
>>> See?  Please, learn what a CPU is as opposed to a SoC.
>>
>>
>> Completely agree with you. I will fix this
>>
> Thank god you agreed to drop your current approach. Please elaborate
> what you are going to fix and also state what user-space features
> changes from OMAP4460 to OMAP4470.
>
> Regards,
> Santosh
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index c50f056..f49de38 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_cpu_model_name(char *name);
 
 #endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 3f6cbb2..6fab2e2 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 *cpu_model_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_cpu_model_name(char *name)
+{
+	cpu_model_name = name;
+}
+
 void __init dump_machine_table(void)
 {
 	struct machine_desc *p;
@@ -880,6 +886,10 @@  static int c_show(struct seq_file *m, void *v)
 				seq_printf(m, "%s ", hwcap_str[j]);
 
 		seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24);
+
+		if (cpu_model_name)
+			seq_printf(m, "CPU name\t: %s\n", cpu_model_name);
+
 		seq_printf(m, "CPU architecture: %s\n",
 			   proc_arch[cpu_architecture()]);