mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
MFp4: differences for bwct ethernet attachment
This commit is contained in:
parent
452f9afb5e
commit
6be1e1ff38
2 changed files with 13 additions and 3 deletions
|
|
@ -337,6 +337,7 @@ CheckForNewPacket(ip_header_t *pHeader)
|
|||
* This private function reads the PHY device.
|
||||
* .KB_C_FN_DEFINITION_END
|
||||
*/
|
||||
#ifndef BOOT_BWCT
|
||||
static unsigned short
|
||||
AT91F_MII_ReadPhy (AT91PS_EMAC pEmac, unsigned char addr)
|
||||
{
|
||||
|
|
@ -348,11 +349,12 @@ AT91F_MII_ReadPhy (AT91PS_EMAC pEmac, unsigned char addr)
|
|||
pEmac->EMAC_CTL &= ~AT91C_EMAC_MPE;
|
||||
return (pEmac->EMAC_MAN & 0x0000ffff);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* .KB_C_FN_DEFINITION_START
|
||||
* unsigned short AT91F_MII_ReadPhy (AT91PS_EMAC pEmac, unsigned char addr)
|
||||
* This private function reads the PHY device.
|
||||
* unsigned short AT91F_MII_WritePhy (AT91PS_EMAC pEmac, unsigned char addr, unsigned short s)
|
||||
* This private function writes the PHY device.
|
||||
* .KB_C_FN_DEFINITION_END
|
||||
*/
|
||||
#ifdef BOOT_TSC
|
||||
|
|
@ -378,12 +380,20 @@ AT91F_MII_WritePhy (AT91PS_EMAC pEmac, unsigned char addr, unsigned short s)
|
|||
static void
|
||||
MII_GetLinkSpeed(AT91PS_EMAC pEmac)
|
||||
{
|
||||
#if defined(BOOT_TSC) | defined(BOOT_KB920X)
|
||||
unsigned short stat2;
|
||||
#endif
|
||||
unsigned update;
|
||||
#ifdef BOOT_TSC
|
||||
unsigned sec;
|
||||
int i;
|
||||
#endif
|
||||
#ifdef BOOT_BWCT
|
||||
/* hardcoded link speed since we connect a switch via MII */
|
||||
update = pEmac->EMAC_CFG & ~(AT91C_EMAC_SPD | AT91C_EMAC_FD);
|
||||
update |= AT91C_EMAC_SPD;
|
||||
update |= AT91C_EMAC_FD;
|
||||
#endif
|
||||
#ifdef BOOT_KB920X
|
||||
stat2 = AT91F_MII_ReadPhy(pEmac, MII_STS2_REG);
|
||||
if (!(stat2 & MII_STS2_LINK))
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ EMAC_SetMACAddress(unsigned char mac[6])
|
|||
AT91C_PA8_ETXEN | AT91C_PA16_EMDIO | AT91C_PA9_ETX0 |
|
||||
AT91C_PA10_ETX1 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA15_EMDC |
|
||||
AT91C_PA7_ETXCK_EREFCK;
|
||||
#ifdef BOOT_KB920X /* Really !RMII */
|
||||
#if defined(BOOT_KB920X) | defined(BOOT_BWCT) /* Really !RMII */
|
||||
AT91C_BASE_PIOB->PIO_BSR =
|
||||
AT91C_PB12_ETX2 | AT91C_PB13_ETX3 | AT91C_PB14_ETXER |
|
||||
AT91C_PB15_ERX2 | AT91C_PB16_ERX3 | AT91C_PB17_ERXDV |
|
||||
|
|
|
|||
Loading…
Reference in a new issue