util/ifdtool: Add support for Intel 800 series chipset

This commit adds support for Intel 800 series chipset. The new chipset
can be uniquely identified by its SPI speed, eSPI speed, and
chipset name.

This commit message is clear and concise, and it accurately describes
the changes that were made to the code. It also includes the following
information:

- Specify the correct chipset name.
  "PCH Revision: 800 series Meteor Lake"
- Show the valid eSPI/EC frequency.
  "Read eSPI/EC Bus Frequency: 20MHz"

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I70619d9e3ed2bcad86f84a0527e3a0ad13acd706
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75433
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index ada120b..ddbc0fb 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -95,6 +95,7 @@
 	"300 series Cannon Point",
 	"400 series Ice Point",
 	"500 series Tiger Point/ 600 series Alder Point",
+	"800 series Meteor Lake",
 	"C620 series Lewisburg",
 	"Denverton: C39xx",
 	NULL
@@ -241,8 +242,9 @@
 	case PLATFORM_TGL:
 	case PLATFORM_ADL:
 	case PLATFORM_IFD2:
-	case PLATFORM_MTL:
 		return CHIPSET_500_600_SERIES_TIGER_ALDER_POINT;
+	case PLATFORM_MTL:
+		return CHIPSET_800_SERIES_METEOR_LAKE;
 	case PLATFORM_ICL:
 		return CHIPSET_400_SERIES_ICE_POINT;
 	case PLATFORM_LBG:
@@ -531,10 +533,14 @@
 
 static void decode_spi_frequency(unsigned int freq)
 {
-	if (chipset == CHIPSET_500_600_SERIES_TIGER_ALDER_POINT)
+	switch (chipset) {
+	case CHIPSET_500_600_SERIES_TIGER_ALDER_POINT:
+	case CHIPSET_800_SERIES_METEOR_LAKE:
 		_decode_spi_frequency_500_series(freq);
-	else
+		break;
+	default:
 		_decode_spi_frequency(freq);
+	}
 }
 
 static void _decode_espi_frequency(unsigned int freq)
@@ -586,10 +592,32 @@
 	}
 }
 
+static void _decode_espi_frequency_800_series(unsigned int freq)
+{
+	switch (freq) {
+	case ESPI_FREQUENCY_800SERIES_20MHZ:
+		printf("20MHz");
+		break;
+	case ESPI_FREQUENCY_800SERIES_25MHZ:
+		printf("25MHz");
+		break;
+	case ESPI_FREQUENCY_800SERIES_33MHZ:
+		printf("33MHz");
+		break;
+	case ESPI_FREQUENCY_800SERIES_50MHZ:
+		printf("50MHz");
+		break;
+	default:
+		printf("unknown<%x>MHz", freq);
+	}
+}
+
 static void decode_espi_frequency(unsigned int freq)
 {
 	if (chipset == CHIPSET_500_600_SERIES_TIGER_ALDER_POINT)
 		_decode_espi_frequency_500_series(freq);
+	else if (chipset == CHIPSET_800_SERIES_METEOR_LAKE)
+		_decode_espi_frequency_800_series(freq);
 	else
 		_decode_espi_frequency(freq);
 }
@@ -641,7 +669,7 @@
 static int is_platform_with_100x_series_pch(void)
 {
 	if (chipset >= CHIPSET_100_200_SERIES_SUNRISE_POINT &&
-			chipset <= CHIPSET_500_600_SERIES_TIGER_ALDER_POINT)
+			chipset <= CHIPSET_800_SERIES_METEOR_LAKE)
 		return 1;
 
 	return 0;
@@ -668,6 +696,8 @@
 		printf("\n  Read eSPI/EC Bus Frequency:          ");
 		if (chipset == CHIPSET_500_600_SERIES_TIGER_ALDER_POINT)
 			freq = (fpsba->pchstrp[22] & 0x38) >> 3;
+		else if (chipset == CHIPSET_800_SERIES_METEOR_LAKE)
+			freq = (fpsba->pchstrp[65] & 0x38) >> 3;
 		else
 			freq = (fcba->flcomp >> 17) & 7;
 		decode_espi_frequency(freq);
@@ -964,7 +994,8 @@
 		printf("  FMSBA:   0x%x\n", ((fdb->flmap2) & 0xff) << 4);
 	}
 
-	if (chipset == CHIPSET_500_600_SERIES_TIGER_ALDER_POINT) {
+	if (chipset == CHIPSET_500_600_SERIES_TIGER_ALDER_POINT ||
+		 chipset == CHIPSET_800_SERIES_METEOR_LAKE) {
 		printf("FLMAP3:    0x%08x\n", fdb->flmap3);
 		printf("  Minor Revision ID:     0x%04x\n", (fdb->flmap3 >> 14) & 0x7f);
 		printf("  Major Revision ID:     0x%04x\n", (fdb->flmap3 >> 21) & 0x7ff);
@@ -1810,6 +1841,7 @@
 	       "                                         icl    - Ice Lake\n"
 	       "                                         ifd2   - IFDv2 Platform\n"
 	       "                                         jsl    - Jasper Lake\n"
+	       "                                         mtl    - Meteor Lake\n"
 	       "                                         sklkbl - Sky Lake/Kaby Lake\n"
 	       "                                         tgl    - Tiger Lake\n"
 	       "                                         wbg    - Wellsburg\n"