All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/4] ARM build infra changes to support building .dtbos
@ 2018-08-31 12:47 ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Hi,

This v2 is just a split of the v1 series, adding support for building
DT overlays to ARM build infra. The series also adds support for
individual Makefiles under boot/dts hierarchy, so that per-dir
flags or rules can be introduced (patch #2, #4.)

Depends on the kbuild change for adding support for building .dtbo files [1].

[1] https://marc.info/?l=linux-arm-kernel&m=153571933518229&w=2

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCHv2 0/4] ARM build infra changes to support building .dtbos
@ 2018-08-31 12:47 ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This v2 is just a split of the v1 series, adding support for building
DT overlays to ARM build infra. The series also adds support for
individual Makefiles under boot/dts hierarchy, so that per-dir
flags or rules can be introduced (patch #2, #4.)

Depends on the kbuild change for adding support for building .dtbo files [1].

[1] https://marc.info/?l=linux-arm-kernel&m=153571933518229&w=2

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCHv2 1/4] ARM: dts: add support for building DT overlays
  2018-08-31 12:47 ` Tero Kristo
@ 2018-08-31 12:47   ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm/boot/dts directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d1516f8..ab555a0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-%.dtb: | scripts
+%.dtb %.dtbo: | scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCHv2 1/4] ARM: dts: add support for building DT overlays
@ 2018-08-31 12:47   ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm/boot/dts directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d1516f8..ab555a0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-%.dtb: | scripts
+%.dtb %.dtbo: | scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
  2018-08-31 12:47 ` Tero Kristo
@ 2018-08-31 12:47   ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Currently the makefile is setup in such manner that even if
we build a DT file in a subdirectory under arch/arm/boot/dts,
it gets built based on the base boot/dts/Makefile rules.
This patch modifies the base makefile in such manner, that
it detects which makefile to use based on build target path.
This allows setting for example per-directory DTC_FLAGS and
using those for the subdir build. The dtbdir local variable
is setup to target to the build path.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ab555a0..b7c21e8 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
+%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
+
 %.dtb %.dtbo: | scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
@ 2018-08-31 12:47   ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the makefile is setup in such manner that even if
we build a DT file in a subdirectory under arch/arm/boot/dts,
it gets built based on the base boot/dts/Makefile rules.
This patch modifies the base makefile in such manner, that
it detects which makefile to use based on build target path.
This allows setting for example per-directory DTC_FLAGS and
using those for the subdir build. The dtbdir local variable
is setup to target to the build path.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ab555a0..b7c21e8 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
+%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
+
 %.dtb %.dtbo: | scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCHv2 3/4] arm64: dts: add support for building DT overlays
  2018-08-31 12:47 ` Tero Kristo
@ 2018-08-31 12:47   ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm64/boot/dts/*/ directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 106039d..f04c814 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -127,7 +127,7 @@ Image.%: Image
 zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
-%.dtb: scripts
+%.dtb %.dtbo: scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCHv2 3/4] arm64: dts: add support for building DT overlays
@ 2018-08-31 12:47   ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm64/boot/dts/*/ directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 106039d..f04c814 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -127,7 +127,7 @@ Image.%: Image
 zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
-%.dtb: scripts
+%.dtb %.dtbo: scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building
  2018-08-31 12:47 ` Tero Kristo
@ 2018-08-31 12:47   ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Currently the makefile for arm64 builds all the DT files based on
rules in the arch/arm64/boot/dts/Makefile, as this is statically
passed via the $(build)= parameter. Change the $(build) parameter
to actually point to the subdir itself, so the makefile from
that subdir can be used to set-up build flags etc., for example
setting up DTC_FLAGS. The patsubst magic is used to strip the
trailing "/" from the path, as that confuses the kbuild system.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f04c814..2ac4358 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -128,7 +128,7 @@ zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
 %.dtb %.dtbo: scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(patsubst %/,%,$(boot)/dts/$(dir $@)) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building
