1 From 152d226fd2eff1fdc1f8881287bf1a7d4560b27e Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 26 Feb 2018 19:46:32 +0000
4 Subject: [PATCH 233/454] overlays: Rework sdio overlays to allow polling
6 MMC/SD interfaces support a DT property (non-removable) that disables
7 the usual polling required to detect card removal for a configuration
8 that doesn't have hardware card presence detection. This property is
9 required for the on-board SDIO WiFi interface, but other uses of the
10 interface may want the polling to be re-enabled.
12 'non-removable' is a boolean DT property - true if present, false if
13 absent - and the overlay mechanism does not allow a property in the
14 base DTB to be deleted, so if the base DTB has non-removable set
15 (which is true for all WiFi-equipped Pis) then an overlay cannot
18 Modify the SDIO overlays to work around this problem by disabling
19 the mmc node and adding a clone to which non-removable may
22 N.B. The default state of poll_once is still true, and the overlay
23 does include a non-removable property, but setting poll_once to false
24 ("off") will remove the property from the overlay before it is applied.
26 See: https://github.com/raspberrypi/linux/issues/2401
28 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
30 .../boot/dts/overlays/sdio-1bit-overlay.dts | 40 +++++++++++++-----
31 arch/arm/boot/dts/overlays/sdio-overlay.dts | 41 ++++++++++++++-----
32 2 files changed, 59 insertions(+), 22 deletions(-)
34 --- a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts
35 +++ b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts
40 - sdio_mmc: __overlay__ {
41 - compatible = "brcm,bcm2835-mmc";
42 - pinctrl-names = "default";
43 - pinctrl-0 = <&sdio_pins>;
46 - brcm,overclock-50 = <0>;
49 + status = "disabled";
56 + #address-cells = <1>;
59 + sdio_1bit: sdio@7e300000 {
60 + compatible = "brcm,bcm2835-mmc",
61 + "brcm,bcm2835-sdhci";
62 + reg = <0x7e300000 0x100>;
63 + interrupts = <2 30>;
64 + clocks = <&clocks 28/*BCM2835_CLOCK_EMMC*/>;
66 + dma-names = "rx-tx";
67 + brcm,overclock-50 = <0>;
69 + pinctrl-names = "default";
70 + pinctrl-0 = <&sdio_1bit_pins>;
80 - sdio_pins: sdio_pins {
81 + sdio_1bit_pins: sdio_1bit_pins {
82 brcm,pins = <22 23 24 25>;
83 brcm,function = <7>; /* ALT3 = SD1 */
84 brcm,pull = <0 2 2 2>;
89 - poll_once = <&sdio_mmc>,"non-removable?";
90 - sdio_overclock = <&sdio_mmc>,"brcm,overclock-50:0";
91 + poll_once = <&sdio_1bit>,"non-removable?";
92 + sdio_overclock = <&sdio_1bit>,"brcm,overclock-50:0";
95 --- a/arch/arm/boot/dts/overlays/sdio-overlay.dts
96 +++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts
101 - sdio_mmc: __overlay__ {
102 - pinctrl-names = "default";
103 - pinctrl-0 = <&sdio_pins>;
106 - brcm,overclock-50 = <0>;
109 + status = "disabled";
116 + #address-cells = <1>;
119 + sdio_ovl: sdio@7e300000 {
120 + compatible = "brcm,bcm2835-mmc",
121 + "brcm,bcm2835-sdhci";
122 + reg = <0x7e300000 0x100>;
123 + interrupts = <2 30>;
124 + clocks = <&clocks 28/*BCM2835_CLOCK_EMMC*/>;
126 + dma-names = "rx-tx";
127 + brcm,overclock-50 = <0>;
129 + pinctrl-names = "default";
130 + pinctrl-0 = <&sdio_ovl_pins>;
140 - sdio_pins: sdio_pins {
141 + sdio_ovl_pins: sdio_ovl_pins {
142 brcm,pins = <22 23 24 25 26 27>;
143 brcm,function = <7>; /* ALT3 = SD1 */
144 brcm,pull = <0 2 2 2 2 2>;
149 - poll_once = <&sdio_mmc>,"non-removable?";
150 - bus_width = <&sdio_mmc>,"bus-width:0";
151 - sdio_overclock = <&sdio_mmc>,"brcm,overclock-50:0";
152 + poll_once = <&sdio_ovl>,"non-removable?";
153 + bus_width = <&sdio_ovl>,"bus-width:0";
154 + sdio_overclock = <&sdio_ovl>,"brcm,overclock-50:0";