Using the MII -- am I missing something?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using the MII -- am I missing something?

1,790 Views
HanClinto
Contributor I
Hello,

I’m having trouble reading registers from the PHY on a Coldfire 5372. The PHY may or may not be relevant, but I'm accessing a Micrel KSZ8893MQL/MBL (Integrated 3-Port 10/100 Managed Switch with PHYs).

This chip provides access to registers through both an MII and an SMI (apparently a sort of "extended" MII that uses a subset of the MII protocol).

I prematurely thought that reading and writing to the MII and SMI ports for the network PHY were working – I saw the write functionality work, and (foolishly) thought that if writing data on that interface worked, that then reading on that interface would also work. I was wrong. Only writing to registers is working, but reading from registers isn’t returning any valid data.

I’ve been trying to do due diligence in checking things before I asked you guys, but I’m about out of ideas. Here’s what I’ve tried:
  1. I checked to see if there was anything wrong with the commands that I was sending to read from the MII / SMI – I looked at the bits and from what I can see, it matches the spec perfectly. It clearly works for writing, but the reading is not quite working.
  2. I tried reading from a whole host of registers (both MII and SMI), and none of them are returning valid data.
  3. I tried using a spin loop to poll the data ready register to see if that ever triggers – it goes through the spin loop just fine – I’m not sure if something isn’t set correctly or what, because clearly the data isn’t there that I was expecting.
  4. I tried switching interfaces, and reading from the MII rather than the SMI. This didn’t give me any different behavior. I also tried switching hardware, to a device that would use only the MII (with the SMI disabled) – that didn’t fix anything.
Any ideas? It's odd to me that writing to registers is working but reading from them is not.

Thanks in advance -- I'm new to using the MII, and could use some pointers as far as what I might try poking at next.

Cheers!

--clint
Labels (1)
0 Kudos
Reply
2 Replies

627 Views
msm516
Contributor I

I am having a very similar problem reading from the PHY on my 5372 as well. I would be very curious to know how this got resolved, if it has been. Following up on Mark's post, I do have a pull up on the data line and (like Clint) am also able to write, but have, thus far, been unable to successfully read.

 

Thanks in advance.

HanClinto rules!

0 Kudos
Reply

627 Views
mjbcswitzerland
Specialist V
Hi Clint

A couple of quick ideas:
- Have you a pull up on the MII input data line? I believe the PHY output is open drain so may require one to be able to be read.
- What value are you reading? Generally all registers of a non-responding PHY will be read as 0xffff
- Are you sure that you can write? PHYs often have a default configuration which is adequate for basic operation without any successful writes.
- Are you sure that you are reading from the correct PHY address? This is hardwired when powered up (read in on some inputs).

See also the following -it is not for your chip but maybe has something of interest:
http://www.utasker.com/forum/index.php?topic=161.0

regards

Mark

www.uTasker.com
0 Kudos
Reply