162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (c) 2017, The Linux Foundation. All rights reserved. 462306a36Sopenharmony_ci */ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#ifndef QCOM_PHY_QMP_H_ 762306a36Sopenharmony_ci#define QCOM_PHY_QMP_H_ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-com.h" 1062306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx.h" 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-com-v3.h" 1362306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v3.h" 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-com-v4.h" 1662306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v4.h" 1762306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v4_20.h" 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-com-v5.h" 2062306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v5.h" 2162306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v5_20.h" 2262306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v5_5nm.h" 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-com-v6.h" 2562306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v6.h" 2662306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-txrx-v6_20.h" 2762306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-ln-shrd-v6.h" 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci#include "phy-qcom-qmp-qserdes-pll.h" 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v2.h" 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v3.h" 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v4.h" 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v4_20.h" 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v5.h" 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v5_20.h" 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v6.h" 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci#include "phy-qcom-qmp-pcs-v6_20.h" 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci/* Only for QMP V3 & V4 PHY - DP COM registers */ 4862306a36Sopenharmony_ci#define QPHY_V3_DP_COM_PHY_MODE_CTRL 0x00 4962306a36Sopenharmony_ci#define QPHY_V3_DP_COM_SW_RESET 0x04 5062306a36Sopenharmony_ci#define QPHY_V3_DP_COM_POWER_DOWN_CTRL 0x08 5162306a36Sopenharmony_ci#define QPHY_V3_DP_COM_SWI_CTRL 0x0c 5262306a36Sopenharmony_ci#define QPHY_V3_DP_COM_TYPEC_CTRL 0x10 5362306a36Sopenharmony_ci#define QPHY_V3_DP_COM_TYPEC_PWRDN_CTRL 0x14 5462306a36Sopenharmony_ci#define QPHY_V3_DP_COM_RESET_OVRD_CTRL 0x1c 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci/* QSERDES V3 COM bits */ 5762306a36Sopenharmony_ci# define QSERDES_V3_COM_BIAS_EN 0x0001 5862306a36Sopenharmony_ci# define QSERDES_V3_COM_BIAS_EN_MUX 0x0002 5962306a36Sopenharmony_ci# define QSERDES_V3_COM_CLKBUF_R_EN 0x0004 6062306a36Sopenharmony_ci# define QSERDES_V3_COM_CLKBUF_L_EN 0x0008 6162306a36Sopenharmony_ci# define QSERDES_V3_COM_EN_SYSCLK_TX_SEL 0x0010 6262306a36Sopenharmony_ci# define QSERDES_V3_COM_CLKBUF_RX_DRIVE_L 0x0020 6362306a36Sopenharmony_ci# define QSERDES_V3_COM_CLKBUF_RX_DRIVE_R 0x0040 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ci/* QSERDES V3 TX bits */ 6662306a36Sopenharmony_ci# define DP_PHY_TXn_TX_EMP_POST1_LVL_MASK 0x001f 6762306a36Sopenharmony_ci# define DP_PHY_TXn_TX_EMP_POST1_LVL_MUX_EN 0x0020 6862306a36Sopenharmony_ci# define DP_PHY_TXn_TX_DRV_LVL_MASK 0x001f 6962306a36Sopenharmony_ci# define DP_PHY_TXn_TX_DRV_LVL_MUX_EN 0x0020 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci/* QMP PHY - DP PHY registers */ 7262306a36Sopenharmony_ci#define QSERDES_DP_PHY_REVISION_ID0 0x000 7362306a36Sopenharmony_ci#define QSERDES_DP_PHY_REVISION_ID1 0x004 7462306a36Sopenharmony_ci#define QSERDES_DP_PHY_REVISION_ID2 0x008 7562306a36Sopenharmony_ci#define QSERDES_DP_PHY_REVISION_ID3 0x00c 7662306a36Sopenharmony_ci#define QSERDES_DP_PHY_CFG 0x010 7762306a36Sopenharmony_ci#define QSERDES_DP_PHY_PD_CTL 0x018 7862306a36Sopenharmony_ci# define DP_PHY_PD_CTL_PWRDN 0x001 7962306a36Sopenharmony_ci# define DP_PHY_PD_CTL_PSR_PWRDN 0x002 8062306a36Sopenharmony_ci# define DP_PHY_PD_CTL_AUX_PWRDN 0x004 8162306a36Sopenharmony_ci# define DP_PHY_PD_CTL_LANE_0_1_PWRDN 0x008 8262306a36Sopenharmony_ci# define DP_PHY_PD_CTL_LANE_2_3_PWRDN 0x010 8362306a36Sopenharmony_ci# define DP_PHY_PD_CTL_PLL_PWRDN 0x020 8462306a36Sopenharmony_ci# define DP_PHY_PD_CTL_DP_CLAMP_EN 0x040 8562306a36Sopenharmony_ci#define QSERDES_DP_PHY_MODE 0x01c 8662306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG0 0x020 8762306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG1 0x024 8862306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG2 0x028 8962306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG3 0x02c 9062306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG4 0x030 9162306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG5 0x034 9262306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG6 0x038 9362306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG7 0x03c 9462306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG8 0x040 9562306a36Sopenharmony_ci#define QSERDES_DP_PHY_AUX_CFG9 0x044 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci/* Only for QMP V3 PHY - DP PHY registers */ 9862306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK 0x048 9962306a36Sopenharmony_ci# define PHY_AUX_STOP_ERR_MASK 0x01 10062306a36Sopenharmony_ci# define PHY_AUX_DEC_ERR_MASK 0x02 10162306a36Sopenharmony_ci# define PHY_AUX_SYNC_ERR_MASK 0x04 10262306a36Sopenharmony_ci# define PHY_AUX_ALIGN_ERR_MASK 0x08 10362306a36Sopenharmony_ci# define PHY_AUX_REQ_ERR_MASK 0x10 10462306a36Sopenharmony_ci 10562306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_AUX_INTERRUPT_CLEAR 0x04c 10662306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_AUX_BIST_CFG 0x050 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_VCO_DIV 0x064 10962306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_TX0_TX1_LANE_CTL 0x06c 11062306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_TX2_TX3_LANE_CTL 0x088 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_SPARE0 0x0ac 11362306a36Sopenharmony_ci#define DP_PHY_SPARE0_MASK 0x0f 11462306a36Sopenharmony_ci#define DP_PHY_SPARE0_ORIENTATION_INFO_SHIFT 0x04(0x0004) 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_ci#define QSERDES_V3_DP_PHY_STATUS 0x0c0 11762306a36Sopenharmony_ci 11862306a36Sopenharmony_ci/* Only for QMP V4 PHY - DP PHY registers */ 11962306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_CFG_1 0x014 12062306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_AUX_INTERRUPT_MASK 0x054 12162306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_AUX_INTERRUPT_CLEAR 0x058 12262306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_VCO_DIV 0x070 12362306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_TX0_TX1_LANE_CTL 0x078 12462306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_TX2_TX3_LANE_CTL 0x09c 12562306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_SPARE0 0x0c8 12662306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_AUX_INTERRUPT_STATUS 0x0d8 12762306a36Sopenharmony_ci#define QSERDES_V4_DP_PHY_STATUS 0x0dc 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci/* Only for QMP V4 PHY - PCS_MISC registers */ 13062306a36Sopenharmony_ci#define QPHY_V4_PCS_MISC_TYPEC_CTRL 0x00 13162306a36Sopenharmony_ci#define QPHY_V4_PCS_MISC_TYPEC_PWRDN_CTRL 0x04 13262306a36Sopenharmony_ci#define QPHY_V4_PCS_MISC_PCS_MISC_CONFIG1 0x08 13362306a36Sopenharmony_ci#define QPHY_V4_PCS_MISC_CLAMP_ENABLE 0x0c 13462306a36Sopenharmony_ci#define QPHY_V4_PCS_MISC_TYPEC_STATUS 0x10 13562306a36Sopenharmony_ci#define QPHY_V4_PCS_MISC_PLACEHOLDER_STATUS 0x14 13662306a36Sopenharmony_ci 13762306a36Sopenharmony_ci#define QSERDES_V5_DP_PHY_STATUS 0x0dc 13862306a36Sopenharmony_ci 13962306a36Sopenharmony_ci/* Only for QMP V6 PHY - DP PHY registers */ 14062306a36Sopenharmony_ci#define QSERDES_V6_DP_PHY_AUX_INTERRUPT_STATUS 0x0e0 14162306a36Sopenharmony_ci#define QSERDES_V6_DP_PHY_STATUS 0x0e4 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci#endif 144