summaryrefslogtreecommitdiff
path: root/cpu/ppc4xx/405gp_enet.c
diff options
context:
space:
mode:
authorJon Loeliger <jdl@freescale.com>2005-08-02 13:53:07 -0500
committerJon Loeliger <jdl@freescale.com>2005-08-02 13:53:07 -0500
commit4b1d95d96a39a71eddd088bb5e0e9e699035c9bf (patch)
tree57e2d52b0636c7299992e869fa0b0ee4da7ca4d2 /cpu/ppc4xx/405gp_enet.c
parentde1d0a69956a63cea6a62043ae5d5afb584efe93 (diff)
parent095b8a3798f1c6cd618092899e783dc2ee0d23f5 (diff)
downloadu-boot-imx-4b1d95d96a39a71eddd088bb5e0e9e699035c9bf.zip
u-boot-imx-4b1d95d96a39a71eddd088bb5e0e9e699035c9bf.tar.gz
u-boot-imx-4b1d95d96a39a71eddd088bb5e0e9e699035c9bf.tar.bz2
Merge with rsync://git-user@source.denx.net/git/u-boot.git
Diffstat (limited to 'cpu/ppc4xx/405gp_enet.c')
-rw-r--r--cpu/ppc4xx/405gp_enet.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/cpu/ppc4xx/405gp_enet.c b/cpu/ppc4xx/405gp_enet.c
index 9d8e2b6..9c17e31 100644
--- a/cpu/ppc4xx/405gp_enet.c
+++ b/cpu/ppc4xx/405gp_enet.c
@@ -227,7 +227,12 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
/* wait for reset */
while (mfdcr (malmcr) & MAL_CR_MMSR) {
};
-#if defined(CONFIG_440)
+#if defined(CONFIG_440_EP) || defined(CONFIG_440_GR)
+ out32 (ZMII_FER, 0);
+ udelay(100);
+ /* set RII mode */
+ out32 (ZMII_FER, ZMII_RMII | ZMII_MDI0);
+#elif defined(CONFIG_440)
/* set RMII mode */
out32 (ZMII_FER, ZMII_RMII | ZMII_MDI0);
#endif /* CONFIG_440 */
@@ -461,6 +466,18 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
out32(ZMII_SSR, in32(ZMII_SSR) | 0x10000000);
else
out32(ZMII_SSR, in32(ZMII_SSR) & ~0x10000000);
+#if defined(CONFIG_440_EP) || defined(CONFIG_440_GR)
+ mfsdr(sdr_mfr, reg);
+ /* set speed */
+ if (speed == _100BASET) {
+ out32(ZMII_SSR, in32(ZMII_SSR) | 0x10000000);
+ reg = (reg & ~SDR0_MFR_ZMII_MODE_MASK) | SDR0_MFR_ZMII_MODE_RMII_100M;
+ } else {
+ reg = (reg & ~SDR0_MFR_ZMII_MODE_MASK) | SDR0_MFR_ZMII_MODE_RMII_10M;
+ out32(ZMII_SSR, in32(ZMII_SSR) & ~0x10000000);
+ }
+ mtsdr(sdr_mfr, reg);
+#endif
#endif
/* Enable broadcast and indvidual address */
@@ -498,11 +515,6 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
/*
* Connect interrupt service routines
*/
-#if !defined(CONFIG_405EP)
- /* 405EP has one EWU interrupt */
- irq_install_handler (VECNUM_EWU0 + (hw_p->devnum * 2),
- (interrupt_handler_t *) enetInt, dev);
-#endif
irq_install_handler (VECNUM_ETH0 + (hw_p->devnum * 2),
(interrupt_handler_t *) enetInt, dev);
}
@@ -993,12 +1005,6 @@ int ppc_4xx_eth_initialize (bd_t * bis)
mtdcr (malrxdeir, 0xffffffff); /* clear pending interrupts */
mtdcr (malier, mal_ier);
-#if defined(CONFIG_405EP)
- /* 405EP has one EWU interrupt */
- irq_install_handler (VECNUM_EWU0,
- (interrupt_handler_t *) enetInt,
- dev);
-#endif
/* install MAL interrupt handler */
irq_install_handler (VECNUM_MS,
(interrupt_handler_t *) enetInt,