Angel Pons | 6e5aabd | 2020-03-23 23:44:42 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Rudolph | 74203de | 2017-11-20 11:57:01 +0100 | [diff] [blame] | 2 | |
Patrick Rudolph | 74203de | 2017-11-20 11:57:01 +0100 | [diff] [blame] | 3 | #include <console/console.h> |
| 4 | #include <device/device.h> |
Patrick Rudolph | 51518e5 | 2023-10-29 19:44:52 +0100 | [diff] [blame] | 5 | #include <device/pci_def.h> |
| 6 | #include <device/pci_ops.h> |
Patrick Rudolph | 74203de | 2017-11-20 11:57:01 +0100 | [diff] [blame] | 7 | #include "sandybridge.h" |
| 8 | |
| 9 | enum platform_type get_platform_type(void) |
| 10 | { |
Patrick Rudolph | 51518e5 | 2023-10-29 19:44:52 +0100 | [diff] [blame] | 11 | 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 Rudolph | 74203de | 2017-11-20 11:57:01 +0100 | [diff] [blame] | 20 | } |