arm64: kernel: add system revision support
authorPeng Du <pdu@nvidia.com>
Mon, 12 Aug 2013 21:42:59 +0000 (14:42 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 22 May 2015 14:27:05 +0000 (22:27 +0800)
Bug 1248538

Change-Id: I272a264ba2904dfc7a2c6d74ab4fbfdd301b8985
Signed-off-by: Peng Du <pdu@nvidia.com>
Reviewed-on: http://git-master/r/260756
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
arch/arm64/include/asm/system_info.h [new file with mode: 0644]
arch/arm64/kernel/setup.c

diff --git a/arch/arm64/include/asm/system_info.h b/arch/arm64/include/asm/system_info.h
new file mode 100644 (file)
index 0000000..7f4d9c7
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __ASM_ARM_SYSTEM_INFO_H
+#define __ASM_ARM_SYSTEM_INFO_H
+
+#ifndef __ASSEMBLY__
+
+/* information about the system we're running on */
+extern unsigned int system_rev;
+extern unsigned int system_serial_low;
+extern unsigned int system_serial_high;
+
+#endif /* !__ASSEMBLY__ */
+
+#endif /* __ASM_ARM_SYSTEM_INFO_H */
index 47cd3ffd5eeb9a6addc43e4da756e5d1409df808..53a90f6a9421162ada9355cb068f466768abb260 100644 (file)
@@ -78,6 +78,16 @@ unsigned int compat_elf_hwcap2 __read_mostly;
 
 static const char *cpu_name;
 static const char *machine_name;
+
+unsigned int system_rev;
+EXPORT_SYMBOL(system_rev);
+
+unsigned int system_serial_low;
+EXPORT_SYMBOL(system_serial_low);
+
+unsigned int system_serial_high;
+EXPORT_SYMBOL(system_serial_high);
+
 phys_addr_t __fdt_pointer __initdata;
 
 /*
@@ -558,6 +568,11 @@ static int c_show(struct seq_file *m, void *v)
                seq_printf(m, "CPU revision\t: %d\n\n", (midr & 0xf));
        }
 
+       seq_printf(m, "Hardware\t: %s\n", machine_name);
+       seq_printf(m, "Revision\t: %04x\n", system_rev);
+       seq_printf(m, "Serial\t\t: %08x%08x\n",
+                  system_serial_high, system_serial_low);
+
        return 0;
 }