mediatek: add v4.19 support
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0306-overlays-sdio-Add-enhanced-1-bit-support.patch
1 From 510aeba93fa3dde1e2890d49409bd1be2d72f3fe Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Thu, 10 Jan 2019 15:27:56 +0000
4 Subject: [PATCH 306/703] overlays: sdio: Add enhanced 1-bit support
5
6 "dtoverlay=sdio,bus_width=1,gpios_22_25" is equivalent to the sdio-1bit
7 overlay, which is now deprecated.
8
9 "dtoverlay=sdio,bus_width=1,gpios_34_37" enables 1-bit mode on GPIOs 34-37.
10
11 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
12 ---
13 arch/arm/boot/dts/overlays/README | 24 +++++++++++----------
14 arch/arm/boot/dts/overlays/sdio-overlay.dts | 20 ++++++++++++++++-
15 2 files changed, 32 insertions(+), 12 deletions(-)
16
17 --- a/arch/arm/boot/dts/overlays/README
18 +++ b/arch/arm/boot/dts/overlays/README
19 @@ -479,8 +479,7 @@ Params: <None>
20
21 Name: bmp085_i2c-sensor
22 Info: This overlay is now deprecated - see i2c-sensor
23 -Load: dtoverlay=bmp085_i2c-sensor
24 -Params: <None>
25 +Load: <Deprecated>
26
27
28 Name: dht11
29 @@ -1737,7 +1736,8 @@ Params: overclock_50 Clock (i
30
31 Name: sdio
32 Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock,
33 - and enables SDIO via GPIOs 22-27.
34 + and enables SDIO via GPIOs 22-27. An example of use in 1-bit mode is
35 + "dtoverlay=sdio,bus_width=1,gpios_22_25"
36 Load: dtoverlay=sdio,<param>=<val>
37 Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC
38 framework requests 50MHz
39 @@ -1747,16 +1747,18 @@ Params: sdio_overclock SDIO Clo
40
41 bus_width Set the SDIO host bus width (default 4 bits)
42
43 + gpios_22_25 Select GPIOs 22-25 for 1-bit mode. Must be used
44 + with bus_width=1. This replaces the sdio-1bit
45 + overlay, which is now deprecated.
46
47 -Name: sdio-1bit
48 -Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock,
49 - and enables 1-bit SDIO via GPIOs 22-25.
50 -Load: dtoverlay=sdio-1bit,<param>=<val>
51 -Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC
52 - framework requests 50MHz
53 + gpios_34_37 Select GPIOs 34-37 for 1-bit mode. Must be used
54 + with bus_width=1.
55
56 - poll_once Disable SDIO-device polling every second
57 - (default on: polling once at boot-time)
58 +
59 +Name: sdio-1bit
60 +Info: This overlay is now deprecated. Use
61 + "dtoverlay=sdio,bus_width=1,gpios_22_25" instead.
62 +Load: <Deprecated>
63
64
65 Name: sdtweak
66 --- a/arch/arm/boot/dts/overlays/sdio-overlay.dts
67 +++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts
68 @@ -32,7 +32,7 @@
69 pinctrl-names = "default";
70 pinctrl-0 = <&sdio_ovl_pins>;
71 non-removable;
72 - bus-width = <1>;
73 + bus-width = <4>;
74 };
75 };
76 };
77 @@ -49,6 +49,22 @@
78 };
79
80 fragment@3 {
81 + target = <&sdio_ovl_pins>;
82 + __dormant__ {
83 + brcm,pins = <22 23 24 25>;
84 + brcm,pull = <0 2 2 2>;
85 + };
86 + };
87 +
88 + fragment@4 {
89 + target = <&sdio_ovl_pins>;
90 + __dormant__ {
91 + brcm,pins = <34 35 36 37>;
92 + brcm,pull = <0 2 2 2>;
93 + };
94 + };
95 +
96 + fragment@6 {
97 target-path = "/aliases";
98 __overlay__ {
99 mmc1 = "/soc/sdio@7e300000";
100 @@ -59,5 +75,7 @@
101 poll_once = <&sdio_ovl>,"non-removable?";
102 bus_width = <&sdio_ovl>,"bus-width:0";
103 sdio_overclock = <&sdio_ovl>,"brcm,overclock-50:0";
104 + gpios_22_25 = <0>,"=3";
105 + gpios_34_37 = <0>,"=4";
106 };
107 };