Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 May 2017 05:10:15 +0000 (UTC)
From:      Luiz Otavio O Souza <loos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r318337 - in head/sys: arm/conf arm/mv/armada38x dev/sdhci
Message-ID:  <201705160510.v4G5AGVG026023@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loos
Date: Tue May 16 05:10:15 2017
New Revision: 318337
URL: https://svnweb.freebsd.org/changeset/base/318337

Log:
  Add the Marvell SDHCI controller to the list of supported devices in
  sdhci_fdt.
  
  Enable the SDHCI controller, bus and devices on ARMADA38X kernel.
  
  Tested on:	ClearFog Pro
  Reviewed by:	Marcin Wojtas <mw at semihalf.com>
  Sponsored by:	Rubicon Communications, LLC (Netgate)
  Differential Revision:	https://reviews.freebsd.org/D10606

Modified:
  head/sys/arm/conf/ARMADA38X
  head/sys/arm/mv/armada38x/files.armada38x
  head/sys/dev/sdhci/sdhci_fdt.c

Modified: head/sys/arm/conf/ARMADA38X
==============================================================================
--- head/sys/arm/conf/ARMADA38X	Tue May 16 04:47:50 2017	(r318336)
+++ head/sys/arm/conf/ARMADA38X	Tue May 16 05:10:15 2017	(r318337)
@@ -63,6 +63,11 @@ device		scbus
 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
 

Modified: head/sys/arm/mv/armada38x/files.armada38x
==============================================================================
--- head/sys/arm/mv/armada38x/files.armada38x	Tue May 16 04:47:50 2017	(r318336)
+++ head/sys/arm/mv/armada38x/files.armada38x	Tue May 16 05:10:15 2017	(r318337)
@@ -8,3 +8,4 @@ arm/mv/armada38x/armada38x_mp.c	optional
 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

Modified: head/sys/dev/sdhci/sdhci_fdt.c
==============================================================================
--- head/sys/dev/sdhci/sdhci_fdt.c	Tue May 16 04:47:50 2017	(r318336)
+++ head/sys/dev/sdhci/sdhci_fdt.c	Tue May 16 05:10:15 2017	(r318337)
@@ -57,7 +57,17 @@ __FBSDID("$FreeBSD$");
 #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 @@ sdhci_fdt_probe(device_t dev)
 	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_BROKEN_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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705160510.v4G5AGVG026023>