From patchwork Fri Mar 27 10:15:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1262690 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=E2NH4cV9; 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 48pd6z1tN9z9sSH for ; Fri, 27 Mar 2020 21:16:27 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6856A818A5; Fri, 27 Mar 2020 11:16:14 +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=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E2NH4cV9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7E97281883; Fri, 27 Mar 2020 11:15:57 +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=-2.0 required=5.0 tests=BAYES_00,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-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (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 BF49781836 for ; Fri, 27 Mar 2020 11:15:53 +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-lj1-x22c.google.com with SMTP id g12so9630603ljj.3 for ; Fri, 27 Mar 2020 03:15:53 -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:in-reply-to:references; bh=si5nJgKOujVpnmASdE9F7pjZ9chjSmZhTwLimRaWaq0=; b=E2NH4cV9ItkUIXWvwPqMy7R18Qtc6sFhNwNUkom3+8fXFNly5vpNiP47ldtQvjbQjZ fnV3LWq0lSG0o5hFP527eQUiQ0Mx52eyF5ZNDSWhm07ApCYobIQq2xQxmsC/Y39l3HGr 5CAvBmUG7gdmNij93YC2wjezPzyv3UCZYsokOOzRY3kP7VmfRW+PsoUF0aml3kmRWQJb kM6sbWdKrPQmyA19H93MobhK84Ppyln0hrL+UeKlTV2NknD0XS7hwPJNmcZx9KM4zj02 PsJgNjJHFzPomKsW7H+iHeTbiiN2e7xENxbOEep1FBJ6Ti3Iv749K/x04a6cCyACximt IRzw== 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=EsEKNHM/CZFfq4wEEv+BfLueQF08NA+WpfXb3hZao8Vw2QaKsm4t96+R3jusTXZEcO yWM7kS6E5y5Wk0989LE0kLqPxNMo3jOc7bRb7fMOLeJB2Q8j6EhTzetLLDvfTS7hZjV7 bMoW/6P3QojQE3XvGUC5DgFn3uCZut7Gu/XQFb4I8jv9gTv99ELSJxhV3Exz4FvO99wB Sm0sGrE4l4JL/r3D12VDTzheT0qOk01ltXnen0BFW58InYBmJ19aM/Nz4aoTsUumyhnB Iiz7mKagU2G5lxkEnP2jNvuT8fdu9/rFvHxIU9aoQp90hJLGDvSaQpsH7vXwdQAS0/Sq qk8Q== X-Gm-Message-State: AGi0PuZCTLXiHRgORQGSncOVsNc89Dac6F1AsM79349wCtHIU9vhwzyr P1uDroOjkll4OeMMXDwOJItTZdswo+s= X-Google-Smtp-Source: APiQypLm6tH1id7akJSbmcgPquURe/EhNlkv3OO6vSTE9xxlplE/XR7I8ARMAgCYnZ36xNblARwfcQ== X-Received: by 2002:a05:651c:50a:: with SMTP id o10mr7641016ljp.163.1585304152785; Fri, 27 Mar 2020 03:15:52 -0700 (PDT) Received: from localhost (host-176-37-176-139.la.net.ua. [176.37.176.139]) by smtp.gmail.com with ESMTPSA id s8sm2530400ljs.60.2020.03.27.03.15.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 03:15:52 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Cc: Oleksandr Suvorov , Marcel Ziswiler , Max Krummenacher , Philippe Schenker , Tom Warren , Igor Opaniuk Subject: [PATCH v3 1/4] apalis-tk1: add update_uboot wrapper Date: Fri, 27 Mar 2020 12:15:45 +0200 Message-Id: <20200327101548.8500-2-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327101548.8500-1-igor.opaniuk@gmail.com> References: <20200327101548.8500-1-igor.opaniuk@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 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 Reviewed-by: Oleksandr Suvorov --- 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 Fri Mar 27 10:15:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1262691 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=rBqQ9wrC; 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 48pd772sVGz9sSH for ; Fri, 27 Mar 2020 21:16:35 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 69CBF818A2; Fri, 27 Mar 2020 11:16:18 +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=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rBqQ9wrC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2246681869; Fri, 27 Mar 2020 11:15:59 +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=-2.0 required=5.0 tests=BAYES_00,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-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) (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 3968381869 for ; Fri, 27 Mar 2020 11:15:55 +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-lj1-x242.google.com with SMTP id n17so9585139lji.8 for ; Fri, 27 Mar 2020 03:15:55 -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:in-reply-to:references; bh=cjNfx8LWmJ2fCiUVDA6zdLSjt1wr+ybUkTS817GXsH8=; b=rBqQ9wrCeMLd9+KolGt4nxttONTmcpItklfa+dt8J6f+89glZpkZ+gwz1zbXutrxcs 1i7E6+gn7ulJFdV6DlHCoVOrX82yFFlA7SSOYae8TKjgz8Gi9KdZ5Dvlu21HTJVD49pG SOBYyL543lYbruKT1WRcPoGbpHLVcylRKYS/dtEauLiPJt9BkWM/vm8pJIT7wMRPrUbU 7EAIr1sz8AHKkFrzGKYABXXd/VEze4JUrsBrk087JK5wOVat49Bb2pUu9vO5opNViBSN 3T55TGGTl+Tb9lXLBAE6U6n5E92y4VUhz7YKjSQXK+NKnQouu2qc4HPOl/KfvOWhtl9y 46Cg== 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=PhSfarpU+pkXIYoD8KNBQnf/VPpmcTCOjof7M263OMbHshWxxl5GmeXcbKL8ws4eh7 dv3/fosiXz8sEiVoF43tXY5db46pD4j7kIMEXwh8/kqk5NKqe7nMss/UkxKdW8Znk2j3 doS+B/x7OL50OJqZx5fqZEusaMEuKGadZ7hyjgVA3R5ctaqXw0jwZjEA6KcF+Sy+5zEZ Y09LtBdfCjtqglvOg/Su3bH1xW2WLqV6/diGDomtBmg5ylpaOVAUMssdXZh/7OfBhovQ hM6p9zw7Fpt1U5NufHgbGnU574EswNDrkOcYilTgCpmdgHKDP/1ee9WP1eeZR+QLg8n+ WPPA== X-Gm-Message-State: AGi0PuY7JRVGGd11PH+KFurQh2/3gA2fbWAfydAulim5NXSWw5ZfHMem ws2ufzJo/Ew0Kndbz2ziKsQB4kxxkrc= X-Google-Smtp-Source: APiQypL3Hfu4lilKPYgKMr3y+Cyjpst6aApKKrNHhZe/hpLrNur5mWLFbPYtzGo7O+EMI2pKG9tS+w== X-Received: by 2002:a2e:9ed6:: with SMTP id h22mr8359366ljk.211.1585304154241; Fri, 27 Mar 2020 03:15:54 -0700 (PDT) Received: from localhost (host-176-37-176-139.la.net.ua. [176.37.176.139]) by smtp.gmail.com with ESMTPSA id y26sm1252253lfl.95.2020.03.27.03.15.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 03:15:53 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Cc: Oleksandr Suvorov , Marcel Ziswiler , Max Krummenacher , Philippe Schenker , Tom Warren , Igor Opaniuk Subject: [PATCH v3 2/4] apalis_t30: add update_uboot wrapper Date: Fri, 27 Mar 2020 12:15:46 +0200 Message-Id: <20200327101548.8500-3-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327101548.8500-1-igor.opaniuk@gmail.com> References: <20200327101548.8500-1-igor.opaniuk@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 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 Reviewed-by: Oleksandr Suvorov --- 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 Fri Mar 27 10:15:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1262692 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=J/9ktw6f; 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 48pd7K6Fwvz9sSH for ; Fri, 27 Mar 2020 21:16:45 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 085B5818B9; Fri, 27 Mar 2020 11:16: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=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J/9ktw6f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44EB1818A4; Fri, 27 Mar 2020 11:16:03 +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=-2.0 required=5.0 tests=BAYES_00,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-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) (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 D13D981850 for ; Fri, 27 Mar 2020 11:15:56 +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-lf1-x141.google.com with SMTP id h6so1602482lfp.6 for ; Fri, 27 Mar 2020 03:15:56 -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:in-reply-to:references; bh=UlQmvkRP1/T21kLqJZSRxD2vMHvzJsnh7/qgBjfiZ9s=; b=J/9ktw6fufRZzoW020Df+Daz94Xn7k288V9fRMHY+Hlk9R0jZdqO5g5i5VzCDeSzz3 rC9TDWuBNCjCWFGNyDA/SLxVhBZ4S5t8iYR2735TVb+TMUPqbDJR5e5uQ+SI6BOG4UUB 7dPNywBaB6rSTY2thazKeHeyF/BSTbXK2WZWMcyqj8er5kn9PScZl89dh5FrZfO84ZfI +gln6tKKe775FJEJHHPsDUJBkTg09WpmKViH+d1NV2nhaTMj5+kd5wKSYbVJStYO+sfC 6s0tDjMGqR5sl+w01S9luGNZZCH7TNQb82Xb68euptEGm+dVwiGofdyhL2pr2EyYUo0I 02sw== 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=SnJgnv5couJcAU0L9d9yY7VAvZQbUZ7dPfeo83JPZRTtqN6zQR167pFOsXPzz92WEj 0qKEmTCzw3YG/JJB2sQDxnehu+Y5cRzGVCPwyM9ELrOA2JOeBm25XeXy0Kbzyq3nyt7W lwc9LGI3B2FCXnVKe+jyIYHSNb5c66rHxoN1ELxW++HWrY6c6ueL5jnc0YftrXDRG1D2 iOGJbKqxw0cj6wSwP1sYMLj4slQKyQw/6acuweRaGKBeNx31y2MV7lwl3ST4zbK5jybo MgEizbrPvk7OCwRlAnTPpa27KzfPNtqh1a+CepqWNU/+ioxhCEf3XxMztHsj7DpcmDqt JIjQ== X-Gm-Message-State: AGi0Pubcsb3tKKA5a6Rb1NunnozYgB0veqWYVGm74XGcPhmZV/EUTUvM BcJFihcRFa+n5L215F6H/1OJaFaKMuU= X-Google-Smtp-Source: APiQypJ3aul/z4qP7FaEWVFp8wml5N4UQZHV5BkZf9kVosdCIrNakWwP9rylaG2px2PaIAwMfiqE7w== X-Received: by 2002:ac2:4c89:: with SMTP id d9mr1362179lfl.96.1585304155787; Fri, 27 Mar 2020 03:15:55 -0700 (PDT) Received: from localhost (host-176-37-176-139.la.net.ua. [176.37.176.139]) by smtp.gmail.com with ESMTPSA id u30sm2801840lfn.2.2020.03.27.03.15.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 03:15:55 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Cc: Oleksandr Suvorov , Marcel Ziswiler , Max Krummenacher , Philippe Schenker , Tom Warren , Igor Opaniuk , Lucas Stach Subject: [PATCH v3 3/4] colibri_t20: add update_uboot wrapper Date: Fri, 27 Mar 2020 12:15:47 +0200 Message-Id: <20200327101548.8500-4-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327101548.8500-1-igor.opaniuk@gmail.com> References: <20200327101548.8500-1-igor.opaniuk@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 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 Reviewed-by: Oleksandr Suvorov --- 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 Fri Mar 27 10:15:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1262693 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=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MdlJBO6j; 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 48pd7Z0hr5z9sSH for ; Fri, 27 Mar 2020 21:16:58 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 27957818C2; Fri, 27 Mar 2020 11:16:30 +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=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MdlJBO6j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5DE1D81836; Fri, 27 Mar 2020 11:16:04 +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=-2.0 required=5.0 tests=BAYES_00,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-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) (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 3496B81836 for ; Fri, 27 Mar 2020 11:15:58 +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-lf1-x144.google.com with SMTP id s1so7358479lfd.3 for ; Fri, 27 Mar 2020 03:15:58 -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:in-reply-to:references; bh=+gZUC4fztCXz5faeK0YgwxQNp+0nSkAA2RwkRrW1ur8=; b=MdlJBO6jAJ+G5udTwZWHYXqoxXttJSo+nnTa1ebM1Ue1vJUjHlFzA91bzUTMtBe7Um 6E1l1jFRoMbihMOQZOwWCJZB+9WmDaIMThjGhBJyadArZoOBpdIGfh+1X8uUMCMXhGh2 aXIpkyU/2RQNB1LOlWIhK94HUj6xy9V0MQc78wqkXtzDgfrUDwZz5CA2IefXn6hgNelS jSAFm9JZrqvxNUdNZBki8t7ndFR7IFnMCC61vZYX8FQVwpkZhDr5SXdPnVATjLVANhZ3 c96yvkpiDqaAdAugG5Qrb1K8GTmoHUW9lDZXtoG6E5BHG6UYRzbugYcRM1GVigYoVXrP K44g== 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=np4EPpLs2xUPXP50A0ZWwQ1pgqS+o+cZXQZQiRL36fG25agOVc1YGgpI9IPtrjSHZ/ JHW6ymBmRXje3N9Drg8nUPHFeC4jQyw8jr645Mwfec/Tj+N7VwiZZjnGzec9v0jG7IXs KSSDJT1sMwEno+YlpZR6s+vwpoXPtyTZCjAcFOIbQUmmt2QLVbD/Su69nDDzqcxHtEVO ai35xGEInFmHYurE6RXXZa65yOTOtp/EHrUjEtfH4YCq7ZFpVt/rqYMYIS3FzL/nG7RP eyj/qx+jpxX5xD8dK90bYUg3UfWv0ijMiRPD4WeNnMiK5WrpE0EOTdU9IPHHwDT243Ia 5Rfg== X-Gm-Message-State: ANhLgQ1rlT44ePn8eWy3TITS9jz6cP6SrSavofnw3vO5I8Ky0fJoY9w6 8Q4Kw0IXGLjaeRmx9VzqZIS6EnFboeM= X-Google-Smtp-Source: ADFU+vunjH+t4s5OBKpY4hHWSSCwoqXqKAX9LaZd0zrgNNhdyd5HvabG2TbS1utZHRZj9zBJeGssLA== X-Received: by 2002:a05:6512:308e:: with SMTP id z14mr8856240lfd.110.1585304157208; Fri, 27 Mar 2020 03:15:57 -0700 (PDT) Received: from localhost (host-176-37-176-139.la.net.ua. [176.37.176.139]) by smtp.gmail.com with ESMTPSA id x17sm2504893ljc.33.2020.03.27.03.15.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 03:15:56 -0700 (PDT) From: Igor Opaniuk To: u-boot@lists.denx.de Cc: Oleksandr Suvorov , Marcel Ziswiler , Max Krummenacher , Philippe Schenker , Tom Warren , Igor Opaniuk Subject: [PATCH v3 4/4] colibri_t30: add update_uboot wrapper Date: Fri, 27 Mar 2020 12:15:48 +0200 Message-Id: <20200327101548.8500-5-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200327101548.8500-1-igor.opaniuk@gmail.com> References: <20200327101548.8500-1-igor.opaniuk@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 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 Reviewed-by: Oleksandr Suvorov --- 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"