jlaitine opened a new pull request, #18273:
URL: https://github.com/apache/nuttx/pull/18273

   ## Summary
   
   This PR has two commits:
   - Correct the configuration flag CONFIG_IMX9_ENET_PHYINIT, which is 
mistakenly written as CONFIG_IMX9_ENET1_PHYINIT in the Kconfig. Also move it to 
more proper place in Kconfig.
   - Move the imx9_phy_boardinitialize to a later phase in ethernet 
initialization, to enable usage of sleeps and work-queues in board-specific 
logic.
   
   I needed this function on a custom board, which needs to separately enable 
the ethernet phy via an i2c command to another device. While doing this, I 
found out that the
   1) PHY is being reset unnecessarily early in the boot flow, and this is not 
possible (without specifying CONFIG_NETDEV_LATEINIT, whcih shouldn't be 
necessary just for this).
   2) It was not possible to even configure the function into use due to 
mismatch in the CONFIG flag name
   3) I'd like to physically reset/power on the phy again every time the 
interface is taken up
   
   This PR fixes those issues.
   
   ## Impact
   
   In theory, affects only imx9 based boards with CONFIG_IMX9_ENET_PHYINIT. 
Which shouldn't exist, since the flag was not usable due to misspelling it in 
Kconfig. So essentially, no boards are affected.
   
   ## Testing
   
   Tested on a custom hardware, which requires explicitly powering on the 
ethernet phy. After implementing the needed "imx9_phy_boardinitialize" in the 
board files, and enabling the CONFIG_IMX9_ENET_PHYINIT, I can see that the
   - PHY link LED starts working
   - Board can communicate with PC over ethernet when connected:
   ```
   nsh> ping 192.168.202.254
   PING 192.168.202.254 56 bytes of data
   56 bytes from 192.168.202.254: icmp_seq=0 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=1 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=2 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=3 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=4 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=5 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=6 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=7 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=8 time=0.0 ms
   56 bytes from 192.168.202.254: icmp_seq=9 time=0.0 ms
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to