Lines Matching full:memory

3 Memory Attributes
6 It is possible in the devicetree to mark the memory regions with attributes by
7 using the ``zephyr,memory-attr`` property. This property and the related memory
12 and explained in :zephyr_file:`include/zephyr/dt-bindings/memory-attr/memory-attr.h`.
14 For example, to mark a memory region in the devicetree as non-volatile, cacheable,
19 mem: memory@10000000 {
22 zephyr,memory-attr = <( DT_MEM_NON_VOLATILE | DT_MEM_CACHEABLE | DT_MEM_OOO )>;
27 The ``zephyr,memory-attr`` usage does not result in any memory region
29 devicetree defined memory region, it is possible to use the compatible
30 :dtcompatible:`zephyr,memory-region` that will result (only when supported
33 The ``zephyr,memory-attr`` property can also be used to set
36 regions out of devicetree defined memory regions, for example:
40 mem: memory@10000000 {
43 zephyr,memory-region = "NOCACHE_REGION";
44 zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>;
47 See :zephyr_file:`include/zephyr/dt-bindings/memory-attr/memory-attr-arm.h` and
52 The conventional and recommended way to deal and manage with memory regions
55 list of memory regions and their attributes are compiled in a user-accessible
61 The ``zephyr,memory-attr`` property is only a descriptive property of the
62 capabilities of the associated memory region, but it does not result in any
63 actual setting for the memory to be set. The user, code or subsystem willing
74 Migration guide from ``zephyr,memory-region-mpu``
77 When the ``zephyr,memory-attr`` property was introduced, the
78 ``zephyr,memory-region-mpu`` property was removed and deprecated.
92 Memory Attributes Heap Allocator
95 It is possible to leverage the memory attribute property ``zephyr,memory-attr``
96 to define and create a set of memory heaps from which the user can allocate
97 memory from with certain attributes / capabilities.
100 with one of the memory attributes listed in
101 :zephyr_file:`include/zephyr/dt-bindings/memory-attr/memory-attr-sw.h` is added
102 to a pool of memory heaps used for dynamic allocation of memory buffers with
113 For example we can define several memory regions with different attributes and
115 allocate memory from those regions:
119 mem_cacheable: memory@10000000 {
122 zephyr,memory-attr = <( DT_MEM_CACHEABLE | DT_MEM_SW_ALLOC_CACHE )>;
125 mem_non_cacheable: memory@20000000 {
128 zephyr,memory-attr = <( DT_MEM_NON_CACHEABLE | ATTR_SW_ALLOC_NON_CACHE )>;
131 mem_cacheable_big: memory@30000000 {
134 zephyr,memory-attr = <( DT_MEM_CACHEABLE | DT_MEM_OOO | DT_MEM_SW_ALLOC_CACHE )>;
137 mem_cacheable_dma: memory@40000000 {
140 zephyr,memory-attr = <( DT_MEM_CACHEABLE | DT_MEM_DMA |
144 The user can then dynamically carve memory out of those regions using the
145 provided functions, the library will take care of allocating memory from the
153 // Allocate 0x100 bytes of cacheable memory from `mem_cacheable`
156 // Allocate 0x200 bytes of non-cacheable memory aligned to 32 bytes
160 // Allocate 0x100 bytes of cacheable and dma-able memory from `mem_cacheable_dma`
163 When several regions are marked with the same attributes, the memory is allocated:
165 1. From the regions where the ``zephyr,memory-attr`` property has the requested
178 // This memory is allocated from `mem_non_cacheable`
181 // This memory is allocated from `mem_cacheable_big`
186 The framework is assuming that the memory regions used to create the heaps
188 initializing and setting the memory area before calling
193 example by leveraging the ``zephyr,memory-region`` property to create a