diff options
Diffstat (limited to 'config/flashprog/patches')
-rw-r--r-- | config/flashprog/patches/0001-Workaround-for-MX25-chips.patch | 44 | ||||
-rw-r--r-- | config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch | 48 |
2 files changed, 72 insertions, 20 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..f7b9ad79 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 9d7b97a0f08a3f0f62c389aee61e92377d82d645 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,16 +11,16 @@ 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 +index 26253dc..5a80394 100644 --- a/cli_classic.c +++ b/cli_classic.c -@@ -67,6 +67,7 @@ static void cli_classic_usage(const char *name) +@@ -68,6 +68,7 @@ static void cli_classic_usage(const char *name) " -o | --output <logfile> log output to <logfile>\n" " --flash-contents <ref-file> assume flash contents to be <ref-file>\n" " -L | --list-supported print supported devices\n" @@ -28,7 +28,7 @@ index ab5f8b1..2825033 100644 #if CONFIG_PRINT_WIKI == 1 " -z | --list-supported-wiki print supported devices in wiki syntax\n" #endif -@@ -262,6 +263,7 @@ int main(int argc, char *argv[]) +@@ -231,6 +232,7 @@ int flashprog_classic_main(int argc, char *argv[]) {"version", 0, NULL, 'R'}, {"output", 1, NULL, 'o'}, {"progress", 0, NULL, OPTION_PROGRESS}, @@ -36,9 +36,9 @@ index ab5f8b1..2825033 100644 {NULL, 0, NULL, 0}, }; -@@ -478,6 +480,9 @@ int main(int argc, char *argv[]) - cli_classic_abort_usage("No log filename specified.\n"); - } +@@ -357,6 +359,9 @@ int flashprog_classic_main(int argc, char *argv[]) + cli_classic_usage(argv[0]); + exit(0); break; + case 'm': /* --workaround-mx */ + workaround_mx = 1; @@ -47,23 +47,23 @@ index ab5f8b1..2825033 100644 show_progress = true; break; diff --git a/include/programmer.h b/include/programmer.h -index edef52b..722e599 100644 +index 11d15a8..3b33d5a 100644 --- a/include/programmer.h +++ b/include/programmer.h -@@ -356,6 +356,7 @@ enum ich_chipset { - CHIPSET_GEMINI_LAKE, - CHIPSET_ELKHART_LAKE, +@@ -372,6 +372,7 @@ enum ich_chipset { + CHIPSET_LUNAR_LAKE, + CHIPSET_ARROW_LAKE, }; +extern int workaround_mx; /* workaround for MX25* chips, makes flash operations more reliable, less failures */ /* 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,16 +72,20 @@ 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); } -- -2.39.2 +2.39.5 diff --git a/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch b/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch new file mode 100644 index 00000000..d2702d23 --- /dev/null +++ b/config/flashprog/patches/0002-lbmk-hack-add-config-Makefile-options.patch @@ -0,0 +1,48 @@ +From b7a4d2907d3358173510aa6e31af08afe4969b38 Mon Sep 17 00:00:00 2001 +From: Leah Rowe <leah@libreboot.org> +Date: Thu, 22 May 2025 11:25:42 +0100 +Subject: [PATCH 1/1] lbmk hack: add config Makefile options + +this prevents a build error when running the +-u, -m, -s, -l and -n options in lbmk without +argument. + +this makes no functional changes to flashprog. + +Signed-off-by: Leah Rowe <leah@libreboot.org> +--- + Makefile | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 12adf61..701f842 100644 +--- a/Makefile ++++ b/Makefile +@@ -1113,7 +1113,23 @@ libpayload: clean + gitconfig: + ./util/getrevision.sh -c 2>/dev/null && ./util/git-hooks/install.sh + +-.PHONY: all install clean distclean config branch tag versioninfo _export export tarball libpayload gitconfig ++oldconfig: ++ : ++ ++menuconfig: ++ : ++ ++savedefconfig: ++ : ++ ++olddefconfig: ++ : ++ ++nconfig: ++ : ++ ++ ++.PHONY: all install clean distclean config branch tag versioninfo _export export tarball libpayload gitconfig oldconfig menuconfig savedefconfig olddefconfig nconfig + + # Disable implicit suffixes and built-in rules (for performance and profit) + .SUFFIXES: +-- +2.39.5 + |