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
This commit is contained in:
Justin Hibbits 2017-11-02 04:07:41 +00:00
parent fbb74b0ee7
commit 1163f0612f
3 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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);
@ -192,6 +192,11 @@ dtsec_fdt_attach(device_t dev)
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,
sizeof(fman_rxtx_node)) <= 0)