summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke he <sixuerain@qq.com>2020-12-28 18:22:21 +0800
committerEdward O'Callaghan <quasisec@chromium.org>2021-01-02 00:07:23 +0000
commit32f4cb4ffa2854354f00e5facc9ccb8c9beafd61 (patch)
treec7ec6b2f4f6d68ab4ae4f8212942562ae3e0ed71
parente3afd77087b317253114b231be96eec6aadf5565 (diff)
downloadflashrom-32f4cb4ffa2854354f00e5facc9ccb8c9beafd61.tar.gz
flashrom-32f4cb4ffa2854354f00e5facc9ccb8c9beafd61.tar.bz2
flashrom-32f4cb4ffa2854354f00e5facc9ccb8c9beafd61.zip
flashchips.c: Add support for XMC new SPI flash types
Adds initial support for the follow SPI flash chips: XM25QU64C XM25QU128C XM25QU256C XM25QH64C XM25QH128C XM25QH256C BUG=none TEST=builds Signed-off-by: Luke He <sixuerain@qq.com> Change-Id: I15c51b0f1ed789bcb2cabe33bc830f8d5d916969 Reviewed-on: https://review.coreboot.org/c/flashrom/+/48949 Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--flashchips.c238
-rw-r--r--flashchips.h8
2 files changed, 245 insertions, 1 deletions
diff --git a/flashchips.c b/flashchips.c
index c4a1e6f8a..7590dff91 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -18993,6 +18993,244 @@ const struct flashchip flashchips[] = {
},
{
+ .vendor = "XMC",
+ .name = "XM25QH64C",
+ .bustype = BUS_SPI,
+ .manufacture_id = ST_ID,
+ .model_id = XMC_XM25QH64C,
+ .total_size = 8192,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 2048} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 256} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 128} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {8 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {8 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
+ .printlock = spi_prettyprint_status_register_plain,
+ .unlock = spi_disable_blockprotect,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ },
+
+ {
+ .vendor = "XMC",
+ .name = "XM25QU64C",
+ .bustype = BUS_SPI,
+ .manufacture_id = ST_ID,
+ .model_id = XMC_XM25QU64C,
+ .total_size = 8192,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 2048} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 256} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 128} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {8 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {8 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
+ .printlock = spi_prettyprint_status_register_plain,
+ .unlock = spi_disable_blockprotect,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {1650, 1950},
+ },
+
+ {
+ .vendor = "XMC",
+ .name = "XM25QH128C",
+ .bustype = BUS_SPI,
+ .manufacture_id = ST_ID,
+ .model_id = XMC_XM25QH128C,
+ .total_size = 16384,
+ .page_size = 256,
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 4096} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 512} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 256} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {16 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {16 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
+ .printlock = spi_prettyprint_status_register_plain,
+ .unlock = spi_disable_blockprotect,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ },
+
+ {
+ .vendor = "XMC",
+ .name = "XM25QU128C",
+ .bustype = BUS_SPI,
+ .manufacture_id = ST_ID,
+ .model_id = XMC_XM25QU128C,
+ .total_size = 16384,
+ .page_size = 256,
+ /* supports SFDP */
+ /* OTP: 1024B total, 256B reserved; read 0x48; write 0x42, erase 0x44, read ID 0x4B */
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_QPI,
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 4096} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 512} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 256} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {16 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {16 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
+ .printlock = spi_prettyprint_status_register_plain, /* TODO: improve */
+ .unlock = spi_disable_blockprotect,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {1650, 1950},
+ },
+
+ {
+ .vendor = "XMC",
+ .name = "XM25QH256C",
+ .bustype = BUS_SPI,
+ .manufacture_id = ST_ID,
+ .model_id = XMC_XM25QH256C,
+ .total_size = 32768,
+ .page_size = 256,
+ /* supports SFDP */
+ /* OTP: 1024B total, 256B reserved; read 0x48; write 0x42, erase 0x44, read ID 0x4B */
+ /* FOUR_BYTE_ADDR: supports 4-bytes addressing mode */
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_ENTER_WREN
+ | FEATURE_4BA_EXT_ADDR | FEATURE_4BA_READ | FEATURE_4BA_FAST_READ,
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 8192} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 1024} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 512} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {32 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {32 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
+ .printlock = spi_prettyprint_status_register_plain, /* TODO: improve */
+ .unlock = spi_disable_blockprotect,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {2700, 3600},
+ },
+
+ {
+ .vendor = "XMC",
+ .name = "XM25QU256C",
+ .bustype = BUS_SPI,
+ .manufacture_id = ST_ID,
+ .model_id = XMC_XM25QU256C,
+ .total_size = 32768,
+ .page_size = 256,
+ /* supports SFDP */
+ /* OTP: 1024B total, 256B reserved; read 0x48; write 0x42, erase 0x44, read ID 0x4B */
+ /* FOUR_BYTE_ADDR: supports 4-bytes addressing mode */
+ .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_ENTER_WREN
+ | FEATURE_4BA_EXT_ADDR | FEATURE_4BA_READ | FEATURE_4BA_FAST_READ,
+ .tested = TEST_UNTESTED,
+ .probe = probe_spi_rdid,
+ .probe_timing = TIMING_ZERO,
+ .block_erasers =
+ {
+ {
+ .eraseblocks = { {4 * 1024, 8192} },
+ .block_erase = spi_block_erase_20,
+ }, {
+ .eraseblocks = { {32 * 1024, 1024} },
+ .block_erase = spi_block_erase_52,
+ }, {
+ .eraseblocks = { {64 * 1024, 512} },
+ .block_erase = spi_block_erase_d8,
+ }, {
+ .eraseblocks = { {32 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_60,
+ }, {
+ .eraseblocks = { {32 * 1024 * 1024, 1} },
+ .block_erase = spi_block_erase_c7,
+ }
+ },
+ .printlock = spi_prettyprint_status_register_plain, /* TODO: improve */
+ .unlock = spi_disable_blockprotect,
+ .write = spi_chip_write_256,
+ .read = spi_chip_read,
+ .voltage = {1650, 1950},
+ },
+
+ {
.vendor = "Zetta Device",
.name = "ZD25D20",
.bustype = BUS_SPI,
diff --git a/flashchips.h b/flashchips.h
index 394eb30d2..a85fa6a6b 100644
--- a/flashchips.h
+++ b/flashchips.h
@@ -792,7 +792,7 @@
* ST25P chips are SPI, first byte of device ID is memory type, second
* byte of device ID is related to log(bitsize) at least for some chips.
*/
-#define ST_ID 0x20 /* ST / SGS/Thomson / Numonyx (later acquired by Micron) */
+#define ST_ID 0x20 /* ST / SGS/Thomson / Numonyx / XMC(later acquired by Micron) */
#define ST_M25P05A 0x2010
#define ST_M25P05_RES 0x05
#define ST_M25P10A 0x2011
@@ -811,6 +811,12 @@
#define ST_M45PE40 0x4013
#define ST_M45PE80 0x4014
#define ST_M45PE16 0x4015
+#define XMC_XM25QH64C 0x4017
+#define XMC_XM25QU64C 0x4117
+#define XMC_XM25QH128C 0x4018
+#define XMC_XM25QU128C 0x4118
+#define XMC_XM25QH256C 0x4019
+#define XMC_XM25QU256C 0x4119
#define ST_M25PX80 0x7114
#define ST_M25PX16 0x7115
#define ST_M25PX32 0x7116