1 From aabfcb0abbc34ca5f3c4b4f872123166eca2e100 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Tue, 3 Sep 2019 18:17:25 +0100
4 Subject: [PATCH 777/806] arch/arm64: Add Revision, Serial, Model to cpuinfo
6 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 arch/arm64/kernel/cpuinfo.c | 25 +++++++++++++++++++++++++
9 1 file changed, 25 insertions(+)
11 --- a/arch/arm64/kernel/cpuinfo.c
12 +++ b/arch/arm64/kernel/cpuinfo.c
14 #include <linux/elf.h>
15 #include <linux/init.h>
16 #include <linux/kernel.h>
17 +#include <linux/of_platform.h>
18 #include <linux/personality.h>
19 #include <linux/preempt.h>
20 #include <linux/printk.h>
21 @@ -126,6 +127,10 @@ static int c_show(struct seq_file *m, vo
24 bool compat = personality(current->personality) == PER_LINUX32;
25 + struct device_node *np;
30 for_each_online_cpu(i) {
31 struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
32 @@ -177,6 +182,26 @@ static int c_show(struct seq_file *m, vo
33 seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
36 + seq_printf(m, "Hardware\t: BCM2835\n");
38 + np = of_find_node_by_path("/system");
40 + if (!of_property_read_u32(np, "linux,revision", &revision))
41 + seq_printf(m, "Revision\t: %04x\n", revision);
45 + np = of_find_node_by_path("/");
47 + if (!of_property_read_string(np, "serial-number",
49 + seq_printf(m, "Serial\t\t: %s\n", serial);
50 + if (!of_property_read_string(np, "model",
52 + seq_printf(m, "Model\t\t: %s\n", model);