Skip to content

Commit

Permalink
Adding bcm2835-sdhost driver, and an overlay to enable it
Browse files Browse the repository at this point in the history
BCM2835 has two SD card interfaces. This driver uses the other one.
  • Loading branch information
Phil Elwell authored and popcornmix committed Apr 23, 2015
1 parent c8ffccd commit d441bcb
Show file tree
Hide file tree
Showing 7 changed files with 1,740 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/Makefile
Expand Up @@ -34,6 +34,7 @@ dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb
dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb
Expand Down
59 changes: 59 additions & 0 deletions arch/arm/boot/dts/sdhost-overlay.dts
@@ -0,0 +1,59 @@
/dts-v1/;
/plugin/;

/{
compatible = "brcm,bcm2708";

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

sdhost: sdhost@7e202000 {
compatible = "brcm,bcm2835-sdhost";
reg = <0x7e202000 0x100>;
interrupts = <2 24>;
clocks = <&clk_sdhost>;
dmas = <&dma 13>,
<&dma 13>;
dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&sdhost_pins>;
status = "okay";
};

clocks {
#address-cells = <1>;
#size-cells = <0>;

clk_sdhost: clock@3 {
compatible = "fixed-clock";
reg = <0>;
#clock-cells = <0>;
clock-output-names = "sdhost";
clock-frequency = <250000000>;
};
};
};
};

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";
};
};
};
1 change: 1 addition & 0 deletions arch/arm/configs/bcm2709_defconfig
Expand Up @@ -957,6 +957,7 @@ CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_BCM2835=y
CONFIG_MMC_BCM2835_DMA=y
CONFIG_MMC_BCM2835_SDHOST=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SPI=m
Expand Down
1 change: 1 addition & 0 deletions arch/arm/configs/bcmrpi_defconfig
Expand Up @@ -950,6 +950,7 @@ CONFIG_MMC=y
CONFIG_MMC_BLOCK_MINORS=32
CONFIG_MMC_BCM2835=y
CONFIG_MMC_BCM2835_DMA=y
CONFIG_MMC_BCM2835_SDHOST=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SPI=m
Expand Down
10 changes: 10 additions & 0 deletions drivers/mmc/host/Kconfig
Expand Up @@ -33,6 +33,16 @@ config MMC_BCM2835_PIO_DMA_BARRIER

If unsure, say 2 here.

config MMC_BCM2835_SDHOST
tristate "Support for the SDHost controller on BCM2708/9"
depends on (MACH_BCM2708 || MACH_BCM2709)
help
This selects the SDHost controller on BCM2835/6.

If you have a controller with this interface, say Y or M here.

If unsure, say N.

config MMC_ARMMMCI
tristate "ARM AMBA Multimedia Card Interface support"
depends on ARM_AMBA
Expand Down
1 change: 1 addition & 0 deletions drivers/mmc/host/Makefile
Expand Up @@ -18,6 +18,7 @@ obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o
obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o
obj-$(CONFIG_MMC_SDHCI_F_SDH30) += sdhci_f_sdh30.o
obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o
obj-$(CONFIG_MMC_BCM2835_SDHOST) += bcm2835-sdhost.o
obj-$(CONFIG_MMC_BCM2835) += bcm2835-mmc.o
obj-$(CONFIG_MMC_WBSD) += wbsd.o
obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
Expand Down

1 comment on commit d441bcb

@notro
Copy link
Contributor

@notro notro commented on d441bcb Apr 28, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 would be nice.

Please sign in to comment.