PERFORCE change 221670 for review

Bjoern A. Zeeb bz at FreeBSD.org
Fri Feb 1 12:28:40 UTC 2013


http://p4web.freebsd.org/@@221670?ac=10

Change 221670 by bz at bz_zenith on 2013/02/01 12:28:28

	Fully describe atse0,1 for fdt(4).  Remove most of the hints though leaving
	the code to attach from those as well.  In fact we try both hints and fdt.
	Split the atse(4) code up for that.
	
	Make interrupts optional in atse(4) and force polling to on if compiled in
	and not intrs available.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#13 edit
.. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse.c#4 edit
.. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse_fdt.c#1 add
.. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse_nexus.c#1 add
.. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atsereg.h#2 edit
.. //depot/projects/ctsrd/beribsd/src/sys/mips/beri/files.beri#29 edit
.. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4.hints#20 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#13 (text+ko) ====

@@ -97,7 +97,24 @@
 
 		ethernet at 7f007000 {
 			compatible = "altera,atse";
-			reg = <0x7f007000 0x540>;
+			/* MAC, RX+RXC, TX+TXC. */
+			reg = <0x7f007000 0x400
+				0x7f007500 0x8
+				0x7f007520 0x20
+				0x7f007400 0x8
+				0x7f007420 0x20>;
+			/* RX, TX */
+			interrupts = <1 2>;
+		};
+
+		ethernet at 7f005000 {
+			compatible = "altera,atse";
+			/* MAC, RX+RXC, TX+TXC. */
+			reg = <0x7f005000 0x400
+				0x7f005500 0x8
+				0x7f005520 0x20
+				0x7f005400 0x8
+				0x7f005420 0x20>;
 		};
 
 		touchscreen at 70400000 {

==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse.c#4 (text+ko) ====

@@ -37,13 +37,10 @@
  */
 /*
  * XXX-BZ NOTES:
- * - brooks, rwatson report:
- *   - buffered packet data as SOP arrives
  * - ifOutBroadcastPkts are only counted if both ether dst and src are all-1s;
  *   seems an IP core bug, they count ether broadcasts as multicast.  Is this
  *   still the case?
  * - figure out why the TX FIFO fill status and intr did not work as expected.
- * - make sure we can run even without IRQs specificed in hints/fdt.
  * - test 100Mbit/s and 10Mbit/s
  * - reading the ethernet address does not work with isf using fdt and no
  *   hints anymore.
@@ -88,73 +85,12 @@
 #include <dev/mii/mii.h>
 #include <dev/mii/miivar.h>
 
-#include "if_atsereg.h"
-#include "a_api.h"
+#include <dev/altera/atse/if_atsereg.h>
+#include <dev/altera/atse/a_api.h>
 
 MODULE_DEPEND(atse, ether, 1, 1, 1);
 MODULE_DEPEND(atse, miibus, 1, 1, 1);
 
-/* "device miibus" required.  See GENERIC if you get errors here. */
-#include "miibus_if.h"
-
-struct atse_softc {
-	struct ifnet		*atse_ifp;
-	struct mbuf		*atse_rx_m;
-	struct mbuf		*atse_tx_m;
-	uint8_t			*atse_tx_buf;
-	struct resource		*atse_mem_res;
-	struct resource		*atse_rx_irq_res;
-	struct resource		*atse_rx_mem_res;
-	struct resource		*atse_rxc_mem_res;
-	struct resource		*atse_tx_irq_res;
-	struct resource		*atse_tx_mem_res;
-	struct resource		*atse_txc_mem_res;
-	device_t		atse_miibus;
-	device_t		atse_dev;
-	int			atse_unit;
-	int			atse_mem_rid;
-	int			atse_rx_irq_rid;
-	int			atse_rx_mem_rid;
-	int			atse_rxc_mem_rid;
-	int			atse_tx_irq_rid;
-	int			atse_tx_mem_rid;
-	int			atse_txc_mem_rid;
-	int			atse_phy_addr;
-	int			atse_if_flags;
-	int			atse_rx_irq;
-	int			atse_tx_irq;
-	u_long			atse_rx_maddr;
-	u_long			atse_rx_msize;
-	u_long			atse_tx_maddr;
-	u_long			atse_tx_msize;
-	u_long			atse_rxc_maddr;
-	u_long			atse_rxc_msize;
-	u_long			atse_txc_maddr;
-	u_long			atse_txc_msize;
-	void			*atse_rx_intrhand;
-	void			*atse_tx_intrhand;
-	bus_addr_t		atse_bmcr0;
-	bus_addr_t		atse_bmcr1;
-	uint32_t		atse_flags;
-#define	ATSE_FLAGS_LINK			0x00000001
-#define	ATSE_FLAGS_ERROR		0x00000002
-#define	ATSE_FLAGS_SOP_SEEN		0x00000004
-	uint8_t			atse_eth_addr[ETHER_ADDR_LEN];
-#define	ATSE_ETH_ADDR_DEF	0x01
-#define	ATSE_ETH_ADDR_SUPP1	0x02
-#define	ATSE_ETH_ADDR_SUPP2	0x04
-#define	ATSE_ETH_ADDR_SUPP3	0x08
-#define	ATSE_ETH_ADDR_SUPP4	0x10
-#define	ATSE_ETH_ADDR_ALL	0x1f
-	uint16_t		atse_watchdog_timer;
-	uint16_t		atse_tx_m_offset;
-	uint16_t		atse_tx_buf_len;
-	uint16_t		atse_rx_buf_len;
-	int16_t			atse_rx_cycles;		/* POLLING */
-#define	RX_CYCLES_IN_INTR	5
-	struct callout		atse_tick;
-	struct mtx		atse_mtx;
-};
 
 #define	ATSE_WATCHDOG_TIME	5
 
@@ -364,9 +300,8 @@
 
 static void atse_tick(void *);
 static int atse_detach(device_t);
-static void atse_miibus_statchg(device_t);
-static int atse_miibus_readreg(device_t, int, int);
-static int atse_miibus_writereg(device_t, int, int, int);
+
+devclass_t atse_devclass;
 
 static int
 atse_tx_locked(struct atse_softc *sc, int *sent)
@@ -1446,7 +1381,7 @@
 /*
  * Generic device handling routines.
  */
-static int
+int
 atse_attach(device_t dev)
 {
 	struct atse_softc *sc;
@@ -1515,45 +1450,52 @@
 	ifp->if_capabilities |= IFCAP_VLAN_MTU;
 	ifp->if_capenable = ifp->if_capabilities;
 #ifdef DEVICE_POLLING
-	/* Enable polling by default if compiled in. */
-	/* Cannot do that, see below, thus moved after if_capenable. */
+	/* We will enable polling by default if no irqs available. See below. */
 	ifp->if_capabilities |= IFCAP_POLLING;
 #endif
 
 	/* Hook up interrupts. */
-	error = bus_setup_intr(dev, sc->atse_rx_irq_res, INTR_TYPE_NET |
-	    INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_rx_intrhand);
-	if (error != 0) {
-		device_printf(dev, "could not enable resources\n");
-		ether_ifdetach(ifp);
-		goto err;
+	if (sc->atse_rx_irq_res != NULL) {
+		error = bus_setup_intr(dev, sc->atse_rx_irq_res, INTR_TYPE_NET |
+		    INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_rx_intrhand);
+		if (error != 0) {
+			device_printf(dev, "enabling RX IRQ failed\n");
+			ether_ifdetach(ifp);
+			goto err;
+		}
 	}
 
-	error = bus_setup_intr(dev, sc->atse_tx_irq_res, INTR_TYPE_NET |
-	    INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_tx_intrhand);
-	if (error != 0) {
-		bus_teardown_intr(dev, sc->atse_rx_irq_res,
-		    sc->atse_rx_intrhand);
-		device_printf(dev, "could not enable resources\n");
-		ether_ifdetach(ifp);
-		goto err;
+	if (sc->atse_tx_irq_res != NULL) {
+		error = bus_setup_intr(dev, sc->atse_tx_irq_res, INTR_TYPE_NET |
+		    INTR_MPSAFE, NULL, atse_intr, sc, &sc->atse_tx_intrhand);
+		if (error != 0) {
+			bus_teardown_intr(dev, sc->atse_rx_irq_res,
+			    sc->atse_rx_intrhand);
+			device_printf(dev, "enabling TX IRQ failed\n");
+			ether_ifdetach(ifp);
+			goto err;
+		}
 	}
 
-	if ((ifp->if_capenable & IFCAP_POLLING) == 0) {
-		ATSE_RX_INTR_ENABLE(sc);
-		ATSE_TX_INTR_ENABLE(sc);
+	if ((ifp->if_capenable & IFCAP_POLLING) != 0 ||
+	   (sc->atse_rx_irq_res == NULL && sc->atse_tx_irq_res == NULL)) {
 #ifdef DEVICE_POLLING
-#if 0
-	/*
-	 * If compiled into the kernel, this does not work yet, as
-	 * the poll_mtx is not initialized yet.
-	 */
-	} else {
+		/* If not on and no IRQs force it on. */
+		if (sc->atse_rx_irq_res == NULL && sc->atse_tx_irq_res == NULL){
+			ifp->if_capenable |= IFCAP_POLLING;
+			device_printf(dev, "forcing to polling due to no "
+			    "interrupts\n");
+		}
 		error = ether_poll_register(atse_poll, ifp);
 		if (error != 0)
 			goto err;
+#else
+		device_printf(dev, "no DEVICE_POLLING in kernel and no IRQs\n");
+		error = ENXIO;
 #endif
-#endif
+	} else {
+		ATSE_RX_INTR_ENABLE(sc);
+		ATSE_TX_INTR_ENABLE(sc);
 	}
 
 err:
@@ -1608,81 +1550,8 @@
 	return (0);
 }
 
-
-/*
- * Device routines for interacting with nexus (probe, attach, detach) & helpers.
- * XXX We should add suspend/resume later.
- */
-static int
-atse_resource_int(device_t dev, const char *resname, int *v)
-{
-	int error;
-
-	error = resource_int_value(device_get_name(dev), device_get_unit(dev),
-	    resname, v);
-	if (error != 0) {
-		/* If it does not exist, we fail, so not ingoring ENOENT. */
-		device_printf(dev, "could not fetch '%s' hint\n", resname);
-		return (error);
-	}
-
-	return (0);
-}
-
-static int
-atse_resource_long(device_t dev, const char *resname, long *v)
-{
-	int error;
-
-	error = resource_long_value(device_get_name(dev), device_get_unit(dev),
-	    resname, v);
-	if (error != 0) {
-		/* If it does not exist, we fail, so not ingoring ENOENT. */
-		device_printf(dev, "could not fetch '%s' hint\n", resname);
-		return (error);
-	}
-
-	return (0);
-}
-
-static int
-atse_probe_nexus(device_t dev)
-{
-	struct resource *res;
-	long l;
-	int error, rid;
-
-	/*
-	 * It is almost impossible to properly probe this device.  We must
-	 * rely on hints being set correctly.  So try to get hints and
-	 * one memory mapping.  Must cleanup and do again in attach but
-	 * should not probe successfully if not able to attach later.
-	 */
-	error = atse_resource_int(dev, "rx_irq", &rid);
-	error += atse_resource_long(dev, "rx_maddr", &l);
-	error += atse_resource_long(dev, "rx_msize", &l);
-	error += atse_resource_long(dev, "rxc_maddr", &l);
-	error += atse_resource_long(dev, "rxc_msize", &l);
-	error += atse_resource_int(dev, "tx_irq", &rid);
-	error += atse_resource_long(dev, "tx_maddr", &l);
-	error += atse_resource_long(dev, "tx_msize", &l);
-	error += atse_resource_long(dev, "txc_maddr", &l);
-	error += atse_resource_long(dev, "txc_msize", &l);
-	if (error != 0)
-		return (ENXIO);
-
-	rid = 0;
-	res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
-	if (res == NULL)
-		return (ENXIO);
-	bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
-
-	/* Success. */
-	device_set_desc(dev, "Altera Triple-Speed Ethernet MegaCore");
-	return (BUS_PROBE_DEFAULT);
-}
-
-static void
+/* Shared between nexus anf fdt implementation. */
+void
 atse_detach_resources(device_t dev)
 {
 	struct atse_softc *sc;
@@ -1726,114 +1595,8 @@
 	}
 }
 
-static int
-atse_attach_nexus(device_t dev)
-{
-	struct atse_softc *sc;
-	int error;
-
-	sc = device_get_softc(dev);
-	sc->atse_dev = dev;
-	sc->atse_unit = device_get_unit(dev);
-
-	/* Get RX and TX IRQ and FIFO information from hints. */
-	error = atse_resource_int(dev, "rx_irq", &sc->atse_rx_irq);
-	error += atse_resource_long(dev, "rx_maddr", &sc->atse_rx_maddr);
-	error += atse_resource_long(dev, "rx_msize", &sc->atse_rx_msize);
-	error += atse_resource_long(dev, "rxc_maddr", &sc->atse_rxc_maddr);
-	error += atse_resource_long(dev, "rxc_msize", &sc->atse_rxc_msize);
-	error += atse_resource_int(dev, "tx_irq", &sc->atse_tx_irq);
-	error += atse_resource_long(dev, "tx_maddr", &sc->atse_tx_maddr);
-	error += atse_resource_long(dev, "tx_msize", &sc->atse_tx_msize);
-	error += atse_resource_long(dev, "txc_maddr", &sc->atse_txc_maddr);
-	error += atse_resource_long(dev, "txc_msize", &sc->atse_txc_msize);
-	if (error != 0)
-		return (error);
-
-	/* Avalon-MM, atse management register region. */
-	sc->atse_mem_rid = 0;
-	sc->atse_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-	    &sc->atse_mem_rid, RF_ACTIVE);
-	if (sc->atse_mem_res == NULL) {
-		device_printf(dev, "failed to map memory for ctrl region\n");
-		return (ENXIO);
-	}
-
-	/*
-	 * RX IRQ and memory mapped region.
-	 * 0x00: 2 * 32bit FIFO data,
-	 * 0x20: 8 * 32bit FIFO ctrl, Avalon-ST Sink to Avalon-MM R-Slave.
-	 */
-	sc->atse_rx_irq_rid = 0;
-	sc->atse_rx_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ,
-	    &sc->atse_rx_irq_rid, sc->atse_rx_irq, sc->atse_rx_irq, 1,
-	    RF_ACTIVE | RF_SHAREABLE);
-	if (sc->atse_rx_irq_res == NULL) {
-		device_printf(dev, "RX IRQ unavailable\n");
-		goto err;
-	}
-	sc->atse_rx_mem_rid = 0;
-	sc->atse_rx_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
-	    &sc->atse_rx_mem_rid, sc->atse_rx_maddr, sc->atse_rx_maddr +
-	    sc->atse_rx_msize, sc->atse_rx_msize, RF_ACTIVE);
-	if (sc->atse_rx_mem_res == NULL) {
-		device_printf(dev, "failed to map memory for RX\n");
-		goto err;
-        }
-	sc->atse_rxc_mem_rid = 0;
-	sc->atse_rxc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
-	    &sc->atse_rxc_mem_rid, sc->atse_rxc_maddr, sc->atse_rxc_maddr +
-	    sc->atse_rxc_msize, sc->atse_rxc_msize, RF_ACTIVE);
-	if (sc->atse_rxc_mem_res == NULL) {
-		device_printf(dev, "failed to map memory for RX control\n");
-		goto err;
-        }
-
-	/*
-	 * TX IRQ and memory mapped region.
-	 * 0x00: 2 * 32bit FIFO data,
-	 * 0x20: 8 * 32bit FIFO ctrl, Avalon-MM W-Slave to Avalon-ST Source.
-	 */
-	sc->atse_tx_irq_rid = 0;
-	sc->atse_tx_irq_res = bus_alloc_resource(dev, SYS_RES_IRQ,
-	    &sc->atse_tx_irq_rid, sc->atse_tx_irq, sc->atse_tx_irq, 1,
-	    RF_ACTIVE | RF_SHAREABLE);
-	if (sc->atse_tx_irq_res == NULL) {
-		device_printf(dev, "TX IRQ unavailable\n");
-		goto err;
-	}
-	sc->atse_tx_mem_rid = 0;
-	sc->atse_tx_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
-	    &sc->atse_tx_mem_rid, sc->atse_tx_maddr, sc->atse_tx_maddr +
-	    sc->atse_tx_msize, sc->atse_tx_msize, RF_ACTIVE);
-	if (sc->atse_tx_mem_res == NULL) {
-		device_printf(dev, "failed to map memory for TX\n");
-		goto err;
-	}
-	sc->atse_txc_mem_rid = 0;
-	sc->atse_txc_mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
-	    &sc->atse_txc_mem_rid, sc->atse_txc_maddr, sc->atse_txc_maddr +
-	    sc->atse_txc_msize, sc->atse_txc_msize, RF_ACTIVE);
-	if (sc->atse_txc_mem_res == NULL) {
-		device_printf(dev, "failed to map memory for TX control\n");
-		goto err;
-	}
-
-	error = atse_attach(dev);
-	if (error)
-		goto err;
-
-	return (0);
-
-err:
-	/* Cleanup. */
-	atse_detach_resources(dev);
-
-	return (error);
-}
-
-static int
-atse_detach_nexus(device_t dev)
+int
+atse_detach_dev(device_t dev)
 {
 	int error;
 
@@ -1849,7 +1612,7 @@
 	return (0);
 }
 
