Commit Graph

8 Commits

Author SHA1 Message Date
Armando
d6844051fc esp_mm: new virtual memory mapping apis via mmu 2023-02-07 20:23:52 +08:00
Armando
8ba67dfc38 mmu: rename api to esp_mmu_reserve_block_with_caps
esp_mmu_get_largest_free_block() ->
esp_mmu_get_max_consecutive_free_block()

esp_mmu_find_vaddr_range() -> esp_mmu_reserve_block_with_caps()
2023-02-07 20:23:51 +08:00
Armando
2d44dc1eed mmu: driver framework, for vaddr maintenance
This commit gives basic mmu driver framework. Now it is able to maintain
mmu virtual address usage on esp32, esp32s2 and esp32s3. Usage to
external virtual address should rely on mmu functions to know which
address range is available, instead of hardcoded.

This commit also improves psram memory that is added to the heap
allocator. Now it's added to the heap, according to the memory
alignment.

Closes https://github.com/espressif/esp-idf/issues/8295
2022-08-26 17:59:06 +08:00
Armando
dc5cab7730 esp_psram: rename esp_private/mmu.h to mmu_psram_flash.h
Prior to this commit, esp_psram/include/esp_private/mmu.h contains some
APIs that is used for:
- copy flash content to psram
- necessary sync APIs used by flash_mmap.c, due to above feature

This commit rename it to mmu_psram_flash.h, therefore mmu.h can be used
for real mmu related APIs.

This commit also moves above mention funcitons in `mmu.c` and
`mmu_psram.c` to `mmu_psram_flash.c`, leaving `mmu.c` to be used for
real mmu driver.
2022-08-25 20:35:20 +08:00
Armando
42dfb5cadd esp_psram: improve mapping log when physical range is larger
After this commit, when physical address is larger than vaddr range,
driver will still map as much as it can, but also give a verbose level
log to show the actual mapped size
2022-07-27 10:22:09 +00:00
Armando
f0e93ed0f8 psram: reserve dma pool in the step of heap max block
As heap block may be allocated into multiple non-contiguous chunks, to
reserve enough memory for dma/internal usage, we do the malloc in the
step of max available block.

On ESP32 we use this way, this commit follows this way, on ESP32S2 and
ESP32S3
2022-06-30 10:18:20 +00:00
Armando
63d4b52e21 psram: correct psram size log 2022-06-28 14:17:44 +08:00
Armando
38e5043ae8 esp_psram: new psram component 2022-06-14 15:44:27 +08:00