diff -Naur u-boot/cpu/mpc5xxx/fec.c u-boot-paub/cpu/mpc5xxx/fec.c --- u-boot/cpu/mpc5xxx/fec.c 2004-03-23 22:43:08.000000000 +0100 +++ u-boot-paub/cpu/mpc5xxx/fec.c 2004-03-25 09:03:19.000000000 +0100 @@ -276,26 +276,22 @@ */ if (fec->xcv_type == SEVENWIRE) { /* - * Frame length=1518; 7-wire mode + * Frame length=1518; FCE, 7-wire mode */ - fec->eth->r_cntrl = 0x05ee0020; /*0x05ee0000;FIXME */ + fec->eth->r_cntrl = 0x05ee0020; } else { /* - * Frame length=1518; MII mode; + * Frame length=1518; FCE, MII mode; */ - fec->eth->r_cntrl = 0x05ee0024; /*0x05ee0004;FIXME */ + fec->eth->r_cntrl = 0x05ee0024; } - if (fec->xcv_type == SEVENWIRE) { - /* - * Set FEC-Lite transmit control register(X_CNTRL): - */ - /*fec->eth->x_cntrl = 0x00000002; */ /* half-duplex, heartbeat */ - fec->eth->x_cntrl = 0x00000000; /* half-duplex, heartbeat disabled */ - } else { - /*fec->eth->x_cntrl = 0x00000006; */ /* full-duplex, heartbeat */ - fec->eth->x_cntrl = 0x00000004; /* full-duplex, heartbeat disabled */ - + /* + * Set FEC-Lite transmit control register(X_CNTRL): + * Half-Duplex + */ + fec->eth->x_cntrl = 0x00000000; + if (fec->xcv_type != SEVENWIRE) { /* * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock * and do not drop the Preamble. @@ -379,7 +375,7 @@ *(int *)FEC_TBD_NEXT = (int)fec->tbdBase; *(int *)FEC_RBD_NEXT = (int)fec->rbdBase; - if (fec->xcv_type != SEVENWIRE) { + if (fec->xcv_type == MII10) { /* * Initialize PHY(LXT971A): * @@ -410,87 +406,46 @@ miiphy_write(phyAddr, 0x0, 0x8000); udelay(1000); - if (fec->xcv_type == MII10) { - /* - * Force 10Base-T, FDX operation - */ -#if (DEBUG & 0x2) - printf("Forcing 10 Mbps ethernet link... "); -#endif - miiphy_read(phyAddr, 0x1, &phyStatus); - /* - miiphy_write(fec, phyAddr, 0x0, 0x0100); - */ - miiphy_write(phyAddr, 0x0, 0x0180); - - timeout = 20; - do { /* wait for link status to go down */ - udelay(10000); - if ((timeout--) == 0) { -#if (DEBUG & 0x2) - printf("hmmm, should not have waited..."); -#endif - break; - } - miiphy_read(phyAddr, 0x1, &phyStatus); -#if (DEBUG & 0x2) - printf("="); -#endif - } while ((phyStatus & 0x0004)); /* !link up */ - - timeout = 1000; - do { /* wait for link status to come back up */ - udelay(10000); - if ((timeout--) == 0) { - printf("failed. Link is down.\n"); - break; - } - miiphy_read(phyAddr, 0x1, &phyStatus); + /* + * Force 10Base-T, FDX operation + */ #if (DEBUG & 0x2) - printf("+"); + printf("Forcing 10 Mbps ethernet link... "); #endif - } while (!(phyStatus & 0x0004)); /* !link up */ + miiphy_read(phyAddr, 0x1, &phyStatus); + miiphy_write(phyAddr, 0x0, 0x0080); + timeout = 20; + do { /* wait for link status to go down */ + udelay(10000); + if ((timeout--) == 0) { #if (DEBUG & 0x2) - printf ("done.\n"); + printf("hmmm, should not have waited..."); #endif - } else { /* MII100 */ - /* - * Set the auto-negotiation advertisement register bits - */ - miiphy_write(phyAddr, 0x4, 0x01e1); - - /* - * Set MDIO bit 0.12 = 1(&& bit 0.9=1?) to enable auto-negotiation - */ - miiphy_write(phyAddr, 0x0, 0x1200); - - /* - * Wait for AN completion - */ - timeout = 5000; - do { - udelay(1000); - - if ((timeout--) == 0) { + break; + } + miiphy_read(phyAddr, 0x1, &phyStatus); #if (DEBUG & 0x2) - printf("PHY auto neg 0 failed...\n"); + printf("="); #endif - return -1; - } + } while ((phyStatus & 0x0004)); /* !link up */ - if (miiphy_read(phyAddr, 0x1, &phyStatus) != 0) { + timeout = 1000; + do { /* wait for link status to come back up */ + udelay(10000); + if ((timeout--) == 0) { + printf("failed. Link is down.\n"); + break; + } + miiphy_read(phyAddr, 0x1, &phyStatus); #if (DEBUG & 0x2) - printf("PHY auto neg 1 failed 0x%04x...\n", phyStatus); + printf("+"); #endif - return -1; - } - } while ((phyStatus & 0x0020) != 0x0020); - + } while (!(phyStatus & 0x0004)); /* !link up */ + #if (DEBUG & 0x2) - printf("PHY auto neg complete! \n"); + printf ("done.\n"); #endif - } } diff -Naur u-boot/include/configs/IceCube.h u-boot-paub/include/configs/IceCube.h --- u-boot/include/configs/IceCube.h 2004-03-17 02:13:08.000000000 +0100 +++ u-boot-paub/include/configs/IceCube.h 2004-03-25 09:15:46.000000000 +0100 @@ -232,7 +232,8 @@ * Ethernet configuration */ #define CONFIG_MPC5xxx_FEC 1 -#define CONFIG_FEC_10MBIT 1 /* Workaround for FEC 100Mbit problem */ +/* Define CONFIG_FEC_10MB To force FEC at 10Mb */ +/* #define CONFIG_FEC_10MBIT 1 */ #define CONFIG_PHY_ADDR 0x00 /*