Shiyu Sun has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/46623 )
Change subject: realtek_mst_i2c_spi.c: Introduce ISP enter param
......................................................................
realtek_mst_i2c_spi.c: Introduce ISP enter param
This is needed to avoid attempt entering ISP mode multiple
times. The ISP mode can only exit after a reset, so once the
reset MCU parameter is set to 0, the device will not able to
exit from ISP mode and hence shouldn't enter ISP again on
the next operation.
Without exit ISP mode, the device data, like firmware version,
will not show the correct value, this param will also help
to identify this situation.
Example on update a firmware with A/B udpate:
flashrom -p realtek_mst_i2c_spi:bus=x,reset-mcu=0,enter-isp=1 write fw
flashrom -p realtek_mst_i2c_spi:bus=x,reset-mcu=0,enter-isp=0 write flag
-> then either reset computer to allow update to take effect, or:
flashrom -p realtek_mst_i2c_spi:bus=x,reset-mcu=1,enter-isp=0 command
to trigger the update.
BUG=b:152558985,b:148745673
BRANCH=none
TEST=build
Signed-off-by: Shiyu Sun <sshiyu(a)chromium.org>
Change-Id: I58931ac8b42ab55829f102d243aea6fcfd632e3e
---
M realtek_mst_i2c_spi.c
1 file changed, 24 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/23/46623/1
diff --git a/realtek_mst_i2c_spi.c b/realtek_mst_i2c_spi.c
index 43cf25b..538b07a 100644
--- a/realtek_mst_i2c_spi.c
+++ b/realtek_mst_i2c_spi.c
@@ -432,10 +432,10 @@
return ret;
}
-static int get_params(int *i2c_bus, int *reset)
+static int get_params(int *i2c_bus, int *reset, int *enter_isp)
{
- char *bus_str = NULL, *reset_str = NULL;
- int ret = SPI_GENERIC_ERROR;
+ char *bus_str = NULL, *reset_str = NULL, *isp_str = NULL;
+ int ret = SPI_GENERIC_ERROR;
bus_str = extract_programmer_param("bus");
if (bus_str) {
@@ -478,6 +478,20 @@
*reset = 0; /* Default behaviour is no MCU reset on tear-down. */
free(reset_str);
+ isp_str = extract_programmer_param("enter-isp");
+ if (isp_str) {
+ if (isp_str[0] == '1')
+ *enter_isp = 1;
+ else if (isp_str[0] == '0')
+ *enter_isp = 0;
+ else {
+ msg_perr("%s: Incorrect param format, enter-isp=1 or 0.\n", __func__);
+ ret = SPI_GENERIC_ERROR;
+ }
+ } else
+ *enter_isp = 1; /* Default behaviour is enter ISP on setup. */
+ free(isp_str);
+
_get_params_failed:
if (bus_str)
free(bus_str);
@@ -488,18 +502,20 @@
int realtek_mst_i2c_spi_init(void)
{
int ret = 0;
- int i2c_bus = 0, reset = 0;
+ int i2c_bus = 0, reset = 0, enter_isp = 0;
- if (get_params(&i2c_bus, &reset))
+ if (get_params(&i2c_bus, &reset, &enter_isp))
return SPI_GENERIC_ERROR;
int fd = i2c_open(i2c_bus, REGISTER_ADDRESS, 0);
if (fd < 0)
return fd;
- ret |= realtek_mst_i2c_spi_enter_isp_mode(fd);
- if (ret)
- return ret;
+ if (enter_isp) {
+ ret |= realtek_mst_i2c_spi_enter_isp_mode(fd);
+ if (ret)
+ return ret;
+ }
struct realtek_mst_i2c_spi_data *data = calloc(1, sizeof(struct realtek_mst_i2c_spi_data));
if (!data) {
--
To view, visit https://review.coreboot.org/c/flashrom/+/46623
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I58931ac8b42ab55829f102d243aea6fcfd632e3e
Gerrit-Change-Number: 46623
Gerrit-PatchSet: 1
Gerrit-Owner: Shiyu Sun <sshiyu(a)google.com>
Gerrit-MessageType: newchange
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/46523 )
Change subject: dummyflasher.c: Use programmer logger functions
......................................................................
dummyflasher.c: Use programmer logger functions
All but three log messages use the programmer logger. Change the three
outliers that were using the chip logger accordingly.
Change-Id: Ia8668e05df2da739e6bb4c7d0fddad86e8d054a3
Signed-off-by: Angel Pons <th3fanbus(a)gmail.com>
---
M dummyflasher.c
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/23/46523/1
diff --git a/dummyflasher.c b/dummyflasher.c
index 6426ad2..d233db4 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -610,7 +610,7 @@
}
for (i = 0; i < data->spi_ignorelist_size; i++) {
if (writearr[0] == data->spi_ignorelist[i]) {
- msg_cdbg("Ignoring ignorelisted SPI command 0x%02x\n",
+ msg_pdbg("Ignoring ignorelisted SPI command 0x%02x\n",
data->spi_ignorelist[i]);
/* Return success because the command does not fail,
* it is simply ignored.
@@ -1050,7 +1050,7 @@
* Search "total_size * 1024" in code.
*/
flash->chip->total_size = emu_data->emu_chip_size / 1024;
- msg_cdbg("%s: set flash->total_size to %dK bytes.\n", __func__,
+ msg_pdbg("%s: set flash->total_size to %dK bytes.\n", __func__,
flash->chip->total_size);
/* Update the first count of each of the block_erasers. */
@@ -1061,7 +1061,7 @@
eraser->eraseblocks[0].count = 1;
eraser->eraseblocks[0].size = emu_data->emu_chip_size;
- msg_cdbg("%s: eraser.size=%d, .count=%d\n",
+ msg_pdbg("%s: eraser.size=%d, .count=%d\n",
__func__, eraser->eraseblocks[0].size,
eraser->eraseblocks[0].count);
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/46523
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia8668e05df2da739e6bb4c7d0fddad86e8d054a3
Gerrit-Change-Number: 46523
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newchange
Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/46325 )
Change subject: ichspi.c: ich7_run_opcode() fail early on transact error
......................................................................
ichspi.c: ich7_run_opcode() fail early on transact error
This patch is adapted from the ChromiumOS fork. While we no longer ship
and support the devices:
- Lenovo S10-t3,
- EEEPC,
- Alex and Mario.
I did however want to preserve the support for the community as the
right thing to do.
Downstream commit d2129f1cc036394fcf3c5232647a6e11eb1674fd
http://codereview.chromium.org/6698020
Change-Id: I93198cb8536705e9b71b7fbe43a20e151c2a72a8
Original-author-by: Louis Yung-Chieh Lo <yjlou(a)chromium.org>
Signed-off-by: Edward O'Callaghan <quasisec(a)google.com>
---
M ichspi.c
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/25/46325/1
diff --git a/ichspi.c b/ichspi.c
index 4209d60..3668a82 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -929,9 +929,11 @@
while (((REGREAD16(ICH7_REG_SPIS) & (SPIS_CDS | SPIS_FCERR)) == 0) &&
--timeout) {
programmer_delay(10);
+ if (REGREAD16(ICH7_REG_SPIS) & SPIS_FCERR)
+ break; /* Transaction error */
}
if (!timeout) {
- msg_perr("timeout, ICH7_REG_SPIS=0x%04x\n",
+ msg_perr("CDS timeout, ICH7_REG_SPIS=0x%04x\n",
REGREAD16(ICH7_REG_SPIS));
return 1;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/46325
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I93198cb8536705e9b71b7fbe43a20e151c2a72a8
Gerrit-Change-Number: 46325
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange
Daniel Verkamp has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/46310 )
Change subject: pcidev.c: populate IDs with pci_fill_info()
......................................................................
pcidev.c: populate IDs with pci_fill_info()
With pciutils 3.7.0, flashrom is unable to match any PCI devices by
vendor/device ID because the vendor_id and device_id fields of struct
pci_dev are not filled in.
Call pci_fill_info() to request these identifiers before trying to match
them against the supported device list.
With this change, reading/writing a nicintel_spi boot ROM is successful.
Signed-off-by: Daniel Verkamp <dverkamp(a)chromium.org>
Change-Id: Ia011d4d801f8a54160e45a70b14b740e6dcc00ef
---
M pcidev.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/10/46310/1
diff --git a/pcidev.c b/pcidev.c
index e13b78c..892f7b1 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -206,6 +206,7 @@
for (dev = pacc->devices; dev; dev = dev->next) {
if (pci_filter_match(&filter, dev)) {
+ pci_fill_info(dev, PCI_FILL_IDENT);
/* Check against list of supported devices. */
for (i = 0; devs[i].device_name != NULL; i++)
if ((dev->vendor_id == devs[i].vendor_id) &&
--
To view, visit https://review.coreboot.org/c/flashrom/+/46310
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia011d4d801f8a54160e45a70b14b740e6dcc00ef
Gerrit-Change-Number: 46310
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Verkamp <dverkamp(a)chromium.org>
Gerrit-MessageType: newchange