
In message Pine.LNX.4.64.0711292057520.6673@axis700.grange you wrote:
This patch fixes several issues at least on a MPC885 based system with two FEC interfaces used in MII mode.
PHY discovery should first read PHY_PHYIDR2 register and only then PHY_PHYIDR1 like cpu/mpc8xx/fec.c::mii_discover_phy() does it, otherwise the values read are wrong. Also notice, that PHY discovery cannot work on MPC88x / MPC87x in setups with both FECs active at all in its present form, because for both interfaces the registers from FEC 1 are used to communicate over MII.
Remove code duplication for resetting the FEC by isolating it into a separate function.
Initialize MII on FEC 1 when communicating over FEC 2 in fec_init().
Optimize mii_init() to only reset the FEC 1 controller once.
Fix a typo in mii_init() using index i instead of j thus potentially leading to unpredictable results.
Signed-off-by: Guennadi Liakhovetski lg@denx.de
Applied, thanks.
Best regards,
Wolfgang Denk