Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
devicetree_regions.h File Reference
#include <zephyr/devicetree.h>
#include <zephyr/sys/util.h>
#include <zephyr/toolchain.h>

Go to the source code of this file.

Macros

#define LINKER_DT_NODE_REGION_NAME_TOKEN(node_id)    DT_STRING_TOKEN(node_id, zephyr_memory_region)
 Get the linker memory-region name in a token form.
 
#define LINKER_DT_NODE_REGION_NAME(node_id)    STRINGIFY(LINKER_DT_NODE_REGION_NAME_TOKEN(node_id))
 Get the linker memory-region name.
 
#define LINKER_DT_REGIONS()    DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _REGION_DECLARE)
 Generate linker memory regions from the device tree nodes with compatible 'zephyr,memory-region'.
 
#define LINKER_DT_SECTIONS()    DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _SECTION_DECLARE)
 Generate linker memory sections from the device tree nodes with compatible 'zephyr,memory-region'.
 

Macro Definition Documentation

◆ LINKER_DT_NODE_REGION_NAME

#define LINKER_DT_NODE_REGION_NAME (   node_id)     STRINGIFY(LINKER_DT_NODE_REGION_NAME_TOKEN(node_id))

Get the linker memory-region name.

This attempts to use the zephyr,memory-region property (with non-alphanumeric characters replaced with underscores).

Example devicetree fragment:

/ {
soc {
sram1: memory@2000000 {
zephyr,memory-region = "MY_NAME";
};
sram2: memory@2001000 {
zephyr,memory-region = "MY@OTHER@NAME";
};
};
};

Example usage:

LINKER_DT_NODE_REGION_NAME(DT_NODELABEL(sram2)) // "MY_OTHER_NAME"
#define LINKER_DT_NODE_REGION_NAME(node_id)
Get the linker memory-region name.
Definition devicetree_regions.h:82
#define DT_NODELABEL(label)
Get a node identifier for a node label.
Definition devicetree.h:200
Parameters
node_idnode identifier
Returns
the name of the memory memory region the node will generate

◆ LINKER_DT_NODE_REGION_NAME_TOKEN

#define LINKER_DT_NODE_REGION_NAME_TOKEN (   node_id)     DT_STRING_TOKEN(node_id, zephyr_memory_region)

Get the linker memory-region name in a token form.

This attempts to use the zephyr,memory-region property (with non-alphanumeric characters replaced with underscores) returning a token.

Example devicetree fragment:

/ {
soc {
sram1: memory@2000000 {
zephyr,memory-region = "MY_NAME";
};
sram2: memory@2001000 {
zephyr,memory-region = "MY@OTHER@NAME";
};
};
};

Example usage:

#define LINKER_DT_NODE_REGION_NAME_TOKEN(node_id)
Get the linker memory-region name in a token form.
Definition devicetree_regions.h:48
Parameters
node_idnode identifier
Returns
the name of the memory memory region the node will generate

◆ LINKER_DT_REGIONS

#define LINKER_DT_REGIONS ( )     DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _REGION_DECLARE)

Generate linker memory regions from the device tree nodes with compatible 'zephyr,memory-region'.

Note: for now we do not deal with MEMORY attributes since those are optional, not actually used by Zephyr and they will likely conflict with the MPU configuration.

◆ LINKER_DT_SECTIONS

#define LINKER_DT_SECTIONS ( )     DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _SECTION_DECLARE)

Generate linker memory sections from the device tree nodes with compatible 'zephyr,memory-region'.