Skip to content

Commit b662e2d

Browse files
authored
Add temporary fix for mmu map and late init of psram (#188)
1 parent 6683a0d commit b662e2d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

patches/mmu_map.diff

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/components/esp_mm/esp_mmu_map.c b/components/esp_mm/esp_mmu_map.c
2+
index b7d927f8fe..6a8c4635f0 100644
3+
--- a/components/esp_mm/esp_mmu_map.c
4+
+++ b/components/esp_mm/esp_mmu_map.c
5+
@@ -315,6 +315,19 @@ esp_err_t esp_mmu_map_reserve_block_with_caps(size_t size, mmu_mem_caps_t caps,
6+
s_mmu_ctx.mem_regions[found_region_id].max_slot_size -= aligned_size;
7+
ESP_EARLY_LOGV(TAG, "found laddr is 0x%x", laddr);
8+
9+
+ mem_block_t *mem_block = NULL;
10+
+ mem_region_t *region = &s_mmu_ctx.mem_regions[found_region_id];
11+
+ TAILQ_FOREACH(mem_block, &region->mem_block_head, entries) {
12+
+ if (mem_block == TAILQ_FIRST(&region->mem_block_head) || mem_block == TAILQ_LAST(&region->mem_block_head, mem_block_head_)) {
13+
+ TAILQ_REMOVE(&region->mem_block_head, mem_block, entries);
14+
+ } else {
15+
+ // probably the reservation of MMU region should be disallowed for this case - already some MMU mappings exist?
16+
+ // assert/abort
17+
+ ESP_EARLY_LOGE(TAG, "already some MMU mappings exist?");
18+
+ abort();
19+
+ }
20+
+ }
21+
+
22+
uint32_t vaddr = 0;
23+
if (caps & MMU_MEM_CAP_EXEC) {
24+
vaddr = mmu_ll_laddr_to_vaddr(laddr, MMU_VADDR_INSTRUCTION);

tools/install-esp-idf.sh

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ if [ ! -x $idf_was_installed ] || [ ! -x $commit_predefined ]; then
3838
# Temporarily patch the ESP32-S2 I2C LL driver to keep the clock source
3939
cd $IDF_PATH
4040
patch -p1 -N -i ../patches/esp32s2_i2c_ll_master_init.diff
41+
patch -p1 -N -i ../patches/mmu_map.diff
4142
cd -
4243
fi
4344

0 commit comments

Comments
 (0)