Edward O'Callaghan has uploaded this change for review.
realtek_mst_i2c_spi.c: Implement wp
WIP/RFC
Change-Id: I8fe6a3b4e7a8637ec9215351f66f5b96054c550d
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M realtek_mst_i2c_spi.c
1 file changed, 30 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/83/64083/1
diff --git a/realtek_mst_i2c_spi.c b/realtek_mst_i2c_spi.c
index 954150d..4128cb1 100644
--- a/realtek_mst_i2c_spi.c
+++ b/realtek_mst_i2c_spi.c
@@ -432,6 +432,33 @@
return ret;
}
+static enum flashrom_wp_result realtek_mst_i2c_spi_wp_read_cfg(struct flashrom_wp_cfg *cfg, struct flashctx *flash)
+{
+ /* Not supported. */
+ return FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE;
+}
+
+static enum flashrom_wp_result realtek_mst_i2c_spi_wp_write_cfg(struct flashctx *flash, const struct flashrom_wp_cfg *cfg)
+{
+ struct realtek_mst_i2c_spi_data *realtek_mst_data =
+ (struct realtek_mst_i2c_spi_data *)data;
+ int fd = realtek_mst_data->fd;
+
+ int ret = realtek_mst_i2c_spi_toggle_gpio_88_strap(fd, (cfg->mode == FLASHROM_WP_MODE_DISABLED));
+ if (ret) {
+ msg_perr("Unable to toggle gpio 88 strap to True.\n");
+ return FLASHROM_WP_ERR_WRITE_FAILED;
+ }
+
+ return FLASHROM_WP_OK;
+}
+
+static enum flashrom_wp_result realtek_mst_i2c_spi_wp_get_available_ranges(struct flashrom_wp_ranges **list, struct flashctx *flash)
+{
+ /* Not supported. */
+ return FLASHROM_WP_ERR_RANGE_LIST_UNAVAILABLE;
+}
+
static const struct spi_master spi_master_i2c_realtek_mst = {
.max_data_read = 16,
.max_data_write = 8,
@@ -441,6 +468,9 @@
.write_256 = realtek_mst_i2c_spi_write_256,
.write_aai = realtek_mst_i2c_spi_write_aai,
.shutdown = realtek_mst_i2c_spi_shutdown,
+ .wp_read_cfg = realtek_mst_i2c_spi_wp_read_cfg,
+ .wp_write_cfg = realtek_mst_i2c_spi_wp_write_cfg,
+ .wp_get_ranges = realtek_mst_i2c_spi_wp_get_available_ranges,
};
static int get_params(int *reset, int *enter_isp)
To view, visit change 64083. To unsubscribe, or for help writing mail filters, visit settings.