toradex: tdx-cfg-block: add support for EEPROM
authorIgor Opaniuk <igor.opaniuk@toradex.com>
Wed, 15 Jul 2020 10:30:55 +0000 (13:30 +0300)
committerStefano Babic <sbabic@denx.de>
Mon, 27 Jul 2020 12:00:36 +0000 (14:00 +0200)
commit0c6b5588ef4ab908579ef53d930914c64cb762ab
tree4767f1efd181a325057d8bfdf996981ab3912457
parent26921f5853bc5b980e4989bf2cc8043209e9e218
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>
board/toradex/common/Kconfig
board/toradex/common/tdx-cfg-block.c
board/toradex/common/tdx-cfg-block.h