diff options
Diffstat (limited to 'board/sunxi/board.c')
-rw-r--r-- | board/sunxi/board.c | 20 |
1 files changed, 20 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) { |