* [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
@ 2024-12-17 9:55 Edgar Bonet
2024-12-18 14:55 ` Romain Naour via buildroot
0 siblings, 1 reply; 10+ messages in thread
From: Edgar Bonet @ 2024-12-17 9:55 UTC (permalink / raw)
To: Buildroot development; +Cc: Michael Walle, Chris Packham, Sergey Matyukevich
Since Linux 6.12 (commit e7e2941300d2, "kbuild: split device tree build
rules into scripts/Makefile.dtbs"), the kernel build process does not
build the DTBs from the source files listed in
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.[1] This is because it expects all the
DTS files to live in vendor-specific subdirectories of
arch/$ARCH/boot/dts/ , whereas Buildroot drops them in the top dts
directory.
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 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.
I ran the folowing build tests:
# Test with an old kernel: v6.6.30
make acmesystems_acqua_a5_512mb_defconfig
make linux
# Test with a new kernel: v6.12.5
make linux-dirclean
git cherry-pick 0938346cde # bump Acqua's kernel to v6.12.5
make acmesystems_acqua_a5_512mb_defconfig
make linux
# Test the OVERRIDE_SRCDIR case.
make linux-dirclean
git -C $HOME/src/linux checkout v6.12.5
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 1d3d8fffa6..eb509fd747 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
+# 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
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2024-12-17 9:55 [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels Edgar Bonet
@ 2024-12-18 14:55 ` Romain Naour via buildroot
2024-12-24 12:22 ` Edgar Bonet
0 siblings, 1 reply; 10+ messages in thread
From: Romain Naour via buildroot @ 2024-12-18 14:55 UTC (permalink / raw)
To: Edgar Bonet, Buildroot development
Cc: Michael Walle, Chris Packham, Sergey Matyukevich
Hello Edgar,
Le 17/12/2024 à 10:55, Edgar Bonet a écrit :
> Since Linux 6.12 (commit e7e2941300d2, "kbuild: split device tree build
> rules into scripts/Makefile.dtbs"), the kernel build process does not
> build the DTBs from the source files listed in
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.[1] This is because it expects all the
> DTS files to live in vendor-specific subdirectories of
> arch/$ARCH/boot/dts/ , whereas Buildroot drops them in the top dts
> directory.
Maybe we could add some additional explanation:
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08 [1] at the
time the kernel didn't have any vendor-specific subdirectory in
arch/$ARCH/boot/dts/.
vendor-specific subdirectory was introduced in kernel v3.19 [2] for ARM64 and in
kernel v6.5 for ARM [3]. Note, other arch than ARM and ARM64 doesn't actually
use a vendor-specific subdirectory (not even powerpc).
Your comment doesn't seems to apply for non ARM{,64} arch:
"This is because it expects all the DTS files to live in vendor-specific
subdirectories of arch/$ARCH/boot/dts/"
[1]
https://gitlab.com/buildroot.org/buildroot/-/commit/69fc497df0ae51bcc8a067c849447abdeb3cb2be
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ca5b34100c571658e605c5554aac374649593327
[3]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=724ba6751532055db75992fc6ae21c3e322e94a7
>
> 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
Note: Yocto doesn't rely on the kernel build infrastructure to build user
provided devicetree [4].
Maybe we should consider adding a new package infrastructure like kernel-module?
[4]
https://github.com/openembedded/openembedded-core/blob/f642edb006a8c16dbe45681afe547eabfae17073/meta/classes-recipe/devicetree.bbclass#L59C1-L59C9
Best regards,
Romain
>
> Reported-by: Chris Packham <judge.packham@gmail.com>
> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
> ---
> 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.
>
> I ran the folowing build tests:
>
> # Test with an old kernel: v6.6.30
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
>
> # Test with a new kernel: v6.12.5
> make linux-dirclean
> git cherry-pick 0938346cde # bump Acqua's kernel to v6.12.5
> make acmesystems_acqua_a5_512mb_defconfig
> make linux
>
> # Test the OVERRIDE_SRCDIR case.
> make linux-dirclean
> git -C $HOME/src/linux checkout v6.12.5
> 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 1d3d8fffa6..eb509fd747 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
>
> +# 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] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2024-12-18 14:55 ` Romain Naour via buildroot
@ 2024-12-24 12:22 ` Edgar Bonet
2025-01-28 13:33 ` Fiona Klute via buildroot
0 siblings, 1 reply; 10+ messages in thread
From: Edgar Bonet @ 2024-12-24 12:22 UTC (permalink / raw)
To: Romain Naour, Buildroot development
Cc: Michael Walle, Chris Packham, Sergey Matyukevich
Hello!
On 2024-12-18, Romain Naour wrote:
> Hello Edgar,
>
> Le 17/12/2024 à 10:55, Edgar Bonet a écrit :
>> Since Linux 6.12 (commit e7e2941300d2, "kbuild: split device tree build
>> rules into scripts/Makefile.dtbs"), the kernel build process does not
>> build the DTBs from the source files listed in
>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.[1] This is because it expects all the
>> DTS files to live in vendor-specific subdirectories of
>> arch/$ARCH/boot/dts/ , whereas Buildroot drops them in the top dts
>> directory.
>
> Maybe we could add some additional explanation:
>
> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08 [1] at the
> time the kernel didn't have any vendor-specific subdirectory in
> arch/$ARCH/boot/dts/.
>
> vendor-specific subdirectory was introduced in kernel v3.19 [2] for ARM64 and in
> kernel v6.5 for ARM [3]. Note, other arch than ARM and ARM64 doesn't actually
> use a vendor-specific subdirectory (not even powerpc).
I hadn't noticed that this varies among archs. Now that I look at it, it
appears mips and riscv also use vendor-specific subdirectories.
> Your comment doesn't seems to apply for non ARM{,64} arch:
> "This is because it expects all the DTS files to live in vendor-specific
> subdirectories of arch/$ARCH/boot/dts/"
Indeed, it is architecture-dependent.
> [1]
> https://gitlab.com/buildroot.org/buildroot/-/commit/69fc497df0ae51bcc8a067c849447abdeb3cb2be
> [2]
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ca5b34100c571658e605c5554aac374649593327
> [3]
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=724ba6751532055db75992fc6ae21c3e322e94a7
>
>
>>
>> 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
>
> Note: Yocto doesn't rely on the kernel build infrastructure to build user
> provided devicetree [4].
>
> Maybe we should consider adding a new package infrastructure like kernel-module?
This seems like an interesting option. It is, however, beyond my
capabilities.
Should I respin this patch with an updated commit log? Or should I
instead wait for someone to implement a Yocto-like approach?
Regards,
Edgar Bonet.
> [4]
> https://github.com/openembedded/openembedded-core/blob/f642edb006a8c16dbe45681afe547eabfae17073/meta/classes-recipe/devicetree.bbclass#L59C1-L59C9
>
> Best regards,
> Romain
>
>
>>
>> Reported-by: Chris Packham <judge.packham@gmail.com>
>> Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
>> ---
>> 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.
>>
>> I ran the folowing build tests:
>>
>> # Test with an old kernel: v6.6.30
>> make acmesystems_acqua_a5_512mb_defconfig
>> make linux
>>
>> # Test with a new kernel: v6.12.5
>> make linux-dirclean
>> git cherry-pick 0938346cde # bump Acqua's kernel to v6.12.5
>> make acmesystems_acqua_a5_512mb_defconfig
>> make linux
>>
>> # Test the OVERRIDE_SRCDIR case.
>> make linux-dirclean
>> git -C $HOME/src/linux checkout v6.12.5
>> 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 1d3d8fffa6..eb509fd747 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
>>
>> +# 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
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2024-12-24 12:22 ` Edgar Bonet
@ 2025-01-28 13:33 ` Fiona Klute via buildroot
2025-01-29 10:10 ` Romain Naour via buildroot
0 siblings, 1 reply; 10+ messages in thread
From: Fiona Klute via buildroot @ 2025-01-28 13:33 UTC (permalink / raw)
To: Edgar Bonet, Romain Naour, Buildroot development
Cc: Michael Walle, Chris Packham, Sergey Matyukevich
Am 24.12.24 um 13:22 schrieb Edgar Bonet:
> Hello!
>
> On 2024-12-18, Romain Naour wrote:
>> Hello Edgar,
>>
>> Le 17/12/2024 à 10:55, Edgar Bonet a écrit :
>>> Since Linux 6.12 (commit e7e2941300d2, "kbuild: split device tree build
>>> rules into scripts/Makefile.dtbs"), the kernel build process does not
>>> build the DTBs from the source files listed in
>>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.[1] This is because it expects all the
>>> DTS files to live in vendor-specific subdirectories of
>>> arch/$ARCH/boot/dts/ , whereas Buildroot drops them in the top dts
>>> directory.
>>
>> Maybe we could add some additional explanation:
>>
>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08 [1] at the
>> time the kernel didn't have any vendor-specific subdirectory in
>> arch/$ARCH/boot/dts/.
>>
>> vendor-specific subdirectory was introduced in kernel v3.19 [2] for ARM64 and in
>> kernel v6.5 for ARM [3]. Note, other arch than ARM and ARM64 doesn't actually
>> use a vendor-specific subdirectory (not even powerpc).
>
> I hadn't noticed that this varies among archs. Now that I look at it, it
> appears mips and riscv also use vendor-specific subdirectories.
>
>> Your comment doesn't seems to apply for non ARM{,64} arch:
>> "This is because it expects all the DTS files to live in vendor-specific
>> subdirectories of arch/$ARCH/boot/dts/"
>
> Indeed, it is architecture-dependent.
>
>> [1]
>> https://gitlab.com/buildroot.org/buildroot/-/commit/69fc497df0ae51bcc8a067c849447abdeb3cb2be
>> [2]
>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ca5b34100c571658e605c5554aac374649593327
>> [3]
>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=724ba6751532055db75992fc6ae21c3e322e94a7
>>
>>
>>>
>>> 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
>>
>> Note: Yocto doesn't rely on the kernel build infrastructure to build user
>> provided devicetree [4].
>>
>> Maybe we should consider adding a new package infrastructure like kernel-module?
>
> This seems like an interesting option. It is, however, beyond my
> capabilities.
Bit late to the party, but: I currently have a package in an external
tree that takes a list of .dts/.dtso files from config and calls cpp &
dtc to build .dtb/.dtbo files, with include paths into the Linux build
dir added. The build commands are naturally modeled on how the kernel
build builds DTBs, but it doesn't rely on the kernel Makefiles.
Would something like that be interesting for Buildroot, whether as a
generic DTB build package or infrastructure?
Best regards,
Fiona
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-28 13:33 ` Fiona Klute via buildroot
@ 2025-01-29 10:10 ` Romain Naour via buildroot
2025-01-30 10:30 ` Niklas Cassel
2025-02-03 15:48 ` Fiona Klute via buildroot
0 siblings, 2 replies; 10+ messages in thread
From: Romain Naour via buildroot @ 2025-01-29 10:10 UTC (permalink / raw)
To: Fiona Klute, Edgar Bonet, Buildroot development
Cc: Michael Walle, Chris Packham, Sergey Matyukevich
Hello Fiona, All,
Le 28/01/2025 à 14:33, Fiona Klute a écrit :
> Am 24.12.24 um 13:22 schrieb Edgar Bonet:
>> Hello!
>>
>> On 2024-12-18, Romain Naour wrote:
>>> Hello Edgar,
>>>
>>> Le 17/12/2024 à 10:55, Edgar Bonet a écrit :
>>>> Since Linux 6.12 (commit e7e2941300d2, "kbuild: split device tree build
>>>> rules into scripts/Makefile.dtbs"), the kernel build process does not
>>>> build the DTBs from the source files listed in
>>>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.[1] This is because it expects all the
>>>> DTS files to live in vendor-specific subdirectories of
>>>> arch/$ARCH/boot/dts/ , whereas Buildroot drops them in the top dts
>>>> directory.
>>>
>>> Maybe we could add some additional explanation:
>>>
>>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08 [1] at the
>>> time the kernel didn't have any vendor-specific subdirectory in
>>> arch/$ARCH/boot/dts/.
>>>
>>> vendor-specific subdirectory was introduced in kernel v3.19 [2] for ARM64 and in
>>> kernel v6.5 for ARM [3]. Note, other arch than ARM and ARM64 doesn't actually
>>> use a vendor-specific subdirectory (not even powerpc).
>>
>> I hadn't noticed that this varies among archs. Now that I look at it, it
>> appears mips and riscv also use vendor-specific subdirectories.
>>
>>> Your comment doesn't seems to apply for non ARM{,64} arch:
>>> "This is because it expects all the DTS files to live in vendor-specific
>>> subdirectories of arch/$ARCH/boot/dts/"
>>
>> Indeed, it is architecture-dependent.
>>
>>> [1]
>>> https://gitlab.com/buildroot.org/buildroot/-/
>>> commit/69fc497df0ae51bcc8a067c849447abdeb3cb2be
>>> [2]
>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
>>> id=ca5b34100c571658e605c5554aac374649593327
>>> [3]
>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
>>> id=724ba6751532055db75992fc6ae21c3e322e94a7
>>>
>>>
>>>>
>>>> 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
>>>
>>> Note: Yocto doesn't rely on the kernel build infrastructure to build user
>>> provided devicetree [4].
>>>
>>> Maybe we should consider adding a new package infrastructure like kernel-module?
>>
>> This seems like an interesting option. It is, however, beyond my
>> capabilities.
>
> Bit late to the party, but: I currently have a package in an external
> tree that takes a list of .dts/.dtso files from config and calls cpp &
> dtc to build .dtb/.dtbo files, with include paths into the Linux build
> dir added. The build commands are naturally modeled on how the kernel
> build builds DTBs, but it doesn't rely on the kernel Makefiles.
AFAIK, the current BR2_LINUX_KERNEL_CUSTOM_DTS_PATH option doesn't seems to take
into account any external devicetree overlay files (dtso).
I've send a new version of this patch (but dtso are not supported):
https://lore.kernel.org/buildroot/20250129095716.2511434-1-romain.naour@smile.fr/T/#t
>
> Would something like that be interesting for Buildroot, whether as a
> generic DTB build package or infrastructure?
While reviewing this patch, I had to take a look at how to build a dtb file
outside of the kernel build infrastructure (like Yocto does) but it's not easy.
Actually we are happy to keep this build process hidden in the kernel Makefiles.
Since the next Buildroot meeting is next week, this is probably a topic we can
discuss. Feel free to send a patch (even a draft).
Best regards,
Romain
>
> Best regards,
> Fiona
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-29 10:10 ` Romain Naour via buildroot
@ 2025-01-30 10:30 ` Niklas Cassel
2025-01-30 18:12 ` Romain Naour via buildroot
2025-02-03 15:48 ` Fiona Klute via buildroot
1 sibling, 1 reply; 10+ messages in thread
From: Niklas Cassel @ 2025-01-30 10:30 UTC (permalink / raw)
To: Romain Naour
Cc: Fiona Klute, Edgar Bonet, Buildroot development, Michael Walle,
Chris Packham, Sergey Matyukevich, dlemoal@kernel.org
Hello Romain,
On Wed, Jan 29, 2025 at 11:10:31AM +0100, Romain Naour via buildroot wrote:
>
> AFAIK, the current BR2_LINUX_KERNEL_CUSTOM_DTS_PATH option doesn't seems to take
> into account any external devicetree overlay files (dtso).
>
> I've send a new version of this patch (but dtso are not supported):
>
> https://lore.kernel.org/buildroot/20250129095716.2511434-1-romain.naour@smile.fr/T/#t
>
> >
> > Would something like that be interesting for Buildroot, whether as a
> > generic DTB build package or infrastructure?
>
> While reviewing this patch, I had to take a look at how to build a dtb file
> outside of the kernel build infrastructure (like Yocto does) but it's not easy.
> Actually we are happy to keep this build process hidden in the kernel Makefiles.
>
> Since the next Buildroot meeting is next week, this is probably a topic we can
> discuss. Feel free to send a patch (even a draft).
The patch series that you link to above only cater to out-of-tree device
trees.
I've send a patch for in-tree device tree overlays (.dtso) that has been
ignored:
https://lore.kernel.org/buildroot/Z2VBjTBKUkn9Mehr@ryzen/T/#u
If there is a Buildroot meeting next week, perhaps you could be nice to
bring up the use case of in-tree device tree overlays (.dtso).
I would be nice if either:
1) My patch is merged.
2) Some other patch that adds support for in-tree device tree overlays
(.dtso) gets accepted.
Kind regards,
Niklas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-30 10:30 ` Niklas Cassel
@ 2025-01-30 18:12 ` Romain Naour via buildroot
0 siblings, 0 replies; 10+ messages in thread
From: Romain Naour via buildroot @ 2025-01-30 18:12 UTC (permalink / raw)
To: Niklas Cassel
Cc: Fiona Klute, Edgar Bonet, Buildroot development, Michael Walle,
Chris Packham, Sergey Matyukevich, dlemoal@kernel.org
Hello Niklas, All,
Le 30/01/2025 à 11:30, Niklas Cassel a écrit :
> Hello Romain,
>
> On Wed, Jan 29, 2025 at 11:10:31AM +0100, Romain Naour via buildroot wrote:
>>
>> AFAIK, the current BR2_LINUX_KERNEL_CUSTOM_DTS_PATH option doesn't seems to take
>> into account any external devicetree overlay files (dtso).
>>
>> I've send a new version of this patch (but dtso are not supported):
>>
>> https://lore.kernel.org/buildroot/20250129095716.2511434-1-romain.naour@smile.fr/T/#t
>>
>>>
>>> Would something like that be interesting for Buildroot, whether as a
>>> generic DTB build package or infrastructure?
>>
>> While reviewing this patch, I had to take a look at how to build a dtb file
>> outside of the kernel build infrastructure (like Yocto does) but it's not easy.
>> Actually we are happy to keep this build process hidden in the kernel Makefiles.
>>
>> Since the next Buildroot meeting is next week, this is probably a topic we can
>> discuss. Feel free to send a patch (even a draft).
>
> The patch series that you link to above only cater to out-of-tree device
> trees.
>
> I've send a patch for in-tree device tree overlays (.dtso) that has been
> ignored:
> https://lore.kernel.org/buildroot/Z2VBjTBKUkn9Mehr@ryzen/T/#u
>
> If there is a Buildroot meeting next week, perhaps you could be nice to
> bring up the use case of in-tree device tree overlays (.dtso).
>
> I would be nice if either:
> 1) My patch is merged.
> 2) Some other patch that adds support for in-tree device tree overlays
> (.dtso) gets accepted.
Thanks for the reminder!
Actually, I missed your patch series and noticed that external dtso support is
currently missing in Buildroot.
I'll take your contribution into account during the meeting :)
Best regards,
Romain
>
>
> Kind regards,
> Niklas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2025-01-29 10:10 ` Romain Naour via buildroot
2025-01-30 10:30 ` Niklas Cassel
@ 2025-02-03 15:48 ` Fiona Klute via buildroot
2025-02-04 14:47 ` Bryce Johnson
1 sibling, 1 reply; 10+ messages in thread
From: Fiona Klute via buildroot @ 2025-02-03 15:48 UTC (permalink / raw)
To: Romain Naour, Edgar Bonet, Buildroot development
Cc: Michael Walle, Chris Packham, Sergey Matyukevich
Am 29.01.25 um 11:10 schrieb Romain Naour via buildroot:
> Hello Fiona, All,
>
> Le 28/01/2025 à 14:33, Fiona Klute a écrit :
>> Am 24.12.24 um 13:22 schrieb Edgar Bonet:
>>> Hello!
>>>
>>> On 2024-12-18, Romain Naour wrote:
>>>> Hello Edgar,
>>>>
>>>> Le 17/12/2024 à 10:55, Edgar Bonet a écrit :
>>>>> Since Linux 6.12 (commit e7e2941300d2, "kbuild: split device tree build
>>>>> rules into scripts/Makefile.dtbs"), the kernel build process does not
>>>>> build the DTBs from the source files listed in
>>>>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.[1] This is because it expects all the
>>>>> DTS files to live in vendor-specific subdirectories of
>>>>> arch/$ARCH/boot/dts/ , whereas Buildroot drops them in the top dts
>>>>> directory.
>>>>
>>>> Maybe we could add some additional explanation:
>>>>
>>>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08 [1] at the
>>>> time the kernel didn't have any vendor-specific subdirectory in
>>>> arch/$ARCH/boot/dts/.
>>>>
>>>> vendor-specific subdirectory was introduced in kernel v3.19 [2] for ARM64 and in
>>>> kernel v6.5 for ARM [3]. Note, other arch than ARM and ARM64 doesn't actually
>>>> use a vendor-specific subdirectory (not even powerpc).
>>>
>>> I hadn't noticed that this varies among archs. Now that I look at it, it
>>> appears mips and riscv also use vendor-specific subdirectories.
>>>
>>>> Your comment doesn't seems to apply for non ARM{,64} arch:
>>>> "This is because it expects all the DTS files to live in vendor-specific
>>>> subdirectories of arch/$ARCH/boot/dts/"
>>>
>>> Indeed, it is architecture-dependent.
>>>
>>>> [1]
>>>> https://gitlab.com/buildroot.org/buildroot/-/
>>>> commit/69fc497df0ae51bcc8a067c849447abdeb3cb2be
>>>> [2]
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
>>>> id=ca5b34100c571658e605c5554aac374649593327
>>>> [3]
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
>>>> id=724ba6751532055db75992fc6ae21c3e322e94a7
>>>>
>>>>
>>>>>
>>>>> 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
>>>>
>>>> Note: Yocto doesn't rely on the kernel build infrastructure to build user
>>>> provided devicetree [4].
>>>>
>>>> Maybe we should consider adding a new package infrastructure like kernel-module?
>>>
>>> This seems like an interesting option. It is, however, beyond my
>>> capabilities.
>>
>> Bit late to the party, but: I currently have a package in an external
>> tree that takes a list of .dts/.dtso files from config and calls cpp &
>> dtc to build .dtb/.dtbo files, with include paths into the Linux build
>> dir added. The build commands are naturally modeled on how the kernel
>> build builds DTBs, but it doesn't rely on the kernel Makefiles.
>
> AFAIK, the current BR2_LINUX_KERNEL_CUSTOM_DTS_PATH option doesn't seems to take
> into account any external devicetree overlay files (dtso).
>
> I've send a new version of this patch (but dtso are not supported):
>
> https://lore.kernel.org/buildroot/20250129095716.2511434-1-romain.naour@smile.fr/T/#t
>
>>
>> Would something like that be interesting for Buildroot, whether as a
>> generic DTB build package or infrastructure?
>
> While reviewing this patch, I had to take a look at how to build a dtb file
> outside of the kernel build infrastructure (like Yocto does) but it's not easy.
> Actually we are happy to keep this build process hidden in the kernel Makefiles.
>
> Since the next Buildroot meeting is next week, this is probably a topic we can
> discuss. Feel free to send a patch (even a draft).
I've just sent a patch, and would be happy to hear what you think. I'm
not at the meeting, but available on IRC if there's anything to discuss. :-)
See:
https://patchwork.ozlabs.org/project/buildroot/patch/20250203154651.2790784-1-fiona.klute@gmx.de/
Best regards,
Fiona
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2025-02-03 15:48 ` Fiona Klute via buildroot
@ 2025-02-04 14:47 ` Bryce Johnson
2025-02-04 18:27 ` Fiona Klute via buildroot
0 siblings, 1 reply; 10+ messages in thread
From: Bryce Johnson @ 2025-02-04 14:47 UTC (permalink / raw)
To: Fiona Klute
Cc: Romain Naour, Edgar Bonet, Buildroot development, Michael Walle,
Chris Packham, Sergey Matyukevich
Hi Fiona,
I tried the patch and it looks interesting, was there a way to still
include some dtsi included in the kernel? For example, I have a
custom board with TI AM62X. I might have a myboard.dts that wants to
include from the kernel, k3-am625.dtsi which includes k3-am62.dtsi,
which include k3-am62-main.dtsi,k3-am62-mcu.dtsi, k3-am62-wakeup.dtsi,
etc.
I could probably copy them all over and have custom-dtbs build it, but
not quite as convenient since in general I shouldn't need to touch
those underlying chip support dtsi and want to pull in bug fixes or
added features when I bump kernel version.
Bryce
On Mon, Feb 3, 2025 at 8:48 AM Fiona Klute via buildroot
<buildroot@buildroot.org> wrote:
>
> Am 29.01.25 um 11:10 schrieb Romain Naour via buildroot:
> > Hello Fiona, All,
> >
> > Le 28/01/2025 à 14:33, Fiona Klute a écrit :
> >> Am 24.12.24 um 13:22 schrieb Edgar Bonet:
> >>> Hello!
> >>>
> >>> On 2024-12-18, Romain Naour wrote:
> >>>> Hello Edgar,
> >>>>
> >>>> Le 17/12/2024 à 10:55, Edgar Bonet a écrit :
> >>>>> Since Linux 6.12 (commit e7e2941300d2, "kbuild: split device tree build
> >>>>> rules into scripts/Makefile.dtbs"), the kernel build process does not
> >>>>> build the DTBs from the source files listed in
> >>>>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH.[1] This is because it expects all the
> >>>>> DTS files to live in vendor-specific subdirectories of
> >>>>> arch/$ARCH/boot/dts/ , whereas Buildroot drops them in the top dts
> >>>>> directory.
> >>>>
> >>>> Maybe we could add some additional explanation:
> >>>>
> >>>> BR2_LINUX_KERNEL_CUSTOM_DTS_PATH was introduced in Buildroot 2012.08 [1] at the
> >>>> time the kernel didn't have any vendor-specific subdirectory in
> >>>> arch/$ARCH/boot/dts/.
> >>>>
> >>>> vendor-specific subdirectory was introduced in kernel v3.19 [2] for ARM64 and in
> >>>> kernel v6.5 for ARM [3]. Note, other arch than ARM and ARM64 doesn't actually
> >>>> use a vendor-specific subdirectory (not even powerpc).
> >>>
> >>> I hadn't noticed that this varies among archs. Now that I look at it, it
> >>> appears mips and riscv also use vendor-specific subdirectories.
> >>>
> >>>> Your comment doesn't seems to apply for non ARM{,64} arch:
> >>>> "This is because it expects all the DTS files to live in vendor-specific
> >>>> subdirectories of arch/$ARCH/boot/dts/"
> >>>
> >>> Indeed, it is architecture-dependent.
> >>>
> >>>> [1]
> >>>> https://gitlab.com/buildroot.org/buildroot/-/
> >>>> commit/69fc497df0ae51bcc8a067c849447abdeb3cb2be
> >>>> [2]
> >>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
> >>>> id=ca5b34100c571658e605c5554aac374649593327
> >>>> [3]
> >>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?
> >>>> id=724ba6751532055db75992fc6ae21c3e322e94a7
> >>>>
> >>>>
> >>>>>
> >>>>> 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
> >>>>
> >>>> Note: Yocto doesn't rely on the kernel build infrastructure to build user
> >>>> provided devicetree [4].
> >>>>
> >>>> Maybe we should consider adding a new package infrastructure like kernel-module?
> >>>
> >>> This seems like an interesting option. It is, however, beyond my
> >>> capabilities.
> >>
> >> Bit late to the party, but: I currently have a package in an external
> >> tree that takes a list of .dts/.dtso files from config and calls cpp &
> >> dtc to build .dtb/.dtbo files, with include paths into the Linux build
> >> dir added. The build commands are naturally modeled on how the kernel
> >> build builds DTBs, but it doesn't rely on the kernel Makefiles.
> >
> > AFAIK, the current BR2_LINUX_KERNEL_CUSTOM_DTS_PATH option doesn't seems to take
> > into account any external devicetree overlay files (dtso).
> >
> > I've send a new version of this patch (but dtso are not supported):
> >
> > https://lore.kernel.org/buildroot/20250129095716.2511434-1-romain.naour@smile.fr/T/#t
> >
> >>
> >> Would something like that be interesting for Buildroot, whether as a
> >> generic DTB build package or infrastructure?
> >
> > While reviewing this patch, I had to take a look at how to build a dtb file
> > outside of the kernel build infrastructure (like Yocto does) but it's not easy.
> > Actually we are happy to keep this build process hidden in the kernel Makefiles.
> >
> > Since the next Buildroot meeting is next week, this is probably a topic we can
> > discuss. Feel free to send a patch (even a draft).
> I've just sent a patch, and would be happy to hear what you think. I'm
> not at the meeting, but available on IRC if there's anything to discuss. :-)
>
> See:
> https://patchwork.ozlabs.org/project/buildroot/patch/20250203154651.2790784-1-fiona.klute@gmx.de/
>
> Best regards,
> Fiona
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels
2025-02-04 14:47 ` Bryce Johnson
@ 2025-02-04 18:27 ` Fiona Klute via buildroot
0 siblings, 0 replies; 10+ messages in thread
From: Fiona Klute via buildroot @ 2025-02-04 18:27 UTC (permalink / raw)
To: Bryce Johnson
Cc: Romain Naour, Edgar Bonet, Buildroot development, Michael Walle,
Chris Packham, Sergey Matyukevich
Hi Bryce!
Am 04.02.25 um 15:47 schrieb Bryce Johnson:
> Hi Fiona,
> I tried the patch and it looks interesting, was there a way to still
> include some dtsi included in the kernel? For example, I have a
> custom board with TI AM62X. I might have a myboard.dts that wants to
> include from the kernel, k3-am625.dtsi which includes k3-am62.dtsi,
> which include k3-am62-main.dtsi,k3-am62-mcu.dtsi, k3-am62-wakeup.dtsi,
> etc.
Yes, I actually do that in my setups. E.g. I have a WIP (not posted
publicly yet, but planned) DTS for a certain RPi CM4 based device [1]. I
just have
#include "arm/broadcom/bcm2711-rpi-cm4-io.dts"
in there to start from the mainline CM4 IO-Board DTS. I should probably
switch to bcm2711-rpi-cm4.dtsi instead before sending a kernel patch,
but it works. :-)
Making that work is why $(LINUX_DIR)/scripts/dtc/include-prefixes/ is
added to the include paths for dtc in custom-dtbs.mk. What doesn't work
yet is using extra .dtsi files (as in ones you provide, not from kernel
source), but that should be easy to add.
Best regards,
Fiona
(Patch link for reference)
>> See:
>> https://patchwork.ozlabs.org/project/buildroot/patch/20250203154651.2790784-1-fiona.klute@gmx.de/
[1] https://revolutionpi.com/documentation/revpi-connect-4/
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-02-04 18:28 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17 9:55 [Buildroot] [PATCH v2 1/1] linux: make out-of-tree DTS work with newest kernels Edgar Bonet
2024-12-18 14:55 ` Romain Naour via buildroot
2024-12-24 12:22 ` Edgar Bonet
2025-01-28 13:33 ` Fiona Klute via buildroot
2025-01-29 10:10 ` Romain Naour via buildroot
2025-01-30 10:30 ` Niklas Cassel
2025-01-30 18:12 ` Romain Naour via buildroot
2025-02-03 15:48 ` Fiona Klute via buildroot
2025-02-04 14:47 ` Bryce Johnson
2025-02-04 18:27 ` Fiona Klute via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox