From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 8 Dec 2007 13:40:24 +0100 Subject: [U-Boot-Users] PATCH: add support for MII-connected ethernet switch for IPX42x In-Reply-To: <20071110153448.GA11033@discworld.dascon.de> References: <20071110153448.GA11033@discworld.dascon.de> Message-ID: <20071208124024.GA32116@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 16:34 Sat 10 Nov , Michael Schwingen wrote: > Hi, > > the following patch adds support for an ethernet switch that is connected to > the MII port. In that case, there is no PHY with which auto-negotiation can > be done, and the MII port always runs in full-duplex 100MBit/s mode. > > Signed-off-by: Michael Schwingen > > diff --git a/cpu/ixp/npe/npe.c b/cpu/ixp/npe/npe.c > index 7e4af44..88d0183 100644 > --- a/cpu/ixp/npe/npe.c > +++ b/cpu/ixp/npe/npe.c > @@ -361,6 +361,10 @@ static int npe_init(struct eth_device *dev, bd_t * bis) > > debug("%s: 1\n", __FUNCTION__); > > +#ifdef CONFIG_MII_ETHSWITCH > + speed = _100BASET; > + duplex = FULL; > +#else > miiphy_read (dev->name, p_npe->phy_no, PHY_BMSR, ®_short); > > /* > @@ -396,6 +400,7 @@ static int npe_init(struct eth_device *dev, bd_t * bis) > printf ("ENET Speed is %d Mbps - %s duplex connection\n", > (int) speed, (duplex == HALF) ? "HALF" : "FULL"); > } > +#endif > > npe_alloc_end = npe_alloc_pool + sizeof(npe_alloc_pool); > npe_alloc_free = (u8 *)(((unsigned)npe_alloc_pool + Hi, If you have a switch between your phy and your cpu the speed and the duplex must be specified by the phy driver. The best way is to add a function that request the phy status and do not wait the phy autonegociation like done in the kernel by read_status callback and it's implementation genphy_read_status. Best Regards, J.