diff mbox

[U-Boot,V2,5/8] sun8i: Display silicon revision of A83t processors

Message ID 6357ee35427556a22cd731acbc92867d.squirrel@vali.starlink.edu
State Superseded
Delegated to: Hans de Goede
Headers show

Commit Message

Timothy Pearson May 17, 2016, 7:36 p.m. UTC
There are two versions of the A83t processor; per the provided
Linux code from Allwinner revisions A and B can be distingushed
by the lower bit of the SRAM ID register.  The distinction is
important because revision B requires a SMP bringup workaround.

Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com>
---
 arch/arm/mach-sunxi/cpu_info.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/arch/arm/mach-sunxi/cpu_info.c b/arch/arm/mach-sunxi/cpu_info.c
index 76b6719..d552061 100644
--- a/arch/arm/mach-sunxi/cpu_info.c
+++ b/arch/arm/mach-sunxi/cpu_info.c
@@ -50,6 +50,17 @@  uint sunxi_get_sram_id(void)

 	return id;
 }
+
+uint sunxi_get_revision(void)
+{
+	uint rev;
+
+	/* Unlock sram info reg, read it, relock */
+	rev = readl(SUNXI_SRAMC_BASE + 0x24) & 0x1;
+
+	return rev;
+}
+
 #endif

 #ifdef CONFIG_DISPLAY_CPUINFO
@@ -84,7 +95,7 @@  int print_cpuinfo(void)
 #elif defined CONFIG_MACH_SUN8I_A33
 	printf("CPU:   Allwinner A33 (SUN8I %04x)\n", sunxi_get_sram_id());
 #elif defined CONFIG_MACH_SUN8I_A83T
-	printf("CPU:   Allwinner A83T (SUN8I %04x)\n", sunxi_get_sram_id());
+	printf("CPU:   Allwinner A83T (SUN8I %04x rev. %s)\n", sunxi_get_sram_id(), (sunxi_get_revision() == 0)?"A":"B");
 #elif defined CONFIG_MACH_SUN8I_H3
 	printf("CPU:   Allwinner H3 (SUN8I %04x)\n", sunxi_get_sram_id());
 #elif defined CONFIG_MACH_SUN9I