Skip to content

Commit cf23702

Browse files
committed
[RFC] flashchips.c: enable WP for MX25L320{6,8}E, MX25L6405[D], MX25L64{06,08,36,45,65}E, MX25L6473[EF]
Change-Id: Ib3db9d39ffacd3e9e44de92c6cfb6c3ecc8615bd Signed-off-by: Sergii Dmytruk <[email protected]>
1 parent 89a6116 commit cf23702

File tree

1 file changed

+131
-2
lines changed

1 file changed

+131
-2
lines changed

flashchips.c

Lines changed: 131 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8863,6 +8863,13 @@ const struct flashchip flashchips[] = {
88638863
.write = spi_chip_write_256,
88648864
.read = spi_chip_read, /* Fast read (0x0B) and dual I/O supported */
88658865
.voltage = {2700, 3600},
8866+
.reg_bits =
8867+
{
8868+
.srp = {STATUS1, 7, RW},
8869+
.bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
8870+
.cmp = {STATUS1, 5, RW}, /* Called BP3 in datasheet, acts like CMP */
8871+
},
8872+
.decode_range = decode_range_spi25_bit_cmp,
88668873
},
88678874

88688875
{
@@ -9089,6 +9096,12 @@ const struct flashchip flashchips[] = {
90899096
.write = spi_chip_write_256,
90909097
.read = spi_chip_read, /* Fast read (0x0B) supported */
90919098
.voltage = {2700, 3600},
9099+
.reg_bits =
9100+
{
9101+
.srp = {STATUS1, 7, RW},
9102+
.bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}, {STATUS1, 5, RW}},
9103+
},
9104+
.decode_range = decode_range_spi25,
90929105
},
90939106

90949107
{
@@ -9125,6 +9138,13 @@ const struct flashchip flashchips[] = {
91259138
.write = spi_chip_write_256,
91269139
.read = spi_chip_read, /* Fast read (0x0B), dual I/O read (0xBB) supported */
91279140
.voltage = {2700, 3600},
9141+
.reg_bits =
9142+
{
9143+
.srp = {STATUS1, 7, RW},
9144+
.bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
9145+
.cmp = {STATUS1, 5, RW}, /* Called BP3 in datasheet, acts like CMP */
9146+
},
9147+
.decode_range = decode_range_spi25_bit_cmp,
91289148
},
91299149

91309150
{
@@ -9165,19 +9185,26 @@ const struct flashchip flashchips[] = {
91659185
.write = spi_chip_write_256,
91669186
.read = spi_chip_read, /* Fast read (0x0B), dual I/O read supported */
91679187
.voltage = {2700, 3600},
9188+
.reg_bits =
9189+
{
9190+
.srp = {STATUS1, 7, RW},
9191+
.bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}},
9192+
.cmp = {STATUS1, 5, RW}, /* Called BP3 in datasheet, acts like CMP */
9193+
},
9194+
.decode_range = decode_range_spi25_bit_cmp,
91689195
},
91699196

