From patchwork Wed Jan 30 15:01:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruslan Bilovol X-Patchwork-Id: 2068311 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 AD4A43FD56 for ; Wed, 30 Jan 2013 15:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754955Ab3A3PBo (ORCPT ); Wed, 30 Jan 2013 10:01:44 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:38696 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753818Ab3A3PBk (ORCPT ); Wed, 30 Jan 2013 10:01:40 -0500 Received: by mail-wi0-f177.google.com with SMTP id hm14so1732939wib.10 for ; Wed, 30 Jan 2013 07:01:38 -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=e/gNN+OFGfVK2SUS3IwRyXzmNqY2RG73a7+usJlGWtI=; b=kq5im+Hk69MhYB5U4c+qfH1M9eKnG/aPHPn+Ags1gB4EDG+rUUFUkl7IR2LuBrx+Pl loqi8Mshhhb/DrOLud6WoztcB9SZkhNDkoXdGWgvJ7FtuyezyY4QF8ZsTESo13CNr2Er hP6T3KpRKj5KPlEK7fxFh5Q3yYirqbrc+/qO6Swgtylz84KqGdQ66a3oVl1C4MTOOd0d do/SA9FsMrA9IRkGaqECcvkQoBNPr9gpwqNqZdY+M+qJOkniMxQTx+9e3Z65YWnYUKbu j7Ck7ucVNHFXB5UOiyTFnbw5mkDI2I21BeHuSpxMyFv5cSb8Kqy6sQDlYDWc2uKLUyGq z3fw== X-Received: by 10.194.177.199 with SMTP id cs7mr9560161wjc.41.1359558098350; Wed, 30 Jan 2013 07:01:38 -0800 (PST) Received: from localhost ([195.238.93.36]) by mx.google.com with ESMTPS id m6sm3451671wic.2.2013.01.30.07.01.36 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 30 Jan 2013 07:01:37 -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 v3 1/2] ARM: kernel: update cpuinfo to print SoC model name Date: Wed, 30 Jan 2013 17:01:30 +0200 Message-Id: <1359558091-29251-2-git-send-email-ruslan.bilovol@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359558091-29251-1-git-send-email-ruslan.bilovol@ti.com> References: <1359558091-29251-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 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",