@ 2018-08-31 12:47   ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-08-31 12:47 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the makefile for arm64 builds all the DT files based on
rules in the arch/arm64/boot/dts/Makefile, as this is statically
passed via the $(build)= parameter. Change the $(build) parameter
to actually point to the subdir itself, so the makefile from
that subdir can be used to set-up build flags etc., for example
setting up DTC_FLAGS. The patsubst magic is used to strip the
trailing "/" from the path, as that confuses the kbuild system.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f04c814..2ac4358 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -128,7 +128,7 @@ zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
 %.dtb %.dtbo: scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(patsubst %/,%,$(boot)/dts/$(dir $@)) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 0/4] ARM build infra changes to support building .dtbos
  2018-08-31 12:47 ` Tero Kristo
@ 2018-09-04  8:05   ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt, frowand.list
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Hi,

This v2 is just a split of the v1 series, adding support for building
DT overlays to ARM build infra. The series also adds support for
individual Makefiles under boot/dts hierarchy, so that per-dir
flags or rules can be introduced (patch #2, #4.)

Resending due to missing Frank from delivery of initial v2.

Depends on the kbuild change for adding support for building .dtbo files [1].

[1] https://marc.info/?l=linux-arm-kernel&m=153604732319790&w=2

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 0/4] ARM build infra changes to support building .dtbos
@ 2018-09-04  8:05   ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This v2 is just a split of the v1 series, adding support for building
DT overlays to ARM build infra. The series also adds support for
individual Makefiles under boot/dts hierarchy, so that per-dir
flags or rules can be introduced (patch #2, #4.)

Resending due to missing Frank from delivery of initial v2.

Depends on the kbuild change for adding support for building .dtbo files [1].

[1] https://marc.info/?l=linux-arm-kernel&m=153604732319790&w=2

-Tero

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
  2018-09-04  8:05   ` Tero Kristo
@ 2018-09-04  8:05     ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt, frowand.list
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm/boot/dts directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d1516f8..ab555a0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-%.dtb: | scripts
+%.dtb %.dtbo: | scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
@ 2018-09-04  8:05     ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm/boot/dts directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index d1516f8..ab555a0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
-%.dtb: | scripts
+%.dtb %.dtbo: | scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
  2018-09-04  8:05   ` Tero Kristo
@ 2018-09-04  8:05     ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt, frowand.list
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Currently the makefile is setup in such manner that even if
we build a DT file in a subdirectory under arch/arm/boot/dts,
it gets built based on the base boot/dts/Makefile rules.
This patch modifies the base makefile in such manner, that
it detects which makefile to use based on build target path.
This allows setting for example per-directory DTC_FLAGS and
using those for the subdir build. The dtbdir local variable
is setup to target to the build path.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ab555a0..b7c21e8 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
+%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
+
 %.dtb %.dtbo: | scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
@ 2018-09-04  8:05     ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the makefile is setup in such manner that even if
we build a DT file in a subdirectory under arch/arm/boot/dts,
it gets built based on the base boot/dts/Makefile rules.
This patch modifies the base makefile in such manner, that
it detects which makefile to use based on build target path.
This allows setting for example per-directory DTC_FLAGS and
using those for the subdir build. The dtbdir local variable
is setup to target to the build path.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ab555a0..b7c21e8 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
 $(INSTALL_TARGETS):
 	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
 
+%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
+
 %.dtb %.dtbo: | scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 3/4] arm64: dts: add support for building DT overlays
  2018-09-04  8:05   ` Tero Kristo
@ 2018-09-04  8:05     ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt, frowand.list
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm64/boot/dts/*/ directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 106039d..f04c814 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -127,7 +127,7 @@ Image.%: Image
 zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
-%.dtb: scripts
+%.dtb %.dtbo: scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 3/4] arm64: dts: add support for building DT overlays
@ 2018-09-04  8:05     ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add simple support for building DT overlays. This just compiles any
given .dtso file under the base arch/arm64/boot/dts/*/ directory into
a .dtbo.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 106039d..f04c814 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -127,7 +127,7 @@ Image.%: Image
 zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
-%.dtb: scripts
+%.dtb %.dtbo: scripts
 	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building
  2018-09-04  8:05   ` Tero Kristo
@ 2018-09-04  8:05     ` Tero Kristo
  -1 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: catalin.marinas, will.deacon, linux, robh+dt, frowand.list
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

Currently the makefile for arm64 builds all the DT files based on
rules in the arch/arm64/boot/dts/Makefile, as this is statically
passed via the $(build)= parameter. Change the $(build) parameter
to actually point to the subdir itself, so the makefile from
that subdir can be used to set-up build flags etc., for example
setting up DTC_FLAGS. The patsubst magic is used to strip the
trailing "/" from the path, as that confuses the kbuild system.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f04c814..2ac4358 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -128,7 +128,7 @@ zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
 %.dtb %.dtbo: scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(patsubst %/,%,$(boot)/dts/$(dir $@)) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building
