1 From 14cd948e16714fd0d2c08763aebd641136117421 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Wed, 3 Jun 2015 12:26:13 +0200
4 Subject: [PATCH] ARM: bcm2835: Set Serial number and Revision
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 The VideoCore bootloader passes in Serial number and
10 Revision number through Device Tree. Make these available to
11 userspace through /proc/cpuinfo.
15 There is a commit in linux-next that standardize passing the serial
16 number through Device Tree (string: /serial-number):
17 ARM: 8355/1: arch: Show the serial number from devicetree in cpuinfo
19 There was an attempt to do the same with the revision number, but it
21 [PATCH v2 1/2] arm: devtree: Set system_rev from DT revision
23 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
25 arch/arm/mach-bcm/board_bcm2835.c | 14 ++++++++++++++
26 1 file changed, 14 insertions(+)
28 --- a/arch/arm/mach-bcm/board_bcm2835.c
29 +++ b/arch/arm/mach-bcm/board_bcm2835.c
31 #include <linux/init.h>
32 #include <linux/irqchip.h>
33 #include <linux/of_address.h>
34 +#include <asm/system_info.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/map.h>
41 +static void __init bcm2835_init(void)
43 + struct device_node *np = of_find_node_by_path("/system");
47 + if (!of_property_read_u32(np, "linux,revision", &val))
49 + if (!of_property_read_u64(np, "linux,serial", &val64))
50 + system_serial_low = val64;
53 static const char * const bcm2835_compat[] = {
54 #ifdef CONFIG_ARCH_MULTI_V6
56 @@ -24,6 +37,7 @@ static const char * const bcm2835_compat
59 DT_MACHINE_START(BCM2835, "BCM2835")
60 + .init_machine = bcm2835_init,
61 .dt_compat = bcm2835_compat,
62 .smp = smp_ops(bcm2836_smp_ops),