File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 77 * Generate memory regions from devicetree nodes.
88 */
99
10+ /**
11+ * @brief Get the linker memory-region name
12+ *
13+ * This attempts to use the zephyr,memory-region property, falling back
14+ * to the node path if it doesn't exist.
15+ *
16+ * Example devicetree fragment:
17+ *
18+ * / {
19+ * soc {
20+ * sram1: memory@2000000 {
21+ * zephyr,memory-region = "MY_NAME";
22+ * };
23+ * sram2: memory@2001000 { ... };
24+ * };
25+ * };
26+ *
27+ * Example usage:
28+ *
29+ * LINKER_DT_NODE_REGION_NAME(DT_NODELABEL(sram1)) // "MY_NAME"
30+ * LINKER_DT_NODE_REGION_NAME(DT_NODELABEL(sram2)) // "/soc/memory@2001000"
31+ *
32+ * @param node_id node identifier
33+ * @return the name of the memory memory region the node will generate
34+ */
35+ #define LINKER_DT_NODE_REGION_NAME (node_id ) \
36+ DT_PROP_OR(node_id, zephyr_memory_region, DT_NODE_PATH(node_id))
37+
1038/* Declare a memory region */
1139#define _REGION_DECLARE (name , attr , node ) name(attr) : \
1240 ORIGIN = DT_REG_ADDR(node), \
You can’t perform that action at this time.
0 commit comments