Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/70569 )
Change subject: serial: Call set_custom_baudrate() thrice
......................................................................
serial: Call set_custom_baudrate() thrice
Call the function before tcsetattr() settings are known, then again
with settings prepared but not yet applied and finally a third time
after tcsetattr().
Darwin support needs this change; there custom_baud code must be
called to modify the settings passed to tcsetattr() and then again
after tcsetattr() returns.
The change should be non-functional on all currently supported systems;
current code calls set_custom_baudrate() before any tcsetattr()
settings are prepared, so we have three stages in total.
This change originates from discussion of the macOS patch proposed by
Denis Ahrens in https://review.coreboot.org/c/flashrom/+/67822
Change-Id: I40cc443cfb7bf6b212b31826d437b898cc13c427
Signed-off-by: Peter Stuge <peter(a)stuge.se>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/70569
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M custom_baud.c
M custom_baud_linux.c
M include/custom_baud.h
M serial.c
4 files changed, 55 insertions(+), 6 deletions(-)
Approvals:
build bot (Jenkins): Verified
Thomas Heijligen: Looks good to me, approved
diff --git a/custom_baud.c b/custom_baud.c
index 28f182c..8bbe6cc 100644
--- a/custom_baud.c
+++ b/custom_baud.c
@@ -19,7 +19,7 @@
#include "custom_baud.h"
/* Stub, should not get called. */
-int set_custom_baudrate(int fd, unsigned int baud)
+int set_custom_baudrate(int fd, unsigned int baud, const enum custom_baud_stage stage, void *tio_wanted)
{
errno = ENOSYS; /* Hoping "Function not supported" will make you look here. */
return -1;
diff --git a/custom_baud_linux.c b/custom_baud_linux.c
index 2d5f261..761d496 100644
--- a/custom_baud_linux.c
+++ b/custom_baud_linux.c
@@ -29,9 +29,13 @@
* for more info.
*/
-int set_custom_baudrate(int fd, unsigned int baud)
+int set_custom_baudrate(int fd, unsigned int baud, const enum custom_baud_stage stage, void *tio_wanted)
{
struct termios2 tio;
+
+ if (stage != BEFORE_FLAGS)
+ return 0;
+
if (ioctl(fd, TCGETS2, &tio)) {
return -1;
}
diff --git a/include/custom_baud.h b/include/custom_baud.h
index c8b8fc2..38e6cfc 100644
--- a/include/custom_baud.h
+++ b/include/custom_baud.h
@@ -22,7 +22,13 @@
unsigned int baud;
};
-int set_custom_baudrate(int fd, unsigned int baud);
+enum custom_baud_stage {
+ BEFORE_FLAGS = 0,
+ WITH_FLAGS,
+ AFTER_FLAGS
+};
+
+int set_custom_baudrate(int fd, unsigned int baud, const enum custom_baud_stage stage, void *tio_wanted);
/* Returns 1 if non-exact rate would be used, and setting a custom rate is supported.
The baudtable must be in ascending order and terminated with a 0-baud entry. */
diff --git a/serial.c b/serial.c
index a0ef632..b9ce2b3 100644
--- a/serial.c
+++ b/serial.c
@@ -179,6 +179,7 @@
}
msg_pdbg("Baud rate is %ld.\n", dcb.BaudRate);
#else
+ int custom_baud = (baud >= 0 && use_custom_baud(baud, sp_baudtable));
struct termios wanted, observed;
if (tcgetattr(fd, &observed) != 0) {
msg_perr_strerror("Could not fetch original serial port configuration: ");
@@ -186,8 +187,8 @@
}
wanted = observed;
if (baud >= 0) {
- if (use_custom_baud(baud, sp_baudtable)) {
- if (set_custom_baudrate(fd, baud)) {
+ if (custom_baud) {
+ if (set_custom_baudrate(fd, baud, BEFORE_FLAGS, NULL)) {
msg_perr_strerror("Could not set custom baudrate: ");
return 1;
}
@@ -198,7 +199,6 @@
msg_perr_strerror("Could not fetch serial port configuration: ");
return 1;
}
- msg_pdbg("Using custom baud rate.\n");
} else {
const struct baudentry *entry = round_baud(baud);
if (cfsetispeed(&wanted, entry->flag) != 0 || cfsetospeed(&wanted, entry->flag) != 0) {
@@ -212,6 +212,10 @@
wanted.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG | IEXTEN);
wanted.c_iflag &= ~(IXON | IXOFF | IXANY | ICRNL | IGNCR | INLCR);
wanted.c_oflag &= ~OPOST;
+ if (custom_baud && set_custom_baudrate(fd, baud, WITH_FLAGS, &wanted)) {
+ msg_perr_strerror("Could not set custom baudrate: ");
+ return 1;
+ }
if (tcsetattr(fd, TCSANOW, &wanted) != 0) {
msg_perr_strerror("Could not change serial port configuration: ");
return 1;
@@ -236,6 +240,13 @@
(long)observed.c_oflag, (long)wanted.c_oflag
);
}
+ if (custom_baud) {
+ if (set_custom_baudrate(fd, baud, AFTER_FLAGS, &wanted)) {
+ msg_perr_strerror("Could not set custom baudrate: ");
+ return 1;
+ }
+ msg_pdbg("Using custom baud rate.\n");
+ }
if (cfgetispeed(&observed) != cfgetispeed(&wanted) ||
cfgetospeed(&observed) != cfgetospeed(&wanted)) {
msg_pwarn("Could not set baud rates exactly.\n");
--
To view, visit https://review.coreboot.org/c/flashrom/+/70569
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I40cc443cfb7bf6b212b31826d437b898cc13c427
Gerrit-Change-Number: 70569
Gerrit-PatchSet: 5
Gerrit-Owner: Peter Stuge <peter(a)stuge.se>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Name of user not set #1004601
Gerrit-MessageType: merged
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/72056 )
(
4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Add missing Intel B460 flash chip id
......................................................................
Add missing Intel B460 flash chip id
Note that while I can read the chip, on my Lenovo Legion T5 28IMB05,
cannot write to the flash chip with any tools except upgrading with
vendor tool, no downgrades are allowed, due to the fact of SMM, even if
I did manage to flash the BIOS chip somehow, would still face bootguard
since this machine has bootguard. But if I read the chip, and verify my
read bin file, it works fine, until changing the SMBIOS, which is in
the vendor BIOS update package.
Change-Id: Id8fcb59d5dbafea3e79c4e3ad75484bbd163feca
Signed-off-by: Christopher Lentocha <christopherericlentocha(a)gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72056
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
Reviewed-by: Paul Menzel <paulepanter(a)mailbox.org>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M chipset_enable.c
1 file changed, 23 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Paul Menzel: Looks good to me, but someone else must approve
Thomas Heijligen: Looks good to me, approved
diff --git a/chipset_enable.c b/chipset_enable.c
index 480113a..e1dd6a3 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -2152,6 +2152,7 @@
{0x8086, 0xa30d, B_S, NT, "Intel", "HM370", enable_flash_pch300},
{0x8086, 0xa30e, B_S, DEP, "Intel", "CM246", enable_flash_pch300},
{0x8086, 0x3482, B_S, DEP, "Intel", "Ice Lake U Premium", enable_flash_pch300},
+ {0x8086, 0xa3c8, B_S, OK, "Intel", "B460", enable_flash_pch400},
{0x8086, 0x0684, B_S, NT, "Intel", "H470", enable_flash_pch400},
{0x8086, 0x0685, B_S, NT, "Intel", "Z490", enable_flash_pch400},
{0x8086, 0x0687, B_S, NT, "Intel", "Q470", enable_flash_pch400},
--
To view, visit https://review.coreboot.org/c/flashrom/+/72056
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id8fcb59d5dbafea3e79c4e3ad75484bbd163feca
Gerrit-Change-Number: 72056
Gerrit-PatchSet: 7
Gerrit-Owner: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-MessageType: merged
Attention is currently required from: Felix Singer, Edward O'Callaghan, Alex Badea.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73037 )
Change subject: asm106x: add programmer for ASM106x SATA controllers
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/73037
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I591b117be911bdb8249247c20530c1cf70f6e70d
Gerrit-Change-Number: 73037
Gerrit-PatchSet: 6
Gerrit-Owner: Alex Badea <vamposdecampos(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
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-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Alex Badea <vamposdecampos(a)gmail.com>
Gerrit-Comment-Date: Thu, 16 Feb 2023 17:20:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Edward O'Callaghan, Alex Badea.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/73037 )
Change subject: asm106x: add programmer for ASM106x SATA controllers
......................................................................
Patch Set 6: Verified+1
(1 comment)
Patchset:
PS6:
Tested successfully. Read write and erase with a puya spi flash found as "SFDP-capable". Same PCI-Id chip number combo as in the commit message.
--
To view, visit https://review.coreboot.org/c/flashrom/+/73037
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I591b117be911bdb8249247c20530c1cf70f6e70d
Gerrit-Change-Number: 73037
Gerrit-PatchSet: 6
Gerrit-Owner: Alex Badea <vamposdecampos(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
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-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Alex Badea <vamposdecampos(a)gmail.com>
Gerrit-Comment-Date: Thu, 16 Feb 2023 17:18:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: ChrisEric1 CECL, Edward O'Callaghan.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72057 )
Change subject: Add support for VIA VL805 USB Controller flashing
......................................................................
Patch Set 19: Verified+1
(3 comments)
Patchset:
PS19:
Tested successfully on the VIA Labs Inc. VIA VL805-QFN68 VL0127A reference card.
Read write and erase successfully on an MACRONIX MX25L1006E, recognized as "SFDP-capable chip" by flashrom
File vl805.c:
https://review.coreboot.org/c/flashrom/+/72057/comment/ee5f6706_b7c811fd
PS19, Line 120: 64 * 1024, /* Maximum data read size in one go (excluding opcode+address). */
This can be `MAX_DATA_READ_UNLIMITED`
https://review.coreboot.org/c/flashrom/+/72057/comment/698b01a2_f777a5f5
PS19, Line 121: 256, /* Maximum data write size in one go (excluding opcode+address). */
This can be `MAX_DATA_WRITE_UNLIMITED`
--
To view, visit https://review.coreboot.org/c/flashrom/+/72057
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I71435afcacdf97e14d627e35bce3d29de9657f38
Gerrit-Change-Number: 72057
Gerrit-PatchSet: 19
Gerrit-Owner: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Attention: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Thu, 16 Feb 2023 17:05:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: ChrisEric1 CECL, Thomas Heijligen, Edward O'Callaghan.
Nicholas Chin has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72057 )
Change subject: Add support for VIA VL805 USB Controller flashing
......................................................................
Patch Set 19:
(2 comments)
File vl805.c:
https://review.coreboot.org/c/flashrom/+/72057/comment/101f1f99_4fcc96a4
PS19, Line 72: unsigned int curreadcnt;
Delete, similar to what you did for curwritecnt before
https://review.coreboot.org/c/flashrom/+/72057/comment/a16670b1_8d7591ed
PS19, Line 91: curreadcnt = min(4, readcnt - j);
Change to `uint32_t unsigned int curreadcnt;`, similar to what you did for `curwritecnt` above
--
To view, visit https://review.coreboot.org/c/flashrom/+/72057
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I71435afcacdf97e14d627e35bce3d29de9657f38
Gerrit-Change-Number: 72057
Gerrit-PatchSet: 19
Gerrit-Owner: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Attention: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Thu, 16 Feb 2023 14:29:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: ChrisEric1 CECL, Thomas Heijligen, Nicholas Chin.
Hello build bot (Jenkins), Thomas Heijligen, Edward O'Callaghan,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/72057
to look at the new patch set (#19).
Change subject: Add support for VIA VL805 USB Controller flashing
......................................................................
Add support for VIA VL805 USB Controller flashing
It works fine for me on my Raspberry Pi 4 Model B. Was able read read,
erase, write, verify. Only thing is the WP with the W25X10 gives a
untested warning.
Change-Id: I71435afcacdf97e14d627e35bce3d29de9657f38
Signed-off-by: Christopher Lentocha <christopherericlentocha(a)gmail.com>
---
M Makefile
M flashrom.8.tmpl
M include/programmer.h
M meson.build
M meson_options.txt
M programmer_table.c
A vl805.c
7 files changed, 215 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/57/72057/19
--
To view, visit https://review.coreboot.org/c/flashrom/+/72057
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I71435afcacdf97e14d627e35bce3d29de9657f38
Gerrit-Change-Number: 72057
Gerrit-PatchSet: 19
Gerrit-Owner: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Attention: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan, Nikolai Artemiev, Anastasia Klimchuk.
Sergii Dmytruk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/69847 )
Change subject: writeprotect: Add function to get register values and WP bit masks
......................................................................
Patch Set 9: Code-Review+1
--
To view, visit https://review.coreboot.org/c/flashrom/+/69847
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib2a47153b230c9f82bb4eca357c335f2abbacc20
Gerrit-Change-Number: 69847
Gerrit-PatchSet: 9
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
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: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Thu, 16 Feb 2023 13:05:58 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment