DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: distrokit@pengutronix.de
Cc: Roland Hieber <rhi@pengutronix.de>
Subject: [DistroKit] [PATCH v2 3/5] mips, mipsel: kernel-*: rework device-tree handling
Date: Fri, 26 Nov 2021 11:39:35 +0100	[thread overview]
Message-ID: <20211126103937.2856148-3-rhi@pengutronix.de> (raw)
In-Reply-To: <20211126103937.2856148-1-rhi@pengutronix.de>

This ports the kernel template part of PTXdist commit f50cd1449e934730:

    | commit f50cd1449e9347309b1050b0b738882dac1954e9
    | Author: Michael Olbrich <m.olbrich@pengutronix.de>
    | 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 <m.olbrich@pengutronix.de>

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 <rhi@pengutronix.de>
---
v2: no changes

 .../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


  parent reply	other threads:[~2021-11-26 10:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 10:39 [DistroKit] [PATCH v2 1/5] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Roland Hieber
2021-11-26 10:39 ` [DistroKit] [PATCH v2 2/5] mips, mipsel: kernel-*: bring up-to-date with PTXdist 2021.07.0 template Roland Hieber
2021-11-26 10:39 ` Roland Hieber [this message]
2021-11-26 10:39 ` [DistroKit] [PATCH v2 4/5] mips, mipsel: kernel-*: use ptx/config-version and ptx/config-md5 Roland Hieber
2021-11-26 10:39 ` [DistroKit] [PATCH v2 5/5] mips, mipsel: update kernel configs Roland Hieber
2021-11-26 10:47 ` [DistroKit] [PATCH v2 1/5] mips, mipsel: kernel-*: bring back KERNEL_*_PATH Robert Schwebel

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=20211126103937.2856148-3-rhi@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /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