From patchwork Fri May 31 22:42:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 248034 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 BD52A2C007E for ; Sat, 1 Jun 2013 08:44:33 +1000 (EST) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiY2W-0004M3-L4; Fri, 31 May 2013 22:43:17 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiY1x-0004my-Rw; Fri, 31 May 2013 22:42:41 +0000 Received: from mail-ye0-f177.google.com ([209.85.213.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UiY1v-0004mK-G5 for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2013 22:42:40 +0000 Received: by mail-ye0-f177.google.com with SMTP id l8so510478yen.36 for ; Fri, 31 May 2013 15:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=OvDH+448NGUZPLkuNhIYmRvpzCEvxn18m50yjlVO4jU=; b=USmx4ZjrOZEQTaZiO4Pn2Wk4TKVclunheRXCbOtTjc2sMxIsDTlvuOs8H4MgGIAw/T 3BfiYPYxsL7ihsqm8QB5wtyJNUvIdEECwWlrFOWUMHWf30P9vrFd3y6Z/eW9b+kiTaBB 1qWNgOwtowflbB1ZzGPwO83k96CYjuByoHCKNhVIGXvE0ITyBtYSK0AhuQqprvlNjDWo P23FiT1MWPIjkcyngH89w3vxCSBNeV4YTXThR+0wj2fuVaw7D1NSZpGDdTokkdZK9hHH RYs+t4EAA3tARJLHC9H2Kl2vruMgPMwVpdgb1OEusSHldbb2z3NyXS5Veh/4wwVRnm/T J8Hg== X-Received: by 10.236.32.38 with SMTP id n26mr8146396yha.49.1370040138521; Fri, 31 May 2013 15:42:18 -0700 (PDT) Received: from localhost.localdomain ([189.101.179.164]) by mx.google.com with ESMTPSA id m74sm70881008yhm.0.2013.05.31.15.42.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 15:42:18 -0700 (PDT) From: Fabio Estevam To: shawn.guo@linaro.org Subject: [PATCH v2 2/2] ARM: mxs: Pass the system revision Date: Fri, 31 May 2013 19:42:07 -0300 Message-Id: <1370040127-15072-2-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370040127-15072-1-git-send-email-festevam@gmail.com> References: <1370040127-15072-1-git-send-email-festevam@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130531_184239_666435_FFA04A45 X-CRM114-Status: GOOD ( 12.01 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , MIME-Version: 1.0 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 From: Fabio Estevam 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 --- Changes since v1: - No changes 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 462fa14..0d7e1eb 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" @@ -442,12 +443,26 @@ 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) { const char *cpu_char = mxs_get_cpu_type(); int cpu_rev = mxs_get_cpu_rev(); mxs_print_silicon_rev(cpu_char, cpu_rev); + mxs_pass_sysrev(); if (of_machine_is_compatible("fsl,imx28-evk")) imx28_evk_init();