]> git.sur5r.net Git - u-boot/commitdiff
sniper: Pass serial number through ATAG
authorPaul Kocialkowski <contact@paulk.fr>
Mon, 20 Jul 2015 13:17:14 +0000 (15:17 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 13 Aug 2015 00:47:38 +0000 (20:47 -0400)
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>
board/lge/sniper/sniper.c
include/configs/sniper.h

index f26855dd39748239eb7c5638adde9900afdfe67a..b211528e2b550f4878d693743f2130c5d539edc3 100644 (file)
@@ -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();
index 2ac9291c4401e0ae5dfe7138751b2dd4e917a74c..f17bb0414906364033884effe32e44a0a3ea10f8 100644 (file)
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_INITRD_TAG
 #define CONFIG_REVISION_TAG
+#define CONFIG_SERIAL_TAG
 
 /*
  * Boot