Message ID | 1437398238-27912-9-git-send-email-contact@paulk.fr |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show |
On Mon, Jul 20, 2015 at 03:17:14PM +0200, Paul Kocialkowski wrote: > Now that the serial number is correctly defined, we can pass it to the kernel > using the (legacy) ATAG method. It will be automatically passed via device-tree > when enabled. > > Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@konsulko.com>
On Mon, Jul 20, 2015 at 03:17:14PM +0200, Paul Kocialkowski wrote: > Now that the serial number is correctly defined, we can pass it to the kernel > using the (legacy) ATAG method. It will be automatically passed via device-tree > when enabled. > > Signed-off-by: Paul Kocialkowski <contact@paulk.fr> > Reviewed-by: Tom Rini <trini@konsulko.com> Applied to u-boot/master, thanks!
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c index f26855d..b211528 100644 --- a/board/lge/sniper/sniper.c +++ b/board/lge/sniper/sniper.c @@ -98,6 +98,24 @@ int misc_init_r(void) return 0; } +void get_board_serial(struct tag_serialnr *serialnr) +{ + char *serial_string; + unsigned long long serial; + + serial_string = getenv("serial#"); + + if (serial_string) { + serial = simple_strtoull(serial_string, NULL, 16); + + serialnr->high = (unsigned int) (serial >> 32); + serialnr->low = (unsigned int) (serial & 0xffffffff); + } else { + serialnr->high = 0; + serialnr->low = 0; + } +} + void set_muxconf_regs(void) { MUX_SNIPER(); diff --git a/include/configs/sniper.h b/include/configs/sniper.h index eb1252d..159ed4c 100644 --- a/include/configs/sniper.h +++ b/include/configs/sniper.h @@ -239,6 +239,7 @@ #define CONFIG_CMDLINE_TAG #define CONFIG_INITRD_TAG #define CONFIG_REVISION_TAG +#define CONFIG_SERIAL_TAG /* * Boot
Now that the serial number is correctly defined, we can pass it to the kernel using the (legacy) ATAG method. It will be automatically passed via device-tree when enabled. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> --- board/lge/sniper/sniper.c | 18 ++++++++++++++++++ include/configs/sniper.h | 1 + 2 files changed, 19 insertions(+)