Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68657 )
Change subject: util/ifdtool: Add Wellsburg support ......................................................................
util/ifdtool: Add Wellsburg support
Wellsburg is IFDv2 compatible and supports up to 6 regions. Use the NR field to differentiate between Wellsburg and Lynxpoint.
Also add support using the -p argument to specify Wellsburg platform.
Make sure to not use 16 regions as default as this corrupts the image when using the layout modification feature.
Tested on Intel Grangeville.
Documents used: Intel Document Id: 516552 Intel Document Id: 565117
Change-Id: I651730b05deb512478d059174cf8615547d2fde4 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 44 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/68657/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index e97efcc..880ca17 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -202,6 +202,7 @@ uint32_t msl = (fdb->flmap2 >> 8) & 0xff; uint32_t isl = (fdb->flmap1 >> 24); uint32_t nm = (fdb->flmap1 >> 8) & 0x7; + uint32_t nr = (fdb->flmap0 >> 24) & 7;
/* Rest for IFD1 chipset type */ if (iccriba == 0x00) { @@ -220,8 +221,12 @@ return CHIPSET_BAYTRAIL; else if (msl <= 1 && isl <= 18) return CHIPSET_6_SERIES_COUGAR_POINT; - else if (msl <= 1 && isl <= 21) - return CHIPSET_8_SERIES_LYNX_POINT; + else if (msl <= 1 && isl <= 21) { + if (nr > 4) + return CHIPSET_8_SERIES_WELLSBURG; + else + return CHIPSET_8_SERIES_LYNX_POINT; + } printf("Peculiar firmware descriptor, assuming Wildcat Point compatibility.\n"); return CHIPSET_9_SERIES_WILDCAT_POINT; } else if (nm == 6) { @@ -256,6 +261,8 @@ return CHIPSET_C620_SERIES_LEWISBURG; case PLATFORM_DNV: return CHIPSET_DENVERTON; + case PLATFORM_WLS: + return CHIPSET_8_SERIES_WELLSBURG; default: return CHIPSET_PCH_UNKNOWN; } @@ -283,6 +290,7 @@ PLATFORM_SKLKBL, PLATFORM_IFD2, PLATFORM_MTL, + PLATFORM_WLS, }; unsigned int i;
@@ -299,7 +307,10 @@ if (is_platform_ifd_2()) { ifd_version = IFD_VERSION_2; chipset = ifd2_platform_to_chipset(platform); - max_regions = MAX_REGIONS; + if (chipset == CHIPSET_8_SERIES_WELLSBURG) + max_regions = MAX_REGIONS_WLS; + else + max_regions = MAX_REGIONS; } else { ifd_version = IFD_VERSION_1; chipset = ifd1_guess_chipset(image, size); @@ -1271,6 +1282,7 @@ } break; case PLATFORM_DNV: + case PLATFORM_WLS: /* CPU/BIOS can read descriptor and BIOS. */ fmba->flmstr1 |= (1 << REGION_DESC) << rd_shift; fmba->flmstr1 |= (1 << REGION_BIOS) << rd_shift; @@ -1709,6 +1721,7 @@ " jsl - Jasper Lake\n" " sklkbl - Sky Lake/Kaby Lake\n" " tgl - Tiger Lake\n" + " wls - Wellsburg\n" " -S | --setpchstrap Write a PCH strap\n" " -V | --newvalue The new value to write into PCH strap specified by -S\n" " -v | --version: print the version\n" @@ -1979,6 +1992,8 @@ platform = PLATFORM_IFD2; } else if (!strcmp(optarg, "mtl")) { platform = PLATFORM_MTL; + } else if (!strcmp(optarg, "wls")) { + platform = PLATFORM_WLS; } else { fprintf(stderr, "Unknown platform: %s\n", optarg); exit(EXIT_FAILURE); diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h index 1ee76f1..7c1507c 100644 --- a/util/ifdtool/ifdtool.h +++ b/util/ifdtool/ifdtool.h @@ -62,6 +62,7 @@ PLATFORM_IFD2, PLATFORM_DNV, PLATFORM_MTL, + PLATFORM_WLS, };
#define LAYOUT_LINELEN 80 @@ -122,6 +123,7 @@
// regions #define MAX_REGIONS 16 +#define MAX_REGIONS_WLS 6 #define MAX_REGIONS_OLD 5
enum flash_regions {