Attention is currently required from: Nikolai Artemiev.
Hello build bot (Jenkins), Edward O'Callaghan, Sergii Dmytruk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/70349
to look at the new patch set (#7).
Change subject: tree/: Change chip restore data type from uint8_t to void ptr
......................................................................
tree/: Change chip restore data type from uint8_t to void ptr
Chip restore callbacks currently are used by
- spi25_statusreg.c unlock functions to restore status register 1.
- s25f.c to restore config register 3.
Both of these cases only need to save a single uint8_t value to restore
the original chip state, however storing a void pointer will allow more
flexible chip restore behaviour. In particular, it will allow
flashrom_wp_cfg objects to be saved and restored, enabling
writeprotect-based unlocking.
BUG=b:237485865,b:247421511
BRANCH=none
TEST=Tested on grunt DUT (prog: sb600spi, flash: W25Q128.W):
`flashrom --wp-range 0x0,0x1000000 \
flashrom --wp-status # Result: range=0x0,0x1000000 \
flashrom -w random.bin # Result: success \
flashrom -v random.bin # Result: success \
flashrom --wp-status # Result: range=0x0,0x1000000`
Change-Id: I311b468a4b0349f4da9584c12b36af6ec2394527
Signed-off-by: Nikolai Artemiev <nartemiev(a)google.com>
---
M flashrom.c
M include/flash.h
M s25f.c
M spi25_statusreg.c
4 files changed, 57 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/49/70349/7
--
To view, visit https://review.coreboot.org/c/flashrom/+/70349
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I311b468a4b0349f4da9584c12b36af6ec2394527
Gerrit-Change-Number: 70349
Gerrit-PatchSet: 7
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Sam McNally, Felix Singer, Angel Pons.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71269 )
Change subject: programmer.h: Guard against sending spi commands on non-spi mst
......................................................................
Patch Set 2:
(1 comment)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/71269/comment/08fd139d_ef244c11
PS1, Line 1937: spi_master_no_4ba_modes
> I feel like the code needs a bit of work.. […]
Sam, https://review.coreboot.org/c/flashrom/+/71742
--
To view, visit https://review.coreboot.org/c/flashrom/+/71269
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7cce4f9c032d33c01bf616e27a50b9727a40fe1b
Gerrit-Change-Number: 71269
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Jonathon Hall <jonathon.hall(a)puri.sm>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-CC: Sam McNally <sammc(a)google.com>
Gerrit-CC: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Sun, 08 Jan 2023 01:42:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sam McNally <sammc(a)google.com>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/71742 )
Change subject: flashrom.c: Rewrite prepare_chip_access() 4BA enablement
......................................................................
flashrom.c: Rewrite prepare_chip_access() 4BA enablement
Factor out the 4BA enablement logic into its own function and
break down predicates into a series of easy to follow base-cases
complete with comments.
TEST=`$ sudo ./flashrom -p internal -r /tmp/bios`.
on a Found chipset "Intel Tiger Lake U Premium".
Change-Id: I10a426331cb2a3485e3dd786fa771e20870cbd84
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M flashrom.c
1 file changed, 57 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/42/71742/1
diff --git a/flashrom.c b/flashrom.c
index 822594b..f7499c3 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1905,6 +1905,45 @@
return 0;
}
+static int enable_4ba_if_required(struct flashctx *const flash)
+{
+ /* Check if chip too small to need 4BA. */
+ if (flash->chip->total_size <= 16 * 1024) {
+ return 0;
+ }
+
+ /* Check if SPI bus with 4BA enabled has a SPI master missing 4BA mode. */
+ if (!spi_master_no_4ba_modes(flash)) {
+ return 0;
+ }
+
+ /* Check if SPI bus with 4BA has a SPI master that supports a 4BA mode. */
+ if (!spi_master_4ba(flash)) {
+ msg_cerr("Programmer doesn't support this chip. Aborting.\n");
+ return 1;
+ }
+
+ /* Check chip supports native 4BA instructions and if not bail out. */
+ if ((flash->chip->feature_bits & FEATURE_4BA_NATIVE) != FEATURE_4BA_NATIVE) {
+ msg_cerr("Chip does not support 4BA Native instructions. Aborting.\n");
+ return 1;
+ }
+
+ /* Check if chip is on a chipbus that supports 4BA addressing mode. */
+ if (!spi_chip_4ba(flash)) {
+ return 0;
+ }
+
+ /* Enable/disable 4-byte addressing mode. */
+ int ret = spi_master_4ba(flash) ? spi_enter_4ba(flash): spi_exit_4ba(flash);
+ if (ret) {
+ msg_cerr("Failed to set correct 4BA mode! Aborting.\n");
+ return 1;
+ }
+
+ return 0;
+}
+
int prepare_flash_access(struct flashctx *const flash,
const bool read_it, const bool write_it,
const bool erase_it, const bool verify_it)
@@ -1933,30 +1972,7 @@
flash->address_high_byte = -1;
flash->in_4ba_mode = false;
- /* Be careful about 4BA chips and broken masters */
- if (flash->chip->total_size > 16 * 1024 && spi_master_no_4ba_modes(flash)) {
- /* If we can't use native instructions, bail out */
- if ((flash->chip->feature_bits & FEATURE_4BA_NATIVE) != FEATURE_4BA_NATIVE
- || !spi_master_4ba(flash)) {
- msg_cerr("Programmer doesn't support this chip. Aborting.\n");
- return 1;
- }
- }
-
- /* Enable/disable 4-byte addressing mode if flash chip supports it */
- if (spi_chip_4ba(flash)) {
- int ret;
- if (spi_master_4ba(flash))
- ret = spi_enter_4ba(flash);
- else
- ret = spi_exit_4ba(flash);
- if (ret) {
- msg_cerr("Failed to set correct 4BA mode! Aborting.\n");
- return 1;
- }
- }
-
- return 0;
+ return enable_4ba_if_required(flash);
}
void finalize_flash_access(struct flashctx *const flash)
--
To view, visit https://review.coreboot.org/c/flashrom/+/71742
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I10a426331cb2a3485e3dd786fa771e20870cbd84
Gerrit-Change-Number: 71742
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Sam McNally, Felix Singer, Angel Pons.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71269 )
Change subject: programmer.h: Guard against sending spi commands on non-spi mst
......................................................................
Patch Set 2:
(1 comment)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/71269/comment/3751906d_36a73bbc
PS1, Line 1937: spi_master_no_4ba_modes
> Could we skip this entire section on 4ba for non-SPI masters?
I feel like the code needs a bit of work.. Can we just fix the immediate issue first (>16MB flashing is broken on ichspi).
--
To view, visit https://review.coreboot.org/c/flashrom/+/71269
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7cce4f9c032d33c01bf616e27a50b9727a40fe1b
Gerrit-Change-Number: 71269
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Jonathon Hall <jonathon.hall(a)puri.sm>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-CC: Sam McNally <sammc(a)google.com>
Gerrit-CC: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Sam McNally <sammc(a)google.com>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Sat, 07 Jan 2023 09:16:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sam McNally <sammc(a)google.com>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Vasily Galkin, Thomas Heijligen, roman.stingler(a)gmail.com.
Hello Felix Singer, build bot (Jenkins), Thomas Heijligen, roman.stingler(a)gmail.com,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/58179
to look at the new patch set (#5).
Change subject: flashchips.c: Add support for IS25WQ040
......................................................................
flashchips.c: Add support for IS25WQ040
Based on https://github.com/flashrom/flashrom/pull/204
squashed with fixes of IS25WQ040 size: it is 4Mbits, not 4MBytes, see
https://www.issi.com/WW/pdf/25WQ020-040.pdf
Tested read, write and erase with ft2232_spi-based "Tigard" programmer.
Change-Id: I072c6b94d7931637d1c2721c3316205f2d57320e
Signed-off-by: Roman Stingler <roman.stingler(a)gmail.com>
Signed-off-by: Vasily Galkin <galkin-vv(a)ya.ru>
---
M flashchips.c
M include/flashchips.h
2 files changed, 60 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/79/58179/5
--
To view, visit https://review.coreboot.org/c/flashrom/+/58179
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I072c6b94d7931637d1c2721c3316205f2d57320e
Gerrit-Change-Number: 58179
Gerrit-PatchSet: 5
Gerrit-Owner: Vasily Galkin
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: roman.stingler(a)gmail.com
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Vasily Galkin
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: roman.stingler(a)gmail.com
Gerrit-MessageType: newpatchset
Attention is currently required from: Felix Singer, Thomas Heijligen, roman.stingler(a)gmail.com.
Hello Felix Singer, build bot (Jenkins), Thomas Heijligen, roman.stingler(a)gmail.com,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/58179
to look at the new patch set (#4).
Change subject: flashchips.c: Add support for IS25WQ040
......................................................................
flashchips.c: Add support for IS25WQ040
Based on https://github.com/flashrom/flashrom/pull/204
squashed with fixes of IS25WQ040 size: it is 4Mbits, not 4MBytes, see
https://www.issi.com/WW/pdf/25WQ020-040.pdf
Tested read, write and erase with ft2232_spi-based "Tigard" programmer.
Change-Id: I072c6b94d7931637d1c2721c3316205f2d57320e
Signed-off-by: Roman Stingler <roman.stingler(a)gmail.com>
Signed-off-by: Vasily Galkin <galkin-vv(a)ya.ru>
---
M flashchips.c
M include/flashchips.h
2 files changed, 60 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/79/58179/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/58179
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I072c6b94d7931637d1c2721c3316205f2d57320e
Gerrit-Change-Number: 58179
Gerrit-PatchSet: 4
Gerrit-Owner: Vasily Galkin
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: roman.stingler(a)gmail.com
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: roman.stingler(a)gmail.com
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan, Angel Pons.
Sam McNally has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71576 )
Change subject: chipset_enable.c: Add TL UP3 and UP4/Y id's
......................................................................
Patch Set 1:
(1 comment)
File chipset_enable.c:
https://review.coreboot.org/c/flashrom/+/71576/comment/637d65cb_688eb081
PS1, Line 2083: {0x8086, 0xa083, B_S, DEP, "Intel", "Tiger Lake U Premium 3", enable_flash_pch500},
> Let's keep it, but mark it as untested (change `DEP` to `NT`).
Sure; going off the coreboot #define, I think this should be "Tiger Lake Base UP4" or "Tiger Lake U Base", depending on the naming scheme used for the others..
--
To view, visit https://review.coreboot.org/c/flashrom/+/71576
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I77120612f7a770ae1319f4cd82913fa465f355f5
Gerrit-Change-Number: 71576
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Elyes Haouas <ehaouas(a)noos.fr>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Fri, 06 Jan 2023 10:50:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sam McNally <sammc(a)google.com>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Edward O'Callaghan, Angel Pons.
Sam McNally has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71269 )
Change subject: programmer.h: Guard against sending spi commands on non-spi mst
......................................................................
Patch Set 2:
(1 comment)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/71269/comment/d2310077_4c7d1571
PS1, Line 1937: spi_master_no_4ba_modes
> sort of but not really. This is a chip bustype check not a master bustype check. […]
Could we skip this entire section on 4ba for non-SPI masters?
--
To view, visit https://review.coreboot.org/c/flashrom/+/71269
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7cce4f9c032d33c01bf616e27a50b9727a40fe1b
Gerrit-Change-Number: 71269
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Jonathon Hall <jonathon.hall(a)puri.sm>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-CC: Sam McNally <sammc(a)google.com>
Gerrit-CC: Subrata Banik <subratabanik(a)google.com>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Fri, 06 Jan 2023 10:48:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment