Skip to content

Commit

Permalink
Merge tag 'mmc-v4.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:
 "MMC core:
   - Add support for marking HPI as broken through devicetree
   - Enable runtime PM management of host devices
   - Remove the ->enable|disable() callbacks
   - Restructure code and cleanups
   - Refreshed some of the MMC sections in MAINTAINERS

  MMC host:
   - dw_mmc: HS400 mode support
   - dw_mmc: Add the cmd11 timer to detect a timeout
   - dw_mmc: Endian agnostic IO accessors
   - dw_mmc: Bugfixes
   - sh_mmcif: Add exclusion between cmd and interrupt
   - omap_hsmmc: Hibernation support
   - omap_hsmmc: Rework and simplify cover/card detect
   - omap_hsmmc: Stop using ->enable|disable() callbacks
   - atmel-mci: Endian agnostic IO
   - sunxi: Enable MMC_CAP_SDIO_IRQ
   - sdhci-st: Add support for the stih407 family silicon
   - sdhci-st: UHS card support in SDR104 mode
   - sdhci-st: HS200 mode support
   - sdhci-esdhc-imx: Use common mmc DT parser
   - sdhci-of-arasan: Use common mmc DT parser
   - sdhci-iproc: Add new driver for Broadcom IPROC SDHCI controller
   - sdhci-tegra: Convert to GPIO descriptors
   - sdhci-tegra: Optmize write_w path for tegra114 and later
   - sdhci-sirf: Update tuning procedure
   - sdhci: Fix card presence logic
   - sdhci: Cleanups and consolidation"

* tag 'mmc-v4.1' of git://git.linaro.org/people/ulf.hansson/mmc: (79 commits)
  mmc: sdhci-st: Update ST SDHCI binding documentation.
  mmc: sdhci-st: Update the quirks for this controller.
  mmc: sdhci-st: Add sdhci_st_set_uhs_signaling function.
  mmc: sdhci-st: Add st_mmcss_cconfig function to configure mmcss glue registers.
  mmc: sdhci-st: Add delay management functions for top registers (eMMC).
  mmc: sdhci-st: Add support for de-asserting reset signal and top regs resource
  mmc: sdhci-st: Add macros for register offsets and bitfields for mmcss glue regs
  mmc: sdhci-esdhc-imx: Call mmc_of_parse()
  mmc: dw_mmc: Add locking around cmd11 timer
  mmc: dw_mmc: Add a return in an unexpected cmd11 timeout
  mmc: dw_mmc: Increase cmd11 timeout to 500ms
  mmc: dw_mmc: fix fifo ordering in big endian
  mmc: dw_mmc: change idmac descriptor files to __le32
  mmc: dw_mmc: make IO accessors endian agnostic
  mmc: core: Convert the error field in struct mmc_command|data into an int
  mmc: sdhci-of-arasan: Call OF parsing for MMC
  mmc: sdhci-pci: fix 64 BIT DMA quirks for rtsx
  mmc: Add support for marking hpi as broken through devicetree
  mmc: sdhci-tegra: convert to use GPIO descriptors
  mmc: omap_hsmmc: use generic slot-gpio isr to manage card detect pin
  ...
  • Loading branch information
torvalds committed Apr 13, 2015
2 parents 1a370f4 + 69f0fb2 commit 8d9095c
Show file tree
Hide file tree
Showing 55 changed files with 1,692 additions and 892 deletions.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ N: Krishna Balasubramanian
E: [email protected]
D: Wrote SYS V IPC (part of standard kernel since 0.99.10)

N: Chris Ball
E: [email protected]
D: Former maintainer of the MMC/SD/SDIO subsystem.

N: Dario Ballabio
E: [email protected]
E: [email protected]
Expand Down
23 changes: 23 additions & 0 deletions Documentation/devicetree/bindings/mmc/brcm,sdhci-iproc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Broadcom IPROC SDHCI controller

This file documents differences between the core properties described
by mmc.txt and the properties that represent the IPROC SDHCI controller.

Required properties:
- compatible : Should be "brcm,sdhci-iproc-cygnus".
- clocks : The clock feeding the SDHCI controller.

Optional properties:
- sdhci,auto-cmd12: specifies that controller should use auto CMD12.

Example:

sdhci0: sdhci@0x18041000 {
compatible = "brcm,sdhci-iproc-cygnus";
reg = <0x18041000 0x100>;
interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&lcpll0_clks BCM_CYGNUS_LCPLL0_SDIO_CLK>;
bus-width = <4>;
sdhci,auto-cmd12;
no-1-8-v;
};
7 changes: 7 additions & 0 deletions Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Required Properties:
in transmit mode and CIU clock phase shift value in receive mode for double
data rate mode operation. Refer notes below for the order of the cells and the
valid values.
* samsung,dw-mshc-hs400-timing: Specifies the value of CIU TX and RX clock phase
shift value for hs400 mode operation.

Notes for the sdr-timing and ddr-timing values:

Expand All @@ -50,6 +52,9 @@ Required Properties:
- if CIU clock divider value is 0 (that is divide by 1), both tx and rx
phase shift clocks should be 0.

* samsung,read-strobe-delay: RCLK (Data strobe) delay to control HS400 mode
(Latency value for delay line in Read path)

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
Expand Down Expand Up @@ -82,5 +87,7 @@ Example:
samsung,dw-mshc-ciu-div = <3>;
samsung,dw-mshc-sdr-timing = <2 3>;
samsung,dw-mshc-ddr-timing = <1 2>;
samsung,dw-mshc-hs400-timing = <0 2>;
samsung,read-strobe-delay = <90>;
bus-width = <8>;
};
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/mmc/fsl-imx-esdhc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Optional properties:
to select a proper data sampling window in case the clock quality is not good
due to signal path is too long on the board. Please refer to eSDHC/uSDHC
chapter, DLL (Delay Line) section in RM for details.
- voltage-ranges : Specify the voltage range in case there are software
transparent level shifters on the outputs of the controller. Two cells are
required, first cell specifies minimum slot voltage (mV), second cell
specifies maximum slot voltage (mV). Several ranges could be specified.

Examples:

Expand Down
31 changes: 31 additions & 0 deletions Documentation/devicetree/bindings/mmc/mmc-card.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
mmc-card / eMMC bindings
------------------------

This documents describes the devicetree bindings for a mmc-host controller
child node describing a mmc-card / an eMMC, see "Use of Function subnodes"
in mmc.txt

Required properties:
-compatible : Must be "mmc-card"
-reg : Must be <0>

Optional properties:
-broken-hpi : Use this to indicate that the mmc-card has a broken hpi
implementation, and that hpi should not be used

Example:

&mmc2 {
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins_a>;
vmmc-supply = <&reg_vcc3v3>;
bus-width = <8>;
non-removable;
status = "okay";

mmccard: mmccard@0 {
reg = <0>;
compatible = "mmc-card";
broken-hpi;
};
};
100 changes: 90 additions & 10 deletions Documentation/devicetree/bindings/mmc/sdhci-st.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,62 @@ 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
- compatible: Must be "st,sdhci" and it can be compatible to "st,sdhci-stih407"
to set the internal glue logic used for configuring the MMC
subsystem (mmcss) inside the FlashSS (available in STiH407 SoC
family).

- clock-names: Should be "mmc".
See: Documentation/devicetree/bindings/resource-names.txt
- clocks: Phandle to the clock.
See: Documentation/devicetree/bindings/clock/clock-bindings.txt

- interrupts: One mmc interrupt should be described here.
- interrupt-names: Should be "mmcirq".

- pinctrl-names: A pinctrl state names "default" must be defined.
- pinctrl-0: Phandle referencing pin configuration of the sd/emmc controller.
See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt

- reg: This must provide the host controller base address and it can also
contain the FlashSS Top register for TX/RX delay used by the driver
to configure DLL inside the flashSS, if so reg-names must also be
specified.

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
- reg-names: Should be "mmc" and "top-mmc-delay". "top-mmc-delay" is optional
for eMMC on stih407 family silicon to configure DLL inside FlashSS.

- non-removable: Non-removable slot. Also used for configuring mmcss in STiH407 SoC
family.
See: Documentation/devicetree/bindings/mmc/mmc.txt.

- bus-width: Number of data lines.
See: Documentation/devicetree/bindings/mmc/mmc.txt.

