* [PATCH v4 0/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC
@ 2025-09-29 11:35 Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes Ram Prakash Gupta
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-09-29 11:35 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_rampraka, quic_pragalla, quic_sayalil,
quic_nitirawa, quic_bhaskarv, kernel, Ram Prakash Gupta
From: Ram Prakash Gupta <rampraka@qti.qualcomm.com>
With the current DLL sequence stability issues are seen in
HS400 and HS200 mode for data transfers.
Rectify the DLL programming sequence as per latest hardware
programming guide and also incorporate support for HS200 and
HS400 DLL settings using the device tree.
Changes from v3:
1. Addressed Dmitry Baryshkov comments:
a. Regarding clk division by in V2 patchset
2. Addressed Konrad Dybcio comments:
a. Renaming of parameters
b. Memory allocation
c. couldn't address __free, as didn't fit here
3. Addressed Krzysztof Kozlowsk comment:
a. Regarding the dt binding
b. commit message to reflect the need of dt
4. Additional change:
a. DT parsing logic
b. Maintain backward compatibility
Changes from v2:
1. Addressed Dmitry Baryshkov comments:
a. Regarding TCXO frequency.
b. Regarding clock rate.
c. regarding checkpatch.
Changes from v1:
1. Addressed Tengfei Fan comment, added missing semicolocon
in sdhci_msm_host structure.
Sachin Gupta (4):
dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes
mmc: sdhci-msm: Add core_major, minor to msm_host structure
mmc: sdhci-msm: Add Device tree parsing logic for DLL settings
mmc: sdhci-msm: Rectify DLL programming sequence for SDCC
.../devicetree/bindings/mmc/sdhci-msm.yaml | 5 +
drivers/mmc/host/sdhci-msm.c | 368 +++++++++++++++++-
2 files changed, 354 insertions(+), 19 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes
2025-09-29 11:35 [PATCH v4 0/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
@ 2025-09-29 11:35 ` Ram Prakash Gupta
2025-10-06 21:48 ` Rob Herring
2025-09-29 11:35 ` [PATCH v4 2/4] mmc: sdhci-msm: Add core_major, minor to msm_host structure Ram Prakash Gupta
` (2 subsequent siblings)
3 siblings, 1 reply; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-09-29 11:35 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_rampraka, quic_pragalla, quic_sayalil,
quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
From: Sachin Gupta <quic_sachgupt@quicinc.com>
Document the 'dll-hsr-list' property for MMC device tree bindings.
The 'dll-hsr-list' property defines the DLL configurations for HS400
and HS200 modes.
QC SoCs can have 0 to 4 SDHCI instances, and each one may need
different tuning.
Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
---
Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
index 22d1f50c3fd1..a60222473990 100644
--- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
+++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
@@ -137,6 +137,11 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint32
description: platform specific settings for DLL_CONFIG reg.
+ qcom,dll-hsr-list:
+ maxItems: 10
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ description: platform specific settings for DLL registers.
+
iommus:
minItems: 1
maxItems: 8
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 2/4] mmc: sdhci-msm: Add core_major, minor to msm_host structure
2025-09-29 11:35 [PATCH v4 0/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes Ram Prakash Gupta
@ 2025-09-29 11:35 ` Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
3 siblings, 0 replies; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-09-29 11:35 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_rampraka, quic_pragalla, quic_sayalil,
quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
From: Sachin Gupta <quic_sachgupt@quicinc.com>
Add the core_major and core_minor variables to
the msm_host structure, allowing these variables to be
accessed more easily throughout the msm_host context.
This update is necessary for an upcoming follow-up patch.
Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
---
drivers/mmc/host/sdhci-msm.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 9d8e20dc8ca1..36700735aa3e 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -282,6 +282,8 @@ struct sdhci_msm_host {
bool tuning_done;
bool calibration_done;
u8 saved_tuning_phase;
+ u8 core_major;
+ u16 core_minor;
bool use_cdclp533;
u32 curr_pwr_state;
u32 curr_io_level;
@@ -2673,6 +2675,10 @@ static int sdhci_msm_probe(struct platform_device *pdev)
core_major = (core_version & CORE_VERSION_MAJOR_MASK) >>
CORE_VERSION_MAJOR_SHIFT;
core_minor = core_version & CORE_VERSION_MINOR_MASK;
+
+ msm_host->core_major = core_major;
+ msm_host->core_minor = core_minor;
+
dev_dbg(&pdev->dev, "MCI Version: 0x%08x, major: 0x%04x, minor: 0x%02x\n",
core_version, core_major, core_minor);
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings
2025-09-29 11:35 [PATCH v4 0/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 2/4] mmc: sdhci-msm: Add core_major, minor to msm_host structure Ram Prakash Gupta
@ 2025-09-29 11:35 ` Ram Prakash Gupta
2025-09-29 16:12 ` Adrian Hunter
2025-10-06 21:44 ` Rob Herring
2025-09-29 11:35 ` [PATCH v4 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
3 siblings, 2 replies; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-09-29 11:35 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_rampraka, quic_pragalla, quic_sayalil,
quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
From: Sachin Gupta <quic_sachgupt@quicinc.com>
This update introduces the capability to configure HS200
and HS400 DLL settings via the device tree and parsing it.
Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
---
drivers/mmc/host/sdhci-msm.c | 91 ++++++++++++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 36700735aa3e..d07f0105b733 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -265,6 +265,19 @@ struct sdhci_msm_variant_info {
const struct sdhci_msm_offset *offset;
};
+/*
+ * DLL registers which needs be programmed with HSR settings.
+ * Add any new register only at the end and don't change the
+ * sequence.
+ */
+struct sdhci_msm_dll {
+ u32 dll_config[2];
+ u32 dll_config_2[2];
+ u32 dll_config_3[2];
+ u32 dll_usr_ctl[2];
+ u32 ddr_config[2];
+};
+
struct sdhci_msm_host {
struct platform_device *pdev;
void __iomem *core_mem; /* MSM SDCC mapped address */
@@ -273,6 +286,7 @@ struct sdhci_msm_host {
struct clk *xo_clk; /* TCXO clk needed for FLL feature of cm_dll*/
/* core, iface, cal and sleep clocks */
struct clk_bulk_data bulk_clks[4];
+ struct sdhci_msm_dll dll;
#ifdef CONFIG_MMC_CRYPTO
struct qcom_ice *ice;
#endif
@@ -301,6 +315,7 @@ struct sdhci_msm_host {
u32 dll_config;
u32 ddr_config;
bool vqmmc_enabled;
+ bool artanis_dll;
};
static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
@@ -2516,6 +2531,73 @@ static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host)
return ret;
}
+static int sdhci_msm_dt_get_array(struct device *dev, const char *prop_name,
+ u32 **dll_table, int *len)
+{
+ struct device_node *np = dev->of_node;
+ u32 *arr = NULL;
+ int ret = 0, sz = 0;
+
+ if (!np)
+ return -ENODEV;
+ if (!of_get_property(np, prop_name, &sz))
+ return -EINVAL;
+
+ sz = sz / sizeof(*arr);
+ if (sz <= 0)
+ return -EINVAL;
+
+ arr = kcalloc(sz, sizeof(*arr), GFP_KERNEL);
+ if (!arr)
+ return -ENOMEM;
+
+ ret = of_property_read_u32_array(np, prop_name, arr, sz);
+ if (ret) {
+ dev_err(dev, "%s failed reading array %d\n", prop_name, ret);
+ *len = 0;
+ return ret;
+ }
+
+ *dll_table = arr;
+ *len = sz;
+
+ return ret;
+}
+
+static int sdhci_msm_dt_parse_dll_info(struct device *dev, struct sdhci_msm_host *msm_host)
+{
+ int dll_table_len, dll_reg_count;
+ u32 *dll_table = NULL;
+ int i, j;
+
+ msm_host->artanis_dll = false;
+
+ if (sdhci_msm_dt_get_array(dev, "qcom,dll-hsr-list",
+ &dll_table, &dll_table_len))
+ return -EINVAL;
+
+ dll_reg_count = sizeof(struct sdhci_msm_dll) / sizeof(u32);
+
+ if (dll_table_len != dll_reg_count) {
+ dev_err(dev, "Number of HSR entries are not matching\n");
+ return -EINVAL;
+ }
+
+ for (i = 0, j = 0; j < 2; i = i + 5, j++) {
+ msm_host->dll.dll_config[j] = dll_table[i];
+ msm_host->dll.dll_config_2[j] = dll_table[i + 1];
+ msm_host->dll.dll_config_3[j] = dll_table[i + 2];
+ msm_host->dll.dll_usr_ctl[j] = dll_table[i + 3];
+ msm_host->dll.ddr_config[j] = dll_table[i + 4];
+ }
+
+ msm_host->artanis_dll = true;
+
+ kfree(dll_table);
+
+ return 0;
+}
+
static int sdhci_msm_probe(struct platform_device *pdev)
{
struct sdhci_host *host;
@@ -2562,6 +2644,15 @@ static int sdhci_msm_probe(struct platform_device *pdev)
msm_host->saved_tuning_phase = INVALID_TUNING_PHASE;
+ /*
+ * Parse HSR dll only when property is present in DT.
+ */
+ if (of_find_property(node, "qcom,dll-hsr-list", NULL)) {
+ ret = sdhci_msm_dt_parse_dll_info(&pdev->dev, msm_host);
+ if (ret)
+ return ret;
+ }
+
ret = sdhci_msm_gcc_reset(&pdev->dev, host);
if (ret)
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC
2025-09-29 11:35 [PATCH v4 0/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
` (2 preceding siblings ...)
2025-09-29 11:35 ` [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings Ram Prakash Gupta
@ 2025-09-29 11:35 ` Ram Prakash Gupta
2025-10-02 15:13 ` kernel test robot
3 siblings, 1 reply; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-09-29 11:35 UTC (permalink / raw)
To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Adrian Hunter, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_rampraka, quic_pragalla, quic_sayalil,
quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
From: Sachin Gupta <quic_sachgupt@quicinc.com>
With the current DLL sequence stability issues for data
transfer seen in HS400 and HS200 modes.
"mmc0: cqhci: error IRQ status: 0x00000000 cmd error -84
data error 0"
Rectify the DLL programming sequence as per latest hardware
programming guide
Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
---
drivers/mmc/host/sdhci-msm.c | 271 ++++++++++++++++++++++++++++++++---
1 file changed, 252 insertions(+), 19 deletions(-)
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index d07f0105b733..0f60a3655ef1 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -28,6 +28,7 @@
#define CORE_VERSION_MAJOR_SHIFT 28
#define CORE_VERSION_MAJOR_MASK (0xf << CORE_VERSION_MAJOR_SHIFT)
#define CORE_VERSION_MINOR_MASK 0xff
+#define SDHCI_MSM_MIN_V_7FF 0x6e
#define CORE_MCI_GENERICS 0x70
#define SWITCHABLE_SIGNALING_VOLTAGE BIT(29)
@@ -118,7 +119,8 @@
#define CORE_PWRSAVE_DLL BIT(3)
#define DDR_CONFIG_POR_VAL 0x80040873
-
+#define DLL_CONFIG_3_POR_VAL 0x10
+#define TCXO_FREQ 19200000
#define INVALID_TUNING_PHASE -1
#define SDHCI_MSM_MIN_CLOCK 400000
@@ -318,6 +320,16 @@ struct sdhci_msm_host {
bool artanis_dll;
};
+enum dll_init_context {
+ DLL_INIT_NORMAL,
+ DLL_INIT_FROM_CX_COLLAPSE_EXIT,
+};
+
+enum mode {
+ HS400, // equivalent to SDR104 mode for DLL.
+ HS200, // equivalent to SDR50 mode for DLL.
+};
+
static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -802,6 +814,208 @@ static int msm_init_cm_dll(struct sdhci_host *host)
return 0;
}
+static unsigned int sdhci_msm_get_min_clock(struct sdhci_host *host)
+{
+ return SDHCI_MSM_MIN_CLOCK;
+}
+
+static unsigned int sdhci_msm_get_clk_rate(struct sdhci_host *host, u32 req_clk)
+{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
+ struct clk *core_clk = msm_host->bulk_clks[0].clk;
+ struct mmc_ios ios = host->mmc->ios;
+ unsigned int sup_clk;
+
+ if (req_clk < sdhci_msm_get_min_clock(host))
+ return sdhci_msm_get_min_clock(host);
+
+ sup_clk = clk_get_rate(core_clk);
+
+ if (ios.timing == MMC_TIMING_MMC_HS400 ||
+ host->flags & SDHCI_HS400_TUNING)
+ sup_clk = sup_clk / 2;
+
+ return sup_clk;
+}
+
+/* Initialize the DLL (Programmable Delay Line) */
+static int sdhci_msm_configure_dll(struct sdhci_host *host, enum dll_init_context
+ init_context, enum mode index)
+{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
+ const struct sdhci_msm_offset *msm_offset = msm_host->offset;
+ struct mmc_host *mmc = host->mmc;
+ u32 ddr_cfg_offset, core_vendor_spec, config;
+ void __iomem *ioaddr = host->ioaddr;
+ unsigned long flags, dll_clock;
+ int rc = 0, wait_cnt = 50;
+
+ dll_clock = sdhci_msm_get_clk_rate(host, host->clock);
+ spin_lock_irqsave(&host->lock, flags);
+
+ core_vendor_spec = readl_relaxed(ioaddr + msm_offset->core_vendor_spec);
+
+ /*
+ * Always disable PWRSAVE during the DLL power
+ * up regardless of its current setting.
+ */
+ core_vendor_spec &= ~CORE_CLK_PWRSAVE;
+ writel_relaxed(core_vendor_spec, ioaddr + msm_offset->core_vendor_spec);
+
+ if (msm_host->use_14lpp_dll_reset) {
+ /* Disable CK_OUT */
+ config = readl_relaxed(ioaddr + msm_offset->core_dll_config);
+ config &= ~CORE_CK_OUT_EN;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ /* Disable the DLL clock */
+ config = readl_relaxed(ioaddr + msm_offset->core_dll_config_2);
+ config |= CORE_DLL_CLOCK_DISABLE;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config_2);
+ }
+
+ /*
+ * Write 1 to DLL_RST bit of DLL_CONFIG register
+ * and Write 1 to DLL_PDN bit of DLL_CONFIG register.
+ */
+ config = readl_relaxed(ioaddr + msm_offset->core_dll_config);
+ config |= (CORE_DLL_RST | CORE_DLL_PDN);
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ /*
+ * Configure DLL_CONFIG_3 and USER_CTRL
+ * (Only applicable for 7FF projects).
+ */
+ if (msm_host->core_minor >= SDHCI_MSM_MIN_V_7FF) {
+ writel_relaxed(msm_host->dll.dll_config_3[index],
+ ioaddr + msm_offset->core_dll_config_3);
+ writel_relaxed(msm_host->dll.dll_usr_ctl[index],
+ ioaddr + msm_offset->core_dll_usr_ctl);
+ }
+
+ /*
+ * Set DDR_CONFIG since step 7 is setting TEST_CTRL that can be skipped.
+ */
+ ddr_cfg_offset = msm_host->updated_ddr_cfg ? msm_offset->core_ddr_config
+ : msm_offset->core_ddr_config_old;
+
+ config = msm_host->dll.ddr_config[index];
+ writel_relaxed(config, ioaddr + ddr_cfg_offset);
+
+ /* Set DLL_CONFIG_2 */
+ if (msm_host->use_14lpp_dll_reset) {
+ u32 mclk_freq;
+ int cycle_cnt;
+
+ /*
+ * Only configure the mclk_freq in normal DLL init
+ * context. If the DLL init is coming from
+ * CX Collapse Exit context, the host->clock may be zero.
+ * The DLL_CONFIG_2 register has already been restored to
+ * proper value prior to getting here.
+ */
+ if (init_context == DLL_INIT_NORMAL) {
+ cycle_cnt = readl_relaxed(ioaddr +
+ msm_offset->core_dll_config_2)
+ & CORE_FLL_CYCLE_CNT ? 8 : 4;
+
+ mclk_freq = DIV_ROUND_CLOSEST_ULL(dll_clock * cycle_cnt, TCXO_FREQ);
+
+ if (dll_clock < 100000000) {
+ pr_err("%s: %s: Non standard clk freq =%u\n",
+ mmc_hostname(mmc), __func__, dll_clock);
+ rc = -EINVAL;
+ goto out;
+ }
+
+ config = readl_relaxed(ioaddr + msm_offset->core_dll_config_2);
+ config = (config & ~GENMASK(17, 10)) |
+ FIELD_PREP(GENMASK(17, 10), mclk_freq);
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config_2);
+ }
+ /* wait for 5us before enabling DLL clock */
+ udelay(5);
+ }
+
+ config = msm_host->dll.dll_config[index];
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ /* Wait for 52us */
+ spin_unlock_irqrestore(&host->lock, flags);
+ usleep_range(60, 70);
+ spin_lock_irqsave(&host->lock, flags);
+
+ /*
+ * Write 0 to DLL_RST bit of DLL_CONFIG register
+ * and Write 0 to DLL_PDN bit of DLL_CONFIG register.
+ */
+ config &= ~CORE_DLL_RST;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ config &= ~CORE_DLL_PDN;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+ /* Write 1 to DLL_RST bit of DLL_CONFIG register */
+ config |= CORE_DLL_RST;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ /* Write 0 to DLL_RST bit of DLL_CONFIG register */
+ config &= ~CORE_DLL_RST;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ /* Set CORE_DLL_CLOCK_DISABLE to 0 */
+ if (msm_host->use_14lpp_dll_reset) {
+ config = readl_relaxed(ioaddr + msm_offset->core_dll_config_2);
+ config &= ~CORE_DLL_CLOCK_DISABLE;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config_2);
+ }
+
+ /* Set DLL_EN bit to 1. */
+ config = readl_relaxed(ioaddr + msm_offset->core_dll_config);
+ config |= CORE_DLL_EN;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ /*
+ * Wait for 8000 input clock. Here we calculate the
+ * delay from fixed clock freq 192MHz, which turns out 42us.
+ */
+ spin_unlock_irqrestore(&host->lock, flags);
+ usleep_range(50, 60);
+ spin_lock_irqsave(&host->lock, flags);
+
+ /* Set CK_OUT_EN bit to 1. */
+ config |= CORE_CK_OUT_EN;
+ writel_relaxed(config, ioaddr + msm_offset->core_dll_config);
+
+ /*
+ * Wait until DLL_LOCK bit of DLL_STATUS register
+ * becomes '1'.
+ */
+ while (!(readl_relaxed(ioaddr + msm_offset->core_dll_status) &
+ CORE_DLL_LOCK)) {
+ /* max. wait for 50us sec for LOCK bit to be set */
+ if (--wait_cnt == 0) {
+ dev_err(mmc_dev(mmc), "%s: DLL failed to LOCK\n",
+ mmc_hostname(mmc));
+ rc = -ETIMEDOUT;
+ goto out;
+ }
+ /* wait for 1us before polling again */
+ udelay(1);
+ }
+
+out:
+ if (core_vendor_spec & CORE_CLK_PWRSAVE) {
+ /* Reenable PWRSAVE as needed */
+ config = readl_relaxed(ioaddr + msm_offset->core_vendor_spec);
+ config |= CORE_CLK_PWRSAVE;
+ writel_relaxed(config, ioaddr + msm_offset->core_vendor_spec);
+ }
+ spin_unlock_irqrestore(&host->lock, flags);
+ return rc;
+}
+
static void msm_hc_select_default(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -924,14 +1138,31 @@ static void sdhci_msm_hc_select_mode(struct sdhci_host *host)
msm_hc_select_default(host);
}
+static int sdhci_msm_init_dll(struct sdhci_host *host, enum dll_init_context init_context)
+{
+ if (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104 ||
+ host->mmc->ios.timing == MMC_TIMING_MMC_HS400)
+ return sdhci_msm_configure_dll(host, init_context, HS400);
+
+ return sdhci_msm_configure_dll(host, init_context, HS200);
+}
+
+static int sdhci_msm_dll_config(struct sdhci_host *host, enum dll_init_context init_context)
+{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
+
+ return msm_host->artanis_dll ? sdhci_msm_init_dll(host, init_context) :
+ msm_init_cm_dll(host);
+}
+
static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
+ const struct sdhci_msm_offset *msm_offset = msm_host->offset;
u32 config, calib_done;
int ret;
- const struct sdhci_msm_offset *msm_offset =
- msm_host->offset;
pr_debug("%s: %s: Enter\n", mmc_hostname(host->mmc), __func__);
@@ -939,7 +1170,7 @@ static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host)
* Retuning in HS400 (DDR mode) will fail, just reset the
* tuning block and restore the saved tuning phase.
*/
- ret = msm_init_cm_dll(host);
+ ret = sdhci_msm_dll_config(host, DLL_INIT_NORMAL);
if (ret)
goto out;
@@ -1027,7 +1258,7 @@ static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host)
return ret;
}
-static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host)
+static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host, enum mode index)
{
struct mmc_host *mmc = host->mmc;
u32 dll_status, config, ddr_cfg_offset;
@@ -1050,7 +1281,11 @@ static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host)
ddr_cfg_offset = msm_offset->core_ddr_config;
else
ddr_cfg_offset = msm_offset->core_ddr_config_old;
- writel_relaxed(msm_host->ddr_config, host->ioaddr + ddr_cfg_offset);
+
+ if (msm_host->artanis_dll)
+ writel_relaxed(msm_host->dll.ddr_config[index], host->ioaddr + ddr_cfg_offset);
+ else
+ writel_relaxed(msm_host->ddr_config, host->ioaddr + ddr_cfg_offset);
if (mmc->ios.enhanced_strobe) {
config = readl_relaxed(host->ioaddr +
@@ -1107,11 +1342,10 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);
+ const struct sdhci_msm_offset *msm_offset = msm_host->offset;
struct mmc_host *mmc = host->mmc;
- int ret;
u32 config;
- const struct sdhci_msm_offset *msm_offset =
- msm_host->offset;
+ int ret;
pr_debug("%s: %s: Enter\n", mmc_hostname(host->mmc), __func__);
@@ -1119,7 +1353,8 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host)
* Retuning in HS400 (DDR mode) will fail, just reset the
* tuning block and restore the saved tuning phase.
*/
- ret = msm_init_cm_dll(host);
+ ret = sdhci_msm_dll_config(host, DLL_INIT_NORMAL);
+
if (ret)
goto out;
@@ -1139,7 +1374,7 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host)
if (msm_host->use_cdclp533)
ret = sdhci_msm_cdclp533_calibration(host);
else
- ret = sdhci_msm_cm_dll_sdc4_calibration(host);
+ ret = sdhci_msm_cm_dll_sdc4_calibration(host, HS400);
out:
pr_debug("%s: %s: Exit, ret %d\n", mmc_hostname(host->mmc),
__func__, ret);
@@ -1178,7 +1413,8 @@ static int sdhci_msm_restore_sdr_dll_config(struct sdhci_host *host)
return 0;
/* Reset the tuning block */
- ret = msm_init_cm_dll(host);
+ ret = sdhci_msm_dll_config(host, DLL_INIT_NORMAL);
+
if (ret)
return ret;
@@ -1242,12 +1478,11 @@ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode)
if (host->flags & SDHCI_HS400_TUNING) {
sdhci_msm_hc_select_mode(host);
msm_set_clock_rate_for_bus_mode(host, ios.clock);
- host->flags &= ~SDHCI_HS400_TUNING;
}
retry:
/* First of all reset the tuning block */
- rc = msm_init_cm_dll(host);
+ rc = sdhci_msm_dll_config(host, DLL_INIT_NORMAL);
if (rc)
return rc;
@@ -1310,6 +1545,9 @@ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode)
rc = -EIO;
}
+ if (host->flags & SDHCI_HS400_TUNING)
+ host->flags &= ~SDHCI_HS400_TUNING;
+
if (!rc)
msm_host->tuning_done = true;
return rc;
@@ -1830,11 +2068,6 @@ static unsigned int sdhci_msm_get_max_clock(struct sdhci_host *host)
return clk_round_rate(core_clk, ULONG_MAX);
}
-static unsigned int sdhci_msm_get_min_clock(struct sdhci_host *host)
-{
- return SDHCI_MSM_MIN_CLOCK;
-}
-
/*
* __sdhci_msm_set_clock - sdhci_msm clock control.
*
--
2.34.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings
2025-09-29 11:35 ` [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings Ram Prakash Gupta
@ 2025-09-29 16:12 ` Adrian Hunter
2025-10-07 11:04 ` Ram Prakash Gupta
2025-10-06 21:44 ` Rob Herring
1 sibling, 1 reply; 15+ messages in thread
From: Adrian Hunter @ 2025-09-29 16:12 UTC (permalink / raw)
To: Ram Prakash Gupta, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_pragalla, quic_sayalil, quic_nitirawa,
quic_bhaskarv, kernel, Sachin Gupta
On 29/09/2025 14:35, Ram Prakash Gupta wrote:
> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>
> This update introduces the capability to configure HS200
> and HS400 DLL settings via the device tree and parsing it.
>
> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
> ---
> drivers/mmc/host/sdhci-msm.c | 91 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 91 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index 36700735aa3e..d07f0105b733 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
> @@ -265,6 +265,19 @@ struct sdhci_msm_variant_info {
> const struct sdhci_msm_offset *offset;
> };
>
> +/*
> + * DLL registers which needs be programmed with HSR settings.
> + * Add any new register only at the end and don't change the
> + * sequence.
> + */
> +struct sdhci_msm_dll {
> + u32 dll_config[2];
> + u32 dll_config_2[2];
> + u32 dll_config_3[2];
> + u32 dll_usr_ctl[2];
> + u32 ddr_config[2];
> +};
> +
> struct sdhci_msm_host {
> struct platform_device *pdev;
> void __iomem *core_mem; /* MSM SDCC mapped address */
> @@ -273,6 +286,7 @@ struct sdhci_msm_host {
> struct clk *xo_clk; /* TCXO clk needed for FLL feature of cm_dll*/
> /* core, iface, cal and sleep clocks */
> struct clk_bulk_data bulk_clks[4];
> + struct sdhci_msm_dll dll;
> #ifdef CONFIG_MMC_CRYPTO
> struct qcom_ice *ice;
> #endif
> @@ -301,6 +315,7 @@ struct sdhci_msm_host {
> u32 dll_config;
> u32 ddr_config;
> bool vqmmc_enabled;
> + bool artanis_dll;
> };
>
> static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
> @@ -2516,6 +2531,73 @@ static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host)
> return ret;
> }
>
> +static int sdhci_msm_dt_get_array(struct device *dev, const char *prop_name,
> + u32 **dll_table, int *len)
> +{
> + struct device_node *np = dev->of_node;
> + u32 *arr = NULL;
> + int ret = 0, sz = 0;
> +
> + if (!np)
> + return -ENODEV;
> + if (!of_get_property(np, prop_name, &sz))
> + return -EINVAL;
> +
> + sz = sz / sizeof(*arr);
> + if (sz <= 0)
> + return -EINVAL;
> +
> + arr = kcalloc(sz, sizeof(*arr), GFP_KERNEL);
> + if (!arr)
> + return -ENOMEM;
> +
> + ret = of_property_read_u32_array(np, prop_name, arr, sz);
> + if (ret) {
> + dev_err(dev, "%s failed reading array %d\n", prop_name, ret);
> + *len = 0;
> + return ret;
> + }
> +
> + *dll_table = arr;
> + *len = sz;
> +
> + return ret;
> +}
> +
> +static int sdhci_msm_dt_parse_dll_info(struct device *dev, struct sdhci_msm_host *msm_host)
> +{
> + int dll_table_len, dll_reg_count;
> + u32 *dll_table = NULL;
> + int i, j;
> +
> + msm_host->artanis_dll = false;
> +
> + if (sdhci_msm_dt_get_array(dev, "qcom,dll-hsr-list",
> + &dll_table, &dll_table_len))
> + return -EINVAL;
> +
> + dll_reg_count = sizeof(struct sdhci_msm_dll) / sizeof(u32);
> +
> + if (dll_table_len != dll_reg_count) {
> + dev_err(dev, "Number of HSR entries are not matching\n");
> + return -EINVAL;
> + }
> +
> + for (i = 0, j = 0; j < 2; i = i + 5, j++) {
> + msm_host->dll.dll_config[j] = dll_table[i];
> + msm_host->dll.dll_config_2[j] = dll_table[i + 1];
> + msm_host->dll.dll_config_3[j] = dll_table[i + 2];
> + msm_host->dll.dll_usr_ctl[j] = dll_table[i + 3];
> + msm_host->dll.ddr_config[j] = dll_table[i + 4];
> + }
Kind of begs the question, why the driver and the DT have to be in
a different order.
It might be simpler to have:
struct sdhci_msm_dll {
u32 dll_config;
u32 dll_config_2;
u32 dll_config_3;
u32 dll_usr_ctl;
u32 ddr_config;
};
And:
struct sdhci_msm_dll dll[2];
And then dereference like:
msm_host->dll[index].dll_config_3
Also then you could perhaps use something like:
of_property_read_variable_u32_array(np, "qcom,dll-hsr-list", msm_host->dll, 10, 10)
instead of most of sdhci_msm_dt_get_array()
> +
> + msm_host->artanis_dll = true;
> +
> + kfree(dll_table);
> +
> + return 0;
> +}
> +
> static int sdhci_msm_probe(struct platform_device *pdev)
> {
> struct sdhci_host *host;
> @@ -2562,6 +2644,15 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>
> msm_host->saved_tuning_phase = INVALID_TUNING_PHASE;
>
> + /*
> + * Parse HSR dll only when property is present in DT.
> + */
> + if (of_find_property(node, "qcom,dll-hsr-list", NULL)) {
> + ret = sdhci_msm_dt_parse_dll_info(&pdev->dev, msm_host);
> + if (ret)
> + return ret;
> + }
> +
> ret = sdhci_msm_gcc_reset(&pdev->dev, host);
> if (ret)
> return ret;
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC
2025-09-29 11:35 ` [PATCH v4 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
@ 2025-10-02 15:13 ` kernel test robot
0 siblings, 0 replies; 15+ messages in thread
From: kernel test robot @ 2025-10-02 15:13 UTC (permalink / raw)
To: Ram Prakash Gupta, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Adrian Hunter, Bjorn Andersson, Konrad Dybcio
Cc: oe-kbuild-all, linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_rampraka, quic_pragalla, quic_sayalil,
quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
Hi Ram,
kernel test robot noticed the following build warnings:
[auto build test WARNING on robh/for-next]
[also build test WARNING on krzk-dt/for-next linus/master ulf-hansson-mmc-mirror/next v6.17 next-20250929]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Ram-Prakash-Gupta/dt-bindings-mmc-Add-dll-hsr-list-for-HS400-and-HS200-modes/20250929-193817
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20250929113515.26752-5-quic_rampraka%40quicinc.com
patch subject: [PATCH v4 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20251002/202510022258.5n14WOx5-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251002/202510022258.5n14WOx5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510022258.5n14WOx5-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/asm-generic/bug.h:22,
from arch/s390/include/asm/bug.h:69,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from arch/s390/include/asm/cmpxchg.h:11,
from arch/s390/include/asm/atomic.h:16,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/atomic.h:5,
from arch/s390/include/asm/bitops.h:75,
from include/linux/bitops.h:67,
from arch/s390/include/asm/machine.h:25,
from arch/s390/include/asm/lowcore.h:13,
from arch/s390/include/asm/current.h:13,
from arch/s390/include/asm/preempt.h:5,
from include/linux/preempt.h:79,
from arch/s390/include/asm/timex.h:13,
from include/linux/timex.h:67,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/mmc/host/sdhci-msm.c:8:
drivers/mmc/host/sdhci-msm.c: In function 'sdhci_msm_configure_dll':
>> include/linux/kern_levels.h:5:25: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=]
5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
| ^~~~~~
include/linux/printk.h:486:25: note: in definition of macro 'printk_index_wrap'
486 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~
include/linux/printk.h:557:9: note: in expansion of macro 'printk'
557 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~
include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH'
11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
| ^~~~~~~~
include/linux/printk.h:557:16: note: in expansion of macro 'KERN_ERR'
557 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~
drivers/mmc/host/sdhci-msm.c:927:33: note: in expansion of macro 'pr_err'
927 | pr_err("%s: %s: Non standard clk freq =%u\n",
| ^~~~~~
vim +5 include/linux/kern_levels.h
314ba3520e513a Joe Perches 2012-07-30 4
04d2c8c83d0e3a Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3a Joe Perches 2012-07-30 7
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings
2025-09-29 11:35 ` [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings Ram Prakash Gupta
2025-09-29 16:12 ` Adrian Hunter
@ 2025-10-06 21:44 ` Rob Herring
2025-10-07 11:08 ` Ram Prakash Gupta
1 sibling, 1 reply; 15+ messages in thread
From: Rob Herring @ 2025-10-06 21:44 UTC (permalink / raw)
To: Ram Prakash Gupta
Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter,
Bjorn Andersson, Konrad Dybcio, linux-mmc, devicetree,
linux-kernel, linux-arm-msm, dmitry.baryshkov, quic_pragalla,
quic_sayalil, quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
On Mon, Sep 29, 2025 at 05:05:14PM +0530, Ram Prakash Gupta wrote:
> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>
> This update introduces the capability to configure HS200
> and HS400 DLL settings via the device tree and parsing it.
>
> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
> ---
> drivers/mmc/host/sdhci-msm.c | 91 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 91 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index 36700735aa3e..d07f0105b733 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
> @@ -265,6 +265,19 @@ struct sdhci_msm_variant_info {
> const struct sdhci_msm_offset *offset;
> };
>
> +/*
> + * DLL registers which needs be programmed with HSR settings.
> + * Add any new register only at the end and don't change the
> + * sequence.
> + */
> +struct sdhci_msm_dll {
> + u32 dll_config[2];
> + u32 dll_config_2[2];
> + u32 dll_config_3[2];
> + u32 dll_usr_ctl[2];
> + u32 ddr_config[2];
> +};
> +
> struct sdhci_msm_host {
> struct platform_device *pdev;
> void __iomem *core_mem; /* MSM SDCC mapped address */
> @@ -273,6 +286,7 @@ struct sdhci_msm_host {
> struct clk *xo_clk; /* TCXO clk needed for FLL feature of cm_dll*/
> /* core, iface, cal and sleep clocks */
> struct clk_bulk_data bulk_clks[4];
> + struct sdhci_msm_dll dll;
> #ifdef CONFIG_MMC_CRYPTO
> struct qcom_ice *ice;
> #endif
> @@ -301,6 +315,7 @@ struct sdhci_msm_host {
> u32 dll_config;
> u32 ddr_config;
> bool vqmmc_enabled;
> + bool artanis_dll;
> };
>
> static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
> @@ -2516,6 +2531,73 @@ static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host)
> return ret;
> }
>
> +static int sdhci_msm_dt_get_array(struct device *dev, const char *prop_name,
> + u32 **dll_table, int *len)
> +{
> + struct device_node *np = dev->of_node;
> + u32 *arr = NULL;
> + int ret = 0, sz = 0;
> +
> + if (!np)
> + return -ENODEV;
> + if (!of_get_property(np, prop_name, &sz))
Don't add new users of of_get_property which adds untracked pointers to
raw DT data.
> + return -EINVAL;
> +
> + sz = sz / sizeof(*arr);
> + if (sz <= 0)
> + return -EINVAL;
> +
> + arr = kcalloc(sz, sizeof(*arr), GFP_KERNEL);
Why do you need to count the length first when only 5 entries is valid?
> + if (!arr)
> + return -ENOMEM;
> +
> + ret = of_property_read_u32_array(np, prop_name, arr, sz);
> + if (ret) {
> + dev_err(dev, "%s failed reading array %d\n", prop_name, ret);
> + *len = 0;
> + return ret;
> + }
> +
> + *dll_table = arr;
> + *len = sz;
> +
> + return ret;
> +}
> +
> +static int sdhci_msm_dt_parse_dll_info(struct device *dev, struct sdhci_msm_host *msm_host)
> +{
> + int dll_table_len, dll_reg_count;
> + u32 *dll_table = NULL;
> + int i, j;
> +
> + msm_host->artanis_dll = false;
> +
> + if (sdhci_msm_dt_get_array(dev, "qcom,dll-hsr-list",
> + &dll_table, &dll_table_len))
> + return -EINVAL;
> +
> + dll_reg_count = sizeof(struct sdhci_msm_dll) / sizeof(u32);
> +
> + if (dll_table_len != dll_reg_count) {
> + dev_err(dev, "Number of HSR entries are not matching\n");
> + return -EINVAL;
You just leaked memory. devm_* functions are your friend.
> + }
> +
> + for (i = 0, j = 0; j < 2; i = i + 5, j++) {
> + msm_host->dll.dll_config[j] = dll_table[i];
> + msm_host->dll.dll_config_2[j] = dll_table[i + 1];
> + msm_host->dll.dll_config_3[j] = dll_table[i + 2];
> + msm_host->dll.dll_usr_ctl[j] = dll_table[i + 3];
> + msm_host->dll.ddr_config[j] = dll_table[i + 4];
> + }
> +
> + msm_host->artanis_dll = true;
> +
> + kfree(dll_table);
> +
> + return 0;
> +}
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes
2025-09-29 11:35 ` [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes Ram Prakash Gupta
@ 2025-10-06 21:48 ` Rob Herring
2025-10-07 11:16 ` Ram Prakash Gupta
0 siblings, 1 reply; 15+ messages in thread
From: Rob Herring @ 2025-10-06 21:48 UTC (permalink / raw)
To: Ram Prakash Gupta
Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter,
Bjorn Andersson, Konrad Dybcio, linux-mmc, devicetree,
linux-kernel, linux-arm-msm, dmitry.baryshkov, quic_pragalla,
quic_sayalil, quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
On Mon, Sep 29, 2025 at 05:05:12PM +0530, Ram Prakash Gupta wrote:
> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>
> Document the 'dll-hsr-list' property for MMC device tree bindings.
> The 'dll-hsr-list' property defines the DLL configurations for HS400
> and HS200 modes.
>
> QC SoCs can have 0 to 4 SDHCI instances, and each one may need
> different tuning.
>
> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
> ---
> Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
> index 22d1f50c3fd1..a60222473990 100644
> --- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
> +++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
> @@ -137,6 +137,11 @@ properties:
> $ref: /schemas/types.yaml#/definitions/uint32
> description: platform specific settings for DLL_CONFIG reg.
>
> + qcom,dll-hsr-list:
'-list' doesn't add anything.
What is 'hsr'?
> + maxItems: 10
> + $ref: /schemas/types.yaml#/definitions/uint32-array
> + description: platform specific settings for DLL registers.
> +
> iommus:
> minItems: 1
> maxItems: 8
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings
2025-09-29 16:12 ` Adrian Hunter
@ 2025-10-07 11:04 ` Ram Prakash Gupta
2025-10-07 11:29 ` Adrian Hunter
0 siblings, 1 reply; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-10-07 11:04 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_pragalla, quic_sayalil, quic_nitirawa,
quic_bhaskarv, kernel, Sachin Gupta
On 9/29/2025 9:42 PM, Adrian Hunter wrote:
> On 29/09/2025 14:35, Ram Prakash Gupta wrote:
>> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>>
>> This update introduces the capability to configure HS200
>> and HS400 DLL settings via the device tree and parsing it.
>>
>> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
>> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
>> ---
>> drivers/mmc/host/sdhci-msm.c | 91 ++++++++++++++++++++++++++++++++++++
>> 1 file changed, 91 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
>> index 36700735aa3e..d07f0105b733 100644
>> --- a/drivers/mmc/host/sdhci-msm.c
>> +++ b/drivers/mmc/host/sdhci-msm.c
>> @@ -265,6 +265,19 @@ struct sdhci_msm_variant_info {
>> const struct sdhci_msm_offset *offset;
>> };
>>
>> +/*
>> + * DLL registers which needs be programmed with HSR settings.
>> + * Add any new register only at the end and don't change the
>> + * sequence.
>> + */
>> +struct sdhci_msm_dll {
>> + u32 dll_config[2];
>> + u32 dll_config_2[2];
>> + u32 dll_config_3[2];
>> + u32 dll_usr_ctl[2];
>> + u32 ddr_config[2];
>> +};
>> +
>> struct sdhci_msm_host {
>> struct platform_device *pdev;
>> void __iomem *core_mem; /* MSM SDCC mapped address */
>> @@ -273,6 +286,7 @@ struct sdhci_msm_host {
>> struct clk *xo_clk; /* TCXO clk needed for FLL feature of cm_dll*/
>> /* core, iface, cal and sleep clocks */
>> struct clk_bulk_data bulk_clks[4];
>> + struct sdhci_msm_dll dll;
>> #ifdef CONFIG_MMC_CRYPTO
>> struct qcom_ice *ice;
>> #endif
>> @@ -301,6 +315,7 @@ struct sdhci_msm_host {
>> u32 dll_config;
>> u32 ddr_config;
>> bool vqmmc_enabled;
>> + bool artanis_dll;
>> };
>>
>> static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
>> @@ -2516,6 +2531,73 @@ static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host)
>> return ret;
>> }
>>
>> +static int sdhci_msm_dt_get_array(struct device *dev, const char *prop_name,
>> + u32 **dll_table, int *len)
>> +{
>> + struct device_node *np = dev->of_node;
>> + u32 *arr = NULL;
>> + int ret = 0, sz = 0;
>> +
>> + if (!np)
>> + return -ENODEV;
>> + if (!of_get_property(np, prop_name, &sz))
>> + return -EINVAL;
>> +
>> + sz = sz / sizeof(*arr);
>> + if (sz <= 0)
>> + return -EINVAL;
>> +
>> + arr = kcalloc(sz, sizeof(*arr), GFP_KERNEL);
>> + if (!arr)
>> + return -ENOMEM;
>> +
>> + ret = of_property_read_u32_array(np, prop_name, arr, sz);
>> + if (ret) {
>> + dev_err(dev, "%s failed reading array %d\n", prop_name, ret);
>> + *len = 0;
>> + return ret;
>> + }
>> +
>> + *dll_table = arr;
>> + *len = sz;
>> +
>> + return ret;
>> +}
>> +
>> +static int sdhci_msm_dt_parse_dll_info(struct device *dev, struct sdhci_msm_host *msm_host)
>> +{
>> + int dll_table_len, dll_reg_count;
>> + u32 *dll_table = NULL;
>> + int i, j;
>> +
>> + msm_host->artanis_dll = false;
>> +
>> + if (sdhci_msm_dt_get_array(dev, "qcom,dll-hsr-list",
>> + &dll_table, &dll_table_len))
>> + return -EINVAL;
>> +
>> + dll_reg_count = sizeof(struct sdhci_msm_dll) / sizeof(u32);
>> +
>> + if (dll_table_len != dll_reg_count) {
>> + dev_err(dev, "Number of HSR entries are not matching\n");
>> + return -EINVAL;
>> + }
>> +
>> + for (i = 0, j = 0; j < 2; i = i + 5, j++) {
>> + msm_host->dll.dll_config[j] = dll_table[i];
>> + msm_host->dll.dll_config_2[j] = dll_table[i + 1];
>> + msm_host->dll.dll_config_3[j] = dll_table[i + 2];
>> + msm_host->dll.dll_usr_ctl[j] = dll_table[i + 3];
>> + msm_host->dll.ddr_config[j] = dll_table[i + 4];
>> + }
> Kind of begs the question, why the driver and the DT have to be in
> a different order.
>
> It might be simpler to have:
>
> struct sdhci_msm_dll {
> u32 dll_config;
> u32 dll_config_2;
> u32 dll_config_3;
> u32 dll_usr_ctl;
> u32 ddr_config;
> };
>
> And:
> struct sdhci_msm_dll dll[2];
>
> And then dereference like:
>
> msm_host->dll[index].dll_config_3
>
> Also then you could perhaps use something like:
>
> of_property_read_variable_u32_array(np, "qcom,dll-hsr-list", msm_host->dll, 10, 10)
>
> instead of most of sdhci_msm_dt_get_array()
Thanks Adrian for your suggestion, I could get rid of most of the lines of code
of this patch with this approach. Accordingly I had to make some changes in
patch #4 of this version.
please let me know if I can push next patchset version.
>> +
>> + msm_host->artanis_dll = true;
>> +
>> + kfree(dll_table);
>> +
>> + return 0;
>> +}
>> +
>> static int sdhci_msm_probe(struct platform_device *pdev)
>> {
>> struct sdhci_host *host;
>> @@ -2562,6 +2644,15 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>>
>> msm_host->saved_tuning_phase = INVALID_TUNING_PHASE;
>>
>> + /*
>> + * Parse HSR dll only when property is present in DT.
>> + */
>> + if (of_find_property(node, "qcom,dll-hsr-list", NULL)) {
>> + ret = sdhci_msm_dt_parse_dll_info(&pdev->dev, msm_host);
>> + if (ret)
>> + return ret;
>> + }
>> +
>> ret = sdhci_msm_gcc_reset(&pdev->dev, host);
>> if (ret)
>> return ret;
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings
2025-10-06 21:44 ` Rob Herring
@ 2025-10-07 11:08 ` Ram Prakash Gupta
0 siblings, 0 replies; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-10-07 11:08 UTC (permalink / raw)
To: Rob Herring
Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter,
Bjorn Andersson, Konrad Dybcio, linux-mmc, devicetree,
linux-kernel, linux-arm-msm, dmitry.baryshkov, quic_pragalla,
quic_sayalil, quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
On 10/7/2025 3:14 AM, Rob Herring wrote:
> On Mon, Sep 29, 2025 at 05:05:14PM +0530, Ram Prakash Gupta wrote:
>> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>>
>> This update introduces the capability to configure HS200
>> and HS400 DLL settings via the device tree and parsing it.
>>
>> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
>> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
>> ---
>> drivers/mmc/host/sdhci-msm.c | 91 ++++++++++++++++++++++++++++++++++++
>> 1 file changed, 91 insertions(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
>> index 36700735aa3e..d07f0105b733 100644
>> --- a/drivers/mmc/host/sdhci-msm.c
>> +++ b/drivers/mmc/host/sdhci-msm.c
>> @@ -265,6 +265,19 @@ struct sdhci_msm_variant_info {
>> const struct sdhci_msm_offset *offset;
>> };
>>
>> +/*
>> + * DLL registers which needs be programmed with HSR settings.
>> + * Add any new register only at the end and don't change the
>> + * sequence.
>> + */
>> +struct sdhci_msm_dll {
>> + u32 dll_config[2];
>> + u32 dll_config_2[2];
>> + u32 dll_config_3[2];
>> + u32 dll_usr_ctl[2];
>> + u32 ddr_config[2];
>> +};
>> +
>> struct sdhci_msm_host {
>> struct platform_device *pdev;
>> void __iomem *core_mem; /* MSM SDCC mapped address */
>> @@ -273,6 +286,7 @@ struct sdhci_msm_host {
>> struct clk *xo_clk; /* TCXO clk needed for FLL feature of cm_dll*/
>> /* core, iface, cal and sleep clocks */
>> struct clk_bulk_data bulk_clks[4];
>> + struct sdhci_msm_dll dll;
>> #ifdef CONFIG_MMC_CRYPTO
>> struct qcom_ice *ice;
>> #endif
>> @@ -301,6 +315,7 @@ struct sdhci_msm_host {
>> u32 dll_config;
>> u32 ddr_config;
>> bool vqmmc_enabled;
>> + bool artanis_dll;
>> };
>>
>> static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
>> @@ -2516,6 +2531,73 @@ static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host)
>> return ret;
>> }
>>
>> +static int sdhci_msm_dt_get_array(struct device *dev, const char *prop_name,
>> + u32 **dll_table, int *len)
>> +{
>> + struct device_node *np = dev->of_node;
>> + u32 *arr = NULL;
>> + int ret = 0, sz = 0;
>> +
>> + if (!np)
>> + return -ENODEV;
>> + if (!of_get_property(np, prop_name, &sz))
> Don't add new users of of_get_property which adds untracked pointers to
> raw DT data.
Adrian also checked and provided some suggestion, and with those I could
get rid of this function, so it is no longer needed.
>
>> + return -EINVAL;
>> +
>> + sz = sz / sizeof(*arr);
>> + if (sz <= 0)
>> + return -EINVAL;
>> +
>> + arr = kcalloc(sz, sizeof(*arr), GFP_KERNEL);
> Why do you need to count the length first when only 5 entries is valid?
This line also would not be needed in needed in next patchset.
>> + if (!arr)
>> + return -ENOMEM;
>> +
>> + ret = of_property_read_u32_array(np, prop_name, arr, sz);
>> + if (ret) {
>> + dev_err(dev, "%s failed reading array %d\n", prop_name, ret);
>> + *len = 0;
>> + return ret;
>> + }
>> +
>> + *dll_table = arr;
>> + *len = sz;
>> +
>> + return ret;
>> +}
>> +
>> +static int sdhci_msm_dt_parse_dll_info(struct device *dev, struct sdhci_msm_host *msm_host)
>> +{
>> + int dll_table_len, dll_reg_count;
>> + u32 *dll_table = NULL;
>> + int i, j;
>> +
>> + msm_host->artanis_dll = false;
>> +
>> + if (sdhci_msm_dt_get_array(dev, "qcom,dll-hsr-list",
>> + &dll_table, &dll_table_len))
>> + return -EINVAL;
>> +
>> + dll_reg_count = sizeof(struct sdhci_msm_dll) / sizeof(u32);
>> +
>> + if (dll_table_len != dll_reg_count) {
>> + dev_err(dev, "Number of HSR entries are not matching\n");
>> + return -EINVAL;
> You just leaked memory. devm_* functions are your friend.
These changes would also be removed in next patchset, after addressing
Adrian comment.
>
>> + }
>> +
>> + for (i = 0, j = 0; j < 2; i = i + 5, j++) {
>> + msm_host->dll.dll_config[j] = dll_table[i];
>> + msm_host->dll.dll_config_2[j] = dll_table[i + 1];
>> + msm_host->dll.dll_config_3[j] = dll_table[i + 2];
>> + msm_host->dll.dll_usr_ctl[j] = dll_table[i + 3];
>> + msm_host->dll.ddr_config[j] = dll_table[i + 4];
>> + }
>> +
>> + msm_host->artanis_dll = true;
>> +
>> + kfree(dll_table);
>> +
>> + return 0;
>> +}
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes
2025-10-06 21:48 ` Rob Herring
@ 2025-10-07 11:16 ` Ram Prakash Gupta
2025-10-07 11:42 ` Konrad Dybcio
0 siblings, 1 reply; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-10-07 11:16 UTC (permalink / raw)
To: Rob Herring
Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter,
Bjorn Andersson, Konrad Dybcio, linux-mmc, devicetree,
linux-kernel, linux-arm-msm, dmitry.baryshkov, quic_pragalla,
quic_sayalil, quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
On 10/7/2025 3:18 AM, Rob Herring wrote:
> On Mon, Sep 29, 2025 at 05:05:12PM +0530, Ram Prakash Gupta wrote:
>> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>>
>> Document the 'dll-hsr-list' property for MMC device tree bindings.
>> The 'dll-hsr-list' property defines the DLL configurations for HS400
>> and HS200 modes.
>>
>> QC SoCs can have 0 to 4 SDHCI instances, and each one may need
>> different tuning.
>>
>> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
>> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
>> ---
>> Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>> index 22d1f50c3fd1..a60222473990 100644
>> --- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>> +++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>> @@ -137,6 +137,11 @@ properties:
>> $ref: /schemas/types.yaml#/definitions/uint32
>> description: platform specific settings for DLL_CONFIG reg.
>>
>> + qcom,dll-hsr-list:
> '-list' doesn't add anything.
list was used as there are 5 dll register, but '-list' can be
dropped, and it can be renamed to qcom,dll-hsr, I will update in
next patchset.
>
> What is 'hsr'?
Hardware Settings Reference
>
>> + maxItems: 10
>> + $ref: /schemas/types.yaml#/definitions/uint32-array
>> + description: platform specific settings for DLL registers.
>> +
>> iommus:
>> minItems: 1
>> maxItems: 8
>> --
>> 2.34.1
>>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings
2025-10-07 11:04 ` Ram Prakash Gupta
@ 2025-10-07 11:29 ` Adrian Hunter
0 siblings, 0 replies; 15+ messages in thread
From: Adrian Hunter @ 2025-10-07 11:29 UTC (permalink / raw)
To: Ram Prakash Gupta, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Bjorn Andersson, Konrad Dybcio
Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm,
dmitry.baryshkov, quic_pragalla, quic_sayalil, quic_nitirawa,
quic_bhaskarv, kernel, Sachin Gupta
On 07/10/2025 14:04, Ram Prakash Gupta wrote:
> please let me know if I can push next patchset version.
That is up to you. Whenever you are ready, review comments addressed etc
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes
2025-10-07 11:16 ` Ram Prakash Gupta
@ 2025-10-07 11:42 ` Konrad Dybcio
2025-10-13 13:04 ` Ram Prakash Gupta
0 siblings, 1 reply; 15+ messages in thread
From: Konrad Dybcio @ 2025-10-07 11:42 UTC (permalink / raw)
To: Ram Prakash Gupta, Rob Herring
Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter,
Bjorn Andersson, Konrad Dybcio, linux-mmc, devicetree,
linux-kernel, linux-arm-msm, dmitry.baryshkov, quic_pragalla,
quic_sayalil, quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
On 10/7/25 1:16 PM, Ram Prakash Gupta wrote:
>
> On 10/7/2025 3:18 AM, Rob Herring wrote:
>> On Mon, Sep 29, 2025 at 05:05:12PM +0530, Ram Prakash Gupta wrote:
>>> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>>>
>>> Document the 'dll-hsr-list' property for MMC device tree bindings.
>>> The 'dll-hsr-list' property defines the DLL configurations for HS400
>>> and HS200 modes.
>>>
>>> QC SoCs can have 0 to 4 SDHCI instances, and each one may need
>>> different tuning.
>>>
>>> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
>>> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
>>> ---
>>> Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 5 +++++
>>> 1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>>> index 22d1f50c3fd1..a60222473990 100644
>>> --- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>>> +++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>>> @@ -137,6 +137,11 @@ properties:
>>> $ref: /schemas/types.yaml#/definitions/uint32
>>> description: platform specific settings for DLL_CONFIG reg.
>>>
>>> + qcom,dll-hsr-list:
>> '-list' doesn't add anything.
>
> list was used as there are 5 dll register, but '-list' can be
> dropped, and it can be renamed to qcom,dll-hsr, I will update in
> next patchset.
>
>>
>> What is 'hsr'?
>
> Hardware Settings Reference
Maybe "qcom,dll-presets" would be more clear?
Konrad
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes
2025-10-07 11:42 ` Konrad Dybcio
@ 2025-10-13 13:04 ` Ram Prakash Gupta
0 siblings, 0 replies; 15+ messages in thread
From: Ram Prakash Gupta @ 2025-10-13 13:04 UTC (permalink / raw)
To: Konrad Dybcio, Rob Herring
Cc: Ulf Hansson, Krzysztof Kozlowski, Conor Dooley, Adrian Hunter,
Bjorn Andersson, Konrad Dybcio, linux-mmc, devicetree,
linux-kernel, linux-arm-msm, dmitry.baryshkov, quic_pragalla,
quic_sayalil, quic_nitirawa, quic_bhaskarv, kernel, Sachin Gupta
On 10/7/2025 5:12 PM, Konrad Dybcio wrote:
> On 10/7/25 1:16 PM, Ram Prakash Gupta wrote:
>> On 10/7/2025 3:18 AM, Rob Herring wrote:
>>> On Mon, Sep 29, 2025 at 05:05:12PM +0530, Ram Prakash Gupta wrote:
>>>> From: Sachin Gupta <quic_sachgupt@quicinc.com>
>>>>
>>>> Document the 'dll-hsr-list' property for MMC device tree bindings.
>>>> The 'dll-hsr-list' property defines the DLL configurations for HS400
>>>> and HS200 modes.
>>>>
>>>> QC SoCs can have 0 to 4 SDHCI instances, and each one may need
>>>> different tuning.
>>>>
>>>> Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
>>>> Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
>>>> ---
>>>> Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 5 +++++
>>>> 1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>>>> index 22d1f50c3fd1..a60222473990 100644
>>>> --- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>>>> +++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
>>>> @@ -137,6 +137,11 @@ properties:
>>>> $ref: /schemas/types.yaml#/definitions/uint32
>>>> description: platform specific settings for DLL_CONFIG reg.
>>>>
>>>> + qcom,dll-hsr-list:
>>> '-list' doesn't add anything.
>> list was used as there are 5 dll register, but '-list' can be
>> dropped, and it can be renamed to qcom,dll-hsr, I will update in
>> next patchset.
>>
>>> What is 'hsr'?
>> Hardware Settings Reference
> Maybe "qcom,dll-presets" would be more clear?
>
> Konrad
sure, sounds good.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-10-13 13:04 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-29 11:35 [PATCH v4 0/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 1/4] dt-bindings: mmc: Add dll-hsr-list for HS400 and HS200 modes Ram Prakash Gupta
2025-10-06 21:48 ` Rob Herring
2025-10-07 11:16 ` Ram Prakash Gupta
2025-10-07 11:42 ` Konrad Dybcio
2025-10-13 13:04 ` Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 2/4] mmc: sdhci-msm: Add core_major, minor to msm_host structure Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 3/4] mmc: sdhci-msm: Add Device tree parsing logic for DLL settings Ram Prakash Gupta
2025-09-29 16:12 ` Adrian Hunter
2025-10-07 11:04 ` Ram Prakash Gupta
2025-10-07 11:29 ` Adrian Hunter
2025-10-06 21:44 ` Rob Herring
2025-10-07 11:08 ` Ram Prakash Gupta
2025-09-29 11:35 ` [PATCH v4 4/4] mmc: sdhci-msm: Rectify DLL programming sequence for SDCC Ram Prakash Gupta
2025-10-02 15:13 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).