From patchwork Thu Feb 14 11:55:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruslan Bilovol X-Patchwork-Id: 2141381 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 0483CE00D9 for ; Thu, 14 Feb 2013 11:56:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934126Ab3BNL4A (ORCPT ); Thu, 14 Feb 2013 06:56:00 -0500 Received: from mail-wg0-f41.google.com ([74.125.82.41]:53528 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934107Ab3BNLz6 (ORCPT ); Thu, 14 Feb 2013 06:55:58 -0500 Received: by mail-wg0-f41.google.com with SMTP id ds1so5063837wgb.0 for ; Thu, 14 Feb 2013 03:55:57 -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=RI0939yNQNAB3/qf5mPswuDHidL5a65MmtSD/13SGGg=; b=jNkxyArrDEMFMFuhtqIhIfjKsXIF53jIfmBy4780cRTyslpV5ieqTQinH6UKJNicbW Vkoq2KHaHe686uyho6VLOLFK1Jyw3mYhQR/CbvGOQdoIO71jDZOWS0wM8aRTab6VcPRK lAp4VO0KZFuQzD8fWeqn23ghBu35nzlLfri6R3ViyBjXdr2rPoHCTLiczOyuLSjDTn0g bTc6LeMW3TfYna6bLAuX6rQ3zUsrl747V5zGtaPaIj+rAwmFMfgVOCTZJ0xc4zstYkoX Ja0GlE5WOF3XD6xTgOhv4ucPNgBuW+5U0CNqZB8pTWvSslnT/2eCIwYkWgJf4t2cOOxy p1HQ== X-Received: by 10.194.92.231 with SMTP id cp7mr29324602wjb.19.1360842947172; Thu, 14 Feb 2013 03:55:47 -0800 (PST) Received: from localhost ([195.238.93.36]) by mx.google.com with ESMTPS id dw1sm1499585wib.5.2013.02.14.03.55.44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 14 Feb 2013 03:55:46 -0800 (PST) From: Ruslan Bilovol To: tony@atomide.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/3] ARM: OMAP2+: SoC name and revision unification Date: Thu, 14 Feb 2013 13:55:23 +0200 Message-Id: <1360842924-32429-3-git-send-email-ruslan.bilovol@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360842924-32429-1-git-send-email-ruslan.bilovol@ti.com> References: <1360842924-32429-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 This is a long story where for each new generation of OMAP we used different approaches for creating strings for SoCs names and revisions that this patch fixes. It makes future exporting of this information to SoC infrastructure easier. Signed-off-by: Ruslan Bilovol --- arch/arm/mach-omap2/id.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 8a68f1e..3737700 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -31,8 +31,11 @@ #define OMAP4_SILICON_TYPE_STANDARD 0x01 #define OMAP4_SILICON_TYPE_PERFORMANCE 0x02 +#define OMAP_SOC_MAX_NAME_LENGTH 16 + static unsigned int omap_revision; -static const char *cpu_rev; +static char soc_name[OMAP_SOC_MAX_NAME_LENGTH]; +static char soc_rev[OMAP_SOC_MAX_NAME_LENGTH]; u32 omap_features; unsigned int omap_rev(void) @@ -169,9 +172,12 @@ void __init omap2xxx_check_revision(void) j = i; } - pr_info("OMAP%04x", omap_rev() >> 16); + sprintf(soc_name, "OMAP%04x", omap_rev() >> 16); + sprintf(soc_rev, "ES%x", (omap_rev() >> 12) & 0xf); + + pr_info("%s", soc_name); if ((omap_rev() >> 8) & 0x0f) - pr_info("ES%x", (omap_rev() >> 12) & 0xf); + pr_info("%s", soc_rev); pr_info("\n"); } @@ -211,8 +217,10 @@ static void __init omap3_cpuinfo(void) cpu_name = "OMAP3503"; } + sprintf(soc_name, "%s", cpu_name); + /* Print verbose information */ - pr_info("%s ES%s (", cpu_name, cpu_rev); + pr_info("%s %s (", soc_name, soc_rev); OMAP3_SHOW_FEATURE(l2cache); OMAP3_SHOW_FEATURE(iva); @@ -291,6 +299,7 @@ void __init ti81xx_check_features(void) void __init omap3xxx_check_revision(void) { + const char *cpu_rev; u32 cpuid, idcode; u16 hawkeye; u8 rev; @@ -438,6 +447,7 @@ void __init omap3xxx_check_revision(void) cpu_rev = "1.2"; pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n"); } + sprintf(soc_rev, "ES%s", cpu_rev); } void __init omap4xxx_check_revision(void) @@ -512,8 +522,10 @@ 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(soc_name, "OMAP%04x", omap_rev() >> 16); + sprintf(soc_rev, "ES%d.%d", (omap_rev() >> 12) & 0xf, + (omap_rev() >> 8) & 0xf); + pr_info("%s %s\n", soc_name, soc_rev); } void __init omap5xxx_check_revision(void) @@ -547,8 +559,10 @@ void __init omap5xxx_check_revision(void) omap_revision = OMAP5430_REV_ES1_0; } - pr_info("OMAP%04x ES%d.0\n", - omap_rev() >> 16, ((omap_rev() >> 12) & 0xf)); + sprintf(soc_name, "OMAP%04x", omap_rev() >> 16); + sprintf(soc_rev, "ES%d.0", (omap_rev() >> 12) & 0xf); + + pr_info("%s %s\n", soc_name, soc_rev); } /*