Skip to content

Commit 15d8ffc

Browse files
committed
Merge tag 'mmc-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC updates from Ulf Hansson: "MMC core: - Continue to refactor the mmc block code to prepare for blkmq - Move mmc block debugfs into block module - Next step for eMMC CMDQ by adding a new mmc host interface for it - Move Kconfig option MMC_DEBUG from core to host - Some additional minor improvements MMC host: - Declare structs as const when applicable - Explicitly request exclusive reset control when applicable - Improve some error paths and other various cleanups - sdhci: Preparations to support SDHCI OMAP - sdhci: Improve some PM related code - sdhci: Re-factoring and modernizations - sdhci-xenon: Add runtime PM and system sleep support - sdhci-xenon: Add support for eMMC HS400 Enhanced Strobe - sdhci-cadence: Add system sleep support - sdhci-of-at91: Improve system sleep support - dw_mmc: Add support for Hisilicon hi3660 - sunxi: Add support for A83T eMMC - sunxi: Add support for DDR52 mode - meson-gx: Add support for UHS-I SD-cards - meson-gx: Cleanups and improvements - tmio: Fix CMD12 (STOP) handling - tmio: Cleanups and improvements - renesas_sdhi: Add r8a7743/5 support - renesas-sdhi: Add support for R-Car Gen3 SDHI DMAC - renesas_sdhi: Cleanups and improvements" * tag 'mmc-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (145 commits) mmc: renesas_sdhi: Add r8a7743/5 support mmc: meson-gx: fix __ffsdi2 undefined on arm32 mmc: sdhci-xenon: add runtime pm support and reimplement standby mmc: core: Move mmc_start_areq() declaration mmc: mmci: stop building qcom dml as module mmc: sunxi: Reset the device at probe time clk: sunxi-ng: Provide a default reset hook mmc: meson-gx: rework tuning function mmc: meson-gx: change default tx phase mmc: meson-gx: implement voltage switch callback mmc: meson-gx: use CCF to handle the clock phases mmc: meson-gx: implement card_busy callback mmc: meson-gx: simplify interrupt handler mmc: meson-gx: work around clk-stop issue mmc: meson-gx: fix dual data rate mode frequencies mmc: meson-gx: rework clock init function mmc: meson-gx: rework clk_set function mmc: meson-gx: rework set_ios function mmc: meson-gx: cfg init overwrite values mmc: meson-gx: initialize sane clk default before clock register ...
2 parents a0725ab + c16a854 commit 15d8ffc

91 files changed

Lines changed: 2559 additions & 997 deletions

Some content is hidden

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

‎Documentation/devicetree/bindings/mmc/renesas,mmcif.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Required properties:
1111
- "renesas,mmcif-r7s72100" for the MMCIF found in r7s72100 SoCs
1212
- "renesas,mmcif-r8a73a4" for the MMCIF found in r8a73a4 SoCs
1313
- "renesas,mmcif-r8a7740" for the MMCIF found in r8a7740 SoCs
14+
- "renesas,mmcif-r8a7743" for the MMCIF found in r8a7743 SoCs
15+
- "renesas,mmcif-r8a7745" for the MMCIF found in r8a7745 SoCs
1416
- "renesas,mmcif-r8a7778" for the MMCIF found in r8a7778 SoCs
1517
- "renesas,mmcif-r8a7790" for the MMCIF found in r8a7790 SoCs
1618
- "renesas,mmcif-r8a7791" for the MMCIF found in r8a7791 SoCs
@@ -21,7 +23,7 @@ Required properties:
2123
- interrupts: Some SoCs have only 1 shared interrupt, while others have either
2224
2 or 3 individual interrupts (error, int, card detect). Below is the number
2325
of interrupts for each SoC:
24-
1: r8a73a4, r8a7778, r8a7790, r8a7791, r8a7793, r8a7794
26+
1: r8a73a4, r8a7743, r8a7745, r8a7778, r8a7790, r8a7791, r8a7793, r8a7794
2527
2: r8a7740, sh73a0
2628
3: r7s72100
2729

