FreeBSD/sys/arm/at91/if_macb.c
/*
 * We have to know if we're using MII or RMII attachment
 * for the MACB to talk to the PHY correctly. Without FDT,
 * there's no good way to do this. So, if the config file
 * has 'option AT91_MACB_USE_RMII', then we'll force RMII.
 * Otherwise, we'll use what the bootloader setup. Either
 * it setup RMII or MII, in which case we'll get it right,
 * or it did nothing, and we'll fall back to MII and the
 * option would override if present.
 */
We have to know if we're using MII or RMII attachment
for the MACB to talk to the PHY correctly. Without FDT,
there's no good way to do this. So, if the config file
has 'option AT91_MACB_USE_RMII', then we'll force RMII.
Otherwise, we'll use what the bootloader setup. Either
it setup RMII or MII, in which case we'll get it right,
or it did nothing, and we'll fall back to MII and the
option would override if present.
We have to know if we ' re using MII or RMII attachment for the MACB to talk to the PHY correctly . Without FDT there ' s no good way to do this . So if the config file has ' option AT91_MACB_USE_RMII ' then we ' ll force RMII . Otherwise we ' ll use what the bootloader setup . Either it setup RMII or MII in which case we ' ll get it right or it did nothing and we ' ll fall back to MII and the option would override if present .
static void
macb_set_rmii(struct macb_softc *sc)
{
#ifdef AT91_MACB_USE_RMII
	sc->use_rmii = USRIO_RMII;
#else
	sc->use_rmii = read_4(sc, EMAC_USRIO) & USRIO_RMII;
#endif
}
static void macb_set_rmii ( struct macb_softc * sc ) { #ifdef AT91_MACB_USE_RMII sc -> use_rmii = USRIO_RMII ; #else sc -> use_rmii = read_4 ( sc , EMAC_USRIO ) & USRIO_RMII ; #endif }
We have to know if we're using MII or RMII attachment
 for the MACB to talk to the PHY correctly.
We have to know if we ' re using MII or RMII attachment for the MACB to talk to the PHY correctly .