Peter Marheine has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/81606?usp=email )
Change subject: Make sleep threshold for delays configurable
......................................................................
Make sleep threshold for delays configurable
This allows the minimum time that default_delay() will choose to sleep
for instead of polling to be configured at build-time. The default
remains unchanged at 100 milliseconds for now.
Change-Id: Ida96e0816ac914ed69d6fd82ad90ebe89cdef1cc
Signed-off-by: Peter Marheine <pmarheine(a)chromium.org>
---
M Makefile
M meson.build
M meson_options.txt
M udelay.c
M udelay_dos.c
5 files changed, 15 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/06/81606/1
diff --git a/Makefile b/Makefile
index f8aa136..09b31b3 100644
--- a/Makefile
+++ b/Makefile
@@ -542,6 +542,8 @@
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
+CONFIG_DELAY_MINIMUM_SLEEP_US ?= 100000
+
# Disable all features if CONFIG_NOTHING=yes is given unless CONFIG_EVERYTHING was also set
ifeq ($(CONFIG_NOTHING), yes)
ifeq ($(CONFIG_EVERYTHING), yes)
@@ -587,6 +589,7 @@
endif
FEATURE_FLAGS += -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="$(CONFIG_DEFAULT_PROGRAMMER_ARGS)"'
+FEATURE_FLAGS += -D'CONFIG_DELAY_MINIMUM_SLEEP_US=$(CONFIG_DELAY_MINIMUM_SLEEP_US)'
################################################################################
diff --git a/meson.build b/meson.build
index 1c8316e..d4a5b9c 100644
--- a/meson.build
+++ b/meson.build
@@ -112,6 +112,9 @@
delay_src = files('udelay_dos.c')
endif
srcs += delay_src
+cargs += ['-DCONFIG_DELAY_MINIMUM_SLEEP_US=@0@'.format(
+ get_option('delay_minimum_sleep_us')
+)]
# check for required symbols
if cc.has_function('clock_gettime')
diff --git a/meson_options.txt b/meson_options.txt
index e62deb6..8a04114 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -22,3 +22,6 @@
option('documentation', type : 'feature', value : 'auto', description : 'build the html documentation')
option('ni845x_search_path', type : 'string', value : 'C:\Program Files (x86)\National Instruments\Ni-845x\MS Visual C',
description : 'Path to search for the proprietary ni845x library and header (32-bit Windows only)')
+option('delay_minimum_sleep_us', type : 'integer', min : 0, value : 100000,
+ description : 'Minimum time in microseconds to suspend execution for (rather than polling) when a delay is required.'
+ + ' Larger values may perform better on machines with low timer resolution, at the cost of increased power.')
diff --git a/udelay.c b/udelay.c
index 14900c7..85ed5b3 100644
--- a/udelay.c
+++ b/udelay.c
@@ -96,11 +96,10 @@
/* Precise delay. */
void default_delay(unsigned int usecs)
{
- /* 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 (usecs < CONFIG_DELAY_MINIMUM_SLEEP_US) {
clock_usec_delay(usecs);
+ } else {
+ internal_sleep(usecs);
}
}
diff --git a/udelay_dos.c b/udelay_dos.c
index 4a29f73..21ca9b8 100644
--- a/udelay_dos.c
+++ b/udelay_dos.c
@@ -158,14 +158,13 @@
{
static bool calibrated = false;
- /* 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 (usecs < CONFIG_DELAY_MINIMUM_SLEEP_US) {
if (!calibrated) {
myusec_calibrate_delay();
calibrated = true;
}
myusec_delay(usecs);
+ } else {
+ internal_sleep(usecs);
}
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/81606?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: Ida96e0816ac914ed69d6fd82ad90ebe89cdef1cc
Gerrit-Change-Number: 81606
Gerrit-PatchSet: 1
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Anastasia Klimchuk, Brian Norris, Thomas Heijligen.
Peter Marheine has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/81545?usp=email )
Change subject: udelay: only use OS time for delays, except on DOS
......................................................................
Patch Set 4:
This change is ready for review.
--
To view, visit https://review.coreboot.org/c/flashrom/+/81545?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: I7ac5450d194a475143698d65d64d8bcd2fd25e3f
Gerrit-Change-Number: 81545
Gerrit-PatchSet: 4
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Brian Norris <briannorris(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Brian Norris <briannorris(a)chromium.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Tue, 02 Apr 2024 00:25:18 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Dmitry Mikushin has abandoned this change. ( https://review.coreboot.org/c/flashrom/+/81604?usp=email )
Change subject: flashchips: Add support for Boya BY25D40
......................................................................
Abandoned
Not possible to rerun Jenkins after commit message change
--
To view, visit https://review.coreboot.org/c/flashrom/+/81604?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: I2b34090822370667640bffb291e8d56493d0da00
Gerrit-Change-Number: 81604
Gerrit-PatchSet: 2
Gerrit-Owner: Dmitry Mikushin <dmitry(a)kernelgen.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: abandon
Attention is currently required from: Anastasia Klimchuk, Dmitry Mikushin, Nikolai Artemiev, Stefan Reinauer.
Hello Anastasia Klimchuk, Nikolai Artemiev, Stefan Reinauer, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/81604?usp=email
to look at the new patch set (#2).
Change subject: flashchips: Add support for Boya BY25D40
......................................................................
flashchips: Add support for Boya BY25D40
Read tested on YW500U3M industrial camera
Change-Id: I2b34090822370667640bffb291e8d56493d0da00
Signed-off-by: Dmitry Mikushin <dmitry(a)kernelgen.org>
---
M flashchips.c
M include/flashchips.h
2 files changed, 41 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/04/81604/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/81604?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: I2b34090822370667640bffb291e8d56493d0da00
Gerrit-Change-Number: 81604
Gerrit-PatchSet: 2
Gerrit-Owner: Dmitry Mikushin <dmitry(a)kernelgen.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Dmitry Mikushin <dmitry(a)kernelgen.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newpatchset