Skip to contentSkip to conversation

imx: add rules for U-Boot DTB support

PATCH Superseded Stefano Babic 3 participants 11 messages Mar 17, 2014 – Apr 9, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

---

 Makefile                     |    6 +++---
 arch/arm/config.mk           |    4 ++++
 arch/arm/imx-common/Makefile |    8 ++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)
Makefile +3 -3
index 0281171..0f7cabb 100644
@@ -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
 
arch/arm/config.mk +4 -0
index 17b7408..5bd3961 100644
@@ -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
arch/arm/imx-common/Makefile +8 -0
index 16809fe..025cfed 100644
@@ -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)
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/2 mx6: add example DTB for mx6qsabreauto

---

 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
arch/arm/dts/Makefile +1 -0
index e2fcca5..6316a7d 100644
@@ -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 \
arch/arm/dts/mx6qsabreauto.dts new file +13 -0
new file mode 100644
index 0000000..a3c9c91
@@ -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";
+};
include/configs/mx6qsabreauto.h +3 -0
index dbbb6f0..8e82487 100644
@@ -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 */
Signature · 1 line
1.7.9.5
reviewer
#2 lore raw

PATCH 2/2 mx6: add example DTB for mx6qsabreauto

Hi Stefano,

arch/arm/dts/Makefile dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ · line 5

Quoted 7 lines · Stefano Babic
arch/arm/dts/Makefile +1 -0
@@ -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.

Quoted 12 lines
arch/arm/dts/Makefile +0 -0
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
        tegra20-medcom-wide.dtb \
        tegra20-paz00.dtb \
arch/arm/dts/mx6qsabreauto.dts new file +3 -0
new file mode 100644
index 0000000..a3c9c91
@@ -0,0 +1,13 @@
+/*
+    + * Copyright 2012 Freescale Semiconductor, Inc.
+    + * Copyright 2011 Linaro Ltd.

arch/arm/dts/mx6qsabreauto.dts line 13

Quoted 10 lines
arch/arm/dts/mx6qsabreauto.dts new file +10 -0
+    + *
+    + * 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

#3 lore raw

PATCH 2/2 mx6: add example DTB for mx6qsabreauto

Hi Fabio,

Quoted 4 lines · Fabio Estevam

Hi Stefano,

On Mon, Mar 17, 2014 at 5:58 AM, Stefano Babic <[email protected]> wrote:

Quoted 10 lines

arch/arm/dts/Makefile dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ · line 5

Quoted 7 lines
arch/arm/dts/Makefile +1 -0
@@ -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.

Quoted 26 lines
Quoted 13 lines
arch/arm/dts/Makefile +0 -0
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
        tegra20-medcom-wide.dtb \
        tegra20-paz00.dtb \
arch/arm/dts/mx6qsabreauto.dts new file +3 -0
new file mode 100644
index 0000000..a3c9c91
@@ -0,0 +1,13 @@
+/*
+    + * Copyright 2012 Freescale Semiconductor, Inc.
+    + * Copyright 2011 Linaro Ltd.

arch/arm/dts/mx6qsabreauto.dts line 13

Quoted 10 lines
arch/arm/dts/mx6qsabreauto.dts new file +10 -0
+    + *
+    + * 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?

Quoted 4 lines

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

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
reviewer
#4 lore raw

PATCH 2/2 mx6: add example DTB for mx6qsabreauto

Hi Stefano,

Quoted 3 lines · Stefano Babic

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

#5 lore raw

PATCH 2/2 mx6: add example DTB for mx6qsabreauto

Hi Fabio,

Quoted 11 lines · Fabio Estevam

Hi Stefano,

Quoted 3 lines · Stefano Babic

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.

Quoted 6 lines

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

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#6 lore raw

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

In reply to Stefano Babic

---

Changes in v2: None

 Makefile                     |    6 +++---
 arch/arm/config.mk           |    4 ++++
 arch/arm/imx-common/Makefile |    8 ++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)
Makefile +3 -3
index 0281171..0f7cabb 100644
@@ -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
 
arch/arm/config.mk +4 -0
index 17b7408..5bd3961 100644
@@ -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
arch/arm/imx-common/Makefile +8 -0
index 16809fe..025cfed 100644
@@ -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)
 
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH v2 2/2 mx6: add example DTB for mx6qsabreauto

---

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
arch/arm/dts/Makefile +1 -0
index e2fcca5..6acd861 100644
@@ -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 \
arch/arm/dts/imx6q-sabreauto.dts new file +13 -0
new file mode 100644
index 0000000..a3c9c91
@@ -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";
+};
include/configs/mx6qsabreauto.h +3 -0
index dbbb6f0..bd0144f 100644
@@ -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 */
Signature · 1 line
1.7.9.5
#7 lore raw

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

In reply to Stefano Babic
Quoted 3 lines · Stefano Babic

---

Applied to u-boot-imx (both patches)

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#9 lore raw

PATCH v2 2/2 mx6: add example DTB for mx6qsabreauto

In reply to Stefano Babic

Hi Stefano,

Quoted 32 lines · On Mon, 31 Mar 2014 09:50:36 +0200 Stefano Babic <[email protected]> wrote:

---

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
arch/arm/dts/Makefile +1 -0
index e2fcca5..6acd861 100644
@@ -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 \
arch/arm/dts/imx6q-sabreauto.dts new file +0 -0
new file mode 100644
index 0000000..a3c9c91

arch/arm/dts/imx6q-sabreauto.dts line 7

Quoted 7 lines
arch/arm/dts/imx6q-sabreauto.dts new file +7 -0
@@ -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

#10 lore raw

PATCH v2 2/2 mx6: add example DTB for mx6qsabreauto

Hi Masahiro,

Quoted 5 lines · Masahiro Yamada
Quoted 5 lines
arch/arm/dts/imx6q-sabreauto.dts new file +2 -0
@@ -0,0 +1,13 @@
+/*
+    + * Copyright 2012 Freescale Semiconductor, Inc.
Quoted 8 lines

arch/arm/dts/imx6q-sabreauto.dts line 7

Quoted 5 lines
arch/arm/dts/imx6q-sabreauto.dts new file +5 -0
+    + * 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 !

Quoted 2 lines

Could you fix the broken format in a follow-up patch?

Of course !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================