From patchwork Wed Jan 30 00:38:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruslan Bilovol X-Patchwork-Id: 2064381 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3F95EDF23E for ; Wed, 30 Jan 2013 00:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753360Ab3A3Aj0 (ORCPT ); Tue, 29 Jan 2013 19:39:26 -0500 Received: from mail-la0-f52.google.com ([209.85.215.52]:41812 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753250Ab3A3AjL (ORCPT ); Tue, 29 Jan 2013 19:39:11 -0500 Received: by mail-la0-f52.google.com with SMTP id fs12so708299lab.39 for ; Tue, 29 Jan 2013 16:39:09 -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=P9lpnfJ9WS3MRGiWTFFN4OOLYV00FxTBIi5OH0YPAwk=; b=FWIeZx94Zp0b9hrUN+teNV0vq7IxpfCI+DNOoWqWdY/iyVGxohnqmzhzKlxLvWDwz1 Y4uAflGgWh4iuJTGTHLpPrdKrfyCIV1jeUyMi3rIttxHXt+/7LFNX/r4/19pD9h2wc+Y bTGYl8u9Mk7YIJ1YFcYQ69FmUnziFEWOkxl5LRYaDLJ2AwhmgELknwF7onAGyVhxELwv oxJkumYEvJaozcnhQbG6uf551ZvR7siIx4uzelM+EWw3pGd1e8MLwIDSTWgb2VgdfVCT KZIhZ2cg67wzs/xiXjw4qFAJjLn2fMur+rmFtY21NoAVQXFbew0vReqneLw3KHW1tKwT 6pfw== X-Received: by 10.112.10.232 with SMTP id l8mr1206052lbb.69.1359506349535; Tue, 29 Jan 2013 16:39:09 -0800 (PST) Received: from localhost (diamondly-something.volia.net. [93.74.62.0]) by mx.google.com with ESMTPS id ft8sm5787376lab.9.2013.01.29.16.39.07 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 29 Jan 2013 16:39:08 -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 2/2] ARM: OMAP4: setup SoC model name during ID initialisation Date: Wed, 30 Jan 2013 02:38:57 +0200 Message-Id: <1359506337-21619-3-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 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 --- 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 #include +#include #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)