arch/arm: Add model string to cpuinfo
authorPhil Elwell <phil@raspberrypi.org>
Tue, 3 Sep 2019 17:16:56 +0000 (18:16 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:03:57 +0000 (16:03 +0000)
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
arch/arm/kernel/setup.c

index 284a80c..12e73ce 100644 (file)
@@ -1264,6 +1264,8 @@ static int c_show(struct seq_file *m, void *v)
 {
        int i, j;
        u32 cpuid;
+       struct device_node *np;
+       const char *model;
 
        for_each_online_cpu(i) {
                /*
@@ -1323,6 +1325,14 @@ static int c_show(struct seq_file *m, void *v)
        seq_printf(m, "Revision\t: %04x\n", system_rev);
        seq_printf(m, "Serial\t\t: %s\n", system_serial);
 
+       np = of_find_node_by_path("/");
+       if (np) {
+               if (!of_property_read_string(np, "model",
+                                            &model))
+                       seq_printf(m, "Model\t\t: %s\n", model);
+               of_node_put(np);
+       }
+
        return 0;
 }