ichspi: Properly add Emmitsburg PCH

The Emmitsburg or C740 series PCH is actually ahead of all the other,
currently supported chipsets. Finally, Intel added new registers that
carry the read and write access permissions for all 16 regions.

The old FRAP register seems to be still around, so we print both new
and old registers. For the detailed report we use the new registers,
though.

We also adapt the descriptor detection slightly: We check for `NM == 6`
just like we did for Lewisburg. This way we won't treat a huge range of
ISL (ICH/PCH strap length) values as Emmitsburg, which should result in
less false positives.

The output of `ich_descriptors_tool' tested on some Supermicro firmware
looks reasonable.  Also tested read/erase/write in `swseq' and  `hwseq'
modes with 7 series PCH, reading with ADL-P. All logs still report FRAP
settings correctly.

Change-Id: Ibf5ebe2e2edfe5e5ae26bf1136648bf6354b0aa9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/187
diff --git a/chipset_enable.c b/chipset_enable.c
index 5dc651d..2988a60 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -699,6 +699,7 @@
 		boot_straps = boot_straps_pch8_lp;
 		break;
 	case CHIPSET_500_SERIES_TIGER_POINT:
+	case CHIPSET_C740_SERIES_EMMITSBURG:
 		boot_straps = boot_straps_pch500;
 		break;
 	case CHIPSET_APOLLO_LAKE:
@@ -1011,6 +1012,12 @@
 	return enable_flash_pch_spidev(spi_dev, name, CHIPSET_500_SERIES_TIGER_POINT);
 }
 
+static int enable_flash_c740(struct flashprog_programmer *const prog,
+			     struct pci_dev *const spi_dev, const char *const name)
+{
+	return enable_flash_pch_spidev(spi_dev, name, CHIPSET_C740_SERIES_EMMITSBURG);
+}
+
 /* Silvermont architecture: Bay Trail(-T/-I), Avoton/Rangeley.
  * These have a distinctly different behavior compared to other Intel chipsets and hence are handled separately.
  *
@@ -2182,7 +2189,7 @@
 	{0x8086, 0xa247,   ANY_REV, B_S,    NT,  "Intel", "C620 Series Supersku",	enable_flash_c620},
 	{0x8086, 0xa248,   ANY_REV, B_S,    NT,  "Intel", "C620 Series Supersku",	enable_flash_c620},
 	{0x8086, 0xa249,   ANY_REV, B_S,    NT,  "Intel", "C620 Series Supersku",	enable_flash_c620},
-	{0x8086, 0x1bca,   ANY_REV, B_S,    NT,  "Intel", "Emmitsburg SKU",		enable_flash_c620},
+	{0x8086, 0x1bca,   ANY_REV, B_S,    NT,  "Intel", "Emmitsburg SKU",		enable_flash_c740},
 	{0x8086, 0xa2c4,   ANY_REV, B_S,    NT,  "Intel", "H270",			enable_flash_pch100},
 	{0x8086, 0xa2c5,   ANY_REV, B_S,    NT,  "Intel", "Z270",			enable_flash_pch100},
 	{0x8086, 0xa2c6,   ANY_REV, B_S,    NT,  "Intel", "Q270",			enable_flash_pch100},