spiram: Fix ESP32 SPIRAM when using SPIRAM_TYPE_AUTO, disable "AUTO" for ESP32-S2

Requirement to enable for ESP32-S2 captured in IDF-912.
This commit is contained in:
Angus Gratton
2019-08-23 15:23:41 +10:00
committed by Angus Gratton
parent 0c88ef3232
commit e44df658d5
3 changed files with 15 additions and 9 deletions

View File

@@ -68,6 +68,13 @@ const soc_memory_type_desc_t soc_memory_types[] = {
const size_t soc_memory_type_count = sizeof(soc_memory_types)/sizeof(soc_memory_type_desc_t);
#if CONFIG_SPIRAM_SIZE == -1
// Assume we need to reserve 4MB in the auto-detection case
#define RESERVE_SPIRAM_SIZE (4*1024*1024)
#else
#define RESERVE_SPIRAM_SIZE CONFIG_SPIRAM_SIZE
#endif
/*
Region descriptors. These describe all regions of memory available, and map them to a type in the above type.
@@ -76,7 +83,7 @@ from low to high start address.
*/
const soc_memory_region_t soc_memory_regions[] = {
#ifdef CONFIG_SPIRAM
{ SOC_EXTRAM_DATA_LOW, CONFIG_SPIRAM_SIZE, 15, 0}, //SPI SRAM, if available
{ SOC_EXTRAM_DATA_LOW, RESERVE_SPIRAM_SIZE, 15, 0}, //SPI SRAM, if available
#endif
{ 0x3FFAE000, 0x2000, 0, 0}, //pool 16 <- used for rom code
{ 0x3FFB0000, 0x8000, 0, 0}, //pool 15 <- if BT is enabled, used as BT HW shared memory
@@ -167,7 +174,7 @@ SOC_RESERVE_MEMORY_REGION(0x3fffc000, 0x40000000, trace_mem); //Reserve trace me
#endif
#ifdef CONFIG_SPIRAM
SOC_RESERVE_MEMORY_REGION(SOC_EXTRAM_DATA_LOW, SOC_EXTRAM_DATA_LOW + CONFIG_SPIRAM_SIZE, spi_ram); //SPI RAM gets added later if needed, in spiram.c; reserve it for now
SOC_RESERVE_MEMORY_REGION(SOC_EXTRAM_DATA_LOW, SOC_EXTRAM_DATA_LOW + RESERVE_SPIRAM_SIZE, spi_ram); //SPI RAM gets added later if needed, in spiram.c; reserve it for now
#endif
#endif /* BOOTLOADER_BUILD */