• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » ARM® Processors » Sitara™ ARM® » AM3x Sitara ARM Processors Forum » Phy GigaEthernet to replace AR8031 with KSZ9021 (micrel)
Share
Sitara™ ARM®
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

Phy GigaEthernet to replace AR8031 with KSZ9021 (micrel)

This question is answered
Keldy
Posted by Keldy
on Apr 16 2012 10:51 AM
Expert1780 points

Hi,

I'm using AM335x MPU, i'm planing to use micrel KSZ9021RL gigabit PHY on AM335x.

is the ethernet device drive from AM335x EVM SDK is generic?

Thanks

Keldy

sdk AM335x PSP CPSW Ethernet
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • peaves
    Posted by peaves
    on Apr 27 2012 17:23 PM
    Genius13005 points

    As mentioned in your other E2E forum post titled “Ethernet PHY connection and configuration“, the KSZ9021 has different default timing for the RGMII signals. 

    You must configure the KSZ9021 to meet the timing requirements defined in the AM335x data sheet.

    The receive data is transferred with respect to the receive clock and the transmit data is transferred with respect to the transmit clock. You need to insure all timing parameters of both devices are within the specified operating range.  This may require timing adjustments via the KSZ9021RL RGMII Clock and Control Pad Skew and RGMII RX Data Pad Skew registers.

    Note: The AM335x has the internal delay mode enabled by default and this is not supported so you must disable the internal delay mode in AM335x and adjust RGMII timing using the timing adjustment features in KSZ9021.

    Regards,
    Paul

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on Apr 30 2012 02:07 AM
    Expert1780 points

    Hi,

    I had disable the internal delay by changing file in "ti-sdk-am335x-evm-05.03.00.00/board-support/u-boot-2011.09-psp04.06.00.02/board/ti/am335x/evm.c"  

    int board_init(void)
    {
     __raw_writel(0x00111010, gmii_sel); --------------------disable internal delay, enable RGMII

    In adjustment of RGMII timing of KSZ9021 micrel phy, i have no idea how to do it. Any tutorial that i can refer ?

    Thanks & Regards

    Keldy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steve Kipisz
    Posted by Steve Kipisz
    on Apr 30 2012 14:13 PM
    Expert3965 points

    To change the phy timings you use the MDIO interface to modify phy registers. In u-boot, you would use the miiphy_read() and mmiphy_write() routines. In u-boot, look in evm.c for the evm_phy_init() routine. You can see where code reads registers MII_PHYSID1 and MII_PHYSID2 to determine which phy is used. You would want to add code to test for your phy and, if found, program the RGMII Clock and Control Pad Skew register (address 260) and the RTMII RX Data Pad Skew register (address 261). I found these addresses in the Micrel datasheet.

    I asked Paul for more information about these registers and he said:

    He needs to check the timing of each RGMII signal.  This calculation is done by using the minimum setup/hold time input requirements, the min/max output characteristics, and PCB propagation delays of each signal to determine how to configure these registers. 

    For example, the RX data to RX clock output characteristics of the KSZ9021 is +/-500ps and the AM335x input requires a minimum 1ns setup and hold time to operate properly.  If the PCB propagation time of RX data and RX clock are equal, the RX clock would need to be delayed in the KSZ9021 about 1.5ns - 2ns to center the clock edge in the valid data window.

    Steve K.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on May 01 2012 10:31 AM
    Expert1780 points

    Hi,

    Thanks for reply.

    I know nothing about RGMII calculation and RGMII signal tunning. I'll try study some RGMII document to learn.

    Please continue to support me in this issue.

    Thanks & Regards

    Keldy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on May 02 2012 04:01 AM
    Expert1780 points

    Hi,

    base on ksz9021 datasheet, the TskewT min/max is +/- 500ps, TskewR max is 2.6ns, AM335x setup/hold time min is 1ns, assume PCB propagation delay is same.

    RXC skew delay about 1.5ns(500ps + 1ns) to 3.1ns(500ps + 2.6ns) 

    TXC skew delay about 1.5ns(500ps + 1ns) to 3.1ns(500ps + 2.6ns)

    RXCTL, TXCTL, RXD[0-3] skew delay set to 0ns

    ksz9021 phy, register 260: 

    default value     default delay     new value     new delay
    RXC PAD Skew (0.2ns/step) 0111     0.2 x 7 = 1.4ns     1000     0.2 x 8 = 1.6ns
    RX_CTL PAD Skew (0.2ns/step) 0111     0.2 x 7 = 1.4ns     0000     0.2 x 0 = 0ns
    TXC PAD Skew (0.2ns/step) 0111     0.2 x 7 = 1.4ns     1000     0.2 x 8 = 1.6ns
    TX_CTL PAD Skew(0.2ns/step) 0111     0.2 x 7 = 1.4ns     0000     0.2 x 0 = 0ns

    register 261

    default value     default delay     new value     new delay
    RXD3 PAD Skew (0.2ns/step) 0111     0.2 x 7 = 1.4ns     0000     0.2 x 0 = 0ns
    RXD2 PAD Skew (0.2ns/step) 0111     0.2 x 7 = 1.4ns     0000     0.2 x 0 = 0ns
    RXD1 PAD Skew (0.2ns/step) 0111     0.2 x 7 = 1.4ns     0000     0.2 x 0 = 0ns
    RXD0 PAD Skew(0.2ns/step) 0111     0.2 x 7 = 1.4ns     0000     0.2 x 0 = 0ns

     Am i correct with the register new configuration? 

    Thanks & Regards

    Keldy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • -DK-
    Posted by -DK-
    on May 03 2012 14:08 PM
    Verified Answer
    Verified by Keldy
    Expert6970 points

    Hello Keldy,

    After reviewing the Micrel datasheet, I agree that you are moving in the right direction, but I would suggest trying to center the data a bit more by setting 0x104 [15:0] to 0x9797. This would set the new delay for TXC and RXC to 1.8ns while leaving RX_CTL and TX_CTL at their default values.

    Keep in mind this number may still need to be adjusted higher or lower based on the specifics of your design, but this should be a good start.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on May 04 2012 01:33 AM
    Expert1780 points

    Hi,

    How about the RXD[0-3] skew delay ? leave it to default value 0x7777, or change to 0x0000 ?

    The miiphy_read() and miiphy_write() function only allow 8 bits phy register address, writing value to phy register 0x104 and 0x105 using miiphy_write() make writing value to phy register 0x04 and 0x05.

    Any other method to write to phy register 0x104 and 0x105?

    Thanks & Regards

    Keldy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • -DK-
    Posted by -DK-
    on May 04 2012 14:44 PM
    Verified Answer
    Verified by Keldy
    Expert6970 points

    Yes,

    Please set the RXD[0-3] skew delays to '0'. Again, you may have to tune these values based on the specifics of your implementation.

    As for extended register methods, please use the Extended Register Read and Extended Register Write functionality present in this PHY. This is described on page 33 of the KSZ9021 datasheet.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ali Asgar Sohanghpurwala
    Posted by Ali Asgar Sohanghpurwala
    on May 07 2012 11:13 AM
    Prodigy180 points

    Keldy, please post back here if you have success getting the Micrel PHY to work with these settings.  We are laying out a board with the same PHY and may have to go through the same process.  Perhaps if we can get the Micrel chip timings right we can add support for this phy to the u-boot tree.

    It looks like there shouldn't be anything changed in the kernel right?  Just in u-boot?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on May 12 2012 09:49 AM
    Expert1780 points

    Hi,

    Yes, just in uboot.

    Thanks & Regards

    Keldy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vladimir Novikov
    Posted by Vladimir Novikov
    on May 18 2012 09:32 AM
    Prodigy10 points

    Hi Keldy,

    Any luck with the PHY? I have absolutely the same problem. I've stumbled upon this thread and am just curious if you get it work. I've tried everything including Extended Registers with no luck. And Micrel's tech support is just unresponsive, to say the least.

    Thank you,

    Vlad.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on May 19 2012 02:07 AM
    Expert1780 points

    Hi,

    My custom PCB board just arrived, before this i just jump wire to test the micrel PHY. but i facing the UART0 boot problem now, will come back to this after i fix the boot problem.

    Thanks & Regards

    Keldy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on May 31 2012 08:14 AM
    Expert1780 points

    Hi,

    it works! it was the skew delay problem. The ethernet driver is generic.

    setting the micrel phy register (0x104) to value 0x9797, and register(0x105) to value 0x0000 make my ethernet working. But there is a failure sometime, need to tune the skew delay properly to make sure working properly.

    Many Thanks to Paul, Steve K, and DK.

    Thanks & Regards

    Keldy 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Russell Robinson
    Posted by Russell Robinson
    on Jun 01 2012 11:33 AM
    Prodigy50 points

    Hi Keldy,

    You mentioned above that you were only making changes in U-boot, not Linux. In U-Boot, is it operating at 100Mbit/s or 1000Mbit/s? Did you get it to work in Linux?

    Currently we have the same PHY operating at 100Mbit/s, and only in U-boot. Our skew delays are slightly different (more optimized for the required delay and our hardware setup), and we're setting them in both U-boot and Linux, but in U-boot it is limited to 100Mbit/s and in Linux it comes up and then goes down as soon as it is actually configured with the cpsw driver. Therefore, I'm curious if you actually got it to work in Linux.

    Thanks,
    Russell 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Keldy
    Posted by Keldy
    on Jun 01 2012 22:34 PM
    Expert1780 points

    Hi,

    only make changes in u-boot, i use ' mii ' command to write data to phy register, operating speed is 100Mbit/s, and i can boot kernel image and file system through network, and i can telnet into my board from linux PC. For 1000Mbit/s i haven't test yet. At least know AM335x SDK driver can support micrel phy, what need to do is tuning the skew.  

    Thanks and Regards

    Keldy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
123
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use