summaryrefslogtreecommitdiffstats
path: root/board/lge
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2015-07-20 15:17:13 +0200
committerTom Rini <trini@konsulko.com>2015-08-12 20:47:38 -0400
commit169ecb4a83c86dba7d19442de05310f0c068f0d1 (patch)
tree97129279b9a6c782885dc8210327db13e982aefc /board/lge
parent957efd4b5766e5ab68b032615c1a99f89ad01d86 (diff)
downloadtalos-obmc-uboot-169ecb4a83c86dba7d19442de05310f0c068f0d1.tar.gz
talos-obmc-uboot-169ecb4a83c86dba7d19442de05310f0c068f0d1.zip
sniper: Serial number support, obtained from die ID
The OMAP3 has some die-specific ID bits that we can use to give the device a (more or less) unique serial number. This is particularly useful for e.g. USB. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'board/lge')
-rw-r--r--board/lge/sniper/sniper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c
index 44d422da1b..f26855dd39 100644
--- a/board/lge/sniper/sniper.c
+++ b/board/lge/sniper/sniper.c
@@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void)
{
+ char serial_string[17] = { 0 };
char reboot_mode[2] = { 0 };
+ u32 dieid[4] = { 0 };
/* Reboot mode */
@@ -82,6 +84,17 @@ int misc_init_r(void)
omap_reboot_mode_clear();
}
+ /* Serial number */
+
+ get_dieid((u32 *)&dieid);
+
+ if (!getenv("serial#")) {
+ snprintf(serial_string, sizeof(serial_string),
+ "%08x%08x", dieid[0], dieid[3]);
+
+ setenv("serial#", serial_string);
+ }
+
return 0;
}
OpenPOWER on IntegriCloud