summaryrefslogtreecommitdiffstats
path: root/sys/boot/arm
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-12-20 18:26:37 +0000
committerimp <imp@FreeBSD.org>2006-12-20 18:26:37 +0000
commitf52bff60b36a1c7d9f9eef67345770c2741fb6fe (patch)
tree9571de1bf58c15be2b4e6fc4e00b2ea525af92ac /sys/boot/arm
parent4a8daf1b959be7285c549398453bf96766fd4abd (diff)
downloadFreeBSD-src-f52bff60b36a1c7d9f9eef67345770c2741fb6fe.zip
FreeBSD-src-f52bff60b36a1c7d9f9eef67345770c2741fb6fe.tar.gz
MFp4: differences for bwct ethernet attachment
Diffstat (limited to 'sys/boot/arm')
-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