91709197
{
91719198
.vendor = "Macronix",
9172-
.name = "MX25L6436E/MX25L6445E/MX25L6465E/MX25L6473E/MX25L6473F",
9199+
.name = "MX25L6436E/MX25L6445E/MX25L6465E",
91739200
.bustype = BUS_SPI,
91749201
.manufacture_id = MACRONIX_ID,
91759202
.model_id = MACRONIX_MX25L6405,
91769203
.total_size = 8192,
91779204
.page_size = 256,
91789205
/* supports SFDP */
91799206
/* OTP: 512B total; enter 0xB1, exit 0xC1 */
9180-
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP,
9207+
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_SCUR,
91819208
.tested = TEST_OK_PREW,
91829209
.probe = probe_spi_rdid,
91839210
.probe_timing = TIMING_ZERO,
@@ -9205,6 +9232,108 @@ const struct flashchip flashchips[] = {
92059232
.write = spi_chip_write_256,
92069233
.read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
92079234
.voltage = {2700, 3600},
9235+
.reg_bits =
9236+
{
9237+
.srp = {STATUS1, 7, RW},
9238+
.bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}, {STATUS1, 5, RW}},
9239+
.wps = {SECREG, 7, OTP}, /* This bit is set by WPSEL command */
9240+
},
9241+
.decode_range = decode_range_spi25_2x_block,
9242+
},
9243+
9244+
{
9245+
.vendor = "Macronix",
9246+
.name = "MX25L6473E",
9247+
.bustype = BUS_SPI,
9248+
.manufacture_id = MACRONIX_ID,
9249+
.model_id = MACRONIX_MX25L6405,
9250+
.total_size = 8192,
9251+
.page_size = 256,
9252+
/* supports SFDP */
9253+
/* OTP: 512B total; enter 0xB1, exit 0xC1 */
9254+
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_WRSR_EXT2 | FEATURE_SCUR | FEATURE_CR,
9255+
.tested = TEST_OK_PREW,
9256+
.probe = probe_spi_rdid,
9257+
.probe_timing = TIMING_ZERO,
9258+
.block_erasers =
9259+
{
9260+
{
9261+
.eraseblocks = { {4 * 1024, 2048} },
9262+
.block_erase = spi_block_erase_20,
9263+
}, {
9264+
.eraseblocks = { {32 * 1024, 256} },
9265+
.block_erase = spi_block_erase_52,
9266+
}, {
9267+
.eraseblocks = { {64 * 1024, 128} },
9268+
.block_erase = spi_block_erase_d8,
9269+
}, {
9270+
.eraseblocks = { {8 * 1024 * 1024, 1} },
9271+
.block_erase = spi_block_erase_60,
9272+
}, {
9273+
.eraseblocks = { {8 * 1024 * 1024, 1} },
9274+
.block_erase = spi_block_erase_c7,
9275+
}
9276+
},
9277+
.printlock = spi_prettyprint_status_register_bp3_srwd, /* bit6 is quad enable */
9278+
.unlock = spi_disable_blockprotect_bp3_srwd,
9279+
.write = spi_chip_write_256,
9280+
.read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
9281+
.voltage = {2700, 3600},
9282+
.reg_bits =
9283+
{
9284+
.srp = {STATUS1, 7, RW},
9285+
.bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}, {STATUS1, 5, RW}},
9286+
.tb = {CFGREG, 3, OTP},
9287+
.wps = {SECREG, 7, OTP}, /* This bit is set by WPSEL command */
9288+
},
9289+
.decode_range = decode_range_spi25,
9290+
},
9291+
9292+
{
9293+
.vendor = "Macronix",
9294+
.name = "MX25L6473F",
9295+
.bustype = BUS_SPI,
9296+
.manufacture_id = MACRONIX_ID,
9297+
.model_id = MACRONIX_MX25L6405,
9298+
.total_size = 8192,
9299+
.page_size = 256,
9300+
/* supports SFDP */
9301+
/* OTP: 512B total; enter 0xB1, exit 0xC1 */
9302+
.feature_bits = FEATURE_WRSR_WREN | FEATURE_OTP | FEATURE_WRSR_EXT2 | FEATURE_CR,
9303+
.tested = TEST_OK_PREW,
9304+
.probe = probe_spi_rdid,
9305+
.probe_timing = TIMING_ZERO,
9306+
.block_erasers =
9307+
{
9308+
{
9309+
.eraseblocks = { {4 * 1024, 2048} },
9310+
.block_erase = spi_block_erase_20,
9311+
}, {
9312+
.eraseblocks = { {32 * 1024, 256} },
9313+
.block_erase = spi_block_erase_52,
9314+
}, {
9315+
.eraseblocks = { {64 * 1024, 128} },
9316+
.block_erase = spi_block_erase_d8,
9317+
}, {
9318+
.eraseblocks = { {8 * 1024 * 1024, 1} },
9319+
.block_erase = spi_block_erase_60,
9320+
}, {
9321+
.eraseblocks = { {8 * 1024 * 1024, 1} },
9322+
.block_erase = spi_block_erase_c7,
9323+
}
9324+
},
9325+
.printlock = spi_prettyprint_status_register_bp3_srwd, /* bit6 is quad enable */
9326+
.unlock = spi_disable_blockprotect_bp3_srwd,
9327+
.write = spi_chip_write_256,
9328+
.read = spi_chip_read, /* Fast read (0x0B) and multi I/O supported */
9329+
.voltage = {2700, 3600},
9330+
.reg_bits =
9331+
{
9332+
.srp = {STATUS1, 7, RW},
9333+
.bp = {{STATUS1, 2, RW}, {STATUS1, 3, RW}, {STATUS1, 4, RW}, {STATUS1, 5, RW}},
9334+
.tb = {CFGREG, 3, OTP},
9335+
},
9336+
.decode_range = decode_range_spi25,
92089337
},
92099338

92109339
{

0 commit comments

Comments
 (0)