|
@@ -31,6 +31,7 @@ typedef struct {
|
|
|
#define ESP8266_SPI_REG_BASE 0x60000200
|
|
#define ESP8266_SPI_REG_BASE 0x60000200
|
|
|
#define ESP32S2_SPI_REG_BASE 0x3f402000
|
|
#define ESP32S2_SPI_REG_BASE 0x3f402000
|
|
|
#define ESP32C3_SPI_REG_BASE 0x60002000
|
|
#define ESP32C3_SPI_REG_BASE 0x60002000
|
|
|
|
|
+#define ESP32S3_SPI_REG_BASE 0x60002000
|
|
|
#define ESP32_SPI_REG_BASE 0x3ff42000
|
|
#define ESP32_SPI_REG_BASE 0x3ff42000
|
|
|
|
|
|
|
|
static esp_loader_error_t spi_config_esp32(uint32_t efuse_base, uint32_t *spi_config);
|
|
static esp_loader_error_t spi_config_esp32(uint32_t efuse_base, uint32_t *spi_config);
|
|
@@ -101,6 +102,22 @@ static const esp_target_t esp_target[ESP_MAX_CHIP] = {
|
|
|
.chip_magic_value = 0x6921506f,
|
|
.chip_magic_value = 0x6921506f,
|
|
|
.read_spi_config = spi_config_esp32xx,
|
|
.read_spi_config = spi_config_esp32xx,
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ // ESP32S3
|
|
|
|
|
+ {
|
|
|
|
|
+ .regs = {
|
|
|
|
|
+ .cmd = ESP32C3_SPI_REG_BASE + 0x00,
|
|
|
|
|
+ .usr = ESP32C3_SPI_REG_BASE + 0x18,
|
|
|
|
|
+ .usr1 = ESP32C3_SPI_REG_BASE + 0x1c,
|
|
|
|
|
+ .usr2 = ESP32C3_SPI_REG_BASE + 0x20,
|
|
|
|
|
+ .w0 = ESP32C3_SPI_REG_BASE + 0x58,
|
|
|
|
|
+ .mosi_dlen = ESP32C3_SPI_REG_BASE + 0x24,
|
|
|
|
|
+ .miso_dlen = ESP32C3_SPI_REG_BASE + 0x28,
|
|
|
|
|
+ },
|
|
|
|
|
+ .efuse_base = 0x60007000,
|
|
|
|
|
+ .chip_magic_value = 0x00000009,
|
|
|
|
|
+ .read_spi_config = spi_config_esp32xx, // !
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const target_registers_t *get_esp_target_data(target_chip_t chip)
|
|
const target_registers_t *get_esp_target_data(target_chip_t chip)
|
|
@@ -171,7 +188,7 @@ static esp_loader_error_t spi_config_esp32(uint32_t efuse_base, uint32_t *spi_co
|
|
|
return ESP_LOADER_SUCCESS;
|
|
return ESP_LOADER_SUCCESS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Applies for esp32s2 and esp32c3
|
|
|
|
|
|
|
+// Applies for esp32s2, esp32c3 and esp32c3
|
|
|
static esp_loader_error_t spi_config_esp32xx(uint32_t efuse_base, uint32_t *spi_config)
|
|
static esp_loader_error_t spi_config_esp32xx(uint32_t efuse_base, uint32_t *spi_config)
|
|
|
{
|
|
{
|
|
|
*spi_config = 0;
|
|
*spi_config = 0;
|