Merge branch 'feat/psram_qemu_16_32_mb_qpi' into 'master'

feat(esp_psram): add support for QEMU 16MB and 32MB QPI PSRAM

See merge request espressif/esp-idf!34832
This commit is contained in:
Omar Chebib 2024-11-14 12:04:22 +08:00
commit d5f244c5f7
2 changed files with 10 additions and 1 deletions

View File

@ -267,9 +267,14 @@ esp_err_t esp_psram_impl_enable(void)
s_psram_size = PSRAM_SIZE_8MB;
} else {
uint8_t density = PSRAM_SIZE_ID(psram_id);
const int eid = PSRAM_EID_BIT_47_40(psram_id);
s_psram_size = density == 0x0 ? PSRAM_SIZE_2MB :
density == 0x1 ? PSRAM_SIZE_4MB :
density == 0x2 ? PSRAM_SIZE_8MB : 0;
density == 0x2 ? PSRAM_SIZE_8MB :
/* Do not use `density` for QEMU PSRAM since we don't want any future QSPI PSRAM
* that are 16MB or 32MB to be interpreted as QEMU PSRAM devices */
eid == PSRAM_QEMU_16MB_ID ? PSRAM_SIZE_16MB :
eid == PSRAM_QEMU_32MB_ID ? PSRAM_SIZE_32MB : 0;
}
if ((s_psram_size == PSRAM_SIZE_8MB) && s_check_aps3204_2tmode()) {

View File

@ -70,6 +70,10 @@ extern "C" {
#define PSRAM_CS_HOLD_VAL 1
#define PSRAM_CS_SETUP_VAL 1
// QEMU has a simulated 16MB and 32MB Quad SPI PSRAM. Use a fake ID for these.
#define PSRAM_QEMU_16MB_ID 0x6a
#define PSRAM_QEMU_32MB_ID 0x8e
#ifdef __cplusplus
}
#endif