Attention is currently required from: Nikolai Artemiev.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58482 )
Change subject: [RFC] writeprotect: implement wp_{get,set}_range()
......................................................................
Patch Set 6:
(1 comment)
Patchset:
PS6:
So a very basic question: Why add it to the existing CLI that
is about reading/writing data and not configuration? I guess
a separate tool that handles only block protection (or write
protection or flash configuration in general) would be much
easier to maintain.
No matter where the UI parts end up, I would much prefer to
only call libflashrom functions from any CLI code. Using
internal APIs directly turned into havoc in the past :-/
--
To view, visit https://review.coreboot.org/c/flashrom/+/58482
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7d26f43fb05c5828b9839bb57a28fa1088dcd9a0
Gerrit-Change-Number: 58482
Gerrit-PatchSet: 6
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Sun, 31 Oct 2021 15:33:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/58776 )
Change subject: [TESTME]sb600spi: Remove memory-mapped read workaround
......................................................................
[TESTME]sb600spi: Remove memory-mapped read workaround
The actual reasons for this workaround are unknown and it bricks systems
with >16MiB chips. The controller has support to restrict the available
commands to a specific set of opcodes. So it seems possible that an in-
compatible set of commands was locked during testing.
With this patch applied, flashrom would try to use the actual SPI read
command for reading. When the set of allowed opcodes is not locked, it
might even work for >16MiB (then, flashrom could use extended-address
register commands to access pages of 16MiB).
Change-Id: I67f9ca0cd88de35953d988ab51b4b5f485085f49
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M sb600spi.c
1 file changed, 1 insertion(+), 33 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/76/58776/1
diff --git a/sb600spi.c b/sb600spi.c
index 7fa01af..ba3786f 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -53,7 +53,6 @@
#define FIFO_SIZE_YANGTZE 71
struct sb600spi_data {
- struct flashctx *flash;
uint8_t *spibar;
};
@@ -556,25 +555,8 @@
return amd_imc_shutdown(dev);
}
-static int promontory_read_memmapped(struct flashctx *flash, uint8_t *buf,
- unsigned int start, unsigned int len)
-{
- struct sb600spi_data * data = (struct sb600spi_data *)flash->mst->spi.data;
- if (!data->flash) {
- map_flash(flash);
- data->flash = flash; /* keep a copy of flashctx for unmap() on tear-down. */
- }
- mmio_readn((void *)(flash->virtual_memory + start), buf, len);
- return 0;
-}
-
static int sb600spi_shutdown(void *data)
{
- struct sb600spi_data *sb600_data = data;
- struct flashctx *flash = sb600_data->flash;
- if (flash)
- finalize_flash_access(flash);
-
free(data);
return 0;
}
@@ -601,17 +583,6 @@
.shutdown = sb600spi_shutdown,
};
-static const struct spi_master spi_master_promontory = {
- .max_data_read = MAX_DATA_READ_UNLIMITED,
- .max_data_write = FIFO_SIZE_YANGTZE - 3,
- .command = spi100_spi_send_command,
- .multicommand = default_spi_send_multicommand,
- .read = promontory_read_memmapped,
- .write_256 = default_spi_write_256,
- .write_aai = default_spi_write_aai,
- .shutdown = sb600spi_shutdown,
-};
-
int sb600_probe_spi(struct pci_dev *dev)
{
struct pci_dev *smbus_dev;
@@ -784,16 +755,13 @@
return SPI_GENERIC_ERROR;
}
- data->flash = NULL;
data->spibar = sb600_spibar;
/* Starting with Yangtze the SPI controller got a different interface with a much bigger buffer. */
if (amd_gen < CHIPSET_YANGTZE)
register_spi_master(&spi_master_sb600, data);
- else if (amd_gen == CHIPSET_YANGTZE)
- register_spi_master(&spi_master_yangtze, data);
else
- register_spi_master(&spi_master_promontory, data);
+ register_spi_master(&spi_master_yangtze, data);
return 0;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/58776
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I67f9ca0cd88de35953d988ab51b4b5f485085f49
Gerrit-Change-Number: 58776
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: newchange