Attention is currently required from: Anastasia Klimchuk, Brian Norris, Hsuan-ting Chen.
Hello Anastasia Klimchuk, Arthur Heymans, Edward O'Callaghan, Hsuan-ting Chen, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/79060?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Code-Review+1 by Anastasia Klimchuk, Code-Review+2 by Hsuan-ting Chen, Verified+1 by build bot (Jenkins)
Change subject: fmap: Update major/minor version check
......................................................................
fmap: Update major/minor version check
It's not valid to separately check the major and minor versions. The
proper minor check would be something like:
if (fmap->ver_major == FMAP_VER_MAJOR &&
fmap->ver_minor > FMAP_VER_MINOR)
ERROR();
But this code was alleged (at introduction in [1]) to have come from
cbfstool, and cbfstool doesn't bother with a minor version check. This
check is only for finding the FMAP while searching the flash; it isn't
actually here for integrity and compatibility purpose.
Drop the MINOR version check; align with cbfstool on the MAJOR version
check; and match the cbfstool comments for is_valid_fmap(), to emphasize
the lack of precision.
[1] Commit c82900b66142 ("Add support to get layout from fmap (e.g.
coreboot rom)")
BRANCH=none
BUG=b:288327526
TEST=libflashrom + ChromiumOS flashmap
Change-Id: I984835579d3b257a2462906f1f5091b179891bd0
Signed-off-by: Brian Norris <briannorris(a)chromium.org>
---
M fmap.c
1 file changed, 2 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/60/79060/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/79060?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I984835579d3b257a2462906f1f5091b179891bd0
Gerrit-Change-Number: 79060
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Norris <briannorris(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Brian Norris <briannorris(a)chromium.org>
Gerrit-Attention: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/81032?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: serprog: Fix scan-build warning of resource leak
......................................................................
serprog: Fix scan-build warning of resource leak
Warning found by the latest scan-build run:
*** CID 1534883: (RESOURCE_LEAK)
/serprog.c: 853 in serprog_init()
847 "by programmer!\n", cs_num8);
848 goto init_err_cleanup_exit;
849 }
850 }
851 bt = serprog_buses_supported;
852 if (sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL))
>>>CID 1534883: (RESOURCE_LEAK)
>>>Variable "cs" going out of scope leaks the storage it points to.
853 goto init_err_cleanup_exit;
854 }
Change-Id: Id9cf211de3c482f702adebfcfa274a183c83a33f
Signed-off-by: Anastasia Klimchuk <aklm(a)flashrom.org>
---
M serprog.c
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/32/81032/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/81032?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Id9cf211de3c482f702adebfcfa274a183c83a33f
Gerrit-Change-Number: 81032
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: Anastasia Klimchuk, Angel Pons, Thomas Heijligen.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/80729?usp=email )
Change subject: doc: Add doc how to support flashrom project
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/80729?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I59a4f5978bc8ffa8ca3a3dc3f15c770ef5fcedce
Gerrit-Change-Number: 80729
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
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: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Sat, 02 Mar 2024 00:55:16 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/80765?usp=email )
Change subject: doc: Add links to Gerrit groups in team page
......................................................................
doc: Add links to Gerrit groups in team page
Change-Id: I493db8c7b2610076136d439e172e3f2cee971346
Signed-off-by: Anastasia Klimchuk <aklm(a)flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/80765
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Patrick Georgi <patrick(a)coreboot.org>
---
M doc/about_flashrom/team.rst
1 file changed, 6 insertions(+), 3 deletions(-)
Approvals:
build bot (Jenkins): Verified
Patrick Georgi: Looks good to me, approved
diff --git a/doc/about_flashrom/team.rst b/doc/about_flashrom/team.rst
index 2c593ec..215d930 100644
--- a/doc/about_flashrom/team.rst
+++ b/doc/about_flashrom/team.rst
@@ -14,9 +14,11 @@
"flashrom reviewers" group
==========================
-Members of the group can do full approval of patches (i.e. vote +2).
+Members of the group (see `flashrom reviewers <https://review.coreboot.org/admin/groups/25cadc351dd0492fd2a2a1b1a8e5bb08c2…>`_)
+can do full approval of patches (i.e. vote +2).
-In general, members of the group have some area of responsibility in the MAINTAINERS file,
+In general, members of the group have some area of responsibility in the
+`MAINTAINERS <https://review.coreboot.org/plugins/gitiles/flashrom/+/refs/heads/main/MAIN…>`_ file,
and are automatically added as reviewers to patches when the patch touches this area.
The responsibilities are the following.
@@ -31,7 +33,8 @@
"flashrom developers" group
===========================
-Members of the group can merge patches.
+Members of the group (see `flashrom developers <https://review.coreboot.org/admin/groups/db95ce11b379445ac8c5806ea0b6119555…>`_)
+can merge patches.
The responsibilities for the members of the group are described in more details below.
There is no expectation on how much time you spend on your duties, some non-zero amount of time,
--
To view, visit https://review.coreboot.org/c/flashrom/+/80765?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I493db8c7b2610076136d439e172e3f2cee971346
Gerrit-Change-Number: 80765
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Brian Norris.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/79060?usp=email )
Change subject: fmap: Update major/minor version check
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/79060/comment/58eb0f9d_06d27983 :
PS2, Line 9: It's not valid to separately check the major and minor versions. The
: proper minor check would be something like:
:
: if (fmap->ver_major == FMAP_VER_MAJOR &&
: fmap->ver_minor > FMAP_VER_MINOR)
Brian, thank you so much for lots of details and links, this is really cool!
I thought more about it, and I think the patch is fine, please don't drop it :)
However, I found one gem in cbfstool code , which is a comment for the `is_valid_fmap` function,
/* Make a best-effort assessment if the given fmap is real */
If you could add this comment to the functions, that would be it! Thank you!
> I still think it's bad to leave flashrom as it is
This is so nice of you, I appreciate a lot!
--
To view, visit https://review.coreboot.org/c/flashrom/+/79060?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I984835579d3b257a2462906f1f5091b179891bd0
Gerrit-Change-Number: 79060
Gerrit-PatchSet: 2
Gerrit-Owner: Brian Norris <briannorris(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Brian Norris <briannorris(a)chromium.org>
Gerrit-Comment-Date: Fri, 01 Mar 2024 08:35:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Brian Norris <briannorris(a)chromium.org>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/80499?usp=email )
Change subject: serprog: clean up documentation
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS1:
> you can cc me on that, but no promises. this .rst thing is new to me anyway.
sure I understand!
I was going to do .rst thing (formatting, images, ref links etc), so that you can maybe read the text and see if it still looks correct, or updates needed. And one half of serprog documentation you read and updated already! (which is this patch!) I will copy the content of serprog-protocol and add formatting.
> if its side by side with categories "developers" and "users" my intuitive interpretation of the word "programmers" might not be the one intended.
That's a useful feedback, and meanwhile I got an idea #3 of "Supported hardware" as a top item and then Programmers inside. Anyways that will be my task, I will decide on something.
thank you so much for help!
--
To view, visit https://review.coreboot.org/c/flashrom/+/80499?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ic83e7fd80840f2db0b006935a964721da0388068
Gerrit-Change-Number: 80499
Gerrit-PatchSet: 4
Gerrit-Owner: Riku Viitanen <riku.viitanen(a)protonmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Fri, 01 Mar 2024 07:21:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Riku Viitanen <riku.viitanen(a)protonmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/80499?usp=email )
Change subject: serprog: clean up documentation
......................................................................
serprog: clean up documentation
* serprog.h doesn't exist, so refer to .c source instead
* in the doc, no other command has S_CMD_ prefix either
Change-Id: Ic83e7fd80840f2db0b006935a964721da0388068
Signed-off-by: Riku Viitanen <riku.viitanen(a)protonmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/80499
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M Documentation/serprog-protocol.txt
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Anastasia Klimchuk: Looks good to me, approved
build bot (Jenkins): Verified
diff --git a/Documentation/serprog-protocol.txt b/Documentation/serprog-protocol.txt
index d58b8e9..3d4aa1a 100644
--- a/Documentation/serprog-protocol.txt
+++ b/Documentation/serprog-protocol.txt
@@ -84,7 +84,7 @@
lower than the one requested. If there is no lower frequency
available the lowest possible should be used. The value
chosen is sent back in the reply with an ACK.
- 0x15 (S_CMD_S_PIN_STATE):
+ 0x15 (S_PIN_STATE):
Sets the state of the pin drivers connected to the flash chip. Disabling them allows other
devices (e.g. a mainboard's chipset) to access the chip. This way the serprog controller can
remain attached to the flash chip even when the board is running. The user is responsible to
@@ -103,4 +103,4 @@
In addition, support for these commands is recommended:
S_CMD_Q_PGMNAME, S_CMD_Q_BUSTYPE, S_CMD_Q_CHIPSIZE (if parallel).
-See also serprog.h.
+See also serprog.c
--
To view, visit https://review.coreboot.org/c/flashrom/+/80499?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ic83e7fd80840f2db0b006935a964721da0388068
Gerrit-Change-Number: 80499
Gerrit-PatchSet: 4
Gerrit-Owner: Riku Viitanen <riku.viitanen(a)protonmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/80498?usp=email )
Change subject: serprog: Add support for multiple SPI chip selects
......................................................................
serprog: Add support for multiple SPI chip selects
Tested with an EliteBook 8560w, Pi Pico, and my serprog firmware:
https://codeberg.org/Riku_V/pico-serprog/
As seen on Flashprog: https://review.sourcearcade.org/c/flashprog/+/51
Change-Id: If8052bc6f5c314dcc493bc083bb8270723efaae7
Signed-off-by: Riku Viitanen <riku.viitanen(a)protonmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/80498
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M Documentation/serprog-protocol.txt
M doc/classic_cli_manpage.rst
M serprog.c
3 files changed, 39 insertions(+), 1 deletion(-)
Approvals:
Anastasia Klimchuk: Looks good to me, approved
build bot (Jenkins): Verified
diff --git a/Documentation/serprog-protocol.txt b/Documentation/serprog-protocol.txt
index 6b7e7e3..d58b8e9 100644
--- a/Documentation/serprog-protocol.txt
+++ b/Documentation/serprog-protocol.txt
@@ -35,6 +35,7 @@
+ slen bytes of data
0x14 Set SPI clock frequency in Hz 32-bit requested frequency ACK + 32-bit set frequency / NAK
0x15 Toggle flash chip pin drivers 8-bit (0 disable, else enable) ACK / NAK
+0x16 Set SPI Chip Select 8-bit ACK / NAK
0x?? unimplemented command - invalid.
@@ -89,6 +90,9 @@
remain attached to the flash chip even when the board is running. The user is responsible to
NOT connect VCC and other permanently externally driven signals to the programmer as needed.
If the value is 0, then the drivers should be disabled, otherwise they should be enabled.
+ 0x16 (S_SPI_CS):
+ Set which SPI Chip Select pin to use. This operation is immediate,
+ meaning it doesn't use the operation buffer.
About mandatory commands:
The only truly mandatory commands for any device are 0x00, 0x01, 0x02 and 0x10,
but one can't really do anything with these commands.
diff --git a/doc/classic_cli_manpage.rst b/doc/classic_cli_manpage.rst
index 0cd45ca..c46edf6 100644
--- a/doc/classic_cli_manpage.rst
+++ b/doc/classic_cli_manpage.rst
@@ -741,6 +741,14 @@
flashrom -p serprog:dev=/dev/device:baud,spispeed=2M
+Optional ``cs`` parameter can be used to switch which chip select number is used. This allows connecting multiple
+chips at once and selecting which one to flash by software means (rather than rewiring)::
+
+ flashrom -p serprog:dev=/dev/device:baud,cs=0
+
+The particular programmer implementation needs to support this feature, for it to work. If the requested chip
+select isn't available, flashrom will fail safely.
+
More information about serprog is available in **serprog-protocol.txt** in the source distribution.
diff --git a/serprog.c b/serprog.c
index b51f0cf..c2965c5 100644
--- a/serprog.c
+++ b/serprog.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2009, 2011 Urja Rannikko <urjaman(a)gmail.com>
* Copyright (C) 2009 Carl-Daniel Hailfinger
+ * Copyright (C) 2024 Riku Viitanen <riku.viitanen(a)protonmail.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
@@ -63,6 +64,7 @@
#define S_CMD_O_SPIOP 0x13 /* Perform SPI operation. */
#define S_CMD_S_SPI_FREQ 0x14 /* Set SPI clock frequency */
#define S_CMD_S_PIN_STATE 0x15 /* Enable/disable output drivers */
+#define S_CMD_S_SPI_CS 0x16 /* Set SPI chip select to use */
#define MSGHEADER "serprog: "
@@ -742,7 +744,7 @@
/* Check for the minimum operational set of commands. */
if (serprog_buses_supported & BUS_SPI) {
uint8_t bt = BUS_SPI;
- char *spispeed;
+ char *spispeed, *cs;
if (sp_check_commandavail(S_CMD_O_SPIOP) == 0) {
msg_perr("Error: SPI operation not supported while the "
"bustype is SPI\n");
@@ -822,6 +824,30 @@
}
}
free(spispeed);
+ cs = extract_programmer_param_str(cfg, "cs");
+ if (cs && strlen(cs)) {
+ char *endptr = NULL;
+ errno = 0;
+ unsigned long cs_num = strtoul(cs, &endptr, 0);
+ if (errno || *endptr || cs_num > 255) {
+ msg_perr("Error: Invalid chip select requested! "
+ "Only 0-255 are valid.\n");
+ free(cs);
+ goto init_err_cleanup_exit;
+ }
+ free(cs);
+ if (!sp_check_commandavail(S_CMD_S_SPI_CS)) {
+ msg_perr("Error: Setting SPI chip select is not supported!\n");
+ goto init_err_cleanup_exit;
+ }
+ msg_pdbg(MSGHEADER "Requested to use chip select %lu.\n", cs_num);
+ uint8_t cs_num8 = cs_num;
+ if (sp_docommand(S_CMD_S_SPI_CS, 1, &cs_num8, 0, NULL)) {
+ msg_perr("Error: Chip select %u not supported "
+ "by programmer!\n", cs_num8);
+ goto init_err_cleanup_exit;
+ }
+ }
bt = serprog_buses_supported;
if (sp_docommand(S_CMD_S_BUSTYPE, 1, &bt, 0, NULL))
goto init_err_cleanup_exit;
--
To view, visit https://review.coreboot.org/c/flashrom/+/80498?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: If8052bc6f5c314dcc493bc083bb8270723efaae7
Gerrit-Change-Number: 80498
Gerrit-PatchSet: 4
Gerrit-Owner: Riku Viitanen <riku.viitanen(a)protonmail.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Brian Norris has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/80808?usp=email )
Change subject: udelay: Lower the sleep vs delay threshold
......................................................................
udelay: Lower the sleep vs delay threshold
By default, we busy-loop (a.k.a., "delay") for most delay values, and
only allow sleeping for large delays. But busy-looping is expensive, as
it wastes CPU cycles.
In a simple program that runs a bunch of samples of [1] over 1000
samples, I find that for 0.1 s (100000 us):
64x2 AMD CPU (CONFIG_HZ=250 / CONFIG_NO_HZ_FULL=y):
min diff: 60 us
max diff: 831 us
mean diff: 135 us
4+2 Mediatek MT8183 CPU (CONFIG_HZ=1000 / CONFIG_NO_HZ_IDLE=y /
sysctl kernel.timer_highres=1):
min diff: 70 us
max diff: 1556 us
mean diff: 146 us
4+2 Mediatek MT8183 CPU (CONFIG_HZ=1000 / CONFIG_NO_HZ_IDLE=y /
sysctl kernel.timer_highres=0):
min diff: 94 us
max diff: 7222 us
mean diff: 1201 us
i.e., maximum 1.5% error, typically ~0.1% error with high resolution
timers. Max 7% error, typical 1% error with low resolution timers.
This seems reasonable.
[1] Stripped / pseudocode:
clock_gettime(CLOCK_MONOTONIC, before);
nanosleep({ .tv_nsec = usecs * 1000 }, NULL);
clock_gettime(CLOCK_MONOTONIC, after);
diff = abs((after - before) / 1000 - usecs));
Change-Id: Ifd4821c66c5564f7c975c08769a6742f645e9be0
Signed-off-by: Brian Norris <briannorris(a)chromium.org>
---
M udelay.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/08/80808/1
diff --git a/udelay.c b/udelay.c
index 0005d39..c42de25 100644
--- a/udelay.c
+++ b/udelay.c
@@ -220,8 +220,8 @@
/* Precise delay. */
void default_delay(unsigned int usecs)
{
- /* If the delay is >1 s, use internal_sleep because timing does not need to be so precise. */
- if (usecs > 1000000) {
+ /* If the delay is >0.1 s, use internal_sleep because timing does not need to be so precise. */
+ if (usecs > 100000) {
internal_sleep(usecs);
} else if (use_clock_gettime) {
clock_usec_delay(usecs);
--
To view, visit https://review.coreboot.org/c/flashrom/+/80808?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ifd4821c66c5564f7c975c08769a6742f645e9be0
Gerrit-Change-Number: 80808
Gerrit-PatchSet: 1
Gerrit-Owner: Brian Norris <briannorris(a)chromium.org>
Gerrit-MessageType: newchange