@ 2018-09-04  8:05     ` Tero Kristo
  0 siblings, 0 replies; 34+ messages in thread
From: Tero Kristo @ 2018-09-04  8:05 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the makefile for arm64 builds all the DT files based on
rules in the arch/arm64/boot/dts/Makefile, as this is statically
passed via the $(build)= parameter. Change the $(build) parameter
to actually point to the subdir itself, so the makefile from
that subdir can be used to set-up build flags etc., for example
setting up DTC_FLAGS. The patsubst magic is used to strip the
trailing "/" from the path, as that confuses the kbuild system.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 arch/arm64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index f04c814..2ac4358 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -128,7 +128,7 @@ zinstall install:
 	$(Q)$(MAKE) $(build)=$(boot) $@
 
 %.dtb %.dtbo: scripts
-	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
+	$(Q)$(MAKE) $(build)=$(patsubst %/,%,$(boot)/dts/$(dir $@)) $(boot)/dts/$@
 
 PHONY += dtbs dtbs_install
 
-- 
1.9.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
  2018-09-04  8:05     ` Tero Kristo
@ 2018-09-05 20:36       ` Frank Rowand
  -1 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:36 UTC (permalink / raw)
  To: Tero Kristo, catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, Devicetree Compiler, linux-arm-kernel

+cc: devicetree-compiler@vger.kernel.org

     For context on the device-tree compiler list, this patch is for
     the Linux kernel.

On 09/04/18 01:05, Tero Kristo wrote:
> Add simple support for building DT overlays. This just compiles any
> given .dtso file under the base arch/arm/boot/dts directory into
> a .dtbo.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index d1516f8..ab555a0 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
>  $(INSTALL_TARGETS):
>  	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
>  
> -%.dtb: | scripts
> +%.dtb %.dtbo: | scripts
>  	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
> 

The idea of adding knowledge of .dtso and .dtbo files to the dtc
compiler, but that idea and the related patches have fallen by
the wayside.

Current overlay sources and blobs are properly handled by dtc when
they are .dts and .dtb files.

If the dtc compiler is updated with knowledge of .dtso and .dtbo
then these changes would be needed.  At the moment the distinction
of a .dtso and .dtbo is a naming convention that provides a clue
about the intended use of the file.  But dtc does not know these
file name extensions, requiring a specific flag to tell dtc to
treat them as .dts or .dtb files.  I think the negative outweighs
the positive for this patch.

-Frank

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
@ 2018-09-05 20:36       ` Frank Rowand
  0 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:36 UTC (permalink / raw)
  To: linux-arm-kernel

+cc: devicetree-compiler at vger.kernel.org

     For context on the device-tree compiler list, this patch is for
     the Linux kernel.

On 09/04/18 01:05, Tero Kristo wrote:
> Add simple support for building DT overlays. This just compiles any
> given .dtso file under the base arch/arm/boot/dts directory into
> a .dtbo.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index d1516f8..ab555a0 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
>  $(INSTALL_TARGETS):
>  	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
>  
> -%.dtb: | scripts
> +%.dtb %.dtbo: | scripts
>  	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
> 

The idea of adding knowledge of .dtso and .dtbo files to the dtc
compiler, but that idea and the related patches have fallen by
the wayside.

Current overlay sources and blobs are properly handled by dtc when
they are .dts and .dtb files.

If the dtc compiler is updated with knowledge of .dtso and .dtbo
then these changes would be needed.  At the moment the distinction
of a .dtso and .dtbo is a naming convention that provides a clue
about the intended use of the file.  But dtc does not know these
file name extensions, requiring a specific flag to tell dtc to
treat them as .dts or .dtb files.  I think the negative outweighs
the positive for this patch.

-Frank

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
  2018-09-04  8:05     ` Tero Kristo
@ 2018-09-05 20:36       ` Frank Rowand
  -1 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:36 UTC (permalink / raw)
  To: Tero Kristo, catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

On 09/04/18 01:05, Tero Kristo wrote:
> Currently the makefile is setup in such manner that even if
> we build a DT file in a subdirectory under arch/arm/boot/dts,
> it gets built based on the base boot/dts/Makefile rules.
> This patch modifies the base makefile in such manner, that
> it detects which makefile to use based on build target path.
> This allows setting for example per-directory DTC_FLAGS and
> using those for the subdir build. The dtbdir local variable
> is setup to target to the build path.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index ab555a0..b7c21e8 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
>  $(INSTALL_TARGETS):
>  	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
>  
> +%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
> +
>  %.dtb %.dtbo: | scripts
> -	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
> +	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
>  
> 

