diff mbox series

arm: xilinx: Fill DEVICE_TREE directly in Makefiles

Message ID dd51ad28ee348c94edec4933b3aff871362e88cb.1581601997.git.michal.simek@xilinx.com
State Accepted
Commit 9c18aaa23c4a052000133979c268ae703966d0c8
Delegated to: Michal Simek
Headers show
Series arm: xilinx: Fill DEVICE_TREE directly in Makefiles | expand

Commit Message

Michal Simek Feb. 13, 2020, 1:53 p.m. UTC
DEVICE_TREE variable is not exported from dts/Makefile that's why it is
necessary to setup directly before use.

Fixes: 312f2c5b14fa ("arm: xilinx: Use device tree which can be passed on cmd line")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

It was found by more intensive testing.

Another option would be to move DEVICE_TREE setup from dts/Makefile to
Makefile but I didn't find the right place for it.

---
 board/xilinx/zynq/Makefile   | 5 +++++
 board/xilinx/zynqmp/Makefile | 5 +++++
 2 files changed, 10 insertions(+)

Comments

Michal Simek Feb. 28, 2020, 11:18 a.m. UTC | #1
čt 13. 2. 2020 v 14:53 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> DEVICE_TREE variable is not exported from dts/Makefile that's why it is
> necessary to setup directly before use.
>
> Fixes: 312f2c5b14fa ("arm: xilinx: Use device tree which can be passed on cmd line")
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> It was found by more intensive testing.
>
> Another option would be to move DEVICE_TREE setup from dts/Makefile to
> Makefile but I didn't find the right place for it.
>
> ---
>  board/xilinx/zynq/Makefile   | 5 +++++
>  board/xilinx/zynqmp/Makefile | 5 +++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/board/xilinx/zynq/Makefile b/board/xilinx/zynq/Makefile
> index 6a2acee108fa..096a7aceb939 100644
> --- a/board/xilinx/zynq/Makefile
> +++ b/board/xilinx/zynq/Makefile
> @@ -13,6 +13,11 @@ spl/board/xilinx/zynq/ps_init_gpl.o board/xilinx/zynq/ps_init_gpl.o: $(PS_INIT_F
>         $(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
>  endif
>
> +DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
> +ifeq ($(DEVICE_TREE),)
> +DEVICE_TREE := unset
> +endif
> +
>  ifeq ($(init-objs),)
>  hw-platform-y :=$(shell echo $(DEVICE_TREE))
>  init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/ps7_init_gpl.c),\
> diff --git a/board/xilinx/zynqmp/Makefile b/board/xilinx/zynqmp/Makefile
> index 174f4ed24be3..398c6aaa452a 100644
> --- a/board/xilinx/zynqmp/Makefile
> +++ b/board/xilinx/zynqmp/Makefile
> @@ -13,6 +13,11 @@ spl/board/xilinx/zynqmp/ps_init_gpl.o board/xilinx/zynqmp/ps_init_gpl.o: $(PS_IN
>         $(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
>  endif
>
> +DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
> +ifeq ($(DEVICE_TREE),)
> +DEVICE_TREE := unset
> +endif
> +
>  ifeq ($(init-objs),)
>  hw-platform-y :=$(shell echo $(DEVICE_TREE))
>  init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\
> --
> 2.25.0
>

Applied.
M
diff mbox series

Patch

diff --git a/board/xilinx/zynq/Makefile b/board/xilinx/zynq/Makefile
index 6a2acee108fa..096a7aceb939 100644
--- a/board/xilinx/zynq/Makefile
+++ b/board/xilinx/zynq/Makefile
@@ -13,6 +13,11 @@  spl/board/xilinx/zynq/ps_init_gpl.o board/xilinx/zynq/ps_init_gpl.o: $(PS_INIT_F
 	$(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
 endif
 
+DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
+ifeq ($(DEVICE_TREE),)
+DEVICE_TREE := unset
+endif
+
 ifeq ($(init-objs),)
 hw-platform-y :=$(shell echo $(DEVICE_TREE))
 init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/ps7_init_gpl.c),\
diff --git a/board/xilinx/zynqmp/Makefile b/board/xilinx/zynqmp/Makefile
index 174f4ed24be3..398c6aaa452a 100644
--- a/board/xilinx/zynqmp/Makefile
+++ b/board/xilinx/zynqmp/Makefile
@@ -13,6 +13,11 @@  spl/board/xilinx/zynqmp/ps_init_gpl.o board/xilinx/zynqmp/ps_init_gpl.o: $(PS_IN
 	$(CC) $(c_flags) -I $(srctree)/$(src) -c -o $@ $^
 endif
 
+DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
+ifeq ($(DEVICE_TREE),)
+DEVICE_TREE := unset
+endif
+
 ifeq ($(init-objs),)
 hw-platform-y :=$(shell echo $(DEVICE_TREE))
 init-objs := $(if $(wildcard $(srctree)/$(src)/$(hw-platform-y)/psu_init_gpl.c),\