diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2015-03-28 18:35:36 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2015-05-19 18:28:52 +0200 |
commit | 9f85221135745f7f20c9b00a241a8331a7f5b190 (patch) | |
tree | 41b20f7e7ab394df52e9df99ddf9db84db17c2bd | |
parent | 0e6b7a28243175ae0874d53b6e6e4eff8548d71f (diff) | |
download | u-boot-imx-9f85221135745f7f20c9b00a241a8331a7f5b190.zip u-boot-imx-9f85221135745f7f20c9b00a241a8331a7f5b190.tar.gz u-boot-imx-9f85221135745f7f20c9b00a241a8331a7f5b190.tar.bz2 |
sunxi: Pass serial number through ATAG
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | board/sunxi/board.c | 20 | ||||
-rw-r--r-- | include/configs/sunxi-common.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index d9f7691..4c51468 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -480,6 +480,26 @@ int g_dnl_board_usb_cable_connected(void) } #endif +#ifdef CONFIG_SERIAL_TAG +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; + } +} +#endif + #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index 2d6b815..723067e 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -98,6 +98,7 @@ #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_CMDLINE_TAG #define CONFIG_INITRD_TAG +#define CONFIG_SERIAL_TAG /* mmc config */ #if !defined(CONFIG_UART0_PORT_F) |