Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jan 2010 10:38:43 GMT
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 174004 for review
Message-ID:  <201001311038.o0VAchNr034456@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=174004

Change 174004 by raj@raj_fdt on 2010/01/31 10:38:23

	Convert mge(4) to FDT/simplebus convention.
	
	This is the very first ARM driver using IRQ resources within
	FTD/simplebus environment.

Affected files ...

.. //depot/projects/fdt/sys/arm/mv/kirkwood/kirkwood.c#4 edit
.. //depot/projects/fdt/sys/dev/mge/if_mge.c#4 edit

Differences ...

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

@@ -84,12 +84,6 @@
 		{ -1 },
 		CPU_PM_CTRL_USB0
 	},
-	{ "mge", MV_ETH0_BASE, MV_ETH_SIZE,
-		{ MV_INT_GBERX, MV_INT_GBETX, MV_INT_GBEMISC,
-		  MV_INT_GBESUM, MV_INT_GBEERR, -1 },
-		{ -1 },
-		CPU_PM_CTRL_GE0
-	},
 	{ "sata", MV_SATAHC_BASE, MV_SATAHC_SIZE,
 		{ MV_INT_SATA, -1 },
 		{ -1 },

==== //depot/projects/fdt/sys/dev/mge/if_mge.c#4 (text+ko) ====

@@ -68,6 +68,8 @@
 
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
 
 #ifndef MII_ADDR_BASE
 #define MII_ADDR_BASE 8
@@ -164,7 +166,7 @@
 
 static devclass_t mge_devclass;
 
-DRIVER_MODULE(mge, mbus, mge_driver, mge_devclass, 0, 0);
+DRIVER_MODULE(mge, simplebus, mge_driver, mge_devclass, 0, 0);
 DRIVER_MODULE(miibus, mge, miibus_driver, miibus_devclass, 0, 0);
 MODULE_DEPEND(mge, ether, 1, 1, 1);
 MODULE_DEPEND(mge, miibus, 1, 1, 1);
@@ -1320,6 +1322,9 @@
 mge_probe(device_t dev)
 {
 
+	if (!ofw_bus_is_compatible(dev, "mrvl,ge"))
+		return (ENXIO);
+
 	device_set_desc(dev, "Marvell Gigabit Ethernet controller");
 	return (BUS_PROBE_DEFAULT);
 }



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