1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-29 07:53:44 +02:00

flashchips: Revise all 4BA chips

Advertise all 4BA features that are currently supported by flashrom,
plus add a new feature flag for the 4BA fast-read instruction. Also,
list all supported 3BA and 4BA erase-block functions.

As this adds a lot of new code paths that could be taken for these
chips, mark them all as untested again.

Change-Id: I0598496ee7058e3b170684d366f58e4014e0e871
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/22423
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
This commit is contained in:
Nico Huber 2017-11-10 22:54:13 +01:00
parent fe34d2af28
commit aac81424eb
2 changed files with 50 additions and 16 deletions

11
flash.h
View File

@ -98,9 +98,9 @@ enum write_granularity {
/* /*
* How many different erase functions do we have per chip? * How many different erase functions do we have per chip?
* Atmel AT25FS010 has 6 different functions. * Macronix MX25L25635F has 8 different functions.
*/ */
#define NUM_ERASEFUNCTIONS 6 #define NUM_ERASEFUNCTIONS 8
/* Feature bits used for non-SPI only */ /* Feature bits used for non-SPI only */
#define FEATURE_REGISTERMAP (1 << 0) #define FEATURE_REGISTERMAP (1 << 0)
@ -124,7 +124,12 @@ enum write_granularity {
#define FEATURE_4BA_EXT_ADDR (1 << 12) /**< Regular 3-byte operations can be used by writing the most #define FEATURE_4BA_EXT_ADDR (1 << 12) /**< Regular 3-byte operations can be used by writing the most
significant address byte into an extended address register. */ significant address byte into an extended address register. */
#define FEATURE_4BA_READ (1 << 13) /**< Native 4BA read instruction (0x13) is supported. */ #define FEATURE_4BA_READ (1 << 13) /**< Native 4BA read instruction (0x13) is supported. */
#define FEATURE_4BA_WRITE (1 << 14) /**< Native 4BA byte program (0x12) is supported. */ #define FEATURE_4BA_FAST_READ (1 << 14) /**< Native 4BA fast read instruction (0x0c) is supported. */
#define FEATURE_4BA_WRITE (1 << 15) /**< Native 4BA byte program (0x12) is supported. */
/* 4BA Shorthands */
#define FEATURE_4BA_NATIVE (FEATURE_4BA_READ | FEATURE_4BA_FAST_READ | FEATURE_4BA_WRITE)
#define FEATURE_4BA (FEATURE_4BA_ENTER | FEATURE_4BA_EXT_ADDR | FEATURE_4BA_NATIVE)
#define FEATURE_4BA_WREN (FEATURE_4BA_ENTER_WREN | FEATURE_4BA_EXT_ADDR | FEATURE_4BA_NATIVE)
enum test_state { enum test_state {
OK = 0, OK = 0,

View File

@ -8127,25 +8127,34 @@ const struct flashchip flashchips[] = {
{ {
.vendor = "Macronix", .vendor = "Macronix",
.name = "MX25L25635F/MX25L25645E/MX25L25665E", .name = "MX25L25635F",
.bustype = BUS_SPI, .bustype = BUS_SPI,
.manufacture_id = MACRONIX_ID, .manufacture_id = MACRONIX_ID,
.model_id = MACRONIX_MX25L25635F, .model_id = MACRONIX_MX25L25635F,
.total_size = 32768, .total_size = 32768,
.page_size = 256, .page_size = 256,
/* OTP: 512B total; enter 0xB1, exit 0xC1 */ /* OTP: 512B total; enter 0xB1, exit 0xC1 */
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_ENTER, .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA,
.tested = TEST_OK_PREW, .tested = TEST_UNTESTED,
.probe = probe_spi_rdid, .probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO, .probe_timing = TIMING_ZERO,
.block_erasers = .block_erasers =
{ {
{ {
.eraseblocks = { {4 * 1024, 8192} },
.block_erase = spi_block_erase_21,
}, {
.eraseblocks = { {4 * 1024, 8192} }, .eraseblocks = { {4 * 1024, 8192} },
.block_erase = spi_block_erase_20, .block_erase = spi_block_erase_20,
}, {
.eraseblocks = { {32 * 1024, 1024} },
.block_erase = spi_block_erase_5c,
}, { }, {
.eraseblocks = { {32 * 1024, 1024} }, .eraseblocks = { {32 * 1024, 1024} },
.block_erase = spi_block_erase_52, .block_erase = spi_block_erase_52,
}, {
.eraseblocks = { {64 * 1024, 512} },
.block_erase = spi_block_erase_dc,
}, { }, {
.eraseblocks = { {64 * 1024, 512} }, .eraseblocks = { {64 * 1024, 512} },
.block_erase = spi_block_erase_d8, .block_erase = spi_block_erase_d8,
@ -8174,18 +8183,27 @@ const struct flashchip flashchips[] = {
.total_size = 65536, .total_size = 65536,
.page_size = 256, .page_size = 256,
/* OTP: 512B total; enter 0xB1, exit 0xC1 */ /* OTP: 512B total; enter 0xB1, exit 0xC1 */
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_ENTER, .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA,
.tested = TEST_OK_PREW, .tested = TEST_UNTESTED,
.probe = probe_spi_rdid, .probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO, .probe_timing = TIMING_ZERO,
.block_erasers = .block_erasers =
{ {
{ {
.eraseblocks = { {4 * 1024, 16384} },
.block_erase = spi_block_erase_21,
}, {
.eraseblocks = { {4 * 1024, 16384} }, .eraseblocks = { {4 * 1024, 16384} },
.block_erase = spi_block_erase_20, .block_erase = spi_block_erase_20,
}, {
.eraseblocks = { {32 * 1024, 2048} },
.block_erase = spi_block_erase_5c,
}, { }, {
.eraseblocks = { {32 * 1024, 2048} }, .eraseblocks = { {32 * 1024, 2048} },
.block_erase = spi_block_erase_52, .block_erase = spi_block_erase_52,
}, {
.eraseblocks = { {64 * 1024, 1024} },
.block_erase = spi_block_erase_dc,
}, { }, {
.eraseblocks = { {64 * 1024, 1024} }, .eraseblocks = { {64 * 1024, 1024} },
.block_erase = spi_block_erase_d8, .block_erase = spi_block_erase_d8,
@ -9914,18 +9932,23 @@ const struct flashchip flashchips[] = {
.page_size = 256, .page_size = 256,
/* supports SFDP */ /* supports SFDP */
/* OTP: 64B total; read 0x4B, write 0x42 */ /* OTP: 64B total; read 0x4B, write 0x42 */
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_WREN,
| FEATURE_4BA_ENTER_WREN | FEATURE_4BA_READ | FEATURE_4BA_WRITE, .tested = TEST_UNTESTED,
.tested = TEST_OK_PREW,
.probe = probe_spi_rdid, .probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO, .probe_timing = TIMING_ZERO,
.block_erasers = { .block_erasers = {
{ {
.eraseblocks = { {4 * 1024, 8192} }, .eraseblocks = { {4 * 1024, 8192} },
.block_erase = spi_block_erase_21, .block_erase = spi_block_erase_21,
}, {
.eraseblocks = { {4 * 1024, 8192} },
.block_erase = spi_block_erase_20,
}, { }, {
.eraseblocks = { {64 * 1024, 512} }, .eraseblocks = { {64 * 1024, 512} },
.block_erase = spi_block_erase_dc, .block_erase = spi_block_erase_dc,
}, {
.eraseblocks = { {64 * 1024, 512} },
.block_erase = spi_block_erase_d8,
}, { }, {
.eraseblocks = { {32768 * 1024, 1} }, .eraseblocks = { {32768 * 1024, 1} },
.block_erase = spi_block_erase_c7, .block_erase = spi_block_erase_c7,
@ -9948,18 +9971,23 @@ const struct flashchip flashchips[] = {
.page_size = 256, .page_size = 256,
/* supports SFDP */ /* supports SFDP */
/* OTP: 64B total; read 0x4B, write 0x42 */ /* OTP: 64B total; read 0x4B, write 0x42 */
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_WREN,
| FEATURE_4BA_ENTER_WREN | FEATURE_4BA_READ | FEATURE_4BA_WRITE, .tested = TEST_UNTESTED,
.tested = TEST_OK_PREW,
.probe = probe_spi_rdid, .probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO, .probe_timing = TIMING_ZERO,
.block_erasers = { .block_erasers = {
{ {
.eraseblocks = { {4 * 1024, 16384} }, .eraseblocks = { {4 * 1024, 16384} },
.block_erase = spi_block_erase_21, .block_erase = spi_block_erase_21,
}, {
.eraseblocks = { {4 * 1024, 16384} },
.block_erase = spi_block_erase_20,
}, { }, {
.eraseblocks = { {64 * 1024, 1024} }, .eraseblocks = { {64 * 1024, 1024} },
.block_erase = spi_block_erase_dc, .block_erase = spi_block_erase_dc,
}, {
.eraseblocks = { {64 * 1024, 1024} },
.block_erase = spi_block_erase_d8,
}, { }, {
.eraseblocks = { {65536 * 1024, 1} }, .eraseblocks = { {65536 * 1024, 1} },
.block_erase = spi_block_erase_c7, .block_erase = spi_block_erase_c7,
@ -14827,8 +14855,9 @@ const struct flashchip flashchips[] = {
/* supports SFDP */ /* supports SFDP */
/* OTP: 1024B total, 256B reserved; read 0x48; write 0x42, erase 0x44, read ID 0x4B */ /* OTP: 1024B total, 256B reserved; read 0x48; write 0x42, erase 0x44, read ID 0x4B */
/* FOUR_BYTE_ADDR: supports 4-bytes addressing mode */ /* FOUR_BYTE_ADDR: supports 4-bytes addressing mode */
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_ENTER_WREN | FEATURE_4BA_READ, .feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_4BA_ENTER_WREN
.tested = TEST_OK_PREW, | FEATURE_4BA_EXT_ADDR | FEATURE_4BA_READ | FEATURE_4BA_FAST_READ,
.tested = TEST_UNTESTED,
.probe = probe_spi_rdid, .probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO, .probe_timing = TIMING_ZERO,
.block_erasers = .block_erasers =