From patchwork Wed Dec 4 14:31:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1204209 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.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="KSMUtbUK"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47ShFx6zbTz9sP3 for ; Thu, 5 Dec 2019 01:35:01 +1100 (AEDT) Received: by phobos.denx.de (Postfix, from userid 109) id 0D95781680; Wed, 4 Dec 2019 15:34:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6BF2D8166C; Wed, 4 Dec 2019 15:32:23 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: mail.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KSMUtbUK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5024F81582; Wed, 4 Dec 2019 15:31:20 +0100 (CET) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DAA768089E for ; Wed, 4 Dec 2019 15:31:17 +0100 (CET) Authentication-Results: mail.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: mail.denx.de; spf=pass smtp.mailfrom=igor.opaniuk@gmail.com Received: by mail-wm1-f66.google.com with SMTP id u8so8185022wmu.0 for ; Wed, 04 Dec 2019 06:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=I0Tz6vJJ1aFX+b39lpCfOO74x5v7MyUwBrc2+v6hmNU=; b=KSMUtbUKaqLBmkd4YEi/SZAzgR/xU0+9p7RuOEkelVw58CsU60Mag4/g6Wt6yoFNrh MZ52KuOFFQo5IqE8z2f2sLqT2YmjpanLrh0n/oxl5M4nOaUgBYH7+BMykTm8+72I4q7M R5uIdwNrLq/OvJeqMClaVD+Lx4+FRWPAx6tMkM7E7bI+8HmWvIbCedToMoG+4t6KBtct 26jyxHTeoVlWEnwOV0Wc6kppBJTjoTvxE9SdA4xWvipWNn2OWg98Fn8omos8tb6icdSy P2qHxPqngY9kVKStkRRsphJgYHBFYDOg8D3pZuE3ERWJApuvZLszDscm+8YL3uoDR9RB 569A== 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:in-reply-to :references; bh=I0Tz6vJJ1aFX+b39lpCfOO74x5v7MyUwBrc2+v6hmNU=; b=oDuwqnxFSEhLsQFRRTVygQGFd4V/DvtDO5+BbgjD50/Wx3tqrUqI9eLSDI59RcfY45 WbhiFXCetLHqVrCFs44P1Tnr07Sie7slPPSIwfjainA07M5LLbXka1uJTr3WesuaGhwA PvgoNZbuADDogyp9fLXo0YNa/57nV9VuALKskc25Uteey0OjIU6N8Jnk7YH0x1KvR2Q/ PYxjEW2K3q4SBLaFiQfJqqGmrpCuaPAk77X394sSyvmfP3aPtTxqoc8XtA+gw7oDG4B4 SJJFVEJsQ6Z7+e8Rx0cWnlMJ+ZuTyCR2aMV7hd3BaW/rrnFkGjigAfuzG0fBzGfxV7PA 6jNw== X-Gm-Message-State: APjAAAVboOBXjVUb3KDsd92BDD0fIwQFjrY48+Asps+mmzoFKTBVjgRL gDPDQbt2Aq169qC5mm2cTy6O8n9nZOA= X-Google-Smtp-Source: APXvYqzqXVGw9cOL3ivpVKuCflAdATJk3IXDQ2qAkRakvcIzDMZ5xa0uWWeIUP5YUJI/bP2m0ejx1A== X-Received: by 2002:a05:600c:1009:: with SMTP id c9mr37737575wmc.162.1575469877033; Wed, 04 Dec 2019 06:31:17 -0800 (PST) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id t81sm7292064wmg.6.2019.12.04.06.31.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Dec 2019 06:31:16 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Subject: [PATCH v1 1/5] colibri_imx7: add update_uboot wrapper Date: Wed, 4 Dec 2019 16:31:06 +0200 Message-Id: <20191204143111.5596-2-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191204143111.5596-1-igor.opaniuk@gmail.com> References: <20191204143111.5596-1-igor.opaniuk@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Opaniuk , Stefan Agner , marcel.ziswiler@toradex.com, max.krummenacher@toradex.com Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at mail.denx.de X-Virus-Status: Clean From: Igor Opaniuk Add universal update_uboot wrapper that helps to update U-Boot image on internal storage. Usage example: > tftpboot ${loadaddr} ${board_name}/u-boot-dtb.imx > run update_uboot Signed-off-by: Igor Opaniuk --- include/configs/colibri_imx7.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h index d92db7192e..2e212bf8ec 100644 --- a/include/configs/colibri_imx7.h +++ b/include/configs/colibri_imx7.h @@ -43,6 +43,23 @@ #define CONFIG_NETMASK 255.255.255.0 #define CONFIG_SERVERIP 192.168.10.1 +#if defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC) +#define UBOOT_UPDATE \ + "uboot_hwpart=1\0" \ + "uboot_blk=2\0" \ + "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \ + "setexpr blkcnt ${blkcnt} / 0x200\0" \ + "update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \ + "mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0" +#elif defined(CONFIG_TARGET_COLIBRI_IMX7_NAND) +#define UBOOT_UPDATE \ + "uboot_hwpart=1\0" \ + "update_uboot=nand erase.part u-boot1 && " \ + "nand write ${loadaddr} u-boot1 ${filesize} && " \ + "nand erase.part u-boot2 && " \ + "nand write ${loadaddr} u-boot2 ${filesize}\0" +#endif + #ifndef PARTS_DEFAULT /* Define the default GPT table for eMMC */ #define PARTS_DEFAULT \ @@ -163,6 +180,7 @@ MEM_LAYOUT_ENV_SETTINGS \ NFS_BOOTCMD \ MODULE_EXTRA_ENV_SETTINGS \ + UBOOT_UPDATE \ "boot_file=zImage\0" \ "console=ttymxc0\0" \ "defargs=\0" \