Luka Kovacic has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/44162 )
Change subject: chipset_enable.c: Add support for Intel C620 Series Chipset SPI Controller
......................................................................
chipset_enable.c: Add support for Intel C620 Series Chipset SPI Controller
Support for the Intel C620 Series Chipset SPI Controller (rev 04) is added
to enable SPI flash access on the following platform:
- Intel Xeon D-2187NT
Support for this controller was shortly tested on the platform above.
The flash is recognized, some regions of the flash are locked.
Signed-off-by: Luka Kovacic <luka.kovacic(a)sartura.hr>
Tested-by: Jakov Petrina <jakov.petrina(a)sartura.hr>
Cc: Luka Perkov <luka.perkov(a)sartura.hr>
Change-Id: If39d9bb1acd4029f802a44a2940dd23f66ba09b1
---
M chipset_enable.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/62/44162/1
diff --git a/chipset_enable.c b/chipset_enable.c
index d56a547..4772a1c 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -2023,6 +2023,7 @@
{0x8086, 0xa153, B_S, NT, "Intel", "QM175", enable_flash_pch100},
{0x8086, 0xa154, B_S, NT, "Intel", "CM238", enable_flash_pch100},
{0x8086, 0xa155, B_S, NT, "Intel", "QMU185", enable_flash_pch100},
+ {0x8086, 0xa1a4, B_S, DEP, "Intel", "C620 Series Chipset (QS/PRQ)", enable_flash_c620},
{0x8086, 0xa1c0, B_S, NT, "Intel", "C620 Series Chipset (QS/PRQ)", enable_flash_c620},
{0x8086, 0xa1c1, B_S, NT, "Intel", "C621 Series Chipset (QS/PRQ)", enable_flash_c620},
{0x8086, 0xa1c2, B_S, NT, "Intel", "C622 Series Chipset (QS/PRQ)", enable_flash_c620},
--
To view, visit https://review.coreboot.org/c/flashrom/+/44162
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If39d9bb1acd4029f802a44a2940dd23f66ba09b1
Gerrit-Change-Number: 44162
Gerrit-PatchSet: 1
Gerrit-Owner: Luka Kovacic <luka.kovacic(a)sartura.hr>
Gerrit-MessageType: newchange
David Hendricks has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/30521
Change subject: dediprog: Use 4BA page program without 0x12
......................................................................
dediprog: Use 4BA page program without 0x12
It's not clear exactly what the difference is between
WRITE_MODE_4B_ADDR_256B_PAGE_PGM with and without _0x12 from the SF600
command spec, but the former seems to work more reliably.
Tested using an SF600 (FW v7.2.21), IS25LP256D, W25Q256JV, and
MX25L25735.
Change-Id: I3cb37ec8838f5bb02948ed52b4a2906fa033cf83
Signed-off-by: David Hendricks <david.hendricks(a)gmail.com>
---
M dediprog.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/21/30521/1
diff --git a/dediprog.c b/dediprog.c
index 2a190d2..303f1d5 100644
--- a/dediprog.c
+++ b/dediprog.c
@@ -398,7 +398,8 @@
}
} else if (dedi_spi_cmd == WRITE_MODE_PAGE_PGM) {
if (flash->chip->feature_bits & FEATURE_4BA_WRITE) {
- data_packet[3] = WRITE_MODE_4B_ADDR_256B_PAGE_PGM_0x12;
+// data_packet[3] = WRITE_MODE_4B_ADDR_256B_PAGE_PGM_0x12;
+ data_packet[3] = WRITE_MODE_4B_ADDR_256B_PAGE_PGM;
data_packet[4] = JEDEC_BYTE_PROGRAM_4BA;
use_4ba = true;
} else if (flash->in_4ba_mode) {
--
To view, visit https://review.coreboot.org/c/flashrom/+/30521
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3cb37ec8838f5bb02948ed52b4a2906fa033cf83
Gerrit-Change-Number: 30521
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-MessageType: newchange
Nikolai Artemiev has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/44562 )
Change subject: flashrom.c: do not delete programmer arguments
......................................................................
flashrom.c: do not delete programmer arguments
Make extract_param() leave parameters in tact rather than deleting
them as they are retrieved. Deleting them is undesierable as makes
the function more complex and requires that extract_programmer_param()
does not get called for the same parameter multiple times, which can
be difficult to gaurentee for some programmer initialization cases.
Change-Id: I9b1ec2d273c723fef8908e4ddf13b3079924f0a7
Signed-off-by: Nikolai Artemiev <nartemiev(a)google.com>
---
M flashrom.c
1 file changed, 0 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/62/44562/1
diff --git a/flashrom.c b/flashrom.c
index 4a30986..f3f0b46 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -750,11 +750,6 @@
}
strncpy(opt, opt_pos, optlen);
opt[optlen] = '\0';
- rest = opt_pos + optlen;
- /* Skip all delimiters after the current parameter. */
- rest += strspn(rest, delim);
- memmove(param_pos, rest, strlen(rest) + 1);
- /* We could shrink haystack, but the effort is not worth it. */
}
return opt;
--
To view, visit https://review.coreboot.org/c/flashrom/+/44562
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9b1ec2d273c723fef8908e4ddf13b3079924f0a7
Gerrit-Change-Number: 44562
Gerrit-PatchSet: 1
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-MessageType: newchange
Hrvoje Čavrak has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/44517 )
Change subject: udelay.c: Enable providing delay calibration value through CLI
......................................................................
udelay.c: Enable providing delay calibration value through CLI
This commit implements --get-loop-delay/--set-loop-delay options to
retrieve and provide the calibration loop delay through the command line.
The delay calibration procedure can take up to few seconds, which adds up
when executed a number of times consecutively. Therefore, this provides a
means to execute it only once, and then re-use the calibrated value on
subsequent runs. Also, it implements a sanity check, expecting the value
to land within 10% of the theoretical delay expectance, otherwise it
ignores the provided value and runs the calibration procedure instead.
Signed-off-by: Hrvoje Cavrak <hrvoje(a)hrvoje.org>
Change-Id: I7c9a491c5cb5fb3af56a691a0c6af9b53dcff550
---
M cli_classic.c
M flashrom.8.tmpl
M libflashrom.c
M programmer.h
M udelay.c
5 files changed, 60 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/17/44517/1
diff --git a/cli_classic.c b/cli_classic.c
index 967ff50..b023c45 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -63,6 +63,8 @@
" -o | --output <logfile> log output to <logfile>\n"
" --flash-contents <ref-file> assume flash contents to be <ref-file>\n"
" -L | --list-supported print supported devices\n"
+ " --set-loop-delay <value> set loop delay calibration manually\n"
+ " --get-loop-delay retrieve loop delay calibration\n"
#if CONFIG_PRINT_WIKI == 1
" -z | --list-supported-wiki print supported devices in wiki syntax\n"
#endif
@@ -118,6 +120,7 @@
int flash_name = 0, flash_size = 0;
int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
int dont_verify_it = 0, dont_verify_all = 0, list_supported = 0, operation_specified = 0;
+ unsigned long provided_delay = 0;
struct flashrom_layout *layout = NULL;
enum programmer prog = PROGRAMMER_INVALID;
enum {
@@ -127,6 +130,8 @@
OPTION_FLASH_CONTENTS,
OPTION_FLASH_NAME,
OPTION_FLASH_SIZE,
+ OPTION_GET_LOOP_DELAY,
+ OPTION_SET_LOOP_DELAY,
};
int ret = 0;
@@ -156,6 +161,8 @@
{"help", 0, NULL, 'h'},
{"version", 0, NULL, 'R'},
{"output", 1, NULL, 'o'},
+ {"get-loop-delay", 0, NULL, OPTION_GET_LOOP_DELAY},
+ {"set-loop-delay", 1, NULL, OPTION_SET_LOOP_DELAY},
{NULL, 0, NULL, 0},
};
@@ -365,6 +372,14 @@
}
#endif /* STANDALONE */
break;
+ case OPTION_GET_LOOP_DELAY:
+ /* Make it easy for scripts to parse this by omitting anything else */
+ msg_pinfo("%lu\n", get_calibration_value());
+ exit(0);
+ break;
+ case OPTION_SET_LOOP_DELAY:
+ provided_delay = strtoul(strdup(optarg), NULL, 0);
+ break;
default:
cli_classic_abort_usage(NULL);
break;
@@ -457,7 +472,10 @@
}
/* FIXME: Delay calibration should happen in programmer code. */
- myusec_calibrate_delay();
+ if (provided_delay)
+ set_external_calibration(provided_delay);
+ else
+ myusec_calibrate_delay(0);
if (programmer_init(prog, pparam)) {
msg_perr("Error: Programmer initialization failed.\n");
diff --git a/flashrom.8.tmpl b/flashrom.8.tmpl
index db50d59..4aada91 100644
--- a/flashrom.8.tmpl
+++ b/flashrom.8.tmpl
@@ -50,7 +50,7 @@
[\fB\-E\fR|\fB\-r\fR <file>|\fB\-w\fR <file>|\fB\-v\fR <file>]
[(\fB\-l\fR <file>|\fB\-\-ifd|\fB \-\-fmap\fR|\fB\-\-fmap-file\fR <file>) [\fB\-i\fR <image>]]
[\fB\-n\fR] [\fB\-N\fR] [\fB\-f\fR])]
- [\fB\-V\fR[\fBV\fR[\fBV\fR]]] [\fB-o\fR <logfile>]
+ [\fB\-V\fR[\fBV\fR[\fBV\fR]]] [\fB-o\fR <logfile>] [\fB-d\fR get | <value>]
.SH DESCRIPTION
.B flashrom
is a utility for detecting, reading, writing, verifying and erasing flash
@@ -364,6 +364,17 @@
.TP
.B "\-R, \-\-version"
Show version information and exit.
+.TP
+.B "\-\-get\-loop\-delay"
+Retrieve the loop calibration delay value or provide one externally. Calibrate
+delay procedure can take a few seconds and for repeated execution on a large
+number of hosts it can provide a significant overhead. By getting the value,
+it can later be provided by \-\-set\-loop\-delay
+.TP
+.B "\-\-set\-loop\-delay <value>"
+This argument makes it possible to provide the calibration delay through the
+command line option.
+
.SH PROGRAMMER-SPECIFIC INFORMATION
Some programmer drivers accept further parameters to set programmer-specific
parameters. These parameters are separated from the programmer name by a
diff --git a/libflashrom.c b/libflashrom.c
index ae2d33d..92e2527 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -51,7 +51,7 @@
{
if (perform_selfcheck && selfcheck())
return 1;
- myusec_calibrate_delay();
+ myusec_calibrate_delay(0);
return 0;
}
diff --git a/programmer.h b/programmer.h
index c5cab18..e0925e2 100644
--- a/programmer.h
+++ b/programmer.h
@@ -280,9 +280,11 @@
/* udelay.c */
void myusec_delay(unsigned int usecs);
-void myusec_calibrate_delay(void);
+void myusec_calibrate_delay(int force);
void internal_sleep(unsigned int usecs);
void internal_delay(unsigned int usecs);
+unsigned long get_calibration_value(void);
+void set_external_calibration(unsigned long external_micro);
#if CONFIG_INTERNAL == 1
/* board_enable.c */
diff --git a/udelay.c b/udelay.c
index 6c0efc4..698f1ca 100644
--- a/udelay.c
+++ b/udelay.c
@@ -133,9 +133,9 @@
return timeusec;
}
-void myusec_calibrate_delay(void)
+void myusec_calibrate_delay(int force)
{
- if (clock_check_res())
+ if (clock_check_res() && !force)
return;
unsigned long count = 1000;
@@ -221,6 +221,28 @@
msg_pinfo("OK.\n");
}
+void set_external_calibration(unsigned long external_micro)
+{
+ micro = external_micro;
+ unsigned long elapsed = measure_delay(100000);
+ /* Do a sanity check if the provided parameter makes loops fall
+ * within 10% of the desired value. Otherwise, ignore provided value
+ * and recalibrate.
+ */
+ if (elapsed > 90000 && elapsed < 110000)
+ msg_pinfo("Provided delay is acceptable!\n");
+ else {
+ msg_pinfo("Elapsed: %lu, provided delay is NOT acceptable!\n", elapsed);
+ myusec_calibrate_delay(1); /* Ignore using the system clock for loop timing */
+ }
+}
+
+unsigned long get_calibration_value(void)
+{
+ myusec_calibrate_delay(1); /* Ignore using the system clock for loop timing */
+ return micro;
+}
+
/* Not very precise sleep. */
void internal_sleep(unsigned int usecs)
{
@@ -250,7 +272,7 @@
#else
#include <libpayload.h>
-void myusec_calibrate_delay(void)
+void myusec_calibrate_delay(int force)
{
get_cpu_speed();
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/44517
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7c9a491c5cb5fb3af56a691a0c6af9b53dcff550
Gerrit-Change-Number: 44517
Gerrit-PatchSet: 1
Gerrit-Owner: Hrvoje Čavrak <github(a)hrvoje.org>
Gerrit-MessageType: newchange