Skip to content

Commit

Permalink
Merge tag 'mmc-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/ulfh/mmc

Pull MMC updates from Ulf Hansson:
 "MMC core:
   - Decrease polling rate for erase/trim/discard
   - Allow non-sleeping GPIOs for card detect
   - Improve mmc block removal path
   - Enable support for mmc_sw_reset() for SDIO cards
   - Add mmc_sw_reset() to allow users to do a soft reset of the card
   - Allow power delay to be tunable via DT
   - Allow card detect debounce delay to be tunable via DT
   - Enable new quirk to limit clock rate for Marvell 8887 chip
   - Don't show eMMC RPMB and BOOT areas in /proc/partitions
   - Add capability to avoid 3.3V signaling for fragile HWs

  MMC host:
   - Improve/fixup support for handle highmem pages
   - Remove depends on HAS_DMA in case of platform dependency
   - mvsdio: Enable support for erase/trim/discard
   - rtsx_usb: Enable support for erase/trim/discard
   - renesas_sdhi: Fix WP logic regressions
   - renesas_sdhi: Add r8a77965 support
   - renesas_sdhi: Add R8A77980 to whitelist
   - meson: Add optional support for device reset
   - meson: Add support for the Meson-AXG platform
   - dw_mmc: Add new driver for BlueField DW variant
   - mediatek: Add support for 64G DRAM DMA
   - sunxi: Deploy runtime PM support
   - jz4740: Add support for JZ4780
   - jz4740: Enable support for DT based platforms
   - sdhci: Various improvement to timeout handling
   - sdhci: Disable support for HS200/HS400/UHS when no 1.8V support
   - sdhci-omap: Add support for controller in k2g SoC
   - sdhci-omap: Add workarounds for a couple of Erratas
   - sdhci-omap: Enable support for generic sdhci DT properties
   - sdhci-cadence: Re-send tune request to deal with errata
   - sdhci-pci: Fix 3.3V voltage switch for some BYT-based Intel controllers
   - sdhci-pci: Avoid 3.3V signaling on some NI 904x
   - sdhci-esdhc-imx: Use watermark levels for PIO access
   - sdhci-msm: Improve card detection handling
   - sdhci-msm: Add support voltage pad switching"

* tag 'mmc-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (104 commits)
  mmc: renesas_sdhi: really fix WP logic regressions
  mmc: mvsdio: Enable MMC_CAP_ERASE
  mmc: mvsdio: Respect card busy time out from mmc core
  mmc: sdhci-msm: Remove NO_CARD_NO_RESET quirk
  mmc: sunxi: Use ifdef rather than __maybe_unused
  mmc: mxmmc: Use ifdef rather than __maybe_unused
  mmc: mxmmc: include linux/highmem.h
  mmc: sunxi: mark PM functions as __maybe_unused
  mmc: Throttle calls to MMC_SEND_STATUS during mmc_do_erase()
  mmc: au1xmmc: handle highmem pages
  mmc: Allow non-sleeping GPIO cd
  mmc: sdhci-*: Don't emit error msg if sdhci_add_host() fails
  mmc: sd: Define name for default speed dtr
  mmc: core: Move calls to ->prepare_hs400_tuning() closer to mmc code
  mmc: sdhci-xenon: use match_string() helper
  mmc: wbsd: handle highmem pages
  mmc: ushc: handle highmem pages
  mmc: mxcmmc: handle highmem pages
  mmc: atmel-mci: use sg_copy_{from,to}_buffer
  mmc: android-goldfish: use sg_copy_{from,to}_buffer
  ...
  • Loading branch information
torvalds committed Jun 5, 2018
2 parents 5231804 + ef5332c commit f60342f
Show file tree
Hide file tree
Showing 66 changed files with 1,382 additions and 431 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ Required properties:
- "amlogic,meson-gxbb-mmc"
- "amlogic,meson-gxl-mmc"
- "amlogic,meson-gxm-mmc"
- "amlogic,meson-axg-mmc"
- clocks : A list of phandle + clock-specifier pairs for the clocks listed in clock-names.
- clock-names: Should contain the following:
"core" - Main peripheral bus clock
"clkin0" - Parent clock of internal mux
"clkin1" - Other parent clock of internal mux
The driver has an internal mux clock which switches between clkin0 and clkin1 depending on the
clock rate requested by the MMC core.
- resets : phandle of the internal reset line

Example:

Expand All @@ -29,4 +31,5 @@ Example:
clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, <&clkc CLKID_FCLK_DIV2>;
clock-names = "core", "clkin0", "clkin1";
pinctrl-0 = <&emmc_pins>;
resets = <&reset RESET_SD_EMMC_A>;
};
29 changes: 29 additions & 0 deletions Documentation/devicetree/bindings/mmc/bluefield-dw-mshc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
* Mellanox Bluefield SoC specific extensions to the Synopsys Designware
Mobile Storage Host Controller

Read synopsys-dw-mshc.txt for more details

