Attention is currently required from: Anastasia Klimchuk, Peter Marheine, Thomas Heijligen.
Brian Norris 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:
(2 comments)
File meson.build:
https://review.coreboot.org/c/flashrom/+/81545/comment/83756100_30849eb3 :
PS4, Line 121: DHAVE_NANOSLEEP=1
> I didn't find this to be ever defined in Makefile, is it right? I thought there would be something i […]
yeah, maybe something similar to the `Makefile.d/clock_gettime_test.c` test? frankly, it's easy to get lazy and incomplete [*] when there are two build systems, for some reason...
[*] speaking from experience
File udelay.c:
https://review.coreboot.org/c/flashrom/+/81545/comment/47ccbdf1_dd3d0200 :
PS4, Line 76: timeusec
I'm gonna say you probably didn't test this part 😜
--
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: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Tue, 02 Apr 2024 21:21:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Brian Norris, Peter Marheine, Thomas Heijligen.
Anastasia Klimchuk 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:
(4 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/81545/comment/77d2ad59_24d5233c :
PS4, Line 25:
For the patch like this, it would be useful to know what was tested, if you could add testing info here, at least from yourself, it would be great!
(whenever you will have such info, I understand it might be ready a bit later).
Patchset:
PS4:
Thank you so much for the patch!
File meson.build:
https://review.coreboot.org/c/flashrom/+/81545/comment/db72f8ed_b0a68bf9 :
PS4, Line 121: DHAVE_NANOSLEEP=1
I didn't find this to be ever defined in Makefile, is it right? I thought there would be something in Makefile too?
File udelay.c:
https://review.coreboot.org/c/flashrom/+/81545/comment/fc39ae6f_9e6f8054 :
PS4, Line 6: *
I think this counts as a significant change, maybe you want to add your copyright here?
--
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: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Comment-Date: Tue, 02 Apr 2024 08:34:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/81428?usp=email )
Change subject: serprog: Add SPI Mode and CS Mode commands
......................................................................
serprog: Add SPI Mode and CS Mode commands
This commit adds two new commands to the serprog protocol which allow
more fine grained control over the SPI bus. This enables more
applications over serprog like e.g. flashing AVR microcontrollers.
This can be tried with my forks of pico-serprog:
https://github.com/funkeleinhorn/pico-serprog/tree/spimode
and avrdude:
https://github.com/funkeleinhorn/avrgirl/tree/serprog-programmer
I announced this change in flashrom and flashprog IRC channels and got
overall positive feedback in the flashprog channel. The same changes
will be sent to flashprog to prevent diverging specs.
Change-Id: Idb5a9a3710fede322def5191d68b7fba0e135292
Signed-off-by: Funkeleinhorn <git(a)funkeleinhorn.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/81428
Reviewed-by: Anastasia Klimchuk <aklm(a)chromium.org>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M Documentation/serprog-protocol.txt
1 file changed, 17 insertions(+), 0 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 3d4aa1a..d001ceb 100644
--- a/Documentation/serprog-protocol.txt
+++ b/Documentation/serprog-protocol.txt
@@ -36,6 +36,8 @@
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
+0x17 Set SPI Mode 8-bit ACK / NAK
+0x18 Set CS Mode 8-bit ACK / NAK
0x?? unimplemented command - invalid.
@@ -93,6 +95,21 @@
0x16 (S_SPI_CS):
Set which SPI Chip Select pin to use. This operation is immediate,
meaning it doesn't use the operation buffer.
+ 0x17 (S_SPI_MODE):
+ Set which SPI Mode to use for 0x13 O_SPIOP commands.
+ This operation is immediate, meaning it doesn't use the operation buffer.
+ The current defined modes are:
+ 0x00: SPI Half Duplex (default)
+ 0x01: SPI Full Duplex
+ 0x18 (S_CS_MODE):
+ Set which CS Mode to use. The CS Mode determines the CS behaviour.
+ This allows manual control over the CS.
+ This operation is immediate, meaning it doesn't use the operation buffer.
+ The current defined modes are:
+ 0x00: CS Auto Mode. The CS gets selected before 0x13 O_SPIOP commands and
+ deselected afterwards. (default)
+ 0x01: CS Selected. The CS will be selected until another mode is set.
+ 0x02: CS Deselected. The CS will be deselected until another mode is set.
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.
--
To view, visit https://review.coreboot.org/c/flashrom/+/81428?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: Idb5a9a3710fede322def5191d68b7fba0e135292
Gerrit-Change-Number: 81428
Gerrit-PatchSet: 2
Gerrit-Owner: Funkeleinhorn <git(a)funkeleinhorn.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Urja Rannikko <urjaman(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: merged
Attention is currently required from: Funkeleinhorn, Urja Rannikko.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/81428?usp=email )
Change subject: serprog: Add SPI Mode and CS Mode commands
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I forgot to reply to:
> I didn't know about the Discord
There is a doc with all various way to talk to people: https://flashrom.org/contact.html you are welcome!
--
To view, visit https://review.coreboot.org/c/flashrom/+/81428?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: Idb5a9a3710fede322def5191d68b7fba0e135292
Gerrit-Change-Number: 81428
Gerrit-PatchSet: 1
Gerrit-Owner: Funkeleinhorn <git(a)funkeleinhorn.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Urja Rannikko <urjaman(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Urja Rannikko <urjaman(a)gmail.com>
Gerrit-Attention: Funkeleinhorn <git(a)funkeleinhorn.com>
Gerrit-Comment-Date: Tue, 02 Apr 2024 02:51:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Funkeleinhorn <git(a)funkeleinhorn.com>
Gerrit-MessageType: comment
Attention is currently required from: Anastasia Klimchuk, Brian Norris, Chen, Nikolai Artemiev, Stefan Reinauer.
Peter Marheine has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/80806?usp=email )
Change subject: udelay: clock_getres() does not provide clock_gettime() resolution
......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/80806/comment/7f4040c3_29a8c675 :
PS2, Line 10: Linux makes this clearer
> I've subscribed now, but there's no way to reply to messages that predate my subscription. […]
After looking at what kinds of delays things use in reality, I decided realtime priority wasn't necessary anyway. If there's insufficient agreement on how long we can reasonably sleep, that's why it's nice to make it configurable at build-time. The CL resulting from that proposal is https://review.coreboot.org/c/flashrom/+/81545
--
To view, visit https://review.coreboot.org/c/flashrom/+/80806?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: Icdc6e184eacb14d3bd27029e3fc75be4431d82b4
Gerrit-Change-Number: 80806
Gerrit-PatchSet: 3
Gerrit-Owner: Brian Norris <briannorris(a)chromium.org>
Gerrit-Reviewer: Chen <c(a)jia.je>
Gerrit-Reviewer: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Brian Norris <briannorris(a)chromium.org>
Gerrit-Attention: Chen <c(a)jia.je>
Gerrit-Attention: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Tue, 02 Apr 2024 02:22:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brian Norris <briannorris(a)chromium.org>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-MessageType: comment
Peter Marheine has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/81608?usp=email )
Change subject: reduce DELAY_MINIMUM_SLEEP_US to 100 by default
......................................................................
reduce DELAY_MINIMUM_SLEEP_US to 100 by default
This makes flashrom sleep more eagerly rather than busy-waiting,
observing that most delays in flashrom are either less than 100
microseconds (barely enough time to get any work done, even on a fast
machine) or much more than 1 millisecond (very wasteful to busy-loop).
Since we believe most systems offer good timer resolution that should
provide sleep latency on the order of 100 microseconds, this is a
reasonable default.
For DOS, the default is set to 50ms because the best available timing
source on DOS only ticks at about 20 Hz.
Signed-off-by: Peter Marheine <pmarheine(a)chromium.org>
Change-Id: I0f431d240c670446218b14811ef62a34e4c83da2
---
M Makefile
M meson_cross/i586_djgpp_dos.txt
M meson_options.txt
3 files changed, 4 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/08/81608/1
diff --git a/Makefile b/Makefile
index 09b31b3..71a7490 100644
--- a/Makefile
+++ b/Makefile
@@ -542,7 +542,7 @@
# Disable wiki printing by default. It is only useful if you have wiki access.
CONFIG_PRINT_WIKI ?= no
-CONFIG_DELAY_MINIMUM_SLEEP_US ?= 100000
+CONFIG_DELAY_MINIMUM_SLEEP_US ?= 100
# Disable all features if CONFIG_NOTHING=yes is given unless CONFIG_EVERYTHING was also set
ifeq ($(CONFIG_NOTHING), yes)
diff --git a/meson_cross/i586_djgpp_dos.txt b/meson_cross/i586_djgpp_dos.txt
index 66d5ed0..4a96e2e 100644
--- a/meson_cross/i586_djgpp_dos.txt
+++ b/meson_cross/i586_djgpp_dos.txt
@@ -25,5 +25,7 @@
[project options]
tests = 'disabled'
ich_descriptors_tool = 'disabled'
+# DOS time resolution is only about 50ms
+delay_minimum_sleep_us = 50000
[properties]
diff --git a/meson_options.txt b/meson_options.txt
index 8a04114..f5e2800 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -22,6 +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,
+option('delay_minimum_sleep_us', type : 'integer', min : 0, value : 100,
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.')
--
To view, visit https://review.coreboot.org/c/flashrom/+/81608?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: I0f431d240c670446218b14811ef62a34e4c83da2
Gerrit-Change-Number: 81608
Gerrit-PatchSet: 1
Gerrit-Owner: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-MessageType: newchange
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