warp7: Set u-boot serial# based on OTP value
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Mon, 26 Mar 2018 14:27:34 +0000 (15:27 +0100)
committerStefano Babic <sbabic@denx.de>
Sun, 15 Apr 2018 09:44:13 +0000 (11:44 +0200)
commit852cc548b3fdf6d5b46e2a96f876d14608ccdcf4
treea21ec8af3f241ebcda1c1db7277e8bcca7f0bbae
parent1ab1ffded4f1363080324d96a12fd76c90175be2
warp7: Set u-boot serial# based on OTP value

u-boot has a standard "serial#" environment variable that is suitable
for storing the iSerial number we will supply via the USB device
descriptor. serial# is automatically picked up by the disk subsystem in
u-boot - thus providing a handy unique identifier in /dev/disk/by-id as
detailed below.

Storing the hardware serial identifier in serial# means we can change the
serial# if we want before USB enumeration - thus making iSerial automatic
via OTP but overridable if necessary.

This patch reads the defined OTP fuse and sets environment variable
"serial#" to the value read.

With this patch in place the USB mass storage device will appear in
/dev/disk/by-id with a unique name based on the OTP value. For example

/dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0xf42400d3000001d4-0:0

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Rui Miguel Silva <rui.silva@linaro.org>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
board/warp7/warp7.c
include/configs/warp7.h