Skip to content

Commit

Permalink
Merge tag 'mmc-v3.17-1' of git://git.linaro.org/people/ulf.hansson/mmc
Browse files Browse the repository at this point in the history
Pull MMC updates from Ulf Hansson:
 "Me and Chris Ball decided to try out using my MMC tree as the primary
  one, to simplify handling of patches.

  This pull does thus contains all the MMC patches for 3.17 rc1, no pull
  from Chris this time.

  Details:

  MMC core:
   - forward compatibility for eMMC
   - fix some blacklisted cards with broken secure discard

  MMC host:
   - mmci: Add support for Qualcomm variant
   - mmci: Fix regression for arm_variant
   - sdhci: Various fixes and cleanups
   - sdhci: Improve external VDD regulator support
   - sdhci: Support for DDR50 1.8V mode for BayTrail
   - sdhci-st: Add driver for ST SDHCI controller
   - sh-mmcif: DMA fixes
   - omap_hsmmc: Add support for SDIO interrupts
   - sdhci-pci: Add support for Intel Quark X1000
   - dw_mmc: Update the reset sequence
   - s3cmci: port DMA code to dmaengine API"

* tag 'mmc-v3.17-1' of git://git.linaro.org/people/ulf.hansson/mmc: (67 commits)
  mmc: dw_mmc: modify the dt-binding for removing slot-node and supports-highspeed
  mmc: dw_mmc: Slot quirk "disable-wp" is deprecated.
  mmc: mmci: Reverse IRQ handling for the arm_variant
  mmc: mmci: Move all CMD irq handling to mmci_cmd_irq()
  mmc: mmci: Remove redundant check of status for DATA irq
  mmc: dw_mmc: change to use recommended reset procedure
  mmc: sdhci-pxav3: Use devm_* managed helpers
  mmc: tmio: Configure DMA slave bus width
  mmc: sh_mmcif: Configure DMA slave bus width
  mmc: sh_mmcif: Fix DMA slave address configuration
  mmc: sh_mmcif: Document DT bindings
  mmc: sdhci-pci: remove PCI PM functions in suspend/resume callback
  mmc: Do not advertise secure discard if it is blacklisted
  mmc: sdhci-msm: Get COMPILE_TEST support
  mmc: sdhci-msm: Remove unnecessary header file inclusion
  mmc: sdhci-msm: Fix the binding example
  mmc: sdhci: add DDR50 1.8V mode support for BayTrail eMMC Controller
  mmc: sdhci: Preset value not supported in Baytrail eMMC
  mmc: MMC_USDHI6ROL0 should depend on HAS_DMA
  mmc: MMC_SH_MMCIF should depend on HAS_DMA
  ...
  • Loading branch information
torvalds committed Aug 14, 2014
2 parents d429a36 + c83c873 commit a8e4def
Show file tree
Hide file tree
Showing 40 changed files with 1,050 additions and 471 deletions.
17 changes: 5 additions & 12 deletions Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ Required Properties:
- if CIU clock divider value is 0 (that is divide by 1), both tx and rx
phase shift clocks should be 0.

Required properties for a slot:
Required properties for a slot (Deprecated - Recommend to use one slot per host):

* gpios: specifies a list of gpios used for command, clock and data bus. The
first gpio is the command line and the second gpio is the clock line. The
rest of the gpios (depending on the bus-width property) are the data lines in
no particular order. The format of the gpio specifier depends on the gpio
controller.
(Deprecated - Refer to Documentation/devicetree/binding/pinctrl/samsung-pinctrl.txt)

Example:

Expand All @@ -69,21 +70,13 @@ Example:

