summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-08-25 17:02:31 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-08-28 13:11:31 +0900
commit499c8679be13383c44a1f277d5b0d7c63b6b2008 (patch)
treec6f818addea033ac089ec38600d0fc3090c55b4e /arch
parent928f3248b3e81a9fdaa818cf3aa02e5daef7015d (diff)
downloadu-boot-imx-499c8679be13383c44a1f277d5b0d7c63b6b2008.zip
u-boot-imx-499c8679be13383c44a1f277d5b0d7c63b6b2008.tar.gz
u-boot-imx-499c8679be13383c44a1f277d5b0d7c63b6b2008.tar.bz2
ARM: uniphier: display revision of Micro Support Card 3.6.x kindly
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 <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-uniphier/micro-support-card.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mach-uniphier/micro-support-card.c b/arch/arm/mach-uniphier/micro-support-card.c
index eeb515a..6987d1e 100644
--- a/arch/arm/mach-uniphier/micro-support-card.c
+++ b/arch/arm/mach-uniphier/micro-support-card.c
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ * Copyright (C) 2012-2015 Panasonic Corporation
+ * Copyright (C) 2015-2016 Socionext Inc.
+ * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -38,7 +40,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;
}