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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8D2E3C6FD18 for ; Tue, 18 Apr 2023 16:50:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CB1DE86175; Tue, 18 Apr 2023 18:47:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="UOBhDwNj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3CB33860D6; Tue, 18 Apr 2023 18:46:49 +0200 (CEST) Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) (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 C637F86151 for ; Tue, 18 Apr 2023 18:46:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=+KZy679u17KH9z52Nq8lhzgXI5BKNqosX/kxKarRgJU=; b=UOBhDwNjRT+UD3S+ScA/o/TKnP4NshN4H+vugaZ+8f9QT0BHawm8nofYavQBa0tzPcei NoFVHtxtRONDAT9dhd3nHG06Pq+OT/+HahyfEaDOtyyknUYBM61Phm4MyIqT7xr1DZSZSf kHcq6dNJsVQT4dFxZz/qmCaiHdymn1qum3PDDabhQzbFIKijW2cGEF0YQT8sdfO/Hx+gQF lT+Qip6+5jkuzxp5hPhrIchRFvO54nRcoVy+08a2yCPPE2nyaIumDFRRSGsvfniF93I6ec pL4YxonDq+GD2Tfq4jzPDRg2I8xrl/PvLiZzWKXrl2KVtcTp5UkfRnu7iVagmUCA== Received: by filterdrecv-59cb65cf6d-cxhgz with SMTP id filterdrecv-59cb65cf6d-cxhgz-1-643EC975-12 2023-04-18 16:46:45.282791189 +0000 UTC m=+4814088.345387297 Received: from bionic.localdomain (unknown) by geopod-ismtpd-4 (SG) with ESMTP id KxX2EEsKT2KBYC5UXfcE1w Tue, 18 Apr 2023 16:46:45.059 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 17/17] mmc: rockchip_sdhci: Limit number of blocks read in a single command Date: Tue, 18 Apr 2023 16:46:45 +0000 (UTC) Message-Id: <20230418164618.2571309-18-jonas@kwiboo.se> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230418164618.2571309-1-jonas@kwiboo.se> References: <20230418164618.2571309-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h4ziPjt6oNkIZXviX?= =?us-ascii?Q?iJ1SvfMxfmxt2Rpma4C0DCcpz2NrGb73Ffjp90Y?= =?us-ascii?Q?Aqwq9oj0Gb=2F8Ndtsk0UfibSVmjpLSU7=2FYuEYT44?= =?us-ascii?Q?S0HdHb5YSBg31CRVnlJkefpLq0tC+FOP4Odvw6K?= =?us-ascii?Q?jUoV3Ymjd6EJUvGm6i7aDhrpG4d9IvAq33uV2L?= To: Kever Yang , Simon Glass , Philipp Tomsich , Eugen Hristev , Peng Fan , Jaehoon Chung Cc: u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii 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 Using DMA to load TF-A into SRAM fails when booting from eMMC on RK3588. ## Checking hash(es) for Image atf-3 ... sha256 error! Bad hash value for 'hash' hash node in 'atf-3' image node spl_load_simple_fit: can't load image loadables index 2 (ret = -1) mmc_load_image_raw_sector: mmc block read error Fix this by using PIO mode in SPL and limit the number of blocks used in a single read command to avoid triggering Data End Bit Error interrupt. Signed-off-by: Jonas Karlman --- v2: - No change configs/rock5b-rk3588_defconfig | 1 + drivers/mmc/rockchip_sdhci.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/configs/rock5b-rk3588_defconfig b/configs/rock5b-rk3588_defconfig index 3fcc6a26bb51..d3136ac850fe 100644 --- a/configs/rock5b-rk3588_defconfig +++ b/configs/rock5b-rk3588_defconfig @@ -58,6 +58,7 @@ CONFIG_MMC_DW=y CONFIG_MMC_DW_ROCKCHIP=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_SDMA=y +# CONFIG_SPL_MMC_SDHCI_SDMA is not set CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_ETH_DESIGNWARE=y CONFIG_GMAC_ROCKCHIP=y diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index 2857dcc9ec4f..4f110976f4e8 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -589,6 +589,14 @@ static int rockchip_sdhci_probe(struct udevice *dev) if (ret) return ret; + /* + * Reading more than 4 blocks with a single CMD18 command in PIO mode + * triggers Data End Bit Error on RK3568 and RK3588. Limit to reading + * max 4 blocks in one command when using PIO mode. + */ + if (!(host->flags & USE_DMA)) + cfg->b_max = 4; + return sdhci_probe(dev); } -- 2.40.0