• AVR Freaks

How to make a new PHY communicate with PIC32MX ?

Author
Fredo61
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2020/05/17 23:56:03
  • Location: 0
  • Status: offline
2020/05/20 08:44:07 (permalink)
0

How to make a new PHY communicate with PIC32MX ?

How to make a new PHY communicate with PIC32MX ?
 
Hello everybody,
we have developped a custom board with a PIC32MX795 and a Marvell chip as a PHY.
During prototyping, the project code was developped using Harmony V2.06 and an ETH SKII dev board.
 
What are the steps to follow to port our code and use our new PHY?
 
HW side:
  •  is it compulsory to use the MDIO and MCLK? Can we use instead HW (strapping) configuration on the Marvell chip?
    •  on the actual design, MDIO and MCLK are not used, and the PHY init Fails
SW side:
  •  I have found an old link to a PDF explaining which function have to be modified in the driver, but it refers to old drivers and not to Harmony 2.06. Anything recent?
  •  Once the driver is re-written, what should be modified so that it appears as a choice in the MHC?  
 
Thank you for your help!
Fredo
#1

1 Reply Related Threads

    rainad
    Moderator
    • Total Posts : 1329
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: How to make a new PHY communicate with PIC32MX ? 2020/05/22 06:54:18 (permalink)
    4 (1)
    1. The Harmony PHY driver uses the MIIM driver to get access to the PHY registers. The MIIM driver is a virtual one, meaning that as long as it provides the required functions, the implementation is irrelevant.
    I think that the easiest way is to provide a mock up MIIM driver (let's say DRV_MIIM_OBJECT_MARVELL) which just returns success and well known values when asked to communicate with the PHY. This will take care of the PHY initialization as long as the PHY is configured properly. You may need to disable the PHY auto-negotiation and use directly 100Mbps or whatever matches your network.
    Use this object in the PHY initialization:
    DRV_ETHPHY_INIT::pMiimObject = &DRV_MIIM_OBJECT_MARVELL.
     
    2. The functions to be modified in the PHY driver for the addition of a new PHY are the same, only they have been grouped into an proper object: DRV_ETHPHY_OBJECT (see definition in the drv_ethphy.h).
    So basically you need to provide a new object, let's say DRV_ETHPHY_OBJECT_MARVELL that implements the 3 functions: {miiConfigure, mdixConfigure, smiClockGet} (the wolConfigure can be ignored for now).
    These 3 functions can return constants and do nothing if everything is configured properly.
    Use the DRV_ETHPHY_OBJECT_MARVELL in the initialization structure: DRV_ETHPHY_INIT::const DRV_ETHPHY_OBJECT* pPhyObject = &DRV_ETHPHY_OBJECT_MARVELL .
     
    3. You'll need to add the new MARVEL PHY to the MHC code. I'd suggest you check first that everything is working as expected and when/if you regenerate the code just make sure you don't overwrite the changes. After that you can work on MHC changes, if you wish.
     
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5