diff options
author | Alexandre Pereira da Silva <aletes.xgr@gmail.com> | 2012-07-20 08:01:51 -0400 |
---|---|---|
committer | Roland Stigge <stigge@antcom.de> | 2012-07-20 08:01:51 -0400 |
commit | e39942f527fb02b73236d872d22c1b6b8335266c (patch) | |
tree | 7bda3b7b6601a381e8d413e3a82a2de9d9248c04 | |
parent | 8ba85f8bffdfbac98dac8630406f7d020103db70 (diff) |
ARM: LPC32xx: Set system serial based on cpu unique id
LPC32xx SoC has a 128 bits unique id that can be used as a system
serial number, if none has been provided by atags or dt.
Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Signed-off-by: Roland Stigge <stigge@antcom.de>
-rw-r--r-- | arch/arm/mach-lpc32xx/common.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c index 5c96057b6d78..a48dc2dec485 100644 --- a/arch/arm/mach-lpc32xx/common.c +++ b/arch/arm/mach-lpc32xx/common.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | 27 | ||
28 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
29 | #include <asm/system_info.h> | ||
29 | 30 | ||
30 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
31 | #include <mach/platform.h> | 32 | #include <mach/platform.h> |
@@ -224,7 +225,7 @@ void lpc23xx_restart(char mode, const char *cmd) | |||
224 | ; | 225 | ; |
225 | } | 226 | } |
226 | 227 | ||
227 | static int __init lpc32xx_display_uid(void) | 228 | static int __init lpc32xx_check_uid(void) |
228 | { | 229 | { |
229 | u32 uid[4]; | 230 | u32 uid[4]; |
230 | 231 | ||
@@ -233,6 +234,11 @@ static int __init lpc32xx_display_uid(void) | |||
233 | printk(KERN_INFO "LPC32XX unique ID: %08x%08x%08x%08x\n", | 234 | printk(KERN_INFO "LPC32XX unique ID: %08x%08x%08x%08x\n", |
234 | uid[3], uid[2], uid[1], uid[0]); | 235 | uid[3], uid[2], uid[1], uid[0]); |
235 | 236 | ||
237 | if (!system_serial_low && !system_serial_high) { | ||
238 | system_serial_low = uid[0]; | ||
239 | system_serial_high = uid[1]; | ||
240 | } | ||
241 | |||
236 | return 1; | 242 | return 1; |
237 | } | 243 | } |
238 | arch_initcall(lpc32xx_display_uid); | 244 | arch_initcall(lpc32xx_check_uid); |