From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <6.0.1.1.0.20040308093457.01eb3158@192.168.2.1> Date: Mon, 08 Mar 2004 09:41:52 +0100 To: Eugene Surovegin From: llandre Subject: Re: Bug in new IBM 4xx on-chip Ethernet drivers? Cc: benh@kernel.crashing.org, Stefan Roese , linuxppc-embedded@lists.linuxppc.org, Matt Porter In-Reply-To: <20040303183637.GA32732@gate.ebshome.net> References: <6.0.1.1.0.20040303103039.01efcac0@dns.struinfo.it> <20040303183637.GA32732@gate.ebshome.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-linuxppc-embedded@lists.linuxppc.org List-Id: Hi Eugenene, I can confirm your experience. As phy we use the STE100P from ST. I've never seen it to fail with MII clock frequency set to 3.3MHz. Anyway I think that, for production, it should be set to 2.5MHz as requested by the datasheet. >On Wed, Mar 03, 2004 at 10:48:00AM +0100, llandre wrote: > > I'm working with a custom 405EP-based board. So far I used the kernel > 2.4.20 > > and now I'm moving to the 2.4.23. I realized that the on-chip Ethernet MAC > > driver > > changed. > > I have a question about the function emac_phy_read in ibm_ocp_enet.c file. > > In my understanding the following snippet is not correct > > > > /* Clear the speed bits and make a read request to the PHY */ > > stacr = ((EMAC_STACR_READ | (reg & 0x1f)) & > ~EMAC_STACR_CLK_100MHZ); > > stacr |= ((mii_id & 0x1F) << 5); > > > > because it assumes the OPB clock frequency is 50MHz. If it differs, > > the MII clock frequency generated by the Ethernet controller is erroneous. > > For example, with OPB frequency = 66MHz, the MII clock frequency is set > > to 3.3MHz (this should be 2.5MHz). > >Although you are rigth that this code needs fixing, my experience with >different 4xx hardware running with different OPB clock speed showed >that even incorrect setting doesn't affect MII operation. > >And to be fair, all previous EMAC drivers had the same bug :). > >Eugene. llandre ** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/