RFC lib: tlv_eeprom: refactor API
Get series with b4
b4 am [email protected]Versions newest first
- v2 RFC Latest3 patches 0 repliesNew
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | lib: add tlv_eeprom librarycmd/ include/ lib/ +4 more | +899 | 0 replies | |
| 2/3 | mvebu: clearfog: convert tlv parsing to use new libraryboard/ configs/ | +20 | 0 replies | |
| 3/3 | cmd: tlv_eeprom: port to new shared tlv librarycmd/ cmd/ configs/ +1 more | +92 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RFC v2 0/3] lib: tlv_eeprom: refactor API
The existing tlv_eeprom functionality has been designed as a single application living as a uboot command.
The split into individual library and command, as well as attempts using this functionality extensively for board-identification have revealed several short-comings, such as:
- Inconsistent naming convention
- Inconsistent order of arguments
- Stateful functions
- Complex inter-dependencies between functions
- Control of low-level information such as header checksums by command
- Difficult to extend
- No clear separation between eeprom access and tlv format
- No support for multiple entries with same code (e.g. vendor extension)
Introduce a new API with clear names and support for duplicate tlv codes. Further rewrite the tlv_eeprom command, and the solidrun clearfog board logic to utilize these new functions.
This is the second draft, I am looking for:
- comments on the library functions names + descriptions
- comments on the use of udevice pointers, especially wrt. "tlv_eeprom_get_by_index" function that I am not sure about keeping
Please note that there are still bugs and untested functions in this version. I am planning to provide a complete result in the coming weeks.
Josua Mayer (3):
lib: add tlv_eeprom library
mvebu: clearfog: convert tlv parsing to use new library
cmd: tlv_eeprom: port to new shared tlv library
board/solidrun/common/tlv_data.c | 46 +-- cmd/Kconfig | 7 +- cmd/tlv_eeprom.c | 507 +++++--------------------- configs/clearfog_defconfig | 2 + include/tlv_eeprom.h | 242 ++++++++++--- lib/Kconfig | 2 + lib/Makefile | 2 + lib/tlv/Kconfig | 18 + lib/tlv/Makefile | 4 + lib/tlv/tlv_eeprom.c | 599 +++++++++++++++++++++++++++++++ 10 files changed, 918 insertions(+), 511 deletions(-) create mode 100644 lib/tlv/Kconfig create mode 100644 lib/tlv/Makefile create mode 100644 lib/tlv/tlv_eeprom.c
Signature · 1 line
2.35.3