[U-Boot-Users] [PATCH] AT91RM9200 Ethernet initialization

Anders Larsen alarsen at rea.de
Mon Oct 24 18:06:06 CEST 2005


Hi,

the AT91RM9200 on-chip Ethernet interface is explicitly initialized
to use promiscuous mode.

This is probably due to a bug in line 183 of
cpu/arm920t/at91rm9200/ether.c which was supposed to clear the
statistics counters but instead erroneously disabled reception of
broadcast packets - so the driver later enables promiscuous mode in
order to receive such broadcasts, like e.g. DHCP responses.

The patch below fixes the original bug and lets the interface
run in normal (non-promiscuous) mode, which should improve
performance on networks with heavy traffic.

Cheers
 Anders

Signed-off-by: Anders Larsen <alarsen at rea.de>

CHANGELOG:
  Fix the initialization of the AT91RM9200 ethernet interface
  to use non-promiscuous mode
  Patch by Lars Munch, 24 Oct 2005

---

 cpu/arm920t/at91rm9200/ether.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/cpu/arm920t/at91rm9200/ether.c b/cpu/arm920t/at91rm9200/ether.c
index ca5b7d1..eb9dd76 100644
--- a/cpu/arm920t/at91rm9200/ether.c
+++ b/cpu/arm920t/at91rm9200/ether.c
@@ -180,7 +180,7 @@ int eth_init (bd_t * bd)
 
 	*AT91C_PMC_PCER = 1 << AT91C_ID_EMAC;	/* Peripheral Clock Enable Register */
 
-	p_mac->EMAC_CFG |= AT91C_EMAC_CSR;	/* Clear statistics */
+	p_mac->EMAC_CTL |= AT91C_EMAC_CSR;	/* Clear statistics */
 
 	/* Init Ehternet buffers */
 	for (i = 0; i < RBF_FRAMEMAX; i++) {
@@ -197,8 +197,7 @@ int eth_init (bd_t * bd)
 	p_mac->EMAC_RBQP = (long) (&rbfdt[0]);
 	p_mac->EMAC_RSR &= ~(AT91C_EMAC_RSR_OVR | AT91C_EMAC_REC | AT91C_EMAC_BNA);
 
-	p_mac->EMAC_CFG = (p_mac->EMAC_CFG | AT91C_EMAC_CAF | AT91C_EMAC_NBC)
-			& ~AT91C_EMAC_CLK;
+	p_mac->EMAC_CFG &= ~AT91C_EMAC_CLK;
 
 #ifdef CONFIG_AT91C_USE_RMII
 	p_mac->EMAC_CFG |= AT91C_EMAC_RMII;






More information about the U-Boot mailing list