Skip to content
Snippets Groups Projects
Commit 169ecb4a authored by Paul Kocialkowski's avatar Paul Kocialkowski Committed by Tom Rini
Browse files

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: default avatarPaul Kocialkowski <contact@paulk.fr>
parent 957efd4b
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,9 @@ int board_init(void) ...@@ -70,7 +70,9 @@ int board_init(void)
int misc_init_r(void) int misc_init_r(void)
{ {
char serial_string[17] = { 0 };
char reboot_mode[2] = { 0 }; char reboot_mode[2] = { 0 };
u32 dieid[4] = { 0 };
/* Reboot mode */ /* Reboot mode */
...@@ -82,6 +84,17 @@ int misc_init_r(void) ...@@ -82,6 +84,17 @@ int misc_init_r(void)
omap_reboot_mode_clear(); 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; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment