Skip to content

Commit 4946b3a

Browse files
anderssonstorulf
authored andcommitted
mmc: sdhci-msm: Enable delay circuit calibration clocks
The delay circuit used to support HS400 is calibrated based on two additional clocks. When these clocks are not available and FF_CLK_SW_RST_DIS is not set in CORE_HC_MODE, reset might fail. But on some platforms this doesn't work properly and below dump can be seen in the kernel log. mmc0: Reset 0x1 never completed. mmc0: sdhci: ============ SDHCI REGISTER DUMP =========== mmc0: sdhci: Sys addr: 0x00000000 | Version: 0x00001102 mmc0: sdhci: Blk size: 0x00004000 | Blk cnt: 0x00000000 mmc0: sdhci: Argument: 0x00000000 | Trn mode: 0x00000000 mmc0: sdhci: Present: 0x01f80000 | Host ctl: 0x00000000 mmc0: sdhci: Power: 0x00000000 | Blk gap: 0x00000000 mmc0: sdhci: Wake-up: 0x00000000 | Clock: 0x00000002 mmc0: sdhci: Timeout: 0x00000000 | Int stat: 0x00000000 mmc0: sdhci: Int enab: 0x00000000 | Sig enab: 0x00000000 mmc0: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000000 mmc0: sdhci: Caps: 0x742dc8b2 | Caps_1: 0x00008007 mmc0: sdhci: Cmd: 0x00000000 | Max curr: 0x00000000 mmc0: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000 mmc0: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 mmc0: sdhci: Host ctl2: 0x00000000 mmc0: sdhci: ============================================ Add support for the additional calibration clocks to allow these platforms to be configured appropriately. Cc: Venkat Gopalakrishnan <venkatg@codeaurora.org> Cc: Ritesh Harjani <riteshh@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Tested-by: Jeremy McNicoll <jeremymc@redhat.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent e4bf91f commit 4946b3a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Documentation/devicetree/bindings/mmc/sdhci-msm.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Required properties:
1818
"core" - SDC MMC clock (MCLK) (required)
1919
"bus" - SDCC bus voter clock (optional)
2020
"xo" - TCXO clock (optional)
21+
"cal" - reference clock for RCLK delay calibration (optional)
22+
"sleep" - sleep clock for RCLK delay calibration (optional)
2123

2224
Example:
2325

drivers/mmc/host/sdhci-msm.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct sdhci_msm_host {
129129
int pwr_irq; /* power irq */
130130
struct clk *bus_clk; /* SDHC bus voter clock */
131131
struct clk *xo_clk; /* TCXO clk needed for FLL feature of cm_dll*/
132-
struct clk_bulk_data bulk_clks[2]; /* core, iface clocks */
132+
struct clk_bulk_data bulk_clks[4]; /* core, iface, cal, sleep clocks */
133133
unsigned long clk_rate;
134134
struct mmc_host *mmc;
135135
bool use_14lpp_dll_reset;
@@ -1184,6 +1184,16 @@ static int sdhci_msm_probe(struct platform_device *pdev)
11841184
if (ret)
11851185
dev_warn(&pdev->dev, "core clock boost failed\n");
11861186

1187+
clk = devm_clk_get(&pdev->dev, "cal");
1188+
if (IS_ERR(clk))
1189+
clk = NULL;
1190+
msm_host->bulk_clks[2].clk = clk;
1191+
1192+
clk = devm_clk_get(&pdev->dev, "sleep");
1193+
if (IS_ERR(clk))
1194+
clk = NULL;
1195+
msm_host->bulk_clks[3].clk = clk;
1196+
11871197
ret = clk_bulk_prepare_enable(ARRAY_SIZE(msm_host->bulk_clks),
11881198
msm_host->bulk_clks);
11891199
if (ret)

0 commit comments

Comments
 (0)