cpu/lpc1768: add ethernet driver#22305
Open
basilfx wants to merge 9 commits into
Open
Conversation
1393b11 to
6a742ef
Compare
Although the ethernet peripheral isn't a common peripheral, it is best placed under the peripheral configuration in the Kconfig menu.
This commit adds a driver for the ethernet peripheral. It is split into a low-level peripheral driver, and a higher-level netdev driver. Two pseudo-modules are introduced for link state monitoring and auto negotiation. Kconfig support has been added too.
e7c2cc8 to
257d4a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
Note
Development of this PR happens in parallel to the EFM32 ethernet driver in #22306. Any feedback on this one is likely applicable to the other one as well. I will try to keep both PRs in sync where it matters.
This PR adds an ethernet driver for the LPC1768. Although this CPU is ancient and not the best-supported one, it is still an active one. It is also very well supported by other projects and I have a board (Seeeduino Arch Pro) that has ethernet support.
I have no former experience with ethernet drivers, so that's why I chose this one. Together with the help of LLMs, I figured this would be an OK challenge, which is a small side-step to get Modbus TCP support testable.
I took the ethernet driver of the SAM0 and the STM32 as a basis, and modelled it closely to that one.
What is provided:
lpc1768_eth_link_up,lpc1768_eth_auto) like the STM32.Testing procedure
The only LPC1768 board with ethernet in RIOT's code base, is the Seeeduino Arch Pro. I don't think many people will own this board, so it is noted that actual testing will a be a bit harder.
At this point, I would rather receive feedback on the general structure and adoption. I will then do my best to collect as much evidence as possible.
Testing has been performed as follows:
tests/drivers/lpc1768_ethWith
lpc1768_eth_autoenabled, the link speed is ~15-20 MBit/sec (measured using lwIP iPerf). Without, it is ~75-100 KBit/sec (classical issue due to link negotation issues).Compile test
Issues/PRs references
None
Declaration of AI-Tools / LLMs usage:
AI-Tools / LLMs that were used are:
cpu/lpc1768. I then refined, reworked and tested it myself. I did ask Claude Code to analyze bugs I encountered during testing. The final PR review was also done with Claude Code, but changes were applied manually. The test application, auto-init adoption and several other parts are simply copy-paste of existing drivers.