diff options
Diffstat (limited to 'config/coreboot/default/patches/0005-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch')
| -rw-r--r-- | config/coreboot/default/patches/0005-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/config/coreboot/default/patches/0005-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch b/config/coreboot/default/patches/0005-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch index b7b514cd..1a300e11 100644 --- a/config/coreboot/default/patches/0005-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch +++ b/config/coreboot/default/patches/0005-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch @@ -1,7 +1,7 @@ -From d2f579b82921c2c35e4cf756db0ca476fbadfac1 Mon Sep 17 00:00:00 2001 +From a3bc9753261ebd534df6c6752169b3edbb588a97 Mon Sep 17 00:00:00 2001 From: Leah Rowe <info@minifree.org> Date: Sun, 19 Feb 2023 18:21:43 +0000 -Subject: [PATCH 05/51] util/ifdtool: add --nuke flag (all 0xFF on region) +Subject: [PATCH 05/41] util/ifdtool: add --nuke flag (all 0xFF on region) When this option is used, the region's contents are overwritten with all ones (0xFF). @@ -16,22 +16,22 @@ Rebased since the last revision update in lbmk. Signed-off-by: Leah Rowe <leah@libreboot.org> --- - util/ifdtool/ifdtool.c | 114 ++++++++++++++++++++++++++++++----------- - 1 file changed, 83 insertions(+), 31 deletions(-) + util/ifdtool/ifdtool.c | 116 +++++++++++++++++++++++++++++------------ + 1 file changed, 84 insertions(+), 32 deletions(-) diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c -index 32b2081d93..1473cf058b 100644 +index 75238c73b2..ea8dfc788d 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c -@@ -2204,6 +2204,7 @@ static void print_usage(const char *name) +@@ -2240,6 +2240,7 @@ static void print_usage(const char *name) " tgl - Tiger Lake\n" " wbg - Wellsburg\n" " -S | --setpchstrap Write a PCH strap\n" + " -N | --nuke <region> Overwrite the specified region with 0xFF (all ones)\n" " -V | --newvalue The new value to write into PCH strap specified by -S\n" - " -v | --version: print the version\n" - " -h | --help: print this help\n\n" -@@ -2212,6 +2213,60 @@ static void print_usage(const char *name) + " -T | --topswapsize Set the Top Swap Block Size PCH strap value\n" + " Possible values: 0x10000, 0x20000, 0x40000, 0x80000,\n" +@@ -2251,6 +2252,60 @@ static void print_usage(const char *name) "\n"); } @@ -92,23 +92,23 @@ index 32b2081d93..1473cf058b 100644 int main(int argc, char *argv[]) { int opt, option_index = 0; -@@ -2219,6 +2274,7 @@ int main(int argc, char *argv[]) +@@ -2258,6 +2313,7 @@ int main(int argc, char *argv[]) int mode_em100 = 0, mode_locked = 0, mode_unlocked = 0, mode_validate = 0; int mode_layout = 0, mode_newlayout = 0, mode_density = 0, mode_setstrap = 0; int mode_read = 0, mode_altmedisable = 0, altmedisable = 0, mode_fmap_template = 0; + int mode_nuke = 0; int mode_gpr0_disable = 0, mode_gpr0_enable = 0, mode_gpr0_status = 0; - char *region_type_string = NULL, *region_fname = NULL; - const char *layout_fname = NULL; -@@ -2254,6 +2310,7 @@ int main(int argc, char *argv[]) - {"validate", 0, NULL, 't'}, + int mode_settopswapsize = 0; + char *region_type_string = NULL, *region_fname = NULL, *layout_fname = NULL; +@@ -2294,6 +2350,7 @@ int main(int argc, char *argv[]) {"setpchstrap", 1, NULL, 'S'}, {"newvalue", 1, NULL, 'V'}, + {"topswapsize", 1, NULL, 'T'}, + {"nuke", 1, NULL, 'N'}, {0, 0, 0, 0} }; -@@ -2303,35 +2360,8 @@ int main(int argc, char *argv[]) +@@ -2343,35 +2400,8 @@ int main(int argc, char *argv[]) region_fname++; // Descriptor, BIOS, ME, GbE, Platform // valid type? @@ -146,10 +146,11 @@ index 32b2081d93..1473cf058b 100644 fprintf(stderr, "No such region type: '%s'\n\n", region_type_string); fprintf(stderr, "run '%s -h' for usage\n", argv[0]); -@@ -2508,6 +2538,22 @@ int main(int argc, char *argv[]) - case 't': - mode_validate = 1; +@@ -2552,7 +2582,23 @@ int main(int argc, char *argv[]) + mode_settopswapsize = 1; + top_swap_size_arg = optarg; break; +- case 'v': + case 'N': + region_type_string = strdup(optarg); + if (!region_type_string) { @@ -166,12 +167,13 @@ index 32b2081d93..1473cf058b 100644 + } + mode_nuke = 1; + break; - case 'v': ++ Case 'v': print_version(); exit(EXIT_SUCCESS); -@@ -2524,7 +2570,8 @@ int main(int argc, char *argv[]) + break; +@@ -2571,7 +2617,8 @@ int main(int argc, char *argv[]) if ((mode_dump + mode_layout + mode_fmap_template + mode_extract + mode_inject + - mode_setstrap + mode_newlayout + (mode_spifreq | mode_em100 | + mode_setstrap + mode_settopswapsize + mode_newlayout + (mode_spifreq | mode_em100 | mode_unlocked | mode_locked) + mode_altmedisable + mode_validate + - (mode_gpr0_disable | mode_gpr0_enable) + mode_gpr0_status) > 1) { + (mode_gpr0_disable | mode_gpr0_enable) + mode_gpr0_status + @@ -179,9 +181,9 @@ index 32b2081d93..1473cf058b 100644 fprintf(stderr, "You may not specify more than one mode.\n\n"); fprintf(stderr, "run '%s -h' for usage\n", argv[0]); exit(EXIT_FAILURE); -@@ -2533,7 +2580,8 @@ int main(int argc, char *argv[]) +@@ -2580,7 +2627,8 @@ int main(int argc, char *argv[]) if ((mode_dump + mode_layout + mode_fmap_template + mode_extract + mode_inject + - mode_setstrap + mode_newlayout + mode_spifreq + mode_em100 + + mode_setstrap + mode_settopswapsize + mode_newlayout + mode_spifreq + mode_em100 + mode_locked + mode_unlocked + mode_density + mode_altmedisable + - mode_validate + (mode_gpr0_disable | mode_gpr0_enable) + mode_gpr0_status) == 0) { + mode_validate + (mode_gpr0_disable | mode_gpr0_enable) + mode_gpr0_status + @@ -189,7 +191,7 @@ index 32b2081d93..1473cf058b 100644 fprintf(stderr, "You need to specify a mode.\n\n"); fprintf(stderr, "run '%s -h' for usage\n", argv[0]); exit(EXIT_FAILURE); -@@ -2646,6 +2694,10 @@ int main(int argc, char *argv[]) +@@ -2746,6 +2794,10 @@ int main(int argc, char *argv[]) write_image(new_filename, image, size); } @@ -201,5 +203,5 @@ index 32b2081d93..1473cf058b 100644 struct fpsba *fpsba = find_fpsba(image, size); struct fmsba *fmsba = find_fmsba(image, size); -- -2.39.5 +2.47.3 |
