From: Alexandre Pereira da Silva Date: Fri, 20 Jul 2012 12:01:51 +0000 (+0200) Subject: ARM: LPC32xx: Set system serial based on cpu unique id X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e39942f527fb02b73236d872d22c1b6b8335266c;p=linux-beck.git 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 Signed-off-by: Roland Stigge --- 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 @@ #include #include +#include #include #include @@ -224,7 +225,7 @@ void lpc23xx_restart(char mode, const char *cmd) ; } -static int __init lpc32xx_display_uid(void) +static int __init lpc32xx_check_uid(void) { u32 uid[4]; @@ -233,6 +234,11 @@ static int __init lpc32xx_display_uid(void) printk(KERN_INFO "LPC32XX unique ID: %08x%08x%08x%08x\n", uid[3], uid[2], uid[1], uid[0]); + if (!system_serial_low && !system_serial_high) { + system_serial_low = uid[0]; + system_serial_high = uid[1]; + } + return 1; } -arch_initcall(lpc32xx_display_uid); +arch_initcall(lpc32xx_check_uid);