Skip to content

Commit e7a0c77

Browse files
nordicjmnashif
authored andcommitted
doc: hardware: porting: board_porting: Fix outdated merged info
Fixes some information that is very outdated to do with board Kconfig files, which are not merged, and multiple dts files Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no> (cherry picked from commit 88176a7)
1 parent b06f55f commit e7a0c77

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

doc/hardware/porting/board_porting.rst

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,11 @@ If multiple boards are placed in the same board folder, then the file
369369
Write your devicetree
370370
*********************
371371

372-
The devicetree file :file:`boards/<vendor>/plank/plank.dts` or
373-
:file:`boards/<vendor>/plank/plank_<qualifiers>.dts` describes your board
372+
The devicetree file :file:`boards/<vendor>/plank/plank_<qualifiers>.dts` describes your board
374373
hardware in the Devicetree Source (DTS) format (as usual, change ``plank`` to
375374
your board's name). If you're new to devicetree, see :ref:`devicetree-intro`.
376375

377-
In general, :file:`plank.dts` should look like this:
376+
In general, :file:`plank_<qualifiers>.dts` should look like this:
378377

379378
.. code-block:: devicetree
380379
@@ -424,16 +423,9 @@ In general, :file:`plank.dts` should look like this:
424423
status = "okay";
425424
};
426425
427-
Only one ``.dts`` file will be used, and the most specific file which exists
428-
will be used.
429-
430-
This means that if both :file:`plank.dts` and :file:`plank_soc1_foo.dts` exist,
431-
then when building for ``plank`` / ``plank/soc1``, then :file:`plank.dts` is
432-
used. When building for ``plank//foo`` / ``plank/soc1/foo`` the
433-
:file:`plank_soc1_foo.dts` is used.
434-
435-
This allows board maintainers to write a base devicetree file for the board
436-
or write specific devicetree files for a given board's SoC or variant.
426+
In the case a board has only a single SoC, without any board variants then the dts file can be
427+
named :file:`<plank>.dts` instead, however this is not recommended due to the file silently be
428+
unused if a variant or other SoC is added to the board.
437429

438430
If you're in a hurry, simple hardware can usually be supported by copy/paste
439431
followed by trial and error. If you want to understand details, you will need
@@ -518,7 +510,6 @@ files for a board named ``plank``:
518510
├── Kconfig
519511
├── Kconfig.plank
520512
├── Kconfig.defconfig
521-
├── plank_defconfig
522513
└── plank_<qualifiers>_defconfig
523514
524515
:file:`Kconfig.plank`
@@ -575,23 +566,28 @@ files for a board named ``plank``:
575566
default y
576567
577568
if NETWORKING
569+
578570
config SOC_ETHERNET_DRIVER
579571
default y
572+
580573
endif # NETWORKING
581574
582575
endif # BOARD_PLANK
583576
584-
:file:`plank_defconfig` / :file:`plank_<qualifiers>_defconfig`
577+
:file:`plank_<qualifiers>_defconfig` (or :file:`plank_defconfig` in limited circumstances)
585578
A Kconfig fragment that is merged as-is into the final build directory
586579
:file:`.config` whenever an application is compiled for your board.
587580

588-
If both the common :file:`plank_defconfig` file and one or more board
589-
qualifiers specific :file:`plank_<qualifiers>_defconfig` files exist, then
590-
all matching files will be used.
591-
This allows you to place configuration which is common for all board SoCs,
592-
CPU clusters, and board variants in the base :file:`plank_defconfig` and only
593-
place the adjustments specific for a given SoC or board variant in the
594-
:file:`plank_<qualifiers>_defconfig`.
581+
:file:`plank_defconfig` can only be used with boards that have no qualifiers, no variants and a
582+
single SoC present, though this style of naming is not recommended due to samples/tests or
583+
downstream usage breaking suddenly without warning if a new SoC or board variant/qualifier is
584+
added to an board in upstream Zephyr.
585+
586+
.. note::
587+
Multiple files are not merged and there is no fallback mechanism for files, this means if there
588+
is a board with 2 different SoCs and each one has 2 board variants, a :file:`plank_defconfig`
589+
file would be wholly unused, for the first qualifier and variant
590+
:file:`plank_<soc1>_<variant1>_defconfig` will be used, it will not include other file.
595591

596592
The ``_defconfig`` should contain mandatory settings for your system clock,
597593
console, etc. The results are architecture-specific, but typically look

0 commit comments

Comments
 (0)