mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/10] Add barebox TLV infrastructure
@ 2025-04-11  7:40 Ahmad Fatoum
  2025-04-11  7:40 ` [PATCH 01/10] net: factor out eth_of_get_fixup_node Ahmad Fatoum
                   ` (9 more replies)
  0 siblings, 10 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2025-04-11  7:40 UTC (permalink / raw)
  To: barebox

barebox TLV is a system to store and retrieve a device's (read-only)
meta-data from non-volatile memory.
It is intended to handle information that are usually only set in
the factory - like serial number, MAC-addresses, analog calibration
data, etc.
Data is stored in a tag-length-value format (hence the name) and read
from non-volatile memory during startup.

Unpacked values are fixed up into the devicetree ``chosen``-node
for consumption by the operating system.

This system has already been deployed in the field for a couple of years
now on the LXA TAC. The feature is given a generic name though, because
it's hoped it will be useful to a more general audience.

Nowadays, this could be implemented as a NVMEM layout in Linux.
The benefit of doing it in barebox is that, when signing is added
in the future, we preclude an attacker from showing barebox
and Linux different content.

Nevertheless, NVMEM layout infrastructure in barebox could be
useful, but our NVMEM support needs an overhaul to support layouts,
so fixed-partitions is the only supported binding for now.

Ahmad Fatoum (8):
  net: factor out eth_of_get_fixup_node
  net: export list of registered ethernet addresses
  common: add optional systemd.hostname generation
  common: add barebox TLV support
  commands: add TLV debugging command
  scripts: add bareboxtlv host/target tool
  boards: add decoder for LXA TLV v1 format
  ARM: stm32mp: lxa: enable TLV support for TAC & FairyTux2

Chris Fiege (2):
  scripts: Add Barebox TLV Generator Tooling
  doc: Add User-Documentation for Barebox TLV

 .../bindings/nvmem/barebox,tlv.yaml           |  60 ++++
 Documentation/user/barebox-tlv.rst            |  93 +++++
 Documentation/user/user-manual.rst            |   1 +
 arch/arm/boards/lxa-fairytux2/board.c         |   8 +
 arch/arm/boards/lxa-tac/board.c               |   8 +
 .../dts/stm32mp153c-lxa-fairytux2-gen2.dts    |   1 +
 arch/arm/dts/stm32mp153c-lxa-fairytux2.dtsi   |   1 +
 arch/arm/dts/stm32mp15xc-lxa-tac.dtsi         |   2 +
 arch/arm/mach-stm32mp/Kconfig                 |   2 +
 commands/Kconfig                              |  12 +
 commands/Makefile                             |   1 +
 commands/tlv.c                                |  55 +++
 common/Kconfig                                |  34 ++
 common/Makefile                               |   1 +
 common/boards/Kconfig                         |   5 +
 common/boards/Makefile                        |   1 +
 common/boards/lxa/Makefile                    |   2 +
 common/boards/lxa/factory-data.c              | 132 +++++++
 common/bootm.c                                |   9 +-
 common/tlv/Makefile                           |   4 +
 common/tlv/barebox.c                          | 183 ++++++++++
 common/tlv/bus.c                              | 133 ++++++++
 common/tlv/drv.c                              |  49 +++
 common/tlv/parser.c                           | 211 ++++++++++++
 common/tlv/register.c                         |  94 +++++
 include/net.h                                 |  21 ++
 include/string.h                              |   7 +
 include/tlv/format.h                          |  72 ++++
 include/tlv/tlv.h                             |  99 ++++++
 lib/string.c                                  |  21 ++
 net/eth.c                                     |  40 +--
 scripts/.gitignore                            |   2 +
 scripts/Makefile                              |   2 +
 .../bareboxtlv-generator.py                   | 321 ++++++++++++++++++
 .../bareboxtlv-generator/data-example.yaml    |  12 +
 scripts/bareboxtlv-generator/requirements.txt |   2 +
 .../bareboxtlv-generator/schema-example.yaml  |  48 +++
 scripts/bareboxtlv-target.c                   |   1 +
 scripts/bareboxtlv.c                          | 183 ++++++++++
 scripts/include/asm/unaligned.h               |  21 ++
 scripts/include/linux/build_bug.h             |   8 +
 scripts/include/linux/stringify.h             |  14 +
 test/self/Kconfig                             |   7 +
 test/self/Makefile                            |   1 +
 test/self/tlv.c                               |  89 +++++
 test/self/tlv.dts                             |  27 ++
 46 files changed, 2080 insertions(+), 20 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/nvmem/barebox,tlv.yaml
 create mode 100644 Documentation/user/barebox-tlv.rst
 create mode 100644 commands/tlv.c
 create mode 100644 common/boards/lxa/Makefile
 create mode 100644 common/boards/lxa/factory-data.c
 create mode 100644 common/tlv/Makefile
 create mode 100644 common/tlv/barebox.c
 create mode 100644 common/tlv/bus.c
 create mode 100644 common/tlv/drv.c
 create mode 100644 common/tlv/parser.c
 create mode 100644 common/tlv/register.c
 create mode 100644 include/tlv/format.h
 create mode 100644 include/tlv/tlv.h
 create mode 100755 scripts/bareboxtlv-generator/bareboxtlv-generator.py
 create mode 100644 scripts/bareboxtlv-generator/data-example.yaml
 create mode 100644 scripts/bareboxtlv-generator/requirements.txt
 create mode 100644 scripts/bareboxtlv-generator/schema-example.yaml
 create mode 100644 scripts/bareboxtlv-target.c
 create mode 100644 scripts/bareboxtlv.c
 create mode 100644 scripts/include/asm/unaligned.h
 create mode 100644 scripts/include/linux/build_bug.h
 create mode 100644 scripts/include/linux/stringify.h
 create mode 100644 test/self/tlv.c
 create mode 100644 test/self/tlv.dts

-- 
2.39.5




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

end of thread, other threads:[~2025-04-14 15:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-11  7:40 [PATCH 00/10] Add barebox TLV infrastructure Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 01/10] net: factor out eth_of_get_fixup_node Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 02/10] net: export list of registered ethernet addresses Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 03/10] common: add optional systemd.hostname generation Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 04/10] common: add barebox TLV support Ahmad Fatoum
2025-04-14 14:49   ` Sascha Hauer
2025-04-14 14:57     ` Ahmad Fatoum
2025-04-14 15:06       ` Sascha Hauer
2025-04-11  7:40 ` [PATCH 05/10] commands: add TLV debugging command Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 06/10] scripts: add bareboxtlv host/target tool Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 07/10] boards: add decoder for LXA TLV v1 format Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 08/10] scripts: Add Barebox TLV Generator Tooling Ahmad Fatoum
2025-04-14 15:00   ` Sascha Hauer
2025-04-11  7:40 ` [PATCH 09/10] doc: Add User-Documentation for Barebox TLV Ahmad Fatoum
2025-04-11  7:40 ` [PATCH 10/10] ARM: stm32mp: lxa: enable TLV support for TAC & FairyTux2 Ahmad Fatoum

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