From patchwork Wed Jan 30 00:38:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruslan Bilovol X-Patchwork-Id: 2064351 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2D94A40106 for ; Wed, 30 Jan 2013 00:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753256Ab3A3AjK (ORCPT ); Tue, 29 Jan 2013 19:39:10 -0500 Received: from mail-lb0-f181.google.com ([209.85.217.181]:53379 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467Ab3A3AjH (ORCPT ); Tue, 29 Jan 2013 19:39:07 -0500 Received: by mail-lb0-f181.google.com with SMTP id gm6so1450734lbb.26 for ; Tue, 29 Jan 2013 16:39:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=oItbq6MyoswjHXoFPYazRreVog6ZgHFbljFaTzHOtEo=; b=TzY1nhV99CxtR/All3Fc0akdN9o8Wjvmr2M39FzBeB/F1ImD7o6gLdjCjwFlUnotIn XyRyy6z0bFR2MzHTdXGYPO6FljS7SlfDb+ZnU3m8b1Z5UX63ndWpZrbhlwXd5SwWVtrs 0al+535YdwDK+eAW0MApyqrYu1c7znpJNm+lBzIwGN3/+rRZOYoipVRsSK2KydtmfVjF hxlvkALxc277L3MHq2vd3Ka59EOGmOjU881wRekawWHVvfPVpIUlIxVFr3RpriIyIwEy Kdy56eEcJrS1NQIbiiID4UkrIaaOAExaC7tcdBx8weTFUvbjwd1k+dhVEISI/zFw6tQq kgzw== X-Received: by 10.152.144.4 with SMTP id si4mr2836368lab.10.1359506345381; Tue, 29 Jan 2013 16:39:05 -0800 (PST) Received: from localhost (diamondly-something.volia.net. [93.74.62.0]) by mx.google.com with ESMTPS id ft8sm5787410lab.9.2013.01.29.16.39.03 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 29 Jan 2013 16:39:04 -0800 (PST) From: Ruslan Bilovol To: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, tony@atomide.com, linux@arm.linux.org.uk, eduardo.valentin@ti.com Subject: [RFC PATCH v2 1/2] ARM: kernel: update cpuinfo to print SoC model name Date: Wed, 30 Jan 2013 02:38:56 +0200 Message-Id: <1359506337-21619-2-git-send-email-ruslan.bilovol@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359506337-21619-1-git-send-email-ruslan.bilovol@ti.com> References: <1359506337-21619-1-git-send-email-ruslan.bilovol@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- 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",