PERFORCE change 174006 for review

Rafal Jaworowski raj at FreeBSD.org
Sun Jan 31 10:42:48 UTC 2010


http://p4web.freebsd.org/chv.cgi?CH=174006

Change 174006 by raj at raj_fdt on 2010/01/31 10:42:25

	Convert Marvell SATA to FDT/simplebus convention.

Affected files ...

.. //depot/projects/fdt/sys/arm/mv/kirkwood/kirkwood.c#6 edit
.. //depot/projects/fdt/sys/arm/mv/mv_sata.c#4 edit

Differences ...

==== //depot/projects/fdt/sys/arm/mv/kirkwood/kirkwood.c#6 (text+ko) ====

@@ -79,11 +79,6 @@
 		{ -1 },
 		CPU_PM_CTRL_XOR0 | CPU_PM_CTRL_XOR1
 	},
-	{ "sata", MV_SATAHC_BASE, MV_SATAHC_SIZE,
-		{ MV_INT_SATA, -1 },
-		{ -1 },
-		CPU_PM_CTRL_SATA0 | CPU_PM_CTRL_SATA1
-	},
 	{ NULL, 0, 0, { 0 }, { 0 }, 0 }
 };
 

==== //depot/projects/fdt/sys/arm/mv/mv_sata.c#4 (text+ko) ====

@@ -48,6 +48,8 @@
 
 #include <sys/ata.h>
 #include <dev/ata/ata-all.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
 
 #include "ata_if.h"
 
@@ -173,7 +175,7 @@
 
 devclass_t sata_devclass;
 
-DRIVER_MODULE(sata, mbus, sata_driver, sata_devclass, 0, 0);
+DRIVER_MODULE(sata, simplebus, sata_driver, sata_devclass, 0, 0);
 MODULE_VERSION(sata, 1);
 MODULE_DEPEND(sata, ata, 1, 1, 1);
 
@@ -183,13 +185,12 @@
 	struct sata_softc *sc;
 	uint32_t d, r;
 
+	if (!ofw_bus_is_compatible(dev, "mrvl,sata"))
+		return (ENXIO);
+
 	soc_id(&d, &r);
 	sc = device_get_softc(dev);
 
-	/* No SATA controller on the 88F5281 SoC */
-	if (d == MV_DEV_88F5281)
-		return (ENXIO);
-
 	switch(d) {
 	case MV_DEV_88F5182:
 		sc->sc_version = 1;


More information about the p4-projects mailing list