Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51706 )
Change subject: dediprog.c: Split up compound conditional statement
......................................................................
Patch Set 1:
(1 comment)
File dediprog.c:
https://review.coreboot.org/c/flashrom/+/51706/comment/6683d311_a2929819
PS1, Line 1276: if (register_spi_master(&spi_master_dediprog))
: return 1;
:
: return dediprog_set_leds(LED_NONE);
> Probably not worth to merge this as is if we are going […]
Returning back to this patch, because I think it is a very good idea to split compound conditional statement. Dediprog has changed a bit since March but compound statement is still present. I would really want to split it, and the last line can be `return register_spi_master(....)` as it is in most of spi masters now.
Those are technically two things: split compound statement and switch the order of two operations, can this be done in one patch, what do you think?
Another thing, Angel do you plan to work on this patch in the nearest future? It would be so great to do the last step for dediprog, so we can check it's "done", I am happy to do this, but of course I don't want to steal your work if you plan to do this!
Tell me if you want me to do this.
Thank you!!
--
To view, visit https://review.coreboot.org/c/flashrom/+/51706
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib7e0179da39279e32a8497466b044b69ec836da8
Gerrit-Change-Number: 51706
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 28 Sep 2021 23:50:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57889 )
Change subject: ch341a_spi: replace active kernel driver detaching by automatic one
......................................................................
Patch Set 4: Code-Review+1
(1 comment)
File ch341a_spi.c:
https://review.coreboot.org/c/flashrom/+/57889/comment/647804dc_23668dce
PS4, Line 452: \
This escapes the newline, but you still got the tabs in the string ^^
You can just end the string literal here and continue it later, as C will
concatenate the literals, i.e. "a" "b" "cde" is the same thing as "abcde".
So it could look like this:
msg_pwarn("Platform does not support detaching of USB kernel drivers.\n"
"If an unsupported driver is active, the claiming of the interface may fail.\n");
NB. If my English isn't failing, I think you can drop the "the" in "the claiming".
--
To view, visit https://review.coreboot.org/c/flashrom/+/57889
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If6f19744503055ab8e22c863b31e696808e0407d
Gerrit-Change-Number: 57889
Gerrit-PatchSet: 4
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Tue, 28 Sep 2021 22:07:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Nico Huber has submitted this change. ( https://review.coreboot.org/c/flashrom/+/57990 )
Change subject: custom_baud: move Linux specific code into own file
......................................................................
custom_baud: move Linux specific code into own file
Handle system specific code in an own file like i2c_helper_linux.c.
The build system decides when to build it.
Change-Id: I0744e769dcc6000483e7256105903a87e927ee77
Signed-off-by: Thomas Heijligen <thomas.heijligen(a)secunet.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/57990
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
---
M Makefile
M custom_baud.c
A custom_baud_linux.c
M meson.build
4 files changed, 69 insertions(+), 47 deletions(-)
Approvals:
build bot (Jenkins): Verified
Nico Huber: Looks good to me, approved
diff --git a/Makefile b/Makefile
index 19f8673..df67e0f 100644
--- a/Makefile
+++ b/Makefile
@@ -750,7 +750,12 @@
endif
ifneq ($(NEED_SERIAL), )
-LIB_OBJS += serial.o custom_baud.o
+LIB_OBJS += serial.o
+ifeq ($(TARGET_OS), Linux)
+LIB_OBJS += custom_baud_linux.o
+else
+LIB_OBJS += custom_baud.o
+endif
endif
ifneq ($(NEED_POSIX_SOCKETS), )
diff --git a/custom_baud.c b/custom_baud.c
index caf2b78..28f182c 100644
--- a/custom_baud.c
+++ b/custom_baud.c
@@ -14,52 +14,10 @@
* GNU General Public License for more details.
*/
-#include "platform.h"
-#include "custom_baud.h"
-
-#if IS_LINUX
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <asm-generic/termbits.h>
-#include <asm-generic/ioctls.h>
-
-/*
- * This include hell above is why this is in a separate source file. See eg.
- * https://www.downtowndougbrown.com/2013/11/linux-custom-serial-baud-rates/
- * https://stackoverflow.com/questions/12646324/how-to-set-a-custom-baud-rate-…
- * https://github.com/jbkim/Linux-custom-baud-rate
- * for more info.
- */
-
-int set_custom_baudrate(int fd, unsigned int baud)
-{
- struct termios2 tio;
- if (ioctl(fd, TCGETS2, &tio)) {
- return -1;
- }
- tio.c_cflag &= ~CBAUD;
- tio.c_cflag |= BOTHER;
- tio.c_ispeed = baud;
- tio.c_ospeed = baud;
- return ioctl(fd, TCSETS2, &tio);
-}
-
-int use_custom_baud(unsigned int baud, const struct baudentry *baudtable)
-{
- int i;
- for (i = 0; baudtable[i].baud; i++) {
- if (baudtable[i].baud == baud)
- return 0;
-
- if (baudtable[i].baud > baud)
- return 1;
- }
- return 1;
-}
-
-#else
#include <errno.h>
+#include "custom_baud.h"
+
/* Stub, should not get called. */
int set_custom_baudrate(int fd, unsigned int baud)
{
@@ -71,4 +29,3 @@
{
return 0;
}
-#endif
diff --git a/custom_baud_linux.c b/custom_baud_linux.c
new file mode 100644
index 0000000..2d5f261
--- /dev/null
+++ b/custom_baud_linux.c
@@ -0,0 +1,56 @@
+/*
+ * This file is part of the flashrom project.
+ *
+ * Copyright (C) 2017 Urja Rannikko <urjaman(a)gmail.com>
+ *
+ * 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 <sys/ioctl.h>
+#include <fcntl.h>
+#include <asm-generic/termbits.h>
+#include <asm-generic/ioctls.h>
+
+#include "custom_baud.h"
+
+/*
+ * This include hell above is why this is in a separate source file. See eg.
+ * https://www.downtowndougbrown.com/2013/11/linux-custom-serial-baud-rates/
+ * https://stackoverflow.com/questions/12646324/how-to-set-a-custom-baud-rate-…
+ * https://github.com/jbkim/Linux-custom-baud-rate
+ * for more info.
+ */
+
+int set_custom_baudrate(int fd, unsigned int baud)
+{
+ struct termios2 tio;
+ if (ioctl(fd, TCGETS2, &tio)) {
+ return -1;
+ }
+ tio.c_cflag &= ~CBAUD;
+ tio.c_cflag |= BOTHER;
+ tio.c_ispeed = baud;
+ tio.c_ospeed = baud;
+ return ioctl(fd, TCSETS2, &tio);
+}
+
+int use_custom_baud(unsigned int baud, const struct baudentry *baudtable)
+{
+ int i;
+ for (i = 0; baudtable[i].baud; i++) {
+ if (baudtable[i].baud == baud)
+ return 0;
+
+ if (baudtable[i].baud > baud)
+ return 1;
+ }
+ return 1;
+}
diff --git a/meson.build b/meson.build
index fcb11c6..1a36df8 100644
--- a/meson.build
+++ b/meson.build
@@ -323,8 +323,12 @@
# raw serial IO
if need_serial
- srcs += 'custom_baud.c'
srcs += 'serial.c'
+ if host_machine.system() == 'linux'
+ srcs += 'custom_baud_linux.c'
+ else
+ srcs += 'custom_baud.c'
+ endif
endif
prefix = get_option('prefix')
--
To view, visit https://review.coreboot.org/c/flashrom/+/57990
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0744e769dcc6000483e7256105903a87e927ee77
Gerrit-Change-Number: 57990
Gerrit-PatchSet: 5
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Thomas Heijligen, Angel Pons.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57990 )
Change subject: custom_baud: move Linux specific code into own file
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/57990
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0744e769dcc6000483e7256105903a87e927ee77
Gerrit-Change-Number: 57990
Gerrit-PatchSet: 4
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 28 Sep 2021 22:00:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Michael Niewöhner.
Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58012 )
Change subject: util: Add Nix shell file
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
> It's nice to have but not necessary.
coreboot repo also has one -> util/nixshell
--
To view, visit https://review.coreboot.org/c/flashrom/+/58012
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9757b952f4b034e98c2b4b70fbede52d8efb9d50
Gerrit-Change-Number: 58012
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Comment-Date: Tue, 28 Sep 2021 18:13:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Michael Niewöhner.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58012 )
Change subject: util: Add Nix shell file
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
Patchset:
PS2:
It's nice to have but not necessary.
--
To view, visit https://review.coreboot.org/c/flashrom/+/58012
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9757b952f4b034e98c2b4b70fbede52d8efb9d50
Gerrit-Change-Number: 58012
Gerrit-PatchSet: 2
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
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: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Comment-Date: Tue, 28 Sep 2021 16:14:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Nico Huber, Angel Pons.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58015 )
Change subject: Makefile: Move os.h code into the Makefile
......................................................................
Patch Set 2:
This change is ready for review.
--
To view, visit https://review.coreboot.org/c/flashrom/+/58015
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id911f17f4100f242e1fde10d23a8459ddf38b369
Gerrit-Change-Number: 58015
Gerrit-PatchSet: 2
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 28 Sep 2021 16:11:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment