From: Sam Protsenko Date: Tue, 27 Feb 2018 22:05:43 +0200 Subject: [U-Boot] [PATCH] board: am335x: Set serial# variable Message-ID: <20180227200543.2367-1-semen.protsenko@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de serial# variable is needed to show device correctly in "fastboot devices" output. It's useful when we have several devices (in fastboot mode) connected to single host and want to choose which one to flash. Reuse board_serial variable (obtained from EEPROM in set_board_info_env() function) to set serial#. We can't use omap_die_id_serial(), because AM335x lacks DIE_ID, as can be seen from AM335x TRM. The other available option would be to reuse ethaddr variable, but using board_serial seems more reasonable for this purpose. Signed-off-by: Sam Protsenko --- board/ti/am335x/board.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 1a52bffc00..4d421697bf 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -732,6 +732,10 @@ int board_late_init(void) */ if (get_device_type() == HS_DEVICE) env_set("boot_fit", "1"); + + /* Reuse serial number set by set_board_info_env() (from EEPROM) */ + if (!env_get("serial#")) + env_set("serial#", env_get("board_serial")); #endif #if !defined(CONFIG_SPL_BUILD) -- 2.16.1