Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide
BUG=b:153888802 TEST=Able to list correct eSPI 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: 50MHz Write/Erase Clock Frequency: 50MHz Fast Read Clock Frequency: 50MHz 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: 60MHz
Signed-off-by: Subrata Banik subrata.banik@intel.com Change-Id: I20840e6f931d7c1fabea0b6892e3bd19ead81168 --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 83 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/44820/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 3d9d55b..287c8c6 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -507,6 +507,63 @@ _decode_spi_frequency(freq); }
+static void _decode_espi_frequency(unsigned int freq) +{ + switch (freq) { + case ESPI_FREQUENCY_20MHZ: + printf("20MHz"); + break; + case ESPI_FREQUENCY_24MHZ: + printf("24MHz"); + break; + case ESPI_FREQUENCY_30MHZ: + printf("30MHz"); + break; + case ESPI_FREQUENCY_48MHZ: + printf("48MHz"); + break; + case ESPI_FREQUENCY_60MHZ: + printf("60MHz"); + break; + case ESPI_FREQUENCY_17MHZ: + printf("17MHz"); + break; + default: + printf("unknown<%x>MHz", freq); + } +} + +static void _decode_espi_frequency_500_series(unsigned int freq) +{ + switch (freq) { + case ESPI_FREQUENCY_500SERIES_20MHZ: + printf("20MHz"); + break; + case ESPI_FREQUENCY_500SERIES_24MHZ: + printf("24MHz"); + break; + case ESPI_FREQUENCY_500SERIES_25MHZ: + printf("25MHz"); + break; + case ESPI_FREQUENCY_500SERIES_48MHZ: + printf("48MHz"); + break; + case ESPI_FREQUENCY_500SERIES_60MHZ: + printf("60MHz"); + break; + default: + printf("unknown<%x>MHz", freq); + } +} + +static void decode_espi_frequency(unsigned int freq) +{ + if (chipset == CHIPSET_500_SERIES_TIGER_POINT) + _decode_espi_frequency_500_series(freq); + else + _decode_espi_frequency(freq); +} + static void decode_component_density(unsigned int density) { switch (density) { @@ -560,8 +617,10 @@ return 0; }
-static void dump_fcba(const fcba_t *fcba) +static void dump_fcba(const fcba_t *fcba, const fpsba_t *fpsba) { + unsigned int freq; + printf("\nFound Component Section\n"); printf("FLCOMP 0x%08x\n", fcba->flcomp); printf(" Dual Output Fast Read Support: %ssupported\n", @@ -575,7 +634,11 @@ printf("\n Fast Read Support: %ssupported", (fcba->flcomp & (1 << 20))?"":"not "); printf("\n Read Clock Frequency: "); - decode_spi_frequency((fcba->flcomp >> 17) & 7); + if (chipset == CHIPSET_500_SERIES_TIGER_POINT) + freq = (fpsba->pchstrp[22] & 0x38) >> 3; + else + freq = (fcba->flcomp >> 17) & 7; + decode_espi_frequency(freq);
switch (ifd_version) { case IFD_VERSION_1: @@ -870,7 +933,7 @@
if (frba && fcba && fpsba && fmba && fmsba) { dump_frba(frba); - dump_fcba(fcba); + dump_fcba(fcba, fpsba); dump_fpsba(fdb, fpsba); dump_fmba(fmba); dump_fmsba(fmsba); diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h index 0842924..b725823 100644 --- a/util/ifdtool/ifdtool.h +++ b/util/ifdtool/ifdtool.h @@ -71,6 +71,23 @@ SPI_FREQUENCY_14MHZ = 6, };
+enum espi_frequency { + ESPI_FREQUENCY_20MHZ = 0, + ESPI_FREQUENCY_24MHZ = 1, + ESPI_FREQUENCY_30MHZ = 2, + ESPI_FREQUENCY_48MHZ = 3, + ESPI_FREQUENCY_60MHZ = 4, + ESPI_FREQUENCY_17MHZ = 6, +}; + +enum espi_frequency_500_series { + ESPI_FREQUENCY_500SERIES_20MHZ = 0, + ESPI_FREQUENCY_500SERIES_24MHZ = 1, + ESPI_FREQUENCY_500SERIES_25MHZ = 2, + ESPI_FREQUENCY_500SERIES_48MHZ = 3, + ESPI_FREQUENCY_500SERIES_60MHZ = 4, +}; + enum component_density { COMPONENT_DENSITY_512KB = 0, COMPONENT_DENSITY_1MB = 1,
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44820/1/util/ifdtool/ifdtool.c File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/44820/1/util/ifdtool/ifdtool.c@641 PS1, Line 641: decode_espi_frequency(freq); Where did the call to `decode_spi_frequency` go?
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44820/1/util/ifdtool/ifdtool.c File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/44820/1/util/ifdtool/ifdtool.c@641 PS1, Line 641: decode_espi_frequency(freq);
Where did the call to `decode_spi_frequency` go?
always this field is known as "eSPI / EC Bus Frequency" or "Read Clock Frequency" FLCOMP—Flash Components Register Bit 17-19
I could see an issue, thanks for highlighting will fix it.
Hello build bot (Jenkins), Stefan Reinauer,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44820
to look at the new patch set (#2).
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide
BUG=b:153888802 TEST=Able to list correct eSPI 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: 50MHz Write/Erase Clock Frequency: 50MHz Fast Read Clock Frequency: 50MHz 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 eSPI/EC Bus Frequency: 60MHz
Signed-off-by: Subrata Banik subrata.banik@intel.com Change-Id: I20840e6f931d7c1fabea0b6892e3bd19ead81168 --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 95 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/44820/2
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44820/1/util/ifdtool/ifdtool.c File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/44820/1/util/ifdtool/ifdtool.c@641 PS1, Line 641: decode_espi_frequency(freq);
always this field is known as "eSPI / EC Bus Frequency" or "Read Clock Frequency" FLCOMP—Flash Compo […]
Ack
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/44820/2/util/ifdtool/ifdtool.c File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/44820/2/util/ifdtool/ifdtool.c@638 PS2, Line 638: if (is_platform_with_100x_series_pch()) { suspect code indent for conditional statements (8, 17)
https://review.coreboot.org/c/coreboot/+/44820/2/util/ifdtool/ifdtool.c@639 PS2, Line 639: if (chipset == CHIPSET_100_200_SERIES_SUNRISE_POINT) { Statements should start on a tabstop
Hello build bot (Jenkins), Stefan Reinauer,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44820
to look at the new patch set (#3).
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide
BUG=b:153888802 TEST=Able to list correct eSPI 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: 50MHz Write/Erase Clock Frequency: 50MHz Fast Read Clock Frequency: 50MHz 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 eSPI/EC Bus Frequency: 60MHz
Signed-off-by: Subrata Banik subrata.banik@intel.com Change-Id: I20840e6f931d7c1fabea0b6892e3bd19ead81168 --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 95 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/44820/3
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/44820/2/util/ifdtool/ifdtool.c File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/44820/2/util/ifdtool/ifdtool.c@638 PS2, Line 638: if (is_platform_with_100x_series_pch()) {
suspect code indent for conditional statements (8, 17)
Done
https://review.coreboot.org/c/coreboot/+/44820/2/util/ifdtool/ifdtool.c@639 PS2, Line 639: if (chipset == CHIPSET_100_200_SERIES_SUNRISE_POINT) {
Statements should start on a tabstop
Done
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44820/3/util/ifdtool/ifdtool.c File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/44820/3/util/ifdtool/ifdtool.c@638 PS3, Line 638: if (is_platform_with_100x_series_pch()) { suggestion: if (is_platform_with_100x_series_pch() && chipset != CHIPSET_100_200_SERIES_SUNRISE_POINT) { ... } else { }
that way it's a little more clear that sunrise point is the same as non-100x series here
Hello build bot (Jenkins), Stefan Reinauer,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44820
to look at the new patch set (#4).
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide
BUG=b:153888802 TEST=Able to list correct eSPI 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: 50MHz Write/Erase Clock Frequency: 50MHz Fast Read Clock Frequency: 50MHz 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 eSPI/EC Bus Frequency: 60MHz
Signed-off-by: Subrata Banik subrata.banik@intel.com Change-Id: I20840e6f931d7c1fabea0b6892e3bd19ead81168 --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 90 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/44820/4
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/44820/3/util/ifdtool/ifdtool.c File util/ifdtool/ifdtool.c:
https://review.coreboot.org/c/coreboot/+/44820/3/util/ifdtool/ifdtool.c@638 PS3, Line 638: if (is_platform_with_100x_series_pch()) {
suggestion: […]
Thanks Tim
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 4:
@Tim, if you can take a look
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
Patch Set 4: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44820 )
Change subject: util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide ......................................................................
util/ifdtool: Fix eSPI frequency as per Gen 11 SPI flash guide
BUG=b:153888802 TEST=Able to list correct eSPI 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: 50MHz Write/Erase Clock Frequency: 50MHz Fast Read Clock Frequency: 50MHz 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 eSPI/EC Bus Frequency: 60MHz
Signed-off-by: Subrata Banik subrata.banik@intel.com Change-Id: I20840e6f931d7c1fabea0b6892e3bd19ead81168 Reviewed-on: https://review.coreboot.org/c/coreboot/+/44820 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 90 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 9f507bb..e2fd0ab 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -509,6 +509,63 @@ _decode_spi_frequency(freq); }
+static void _decode_espi_frequency(unsigned int freq) +{ + switch (freq) { + case ESPI_FREQUENCY_20MHZ: + printf("20MHz"); + break; + case ESPI_FREQUENCY_24MHZ: + printf("24MHz"); + break; + case ESPI_FREQUENCY_30MHZ: + printf("30MHz"); + break; + case ESPI_FREQUENCY_48MHZ: + printf("48MHz"); + break; + case ESPI_FREQUENCY_60MHZ: + printf("60MHz"); + break; + case ESPI_FREQUENCY_17MHZ: + printf("17MHz"); + break; + default: + printf("unknown<%x>MHz", freq); + } +} + +static void _decode_espi_frequency_500_series(unsigned int freq) +{ + switch (freq) { + case ESPI_FREQUENCY_500SERIES_20MHZ: + printf("20MHz"); + break; + case ESPI_FREQUENCY_500SERIES_24MHZ: + printf("24MHz"); + break; + case ESPI_FREQUENCY_500SERIES_25MHZ: + printf("25MHz"); + break; + case ESPI_FREQUENCY_500SERIES_48MHZ: + printf("48MHz"); + break; + case ESPI_FREQUENCY_500SERIES_60MHZ: + printf("60MHz"); + break; + default: + printf("unknown<%x>MHz", freq); + } +} + +static void decode_espi_frequency(unsigned int freq) +{ + if (chipset == CHIPSET_500_SERIES_TIGER_POINT) + _decode_espi_frequency_500_series(freq); + else + _decode_espi_frequency(freq); +} + static void decode_component_density(unsigned int density) { switch (density) { @@ -562,8 +619,10 @@ return 0; }
-static void dump_fcba(const fcba_t *fcba) +static void dump_fcba(const fcba_t *fcba, const fpsba_t *fpsba) { + unsigned int freq; + printf("\nFound Component Section\n"); printf("FLCOMP 0x%08x\n", fcba->flcomp); printf(" Dual Output Fast Read Support: %ssupported\n", @@ -576,8 +635,18 @@ decode_spi_frequency((fcba->flcomp >> 21) & 7); printf("\n Fast Read Support: %ssupported", (fcba->flcomp & (1 << 20))?"":"not "); - printf("\n Read Clock Frequency: "); - decode_spi_frequency((fcba->flcomp >> 17) & 7); + if (is_platform_with_100x_series_pch() && + chipset != CHIPSET_100_200_SERIES_SUNRISE_POINT) { + printf("\n Read eSPI/EC Bus Frequency: "); + if (chipset == CHIPSET_500_SERIES_TIGER_POINT) + freq = (fpsba->pchstrp[22] & 0x38) >> 3; + else + freq = (fcba->flcomp >> 17) & 7; + decode_espi_frequency(freq); + } else { + printf("\n Read Clock Frequency: "); + decode_spi_frequency((fcba->flcomp >> 17) & 7); + }
switch (ifd_version) { case IFD_VERSION_1: @@ -868,7 +937,7 @@
if (frba && fcba && fpsba && fmba && fmsba) { dump_frba(frba); - dump_fcba(fcba); + dump_fcba(fcba, fpsba); dump_fpsba(fdb, fpsba); dump_fmba(fmba); dump_fmsba(fmsba); diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h index 0842924..b725823 100644 --- a/util/ifdtool/ifdtool.h +++ b/util/ifdtool/ifdtool.h @@ -71,6 +71,23 @@ SPI_FREQUENCY_14MHZ = 6, };
+enum espi_frequency { + ESPI_FREQUENCY_20MHZ = 0, + ESPI_FREQUENCY_24MHZ = 1, + ESPI_FREQUENCY_30MHZ = 2, + ESPI_FREQUENCY_48MHZ = 3, + ESPI_FREQUENCY_60MHZ = 4, + ESPI_FREQUENCY_17MHZ = 6, +}; + +enum espi_frequency_500_series { + ESPI_FREQUENCY_500SERIES_20MHZ = 0, + ESPI_FREQUENCY_500SERIES_24MHZ = 1, + ESPI_FREQUENCY_500SERIES_25MHZ = 2, + ESPI_FREQUENCY_500SERIES_48MHZ = 3, + ESPI_FREQUENCY_500SERIES_60MHZ = 4, +}; + enum component_density { COMPONENT_DENSITY_512KB = 0, COMPONENT_DENSITY_1MB = 1,