summaryrefslogtreecommitdiff
path: root/config/flashprog/patches
diff options
context:
space:
mode:
Diffstat (limited to 'config/flashprog/patches')
-rw-r--r--config/flashprog/patches/0001-Workaround-for-MX25-chips.patch26
1 files changed, 15 insertions, 11 deletions
diff --git a/config/flashprog/patches/0001-Workaround-for-MX25-chips.patch b/config/flashprog/patches/0001-Workaround-for-MX25-chips.patch
index ddbe90a6..fc3befb1 100644
--- a/config/flashprog/patches/0001-Workaround-for-MX25-chips.patch
+++ b/config/flashprog/patches/0001-Workaround-for-MX25-chips.patch
@@ -1,4 +1,4 @@
-From 25047d86c478beb58fd7c9a3539b03ea9426edb6 Mon Sep 17 00:00:00 2001
+From 9d8c79eecf760e4f963a0a7f29b577cd84962a2a Mon Sep 17 00:00:00 2001
From: consts <grudnevkv@gmail.com>
Date: Fri, 2 Mar 2018 07:03:37 +0000
Subject: [PATCH 1/1] Workaround for MX25 chips
@@ -11,10 +11,10 @@ Chip: MX25L6405D
Tested-by: Riku Viitanen <riku.viitanen@protonmail.com>
Change-Id: I43a306b67862b59c1dcd02729e189f3bf73f481b
---
- cli_classic.c | 5 +++++
- include/programmer.h | 1 +
- spi.c | 9 +++++++++
- 3 files changed, 15 insertions(+)
+ cli_classic.c | 5 +++++
+ include/programmer.h | 1 +
+ spi.c | 11 ++++++++++-
+ 3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/cli_classic.c b/cli_classic.c
index ab5f8b1..2825033 100644
@@ -47,10 +47,10 @@ index ab5f8b1..2825033 100644
show_progress = true;
break;
diff --git a/include/programmer.h b/include/programmer.h
-index edef52b..722e599 100644
+index 873dc37..2007fd6 100644
--- a/include/programmer.h
+++ b/include/programmer.h
-@@ -356,6 +356,7 @@ enum ich_chipset {
+@@ -364,6 +364,7 @@ enum ich_chipset {
CHIPSET_GEMINI_LAKE,
CHIPSET_ELKHART_LAKE,
};
@@ -59,11 +59,11 @@ index edef52b..722e599 100644
/* ichspi.c */
#if CONFIG_INTERNAL == 1
diff --git a/spi.c b/spi.c
-index ac51d87..be62588 100644
+index 748ef99..9bbdee9 100644
--- a/spi.c
+++ b/spi.c
-@@ -26,10 +26,19 @@
- #include "programmer.h"
+@@ -27,13 +27,22 @@
+ #include "spi_command.h"
#include "spi.h"
+int workaround_mx; /* Make operations with MX25* chips more reliable */
@@ -72,12 +72,16 @@ index ac51d87..be62588 100644
unsigned int readcnt, const unsigned char *writearr,
unsigned char *readarr)
{
-+ if (workaround_mx) {
+- if (spi_current_io_mode(flash) != SINGLE_IO_1_1_1)
++ if (spi_current_io_mode(flash) != SINGLE_IO_1_1_1) {
+ return default_spi_send_command(flash, writecnt, readcnt, writearr, readarr);
++ } else if (workaround_mx) {
+ const unsigned char cmd[JEDEC_READ_OUTSIZE] = {JEDEC_READ, 0, 0, 0};
+ unsigned char buf[256];
+ /* keep flash busy for some time, keep CS warm before sending actual command */
+ flash->mst.spi->command(flash, sizeof(cmd), sizeof(buf), cmd, buf);
+ }
+
+ /* actual command */
return flash->mst.spi->command(flash, writecnt, readcnt, writearr,
readarr);