Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/72966 )
Change subject: cli_classic.c: Drop spurious cast
......................................................................
cli_classic.c: Drop spurious cast
This cast should not be required.
Change-Id: Ia3a658dd6f4986eb6da84a11bce66f53e1571469
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/72966
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Sam McNally <sammc(a)google.com>
---
M cli_classic.c
1 file changed, 16 insertions(+), 2 deletions(-)
Approvals:
build bot (Jenkins): Verified
Sam McNally: Looks good to me, approved
diff --git a/cli_classic.c b/cli_classic.c
index c72836f..da68919 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -662,8 +662,7 @@
* chip when a flash device gets opened with fd 1 or 2.
*/
if (check_file(stdout) && check_file(stderr)) {
- flashrom_set_log_callback(
- (flashrom_log_callback *)&flashrom_print_cb);
+ flashrom_set_log_callback(&flashrom_print_cb);
}
print_version();
--
To view, visit https://review.coreboot.org/c/flashrom/+/72966
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia3a658dd6f4986eb6da84a11bce66f53e1571469
Gerrit-Change-Number: 72966
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Sam McNally <sammc(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Thomas Heijligen, Angel Pons, qianfan.
Nicholas Chin has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/70573 )
Change subject: ch347_spi.c: Add initial support for the WCH CH347
......................................................................
Patch Set 3:
(1 comment)
File ch347_spi.c:
https://review.coreboot.org/c/flashrom/+/70573/comment/8655d8f4_05c42a9d
PS3, Line 261: 64 * 1024
> With the CH347, you can basically read an unlimited amount of bytes with one command. […]
I was reading over some of Thomas's comments in CB:72057 (Patchset 19, lines 120 and 121) and it seems like these can be replaced with `MAX_DATA_READ_UNLIMITED` and `MAX_DATA_WRITE_UNLIMITED`
--
To view, visit https://review.coreboot.org/c/flashrom/+/70573
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I31b86c41076cc45d4a416a73fa1131350fb745ba
Gerrit-Change-Number: 70573
Gerrit-PatchSet: 3
Gerrit-Owner: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-CC: qianfan <qianfanguijin(a)163.com>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: qianfan <qianfanguijin(a)163.com>
Gerrit-Comment-Date: Thu, 16 Feb 2023 19:17:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Nicholas Chin <nic.c3.14(a)gmail.com>
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 20:
(1 comment)
File vl805.c:
https://review.coreboot.org/c/flashrom/+/72057/comment/9a49faa9_d7ad1c32
PS19, Line 91: curreadcnt = min(4, readcnt - j);
> I did this so it would compile, and its just what I did before, just a different name of course: […]
Ah right, I had a spurious `unsigned int` copied there
--
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: 20
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 19:15:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: ChrisEric1 CECL <christopherericlentocha(a)gmail.com>
Comment-In-Reply-To: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Nicholas Chin.
ChrisEric1 CECL 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:
(4 comments)
File vl805.c:
https://review.coreboot.org/c/flashrom/+/72057/comment/a9b7085d_e109fcab
PS19, Line 72: unsigned int curreadcnt;
> Delete, similar to what you did for curwritecnt before
Done
https://review.coreboot.org/c/flashrom/+/72057/comment/e65bea63_c89d74d8
PS19, Line 91: curreadcnt = min(4, readcnt - j);
> Change to `uint32_t unsigned int curreadcnt;`, similar to what you did for `curwritecnt` above
I did this so it would compile, and its just what I did before, just a different name of course:
uint32_t curreadcnt = min(4, readcnt - j);
https://review.coreboot.org/c/flashrom/+/72057/comment/caa1639e_84d7ca15
PS19, Line 120: 64 * 1024, /* Maximum data read size in one go (excluding opcode+address). */
> This can be `MAX_DATA_READ_UNLIMITED`
Done
https://review.coreboot.org/c/flashrom/+/72057/comment/8ae5bbce_5b956fe2
PS19, Line 121: 256, /* Maximum data write size in one go (excluding opcode+address). */
> This can be `MAX_DATA_WRITE_UNLIMITED`
Done
--
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: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Comment-Date: Thu, 16 Feb 2023 19:02:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Comment-In-Reply-To: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: ChrisEric1 CECL, Edward O'Callaghan.
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 (#20).
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, 214 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/57/72057/20
--
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: 20
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-MessageType: newpatchset
Thomas Heijligen has submitted this change. ( https://review.coreboot.org/c/flashrom/+/70571 )
(
7 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: serial: Add Darwin/macOS support for custom and >230400 baudrates
......................................................................
serial: Add Darwin/macOS support for custom and >230400 baudrates
This change is based on the patch proposed by Denis Ahrens in
https://review.coreboot.org/c/flashrom/+/67822
Change-Id: I3e6b88d2b4c2a130b16456752681fd9f807bf6f0
Signed-off-by: Peter Stuge <peter(a)stuge.se>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/70571
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Thomas Heijligen <src(a)posteo.de>
---
M Makefile
A custom_baud_darwin.c
M meson.build
M serial.c
4 files changed, 87 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Thomas Heijligen: Looks good to me, approved
diff --git a/Makefile b/Makefile
index 16af214..25c01e0 100644
--- a/Makefile
+++ b/Makefile
@@ -844,9 +844,13 @@
ifeq ($(TARGET_OS), Linux)
LIB_OBJS += custom_baud_linux.o
else
+ifeq ($(TARGET_OS), Darwin)
+LIB_OBJS += custom_baud_darwin.o
+else
LIB_OBJS += custom_baud.o
endif
endif
+endif
USE_SOCKETS := $(if $(call filter_deps,$(DEPENDS_ON_SOCKETS)),yes,no)
ifeq ($(USE_SOCKETS), yes)
diff --git a/custom_baud_darwin.c b/custom_baud_darwin.c
new file mode 100644
index 0000000..e8764dd
--- /dev/null
+++ b/custom_baud_darwin.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2022 Peter Stuge <peter(a)stuge.se>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <IOKit/serial/ioss.h>
+#include <errno.h>
+
+#include "custom_baud.h"
+
+int use_custom_baud(unsigned int baud, const struct baudentry *baudtable)
+{
+ int i;
+
+ if (baud > 230400)
+ return 1;
+
+ for (i = 0; baudtable[i].baud; i++) {
+ if (baudtable[i].baud == baud)
+ return 0;
+
+ if (baudtable[i].baud > baud)
+ return 1;
+ }
+
+ return 1;
+}
+
+int set_custom_baudrate(int fd, unsigned int baud, const enum custom_baud_stage stage, void *tio_wanted)
+{
+ struct termios *wanted;
+ speed_t speed;
+
+ switch (stage) {
+ case BEFORE_FLAGS:
+ break;
+
+ case WITH_FLAGS:
+ wanted = tio_wanted;
+ return cfsetspeed(wanted, B19200);
+
+ case AFTER_FLAGS:
+ speed = baud;
+ return ioctl(fd, IOSSIOSPEED, &speed);
+ }
+
+ return 0;
+}
diff --git a/meson.build b/meson.build
index 92c5590..2f11c3f 100644
--- a/meson.build
+++ b/meson.build
@@ -103,6 +103,8 @@
if host_machine.system() == 'linux'
custom_baud_c = 'custom_baud_linux.c'
+elif host_machine.system() == 'darwin'
+ custom_baud_c = 'custom_baud_darwin.c'
else
custom_baud_c = 'custom_baud.c'
endif
diff --git a/serial.c b/serial.c
index b9ce2b3..10d739a 100644
--- a/serial.c
+++ b/serial.c
@@ -47,6 +47,10 @@
* On Linux there is a non-standard way to use arbitrary baud rates that we use if there is no
* matching standard rate, see custom_baud.c
*
+ * On Darwin there is also a non-standard ioctl() to set arbitrary baud rates
+ * and any above 230400, see custom_baud_darwin.c and
+ * https://opensource.apple.com/source/IOSerialFamily/IOSerialFamily-91/tests/…
+ *
* On Windows there exist similar macros (starting with CBR_ instead of B) but they are only defined for
* backwards compatibility and the API supports arbitrary baud rates in the same manner as the macros, see
* http://msdn.microsoft.com/en-us/library/windows/desktop/aa363214(v=vs.85).a…
--
To view, visit https://review.coreboot.org/c/flashrom/+/70571
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3e6b88d2b4c2a130b16456752681fd9f807bf6f0
Gerrit-Change-Number: 70571
Gerrit-PatchSet: 9
Gerrit-Owner: Peter Stuge <peter(a)stuge.se>
Gerrit-Reviewer: Name of user not set #1004601
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged