From: Peng Du Date: Mon, 12 Aug 2013 21:42:59 +0000 (-0700) Subject: arm64: kernel: add system revision support X-Git-Tag: firefly_0821_release~4124 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a3a744d4dfc60bff89576bb88f9c9d9aac99133d;p=firefly-linux-kernel-4.4.55.git arm64: kernel: add system revision support Bug 1248538 Change-Id: I272a264ba2904dfc7a2c6d74ab4fbfdd301b8985 Signed-off-by: Peng Du Reviewed-on: http://git-master/r/260756 Reviewed-by: Alexander Van Brunt --- diff --git a/arch/arm64/include/asm/system_info.h b/arch/arm64/include/asm/system_info.h new file mode 100644 index 000000000000..7f4d9c7566ac --- /dev/null +++ b/arch/arm64/include/asm/system_info.h @@ -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 */ diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 47cd3ffd5eeb..53a90f6a9421 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -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; }