‎Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Required Properties:
1515
- "rockchip,rk3288-dw-mshc": for Rockchip RK3288
1616
- "rockchip,rv1108-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RV1108
1717
- "rockchip,rk3036-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3036
18+
- "rockchip,rk3228-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK322x
1819
- "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3328
1920
- "rockchip,rk3368-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3368
2021
- "rockchip,rk3399-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3399

‎Documentation/devicetree/bindings/mmc/sunxi-mmc.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Required properties:
1212
* "allwinner,sun4i-a10-mmc"
1313
* "allwinner,sun5i-a13-mmc"
1414
* "allwinner,sun7i-a20-mmc"
15+
* "allwinner,sun8i-a83t-emmc"
1516
* "allwinner,sun9i-a80-mmc"
1617
* "allwinner,sun50i-a64-emmc"
1718
* "allwinner,sun50i-a64-mmc"

‎Documentation/devicetree/bindings/mmc/tmio_mmc.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Required properties:
1515
"renesas,sdhi-r7s72100" - SDHI IP on R7S72100 SoC
1616
"renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
1717
"renesas,sdhi-r8a7740" - SDHI IP on R8A7740 SoC
18+
"renesas,sdhi-r8a7743" - SDHI IP on R8A7743 SoC
19+
"renesas,sdhi-r8a7745" - SDHI IP on R8A7745 SoC
1820
"renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC
1921
"renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC
2022
"renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC
@@ -33,10 +35,8 @@ Required properties:
3335
If 2 clocks are specified by the hardware, you must name them as
3436
"core" and "cd". If the controller only has 1 clock, naming is not
3537
required.
36-
Below is the number clocks for each supported SoC:
37-
1: SH73A0, R8A73A4, R8A7740, R8A7778, R8A7779, R8A7790
38-
R8A7791, R8A7792, R8A7793, R8A7794, R8A7795, R8A7796
39-
2: R7S72100
38+
Devices which have more than 1 clock are listed below:
39+
2: R7S72100
4040

4141
Optional properties:
4242
- toshiba,mmc-wrprotect-disable: write-protect detection is unavailable