dwmmc0@12200000 {
num-slots = <1>;
supports-highspeed;
cap-mmc-highspeed;
cap-sd-highspeed;
broken-cd;
fifo-depth = <0x80>;
card-detect-delay = <200>;
samsung,dw-mshc-ciu-div = <3>;
samsung,dw-mshc-sdr-timing = <2 3>;
samsung,dw-mshc-ddr-timing = <1 2>;

slot@0 {
reg = <0>;
bus-width = <8>;
gpios = <&gpc0 0 2 0 3>, <&gpc0 1 2 0 3>,
<&gpc1 0 2 3 3>, <&gpc1 1 2 3 3>,
<&gpc1 2 2 3 3>, <&gpc1 3 2 3 3>,
<&gpc0 3 2 3 3>, <&gpc0 4 2 3 3>,
<&gpc0 5 2 3 3>, <&gpc0 6 2 3 3>;
};
bus-width = <8>;
};
12 changes: 5 additions & 7 deletions Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ Example:
num-slots = <1>;
vmmc-supply = <&ldo12>;
fifo-depth = <0x100>;
supports-highspeed;
pinctrl-names = "default";
pinctrl-0 = <&sd_pmx_pins &sd_cfg_func1 &sd_cfg_func2>;
slot@0 {
reg = <0>;
bus-width = <4>;
disable-wp;
cd-gpios = <&gpio10 3 0>;
};
bus-width = <4>;
disable-wp;
cd-gpios = <&gpio10 3 0>;
cap-mmc-highspeed;
cap-sd-highspeed;
};
4 changes: 2 additions & 2 deletions Documentation/devicetree/bindings/mmc/mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Optional properties:
- cap-power-off-card: powering off the card is safe
- cap-sdio-irq: enable SDIO IRQ signalling on this interface
- full-pwr-cycle: full power cycle of the card is supported
- mmc-highspeed-ddr-1_8v: eMMC high-speed DDR mode(1.8V I/O) is supported
- mmc-highspeed-ddr-1_2v: eMMC high-speed DDR mode(1.2V I/O) is supported
- mmc-ddr-1_8v: eMMC high-speed DDR mode(1.8V I/O) is supported
- mmc-ddr-1_2v: eMMC high-speed DDR mode(1.2V I/O) is supported
- mmc-hs200-1_8v: eMMC HS200 mode(1.8V I/O) is supported
- mmc-hs200-1_2v: eMMC HS200 mode(1.2V I/O) is supported
- mmc-hs400-1_8v: eMMC HS400 mode(1.8V I/O) is supported
Expand Down
32 changes: 32 additions & 0 deletions Documentation/devicetree/bindings/mmc/renesas,mmcif.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
* Renesas Multi Media Card Interface (MMCIF) Controller

This file documents differences between the core properties in mmc.txt
and the properties used by the MMCIF device.


Required properties:

- compatible: must contain one of the following
- "renesas,mmcif-r8a7740" for the MMCIF found in r8a7740 SoCs
- "renesas,mmcif-r8a7790" for the MMCIF found in r8a7790 SoCs
- "renesas,mmcif-r8a7791" for the MMCIF found in r8a7791 SoCs
- "renesas,sh-mmcif" for the generic MMCIF

- clocks: reference to the functional clock

- dmas: reference to the DMA channels, one per channel name listed in the
dma-names property.
- dma-names: must contain "tx" for the transmit DMA channel and "rx" for the
receive DMA channel.


Example: R8A7790 (R-Car H2) MMCIF0

mmcif0: mmc@ee200000 {
compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif";
reg = <0 0xee200000 0 0x80>;
interrupts = <0 169 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mstp3_clks R8A7790_CLK_MMCIF0>;
dmas = <&dmac0 0xd1>, <&dmac0 0xd2>;
dma-names = "tx", "rx";
};
8 changes: 4 additions & 4 deletions Documentation/devicetree/bindings/mmc/sdhci-msm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Example:
bus-width = <8>;
non-removable;

vmmc = <&pm8941_l20>;
vqmmc = <&pm8941_s3>;
vmmc-supply = <&pm8941_l20>;
vqmmc-supply = <&pm8941_s3>;

pinctrl-names = "default";
pinctrl-0 = <&sdc1_clk &sdc1_cmd &sdc1_data>;
Expand All @@ -44,8 +44,8 @@ Example:
bus-width = <4>;
cd-gpios = <&msmgpio 62 0x1>;

vmmc = <&pm8941_l21>;
vqmmc = <&pm8941_l13>;
vmmc-supply = <&pm8941_l21>;
vqmmc-supply = <&pm8941_l13>;

pinctrl-names = "default";
pinctrl-0 = <&sdc2_clk &sdc2_cmd &sdc2_data>;
Expand Down
33 changes: 33 additions & 0 deletions Documentation/devicetree/bindings/mmc/sdhci-st.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
* STMicroelectronics sdhci-st MMC/SD controller

