diff mbox series

[U-Boot,v3] imx: add u-boot-nand.imx target

Message ID 20190724141433.5075-1-igor.opaniuk@gmail.com
State Rejected
Delegated to: Stefano Babic
Headers show
Series [U-Boot,v3] imx: add u-boot-nand.imx target | expand

Commit Message

Igor Opaniuk July 24, 2019, 2:14 p.m. UTC
From: Igor Opaniuk <igor.opaniuk@toradex.com>

Add an additional target which prepends the u-boot.imx image with
0x400 padding bytes. On Vybrid and i.MX 7, i.MX6ULL this is required
for NAND boot devices. The configuration CONFIG_IMX_NAND enables this
image for a board.

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

v3:
- fixed depedency of Ksymbol

v2:
- addressed Jagan's comment

 Kconfig                    | 1 +
 Makefile                   | 3 +++
 arch/arm/mach-imx/Makefile | 7 +++++++
 3 files changed, 11 insertions(+)

Comments

Oleksandr Suvorov July 25, 2019, 6:29 a.m. UTC | #1
On Wed, Jul 24, 2019 at 5:15 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> Add an additional target which prepends the u-boot.imx image with
> 0x400 padding bytes. On Vybrid and i.MX 7, i.MX6ULL this is required
> for NAND boot devices. The configuration CONFIG_IMX_NAND enables this
> image for a board.
>
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
> v3:
> - fixed depedency of Ksymbol
>
> v2:
> - addressed Jagan's comment
>
>  Kconfig                    | 1 +
>  Makefile                   | 3 +++
>  arch/arm/mach-imx/Makefile | 7 +++++++
>  3 files changed, 11 insertions(+)
>
> diff --git a/Kconfig b/Kconfig
> index d2eb744e70..c9473e00a9 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -253,6 +253,7 @@ config BUILD_TARGET
>         default "u-boot.itb" if SPL_LOAD_FIT && (ROCKCHIP_RK3399 || ARCH_SUNXI)
>         default "u-boot.kwb" if KIRKWOOD
>         default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
> +       default "u-boot-nand.imx" if (ARCH_MX6 || ARCH_MX7) && NAND_BOOT
>         help
>           Some SoCs need special image types (e.g. U-Boot binary
>           with a special header) as build targets. By defining
> diff --git a/Makefile b/Makefile
> index 73fdf70cdd..287b74dd50 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1106,6 +1106,9 @@ endif
>  %.vyb: %.imx
>         $(Q)$(MAKE) $(build)=arch/arm/cpu/armv7/vf610 $@
>
> +u-boot-nand.imx: u-boot.imx
> +       $(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
> +
>  quiet_cmd_copy = COPY    $@
>        cmd_copy = cp $< $@
>
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index 898478fc4a..365a5951f1 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -112,6 +112,13 @@ u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
>  u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
>         $(call if_changed,mkimage)
>
> +ifeq ($(CONFIG_NAND_BOOT),y)
> +cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | \
> +       cat - $< > $@
> +u-boot-nand.imx: u-boot.imx FORCE
> +       $(call if_changed,u-boot-nand_imx)
> +endif
> +
>  ifeq ($(CONFIG_MULTI_DTB_FIT),y)
>  MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
>         -T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE)
> --
> 2.17.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
diff mbox series

Patch

diff --git a/Kconfig b/Kconfig
index d2eb744e70..c9473e00a9 100644
--- a/Kconfig
+++ b/Kconfig
@@ -253,6 +253,7 @@  config BUILD_TARGET
 	default "u-boot.itb" if SPL_LOAD_FIT && (ROCKCHIP_RK3399 || ARCH_SUNXI)
 	default "u-boot.kwb" if KIRKWOOD
 	default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
+	default "u-boot-nand.imx" if (ARCH_MX6 || ARCH_MX7) && NAND_BOOT
 	help
 	  Some SoCs need special image types (e.g. U-Boot binary
 	  with a special header) as build targets. By defining
diff --git a/Makefile b/Makefile
index 73fdf70cdd..287b74dd50 100644
--- a/Makefile
+++ b/Makefile
@@ -1106,6 +1106,9 @@  endif
 %.vyb: %.imx
 	$(Q)$(MAKE) $(build)=arch/arm/cpu/armv7/vf610 $@
 
+u-boot-nand.imx: u-boot.imx
+	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+
 quiet_cmd_copy = COPY    $@
       cmd_copy = cp $< $@
 
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 898478fc4a..365a5951f1 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -112,6 +112,13 @@  u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
 u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
 	$(call if_changed,mkimage)
 
+ifeq ($(CONFIG_NAND_BOOT),y)
+cmd_u-boot-nand_imx = (dd bs=1024 count=1 if=/dev/zero 2>/dev/null) | \
+	cat - $< > $@
+u-boot-nand.imx: u-boot.imx FORCE
+	$(call if_changed,u-boot-nand_imx)
+endif
+
 ifeq ($(CONFIG_MULTI_DTB_FIT),y)
 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
 	-T $(IMAGE_TYPE) -e $(CONFIG_SYS_TEXT_BASE)