From patchwork Mon Dec 9 12:58:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1206197 X-Patchwork-Delegate: twarren@nvidia.com 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="UTD7LdVT"; 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 47WjtW4Rf4z9sNH for ; Mon, 9 Dec 2019 23:58:43 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EE387816C5; Mon, 9 Dec 2019 13:58:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UTD7LdVT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A77D1816A9; Mon, 9 Dec 2019 13:58:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (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 E8016816A7 for ; Mon, 9 Dec 2019 13:58:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=igor.opaniuk@gmail.com Received: by mail-wm1-x342.google.com with SMTP id p9so15417673wmg.0 for ; Mon, 09 Dec 2019 04:58:21 -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=cjNfx8LWmJ2fCiUVDA6zdLSjt1wr+ybUkTS817GXsH8=; b=UTD7LdVTK+9arc84bVWH8HH9YqHT2YtSVKfAQ0XVPW0pfbRG/JueKhbRsjD53aqfYY NpjjE0D9TzsMta+tlV8EciKNMBz7wtDaLxXPtWrxL7rohE9jbEDLwPxeFPbEqo+rhRMh /JK19JxbZo5h8Fd1zu/wsR0aS8gHDt918PiJ/8S9zgxCrBaRNYRt5G0D0TKN+qEVdALQ sfMqTUYXjO1Viwq5jNIcnrZFpwECi9znFEWhbYLG2tKDH/7YRWg+tJkYn7RISnxH55G2 ea9R3pNitZpJ5KBx9z9J6/OQOM3UGzBTLO3cnVCbH0nSYfqDaQojHDCbkoXBBnXfhA0e 7bWA== 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=cjNfx8LWmJ2fCiUVDA6zdLSjt1wr+ybUkTS817GXsH8=; b=CXnLYJuI5HcgJbsEJlfj05I4+bgySnF+Nvo5QpgySCT9mvW6Rh2/QvY8RLzAvjTHhI Mhmlvz0rVFOGj+GFpEqn18B6ThBrroKv31z4DaXv3nzgF4NXZxQKPZwY/LoWckxkXHtn UleMHd7P6w8gkgbwpWRrhZUKUObsPKbVu0rpPQUTcyU7v0SU2KRXqUASr3ZGN8PztsD6 LUdsOyZEf+fm9NoYTQoh07Xc43pe/vfLrbq0vzkRCjTrZaEtNarltdweLywy7wex1nGc FegEBx4QTvrDdSOIfeidMtCU99xu8J57DA5QRpoAH6S/wTLqtQvRvptSS5ZlUf1QBgq0 97dw== X-Gm-Message-State: APjAAAXNkaSs3buelamHEYVH22yVGtKzeMItp1fa+JljvRuPC3mUJpLN t+Zbp5u2+lD49LDoBgNWDDYVJADX5fg= X-Google-Smtp-Source: APXvYqzkKUJg231lFmwc5B6esSakBWZDC4OcS5OHytv9dMiE8DtkkENbSnvsdv+5N/+S51k4K+575g== X-Received: by 2002:a7b:c8da:: with SMTP id f26mr24538432wml.40.1575896301229; Mon, 09 Dec 2019 04:58:21 -0800 (PST) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id 5sm28619439wrh.5.2019.12.09.04.58.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Dec 2019 04:58:20 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Subject: [PATCH v2 2/4] apalis_t30: add update_uboot wrapper Date: Mon, 9 Dec 2019 14:58:08 +0200 Message-Id: <20191209125810.15159-3-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191209125810.15159-1-igor.opaniuk@gmail.com> References: <20191209125810.15159-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: marcel.ziswiler@toradex.com, Igor Opaniuk , max.krummenacher@toradex.com Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean From: Igor Opaniuk Add universal update_uboot wrapper that helps to update U-Boot image on internal storage. Create an proper tegra image: $ cbootimage -s tegra30 apalis_t30.img.cfg apalis_t30.img Flash in U-boot shell: > tftpboot ${loadaddr} ${board_name}/${board_name}.img > run update_uboot Signed-off-by: Igor Opaniuk --- include/configs/apalis_t30.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/configs/apalis_t30.h b/include/configs/apalis_t30.h index 821162a2be..701b34aa84 100644 --- a/include/configs/apalis_t30.h +++ b/include/configs/apalis_t30.h @@ -40,6 +40,17 @@ #undef CONFIG_SYS_MAXARGS #define CONFIG_SYS_MAXARGS 32 +#define UBOOT_UPDATE \ + "uboot_hwpart=1\0" \ + "uboot_blk=0\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" \ + +#define BOARD_EXTRA_ENV_SETTINGS \ + UBOOT_UPDATE + #include "tegra-common-usb-gadget.h" #include "tegra-common-post.h"