This file documents the differences between the core properties in
Documentation/devicetree/bindings/mmc/mmc.txt and the properties
used by the sdhci-st driver.

Required properties:
- compatible : Must be "st,sdhci"
- clock-names : Should be "mmc"
See: Documentation/devicetree/bindings/resource-names.txt
- clocks : Phandle of the clock used by the sdhci controler
See: Documentation/devicetree/bindings/clock/clock-bindings.txt

Optional properties:
- non-removable: non-removable slot
See: Documentation/devicetree/bindings/mmc/mmc.txt
- bus-width: Number of data lines
See: Documentation/devicetree/bindings/mmc/mmc.txt

Example:

mmc0: sdhci@fe81e000 {
compatible = "st,sdhci";
status = "disabled";
reg = <0xfe81e000 0x1000>;
interrupts = <GIC_SPI 127 IRQ_TYPE_NONE>;
interrupt-names = "mmcirq";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc0>;
clock-names = "mmc";
clocks = <&clk_s_a1_ls 1>;
bus-width = <8>
};
12 changes: 5 additions & 7 deletions Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ Optional properties:
* card-detect-delay: Delay in milli-seconds before detecting card after card
insert event. The default value is 0.

* supports-highspeed: Enables support for high speed cards (up to 50MHz)
* supports-highspeed (DEPRECATED): Enables support for high speed cards (up to 50MHz)
(use "cap-mmc-highspeed" or "cap-sd-highspeed" instead)

* broken-cd: as documented in mmc core bindings.

Expand Down Expand Up @@ -98,14 +99,11 @@ board specific portions as listed below.
clock-frequency = <400000000>;
clock-freq-min-max = <400000 200000000>;
num-slots = <1>;
supports-highspeed;
broken-cd;
fifo-depth = <0x80>;
card-detect-delay = <200>;
vmmc-supply = <&buck8>;

slot@0 {
reg = <0>;
bus-width = <8>;
};
bus-width = <8>;
cap-mmc-highspeed;
cap-sd-highspeed;
};
54 changes: 54 additions & 0 deletions Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Required properties:
Should be "ti,omap3-hsmmc", for OMAP3 controllers
Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0
Should be "ti,omap4-hsmmc", for OMAP4 controllers
Should be "ti,am33xx-hsmmc", for AM335x controllers
- ti,hwmods: Must be "mmc<n>", n is controller instance starting 1

Optional properties:
Expand Down Expand Up @@ -56,3 +57,56 @@ Examples:
&edma 25>;
dma-names = "tx", "rx";
};

[workaround for missing swakeup on am33xx]

This SOC is missing the swakeup line, it will not detect SDIO irq
while in suspend.

------
| PRCM |
------
^ |
swakeup | | fclk
| v
------ ------- -----
| card | -- CIRQ --> | hsmmc | -- IRQ --> | CPU |
------ ------- -----

In suspend the fclk is off and the module is disfunctional. Even register reads
will fail. A small logic in the host will request fclk restore, when an
external event is detected. Once the clock is restored, the host detects the
event normally. Since am33xx doesn't have this line it never wakes from
suspend.

The workaround is to reconfigure the dat1 line as a GPIO upon suspend. To make
this work, we need to set the named pinctrl states "default" and "idle".
Prepare idle to remux dat1 as a gpio, and default to remux it back as sdio
dat1. The MMC driver will then toggle between idle and default state during
runtime.

In summary:
1. select matching 'compatible' section, see example below.
2. specify pinctrl states "default" and "idle", "sleep" is optional.
3. specify the gpio irq used for detecting sdio irq in suspend

If configuration is incomplete, a warning message is emitted "falling back to
polling". Also check the "sdio irq mode" in /sys/kernel/debug/mmc0/regs. Mind
not every application needs SDIO irq, e.g. MMC cards.

mmc1: mmc@48060100 {
compatible = "ti,am33xx-hsmmc";
...
pinctrl-names = "default", "idle", "sleep"
pinctrl-0 = <&mmc1_pins>;
pinctrl-1 = <&mmc1_idle>;
pinctrl-2 = <&mmc1_sleep>;
...
interrupts-extended = <&intc 64 &gpio2 28 0>;
};

