Skip to content

Commit 96b0b90

Browse files
axelnxpMaureenHelm
authored andcommitted
soc: nxp: mcxw7xx: refactor shared memory layout
- Define the entire SMU2 as a single memory region so it represents only one entry in the MPU. - Clean up linker.ld and sections.ld to remove obsolete/unused symbols - Declare the "shmem_fwk" section in SMU2 used by connectivity framework - Rearrange the rpmsg shared memory relatively to the entire SMU2 range - Provide necessary symbols for the connectivity framework to locate its shared memory section within SMU2 This is preparatory work for upcoming connectivity framework integration and mcxw70 ble enablement. Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
1 parent f471eb2 commit 96b0b90

4 files changed

Lines changed: 35 additions & 34 deletions

File tree

dts/arm/nxp/nxp_mcxw71.dtsi

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2025 NXP
2+
* Copyright 2023-2026 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -10,12 +10,17 @@
1010
smu2: smu2@1c0000 {
1111
#address-cells = <1>;
1212
#size-cells = <1>;
13+
compatible = "zephyr,memory-region", "mmio-sram";
14+
zephyr,memory-region = "SMU2";
15+
zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_RAM)>;
16+
reg = <0x1c0000 DT_SIZE_K(40)>;
1317

14-
rpmsgmem: memory@8800 {
15-
compatible = "zephyr,memory-region", "mmio-sram";
16-
reg = <0x8800 DT_SIZE_K(6)>;
17-
zephyr,memory-region = "rpmsg_sh_mem";
18-
zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_RAM)>;
18+
shmem_fwk: memory@78 {
19+
reg = <0x78 0x8>;
20+
};
21+
22+
shmem_rpmsg: memory@8800 {
23+
reg = <0x8800 0x1100>;
1924
};
2025
};
2126
};

dts/arm/nxp/nxp_mcxw72.dtsi

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2025 NXP
2+
* Copyright 2024-2026 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -10,12 +10,17 @@
1010
smu2: smu2@1c0000 {
1111
#address-cells = <1>;
1212
#size-cells = <1>;
13+
compatible = "zephyr,memory-region", "mmio-sram";
14+
zephyr,memory-region = "SMU2";
15+
zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_RAM)>;
16+
reg = <0x1c0000 DT_SIZE_K(64)>;
1317

14-
rpmsgmem: memory@220 {
15-
compatible = "zephyr,memory-region", "mmio-sram";
16-
reg = <0x220 0x1100>;
17-
zephyr,memory-region = "rpmsg_sh_mem";
18-
zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_RAM)>;
18+
shmem_fwk: memory@200 {
19+
reg = <0x200 0x20>;
20+
};
21+
22+
shmem_rpmsg: memory@220 {
23+
reg = <0x220 0xA00>;
1924
};
2025
};
2126
};

soc/nxp/mcx/mcxw/mcxw7xx/linker.ld

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
/*
2-
* Copyright 2023 NXP
2+
* Copyright 2023, 2026 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
#include <zephyr/devicetree.h>
88

9-
m_sector_size = 0x2000;
10-
m_flash_end = 0x000FFFFF;
11-
12-
13-
m_fsl_prodInfo_size = m_sector_size;
14-
m_fsl_prodInfo_start = m_flash_end - m_fsl_prodInfo_size + 1;
15-
m_fsl_prodInfo_end = m_flash_end;
16-
PROD_DATA_BASE_ADDR = m_fsl_prodInfo_start;
17-
189
/*
1910
* We perform all custom placement before including the generic linker file. This
2011
* is done because calling this linker at the beginning will place some sections
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/*
2-
* Copyright 2024 NXP
2+
* Copyright 2024, 2026 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
/* NOINIT section for rpmsg_sh_mem */
8-
.noinit_rpmsg_sh_mem (NOLOAD) : ALIGN(4)
7+
/* NOINIT section for shared memory SMU2 */
8+
.noinit_smu2 (NOLOAD) : ALIGN(4)
99
{
10-
__RPMSG_SH_MEM_START__ = .;
11-
PROVIDE(rpmsg_sh_mem_start = __RPMSG_SH_MEM_START__);
12-
13-
*(.noinit.$rpmsg_sh_mem*)
14-
. = ALIGN(4) ;
15-
__RPMSG_SH_MEM_END__ = .;
16-
PROVIDE(rpmsg_sh_mem_end = __RPMSG_SH_MEM_END__);
17-
18-
} > rpmsg_sh_mem
10+
. = DT_REG_ADDR(DT_NODELABEL(shmem_fwk)) - DT_REG_ADDR(DT_NODELABEL(smu2));
11+
PROVIDE(m_lowpower_flag_start = . + 0x4);
12+
. = DT_REG_ADDR(DT_NODELABEL(shmem_rpmsg)) - DT_REG_ADDR(DT_NODELABEL(smu2));
13+
PROVIDE(rpmsg_sh_mem_start = .);
14+
*(.noinit.$rpmsg_sh_mem*)
15+
. = ALIGN(4) ;
16+
PROVIDE(rpmsg_sh_mem_end = .);
17+
. = DT_REG_SIZE(DT_NODELABEL(smu2));
18+
} > SMU2

0 commit comments

Comments
 (0)