From: Jonas Rebmann <jre@pengutronix.de>
To: Fabian Pflug <f.pflug@pengutronix.de>,
Sascha Hauer <s.hauer@pengutronix.de>,
BAREBOX <barebox@lists.infradead.org>
Subject: Re: [PATCH RESEND] doc: tlv: add images and custom format documentation
Date: Thu, 30 Apr 2026 16:41:05 +0200 [thread overview]
Message-ID: <25879743-34cc-4af5-8924-c72dadba5d5b@pengutronix.de> (raw)
In-Reply-To: <193581a7-fd26-4ac4-b6a0-b625c8090f2e@pengutronix.de>
Hi again,
On 2026-04-30 14:20, Jonas Rebmann wrote:
> Can we turn this into ASCII-art or DOT/Graphviz or similar?
>
> Is there anything our sphinx setup already supports to turn into SVG on
> the fly?
We could use sphinx.ext.graphviz and represent your diagrams like so:
---8<---
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 9244bffe9e..13b74a8655 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -29,7 +29,9 @@ import re
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-extensions = []
+extensions = ["sphinx.ext.graphviz"]
+
+graphviz_output_format = 'svg'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
diff --git a/Documentation/user/barebox-tlv.rst b/Documentation/user/barebox-tlv.rst
index 3884d17409..1a108235ad 100644
--- a/Documentation/user/barebox-tlv.rst
+++ b/Documentation/user/barebox-tlv.rst
@@ -10,9 +10,20 @@ Data is stored in a tag-length-value format (hence the name) and read
from non-volatile memory during startup.
Unpacked values are stored in the devicetree ``chosen``-node.
-.. image:: figures/tlv_usage.svg
- :width: 40%
- :align: center
+.. graphviz::
+
+ digraph tlv_usage {
+ node [shape=box]
+
+ soc_id [label="SOC ID\n(read from fuses)"]
+ tlv_pubkey [label="TLV Public Key\n(compiled into barebox)"]
+ signed_tlv [label="Signed TLV data\n(read from eeprom)"]
+ device_tree [label="Device-Tree"]
+
+ tlv_pubkey -> signed_tlv [label="Verifies"]
+ soc_id -> signed_tlv [label="Compared against" dir=both]
+ signed_tlv -> device_tree [label="Updates"]
+ }
barebox TLV consists of two components:
@@ -121,7 +132,41 @@ This schema defines some well-known tags and two board-specific tags.
Afterwards another yaml-file with the data for the TLV binary is needed.
An example can be found in ``scripts/bareboxtlv-generator/data-example.yaml``.
-.. image:: figures/tlv_generator.svg
+.. graphviz::
+
+ digraph tlv_generator {
+ node [shape=record fontname="Monospace"]
+
+ schema_yaml [label="{schema.yaml |
+ magic: 0x61bb95f3
+ \lmax_size: 0x1000
+ \ltags:
+ \l\ factory-timestamp:
+ \l\ tag: 0x0003
+ \l\ format: \"decimal\"
+ \l\ length: 8
+ \l\ example: 1636451762
+ \l\ featureset:
+ \l\ tag: 0x0006
+ \l\ format: \"string\"
+ \l\ example: \"base\"
+ \l\ purpose: For later use.
+ }" style=dashed]
+
+ data_yaml [label="{data.yaml |
+ factory-timestamp: 1636451762
+ \lfeatureset: \"base\"\l
+ }"]
+
+ tlv_key [label="{tlv.key | PRIVATE KEY}"]
+ generator [label="barebox-tlv-generator.py"]
+ signed_bin [label="{TLV_signed.bin | Signed TLV data}"]
+
+ schema_yaml -> generator
+ data_yaml -> generator
+ tlv_key -> generator
+ generator -> signed_bin
+ }
With these information in place a TLV binary can be created:
---8<---
I didn't create another version of your patch because it lacked the
Signed-off-by, only signed off the (empty) message body/cover letter.
What do you think about using dot/graphviz for this?
Regards,
Jonas
--
Pengutronix e.K. | Jonas Rebmann |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
prev parent reply other threads:[~2026-04-30 14:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 11:41 Fabian Pflug
2026-04-30 12:20 ` Jonas Rebmann
2026-04-30 14:41 ` Jonas Rebmann [this message]
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=25879743-34cc-4af5-8924-c72dadba5d5b@pengutronix.de \
--to=jre@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=f.pflug@pengutronix.de \
--cc=s.hauer@pengutronix.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