Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/78826?usp=email )
Change subject: nb/intel/sandybridge: Use SA devid to identify PC type ......................................................................
nb/intel/sandybridge: Use SA devid to identify PC type
Instead or using MSR IA32_PLATFORM_ID read the SystemAgent device id to figure out the PC type. This follows the BWG which suggest to not use MSR IA32_PLATFORM_ID for system identification.
Change-Id: Ibddf6c75d15ca7a99758c377ed956d483abe7ec1 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/cpu/intel/model_206ax/Makefile.inc D src/cpu/intel/model_206ax/common.c M src/northbridge/intel/sandybridge/common.c 3 files changed, 9 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/78826/1
diff --git a/src/cpu/intel/model_206ax/Makefile.inc b/src/cpu/intel/model_206ax/Makefile.inc index cd947df..e6e6e37 100644 --- a/src/cpu/intel/model_206ax/Makefile.inc +++ b/src/cpu/intel/model_206ax/Makefile.inc @@ -9,10 +9,6 @@
ramstage-y += acpi.c
-ramstage-y += common.c -romstage-y += common.c -smm-y += common.c - smm-y += finalize.c
cpu_microcode_bins += $(wildcard 3rdparty/intel-microcode/intel-ucode/06-2a-*) diff --git a/src/cpu/intel/model_206ax/common.c b/src/cpu/intel/model_206ax/common.c deleted file mode 100644 index a881314..0000000 --- a/src/cpu/intel/model_206ax/common.c +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include <cpu/x86/msr.h> -#include "model_206ax.h" - -int get_platform_id(void) -{ - msr_t msr; - - msr = rdmsr(IA32_PLATFORM_ID); - /* Read Platform Id Bits 52:50 */ - return (msr.hi >> 18) & 0x7; -} diff --git a/src/northbridge/intel/sandybridge/common.c b/src/northbridge/intel/sandybridge/common.c index a8f718c..9625f6b 100644 --- a/src/northbridge/intel/sandybridge/common.c +++ b/src/northbridge/intel/sandybridge/common.c @@ -2,14 +2,18 @@
#include <console/console.h> #include <device/device.h> -#include <cpu/intel/model_206ax/model_206ax.h> #include "sandybridge.h"
enum platform_type get_platform_type(void) { - const int id = get_platform_id(); - if (id != 1 && id != 4) - printk(BIOS_WARNING, "Unknown platform id 0x%x\n", id); + struct device *dev = pcidev_on_root(0, 0);
- return (id == 4) ? PLATFORM_MOBILE : PLATFORM_DESKTOP_SERVER; + switch (pci_read_config16(dev, PCI_DEVICE_ID) & 0xc) { + case 0x0: /* Desktop */ + return PLATFORM_DESKTOP_SERVER; + case 0x4: /* Mobile */ + return PLATFORM_MOBILE; + case 0x8: /* Server */ + return PLATFORM_DESKTOP_SERVER; + } }