From patchwork Fri Aug 9 16:53:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1971034 X-Patchwork-Delegate: festevam@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=i7bSHXvL; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=vtpv7yvd; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WgVPD42Dsz1ybT for ; Sat, 10 Aug 2024 02:54:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E634C88A2F; Fri, 9 Aug 2024 18:54:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=1723222440; bh=AoUHAZNlelI3OaShFU7g54jCVgO6ZqC8gwOqiNAzx1A=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=i7bSHXvLDmkJi0VRFpXk/u7F/Fu7fWqX9BvYTrBZMcoePNMo8ahjYrvaX8rjY6k/N EA5AcR+JavYGVAINejWnHpEEpnzTvkYPAueEAK1PY8AJOsnlNrE/GeeMLCrpfhK7nb iTCzGPl8lGIKKI1TSl05O7mXofYMTNnwo8+cbXWF9lcurfJ4Nfpl1wa4X+h+P9Tw/H 9rg8cxYTTIGvhfua5k50ETyKN6pgJwLBFLTY92011zdtvWKfzdglnhRe7yD4368bDi WZoDyL8JZttwYKPN+TI1xlNLMgI92KGWUHetyCsP4GEAIOkJlnHeVxny+u0rgAJr24 Uvrg+KL/Gpuzw== Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 0426B886FD; Fri, 9 Aug 2024 18:53:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1723222439; bh=AoUHAZNlelI3OaShFU7g54jCVgO6ZqC8gwOqiNAzx1A=; h=From:To:Cc:Subject:Date:From; b=vtpv7yvd1UsNAtgtYwN4m1AizYQRSiO8cpQ80nBoVx2GcGSaNHx4Bm18poZIGHnEQ MInxGyYp77etLCR5D4PKdKyf3sVeqYQLV95iEOtro5eie6gH8Um/vbo2lKYRQsXtcw T4LQI+Sv8kEMm/6Q3NxnlcAShAUIdBJ/B+oJqN8Jx2Sl6rxw3WCOmkApVyCrhyTNQI RPgVlzUk7FGgNctm0C2KXPnvQJy0zvIl6dHW3ZQPhOh3gIh8wE4TRl+8aFHhC3plbb S+6kwhKr/rwKdA6T0O3WwuPHm2we+LMuJO6Z4hnP5MF62H+eypWDlJidDXfqiUSbP9 gmDh37Rdp9Q3Q== From: Lukasz Majewski To: Teresa Remmet , u-boot@lists.denx.de Cc: Tom Rini , Benjamin Hahn , Cem Tenruh , Martyn Welch , Simon Glass , Fabio Estevam , Lukasz Majewski Subject: [PATCH v4] config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm Date: Fri, 9 Aug 2024 18:53:32 +0200 Message-Id: <20240809165332.1898756-1-lukma@denx.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean This command allows easy update on SD card or eMMC of the flash.bin generated (with binman) during u-boot build. Signed-off-by: Lukasz Majewski Reviewed-by: Benjamin Hahn Tested-by: Teresa Remmet Reviewed-by: Fabio Estevam --- Changes for v2: - Remove 'update_mmc_part' variable - Change path for hostname - Use full version of dhcp command (${loadaddr} added) Changes for v3: - Remove +1 when calculating the size of binary to be written Changes for v4: - Replace ${hostname} with ${update_filepath} --- include/configs/phycore_imx8mm.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/configs/phycore_imx8mm.h b/include/configs/phycore_imx8mm.h index dd7cfdba52..0910ae2d87 100644 --- a/include/configs/phycore_imx8mm.h +++ b/include/configs/phycore_imx8mm.h @@ -29,6 +29,14 @@ "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ "mmcpart=1\0" \ "mmcroot=2\0" \ + "update_offset=0x42\0" \ + "update_filename=flash.bin\0" \ + "update_bootimg=" \ + "mmc dev ${mmcdev} ; " \ + "if dhcp ${loadaddr} ${update_filepath}/${update_filename} ; then " \ + "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ + "mmc write ${loadaddr} ${update_offset} ${fw_sz} ; " \ + "fi\0" \ "mmcautodetect=yes\0" \ "mmcargs=setenv bootargs console=${console} " \ "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \