openwrt/target/linux/brcm2708/patches-4.1/0221-bcm270x_dt-Use-the-sdhost-MMC-controller-by-default.patch
John Crispin d4b8d51580 brcm2708: update 4.1 patches
As usual, this patches were taken (and rebased) from
https://github.com/raspberrypi/linux/commits/rpi-4.1.y

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

SVN-Revision: 47922
2015-12-17 09:29:22 +00:00

270 lines
5.8 KiB
Diff

From 702070d58bb61bcdcc46f28b6cef7f269ef14c3e Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 8 Dec 2015 16:23:33 +0000
Subject: [PATCH 221/222] bcm270x_dt: Use the sdhost MMC controller by default
The "mmc" overlay reverts to using the other controller.
---
arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 11 ++++--
arch/arm/boot/dts/bcm2708-rpi-b.dts | 11 ++++--
arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 14 ++++++--
arch/arm/boot/dts/bcm2708_common.dtsi | 13 +++++++
arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 11 ++++--
arch/arm/boot/dts/overlays/mmc-overlay.dts | 22 +++++++++++-
arch/arm/boot/dts/overlays/sdhost-overlay.dts | 49 ++++++---------------------
arch/arm/boot/dts/overlays/sdio-overlay.dts | 1 -
8 files changed, 84 insertions(+), 48 deletions(-)
--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
+++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
@@ -8,6 +8,11 @@
};
&gpio {
+ sdhost_pins: sdhost_pins {
+ brcm,pins = <48 49 50 51 52 53>;
+ brcm,function = <4>; /* alt0 */
+ };
+
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,function = <4>; /* alt0 */
@@ -29,9 +34,11 @@
};
};
-&mmc {
- status = "okay";
+&sdhost {
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdhost_pins>;
bus-width = <4>;
+ status = "okay";
};
&fb {
--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
@@ -8,6 +8,11 @@
};
&gpio {
+ sdhost_pins: sdhost_pins {
+ brcm,pins = <48 49 50 51 52 53>;
+ brcm,function = <4>; /* alt0 */
+ };
+
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,function = <4>; /* alt0 */
@@ -29,9 +34,11 @@
};
};
-&mmc {
- status = "okay";
+&sdhost {
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdhost_pins>;
bus-width = <4>;
+ status = "okay";
};
&fb {
--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
+++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
@@ -1,5 +1,12 @@
/include/ "bcm2708.dtsi"
+&gpio {
+ sdhost_pins: sdhost_pins {
+ brcm,pins = <48 49 50 51 52 53>;
+ brcm,function = <4>; /* alt0 */
+ };
+};
+
&leds {
act_led: act {
label = "led0";
@@ -8,9 +15,12 @@
};
};
-&mmc {
- status = "okay";
+&sdhost {
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdhost_pins>;
bus-width = <4>;
+ non-removable;
+ status = "okay";
};
&fb {
--- a/arch/arm/boot/dts/bcm2708_common.dtsi
+++ b/arch/arm/boot/dts/bcm2708_common.dtsi
@@ -14,6 +14,7 @@
mailbox = &mailbox;
gpio = &gpio;
uart0 = &uart0;
+ sdhost = &sdhost;
i2s = &i2s;
spi0 = &spi0;
i2c0 = &i2c0;
@@ -114,6 +115,18 @@
status = "disabled";
};
+ sdhost: sdhost@7e202000 {
+ compatible = "brcm,bcm2835-sdhost";
+ reg = <0x7e202000 0x100>;
+ interrupts = <2 24>;
+ clocks = <&clk_core>;
+ dmas = <&dma 13>,
+ <&dma 13>;
+ dma-names = "tx", "rx";
+ brcm,pio-limit = <1>;
+ status = "disabled";
+ };
+
i2s: i2s@7e203000 {
compatible = "brcm,bcm2708-i2s";
reg = <0x7e203000 0x24>,
--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
+++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
@@ -8,6 +8,11 @@
};
&gpio {
+ sdhost_pins: sdhost_pins {
+ brcm,pins = <48 49 50 51 52 53>;
+ brcm,function = <4>; /* alt0 */
+ };
+
spi0_pins: spi0_pins {
brcm,pins = <7 8 9 10 11>;
brcm,function = <4>; /* alt0 */
@@ -29,9 +34,11 @@
};
};
-&mmc {
- status = "okay";
+&sdhost {
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdhost_pins>;
bus-width = <4>;
+ status = "okay";
};
&fb {
--- a/arch/arm/boot/dts/overlays/mmc-overlay.dts
+++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts
@@ -6,9 +6,29 @@
fragment@0 {
target = <&mmc>;
-
frag0: __overlay__ {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc_pins>;
+ bus-width = <4>;
brcm,overclock-50 = <0>;
+ status = "okay";
+ };
+ };
+
+ fragment@1 {
+ target = <&gpio>;
+ __overlay__ {
+ mmc_pins: mmc_pins {
+ brcm,pins = <48 49 50 51 52 53>;
+ brcm,function = <7>; /* alt3 */
+ };
+ };
+ };
+
+ fragment@2 {
+ target = <&sdhost>;
+ __overlay__ {
+ status = "disabled";
};
};
--- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts
@@ -5,52 +5,25 @@
compatible = "brcm,bcm2708";
fragment@0 {
- target = <&soc>;
+ target = <&mmc>;
__overlay__ {
- #address-cells = <1>;
- #size-cells = <1>;
-
- sdhost: sdhost@7e202000 {
- compatible = "brcm,bcm2835-sdhost";
- reg = <0x7e202000 0x100>;
- pinctrl-names = "default";
- pinctrl-0 = <&sdhost_pins>;
- interrupts = <2 24>;
- clocks = <&clk_core>;
- dmas = <&dma 13>,
- <&dma 13>;
- dma-names = "tx", "rx";
- brcm,delay-after-stop = <0>;
- brcm,overclock-50 = <0>;
- brcm,pio-limit = <1>;
- status = "okay";
- };
+ status = "disabled";
};
};
fragment@1 {
- target = <&gpio>;
- __overlay__ {
- sdhost_pins: sdhost_pins {
- brcm,pins = <48 49 50 51 52 53>;
- brcm,function = <4>; /* alt0 */
- };
- };
- };
-
- fragment@2 {
- target = <&mmc>;
- __overlay__ {
- /* Find a way to disable the other driver */
- compatible = "";
- status = "disabled";
+ target = <&sdhost>;
+ frag1: __overlay__ {
+ brcm,overclock-50 = <0>;
+ brcm,pio-limit = <1>;
+ status = "okay";
};
};
__overrides__ {
- overclock_50 = <&sdhost>,"brcm,overclock-50:0";
- force_pio = <&sdhost>,"brcm,force-pio?";
- pio_limit = <&sdhost>,"brcm,pio-limit:0";
- debug = <&sdhost>,"brcm,debug?";
+ overclock_50 = <&frag1>,"brcm,overclock-50:0";
+ force_pio = <&frag1>,"brcm,force-pio?";
+ pio_limit = <&frag1>,"brcm,pio-limit:0";
+ debug = <&frag1>,"brcm,debug?";
};
};
--- a/arch/arm/boot/dts/overlays/sdio-overlay.dts
+++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts
@@ -8,7 +8,6 @@
fragment@3 {
target = <&mmc>;
sdio_mmc: __overlay__ {
- compatible = "brcm,bcm2835-mmc";
pinctrl-names = "default";
pinctrl-0 = <&sdio_pins>;
non-removable;