Skip to content

Commit fa0f3ad

Browse files
committed
boards: st: stm32h7s78_dk: add Ethernet support
Add Ethernet configuration to the board's .dtsi file and add a fallback for sram2 (sram1) which is needed for Ethernet. Updated the board yaml file to include Ethernet feature and updated documentation to explain Ethernet usage. Signed-off-by: Benjamin Klaric <benjamin.klaric01@gmail.com>
1 parent 9e6256e commit fa0f3ad

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

boards/st/stm32h7s78_dk/doc/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Default Zephyr Peripheral Mapping:
180180
- USB OTG FS DM/DP : PM12/PM11
181181
- XSPI1 NCS/DQS0/DQS1/CLK/IO: PO0/PO2/PO3/PO4/PP0..15
182182
- I2C1 SCL/SDA: PB6/PB9
183+
- ETH: PA2, PA7, PB0, PB1, PC1, PC4, PC5, PD7, PG11
183184

184185
System Clock
185186
------------
@@ -200,6 +201,13 @@ USB
200201
STM32H7S78-DK Discovery board has 2 USB Type-C connectors. Currently, only
201202
USB port2 (FS) is supported.
202203

204+
Ethernet
205+
--------
206+
207+
In order to use Ethernet on STM32H7S78-DK, you need to set the ``JP6`` jumper
208+
to PC1 position on the back side of the board.
209+
210+
203211
Programming and Debugging
204212
*************************
205213

boards/st/stm32h7s78_dk/stm32h7s78_dk-common.dtsi

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,31 @@
209209
};
210210
};
211211

212+
&mac {
213+
pinctrl-0 = <&eth_rmii_ref_clk_pd7
214+
&eth_rmii_crs_dv_pa7
215+
&eth_rmii_rxd0_pc4
216+
&eth_rmii_rxd1_pc5
217+
&eth_rmii_tx_en_pg11
218+
&eth_rmii_txd0_pb0
219+
&eth_rmii_txd1_pb1>;
220+
pinctrl-names = "default";
221+
phy-connection-type = "rmii";
222+
phy-handle = <&eth_phy>;
223+
status = "okay";
224+
};
225+
226+
&mdio {
227+
pinctrl-0 = <&eth_mdio_pa2 &eth_mdc_pc1>;
228+
pinctrl-names = "default";
229+
status = "okay";
230+
231+
eth_phy: ethernet-phy@0 {
232+
compatible = "ethernet-phy";
233+
reg = <0x00>;
234+
};
235+
};
236+
212237
&xspi1 {
213238
pinctrl-0 = <&xspim_p1_ncs1_po0 &xspim_p1_dqs0_po2
214239
&xspim_p1_dqs1_po3 &xspim_p1_clk_po4

boards/st/stm32h7s78_dk/stm32h7s78_dk.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ supported:
1616
- octospi
1717
- usbd
1818
- memc
19+
- netif:eth
1920
vendor: st

soc/st/stm32/stm32h7rsx/mpu_regions.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ static const struct arm_mpu_region mpu_regions[] = {
3131
MPU_REGION_ENTRY("ID", 0x08FFF800, REGION_FLASH_ATTR(REGION_2K)),
3232

3333
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(mac))
34-
#define sram_eth_node DT_NODELABEL(sram2)
34+
35+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(sram2))
36+
#define sram_eth_node DT_NODELABEL(sram2)
37+
#else
38+
#define sram_eth_node DT_NODELABEL(sram1)
39+
#endif
40+
3541
#if DT_NODE_HAS_STATUS_OKAY(sram_eth_node)
3642
/* Region 5 - Ethernet DMA buffer RAM */
3743
MPU_REGION_ENTRY("SRAM_ETH_BUF", DT_REG_ADDR(sram_eth_node),

soc/st/stm32/stm32h7rsx/sections.ld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
*/
66

77
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(mac))
8+
9+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(sram2))
810
#define sram_eth_node DT_NODELABEL(sram2)
11+
#else
12+
#define sram_eth_node DT_NODELABEL(sram1)
13+
#endif
14+
915
#if DT_NODE_HAS_STATUS_OKAY(sram_eth_node)
1016
SECTION_DATA_PROLOGUE(eth_stm32,(NOLOAD),)
1117
{

0 commit comments

Comments
 (0)