From 9282e2f4ce89cc3d19a5d1cb32c321dfe1808fc3 Mon Sep 17 00:00:00 2001 From: Mathew Blowers Date: Tue, 11 Aug 2026 13:56:21 +0100 Subject: [PATCH] flashchips: Add PUYA P25Q40HB Datasheet: https://datasheet4u.com/pdf/1603105/PY25Q40HB.pdf Tested: probe, read, write and erase Tested-with: Raspberry Pi 4 https://paste.flashrom.org/view.php?id=3885 Change-Id: I1bf8ccced1d1d63dfb7ec56eac6c95cbe14ec742 Signed-off-by: Mathew Blowers Reviewed-on: https://review.coreboot.org/c/flashrom/+/94903 Tested-by: build bot (Jenkins) Reviewed-by: Abdelkader Boudih --- flashchips/puya.c | 38 ++++++++++++++++++++++++++++++++++++++ include/flashchips.h | 1 + 2 files changed, 39 insertions(+) --- a/flashchips/puya.c +++ b/flashchips/puya.c @@ -12,6 +12,44 @@ { .vendor = "PUYA", + .name = "P25Q40HB", + .bustype = BUS_SPI, + .manufacture_id = PUYA_ID, + .model_id = PUYA_P25Q40HB, + .total_size = 512, + .page_size = 256, + .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP, + .tested = TEST_OK_PREW, + .probe = PROBE_SPI_RDID, + .probe_timing = TIMING_ZERO, + .block_erasers = + { + { + .eraseblocks = { {4 * 1024, 128} }, + .block_erase = SPI_BLOCK_ERASE_20, + }, { + .eraseblocks = { {32 * 1024, 16} }, + .block_erase = SPI_BLOCK_ERASE_52, + }, { + .eraseblocks = { {64 * 1024, 8} }, + .block_erase = SPI_BLOCK_ERASE_D8, + }, { + .eraseblocks = { {512 * 1024, 1} }, + .block_erase = SPI_BLOCK_ERASE_60, + }, { + .eraseblocks = { {512 * 1024, 1} }, + .block_erase = SPI_BLOCK_ERASE_C7, + } + }, + .printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP4_SRWD, + .unlock = SPI_DISABLE_BLOCKPROTECT_BP4_SRWD, + .write = SPI_CHIP_WRITE256, + .read = SPI_CHIP_READ, + .voltage = {2300, 3600}, + }, + + { + .vendor = "PUYA", .name = "P25Q16HB", .bustype = BUS_SPI, .manufacture_id = PUYA_ID, --- a/include/flashchips.h +++ b/include/flashchips.h @@ -669,6 +669,7 @@ #define PMC_PM49FL004 0x6E #define PUYA_ID 0x85 +#define PUYA_P25Q40HB 0x2013 #define PUYA_P25Q16HB 0x2015 #define PUYA_P25Q06H 0x4010 #define PUYA_P25Q11H 0x4011