[U-Boot] [PATCH 1/2] imx: add rules for U-Boot DTB support

Signed-off-by: Stefano Babic sbabic@denx.de ---
Makefile | 6 +++--- arch/arm/config.mk | 4 ++++ arch/arm/imx-common/Makefile | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile index 0281171..0f7cabb 100644 --- a/Makefile +++ b/Makefile @@ -757,6 +757,9 @@ dtbs dts/dt.dtb: checkdtc u-boot u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE $(call if_changed,cat)
+%.imx: %.bin + $(Q)$(MAKE) $(build)=arch/arm/imx-common $@ + quiet_cmd_copy = COPY $@ cmd_copy = cp $< $@
@@ -810,9 +813,6 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(CONFIG_SYS_FSL_PBL_RCW) \ u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE $(call if_changed,mkimage)
-u-boot.imx: u-boot.bin - $(Q)$(MAKE) $(build)=arch/arm/imx-common $@ - u-boot.sha1: u-boot.bin tools/ubsha1 u-boot.bin
diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 17b7408..5bd3961 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -119,6 +119,10 @@ ifndef CONFIG_SPL_BUILD ALL-y += SPL endif else +ifeq ($(CONFIG_OF_SEPARATE),y) +ALL-y += u-boot-dtb.imx +else ALL-y += u-boot.imx endif endif +endif diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 16809fe..025cfed 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -42,6 +42,14 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \ u-boot.imx: u-boot.bin $(IMX_CONFIG) FORCE $(call if_changed,mkimage)
+ifeq ($(CONFIG_OF_SEPARATE),y) +MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \ + -e $(CONFIG_SYS_TEXT_BASE) + +u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) FORCE + $(call if_changed,mkimage) +endif + MKIMAGEFLAGS_SPL = -n $(filter-out $< $(PHONY),$^) -T imximage \ -e $(CONFIG_SPL_TEXT_BASE)

Signed-off-by: Stefano Babic sbabic@denx.de CC: Fabio Estevam fabio.estevam@freescale.com ---
arch/arm/dts/Makefile | 1 + arch/arm/dts/mx6qsabreauto.dts | 13 +++++++++++++ include/configs/mx6qsabreauto.h | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 arch/arm/dts/mx6qsabreauto.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index e2fcca5..6316a7d 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -2,6 +2,7 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5250-snow.dtb \ exynos5250-smdk5250.dtb \ exynos5420-smdk5420.dtb +dtb-$(CONFIG_MX6) += mx6qsabreauto.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \ diff --git a/arch/arm/dts/mx6qsabreauto.dts b/arch/arm/dts/mx6qsabreauto.dts new file mode 100644 index 0000000..a3c9c91 --- /dev/null +++ b/arch/arm/dts/mx6qsabreauto.dts @@ -0,0 +1,13 @@ +/* + + * Copyright 2012 Freescale Semiconductor, Inc. + + * Copyright 2011 Linaro Ltd. + + * + + * SPDX-License-Identifier: GPL-2.0+ + + */ + +/dts-v1/; + +/ { + model = "Freescale i.MX6 Quad SABRE Automotive Board"; + compatible = "fsl,imx6q-sabreauto", "fsl,imx6q"; +}; diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h index dbbb6f0..8e82487 100644 --- a/include/configs/mx6qsabreauto.h +++ b/include/configs/mx6qsabreauto.h @@ -41,4 +41,7 @@ #define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 100000
+#define CONFIG_OF_SEPARATE +#define CONFIG_DEFAULT_DEVICE_TREE mx6qsabreauto + #endif /* __MX6QSABREAUTO_CONFIG_H */

Hi Stefano,
On Mon, Mar 17, 2014 at 5:58 AM, Stefano Babic sbabic@denx.de wrote:
--- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -2,6 +2,7 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5250-snow.dtb \ exynos5250-smdk5250.dtb \ exynos5420-smdk5420.dtb +dtb-$(CONFIG_MX6) += mx6qsabreauto.dtb
It would be better to use the name as 'imx6q-sabresd.dtb' to make it consistent with the name we currently use in the kernel.
dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \ diff --git a/arch/arm/dts/mx6qsabreauto.dts b/arch/arm/dts/mx6qsabreauto.dts new file mode 100644 index 0000000..a3c9c91 --- /dev/null +++ b/arch/arm/dts/mx6qsabreauto.dts @@ -0,0 +1,13 @@ +/*
- Copyright 2012 Freescale Semiconductor, Inc.
- Copyright 2011 Linaro Ltd.
- SPDX-License-Identifier: GPL-2.0+
- */
+/dts-v1/;
+/ {
model = "Freescale i.MX6 Quad SABRE Automotive Board";
compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
+};
Don't we need imx6qdl-sabresd.dtsi as well?
imx6q-sabresd.dts only contains the support that is mx6quad specific (sata, extra IPU, etc).
imx6qdl-sabresd.dtsi contains the common part.
Regards,
Fabio Estevam

