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 43F72C77B73 for ; Thu, 20 Apr 2023 10:05:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C52FF862F8; Thu, 20 Apr 2023 12:05:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=rock-chips.com 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 7B158862E9; Thu, 20 Apr 2023 12:05:02 +0200 (CEST) Received: from mail-m11880.qiye.163.com (mail-m11880.qiye.163.com [115.236.118.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6D01A86315 for ; Thu, 20 Apr 2023 12:04:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@rock-chips.com Received: from [172.16.12.93] (unknown [58.22.7.114]) by mail-m11880.qiye.163.com (Hmail) with ESMTPA id 7651320264; Thu, 20 Apr 2023 18:04:46 +0800 (CST) Message-ID: Date: Thu, 20 Apr 2023 18:04:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v2 17/17] mmc: rockchip_sdhci: Limit number of blocks read in a single command Content-Language: en-US To: Jonas Karlman , Simon Glass , Philipp Tomsich , Eugen Hristev , Peng Fan , Jaehoon Chung Cc: u-boot@lists.denx.de References: <20230418164618.2571309-1-jonas@kwiboo.se> <20230418164618.2571309-18-jonas@kwiboo.se> From: Kever Yang In-Reply-To: <20230418164618.2571309-18-jonas@kwiboo.se> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZGhlNGVYYSElNHxpMTE5NTkhVEwETFh oSFyQUDg9ZV1kYEgtZQVlOQ1VJSVVMVUpKT1lXWRYaDxIVHRRZQVlPS0hVSk5MSUpJVUpLS1VKQl kG X-HM-Tid: 0a879e1fa4b32eb6kusn7651320264 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Phw6SCo5Nj0cHhUoIxIDCQ0f LRMKCRRVSlVKTUNKQkNOS0NMS0xPVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlOQ1VJSVVMVUpKT1lXWQgBWUFITkhPNwY+ 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 On 2023/4/19 00:46, Jonas Karlman wrote: > 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 Reviewed-by: Kever Yang Thanks, - Kever > --- > 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); > } >