Skip to content

Commit c7c89dd

Browse files
committed
soc: st: stm32: stm32n6x: Add linker section for Ethernet configuration
- Added a new section in the linker script for Ethernet configuration. - Configured Rx and Tx descriptor sections and Ethernet buffer sections. - Used DT_NODE_HAS_STATUS to check the status of axisram2 and axisram1 nodes. - Ensured proper memory allocation for Ethernet descriptors and buffers. Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <[email protected]>
1 parent d87dec4 commit c7c89dd

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

soc/st/stm32/stm32n6x/section.ld

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(mac))
8+
9+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(axisram2))
10+
#define sram_eth_node DT_NODELABEL(axisram2)
11+
#else
12+
#define sram_eth_node DT_NODELABEL(axisram1)
13+
#endif
14+
15+
#if DT_NODE_HAS_STATUS_OKAY(sram_eth_node)
16+
SECTION_DATA_PROLOGUE(eth_stm32,(NOLOAD),)
17+
{
18+
. = ABSOLUTE(DT_REG_ADDR(sram_eth_node));
19+
*(.RxDecripSection)
20+
. = ABSOLUTE(DT_REG_ADDR(sram_eth_node) + 0xC0);
21+
*(.TxDecripSection)
22+
. = ABSOLUTE(DT_REG_ADDR(sram_eth_node) + 0x4000);
23+
*(.eth_stm32_buf)
24+
} GROUP_DATA_LINK_IN(LINKER_DT_NODE_REGION_NAME(sram_eth_node), LINKER_DT_NODE_REGION_NAME(sram_eth_node))
25+
#endif
26+
27+
#endif /* DT_NODE_HAS_STATUS(DT_NODELABEL(mac), okay) */

0 commit comments

Comments
 (0)