Hi Fabio,
On 17/03/2014 13:54, Fabio Estevam wrote:
Hi Stefano,
On Mon, Mar 17, 2014 at 5:58 AM, Stefano Babic sbabic@denx.de wrote:
--- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -2,6 +2,7 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5250-snow.dtb \ exynos5250-smdk5250.dtb \ exynos5420-smdk5420.dtb +dtb-$(CONFIG_MX6) += mx6qsabreauto.dtb
It would be better to use the name as 'imx6q-sabresd.dtb' to make it consistent with the name we currently use in the kernel.
ok, got it.
dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \ diff --git a/arch/arm/dts/mx6qsabreauto.dts b/arch/arm/dts/mx6qsabreauto.dts new file mode 100644 index 0000000..a3c9c91 --- /dev/null +++ b/arch/arm/dts/mx6qsabreauto.dts @@ -0,0 +1,13 @@ +/*
- Copyright 2012 Freescale Semiconductor, Inc.
- Copyright 2011 Linaro Ltd.
- SPDX-License-Identifier: GPL-2.0+
- */
+/dts-v1/;
+/ {
model = "Freescale i.MX6 Quad SABRE Automotive Board";
compatible = "fsl,imx6q-sabreauto", "fsl,imx6q";
+};
Don't we need imx6qdl-sabresd.dtsi as well?
imx6q-sabresd.dts only contains the support that is mx6quad specific (sata, extra IPU, etc).
imx6qdl-sabresd.dtsi contains the common part.
Right, but it is to configure the kernel. What I am trying now is to start adding U-Boot configuration via dtb for i.MX, not kernel configuration, similar as we can already see for other SOC (Tegra, zync,..). I can imagine we will have a .dtsi as well, as in kernel, but at the moment we are starting with DT in U-Boot. Have I relly understood your point ?
Best regards, Stefano Babic

