Skip to contentSkip to conversation

AT91RM9200 Ethernet initialization

PATCH New Anders Larsen 1 participant 1 message Oct 24, 2005 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AT91RM9200 Ethernet initialization

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

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(-)
cpu/arm920t/at91rm9200/ether.c +2 -3
index ca5b7d1..eb9dd76 100644
@@ -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;