stm32h7: Actually use the AXI SRAM as the main heap as the documentation describes.

The comments at the top of the file say this:
```
This will be automatically registered
 * - AXI SRAM is a 512kb memory area. This will be automatically registered
 *      with the system heap in up_allocate_heap, all the other memory
 *      regions will be registered in arm_addregion().
```

but the implementation was using SRAM123 instead. Furthermore, arm_addregion then re-adds SRAM123 again.
This commit is contained in:
Anthony Merlino 2021-04-06 13:38:25 -04:00 committed by Xiang Xiao
parent d69cd4ba03
commit 01fabe6c67

View File

@ -210,10 +210,10 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend +
CONFIG_MM_KERNEL_HEAPSIZE;
size_t usize = SRAM123_END - ubase;
size_t usize = SRAM_END - ubase;
int log2;
DEBUGASSERT(ubase < (uintptr_t)SRAM123_END);
DEBUGASSERT(ubase < (uintptr_t)SRAM_END);
/* Adjust that size to account for MPU alignment requirements.
* NOTE that there is an implicit assumption that the SRAM123_END
@ -221,7 +221,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
*/
log2 = (int)mpu_log2regionfloor(usize);
DEBUGASSERT((SRAM123_END & ((1 << log2) - 1)) == 0);
DEBUGASSERT((SRAM_END & ((1 << log2) - 1)) == 0);
usize = (1 << log2);
ubase = SRAM123_END - usize;
@ -277,10 +277,10 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
uintptr_t ubase = (uintptr_t)USERSPACE->us_bssend +
CONFIG_MM_KERNEL_HEAPSIZE;
size_t usize = SRAM123_END - ubase;
size_t usize = SRAM_END - ubase;
int log2;
DEBUGASSERT(ubase < (uintptr_t)SRAM123_END);
DEBUGASSERT(ubase < (uintptr_t)SRAM_END);
/* Adjust that size to account for MPU alignment requirements.
* NOTE that there is an implicit assumption that the SRAM123_END
@ -288,10 +288,10 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
*/
log2 = (int)mpu_log2regionfloor(usize);
DEBUGASSERT((SRAM123_END & ((1 << log2) - 1)) == 0);
DEBUGASSERT((SRAM_END & ((1 << log2) - 1)) == 0);
usize = (1 << log2);
ubase = SRAM123_END - usize;
ubase = SRAM_END - usize;
/* Return the kernel heap settings (i.e., the part of the heap region
* that was not dedicated to the user heap).