diff options
author | Tomasz Figa <t.figa@samsung.com> | 2013-09-26 19:14:37 +0200 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-03-20 17:41:13 +0900 |
commit | efafb5dc1062d0ae8ff9d03339e86d05e1c1d9c6 (patch) | |
tree | 0b03fb33e83be623647597e431e25c479a6e4783 /drivers/of | |
parent | 52fe2de8566b2b8b333121b0d75444deb4e78ff8 (diff) | |
download | linux-3.10-efafb5dc1062d0ae8ff9d03339e86d05e1c1d9c6.tar.gz linux-3.10-efafb5dc1062d0ae8ff9d03339e86d05e1c1d9c6.tar.bz2 linux-3.10-efafb5dc1062d0ae8ff9d03339e86d05e1c1d9c6.zip |
OF: fdt: Add support for parsing system serial number from device tree
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/fdt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index a829c28cd84..860dddf0255 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -19,6 +19,7 @@ #include <linux/slab.h> #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ +#include <asm/system_info.h> #ifdef CONFIG_PPC #include <asm/machdep.h> #endif /* CONFIG_PPC */ @@ -741,6 +742,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, int depth, void *data) { unsigned long l; + __be32 *serial; char *p; pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname); @@ -751,6 +753,13 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, early_init_dt_check_for_initrd(node); + /* Retrieve serial number */ + serial = of_get_flat_dt_prop(node, "linux,serial-number", &l); + if (serial != NULL && l == 2 * sizeof(u32)) { + system_serial_high = be32_to_cpu(serial[0]); + system_serial_low = be32_to_cpu(serial[1]); + } + /* Retrieve command line */ p = of_get_flat_dt_prop(node, "bootargs", &l); if (p != NULL && l > 0) |