Page MenuHomeFreeBSD

D10606.id28046.diff
No OneTemporary

D10606.id28046.diff

Index: sys/arm/conf/ARMADA38X
===================================================================
--- sys/arm/conf/ARMADA38X
+++ sys/arm/conf/ARMADA38X
@@ -62,6 +62,11 @@
device pass
device da
+# MMC/SD/SDIO Card slot support
+device mmc # mmc/sd bus
+device mmcsd # mmc/sd flash cards
+device sdhci # mmc/sd host controller
+
# SATA
device ahci
Index: sys/arm/mv/armada38x/files.armada38x
===================================================================
--- sys/arm/mv/armada38x/files.armada38x
+++ sys/arm/mv/armada38x/files.armada38x
@@ -8,3 +8,4 @@
arm/mv/armada38x/pmsu.c standard
arm/mv/armada38x/rtc.c standard
arm/mv/armada38x/armada38x_pl310.c optional pl310
+dev/sdhci/sdhci_fdt.c optional sdhci
Index: sys/dev/sdhci/sdhci_fdt.c
===================================================================
--- sys/dev/sdhci/sdhci_fdt.c
+++ sys/dev/sdhci/sdhci_fdt.c
@@ -57,7 +57,17 @@
#include "mmcbr_if.h"
#include "sdhci_if.h"
-#define MAX_SLOTS 6
+#define MAX_SLOTS 6
+#define SDHCI_FDT_ARMADA38X 1
+#define SDHCI_FDT_GENERIC 2
+#define SDHCI_FDT_XLNX_ZY7 3
+
+static struct ofw_compat_data compat_data[] = {
+ { "marvell,armada-380-sdhci", SDHCI_FDT_ARMADA38X },
+ { "sdhci_generic", SDHCI_FDT_GENERIC },
+ { "xlnx,zy7_sdhci", SDHCI_FDT_XLNX_ZY7 },
+ { NULL, 0 }
+};
struct sdhci_fdt_softc {
device_t dev; /* Controller device */
@@ -181,13 +191,21 @@
if (!ofw_bus_status_okay(dev))
return (ENXIO);
- if (ofw_bus_is_compatible(dev, "sdhci_generic")) {
+ switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) {
+ case SDHCI_FDT_ARMADA38X:
+ sc->quirks = SDHCI_QUIRK_NO_AUTO_STOP;
+ device_set_desc(dev, "ARMADA38X SDHCI controller");
+ break;
+ case SDHCI_FDT_GENERIC:
device_set_desc(dev, "generic fdt SDHCI controller");
- } else if (ofw_bus_is_compatible(dev, "xlnx,zy7_sdhci")) {
+ break;
+ case SDHCI_FDT_XLNX_ZY7:
sc->quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
device_set_desc(dev, "Zynq-7000 generic fdt SDHCI controller");
- } else
+ break;
+ default:
return (ENXIO);
+ }
node = ofw_bus_get_node(dev);

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 4:02 PM (19 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15542890
Default Alt Text
D10606.id28046.diff (2 KB)

Event Timeline