Skip to content

Commit

Permalink
BCM270X_DT: Add non-removable clone of mmc node
Browse files Browse the repository at this point in the history
non-removable is a boolean property, and as such can't be unset by an
overlay if it is set in a base DTB. Until now the workaround for this
problem has been for overlays to clone non-removable nodes without
the offending property, but this involves a lot of unnecessary
replication. Instead, add a clone of the mmc node with non-removable
already set to the base DTB, selecting the required version using
the status properties.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  • Loading branch information
Phil Elwell committed May 28, 2019
1 parent cf8b7bd commit 089d72f
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 32 deletions.
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/bcm2708-rpi-0-w.dts
Expand Up @@ -14,6 +14,7 @@
aliases {
serial0 = &uart1;
serial1 = &uart0;
mmc1 = &mmcnr;
};
};

Expand Down Expand Up @@ -73,10 +74,9 @@
};
};

&mmc {
&mmcnr {
pinctrl-names = "default";
pinctrl-0 = <&sdio_pins>;
non-removable;
bus-width = <4>;
status = "okay";
};
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/boot/dts/bcm2708-rpi.dtsi
Expand Up @@ -118,7 +118,8 @@
sd_force_pio = <&sdhost>,"brcm,force-pio?";
sd_pio_limit = <&sdhost>,"brcm,pio-limit:0";
sd_debug = <&sdhost>,"brcm,debug";
sdio_overclock = <&mmc>,"brcm,overclock-50:0";
sdio_overclock = <&mmc>,"brcm,overclock-50:0",
<&mmcnr>,"brcm,overclock-50:0";
axiperf = <&axiperf>,"status";
};
};
Expand Down
13 changes: 13 additions & 0 deletions arch/arm/boot/dts/bcm270x.dtsi
Expand Up @@ -79,6 +79,19 @@
status = "disabled";
};

/* A clone of mmc but with non-removable set */
mmcnr: mmcnr@7e300000 {
compatible = "brcm,bcm2835-mmc", "brcm,bcm2835-sdhci";
reg = <0x7e300000 0x100>;
interrupts = <2 30>;
clocks = <&clocks BCM2835_CLOCK_EMMC>;
dmas = <&dma 11>;
dma-names = "rx-tx";
brcm,overclock-50 = <0>;
non-removable;
status = "disabled";
};

hvs: hvs@7e400000 {
/* Add alias */
status = "disabled";
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts
Expand Up @@ -15,6 +15,7 @@
aliases {
serial0 = &uart1;
serial1 = &uart0;
mmc1 = &mmcnr;
};
};

Expand Down Expand Up @@ -74,13 +75,11 @@
};
};

&mmc {
&mmcnr {
pinctrl-names = "default";
pinctrl-0 = <&sdio_pins>;
non-removable;
bus-width = <4>;
status = "okay";
brcm,overclock-50 = <0>;
};

&firmware {
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/boot/dts/bcm2710-rpi-3-b.dts
Expand Up @@ -15,6 +15,7 @@
aliases {
serial0 = &uart1;
serial1 = &uart0;
mmc1 = &mmcnr;
};
};

Expand Down Expand Up @@ -74,13 +75,11 @@
};
};

&mmc {
&mmcnr {
pinctrl-names = "default";
pinctrl-0 = <&sdio_pins>;
non-removable;
bus-width = <4>;
status = "okay";
brcm,overclock-50 = <0>;
};

&soc {
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/boot/dts/overlays/mmc-overlay.dts
Expand Up @@ -33,6 +33,13 @@
};
};

fragment@3 {
target = <&mmcnr>;
__overlay__ {
status = "disabled";
};
};

__overrides__ {
overclock_50 = <&frag0>,"brcm,overclock-50:0";
};
Expand Down
33 changes: 10 additions & 23 deletions arch/arm/boot/dts/overlays/sdio-overlay.dts
@@ -1,39 +1,26 @@
/dts-v1/;
/plugin/;

/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */
/* Enable SDIO from MMC interface via various GPIO groups */

/{
compatible = "brcm,bcm2835";

fragment@0 {
target = <&mmc>;
target = <&mmcnr>;
__overlay__ {
status = "disabled";
};
};

fragment@1 {
target = <&soc>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;

sdio_ovl: sdio@7e300000 {
compatible = "brcm,bcm2835-mmc",
"brcm,bcm2835-sdhci";
reg = <0x7e300000 0x100>;
interrupts = <2 30>;
clocks = <&clocks 28/*BCM2835_CLOCK_EMMC*/>;
dmas = <&dma 11>;
dma-names = "rx-tx";
brcm,overclock-50 = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&sdio_ovl_pins>;
non-removable;
bus-width = <4>;
};
target = <&mmc>;
sdio_ovl: __overlay__ {
pinctrl-0 = <&sdio_ovl_pins>;
pinctrl-names = "default";
non-removable;
bus-width = <4>;
status = "okay";
};
};

Expand Down Expand Up @@ -75,7 +62,7 @@
fragment@6 {
target-path = "/aliases";
__overlay__ {
mmc1 = "/soc/sdio@7e300000";
mmc1 = "/soc/mmc@7e300000";
};
};

Expand Down

0 comments on commit 089d72f

Please sign in to comment.