From patchwork Thu Aug 25 08:02:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 74666 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp710691qga; Thu, 25 Aug 2016 01:01:42 -0700 (PDT) X-Received: by 10.28.22.70 with SMTP id 67mr28937451wmw.52.1472112102295; Thu, 25 Aug 2016 01:01:42 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id 9si12637856wjg.16.2016.08.25.01.01.42; Thu, 25 Aug 2016 01:01:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA4FDA757B; Thu, 25 Aug 2016 10:01:25 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XKSoXzmDXPRC; Thu, 25 Aug 2016 10:01:25 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5946CA7581; Thu, 25 Aug 2016 10:01:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA9394BA5C for ; Thu, 25 Aug 2016 10:00:59 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2TBG85FoBWxR for ; Thu, 25 Aug 2016 10:00:59 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-07.nifty.com (conuserg-07.nifty.com [210.131.2.74]) by theia.denx.de (Postfix) with ESMTPS id 34D82A7535 for ; Thu, 25 Aug 2016 10:00:55 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id u7P80TwD018443; Thu, 25 Aug 2016 17:00:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com u7P80TwD018443 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1472112030; bh=R53esX0NI6XnJNFAhtEBPWIv08uGwrfU3/gaKas2cfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wtMA7+9BAvV973yFnpOVdaEycaKQExnbHfJye3FKHiZvmohAo3jKAMpUeVkIE+Ezx VvaH/KBbLfiwJuaXaVzQdKm/uDSeOEGerVa6M/dtNtwmi8EZjhAmT+9StkcJH4Sfml oTMToxE0YjxVFHFTv0DQUAcXp1dEfvZPOeiDknxi0AoGZ0ZvYl3hBKiW9nf3p7IQhz aDvlAxuZ1ytf9AFsjYPBhsOFq9DWf9E89tcl9pbecSvSb3xtAyjU8Jw+6KrdyhS4rW 32gC0heNxXRnd750dZzN5ZzQMBqobJW6LCHCwXl81TBV1ghuO7c5QrSrBgT052Hv39 GGQoNkYnHWEvA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 25 Aug 2016 17:02:31 +0900 Message-Id: <1472112154-6156-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472112154-6156-1-git-send-email-yamada.masahiro@socionext.com> References: <1472112154-6156-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 1/3] ARM: uniphier: display revision of Micro Support Card 3.6.x kindly X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The revision of the original support card (rev 3.5, rev 3.6) fits in the 8 bit width revision register. When it was extended in a weird way, it was versioned in the format of "3.6.x" (where it should have been "3.7", of course). What is worse, only the sub-level version "6.x" was recorded in the 8 bit width register, completely ignoring the compatibility of the revision register format. This patch saves madly-versioned support cards by assuming the major version "3" when the MSB 4 bit of the register is read as "6". With this, the support card revision that were displayed as "6.10" is now corrected to "3.6.10". Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/micro-support-card.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/mach-uniphier/micro-support-card.c b/arch/arm/mach-uniphier/micro-support-card.c index eeb515a..c1c51ef 100644 --- a/arch/arm/mach-uniphier/micro-support-card.c +++ b/arch/arm/mach-uniphier/micro-support-card.c @@ -38,7 +38,12 @@ static int support_card_show_revision(void) u32 revision; revision = readl(MICRO_SUPPORT_CARD_REVISION); - printf("(CPLD version %d.%d)\n", revision >> 4, revision & 0xf); + revision &= 0xff; + + /* revision 3.6.x card changed the revision format */ + printf("(CPLD version %s%d.%d)\n", revision >> 4 == 6 ? "3." : "", + revision >> 4, revision & 0xf); + return 0; }