On 9/28/24 12:47 AM, Lothar Rubusch wrote:
[...]
Ideally I like to setup some Kconfig choice for base board selection
and one for boot-mode.
1.) In the documentation control.rst I read that the u-boot.dts is
combined of several elements. Is there a way to take this base .dts,
then add a base board .dtsi by Kconfig option, and similar a
boot-mode?
The -u-boot.dtsi is preprocessed by C preprocessor, just like all the
other DTs, so you can have a -u-boot.dtsi file which contains C
preprocessor conditional statements in it to conditionally include other
.dtsi files:
#if IS_ENABLED(...)
#include ...
#else ...
...
#endif
Going through the include list setup by the Makefile made me find my
mistake. Currently I may use u-boot specific stuff in arch/arm/dts and
include generic .dtsi fragments from dts/upstream. Note: I'm not
setting CONFIG_OF_UPSTREAM since I'm using the regular include list
which already contains dts/upstream/src/arm/intel. Is this ok? Or,
shall I try a different approach, which involves having
CONFIG_OF_UPSTREAM explicitely set in the defconfig?
I'm not quite sure I understand the question. Once this platform DTs
land in mainline and the DTs get synchronized into U-Boot, you should
then set CONFIG_OF_UPSTREAM. Until then, you could patch the DTs into
dts/upstream/ to test the result with OF_UPSTREAM enabled .
3.) What would be the best possibility to have a u-boot.dts with
handoff setup in arch/arm/dts and append .dtsi files from the general
dts/upstream - in case are there other boards are doing something
similar?
See above, maybe some of it helps.
Yes. This helped. I can set base-board and boot mode now by Kconfig
option with a generic .dts file. Note, it may still take some time,
since I'd like to test the stuff still a bit on hardware before
submitting something to the list.
Sure