diff options
| author | Artur Rojek <[email protected]> | 2023-10-18 16:00:56 +0200 |
|---|---|---|
| committer | Eugen Hristev <[email protected]> | 2023-10-23 17:07:06 +0300 |
| commit | cd3dbb56874dbf0f85c4c36958e29c2515374a6b (patch) | |
| tree | f3e4592ab103aa35904aaeacbcc1e1f60fb886eb /include | |
| parent | 9a3a58396b78b1f9d0c14580dc03f81d29207dd2 (diff) | |
common: add prototype & rename populate_serial_number()
Rename populate_serial_number() to a more descriptive
serial_read_from_eeprom() and provide the missing function prototype.
This is useful for boards that wish to read their serial number from
EEPROM at init.
Signed-off-by: Artur Rojek <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/init.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/init.h b/include/init.h index 4e7fe26c200..d57a24fd00d 100644 --- a/include/init.h +++ b/include/init.h @@ -271,6 +271,20 @@ void board_init_r(struct global_data *id, ulong dest_addr) int cpu_init_r(void); int mac_read_from_eeprom(void); + +/** + * serial_read_from_eeprom - read the serial number from EEPROM + * + * This function reads the serial number from the EEPROM and sets the + * appropriate environment variable. + * + * The environment variable is only set if it has not been set + * already. This ensures that any user-saved variables are never + * overwritten. + * + * This function must be called after relocation. + */ +int serial_read_from_eeprom(int devnum); int set_cpu_clk_info(void); int update_flash_size(int flash_size); int arch_early_init_r(void); |
