From 2f7edbf6fe66c27248d213acab674d8781c79c27 Mon Sep 17 00:00:00 2001 From: Ssunk Date: Thu, 27 Jun 2024 22:01:52 +0800 Subject: [PATCH] flashchips: Add Support for XMC XM25QH32C/XM25QH32D Add initial support for the SPI flash chip XM25QH32C/XM25QH32D Datasheet link: https://www.xmcwh.com/uploads/799/XM25QH32C_Ver2.1.pdf Tested with ch341a programmer: probe, read, write, erase Change-Id: Ib201ac28384b8db6539e2a82e6f90462d1393208 Signed-off-by: Kan Sun Reviewed-on: https://review.coreboot.org/c/flashrom/+/83235 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk --- flashchips.c | 38 ++++++++++++++++++++++++++++++++++++++ include/flashchips.h | 1 + 2 files changed, 39 insertions(+) diff --git a/flashchips.c b/flashchips.c index 84a3b5e04..b7d378f53 100644 --- a/flashchips.c +++ b/flashchips.c @@ -22124,6 +22124,44 @@ const struct flashchip flashchips[] = { .voltage = {1650, 1950}, }, + { + .vendor = "XMC", + .name = "XM25QH32C/XM25QH32D", + .bustype = BUS_SPI, + .manufacture_id = ST_ID, + .model_id = XMC_XM25QH32C, + .total_size = 4096, + .page_size = 256, + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI, + .tested = TEST_OK_PREW, + .probe = PROBE_SPI_RDID, + .probe_timing = TIMING_ZERO, + .block_erasers = + { + { + .eraseblocks = { {4 * 1024, 1024} }, + .block_erase = SPI_BLOCK_ERASE_20, + }, { + .eraseblocks = { {32 * 1024, 128} }, + .block_erase = SPI_BLOCK_ERASE_52, + }, { + .eraseblocks = { {64 * 1024, 64} }, + .block_erase = SPI_BLOCK_ERASE_D8, + }, { + .eraseblocks = { {4 * 1024 * 1024, 1} }, + .block_erase = SPI_BLOCK_ERASE_60, + }, { + .eraseblocks = { {4 * 1024 * 1024, 1} }, + .block_erase = SPI_BLOCK_ERASE_C7, + } + }, + .printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, + .unlock = SPI_DISABLE_BLOCKPROTECT, + .write = SPI_CHIP_WRITE256, + .read = SPI_CHIP_READ, + .voltage = {2700, 3600}, + }, + { .vendor = "XMC", .name = "XM25QH64C", diff --git a/include/flashchips.h b/include/flashchips.h index c670e3f81..0f96d6af2 100644 --- a/include/flashchips.h +++ b/include/flashchips.h @@ -850,6 +850,7 @@ #define XMC_XM25QU80B 0x5014 #define XMC_XM25QH16C 0x4015 /* Same as XM25QH16D */ #define XMC_XM25QU16C 0x5015 +#define XMC_XM25QH32C 0x4016 /* Same as XM25QH32D */ #define XMC_XM25QH128A 0x7018 #define XMC_XM25QH128C 0x4018 #define XMC_XM25QU128C 0x4118