‎arch/arc/boot/dts/axs10x_mb.dtsi‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@
101101
mmc@0x15000 {
102102
compatible = "altr,socfpga-dw-mshc";
103103
reg = < 0x15000 0x400 >;
104-
num-slots = < 1 >;
105104
fifo-depth = < 16 >;
106105
card-detect-delay = < 200 >;
107106
clocks = <&apbclk>, <&mmcclk>;

‎arch/arc/boot/dts/vdk_axs10x_mb.dtsi‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@
104104
mmc@0x15000 {
105105
compatible = "snps,dw-mshc";
106106
reg = <0x15000 0x400>;
107-
num-slots = <1>;
108107
fifo-depth = <1024>;
109108
card-detect-delay = <200>;
110109
clocks = <&apbclk>, <&mmcclk>;

‎drivers/clk/sunxi-ng/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Common objects
22
lib-$(CONFIG_SUNXI_CCU) += ccu_common.o
3+
lib-$(CONFIG_SUNXI_CCU) += ccu_mmc_timing.o
34
lib-$(CONFIG_SUNXI_CCU) += ccu_reset.o
45

56
# Base clock types

‎drivers/clk/sunxi-ng/ccu-sun8i-a83t.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,14 +418,8 @@ static SUNXI_CCU_PHASE(mmc1_sample_clk, "mmc1-sample", "mmc1",
418418
static SUNXI_CCU_PHASE(mmc1_output_clk, "mmc1-output", "mmc1",
419419
0x08c, 8, 3, 0);
420420

421-
/* TODO Support MMC2 clock's new timing mode. */
422-
static SUNXI_CCU_MP_WITH_MUX_GATE(mmc2_clk, "mmc2", mod0_default_parents,
423-
0x090,
424-
0, 4, /* M */
425-
16, 2, /* P */
426-
24, 2, /* mux */
427-
BIT(31), /* gate */
428-
0);
421+
static SUNXI_CCU_MP_MMC_WITH_MUX_GATE(mmc2_clk, "mmc2", mod0_default_parents,
422+
0x090, 0);
429423

430424
static SUNXI_CCU_PHASE(mmc2_sample_clk, "mmc2-sample", "mmc2",
431425
0x090, 20, 3, 0);

‎drivers/clk/sunxi-ng/ccu_common.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#define CCU_FEATURE_FIXED_POSTDIV BIT(3)
2424
#define CCU_FEATURE_ALL_PREDIV BIT(4)
2525
#define CCU_FEATURE_LOCK_REG BIT(5)
26+
#define CCU_FEATURE_MMC_TIMING_SWITCH BIT(6)
27+
28+
/* MMC timing mode switch bit */
29+
#define CCU_MMC_NEW_TIMING_MODE BIT(30)
2630

2731
struct device_node;
2832

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2017 Chen-Yu Tsai. All rights reserved.
3+
*
4+
* This software is licensed under the terms of the GNU General Public
5+
* License version 2, as published by the Free Software Foundation, and
6+
* may be copied, distributed, and modified under those terms.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*/
13+
14+
#include <linux/clk-provider.h>
15+
#include <linux/clk/sunxi-ng.h>
16+
17+
#include "ccu_common.h"
18+
19+
/**
20+
* sunxi_ccu_set_mmc_timing_mode: Configure the MMC clock timing mode
21+
* @clk: clock to be configured
22+
* @new_mode: true for new timing mode introduced in A83T and later
23+
*
24+
* Returns 0 on success, -ENOTSUPP if the clock does not support
25+
* switching modes.
26+
*/
27+
int sunxi_ccu_set_mmc_timing_mode(struct clk *clk, bool new_mode)
28+
{
29+
struct clk_hw *hw = __clk_get_hw(clk);
30+
struct ccu_common *cm = hw_to_ccu_common(hw);
31+
unsigned long flags;
32+
u32 val;
33+
34+
if (!(cm->features & CCU_FEATURE_MMC_TIMING_SWITCH))
35+
return -ENOTSUPP;
36+
37+
spin_lock_irqsave(cm->lock, flags);
38+
39+
val = readl(cm->base + cm->reg);
40+
if (new_mode)
41+
val |= CCU_MMC_NEW_TIMING_MODE;
42+
else
43+
val &= ~CCU_MMC_NEW_TIMING_MODE;
44+
writel(val, cm->base + cm->reg);
45+
46+
spin_unlock_irqrestore(cm->lock, flags);
47+
48+
return 0;
49+
}
50+
EXPORT_SYMBOL_GPL(sunxi_ccu_set_mmc_timing_mode);
51+
52+
/**
53+
* sunxi_ccu_set_mmc_timing_mode: Get the current MMC clock timing mode
54+
* @clk: clock to query
55+
*
56+
* Returns 0 if the clock is in old timing mode, > 0 if it is in
57+
* new timing mode, and -ENOTSUPP if the clock does not support
58+
* this function.
59+
*/
60+
int sunxi_ccu_get_mmc_timing_mode(struct clk *clk)
61+
{
62+
struct clk_hw *hw = __clk_get_hw(clk);
63+
struct ccu_common *cm = hw_to_ccu_common(hw);
64+
65+
if (!(cm->features & CCU_FEATURE_MMC_TIMING_SWITCH))
66+
return -ENOTSUPP;
67+
68+
return !!(readl(cm->base + cm->reg) & CCU_MMC_NEW_TIMING_MODE);
69+
}
70+
EXPORT_SYMBOL_GPL(sunxi_ccu_get_mmc_timing_mode);

0 commit comments

Comments
 (0)