From 16bdb50cd03e292468f750e624c5bcecdbae07a6 Mon Sep 17 00:00:00 2001 From: Teesmo Date: Wed, 16 Oct 2024 16:09:32 +0200 Subject: [PATCH] feat(spi_nand_flash): added support for Micron MT29F1G01ABAFDSF-AAT:F --- spi_nand_flash/src/nand.c | 12 ++++++++++-- spi_nand_flash/src/nand_flash_devices.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/spi_nand_flash/src/nand.c b/spi_nand_flash/src/nand.c index b0a0979f98..4495db95d3 100644 --- a/spi_nand_flash/src/nand.c +++ b/spi_nand_flash/src/nand.c @@ -145,16 +145,24 @@ static esp_err_t spi_nand_micron_init(spi_nand_flash_device_t *dev) .flags = SPI_TRANS_USE_RXDATA, }; spi_nand_execute_transaction(dev->config.device_handle, &t); - dev->read_page_delay_us = 115; dev->erase_block_delay_us = 2000; - dev->program_page_delay_us = 240; ESP_LOGD(TAG, "%s: device_id: %x\n", __func__, device_id); switch (device_id) { case MICRON_DI_34: + dev->read_page_delay_us = 115; + dev->program_page_delay_us = 240; dev->dhara_nand.num_blocks = 2048; dev->dhara_nand.log2_ppb = 6; // 64 pages per block dev->dhara_nand.log2_page_size = 12; // 4096 bytes per page break; + case MICRON_DI_14: + case MICRON_DI_15: + dev->read_page_delay_us = 46; + dev->program_page_delay_us = 220; + dev->dhara_nand.num_blocks = 1024; + dev->dhara_nand.log2_ppb = 6; // 64 pages per block + dev->dhara_nand.log2_page_size = 11; // 2048 bytes per page + break; default: return ESP_ERR_INVALID_RESPONSE; } diff --git a/spi_nand_flash/src/nand_flash_devices.h b/spi_nand_flash/src/nand_flash_devices.h index 1b439e6cd6..e1474ada27 100644 --- a/spi_nand_flash/src/nand_flash_devices.h +++ b/spi_nand_flash/src/nand_flash_devices.h @@ -42,3 +42,5 @@ #define WINBOND_DI_BC21 0xBC21 #define MICRON_DI_34 0x34 +#define MICRON_DI_14 0x14 +#define MICRON_DI_15 0x15