Edward O'Callaghan has uploaded this change for review.

View Change

flashchips.c: Drop 'unlock' func for chips with WP topologies

Use the proper status register topology data via writeprotect
to correctly unlock the chip over boutique unlock functions
for chips that have WP data to support it.

Change-Id: Ib24e91b28cb3d87ba74019e23f88209b95a21c5d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M flashchips.c
1 file changed, 14 insertions(+), 46 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/14/73714/1
diff --git a/flashchips.c b/flashchips.c
index 6764c33..1a37ce1 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -2438,7 +2438,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 2000},
@@ -5173,7 +5172,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6 is quad enable */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -5256,7 +5254,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6 is quad enable */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -5342,7 +5339,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6 is quad enable */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -6454,7 +6450,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP4_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP4_SRWD, /* TODO: 2nd status reg (read with 0x35) */
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {1695, 1950},
@@ -6620,7 +6615,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP4_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP4_SRWD, /* TODO: 2nd status reg (read with 0x35) */
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {1695, 1950},
@@ -6748,7 +6742,6 @@
},
/* TODO: 2nd status reg (read 0x35, write 0x31) and 3rd status reg (read 0x15, write 0x11) */
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP4_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP4_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -6883,7 +6876,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -6930,7 +6922,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP4_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP4_SRWD, /* TODO: 2nd status reg (read with 0x35) */
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -7052,7 +7043,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP4_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP4_SRWD, /* TODO: 2nd status reg (read with 0x35) */
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -8941,7 +8931,6 @@
},
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and dual I/O supported */
.voltage = {2700, 3600},
@@ -9174,7 +9163,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6: error flag */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) supported */
.voltage = {2700, 3600},
@@ -9216,7 +9204,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6: continuously program mode */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B), dual I/O read (0xBB) supported */
.voltage = {2700, 3600},
@@ -9263,7 +9250,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B), dual I/O read supported */
.voltage = {2700, 3600},
@@ -9310,7 +9296,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6 is quad enable */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -9357,7 +9342,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6 is quad enable */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -9405,7 +9389,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD, /* bit6 is quad enable */
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -11383,7 +11366,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_N25Q, /* TODO: config, lock, flag regs */
- .unlock = SPI_DISABLE_BLOCKPROTECT_N25Q, /* TODO: per 64kB sector lock registers */
.write = SPI_CHIP_WRITE256, /* Multi I/O supported */
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {1700, 2000},
@@ -11428,7 +11410,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_N25Q, /* TODO: config, lock, flag regs */
- .unlock = SPI_DISABLE_BLOCKPROTECT_N25Q, /* TODO: per 64kB sector lock registers */
.write = SPI_CHIP_WRITE256, /* Multi I/O supported */
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -11473,7 +11454,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_N25Q, /* TODO: config, lock, flag regs */
- .unlock = SPI_DISABLE_BLOCKPROTECT_N25Q, /* TODO: per 64kB sector lock registers */
.write = SPI_CHIP_WRITE256, /* Multi I/O supported */
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {1700, 2000},
@@ -11518,7 +11498,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_N25Q, /* TODO: config, lock, flag regs */
- .unlock = SPI_DISABLE_BLOCKPROTECT_N25Q, /* TODO: per 64kB sector lock registers */
.write = SPI_CHIP_WRITE256, /* Multi I/O supported */
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -12168,7 +12147,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_N25Q, /* TODO: config, lock, flag regs */
- .unlock = SPI_DISABLE_BLOCKPROTECT_N25Q, /* TODO: per 64kB sector lock registers */
.write = SPI_CHIP_WRITE256, /* Multi I/O supported */
.read = SPI_CHIP_READ, /* Fast read (0x0B) and multi I/O supported */
.voltage = {2700, 3600},
@@ -16491,7 +16469,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP2_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP2_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) supported */
.voltage = {2700, 3600},
@@ -16985,7 +16962,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP3_SRWD,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP3_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ, /* Fast read (0x0B) supported */
.voltage = {2700, 3600},
@@ -17609,7 +17585,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -17658,7 +17633,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN,
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -17708,7 +17682,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1650, 1950},
@@ -17756,7 +17729,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1650, 1950},
@@ -17927,7 +17899,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -17982,7 +17953,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -18037,7 +18007,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -18139,7 +18108,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 1950},
@@ -18189,7 +18157,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -18240,7 +18207,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -18292,7 +18258,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -18343,7 +18308,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 1950}, /* Fast read (0x0B) and multi I/O supported */
@@ -18394,7 +18358,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 1950}, /* Fast read (0x0B) and multi I/O supported */
@@ -18446,7 +18409,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 1950}, /* Fast read (0x0B) and multi I/O supported */
@@ -18498,7 +18460,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_BP2_TB_BPL,
- .unlock = SPI_DISABLE_BLOCKPROTECT_BP2_SRWD,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 1950},
@@ -18715,7 +18676,6 @@
.block_erase = SPI_BLOCK_ERASE_C7,
}
},
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1650, 1950},
@@ -18765,7 +18725,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -18816,7 +18775,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -18907,7 +18865,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 1950}, /* Fast read (0x0B) and multi I/O supported */
@@ -18957,7 +18914,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {1700, 1950}, /* Fast read (0x0B) and multi I/O supported */
@@ -20290,7 +20246,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN,
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},
@@ -20382,7 +20337,6 @@
}
},
.printlock = SPI_PRETTYPRINT_STATUS_REGISTER_PLAIN, /* TODO: improve */
- .unlock = SPI_DISABLE_BLOCKPROTECT,
.write = SPI_CHIP_WRITE256,
.read = SPI_CHIP_READ,
.voltage = {2700, 3600},

To view, visit change 73714. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib24e91b28cb3d87ba74019e23f88209b95a21c5d
Gerrit-Change-Number: 73714
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange