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 C7201C6FD18 for ; Tue, 18 Apr 2023 16:46:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8DC49860EF; Tue, 18 Apr 2023 18:46:28 +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="kCQavvQo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8E955860EF; Tue, 18 Apr 2023 18:46:26 +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 ABE1D8584E for ; Tue, 18 Apr 2023 18:46:23 +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=K21QVB8BtYxfFjyXbZ0xizHgqCTX9zboBkXOo4W+m4k=; b=kCQavvQoCAncXEdGMDTAGraVIKkEJjE0Q+QmaBn2by+ubDZdICN8dycrmxM7cswWQneU L0gzYqZJe7ModvTtB6zze5KJtfkgjbM5iAHUB308vbp+KE1pY+8LWGsKh5j/WQ+Z9L1sbG B2DaGjoH/82jfObzhGYFPJvferzL0p0Fto9yftrkDrzImLvpyyrQ1wnJppb3izgUDJQxkD 0idskYxOH0IuSAFlSBcktWF/rz4AsiquA/H1xADlaSVf9EvfVT9pQnyrfeD0r1RcZX2aft kmuVkFbjsRk1CD/a3DDRhCDwLN8Crlxd9UwwHaHwwpU8ORKqWVRo0Bjiv9x7i0Bw== Received: by filterdrecv-5848969764-xx99g with SMTP id filterdrecv-5848969764-xx99g-1-643EC95D-31 2023-04-18 16:46:22.048432001 +0000 UTC m=+4814094.810115507 Received: from bionic.localdomain (unknown) by geopod-ismtpd-4 (SG) with ESMTP id 5LLDgfg_QiaSvXfvh6DggA Tue, 18 Apr 2023 16:46:21.728 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 00/17] rockchip: eMMC fixes for RK3568 and support for RK3588 Date: Tue, 18 Apr 2023 16:46:22 +0000 (UTC) Message-Id: <20230418164618.2571309-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+RrMu3cja6a0hyA9wS5KOXEzzJLyO?= =?us-ascii?Q?5Wlu3ZAQdqZt08dv2AHfghrVPQeWlfJyKIRkhdK?= =?us-ascii?Q?JL=2FH1TThs3Gw0e4Afz03gboCYdBXnTDZdDi5Hb+?= =?us-ascii?Q?I8HIA8NSz+VaCThiLFpdu9tWIsANAscCTJLxG8s?= =?us-ascii?Q?ZWWN5g=2FhTzEsv9mvXY4YdL5SP5Yt0uQQ4Up+fj?= To: Kever Yang , Simon Glass , Philipp Tomsich Cc: u-boot@lists.denx.de, Jonas Karlman , Eugen Hristev 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. Changes in v2: - Add Signed-off-by tag and update commit message with a note from where reg-values originates from - Rename quirks to flags - Use driver data for hs200/hs400 txclk tapnum values - Change u-boot,dm-spl to bootph-pre-ram 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-v2 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 | 309 +++++++++++++----------- drivers/mmc/sdhci.c | 13 +- 8 files changed, 215 insertions(+), 142 deletions(-) -- 2.40.0