Mike Banon has uploaded this change for review.

View Change

[v4,3/6] ENE EDI - add dummy read to ensure proper detection of ENE chips

ENE chips enable EDI by detecting a clock frequency between 1 MHz and 8 MHz.
In many cases, the chip won't be able to both detect the clock signal and
serve the associated request at the same time.

Thus, a dummy read has to be added to ensure that EDI is enabled and
operational starting from the next request.

Original patch has been created by Paul Kocialkowski, the previous version:
http://git.code.paulk.fr/gitweb/?p=flashrom.git;a=shortlog;h=refs/heads/next
Now it has been ported to the latest source code of flashrom master branch

Change-Id: I69ee71674649cd8ba4fc635f889cb39a1cd204b9
Signed-off-by: Mike Banon <mikebdp2@gmail.com>
---
M edi.c
1 file changed, 18 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/60/23260/1
diff --git a/edi.c b/edi.c
index 0ca1704..fde5ff1 100644
--- a/edi.c
+++ b/edi.c
@@ -163,6 +163,14 @@
return 0;
}

+static void edi_detect(struct flashctx *flash)
+{
+ unsigned char hwversion;
+
+ /* This dummy read ensures proper detection of EDI. */
+ edi_read(flash, ENE_EC_HWVERSION, &hwversion);
+}
+
static int edi_spi_enable(struct flashctx *flash)
{
unsigned char buffer;
@@ -481,6 +489,16 @@
int probe;
int rc;

+ /*
+ * ENE chips enable EDI by detecting a clock frequency between 1 MHz and
+ * 8 MHz. In many cases, the chip won't be able to both detect the clock
+ * signal and serve the associated request at the same time.
+ *
+ * Thus, a dummy read has to be added to ensure that EDI is enabled and
+ * operational starting from the next request.
+ */
+ edi_detect(flash);
+
probe = edi_chip_probe(flash, &ene_kb9012);
if (!probe)
return 0;

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I69ee71674649cd8ba4fc635f889cb39a1cd204b9
Gerrit-Change-Number: 23260
Gerrit-PatchSet: 1
Gerrit-Owner: Mike Banon <mikebdp2@gmail.com>