-static int
+int
 atse_miibus_readreg(device_t dev, int phy, int reg)
 {
 	struct atse_softc *sc;
@@ -1866,7 +1629,7 @@
 	return (PHY_READ_2(sc, reg));
 }
 
-static int
+int
 atse_miibus_writereg(device_t dev, int phy, int reg, int data)
 {
 	struct atse_softc *sc;
@@ -1884,7 +1647,7 @@
 	return (0);
 }
 
-static void
+void
 atse_miibus_statchg(device_t dev)
 {
 	struct atse_softc *sc;
@@ -1948,29 +1711,4 @@
 	CSR_WRITE_4(sc, BASE_CFG_COMMAND_CONFIG, val4);
 }
 
-static device_method_t atse_methods_nexus[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		atse_probe_nexus),
-	DEVMETHOD(device_attach,	atse_attach_nexus),
-	DEVMETHOD(device_detach,	atse_detach_nexus),
-
-	/* MII interface */
-	DEVMETHOD(miibus_readreg,	atse_miibus_readreg),
-	DEVMETHOD(miibus_writereg,	atse_miibus_writereg),
-	DEVMETHOD(miibus_statchg,	atse_miibus_statchg),
-
-	DEVMETHOD_END
-};
-
-static driver_t atse_driver_nexus = {
-	"atse",
-	atse_methods_nexus,
-	sizeof(struct atse_softc)
-};
-
-static devclass_t atse_devclass;
-
-DRIVER_MODULE(atse, nexus, atse_driver_nexus, atse_devclass, 0, 0);
-DRIVER_MODULE(miibus, atse, miibus_driver, miibus_devclass, 0, 0);
-
 /* end */

