Booting FreeBSD on MPC8540 eval board
Rafal Jaworowski
raj at semihalf.com
Thu Mar 13 10:46:05 UTC 2008
Jacques Fourie wrote:
> Thanks - 'set hw.uart.console=mm:0xfef04500' fixed the console output for me.
> From the console output I can see that miibus_probe() is failing for
> all three ethernet devices.
>
> Here is the console output :
>
*snip*
>
> Here is some output obtained from uboot :
>
> MPC8540EVAL=> mii device
> MII devices: 'TSEC0' 'TSEC1' 'FEC'
> Current device: 'TSEC0'
> MPC8540EVAL=> mii info
> PHY 0x02: OUI = 0x04DE, Model = 0x0E, Rev = 0x02, 10baseT, HDX
> PHY 0x04: OUI = 0x5043, Model = 0x06, Rev = 0x02, 100baseT, FDX
> PHY 0x07: OUI = 0x5043, Model = 0x06, Rev = 0x02, 10baseT, HDX
> PHY 0x1F: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
> MPC8540EVAL=>
> PHY 0x02: OUI = 0x04DE, Model = 0x0E, Rev = 0x02, 10baseT, HDX
> PHY 0x04: OUI = 0x5043, Model = 0x06, Rev = 0x02, 100baseT, FDX
> PHY 0x07: OUI = 0x5043, Model = 0x06, Rev = 0x02, 10baseT, HDX
> PHY 0x1F: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
>
> Do I need some additional mods in the miibus code that is not in CVS?
>
I don't think so, just having miibus should suffice. The problem you're having
is likely caused by a different MAC-PHY topology than is for CDS boards the
port was mainly tested on.
The hidden assumption we currently have requires a 1:1 mapping between TSEC
units and PHY numbers they are 'routed' to. We don't deal too well with
other/mixed MAC-PHY topologies that various systems can have.
Please try this patch, or manipulate in a similar way, you'll get the idea:
diff --git a/sys/dev/tsec/if_tsec.c b/sys/dev/tsec/if_tsec.c
index a5aff35..bd3854b 100644
--- a/sys/dev/tsec/if_tsec.c
+++ b/sys/dev/tsec/if_tsec.c
@@ -1561,7 +1561,7 @@ tsec_miibus_readreg(device_t dev, int ph
sc = device_get_softc(dev);
- if (device_get_unit(dev) != phy)
+ if (phy != 4 || phy != 7)
return (0);
sc = tsec0_sc;
Another thing, but not critical, is that we somehow seem to treat the third
Ethernet controller as TSEC, which it isn't -- 8540 has FEC in addition to the
two TSEC units, but FEC isn't supported at the moment at all, no driver etc.
Rafal
PS. Please boot with -v flag so that we can see more verbose output.
More information about the freebsd-embedded
mailing list