Skip to content

Commit f60342f

Browse files
committed
Merge tag 'mmc-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/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 ...
2 parents 5231804 + ef5332c commit f60342f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1382
-431
lines changed

Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ Required properties:
1212
- "amlogic,meson-gxbb-mmc"
1313
- "amlogic,meson-gxl-mmc"
1414
- "amlogic,meson-gxm-mmc"
15+
- "amlogic,meson-axg-mmc"
1516
- clocks : A list of phandle + clock-specifier pairs for the clocks listed in clock-names.
1617
- clock-names: Should contain the following:
1718
"core" - Main peripheral bus clock
1819
"clkin0" - Parent clock of internal mux
1920
"clkin1" - Other parent clock of internal mux
2021
The driver has an internal mux clock which switches between clkin0 and clkin1 depending on the
2122
clock rate requested by the MMC core.
23+
- resets : phandle of the internal reset line
2224

2325
Example:
2426

@@ -29,4 +31,5 @@ Example:
2931
clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, <&clkc CLKID_FCLK_DIV2>;
3032
clock-names = "core", "clkin0", "clkin1";
3133
pinctrl-0 = <&emmc_pins>;
34+
resets = <&reset RESET_SD_EMMC_A>;
3235
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
* Mellanox Bluefield SoC specific extensions to the Synopsys Designware
2+
Mobile Storage Host Controller
3+
4+
Read synopsys-dw-mshc.txt for more details
5+
6+
The Synopsys designware mobile storage host controller is used to interface
7+
a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
8+
differences between the core Synopsys dw mshc controller properties described
9+
by synopsys-dw-mshc.txt and the properties used by the Mellanox Bluefield SoC
10+
specific extensions to the Synopsys Designware Mobile Storage Host Controller.
11+
12+
Required Properties:
13+
14+
* compatible: should be one of the following.
15+
- "mellanox,bluefield-dw-mshc": for controllers with Mellanox Bluefield SoC
16+
specific extensions.
17+
18+
Example:
19+
20+
/* Mellanox Bluefield SoC MMC */
21+
mmc@6008000 {
22+
compatible = "mellanox,bluefield-dw-mshc";
23+
reg = <0x6008000 0x400>;
24+
interrupts = <32>;
25+
fifo-depth = <0x100>;
26+
clock-frequency = <24000000>;
27+
bus-width = <8>;
28+
cap-mmc-highspeed;
29+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
* Ingenic JZ47xx MMC controllers
2+
3+
This file documents the device tree properties used for the MMC controller in
4+
Ingenic JZ4740/JZ4780 SoCs. These are in addition to the core MMC properties
5+
described in mmc.txt.
6+
7+
Required properties:
8+
- compatible: Should be one of the following:
9+
- "ingenic,jz4740-mmc" for the JZ4740
10+
- "ingenic,jz4780-mmc" for the JZ4780
11+
- reg: Should contain the MMC controller registers location and length.
12+
- interrupts: Should contain the interrupt specifier of the MMC controller.
13+
- clocks: Clock for the MMC controller.
14+
15+
Optional properties:
16+
- dmas: List of DMA specifiers with the controller specific format
17+
as described in the generic DMA client binding. A tx and rx
18+
specifier is required.
19+
- dma-names: RX and TX DMA request names.
20+
Should be "rx" and "tx", in that order.
21+
22+
For additional details on DMA client bindings see ../dma/dma.txt.
23+
24+
Example:
25+
26+
mmc0: mmc@13450000 {
27+
compatible = "ingenic,jz4780-mmc";
28+
reg = <0x13450000 0x1000>;
29+
30+
interrupt-parent = <&intc>;
31+
interrupts = <37>;
32+
33+
clocks = <&cgu JZ4780_CLK_MSC0>;
34+
clock-names = "mmc";
35+
36+
dmas = <&dma JZ4780_DMA_MSC0_RX 0xffffffff>, <&dma JZ4780_DMA_MSC0_TX 0xffffffff>;
37+
dma-names = "rx", "tx";
38+
};

Documentation/devicetree/bindings/mmc/mmc.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Optional properties:
1919
- wp-gpios: Specify GPIOs for write protection, see gpio binding
2020
- cd-inverted: when present, polarity on the CD line is inverted. See the note
2121
below for the case, when a GPIO is used for the CD line
22+
- cd-debounce-delay-ms: Set delay time before detecting card after card insert interrupt.
23+
It's only valid when cd-gpios is present.
2224
- wp-inverted: when present, polarity on the WP line is inverted. See the note
2325
below for the case, when a GPIO is used for the WP line
2426
- disable-wp: When set no physical WP line is present. This property should
@@ -56,6 +58,10 @@ Optional properties:
5658
- fixed-emmc-driver-type: for non-removable eMMC, enforce this driver type.
5759
The value <n> is the driver type as specified in the eMMC specification
5860
(table 206 in spec version 5.1).
61+
- post-power-on-delay-ms : It was invented for MMC pwrseq-simple which could
62+
be referred to mmc-pwrseq-simple.txt. But now it's reused as a tunable delay
63+
waiting for I/O signalling and card power supply to be stable, regardless of
64+
whether pwrseq-simple is used. Default to 10ms if no available.
5965

6066
*NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
6167
polarity properties, we have to fix the meaning of the "normal" and "inverted"

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ Refer to mmc.txt for standard MMC bindings.
44

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

916
Example:
1017
mmc1: mmc@4809c000 {

Documentation/devicetree/bindings/mmc/tmio_mmc.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Required properties:
2626
"renesas,sdhi-r8a7794" - SDHI IP on R8A7794 SoC
2727
"renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
2828
"renesas,sdhi-r8a7796" - SDHI IP on R8A7796 SoC
29+
"renesas,sdhi-r8a77965" - SDHI IP on R8A77965 SoC
30+
"renesas,sdhi-r8a77980" - SDHI IP on R8A77980 SoC
2931
"renesas,sdhi-r8a77995" - SDHI IP on R8A77995 SoC
3032
"renesas,sdhi-shmobile" - a generic sh-mobile SDHI controller
3133
"renesas,rcar-gen1-sdhi" - a generic R-Car Gen1 SDHI controller

arch/mips/boot/dts/ingenic/ci20.dts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,28 @@
3636
clock-frequency = <48000000>;
3737
};
3838

39+
&mmc0 {
40+
status = "okay";
41+
42+
bus-width = <4>;
43+
max-frequency = <50000000>;
44+
45+
pinctrl-names = "default";
46+
pinctrl-0 = <&pins_mmc0>;
47+
48+
cd-gpios = <&gpf 20 GPIO_ACTIVE_LOW>;
49+
};
50+
51+
&mmc1 {
52+
status = "okay";
53+
54+
bus-width = <4>;
55+
max-frequency = <50000000>;
56+
57+
pinctrl-names = "default";
58+
pinctrl-0 = <&pins_mmc1>;
59+
};
60+
3961
&uart0 {
4062
status = "okay";
4163

@@ -203,4 +225,16 @@
203225
groups = "nemc-cs6";
204226
bias-disable;
205227
};
228+
229+
pins_mmc0: mmc0 {
230+
function = "mmc0";
231+
groups = "mmc0-1bit-e", "mmc0-4bit-e";
232+
bias-disable;
233+
};
234+
235+
pins_mmc1: mmc1 {
236+
function = "mmc1";
237+
groups = "mmc1-1bit-d", "mmc1-4bit-d";
238+
bias-disable;
239+
};
206240
};

