-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/sam0_eth: interrupt based link detection/auto-negotiation #19703
Conversation
Is it still WIP ? |
It is still using the timer rather then the GPIO IRQ |
It uses the IRQ, the timer is just a fallback for when it doesn’t work on the first try - not sure why our board is so ' special' there.
|
3a97148
to
e0d955b
Compare
e0d955b
to
63d0695
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels free to squash directly.
3bd9457
to
9d40bd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
bors merge |
Build failed: |
The usual KConfig forgotten issue 😉 |
9d40bd6
to
508d64a
Compare
bors merge |
19703: cpu/sam0_eth: interrupt based link detection/auto-negotiation r=benpicco a=benpicco 19724: dist/tools/openocd: add OPENOCD_SERVER_ADDRESS variable r=benpicco a=fabian18 19735: nrf5x_common: Clear I2C periph shorts r=benpicco a=bergzand ### Contribution description The I2C peripheral's shortcuts are used with the read and write register to automatically stop the I2C transaction or to continue with the next stage. With simple I2C read and write bytes these shorts are not used, but are also not cleared by the function in all cases, causing it to use the shortcut configuration set by a previous function call. This patch ensures that the shorts are always set by the read and write functions ### Testing procedure Should be possible to spot with a logic analyzer and the I2C periph test. Maybe the HIL test can also detect it :) ### Issues/PRs references None Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com> Co-authored-by: Koen Zandberg <koen@bergzand.net>
Build failed (retrying...): |
508d64a
to
2a255ff
Compare
Canceled. |
bors merge |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Contribution description
The PHY interrupt line is connected to the MCU, so we can just generate a GPIO interrupt when a PHY event orrurs.
This allows us to have
LINK_UP
/LINK_DOWN
events which are needed to start / stop sending router solicitations.We can also use the result of the auto-negotiation process to configure the MAC accordingly.
There is a bit of a hack inside: When we have an auto-negotiation capable link partner, but auto-negotiation fails after a timeout, we just re-start the auto-negotiation process.
This is not needed on
same54-xpro
where auto-negotiation always works on the first try, but with our custom board, this is not always the case - it's still unclear as to why, but the link is stable afterwards and we don't have any packet loss.So Having this added robustness is IMHO fine.
Testing procedure
ifconfig
should now show the real link status.When you start the board with the Ethernet cable unplugged, router solicitations will only start once you plug in the cable.
Issues/PRs references
similar to #14688