Zephyr Project API
3.2.0
A Scalable Open Source RTOS
|
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. More... | |
#define | LINKER_DT_NODE_REGION_NAME(node_id) STRINGIFY(LINKER_DT_NODE_REGION_NAME_TOKEN(node_id)) |
Get the linker memory-region name. More... | |
#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'. More... | |
#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'. More... | |
#define | LINKER_DT_REGION_MPU(mpu_fn) _CHECK_APPLY_FN(_DT_COMPATIBLE, _EXPAND_MPU_FN, mpu_fn) |
Generate MPU regions from the device tree nodes with compatible 'zephyr,memory-region' and 'zephyr,memory-region-mpu' attribute. More... | |
#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:
Example usage:
node_id | node identifier |
#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:
Example usage:
node_id | node identifier |
#define LINKER_DT_REGION_MPU | ( | mpu_fn | ) | _CHECK_APPLY_FN(_DT_COMPATIBLE, _EXPAND_MPU_FN, mpu_fn) |
Generate MPU regions from the device tree nodes with compatible 'zephyr,memory-region' and 'zephyr,memory-region-mpu' attribute.
Helper macro to apply an MPU_FN macro to all the memory regions declared using the 'zephyr,memory-region-mpu' property and the 'zephyr,memory-region' compatible.
MPU_FN
must take the form:
The 'name', 'base' and 'size' parameters are taken from the DT node.
The 'zephyr,memory-region-mpu' enum property is passed as an extended token to the MPU_FN macro using the 'attr' parameter, in the form REGION_{attr}_ATTR.
The following enums are supported for the 'zephyr,memory-region-mpu' property:
This means that usually the arch code would provide some macros or defines with the same name of the extended property, that is:
Example devicetree fragment:
/ { soc { sram1: memory@2000000 { zephyr,memory-region = "MY_NAME"; zephyr,memory-region-mpu = "RAM_NOCACHE"; }; }; };
For detailed information about MPU region attribute define configuration refer to the specific architecture MPU header. For example: include/zephyr/arch/arm/aarch32/mpu/arm_mpu_v7m.h.
The 'attr' parameter of the MPU_FN function will be the extended 'REGION_RAM_NOCACHE_ATTR' token and the arch code will be usually implementing a macro with the same name.
Example:
#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.
#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'.