==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atsereg.h#2 (text+ko) ====

@@ -399,6 +399,78 @@
 #define	ALTERA_ETHERNET_OPTION_BITS_OFF	0x00008000
 #define	ALTERA_ETHERNET_OPTION_BITS_LEN	0x00007fff
 
+/* -------------------------------------------------------------------------- */
+
+struct atse_softc {
+	struct ifnet		*atse_ifp;
+	struct mbuf		*atse_rx_m;
+	struct mbuf		*atse_tx_m;
+	uint8_t			*atse_tx_buf;
+	struct resource		*atse_mem_res;
+	struct resource		*atse_rx_irq_res;
+	struct resource		*atse_rx_mem_res;
+	struct resource		*atse_rxc_mem_res;
+	struct resource		*atse_tx_irq_res;
+	struct resource		*atse_tx_mem_res;
+	struct resource		*atse_txc_mem_res;
+	device_t		atse_miibus;
+	device_t		atse_dev;
+	int			atse_unit;
+	int			atse_mem_rid;
+	int			atse_rx_irq_rid;
+	int			atse_rx_mem_rid;
+	int			atse_rxc_mem_rid;
+	int			atse_tx_irq_rid;
+	int			atse_tx_mem_rid;
+	int			atse_txc_mem_rid;
+	int			atse_phy_addr;
+	int			atse_if_flags;
+	int			atse_rx_irq;
+	int			atse_tx_irq;
+	u_long			atse_rx_maddr;
+	u_long			atse_rx_msize;
+	u_long			atse_tx_maddr;
+	u_long			atse_tx_msize;
+	u_long			atse_rxc_maddr;
+	u_long			atse_rxc_msize;
+	u_long			atse_txc_maddr;
+	u_long			atse_txc_msize;
+	void			*atse_rx_intrhand;
+	void			*atse_tx_intrhand;
+	bus_addr_t		atse_bmcr0;
+	bus_addr_t		atse_bmcr1;
+	uint32_t		atse_flags;
+#define	ATSE_FLAGS_LINK			0x00000001
+#define	ATSE_FLAGS_ERROR		0x00000002
+#define	ATSE_FLAGS_SOP_SEEN		0x00000004
+	uint8_t			atse_eth_addr[ETHER_ADDR_LEN];
+#define	ATSE_ETH_ADDR_DEF	0x01
+#define	ATSE_ETH_ADDR_SUPP1	0x02
+#define	ATSE_ETH_ADDR_SUPP2	0x04
+#define	ATSE_ETH_ADDR_SUPP3	0x08
+#define	ATSE_ETH_ADDR_SUPP4	0x10
+#define	ATSE_ETH_ADDR_ALL	0x1f
+	uint16_t		atse_watchdog_timer;
+	uint16_t		atse_tx_m_offset;
+	uint16_t		atse_tx_buf_len;
+	uint16_t		atse_rx_buf_len;
+	int16_t			atse_rx_cycles;		/* POLLING */
+#define	RX_CYCLES_IN_INTR	5
+	struct callout		atse_tick;
+	struct mtx		atse_mtx;
+};
+
+
+int	atse_attach(device_t);
+int	atse_detach_dev(device_t);
+void	atse_detach_resources(device_t);
+
+int	atse_miibus_readreg(device_t, int, int);
+int	atse_miibus_writereg(device_t, int, int, int);
+void	atse_miibus_statchg(device_t);
+
+extern devclass_t atse_devclass;
+
 #endif /* _DEV_IF_ATSEREG_H */
 
 /* end */

