summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/omap-common/utils.c
diff options
context:
space:
mode:
authorDileep Katta <dileep.katta@linaro.org>2015-03-25 04:04:51 +0530
committerTom Rini <trini@konsulko.com>2015-04-23 13:59:19 -0400
commitf12467d1a5d299738c19faeae39d3f093ef67624 (patch)
treeeb6a951054c17eae33915cfeb8db3bb63a0a0b90 /arch/arm/cpu/armv7/omap-common/utils.c
parentbe17d396ffd051703839b896f28cd8dfbb859772 (diff)
downloadu-boot-imx-f12467d1a5d299738c19faeae39d3f093ef67624.zip
u-boot-imx-f12467d1a5d299738c19faeae39d3f093ef67624.tar.gz
u-boot-imx-f12467d1a5d299738c19faeae39d3f093ef67624.tar.bz2
ARM: DRA7: Set serial number environment variable
This patch populates serial number environment variable from die_id_0 and die_id_1 register values for DRA7xx boards. The function is added in omap common code so that this can be re-used. Serial# environment variable will be useful to show correct information in "fastboot devices" commands. Ref: http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=a6bcaaf67f6e4bcd97808f53d0ceb4b0c04d583c Signed-off-by: Angela Stegmaier <angelabaker@ti.com> Signed-off-by: Dileep Katta <dileep.katta@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm/cpu/armv7/omap-common/utils.c')
-rw-r--r--arch/arm/cpu/armv7/omap-common/utils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/utils.c b/arch/arm/cpu/armv7/omap-common/utils.c
index 1696c2d..df5f817 100644
--- a/arch/arm/cpu/armv7/omap-common/utils.c
+++ b/arch/arm/cpu/armv7/omap-common/utils.c
@@ -60,3 +60,16 @@ void __weak usb_fake_mac_from_die_id(u32 *id)
eth_setenv_enetaddr("usbethaddr", device_mac);
}
}
+
+void __weak usb_set_serial_num_from_die_id(u32 *id)
+{
+ char serialno[72];
+ uint32_t serialno_lo, serialno_hi;
+
+ if (!getenv("serial#")) {
+ serialno_hi = id[0];
+ serialno_lo = id[1];
+ sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo);
+ setenv("serial#", serialno);
+ }
+}