Hi Stefano,
On Mon, Mar 17, 2014 at 11:22 AM, Stefano Babic sbabic@denx.de wrote:
Right, but it is to configure the kernel. What I am trying now is to start adding U-Boot configuration via dtb for i.MX, not kernel configuration, similar as we can already see for other SOC (Tegra,
Yes, I understand your goal.
The device tree is OS agnostic, so we should really try to use the exact same device tree for configuring kernel or U-boot.
Also, the current dts you submitted is really empty, so I suggest you to use the same imx6qdl-sabresd.dtsi and imx6q-sabresd.dts that we have in the kernel.
No need for U-boot use a different dts.
Regards,
Fabio Estevam

Hi Fabio,
On 17/03/2014 15:27, Fabio Estevam wrote:
Hi Stefano,
On Mon, Mar 17, 2014 at 11:22 AM, Stefano Babic sbabic@denx.de wrote:
Right, but it is to configure the kernel. What I am trying now is to start adding U-Boot configuration via dtb for i.MX, not kernel configuration, similar as we can already see for other SOC (Tegra,
Yes, I understand your goal.
The device tree is OS agnostic,
Right.
so we should really try to use the exact same device tree for configuring kernel or U-boot.
Also, the current dts you submitted is really empty, so I suggest you to use the same imx6qdl-sabresd.dtsi and imx6q-sabresd.dts that we have in the kernel.
Understood. As first draft, we can start exactly with the same files. I do not know now if we will remain in sync with kernel. In the last U-boot mini summit, we had a discussion on this point, and it is hard to foresee if U-Boot and kernel will share the same dts or if it will be required to diverge. But I understand the point, and we can start in sync, and see later if we really need a different file for U-Boot.
Best regards, Stefano Babic

Signed-off-by: Stefano Babic sbabic@denx.de ---
Changes in v2: None
Makefile | 6 +++--- arch/arm/config.mk | 4 ++++ arch/arm/imx-common/Makefile | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile index 0281171..0f7cabb 100644 --- a/Makefile +++ b/Makefile @@ -757,6 +757,9 @@ dtbs dts/dt.dtb: checkdtc u-boot u-boot-dtb.bin: u-boot.bin dts/dt.dtb FORCE $(call if_changed,cat)
+%.imx: %.bin + $(Q)$(MAKE) $(build)=arch/arm/imx-common $@ + quiet_cmd_copy = COPY $@ cmd_copy = cp $< $@
@@ -810,9 +813,6 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(CONFIG_SYS_FSL_PBL_RCW) \ u-boot.img u-boot.kwb u-boot.pbl: u-boot.bin FORCE $(call if_changed,mkimage)
-u-boot.imx: u-boot.bin - $(Q)$(MAKE) $(build)=arch/arm/imx-common $@ - u-boot.sha1: u-boot.bin tools/ubsha1 u-boot.bin
diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 17b7408..5bd3961 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -119,6 +119,10 @@ ifndef CONFIG_SPL_BUILD ALL-y += SPL endif else +ifeq ($(CONFIG_OF_SEPARATE),y) +ALL-y += u-boot-dtb.imx +else ALL-y += u-boot.imx endif endif +endif diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 16809fe..025cfed 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -42,6 +42,14 @@ MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \ u-boot.imx: u-boot.bin $(IMX_CONFIG) FORCE $(call if_changed,mkimage)
+ifeq ($(CONFIG_OF_SEPARATE),y) +MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $< $(PHONY),$^) -T imximage \ + -e $(CONFIG_SYS_TEXT_BASE) + +u-boot-dtb.imx: u-boot-dtb.bin $(IMX_CONFIG) FORCE + $(call if_changed,mkimage) +endif + MKIMAGEFLAGS_SPL = -n $(filter-out $< $(PHONY),$^) -T imximage \ -e $(CONFIG_SPL_TEXT_BASE)

Signed-off-by: Stefano Babic sbabic@denx.de CC: Fabio Estevam fabio.estevam@freescale.com
---
Changes in v2: - Use the same dts name as in kernel: imx6q-sabreauto.dts (Fabio Estevam, Lars Steubesand)
arch/arm/dts/Makefile | 1 + arch/arm/dts/imx6q-sabreauto.dts | 13 +++++++++++++ include/configs/mx6qsabreauto.h | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index e2fcca5..6acd861 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -2,6 +2,7 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5250-snow.dtb \ exynos5250-smdk5250.dtb \ exynos5420-smdk5420.dtb +dtb-$(CONFIG_MX6) += imx6q-sabreauto.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \ diff --git a/arch/arm/dts/imx6q-sabreauto.dts b/arch/arm/dts/imx6q-sabreauto.dts new file mode 100644 index 0000000..a3c9c91 --- /dev/null +++ b/arch/arm/dts/imx6q-sabreauto.dts @@ -0,0 +1,13 @@ +/* + + * Copyright 2012 Freescale Semiconductor, Inc. + + * Copyright 2011 Linaro Ltd. + + * + + * SPDX-License-Identifier: GPL-2.0+ + + */ + +/dts-v1/; + +/ { + model = "Freescale i.MX6 Quad SABRE Automotive Board"; + compatible = "fsl,imx6q-sabreauto", "fsl,imx6q"; +}; diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h index dbbb6f0..bd0144f 100644 --- a/include/configs/mx6qsabreauto.h +++ b/include/configs/mx6qsabreauto.h @@ -41,4 +41,7 @@ #define CONFIG_SYS_I2C_MXC #define CONFIG_SYS_I2C_SPEED 100000
+#define CONFIG_OF_SEPARATE +#define CONFIG_DEFAULT_DEVICE_TREE imx6q-sabreauto + #endif /* __MX6QSABREAUTO_CONFIG_H */

Hi Stefano,
On Mon, 31 Mar 2014 09:50:36 +0200 Stefano Babic sbabic@denx.de wrote:
Signed-off-by: Stefano Babic sbabic@denx.de CC: Fabio Estevam fabio.estevam@freescale.com
Changes in v2:
- Use the same dts name as in kernel: imx6q-sabreauto.dts (Fabio Estevam, Lars Steubesand)
arch/arm/dts/Makefile | 1 + arch/arm/dts/imx6q-sabreauto.dts | 13 +++++++++++++ include/configs/mx6qsabreauto.h | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 arch/arm/dts/imx6q-sabreauto.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index e2fcca5..6acd861 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -2,6 +2,7 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5250-snow.dtb \ exynos5250-smdk5250.dtb \ exynos5420-smdk5420.dtb +dtb-$(CONFIG_MX6) += imx6q-sabreauto.dtb dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \ tegra20-medcom-wide.dtb \ tegra20-paz00.dtb \ diff --git a/arch/arm/dts/imx6q-sabreauto.dts b/arch/arm/dts/imx6q-sabreauto.dts new file mode 100644 index 0000000..a3c9c91 --- /dev/null +++ b/arch/arm/dts/imx6q-sabreauto.dts @@ -0,0 +1,13 @@ +/*
- Copyright 2012 Freescale Semiconductor, Inc.
- Copyright 2011 Linaro Ltd.
- SPDX-License-Identifier: GPL-2.0+
- */
This patch has been applied, but the license block in arch/arm/dts/imx6q-sabreauto.dts looks weird.
Could you fix the broken format in a follow-up patch?
Best Regards Masahiro Yamada

Hi Masahiro,
On 09/04/2014 04:19, Masahiro Yamada wrote:
--- /dev/null +++ b/arch/arm/dts/imx6q-sabreauto.dts @@ -0,0 +1,13 @@ +/*
- Copyright 2012 Freescale Semiconductor, Inc.
- Copyright 2011 Linaro Ltd.
- SPDX-License-Identifier: GPL-2.0+
- */
This patch has been applied, but the license block in arch/arm/dts/imx6q-sabreauto.dts looks weird.
It is ! Thanks to have noted it !
Could you fix the broken format in a follow-up patch?
Of course !
Best regards, Stefano Babic

On 31/03/2014 09:50, Stefano Babic wrote:
Signed-off-by: Stefano Babic sbabic@denx.de
Applied to u-boot-imx (both patches)
Best regards, Stefano Babic
participants (3)
-
Fabio Estevam
-
Masahiro Yamada
-
Stefano Babic