Attention is currently required from: Stefan Reinauer.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68697 )
Change subject: ifdtool: Use chipset to decide if region exists ......................................................................
ifdtool: Use chipset to decide if region exists
Remove hardcoded platform code for denverton and use the chipset to detect if a specific region is supported.
Change-Id: I6ac79f66395e378f45eba262df914478ff142b1f Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M util/ifdtool/ifdtool.c 1 file changed, 22 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/68697/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index d00e609..1d236b3 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -28,22 +28,6 @@ ((const char *)(ptr) >= (base) && \ (const char *)&(ptr)[1] <= (base) + (limit))
-/** - * PLATFORM_HAS_GBE_REGION - some platforms do not support the PCH GbE LAN region - */ -#define PLATFORM_HAS_GBE_REGION (platform != PLATFORM_DNV) - -/* - * PLATFORM_HAS_EC_REGION - some platforms do not support the EC region - */ -#define PLATFORM_HAS_EC_REGION (ifd_version >= IFD_VERSION_2 && platform != PLATFORM_DNV) - -/* - * PLATFORM_HAS_10GBE_X_REGION - some platforms have 1 or more 10GbE LAN regions - */ -#define PLATFORM_HAS_10GBE_0_REGION (platform == PLATFORM_DNV) -#define PLATFORM_HAS_10GBE_1_REGION (platform == PLATFORM_DNV) - int ifd_version; static int chipset; extern unsigned int max_regions; @@ -606,13 +590,13 @@ }
/* EC region access only available on v2+ */ - if (PLATFORM_HAS_EC_REGION) + if (region_supported(chipset, REGION_EC)) printf(" EC Region Write Access: %s\n", (flmstr & (1 << (wr_shift + 8))) ? "enabled" : "disabled"); printf(" Platform Data Region Write Access: %s\n", (flmstr & (1 << (wr_shift + 4))) ? "enabled" : "disabled"); - if (PLATFORM_HAS_GBE_REGION) { + if (region_supported(chipset, REGION_GBE)) { printf(" GbE Region Write Access: %s\n", (flmstr & (1 << (wr_shift + 3))) ? "enabled" : "disabled"); } @@ -622,22 +606,22 @@ (flmstr & (1 << (wr_shift + 1))) ? "enabled" : "disabled"); printf(" Flash Descriptor Write Access: %s\n", (flmstr & (1 << wr_shift)) ? "enabled" : "disabled"); - if (PLATFORM_HAS_10GBE_0_REGION) { + if (region_supported(chipset, REGION_10GB_0)) { printf(" 10GbE_0 Write Access: %s\n", (flmstr & (1 << (wr_shift + 11))) ? "enabled" : "disabled"); } - if (PLATFORM_HAS_10GBE_1_REGION) { + if (region_supported(chipset, REGION_10GB_1)) { printf(" 10GbE_1 Write Access: %s\n", (flmstr & (1 << 4)) ? "enabled" : "disabled"); }
- if (PLATFORM_HAS_EC_REGION) + if (region_supported(chipset, REGION_EC)) printf(" EC Region Read Access: %s\n", (flmstr & (1 << (rd_shift + 8))) ? "enabled" : "disabled"); printf(" Platform Data Region Read Access: %s\n", (flmstr & (1 << (rd_shift + 4))) ? "enabled" : "disabled"); - if (PLATFORM_HAS_GBE_REGION) { + if (region_supported(chipset, REGION_GBE)) { printf(" GbE Region Read Access: %s\n", (flmstr & (1 << (rd_shift + 3))) ? "enabled" : "disabled"); } @@ -647,11 +631,11 @@ (flmstr & (1 << (rd_shift + 1))) ? "enabled" : "disabled"); printf(" Flash Descriptor Read Access: %s\n", (flmstr & (1 << rd_shift)) ? "enabled" : "disabled"); - if (PLATFORM_HAS_10GBE_0_REGION) { + if (region_supported(chipset, REGION_10GB_0)) { printf(" 10GbE_0 Read Access: %s\n", (flmstr & (1 << (rd_shift + 11))) ? "enabled" : "disabled"); } - if (PLATFORM_HAS_10GBE_1_REGION) { + if (region_supported(chipset, REGION_10GB_1)) { printf(" 10GbE_1 Read Access: %s\n", (flmstr & (1 << 0)) ? "enabled" : "disabled"); } @@ -669,7 +653,7 @@ decode_flmstr(fmba->flmstr1); printf("FLMSTR2: 0x%08x (Intel ME)\n", fmba->flmstr2); decode_flmstr(fmba->flmstr2); - if (PLATFORM_HAS_GBE_REGION) { + if (region_supported(chipset, REGION_GBE)) { printf("FLMSTR3: 0x%08x (GbE)\n", fmba->flmstr3); decode_flmstr(fmba->flmstr3); if (ifd_version >= IFD_VERSION_2) {