From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 6/6] Documentation: document barebox device tree handling
Date: Mon, 23 Sep 2019 14:10:18 +0200 [thread overview]
Message-ID: <20190923121018.31574-7-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20190923121018.31574-1-a.fatoum@pengutronix.de>
The way barebox handles the Linux device trees and the device tree
compiler source included in the source tree may not be obvious
to new developers. Add a basic high-level documentation.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Documentation/devicetree/index.rst | 56 ++++++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/index.rst b/Documentation/devicetree/index.rst
index c6309defdf03..3b911c5a9d42 100644
--- a/Documentation/devicetree/index.rst
+++ b/Documentation/devicetree/index.rst
@@ -1,5 +1,57 @@
-Barebox specific devicetree bindings
-====================================
+Barebox devicetree handling and bindings
+========================================
+
+The preferred way of adding board support to barebox is to have devices
+on non-enumerable buses probed from device tree.
+barebox imports the Linux OpenFirmware ``of_*``-API functions for device tree
+parsing, which makes porting the device tree specific bits from device drivers
+very straight forward.
+
+Additionally, barebox has support for programmatically fixing up device trees
+it passes to the kernel, either directly via ``of_register_fixup`` or via device
+tree overlays.
+
+Upstream Device Trees
+---------------------
+
+barebox regularly synchronizes with the Linux kernel device tree definitions
+via the `kernel.org Split device-tree repository`_.
+They are located under the top-level ``dts/`` directory.
+
+Patches against ``dts/`` and its subdirectories are not accepted upstream.
+
+.. _kernel.org device-tree repository: https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/
+
+barebox Device Trees
+--------------------
+
+For supporting architectures, barebox device trees are located in
+``arch/$ARCH/dts``. Usually the barebox ``board.dts`` imports the upstream
+device tree under ``dts/src/$ARCH`` with ``#include "$ARCH/board.dts"`` and
+then extends it with barebox-specifics like :ref:`barebox,state`,
+environment or boot-time device configuration.
+
+Device Tree Compiler
+--------------------
+
+barebox makes use of the ``dtc`` and ``fdtget`` utilities from the `Device-Tree
+Compiler`_ project.
+
+.. _Device-Tree Compiler: https://git.kernel.org/pub/scm/utils/dtc/dtc.git
+
+These utilities are built as part of the barebox build process.
+
+Steps to update ``dtc``:
+
+* Place a ``git-checkout`` of the upstream ``dtc`` directory in the parent
+ directory of your barebox ``git-checkout``.
+* Run ``scripts/dtc/update-dtc-source.sh`` from the top-level barebox directory.
+* Wait till ``dtc`` build, test, install and commit conclude.
+* If ``scripts/dtc/Makefile`` changes are necessary, apply them manually in
+ a commit preceding the ``dtc`` update.
+
+barebox-specific Bindings
+-------------------------
Contents:
--
2.23.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-09-23 12:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 12:10 [PATCH 0/6] scripts/dtc: rework dtc import handling Ahmad Fatoum
2019-09-23 12:10 ` [PATCH 1/6] scripts/dtc: Reinstate barebox-specifics in update-dtc-source.sh Ahmad Fatoum
2019-09-23 12:10 ` [PATCH 2/6] scripts/dtc: reinstate building of fdtget along with dtc Ahmad Fatoum
2019-09-23 12:10 ` [PATCH 3/6] scripts/dtc: git rm old files as part of update process Ahmad Fatoum
2019-09-23 12:10 ` [PATCH 4/6] scripts/dtc: mention dtc project in update-dtc-source.sh commit message Ahmad Fatoum
2019-09-23 13:49 ` Roland Hieber
2019-09-23 12:10 ` [PATCH 5/6] scripts/dtc: Update to upstream version v1.5.1 Ahmad Fatoum
2019-09-23 12:10 ` Ahmad Fatoum [this message]
2019-09-25 9:51 ` [PATCH 0/6] scripts/dtc: rework dtc import handling Sascha Hauer
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=20190923121018.31574-7-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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