summaryrefslogtreecommitdiff
path: root/cpu/at91rm9200/at91rm9200_ether.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-04-25 14:37:29 +0000
committerwdenk <wdenk>2004-04-25 14:37:29 +0000
commit0b8fa03b6df4130b2c8b215b85f36ab96eaa21f9 (patch)
tree4016b1ebd23d320ad609dc7bedf18ba4cbd8ab56 /cpu/at91rm9200/at91rm9200_ether.c
parentb9711de10218ce3072dcc77d83294d19ac78e193 (diff)
downloadu-boot-imx-0b8fa03b6df4130b2c8b215b85f36ab96eaa21f9.zip
u-boot-imx-0b8fa03b6df4130b2c8b215b85f36ab96eaa21f9.tar.gz
u-boot-imx-0b8fa03b6df4130b2c8b215b85f36ab96eaa21f9.tar.bz2
* Patch by Christian Hohnstaedt, 23 Apr 2004:
JFFS2 speed enhancements: - repair header CRC calculation in jffs2_1pass.c - add eraseblock size to the partition information to skip empty eraseblocks if we find more then 4k of free space. - The JFFS2 scanner is now fast enough to remove the spinning wheel so #ifdef-ed out. - add watchdog calls in long running loops * Patch by Philippe Robin, 22 Apr 2004: Fix ethernet configuration for "versatile" board * Patch by Kshitij Gupta, 21 Apr 2004: Remove busy loop and use MPU timer fr usleep() on OMAP1510/1610 boards * Patch by Steven Scholz, 24 Feb 2004: Fix a bug in AT91RM9200 ethernet driver: The MII interface is now initialized before accessing the PHY. * Cleanup PCI ID's
Diffstat (limited to 'cpu/at91rm9200/at91rm9200_ether.c')
-rw-r--r--cpu/at91rm9200/at91rm9200_ether.c49
1 files changed, 28 insertions, 21 deletions
diff --git a/cpu/at91rm9200/at91rm9200_ether.c b/cpu/at91rm9200/at91rm9200_ether.c
index 3428a9e..544b317 100644
--- a/cpu/at91rm9200/at91rm9200_ether.c
+++ b/cpu/at91rm9200/at91rm9200_ether.c
@@ -378,14 +378,21 @@ int eth_init (bd_t * bd)
p_mac = AT91C_BASE_EMAC;
- *AT91C_PIOA_PDR = AT91C_PA16_EMDIO | AT91C_PA15_EMDC | AT91C_PA14_ERXER | AT91C_PA13_ERX1 | AT91C_PA12_ERX0 | AT91C_PA11_ECRS_ECRSDV | AT91C_PA10_ETX1 | AT91C_PA9_ETX0 | AT91C_PA8_ETXEN | AT91C_PA7_ETXCK_EREFCK; /* PIO Disable Register */
+ /* PIO Disable Register */
+ *AT91C_PIOA_PDR = AT91C_PA16_EMDIO | AT91C_PA15_EMDC | AT91C_PA14_ERXER |
+ AT91C_PA13_ERX1 | AT91C_PA12_ERX0 | AT91C_PA11_ECRS_ECRSDV |
+ AT91C_PA10_ETX1 | AT91C_PA9_ETX0 | AT91C_PA8_ETXEN |
+ AT91C_PA7_ETXCK_EREFCK;
*AT91C_PIOB_PDR = AT91C_PB25_EF100 |
- AT91C_PB19_ERXCK | AT91C_PB18_ECOL | AT91C_PB17_ERXDV |
- AT91C_PB16_ERX3 | AT91C_PB15_ERX2 | AT91C_PB14_ETXER |
- AT91C_PB13_ETX3 | AT91C_PB12_ETX2;
+ AT91C_PB19_ERXCK | AT91C_PB18_ECOL | AT91C_PB17_ERXDV |
+ AT91C_PB16_ERX3 | AT91C_PB15_ERX2 | AT91C_PB14_ETXER |
+ AT91C_PB13_ETX3 | AT91C_PB12_ETX2;
- *AT91C_PIOB_BSR = AT91C_PB25_EF100 | AT91C_PB19_ERXCK | AT91C_PB18_ECOL | AT91C_PB17_ERXDV | AT91C_PB16_ERX3 | AT91C_PB15_ERX2 | AT91C_PB14_ETXER | AT91C_PB13_ETX3 | AT91C_PB12_ETX2; /* Select B Register */
+ /* Select B Register */
+ *AT91C_PIOB_BSR = AT91C_PB25_EF100 | AT91C_PB19_ERXCK | AT91C_PB18_ECOL |
+ AT91C_PB17_ERXDV | AT91C_PB16_ERX3 | AT91C_PB15_ERX2 |
+ AT91C_PB14_ETXER | AT91C_PB13_ETX3 | AT91C_PB12_ETX2;
*AT91C_PMC_PCER = 1 << AT91C_ID_EMAC; /* Peripheral Clock Enable Register */
@@ -400,6 +407,22 @@ int eth_init (bd_t * bd)
rbfdt[RBF_FRAMEMAX - 1].addr |= RBF_WRAP;
rbfp = &rbfdt[0];
+ p_mac->EMAC_SA2L = (bd->bi_enetaddr[3] << 24) | (bd->bi_enetaddr[2] << 16)
+ | (bd->bi_enetaddr[1] << 8) | (bd->bi_enetaddr[0]);
+ p_mac->EMAC_SA2H = (bd->bi_enetaddr[5] << 8) | (bd->bi_enetaddr[4]);
+
+ 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;
+
+#ifdef CONFIG_AT91C_USE_RMII
+ p_mac->EMAC_CFG |= AT91C_EMAC_RMII;
+#endif
+
+ p_mac->EMAC_CTL |= AT91C_EMAC_TE | AT91C_EMAC_RE;
+
at91rm92000_GetPhyInterface ();
if (!pPhyOps->IsPhyConnected (p_mac))
@@ -416,22 +439,6 @@ int eth_init (bd_t * bd)
return 0;
}
- p_mac->EMAC_SA2L = (bd->bi_enetaddr[3] << 24) | (bd->bi_enetaddr[2] << 16)
- | (bd->bi_enetaddr[1] << 8) | (bd->bi_enetaddr[0]);
- p_mac->EMAC_SA2H = (bd->bi_enetaddr[5] << 8) | (bd->bi_enetaddr[4]);
-
- 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;
-
-#ifdef CONFIG_AT91C_USE_RMII
- p_mac->EMAC_CFG |= AT91C_EMAC_RMII;
-#endif
-
- p_mac->EMAC_CTL |= AT91C_EMAC_TE | AT91C_EMAC_RE;
-
return 0;
}