Skip to content

Commit

Permalink
Merge pull request #16 from linux-3ds/ctr_sdhc
Browse files Browse the repository at this point in the history
add SDHC driver
  • Loading branch information
Wolfvak authored Apr 11, 2021
2 parents bf323e8 + 589fd57 commit 6f62208
Show file tree
Hide file tree
Showing 5 changed files with 784 additions and 0 deletions.
33 changes: 33 additions & 0 deletions arch/arm/boot/dts/nintendo3ds.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@
no-output;
};

nwm: sdhc-controller@10122000 {
compatible = "nintendo,3ds-sdhc";
reg = <0x10122000 0x200>;

interrupts =
<GIC_SPI 0x20 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 0x21 IRQ_TYPE_EDGE_RISING>;

clocks = <&sdclk>;

cap-sdio-irq;
cap-sd-highspeed;
};

gpio0: gpio-controller@10147000 {
compatible = "nintendo,3ds-gpio", "basic-mmio-gpio";
reg = <0x10147000 0x2>;
Expand Down Expand Up @@ -354,9 +368,28 @@
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <134055928>;
clock-accuracy = <100>; /* wishful thinking */
clock-output-names = "3ds:refclk134mhz";
};

sdclk: refclk67mhz {
compatible = "fixed-factor-clock";
clocks = <&refclk>;
#clock-cells = <0>;
clock-div = <2>;
clock-mult = <1>;
clock-output-names = "3ds:refclk67mhz";
};

cpuclk: refclk268mhz {
compatible = "fixed-factor-clock";
clocks = <&refclk>;
#clock-cells = <0>;
clock-div = <1>;
clock-mult = <2>;
clock-output-names = "3ds:refclk268mhz";
};

poweroff: poweroff {
compatible = "regulator-poweroff";
cpu-supply = <&pwroff_reg>;
Expand Down
8 changes: 8 additions & 0 deletions drivers/platform/nintendo3ds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ menuconfig NINTENDO3DS_PLATFORM_DEVICES

if NINTENDO3DS_PLATFORM_DEVICES

config CTR_SDHC
tristate "Nintendo 3DS SD Host Controller"
select MMC
default y
help
Add support for driving the 3DS SD Host Controller.
Note: the controller is only used for the wireless chip.

config CTR_PXI
tristate "Nintendo 3DS VirtIO bridge"
select VIRTIO
Expand Down
2 changes: 2 additions & 0 deletions drivers/platform/nintendo3ds/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
obj-$(CONFIG_ARCH_CTR) += ctr_gpiointc.o # hacked in by default

obj-$(CONFIG_CTR_SDHC) += ctr_sdhc.o

obj-$(CONFIG_CTR_PXI) += ctr_pxi.o

obj-$(CONFIG_CTR_SPI) += ctr_spi.o
Expand Down
Loading

0 comments on commit 6f62208

Please sign in to comment.