The Synopsys designware mobile storage host controller is used to interface
a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
differences between the core Synopsys dw mshc controller properties described
by synopsys-dw-mshc.txt and the properties used by the Mellanox Bluefield SoC
specific extensions to the Synopsys Designware Mobile Storage Host Controller.

Required Properties:

* compatible: should be one of the following.
- "mellanox,bluefield-dw-mshc": for controllers with Mellanox Bluefield SoC
specific extensions.

Example:

/* Mellanox Bluefield SoC MMC */
mmc@6008000 {
compatible = "mellanox,bluefield-dw-mshc";
reg = <0x6008000 0x400>;
interrupts = <32>;
fifo-depth = <0x100>;
clock-frequency = <24000000>;
bus-width = <8>;
cap-mmc-highspeed;
};
38 changes: 38 additions & 0 deletions Documentation/devicetree/bindings/mmc/jz4740.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
* Ingenic JZ47xx MMC controllers

This file documents the device tree properties used for the MMC controller in
Ingenic JZ4740/JZ4780 SoCs. These are in addition to the core MMC properties
described in mmc.txt.

Required properties:
- compatible: Should be one of the following:
- "ingenic,jz4740-mmc" for the JZ4740
- "ingenic,jz4780-mmc" for the JZ4780
- reg: Should contain the MMC controller registers location and length.
- interrupts: Should contain the interrupt specifier of the MMC controller.
- clocks: Clock for the MMC controller.

Optional properties:
- dmas: List of DMA specifiers with the controller specific format
as described in the generic DMA client binding. A tx and rx
specifier is required.
- dma-names: RX and TX DMA request names.
Should be "rx" and "tx", in that order.

For additional details on DMA client bindings see ../dma/dma.txt.

Example:

mmc0: mmc@13450000 {
compatible = "ingenic,jz4780-mmc";
reg = <0x13450000 0x1000>;

interrupt-parent = <&intc>;
interrupts = <37>;

clocks = <&cgu JZ4780_CLK_MSC0>;
clock-names = "mmc";

dmas = <&dma JZ4780_DMA_MSC0_RX 0xffffffff>, <&dma JZ4780_DMA_MSC0_TX 0xffffffff>;
dma-names = "rx", "tx";
};
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/mmc/mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Optional properties:
- wp-gpios: Specify GPIOs for write protection, see gpio binding
- cd-inverted: when present, polarity on the CD line is inverted. See the note
below for the case, when a GPIO is used for the CD line
- cd-debounce-delay-ms: Set delay time before detecting card after card insert interrupt.
It's only valid when cd-gpios is present.
- wp-inverted: when present, polarity on the WP line is inverted. See the note
below for the case, when a GPIO is used for the WP line
- disable-wp: When set no physical WP line is present. This property should
Expand Down Expand Up @@ -56,6 +58,10 @@ Optional properties:
- fixed-emmc-driver-type: for non-removable eMMC, enforce this driver type.
The value <n> is the driver type as specified in the eMMC specification
(table 206 in spec version 5.1).
- post-power-on-delay-ms : It was invented for MMC pwrseq-simple which could
be referred to mmc-pwrseq-simple.txt. But now it's reused as a tunable delay
waiting for I/O signalling and card power supply to be stable, regardless of
whether pwrseq-simple is used. Default to 10ms if no available.

*NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
polarity properties, we have to fix the meaning of the "normal" and "inverted"
Expand Down
7 changes: 7 additions & 0 deletions Documentation/devicetree/bindings/mmc/sdhci-omap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ Refer to mmc.txt for standard MMC bindings.

Required properties:
- compatible: Should be "ti,dra7-sdhci" for DRA7 and DRA72 controllers
Should be "ti,k2g-sdhci" for K2G
- ti,hwmods: Must be "mmc<n>", <n> is controller instance starting 1
(Not required for K2G).
- pinctrl-names: Should be subset of "default", "hs", "sdr12", "sdr25", "sdr50",
"ddr50-rev11", "sdr104-rev11", "ddr50", "sdr104",
"ddr_1_8v-rev11", "ddr_1_8v" or "ddr_3_3v", "hs200_1_8v-rev11",
"hs200_1_8v",
- pinctrl-<n> : Pinctrl states as described in bindings/pinctrl/pinctrl-bindings.txt

Example:
mmc1: mmc@4809c000 {
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/mmc/tmio_mmc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Required properties:
"renesas,sdhi-r8a7794" - SDHI IP on R8A7794 SoC
"renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
"renesas,sdhi-r8a7796" - SDHI IP on R8A7796 SoC
"renesas,sdhi-r8a77965" - SDHI IP on R8A77965 SoC
"renesas,sdhi-r8a77980" - SDHI IP on R8A77980 SoC
"renesas,sdhi-r8a77995" - SDHI IP on R8A77995 SoC
"renesas,sdhi-shmobile" - a generic sh-mobile SDHI controller
"renesas,rcar-gen1-sdhi" - a generic R-Car Gen1 SDHI controller
Expand Down
34 changes: 34 additions & 0 deletions arch/mips/boot/dts/ingenic/ci20.dts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,28 @@
clock-frequency = <48000000>;
};

&mmc0 {
status = "okay";

bus-width = <4>;
max-frequency = <50000000>;

pinctrl-names = "default";
pinctrl-0 = <&pins_mmc0>;

cd-gpios = <&gpf 20 GPIO_ACTIVE_LOW>;
};

&mmc1 {
status = "okay";

bus-width = <4>;
max-frequency = <50000000>;

pinctrl-names = "default";
pinctrl-0 = <&pins_mmc1>;
};

&uart0 {
status = "okay";

Expand Down Expand Up @@ -203,4 +225,16 @@
groups = "nemc-cs6";
bias-disable;
};

pins_mmc0: mmc0 {
function = "mmc0";
groups = "mmc0-1bit-e", "mmc0-4bit-e";
bias-disable;
};

pins_mmc1: mmc1 {
function = "mmc1";
groups = "mmc1-1bit-d", "mmc1-4bit-d";
bias-disable;
};
};
52 changes: 52 additions & 0 deletions arch/mips/boot/dts/ingenic/jz4780.dtsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/clock/jz4780-cgu.h>
#include <dt-bindings/dma/jz4780-dma.h>

/ {
#address-cells = <1>;
Expand Down Expand Up @@ -241,6 +242,57 @@
status = "disabled";
};

dma: dma@13420000 {
compatible = "ingenic,jz4780-dma";
reg = <0x13420000 0x10000>;
#dma-cells = <2>;

interrupt-parent = <&intc>;
interrupts = <10>;

clocks = <&cgu JZ4780_CLK_PDMA>;
};

mmc0: mmc@13450000 {
compatible = "ingenic,jz4780-mmc";
reg = <0x13450000 0x1000>;

interrupt-parent = <&intc>;
interrupts = <37>;

clocks = <&cgu JZ4780_CLK_MSC0>;
clock-names = "mmc";

cap-sd-highspeed;
cap-mmc-highspeed;
cap-sdio-irq;
dmas = <&dma JZ4780_DMA_MSC0_RX 0xffffffff>,
<&dma JZ4780_DMA_MSC0_TX 0xffffffff>;
dma-names = "rx", "tx";

status = "disabled";
};

mmc1: mmc@13460000 {
compatible = "ingenic,jz4780-mmc";
reg = <0x13460000 0x1000>;

interrupt-parent = <&intc>;
interrupts = <36>;

clocks = <&cgu JZ4780_CLK_MSC1>;
clock-names = "mmc";

cap-sd-highspeed;
cap-mmc-highspeed;
cap-sdio-irq;
dmas = <&dma JZ4780_DMA_MSC1_RX 0xffffffff>,
<&dma JZ4780_DMA_MSC1_TX 0xffffffff>;
dma-names = "rx", "tx";

status = "disabled";
};

bch: bch@134d0000 {
compatible = "ingenic,jz4780-bch";
reg = <0x134d0000 0x10000>;
Expand Down
4 changes: 4 additions & 0 deletions arch/mips/configs/ci20_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,14 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_HID is not set
# CONFIG_USB_SUPPORT is not set
CONFIG_MMC=y
CONFIG_MMC_JZ4740=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_JZ4740=y
CONFIG_DMADEVICES=y
CONFIG_DMA_JZ4780=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_MEMORY=y
CONFIG_EXT4_FS=y
# CONFIG_DNOTIFY is not set
CONFIG_PROC_KCORE=y
# CONFIG_PROC_PAGE_MONITOR is not set
Expand Down
11 changes: 7 additions & 4 deletions drivers/mmc/core/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
set_disk_ro(md->disk, md->read_only || default_ro);
md->disk->flags = GENHD_FL_EXT_DEVT;
if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
md->disk->flags |= GENHD_FL_NO_PART_SCAN;
md->disk->flags |= GENHD_FL_NO_PART_SCAN
| GENHD_FL_SUPPRESS_PARTITION_INFO;

/*
* As discussed on lkml, GENHD_FL_REMOVABLE should:
Expand Down Expand Up @@ -2965,9 +2966,11 @@ static void mmc_blk_remove(struct mmc_card *card)
mmc_blk_remove_debugfs(card, md);
mmc_blk_remove_parts(card, md);
pm_runtime_get_sync(&card->dev);
mmc_claim_host(card->host);
mmc_blk_part_switch(card, md->part_type);
mmc_release_host(card->host);
if (md->part_curr != md->part_type) {
mmc_claim_host(card->host);
mmc_blk_part_switch(card, md->part_type);
mmc_release_host(card->host);
}
if (card->type != MMC_TYPE_SD_COMBO)
pm_runtime_disable(&card->dev);
pm_runtime_put_noidle(&card->dev);
Expand Down
6 changes: 6 additions & 0 deletions drivers/mmc/core/card.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
card->quirks &= ~data;
}

static inline void __maybe_unused add_limit_rate_quirk(struct mmc_card *card,
int data)
{
card->quirk_max_rate = data;
}

/*
* Quirk add/remove for MMC products.
*/
Expand Down
Loading

0 comments on commit f60342f

Please sign in to comment.