svn commit: r325305 - head/sys/dev/dpaa
Justin Hibbits
jhibbits at FreeBSD.org
Thu Nov 2 04:07:43 UTC 2017
Author: jhibbits
Date: Thu Nov 2 04:07:41 2017
New Revision: 325305
URL: https://svnweb.freebsd.org/changeset/base/325305
Log:
Fix interrupt handling for dtsec
The macId is the dTSEC unit within the FMan, so use the cell-index, not the unit
number, which may not match the cell index.
MFC after: 1 week
Modified:
head/sys/dev/dpaa/if_dtsec.c
head/sys/dev/dpaa/if_dtsec.h
head/sys/dev/dpaa/if_dtsec_fdt.c
Modified: head/sys/dev/dpaa/if_dtsec.c
==============================================================================
--- head/sys/dev/dpaa/if_dtsec.c Thu Nov 2 04:05:03 2017 (r325304)
+++ head/sys/dev/dpaa/if_dtsec.c Thu Nov 2 04:07:41 2017 (r325305)
@@ -578,8 +578,6 @@ dtsec_attach(device_t dev)
parent = device_get_parent(dev);
sc->sc_dev = dev;
sc->sc_mac_mdio_irq = NO_IRQ;
- sc->sc_eth_id = device_get_unit(dev);
-
/* Check if MallocSmart allocator is ready */
if (XX_MallocSmartInit() != E_OK)
Modified: head/sys/dev/dpaa/if_dtsec.h
==============================================================================
--- head/sys/dev/dpaa/if_dtsec.h Thu Nov 2 04:05:03 2017 (r325304)
+++ head/sys/dev/dpaa/if_dtsec.h Thu Nov 2 04:07:41 2017 (r325305)
@@ -66,7 +66,7 @@ struct dtsec_softc {
/* dTSEC data */
enum eth_dev_type sc_eth_dev_type;
- uint8_t sc_eth_id;
+ uint8_t sc_eth_id; /* Ethernet ID within its frame manager */
uintptr_t sc_mac_mem_offset;
e_EnetMode sc_mac_enet_mode;
int sc_mac_mdio_irq;
Modified: head/sys/dev/dpaa/if_dtsec_fdt.c
==============================================================================
--- head/sys/dev/dpaa/if_dtsec_fdt.c Thu Nov 2 04:05:03 2017 (r325304)
+++ head/sys/dev/dpaa/if_dtsec_fdt.c Thu Nov 2 04:07:41 2017 (r325305)
@@ -136,7 +136,7 @@ dtsec_fdt_attach(device_t dev)
phandle_t enet_node, phy_node;
phandle_t fman_rxtx_node[2];
char phy_type[6];
- pcell_t fman_tx_cell;
+ pcell_t fman_tx_cell, mac_id;
int rid;
sc = device_get_softc(dev);
@@ -191,6 +191,11 @@ dtsec_fdt_attach(device_t dev)
sc->sc_mac_enet_mode = e_ENET_MODE_XGMII_10000;
else
return (ENXIO);
+
+ if (OF_getencprop(enet_node, "cell-index",
+ (void *)&mac_id, sizeof(mac_id)) <= 0)
+ return (ENXIO);
+ sc->sc_eth_id = mac_id;
/* Get RX/TX port handles */
if (OF_getprop(enet_node, "fsl,fman-ports", (void *)fman_rxtx_node,
More information about the svn-src-all
mailing list