From patchwork Wed Jul 24 13:19:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1136292 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P0s2QD0y"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45twsz1XM8z9s3l for ; Wed, 24 Jul 2019 23:19:19 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DB905C21D8A; Wed, 24 Jul 2019 13:19:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, KHOP_BIG_TO_CC, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AA5C2C21C27; Wed, 24 Jul 2019 13:19:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E46FEC21C27; Wed, 24 Jul 2019 13:19:09 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by lists.denx.de (Postfix) with ESMTPS id 83DC2C21BE5 for ; Wed, 24 Jul 2019 13:19:09 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id v19so41632886wmj.5 for ; Wed, 24 Jul 2019 06:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=WTeatLBUeWYMF///g8ruZqB5mSDGBegE5D1tE7SFjzs=; b=P0s2QD0yli2cJ5hr5TLvjhhChOBaO7ZbuT/xGCMaIi4u2It3iWmFGP0RN0ARIZomeh cN1NQ+8bvk11I0E3M/30pEr0uhogkK179k0tYa+JLvYBTyhlEXAo6ty+0t3qXzkKR402 ehiHNddNR1Vx0zeLE0xo65FUgBHs0ywCdyTB2WPFwnxyJNpiRyxqqQSaBPvWD7sQwuU0 OHEujt3NcoK+VXHjU+Dayp7iq2fbiXCDhkgdZyF1CEjeWyRSuhj9mxaxS/on3QsecJ+p tT5uF6twwlvAxbNN2bQL5Eou7FCwqfo4VxhHJMeZmgeaEDHIZ4cf/H2jxJugHCOO6X58 +SSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WTeatLBUeWYMF///g8ruZqB5mSDGBegE5D1tE7SFjzs=; b=CfGLQF+FoI1XggftKaXnuUhG3bvIDTgn1FNHJBrg+2E9CeI7PtRF2ZgvgfvritciB4 elt/2o1xQE+Iw9IzETD2m9pVL4JTEijMZEnrb2CBGzxmoyIR8a7P5edmGaKVRUq8Vc7G CigjXXBFBWQuOwrddEf5FxQiulRTf1cQDAEohrONh7RAL7+d+IC1o7M3ujK+jeuBvSEp x33weAMLN2qk92N2Q87gIEKf7PaEP2Pl/20PX3YyHkaSwAFZZerg0RgFgUJ7J5MZsQ63 FUMxpxeke4Whp1sPQW0wQBrwLJ4ebxpVYZ0GP9G3BAqUdBEZJOOcAHKsWwvZlSGAThu6 /dVA== X-Gm-Message-State: APjAAAWRvqecOANFeAoayFki0PBqTHIO2qJlubyxNPs4zBj9Wz5AUUTZ xcBTF2buHdzMeXXjeu9ipJrQWyNj X-Google-Smtp-Source: APXvYqxb2n5QQ9Y1q0H0sVmflLvhzlpj5mRkwRYcNVxjScnGeQKQko2mbMseFAZqc5JHNWvJ76pHNg== X-Received: by 2002:a1c:770d:: with SMTP id t13mr1907026wmi.79.1563974348851; Wed, 24 Jul 2019 06:19:08 -0700 (PDT) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id s188sm37176183wmf.40.2019.07.24.06.19.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jul 2019 06:19:08 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Date: Wed, 24 Jul 2019 16:19:05 +0300 Message-Id: <20190724131905.1151-1-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: Marek Vasut , Igor Opaniuk , Stefan Agner , Marcel Ziswiler , Heinrich Schuchardt , Michal Simek , "NXP i.MX U-Boot Team" , liu.ming50@gmail.com, Stefan Roese , Chris Packham Subject: [U-Boot] [PATCH v2] imx: add u-boot-nand.imx target X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Igor Opaniuk 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 Signed-off-by: Igor Opaniuk --- 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..a791f58801 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)