Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37169 )
Change subject: northbridge/amd/pi: define the number of IOAPICs ......................................................................
northbridge/amd/pi: define the number of IOAPICs
Define the number of IOAPICs in the Kconfig and get rid of AmdGetValue calls being not conformant to AGESA API.
Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Change-Id: I532597dd326093455358a23aef3b3ea0d0a14f75 --- M src/northbridge/amd/pi/00630F01/northbridge.c M src/northbridge/amd/pi/00660F01/northbridge.c M src/northbridge/amd/pi/00730F01/northbridge.c M src/northbridge/amd/pi/Kconfig 4 files changed, 16 insertions(+), 35 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/37169/1
diff --git a/src/northbridge/amd/pi/00630F01/northbridge.c b/src/northbridge/amd/pi/00630F01/northbridge.c index 40d3e05..1adee19 100644 --- a/src/northbridge/amd/pi/00630F01/northbridge.c +++ b/src/northbridge/amd/pi/00630F01/northbridge.c @@ -798,21 +798,12 @@ int siblings = 0; unsigned int family; u32 modules = 0; - VOID* modules_ptr = &modules; - BUILD_OPT_CFG* options = NULL; int ioapic_count = 0;
- // TODO Remove the printk's. - printk(BIOS_SPEW, "KaveriPI Debug: Grabbing the AMD Topology Information.\n"); - AmdGetValue(AMD_GLOBAL_USER_OPTIONS, (VOID**)&options, sizeof(options)); - AmdGetValue(AMD_GLOBAL_NUM_MODULES, &modules_ptr, sizeof(modules)); - modules = *(u32*)modules_ptr; - ASSERT(modules > 0); - ASSERT(options); - ioapic_count = (int)options->CfgPlatNumIoApics; - ASSERT(ioapic_count > 0); - printk(BIOS_SPEW, "KaveriPI Debug: AMD Topology Number of Modules (@0x%p) is %d\n", modules_ptr, modules); - printk(BIOS_SPEW, "KaveriPI Debug: AMD Topology Number of IOAPICs (@0x%p) is %d\n", options, (int)(options->CfgPlatNumIoApics)); + /* For binaryPI there is no multiprocessor configuration, the number of + * modules will always be 1. */ + modules = 1; + ioapic_count = CONFIG_NUM_OF_IOAPICS;
dev_mc = pcidev_on_root(DEV_CDB, 0); if (!dev_mc) { diff --git a/src/northbridge/amd/pi/00660F01/northbridge.c b/src/northbridge/amd/pi/00660F01/northbridge.c index 533b651..b8102cf 100644 --- a/src/northbridge/amd/pi/00660F01/northbridge.c +++ b/src/northbridge/amd/pi/00660F01/northbridge.c @@ -796,17 +796,12 @@ int siblings = 0; unsigned int family; u32 modules = 0; - VOID* modules_ptr = &modules; - BUILD_OPT_CFG* options = NULL; int ioapic_count = 0;
- AmdGetValue(AMD_GLOBAL_USER_OPTIONS, (VOID**)&options, sizeof(options)); - AmdGetValue(AMD_GLOBAL_NUM_MODULES, &modules_ptr, sizeof(modules)); - modules = (*(u32 *)modules_ptr) & ((1ull << (sizeof(modules) * 8)) - 1); - ASSERT(modules > 0); - ASSERT(options); - ioapic_count = (int)options->CfgPlatNumIoApics; - ASSERT(ioapic_count > 0); + /* For binaryPI there is no multiprocessor configuration, the number of + * modules will always be 1. */ + modules = 1; + ioapic_count = CONFIG_NUM_OF_IOAPICS;
dev_mc = pcidev_on_root(DEV_CDB, 0); if (!dev_mc) { diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c index 27e14f5..a188c81 100644 --- a/src/northbridge/amd/pi/00730F01/northbridge.c +++ b/src/northbridge/amd/pi/00730F01/northbridge.c @@ -1031,21 +1031,12 @@ int siblings = 0; unsigned int family; u32 modules = 0; - VOID* modules_ptr = &modules; - BUILD_OPT_CFG* options = NULL; int ioapic_count = 0;
- // TODO Remove the printk's. - printk(BIOS_SPEW, "MullinsPI Debug: Grabbing the AMD Topology Information.\n"); - AmdGetValue(AMD_GLOBAL_USER_OPTIONS, (VOID**)&options, sizeof(options)); - AmdGetValue(AMD_GLOBAL_NUM_MODULES, &modules_ptr, sizeof(modules)); - modules = *(u32*)modules_ptr; - ASSERT(modules > 0); - ASSERT(options); - ioapic_count = (int)options->CfgPlatNumIoApics; - ASSERT(ioapic_count > 0); - printk(BIOS_SPEW, "MullinsPI Debug: AMD Topology Number of Modules (@0x%p) is %d\n", modules_ptr, modules); - printk(BIOS_SPEW, "MullinsPI Debug: AMD Topology Number of IOAPICs (@0x%p) is %d\n", options, (int)options->CfgPlatNumIoApics); + /* For binaryPI there is no multiprocessor configuration, the number of + * modules will always be 1. */ + modules = 1; + ioapic_count = CONFIG_NUM_OF_IOAPICS;
dev_mc = pcidev_on_root(DEV_CDB, 0); if (!dev_mc) { diff --git a/src/northbridge/amd/pi/Kconfig b/src/northbridge/amd/pi/Kconfig index 65c6556..b41c26a 100644 --- a/src/northbridge/amd/pi/Kconfig +++ b/src/northbridge/amd/pi/Kconfig @@ -53,4 +53,8 @@ hex default 0xc0000
+config NUM_OF_IOAPICS + int + default 3 + endif # NORTHBRIDGE_AMD_PI
Kyösti Mälkki has uploaded a new patch set (#2) to the change originally created by Michał Żygowski. ( https://review.coreboot.org/c/coreboot/+/37169 )
Change subject: binaryPI: Use Kconfig to define the number of IOAPICs ......................................................................
binaryPI: Use Kconfig to define the number of IOAPICs
Define the number of IOAPICs in a Kconfig to get rid of AmdGetValue calls being not conformant to AGESA API.
Change-Id: I532597dd326093455358a23aef3b3ea0d0a14f75 Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com --- M src/northbridge/amd/pi/00630F01/northbridge.c M src/northbridge/amd/pi/00660F01/northbridge.c M src/northbridge/amd/pi/00730F01/northbridge.c M src/northbridge/amd/pi/Kconfig 4 files changed, 16 insertions(+), 38 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/37169/2
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37169 )
Change subject: binaryPI: Use Kconfig to define the number of IOAPICs ......................................................................
Patch Set 2:
Please set "topic branch" binarypi-wrapper-killer
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37169 )
Change subject: binaryPI: Use Kconfig to define the number of IOAPICs ......................................................................
Patch Set 2: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37169 )
Change subject: binaryPI: Use Kconfig to define the number of IOAPICs ......................................................................
binaryPI: Use Kconfig to define the number of IOAPICs
Define the number of IOAPICs in a Kconfig to get rid of AmdGetValue calls being not conformant to AGESA API.
Change-Id: I532597dd326093455358a23aef3b3ea0d0a14f75 Signed-off-by: Michał Żygowski michal.zygowski@3mdeb.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/37169 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/northbridge/amd/pi/00630F01/northbridge.c M src/northbridge/amd/pi/00660F01/northbridge.c M src/northbridge/amd/pi/00730F01/northbridge.c M src/northbridge/amd/pi/Kconfig 4 files changed, 16 insertions(+), 38 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved
diff --git a/src/northbridge/amd/pi/00630F01/northbridge.c b/src/northbridge/amd/pi/00630F01/northbridge.c index 40d3e05..6bb1217 100644 --- a/src/northbridge/amd/pi/00630F01/northbridge.c +++ b/src/northbridge/amd/pi/00630F01/northbridge.c @@ -27,7 +27,6 @@ #include <cpu/cpu.h> #include <Porting.h> #include <AGESA.h> -#include <FieldAccessors.h> #include <Topology.h> #include <cpu/x86/lapic.h> #include <cpu/amd/msr.h> @@ -798,21 +797,12 @@ int siblings = 0; unsigned int family; u32 modules = 0; - VOID* modules_ptr = &modules; - BUILD_OPT_CFG* options = NULL; int ioapic_count = 0;
- // TODO Remove the printk's. - printk(BIOS_SPEW, "KaveriPI Debug: Grabbing the AMD Topology Information.\n"); - AmdGetValue(AMD_GLOBAL_USER_OPTIONS, (VOID**)&options, sizeof(options)); - AmdGetValue(AMD_GLOBAL_NUM_MODULES, &modules_ptr, sizeof(modules)); - modules = *(u32*)modules_ptr; - ASSERT(modules > 0); - ASSERT(options); - ioapic_count = (int)options->CfgPlatNumIoApics; - ASSERT(ioapic_count > 0); - printk(BIOS_SPEW, "KaveriPI Debug: AMD Topology Number of Modules (@0x%p) is %d\n", modules_ptr, modules); - printk(BIOS_SPEW, "KaveriPI Debug: AMD Topology Number of IOAPICs (@0x%p) is %d\n", options, (int)(options->CfgPlatNumIoApics)); + /* For binaryPI there is no multiprocessor configuration, the number of + * modules will always be 1. */ + modules = 1; + ioapic_count = CONFIG_NUM_OF_IOAPICS;
dev_mc = pcidev_on_root(DEV_CDB, 0); if (!dev_mc) { diff --git a/src/northbridge/amd/pi/00660F01/northbridge.c b/src/northbridge/amd/pi/00660F01/northbridge.c index 533b651..723e6f4 100644 --- a/src/northbridge/amd/pi/00660F01/northbridge.c +++ b/src/northbridge/amd/pi/00660F01/northbridge.c @@ -27,7 +27,6 @@ #include <cpu/cpu.h> #include <Porting.h> #include <AGESA.h> -#include <FieldAccessors.h> #include <Topology.h> #include <cpu/x86/lapic.h> #include <cpu/amd/msr.h> @@ -796,17 +795,12 @@ int siblings = 0; unsigned int family; u32 modules = 0; - VOID* modules_ptr = &modules; - BUILD_OPT_CFG* options = NULL; int ioapic_count = 0;
- AmdGetValue(AMD_GLOBAL_USER_OPTIONS, (VOID**)&options, sizeof(options)); - AmdGetValue(AMD_GLOBAL_NUM_MODULES, &modules_ptr, sizeof(modules)); - modules = (*(u32 *)modules_ptr) & ((1ull << (sizeof(modules) * 8)) - 1); - ASSERT(modules > 0); - ASSERT(options); - ioapic_count = (int)options->CfgPlatNumIoApics; - ASSERT(ioapic_count > 0); + /* For binaryPI there is no multiprocessor configuration, the number of + * modules will always be 1. */ + modules = 1; + ioapic_count = CONFIG_NUM_OF_IOAPICS;
dev_mc = pcidev_on_root(DEV_CDB, 0); if (!dev_mc) { diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c index 27e14f5..3d7b883 100644 --- a/src/northbridge/amd/pi/00730F01/northbridge.c +++ b/src/northbridge/amd/pi/00730F01/northbridge.c @@ -29,7 +29,6 @@ #include <cpu/cpu.h> #include <Porting.h> #include <AGESA.h> -#include <FieldAccessors.h> #include <Topology.h> #include <cpu/x86/lapic.h> #include <cpu/amd/msr.h> @@ -1031,21 +1030,12 @@ int siblings = 0; unsigned int family; u32 modules = 0; - VOID* modules_ptr = &modules; - BUILD_OPT_CFG* options = NULL; int ioapic_count = 0;
- // TODO Remove the printk's. - printk(BIOS_SPEW, "MullinsPI Debug: Grabbing the AMD Topology Information.\n"); - AmdGetValue(AMD_GLOBAL_USER_OPTIONS, (VOID**)&options, sizeof(options)); - AmdGetValue(AMD_GLOBAL_NUM_MODULES, &modules_ptr, sizeof(modules)); - modules = *(u32*)modules_ptr; - ASSERT(modules > 0); - ASSERT(options); - ioapic_count = (int)options->CfgPlatNumIoApics; - ASSERT(ioapic_count > 0); - printk(BIOS_SPEW, "MullinsPI Debug: AMD Topology Number of Modules (@0x%p) is %d\n", modules_ptr, modules); - printk(BIOS_SPEW, "MullinsPI Debug: AMD Topology Number of IOAPICs (@0x%p) is %d\n", options, (int)options->CfgPlatNumIoApics); + /* For binaryPI there is no multiprocessor configuration, the number of + * modules will always be 1. */ + modules = 1; + ioapic_count = CONFIG_NUM_OF_IOAPICS;
dev_mc = pcidev_on_root(DEV_CDB, 0); if (!dev_mc) { diff --git a/src/northbridge/amd/pi/Kconfig b/src/northbridge/amd/pi/Kconfig index 4fbcd4a..167d957 100644 --- a/src/northbridge/amd/pi/Kconfig +++ b/src/northbridge/amd/pi/Kconfig @@ -54,4 +54,8 @@ hex default 0xc0000
+config NUM_OF_IOAPICS + int + default 3 + endif # NORTHBRIDGE_AMD_PI