public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [RFC v2 0/3] lib: tlv_eeprom: refactor API
@ 2023-05-16 11:41 Josua Mayer
  2023-05-16 11:41 ` [RFC v2 1/3] lib: add tlv_eeprom library Josua Mayer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Josua Mayer @ 2023-05-16 11:41 UTC (permalink / raw)
  To: u-boot; +Cc: Josua Mayer, Stefan Roese, Baruch Siach, Heinrich Schuchardt

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

Cc: Stefan Roese <sr@denx.de>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
-- 
2.35.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-16 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 11:41 [RFC v2 0/3] lib: tlv_eeprom: refactor API Josua Mayer
2023-05-16 11:41 ` [RFC v2 1/3] lib: add tlv_eeprom library Josua Mayer
2023-05-16 11:41 ` [RFC v2 2/3] mvebu: clearfog: convert tlv parsing to use new library Josua Mayer
2023-05-16 11:41 ` [RFC v2 3/3] cmd: tlv_eeprom: port to new shared tlv library Josua Mayer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox