diff options
Diffstat (limited to 'src/northbridge')
-rw-r--r-- | src/northbridge/intel/sandybridge/common.c | 17 | ||||
-rw-r--r-- | src/northbridge/intel/sandybridge/early_init.c | 6 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/northbridge/intel/sandybridge/common.c b/src/northbridge/intel/sandybridge/common.c index a8f718c184..a6704914ac 100644 --- a/src/northbridge/intel/sandybridge/common.c +++ b/src/northbridge/intel/sandybridge/common.c @@ -2,14 +2,19 @@ #include <console/console.h> #include <device/device.h> -#include <cpu/intel/model_206ax/model_206ax.h> +#include <device/pci_def.h> +#include <device/pci_ops.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); - - return (id == 4) ? PLATFORM_MOBILE : PLATFORM_DESKTOP_SERVER; + switch (pci_s_read_config16(HOST_BRIDGE, PCI_DEVICE_ID) & 0xc) { + case 0x0: /* Desktop */ + return PLATFORM_DESKTOP_SERVER; + case 0x4: /* Mobile */ + return PLATFORM_MOBILE; + case 0x8: /* Server */ + default: + return PLATFORM_DESKTOP_SERVER; + } } diff --git a/src/northbridge/intel/sandybridge/early_init.c b/src/northbridge/intel/sandybridge/early_init.c index e35251359a..a5ebf9d3a7 100644 --- a/src/northbridge/intel/sandybridge/early_init.c +++ b/src/northbridge/intel/sandybridge/early_init.c @@ -150,14 +150,13 @@ static void start_peg_link_training(void) void systemagent_early_init(void) { + const size_t is_mobile = get_platform_type() == PLATFORM_MOBILE; u32 capid0_a; u8 reg8; /* Device ID Override Enable should be done very early */ capid0_a = pci_read_config32(HOST_BRIDGE, CAPID0_A); if (capid0_a & (1 << 10)) { - const size_t is_mobile = get_platform_type() == PLATFORM_MOBILE; - reg8 = pci_read_config8(HOST_BRIDGE, DIDOR); reg8 &= ~7; /* Clear 2:0 */ @@ -167,6 +166,9 @@ void systemagent_early_init(void) pci_write_config8(HOST_BRIDGE, DIDOR, reg8); } + /* Print platform type */ + printk(BIOS_INFO, "Detected system type: %s\n", is_mobile ? "mobile" : "desktop"); + /* Setup all BARs required for early PCIe and raminit */ sandybridge_setup_bars(); |