@@ -45,7 +45,8 @@ endchoice
4545
4646choice
4747 prompt "Data cache size"
48- default ESP32S2_DATA_CACHE_0KB
48+ default ESP32S2_DATA_CACHE_0KB if !ESP_SPIRAM
49+ default ESP32S2_DATA_CACHE_8KB if ESP_SPIRAM
4950
5051 config ESP32S2_DATA_CACHE_0KB
5152 bool "0KB data cache size"
@@ -81,6 +82,97 @@ config ESP32S2_DATA_CACHE_SIZE
8182 default 0x4000 if ESP32S2_DATA_CACHE_16KB
8283 default 0x0000
8384
85+ config ESP_SPIRAM
86+ bool "Support for external, SPI-connected RAM"
87+ help
88+ This enables support for an external SPI RAM chip, connected in
89+ parallel with the main SPI flash chip.
90+
91+ config ESP_HEAP_MIN_EXTRAM_THRESHOLD
92+ int "Minimum threshold for external RAM allocation"
93+ default 8192
94+ range 1024 131072
95+ depends on ESP_SPIRAM
96+ help
97+ Threshold to decide if memory will be allocated from DRAM
98+ or SPIRAM. If value of allocation size is less than this value,
99+ memory will be allocated from internal RAM.
100+
101+ menu "SPI RAM config"
102+ depends on ESP_SPIRAM
103+
104+ choice SPIRAM_TYPE
105+ prompt "Type of SPI RAM chip in use"
106+ default SPIRAM_TYPE_ESPPSRAM16
107+
108+ config SPIRAM_TYPE_ESPPSRAM16
109+ bool "ESP-PSRAM16 or APS1604"
110+
111+ config SPIRAM_TYPE_ESPPSRAM32
112+ bool "ESP-PSRAM32 or IS25WP032"
113+
114+ config SPIRAM_TYPE_ESPPSRAM64
115+ bool "ESP-PSRAM64 or LY68L6400"
116+
117+ endchoice # SPIRAM_TYPE
118+
119+ config ESP_SPIRAM_SIZE
120+ int "Size of SPIRAM part"
121+ default 2097152 if SPIRAM_TYPE_ESPPSRAM16
122+ default 4194304 if SPIRAM_TYPE_ESPPSRAM32
123+ default 8388608 if SPIRAM_TYPE_ESPPSRAM64
124+ help
125+ Specify size of SPIRAM part.
126+ NOTE: If SPIRAM size is greater than 4MB, only
127+ lower 4MB can be allocated using k_malloc().
128+
129+ menu "PSRAM clock and cs IO for ESP32S2"
130+ depends on ESP_SPIRAM
131+
132+ config DEFAULT_PSRAM_CLK_IO
133+ int "PSRAM CLK IO number"
134+ range 0 33
135+ default 30
136+ help
137+ The PSRAM CLOCK IO can be any unused GPIO, user can config
138+ it based on hardware design.
139+
140+ config DEFAULT_PSRAM_CS_IO
141+ int "PSRAM CS IO number"
142+ range 0 33
143+ default 26
144+ help
145+ The PSRAM CS IO can be any unused GPIO, user can config it
146+ based on hardware design.
147+
148+ endmenu # PSRAM clock and cs IO for ESP32S2
149+
150+ choice SPIRAM_SPEED
151+ prompt "Set RAM clock speed"
152+ default SPIRAM_SPEED_40M
153+ help
154+ Select the speed for the SPI RAM chip.
155+
156+ config SPIRAM_SPEED_80M
157+ bool "80MHz clock speed"
158+
159+ config SPIRAM_SPEED_40M
160+ bool "40MHz clock speed"
161+
162+ config SPIRAM_SPEED_26M
163+ bool "26MHz clock speed"
164+
165+ config SPIRAM_SPEED_20M
166+ bool "20MHz clock speed"
167+
168+ endchoice # SPIRAM_SPEED
169+
170+ config SPIRAM
171+ bool
172+ default y
173+
174+ endmenu # SPI RAM config
175+
84176choice ESP32S2_UNIVERSAL_MAC_ADDRESSES
85177 bool "Number of universally administered (by IEEE) MAC address"
86178 default ESP32S2_UNIVERSAL_MAC_ADDRESSES_TWO
0 commit comments