public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Josua Mayer <josua@solid-run.com>
To: u-boot@lists.denx.de
Cc: Josua Mayer <josua@solid-run.com>, Stefan Roese <sr@denx.de>,
	Baruch Siach <baruch@tkos.co.il>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [RFC v2 0/3] lib: tlv_eeprom: refactor API
Date: Tue, 16 May 2023 14:41:50 +0300	[thread overview]
Message-ID: <20230516114153.3896-1-josua@solid-run.com> (raw)

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


             reply	other threads:[~2023-05-16 11:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 11:41 Josua Mayer [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230516114153.3896-1-josua@solid-run.com \
    --to=josua@solid-run.com \
    --cc=baruch@tkos.co.il \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox