[PW_SID:1155925] mmc: spacemit: improve clock and tuning logic - #2575
Open
linux-riscv-bot wants to merge 8 commits into
Open
[PW_SID:1155925] mmc: spacemit: improve clock and tuning logic#2575linux-riscv-bot wants to merge 8 commits into
linux-riscv-bot wants to merge 8 commits into
Conversation
No need to switch pinctrl state if the SDHCI controller only support 1.8v IO voltage which DT will only provide a "default" pinctrl state, otherwise function pinctrl_select_state() will trigger a NULL pointer error. Fixes: 00a97fc ("mmc: sdhci-of-k1: add regulator and pinctrl voltage switching support") Signed-off-by: Long Wan <long.wan@linux.spacemit.com> Signed-off-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
No need to set 1.8V Signal for non-SDIO hosts, it will duplicate what sdhci_start_signal_voltage_switch() already handled there. Fixes: e5502d1 ("mmc: sdhci-of-k1: add support for SpacemiT K1 SoC") Signed-off-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Apply PHY configuration only for eMMC hosts which enable PHY function mode, and configure drive strength and bias. While for SD/SDIO hosts mode, bypass the PHY mode and select TX internal clock instead. Fixes: f87b273 ("mmc: sdhci-of-k1: enable essential clock infrastructure for SD operation") Signed-off-by: Long Wan <long.wan@linux.spacemit.com> Signed-off-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The default sdhci_set_power() skips the SD bus voltage select field entirely when a vmmc regulator is present, leaving SD Bus Power in off state of the power control register. To fix this, configure the bus voltage explicitly. Fixes: e5502d1 ("mmc: sdhci-of-k1: add support for SpacemiT K1 SoC") Signed-off-by: Long Wan <long.wan@linux.spacemit.com> Signed-off-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Initialize the RX delay line to 0 (finest step size) instead of 9. This improves tuning precision by allowing smaller delay increments when searching for the optimal sampling point. Fixes: e9cb83c ("mmc: sdhci-of-k1: add comprehensive SDR tuning support") Signed-off-by: Long Wan <long.wan@linux.spacemit.com> Signed-off-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Raise the minimum delay codes of RX tuning window from 3 to 50, to more accurately retrieve a valid configuration. A window of 3 codes wide leaves no sampling margin, which will result tuning tests reporting success on a configuration that drifts out of the window under thermal or power variation. Fixes: e9cb83c ("mmc: sdhci-of-k1: add comprehensive SDR tuning support") Signed-off-by: Long Wan <long.wan@linux.spacemit.com> Signed-off-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
reset() permanently set OVRRD_CLK_OEN and FORCE_CLK_ON for SD/SDIO hosts and never cleared them, so the SD clock was forced on for the lifetime of the controller and hardware auto gating never took effect. These bits are only needed during the CMD11 1.8V voltage switch, where the clock has to keep running so DAT[3:0] can be sampled after the switch. Add a set_clk_gate() helper, force the clock on from set_clock() when CMD11 is in flight, and restore auto gating from card_busy() once the switch completes. card_busy() is registered for all card types since the CMD11 sequence is an SD/SDIO path and the DAT[0] level check is generic. Signed-off-by: Long Wan <long.wan@linux.spacemit.com> Signed-off-by: Yixun Lan <dlan@kernel.org> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
linux-riscv-bot
force-pushed
the
workflow__riscv__fixes
branch
from
September 2, 2026 20:29
9ed823f to
a54e736
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR for series 1155925 applied to workflow__riscv__fixes
Name: mmc: spacemit: improve clock and tuning logic
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1155925
Version: 1