summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-03-24 22:38:23 +0100
committerHans de Goede <hdegoede@redhat.com>2016-03-31 14:26:52 +0200
commitc74384c68011c894a3543f7aca7bc387c1ab4a16 (patch)
tree772ad5a0194ced45f9f64c200fb2fb9a97fde81a /arch/arm
parent5f8afd704c09a557f7303eac22d18c76f855c1cb (diff)
sunxi: Print soc-id from sram controller for sun8i boards
As the need for various magic sram pokes has shown this maybe useful info to have. e.g. this shows one of my a23 tablets having an id of 1661 rather then the usual 1650 for the a23. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/cpu/armv7/sunxi/cpu_info.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/cpu_info.c b/arch/arm/cpu/armv7/sunxi/cpu_info.c
index b9bc70ca86..c0eabdf91d 100644
--- a/arch/arm/cpu/armv7/sunxi/cpu_info.c
+++ b/arch/arm/cpu/armv7/sunxi/cpu_info.c
@@ -38,6 +38,20 @@ int sunxi_get_ss_bonding_id(void)
}
#endif
+#ifdef CONFIG_MACH_SUN8I
+uint sunxi_get_sram_id(void)
+{
+ uint id;
+
+ /* Unlock sram info reg, read it, relock */
+ setbits_le32(SUNXI_SRAMC_BASE + 0x24, (1 << 15));
+ id = readl(SUNXI_SRAMC_BASE + 0x24) >> 16;
+ clrbits_le32(SUNXI_SRAMC_BASE + 0x24, (1 << 15));
+
+ return id;
+}
+#endif
+
#ifdef CONFIG_DISPLAY_CPUINFO
int print_cpuinfo(void)
{
@@ -66,15 +80,15 @@ int print_cpuinfo(void)
#elif defined CONFIG_MACH_SUN7I
puts("CPU: Allwinner A20 (SUN7I)\n");
#elif defined CONFIG_MACH_SUN8I_A23
- puts("CPU: Allwinner A23 (SUN8I)\n");
+ printf("CPU: Allwinner A23 (SUN8I %04x)\n", sunxi_get_sram_id());
#elif defined CONFIG_MACH_SUN8I_A33
- puts("CPU: Allwinner A33 (SUN8I)\n");
+ 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());
#elif defined CONFIG_MACH_SUN8I_H3
- puts("CPU: Allwinner H3 (SUN8I)\n");
+ printf("CPU: Allwinner H3 (SUN8I %04x)\n", sunxi_get_sram_id());
#elif defined CONFIG_MACH_SUN9I
puts("CPU: Allwinner A80 (SUN9I)\n");
-#elif defined CONFIG_MACH_SUN8I_A83T
- puts("CPU: Allwinner A83T (SUN8I)\n");
#else
#warning Please update cpu_info.c with correct CPU information
puts("CPU: SUNXI Family\n");