From 1c18d654165be2536117362e9edbfb6c4563d307 Mon Sep 17 00:00:00 2001 From: "C.S.M" Date: Tue, 29 Jul 2025 12:03:26 +0800 Subject: [PATCH] feat(spi_flash): Add support for gd55f flash chip --- components/spi_flash/esp32c5/Kconfig.soc_caps.in | 4 ++++ components/spi_flash/esp32c5/flash_vendor_caps.h | 1 + components/spi_flash/spi_flash_chip_gd.c | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/spi_flash/esp32c5/Kconfig.soc_caps.in b/components/spi_flash/esp32c5/Kconfig.soc_caps.in index 443f776e07..c95fe41d95 100644 --- a/components/spi_flash/esp32c5/Kconfig.soc_caps.in +++ b/components/spi_flash/esp32c5/Kconfig.soc_caps.in @@ -10,3 +10,7 @@ config SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED config SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED bool default y + +config SPI_FLASH_VENDOR_BOYA_SUPPORT_ENABLED + bool + default y diff --git a/components/spi_flash/esp32c5/flash_vendor_caps.h b/components/spi_flash/esp32c5/flash_vendor_caps.h index 24ce9c86b0..4912aa061d 100644 --- a/components/spi_flash/esp32c5/flash_vendor_caps.h +++ b/components/spi_flash/esp32c5/flash_vendor_caps.h @@ -7,3 +7,4 @@ #define SPI_FLASH_VENDOR_XMC_SUPPORT_ENABLED (1) #define SPI_FLASH_VENDOR_GD_SUPPORT_ENABLED (1) +#define SPI_FLASH_VENDOR_BOYA_SUPPORT_ENABLED (1) diff --git a/components/spi_flash/spi_flash_chip_gd.c b/components/spi_flash/spi_flash_chip_gd.c index b12223f607..46ac61ab32 100644 --- a/components/spi_flash/spi_flash_chip_gd.c +++ b/components/spi_flash/spi_flash_chip_gd.c @@ -40,6 +40,7 @@ spi_flash_caps_t spi_flash_chip_gd_get_caps(esp_flash_t *chip) case 0xC84016: case 0xC84017: case 0xC84018: + case 0xC84319: caps_flags |= SPI_FLASH_CHIP_CAP_SUSPEND; break; default: @@ -74,6 +75,7 @@ esp_err_t spi_flash_chip_gd_detect_size(esp_flash_t *chip, uint32_t *size) #define GD25Q_PRODUCT_ID 0x4000 #define GD25LQ_PRODUCT_ID 0x6000 #define GD25UF_PRODUCT_ID 0x8300 +#define GD55F_PRODUCT_ID 0x4300 #define WRSR_16B_REQUIRED(chip_id) (((chip_id) & FLASH_ID_MASK) == GD25LQ_PRODUCT_ID || \ ((chip_id) & FLASH_SIZE_MASK) <= 0x15) @@ -89,7 +91,7 @@ esp_err_t spi_flash_chip_gd_probe(esp_flash_t *chip, uint32_t flash_id) } uint32_t product_id = flash_id & FLASH_ID_MASK; - if (product_id != GD25Q_PRODUCT_ID && product_id != GD25LQ_PRODUCT_ID && product_id != GD25UF_PRODUCT_ID) { + if (product_id != GD25Q_PRODUCT_ID && product_id != GD25LQ_PRODUCT_ID && product_id != GD25UF_PRODUCT_ID && product_id != GD55F_PRODUCT_ID) { return ESP_ERR_NOT_FOUND; }