From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sun, 24 Oct 2021 21:45:52 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mejRI-0003dR-I9 for lore@lore.pengutronix.de; Sun, 24 Oct 2021 21:45:52 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mejRH-0000GH-Hg; Sun, 24 Oct 2021 21:45:51 +0200 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mejR4-00009r-DI; Sun, 24 Oct 2021 21:45:38 +0200 Received: from rhi by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mejR3-0001l7-Sp; Sun, 24 Oct 2021 21:45:37 +0200 From: Roland Hieber To: distrokit@pengutronix.de Date: Sun, 24 Oct 2021 21:45:29 +0200 Message-Id: <20211024194534.6704-3-rhi@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211024194534.6704-1-rhi@pengutronix.de> References: <20211024194534.6704-1-rhi@pengutronix.de> MIME-Version: 1.0 Subject: [DistroKit] [PATCH 3/8] mips, mipsel: kernel-*: rework device-tree handling X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roland Hieber Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false This ports the kernel template part of PTXdist commit f50cd1449e934730: | commit f50cd1449e9347309b1050b0b738882dac1954e9 | Author: Michael Olbrich | Date: 2021-07-09 17:25:41 | | rework device-tree handling | | It's not really possible to build a dtb by itself. A lot of included dtsi | and header files are needed. So build the device-trees with the package | that provides these files. Currently that's the kernel package. | | This also means, that other kernel packages can have their own device-trees | as well. | | Signed-off-by: Michael Olbrich Set KERNEL_*_DTS to the current values of PTXCONF_DTC_OFTREE_DTS from the platformconfig, as this symbol will vanish when migrating to the next PTXdist version. Link: https://git.pengutronix.de/cgit/ptxdist/commit/?id=f50cd1449e9347309b10 Signed-off-by: Roland Hieber --- .../platform-mips/rules/kernel-ar9331.make | 31 +++++++++++++++++++ configs/platform-mips/rules/kernel-malta.make | 31 +++++++++++++++++++ .../platform-mipsel/rules/kernel-malta.make | 31 +++++++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/configs/platform-mips/rules/kernel-ar9331.make b/configs/platform-mips/rules/kernel-ar9331.make index b4a33fb09e38..7b9782d2b696 100644 --- a/configs/platform-mips/rules/kernel-ar9331.make +++ b/configs/platform-mips/rules/kernel-ar9331.make @@ -25,10 +25,16 @@ KERNEL_AR9331_DIR := $(BUILDDIR)/$(KERNEL_AR9331) KERNEL_AR9331_BUILD_DIR := $(KERNEL_AR9331_DIR)-build KERNEL_AR9331_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig-ar9331) KERNEL_AR9331_REF_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig) +KERNEL_AR9331_DTS_PATH := ${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_AR9331_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts/qca +KERNEL_AR9331_DTS := ar9331_dpt_module.dts +KERNEL_AR9331_DTB_FILES := $(addsuffix .dtb,$(basename $(KERNEL_AR9331_DTS))) KERNEL_AR9331_LICENSE := GPL-2.0-only KERNEL_AR9331_LICENSE_FILES := KERNEL_AR9331_BUILD_OOT := KEEP +# track changes to devices-trees in the BSP +$(call world/dts-cfghash-file, KERNEL_AR9331) + # ---------------------------------------------------------------------------- # Prepare # ---------------------------------------------------------------------------- @@ -90,6 +96,12 @@ KERNEL_AR9331_INSTALL_OPT := \ $(call kernel-opts, KERNEL_AR9331) \ modules_install +$(STATEDIR)/kernel-ar9331.install: + @$(call targetinfo) + @$(call world/install, KERNEL_AR9331) + @$(call world/dtb, KERNEL_AR9331) + @$(call touch) + # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- @@ -101,6 +113,11 @@ $(STATEDIR)/kernel-ar9331.targetinstall: install -v -m 644 $(image) \ $(IMAGEDIR)/$(notdir $(image))-ar9331$(ptx/nl)) + @$(foreach dtb ,$(KERNEL_AR9331_DTB_FILES), \ + echo -e "Installing $(dtb) ...\n"$(ptx/nl) \ + install -D -m0644 $(KERNEL_AR9331_PKGDIR)/boot/$(dtb) \ + $(IMAGEDIR)/$(dtb)$(ptx/nl)) + @$(call install_init, kernel-ar9331) @$(call install_fixup, kernel-ar9331, PRIORITY,optional) @$(call install_fixup, kernel-ar9331, SECTION,base) @@ -110,6 +127,10 @@ $(STATEDIR)/kernel-ar9331.targetinstall: @$(call install_copy, kernel-ar9331, 0, 0, 0644, \ $(IMAGEDIR)/vmlinuz-ar9331, /boot/vmlinuz-ar9331, n) + @$(foreach dtb, $(KERNEL_AR9331_DTB_FILES), \ + $(call install_copy, kernel-ar9331, 0, 0, 0644, -, \ + /boot/$(dtb), n)$(ptx/nl)) + @$(call install_glob, kernel-ar9331, 0, 0, -, /lib/modules, *.ko,, n) @$(call install_glob, kernel-ar9331, 0, 0, -, /lib/modules,, *.ko */build */source, n) @@ -117,6 +138,16 @@ $(STATEDIR)/kernel-ar9331.targetinstall: @$(call touch) +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +$(STATEDIR)/kernel-ar9331.clean: + @$(call targetinfo) + @$(call clean_pkg, KERNEL_AR9331) + @$(foreach dtb,$(KERNEL_AR9331_DTB_FILES), \ + rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl)) + # ---------------------------------------------------------------------------- # oldconfig / menuconfig # ---------------------------------------------------------------------------- diff --git a/configs/platform-mips/rules/kernel-malta.make b/configs/platform-mips/rules/kernel-malta.make index 1d8b72c8efc2..c5028b996264 100644 --- a/configs/platform-mips/rules/kernel-malta.make +++ b/configs/platform-mips/rules/kernel-malta.make @@ -25,10 +25,16 @@ KERNEL_MALTA_DIR := $(BUILDDIR)/$(KERNEL_MALTA) KERNEL_MALTA_BUILD_DIR := $(KERNEL_MALTA_DIR)-build KERNEL_MALTA_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig-malta) KERNEL_MALTA_REF_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig) +KERNEL_MALTA_DTS_PATH := ${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_MALTA_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts/mti +KERNEL_MALTA_DTS := malta.dts +KERNEL_MALTA_DTB_FILES := $(addsuffix .dtb,$(basename $(KERNEL_MALTA_DTS))) KERNEL_MALTA_LICENSE := GPL-2.0-only KERNEL_MALTA_LICENSE_FILES := KERNEL_MALTA_BUILD_OOT := KEEP +# track changes to devices-trees in the BSP +$(call world/dts-cfghash-file, KERNEL_MALTA) + # ---------------------------------------------------------------------------- # Prepare # ---------------------------------------------------------------------------- @@ -90,6 +96,12 @@ KERNEL_MALTA_INSTALL_OPT := \ $(call kernel-opts, KERNEL_MALTA) \ modules_install +$(STATEDIR)/kernel-malta.install: + @$(call targetinfo) + @$(call world/install, KERNEL_MALTA) + @$(call world/dtb, KERNEL_MALTA) + @$(call touch) + # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- @@ -101,6 +113,11 @@ $(STATEDIR)/kernel-malta.targetinstall: install -v -m 644 $(image) \ $(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl)) + @$(foreach dtb ,$(KERNEL_MALTA_DTB_FILES), \ + echo -e "Installing $(dtb) ...\n"$(ptx/nl) \ + install -D -m0644 $(KERNEL_MALTA_PKGDIR)/boot/$(dtb) \ + $(IMAGEDIR)/$(dtb)$(ptx/nl)) + @$(call install_init, kernel-malta) @$(call install_fixup, kernel-malta, PRIORITY,optional) @$(call install_fixup, kernel-malta, SECTION,base) @@ -110,6 +127,10 @@ $(STATEDIR)/kernel-malta.targetinstall: @$(call install_copy, kernel-malta, 0, 0, 0644, \ $(IMAGEDIR)/vmlinuz-malta, /boot/vmlinuz-malta, n) + @$(foreach dtb, $(KERNEL_MALTA_DTB_FILES), \ + $(call install_copy, kernel-malta, 0, 0, 0644, -, \ + /boot/$(dtb), n)$(ptx/nl)) + @$(call install_glob, kernel-malta, 0, 0, -, /lib/modules, *.ko,, n) @$(call install_glob, kernel-malta, 0, 0, -, /lib/modules,, *.ko */build */source, n) @@ -117,6 +138,16 @@ $(STATEDIR)/kernel-malta.targetinstall: @$(call touch) +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +$(STATEDIR)/kernel-malta.clean: + @$(call targetinfo) + @$(call clean_pkg, KERNEL_MALTA) + @$(foreach dtb,$(KERNEL_MALTA_DTB_FILES), \ + rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl)) + # ---------------------------------------------------------------------------- # oldconfig / menuconfig # ---------------------------------------------------------------------------- diff --git a/configs/platform-mipsel/rules/kernel-malta.make b/configs/platform-mipsel/rules/kernel-malta.make index 94f49b89b774..c2bea47e9d0c 100644 --- a/configs/platform-mipsel/rules/kernel-malta.make +++ b/configs/platform-mipsel/rules/kernel-malta.make @@ -25,10 +25,16 @@ KERNEL_MALTA_DIR := $(BUILDDIR)/$(KERNEL_MALTA) KERNEL_MALTA_BUILD_DIR := $(KERNEL_MALTA_DIR)-build KERNEL_MALTA_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig-malta) KERNEL_MALTA_REF_CONFIG := $(call ptx/in-platformconfigdir, kernelconfig) +KERNEL_MALTA_DTS_PATH := ${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_MALTA_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts/mti +KERNEL_MALTA_DTS := malta.dts +KERNEL_MALTA_DTB_FILES := $(addsuffix .dtb,$(basename $(KERNEL_MALTA_DTS))) KERNEL_MALTA_LICENSE := GPL-2.0-only KERNEL_MALTA_LICENSE_FILES := KERNEL_MALTA_BUILD_OOT := KEEP +# track changes to devices-trees in the BSP +$(call world/dts-cfghash-file, KERNEL_MALTA) + # ---------------------------------------------------------------------------- # Prepare # ---------------------------------------------------------------------------- @@ -90,6 +96,12 @@ KERNEL_MALTA_INSTALL_OPT := \ $(call kernel-opts, KERNEL_MALTA) \ modules_install +$(STATEDIR)/kernel-malta.install: + @$(call targetinfo) + @$(call world/install, KERNEL_MALTA) + @$(call world/dtb, KERNEL_MALTA) + @$(call touch) + # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- @@ -101,6 +113,11 @@ $(STATEDIR)/kernel-malta.targetinstall: install -v -m 644 $(image) \ $(IMAGEDIR)/$(notdir $(image))-malta$(ptx/nl)) + @$(foreach dtb ,$(KERNEL_MALTA_DTB_FILES), \ + echo -e "Installing $(dtb) ...\n"$(ptx/nl) \ + install -D -m0644 $(KERNEL_MALTA_PKGDIR)/boot/$(dtb) \ + $(IMAGEDIR)/$(dtb)$(ptx/nl)) + @$(call install_init, kernel-malta) @$(call install_fixup, kernel-malta, PRIORITY,optional) @$(call install_fixup, kernel-malta, SECTION,base) @@ -110,6 +127,10 @@ $(STATEDIR)/kernel-malta.targetinstall: @$(call install_copy, kernel-malta, 0, 0, 0644, \ $(IMAGEDIR)/vmlinuz-malta, /boot/vmlinuz-malta, n) + @$(foreach dtb, $(KERNEL_MALTA_DTB_FILES), \ + $(call install_copy, kernel-malta, 0, 0, 0644, -, \ + /boot/$(dtb), n)$(ptx/nl)) + @$(call install_glob, kernel-malta, 0, 0, -, /lib/modules, *.ko,, n) @$(call install_glob, kernel-malta, 0, 0, -, /lib/modules,, *.ko */build */source, n) @@ -117,6 +138,16 @@ $(STATEDIR)/kernel-malta.targetinstall: @$(call touch) +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +$(STATEDIR)/kernel-malta.clean: + @$(call targetinfo) + @$(call clean_pkg, KERNEL_MALTA) + @$(foreach dtb,$(KERNEL_MALTA_DTB_FILES), \ + rm -vf $(IMAGEDIR)/$(dtb)$(ptx/nl)) + # ---------------------------------------------------------------------------- # oldconfig / menuconfig # ---------------------------------------------------------------------------- -- 2.30.2 _______________________________________________ DistroKit mailing list DistroKit@pengutronix.de