Commit ce53ac3a authored by Thomas Schäfer's avatar Thomas Schäfer
Browse files

kontron: common: introduce board_serial environment variable



- Normally, Kontron modules with VPD data stored on embedded KEU
  EEPROM set the 'serial#' environment variable to the value found
  in the 'Serial Number' entry of the SMBIOS block type 2.
- However, on some i.MX8 based modules, the NXP fastboot implementation
  sets 'serial#' in the 'fastboot_setup' function _before_ KEU VPD data
  EEPROM is read. As serial# is write once, it cannot be overridden by
  the value found in VPD data.
- So introduce the new 'board_serial' environment variable that to
  store the serial number from VPD data area. Board specific 'getSerNo'
  function must be adapted to read 'board_serial' from environment
  instead of 'serial#'.
- Keep also to setting the 'serial#' variable as before to be backward
  compatible and to have the 'serial#' variable still set in case that
  FASTBOOT might not have been configured in the bootloader.
Signed-off-by: Thomas Schäfer's avatarThomas Schaefer <thomas.schaefer@kontron.com>
parent e007e963
......@@ -532,8 +532,10 @@ void emb_eep_init_r(int eeprom_num_serial, int eeprom_num_eth, int num_of_macs)
* Block SMBIOS, type 2, string number 4
*/
val = emb_eep_find_string_in_dmi (eeprom_num_serial, 2, 4);
if (val != NULL)
if (val != NULL) {
env_set("serial#", val);
env_set("board_serial", val);
}
}
vpdi->eeprom_num = eeprom_num_eth;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment