blob: 0ee7e1d59bc23e510f3c3b38f3bf7c65de1fa779 [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 <device/device.h>
Patrick Rudolph51518e52023-10-29 19:44:52 +01004#include <device/pci_def.h>
5#include <device/pci_ops.h>
Patrick Rudolph74203de2017-11-20 11:57:01 +01006#include "sandybridge.h"
7
8enum platform_type get_platform_type(void)
9{
Patrick Rudolph51518e52023-10-29 19:44:52 +010010 switch (pci_s_read_config16(HOST_BRIDGE, PCI_DEVICE_ID) & 0xc) {
11 case 0x0: /* Desktop */
12 return PLATFORM_DESKTOP_SERVER;
13 case 0x4: /* Mobile */
14 return PLATFORM_MOBILE;
15 case 0x8: /* Server */
16 default:
17 return PLATFORM_DESKTOP_SERVER;
18 }
Patrick Rudolph74203de2017-11-20 11:57:01 +010019}