Skip to content

Commit a01815a

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 a70bf0e commit a01815a

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

doc/hardware/porting/board_porting.rst

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,69 @@ There are some extra things you'll need to do:
919919
#. Prepare a pull request adding your board which follows the
920920
:ref:`contribute_guidelines`.
921921

922+
.. _extend-board:
923+
922924
Board extensions
923925
****************
924926

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

0 commit comments

Comments
 (0)