Peter Marheine has uploaded this change for review.

View Change

lspcon: restart MPU on programmer shutdown

Programmer initialization stops the on-chip MPU, and it was never
restarted. Leaving it stopped seems to prevent some display detection
from working, so implement restarting the MPU on programmer shutdown.

BUG=b:190359231
TEST=display hotplug works reliably after device communication

Change-Id: I66cd68f8f6905a2bfaf5b085bf08dcb218f42855
---
M lspcon_i2c_spi.c
1 file changed, 12 insertions(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/03/55403/1
diff --git a/lspcon_i2c_spi.c b/lspcon_i2c_spi.c
index 9f3bb9a..f8df9e4 100644
--- a/lspcon_i2c_spi.c
+++ b/lspcon_i2c_spi.c
@@ -327,6 +327,16 @@
return ret;
}

+static int lspcon_i2c_spi_start_mpu(int fd)
+{
+ int ret;
+ // Assert reset
+ if ((ret = lspcon_i2c_spi_write_register(fd, MPU, 0xc0)) != 0)
+ return ret;
+ // Release reset and start MPU
+ return lspcon_i2c_spi_write_register(fd, MPU, 0);
+}
+
static int lspcon_i2c_spi_map_page(int fd, unsigned int offset)
{
int ret = 0;
@@ -418,15 +428,16 @@
.write_aai = lspcon_i2c_spi_write_aai,
};

-/* TODO: MPU still stopped at this point, probably need to reset it. */
static int lspcon_i2c_spi_shutdown(void *data)
{
int ret = 0;
struct lspcon_i2c_spi_data *lspcon_data =
(struct lspcon_i2c_spi_data *)data;
int fd = lspcon_data->fd;
+
ret |= lspcon_i2c_spi_enable_write_protection(fd);
ret |= lspcon_i2c_spi_toggle_register_protection(fd, 0);
+ ret |= lspcon_i2c_spi_start_mpu(fd);
i2c_close(fd);
free(data);


To view, visit change 55403. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I66cd68f8f6905a2bfaf5b085bf08dcb218f42855
Gerrit-Change-Number: 55403
Gerrit-PatchSet: 1
Gerrit-Owner: Peter Marheine <pmarheine@chromium.org>
Gerrit-MessageType: newchange