1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

cmd: add tlv_eeprom command

Add support for read/write of ONIE "Tlvinfo" EEPROM data format. TLV
stands for Type-Length-Value. The data format is described here:

  https://opencomputeproject.github.io/onie/design-spec/hw_requirements.html#board-eeprom-information-format

Based on U-Boot patch from the Open Compute project:

  ec87e872d4/patches/u-boot/common/feature-sys-eeprom-tlv-common.patch

Keep only I2C EEPROM support. Use the generic eeprom driver. Fix
checkpatch issues.

Add support for multiple EEPROM TLV stores on the same system. This is
useful in case of SOM and carrier that both provide ID and hardware
configuration information.

Add option to enable for SPL. This allows selection of RAM configuration
based on EEPROM stored board identification.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
This commit is contained in:
Baruch Siach
2020-01-21 15:44:54 +02:00
committed by Stefan Roese
parent ae7ba525a5
commit 1c79f2ff88
4 changed files with 1273 additions and 0 deletions

View File

@@ -242,6 +242,20 @@ config CMD_REGINFO
help
Register dump
config CMD_TLV_EEPROM
bool "tlv_eeprom"
depends on I2C_EEPROM
help
Display and program the system EEPROM data block in ONIE Tlvinfo
format. TLV stands for Type-Length-Value.
config SPL_CMD_TLV_EEPROM
bool "tlv_eeprom for SPL"
depends on SPL_I2C_EEPROM
select SPL_DRIVERS_MISC_SUPPORT
help
Read system EEPROM data block in ONIE Tlvinfo format from SPL.
endmenu
menu "Boot commands"

View File

@@ -183,6 +183,8 @@ obj-$(CONFIG_X86) += x86/
obj-$(CONFIG_ARCH_MVEBU) += mvebu/
endif # !CONFIG_SPL_BUILD
obj-$(CONFIG_$(SPL_)CMD_TLV_EEPROM) += tlv_eeprom.o
# core command
obj-y += nvedit.o

1105
cmd/tlv_eeprom.c Normal file

File diff suppressed because it is too large Load Diff