ksz9021RN Unable to Auto-negotiate

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

ksz9021RN Unable to Auto-negotiate

Jump to solution
977 Views
Vinos
Contributor III

Hello,I've been debugging the Gigabit Ethernet chip KSZ9021RN.I'm using the I.MX RT1176 platform. I understand that most of the KSZ9021 examples are for the I.MX Linux platform, but initializing this chip basically involves configuring some registers. I've referred to some of the code in U-Boot for initializing the KSZ9021.

My initialization process is as follows:

1.Successfully read the correct chip ID from register 0x02.

2.Software PHY reset: Set bit 15 of register 0x00.

3.Set RGMII RX/TX Data Pad Skew:

(1) Write register 0x0B as 0x8105, write register 0x0C as 0.

(2) Write register 0x0B as 0x8104, write register 0x0C as 0xa0d0.(I am unsure how these skew values should be set and whether they may affect auto-negotiation.)

4.Read register 0x1B (Interrupt Control/Status) to clear interrupts.

5.Set bit 8 (enable link up interrupt) and bit 10 (enable link down interrupt) of register 0x1B to 1.

6.Set bit 14 of register 0x1F to 0 (interrupt pin active low).

7.Set bits 5 to 8 of register 0x04 to 1 (10/100M full/half duplex capable).

8.Set bit 9 (Restart auto-negotiation process) of register 0x00 to 1 and bit 12 (Auto-Negotiation Enable) to 1.

After initializing these registers, I am waiting for bit 2 (Link Status) in register 0x01 to become 'link up.' I have connected an Ethernet cable to the computer on the hardware side, but the value of this register always remains at 0x7949, and the LEDs on both sides of the RJ45 connector do not light up.

If I turn off Auto-negotiate and use the default 10Mbps speed, I can establish a normal link-up. However, when I manually set the speed to 100Mbps or 1000Mbps, it fails.

There is another issue as well: when operating at 10Mbps, If register 0x104 is not properly configured, the computer also cannot ping the board.

3.png

I'm not sure how these parameters should be configured. 

Additionally, auto-negotiation doesn't work properly. I'm not sure if it's due to the configuration of these registers or if there's an issue in my hardware circuit, such as an inaccurate crystal oscillator.

I would greatly appreciate your response.

0 Kudos
Reply
1 Solution
913 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

 

Please find the following community post that can be help full . Let me know if there is anything else where I can help you.

View solution in original post

0 Kudos
Reply
3 Replies
946 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

Thank you in advance for contacting NXP support.

In this case I would recommend to contact the product vendor for the configuration of the ksz9021RN as this is not an NXP product. They would provide more details regarding the configuration of the ksz9021RN. As it was mentioned the examples or solutions we have with this product is only available for the i.MX modules.

Please let me know if there is anything else where we can help you.

0 Kudos
Reply
922 Views
Vinos
Contributor III
It seems that there is a driver for this module in I.MX6ULL. Where can I download the Linux source code for I.MX6ULL?
0 Kudos
Reply
914 Views
nxf77486
NXP TechSupport
NXP TechSupport

Hello,

 

Please find the following community post that can be help full . Let me know if there is anything else where I can help you.

0 Kudos
Reply