The makefile magic to handle subdirectories below $(boot)/dts/ already
works properly to have Makefiles in $(boot)/dts/, using the following
rule in arch/arm64/Makefile:

%.dtb: scripts
        $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@

I don't understand why that works for arm64, but it should work the
same way for arm.  Or if arch/arm is missing another piece from
arch/arm64 we should be consistent with however the make system
specifies it in arch/arm64

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
@ 2018-09-05 20:36       ` Frank Rowand
  0 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/04/18 01:05, Tero Kristo wrote:
> Currently the makefile is setup in such manner that even if
> we build a DT file in a subdirectory under arch/arm/boot/dts,
> it gets built based on the base boot/dts/Makefile rules.
> This patch modifies the base makefile in such manner, that
> it detects which makefile to use based on build target path.
> This allows setting for example per-directory DTC_FLAGS and
> using those for the subdir build. The dtbdir local variable
> is setup to target to the build path.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index ab555a0..b7c21e8 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
>  $(INSTALL_TARGETS):
>  	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
>  
> +%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
> +
>  %.dtb %.dtbo: | scripts
> -	$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
> +	$(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
>  
> 

The makefile magic to handle subdirectories below $(boot)/dts/ already
works properly to have Makefiles in $(boot)/dts/, using the following
rule in arch/arm64/Makefile:

%.dtb: scripts
        $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@

I don't understand why that works for arm64, but it should work the
same way for arm.  Or if arch/arm is missing another piece from
arch/arm64 we should be consistent with however the make system
specifies it in arch/arm64

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [RESEND PATCHv2 3/4] arm64: dts: add support for building DT overlays
  2018-09-04  8:05     ` Tero Kristo
@ 2018-09-05 20:36       ` Frank Rowand
  -1 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:36 UTC (permalink / raw)
  To: Tero Kristo, catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, Devicetree Compiler, linux-arm-kernel

On 09/04/18 01:05, Tero Kristo wrote:
> Add simple support for building DT overlays. This just compiles any
> given .dtso file under the base arch/arm64/boot/dts/*/ directory into
> a .dtbo.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm64/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 106039d..f04c814 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -127,7 +127,7 @@ Image.%: Image
>  zinstall install:
>  	$(Q)$(MAKE) $(build)=$(boot) $@
>  
> -%.dtb: scripts
> +%.dtb %.dtbo: scripts
>  	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
> 

Same comments as for patch 1/4.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 3/4] arm64: dts: add support for building DT overlays
@ 2018-09-05 20:36       ` Frank Rowand
  0 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:36 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/04/18 01:05, Tero Kristo wrote:
