Zephyr API Documentation 3.7.99
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)
 Get the linker memory-region name in a token form.
 
#define LINKER_DT_NODE_REGION_NAME(node_id)
 Get the linker memory-region name.
 
#define LINKER_DT_REGIONS()
 Generate linker memory regions from the device tree nodes with compatible 'zephyr,memory-region'.
 
#define LINKER_DT_SECTIONS()
 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)
Value:
#define STRINGIFY(s)
Definition common.h:134
#define LINKER_DT_NODE_REGION_NAME_TOKEN(node_id)
Get the linker memory-region name in a token form.
Definition devicetree_regions.h:48

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)
Value:
DT_STRING_TOKEN(node_id, zephyr_memory_region)
#define DT_STRING_TOKEN(node_id, prop)
Get a string property's value as a token.
Definition devicetree.h:959

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:

Parameters
node_idnode identifier
Returns
the name of the memory memory region the node will generate

◆ LINKER_DT_REGIONS

#define LINKER_DT_REGIONS ( )
Value:
DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _REGION_DECLARE)
#define DT_FOREACH_STATUS_OKAY(compat, fn)
Invokes fn for each status okay node of a compatible.
Definition devicetree.h:3202

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 ( )
Value:
DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _SECTION_DECLARE)

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