Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44819 )
Change subject: util/ifdtool: Fix SPI frequency as per Gen11 SPI flash guide ......................................................................
util/ifdtool: Fix SPI frequency as per Gen11 SPI flash guide
BUG=b:153888802 TEST=Able to list correct SPI frequency as per TGL SPI flash guide
Without this CL : Found Component Section FLCOMP 0x093030f6 Dual Output Fast Read Support: not supported Read ID/Read Status Clock Frequency: 33MHz Write/Erase Clock Frequency: 33MHz Fast Read Clock Frequency: 33MHz Fast Read Support: supported Read Clock Frequency: 20MHz
With this CL : Found Component Section FLCOMP 0x093030f6 Dual Output Fast Read Support: not supported Read ID/Read Status Clock Frequency: 50MHz Write/Erase Clock Frequency: 50MHz Fast Read Clock Frequency: 50MHz Fast Read Support: supported Read Clock Frequency: 20MHz
Signed-off-by: Subrata Banik subrata.banik@intel.com Change-Id: Id0a0a0cbd948ef8334cf522c09e881b464e87f0e --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 40 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/44819/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index ac86441..3d9d55b 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -446,7 +446,7 @@ printf("Wrote layout to %s\n", layout_fname); }
-static void decode_spi_frequency(unsigned int freq) +static void _decode_spi_frequency(unsigned int freq) { switch (freq) { case SPI_FREQUENCY_20MHZ: @@ -476,6 +476,37 @@ } }
+static void _decode_spi_frequency_500_series(unsigned int freq) +{ + switch (freq) { + case SPI_FREQUENCY_100MHZ: + printf("100MHz"); + break; + case SPI_FREQUENCY_50MHZ: + printf("50MHz"); + break; + case SPI_FREQUENCY_500SERIES_33MHZ: + printf("33MHz"); + break; + case SPI_FREQUENCY_25MHZ: + printf("25MHz"); + break; + case SPI_FREQUENCY_14MHZ: + printf("14MHz"); + break; + default: + printf("unknown<%x>MHz", freq); + } +} + +static void decode_spi_frequency(unsigned int freq) +{ + if (chipset == CHIPSET_500_SERIES_TIGER_POINT) + _decode_spi_frequency_500_series(freq); + else + _decode_spi_frequency(freq); +} + static void decode_component_density(unsigned int density) { switch (density) { diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h index fb3de2f..0842924 100644 --- a/util/ifdtool/ifdtool.h +++ b/util/ifdtool/ifdtool.h @@ -63,6 +63,14 @@ SPI_FREQUENCY_17MHZ = 6, };
+enum spi_frequency_500_series { + SPI_FREQUENCY_100MHZ = 0, + SPI_FREQUENCY_50MHZ = 1, + SPI_FREQUENCY_500SERIES_33MHZ = 3, + SPI_FREQUENCY_25MHZ = 4, + SPI_FREQUENCY_14MHZ = 6, +}; + enum component_density { COMPONENT_DENSITY_512KB = 0, COMPONENT_DENSITY_1MB = 1,