summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2015-08-27 19:37:14 +0200
committerTom Rini <trini@konsulko.com>2015-10-22 14:18:31 -0400
commit2da87ab3539264af595d8cb2d6dc7e087f1f1ca7 (patch)
treeae891c2214a0c5499a80f93a49dbe5a211f5c4c6 /arch
parent679f82c349473c894159795c14a7fc0a8db0cd43 (diff)
omap-common: Common get_board_serial function to pass serial through ATAG
Since there is a common function to grab the serial number from the die id bits, it makes sense have one to parse that serial number and feed it to the serial ATAG. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/omap-common/utils.c18
-rw-r--r--arch/arm/include/asm/omap_common.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/utils.c b/arch/arm/cpu/armv7/omap-common/utils.c
index dc5a169f9a..602d993e39 100644
--- a/arch/arm/cpu/armv7/omap-common/utils.c
+++ b/arch/arm/cpu/armv7/omap-common/utils.c
@@ -61,6 +61,24 @@ void omap_die_id_serial(void)
}
}
+void omap_die_id_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 omap_die_id_usbethaddr(void)
{
unsigned int die_id[4] = { 0 };
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 8fd728a1e8..d7b81c101b 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -604,6 +604,7 @@ void abb_setup(u32 fuse, u32 ldovbb, u32 setup, u32 control,
s8 abb_setup_ldovbb(u32 fuse, u32 ldovbb);
void omap_die_id_serial(void);
+void omap_die_id_get_board_serial(struct tag_serialnr *serialnr);
void omap_die_id_usbethaddr(void);
void omap_die_id_display(void);