linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/2] ARM: update cpuinfo to print SoC model name
@ 2013-01-30 15:01 Ruslan Bilovol
  2013-01-30 15:01 ` [RFC PATCH v3 1/2] ARM: kernel: " Ruslan Bilovol
  2013-01-30 15:01 ` [RFC PATCH v3 2/2] ARM: OMAP4: setup SoC model name during ID initialisation Ruslan Bilovol
  0 siblings, 2 replies; 11+ messages in thread
From: Ruslan Bilovol @ 2013-01-30 15:01 UTC (permalink / raw)
  To: linux-arm-kernel, linux-omap, linux-kernel, tony, linux,
	eduardo.valentin


The following patches update cpuinfo to print SoC
model name for ARM.
The first patch exactly makes needed changes for ARM
architecture and adds a common approach to show SoC name.
Second patch uses this approach for TI OMAP4 SoCs (as live
example).

Why we need it?

First - the /proc/cpuinfo becomes more informative.
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' instead of 'CPU-Hardware' that we have now)

Second - this information may be used by userspace
for different purposes (as example - OMAP4460 and
OMAP4470 SoCs have different graphics accelerators,
and userspace may want to know what libraries
to use and what module to insert if the graphics
drivers are built as modules)

Looks like there were few attempts to do similar
changes to cpuinfo without any luck (had stuck
on review) so this functionality is still not
in the kernel yet.
In this patch series the update to cpuinfo is very
short (10 lines) and easy.

Comments are welcome as usual

--------------------------------------------------
v3:
Addressed comments from Nishanth (changed 'SoC name'
field for OMAP - now it shows only SoC name without
additional info)

Updated commit messages. Updated this cover letter
with additional information

--------------------------------------------------
v2:
Addressed comments from Russel (changed 'CPU name' > 'SoC name')
Updatet commit messages. Updated cover letter

Ruslan Bilovol (2):
  ARM: kernel: update cpuinfo to print SoC model name
  ARM: OMAP4: setup SoC model name during ID initialisation

 arch/arm/include/asm/setup.h |    1 +
 arch/arm/kernel/setup.c      |    9 +++++++++
 arch/arm/mach-omap2/id.c     |    5 +++++
 3 files changed, 15 insertions(+)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 15:01 [RFC PATCH v3 0/2] ARM: update cpuinfo to print SoC model name Ruslan Bilovol
@ 2013-01-30 15:01 ` Ruslan Bilovol
  2013-01-30 19:07   ` Nicolas Pitre
  2013-01-30 23:18   ` Jean-Christophe PLAGNIOL-VILLARD
  2013-01-30 15:01 ` [RFC PATCH v3 2/2] ARM: OMAP4: setup SoC model name during ID initialisation Ruslan Bilovol
  1 sibling, 2 replies; 11+ messages in thread
From: Ruslan Bilovol @ 2013-01-30 15:01 UTC (permalink / raw)
  To: linux-arm-kernel, linux-omap, linux-kernel, tony, linux,
	eduardo.valentin

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

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] 11+ messages in thread

* [RFC PATCH v3 2/2] ARM: OMAP4: setup SoC model name during ID initialisation
  2013-01-30 15:01 [RFC PATCH v3 0/2] ARM: update cpuinfo to print SoC model name Ruslan Bilovol
  2013-01-30 15:01 ` [RFC PATCH v3 1/2] ARM: kernel: " Ruslan Bilovol
@ 2013-01-30 15:01 ` Ruslan Bilovol
  2013-01-30 15:57   ` Russell King - ARM Linux
  1 sibling, 1 reply; 11+ messages in thread
From: Ruslan Bilovol @ 2013-01-30 15:01 UTC (permalink / raw)
  To: linux-arm-kernel, linux-omap, linux-kernel, tony, linux,
	eduardo.valentin

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

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

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

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 45cc7ed4..dca7ac7 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,6 +34,7 @@
 
 static unsigned int omap_revision;
 static const char *cpu_rev;
+static char omap_soc_model_name[80];
 u32 omap_features;
 
 unsigned int omap_rev(void)
@@ -502,6 +504,9 @@ void __init omap4xxx_check_revision(void)
 		omap_revision = OMAP4430_REV_ES2_3;
 	}
 
+	sprintf(omap_soc_model_name, "OMAP%04x", omap_rev() >> 16);
+	set_soc_model_name(omap_soc_model_name);
+
 	pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
 		((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
 }
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 2/2] ARM: OMAP4: setup SoC model name during ID initialisation
  2013-01-30 15:01 ` [RFC PATCH v3 2/2] ARM: OMAP4: setup SoC model name during ID initialisation Ruslan Bilovol
@ 2013-01-30 15:57   ` Russell King - ARM Linux
  0 siblings, 0 replies; 11+ messages in thread
From: Russell King - ARM Linux @ 2013-01-30 15:57 UTC (permalink / raw)
  To: Ruslan Bilovol
  Cc: linux-arm-kernel, linux-omap, linux-kernel, tony, eduardo.valentin

On Wed, Jan 30, 2013 at 05:01:31PM +0200, Ruslan Bilovol wrote:
> 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

Hmm.  Still not happy.  Wasn't there some SoC infrastructure added to the
kernel to export this kind of information via sysfs?  See:

Documentation/ABI/testing/sysfs-devices-soc

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 15:01 ` [RFC PATCH v3 1/2] ARM: kernel: " Ruslan Bilovol
@ 2013-01-30 19:07   ` Nicolas Pitre
  2013-01-30 20:37     ` Matt Sealey
  2013-01-30 23:24     ` Russell King - ARM Linux
  2013-01-30 23:18   ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 2 replies; 11+ messages in thread
From: Nicolas Pitre @ 2013-01-30 19:07 UTC (permalink / raw)
  To: Ruslan Bilovol
  Cc: linux-arm-kernel, linux-omap, linux-kernel, tony, linux,
	eduardo.valentin

On Wed, 30 Jan 2013, Ruslan Bilovol wrote:

> 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
> 
> Hardware        : OMAP4 Blaze Tablet

Please remove that extra blank line between "SoC name" and "Hardware".  
The blank line after "CPU revision" is fine.

Also, please rename this to "System name".  Not all systems are "on 
chip".  By using "System name" this is more universally useful.


Nicolas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 19:07   ` Nicolas Pitre
@ 2013-01-30 20:37     ` Matt Sealey
  2013-01-30 21:02       ` Nicolas Pitre
  2013-01-30 23:24     ` Russell King - ARM Linux
  1 sibling, 1 reply; 11+ messages in thread
From: Matt Sealey @ 2013-01-30 20:37 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Ruslan Bilovol, Linux ARM Kernel ML, linux-omap, LKML, tony,
	Russell King - ARM Linux, eduardo.valentin

On Wed, Jan 30, 2013 at 1:07 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> On Wed, 30 Jan 2013, Ruslan Bilovol wrote:
>
>> 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
>>
>> Hardware        : OMAP4 Blaze Tablet
>
> Please remove that extra blank line between "SoC name" and "Hardware".
> The blank line after "CPU revision" is fine.
>
> Also, please rename this to "System name".  Not all systems are "on
> chip".  By using "System name" this is more universally useful.

I can't agree with "System name", it is confusing in common
terminology since it's about the same definition as the current
"Hardware" line.

If we're just printing out the name of the device surrounding the CPU
- be it a Northbridge/Southbridge combination or SoC packaging -
"Chipset" might be a better name for it.

-- 
Matt Sealey <matt@genesi-usa.com>
Product Development Analyst, Genesi USA, Inc.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 20:37     ` Matt Sealey
@ 2013-01-30 21:02       ` Nicolas Pitre
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Pitre @ 2013-01-30 21:02 UTC (permalink / raw)
  To: Matt Sealey
  Cc: Ruslan Bilovol, Linux ARM Kernel ML, linux-omap, LKML, tony,
	Russell King - ARM Linux, eduardo.valentin

On Wed, 30 Jan 2013, Matt Sealey wrote:

> On Wed, Jan 30, 2013 at 1:07 PM, Nicolas Pitre <nico@fluxnic.net> wrote:
> > On Wed, 30 Jan 2013, Ruslan Bilovol wrote:
> >
> >> 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
> >>
> >> Hardware        : OMAP4 Blaze Tablet
> >
> > Please remove that extra blank line between "SoC name" and "Hardware".
> > The blank line after "CPU revision" is fine.
> >
> > Also, please rename this to "System name".  Not all systems are "on
> > chip".  By using "System name" this is more universally useful.
> 
> I can't agree with "System name", it is confusing in common
> terminology since it's about the same definition as the current
> "Hardware" line.
> 
> If we're just printing out the name of the device surrounding the CPU
> - be it a Northbridge/Southbridge combination or SoC packaging -
> "Chipset" might be a better name for it.

That suits me as well.


Nicolas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 15:01 ` [RFC PATCH v3 1/2] ARM: kernel: " Ruslan Bilovol
  2013-01-30 19:07   ` Nicolas Pitre
@ 2013-01-30 23:18   ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 11+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-30 23:18 UTC (permalink / raw)
  To: Ruslan Bilovol
  Cc: linux-arm-kernel, linux-omap, linux-kernel, tony, linux,
	eduardo.valentin

On 17:01 Wed 30 Jan     , Ruslan Bilovol wrote:
> 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)
Nack

this break the kernel ABI

and we have now socinfo via sysfs

Best Regards,
J.
> 
> Example:
> 
> / # cat proc/cpuinfo
> [...]
> CPU variant     : 0x2
> CPU part        : 0xc09
> CPU revision    : 10
> 
> SoC name        : OMAP4470
> 
> 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
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 19:07   ` Nicolas Pitre
  2013-01-30 20:37     ` Matt Sealey
@ 2013-01-30 23:24     ` Russell King - ARM Linux
  2013-01-31  0:33       ` Nicolas Pitre
  2013-01-31 11:50       ` Ruslan Bilovol
  1 sibling, 2 replies; 11+ messages in thread
