Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hi, I want to use a new phy BCM89884 in AM2632 with mido45, but the default phy in sdk is mdio22, how can I add the new phy in syscfg and use mdio45 to contorl phy reg
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
1. Follow the steps here to integrate the PHY not supported by the default SDK: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/custom_enetphy_guide.html
2. The SDK can support clause-45 frame format as well, You can configure this in the example.syscfg file. Here in the "Supports MDIO Clause-45", enter your PHY address
and check the "Clause 45 Support" box in the MAC Port config
Regards,
Shaunak
Hi zx,
I am looking into it, please expect a response by tomorrow.
Regards,
Shaunak
Hi ZX,
Apologies for a delayed response, can you also perform the following steps:
1. In the following Javascript file located at: mcu_plus_sdk/source/networking/enet/core/sysconfig/networking/.meta/enet_cpsw/am263x/enet_cpsw_macport_config.syscfg.js, Please remove the line-number-199 (readOnly: true)
2. After step-1, when you re-open the example.syscfg in your application, you will be able to check the Clause-45 Support checkbox. Rebuild your application.
3, In the MDIO_open function, set a breakpoint and ensure that the MDIO configuration is written correctly and CSL_MDIO_setClause45EnableMask is called to set the mask for Clause-45
Also, since the BCM89884 is a non TI PHY, make sure you take care of the PHY configurations (if any configs are required for the PHY to support Clause45) in the application. Also ensure the PHY Address is mentioned correctly in the application syscfg. This should be also visible in the Mdio_Cfg enetAppCpswMdioCfg in syscfg auto-generated ti_enet_open_close.c file
Regards,
Shaunak
Hi :
After following your steps to modify, it can be confirmed that CSL_MDIO_setClause45EnableMask is called to set the mask for Clause-45, but the operation interface of phy is still docked with 22 by default,and we need to manually modify it to 45
Are there any other configuration items missing?
int32_t EnetPhy_readReg(void* pArgs, uint32_t reg, uint16_t *val) { EnetPhy_Handle hPhy = (EnetPhy_Handle)pArgs; EnetPhy_MdioHandle hMdio = hPhy->hMdio; uint32_t phyGroup = hPhy->group; uint32_t phyAddr = hPhy->addr; int32_t status; status = hMdio->readC22(phyGroup, phyAddr, reg, val, hPhy->mdioArgs); ENETTRACE_ERR_IF(status != ENETPHY_SOK, "PHY %u: Failed to read reg %u: %d\r\n", phyAddr, reg, status); ENETTRACE_VERBOSE_IF(status == ENETPHY_SOK, "PHY %u: reg %u val 0x%04x %s\r\n", phyAddr, reg, *val); return status; } int32_t EnetPhy_writeReg(void* pArgs, uint32_t reg, uint16_t val) { EnetPhy_Handle hPhy = (EnetPhy_Handle)pArgs; EnetPhy_MdioHandle hMdio = hPhy->hMdio; uint32_t phyGroup = hPhy->group; uint32_t phyAddr = hPhy->addr; int32_t status; status = hMdio->writeC22(phyGroup, phyAddr, reg, val, hPhy->mdioArgs); ENETTRACE_ERR_IF(status != ENETPHY_SOK, "PHY %u: Failed to write reg %u: %d\r\n", phyAddr, reg, status); ENETTRACE_VERBOSE_IF(status == ENETPHY_SOK, "PHY %u: reg %u val 0x%04x\r\n", phyAddr, reg, val); return status; }
Looking forward to your reply
zx
Hi ZX,
The driver is actually generic and common for Clause-22 & Clause-45. Since all the AM263x on-board PHYs support Clause22, the function is directly calling Clause22 and hasn't been tested with Clause-45 frame format completely due to unavailability of some hardware on our end. Due to some release activities in line, the complete validation will take a few weeks.
The generic flow would be the EnetPhy_readReg or EnetPhy_writeReg functions being called from IOCTLs which internally call hMdio->read22 or hMdio->write22.
For now, there are two options,
1. Incase you just want to have clause-45 read and write and not use clause-22, you can modify the EnetPhy_readReg and EnetPhy_writeReg to call hMdio->read45 and hMdio->write45 instead of the read22 and write22 functions, so whenever any PHY Reg read or write is called, it will call the
2. In your PHY Driver, you can directly call the EnetPhy_readC45Reg and EnetPhy_writeC45Reg to perform Clause-45 based read or writes
Regards,
Shaunak