brcm2708: rename target to bcm27xx
[openwrt/staging/wigyori.git] / target / linux / bcm27xx / patches-4.19 / 950-0675-arch-arm-Add-model-string-to-cpuinfo.patch
1 From d9f55647637be79ff42cb85497e43ca8b9a69a7b Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Tue, 3 Sep 2019 18:16:56 +0100
4 Subject: [PATCH] arch/arm: Add model string to cpuinfo
5
6 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
7 ---
8 arch/arm/kernel/setup.c | 10 ++++++++++
9 1 file changed, 10 insertions(+)
10
11 --- a/arch/arm/kernel/setup.c
12 +++ b/arch/arm/kernel/setup.c
13 @@ -1238,6 +1238,8 @@ static int c_show(struct seq_file *m, vo
14 {
15 int i, j;
16 u32 cpuid;
17 + struct device_node *np;
18 + const char *model;
19
20 for_each_online_cpu(i) {
21 /*
22 @@ -1297,6 +1299,14 @@ static int c_show(struct seq_file *m, vo
23 seq_printf(m, "Revision\t: %04x\n", system_rev);
24 seq_printf(m, "Serial\t\t: %s\n", system_serial);
25
26 + np = of_find_node_by_path("/");
27 + if (np) {
28 + if (!of_property_read_string(np, "model",
29 + &model))
30 + seq_printf(m, "Model\t\t: %s\n", model);
31 + of_node_put(np);
32 + }
33 +
34 return 0;
35 }
36