diff --git a/msm/dsi/dsi_catalog.c b/msm/dsi/dsi_catalog.c index 636f000c8c..1499566f2b 100644 --- a/msm/dsi/dsi_catalog.c +++ b/msm/dsi/dsi_catalog.c @@ -107,6 +107,7 @@ static void dsi_catalog_cmn_init(struct dsi_ctrl_hw *ctrl, case DSI_CTRL_VERSION_2_3: case DSI_CTRL_VERSION_2_4: case DSI_CTRL_VERSION_2_5: + case DSI_CTRL_VERSION_2_6: ctrl->ops.phy_reset_config = dsi_ctrl_hw_22_phy_reset_config; ctrl->ops.config_clk_gating = dsi_ctrl_hw_22_config_clk_gating; ctrl->ops.setup_lane_map = dsi_ctrl_hw_22_setup_lane_map; @@ -179,6 +180,7 @@ int dsi_catalog_ctrl_setup(struct dsi_ctrl_hw *ctrl, dsi_catalog_cmn_init(ctrl, version); break; case DSI_CTRL_VERSION_2_5: + case DSI_CTRL_VERSION_2_6: ctrl->widebus_support = true; ctrl->phy_isolation_enabled = phy_isolation_enabled; dsi_catalog_cmn_init(ctrl, version); @@ -332,6 +334,7 @@ int dsi_catalog_phy_setup(struct dsi_phy_hw *phy, case DSI_PHY_VERSION_4_0: case DSI_PHY_VERSION_4_1: case DSI_PHY_VERSION_4_2: + case DSI_PHY_VERSION_4_3: dsi_catalog_phy_4_0_init(phy); break; case DSI_PHY_VERSION_0_0_HPM: diff --git a/msm/dsi/dsi_ctrl.c b/msm/dsi/dsi_ctrl.c index c8ea6b77d9..375119282e 100644 --- a/msm/dsi/dsi_ctrl.c +++ b/msm/dsi/dsi_ctrl.c @@ -55,6 +55,7 @@ static const enum dsi_ctrl_version dsi_ctrl_v2_2 = DSI_CTRL_VERSION_2_2; static const enum dsi_ctrl_version dsi_ctrl_v2_3 = DSI_CTRL_VERSION_2_3; static const enum dsi_ctrl_version dsi_ctrl_v2_4 = DSI_CTRL_VERSION_2_4; static const enum dsi_ctrl_version dsi_ctrl_v2_5 = DSI_CTRL_VERSION_2_5; +static const enum dsi_ctrl_version dsi_ctrl_v2_6 = DSI_CTRL_VERSION_2_6; static const struct of_device_id msm_dsi_of_match[] = { { @@ -81,6 +82,10 @@ static const struct of_device_id msm_dsi_of_match[] = { .compatible = "qcom,dsi-ctrl-hw-v2.5", .data = &dsi_ctrl_v2_5, }, + { + .compatible = "qcom,dsi-ctrl-hw-v2.6", + .data = &dsi_ctrl_v2_6, + }, {} }; @@ -643,6 +648,7 @@ static int dsi_ctrl_init_regmap(struct platform_device *pdev, case DSI_CTRL_VERSION_2_3: case DSI_CTRL_VERSION_2_4: case DSI_CTRL_VERSION_2_5: + case DSI_CTRL_VERSION_2_6: ptr = msm_ioremap(pdev, "disp_cc_base", ctrl->name); if (IS_ERR(ptr)) { DSI_CTRL_ERR(ctrl, "disp_cc base address not found for\n"); diff --git a/msm/dsi/dsi_ctrl_hw.h b/msm/dsi/dsi_ctrl_hw.h index a635adbde1..92689496fb 100644 --- a/msm/dsi/dsi_ctrl_hw.h +++ b/msm/dsi/dsi_ctrl_hw.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ #ifndef _DSI_CTRL_HW_H_ @@ -38,6 +38,7 @@ * @DSI_CTRL_VERSION_2_3: DSI host v2.3 controller * @DSI_CTRL_VERSION_2_4: DSI host v2.4 controller * @DSI_CTRL_VERSION_2_5: DSI host v2.5 controller + * @DSI_CTRL_VERSION_2_6: DSI host v2.6 controller * @DSI_CTRL_VERSION_MAX: max version */ enum dsi_ctrl_version { @@ -49,6 +50,7 @@ enum dsi_ctrl_version { DSI_CTRL_VERSION_2_3, DSI_CTRL_VERSION_2_4, DSI_CTRL_VERSION_2_5, + DSI_CTRL_VERSION_2_6, DSI_CTRL_VERSION_MAX }; diff --git a/msm/dsi/dsi_phy.c b/msm/dsi/dsi_phy.c index 4eb372d81c..7e5069197b 100644 --- a/msm/dsi/dsi_phy.c +++ b/msm/dsi/dsi_phy.c @@ -91,6 +91,14 @@ static const struct dsi_ver_spec_info dsi_phy_v4_2 = { .timing_cfg_count = 14, }; +static const struct dsi_ver_spec_info dsi_phy_v4_3 = { + .version = DSI_PHY_VERSION_4_3, + .lane_cfg_count = 4, + .strength_cfg_count = 2, + .regulator_cfg_count = 0, + .timing_cfg_count = 14, +}; + static const struct of_device_id msm_dsi_phy_of_match[] = { { .compatible = "qcom,dsi-phy-v0.0-hpm", .data = &dsi_phy_v0_0_hpm,}, @@ -108,6 +116,8 @@ static const struct of_device_id msm_dsi_phy_of_match[] = { .data = &dsi_phy_v4_1,}, { .compatible = "qcom,dsi-phy-v4.2", .data = &dsi_phy_v4_2,}, + { .compatible = "qcom,dsi-phy-v4.3", + .data = &dsi_phy_v4_3,}, {} }; diff --git a/msm/dsi/dsi_phy_hw.h b/msm/dsi/dsi_phy_hw.h index fd27dd42b6..dfd213250c 100644 --- a/msm/dsi/dsi_phy_hw.h +++ b/msm/dsi/dsi_phy_hw.h @@ -32,6 +32,7 @@ * @DSI_PHY_VERSION_4_0: 7nm * @DSI_PHY_VERSION_4_1: 7nm * @DSI_PHY_VERSION_4_2: 5nm + * @DSI_PHY_VERSION_4_3: 5nm * @DSI_PHY_VERSION_MAX: */ enum dsi_phy_version { @@ -44,6 +45,7 @@ enum dsi_phy_version { DSI_PHY_VERSION_4_0, /* 7nm */ DSI_PHY_VERSION_4_1, /* 7nm */ DSI_PHY_VERSION_4_2, /* 5nm */ + DSI_PHY_VERSION_4_3, /* 5nm */ DSI_PHY_VERSION_MAX }; diff --git a/msm/dsi/dsi_phy_hw_v4_0.c b/msm/dsi/dsi_phy_hw_v4_0.c index c40b11e449..2669dd61c4 100644 --- a/msm/dsi/dsi_phy_hw_v4_0.c +++ b/msm/dsi/dsi_phy_hw_v4_0.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #include @@ -60,6 +60,7 @@ #define DSIPHY_CMN_PHY_STATUS 0x140 #define DSIPHY_CMN_LANE_STATUS0 0x148 #define DSIPHY_CMN_LANE_STATUS1 0x14C +#define DSIPHY_CMN_GLBL_DIGTOP_SPARE10 0x1AC /* n = 0..3 for data lanes and n = 4 for clock lane */ #define DSIPHY_LNX_CFG0(n) (0x200 + (0x80 * (n))) @@ -156,8 +157,7 @@ static void dsi_phy_hw_v4_0_lane_settings(struct dsi_phy_hw *phy, u8 tx_dctrl_v4_1[] = {0x40, 0x40, 0x40, 0x46, 0x41}; u8 *tx_dctrl; - if ((phy->version == DSI_PHY_VERSION_4_1) || - (phy->version == DSI_PHY_VERSION_4_2)) + if (phy->version >= DSI_PHY_VERSION_4_1) tx_dctrl = &tx_dctrl_v4_1[0]; else tx_dctrl = &tx_dctrl_v4[0]; @@ -436,6 +436,12 @@ void dsi_phy_hw_v4_0_enable(struct dsi_phy_hw *phy, if (dsi_phy_hw_v4_0_is_pll_on(phy)) pr_warn("PLL turned on before configuring PHY\n"); + /* Request for REFGEN ready */ + if (phy->version == DSI_PHY_VERSION_4_3) { + DSI_W32(phy, DSIPHY_CMN_GLBL_DIGTOP_SPARE10, 0x1); + udelay(500); + } + /* wait for REFGEN READY */ rc = readl_poll_timeout_atomic(phy->base + DSIPHY_CMN_PHY_STATUS, status, (status & BIT(0)), delay_us, timeout_us); diff --git a/msm/dsi/dsi_phy_timing_calc.c b/msm/dsi/dsi_phy_timing_calc.c index 6e2a625a35..be1d8b7899 100644 --- a/msm/dsi/dsi_phy_timing_calc.c +++ b/msm/dsi/dsi_phy_timing_calc.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #include "dsi_phy_timing_calc.h" @@ -1009,6 +1009,7 @@ int dsi_phy_timing_calc_init(struct dsi_phy_hw *phy, case DSI_PHY_VERSION_4_0: case DSI_PHY_VERSION_4_1: case DSI_PHY_VERSION_4_2: + case DSI_PHY_VERSION_4_3: ops->get_default_phy_params = dsi_phy_hw_v4_0_get_default_phy_params; ops->calc_clk_zero = diff --git a/msm/dsi/dsi_pll.c b/msm/dsi/dsi_pll.c index 3f8c927f8e..2f3f26d8b5 100644 --- a/msm/dsi/dsi_pll.c +++ b/msm/dsi/dsi_pll.c @@ -197,10 +197,8 @@ int dsi_pll_init(struct platform_device *pdev, struct dsi_pll_resource **pll) return -ENOMEM; } - if (dsi_pll_get_ioresources(pdev, &pll_res->gdsc_base, "gdsc_base")) { - DSI_PLL_ERR(pll_res, "Unable to remap gdsc base resources\n"); - return -ENOMEM; - } + if (dsi_pll_get_ioresources(pdev, &pll_res->gdsc_base, "gdsc_base")) + DSI_PLL_DBG(pll_res, "Unable to remap gdsc base resources\n"); in_trusted_vm = of_property_read_bool(pdev->dev.of_node, "qcom,dsi-pll-in-trusted-vm");