diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-17 15:59:57 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-17 15:59:57 -0400 |
| commit | f32a10df2ed6b87a10c1ca11757b0bbb035486a4 (patch) | |
| tree | 19af8cda0d8700c27fcd3785b746576d134c3116 | |
| parent | baf009f92731c0fc1f036d8b7dba3bf5bb2c2a5e (diff) | |
| parent | df804d5e27490151da1ce9f216031a31352203e6 (diff) | |
Merge tag 'mmc-v4.8-rc6' of git://git.linaro.org/people/ulf.hansson/mmc
Pull MMC fixes from Ulf Hansson:
"MMC host:
- omap/omap_hsmmc: Initialize dma_slave_config to avoid random data
- sdhci-st: Handle interconnect clock"
* tag 'mmc-v4.8-rc6' of git://git.linaro.org/people/ulf.hansson/mmc:
mmc: omap: Initialize dma_slave_config to avoid random data in it's fields
mmc: omap_hsmmc: Initialize dma_slave_config to avoid random data
mmc: sdhci-st: Handle interconnect clock
dt-bindings: mmc: sdhci-st: Mention the discretionary "icn" clock
| -rw-r--r-- | Documentation/devicetree/bindings/mmc/sdhci-st.txt | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/omap.c | 18 | ||||
| -rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 16 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-st.c | 15 |
4 files changed, 33 insertions, 18 deletions
diff --git a/Documentation/devicetree/bindings/mmc/sdhci-st.txt b/Documentation/devicetree/bindings/mmc/sdhci-st.txt index 88faa91125bf..3cd4c43a3260 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-st.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-st.txt | |||
| @@ -10,7 +10,7 @@ Required properties: | |||
| 10 | subsystem (mmcss) inside the FlashSS (available in STiH407 SoC | 10 | subsystem (mmcss) inside the FlashSS (available in STiH407 SoC |
| 11 | family). | 11 | family). |
| 12 | 12 | ||
| 13 | - clock-names: Should be "mmc". | 13 | - clock-names: Should be "mmc" and "icn". (NB: The latter is not compulsory) |
| 14 | See: Documentation/devicetree/bindings/resource-names.txt | 14 | See: Documentation/devicetree/bindings/resource-names.txt |
| 15 | - clocks: Phandle to the clock. | 15 | - clocks: Phandle to the clock. |
| 16 | See: Documentation/devicetree/bindings/clock/clock-bindings.txt | 16 | See: Documentation/devicetree/bindings/clock/clock-bindings.txt |
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index f23d65eb070d..be3c49fa7382 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
| @@ -1016,14 +1016,16 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) | |||
| 1016 | 1016 | ||
| 1017 | /* Only reconfigure if we have a different burst size */ | 1017 | /* Only reconfigure if we have a different burst size */ |
| 1018 | if (*bp != burst) { | 1018 | if (*bp != burst) { |
| 1019 | struct dma_slave_config cfg; | 1019 | struct dma_slave_config cfg = { |
| 1020 | 1020 | .src_addr = host->phys_base + | |
| 1021 | cfg.src_addr = host->phys_base + OMAP_MMC_REG(host, DATA); | 1021 | OMAP_MMC_REG(host, DATA), |
| 1022 | cfg.dst_addr = host->phys_base + OMAP_MMC_REG(host, DATA); | 1022 | .dst_addr = host->phys_base + |
| 1023 | cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; | 1023 | OMAP_MMC_REG(host, DATA), |
| 1024 | cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; | 1024 | .src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES, |
| 1025 | cfg.src_maxburst = burst; | 1025 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES, |
| 1026 | cfg.dst_maxburst = burst; | 1026 | .src_maxburst = burst, |
| 1027 | .dst_maxburst = burst, | ||
| 1028 | }; | ||
| 1027 | 1029 | ||
| 1028 | if (dmaengine_slave_config(c, &cfg)) | 1030 | if (dmaengine_slave_config(c, &cfg)) |
| 1029 | goto use_pio; | 1031 | goto use_pio; |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 24ebc9a8de89..5f2f24a7360d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
| @@ -1409,11 +1409,18 @@ static int omap_hsmmc_pre_dma_transfer(struct omap_hsmmc_host *host, | |||
| 1409 | static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, | 1409 | static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, |
| 1410 | struct mmc_request *req) | 1410 | struct mmc_request *req) |
| 1411 | { | 1411 | { |
| 1412 | struct dma_slave_config cfg; | ||
| 1413 | struct dma_async_tx_descriptor *tx; | 1412 | struct dma_async_tx_descriptor *tx; |
| 1414 | int ret = 0, i; | 1413 | int ret = 0, i; |
| 1415 | struct mmc_data *data = req->data; | 1414 | struct mmc_data *data = req->data; |
| 1416 | struct dma_chan *chan; | 1415 | struct dma_chan *chan; |
| 1416 | struct dma_slave_config cfg = { | ||
| 1417 | .src_addr = host->mapbase + OMAP_HSMMC_DATA, | ||
| 1418 | .dst_addr = host->mapbase + OMAP_HSMMC_DATA, | ||
| 1419 | .src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, | ||
| 1420 | .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, | ||
| 1421 | .src_maxburst = data->blksz / 4, | ||
| 1422 | .dst_maxburst = data->blksz / 4, | ||
| 1423 | }; | ||
| 1417 | 1424 | ||
| 1418 | /* Sanity check: all the SG entries must be aligned by block size. */ | 1425 | /* Sanity check: all the SG entries must be aligned by block size. */ |
| 1419 | for (i = 0; i < data->sg_len; i++) { | 1426 | for (i = 0; i < data->sg_len; i++) { |
| @@ -1433,13 +1440,6 @@ static int omap_hsmmc_setup_dma_transfer(struct omap_hsmmc_host *host, | |||
| 1433 | 1440 | ||
| 1434 | chan = omap_hsmmc_get_dma_chan(host, data); | 1441 | chan = omap_hsmmc_get_dma_chan(host, data); |
| 1435 | 1442 | ||
| 1436 | cfg.src_addr = host->mapbase + OMAP_HSMMC_DATA; | ||
| 1437 | cfg.dst_addr = host->mapbase + OMAP_HSMMC_DATA; | ||
| 1438 | cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; | ||
| 1439 | cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; | ||
| 1440 | cfg.src_maxburst = data->blksz / 4; | ||
| 1441 | cfg.dst_maxburst = data->blksz / 4; | ||
| 1442 | |||
| 1443 | ret = dmaengine_slave_config(chan, &cfg); | 1443 | ret = dmaengine_slave_config(chan, &cfg); |
| 1444 | if (ret) | 1444 | if (ret) |
| 1445 | return ret; | 1445 | return ret; |
diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c index c95ba83366a0..ed92ce729dde 100644 --- a/drivers/mmc/host/sdhci-st.c +++ b/drivers/mmc/host/sdhci-st.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | struct st_mmc_platform_data { | 29 | struct st_mmc_platform_data { |
| 30 | struct reset_control *rstc; | 30 | struct reset_control *rstc; |
| 31 | struct clk *icnclk; | ||
| 31 | void __iomem *top_ioaddr; | 32 | void __iomem *top_ioaddr; |
| 32 | }; | 33 | }; |
| 33 | 34 | ||
| @@ -353,7 +354,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
| 353 | struct sdhci_host *host; | 354 | struct sdhci_host *host; |
| 354 | struct st_mmc_platform_data *pdata; | 355 | struct st_mmc_platform_data *pdata; |
| 355 | struct sdhci_pltfm_host *pltfm_host; | 356 | struct sdhci_pltfm_host *pltfm_host; |
| 356 | struct clk *clk; | 357 | struct clk *clk, *icnclk; |
| 357 | int ret = 0; | 358 | int ret = 0; |
| 358 | u16 host_version; | 359 | u16 host_version; |
| 359 | struct resource *res; | 360 | struct resource *res; |
| @@ -365,6 +366,11 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
| 365 | return PTR_ERR(clk); | 366 | return PTR_ERR(clk); |
| 366 | } | 367 | } |
| 367 | 368 | ||
| 369 | /* ICN clock isn't compulsory, but use it if it's provided. */ | ||
| 370 | icnclk = devm_clk_get(&pdev->dev, "icn"); | ||
| 371 | if (IS_ERR(icnclk)) | ||
| 372 | icnclk = NULL; | ||
| 373 | |||
| 368 | rstc = devm_reset_control_get(&pdev->dev, NULL); | 374 | rstc = devm_reset_control_get(&pdev->dev, NULL); |
| 369 | if (IS_ERR(rstc)) | 375 | if (IS_ERR(rstc)) |
| 370 | rstc = NULL; | 376 | rstc = NULL; |
| @@ -389,6 +395,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
| 389 | } | 395 | } |
| 390 | 396 | ||
| 391 | clk_prepare_enable(clk); | 397 | clk_prepare_enable(clk); |
| 398 | clk_prepare_enable(icnclk); | ||
| 392 | 399 | ||
| 393 | /* Configure the FlashSS Top registers for setting eMMC TX/RX delay */ | 400 | /* Configure the FlashSS Top registers for setting eMMC TX/RX delay */ |
| 394 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, | 401 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, |
| @@ -400,6 +407,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
| 400 | } | 407 | } |
| 401 | 408 | ||
| 402 | pltfm_host->clk = clk; | 409 | pltfm_host->clk = clk; |
| 410 | pdata->icnclk = icnclk; | ||
| 403 | 411 | ||
| 404 | /* Configure the Arasan HC inside the flashSS */ | 412 | /* Configure the Arasan HC inside the flashSS */ |
| 405 | st_mmcss_cconfig(np, host); | 413 | st_mmcss_cconfig(np, host); |
| @@ -422,6 +430,7 @@ static int sdhci_st_probe(struct platform_device *pdev) | |||
| 422 | return 0; | 430 | return 0; |
| 423 | 431 | ||
| 424 | err_out: | 432 | err_out: |
| 433 | clk_disable_unprepare(icnclk); | ||
| 425 | clk_disable_unprepare(clk); | 434 | clk_disable_unprepare(clk); |
| 426 | err_of: | 435 | err_of: |
| 427 | sdhci_pltfm_free(pdev); | 436 | sdhci_pltfm_free(pdev); |
| @@ -442,6 +451,8 @@ static int sdhci_st_remove(struct platform_device *pdev) | |||
| 442 | 451 | ||
| 443 | ret = sdhci_pltfm_unregister(pdev); | 452 | ret = sdhci_pltfm_unregister(pdev); |
| 444 | 453 | ||
| 454 | clk_disable_unprepare(pdata->icnclk); | ||
| 455 | |||
| 445 | if (rstc) | 456 | if (rstc) |
| 446 | reset_control_assert(rstc); | 457 | reset_control_assert(rstc); |
| 447 | 458 | ||
| @@ -462,6 +473,7 @@ static int sdhci_st_suspend(struct device *dev) | |||
| 462 | if (pdata->rstc) | 473 | if (pdata->rstc) |
| 463 | reset_control_assert(pdata->rstc); | 474 | reset_control_assert(pdata->rstc); |
| 464 | 475 | ||
| 476 | clk_disable_unprepare(pdata->icnclk); | ||
| 465 | clk_disable_unprepare(pltfm_host->clk); | 477 | clk_disable_unprepare(pltfm_host->clk); |
| 466 | out: | 478 | out: |
| 467 | return ret; | 479 | return ret; |
| @@ -475,6 +487,7 @@ static int sdhci_st_resume(struct device *dev) | |||
| 475 | struct device_node *np = dev->of_node; | 487 | struct device_node *np = dev->of_node; |
| 476 | 488 | ||
| 477 | clk_prepare_enable(pltfm_host->clk); | 489 | clk_prepare_enable(pltfm_host->clk); |
| 490 | clk_prepare_enable(pdata->icnclk); | ||
| 478 | 491 | ||
| 479 | if (pdata->rstc) | 492 | if (pdata->rstc) |
| 480 | reset_control_deassert(pdata->rstc); | 493 | reset_control_deassert(pdata->rstc); |