==== //depot/projects/ctsrd/beribsd/src/sys/mips/beri/files.beri#29 (text+ko) ====

@@ -1,5 +1,7 @@
 # $FreeBSD: head/sys/mips/beri/files.beri 245373 2013-01-13 16:27:56Z rwatson $
 dev/altera/atse/if_atse.c		optional altera_atse
+dev/altera/atse/if_atse_fdt.c		optional altera_atse fdt
+dev/altera/atse/if_atse_nexus.c		optional altera_atse
 dev/altera/jtag_uart/altera_jtag_uart_cons.c	optional altera_jtag_uart
 dev/altera/jtag_uart/altera_jtag_uart_tty.c	optional altera_jtag_uart
 dev/altera/jtag_uart/altera_jtag_uart_fdt.c	optional altera_jtag_uart fdt

==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4.hints#20 (text+ko) ====

@@ -25,40 +25,15 @@
 hint.map.3.end=0x02000000
 hint.map.3.name="kernel"
 
-#
 # Altera Triple-Speed Ethernet Mac, present in tPad and DE-4 configurations
-# Currently requires to find the isf(4) device. Later a loader should fix this.
-#
-hint.atse.0.at="nexus0"
-hint.atse.0.maddr=0x7f007000
-hint.atse.0.msize=0x400
-hint.atse.0.tx_maddr=0x7f007400
-hint.atse.0.tx_msize=0x8
-hint.atse.0.txc_maddr=0x7f007420
-hint.atse.0.txc_msize=0x20
-hint.atse.0.tx_irq=2
-hint.atse.0.rx_maddr=0x7f007500
-hint.atse.0.rx_msize=0x8
-hint.atse.0.rxc_maddr=0x7f007520
-hint.atse.0.rxc_msize=0x20
-hint.atse.0.rx_irq=1
+# configured from fdt(4) but PHYs are still described in here.
+# Currently configured for individual tse_mac cores.
 hint.e1000phy.0.at="miibus0"
 hint.e1000phy.0.phyno=0
-
-# No IRQ on the 2nd port, just c&p to make driver happy.
-hint.atse.1.at="nexus0"
-hint.atse.1.maddr=0x7f005000
-hint.atse.1.msize=0x400
-hint.atse.1.tx_maddr=0x7f005400
-hint.atse.1.tx_msize=0x8
-hint.atse.1.txc_maddr=0x7f005420
-hint.atse.1.txc_msize=0x20
-hint.atse.1.tx_irq=2
-hint.atse.1.rx_maddr=0x7f005500
-hint.atse.1.rx_msize=0x8
-hint.atse.1.rxc_maddr=0x7f005520
-hint.atse.1.rxc_msize=0x20
-hint.atse.1.rx_irq=1
 hint.e1000phy.1.at="miibus0"
 hint.e1000phy.1.phyno=0
+hint.e1000phy.2.at="miibus0"
+hint.e1000phy.2.phyno=0
+hint.e1000phy.3.at="miibus0"
+hint.e1000phy.3.phyno=0
 


More information about the p4-projects mailing list