From patchwork Wed May 29 19:44:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 247391 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 57DBD2C0097 for ; Thu, 30 May 2013 05:47:20 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UhmKd-00042p-It; Wed, 29 May 2013 19:46:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UhmKT-0006fr-Oq; Wed, 29 May 2013 19:46:37 +0000 Received: from am1ehsobe001.messaging.microsoft.com ([213.199.154.204] helo=am1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UhmKR-0006eV-5U for linux-arm-kernel@lists.infradead.org; Wed, 29 May 2013 19:46:35 +0000 Received: from mail98-am1-R.bigfish.com (10.3.201.250) by AM1EHSOBE018.bigfish.com (10.3.207.140) with Microsoft SMTP Server id 14.1.225.23; Wed, 29 May 2013 19:46:12 +0000 Received: from mail98-am1 (localhost [127.0.0.1]) by mail98-am1-R.bigfish.com (Postfix) with ESMTP id 2A29BC0116; Wed, 29 May 2013 19:46:12 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1155h) Received: from mail98-am1 (localhost.localdomain [127.0.0.1]) by mail98-am1 (MessageSwitch) id 1369856707104492_16202; Wed, 29 May 2013 19:45:07 +0000 (UTC) Received: from AM1EHSMHS003.bigfish.com (unknown [10.3.201.247]) by mail98-am1.bigfish.com (Postfix) with ESMTP id 767392A00BE; Wed, 29 May 2013 19:44:53 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS003.bigfish.com (10.3.207.103) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 29 May 2013 19:44:50 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.328.11; Wed, 29 May 2013 19:45:47 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.244.74]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r4TJijE5030606; Wed, 29 May 2013 12:44:47 -0700 From: Fabio Estevam To: Subject: [PATCH 2/2] ARM: mxs: Pass the system revision Date: Wed, 29 May 2013 16:44:23 -0300 Message-ID: <1369856663-29314-2-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369856663-29314-1-git-send-email-fabio.estevam@freescale.com> References: <1369856663-29314-1-git-send-email-fabio.estevam@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130529_154635_444439_45D430FA X-CRM114-Status: GOOD ( 11.02 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [213.199.154.204 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Fabio Estevam , linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Some mxs userspace tools, such as multimedia plugins and kobs-ng (tool used to burn boot images to NAND) rely on the 'Revision' field reported by '/proc/cpuinfo'. Provide a mechanism to pass such information, so that now we can get: $ cat /proc/cpuinfo processor : 0 model name : ARM926EJ-S rev 5 (v5l) BogoMIPS : 226.09 Features : swp half fastmult edsp java CPU implementer : 0x41 CPU architecture: 5TEJ CPU variant : 0x0 CPU part : 0x926 CPU revision : 5 Hardware : Freescale i.MX28 Evaluation Kit Revision : 28012 Serial : 0000000000000000 Signed-off-by: Fabio Estevam --- arch/arm/mach-mxs/mach-mxs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index b632323..032812d 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "pm.h" @@ -443,10 +444,24 @@ static void mxs_print_silicon_rev(const char *cpu, int srev) cpu, (srev >> 4) & 0xf, srev & 0xf); } +static void mxs_pass_sysrev(void) +{ + int cputype = 0; + + if (strcmp(mxs_get_cpu_type(), "MX23")) + cputype = 0x23000; + + if (strcmp(mxs_get_cpu_type(), "MX28")) + cputype = 0x28000; + + system_rev = (cputype | mxs_get_cpu_rev()); +} + static void __init mxs_machine_init(void) { mxs_print_silicon_rev(mxs_get_cpu_type(), mxs_get_cpu_rev()); + mxs_pass_sysrev(); if (of_machine_is_compatible("fsl,imx28-evk")) imx28_evk_init();