1 From 1c2be61a1a6e2eb7cc8b337d732563609f5d8299 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 013/381] 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 | 9 +++++++++
26 1 file changed, 9 insertions(+)
28 --- a/arch/arm/mach-bcm/board_bcm2835.c
29 +++ b/arch/arm/mach-bcm/board_bcm2835.c
31 #include <linux/of_address.h>
32 #include <linux/of_platform.h>
33 #include <linux/clk/bcm2835.h>
34 +#include <asm/system_info.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/map.h>
39 static void __init bcm2835_init(void)
41 + struct device_node *np = of_find_node_by_path("/system");
46 bcm2835_init_clocks();
47 @@ -33,6 +37,11 @@ static void __init bcm2835_init(void)
48 pr_err("of_platform_populate failed: %d\n", ret);
52 + if (!of_property_read_u32(np, "linux,revision", &val))
54 + if (!of_property_read_u64(np, "linux,serial", &val64))
55 + system_serial_low = val64;
58 static const char * const bcm2835_compat[] = {