summaryrefslogtreecommitdiff
path: root/resources/coreboot/default/patches/0016-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-08-05 23:36:42 +0100
committerLeah Rowe <leah@libreboot.org>2023-08-06 01:02:49 +0100
commit705149a3e089fb99e671a47b0acd3a30378dd659 (patch)
tree7555825af2916c0203151de624448ee244af4199 /resources/coreboot/default/patches/0016-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch
parent22ee7f745d8745349fe080cc4e75494c05e3720a (diff)
coreboot/default: bump revision to 2 August 2023
coreboot revision: d86260a134575b083f35103e1cd5c7c7ad883bce from 2 August 2023 The patches were updated. HP 8300 USDT has now been merged upstream, so that patch is no longer included in lbmk. SD card fix for E6400 merged upstream, so now it's removed in lbmk. The nvidia E6400 patch (devicetree.cb) has not yet merged upstream. The ifdtool --nuke option has been rebased. Patches as follow-ups to earlier patches removed; for example, patches that set VRAM to 352MB on GM45 have been removed, and replaced with patches that just set 256MB in the first place (this is more stable). This was mostly a clean rebase, of all the patches. It went smooth. I haven't updated cros/haswell yet; the 4.11_branch revision used on fam15h will also remain, for now. The coreboot configurations have been updated, for this new revision of coreboot. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'resources/coreboot/default/patches/0016-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch')
-rw-r--r--resources/coreboot/default/patches/0016-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch205
1 files changed, 0 insertions, 205 deletions
diff --git a/resources/coreboot/default/patches/0016-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch b/resources/coreboot/default/patches/0016-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch
deleted file mode 100644
index d4eb93f5..00000000
--- a/resources/coreboot/default/patches/0016-util-ifdtool-add-nuke-flag-all-0xFF-on-region.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-From 32a961895ed41cd2bb1f9ae00ab0200c4bfb0bf3 Mon Sep 17 00:00:00 2001
-From: Leah Rowe <leah@libreboot.org>
-Date: Sun, 19 Feb 2023 18:21:43 +0000
-Subject: [PATCH 16/18] util/ifdtool: add --nuke flag (all 0xFF on region)
-
-When this option is used, the region's contents are overwritten
-with all ones (0xFF).
-
-Example:
-
-./ifdtool --nuke gbe coreboot.rom
-./ifdtool --nuke bios coreboot.com
-./ifdtool --nuke me coreboot.com
-
-Rebased since the last revision update in lbmk.
----
- util/ifdtool/ifdtool.c | 117 ++++++++++++++++++++++++++++++-----------
- 1 file changed, 85 insertions(+), 32 deletions(-)
-
-diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
-index 98afa4bbcf..5509721018 100644
---- a/util/ifdtool/ifdtool.c
-+++ b/util/ifdtool/ifdtool.c
-@@ -1771,6 +1771,7 @@ static void print_usage(const char *name)
- " wbg - Wellsburg\n"
- " -S | --setpchstrap Write a PCH strap\n"
- " -V | --newvalue The new value to write into PCH strap specified by -S\n"
-+ " -N | --nuke <region> Overwrite the specified region with 0xFF (all ones)\n"
- " -v | --version: print the version\n"
- " -h | --help: print this help\n\n"
- "<region> is one of Descriptor, BIOS, ME, GbE, Platform Data, Secondary BIOS, "
-@@ -1778,13 +1779,70 @@ static void print_usage(const char *name)
- "\n");
- }
-
-+static int
-+get_region_type_string(const char *region_type_string)
-+{
-+ if (region_type_string == NULL)
-+ return -1;
-+ else if (!strcasecmp("Descriptor", region_type_string))
-+ region_type = 0;
-+ else if (!strcasecmp("BIOS", region_type_string))
-+ region_type = 1;
-+ else if (!strcasecmp("ME", region_type_string))
-+ region_type = 2;
-+ else if (!strcasecmp("GbE", region_type_string))
-+ region_type = 3;
-+ else if (!strcasecmp("Platform Data", region_type_string))
-+ region_type = 4;
-+ else if (!strcasecmp("Device Exp1", region_type_string))
-+ region_type = 5;
-+ else if (!strcasecmp("Secondary BIOS", region_type_string))
-+ region_type = 6;
-+ else if (!strcasecmp("Reserved", region_type_string))
-+ region_type = 7;
-+ else if (!strcasecmp("EC", region_type_string))
-+ region_type = 8;
-+ else if (!strcasecmp("Device Exp2", region_type_string))
-+ region_type = 9;
-+ else if (!strcasecmp("IE", region_type_string))
-+ region_type = 10;
-+ else if (!strcasecmp("10GbE_0", region_type_string))
-+ region_type = 11;
-+ else if (!strcasecmp("10GbE_1", region_type_string))
-+ region_type = 12;
-+ else if (!strcasecmp("PTT", region_type_string))
-+ region_type = 15;
-+ else
-+ return -1;
-+}
-+
-+static void
-+nuke(const char *filename, char *image, int size, int region_type)
-+{
-+ int i;
-+ region_t region;
-+ const frba_t *frba = find_frba(image, size);
-+ if (!frba)
-+ exit(EXIT_FAILURE);
-+
-+ region = get_region(frba, region_type);
-+ if (region.size > 0) {
-+ for (i = region.base; i <= region.limit; i++) {
-+ if ((i + 1) > (size))
-+ break;
-+ image[i] = 0xFF;
-+ }
-+ write_image(filename, image, size);
-+ }
-+}
-+
- int main(int argc, char *argv[])
- {
- int opt, option_index = 0;
- int mode_dump = 0, mode_extract = 0, mode_inject = 0, mode_spifreq = 0;
- 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;
-+ int mode_read = 0, mode_altmedisable = 0, altmedisable = 0, mode_nuke = 0;
- char *region_type_string = NULL, *region_fname = NULL;
- const char *layout_fname = NULL;
- char *new_filename = NULL;
-@@ -1815,6 +1873,7 @@ int main(int argc, char *argv[])
- {"validate", 0, NULL, 't'},
- {"setpchstrap", 1, NULL, 'S'},
- {"newvalue", 1, NULL, 'V'},
-+ {"nuke", 1, NULL, 'N'},
- {0, 0, 0, 0}
- };
-
-@@ -1855,35 +1914,8 @@ int main(int argc, char *argv[])
- region_fname++;
- // Descriptor, BIOS, ME, GbE, Platform
- // valid type?
-- if (!strcasecmp("Descriptor", region_type_string))
-- region_type = 0;
-- else if (!strcasecmp("BIOS", region_type_string))
-- region_type = 1;
-- else if (!strcasecmp("ME", region_type_string))
-- region_type = 2;
-- else if (!strcasecmp("GbE", region_type_string))
-- region_type = 3;
-- else if (!strcasecmp("Platform Data", region_type_string))
-- region_type = 4;
-- else if (!strcasecmp("Device Exp1", region_type_string))
-- region_type = 5;
-- else if (!strcasecmp("Secondary BIOS", region_type_string))
-- region_type = 6;
-- else if (!strcasecmp("Reserved", region_type_string))
-- region_type = 7;
-- else if (!strcasecmp("EC", region_type_string))
-- region_type = 8;
-- else if (!strcasecmp("Device Exp2", region_type_string))
-- region_type = 9;
-- else if (!strcasecmp("IE", region_type_string))
-- region_type = 10;
-- else if (!strcasecmp("10GbE_0", region_type_string))
-- region_type = 11;
-- else if (!strcasecmp("10GbE_1", region_type_string))
-- region_type = 12;
-- else if (!strcasecmp("PTT", region_type_string))
-- region_type = 15;
-- if (region_type == -1) {
-+ if ((region_type =
-+ get_region_type_string(region_type_string)) == -1) {
- fprintf(stderr, "No such region type: '%s'\n\n",
- region_type_string);
- print_usage(argv[0]);
-@@ -2050,6 +2082,22 @@ int main(int argc, char *argv[])
- case 't':
- mode_validate = 1;
- break;
-+ case 'N':
-+ region_type_string = strdup(optarg);
-+ if (!region_type_string) {
-+ fprintf(stderr, "No region specified\n");
-+ print_usage(argv[0]);
-+ exit(EXIT_FAILURE);
-+ }
-+ if ((region_type =
-+ get_region_type_string(region_type_string)) == -1) {
-+ fprintf(stderr, "No such region type: '%s'\n\n",
-+ region_type_string);
-+ print_usage(argv[0]);
-+ exit(EXIT_FAILURE);
-+ }
-+ mode_nuke = 1;
-+ break;
- case 'v':
- print_version();
- exit(EXIT_SUCCESS);
-@@ -2065,7 +2113,7 @@ int main(int argc, char *argv[])
-
- if ((mode_dump + mode_layout + mode_extract + mode_inject + mode_setstrap +
- mode_newlayout + (mode_spifreq | mode_em100 | mode_unlocked |
-- mode_locked) + mode_altmedisable + mode_validate) > 1) {
-+ mode_locked) + mode_altmedisable + mode_validate + mode_nuke) > 1) {
- fprintf(stderr, "You may not specify more than one mode.\n\n");
- print_usage(argv[0]);
- exit(EXIT_FAILURE);
-@@ -2073,7 +2121,8 @@ int main(int argc, char *argv[])
-
- if ((mode_dump + mode_layout + mode_extract + mode_inject + mode_setstrap +
- mode_newlayout + mode_spifreq + mode_em100 + mode_locked +
-- mode_unlocked + mode_density + mode_altmedisable + mode_validate) == 0) {
-+ mode_unlocked + mode_density + mode_altmedisable + mode_validate +
-+ mode_nuke) == 0) {
- fprintf(stderr, "You need to specify a mode.\n\n");
- print_usage(argv[0]);
- exit(EXIT_FAILURE);
-@@ -2171,6 +2220,10 @@ int main(int argc, char *argv[])
- write_image(new_filename, image, size);
- }
-
-+ if (mode_nuke) {
-+ nuke(new_filename, image, size, region_type);
-+ }
-+
- if (mode_altmedisable) {
- fpsba_t *fpsba = find_fpsba(image, size);
- fmsba_t *fmsba = find_fmsba(image, size);
---
-2.39.2
-