Skip to content

qcom: Enable HS200/HS400 eMMC modes on Qualcomm platforms - #129

Merged
Gopinath Sekar (g-sekar) merged 3 commits into
qualcomm-linux:qcom-nextfrom
aswinm94:hs400
Sep 2, 2026
Merged

qcom: Enable HS200/HS400 eMMC modes on Qualcomm platforms#129
Gopinath Sekar (g-sekar) merged 3 commits into
qualcomm-linux:qcom-nextfrom
aswinm94:hs400

Conversation

@aswinm94

Copy link
Copy Markdown

This PR adds HS200 and HS400 support for Qualcomm SDHCI controllers
by implementing the required DLL initialization, tuning, and calibration
sequences in the msm_sdhci driver.

Qualcomm SDHCI controllers were previously limited to High Speed and
DDR52 modes due to the lack of HS200 tuning and HS400 DLL calibration
support. This series enables higher-speed eMMC modes by adding the
required controller-specific programming sequences while preserving
support for the existing SDCC core variants.

In addition, the series fixes an issue in the handling of the
"max-frequency" device tree property and enables HS400 support in
Qualcomm defconfigs.

upstream-link: https://lore.kernel.org/u-boot/20260827073325.4113071-1-aswin.murugan@oss.qualcomm.com/

Comment thread drivers/mmc/msm_sdhci.c
Comment on lines +229 to +254
static int msm_dll_poll_ck_out_en(struct sdhci_host *host, u8 poll)
{
u32 wait_cnt = 50;
u8 ck_out_en;
struct udevice *dev = host->mmc->dev;
const struct msm_sdhc_variant_info *var_info =
(void *)dev_get_driver_data(dev);

ck_out_en = !!(readl(host->ioaddr + var_info->core_dll_config) &
CORE_CK_OUT_EN);

while (ck_out_en != poll) {
if (--wait_cnt == 0) {
printf("%s: CK_OUT_EN bit is not %d\n",
host->name, poll);
return -ETIMEDOUT;
}
udelay(1);

ck_out_en = !!(readl(host->ioaddr +
var_info->core_dll_config) &
CORE_CK_OUT_EN);
}

return 0;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_poll_timeout()???

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to read_poll_timeout()

Comment thread drivers/mmc/msm_sdhci.c Outdated
const struct msm_sdhc_variant_info *var_info =
(void *)dev_get_driver_data(dev);

while (!(readl(host->ioaddr + var_info->core_dll_status) &

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_poll_timeout()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to read_poll_timeout()

msm_sdc_clk_init() reads the "max-frequency" DT property into an
8-byte ulong using dev_read_u32(). On 64-bit builds, only the lower
4 bytes are written, leaving the upper 4 bytes uninitialized.

Use dev_read_u32_default() and assign the returned value to
clk_rate instead.

Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
The Qualcomm SDHCI driver lacked DLL init/calibration and tuning
support, so it never negotiated above high-speed/DDR52. Add the
CM_DLL init/phase-tuning sequence for HS200 and the SDC4 DLL
calibration for HS400, matching the SDCC core generation variants
already distinguished in this driver (core_minor-gated 14LPP/
Tassadar DLL reset paths).

Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
msm_sdhci now supports HS200/HS400 tuning and DLL calibration, but
CONFIG_MMC_HS400_SUPPORT was not enabled, so the mmc core never
negotiated HS400. Enable it in the shared qcom_defconfig so every
board built on top of it can use HS400 where the eMMC/host support
it.

Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
@g-sekar
Gopinath Sekar (g-sekar) merged commit 94cbcc2 into qualcomm-linux:qcom-next Sep 2, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants