How to add a new phy(KSZ8873 & KSZ8895) support to imx28 kernel 3.5

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a new phy(KSZ8873 & KSZ8895) support to imx28 kernel 3.5

3,678 Views
pritammunot
Contributor I

Hi There,

I am working on a custom board based on IMX28, linux kernel version is 3.5. On our prototype board we are using KSZ8873 & KSZ8895. KSZ8873 is a 3port switch and KSZ8895 is a 5port switch.

How to add support for these chips in the kernel, I got the device drives from Micrel and I have added them to the kernel and also in KConfig I have selected these drivers. For debugging I added messages in the device driver but it looks like the device driver is never initialized.

When the kernel boots I get  following lines.

[2.460000] eth0: no PHY, assuming direct connection to switch
[2.470000] PHY fixed-0:00 not found
[2.470000] eth0: could not attach to PHY
[2.470000] IP-Config: Failed to open eth0
[2.480000] IP-Config: Device `eth0' not found

In the DTS i have got following section for ethernet.

    mac0: ethernet@800f0000 {
   phy-mode = "rmii";
   pinctrl-names = "default";
   pinctrl-0 = <&mac0_pins_a>;
   phy-reset-gpios = <&gpio4 13 0>;
   phy-reset-duration = <100>;
   status = "okay";
   };

   mac1: ethernet@800f4000 {
   phy-mode = "rmii";
   pinctrl-names = "default";
   pinctrl-0 = <&mac1_pins_a>;
   phy-reset-gpios = <&gpio4 13 0>;
   phy-reset-duration = <100>;
   status = "okay";
   };

I am new to device driver setup. Can some one please give some pointers as in how to debug this issue.

Thanks

Tama

Labels (2)
0 Kudos
2 Replies

104 Views
phdm
Contributor III

Hi,

I have the same problem here, with a different processor (i.mx6) and a different kernel (3.13).  They are three configuration modes for the ksz8895, allowing configuration either by an I2c connected serial eeprom, either the mdc/mdio connection abused (SMI), either a SPI connection.  In the I2c mode, the switch can start automatically, but in the SMI and SPI modes, one must start it by writing 1 in the configuration register 1, using the SMI or SPI protocol.

If your ksz8895 is connected using SPI, you could have a look at drivers/net/phy/spi_ks8995.c, which does similar things.  Mine is connected using SMI, for which I found nothing similar.

0 Kudos

104 Views
MarekVasut
Senior Contributor I

You would have to factor out the logic and then implement it as a regular PHY driver I believe. Btw. it might be worth switching to mainline with MX28, since it's well supported and not ancient.

0 Kudos