public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 00/12] split tlv_eeprom command into a separate library
@ 2022-05-02 14:18 Josua Mayer
  2022-05-02 14:18 ` [PATCH 01/12] cmd: tlv_eeprom: remove use of global variable current_dev Josua Mayer
                   ` (11 more replies)
  0 siblings, 12 replies; 22+ messages in thread
From: Josua Mayer @ 2022-05-02 14:18 UTC (permalink / raw)
  To: u-boot; +Cc: Josua Mayer, Jon Nettleton

The tlv_eeprom command provides much more than just a cli command:
- de- and encoding tlv format
- for reading and writing eeprom
- setting the eth?addr environment variable
- setting the serial# environment variable

One device (Clearfog) is already using the decoding functionality to
choose the correct memory size based on eeprom data.

This patchset massages the implementation in many places removing
stateful behaviour and global variables as much as possible and changing
some functions to be usable as a library.
Then finally everything but the handling of the cli command is split off
into a separate tlv library that can be used independently from the command.

SolidRun is starting to flash more devices with tlv data at the factory,
and we plan to use this information for device identification purposes
in future board files. This refactoring will make those implementations
easier and reduce the amount of duplicate code to carry around.

Josua Mayer (12):
  cmd: tlv_eeprom: remove use of global variable current_dev
  cmd: tlv_eeprom: remove use of global variable has_been_read
  cmd: tlv_eeprom: do_tlv_eeprom: stop using non-api read_eeprom
    function
  cmd: tlv_eeprom: convert functions used by command to api functions
  cmd: tlv_eeprom: remove empty function implementations from header
  cmd: tlv_eeprom: move missing declarations and defines to header
  cmd: tlv_eeprom: hide access to static tlv_devices array behind
    accessor
  cmd: tlv_eeprom: clean up two defines for one thing
  cmd: tlv_eeprom: add my copyright
  cmd: tlv_eeprom: split off tlv library from command
  arm: mvebu: clearfog: enable tlv library for spl in favour of eeprom
    cmd
  lib: tlv_eeprom: add function for reading one entry into a C string

 cmd/Kconfig                |   2 +
 cmd/tlv_eeprom.c           | 817 ++-----------------------------------
 configs/clearfog_defconfig |   3 +-
 include/tlv_eeprom.h       | 122 +++++-
 lib/Kconfig                |   2 +
 lib/Makefile               |   2 +
 lib/tlv/Kconfig            |  15 +
 lib/tlv/Makefile           |   5 +
 lib/tlv/tlv_eeprom.c       | 775 +++++++++++++++++++++++++++++++++++
 9 files changed, 944 insertions(+), 799 deletions(-)
 create mode 100644 lib/tlv/Kconfig
 create mode 100644 lib/tlv/Makefile
 create mode 100644 lib/tlv/tlv_eeprom.c

Cc: Jon Nettleton <jon@solid-run.com>
-- 
2.34.1


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

end of thread, other threads:[~2022-05-05  5:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-02 14:18 [PATCH 00/12] split tlv_eeprom command into a separate library Josua Mayer
2022-05-02 14:18 ` [PATCH 01/12] cmd: tlv_eeprom: remove use of global variable current_dev Josua Mayer
2022-05-03  6:09   ` Stefan Roese
2022-05-03  6:52     ` Josua Mayer
2022-05-02 14:18 ` [PATCH 02/12] cmd: tlv_eeprom: remove use of global variable has_been_read Josua Mayer
2022-05-03  6:11   ` Stefan Roese
2022-05-02 14:18 ` [PATCH 03/12] cmd: tlv_eeprom: do_tlv_eeprom: stop using non-api read_eeprom function Josua Mayer
2022-05-03  6:12   ` Stefan Roese
2022-05-02 14:18 ` [PATCH 04/12] cmd: tlv_eeprom: convert functions used by command to api functions Josua Mayer
2022-05-03  6:16   ` Stefan Roese
2022-05-03  7:17     ` Josua Mayer
2022-05-03 10:54       ` Stefan Roese
2022-05-03 19:09         ` Josua Mayer
2022-05-05  5:09           ` Stefan Roese
2022-05-02 14:18 ` [PATCH 05/12] cmd: tlv_eeprom: remove empty function implementations from header Josua Mayer
2022-05-02 14:18 ` [PATCH 06/12] cmd: tlv_eeprom: move missing declarations and defines to header Josua Mayer
2022-05-02 14:18 ` [PATCH 07/12] cmd: tlv_eeprom: hide access to static tlv_devices array behind accessor Josua Mayer
2022-05-02 14:18 ` [PATCH 08/12] cmd: tlv_eeprom: clean up two defines for one thing Josua Mayer
2022-05-02 14:18 ` [PATCH 09/12] cmd: tlv_eeprom: add my copyright Josua Mayer
2022-05-02 14:18 ` [PATCH 10/12] cmd: tlv_eeprom: split off tlv library from command Josua Mayer
2022-05-02 14:18 ` [PATCH 11/12] arm: mvebu: clearfog: enable tlv library for spl in favour of eeprom cmd Josua Mayer
2022-05-02 14:18 ` [PATCH 12/12] lib: tlv_eeprom: add function for reading one entry into a C string Josua Mayer

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