arch/mips/boot/dts/ingenic/jz4780.dtsi

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <dt-bindings/clock/jz4780-cgu.h>
3+
#include <dt-bindings/dma/jz4780-dma.h>
34

45
/ {
56
#address-cells = <1>;
@@ -241,6 +242,57 @@
241242
status = "disabled";
242243
};
243244

245+
dma: dma@13420000 {
246+
compatible = "ingenic,jz4780-dma";
247+
reg = <0x13420000 0x10000>;
248+
#dma-cells = <2>;
249+
250+
interrupt-parent = <&intc>;
251+
interrupts = <10>;
252+
253+
clocks = <&cgu JZ4780_CLK_PDMA>;
254+
};
255+
256+
mmc0: mmc@13450000 {
257+
compatible = "ingenic,jz4780-mmc";
258+
reg = <0x13450000 0x1000>;
259+
260+
interrupt-parent = <&intc>;
261+
interrupts = <37>;
262+
263+
clocks = <&cgu JZ4780_CLK_MSC0>;
264+
clock-names = "mmc";
265+
266+
cap-sd-highspeed;
267+
cap-mmc-highspeed;
268+
cap-sdio-irq;
269+
dmas = <&dma JZ4780_DMA_MSC0_RX 0xffffffff>,
270+
<&dma JZ4780_DMA_MSC0_TX 0xffffffff>;
271+
dma-names = "rx", "tx";
272+
273+
status = "disabled";
274+
};
275+
276+
mmc1: mmc@13460000 {
277+
compatible = "ingenic,jz4780-mmc";
278+
reg = <0x13460000 0x1000>;
279+
280+
interrupt-parent = <&intc>;
281+
interrupts = <36>;
282+
283+
clocks = <&cgu JZ4780_CLK_MSC1>;
284+
clock-names = "mmc";
285+
286+
cap-sd-highspeed;
287+
cap-mmc-highspeed;
288+
cap-sdio-irq;
289+
dmas = <&dma JZ4780_DMA_MSC1_RX 0xffffffff>,
290+
<&dma JZ4780_DMA_MSC1_TX 0xffffffff>;
291+
dma-names = "rx", "tx";
292+
293+
status = "disabled";
294+
};
295+
244296
bch: bch@134d0000 {
245297
compatible = "ingenic,jz4780-bch";
246298
reg = <0x134d0000 0x10000>;

arch/mips/configs/ci20_defconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,14 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
104104
# CONFIG_HID is not set
105105
# CONFIG_USB_SUPPORT is not set
106106
CONFIG_MMC=y
107+
CONFIG_MMC_JZ4740=y
107108
CONFIG_RTC_CLASS=y
108109
CONFIG_RTC_DRV_JZ4740=y
110+
CONFIG_DMADEVICES=y
111+
CONFIG_DMA_JZ4780=y
109112
# CONFIG_IOMMU_SUPPORT is not set
110113
CONFIG_MEMORY=y
114+
CONFIG_EXT4_FS=y
111115
# CONFIG_DNOTIFY is not set
112116
CONFIG_PROC_KCORE=y
113117
# CONFIG_PROC_PAGE_MONITOR is not set

drivers/mmc/core/block.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,8 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
23512351
set_disk_ro(md->disk, md->read_only || default_ro);
23522352
md->disk->flags = GENHD_FL_EXT_DEVT;
23532353
if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
2354-
md->disk->flags |= GENHD_FL_NO_PART_SCAN;
2354+
md->disk->flags |= GENHD_FL_NO_PART_SCAN
2355+
| GENHD_FL_SUPPRESS_PARTITION_INFO;
23552356

23562357
/*
23572358
* As discussed on lkml, GENHD_FL_REMOVABLE should:
@@ -2965,9 +2966,11 @@ static void mmc_blk_remove(struct mmc_card *card)
29652966
mmc_blk_remove_debugfs(card, md);
29662967
mmc_blk_remove_parts(card, md);
29672968
pm_runtime_get_sync(&card->dev);
2968-
mmc_claim_host(card->host);
2969-
mmc_blk_part_switch(card, md->part_type);
2970-
mmc_release_host(card->host);
2969+
if (md->part_curr != md->part_type) {
2970+
mmc_claim_host(card->host);
2971+
mmc_blk_part_switch(card, md->part_type);
2972+
mmc_release_host(card->host);
2973+
}
29712974
if (card->type != MMC_TYPE_SD_COMBO)
29722975
pm_runtime_disable(&card->dev);
29732976
pm_runtime_put_noidle(&card->dev);

0 commit comments

Comments
 (0)