mmc1_idle : pinmux_cirq_pin {
pinctrl-single,pins = <
0x0f8 0x3f /* GPIO2_28 */
>;
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/mmc/tmio_mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Required properties:
"renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC
"renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC
"renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC
"renesas,sdhi-r8a7791" - SDHI IP on R8A7791 SoC

Optional properties:
- toshiba,mmc-wrprotect-disable: write-protect detection is unavailable
6 changes: 3 additions & 3 deletions drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -2028,8 +2028,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
/* complete ongoing async transfer before issuing discard */
if (card->host->areq)
mmc_blk_issue_rw_rq(mq, NULL);
if (req->cmd_flags & REQ_SECURE &&
!(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN))
if (req->cmd_flags & REQ_SECURE)
ret = mmc_blk_issue_secdiscard_rq(mq, req);
else
ret = mmc_blk_issue_discard_rq(mq, req);
Expand Down Expand Up @@ -2432,6 +2431,8 @@ static int mmc_blk_probe(struct mmc_card *card)
if (!(card->csd.cmdclass & CCC_BLOCK_READ))
return -ENODEV;

mmc_fixup_device(card, blk_fixups);

md = mmc_blk_alloc(card);
if (IS_ERR(md))
return PTR_ERR(md);
Expand All @@ -2446,7 +2447,6 @@ static int mmc_blk_probe(struct mmc_card *card)
goto out;

mmc_set_drvdata(card, md);
mmc_fixup_device(card, blk_fixups);

if (mmc_add_disk(md))
goto out;
Expand Down
10 changes: 1 addition & 9 deletions drivers/mmc/core/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ static int mmc_bus_resume(struct device *dev)
#endif

#ifdef CONFIG_PM_RUNTIME

static int mmc_runtime_suspend(struct device *dev)
{
struct mmc_card *card = mmc_dev_to_card(dev);
Expand All @@ -196,17 +195,10 @@ static int mmc_runtime_resume(struct device *dev)

return host->bus_ops->runtime_resume(host);
}

static int mmc_runtime_idle(struct device *dev)
{
return 0;
}

#endif /* !CONFIG_PM_RUNTIME */

static const struct dev_pm_ops mmc_bus_pm_ops = {
SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume,
mmc_runtime_idle)
SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume, NULL)
SET_SYSTEM_SLEEP_PM_OPS(mmc_bus_suspend, mmc_bus_resume)
};

Expand Down
3 changes: 2 additions & 1 deletion drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,8 @@ EXPORT_SYMBOL(mmc_can_sanitize);

int mmc_can_secure_erase_trim(struct mmc_card *card)
{
if (card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN)
if ((card->ext_csd.sec_feature_support & EXT_CSD_SEC_ER_EN) &&
!(card->quirks & MMC_QUIRK_SEC_ERASE_TRIM_BROKEN))
return 1;
return 0;
}
Expand Down
11 changes: 5 additions & 6 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,12 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
}
}

/*
* The EXT_CSD format is meant to be forward compatible. As long
* as CSD_STRUCTURE does not change, all values for EXT_CSD_REV
* are authorized, see JEDEC JESD84-B50 section B.8.
*/
card->ext_csd.rev = ext_csd[EXT_CSD_REV];
if (card->ext_csd.rev > 7) {
pr_err("%s: unrecognised EXT_CSD revision %d\n",
mmc_hostname(card->host), card->ext_csd.rev);
err = -EINVAL;
goto out;
}

card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0];
card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1];
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/core/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table)
(f->cis_device == card->cis.device ||
f->cis_device == (u16) SDIO_ANY_ID) &&
rev >= f->rev_start && rev <= f->rev_end) {
dev_dbg(&card->dev, "calling %pF\n", f->vendor_fixup);
dev_dbg(&card->dev, "calling %pf\n", f->vendor_fixup);
f->vendor_fixup(card, f->data);
}
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/mmc/core/sd_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
mmc_delay(10);
}

if (!i)
pr_err("%s: card never left busy state\n", mmc_hostname(host));

if (rocr && !mmc_host_is_spi(host))
*rocr = cmd.resp[0];

Expand Down
Loading

0 comments on commit a8e4def

Please sign in to comment.