-
Notifications
You must be signed in to change notification settings - Fork 8.1k
STM32: add ethernet support to stm32h7rs #97364
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
base: main
Are you sure you want to change the base?
Conversation
Add ethernet node with mac and mdio subnodes to dts similar to h7-family. Signed-off-by: Thomas Decker <[email protected]>
6d30e66
to
764aa8b
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.
Hello @TD-JBL , thanks for the contribution. Could you add the pin layout used for the Ethernet in the index.rst of the board in the last commit?
In the Default Zephyr Peripheral Mapping part :
+ -ETH : PA2, PA7, PB6, PG4, PG5, PG6, PG11, PG12, PG13
Otherwise it looks goods to me
764aa8b
to
bac9d90
Compare
Sure, added the documentation. I also fixed a wrong heading format in this file (I added with FDCAN documentation). Is it ok to add this in a extra commit to this PR? |
compatible = "st,stm32-ethernet-controller"; | ||
clock-names = "stm-eth"; | ||
clocks = <&rcc STM32_CLOCK(AHB1, 15)>; | ||
|
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.
status = "disabled"
?
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.
Disable the parent ethernet
node as well? Sounds correct. I copied the ethernet node from stm32h7.dtsi, there it is also missing.
ðernet {status = "okay";}
is then needed in all boards.
I don't have enough experience with Zephyr to decide that... But I'll add it if needed/wanted.
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.
This was introduced with the split of the mac from the ethernet node.
Fixing this would have a wide impact and should be done in a dedicated PR if we think it should be fixed. Meanwhile, I think it is ok to use the same pattern on h7rs.
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.
as the parent is there just to provide common props that are shared by the mac and mdio and it doesn't have a driver on it's own, it is fine that we don't use the status.
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.
as the parent is there just to provide common props that are shared by the mac and mdio and it doesn't have a driver on it's own, it is fine that we don't use the status.
Fine to me as well.
@@ -0,0 +1,20 @@ | |||
/* | |||
* Copyright (c) 2020 Mario Jaun |
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.
Copyright up to date?
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.
I took the sections.ld including the copyright from h7 and changed only the sram node selection. That's fine for me.
Add SOC_SERIES_STM32H7RSX to applicable Kconfig parameters and enable use of .eth_stm32_desc and .eth_stm32_buf linker sections for ethernet dma. Signed-off-by: Thomas Decker <[email protected]>
Add ethernet DMA buffer/descriptor region (sram2) and read only flash region 0x08FFF800 with unique device ID registers to MPU region list. The unique device ID is used to create a random mac address by the ethernet driver. Ethernet DMA buffer/descriptor memory section is also added to linker script. Signed-off-by: Thomas Decker <[email protected]>
Enable support for ethernet on nucleo_h7s3l8 board. Signed-off-by: Thomas Decker <[email protected]>
Fix wrong heading type in index.rst introduced with PR zephyrproject-rtos#95388 Signed-off-by: Thomas Decker <[email protected]>
bac9d90
to
304fa82
Compare
|
This PR adds ethernet support for STM32H7RS series microcontrollers.
It's almost a 1:1 copy of h7x ethernet configuration. Only register addresses, clock sources and interrupt numbers changed in device tree and the used RAM for DMA buffer.
Changes:
SOC_SERIES_STM32H7RSX
where appicable next toSOC_SERIES_STM32H7X
.Used DMA memory
As all h7rs variants have the same memory configuration, there is no need to support multiple memories as DMA buffer.
sram1
andsram2
(AHB SRAM1 and AHB SRAM2) are identical, so I hardcoded the DMA buffer intosram2
.At first I tried not defining any special memory and let the driver use the NOCACHE memory, but after reading #29915 and #30403 I decided to keep it as near as possible to the h7x implementation.
Edit: Is it possible or useful to add a Kconfig option or dts property to select the used sram node?
0x08FFF800 read only flash region with unique device ID registers
The controller memfaults without this region in the MPU list while trying to read the uniqe device ID registers. The PR #94019 introduced a different way of preventing speculative access in entire memory space than the one used for h7x:
MPU_REGION_ENTRY("UNMAPPED", 0, {REGION_4G | MPU_RASR_XN_Msk | P_NA_U_NA_Msk}),
Every accessed memory must get a MPU region after blocking access to the complete memory space with this entry.
The unique device ID is used to create a random mac address by the ethernet driver in some conditions.
Testing Status:
Maybe someone more familiar with running mcuboot+samples on this board can run some tests?