toradex: tdx-cfg-block: add support for EEPROM
This introduces support for EEPROM as a storage for the main Toradex
config block and additional config blocks on extra EEPROM chips (on
carrier board or video adapters).
To enable EEPROM as a storage for the main config block:
TDX_HAVE_EEPROM=y.
For additional EEPROMs please enable this Kconfig symbol:
TDX_CFG_BLOCK_EXTRA=y.
Information about existing EEPROM chips is provided via Device Tree
using aliases.
You can also write configuration for the carrier board using
create_carrier subcommand for cfgblock. Example:
Verdin iMX8MM # cfgblock create_carrier
Supported carrier boards:
UNKNOWN CARRIER = [0]
Verdin Carrier Board = [1]
Choose your carrier board (provide ID): 1
Enter carrier board version (e.g. V1.1B): V1.0A
Enter carrier board serial number: 10622780
Also with barcode:
Verdin iMX8MM # cfgblock create carrier -y 0156100010622780
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
diff --git a/board/toradex/common/Kconfig b/board/toradex/common/Kconfig
index 11f4aab..36068d2 100644
--- a/board/toradex/common/Kconfig
+++ b/board/toradex/common/Kconfig
@@ -20,6 +20,12 @@
config TDX_HAVE_NOR
bool
+config TDX_HAVE_EEPROM
+ bool
+
+config TDX_HAVE_EEPROM_EXTRA
+ bool
+
if TDX_CFG_BLOCK
config TDX_CFG_BLOCK_IS_IN_MMC
@@ -37,6 +43,11 @@
depends on TDX_HAVE_NOR
default y
+config TDX_CFG_BLOCK_IS_IN_EEPROM
+ bool
+ depends on TDX_HAVE_EEPROM
+ default y
+
config TDX_CFG_BLOCK_DEV
int "Toradex config block eMMC device ID"
depends on TDX_CFG_BLOCK_IS_IN_MMC
@@ -66,4 +77,11 @@
Ethernet carrier boards. This options enables the code to set the
second Ethernet address as environment variable (eth1addr).
+config TDX_CFG_BLOCK_EXTRA
+ bool "Support for additional EEPROMs (carrier board, display adapter)"
+ depends on TDX_HAVE_EEPROM_EXTRA
+ help
+ Enables fetching auxilary config blocks from carrier board/display
+ adapter EEPROMs.
+
endif