Skip to content

Commit af4d42c

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
Adding bcm2835-sdhost driver, and an overlay to enable it
BCM2835 has two SD card interfaces. This driver uses the other one.
1 parent 3d71332 commit af4d42c

File tree

7 files changed

+1753
-0
lines changed

7 files changed

+1753
-0
lines changed

arch/arm/boot/dts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
3434
dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
3535
dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
3636
dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
37+
dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
3738
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb
3839
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb
3940
dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb

arch/arm/boot/dts/sdhost-overlay.dts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/{
5+
compatible = "brcm,bcm2708";
6+
7+
fragment@0 {
8+
target = <&soc>;
9+
__overlay__ {
10+
#address-cells = <1>;
11+
#size-cells = <1>;
12+
13+
sdhost: sdhost@7e202000 {
14+
compatible = "brcm,bcm2835-sdhost";
15+
reg = <0x7e202000 0x100>;
16+
interrupts = <2 24>;
17+
clocks = <&clk_sdhost>;
18+
dmas = <&dma 13>,
19+
<&dma 13>;
20+
dma-names = "tx", "rx";
21+
pinctrl-names = "default";
22+
pinctrl-0 = <&sdhost_pins>;
23+
status = "okay";
24+
};
25+
26+
clocks {
27+
#address-cells = <1>;
28+
#size-cells = <0>;
29+
30+
clk_sdhost: clock@3 {
31+
compatible = "fixed-clock";
32+
reg = <0>;
33+
#clock-cells = <0>;
34+
clock-output-names = "sdhost";
35+
clock-frequency = <250000000>;
36+
};
37+
};
38+
};
39+
};
40+
41+
fragment@1 {
42+
target = <&gpio>;
43+
__overlay__ {
44+
sdhost_pins: sdhost_pins {
45+
brcm,pins = <48 49 50 51 52 53>;
46+
brcm,function = <4>; /* alt0 */
47+
};
48+
};
49+
};
50+
51+
fragment@2 {
52+
target = <&mmc>;
53+
__overlay__ {
54+
/* Find a way to disable the other driver */
55+
compatible = "";
56+
status = "disabled";
57+
};
58+
};
59+
};

arch/arm/configs/bcm2709_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,7 @@ CONFIG_MMC=y
956956
CONFIG_MMC_BLOCK_MINORS=32
957957
CONFIG_MMC_BCM2835=y
958958
CONFIG_MMC_BCM2835_DMA=y
959+
CONFIG_MMC_BCM2835_SDHOST=y
959960
CONFIG_MMC_SDHCI=y
960961
CONFIG_MMC_SDHCI_PLTFM=y
961962
CONFIG_MMC_SPI=m

arch/arm/configs/bcmrpi_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,7 @@ CONFIG_MMC=y
949949
CONFIG_MMC_BLOCK_MINORS=32
950950
CONFIG_MMC_BCM2835=y
951951
CONFIG_MMC_BCM2835_DMA=y
952+
CONFIG_MMC_BCM2835_SDHOST=y
952953
CONFIG_MMC_SDHCI=y
953954
CONFIG_MMC_SDHCI_PLTFM=y
954955
CONFIG_MMC_SPI=m

drivers/mmc/host/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ config MMC_BCM2835_PIO_DMA_BARRIER
3333

3434
If unsure, say 2 here.
3535

36+
config MMC_BCM2835_SDHOST
37+
tristate "Support for the SDHost controller on BCM2708/9"
38+
depends on (MACH_BCM2708 || MACH_BCM2709)
39+
help
40+
This selects the SDHost controller on BCM2835/6.
41+
42+
If you have a controller with this interface, say Y or M here.
43+
44+
If unsure, say N.
45+
3646
config MMC_ARMMMCI
3747
tristate "ARM AMBA Multimedia Card Interface support"
3848
depends on ARM_AMBA

drivers/mmc/host/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o
1818
obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o
1919
obj-$(CONFIG_MMC_SDHCI_F_SDH30) += sdhci_f_sdh30.o
2020
obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o
21+
obj-$(CONFIG_MMC_BCM2835_SDHOST) += bcm2835-sdhost.o
2122
obj-$(CONFIG_MMC_BCM2835) += bcm2835-mmc.o
2223
obj-$(CONFIG_MMC_WBSD) += wbsd.o
2324
obj-$(CONFIG_MMC_AU1X) += au1xmmc.o

0 commit comments

Comments
 (0)