162306a36Sopenharmony_ci/* SPDX-License-Identifier: MIT */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright 2019 Intel Corporation.
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#ifndef __INTEL_PCH__
762306a36Sopenharmony_ci#define __INTEL_PCH__
862306a36Sopenharmony_ci
962306a36Sopenharmony_cistruct drm_i915_private;
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci/*
1262306a36Sopenharmony_ci * Sorted by south display engine compatibility.
1362306a36Sopenharmony_ci * If the new PCH comes with a south display engine that is not
1462306a36Sopenharmony_ci * inherited from the latest item, please do not add it to the
1562306a36Sopenharmony_ci * end. Instead, add it right after its "parent" PCH.
1662306a36Sopenharmony_ci */
1762306a36Sopenharmony_cienum intel_pch {
1862306a36Sopenharmony_ci	PCH_NOP = -1,	/* PCH without south display */
1962306a36Sopenharmony_ci	PCH_NONE = 0,	/* No PCH present */
2062306a36Sopenharmony_ci	PCH_IBX,	/* Ibexpeak PCH */
2162306a36Sopenharmony_ci	PCH_CPT,	/* Cougarpoint/Pantherpoint PCH */
2262306a36Sopenharmony_ci	PCH_LPT,	/* Lynxpoint/Wildcatpoint PCH */
2362306a36Sopenharmony_ci	PCH_SPT,        /* Sunrisepoint/Kaby Lake PCH */
2462306a36Sopenharmony_ci	PCH_CNP,        /* Cannon/Comet Lake PCH */
2562306a36Sopenharmony_ci	PCH_ICP,	/* Ice Lake/Jasper Lake PCH */
2662306a36Sopenharmony_ci	PCH_TGP,	/* Tiger Lake/Mule Creek Canyon PCH */
2762306a36Sopenharmony_ci	PCH_ADP,	/* Alder Lake PCH */
2862306a36Sopenharmony_ci	PCH_MTP,	/* Meteor Lake PCH */
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci	/* Fake PCHs, functionality handled on the same PCI dev */
3162306a36Sopenharmony_ci	PCH_DG1 = 1024,
3262306a36Sopenharmony_ci	PCH_DG2,
3362306a36Sopenharmony_ci};
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci#define INTEL_PCH_DEVICE_ID_MASK		0xff80
3662306a36Sopenharmony_ci#define INTEL_PCH_IBX_DEVICE_ID_TYPE		0x3b00
3762306a36Sopenharmony_ci#define INTEL_PCH_CPT_DEVICE_ID_TYPE		0x1c00
3862306a36Sopenharmony_ci#define INTEL_PCH_PPT_DEVICE_ID_TYPE		0x1e00
3962306a36Sopenharmony_ci#define INTEL_PCH_LPT_DEVICE_ID_TYPE		0x8c00
4062306a36Sopenharmony_ci#define INTEL_PCH_LPT_LP_DEVICE_ID_TYPE		0x9c00
4162306a36Sopenharmony_ci#define INTEL_PCH_WPT_DEVICE_ID_TYPE		0x8c80
4262306a36Sopenharmony_ci#define INTEL_PCH_WPT_LP_DEVICE_ID_TYPE		0x9c80
4362306a36Sopenharmony_ci#define INTEL_PCH_SPT_DEVICE_ID_TYPE		0xA100
4462306a36Sopenharmony_ci#define INTEL_PCH_SPT_LP_DEVICE_ID_TYPE		0x9D00
4562306a36Sopenharmony_ci#define INTEL_PCH_KBP_DEVICE_ID_TYPE		0xA280
4662306a36Sopenharmony_ci#define INTEL_PCH_CNP_DEVICE_ID_TYPE		0xA300
4762306a36Sopenharmony_ci#define INTEL_PCH_CNP_LP_DEVICE_ID_TYPE		0x9D80
4862306a36Sopenharmony_ci#define INTEL_PCH_CMP_DEVICE_ID_TYPE		0x0280
4962306a36Sopenharmony_ci#define INTEL_PCH_CMP2_DEVICE_ID_TYPE		0x0680
5062306a36Sopenharmony_ci#define INTEL_PCH_CMP_V_DEVICE_ID_TYPE		0xA380
5162306a36Sopenharmony_ci#define INTEL_PCH_ICP_DEVICE_ID_TYPE		0x3480
5262306a36Sopenharmony_ci#define INTEL_PCH_ICP2_DEVICE_ID_TYPE		0x3880
5362306a36Sopenharmony_ci#define INTEL_PCH_MCC_DEVICE_ID_TYPE		0x4B00
5462306a36Sopenharmony_ci#define INTEL_PCH_TGP_DEVICE_ID_TYPE		0xA080
5562306a36Sopenharmony_ci#define INTEL_PCH_TGP2_DEVICE_ID_TYPE		0x4380
5662306a36Sopenharmony_ci#define INTEL_PCH_JSP_DEVICE_ID_TYPE		0x4D80
5762306a36Sopenharmony_ci#define INTEL_PCH_ADP_DEVICE_ID_TYPE		0x7A80
5862306a36Sopenharmony_ci#define INTEL_PCH_ADP2_DEVICE_ID_TYPE		0x5180
5962306a36Sopenharmony_ci#define INTEL_PCH_ADP3_DEVICE_ID_TYPE		0x7A00
6062306a36Sopenharmony_ci#define INTEL_PCH_ADP4_DEVICE_ID_TYPE		0x5480
6162306a36Sopenharmony_ci#define INTEL_PCH_MTP_DEVICE_ID_TYPE		0x7E00
6262306a36Sopenharmony_ci#define INTEL_PCH_MTP2_DEVICE_ID_TYPE		0xAE00
6362306a36Sopenharmony_ci#define INTEL_PCH_P2X_DEVICE_ID_TYPE		0x7100
6462306a36Sopenharmony_ci#define INTEL_PCH_P3X_DEVICE_ID_TYPE		0x7000
6562306a36Sopenharmony_ci#define INTEL_PCH_QEMU_DEVICE_ID_TYPE		0x2900 /* qemu q35 has 2918 */
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci#define INTEL_PCH_TYPE(dev_priv)		((dev_priv)->pch_type)
6862306a36Sopenharmony_ci#define INTEL_PCH_ID(dev_priv)			((dev_priv)->pch_id)
6962306a36Sopenharmony_ci#define HAS_PCH_MTP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_MTP)
7062306a36Sopenharmony_ci#define HAS_PCH_DG2(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_DG2)
7162306a36Sopenharmony_ci#define HAS_PCH_ADP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_ADP)
7262306a36Sopenharmony_ci#define HAS_PCH_DG1(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_DG1)
7362306a36Sopenharmony_ci#define HAS_PCH_TGP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_TGP)
7462306a36Sopenharmony_ci#define HAS_PCH_ICP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_ICP)
7562306a36Sopenharmony_ci#define HAS_PCH_CNP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_CNP)
7662306a36Sopenharmony_ci#define HAS_PCH_SPT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_SPT)
7762306a36Sopenharmony_ci#define HAS_PCH_LPT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_LPT)
7862306a36Sopenharmony_ci#define HAS_PCH_LPT_LP(dev_priv) \
7962306a36Sopenharmony_ci	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_LP_DEVICE_ID_TYPE || \
8062306a36Sopenharmony_ci	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_LP_DEVICE_ID_TYPE)
8162306a36Sopenharmony_ci#define HAS_PCH_LPT_H(dev_priv) \
8262306a36Sopenharmony_ci	(INTEL_PCH_ID(dev_priv) == INTEL_PCH_LPT_DEVICE_ID_TYPE || \
8362306a36Sopenharmony_ci	 INTEL_PCH_ID(dev_priv) == INTEL_PCH_WPT_DEVICE_ID_TYPE)
8462306a36Sopenharmony_ci#define HAS_PCH_CPT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_CPT)
8562306a36Sopenharmony_ci#define HAS_PCH_IBX(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_IBX)
8662306a36Sopenharmony_ci#define HAS_PCH_NOP(dev_priv)			(INTEL_PCH_TYPE(dev_priv) == PCH_NOP)
8762306a36Sopenharmony_ci#define HAS_PCH_SPLIT(dev_priv)			(INTEL_PCH_TYPE(dev_priv) != PCH_NONE)
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_civoid intel_detect_pch(struct drm_i915_private *dev_priv);
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci#endif /* __INTEL_PCH__ */
92