summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-07-20 07:50:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-08-09 09:39:13 +0200
commit291dd36e4adec5ad2d873123c1eca2b990d67b7b (patch)
tree9209d21402eb9b33dba60c1d28b0b1994fabbd01 /Documentation
parent2fc6302090cd77c368cf784adf91dc2beb71764c (diff)
downloadbarebox-291dd36e4adec5ad2d873123c1eca2b990d67b7b.tar.gz
barebox-291dd36e4adec5ad2d873123c1eca2b990d67b7b.tar.xz
bootsource: allow DT aliases and bootrom numbering to differ
So far, we had no explicit mapping table between bootsource_instance and device id numbering in barebox and mostly depended on DT aliases reflecting the numbering of the bootrom. Add a new bootsource_set() that optionally consults a mapping table in the DT to arrive at the correct numbers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220720055042.3510276-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/barebox/aliases.rst36
1 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/barebox/aliases.rst b/Documentation/devicetree/bindings/barebox/aliases.rst
new file mode 100644
index 0000000000..527cc85ef6
--- /dev/null
+++ b/Documentation/devicetree/bindings/barebox/aliases.rst
@@ -0,0 +1,36 @@
+barebox DT aliases
+==================
+
+barebox can use the properties in the ``/aliases`` node to arrive
+at deterministic names for devices, e.g.::
+
+.. code-block:: none
+ / {
+ aliases {
+ mmc0 = &sdhci;
+ wdog0 = &iwdg;
+ };
+ };
+
+will assign the MMC device created from probing the node at ``&sdhci``
+the name ``/dev/mmc0``. Similarly, the watchdog device created from
+probing the node at ``&iwdg`` will be named ``wdog0``.
+
+By default, barebox will assume the aliases in the DT to align with
+the bootsource communicated by the firmware. If this is not the case,
+a device tree override is possible via an
+``/aliases/barebox,bootsource-${bootsource}${bootsource_instance}``
+property:
+
+.. code-block:: none
+
+ &{/aliases} {
+ mmc0 = &sdmmc0;
+ mmc1 = &sdhci;
+ barebox,bootsource-mmc0 = &sdhci;
+ barebox,bootsource-mmc1 = &sdmmc0;
+ };
+
+This will ensure that when booting from MMC, ``/dev/mmc${bootsource_instance}``
+will point at the correct boot device, despite bootrom and board DT alias
+order being different.