blob: a6704914acb9eead12008ec4910292f77804ed49 [file] [log] [blame]
Angel Pons6e5aabd2020-03-23 23:44:42 +01001/* SPDX-License-Identifier: GPL-2.0-only */
Patrick Rudolph74203de2017-11-20 11:57:01 +01002
Patrick Rudolph74203de2017-11-20 11:57:01 +01003#include <console/console.h>
4#include <device/device.h>
Patrick Rudolph51518e52023-10-29 19:44:52 +01005#include <device/pci_def.h>
6#include <device/pci_ops.h>
Patrick Rudolph74203de2017-11-20 11:57:01 +01007#include "sandybridge.h"
8
9enum platform_type get_platform_type(void)
10{
Patrick Rudolph51518e52023-10-29 19:44:52 +010011 switch (pci_s_read_config16(HOST_BRIDGE, PCI_DEVICE_ID) & 0xc) {
12 case 0x0: /* Desktop */
13 return PLATFORM_DESKTOP_SERVER;
14 case 0x4: /* Mobile */
15 return PLATFORM_MOBILE;
16 case 0x8: /* Server */
17 default:
18 return PLATFORM_DESKTOP_SERVER;
19 }
Patrick Rudolph74203de2017-11-20 11:57:01 +010020}