AnsweredAssumed Answered

Yocto imx7d sabresd and AT8031 - Kernel lock/crash on fec_probe when writel or readl is used - Help!

Question asked by Edward Tyrrell on Sep 26, 2018
Latest reply on Oct 26, 2018 by Edward Tyrrell

Hi All,

As mentioned I have a Yocto based 4.1.44 kernel built for imx7d on a custom board. The only real difference to that of the evk is we're using an AT8031 on our board. The device tree has had a few adjustments but nothing too serious, the AT8031 bolted straight up. However when booted the debug will stop at the probing/loading of the phy in fec_main.c.

 Around the area of fec_get_mac and/or fec_set_mac_address is the fist time the writel and readl address functions are used, and at that point the system locks/dies whatever - debug ends.


In functions:

/* fec_set_mac_address */


writel(ndev->dev_addr[3] | (ndev->dev_addr[2] << 8) |
(ndev->dev_addr[1] << 16) | (ndev->dev_addr[0] << 24),
fep->hwp + FEC_ADDR_LOW);
writel((ndev->dev_addr[5] << 16) | (ndev->dev_addr[4] << 24),
fep->hwp + FEC_ADDR_HIGH);

/* fec_get_mac */

*((__be32 *) &tmpaddr[0]) = cpu_to_be32(readl(fep->hwp + FEC_ADDR_LOW));


As soon as either writel or readl tries to use the address point to by fep->hwp+ofset then it's game over.


In the device tree the fec is as per the documentation => fec1: ethernet@30be0000 and the correct address. Printing out fep->hwp I get  f5be0000, which I'm not sure if it's been remapped / virtual or just incorrect. Any case my system dies at this point. Please help as I'm out of ideas here!


I've tried Rocko andKrogoth builds - no difference.