Skip to content

Commit c145817

Browse files
committed
doc: extend board porting guide with new board extend feature
Extend the board porting guide with documentation on the new board extend feature. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent 37fba9a commit c145817

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

doc/hardware/porting/board_porting.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,9 +912,67 @@ There are some extra things you'll need to do:
912912
#. Prepare a pull request adding your board which follows the
913913
:ref:`contribute_guidelines`.
914914

915+
.. _extend-board:
916+
915917
Board extensions
916918
****************
917919

920+
The board hardware model in Zephyr allows you to extend an existing board with
921+
new board variants. Such board extensions can be done in your custom repository
922+
and thus outside of the Zephyr repository.
923+
924+
Extending an existing board with an extra variant allows you to adjust an
925+
existing board and thereby during build to select building for the existing,
926+
unmodified board, or the new variant.
927+
928+
To extend an existing board, first create a :file:`board.yml` in your extended
929+
board. Make sure to use the directory structure described in
930+
:ref:`create-your-board-directory`.
931+
932+
The skeleton of the board YAML file for extending a board is:
933+
934+
.. code-block:: yaml
935+
936+
board:
937+
extend: <existing-board-name>
938+
variants:
939+
- name: <new-variant>
940+
qualifier: <existing-qualifier>
941+
942+
When extending a board, your board directory should look like:
943+
944+
.. code-block:: none
945+
946+
boards/<VENDOR>/plank
947+
├── board.yml
948+
├── plank_<new-qualifiers>_defconfig
949+
└── plank_<new-qualifiers>.dts
950+
951+
Replace ``plank`` with the real name of the board you extend.
952+
953+
In some cases you might want to also adjust additional settings, like the
954+
:file:`Kconfig.defconfig` or :file:`Kconfig.{board}`.
955+
Therefore it is also possible to provide the following in addition when
956+
extending a board.
957+
958+
.. code-block:: none
959+
960+
boards/<VENDOR>/plank
961+
├── board.cmake
962+
├── Kconfig
963+
├── Kconfig.plank
964+
├── Kconfig.defconfig
965+
└── plank_<new-qualifiers>.yaml
966+
967+
Board extensions (Old hardware model)
968+
*************************************
969+
970+
.. note::
971+
972+
This extension mechanism is intended for boards in old hardware description
973+
format. For boards described in new hardware model format, use the extension
974+
feature described in :ref:`extend-board`.
975+
918976
Boards already supported by Zephyr can be extended by downstream users, such as
919977
``example-application`` or vendor SDKs. In some situations, certain hardware
920978
description or :ref:`choices <devicetree-chosen-nodes>` can not be added in the

0 commit comments

Comments
 (0)