* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-03 14:33 [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels Edgar Bonet
@ 2025-01-03 22:07 ` Romain Naour via buildroot
2025-01-04 7:21 ` Kilian Zinnecker via buildroot
2025-01-05 21:11 ` Michael Walle via buildroot
2 siblings, 0 replies; 9+ messages in thread
From: Romain Naour via buildroot @ 2025-01-03 22:07 UTC (permalink / raw)
To: Edgar Bonet, Buildroot development
Cc: Michael Walle, Sergey Matyukevich, Julien Olivain,
Thomas Petazzoni, Chris Packham, Kilian Zinnecker
Hi Edgar, All,
Le 03/01/2025 à 15:33, Edgar Bonet a écrit :
> Since Linux 6.12, the Buildroot option BR2_LINUX_KERNEL_CUSTOM_DTS_PATH
> does not work as expected on arm, arm64, mips and ricv.[1] These are the
> architectures that store the in-tree DTS files in vendor-specific
> subdirectories of arch/$ARCH/boot/dts/.
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08
> (commit 69fc497df0ae "Rework support for the device tree"). At the time,
> the kernel kept all in-tree DTS files directly in arch/$ARCH/boot/dts/,
> and this is where Buildroot drops the user's custom DTS. Vendor-specific
> subdirectories appeared in Linux v3.19 for the arm64 architecture, and
> this scheme was later adopted by mips, riscv and arm.
>
> For these architectures, Linux 6.12 (commit e7e2941300d2, "kbuild: split
> device tree build rules into scripts/Makefile.dtbs") made the DTB build
> infrastructure incompatible with the way
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH is implemented. This infrastructure now
> expects all DTS files to be in vendor-specific subdirectories on the
> architectures that use this scheme. Fulfilling this kernel expectation
> would require a new configuration parameter for the name of the
> appropriate vendor subdirectory. It would also require changing the
> relative paths to included .dtsi files.
>
> Let's add instead a rule to the top dts/Makefile for each DTB we want to
> build. This avoids breaking user's out-of-tree configurations.
Thanks for the detailed commit log!
I'll wait for feedback from other maintainers and for testing tags.
Reviewed-by: Romain Naour <romain.naour@smile.fr>
Best regards,
Romain
>
> [1] https://lists.buildroot.org/pipermail/buildroot/2024-October/765463.html
>
> Reported-by: Chris Packham <judge.packham@gmail.com>
> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> ---
> Changes v2 -> v3:
> - note, in the comment and in the log message, that this issue only
> affects some architectures
> - expand the log message with some historical context
> These changes were suggested by Romain Naour.
>
> Changes v1 -> v2:
> - define a hook for LINUX_POST_PATCH_HOOKS and LINUX_POST_RSYNC_HOOKS
> instead of modifying LINUX_BUILD_CMDS
> - use $(patsubst %.dts,%.dtb,$(dts)) instead of $(dts:%.dts=%.dtb)
> both changes suggested by Arnout Vandecappelle.
>
> This was build-tested with an Acqua defconfig,
> in the same manner as v2:
>
> # Test with an old kernel: v6.6.30
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
>
> # Test with a new kernel: v6.12.8
> make linux-dirclean
> git am bump_Acqua_kernel_to_v6.12.8.patch
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
>
> # Test the OVERRIDE_SRCDIR case.
> make linux-dirclean
> git -C $HOME/src/linux checkout v6.12.8
> echo "LINUX_OVERRIDE_SRCDIR = $HOME/src/linux" > local.mk
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
> ---
> linux/linux.mk | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 12699b8ee4..e6e8a3c3bc 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -327,6 +327,17 @@ define LINUX_TRY_PATCH_TIMECONST
> endef
> LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST
>
> +# On some architectures, kernels 6.12+ won't compile the custom DTS
> +# files we drop into arch/$ARCH/boot/dts unless we add specific rules to
> +# that directory's Makefile.
> +define LINUX_ADD_DTB_MAKE_RULES
> + $(foreach dts,$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)), \
> + echo "dtb-y += $(patsubst %.dts,%.dtb,$(notdir $(dts)))" >> $(LINUX_ARCH_PATH)/boot/dts/Makefile
> + )
> +endef
> +LINUX_POST_PATCH_HOOKS += LINUX_ADD_DTB_MAKE_RULES
> +LINUX_POST_RSYNC_HOOKS += LINUX_ADD_DTB_MAKE_RULES
> +
> LINUX_KERNEL_CUSTOM_LOGO_PATH = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH))
> ifneq ($(LINUX_KERNEL_CUSTOM_LOGO_PATH),)
> LINUX_DEPENDENCIES += host-imagemagick
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-03 14:33 [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels Edgar Bonet
2025-01-03 22:07 ` Romain Naour via buildroot
@ 2025-01-04 7:21 ` Kilian Zinnecker via buildroot
2025-01-05 21:11 ` Michael Walle via buildroot
2 siblings, 0 replies; 9+ messages in thread
From: Kilian Zinnecker via buildroot @ 2025-01-04 7:21 UTC (permalink / raw)
To: Buildroot development
Cc: Michael Walle, Sergey Matyukevich, Romain Naour, Chris Packham,
Edgar Bonet
On Friday, 3 January 2025 15:33:01 CET Edgar Bonet wrote:
> Since Linux 6.12, the Buildroot option BR2_LINUX_KERNEL_CUSTOM_DTS_PATH
> does not work as expected on arm, arm64, mips and ricv.[1] These are the
> architectures that store the in-tree DTS files in vendor-specific
> subdirectories of arch/$ARCH/boot/dts/.
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08
> (commit 69fc497df0ae "Rework support for the device tree"). At the time,
> the kernel kept all in-tree DTS files directly in arch/$ARCH/boot/dts/,
> and this is where Buildroot drops the user's custom DTS. Vendor-specific
> subdirectories appeared in Linux v3.19 for the arm64 architecture, and
> this scheme was later adopted by mips, riscv and arm.
>
> For these architectures, Linux 6.12 (commit e7e2941300d2, "kbuild: split
> device tree build rules into scripts/Makefile.dtbs") made the DTB build
> infrastructure incompatible with the way
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH is implemented. This infrastructure now
> expects all DTS files to be in vendor-specific subdirectories on the
> architectures that use this scheme. Fulfilling this kernel expectation
> would require a new configuration parameter for the name of the
> appropriate vendor subdirectory. It would also require changing the
> relative paths to included .dtsi files.
>
> Let's add instead a rule to the top dts/Makefile for each DTB we want to
> build. This avoids breaking user's out-of-tree configurations.
>
> [1] https://lists.buildroot.org/pipermail/buildroot/2024-October/765463.html
>
> Reported-by: Chris Packham <judge.packham@gmail.com>
> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> ---
> Changes v2 -> v3:
> - note, in the comment and in the log message, that this issue only
> affects some architectures
> - expand the log message with some historical context
> These changes were suggested by Romain Naour.
>
> Changes v1 -> v2:
> - define a hook for LINUX_POST_PATCH_HOOKS and LINUX_POST_RSYNC_HOOKS
> instead of modifying LINUX_BUILD_CMDS
> - use $(patsubst %.dts,%.dtb,$(dts)) instead of $(dts:%.dts=%.dtb)
> both changes suggested by Arnout Vandecappelle.
>
> This was build-tested with an Acqua defconfig,
> in the same manner as v2:
>
> # Test with an old kernel: v6.6.30
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
>
> # Test with a new kernel: v6.12.8
> make linux-dirclean
> git am bump_Acqua_kernel_to_v6.12.8.patch
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
>
> # Test the OVERRIDE_SRCDIR case.
> make linux-dirclean
> git -C $HOME/src/linux checkout v6.12.8
> echo "LINUX_OVERRIDE_SRCDIR = $HOME/src/linux" > local.mk
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
> ---
> linux/linux.mk | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/linux/linux.mk b/linux/linux.mk
> index 12699b8ee4..e6e8a3c3bc 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -327,6 +327,17 @@ define LINUX_TRY_PATCH_TIMECONST
> endef
> LINUX_POST_PATCH_HOOKS += LINUX_TRY_PATCH_TIMECONST
>
> +# On some architectures, kernels 6.12+ won't compile the custom DTS
> +# files we drop into arch/$ARCH/boot/dts unless we add specific rules to
> +# that directory's Makefile.
> +define LINUX_ADD_DTB_MAKE_RULES
> + $(foreach dts,$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)), \
> + echo "dtb-y += $(patsubst %.dts,%.dtb,$(notdir $(dts)))"
>>
> $(LINUX_ARCH_PATH)/boot/dts/Makefile + )
> +endef
> +LINUX_POST_PATCH_HOOKS += LINUX_ADD_DTB_MAKE_RULES
> +LINUX_POST_RSYNC_HOOKS += LINUX_ADD_DTB_MAKE_RULES
> +
> LINUX_KERNEL_CUSTOM_LOGO_PATH = $(call
> qstrip,$(BR2_LINUX_KERNEL_CUSTOM_LOGO_PATH)) ifneq
> ($(LINUX_KERNEL_CUSTOM_LOGO_PATH),)
> LINUX_DEPENDENCIES += host-imagemagick
Tested-by: Kilian Zinnecker <kilian.zinnecker@mail.de>
I applied the patch and used it in conjunction with a work in progress version
of a board support, which had an out-of-tree dts (see discussion and patch
below). The build worked, which indicates to me, that Edgar's patch
successfully handled the out-of-tree dts problem introduced by the kernel
recently.
Discussion:
https://lists.buildroot.org/pipermail/buildroot/2025-January/769859.html
Patch series:
https://lists.buildroot.org/pipermail/buildroot/2025-January/769872.html
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-03 14:33 [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels Edgar Bonet
2025-01-03 22:07 ` Romain Naour via buildroot
2025-01-04 7:21 ` Kilian Zinnecker via buildroot
@ 2025-01-05 21:11 ` Michael Walle via buildroot
2025-01-22 10:40 ` Romain Naour via buildroot
2 siblings, 1 reply; 9+ messages in thread
From: Michael Walle via buildroot @ 2025-01-05 21:11 UTC (permalink / raw)
To: Edgar Bonet, Buildroot development
Cc: Romain Naour, Chris Packham, Kilian Zinnecker, Sergey Matyukevich
Hi,
> Fulfilling this kernel expectation would require a new
> configuration parameter for the name of the appropriate vendor
> subdirectory.
No, that doesn't work. The vendor part *has* to be included in this
config option as it may contain different device tree (file names).
Don't assume the vendor part will always be the same for different
device trees.
Somehow we have to split the source directory of the OOT device
trees and the (relative) destination within the kernel tree (eg.
'freescale/fsl-ls1028a-my-device-tree.dts', or just
'my-device-tree.dts'). Please keep in mind that the device trees
might also end up in the target filesystem in /boot and these might
also need the vendor prefix (see BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME).
> It would also require changing the relative paths to included
> .dtsi files.
Yes, but I'd argue, that the current solution is broken in this
regard. Yes we shouldn't break things, but newer OOT device trees
should use the same #include directives as the in-tree device trees
to ease sharing the files between u-boot, linux and OOT external
trees. As of today, it's not (always) possible to use the same
(OOT) device tree for u-boot and linux in buildroot, i.e. if the
arch has subdirs and one use the OF_UPSTREAM configuration option in
u-boot.
-michael
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-05 21:11 ` Michael Walle via buildroot
@ 2025-01-22 10:40 ` Romain Naour via buildroot
2025-01-22 10:52 ` Arnout Vandecappelle via buildroot
2025-01-22 19:48 ` Edgar Bonet
0 siblings, 2 replies; 9+ messages in thread
From: Romain Naour via buildroot @ 2025-01-22 10:40 UTC (permalink / raw)
To: Michael Walle, Edgar Bonet, Buildroot development
Cc: Chris Packham, Kilian Zinnecker, Sergey Matyukevich
Hello Edgar, Michael, All,
Le 05/01/2025 à 22:11, Michael Walle a écrit :
> Hi,
>
>> Fulfilling this kernel expectation would require a new
>> configuration parameter for the name of the appropriate vendor
>> subdirectory.
>
> No, that doesn't work. The vendor part *has* to be included in this
> config option as it may contain different device tree (file names).
> Don't assume the vendor part will always be the same for different
> device trees.
>
> Somehow we have to split the source directory of the OOT device
> trees and the (relative) destination within the kernel tree (eg.
> 'freescale/fsl-ls1028a-my-device-tree.dts', or just
> 'my-device-tree.dts'). Please keep in mind that the device trees
> might also end up in the target filesystem in /boot and these might
> also need the vendor prefix (see BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME).
>
>> It would also require changing the relative paths to included
>> .dtsi files.
>
> Yes, but I'd argue, that the current solution is broken in this
> regard. Yes we shouldn't break things, but newer OOT device trees
> should use the same #include directives as the in-tree device trees
> to ease sharing the files between u-boot, linux and OOT external
> trees. As of today, it's not (always) possible to use the same
> (OOT) device tree for u-boot and linux in buildroot, i.e. if the
> arch has subdirs and one use the OF_UPSTREAM configuration option in
> u-boot.
Indeed, the #include directive should be the same as for the in-tree device
trees. The acmesystems_acqua_a5_* OOT dts #include path was updated to use the
vendor prefix while bumping to Linux 6.6.12 [1], so it was probably a
"workaround" of the BR2_LINUX_KERNEL_CUSTOM_DTS_PATH limitation...
The problem is that we define the path to the OOT dts file like this:
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts"
So we can't extract the vendor prefix from it even if it would look like this:
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/dts/microchip/at91-sama5d3_acqua.dts"
Note: the vendor prefix is not always one sub-directory:
arch/arm/boot/dts/ti/omap/dra7.dtsi
arch/arm64/boot/dts/exynos/google/gs101.dtsi
We probably need a new option to provide something like a dts "overlay"
BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY (similar to BR2_ROOTFS_OVERLAY) to copy a
dts directory directly to $(LINUX_ARCH_PATH)/boot/dts/
BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="board/acmesystems/acqua-a5/dts"
board/acmesystems/acqua-a5/dts/
└── microchip
└── at91-sama5d3_acqua.dts
Doing so, the BR2_LINUX_KERNEL_CUSTOM_DTS_PATH should be deprecated.
Thoughts?
[1]
https://gitlab.com/buildroot.org/buildroot/-/commit/8fb52098859fa5cf7ecf4db30ff8e0276687832f
Best regards,
Romain
>
> -michael
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-22 10:40 ` Romain Naour via buildroot
@ 2025-01-22 10:52 ` Arnout Vandecappelle via buildroot
2025-01-22 11:06 ` Romain Naour via buildroot
2025-01-22 11:09 ` Michael Walle via buildroot
2025-01-22 19:48 ` Edgar Bonet
1 sibling, 2 replies; 9+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2025-01-22 10:52 UTC (permalink / raw)
To: Romain Naour, Michael Walle, Edgar Bonet, Buildroot development
Cc: Chris Packham, Sergey Matyukevich, Kilian Zinnecker
On 22/01/2025 11:40, Romain Naour wrote:
[snip]
> The problem is that we define the path to the OOT dts file like this:
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts"
>
> So we can't extract the vendor prefix from it even if it would look like this:
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/dts/microchip/at91-sama5d3_acqua.dts"
>
> Note: the vendor prefix is not always one sub-directory:
>
> arch/arm/boot/dts/ti/omap/dra7.dtsi
> arch/arm64/boot/dts/exynos/google/gs101.dtsi
>
> We probably need a new option to provide something like a dts "overlay"
> BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY (similar to BR2_ROOTFS_OVERLAY) to copy a
> dts directory directly to $(LINUX_ARCH_PATH)/boot/dts/
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="board/acmesystems/acqua-a5/dts"
>
> board/acmesystems/acqua-a5/dts/
> └── microchip
> └── at91-sama5d3_acqua.dts
>
> Doing so, the BR2_LINUX_KERNEL_CUSTOM_DTS_PATH should be deprecated.
Alternatively, we can define an additional config variable
BR2_LINUX_KERNEL_CUSTOM_DTS_DIRECTORY that contains the subdirectory to which
the custom DTS is copied. So `microchip`, `ti/omap`, or `exynos/google`.
Disadvantage: we can't support multiple dts from different vendors. Not sure
if that is going to be an actual use case, but people do crazy things... But I
think for the common case (of only a single or a low number of DTSes that all
use the same CPU (family) so are in the same directory) it works well and is
much easier for the user.
Regards,
Arnout
>
> Thoughts?
>
> [1]
> https://gitlab.com/buildroot.org/buildroot/-/commit/8fb52098859fa5cf7ecf4db30ff8e0276687832f
>
> Best regards,
> Romain
>
>
>>
>> -michael
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-22 10:52 ` Arnout Vandecappelle via buildroot
@ 2025-01-22 11:06 ` Romain Naour via buildroot
2025-01-22 11:09 ` Michael Walle via buildroot
1 sibling, 0 replies; 9+ messages in thread
From: Romain Naour via buildroot @ 2025-01-22 11:06 UTC (permalink / raw)
To: Arnout Vandecappelle, Michael Walle, Edgar Bonet,
Buildroot development
Cc: Chris Packham, Sergey Matyukevich, Kilian Zinnecker
Hello Arnout, All,
Le 22/01/2025 à 11:52, Arnout Vandecappelle a écrit :
>
>
> On 22/01/2025 11:40, Romain Naour wrote:
> [snip]
>> The problem is that we define the path to the OOT dts file like this:
>>
>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/at91-
>> sama5d3_acqua.dts"
>>
>> So we can't extract the vendor prefix from it even if it would look like this:
>>
>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/dts/microchip/
>> at91-sama5d3_acqua.dts"
>>
>> Note: the vendor prefix is not always one sub-directory:
>>
>> arch/arm/boot/dts/ti/omap/dra7.dtsi
>> arch/arm64/boot/dts/exynos/google/gs101.dtsi
>>
>> We probably need a new option to provide something like a dts "overlay"
>> BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY (similar to BR2_ROOTFS_OVERLAY) to copy a
>> dts directory directly to $(LINUX_ARCH_PATH)/boot/dts/
>>
>> BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="board/acmesystems/acqua-a5/dts"
>>
>> board/acmesystems/acqua-a5/dts/
>> └── microchip
>> └── at91-sama5d3_acqua.dts
>>
>> Doing so, the BR2_LINUX_KERNEL_CUSTOM_DTS_PATH should be deprecated.
>
> Alternatively, we can define an additional config variable
> BR2_LINUX_KERNEL_CUSTOM_DTS_DIRECTORY that contains the subdirectory to which
> the custom DTS is copied. So `microchip`, `ti/omap`, or `exynos/google`.
>
> Disadvantage: we can't support multiple dts from different vendors. Not sure if
> that is going to be an actual use case, but people do crazy things... But I
> think for the common case (of only a single or a low number of DTSes that all
> use the same CPU (family) so are in the same directory) it works well and is
> much easier for the user.
That was actually the Michael's comment:
"Don't assume the vendor part will always be the same for different device trees."
What if the user have to copy a file to $(LINUX_ARCH_PATH)/boot/dts/ and another
one to $(LINUX_ARCH_PATH)/boot/dts/<vendor>/ ?
It's true that it's unlikely to happen but who know?
With BR2_LINUX_KERNEL_CUSTOM_DTS_DIRECTORY solution, users can still patch their
kernels to add all missing files but it's not really nice.
Best regards,
Romain
>
> Regards,
> Arnout
>
>>
>> Thoughts?
>>
>> [1]
>> https://gitlab.com/buildroot.org/buildroot/-/
>> commit/8fb52098859fa5cf7ecf4db30ff8e0276687832f
>>
>> Best regards,
>> Romain
>>
>>
>>>
>>> -michael
>>
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-22 10:52 ` Arnout Vandecappelle via buildroot
2025-01-22 11:06 ` Romain Naour via buildroot
@ 2025-01-22 11:09 ` Michael Walle via buildroot
1 sibling, 0 replies; 9+ messages in thread
From: Michael Walle via buildroot @ 2025-01-22 11:09 UTC (permalink / raw)
To: Arnout Vandecappelle, Romain Naour, Edgar Bonet,
Buildroot development
Cc: Chris Packham, Sergey Matyukevich, Kilian Zinnecker
[-- Attachment #1.1: Type: text/plain, Size: 2398 bytes --]
On Wed Jan 22, 2025 at 11:52 AM CET, Arnout Vandecappelle wrote:
>
>
> On 22/01/2025 11:40, Romain Naour wrote:
> [snip]
> > The problem is that we define the path to the OOT dts file like this:
> >
> > BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts"
> >
> > So we can't extract the vendor prefix from it even if it would look like this:
> >
> > BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/dts/microchip/at91-sama5d3_acqua.dts"
> >
> > Note: the vendor prefix is not always one sub-directory:
> >
> > arch/arm/boot/dts/ti/omap/dra7.dtsi
> > arch/arm64/boot/dts/exynos/google/gs101.dtsi
> >
> > We probably need a new option to provide something like a dts "overlay"
> > BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY (similar to BR2_ROOTFS_OVERLAY) to copy a
> > dts directory directly to $(LINUX_ARCH_PATH)/boot/dts/
> >
> > BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="board/acmesystems/acqua-a5/dts"
> >
> > board/acmesystems/acqua-a5/dts/
> > └── microchip
> > └── at91-sama5d3_acqua.dts
> >
> > Doing so, the BR2_LINUX_KERNEL_CUSTOM_DTS_PATH should be deprecated.
>
> Alternatively, we can define an additional config variable
> BR2_LINUX_KERNEL_CUSTOM_DTS_DIRECTORY that contains the subdirectory to which
> the custom DTS is copied. So `microchip`, `ti/omap`, or `exynos/google`.
>
> Disadvantage: we can't support multiple dts from different vendors.
As explained earlier, I'd aim for a solution which works in any
case.
> Not sure
> if that is going to be an actual use case, but people do crazy things... But I
> think for the common case (of only a single or a low number of DTSes that all
> use the same CPU (family) so are in the same directory) it works well and is
> much easier for the user.
The kernel supports multi (sub) arch. I'd prefer it if buildroot
would support the same. Think of an OEM who wants to build common
generic image shared between all its boards.
Esp. if it would be as 'easy' as splitting the current configuration
into a config for "/path/to/dts/files" and "list/of/board.dts
or/list/of/overlay.dtso". The later could also be the same option as
used for the in-tree kernel dts list. From a POV that might even be
easier. Also, the first option (which Romain calls _OVERLAY) could
also be a list, no?
-michael
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Buildroot] [PATCH v3 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-22 10:40 ` Romain Naour via buildroot
2025-01-22 10:52 ` Arnout Vandecappelle via buildroot
@ 2025-01-22 19:48 ` Edgar Bonet
1 sibling, 0 replies; 9+ messages in thread
From: Edgar Bonet @ 2025-01-22 19:48 UTC (permalink / raw)
To: Romain Naour, Michael Walle, Buildroot development
Cc: Chris Packham, Kilian Zinnecker, Sergey Matyukevich
Hello Builroot people!
On 2025-01-22, Romain Naour wrote:
> Hello Edgar, Michael, All,
>
> Le 05/01/2025 à 22:11, Michael Walle a écrit :
>> Hi,
>>
>>> Fulfilling this kernel expectation would require a new
>>> configuration parameter for the name of the appropriate vendor
>>> subdirectory.
>>
>> No, that doesn't work. The vendor part *has* to be included in this
>> config option as it may contain different device tree (file names).
>> Don't assume the vendor part will always be the same for different
>> device trees.
>>
>> Somehow we have to split the source directory of the OOT device
>> trees and the (relative) destination within the kernel tree (eg.
>> 'freescale/fsl-ls1028a-my-device-tree.dts', or just
>> 'my-device-tree.dts'). Please keep in mind that the device trees
>> might also end up in the target filesystem in /boot and these might
>> also need the vendor prefix (see BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME).
>>
>>> It would also require changing the relative paths to included
>>> .dtsi files.
>>
>> Yes, but I'd argue, that the current solution is broken in this
>> regard. Yes we shouldn't break things, but newer OOT device trees
>> should use the same #include directives as the in-tree device trees
>> to ease sharing the files between u-boot, linux and OOT external
>> trees. As of today, it's not (always) possible to use the same
>> (OOT) device tree for u-boot and linux in buildroot, i.e. if the
>> arch has subdirs and one use the OF_UPSTREAM configuration option in
>> u-boot.
>
> Indeed, the #include directive should be the same as for the in-tree device
> trees. The acmesystems_acqua_a5_* OOT dts #include path was updated to use the
> vendor prefix while bumping to Linux 6.6.12 [1], so it was probably a
> "workaround" of the BR2_LINUX_KERNEL_CUSTOM_DTS_PATH limitation...
>
> The problem is that we define the path to the OOT dts file like this:
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts"
>
> So we can't extract the vendor prefix from it even if it would look like this:
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/dts/microchip/at91-sama5d3_acqua.dts"
>
> Note: the vendor prefix is not always one sub-directory:
>
> arch/arm/boot/dts/ti/omap/dra7.dtsi
> arch/arm64/boot/dts/exynos/google/gs101.dtsi
>
> We probably need a new option to provide something like a dts "overlay"
> BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY (similar to BR2_ROOTFS_OVERLAY) to copy a
> dts directory directly to $(LINUX_ARCH_PATH)/boot/dts/
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_OVERLAY="board/acmesystems/acqua-a5/dts"
>
> board/acmesystems/acqua-a5/dts/
> └── microchip
> └── at91-sama5d3_acqua.dts
>
> Doing so, the BR2_LINUX_KERNEL_CUSTOM_DTS_PATH should be deprecated.
>
> Thoughts?
I do like this idea. Quite elegant. It would break current
configurations, but the fix is really easy.
I am only a bit worried about the timing. It would be nice if this issue
could be fixed, one way or another, before the feature freeze of the
next Buildroot LTS.
Best regards,
Edgar.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread