feat(spi_flash): Adjust flash clock to real 80M clock, and support 32bit address on eco1

This commit is contained in:
C.S.M
2024-05-27 12:03:49 +08:00
parent 8541242860
commit 374c89097f
18 changed files with 242 additions and 26 deletions

View File

@@ -17,6 +17,8 @@
#include "hal/spi_flash_hal.h"
#include "hal/assert.h"
#include "soc/soc_caps.h"
#include "soc/chip_revision.h"
#include "hal/efuse_hal.h"
#include "sdkconfig.h"
#define ADDRESS_MASK_24BIT 0xFFFFFF
@@ -130,6 +132,19 @@ esp_err_t spi_flash_hal_configure_host_io_mode(
}
#endif
#if CONFIG_IDF_TARGET_ESP32P4
// TODO: This is temporarily for ESP32P4-ECO0, please remove it when eco0 is not widly used. IDF-10019
unsigned chip_version = efuse_hal_chip_revision();
if (unlikely(!ESP_CHIP_REV_ABOVE(chip_version, 1))) {
if (conf_required) {
int line_width = (io_mode == SPI_FLASH_DIO? 2: 4);
dummy_cyclelen_base -= SPI_FLASH_LL_CONTINUOUS_MODE_BIT_NUMS / line_width;
addr_bitlen += SPI_FLASH_LL_CONTINUOUS_MODE_BIT_NUMS;
spi_flash_ll_set_extra_address(dev, 0);
}
}
#endif
if (command >= 0x100) {
spi_flash_ll_set_command(dev, command, 16);
} else {