linker: devicetree_regions: Add support memory region flag setting

Add `zephyr,memory-region-flags` for supporting memory region flags
setting.

For example, when the below node is in the devicetree,

```
    test_sram: sram@20010000 {
        compatible = "zephyr,memory-region", "mmio-sram";
        reg = < 0x20010000 0x1000 >;
        zephyr,memory-region = "FOOBAR";
        zephyr,memory-region-flags = "rw";
    };
```

We get the following line in MEMORY section of linker script.

```
FOOBAR (rw) : ORIGIN = (0x20010000), LENGTH = (0x1000)
```

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
This commit is contained in:
TOKITA Hiroshi 2024-06-15 11:16:38 +09:00 committed by Anas Nashif
commit 624e051372
4 changed files with 112 additions and 29 deletions

View file

@ -41,10 +41,9 @@ zephyr_linker_memory(NAME FLASH FLAGS rx START ${FLASH_ADDR} SIZE ${FLASH_SIZ
zephyr_linker_memory(NAME RAM FLAGS wx START ${RAM_ADDR} SIZE ${RAM_SIZE})
zephyr_linker_memory(NAME IDT_LIST FLAGS wx START ${IDT_ADDR} SIZE 2K)
# Only use 'rw' as FLAGS. It's not used anyway.
dt_comp_path(paths COMPATIBLE "zephyr,memory-region")
foreach(path IN LISTS paths)
zephyr_linker_dts_memory(PATH ${path} FLAGS rw)
zephyr_linker_dts_memory(PATH ${path})
endforeach()
if(CONFIG_XIP)