[U-Boot] [PATCH] Adds `serial#_trimmed` env var for RPI boards

From: Lyle Franklin lylejfranklin@gmail.com
- The `serial#` env var for Raspberry Pi boards is left padded with zeros in order to mimic the format of the serial number in `/proc/cpuinfo` - Unfortunately the Raspberry Pi bootloader which loads up before u-boot does not pad the serial number, meaning that some boot files are requested from 123456/ while u-boot requests files from 0000000000123456/ - Although a bit adhoc, adding an additional `serial#_trimmed` env var for the RPI board allows for all boot files to live in a single directory
Signed-off-by: Lyle Franklin lylejfranklin@gmail.com ---
board/raspberrypi/rpi/rpi.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 617c892dde..678adff482 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -389,6 +389,9 @@ static void set_serial_number(void) snprintf(serial_string, sizeof(serial_string), "%016llx", msg->get_board_serial.body.resp.serial); env_set("serial#", serial_string); + snprintf(serial_string, sizeof(serial_string), "%llx", + msg->get_board_serial.body.resp.serial); + env_set("serial#_trimmed", serial_string); }
int misc_init_r(void)
participants (1)
-
lylejfranklin@gmail.com