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 3: Code-Review+1
(2 comments)
File custom_baud.c:
https://review.coreboot.org/c/flashrom/+/57990/comment/bb0f618e_8eb8eadc
PS3, Line 17: #include "custom_baud.h"
I guess this was only on top because of the #if later. Generally <> includes
should come first.
File custom_baud_linux.c:
https://review.coreboot.org/c/flashrom/+/57990/comment/1eb8722f_4ce046b6
PS3, Line 17: #include "custom_baud.h"
Same here, please move blow the <> includes.
--
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: 3
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 10:41:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57889 )
Change subject: ch341a_spi: libusb functions can handle all platforms
......................................................................
Patch Set 1: Code-Review+1
(3 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/57889/comment/b44df413_4d84e56f
PS1, Line 7: libusb functions can handle all platforms
This should be a statement about the code change, e.g.
Call libusb_detach_kernel_driver() on all platforms
File ch341a_spi.c:
https://review.coreboot.org/c/flashrom/+/57889/comment/57e5f92d_df2a2c3c
PS1, Line 450: Other platforms return
How about "Other platforms may return..."?
https://review.coreboot.org/c/flashrom/+/57889/comment/0006100a_91b0ff22
PS1, Line 450: /* libusb_detach_kernel_driver() is only available on linux. Other platforms return
: * LIBUSB_ERROR_NOT_SUPPORTED. That's fine. */
Please indent, it was only at level 0 because of the #if there.
--
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: 1
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: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Tue, 28 Sep 2021 10:31:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Nico Huber, Thomas Heijligen.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57942 )
Change subject: internal.c: unify the macro for x86 only code
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
Patchset:
PS1:
> I'd looked for the most widespread variant for x86 only code. […]
Ack
--
To view, visit https://review.coreboot.org/c/flashrom/+/57942
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I94a599431f58666189c8cd601286e9b30c8bf62b
Gerrit-Change-Number: 57942
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: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Mon, 27 Sep 2021 13:41:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Thomas Heijligen.
Hello Nico Huber, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/57990
to look at the new patch set (#3).
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>
---
M Makefile
M custom_baud.c
A custom_baud_linux.c
M meson.build
4 files changed, 67 insertions(+), 45 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/90/57990/3
--
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: 3
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-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newpatchset
Thomas Heijligen has uploaded a new patch set (#2). ( 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
Handling 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>
---
M Makefile
M custom_baud.c
A custom_baud_linux.c
M meson.build
4 files changed, 67 insertions(+), 45 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/90/57990/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: 2
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newpatchset
Thomas Heijligen has uploaded this change for review. ( 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
Handling 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>
---
M Makefile
M custom_baud.c
A custom_baud_linux.c
M meson.build
4 files changed, 68 insertions(+), 44 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/90/57990/1
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..901a654 100644
--- a/custom_baud.c
+++ b/custom_baud.c
@@ -17,47 +17,6 @@
#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>
/* Stub, should not get called. */
@@ -71,4 +30,3 @@
{
return 0;
}
-#endif
diff --git a/custom_baud_linux.c b/custom_baud_linux.c
new file mode 100644
index 0000000..8d8e786
--- /dev/null
+++ b/custom_baud_linux.c
@@ -0,0 +1,57 @@
+/*
+ * 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 "platform.h"
+#include "custom_baud.h"
+
+#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;
+}
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: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Michał Żygowski, Jonathan Zhang, David Hendricks.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57793 )
Change subject: ich_descriptors: Add explicit checks for all chipsets
......................................................................
Patch Set 4: Code-Review+1
--
To view, visit https://review.coreboot.org/c/flashrom/+/57793
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ica49477492876810a6fa212768b1ab9e8c12001f
Gerrit-Change-Number: 57793
Gerrit-PatchSet: 4
Gerrit-Owner: David Hendricks
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Jonathan Zhang <jonzhang(a)fb.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Attention: Jonathan Zhang <jonzhang(a)fb.com>
Gerrit-Attention: David Hendricks
Gerrit-Comment-Date: Mon, 27 Sep 2021 13:08:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment