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 02604C76188 for ; Mon, 3 Apr 2023 20:48:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 638CB85C6D; Mon, 3 Apr 2023 22:48:30 +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="Xm4LCfPu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C683E85C54; Mon, 3 Apr 2023 22:48:20 +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 8C34683623 for ; Mon, 3 Apr 2023 22:48:17 +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:mime-version:to:cc:content-transfer-encoding: content-type:cc:content-type:from:subject:to; s=s1; bh=Glu7BzVEqM0S0jFoj9/lHd+4prCt0cJi2vaM9VsQXZE=; b=Xm4LCfPuFRYyfW9XnbJfTGLSUHuoBuyc26MZ3DEwKWjLuepC9t/C/0TJEvKEPAuHT3J5 7GtiZi8GZ5CiJtA8UuaNoHD+jqLNGPLcsk5ROMP+NOB22zZcwLV9NxZuU/4lvzDfIpfyT1 BfvvrzV+jWcLCZRWUhz7fpu+SB39+5uvp2bOUaW7MKmkXgqnn8itq+eFjnfZVu4vMEG8oc fgzpRiewuJQFgdSeaG6qvcdE79+L2i/LDtXtrQCeXCRonJUHmkAoV4NeEeC7IxDXT2hQRY yW3OXWnFTk977FxF1iYn7PahRbbAU/PQIcdoEzI6sb+Vi1wr1hWOXBLWspaduxwg== Received: by filterdrecv-6c845fd887-s8vb9 with SMTP id filterdrecv-6c845fd887-s8vb9-1-642B3B8F-1C 2023-04-03 20:48:15.728260538 +0000 UTC m=+2346056.201127017 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id tWkmId3VR3mNdqfZflO0xQ Mon, 03 Apr 2023 20:48:15.359 +0000 (UTC) From: Jonas Karlman Subject: [PATCH 00/17] rockchip: eMMC fixes for RK3568 and support for RK3588 Date: Mon, 03 Apr 2023 20:48:15 +0000 (UTC) Message-Id: <20230403204812.2049612-1-jonas@kwiboo.se> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h4V3Pg=2FqpJz9zWB1x?= =?us-ascii?Q?+6LUWN=2FBRwIv8ycCKp4B3T3trAHeCcdzAQ9EVJ0?= =?us-ascii?Q?p1MTsEy16YTxFV3V91ZwLqyEC5K50OicyxNVxlh?= =?us-ascii?Q?o9b=2FMDdZmwYOwb8MVsuF3KwCXzLOStUqG3b6W1e?= =?us-ascii?Q?VR7wdeERmw5rAIwZFAIu0995=2FHjqzboi6=2FdvvI?= To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Eugen Hristev , 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 This series fixes eMMC HS400 modes on RK3568 and add support for RK3588. It has been tested with rock-3a-rk3568/rock5b-rk3588 defconfig and CONFIG_MMC_HS200_SUPPORT=y CONFIG_MMC_HS400_SUPPORT=y CONFIG_MMC_HS400_ES_SUPPORT=y CONFIG_MMC_SPEED_MODE_SET=y using the following command to switch mode and then read 512 MiB of data from eMMC into memory, => mmc dev 0 0 && mmc info && mmc read 10000000 2000 10000 for each of the modes below. 0 = MMC legacy 1 = MMC High Speed (26MHz) 3 = MMC High Speed (52MHz) 4 = MMC DDR52 (52MHz) 10 = HS200 (200MHz) 11 = HS400 (200MHz) 12 = HS400ES (200MHz) All reads have reported OK, prior to this some of these modes worked and others failed. Patch 1-2 fixes an issue with high-speed bit and uhs speed mode field. Patch 3-6 refactors the rk3568 driver to use set_clock and config_dll ops, so that clocks and regs are changed when output clock is disabled. Patch 7-10 continues refactoring and simplification of the driver. Patch 11-12 updates tap and delay values to fix HS400 modes on RK3568. Patch 13-15 adds support for RK3588 to driver and device tree. Patch 16-17 adds workarounds needed to use PIO mode in SPL to successfully load TF-A into SRAM when booting from eMMC on RK3588. Note that this series does not include any change to defconfigs to enable HS200/HS400/HS400ES modes. This series require working pinctrl, see [1]. A copy of this series and its dependencies can be found at [2]. [1] https://patchwork.ozlabs.org/project/uboot/patch/20230315153215.389809-1-eugen.hristev@collabora.com/ [2] https://github.com/Kwiboo/u-boot-rockchip/commits/rk35xx-emmc-v1 Jonas Karlman (16): mmc: sdhci: Fix HISPD bit handling for MMC HS 52MHz mode mmc: sdhci: Set UHS Mode Select field for UHS SDR25 mode mmc: rockchip_sdhci: Fix use of device private data mmc: rockchip_sdhci: Remove unneeded emmc_phy_init ops mmc: rockchip_sdhci: Add set_clock and config_dll sdhci_ops mmc: rockchip_sdhci: Use set_clock and config_dll sdhci_ops mmc: rockchip_sdhci: Refactor execute tuning error handling mmc: rockchip_sdhci: Update speed mode controls in set_ios_post mmc: rockchip_sdhci: Remove empty get_phy and set_enhanced_strobe ops mmc: rockchip_sdhci: Rearrange and simplify used regs and flags mmc: rockchip_sdhci: Fix HS400 and HS400ES mode on RK3568 rockchip: rk3568-rock-3a: Enable support for more eMMC modes mmc: rockchip_sdhci: Add support for RK3588 rockchip: rk3588-rock-5b: Include eMMC node in SPL dtb clk: rockchip: rk3588: Add limited TMCLK_EMMC clock support mmc: rockchip_sdhci: Limit number of blocks read in a single command Peter Geis (1): mmc: sdhci: Allow disabling of SDMA in SPL arch/arm/dts/rk3568-rock-3a-u-boot.dtsi | 8 + arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 12 +- arch/arm/dts/rk3588s-u-boot.dtsi | 4 + configs/rock5b-rk3588_defconfig | 1 + drivers/clk/rockchip/clk_rk3588.c | 2 + drivers/mmc/Kconfig | 8 + drivers/mmc/rockchip_sdhci.c | 314 ++++++++++++++---------- drivers/mmc/sdhci.c | 13 +- 8 files changed, 221 insertions(+), 141 deletions(-) -- 2.40.0