gustavonihei commented on a change in pull request #5827: URL: https://github.com/apache/incubator-nuttx/pull/5827#discussion_r836795833
########## File path: arch/xtensa/src/esp32s2/Kconfig ########## @@ -442,6 +448,96 @@ endif endmenu # SPI Flash Configuration +menu "SPI RAM Configuration" + depends on ESP32S2_SPIRAM + +config ESP32S2_DEFAULT_PSRAM_CLK_IO + int "PSRAM CLK pin" + default 30 + +config ESP32S2_DEFAULT_PSRAM_CS_IO + int "PSRAM CS pin" + default 26 + +choice ESP32S2_SPIRAM_TYPE + prompt "Type of SPI RAM chip in use" + default ESP32S2_SPIRAM_TYPE_AUTO + +config ESP32S2_SPIRAM_TYPE_AUTO + bool "Auto-detect" + +config ESP32S2_SPIRAM_TYPE_ESPPSRAM32 + bool "ESP-PSRAM32 or IS25WP032" + +config ESP32S2_SPIRAM_TYPE_ESPPSRAM64 + bool "ESP-PSRAM64 or LY68L6400" +endchoice #ESP32S2_SPIRAM_TYPE + +config ESP32S2_SPIRAM_SIZE + int + default -1 if ESP32S2_SPIRAM_TYPE_AUTO + default 4194304 if ESP32S2_SPIRAM_TYPE_ESPPSRAM32 + default 8388608 if ESP32S2_SPIRAM_TYPE_ESPPSRAM64 + default 0 + +config ESP32S2_SPIRAM_FETCH_INSTRUCTIONS + bool "Cache fetch instructions from SPI RAM" + default n + ---help--- + If enabled, instruction in flash will be copied into SPIRAM. + If ESP32S2_SPIRAM_RODATA is also enabled, you can run the instruction + when erasing or programming the flash. + +config ESP32S2_SPIRAM_RODATA + bool "Cache load read only data from SPI RAM" + default n + ---help--- + If enabled, rodata in flash will be copied into SPIRAM. + If ESP32S2_SPIRAM_FETCH_INSTRUCTIONS is also enabled, + you can run the instruction when erasing or programming the + flash. + +choice ESP32S2_SPIRAM_SPEED + prompt "Set RAM clock speed" + default ESP32S2_SPIRAM_SPEED_40M + ---help--- + Select the speed for the SPI RAM chip. + +config ESP32S2_SPIRAM_SPEED_40M + bool "40MHz clock speed" + +config ESP32S2_SPIRAM_SPEED_80M + bool "80MHz clock speed" + +endchoice # ESP32S2_SPIRAM_SPEED + +config ESP32S2_SPIRAM_SPEED + int + default 80 if ESP32S2_SPIRAM_SPEED_80M + default 40 if ESP32S2_SPIRAM_SPEED_40M + +config ESP32S2_SPIRAM_BOOT_INIT + bool "Initialize SPI RAM during startup" + depends on ESP32S2_SPIRAM + default "y" + ---help--- + If this is enabled, the SPI RAM will be enabled during initial + boot. Unless you have specific requirements, you'll want to leave + this enabled so memory allocated during boot-up can also be + placed in SPI RAM. + +config ESP32S2_SPIRAM_IGNORE_NOTFOUND + bool "Ignore PSRAM when not found" + default "n" + depends on ESP32S2_SPIRAM_BOOT_INIT && !BOOT_SDRAM_DATA + ---help--- + Normally, if psram initialization is enabled during compile time Review comment: ```suggestion Normally, if PSRAM initialization is enabled during compile time ``` ########## File path: arch/xtensa/src/esp32s2/Kconfig ########## @@ -442,6 +448,96 @@ endif endmenu # SPI Flash Configuration +menu "SPI RAM Configuration" + depends on ESP32S2_SPIRAM + +config ESP32S2_DEFAULT_PSRAM_CLK_IO + int "PSRAM CLK pin" + default 30 + +config ESP32S2_DEFAULT_PSRAM_CS_IO + int "PSRAM CS pin" + default 26 + +choice ESP32S2_SPIRAM_TYPE + prompt "Type of SPI RAM chip in use" + default ESP32S2_SPIRAM_TYPE_AUTO + +config ESP32S2_SPIRAM_TYPE_AUTO + bool "Auto-detect" + +config ESP32S2_SPIRAM_TYPE_ESPPSRAM32 + bool "ESP-PSRAM32 or IS25WP032" + +config ESP32S2_SPIRAM_TYPE_ESPPSRAM64 + bool "ESP-PSRAM64 or LY68L6400" +endchoice #ESP32S2_SPIRAM_TYPE + +config ESP32S2_SPIRAM_SIZE + int + default -1 if ESP32S2_SPIRAM_TYPE_AUTO + default 4194304 if ESP32S2_SPIRAM_TYPE_ESPPSRAM32 + default 8388608 if ESP32S2_SPIRAM_TYPE_ESPPSRAM64 + default 0 + +config ESP32S2_SPIRAM_FETCH_INSTRUCTIONS + bool "Cache fetch instructions from SPI RAM" + default n + ---help--- + If enabled, instruction in flash will be copied into SPIRAM. + If ESP32S2_SPIRAM_RODATA is also enabled, you can run the instruction + when erasing or programming the flash. + +config ESP32S2_SPIRAM_RODATA + bool "Cache load read only data from SPI RAM" + default n + ---help--- + If enabled, rodata in flash will be copied into SPIRAM. + If ESP32S2_SPIRAM_FETCH_INSTRUCTIONS is also enabled, + you can run the instruction when erasing or programming the + flash. + +choice ESP32S2_SPIRAM_SPEED + prompt "Set RAM clock speed" + default ESP32S2_SPIRAM_SPEED_40M + ---help--- + Select the speed for the SPI RAM chip. + +config ESP32S2_SPIRAM_SPEED_40M + bool "40MHz clock speed" + +config ESP32S2_SPIRAM_SPEED_80M + bool "80MHz clock speed" + +endchoice # ESP32S2_SPIRAM_SPEED + +config ESP32S2_SPIRAM_SPEED + int + default 80 if ESP32S2_SPIRAM_SPEED_80M + default 40 if ESP32S2_SPIRAM_SPEED_40M + +config ESP32S2_SPIRAM_BOOT_INIT + bool "Initialize SPI RAM during startup" + depends on ESP32S2_SPIRAM + default "y" + ---help--- + If this is enabled, the SPI RAM will be enabled during initial + boot. Unless you have specific requirements, you'll want to leave + this enabled so memory allocated during boot-up can also be + placed in SPI RAM. + +config ESP32S2_SPIRAM_IGNORE_NOTFOUND + bool "Ignore PSRAM when not found" + default "n" + depends on ESP32S2_SPIRAM_BOOT_INIT && !BOOT_SDRAM_DATA + ---help--- + Normally, if psram initialization is enabled during compile time + but not found at runtime, it is seen as an error making the CPU + panic. If this is enabled, booting will complete but no PSRAM + will be available. + +endmenu #SPI RAM Configuration Review comment: ```suggestion endmenu # SPI RAM Configuration ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org