Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2021BC433EF for ; Sat, 13 Nov 2021 02:25:22 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80BA561057 for ; Sat, 13 Nov 2021 02:25:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 80BA561057 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 71050830B3; Sat, 13 Nov 2021 03:25:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1636770319; bh=YQz30Oc7JbL0xZN31CLv9jduN+Uk8CpIXzgRphIhvck=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=b7W9nj1CYEj+hXcVFxb2Gksxu39ecxj3sWZHbYdFOKufaIwJEmGVjljWNFuzMd9Hn 24duS6jDAyQ6PCGxJvRmPz9zNQPgawAijSYmj4JKeNx3UKytdvreFXoKZhThU8mLzL kF1BQ0zxvpmXOp9BMsoP/QRtqzsYnOa6s1r1RuvWuaO2JXVPMK1B7ceqdiEzcKeqMb hCtSE7dbxxq3stpzENEONzipUHE8c3fHK8KZ3p98m6gF9mSZVymFeydWMaUlcVhJwt yDWH+WUx8pnRzWEs950vrZ5ljXw+LsCeJN9H+HiyZ3hQiNphr+n0z1gWSB+Vantqyl aiz3W7XPAvEsQ== Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 6AEAF830AF; Sat, 13 Nov 2021 03:25:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1636770317; bh=YQz30Oc7JbL0xZN31CLv9jduN+Uk8CpIXzgRphIhvck=; h=From:To:Cc:Subject:Date:From; b=YLXVz1F4JHoIpJA5p3/mmWUHttYB+6LtpYhl4XCDE0s6PPZQEXXuN81U2bwoCxzX3 NiGiGja8p86fE+0yFJXS160yQXDU4OAm2cvk8CKgsrTtorA6z5CS9cEvZ0rBMC834+ GKaUK6JrEMUAOru0BRtOmufbSBw9vrTD702+enKHmv0l79c6XUx2UBxG2GhQMkxsYf zFNDETznYc9BT+UP87hzjfuFkdalqhEcVWfsUBoUkJI/dA7agV4QRBJBjxLXvUbYKV jqiPEMLWbW/onCPSRZdMQhJitGbhrCxgkYARI4UneHUwnGhFQVuYvDywhcWlRCDAaZ C4DcueX56hv1A== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Patrice Chotard , Patrick Delaunay Subject: [PATCH] ARM: stm32: Add update_sf script to install U-Boot into SF on DHSOM Date: Sat, 13 Nov 2021 03:25:13 +0100 Message-Id: <20211113022513.231840-1-marex@denx.de> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 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.103.2 at phobos.denx.de X-Virus-Status: Clean Add script to read U-Boot from SD card and write it to matching locations in the SPI NOR, thus making the SPI NOR bootable. The script erases the entire SPI NOR, including U-Boot environment, to make sure the installation is clean. To retain environment from current running U-Boot, run 'saveenv' after running the 'update_sf' script. Signed-off-by: Marek Vasut Cc: Patrice Chotard Cc: Patrick Delaunay --- include/configs/stm32mp15_dh_dhsom.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/configs/stm32mp15_dh_dhsom.h b/include/configs/stm32mp15_dh_dhsom.h index bac9e8388a7..b68e153f10b 100644 --- a/include/configs/stm32mp15_dh_dhsom.h +++ b/include/configs/stm32mp15_dh_dhsom.h @@ -9,7 +9,17 @@ #define __CONFIG_STM32MP15_DH_DHSOM_H__ #define STM32MP_BOARD_EXTRA_ENV \ - "usb_pgood_delay=1000\0" + "usb_pgood_delay=1000\0" \ + "update_sf=" /* Erase SPI NOR and install U-Boot from SD */ \ + "setexpr loadaddr1 ${loadaddr} + 0x1000000 && " \ + "load mmc 0:4 ${loadaddr1} /boot/u-boot-spl.stm32 && " \ + "env set filesize1 ${filesize} && " \ + "load mmc 0:4 ${loadaddr} /boot/u-boot.itb && " \ + "sf probe && sf erase 0 0x200000 && " \ + "sf update ${loadaddr1} 0 ${filesize1} && " \ + "sf update ${loadaddr1} 0x40000 ${filesize1} && " \ + "sf update ${loadaddr} 0x80000 ${filesize} && " \ + "env set filesize1 && env set loadaddr1\0" #include -- 2.33.0