blob: 06d2cd50af0b9d4d8b28ee48a9d1fa23cdfd476f [file] [log] [blame]
Jani Nikula707d26d2019-08-07 15:04:15 +03001/* SPDX-License-Identifier: MIT */
2/*
3 * Copyright 2019 Intel Corporation.
4 */
5
6#ifndef __INTEL_PCH__
7#define __INTEL_PCH__
8
9struct drm_i915_private;
10
11/*
12 * Sorted by south display engine compatibility.
13 * If the new PCH comes with a south display engine that is not
14 * inherited from the latest item, please do not add it to the
15 * end. Instead, add it right after its "parent" PCH.
16 */
17enum intel_pch {
18 PCH_NOP = -1, /* PCH without south display */
19 PCH_NONE = 0, /* No PCH present */
20 PCH_IBX, /* Ibexpeak PCH */
21 PCH_CPT, /* Cougarpoint/Pantherpoint PCH */
22 PCH_LPT, /* Lynxpoint/Wildcatpoint PCH */
23 PCH_SPT, /* Sunrisepoint/Kaby Lake PCH */
24 PCH_CNP, /* Cannon/Comet Lake PCH */
25 PCH_ICP, /* Ice Lake PCH */
Matt Roper943682e2019-10-15 09:28:54 -070026 PCH_JSP, /* Jasper Lake PCH */
Jani Nikula707d26d2019-08-07 15:04:15 +030027 PCH_MCC, /* Mule Creek Canyon PCH */
28 PCH_TGP, /* Tiger Lake PCH */
Lucas De Marchi51e3a642020-07-13 11:23:21 -070029
30 /* Fake PCHs, functionality handled on the same PCI dev */
31 PCH_DG1 = 1024,
Jani Nikula707d26d2019-08-07 15:04:15 +030032};
33
34#define INTEL_PCH_DEVICE_ID_MASK 0xff80
35#define INTEL_PCH_IBX_DEVICE_ID_TYPE 0x3b00
36#define INTEL_PCH_CPT_DEVICE_ID_TYPE 0x1c00
37#define INTEL_PCH_PPT_DEVICE_ID_TYPE 0x1e00
38#define INTEL_PCH_LPT_DEVICE_ID_TYPE 0x8c00
39#define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE 0x9c00
40#define INTEL_PCH_WPT_DEVICE_ID_TYPE 0x8c80
41#define INTEL_PCH_WPT_LP_DEVICE_ID_TYPE 0x9c80
42#define INTEL_PCH_SPT_DEVICE_ID_TYPE 0xA100
43#define INTEL_PCH_SPT_LP_DEVICE_ID_TYPE 0x9D00
44#define INTEL_PCH_KBP_DEVICE_ID_TYPE 0xA280
45#define INTEL_PCH_CNP_DEVICE_ID_TYPE 0xA300
46#define INTEL_PCH_CNP_LP_DEVICE_ID_TYPE 0x9D80
47#define INTEL_PCH_CMP_DEVICE_ID_TYPE 0x0280
Matt Roper8698ba52019-09-16 16:32:51 -070048#define INTEL_PCH_CMP2_DEVICE_ID_TYPE 0x0680
Imre Deak50a50652019-11-12 12:46:08 +020049#define INTEL_PCH_CMP_V_DEVICE_ID_TYPE 0xA380
Jani Nikula707d26d2019-08-07 15:04:15 +030050#define INTEL_PCH_ICP_DEVICE_ID_TYPE 0x3480
51#define INTEL_PCH_MCC_DEVICE_ID_TYPE 0x4B00
Jani Nikula707d26d2019-08-07 15:04:15 +030052#define INTEL_PCH_TGP_DEVICE_ID_TYPE 0xA080
James Ausmus6cf6e592019-11-05 16:55:26 -080053#define INTEL_PCH_TGP2_DEVICE_ID_TYPE 0x4380
Matt Roper943682e2019-10-15 09:28:54 -070054#define INTEL_PCH_JSP_DEVICE_ID_TYPE 0x4D80
55#define INTEL_PCH_JSP2_DEVICE_ID_TYPE 0x3880
Jani Nikula707d26d2019-08-07 15:04:15 +030056#define INTEL_PCH_P2X_DEVICE_ID_TYPE 0x7100
57#define INTEL_PCH_P3X_DEVICE_ID_TYPE 0x7000
58#define INTEL_PCH_QEMU_DEVICE_ID_TYPE 0x2900 /* qemu q35 has 2918 */
59
60#define INTEL_PCH_TYPE(dev_priv) ((dev_priv)->pch_type)
61#define INTEL_PCH_ID(dev_priv) ((dev_priv)->pch_id)
Lucas De Marchi51e3a642020-07-13 11:23:21 -070062#define HAS_PCH_DG1(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_DG1)
Matt Roper943682e2019-10-15 09:28:54 -070063#define HAS_PCH_JSP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_JSP)
Jani Nikula707d26d2019-08-07 15:04:15 +030064#define HAS_PCH_MCC(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_MCC)
65#define HAS_PCH_TGP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_TGP)
66#define HAS_PCH_ICP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_ICP)
67#define HAS_PCH_CNP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_CNP)
68#define HAS_PCH_SPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_SPT)
69#define HAS_PCH_LPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_LPT)
70#define HAS_PCH_LPT_LP(dev_priv) \
71 (INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE || \
72 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE)
73#define HAS_PCH_LPT_H(dev_priv) \
74 (INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_DEVICE_ID_TYPE || \
75 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_DEVICE_ID_TYPE)
76#define HAS_PCH_CPT(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_CPT)
77#define HAS_PCH_IBX(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_IBX)
78#define HAS_PCH_NOP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_NOP)
79#define HAS_PCH_SPLIT(dev_priv) (INTEL_PCH_TYPE(dev_priv) != PCH_NONE)
80
81void intel_detect_pch(struct drm_i915_private *dev_priv);
82
83#endif /* __INTEL_PCH__ */