fix(spi_flash): Make GD chip to be linked as default, also optimization the log information

This commit is contained in:
C.S.M
2025-05-22 17:35:09 +08:00
parent 5133b89183
commit 0f1dbcc6a5
26 changed files with 139 additions and 102 deletions
+10 -8
View File
@@ -17,7 +17,9 @@
#include "sdkconfig.h"
#include "esp_log.h"
#define TAG "spi_flash"
__attribute__((unused)) static const char *TAG = "spi_flash";
#define FORMAT_STR "Detected %s flash chip but using generic driver. For optimal functionality, enable `SPI_FLASH_SUPPORT_%s_CHIP` in menuconfig"
#if !CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST
/*
@@ -65,39 +67,39 @@ void spi_flash_chip_list_check(esp_flash_t *chip, uint32_t device_id) {
{
case SPI_FLASH_GD:
if (&esp_flash_chip_gd == NULL) {
ESP_EARLY_LOGW(TAG, "GigaDevice detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_GD_CHIP`");
ESP_EARLY_LOGW(TAG, FORMAT_STR, "GigaDevice", "GD");
}
break;
case SPI_FLASH_ISSI:
if (&esp_flash_chip_issi == NULL) {
ESP_EARLY_LOGW(TAG, "ISSI detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_ISSI_CHIP`");
ESP_EARLY_LOGW(TAG, FORMAT_STR, "ISSI", "ISSI");
}
break;
case SPI_FLASH_TH:
if (&esp_flash_chip_th == NULL) {
ESP_EARLY_LOGW(TAG, "TH detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_TH_CHIP`");
ESP_EARLY_LOGW(TAG, FORMAT_STR, "TH", "TH");
}
break;
case SPI_FLASH_WINBOND:
if (&esp_flash_chip_winbond == NULL) {
ESP_EARLY_LOGW(TAG, "winbond detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_WINBOND_CHIP`");
ESP_EARLY_LOGW(TAG, FORMAT_STR, "winbond", "WINBOND");
}
break;
case SPI_FLASH_MXIC:
// Need to tell the difference between octal and quad flash.
if (chip->read_mode < SPI_FLASH_OPI_FLAG) {
if (&esp_flash_chip_mxic == NULL) {
ESP_EARLY_LOGW(TAG, "MXIC detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_MXIC_CHIP`");
ESP_EARLY_LOGW(TAG, FORMAT_STR, "MXIC", "MXIC");
}
} else {
if (&esp_flash_chip_mxic_opi == NULL) {
ESP_EARLY_LOGW(TAG, "MXIC detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_MXIC_OPI_CHIP`");
ESP_EARLY_LOGW(TAG, FORMAT_STR, "MXIC", "MXIC_OPI");
}
}
break;
case SPI_FLASH_BY:
if (&esp_flash_chip_boya == NULL) {
ESP_EARLY_LOGW(TAG, "boya detected but related driver is not linked, please check option `SPI_FLASH_SUPPORT_BOYA_CHIP`");
ESP_EARLY_LOGW(TAG, FORMAT_STR, "boya", "BOYA");
}
break;
default: