scripts/Makefile.lib: add CONFIG_SYS_CONFIG_NAME prefix to dtsi search
PATCH v2 1/1 scripts/Makefile.lib: add CONFIG_SYS_CONFIG_NAME prefix to dtsi search
Add ${CONFIG_SYS_CONFIG_NAME}-u-boot.dtsi into dtsi include search order:
orig filename, (SYS_CONFIG_NAME), SYS_SOC, SYS_CPU, SYS_VENDOR, no prefix
--- doc/develop/devicetree/control.rst | 1 + scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+)
doc/develop/devicetree/control.rst +1 -0
@@ -207,6 +207,7 @@ devicetree for your board, searching for them in `arch/<arch>/dts/` in this order:: <orig_filename>-u-boot.dtsi + <CONFIG_SYS_CONFIG_NAME>-u-boot.dtsi <CONFIG_SYS_SOC>-u-boot.dtsi <CONFIG_SYS_CPU>-u-boot.dtsi <CONFIG_SYS_VENDOR>-u-boot.dtsi
scripts/Makefile.lib +2 -0
@@ -198,6 +198,7 @@ ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) u_boot_dtsi_loc = $(srctree)/arch/$(ARCH)/dts/ u_boot_dtsi_options = $(strip $(wildcard $(u_boot_dtsi_loc)$(basename $(notdir $<))-u-boot.dtsi) \ + $(wildcard $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CONFIG_NAME))-u-boot.dtsi) \ $(wildcard $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \ $(wildcard $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \ $(wildcard $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
@@ -205,6 +206,7 @@ u_boot_dtsi_options = $(strip $(wildcard $(u_boot_dtsi_loc)$(basename $(notdir $ u_boot_dtsi_options_raw = $(warning Automatic .dtsi inclusion: options: \ $(u_boot_dtsi_loc)$(basename $(notdir $<))-u-boot.dtsi \ + $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CONFIG_NAME))-u-boot.dtsi \ $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi \ $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi \ $(u_boot_dtsi_loc)$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi \
base-commit: 3dc5e9a0108bb114175b6362f9cb22367402f624
Signature · 1 line
2.50.0
Quoted 8 lines · E Shattow
Add ${CONFIG_SYS_CONFIG_NAME}-u-boot.dtsi into dtsi include search order:
orig filename, (SYS_CONFIG_NAME),SYS_SOC,SYS_CPU,SYS_VENDOR, no prefixSigned-off-by E Shattow <[email protected]>--- doc/develop/devicetree/control.rst | 1 + scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+)
A problem is that today, this leads to failure to build on:mt7622_rfb mt7986_rfb mt7986a_bpir3_emmc mt7986a_bpir3_sd mt7988_rfb mt7988_sd_rfb mt8516_pum
pkin socfpga_stratix10 socfpga_stratix10_atf socfpga_agilex5 socfpga_agilex5_nand2 socfpga_agilex5_vab socfpga_n5x socfpga_n5x_atf socfpga_n5x_vab mt7623a_unielec_u7623_02 mt7623n_bpir2 imx6q_bosch_acc imx6dl_mamoj socfpga_arria10 socfpga_arria5 socfpga_cyclone5
Because the problem you're trying to solve is being partly solved in another way by others, perhaps?
Signature · 1 line
Tom
Quoted 20 lines · Tom Rini
Quoted 8 lines · E Shattow
Add ${CONFIG_SYS_CONFIG_NAME}-u-boot.dtsi into dtsi include search order:
orig filename, (SYS_CONFIG_NAME),SYS_SOC,SYS_CPU,SYS_VENDOR, no prefixSigned-off-by E Shattow <[email protected]>--- doc/develop/devicetree/control.rst | 1 + scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+)A problem is that today, this leads to failure to build on:
mt7622_rfbmt7986_rfbmt7986a_bpir3_emmcmt7986a_bpir3_sdmt7988_rfbmt7988_sd_rfbmt8516_pum
pkinsocfpga_stratix10socfpga_stratix10_atfsocfpga_agilex5socfpga_agilex5_nand2socfpga_agilex5_vabsocfpga_n5xsocfpga_n5x_atfsocfpga_n5x_vabmt7623a_unielec_u7623_02mt7623n_bpir2imx6q_bosch_accimx6dl_mamojsocfpga_arria10socfpga_arria5socfpga_cyclone5
Quoted 3 lines
Because the problem you're trying to solve is being partly solved in another way by others, perhaps?
For example the first in the list of build failure, mt7622_rfb:
DTC arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dtb
Error: /root/source/u-boot.git/arch/arm/dts/mt7622-u-boot.dtsi:27.1-6 Label or path snfi not found
This happens because CONFIG_SYS_CONFIG_NAME is "mt7622" and is not the expected "m7622-rfb". Explicitly setting CONFIG_SYS_CONFIG_NAME in configs/mt7622_rfb_defconfig does not work.
arch/arm/mach-mediatek/Kconfig:
config SYS_CONFIG_NAME
default "mt7622" if TARGET_MT7622
default "mt7623" if TARGET_MT7623
default "mt7629" if TARGET_MT7629
default ...Drop this in-flight change from the above and it compiles fine.
I would expect this to be an anti-pattern/bug unless we are setting CONFIG_SYS_CONFIG_NAME explicitly in a config file, no?
Why is SYS_CONFIG_NAME being modified in this way?
-E
Quoted 44 lines · E Shattow
Quoted 20 lines · Tom Rini
Quoted 8 lines · E Shattow
Add ${CONFIG_SYS_CONFIG_NAME}-u-boot.dtsi into dtsi include search order:
orig filename, (SYS_CONFIG_NAME),SYS_SOC,SYS_CPU,SYS_VENDOR, no prefixSigned-off-by E Shattow <[email protected]>--- doc/develop/devicetree/control.rst | 1 + scripts/Makefile.lib | 2 ++ 2 files changed, 3 insertions(+)A problem is that today, this leads to failure to build on:
mt7622_rfbmt7986_rfbmt7986a_bpir3_emmcmt7986a_bpir3_sdmt7988_rfbmt7988_sd_rfbmt8516_pum
pkinsocfpga_stratix10socfpga_stratix10_atfsocfpga_agilex5socfpga_agilex5_nand2socfpga_agilex5_vabsocfpga_n5xsocfpga_n5x_atfsocfpga_n5x_vabmt7623a_unielec_u7623_02mt7623n_bpir2imx6q_bosch_accimx6dl_mamojsocfpga_arria10socfpga_arria5socfpga_cyclone5Quoted 3 lines
Because the problem you're trying to solve is being partly solved in another way by others, perhaps?
For example the first in the list of build failure,
mt7622_rfb:DTC
arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dtb
Error: /root/source/u-boot.git/arch/arm/dts/mt7622-u-boot.dtsi:27.1-6 Label or path snfi not foundThis happens because
CONFIG_SYS_CONFIG_NAMEis "mt7622" and is not the expected "m7622-rfb". Explicitly settingCONFIG_SYS_CONFIG_NAMEin configs/mt7622_rfb_defconfig does not work.
arch/arm/mach-mediatek/Kconfig:
configSYS_CONFIG_NAMEdefault "mt7622" if TARGET_MT7622 default "mt7623" if TARGET_MT7623 default "mt7629" if TARGET_MT7629 default ...
Quoted 8 lines
Drop this in-flight change from the above and it compiles fine.
I would expect this to be an anti-pattern/bug unless we are setting
CONFIG_SYS_CONFIG_NAMEexplicitly in a config file, no?Why is
SYS_CONFIG_NAMEbeing modified in this way?-E
Replying my own questions, the name of the defconfig is not represented by SYS_CONFIG_NAME and NAK my own patch here... it will have to be a different (new?) symbol name and configurable from Kconfig not necessarily defconfig file name.
I'll improve on the other series "increase detail for dtsi debug output" and propose a user-configurable dtsi include order that is more suitable.
Thanks for your patience while I learn these programming concepts!
-E