From patchwork Fri Jul 15 15:36:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1656963 X-Patchwork-Delegate: ykai007@gmail.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=) 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 (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LkwVT5s9Zz9s09 for ; Sat, 16 Jul 2022 01:38:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58E0A80FA1; Fri, 15 Jul 2022 17:37:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 5282281F69; Fri, 15 Jul 2022 17:37:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 45B5B82A56 for ; Fri, 15 Jul 2022 17:37:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=foss+uboot@0leil.net Received: (Authenticated sender: foss@0leil.net) by mail.gandi.net (Postfix) with ESMTPSA id 93D361C0003; Fri, 15 Jul 2022 15:37:25 +0000 (UTC) From: Quentin Schulz To: Cc: bharat.gooty@broadcom.com, rayagonda.kokatanur@broadcom.com, sjg@chromium.org, philipp.tomsich@vrull.eu, kever.yang@rock-chips.com, jagan@amarulasolutions.com, xypron.glpk@gmx.de, pali@kernel.org, jbx6244@gmail.com, hanetzer@startmail.com, knaerzche@gmail.com, vagrant@debian.org, heiko.thiery@gmail.com, u-boot@lists.denx.de, Quentin Schulz , Quentin Schulz Subject: [RFC PATCH 4/8] rockchip: pad u-boot-rockchip.bin correctly Date: Fri, 15 Jul 2022 17:36:51 +0200 Message-Id: <20220715153655.955874-5-foss+uboot@0leil.net> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220715153655.955874-1-foss+uboot@0leil.net> References: <20220715153655.955874-1-foss+uboot@0leil.net> 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.6 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz On MMC storage media, the TPL/SPL needs to be flashed at offset 32KB. Instead of requesting the user to put the input the appropriate offsets, let's create u-boot-rockchip.bin with the padding already added. Cc: Quentin Schulz Signed-off-by: Quentin Schulz --- arch/arm/dts/rockchip-u-boot.dtsi | 3 ++- doc/board/rockchip/rockchip.rst | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi index fc28ce5187..4cd243514e 100644 --- a/arch/arm/dts/rockchip-u-boot.dtsi +++ b/arch/arm/dts/rockchip-u-boot.dtsi @@ -18,6 +18,7 @@ pad-byte = <0xff>; mkimage { + offset = <(32 * 1024)>; /* 32KB */ args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; #ifndef CONFIG_TPL u-boot-spl { @@ -38,7 +39,7 @@ #else u-boot-img { #endif - offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>; + offset = <(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)>; }; }; }; diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst index 4ca7b00b1f..1995882244 100644 --- a/doc/board/rockchip/rockchip.rst +++ b/doc/board/rockchip/rockchip.rst @@ -179,7 +179,7 @@ To write an image that boots from a SD card (assumed to be /dev/sda): .. code-block:: bash - sudo dd if=u-boot-rockchip.bin of=/dev/sda seek=64 + sudo dd if=u-boot-rockchip.bin of=/dev/sda sync eMMC