]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mmc: sdhci-of-k1: add comprehensive SDR tuning support
authorIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 11 May 2026 08:53:59 +0000 (10:53 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 11 May 2026 15:35:47 +0000 (17:35 +0200)
commite9cb83c10071808aa7db4582e007a650aa6aa183
tree9f125c98615d393ac787ae1efb59bbcb701463b6
parent00a97fc57c09ff1cf71107753d9b5629caeb8c8a
mmc: sdhci-of-k1: add comprehensive SDR tuning support

Implement software tuning algorithm to enable UHS-I SDR modes for SD
card operation and HS200 mode for eMMC. This adds both TX and RX delay
line tuning based on the SpacemiT K1 controller capabilities.

Algorithm features:
- Add tuning register definitions (RX_CFG, DLINE_CTRL, DLINE_CFG)
- Conditional tuning: only for high-speed modes (≥100MHz)
- TX tuning: configure transmit delay line with optimal values
  (dline_reg=0, delaycode=127) to ensure optimal signal output timing
- RX tuning: single-pass window detection algorithm testing full
  delay range (0-255) to find optimal receive timing window
- Retry mechanism: multiple fallback delays within optimal window
  for improved reliability

Tested-by: Anand Moon <linux.amoon@gmail.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Trevor Gamblin <tgamblin@baylibre.com>
Tested-by: Vincent Legoll <legoll@online.fr>
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-of-k1.c