|
| 1 | +/* |
| 2 | + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 OR MIT |
| 5 | + */ |
| 6 | + |
| 7 | +#pragma once |
| 8 | + |
| 9 | +/* Overall memory map */ |
| 10 | +#define SOC_IROM_LOW 0x42000000 |
| 11 | +#define SOC_IROM_HIGH 0x44000000 |
| 12 | +#define SOC_EXTRAM_DATA_LOW 0x42000000 |
| 13 | +#define SOC_EXTRAM_DATA_HIGH 0x44000000 |
| 14 | +#define SOC_DROM_LOW SOC_IROM_LOW |
| 15 | +#define SOC_DROM_HIGH SOC_IROM_HIGH |
| 16 | +#define SOC_IROM_MASK_LOW 0x40000000 |
| 17 | +#define SOC_IROM_MASK_HIGH 0x40050000 |
| 18 | +#define SOC_DROM_MASK_LOW 0x40000000 |
| 19 | +#define SOC_DROM_MASK_HIGH 0x40050000 |
| 20 | +#define SOC_IRAM_LOW 0x40800000 |
| 21 | +#define SOC_IRAM_HIGH 0x40860000 |
| 22 | +#define SOC_DRAM_LOW 0x40800000 |
| 23 | +#define SOC_DRAM_HIGH 0x40860000 |
| 24 | +#define SOC_RTC_IRAM_LOW 0x50000000 // ESP32-C5 only has 16k LP memory |
| 25 | +#define SOC_RTC_IRAM_HIGH 0x50004000 |
| 26 | +#define SOC_RTC_DRAM_LOW 0x50000000 |
| 27 | +#define SOC_RTC_DRAM_HIGH 0x50004000 |
| 28 | +#define SOC_RTC_DATA_LOW 0x50000000 |
| 29 | +#define SOC_RTC_DATA_HIGH 0x50004000 |
| 30 | + |
| 31 | +//First and last words of the D/IRAM region, for both the DRAM address as well as the IRAM alias. |
| 32 | +#define SOC_DIRAM_IRAM_LOW 0x40800000 |
| 33 | +#define SOC_DIRAM_IRAM_HIGH 0x40860000 |
| 34 | +#define SOC_DIRAM_DRAM_LOW 0x40800000 |
| 35 | +#define SOC_DIRAM_DRAM_HIGH 0x40860000 |
| 36 | + |
| 37 | +#define MAP_DRAM_TO_IRAM(addr) (addr) |
| 38 | +#define MAP_IRAM_TO_DRAM(addr) (addr) |
| 39 | + |
| 40 | +// Region of memory accessible via DMA. See esp_ptr_dma_capable(). |
| 41 | +#define SOC_DMA_LOW 0x40800000 |
| 42 | +#define SOC_DMA_HIGH 0x40860000 |
| 43 | + |
| 44 | +// Region of RAM that is byte-accessible. See esp_ptr_byte_accessible(). |
| 45 | +#define SOC_BYTE_ACCESSIBLE_LOW 0x40800000 |
| 46 | +#define SOC_BYTE_ACCESSIBLE_HIGH 0x40860000 |
| 47 | + |
| 48 | +//Region of memory that is internal, as in on the same silicon die as the ESP32 CPUs |
| 49 | +//(excluding RTC data region, that's checked separately.) See esp_ptr_internal(). |
| 50 | +#define SOC_MEM_INTERNAL_LOW 0x40800000 |
| 51 | +#define SOC_MEM_INTERNAL_HIGH 0x40860000 |
| 52 | +#define SOC_MEM_INTERNAL_LOW1 0x40800000 |
| 53 | +#define SOC_MEM_INTERNAL_HIGH1 0x40860000 |
| 54 | + |
| 55 | +#define SOC_MAX_CONTIGUOUS_RAM_SIZE (SOC_IROM_HIGH - SOC_IROM_LOW) ///< Largest span of contiguous memory (DRAM or IRAM) in the address space |
| 56 | + |
| 57 | +// Region of address space that holds peripherals |
| 58 | +#define SOC_PERIPHERAL_LOW 0x60000000 |
| 59 | +#define SOC_PERIPHERAL_HIGH 0x60100000 |
| 60 | + |
| 61 | +// CPU sub-system region, contains interrupt config registers |
| 62 | +#define SOC_CPU_SUBSYSTEM_LOW 0x20000000 |
| 63 | +#define SOC_CPU_SUBSYSTEM_HIGH 0x30000000 |
| 64 | + |
| 65 | +// Start (highest address) of ROM boot stack, only relevant during early boot |
| 66 | +#define SOC_ROM_STACK_START 0x4085e5a0 |
| 67 | +#define SOC_ROM_STACK_SIZE 0x2000 |
0 commit comments