From: Russell King - ARM Linux @ 2013-01-30 23:24 UTC (permalink / raw)
  To: Nicolas Pitre
  Cc: Ruslan Bilovol, linux-arm-kernel, linux-omap, linux-kernel, tony,
	eduardo.valentin

On Wed, Jan 30, 2013 at 02:07:53PM -0500, Nicolas Pitre wrote:
> On Wed, 30 Jan 2013, Ruslan Bilovol wrote:
> 
> > 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
> > 
> > Hardware        : OMAP4 Blaze Tablet
> 
> Please remove that extra blank line between "SoC name" and "Hardware".  
> The blank line after "CPU revision" is fine.
> 
> Also, please rename this to "System name".  Not all systems are "on 
> chip".  By using "System name" this is more universally useful.

You may notice I've already suggested that this should be using the SoC
infrastructure to export this information, which was explicitly designed
to do this.

If we're going to have one SoC doing one thing and another SoC exporting
this information a completely different way, we're doomed.  We need to
make a decision and do it one way and one way only - and that decision
was made when drivers/base/soc.c was merged.

Unfortunately, I'd forgotten about that when I made my initial comments
about the difference between "CPU" and "SoC".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 23:24     ` Russell King - ARM Linux
@ 2013-01-31  0:33       ` Nicolas Pitre
  2013-01-31 11:50       ` Ruslan Bilovol
  1 sibling, 0 replies; 11+ messages in thread
From: Nicolas Pitre @ 2013-01-31  0:33 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Ruslan Bilovol, linux-arm-kernel, linux-omap, linux-kernel, tony,
	eduardo.valentin

On Wed, 30 Jan 2013, Russell King - ARM Linux wrote:

> On Wed, Jan 30, 2013 at 02:07:53PM -0500, Nicolas Pitre wrote:
> > On Wed, 30 Jan 2013, Ruslan Bilovol wrote:
> > 
> > > 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
> > > 
> > > Hardware        : OMAP4 Blaze Tablet
> > 
> > Please remove that extra blank line between "SoC name" and "Hardware".  
> > The blank line after "CPU revision" is fine.
> > 
> > Also, please rename this to "System name".  Not all systems are "on 
> > chip".  By using "System name" this is more universally useful.
> 
> You may notice I've already suggested that this should be using the SoC
> infrastructure to export this information, which was explicitly designed
> to do this.

Absolutely.  If a mechanism is already in place then it should be used.


Nicolas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC PATCH v3 1/2] ARM: kernel: update cpuinfo to print SoC model name
  2013-01-30 23:24     ` Russell King - ARM Linux
  2013-01-31  0:33       ` Nicolas Pitre
@ 2013-01-31 11:50       ` Ruslan Bilovol
  1 sibling, 0 replies; 11+ messages in thread
From: Ruslan Bilovol @ 2013-01-31 11:50 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Nicolas Pitre, linux-arm-kernel, linux-omap, linux-kernel, tony,
	eduardo.valentin

On Thu, Jan 31, 2013 at 1:24 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Jan 30, 2013 at 02:07:53PM -0500, Nicolas Pitre wrote:
>> On Wed, 30 Jan 2013, Ruslan Bilovol wrote:
>>
>> > 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
>> >
>> > Hardware        : OMAP4 Blaze Tablet
>>
>> Please remove that extra blank line between "SoC name" and "Hardware".
>> The blank line after "CPU revision" is fine.
>>
>> Also, please rename this to "System name".  Not all systems are "on
>> chip".  By using "System name" this is more universally useful.
>
> You may notice I've already suggested that this should be using the SoC
> infrastructure to export this information, which was explicitly designed
> to do this.
>
> If we're going to have one SoC doing one thing and another SoC exporting
> this information a completely different way, we're doomed.  We need to
> make a decision and do it one way and one way only - and that decision
> was made when drivers/base/soc.c was merged.
>
> Unfortunately, I'd forgotten about that when I made my initial comments
> about the difference between "CPU" and "SoC".

Yes agree - let's stop this discussion at this point. I'm going to
learn that soc framework and provide better solution.
Unfortunately, I didn't find it when looked into the kernel sources
for similar approaches.

Regards,
Ruslan

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-01-31 11:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-30 15:01 [RFC PATCH v3 0/2] ARM: update cpuinfo to print SoC model name Ruslan Bilovol
2013-01-30 15:01 ` [RFC PATCH v3 1/2] ARM: kernel: " Ruslan Bilovol
2013-01-30 19:07   ` Nicolas Pitre
2013-01-30 20:37     ` Matt Sealey
2013-01-30 21:02       ` Nicolas Pitre
2013-01-30 23:24     ` Russell King - ARM Linux
2013-01-31  0:33       ` Nicolas Pitre
2013-01-31 11:50       ` Ruslan Bilovol
2013-01-30 23:18   ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-30 15:01 ` [RFC PATCH v3 2/2] ARM: OMAP4: setup SoC model name during ID initialisation Ruslan Bilovol
2013-01-30 15:57   ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).