Skip to content

Commit 2fdc201

Browse files
committed
boards: stm32h7s78_dk: fix SRAM region definition
Define the SRAM region for Ethernet descriptor and buffer using memory-region = <...> in the mac node. Also add netif:eth to ext_flash yaml board file and fix CI checks. Signed-off-by: Benjamin Klaric <benjamin.klaric01@gmail.com>
1 parent fa0f3ad commit 2fdc201

File tree

6 files changed

+23
-20
lines changed

6 files changed

+23
-20
lines changed

boards/st/stm32h7s78_dk/doc/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,9 @@ USB port2 (FS) is supported.
204204
Ethernet
205205
--------
206206

207-
In order to use Ethernet on STM32H7S78-DK, you need to set the ``JP6`` jumper
207+
In order to use Ethernet on STM32H7S78-DK, you need to set the ``JP6`` jumper
208208
to PC1 position on the back side of the board.
209209

210-
211210
Programming and Debugging
212211
*************************
213212

boards/st/stm32h7s78_dk/stm32h7s78_dk-common.dtsi

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
#include "zephyr/dt-bindings/display/panel.h"
1212
#include <zephyr/dt-bindings/input/input-event-codes.h>
1313

14+
/*
15+
* WARNING:
16+
* JP6 must be in PC1 position when using Ethernet.
17+
*/
18+
1419
/ {
1520
chosen {
1621
zephyr,console = &uart4;
@@ -211,15 +216,16 @@
211216

212217
&mac {
213218
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>;
219+
&eth_rmii_crs_dv_pa7
220+
&eth_rmii_rxd0_pc4
221+
&eth_rmii_rxd1_pc5
222+
&eth_rmii_tx_en_pg11
223+
&eth_rmii_txd0_pb0
224+
&eth_rmii_txd1_pb1>;
220225
pinctrl-names = "default";
221226
phy-connection-type = "rmii";
222227
phy-handle = <&eth_phy>;
228+
memory-region = <&sram1>;
223229
status = "okay";
224230
};
225231

boards/st/stm32h7s78_dk/stm32h7s78_dk_stm32h7s7xx_ext_flash_app.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ supported:
1717
- octospi
1818
- usbd
1919
- memc
20+
- netif:eth
2021
vendor: st

dts/bindings/ethernet/st,stm32h7-ethernet.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ description: |
1212
compatible: "st,stm32h7-ethernet"
1313

1414
include: st,stm32-ethernet-common.yaml
15+
16+
properties:
17+
memory-region:
18+
type: phandle
19+
required: true
20+
description: |
21+
Reference to SRAM node used for Ethernet DMA buffer and descriptor.

soc/st/stm32/stm32h7rsx/mpu_regions.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ 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-
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
34+
#define sram_eth_node DT_PHANDLE(DT_NODELABEL(mac), memory_region)
4035

4136
#if DT_NODE_HAS_STATUS_OKAY(sram_eth_node)
4237
/* Region 5 - Ethernet DMA buffer RAM */

soc/st/stm32/stm32h7rsx/sections.ld

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
*/
66

77
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(mac))
8-
9-
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(sram2))
10-
#define sram_eth_node DT_NODELABEL(sram2)
11-
#else
12-
#define sram_eth_node DT_NODELABEL(sram1)
13-
#endif
8+
#define sram_eth_node DT_PHANDLE(DT_NODELABEL(mac), memory_region)
149

1510
#if DT_NODE_HAS_STATUS_OKAY(sram_eth_node)
1611
SECTION_DATA_PROLOGUE(eth_stm32,(NOLOAD),)

0 commit comments

Comments
 (0)