Clint Herron

Using the MII -- am I missing something?

Discussion created by Clint Herron on Jan 9, 2009
Latest reply on Feb 24, 2009 by Clint Herron

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.