From patchwork Mon Dec 9 12:58:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1206196 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="pQ87wePj"; 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 47WjtL75mmz9sPc for ; Mon, 9 Dec 2019 23:58:34 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0755E816BF; Mon, 9 Dec 2019 13:58:27 +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="pQ87wePj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DBD58816A9; Mon, 9 Dec 2019 13:58:23 +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-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 C1E2481685 for ; Mon, 9 Dec 2019 13:58:20 +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-x331.google.com with SMTP id p17so14825175wma.1 for ; Mon, 09 Dec 2019 04:58:20 -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=si5nJgKOujVpnmASdE9F7pjZ9chjSmZhTwLimRaWaq0=; b=pQ87wePjBbYdCjz+AHOXalsgD/fz8VmcH4nlUS5aoUoLWtIhOk3d35AlLskXwlJSG4 ksreao7+iGsqSrbOj2Q3YyI8vWVIpAFbb/1MOl9xHFRo63Z7lAJzTE2XDD+fMmPOecEb l66ru2RQP8KBBfyfsUXGl8OcfWpUsxxq34akVa8QfiV/RDOlCLRoQIfFTZWJYibjyEZk gAD3aNxOt0w4flT8dd80w0XgjB9UTJxHkg9aHCgZOk4FC7LxjX0Regn7zl7bjfXkICuj Ldj6rcMezrhz/ES3TN3sN0oxAc5zdVcXAe3+ih/nNbtwkLmAOYp2G/Yn1L1Jg1NjCRvQ x82Q== 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=si5nJgKOujVpnmASdE9F7pjZ9chjSmZhTwLimRaWaq0=; b=AQxVjE/54YhjoXKXY+htLxdJml8lZOz+fNbb4051yJ/7YmQ83bgLBo9b9XMemQKmsW r3iqbLhzTvsSa87/dfMnW6SvVXpzC3CcOPF0Zn1fMlQgB1VRRT+xjY/coGPyYgd+24vK z+I+OKyqL+Ev92cuTG91LjI+ZUHsvHbSaaw9eiEPp63kiiG/6c4CZZqpKn5kRLmCb1K/ K+TYXNB9z2qXutxoyY4qOVTCntw55aNJM4RxI62WBeq7gRdmg3L019+IwSXyF3i0FBlT 6A+YSYUW1st9mpRamxq3g7Bc3P89SxpuTHPSYA5f1uomKXkf4ep7BwVEQwYO4rYHtdTd Izng== X-Gm-Message-State: APjAAAU6+u2YC6bSWB3GsTKWV1RgOOupg9yvY5ik1hIMxk/gZRDPND1C Pl9oXEbLBmS1VpxyG3kxCzsXZxU/FCw= X-Google-Smtp-Source: APXvYqxteSr1YsXY9bIldSqn+yPkX1XfjJXsX16An7rCQHcvbElejbdUHv9pLwTazxFBZiSEA0K0pg== X-Received: by 2002:a1c:c90e:: with SMTP id f14mr24502105wmb.47.1575896299910; Mon, 09 Dec 2019 04:58:19 -0800 (PST) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id g69sm14075394wmg.13.2019.12.09.04.58.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Dec 2019 04:58:19 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Subject: [PATCH v2 1/4] apalis-tk1: add update_uboot wrapper Date: Mon, 9 Dec 2019 14:58:07 +0200 Message-Id: <20191209125810.15159-2-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 tegra124 apalis-tk1.img.cfg apalis-tk1.img Flash in U-boot shell: > tftpboot ${loadaddr} ${board_name}/${board_name}.img > run update_uboot Signed-off-by: Igor Opaniuk --- include/configs/apalis-tk1.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/configs/apalis-tk1.h b/include/configs/apalis-tk1.h index 4127f2d6c6..8ca571b9b7 100644 --- a/include/configs/apalis-tk1.h +++ b/include/configs/apalis-tk1.h @@ -46,6 +46,14 @@ "zImage fat 0 1 mmcpart 0; " \ "tegra124-apalis-eval.dtb fat 0 1 mmcpart 0" +#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 EMMC_BOOTCMD \ "set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} " \ "ro rootfstype=ext4 rootwait\0" \ @@ -104,6 +112,7 @@ "fdt_module=" FDT_MODULE "\0" \ NFS_BOOTCMD \ SD_BOOTCMD \ + UBOOT_UPDATE \ "setethupdate=if env exists ethaddr; then; else setenv ethaddr " \ "00:14:2d:00:00:00; fi; pci enum && tftpboot ${loadaddr} " \ "flash_eth.img && source ${loadaddr}\0" \ 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" From patchwork Mon Dec 9 12:58:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1206198 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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="XueTwqvW"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Wjth6bRSz9sNH for ; Mon, 9 Dec 2019 23:58:52 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 44E8D816A9; Mon, 9 Dec 2019 13:58:30 +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="XueTwqvW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24002816A9; Mon, 9 Dec 2019 13:58:26 +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-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 471B081686 for ; Mon, 9 Dec 2019 13:58:23 +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-wr1-x444.google.com with SMTP id w15so16148290wru.4 for ; Mon, 09 Dec 2019 04:58:23 -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=UlQmvkRP1/T21kLqJZSRxD2vMHvzJsnh7/qgBjfiZ9s=; b=XueTwqvW++5ukQGZlKilkMOYO/t5Vnh1NWpmY58h63bbeVNZpfnB5sT1V5OsZh8yaA 83zTsDw8Ef8HLG3w/BK+ALjvS18I8WRmnYq1lVwuM9yqzTQkwy6QIandpNvPTrx9VTIl Yvk14bfX2ZJ0bMI+c1tLyRhD/OcG4+UoZuuwevvPuXbW03xKf2hqkDsgRNG9sVIy95l9 6J69ADzhha8DoFrEw2ocEJfRhMs8DG/mAAvq1z5AQfHJc4ahUq+TV9LnLQ3ijcF317Wn af0LYG+EqzruDinllnYsz0wXmFg5ZzTtusptJJ0OyaGVUPKPOa6tCJHdNJirCD/ceVla rdVw== 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=UlQmvkRP1/T21kLqJZSRxD2vMHvzJsnh7/qgBjfiZ9s=; b=aFoa8vJekuIAeJJlo54MwDcP04YQk2HL5Rl49YQdBJj2OotDuM2QeOiYJQ4aPNjRSD Ef/Lvb+r55jOVd3+ARwHZ4hcxvwgl/ZqXxzAv/0yVnw+Q8rTVTlTWoZ0xFTUKS+TvARM AjkbjMPepT7FdUUbpxOhPrYsJy7upPS0p6+Gdm7ByOwl5GHtJL6ykCUSE1rTASz0PwVp vrdLbgeJ8fUiqbkN/dIShClVddw/vvFOx4CdvPFEJJQ8GXg+kML0+pjIh+aP5fY+FaJW rBrMVg/0fa1RNjbWXpCNSiKbQILImpV2hy0eVX5STWyLh/CmlELbPR3Hj+ADiPs/RS3G +glQ== X-Gm-Message-State: APjAAAVVVwTkVFgZuVdbKenAUbaz8sASEPMaeOs0GxVxTKQYitcq5VQs lmgWatuIko3qA+WfI8/prCHd2caZn3Y= X-Google-Smtp-Source: APXvYqwiwAzkX8yZQQQwgkpuBB77EULkRu2lEVMJ1FbdYTXlzSH85xbF+F2AXqTLabKg47ugtSTRBQ== X-Received: by 2002:adf:e3c1:: with SMTP id k1mr1940057wrm.151.1575896302547; Mon, 09 Dec 2019 04:58:22 -0800 (PST) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id k19sm13069369wmi.42.2019.12.09.04.58.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Dec 2019 04:58:22 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Subject: [PATCH v2 3/4] colibri_t20: add update_uboot wrapper Date: Mon, 9 Dec 2019 14:58:09 +0200 Message-Id: <20191209125810.15159-4-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: Igor Opaniuk , Lucas Stach , 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 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(NAND). Create an proper tegra image: $ cbootimage -s tegra20 colibri_t20-512-v12-nand.img.cfg colibri_t20.img Flash in U-boot shell: > tftpboot ${loadaddr} ${board_name}/${board_name}.img > run update_uboot Signed-off-by: Igor Opaniuk --- include/configs/colibri_t20.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/configs/colibri_t20.h b/include/configs/colibri_t20.h index 122294de6f..94e17bbb7c 100644 --- a/include/configs/colibri_t20.h +++ b/include/configs/colibri_t20.h @@ -27,10 +27,14 @@ #define CONFIG_TEGRA_NAND #define CONFIG_SYS_MAX_NAND_DEVICE 1 -/* Environment in NAND, 64K is a bit excessive but erase block is 512K anyway */ +#define UBOOT_UPDATE \ + "update_uboot=nand erase.part u-boot && " \ + "nand write ${loadaddr} u-boot ${filesize}\0" \ +/* Environment in NAND, 64K is a bit excessive but erase block is 512K anyway */ #define BOARD_EXTRA_ENV_SETTINGS \ - "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" + "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \ + UBOOT_UPDATE /* Increase console I/O buffer size */ #undef CONFIG_SYS_CBSIZE From patchwork Mon Dec 9 12:58:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1206199 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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="aOMjwkfB"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 47Wjtv1SCWz9sNH for ; Mon, 9 Dec 2019 23:59:02 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 57F88816CE; Mon, 9 Dec 2019 13:58:32 +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="aOMjwkfB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9D68E816C5; Mon, 9 Dec 2019 13:58:27 +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-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 BE09281685 for ; Mon, 9 Dec 2019 13:58:24 +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-x341.google.com with SMTP id p17so14817209wmi.3 for ; Mon, 09 Dec 2019 04:58:24 -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=+gZUC4fztCXz5faeK0YgwxQNp+0nSkAA2RwkRrW1ur8=; b=aOMjwkfBWmowSfRBDqfbJImP5ajBdglo+GcDfrXcDg8gDfZXiQNujA9F7agJcUg1vv yfGuPH6uXp38eo+C5VCctqsHRcR8H6p6G0WDnrBy3sNlbYu4HsiaT5MLXAzZJR2L4lFD XDXHA0rPp64AFSESBjcgK+X00zm6qtSkakRjfZR7Bfz7vFhyBT4SRWEIatKtIh+1ATRT 59MbOOcJ6xtS+zp/s+j4M7Kv09RUERBvaz+5EniOt2bAPpNyPfvqVkQeWdHxyNvZNe9E Kebwq9E2QvMn5uSgisP2rugmaYjqK+2lv/Jcnn2ms3AHE6VT4uzhivNZSROjphGrafW1 W2Kw== 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=+gZUC4fztCXz5faeK0YgwxQNp+0nSkAA2RwkRrW1ur8=; b=Jp2tndOQ+7YgTmG58d2hIyaXJFdwb6MVdgKlSbjkkb1EFfGGTczWqGR82pIFvdrYNu J+MQrFMDosEeUJO60S5+zLf9+TI057d/Jk/oN367Qu6/hla44TXT6ZiIGo37YGOjkoDr IG6yNh7542AGyBRGrwMDCxUo5HP+5P2mxvTIJIMQhwC6VgFpZPPk27oN6xCquppZrEZM W2k8brGc03Gw9BAGLOal//xnJ40V43tdfeeT2MNV53Mqs8j12T2bGh+VduAOvCOMAR3w jgcpQJq0XaOvdRjb7b3mliktNdn9l5Ur8/4QsX5JYTV6Hy/en9Rwd772NskvAA/yYDKA 13jw== X-Gm-Message-State: APjAAAVFBPI2kVAxemruEHKERA9GSlPpsdsuPGFicRNk//0YNlWBIRKs OcgnoVUtEEyUgcZcTxZww+LSHPV0jLU= X-Google-Smtp-Source: APXvYqzjo4fljbs9Pt9wReGYQ+PTTqHE4EMid46fxqb3N3oGE6pZt8k+lrKqiL799EfTNioPmsODGg== X-Received: by 2002:a1c:4c10:: with SMTP id z16mr25888819wmf.136.1575896303985; Mon, 09 Dec 2019 04:58:23 -0800 (PST) Received: from localhost ([194.105.145.90]) by smtp.gmail.com with ESMTPSA id d19sm13789660wmd.38.2019.12.09.04.58.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Dec 2019 04:58:23 -0800 (PST) From: Igor Opaniuk To: u-boot@lists.denx.de Subject: [PATCH v2 4/4] colibri_t30: add update_uboot wrapper Date: Mon, 9 Dec 2019 14:58:10 +0200 Message-Id: <20191209125810.15159-5-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: 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 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 colibri_t30.img.cfg colibri_t30.img Flash in U-boot shell: > tftpboot ${loadaddr} ${board_name}/${board_name}.img > run update_uboot Signed-off-by: Igor Opaniuk --- include/configs/colibri_t30.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/configs/colibri_t30.h b/include/configs/colibri_t30.h index 5aecf14393..4e5e89b547 100644 --- a/include/configs/colibri_t30.h +++ b/include/configs/colibri_t30.h @@ -39,6 +39,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"