Makefile: Add single image for imx6 socs based boards

Message ID 20190430064526.16008-1-shyam.saini@amarulasolutions.com
State New
Headers show
Series
  • Makefile: Add single image for imx6 socs based boards
Related show

Commit Message

Shyam Saini April 30, 2019, 6:45 a.m. UTC
This was tested on engicam imx6qdl and imx6ul boards

Signed-off-by: Shyam Saini <shyam.saini@amarulasolutions.com>
---
 Makefile                         | 10 ++++++++++
 arch/arm/dts/imx6-u-boot.dtsi    | 16 ++++++++++++++++
 arch/arm/dts/imx6qdl-u-boot.dtsi |  1 +
 arch/arm/dts/imx6ul-u-boot.dtsi  |  1 +
 arch/arm/mach-imx/mx6/Kconfig    |  2 ++
 5 files changed, 30 insertions(+)
 create mode 100644 arch/arm/dts/imx6-u-boot.dtsi

Comments

Jagan Teki April 30, 2019, 7:02 a.m. UTC | #1
On Tue, Apr 30, 2019 at 12:15 PM Shyam Saini
<shyam.saini@amarulasolutions.com> wrote:
>
> This was tested on engicam imx6qdl and imx6ul boards

Write some commit message something like from my patch.

>
> Signed-off-by: Shyam Saini <shyam.saini@amarulasolutions.com>
> ---
>  Makefile                         | 10 ++++++++++
>  arch/arm/dts/imx6-u-boot.dtsi    | 16 ++++++++++++++++
>  arch/arm/dts/imx6qdl-u-boot.dtsi |  1 +
>  arch/arm/dts/imx6ul-u-boot.dtsi  |  1 +
>  arch/arm/mach-imx/mx6/Kconfig    |  2 ++
>  5 files changed, 30 insertions(+)
>  create mode 100644 arch/arm/dts/imx6-u-boot.dtsi
>
> diff --git a/Makefile b/Makefile
> index f2c7bb6041..dd415353ba 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -851,6 +851,11 @@ ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
>  ALL-y += u-boot-sunxi-with-spl.bin
>  endif
>
> +# Build a combined spl + u-boot image for imx6
> +ifdef ($(CONFIG_MX6QDLL || CONFIG_MX6UL)$(CONFIG_SPL)$(CONFIG_OF_CONTROL),yyy)
> +ALL-$(CONFIG_ARCH_MX6) += u-boot-imx6-with-spl.bin
> +endif
> +
>  # enable combined SPL/u-boot/dtb rules for tegra
>  ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
>  ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
> @@ -1364,6 +1369,11 @@ u-boot-br.bin: u-boot FORCE
>  endif
>  endif
>
> +ifeq ($(CONFIG_MX6QDLL || CONFIG_MX6UL)$(CONFIG_SPL)$(CONFIG_OF_CONTROL),yyy)
> +u-boot-imx6-with-spl.bin: SPL u-boot-dtb.img FORCE
> +       @$(call if_changed,binman)
> +endif # CONFIG_ARCH_MX6
> +
>  # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
>  # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
>  # the middle. This is handled by binman based on an image description in the
> diff --git a/arch/arm/dts/imx6-u-boot.dtsi b/arch/arm/dts/imx6-u-boot.dtsi
> new file mode 100644
> index 0000000000..fa02d5f61f
> --- /dev/null
> +++ b/arch/arm/dts/imx6-u-boot.dtsi
> @@ -0,0 +1,16 @@
> +#include <config.h>
> +
> +/ {
> +       binman {
> +               filename = "u-boot-imx6-with-spl.bin";
> +               pad-byte = <0xff>;
> +
> +               blob {
> +                       filename = "SPL";
> +               };
> +
> +               u-boot-img {
> +                       offset = <CONFIG_SPL_PAD_TO>;
> +               };
> +       };
> +};
> diff --git a/arch/arm/dts/imx6qdl-u-boot.dtsi b/arch/arm/dts/imx6qdl-u-boot.dtsi
> index 0aa29e38b8..5c360eed15 100644
> --- a/arch/arm/dts/imx6qdl-u-boot.dtsi
> +++ b/arch/arm/dts/imx6qdl-u-boot.dtsi
> @@ -2,6 +2,7 @@
>  /*
>   * Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
>   */
> +#include "imx6-u-boot.dtsi"
>
>  / {
>         soc {
> diff --git a/arch/arm/dts/imx6ul-u-boot.dtsi b/arch/arm/dts/imx6ul-u-boot.dtsi
> index eb190cf8c8..6bc1629a97 100644
> --- a/arch/arm/dts/imx6ul-u-boot.dtsi
> +++ b/arch/arm/dts/imx6ul-u-boot.dtsi
> @@ -2,6 +2,7 @@
>  /*
>   * Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
>   */
> +#include "imx6-u-boot.dtsi"
>
>  / {
>         soc {
> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
> index e782859b1e..36f460cc21 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -34,6 +34,7 @@ config MX6QDL
>         bool
>         select HAS_CAAM
>         select MX6_SMP
> +       select BINMAN

Better select only if SPL and OF_CONTROL enabled.

Even it's better to document the steps in doc/imx/common/imx6.txt or
we can do this in separate patch.

Patch

diff --git a/Makefile b/Makefile
index f2c7bb6041..dd415353ba 100644
--- a/Makefile
+++ b/Makefile
@@ -851,6 +851,11 @@  ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
 ALL-y += u-boot-sunxi-with-spl.bin
 endif
 
+# Build a combined spl + u-boot image for imx6
+ifdef ($(CONFIG_MX6QDLL || CONFIG_MX6UL)$(CONFIG_SPL)$(CONFIG_OF_CONTROL),yyy)
+ALL-$(CONFIG_ARCH_MX6) += u-boot-imx6-with-spl.bin
+endif
+
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
 ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
@@ -1364,6 +1369,11 @@  u-boot-br.bin: u-boot FORCE
 endif
 endif
 
+ifeq ($(CONFIG_MX6QDLL || CONFIG_MX6UL)$(CONFIG_SPL)$(CONFIG_OF_CONTROL),yyy)
+u-boot-imx6-with-spl.bin: SPL u-boot-dtb.img FORCE
+	@$(call if_changed,binman)
+endif # CONFIG_ARCH_MX6
+
 # x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
 # reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
 # the middle. This is handled by binman based on an image description in the
diff --git a/arch/arm/dts/imx6-u-boot.dtsi b/arch/arm/dts/imx6-u-boot.dtsi
new file mode 100644
index 0000000000..fa02d5f61f
--- /dev/null
+++ b/arch/arm/dts/imx6-u-boot.dtsi
@@ -0,0 +1,16 @@ 
+#include <config.h>
+
+/ {
+	binman {
+		filename = "u-boot-imx6-with-spl.bin";
+		pad-byte = <0xff>;
+
+		blob {
+			filename = "SPL";
+		};
+
+		u-boot-img {
+			offset = <CONFIG_SPL_PAD_TO>;
+		};
+	};
+};
diff --git a/arch/arm/dts/imx6qdl-u-boot.dtsi b/arch/arm/dts/imx6qdl-u-boot.dtsi
index 0aa29e38b8..5c360eed15 100644
--- a/arch/arm/dts/imx6qdl-u-boot.dtsi
+++ b/arch/arm/dts/imx6qdl-u-boot.dtsi
@@ -2,6 +2,7 @@ 
 /*
  * Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
  */
+#include "imx6-u-boot.dtsi"
 
 / {
 	soc {
diff --git a/arch/arm/dts/imx6ul-u-boot.dtsi b/arch/arm/dts/imx6ul-u-boot.dtsi
index eb190cf8c8..6bc1629a97 100644
--- a/arch/arm/dts/imx6ul-u-boot.dtsi
+++ b/arch/arm/dts/imx6ul-u-boot.dtsi
@@ -2,6 +2,7 @@ 
 /*
  * Copyright (C) 2018 Jagan Teki <jagan@amarulasolutions.com>
  */
+#include "imx6-u-boot.dtsi"
 
 / {
 	soc {
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index e782859b1e..36f460cc21 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -34,6 +34,7 @@  config MX6QDL
 	bool
 	select HAS_CAAM
 	select MX6_SMP
+	select BINMAN
 
 config MX6S
 	bool
@@ -57,6 +58,7 @@  config MX6UL
 	select ROM_UNIFIED_SECTIONS
 	select SYSCOUNTER_TIMER
 	select SYS_L2CACHE_OFF
+	select BINMAN
 
 config MX6UL_LITESOM
 	bool