- max-frequency: Can be 200MHz, 100Mz or 50MHz (default) and used for
configuring the CCONFIG3 in the mmcss.
See: Documentation/devicetree/bindings/mmc/mmc.txt.

- resets: Phandle and reset specifier pair to softreset line of HC IP.
See: Documentation/devicetree/bindings/reset/reset.txt

- vqmmc-supply: Phandle to the regulator dt node, mentioned as the vcc/vdd
supply in eMMC/SD specs.

- sd-uhs--sdr50: To enable the SDR50 in the mmcss.
See: Documentation/devicetree/bindings/mmc/mmc.txt.

- sd-uhs-sdr104: To enable the SDR104 in the mmcss.
See: Documentation/devicetree/bindings/mmc/mmc.txt.

- sd-uhs-ddr50: To enable the DDR50 in the mmcss.
See: Documentation/devicetree/bindings/mmc/mmc.txt.

Example:

/* Example stih416e eMMC configuration */

mmc0: sdhci@fe81e000 {
compatible = "st,sdhci";
status = "disabled";
Expand All @@ -29,5 +71,43 @@ mmc0: sdhci@fe81e000 {
pinctrl-0 = <&pinctrl_mmc0>;
clock-names = "mmc";
clocks = <&clk_s_a1_ls 1>;
bus-width = <8>
bus-width = <8>

/* Example SD stih407 family configuration */

mmc1: sdhci@09080000 {
compatible = "st,sdhci-stih407", "st,sdhci";
status = "disabled";
reg = <0x09080000 0x7ff>;
reg-names = "mmc";
interrupts = <GIC_SPI 90 IRQ_TYPE_NONE>;
interrupt-names = "mmcirq";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sd1>;
clock-names = "mmc";
clocks = <&clk_s_c0_flexgen CLK_MMC_1>;
resets = <&softreset STIH407_MMC1_SOFTRESET>;
bus-width = <4>;
};

/* Example eMMC stih407 family configuration */

mmc0: sdhci@09060000 {
compatible = "st,sdhci-stih407", "st,sdhci";
status = "disabled";
reg = <0x09060000 0x7ff>, <0x9061008 0x20>;
reg-names = "mmc", "top-mmc-delay";
interrupts = <GIC_SPI 92 IRQ_TYPE_NONE>;
interrupt-names = "mmcirq";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc0>;
clock-names = "mmc";
clocks = <&clk_s_c0_flexgen CLK_MMC_0>;
vqmmc-supply = <&vmmc_reg>;
max-frequency = <200000000>;
bus-width = <8>;
non-removable;
sd-uhs-sdr50;
sd-uhs-sdr104;
sd-uhs-ddr50;
};
16 changes: 3 additions & 13 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6566,10 +6566,8 @@ F: drivers/mfd/
F: include/linux/mfd/

MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
M: Chris Ball <[email protected]>
M: Ulf Hansson <[email protected]>
L: [email protected]
T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
T: git git://git.linaro.org/people/ulf.hansson/mmc.git
S: Maintained
F: drivers/mmc/
Expand Down Expand Up @@ -8670,10 +8668,8 @@ S: Maintained
F: drivers/mmc/host/sdricoh_cs.c

SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
M: Chris Ball <[email protected]>
L: [email protected]
T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
S: Maintained
S: Orphan
F: drivers/mmc/host/sdhci.*
F: drivers/mmc/host/sdhci-pltfm.[ch]

Expand All @@ -8689,18 +8685,12 @@ F: include/linux/seccomp.h
K: \bsecure_computing
K: \bTIF_SECCOMP\b

SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
M: Anton Vorontsov <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
F: drivers/mmc/host/sdhci-pltfm.[ch]

SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER
M: Ben Dooks <[email protected]>
M: Jaehoon Chung <[email protected]>
L: [email protected]
S: Maintained
F: drivers/mmc/host/sdhci-s3c.c
F: drivers/mmc/host/sdhci-s3c*

SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) ST SPEAR DRIVER
M: Viresh Kumar <[email protected]>
Expand Down
33 changes: 25 additions & 8 deletions arch/arm/mach-omap2/hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,13 @@ static int nop_mmc_set_power(struct device *dev, int power_on, int vdd)
static inline void omap_hsmmc_mux(struct omap_hsmmc_platform_data
*mmc_controller, int controller_nr)
{
if (gpio_is_valid(mmc_controller->switch_pin) &&
(mmc_controller->switch_pin < OMAP_MAX_GPIO_LINES))
omap_mux_init_gpio(mmc_controller->switch_pin,
if (gpio_is_valid(mmc_controller->gpio_cd) &&
(mmc_controller->gpio_cd < OMAP_MAX_GPIO_LINES))
omap_mux_init_gpio(mmc_controller->gpio_cd,
OMAP_PIN_INPUT_PULLUP);
if (gpio_is_valid(mmc_controller->gpio_cod) &&
(mmc_controller->gpio_cod < OMAP_MAX_GPIO_LINES))
omap_mux_init_gpio(mmc_controller->gpio_cod,
OMAP_PIN_INPUT_PULLUP);
if (gpio_is_valid(mmc_controller->gpio_wp) &&
(mmc_controller->gpio_wp < OMAP_MAX_GPIO_LINES))
Expand Down Expand Up @@ -250,15 +254,20 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
mmc->internal_clock = !c->ext_clock;
mmc->reg_offset = 0;

mmc->switch_pin = c->gpio_cd;
if (c->cover_only) {
/* detect if mobile phone cover removed */
mmc->gpio_cd = -EINVAL;
mmc->gpio_cod = c->gpio_cd;
} else {
/* card detect pin on the mmc socket itself */
mmc->gpio_cd = c->gpio_cd;
mmc->gpio_cod = -EINVAL;
}
mmc->gpio_wp = c->gpio_wp;

mmc->remux = c->remux;
mmc->init_card = c->init_card;

if (c->cover_only)
mmc->cover = 1;

if (c->nonremovable)
mmc->nonremovable = 1;

Expand Down Expand Up @@ -358,7 +367,15 @@ void omap_hsmmc_late_init(struct omap2_hsmmc_info *c)
if (!mmc_pdata)
continue;

mmc_pdata->switch_pin = c->gpio_cd;
if (c->cover_only) {
/* detect if mobile phone cover removed */
mmc_pdata->gpio_cd = -EINVAL;
mmc_pdata->gpio_cod = c->gpio_cd;
} else {
/* card detect pin on the mmc socket itself */
mmc_pdata->gpio_cd = c->gpio_cd;
mmc_pdata->gpio_cod = -EINVAL;
}
mmc_pdata->gpio_wp = c->gpio_wp;

res = omap_device_register(pdev);
Expand Down
15 changes: 9 additions & 6 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ int __mmc_claim_host(struct mmc_host *host, atomic_t *abort)
DECLARE_WAITQUEUE(wait, current);
unsigned long flags;
int stop;
bool pm = false;

might_sleep();

Expand All @@ -916,15 +917,18 @@ int __mmc_claim_host(struct mmc_host *host, atomic_t *abort)
host->claimed = 1;
host->claimer = current;
host->claim_cnt += 1;
if (host->claim_cnt == 1)
pm = true;
} else
wake_up(&host->wq);
spin_unlock_irqrestore(&host->lock, flags);
remove_wait_queue(&host->wq, &wait);
if (host->ops->enable && !stop && host->claim_cnt == 1)
host->ops->enable(host);

if (pm)
pm_runtime_get_sync(mmc_dev(host));

return stop;
}

EXPORT_SYMBOL(__mmc_claim_host);

/**
Expand All @@ -940,9 +944,6 @@ void mmc_release_host(struct mmc_host *host)

WARN_ON(!host->claimed);

if (host->ops->disable && host->claim_cnt == 1)
host->ops->disable(host);

spin_lock_irqsave(&host->lock, flags);
if (--host->claim_cnt) {
/* Release for nested claim */
Expand All @@ -952,6 +953,8 @@ void mmc_release_host(struct mmc_host *host)
host->claimer = NULL;
spin_unlock_irqrestore(&host->lock, flags);
wake_up(&host->wq);
pm_runtime_mark_last_busy(mmc_dev(host));
pm_runtime_put_autosuspend(mmc_dev(host));
}
}
EXPORT_SYMBOL(mmc_release_host);
Expand Down
Loading

0 comments on commit 8d9095c

Please sign in to comment.