summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/boot/arm/at91/libat91/emac.c14
-rw-r--r--sys/boot/arm/at91/libat91/emac_init.c2
2 files changed, 13 insertions, 3 deletions
diff --git a/sys/boot/arm/at91/libat91/emac.c b/sys/boot/arm/at91/libat91/emac.c
index 8995596..e82c613 100644
--- a/sys/boot/arm/at91/libat91/emac.c
+++ b/sys/boot/arm/at91/libat91/emac.c
@@ -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))
diff --git a/sys/boot/arm/at91/libat91/emac_init.c b/sys/boot/arm/at91/libat91/emac_init.c
index 2aeb83e..32f4563 100644
--- a/sys/boot/arm/at91/libat91/emac_init.c
+++ b/sys/boot/arm/at91/libat91/emac_init.c
@@ -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 |
OpenPOWER on IntegriCloud