From: Sergey Matyukevich <geomatsi@gmail.com>
To: Michael Walle <michael@walle.cc>
Cc: Chris Packham <judge.packham@gmail.com>,
Edgar Bonet <bonet@grenoble.cnrs.fr>,
buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 0/3] {linux, linux-headers}: add support for 6.12
Date: Fri, 13 Dec 2024 16:30:16 +0300 [thread overview]
Message-ID: <Z1w26BB1zErsfiJR@curiosity> (raw)
In-Reply-To: <D6AHOKYUZUH7.2F0O7NKJXTL0N@walle.cc>
Hi Michael,
On Fri, Dec 13, 2024 at 11:09:45AM +0100, Michael Walle wrote:
> On Wed Dec 11, 2024 at 7:26 PM CET, Chris Packham wrote:
> > On Thu, 12 Dec 2024, 12:34 am Edgar Bonet, <bonet@grenoble.cnrs.fr> wrote:
> >
> > > Hello!
> > >
> > > About the incompatibility between Linux 6.12 and
> > > BR2_LINUX_KERNEL_CUSTOM_DTS_PATH, Sergey Matyukevich wrote:
> > > > IIUC at the moment Buildroot includes the following configurations
> > > > that make use of BR2_LINUX_KERNEL_CUSTOM_DTS_PATH: [only 5 of them]
> > >
> > > Oh, I hadn't noticed there were so few of them!
> > >
> > > > Adding new v6.12 kernel is not going to break any of those boards
> > > > right away. However if the build rule for drop-in dtbs will not be
> > > > re-enabled (which seems likely), migration to new kernels will be a
> > > > problem for those boards.
> > >
> > > Indeed, this is my concern: I maintain the defconfigs of the Acqua
> > > boards (acmesystems_acqua_a5_*), and I would like to upgrade them to
> > > Linux 6.12 before the Buildroot 2025.02 release.
> > >
> > > However, this issue will also affect users that build (or customize)
> > > their own configurations with `make nconfig` or similar. If they select
> > >
> > > [x] Linux Kernel
> > > [x] Build a Device Tree Blob (DTB)
> > > (some_file) Out-of-tree Device Tree Source file paths
> > >
> > > and leave `Kernel version' to its default (which is "Latest version"),
> > > they would end up with a non-functional configuration.
> > >
> > > > I don't see how BR2_LINUX_KERNEL_CUSTOM_DTS_PATH can be supported in
> > > > this case w/o patching new kernels. Probably it makes sense to convert
> > > > those out-of-tree dts files into proper kernel patches ?
> > >
> > > I see two options for patching the kernel:
> > >
> > > 1. Use Chris Packham's patch "kbuild: Restore the ability to build out
> > > of tree dtbs".[1] This works for me: if I drop the patch into
> > > board/acmesystems/acqua-a5/patches/linux/, I can change the kernel
> > > version to 6.12.4 and it just works. It seems like the path of least
> > > resistance for individual defconfigs, but I don't see this becoming
> > > Buildroot's blessed way of supporting custom DTSes.
> > >
> > > 2. Create a patch that adds the DTS to the kernel tree _and_ the DTB
> > > target to the relevant Makefile. I guess this is what you are
> > > suggesting.
> > >
> >
> > For what it's worth I implemented Masahiro's suggestion (basically option
> > 2) for our internal build tool at $dayjob. It's just a bit of sed-ing. It
> > works reasonably well. The trickiest part is avoiding repatching the
> > Makefile but for buildroot that's just a flag file.
>
> Are you sure you need to patch the Makefile? I've tested both
> compiling a dtso and a dts on the latest next. I've tried it on
> arm64 and copying it to a proper subdir in dts/ is working with
>
> $ make <subdir>/test.dtb
>
> To me, it looks like only the flat hierarchy isn't working anymore.
> But IMHO it was already wrong to copy a device tree to dts/ if there
> was a subdir structure in the first place.
>
> -michael
>
> > > If we go for the second option, then we would be saying that a kernel
> > > patch is the canonical way of providing a custom DTS. The
> > > BR2_LINUX_KERNEL_CUSTOM_DTS_PATH option would then have to be deprecated
> > > and eventually removed, which would be a breaking change for some users.
> > >
> > > I would persoanlly prefer updating the implementation of
> > > BR2_LINUX_KERNEL_CUSTOM_DTS_PATH in order to make it compatible with
> > > 6.12+ kernels. Maybe Buildroot could, in addition to copying the DTS to
> > > the kernel tree, add the relevant target to the Makefile. Basically do
> > > what the patch in method 2 is supposed to do.
> > >
> > > I could try to implement this approach, but it can take me some time
> > > (the `make' language is not my cup of tea). In the meantime, I suggest
> > > that, in your patch series, you update the help text of
> > > BR2_LINUX_KERNEL_CUSTOM_DTS_PATH in order to warn about this option
> > > being incompatible with kernels 6.12 and up.
> > >
> > > Regards,
> > >
> > > Edgar.
> > >
> > > [1]
> > > https://lore.kernel.org/all/20241015212830.3899891-1-chris.packham@alliedtelesis.co.nz/T/#u
> > >
Thanks for sharing the results of your tests. Indeed, if drop-in dts
files are still allowed in vendor subdirectories, then it should be
possible to keep BR2_LINUX_KERNEL_CUSTOM_DTS_PATH functionality w/o
converting dts files into patches or sed magic.
I tried to implement a quick PoC using one of the acmesystems boards
maintained by Edgar Bonet. Here is v0 which seems to be working (see
at the bottom of this email). It looks like it can also be implemented
w/o additional configuration option, e.g. drop-in dts files can be kept
in appropriately named subdirectories:
- board/acmesystems/acqua-a5/microchip/at91-sama5d3_acqua.dts
Regards,
Sergey
P.S. example patch v0 that allows to successfully build acqua-a5 with
updated kernel and out-of-tree dts:
diff --git a/board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts b/board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts
index 411d1942f5..60be8a67cd 100644
--- a/board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts
+++ b/board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts
@@ -9,7 +9,7 @@
* Licensed under GPLv2 or later.
*/
/dts-v1/;
-#include "microchip/sama5d31.dtsi"
+#include "sama5d31.dtsi"
/ {
model = "Acme Systems Acqua SOM";
diff --git a/configs/acmesystems_acqua_a5_256mb_defconfig b/configs/acmesystems_acqua_a5_256mb_defconfig
index b102dde0ba..c7025dc234 100644
--- a/configs/acmesystems_acqua_a5_256mb_defconfig
+++ b/configs/acmesystems_acqua_a5_256mb_defconfig
@@ -2,7 +2,7 @@ BR2_arm=y
BR2_cortex_a5=y
BR2_ARM_ENABLE_VFP=y
BR2_ARM_INSTRUCTIONS_THUMB2=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
BR2_GLOBAL_PATCH_DIR="board/acmesystems/acqua-a5/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_SYSTEM_DHCP="eth0"
@@ -10,10 +10,11 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/acmesystems/acqua-a5/genimage.cfg"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.30"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.3"
BR2_LINUX_KERNEL_DEFCONFIG="sama5"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/acmesystems/acqua-a5/at91-sama5d3_acqua.dts"
+BR2_LINUX_KERNEL_CUSTOM_DTS_VENDOR="microchip"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
diff --git a/linux/Config.in b/linux/Config.in
index f537dd7adf..1b5d042782 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -425,6 +425,11 @@ config BR2_LINUX_KERNEL_CUSTOM_DTS_PATH
will be copied to the kernel sources and the .dts files will
be compiled from there.
+config BR2_LINUX_KERNEL_CUSTOM_DTS_VENDOR
+ string "In-tree vendor for out-of-tree dts"
+ help
+ TBD
+
config BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME
bool "Keep the directory name of the Device Tree"
help
diff --git a/linux/linux.mk b/linux/linux.mk
index 1d3d8fffa6..afc3c9ad2b 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -208,7 +208,7 @@ LINUX_DTS_NAME += $(call qstrip,$(BR2_LINUX_KERNEL_INTREE_DTS_NAME))
# and .dtsi files in BR2_LINUX_KERNEL_CUSTOM_DTS_PATH. Both will be
# copied to arch/<arch>/boot/dts, but only the .dts files will
# actually be generated as .dtb.
-LINUX_DTS_NAME += $(basename $(filter %.dts,$(notdir $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)))))
+LINUX_DTS_NAME += $(addprefix $(BR2_LINUX_KERNEL_CUSTOM_DTS_VENDOR)/, $(basename $(filter %.dts,$(notdir $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH))))))
LINUX_DTBS = $(addsuffix .dtb,$(LINUX_DTS_NAME))
@@ -468,7 +468,7 @@ define LINUX_INSTALL_DTB
# dtbs moved from arch/<ARCH>/boot to arch/<ARCH>/boot/dts since 3.8-rc1
$(foreach dtb,$(LINUX_DTBS), \
install -D \
- $(or $(wildcard $(LINUX_ARCH_PATH)/boot/dts/$(dtb)),$(LINUX_ARCH_PATH)/boot/$(dtb)) \
+ $(or $(wildcard $(LINUX_ARCH_PATH)/boot/dts/$(dtb)),$(LINUX_ARCH_PATH)/boot/dts/$(dtb),$(LINUX_ARCH_PATH)/boot/$(dtb)) \
$(1)/$(if $(BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME),$(dtb),$(notdir $(dtb)))
)
endef
@@ -516,7 +516,7 @@ endif
define LINUX_BUILD_CMDS
$(call KCONFIG_DISABLE_OPT,CONFIG_GCC_PLUGINS)
$(foreach dts,$(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)), \
- cp -f $(dts) $(LINUX_ARCH_PATH)/boot/dts/
+ cp -f $(dts) $(LINUX_ARCH_PATH)/boot/dts/$(BR2_LINUX_KERNEL_CUSTOM_DTS_VENDOR)/
)
$(LINUX_MAKE_ENV) $(BR2_MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) all
$(LINUX_MAKE_ENV) $(BR2_MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-12-13 13:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-08 21:46 [Buildroot] [PATCH 0/3] {linux, linux-headers}: add support for 6.12 Sergey Matyukevich
2024-12-08 21:46 ` [Buildroot] [PATCH 1/3] {toolchain, linux-headers}: add support for 6.12 headers Sergey Matyukevich
2024-12-08 21:46 ` [Buildroot] [PATCH 2/3] linux: bump latest version to 6.12 Sergey Matyukevich
2024-12-08 21:46 ` [Buildroot] [PATCH 3/3] package/linux-headers: drop 6.11.x option Sergey Matyukevich
2024-12-09 8:11 ` [Buildroot] [PATCH 0/3] {linux, linux-headers}: add support for 6.12 Edgar Bonet
2024-12-10 20:43 ` Sergey Matyukevich
2024-12-11 11:34 ` Edgar Bonet
2024-12-11 18:26 ` Chris Packham
2024-12-13 10:09 ` Michael Walle via buildroot
2024-12-13 13:30 ` Sergey Matyukevich [this message]
2024-12-13 15:40 ` Edgar Bonet
2024-12-13 10:11 ` Michael Walle via buildroot
2024-12-11 13:43 ` Romain Naour via buildroot
2024-12-11 19:06 ` Romain Naour via buildroot
2024-12-11 19:41 ` Sergey Matyukevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1w26BB1zErsfiJR@curiosity \
--to=geomatsi@gmail.com \
--cc=bonet@grenoble.cnrs.fr \
--cc=buildroot@buildroot.org \
--cc=judge.packham@gmail.com \
--cc=michael@walle.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox