Skip to content

Commit

Permalink
fdt: add fdt description document
Browse files Browse the repository at this point in the history
Signed-off-by: liaoao <[email protected]>
  • Loading branch information
leo11261 authored and xiaoxiang781216 committed Sep 30, 2024
1 parent c4b969b commit 02c292a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Documentation/guides/devicetree.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
====================
Device Tree
====================

Overview
--------

Currently, NuttX supports parsing of FDT(Flattened Device Tree) using libfdt, a
utility library for reading and manipulating the binary format:

https://github.com/dgibson/dtc/

Based on that, NuttX has implemented some common functions to get properties.
Device Tree support in NuttX will reduce the configuration of chips/boards,
it is not used in NuttX kernel framework yet.

How to use
-----------

1. Enable Device Tree and libfdt

Enable the Kconfig settings:

.. code-block:: console
CONFIG_DEVICE_TREE=y /* Enable Device Tree */
CONFIG_LIBFDT=y /* Enable utility library */
2. Register the DTB address

Use fdt_register to set the DTB Address in NuttX

3. Parse the DTB

Chip/board will use fdt_get to get the DTB Address, and then use fdt_* APIs to
parse the DTB properties.
1 change: 1 addition & 0 deletions Documentation/guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ Guides
stackrecord.rst
etcromfs.rst
thread_local_storage.rst
devicetree.rst

0 comments on commit 02c292a

Please sign in to comment.