From: lylejfranklin at gmail.com Date: Mon, 5 Aug 2019 06:32:58 -0400 Subject: [U-Boot] [PATCH] Adds `serial#_trimmed` env var for RPI boards Message-ID: <20190805103258.19464-1-lylejfranklin@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Lyle Franklin - 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 --- 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) -- 2.22.0