> Add simple support for building DT overlays. This just compiles any
> given .dtso file under the base arch/arm64/boot/dts/*/ directory into
> a .dtbo.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm64/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index 106039d..f04c814 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -127,7 +127,7 @@ Image.%: Image
>  zinstall install:
>  	$(Q)$(MAKE) $(build)=$(boot) $@
>  
> -%.dtb: scripts
> +%.dtb %.dtbo: scripts
>  	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
> 

Same comments as for patch 1/4.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [RESEND PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building
  2018-09-04  8:05     ` Tero Kristo
@ 2018-09-05 20:37       ` Frank Rowand
  -1 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:37 UTC (permalink / raw)
  To: Tero Kristo, catalin.marinas, will.deacon, linux, robh+dt
  Cc: mark.rutland, devicetree, tony, linux-arm-kernel

On 09/04/18 01:05, Tero Kristo wrote:
> Currently the makefile for arm64 builds all the DT files based on
> rules in the arch/arm64/boot/dts/Makefile, as this is statically
> passed via the $(build)= parameter. Change the $(build) parameter
> to actually point to the subdir itself, so the makefile from
> that subdir can be used to set-up build flags etc., for example
> setting up DTC_FLAGS. The patsubst magic is used to strip the
> trailing "/" from the path, as that confuses the kbuild system.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm64/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index f04c814..2ac4358 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -128,7 +128,7 @@ zinstall install:
>  	$(Q)$(MAKE) $(build)=$(boot) $@
>  
>  %.dtb %.dtbo: scripts
> -	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
> +	$(Q)$(MAKE) $(build)=$(patsubst %/,%,$(boot)/dts/$(dir $@)) $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
>  
> 

same comment as for patch 2/4

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building
@ 2018-09-05 20:37       ` Frank Rowand
  0 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-05 20:37 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/04/18 01:05, Tero Kristo wrote:
> Currently the makefile for arm64 builds all the DT files based on
> rules in the arch/arm64/boot/dts/Makefile, as this is statically
> passed via the $(build)= parameter. Change the $(build) parameter
> to actually point to the subdir itself, so the makefile from
> that subdir can be used to set-up build flags etc., for example
> setting up DTC_FLAGS. The patsubst magic is used to strip the
> trailing "/" from the path, as that confuses the kbuild system.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> ---
>  arch/arm64/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
> index f04c814..2ac4358 100644
> --- a/arch/arm64/Makefile
> +++ b/arch/arm64/Makefile
> @@ -128,7 +128,7 @@ zinstall install:
>  	$(Q)$(MAKE) $(build)=$(boot) $@
>  
>  %.dtb %.dtbo: scripts
> -	$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
> +	$(Q)$(MAKE) $(build)=$(patsubst %/,%,$(boot)/dts/$(dir $@)) $(boot)/dts/$@
>  
>  PHONY += dtbs dtbs_install
>  
> 

same comment as for patch 2/4

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
  2018-09-05 20:36       ` Frank Rowand
@ 2018-09-05 21:13         ` Rob Herring
  -1 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2018-09-05 21:13 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Mark Rutland, devicetree, Tony Lindgren, Catalin Marinas,
	Will Deacon, Russell King, Tero Kristo, Devicetree Compiler,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Sep 5, 2018 at 3:36 PM Frank Rowand <frowand.list@gmail.com> wrote:
>
> +cc: devicetree-compiler@vger.kernel.org
>
>      For context on the device-tree compiler list, this patch is for
>      the Linux kernel.
>
> On 09/04/18 01:05, Tero Kristo wrote:
> > Add simple support for building DT overlays. This just compiles any
> > given .dtso file under the base arch/arm/boot/dts directory into
> > a .dtbo.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> >  arch/arm/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> > index d1516f8..ab555a0 100644
> > --- a/arch/arm/Makefile
> > +++ b/arch/arm/Makefile
> > @@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
> >  $(INSTALL_TARGETS):
> >       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
> >
> > -%.dtb: | scripts
> > +%.dtb %.dtbo: | scripts

This will need to change with my rework of the DT build rules[1].

> >       $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
> >
> >  PHONY += dtbs dtbs_install
> >
>
> The idea of adding knowledge of .dtso and .dtbo files to the dtc
> compiler, but that idea and the related patches have fallen by
> the wayside.
>
> Current overlay sources and blobs are properly handled by dtc when
> they are .dts and .dtb files.
>
> If the dtc compiler is updated with knowledge of .dtso and .dtbo
> then these changes would be needed.  At the moment the distinction
> of a .dtso and .dtbo is a naming convention that provides a clue
> about the intended use of the file.  But dtc does not know these
> file name extensions, requiring a specific flag to tell dtc to
> treat them as .dts or .dtb files.  I think the negative outweighs
> the positive for this patch.

I don't follow what you are proposing. We should decide on a convention though.

We shouldn't need .dtso because that is identified with the /plugin/
tag. Distinguishing overlay dtbs with .dtbo seems like a good idea
though.

Rob

[1] https://lkml.org/lkml/2018/8/21/770

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
@ 2018-09-05 21:13         ` Rob Herring
  0 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2018-09-05 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 5, 2018 at 3:36 PM Frank Rowand <frowand.list@gmail.com> wrote:
>
> +cc: devicetree-compiler at vger.kernel.org
>
>      For context on the device-tree compiler list, this patch is for
>      the Linux kernel.
>
> On 09/04/18 01:05, Tero Kristo wrote:
> > Add simple support for building DT overlays. This just compiles any
> > given .dtso file under the base arch/arm/boot/dts directory into
> > a .dtbo.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> >  arch/arm/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> > index d1516f8..ab555a0 100644
> > --- a/arch/arm/Makefile
> > +++ b/arch/arm/Makefile
> > @@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
> >  $(INSTALL_TARGETS):
> >       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
> >
> > -%.dtb: | scripts
> > +%.dtb %.dtbo: | scripts

This will need to change with my rework of the DT build rules[1].

> >       $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
> >
> >  PHONY += dtbs dtbs_install
> >
>
> The idea of adding knowledge of .dtso and .dtbo files to the dtc
> compiler, but that idea and the related patches have fallen by
> the wayside.
>
> Current overlay sources and blobs are properly handled by dtc when
> they are .dts and .dtb files.
>
> If the dtc compiler is updated with knowledge of .dtso and .dtbo
> then these changes would be needed.  At the moment the distinction
> of a .dtso and .dtbo is a naming convention that provides a clue
> about the intended use of the file.  But dtc does not know these
> file name extensions, requiring a specific flag to tell dtc to
> treat them as .dts or .dtb files.  I think the negative outweighs
> the positive for this patch.

I don't follow what you are proposing. We should decide on a convention though.

We shouldn't need .dtso because that is identified with the /plugin/
tag. Distinguishing overlay dtbs with .dtbo seems like a good idea
though.

Rob

[1] https://lkml.org/lkml/2018/8/21/770

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
  2018-09-05 20:36       ` Frank Rowand
@ 2018-09-05 21:38         ` Rob Herring
  -1 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2018-09-05 21:38 UTC (permalink / raw)
  To: Frank Rowand
  Cc: Mark Rutland, devicetree, Tony Lindgren, Catalin Marinas,
	Will Deacon, Russell King, Tero Kristo,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Sep 5, 2018 at 3:36 PM Frank Rowand <frowand.list@gmail.com> wrote:
>
> On 09/04/18 01:05, Tero Kristo wrote:
> > Currently the makefile is setup in such manner that even if
> > we build a DT file in a subdirectory under arch/arm/boot/dts,
> > it gets built based on the base boot/dts/Makefile rules.
> > This patch modifies the base makefile in such manner, that
> > it detects which makefile to use based on build target path.
> > This allows setting for example per-directory DTC_FLAGS and
> > using those for the subdir build. The dtbdir local variable
> > is setup to target to the build path.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> >  arch/arm/Makefile | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> > index ab555a0..b7c21e8 100644
> > --- a/arch/arm/Makefile
> > +++ b/arch/arm/Makefile
> > @@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
> >  $(INSTALL_TARGETS):
> >       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
> >
> > +%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
> > +
> >  %.dtb %.dtbo: | scripts
> > -     $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
> > +     $(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
> >
> >  PHONY += dtbs dtbs_install
> >
> >
>
> The makefile magic to handle subdirectories below $(boot)/dts/ already
> works properly to have Makefiles in $(boot)/dts/, using the following
> rule in arch/arm64/Makefile:
>
> %.dtb: scripts
>         $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
>
> I don't understand why that works for arm64, but it should work the
> same way for arm.  Or if arch/arm is missing another piece from
> arch/arm64 we should be consistent with however the make system
> specifies it in arch/arm64

It should just need a subdir-y for the sub-directory. The target is
"subdir/some.dtb" though.

If we want to build specific directories, we should get the standard
way of doing that to work: make arch/arm/boot/dts/subdir/

Rob

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs
@ 2018-09-05 21:38         ` Rob Herring
  0 siblings, 0 replies; 34+ messages in thread
From: Rob Herring @ 2018-09-05 21:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 5, 2018 at 3:36 PM Frank Rowand <frowand.list@gmail.com> wrote:
>
> On 09/04/18 01:05, Tero Kristo wrote:
> > Currently the makefile is setup in such manner that even if
> > we build a DT file in a subdirectory under arch/arm/boot/dts,
> > it gets built based on the base boot/dts/Makefile rules.
> > This patch modifies the base makefile in such manner, that
> > it detects which makefile to use based on build target path.
> > This allows setting for example per-directory DTC_FLAGS and
> > using those for the subdir build. The dtbdir local variable
> > is setup to target to the build path.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> >  arch/arm/Makefile | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> > index ab555a0..b7c21e8 100644
> > --- a/arch/arm/Makefile
> > +++ b/arch/arm/Makefile
> > @@ -339,8 +339,10 @@ $(BOOT_TARGETS): vmlinux
> >  $(INSTALL_TARGETS):
> >       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
> >
> > +%.dtb %.dtbo: dtbdir = $(patsubst %/,%,$(patsubst %./,%,$(boot)/dts/$(dir $@)))
> > +
> >  %.dtb %.dtbo: | scripts
> > -     $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
> > +     $(Q)$(MAKE) $(build)=$(dtbdir) MACHINE=$(MACHINE) $(boot)/dts/$@
> >
> >  PHONY += dtbs dtbs_install
> >
> >
>
> The makefile magic to handle subdirectories below $(boot)/dts/ already
> works properly to have Makefiles in $(boot)/dts/, using the following
> rule in arch/arm64/Makefile:
>
> %.dtb: scripts
>         $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
>
> I don't understand why that works for arm64, but it should work the
> same way for arm.  Or if arch/arm is missing another piece from
> arch/arm64 we should be consistent with however the make system
> specifies it in arch/arm64

It should just need a subdir-y for the sub-directory. The target is
"subdir/some.dtb" though.

If we want to build specific directories, we should get the standard
way of doing that to work: make arch/arm/boot/dts/subdir/

Rob

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
  2018-09-05 21:13         ` Rob Herring
@ 2018-09-06 21:00           ` Frank Rowand
  -1 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-06 21:00 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Rutland, devicetree, Tony Lindgren, Catalin Marinas,
	Will Deacon, Russell King, Tero Kristo, Devicetree Compiler,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On 09/05/18 14:13, Rob Herring wrote:
> On Wed, Sep 5, 2018 at 3:36 PM Frank Rowand <frowand.list@gmail.com> wrote:
>>
>> +cc: devicetree-compiler@vger.kernel.org
>>
>>      For context on the device-tree compiler list, this patch is for
>>      the Linux kernel.
>>
>> On 09/04/18 01:05, Tero Kristo wrote:
>>> Add simple support for building DT overlays. This just compiles any
>>> given .dtso file under the base arch/arm/boot/dts directory into
>>> a .dtbo.
>>>
>>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>>> ---
>>>  arch/arm/Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
>>> index d1516f8..ab555a0 100644
>>> --- a/arch/arm/Makefile
>>> +++ b/arch/arm/Makefile
>>> @@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
>>>  $(INSTALL_TARGETS):
>>>       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
>>>
>>> -%.dtb: | scripts
>>> +%.dtb %.dtbo: | scripts
> 
> This will need to change with my rework of the DT build rules[1].
> 
>>>       $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
>>>
>>>  PHONY += dtbs dtbs_install
>>>
>>
>> The idea of adding knowledge of .dtso and .dtbo files to the dtc
>> compiler, but that idea and the related patches have fallen by
>> the wayside.
>>
>> Current overlay sources and blobs are properly handled by dtc when
>> they are .dts and .dtb files.
>>
>> If the dtc compiler is updated with knowledge of .dtso and .dtbo
>> then these changes would be needed.  At the moment the distinction
>> of a .dtso and .dtbo is a naming convention that provides a clue
>> about the intended use of the file.  But dtc does not know these
>> file name extensions, requiring a specific flag to tell dtc to
>> treat them as .dts or .dtb files.  I think the negative outweighs
>> the positive for this patch.
> 
> I don't follow what you are proposing. We should decide on a convention though.
> 
> We shouldn't need .dtso because that is identified with the /plugin/
> tag. Distinguishing overlay dtbs with .dtbo seems like a good idea
> though.

I noted technical reasons that using .dtbo has both good and bad aspects.
I too at times just fall back to a "sounds good" or "sounds bad" type
response (and will continue to do so in the future), but in this case
please provide a somewhat stronger reasoning for using .dtbo since I
stated that I feel the in technical balance the negatives outweigh the
positives.  If dtc adds knowledge of .dtbo my opinion of the balance
will immediately reverse.

> 
> Rob
> 
> [1] https://lkml.org/lkml/2018/8/21/770
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays
@ 2018-09-06 21:00           ` Frank Rowand
  0 siblings, 0 replies; 34+ messages in thread
From: Frank Rowand @ 2018-09-06 21:00 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/05/18 14:13, Rob Herring wrote:
> On Wed, Sep 5, 2018 at 3:36 PM Frank Rowand <frowand.list@gmail.com> wrote:
>>
>> +cc: devicetree-compiler at vger.kernel.org
>>
>>      For context on the device-tree compiler list, this patch is for
>>      the Linux kernel.
>>
>> On 09/04/18 01:05, Tero Kristo wrote:
>>> Add simple support for building DT overlays. This just compiles any
>>> given .dtso file under the base arch/arm/boot/dts directory into
>>> a .dtbo.
>>>
>>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>>> ---
>>>  arch/arm/Makefile | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
>>> index d1516f8..ab555a0 100644
>>> --- a/arch/arm/Makefile
>>> +++ b/arch/arm/Makefile
>>> @@ -339,7 +339,7 @@ $(BOOT_TARGETS): vmlinux
>>>  $(INSTALL_TARGETS):
>>>       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
>>>
>>> -%.dtb: | scripts
>>> +%.dtb %.dtbo: | scripts
> 
> This will need to change with my rework of the DT build rules[1].
> 
>>>       $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
>>>
>>>  PHONY += dtbs dtbs_install
>>>
>>
>> The idea of adding knowledge of .dtso and .dtbo files to the dtc
>> compiler, but that idea and the related patches have fallen by
>> the wayside.
>>
>> Current overlay sources and blobs are properly handled by dtc when
>> they are .dts and .dtb files.
>>
>> If the dtc compiler is updated with knowledge of .dtso and .dtbo
>> then these changes would be needed.  At the moment the distinction
>> of a .dtso and .dtbo is a naming convention that provides a clue
>> about the intended use of the file.  But dtc does not know these
>> file name extensions, requiring a specific flag to tell dtc to
>> treat them as .dts or .dtb files.  I think the negative outweighs
>> the positive for this patch.
> 
> I don't follow what you are proposing. We should decide on a convention though.
> 
> We shouldn't need .dtso because that is identified with the /plugin/
> tag. Distinguishing overlay dtbs with .dtbo seems like a good idea
> though.

I noted technical reasons that using .dtbo has both good and bad aspects.
I too at times just fall back to a "sounds good" or "sounds bad" type
response (and will continue to do so in the future), but in this case
please provide a somewhat stronger reasoning for using .dtbo since I
stated that I feel the in technical balance the negatives outweigh the
positives.  If dtc adds knowledge of .dtbo my opinion of the balance
will immediately reverse.

> 
> Rob
> 
> [1] https://lkml.org/lkml/2018/8/21/770
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2018-09-06 21:00 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 12:47 [PATCHv2 0/4] ARM build infra changes to support building .dtbos Tero Kristo
2018-08-31 12:47 ` Tero Kristo
2018-08-31 12:47 ` [PATCHv2 1/4] ARM: dts: add support for building DT overlays Tero Kristo
2018-08-31 12:47   ` Tero Kristo
2018-08-31 12:47 ` [PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs Tero Kristo
2018-08-31 12:47   ` Tero Kristo
2018-08-31 12:47 ` [PATCHv2 3/4] arm64: dts: add support for building DT overlays Tero Kristo
2018-08-31 12:47   ` Tero Kristo
2018-08-31 12:47 ` [PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building Tero Kristo
2018-08-31 12:47   ` Tero Kristo
2018-09-04  8:05 ` [RESEND PATCHv2 0/4] ARM build infra changes to support building .dtbos Tero Kristo
2018-09-04  8:05   ` Tero Kristo
2018-09-04  8:05   ` [RESEND PATCHv2 1/4] ARM: dts: add support for building DT overlays Tero Kristo
2018-09-04  8:05     ` Tero Kristo
2018-09-05 20:36     ` Frank Rowand
2018-09-05 20:36       ` Frank Rowand
2018-09-05 21:13       ` Rob Herring
2018-09-05 21:13         ` Rob Herring
2018-09-06 21:00         ` Frank Rowand
2018-09-06 21:00           ` Frank Rowand
2018-09-04  8:05   ` [RESEND PATCHv2 2/4] ARM: dts: add support for individual build flags for DT subdirs Tero Kristo
2018-09-04  8:05     ` Tero Kristo
2018-09-05 20:36     ` Frank Rowand
2018-09-05 20:36       ` Frank Rowand
2018-09-05 21:38       ` Rob Herring
2018-09-05 21:38         ` Rob Herring
2018-09-04  8:05   ` [RESEND PATCHv2 3/4] arm64: dts: add support for building DT overlays Tero Kristo
2018-09-04  8:05     ` Tero Kristo
2018-09-05 20:36     ` Frank Rowand
2018-09-05 20:36       ` Frank Rowand
2018-09-04  8:05   ` [RESEND PATCHv2 4/4] arm64: dts: add support for per sub-dir makefiles for DT building Tero Kristo
2018-09-04  8:05     ` Tero Kristo
2018-09-05 20:37     ` Frank Rowand
2018-09-05 20:37       ` Frank Rowand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.