arm64: cpuinfo: add system serial support
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / kernel / cpuinfo.c
index 95a6fae54740e003a0b9b947a15954c389548f9b..fa51b6ddaceafa88b1e9c7edc2ef54de22217d4e 100644 (file)
 #include <linux/smp.h>
 #include <linux/delay.h>
 
+unsigned int system_serial_low;
+EXPORT_SYMBOL(system_serial_low);
+
+unsigned int system_serial_high;
+EXPORT_SYMBOL(system_serial_high);
+
 /*
  * In case the boot CPU is hotpluggable, we record its initial state and
  * current state separately. Certain system registers may contain different
@@ -104,7 +110,8 @@ static const char *const compat_hwcap2_str[] = {
 static int c_show(struct seq_file *m, void *v)
 {
        int i, j;
-       bool compat = personality(current->personality) == PER_LINUX32;
+       bool compat = personality(current->personality) == PER_LINUX32 ||
+                     is_compat_task();
 
        for_each_online_cpu(i) {
                struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
@@ -156,6 +163,9 @@ static int c_show(struct seq_file *m, void *v)
                seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
        }
 
+       seq_printf(m, "Serial\t\t: %08x%08x\n",
+                  system_serial_high, system_serial_low);
+
        return 0;
 }