18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: MIT */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright 2019 Intel Corporation.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef __INTEL_PCH__
78c2ecf20Sopenharmony_ci#define __INTEL_PCH__
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cistruct drm_i915_private;
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci/*
128c2ecf20Sopenharmony_ci * Sorted by south display engine compatibility.
138c2ecf20Sopenharmony_ci * If the new PCH comes with a south display engine that is not
148c2ecf20Sopenharmony_ci * inherited from the latest item, please do not add it to the
158c2ecf20Sopenharmony_ci * end. Instead, add it right after its "parent" PCH.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_cienum intel_pch {
188c2ecf20Sopenharmony_ci	PCH_NOP = -1,	/* PCH without south display */
198c2ecf20Sopenharmony_ci	PCH_NONE = 0,	/* No PCH present */
208c2ecf20Sopenharmony_ci	PCH_IBX,	/* Ibexpeak PCH */
218c2ecf20Sopenharmony_ci	PCH_CPT,	/* Cougarpoint/Pantherpoint PCH */
228c2ecf20Sopenharmony_ci	PCH_LPT,	/* Lynxpoint/Wildcatpoint PCH */
238c2ecf20Sopenharmony_ci	PCH_SPT,        /* Sunrisepoint/Kaby Lake PCH */
248c2ecf20Sopenharmony_ci	PCH_CNP,        /* Cannon/Comet Lake PCH */
258c2ecf20Sopenharmony_ci	PCH_ICP,	/* Ice Lake PCH */
268c2ecf20Sopenharmony_ci	PCH_JSP,	/* Jasper Lake PCH */
278c2ecf20Sopenharmony_ci	PCH_MCC,        /* Mule Creek Canyon PCH */
288c2ecf20Sopenharmony_ci	PCH_TGP,	/* Tiger Lake PCH */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci	/* Fake PCHs, functionality handled on the same PCI dev */
318c2ecf20Sopenharmony_ci	PCH_DG1 = 1024,
328c2ecf20Sopenharmony_ci};
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define INTEL_PCH_DEVICE_ID_MASK		0xff80
358c2ecf20Sopenharmony_ci#define INTEL_PCH_IBX_DEVICE_ID_TYPE		0x3b00
368c2ecf20Sopenharmony_ci#define INTEL_PCH_CPT_DEVICE_ID_TYPE		0x1c00
378c2ecf20Sopenharmony_ci#define INTEL_PCH_PPT_DEVICE_ID_TYPE		0x1e00
388c2ecf20Sopenharmony_ci#define INTEL_PCH_LPT_DEVICE_ID_TYPE		0x8c00
398c2ecf20Sopenharmony_ci#define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE		0x9c00
408c2ecf20Sopenharmony_ci#define INTEL_PCH_WPT_DEVICE_ID_TYPE		0x8c80
418c2ecf20Sopenharmony_ci#define INTEL_PCH_WPT_LP_DEVICE_ID_TYPE		0x9c80
428c2ecf20Sopenharmony_ci#define INTEL_PCH_SPT_DEVICE_ID_TYPE		0xA100
438c2ecf20Sopenharmony_ci#define INTEL_PCH_SPT_LP_DEVICE_ID_TYPE		0x9D00
448c2ecf20Sopenharmony_ci#define INTEL_PCH_KBP_DEVICE_ID_TYPE		0xA280
458c2ecf20Sopenharmony_ci#define INTEL_PCH_CNP_DEVICE_ID_TYPE		0xA300
468c2ecf20Sopenharmony_ci#define INTEL_PCH_CNP_LP_DEVICE_ID_TYPE		0x9D80
478c2ecf20Sopenharmony_ci#define INTEL_PCH_CMP_DEVICE_ID_TYPE		0x0280
488c2ecf20Sopenharmony_ci#define INTEL_PCH_CMP2_DEVICE_ID_TYPE		0x0680
498c2ecf20Sopenharmony_ci#define INTEL_PCH_CMP_V_DEVICE_ID_TYPE		0xA380
508c2ecf20Sopenharmony_ci#define INTEL_PCH_ICP_DEVICE_ID_TYPE		0x3480
518c2ecf20Sopenharmony_ci#define INTEL_PCH_ICP2_DEVICE_ID_TYPE		0x3880
528c2ecf20Sopenharmony_ci#define INTEL_PCH_MCC_DEVICE_ID_TYPE		0x4B00
538c2ecf20Sopenharmony_ci#define INTEL_PCH_TGP_DEVICE_ID_TYPE		0xA080
548c2ecf20Sopenharmony_ci#define INTEL_PCH_TGP2_DEVICE_ID_TYPE		0x4380
558c2ecf20Sopenharmony_ci#define INTEL_PCH_JSP_DEVICE_ID_TYPE		0x4D80
568c2ecf20Sopenharmony_ci#define INTEL_PCH_P2X_DEVICE_ID_TYPE		0x7100
578c2ecf20Sopenharmony_ci#define INTEL_PCH_P3X_DEVICE_ID_TYPE		0x7000
588c2ecf20Sopenharmony_ci#define INTEL_PCH_QEMU_DEVICE_ID_TYPE		0x2900 /* qemu q35 has 2918 */
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci#define INTEL_PCH_TYPE(dev_priv)		((dev_priv)->pch_type)
618c2ecf20Sopenharmony_ci#define INTEL_PCH_ID(dev_priv)			((dev_priv)->pch_id)
628c2ecf20Sopenharmony_ci#define HAS_PCH_DG1(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_DG1)
638c2ecf20Sopenharmony_ci#define HAS_PCH_JSP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_JSP)
648c2ecf20Sopenharmony_ci#define HAS_PCH_MCC(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_MCC)
658c2ecf20Sopenharmony_ci#define HAS_PCH_TGP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_TGP)
668c2ecf20Sopenharmony_ci#define HAS_PCH_ICP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_ICP)
678c2ecf20Sopenharmony_ci#define HAS_PCH_CNP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_CNP)
688c2ecf20Sopenharmony_ci#define HAS_PCH_SPT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_SPT)
698c2ecf20Sopenharmony_ci#define HAS_PCH_LPT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_LPT)
708c2ecf20Sopenharmony_ci#define HAS_PCH_LPT_LP(dev_priv) \
718c2ecf20Sopenharmony_ci	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE || \
728c2ecf20Sopenharmony_ci	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE)
738c2ecf20Sopenharmony_ci#define HAS_PCH_LPT_H(dev_priv) \
748c2ecf20Sopenharmony_ci	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_DEVICE_ID_TYPE || \
758c2ecf20Sopenharmony_ci	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_DEVICE_ID_TYPE)
768c2ecf20Sopenharmony_ci#define HAS_PCH_CPT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_CPT)
778c2ecf20Sopenharmony_ci#define HAS_PCH_IBX(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_IBX)
788c2ecf20Sopenharmony_ci#define HAS_PCH_NOP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_NOP)
798c2ecf20Sopenharmony_ci#define HAS_PCH_SPLIT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) != PCH_NONE)
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_civoid intel_detect_pch(struct drm_i915_private *dev_priv);
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#endif /* __INTEL_PCH__ */
84