You wrote:
Here’s a difference I noticed with the phy drivers.
The ASF3 phy driver had the following definition:
#define GMII_PCR1 0x1E // PHY Control 1
#define GMII_PCR2 0x1F // PHY Control 2
In the FreeRTOS-Plus-TCP/portable/NetworkInterface/Common/phyHandling.c
#define phyREG_19_PHYCR 0x19U /* 25 RW PHY Control Register */
#define phyREG_1F_PHYSPCS 0x1FU /* 31 RW PHY Special Control Status */
Are these referring to the same register ?? Should the 0x19U be 0x1EU ?
Note that the Atmel driver defines GMII_PCR2
, but it does not use it. It defines and is also uses the first register GMII_PCR1
.
phyHandler.c also refers to this register here:
pxPhyObject->fnPhyRead( xPhyAddress, 0x1E, &ulControlStatus );
I should have given it a proper name, something like PHY_Control_1
, in stead of the number 0x1E
. PHY_Control_1
is very specific for this PHY.
The module common/phyHandling.c is a generic PHY-driver. It has also been used and tested on KSZ8081 (E70-Xplained). I just retested it on my SAME70-XPLD board, and it worked fine.
I saw this logging:
[IP-task ] PHY ID 221560
[IP-task ] xPhyReset: phyBMCR_RESET 0 ready
[IP-task ] +TCP: advertise: 01E1 config 3100
[IP-task ] prvEthernetUpdateConfig: LS mask 00 Force 1
[IP-task ] Autonego ready: 0000786d: full duplex 100 mbit high status
The PHY-driver creates some logging by calling FreeRTOS_printf()
. Can you somehow make this logging visible?
You wrote:
#if BOARD != SAME70_XPLAINED
/*
* Clock input to XI (Pin 8)
*/
ul_phy_ctrl2 = GMII_RMI_REF_CLK_SELECT;
uc_rc = gmac_phy_write(p_gmac, uc_phy_addr, GMII_PCR2, ul_phy_ctrl2);
if (uc_rc != GMAC_OK) {
gmac_enable_management(p_gmac, false);
return uc_rc;
}
#endif
I do not have this code. Both my SAME70 and SAM4E projects use the generic PHY driver.
It looks like this is part of Atmel’s PHY driver, which you do not need if you are using phyHandling.c