Commit 33a9caa4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'phy-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy

Pull phy updates from Vinod Koul:
 "New Support:

   - Qualcomm SM8650 UFS, PCIe and USB/DP Combo PHY, eUSB2 PHY, SDX75
     USB3, X1E80100 USB3 support

   - Mediatek MT8195 support

   - Rockchip RK3128 usb2 support

   - TI SGMII mode for J784S4

  Updates:

   - Qualcomm v7 register offsets updates

   - Mediatek tphy support for force phy mode switch"

* tag 'phy-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (34 commits)
  phy: ti: j721e-wiz: Add SGMII support in WIZ driver for J784S4
  phy: ti: gmii-sel: Enable SGMII mode for J784S4
  phy: qcom-qmp-usb: Add Qualcomm X1E80100 USB3 PHY support
  dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add X1E80100 USB PHY binding
  phy: qcom-qmp-combo: Add x1e80100 USB/DP combo phys
  dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: Document X1E80100 compatible
  dt-bindings: phy: qcom: snps-eusb2: Document the X1E80100 compatible
  phy: mediatek: tphy: add support force phy mode switch
  dt-bindings: phy: mediatek: tphy: add a property for force-mode switch
  phy: phy-can-transceiver: insert space after include
  phy: qualcomm: phy-qcom-qmp-ufs: Rectify SM8550 UFS HS-G4 PHY Settings
  dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header
  phy: renesas: phy-rcar-gen2: use select for GENERIC_PHY
  phy: qcom-qmp: qserdes-txrx: Add v7 register offsets
  phy: qcom-qmp: qserdes-txrx: Add V6 N4 register offsets
  phy: qcom-qmp: qserdes-com: Add v7 register offsets
  phy: qcom-qmp: pcs-usb: Add v7 register offsets
  phy: qcom-qmp: pcs: Add v7 register offsets
  phy: qcom-qmp: qserdes-txrx: Add some more v6.20 register offsets
  phy: qcom-qmp: qserdes-com: Add some more v6 register offsets
  ...
parents 4d5d604c 2029e714
...@@ -16,20 +16,8 @@ properties: ...@@ -16,20 +16,8 @@ properties:
"#phy-cells": "#phy-cells":
const: 0 const: 0
reg:
maxItems: 1
required: required:
- compatible - compatible
- reg
- "#phy-cells" - "#phy-cells"
additionalProperties: false additionalProperties: false
examples:
- |
phy@0 {
compatible = "amlogic,g12a-mipi-dphy-analog";
reg = <0x0 0xc>;
#phy-cells = <0>;
};
...@@ -9,16 +9,6 @@ title: Amlogic AXG shared MIPI/PCIE analog PHY ...@@ -9,16 +9,6 @@ title: Amlogic AXG shared MIPI/PCIE analog PHY
maintainers: maintainers:
- Remi Pommarel <repk@triplefau.lt> - Remi Pommarel <repk@triplefau.lt>
description: |+
The Everything-Else Power Domains node should be the child of a syscon
node with the required property:
- compatible: Should be the following:
"amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon"
Refer to the bindings described in
Documentation/devicetree/bindings/mfd/syscon.yaml
properties: properties:
compatible: compatible:
const: amlogic,axg-mipi-pcie-analog-phy const: amlogic,axg-mipi-pcie-analog-phy
...@@ -31,10 +21,3 @@ required: ...@@ -31,10 +21,3 @@ required:
- "#phy-cells" - "#phy-cells"
additionalProperties: false additionalProperties: false
examples:
- |
mpphy: phy {
compatible = "amlogic,axg-mipi-pcie-analog-phy";
#phy-cells = <0>;
};
...@@ -31,6 +31,7 @@ properties: ...@@ -31,6 +31,7 @@ properties:
- items: - items:
- enum: - enum:
- mediatek,mt8188-mipi-tx - mediatek,mt8188-mipi-tx
- mediatek,mt8195-mipi-tx
- mediatek,mt8365-mipi-tx - mediatek,mt8365-mipi-tx
- const: mediatek,mt8183-mipi-tx - const: mediatek,mt8183-mipi-tx
- const: mediatek,mt2701-mipi-tx - const: mediatek,mt2701-mipi-tx
......
...@@ -235,6 +235,15 @@ patternProperties: ...@@ -235,6 +235,15 @@ patternProperties:
Specify the flag to enable BC1.2 if support it Specify the flag to enable BC1.2 if support it
type: boolean type: boolean
mediatek,force-mode:
description:
The force mode is used to manually switch the shared phy mode between
USB3 and PCIe, when USB3 phy type is selected by the consumer, and
force-mode is set, will cause phy's power and pipe toggled and force
phy as USB3 mode which switched from default PCIe mode. But perfer to
use the property "mediatek,syscon-type" for newer SoCs that support it.
type: boolean
mediatek,syscon-type: mediatek,syscon-type:
$ref: /schemas/types.yaml#/definitions/phandle-array $ref: /schemas/types.yaml#/definitions/phandle-array
maxItems: 1 maxItems: 1
......
...@@ -36,6 +36,8 @@ properties: ...@@ -36,6 +36,8 @@ properties:
- qcom,sm8450-qmp-gen4x2-pcie-phy - qcom,sm8450-qmp-gen4x2-pcie-phy
- qcom,sm8550-qmp-gen3x2-pcie-phy - qcom,sm8550-qmp-gen3x2-pcie-phy
- qcom,sm8550-qmp-gen4x2-pcie-phy - qcom,sm8550-qmp-gen4x2-pcie-phy
- qcom,sm8650-qmp-gen3x2-pcie-phy
- qcom,sm8650-qmp-gen4x2-pcie-phy
reg: reg:
minItems: 1 minItems: 1
...@@ -147,6 +149,8 @@ allOf: ...@@ -147,6 +149,8 @@ allOf:
- qcom,sm8450-qmp-gen3x2-pcie-phy - qcom,sm8450-qmp-gen3x2-pcie-phy
- qcom,sm8550-qmp-gen3x2-pcie-phy - qcom,sm8550-qmp-gen3x2-pcie-phy
- qcom,sm8550-qmp-gen4x2-pcie-phy - qcom,sm8550-qmp-gen4x2-pcie-phy
- qcom,sm8650-qmp-gen3x2-pcie-phy
- qcom,sm8650-qmp-gen4x2-pcie-phy
then: then:
properties: properties:
clocks: clocks:
...@@ -189,6 +193,7 @@ allOf: ...@@ -189,6 +193,7 @@ allOf:
contains: contains:
enum: enum:
- qcom,sm8550-qmp-gen4x2-pcie-phy - qcom,sm8550-qmp-gen4x2-pcie-phy
- qcom,sm8650-qmp-gen4x2-pcie-phy
then: then:
properties: properties:
resets: resets:
......
...@@ -32,6 +32,7 @@ properties: ...@@ -32,6 +32,7 @@ properties:
- qcom,sm8350-qmp-ufs-phy - qcom,sm8350-qmp-ufs-phy
- qcom,sm8450-qmp-ufs-phy - qcom,sm8450-qmp-ufs-phy
- qcom,sm8550-qmp-ufs-phy - qcom,sm8550-qmp-ufs-phy
- qcom,sm8650-qmp-ufs-phy
reg: reg:
maxItems: 1 maxItems: 1
...@@ -112,6 +113,7 @@ allOf: ...@@ -112,6 +113,7 @@ allOf:
- qcom,sm8250-qmp-ufs-phy - qcom,sm8250-qmp-ufs-phy
- qcom,sm8350-qmp-ufs-phy - qcom,sm8350-qmp-ufs-phy
- qcom,sm8550-qmp-ufs-phy - qcom,sm8550-qmp-ufs-phy
- qcom,sm8650-qmp-ufs-phy
then: then:
properties: properties:
clocks: clocks:
......
...@@ -32,6 +32,7 @@ properties: ...@@ -32,6 +32,7 @@ properties:
- qcom,sm8150-qmp-usb3-uni-phy - qcom,sm8150-qmp-usb3-uni-phy
- qcom,sm8250-qmp-usb3-uni-phy - qcom,sm8250-qmp-usb3-uni-phy
- qcom,sm8350-qmp-usb3-uni-phy - qcom,sm8350-qmp-usb3-uni-phy
- qcom,x1e80100-qmp-usb3-uni-phy
reg: reg:
...@@ -135,6 +136,7 @@ allOf: ...@@ -135,6 +136,7 @@ allOf:
- qcom,sm8150-qmp-usb3-uni-phy - qcom,sm8150-qmp-usb3-uni-phy
- qcom,sm8250-qmp-usb3-uni-phy - qcom,sm8250-qmp-usb3-uni-phy
- qcom,sm8350-qmp-usb3-uni-phy - qcom,sm8350-qmp-usb3-uni-phy
- qcom,x1e80100-qmp-usb3-uni-phy
then: then:
properties: properties:
clocks: clocks:
...@@ -171,6 +173,7 @@ allOf: ...@@ -171,6 +173,7 @@ allOf:
enum: enum:
- qcom,sa8775p-qmp-usb3-uni-phy - qcom,sa8775p-qmp-usb3-uni-phy
- qcom,sc8280xp-qmp-usb3-uni-phy - qcom,sc8280xp-qmp-usb3-uni-phy
- qcom,x1e80100-qmp-usb3-uni-phy
then: then:
required: required:
- power-domains - power-domains
......
...@@ -27,6 +27,8 @@ properties: ...@@ -27,6 +27,8 @@ properties:
- qcom,sm8350-qmp-usb3-dp-phy - qcom,sm8350-qmp-usb3-dp-phy
- qcom,sm8450-qmp-usb3-dp-phy - qcom,sm8450-qmp-usb3-dp-phy
- qcom,sm8550-qmp-usb3-dp-phy - qcom,sm8550-qmp-usb3-dp-phy
- qcom,sm8650-qmp-usb3-dp-phy
- qcom,x1e80100-qmp-usb3-dp-phy
reg: reg:
maxItems: 1 maxItems: 1
...@@ -62,12 +64,12 @@ properties: ...@@ -62,12 +64,12 @@ properties:
"#clock-cells": "#clock-cells":
const: 1 const: 1
description: description:
See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h See include/dt-bindings/phy/phy-qcom-qmp.h
"#phy-cells": "#phy-cells":
const: 1 const: 1
description: description:
See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h See include/dt-bindings/phy/phy-qcom-qmp.h
orientation-switch: orientation-switch:
description: description:
...@@ -128,6 +130,8 @@ allOf: ...@@ -128,6 +130,8 @@ allOf:
- qcom,sc8280xp-qmp-usb43dp-phy - qcom,sc8280xp-qmp-usb43dp-phy
- qcom,sm6350-qmp-usb3-dp-phy - qcom,sm6350-qmp-usb3-dp-phy
- qcom,sm8550-qmp-usb3-dp-phy - qcom,sm8550-qmp-usb3-dp-phy
- qcom,sm8650-qmp-usb3-dp-phy
- qcom,x1e80100-qmp-usb3-dp-phy
then: then:
required: required:
- power-domains - power-domains
......
...@@ -18,6 +18,8 @@ properties: ...@@ -18,6 +18,8 @@ properties:
- items: - items:
- enum: - enum:
- qcom,sdx75-snps-eusb2-phy - qcom,sdx75-snps-eusb2-phy
- qcom,sm8650-snps-eusb2-phy
- qcom,x1e80100-snps-eusb2-phy
- const: qcom,sm8550-snps-eusb2-phy - const: qcom,sm8550-snps-eusb2-phy
- const: qcom,sm8550-snps-eusb2-phy - const: qcom,sm8550-snps-eusb2-phy
......
...@@ -185,6 +185,10 @@ ...@@ -185,6 +185,10 @@
#define P3D_RG_CDR_BIR_LTD1 GENMASK(28, 24) #define P3D_RG_CDR_BIR_LTD1 GENMASK(28, 24)
#define P3D_RG_CDR_BIR_LTD0 GENMASK(12, 8) #define P3D_RG_CDR_BIR_LTD0 GENMASK(12, 8)
#define U3P_U3_PHYD_TOP1 0x100
#define P3D_RG_PHY_MODE GENMASK(2, 1)
#define P3D_RG_FORCE_PHY_MODE BIT(0)
#define U3P_U3_PHYD_RXDET1 0x128 #define U3P_U3_PHYD_RXDET1 0x128
#define P3D_RG_RXDET_STB2_SET GENMASK(17, 9) #define P3D_RG_RXDET_STB2_SET GENMASK(17, 9)
...@@ -327,6 +331,7 @@ struct mtk_phy_instance { ...@@ -327,6 +331,7 @@ struct mtk_phy_instance {
int discth; int discth;
int pre_emphasis; int pre_emphasis;
bool bc12_en; bool bc12_en;
bool type_force_mode;
}; };
struct mtk_tphy { struct mtk_tphy {
...@@ -768,6 +773,23 @@ static void u3_phy_instance_init(struct mtk_tphy *tphy, ...@@ -768,6 +773,23 @@ static void u3_phy_instance_init(struct mtk_tphy *tphy,
void __iomem *phya = u3_banks->phya; void __iomem *phya = u3_banks->phya;
void __iomem *phyd = u3_banks->phyd; void __iomem *phyd = u3_banks->phyd;
if (instance->type_force_mode) {
/* force phy as usb mode, default is pcie rc mode */
mtk_phy_update_field(phyd + U3P_U3_PHYD_TOP1, P3D_RG_PHY_MODE, 1);
mtk_phy_set_bits(phyd + U3P_U3_PHYD_TOP1, P3D_RG_FORCE_PHY_MODE);
/* power down phy by ip and pipe reset */
mtk_phy_set_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLD,
P3C_FORCE_IP_SW_RST | P3C_MCU_BUS_CK_GATE_EN);
mtk_phy_set_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLE,
P3C_RG_SWRST_U3_PHYD | P3C_RG_SWRST_U3_PHYD_FORCE_EN);
udelay(10);
/* power on phy again */
mtk_phy_clear_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLD,
P3C_FORCE_IP_SW_RST | P3C_MCU_BUS_CK_GATE_EN);
mtk_phy_clear_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLE,
P3C_RG_SWRST_U3_PHYD | P3C_RG_SWRST_U3_PHYD_FORCE_EN);
}
/* gating PCIe Analog XTAL clock */ /* gating PCIe Analog XTAL clock */
mtk_phy_set_bits(u3_banks->spllc + U3P_SPLLC_XTALCTL3, mtk_phy_set_bits(u3_banks->spllc + U3P_SPLLC_XTALCTL3,
XC3_RG_U3_XTAL_RX_PWD | XC3_RG_U3_FRC_XTAL_RX_PWD); XC3_RG_U3_XTAL_RX_PWD | XC3_RG_U3_FRC_XTAL_RX_PWD);
...@@ -1120,6 +1142,9 @@ static void phy_parse_property(struct mtk_tphy *tphy, ...@@ -1120,6 +1142,9 @@ static void phy_parse_property(struct mtk_tphy *tphy,
{ {
struct device *dev = &instance->phy->dev; struct device *dev = &instance->phy->dev;
if (instance->type == PHY_TYPE_USB3)
instance->type_force_mode = device_property_read_bool(dev, "mediatek,force-mode");
if (instance->type != PHY_TYPE_USB2) if (instance->type != PHY_TYPE_USB2)
return; return;
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
* *
*/ */
#include <linux/of.h> #include <linux/of.h>
#include<linux/phy/phy.h> #include <linux/phy/phy.h>
#include<linux/platform_device.h> #include <linux/platform_device.h>
#include<linux/module.h> #include <linux/module.h>
#include<linux/gpio.h> #include <linux/gpio.h>
#include<linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/mux/consumer.h> #include <linux/mux/consumer.h>
struct can_transceiver_data { struct can_transceiver_data {
......
...@@ -959,7 +959,7 @@ struct phy *phy_create(struct device *dev, struct device_node *node, ...@@ -959,7 +959,7 @@ struct phy *phy_create(struct device *dev, struct device_node *node,
if (!phy) if (!phy)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
id = ida_simple_get(&phy_ida, 0, 0, GFP_KERNEL); id = ida_alloc(&phy_ida, GFP_KERNEL);
if (id < 0) { if (id < 0) {
dev_err(dev, "unable to get id\n"); dev_err(dev, "unable to get id\n");
ret = id; ret = id;
...@@ -1232,7 +1232,7 @@ static void phy_release(struct device *dev) ...@@ -1232,7 +1232,7 @@ static void phy_release(struct device *dev)
dev_vdbg(dev, "releasing '%s'\n", dev_name(dev)); dev_vdbg(dev, "releasing '%s'\n", dev_name(dev));
debugfs_remove_recursive(phy->debugfs); debugfs_remove_recursive(phy->debugfs);
regulator_put(phy->pwr); regulator_put(phy->pwr);
ida_simple_remove(&phy_ida, phy->id); ida_free(&phy_ida, phy->id);
kfree(phy); kfree(phy);
} }
......
...@@ -1203,6 +1203,127 @@ static const struct qmp_phy_init_tbl sc8280xp_usb43dp_pcs_tbl[] = { ...@@ -1203,6 +1203,127 @@ static const struct qmp_phy_init_tbl sc8280xp_usb43dp_pcs_tbl[] = {
QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07), QMP_PHY_INIT_CFG(QPHY_V5_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
}; };
static const struct qmp_phy_init_tbl x1e80100_usb43dp_serdes_tbl[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_EN_CENTER, 0x01),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER1, 0x62),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_PER2, 0x02),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE1_MODE0, 0xc2),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE2_MODE0, 0x03),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE1_MODE1, 0xc2),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SSC_STEP_SIZE2_MODE1, 0x03),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYSCLK_BUF_ENABLE, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x02),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE1, 0x02),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE0, 0x16),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE1, 0x16),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x36),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE1, 0x36),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYSCLK_EN_SEL, 0x1a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x04),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_CFG, 0x04),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x08),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x1a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE1, 0x16),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE1, 0x41),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x82),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MSB_MODE0, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE1, 0x82),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MSB_MODE1, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START1_MODE0, 0x55),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START2_MODE0, 0x55),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START3_MODE0, 0x03),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START1_MODE1, 0x55),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START2_MODE1, 0x55),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DIV_FRAC_START3_MODE1, 0x03),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x14),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE1_MODE0, 0xba),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE2_MODE0, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE1_MODE1, 0xba),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE2_MODE1, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x13),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_HS_SWITCH_SEL_1, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CORE_CLK_DIV_MODE0, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CORECLK_DIV_MODE1, 0x04),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CORE_CLK_EN, 0xa0),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CMN_CONFIG_1, 0x76),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO, 0x0f),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO_MODE1, 0x0f),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE0, 0x20),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE1, 0x20),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_INITVAL2, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAXVAL2, 0x01),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SVS_MODE_CLK_SEL, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_BG_TIMER, 0x0a),
};
static const struct qmp_phy_init_tbl x1e80100_usb43dp_tx_tbl[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_LANE_MODE_1, 0x05),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_LANE_MODE_2, 0x50),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_LANE_MODE_3, 0x50),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_TX, 0x1f),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_RX, 0x0a),
};
static const struct qmp_phy_init_tbl x1e80100_usb43dp_rx_tbl[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_SIGDET_CNTRL, 0x04),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_SIGDET_DEGLITCH_CNTRL, 0x0e),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_SIGDET_ENABLES, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE_0_1_B0, 0xc3),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE_0_1_B1, 0xc3),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE_0_1_B2, 0xd8),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE_0_1_B3, 0x9e),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE_0_1_B4, 0x36),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE_0_1_B5, 0xb6),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE_0_1_B6, 0x64),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE2_B0, 0xd6),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE2_B1, 0xee),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE2_B2, 0x18),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE2_B3, 0x9a),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE2_B4, 0x04),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE2_B5, 0x36),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_MODE_RATE2_B6, 0xe3),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_IVCM_CAL_CODE_OVERRIDE, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_RX_IVCM_CAL_CTRL2, 0x80),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_RX_SUMMER_CAL_SPD_MODE, 0x2f),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_DFE_CTLE_POST_CAL_OFFSET, 0x08),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_UCDR_PI_CONTROLS, 0x15),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_UCDR_PI_CTRL1, 0xd0),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_UCDR_PI_CTRL2, 0x48),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_UCDR_SB2_GAIN2_RATE2, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_RX_IVCM_POSTCAL_OFFSET, 0x7c),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_VGA_CAL_CNTRL1, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_VGA_CAL_MAN_VAL, 0x04),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_DFE_DAC_ENABLE1, 0x88),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_DFE_3, 0x45),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_GM_CAL, 0x0d),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE2, 0x09),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE2, 0x05),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_Q_PI_INTRINSIC_BIAS_RATE32, 0x2f),
QMP_PHY_INIT_CFG(QSERDES_V6_N4_RX_RX_BKUP_CTRL1, 0x14),
};
static const struct qmp_phy_init_tbl x1e80100_usb43dp_pcs_tbl[] = {
QMP_PHY_INIT_CFG(QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_L, 0xe7),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_RCVR_DTCT_DLY_P1U2_H, 0x03),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG1, 0xc4),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG2, 0x89),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG3, 0x20),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_LOCK_DETECT_CONFIG6, 0x13),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_REFGEN_REQ_CONFIG1, 0x21),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_RX_SIGDET_LVL, 0x55),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_CDR_RESET_TIME, 0x0a),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_ALIGN_DETECT_CONFIG1, 0xd4),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_ALIGN_DETECT_CONFIG2, 0x30),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_PCS_TX_RX_CONFIG, 0x0c),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_EQ_CONFIG1, 0x4b),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_EQ_CONFIG5, 0x10),
};
static const struct qmp_phy_init_tbl x1e80100_usb43dp_pcs_usb_tbl[] = {
QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL, 0xf8),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
};
/* list of regulators */ /* list of regulators */
struct qmp_regulator_data { struct qmp_regulator_data {
const char *name; const char *name;
...@@ -1682,6 +1803,51 @@ static const struct qmp_phy_cfg sc8280xp_usb43dpphy_cfg = { ...@@ -1682,6 +1803,51 @@ static const struct qmp_phy_cfg sc8280xp_usb43dpphy_cfg = {
.regs = qmp_v5_5nm_usb3phy_regs_layout, .regs = qmp_v5_5nm_usb3phy_regs_layout,
}; };
static const struct qmp_phy_cfg x1e80100_usb3dpphy_cfg = {
.offsets = &qmp_combo_offsets_v5,
.serdes_tbl = x1e80100_usb43dp_serdes_tbl,
.serdes_tbl_num = ARRAY_SIZE(x1e80100_usb43dp_serdes_tbl),
.tx_tbl = x1e80100_usb43dp_tx_tbl,
.tx_tbl_num = ARRAY_SIZE(x1e80100_usb43dp_tx_tbl),
.rx_tbl = x1e80100_usb43dp_rx_tbl,
.rx_tbl_num = ARRAY_SIZE(x1e80100_usb43dp_rx_tbl),
.pcs_tbl = x1e80100_usb43dp_pcs_tbl,
.pcs_tbl_num = ARRAY_SIZE(x1e80100_usb43dp_pcs_tbl),
.pcs_usb_tbl = x1e80100_usb43dp_pcs_usb_tbl,
.pcs_usb_tbl_num = ARRAY_SIZE(x1e80100_usb43dp_pcs_usb_tbl),
.dp_serdes_tbl = qmp_v6_dp_serdes_tbl,
.dp_serdes_tbl_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl),
.dp_tx_tbl = qmp_v6_dp_tx_tbl,
.dp_tx_tbl_num = ARRAY_SIZE(qmp_v6_dp_tx_tbl),
.serdes_tbl_rbr = qmp_v6_dp_serdes_tbl_rbr,
.serdes_tbl_rbr_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_rbr),
.serdes_tbl_hbr = qmp_v6_dp_serdes_tbl_hbr,
.serdes_tbl_hbr_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_hbr),
.serdes_tbl_hbr2 = qmp_v6_dp_serdes_tbl_hbr2,
.serdes_tbl_hbr2_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_hbr2),
.serdes_tbl_hbr3 = qmp_v6_dp_serdes_tbl_hbr3,
.serdes_tbl_hbr3_num = ARRAY_SIZE(qmp_v6_dp_serdes_tbl_hbr3),
.swing_hbr_rbr = &qmp_dp_v5_voltage_swing_hbr_rbr,
.pre_emphasis_hbr_rbr = &qmp_dp_v5_pre_emphasis_hbr_rbr,
.swing_hbr3_hbr2 = &qmp_dp_v5_voltage_swing_hbr3_hbr2,
.pre_emphasis_hbr3_hbr2 = &qmp_dp_v5_pre_emphasis_hbr3_hbr2,
.dp_aux_init = qmp_v4_dp_aux_init,
.configure_dp_tx = qmp_v4_configure_dp_tx,
.configure_dp_phy = qmp_v4_configure_dp_phy,
.calibrate_dp_phy = qmp_v4_calibrate_dp_phy,
.reset_list = msm8996_usb3phy_reset_l,
.num_resets = ARRAY_SIZE(msm8996_usb3phy_reset_l),
.vreg_list = qmp_phy_vreg_l,
.num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
.regs = qmp_v45_usb3phy_regs_layout,
};
static const struct qmp_phy_cfg sm6350_usb3dpphy_cfg = { static const struct qmp_phy_cfg sm6350_usb3dpphy_cfg = {
.offsets = &qmp_combo_offsets_v3, .offsets = &qmp_combo_offsets_v3,
...@@ -3518,6 +3684,14 @@ static const struct of_device_id qmp_combo_of_match_table[] = { ...@@ -3518,6 +3684,14 @@ static const struct of_device_id qmp_combo_of_match_table[] = {
.compatible = "qcom,sm8550-qmp-usb3-dp-phy", .compatible = "qcom,sm8550-qmp-usb3-dp-phy",
.data = &sm8550_usb3dpphy_cfg, .data = &sm8550_usb3dpphy_cfg,
}, },
{
.compatible = "qcom,sm8650-qmp-usb3-dp-phy",
.data = &sm8550_usb3dpphy_cfg,
},
{
.compatible = "qcom,x1e80100-qmp-usb3-dp-phy",
.data = &x1e80100_usb3dpphy_cfg,
},
{ } { }
}; };
MODULE_DEVICE_TABLE(of, qmp_combo_of_match_table); MODULE_DEVICE_TABLE(of, qmp_combo_of_match_table);
......
...@@ -1909,6 +1909,35 @@ static const struct qmp_phy_init_tbl sm8550_qmp_gen4x2_pcie_pcs_misc_tbl[] = { ...@@ -1909,6 +1909,35 @@ static const struct qmp_phy_init_tbl sm8550_qmp_gen4x2_pcie_pcs_misc_tbl[] = {
QMP_PHY_INIT_CFG(QPHY_PCIE_V6_20_PCS_G4_FOM_EQ_CONFIG5, 0xf2), QMP_PHY_INIT_CFG(QPHY_PCIE_V6_20_PCS_G4_FOM_EQ_CONFIG5, 0xf2),
}; };
static const struct qmp_phy_init_tbl sm8650_qmp_gen4x2_pcie_rx_tbl[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_UCDR_FO_GAIN_RATE_2, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_UCDR_FO_GAIN_RATE_3, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_UCDR_PI_CONTROLS, 0x16),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_UCDR_SO_ACC_DEFAULT_VAL_RATE3, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_IVCM_CAL_CTRL2, 0x82),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_DFE_3, 0x05),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_VGA_CAL_MAN_VAL, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_GM_CAL, 0x0d),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_EQU_ADAPTOR_CNTRL4, 0x0b),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_SIGDET_ENABLES, 0x1c),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_PHPRE_CTRL, 0x20),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_DFE_CTLE_POST_CAL_OFFSET, 0x38),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE2_B0, 0xd3),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE2_B1, 0xd3),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE2_B2, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE2_B3, 0x9a),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE2_B4, 0x06),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE2_B5, 0xb6),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE2_B6, 0xee),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE3_B0, 0x23),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE3_B1, 0x9b),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE3_B2, 0x60),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE3_B3, 0xdf),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE3_B4, 0x43),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE3_B5, 0x76),
QMP_PHY_INIT_CFG(QSERDES_V6_20_RX_MODE_RATE3_B6, 0xff),
};
static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_serdes_alt_tbl[] = { static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_serdes_alt_tbl[] = {
QMP_PHY_INIT_CFG(QSERDES_V5_COM_BIAS_EN_CLKBUFLR_EN, 0x14), QMP_PHY_INIT_CFG(QSERDES_V5_COM_BIAS_EN_CLKBUFLR_EN, 0x14),
QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_IVCO, 0x0f), QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_IVCO, 0x0f),
...@@ -3047,6 +3076,36 @@ static const struct qmp_phy_cfg sm8550_qmp_gen4x2_pciephy_cfg = { ...@@ -3047,6 +3076,36 @@ static const struct qmp_phy_cfg sm8550_qmp_gen4x2_pciephy_cfg = {
.has_nocsr_reset = true, .has_nocsr_reset = true,
}; };
static const struct qmp_phy_cfg sm8650_qmp_gen4x2_pciephy_cfg = {
.lanes = 2,
.offsets = &qmp_pcie_offsets_v6_20,
.tbls = {
.serdes = sm8550_qmp_gen4x2_pcie_serdes_tbl,
.serdes_num = ARRAY_SIZE(sm8550_qmp_gen4x2_pcie_serdes_tbl),
.tx = sm8550_qmp_gen4x2_pcie_tx_tbl,
.tx_num = ARRAY_SIZE(sm8550_qmp_gen4x2_pcie_tx_tbl),
.rx = sm8650_qmp_gen4x2_pcie_rx_tbl,
.rx_num = ARRAY_SIZE(sm8650_qmp_gen4x2_pcie_rx_tbl),
.pcs = sm8550_qmp_gen4x2_pcie_pcs_tbl,
.pcs_num = ARRAY_SIZE(sm8550_qmp_gen4x2_pcie_pcs_tbl),
.pcs_misc = sm8550_qmp_gen4x2_pcie_pcs_misc_tbl,
.pcs_misc_num = ARRAY_SIZE(sm8550_qmp_gen4x2_pcie_pcs_misc_tbl),
.ln_shrd = sm8550_qmp_gen4x2_pcie_ln_shrd_tbl,
.ln_shrd_num = ARRAY_SIZE(sm8550_qmp_gen4x2_pcie_ln_shrd_tbl),
},
.reset_list = sdm845_pciephy_reset_l,
.num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
.vreg_list = sm8550_qmp_phy_vreg_l,
.num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l),
.regs = pciephy_v5_regs_layout,
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
.phy_status = PHYSTATUS_4_20,
.has_nocsr_reset = true,
};
static const struct qmp_phy_cfg sa8775p_qmp_gen4x2_pciephy_cfg = { static const struct qmp_phy_cfg sa8775p_qmp_gen4x2_pciephy_cfg = {
.lanes = 2, .lanes = 2,
.offsets = &qmp_pcie_offsets_v5_20, .offsets = &qmp_pcie_offsets_v5_20,
...@@ -3820,6 +3879,12 @@ static const struct of_device_id qmp_pcie_of_match_table[] = { ...@@ -3820,6 +3879,12 @@ static const struct of_device_id qmp_pcie_of_match_table[] = {
}, { }, {
.compatible = "qcom,sm8550-qmp-gen4x2-pcie-phy", .compatible = "qcom,sm8550-qmp-gen4x2-pcie-phy",
.data = &sm8550_qmp_gen4x2_pciephy_cfg, .data = &sm8550_qmp_gen4x2_pciephy_cfg,
}, {
.compatible = "qcom,sm8650-qmp-gen3x2-pcie-phy",
.data = &sm8550_qmp_gen3x2_pciephy_cfg,
}, {
.compatible = "qcom,sm8650-qmp-gen4x2-pcie-phy",
.data = &sm8650_qmp_gen4x2_pciephy_cfg,
}, },
{ }, { },
}; };
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define QPHY_V6_PCS_UFS_SW_RESET 0x008 #define QPHY_V6_PCS_UFS_SW_RESET 0x008
#define QPHY_V6_PCS_UFS_TIMER_20US_CORECLK_STEPS_MSB 0x00c #define QPHY_V6_PCS_UFS_TIMER_20US_CORECLK_STEPS_MSB 0x00c
#define QPHY_V6_PCS_UFS_TIMER_20US_CORECLK_STEPS_LSB 0x010 #define QPHY_V6_PCS_UFS_TIMER_20US_CORECLK_STEPS_LSB 0x010
#define QPHY_V6_PCS_UFS_PCS_CTRL1 0x020
#define QPHY_V6_PCS_UFS_PLL_CNTL 0x02c #define QPHY_V6_PCS_UFS_PLL_CNTL 0x02c
#define QPHY_V6_PCS_UFS_TX_LARGE_AMP_DRV_LVL 0x030 #define QPHY_V6_PCS_UFS_TX_LARGE_AMP_DRV_LVL 0x030
#define QPHY_V6_PCS_UFS_TX_SMALL_AMP_DRV_LVL 0x038 #define QPHY_V6_PCS_UFS_TX_SMALL_AMP_DRV_LVL 0x038
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2023, Linaro Limited
*/
#ifndef QCOM_PHY_QMP_PCS_USB_V7_H_
#define QCOM_PHY_QMP_PCS_USB_V7_H_
#define QPHY_V7_PCS_USB3_POWER_STATE_CONFIG1 0x00
#define QPHY_V7_PCS_USB3_AUTONOMOUS_MODE_CTRL 0x08
#define QPHY_V7_PCS_USB3_LFPS_RXTERM_IRQ_CLEAR 0x14
#define QPHY_V7_PCS_USB3_LFPS_DET_HIGH_COUNT_VAL 0x18
#define QPHY_V7_PCS_USB3_RXEQTRAINING_DFE_TIME_S2 0x3c
#define QPHY_V7_PCS_USB3_RCVR_DTCT_DLY_U3_L 0x40
#define QPHY_V7_PCS_USB3_RCVR_DTCT_DLY_U3_H 0x44
#endif
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2023, Linaro Limited
*/
#ifndef QCOM_PHY_QMP_PCS_V7_H_
#define QCOM_PHY_QMP_PCS_V7_H_
/* Only for QMP V7 PHY - USB/PCIe PCS registers */
#define QPHY_V7_PCS_SW_RESET 0x000
#define QPHY_V7_PCS_PCS_STATUS1 0x014
#define QPHY_V7_PCS_POWER_DOWN_CONTROL 0x040
#define QPHY_V7_PCS_START_CONTROL 0x044
#define QPHY_V7_PCS_POWER_STATE_CONFIG1 0x090
#define QPHY_V7_PCS_LOCK_DETECT_CONFIG1 0x0c4
#define QPHY_V7_PCS_LOCK_DETECT_CONFIG2 0x0c8
#define QPHY_V7_PCS_LOCK_DETECT_CONFIG3 0x0cc
#define QPHY_V7_PCS_LOCK_DETECT_CONFIG6 0x0d8
#define QPHY_V7_PCS_REFGEN_REQ_CONFIG1 0x0dc
#define QPHY_V7_PCS_RX_SIGDET_LVL 0x188
#define QPHY_V7_PCS_RCVR_DTCT_DLY_P1U2_L 0x190
#define QPHY_V7_PCS_RCVR_DTCT_DLY_P1U2_H 0x194
#define QPHY_V7_PCS_RATE_SLEW_CNTRL1 0x198
#define QPHY_V7_PCS_CDR_RESET_TIME 0x1b0
#define QPHY_V7_PCS_ALIGN_DETECT_CONFIG1 0x1c0
#define QPHY_V7_PCS_ALIGN_DETECT_CONFIG2 0x1c4
#define QPHY_V7_PCS_PCS_TX_RX_CONFIG 0x1d0
#define QPHY_V7_PCS_EQ_CONFIG1 0x1dc
#define QPHY_V7_PCS_EQ_CONFIG2 0x1e0
#define QPHY_V7_PCS_EQ_CONFIG5 0x1ec
#endif
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#define QSERDES_V6_COM_DIV_FRAC_START2_MODE1 0x34 #define QSERDES_V6_COM_DIV_FRAC_START2_MODE1 0x34
#define QSERDES_V6_COM_DIV_FRAC_START3_MODE1 0x38 #define QSERDES_V6_COM_DIV_FRAC_START3_MODE1 0x38
#define QSERDES_V6_COM_HSCLK_SEL_1 0x3c #define QSERDES_V6_COM_HSCLK_SEL_1 0x3c
#define QSERDES_V6_COM_INTEGLOOP_GAIN0_MODE1 0x40
#define QSERDES_V6_COM_INTEGLOOP_GAIN1_MODE1 0x44
#define QSERDES_V6_COM_VCO_TUNE1_MODE1 0x48 #define QSERDES_V6_COM_VCO_TUNE1_MODE1 0x48
#define QSERDES_V6_COM_VCO_TUNE2_MODE1 0x4c #define QSERDES_V6_COM_VCO_TUNE2_MODE1 0x4c
#define QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE1 0x50 #define QSERDES_V6_COM_BIN_VCOCAL_CMP_CODE1_MODE1 0x50
...@@ -48,6 +50,7 @@ ...@@ -48,6 +50,7 @@
#define QSERDES_V6_COM_VCO_TUNE2_MODE0 0xac #define QSERDES_V6_COM_VCO_TUNE2_MODE0 0xac
#define QSERDES_V6_COM_BG_TIMER 0xbc #define QSERDES_V6_COM_BG_TIMER 0xbc
#define QSERDES_V6_COM_SSC_EN_CENTER 0xc0 #define QSERDES_V6_COM_SSC_EN_CENTER 0xc0
#define QSERDES_V6_COM_SSC_ADJ_PER1 0xc4
#define QSERDES_V6_COM_SSC_PER1 0xcc #define QSERDES_V6_COM_SSC_PER1 0xcc
#define QSERDES_V6_COM_SSC_PER2 0xd0 #define QSERDES_V6_COM_SSC_PER2 0xd0
#define QSERDES_V6_COM_PLL_POST_DIV_MUX 0xd8 #define QSERDES_V6_COM_PLL_POST_DIV_MUX 0xd8
...@@ -56,6 +59,7 @@ ...@@ -56,6 +59,7 @@
#define QSERDES_V6_COM_SYS_CLK_CTRL 0xe4 #define QSERDES_V6_COM_SYS_CLK_CTRL 0xe4
#define QSERDES_V6_COM_SYSCLK_BUF_ENABLE 0xe8 #define QSERDES_V6_COM_SYSCLK_BUF_ENABLE 0xe8
#define QSERDES_V6_COM_PLL_IVCO 0xf4 #define QSERDES_V6_COM_PLL_IVCO 0xf4
#define QSERDES_V6_COM_PLL_IVCO_MODE1 0xf8
#define QSERDES_V6_COM_SYSCLK_EN_SEL 0x110 #define QSERDES_V6_COM_SYSCLK_EN_SEL 0x110
#define QSERDES_V6_COM_RESETSM_CNTRL 0x118 #define QSERDES_V6_COM_RESETSM_CNTRL 0x118
#define QSERDES_V6_COM_LOCK_CMP_EN 0x120 #define QSERDES_V6_COM_LOCK_CMP_EN 0x120
...@@ -63,6 +67,7 @@ ...@@ -63,6 +67,7 @@
#define QSERDES_V6_COM_VCO_TUNE_CTRL 0x13c #define QSERDES_V6_COM_VCO_TUNE_CTRL 0x13c
#define QSERDES_V6_COM_VCO_TUNE_MAP 0x140 #define QSERDES_V6_COM_VCO_TUNE_MAP 0x140
#define QSERDES_V6_COM_VCO_TUNE_INITVAL2 0x148 #define QSERDES_V6_COM_VCO_TUNE_INITVAL2 0x148
#define QSERDES_V6_COM_VCO_TUNE_MAXVAL2 0x158
#define QSERDES_V6_COM_CLK_SELECT 0x164 #define QSERDES_V6_COM_CLK_SELECT 0x164
#define QSERDES_V6_COM_CORE_CLK_EN 0x170 #define QSERDES_V6_COM_CORE_CLK_EN 0x170
#define QSERDES_V6_COM_CMN_CONFIG_1 0x174 #define QSERDES_V6_COM_CMN_CONFIG_1 0x174
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2023, Linaro Limited
*/
#ifndef QCOM_PHY_QMP_QSERDES_COM_V7_H_
#define QCOM_PHY_QMP_QSERDES_COM_V7_H_
/* Only for QMP V7 PHY - QSERDES COM registers */
#define QSERDES_V7_COM_SSC_STEP_SIZE1_MODE1 0x00
#define QSERDES_V7_COM_SSC_STEP_SIZE2_MODE1 0x04
#define QSERDES_V7_COM_CP_CTRL_MODE1 0x10
#define QSERDES_V7_COM_PLL_RCTRL_MODE1 0x14
#define QSERDES_V7_COM_PLL_CCTRL_MODE1 0x18
#define QSERDES_V7_COM_CORECLK_DIV_MODE1 0x1c
#define QSERDES_V7_COM_LOCK_CMP1_MODE1 0x20
#define QSERDES_V7_COM_LOCK_CMP2_MODE1 0x24
#define QSERDES_V7_COM_DEC_START_MODE1 0x28
#define QSERDES_V7_COM_DEC_START_MSB_MODE1 0x2c
#define QSERDES_V7_COM_DIV_FRAC_START1_MODE1 0x30
#define QSERDES_V7_COM_DIV_FRAC_START2_MODE1 0x34
#define QSERDES_V7_COM_DIV_FRAC_START3_MODE1 0x38
#define QSERDES_V7_COM_HSCLK_SEL_1 0x3c
#define QSERDES_V7_COM_INTEGLOOP_GAIN0_MODE1 0x40
#define QSERDES_V7_COM_INTEGLOOP_GAIN1_MODE1 0x44
#define QSERDES_V7_COM_VCO_TUNE1_MODE1 0x48
#define QSERDES_V7_COM_VCO_TUNE2_MODE1 0x4c
#define QSERDES_V7_COM_BIN_VCOCAL_CMP_CODE1_MODE1 0x50
#define QSERDES_V7_COM_BIN_VCOCAL_CMP_CODE2_MODE1 0x54
#define QSERDES_V7_COM_BIN_VCOCAL_CMP_CODE1_MODE0 0x58
#define QSERDES_V7_COM_BIN_VCOCAL_CMP_CODE2_MODE0 0x5c
#define QSERDES_V7_COM_SSC_STEP_SIZE1_MODE0 0x60
#define QSERDES_V7_COM_SSC_STEP_SIZE2_MODE0 0x64
#define QSERDES_V7_COM_CP_CTRL_MODE0 0x70
#define QSERDES_V7_COM_PLL_RCTRL_MODE0 0x74
#define QSERDES_V7_COM_PLL_CCTRL_MODE0 0x78
#define QSERDES_V7_COM_PLL_CORE_CLK_DIV_MODE0 0x7c
#define QSERDES_V7_COM_LOCK_CMP1_MODE0 0x80
#define QSERDES_V7_COM_LOCK_CMP2_MODE0 0x84
#define QSERDES_V7_COM_DEC_START_MODE0 0x88
#define QSERDES_V7_COM_DEC_START_MSB_MODE0 0x8c
#define QSERDES_V7_COM_DIV_FRAC_START1_MODE0 0x90
#define QSERDES_V7_COM_DIV_FRAC_START2_MODE0 0x94
#define QSERDES_V7_COM_DIV_FRAC_START3_MODE0 0x98
#define QSERDES_V7_COM_HSCLK_HS_SWITCH_SEL_1 0x9c
#define QSERDES_V7_COM_INTEGLOOP_GAIN0_MODE0 0xa0
#define QSERDES_V7_COM_INTEGLOOP_GAIN1_MODE0 0xa4
#define QSERDES_V7_COM_VCO_TUNE1_MODE0 0xa8
#define QSERDES_V7_COM_VCO_TUNE2_MODE0 0xac
#define QSERDES_V7_COM_BG_TIMER 0xbc
#define QSERDES_V7_COM_SSC_EN_CENTER 0xc0
#define QSERDES_V7_COM_SSC_ADJ_PER1 0xc4
#define QSERDES_V7_COM_SSC_PER1 0xcc
#define QSERDES_V7_COM_SSC_PER2 0xd0
#define QSERDES_V7_COM_PLL_POST_DIV_MUX 0xd8
#define QSERDES_V7_COM_PLL_BIAS_EN_CLK_BUFLR_EN 0xdc
#define QSERDES_V7_COM_CLK_ENABLE1 0xe0
#define QSERDES_V7_COM_SYS_CLK_CTRL 0xe4
#define QSERDES_V7_COM_SYSCLK_BUF_ENABLE 0xe8
#define QSERDES_V7_COM_PLL_IVCO 0xf4
#define QSERDES_V7_COM_PLL_IVCO_MODE1 0xf8
#define QSERDES_V7_COM_SYSCLK_EN_SEL 0x110
#define QSERDES_V7_COM_RESETSM_CNTRL 0x118
#define QSERDES_V7_COM_LOCK_CMP_EN 0x120
#define QSERDES_V7_COM_LOCK_CMP_CFG 0x124
#define QSERDES_V7_COM_VCO_TUNE_CTRL 0x13c
#define QSERDES_V7_COM_VCO_TUNE_MAP 0x140
#define QSERDES_V7_COM_VCO_TUNE_INITVAL2 0x148
#define QSERDES_V7_COM_VCO_TUNE_MAXVAL2 0x158
#define QSERDES_V7_COM_CLK_SELECT 0x164
#define QSERDES_V7_COM_CORE_CLK_EN 0x170
#define QSERDES_V7_COM_CMN_CONFIG_1 0x174
#define QSERDES_V7_COM_SVS_MODE_CLK_SEL 0x17c
#define QSERDES_V7_COM_CMN_MISC_1 0x184
#define QSERDES_V7_COM_CMN_MODE 0x188
#define QSERDES_V7_COM_PLL_VCO_DC_LEVEL_CTRL 0x198
#define QSERDES_V7_COM_AUTO_GAIN_ADJ_CTRL_1 0x1a4
#define QSERDES_V7_COM_AUTO_GAIN_ADJ_CTRL_2 0x1a8
#define QSERDES_V7_COM_AUTO_GAIN_ADJ_CTRL_3 0x1ac
#define QSERDES_V7_COM_ADDITIONAL_MISC 0x1b4
#define QSERDES_V7_COM_ADDITIONAL_MISC_2 0x1b8
#define QSERDES_V7_COM_ADDITIONAL_MISC_3 0x1bc
#define QSERDES_V7_COM_CMN_STATUS 0x1d0
#define QSERDES_V7_COM_C_READY_STATUS 0x1f8
#endif
...@@ -10,10 +10,18 @@ ...@@ -10,10 +10,18 @@
#define QSERDES_UFS_V6_TX_RES_CODE_LANE_RX 0x2c #define QSERDES_UFS_V6_TX_RES_CODE_LANE_RX 0x2c
#define QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_TX 0x30 #define QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_TX 0x30
#define QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_RX 0x34 #define QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_RX 0x34
#define QSERDES_UFS_V6_TX_LANE_MODE_1 0x7c
#define QSERDES_UFS_V6_TX_FR_DCC_CTRL 0x108
#define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE2 0x08 #define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE2 0x08
#define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE4 0x10 #define QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE4 0x10
#define QSERDES_UFS_V6_RX_UCDR_SO_SATURATION 0x28
#define QSERDES_UFS_V6_RX_UCDR_PI_CTRL1 0x58
#define QSERDES_UFS_V6_RX_RX_TERM_BW_CTRL0 0xc4
#define QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE2 0xd4
#define QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE4 0xdc
#define QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL 0x178 #define QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL 0x178
#define QSERDES_UFS_V6_RX_INTERFACE_MODE 0x1e0
#define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B0 0x208 #define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B0 0x208
#define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B1 0x20c #define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B1 0x20c
#define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B3 0x214 #define QSERDES_UFS_V6_RX_MODE_RATE_0_1_B3 0x214
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#define QSERDES_V6_TX_PARRATE_REC_DETECT_IDLE_EN 0x60 #define QSERDES_V6_TX_PARRATE_REC_DETECT_IDLE_EN 0x60
#define QSERDES_V6_TX_BIST_PATTERN7 0x7c #define QSERDES_V6_TX_BIST_PATTERN7 0x7c
#define QSERDES_V6_TX_LANE_MODE_1 0x84 #define QSERDES_V6_TX_LANE_MODE_1 0x84
#define QSERDES_V6_TX_LANE_MODE_2 0x88
#define QSERDES_V6_TX_LANE_MODE_3 0x8c #define QSERDES_V6_TX_LANE_MODE_3 0x8c
#define QSERDES_V6_TX_LANE_MODE_4 0x90 #define QSERDES_V6_TX_LANE_MODE_4 0x90
#define QSERDES_V6_TX_LANE_MODE_5 0x94 #define QSERDES_V6_TX_LANE_MODE_5 0x94
......
...@@ -15,10 +15,13 @@ ...@@ -15,10 +15,13 @@
#define QSERDES_V6_20_RX_UCDR_FO_GAIN_RATE_2 0x08 #define QSERDES_V6_20_RX_UCDR_FO_GAIN_RATE_2 0x08
#define QSERDES_V6_20_RX_UCDR_FO_GAIN_RATE_3 0x0c #define QSERDES_V6_20_RX_UCDR_FO_GAIN_RATE_3 0x0c
#define QSERDES_V6_20_RX_UCDR_SO_GAIN_RATE_2 0x18
#define QSERDES_V6_20_RX_UCDR_PI_CONTROLS 0x20 #define QSERDES_V6_20_RX_UCDR_PI_CONTROLS 0x20
#define QSERDES_V6_20_RX_UCDR_SO_ACC_DEFAULT_VAL_RATE3 0x34 #define QSERDES_V6_20_RX_UCDR_SO_ACC_DEFAULT_VAL_RATE3 0x34
#define QSERDES_V6_20_RX_IVCM_CAL_CTRL2 0x9c #define QSERDES_V6_20_RX_IVCM_CAL_CTRL2 0x9c
#define QSERDES_V6_20_RX_IVCM_POSTCAL_OFFSET 0xa0 #define QSERDES_V6_20_RX_IVCM_POSTCAL_OFFSET 0xa0
#define QSERDES_V6_20_RX_DFE_1 0xac
#define QSERDES_V6_20_RX_DFE_2 0xb0
#define QSERDES_V6_20_RX_DFE_3 0xb4 #define QSERDES_V6_20_RX_DFE_3 0xb4
#define QSERDES_V6_20_RX_VGA_CAL_MAN_VAL 0xe8 #define QSERDES_V6_20_RX_VGA_CAL_MAN_VAL 0xe8
#define QSERDES_V6_20_RX_GM_CAL 0x10c #define QSERDES_V6_20_RX_GM_CAL 0x10c
...@@ -41,5 +44,6 @@ ...@@ -41,5 +44,6 @@
#define QSERDES_V6_20_RX_MODE_RATE3_B4 0x220 #define QSERDES_V6_20_RX_MODE_RATE3_B4 0x220
#define QSERDES_V6_20_RX_MODE_RATE3_B5 0x224 #define QSERDES_V6_20_RX_MODE_RATE3_B5 0x224
#define QSERDES_V6_20_RX_MODE_RATE3_B6 0x228 #define QSERDES_V6_20_RX_MODE_RATE3_B6 0x228
#define QSERDES_V6_20_RX_BKUP_CTRL1 0x22c
#endif #endif
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2023, Linaro Limited
*/
#ifndef QCOM_PHY_QMP_QSERDES_TXRX_V6_N4_H_
#define QCOM_PHY_QMP_QSERDES_TXRX_V6_N4_H_
#define QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_TX 0x30
#define QSERDES_V6_N4_TX_RES_CODE_LANE_OFFSET_RX 0x34
#define QSERDES_V6_N4_TX_LANE_MODE_1 0x78
#define QSERDES_V6_N4_TX_LANE_MODE_2 0x7c
#define QSERDES_V6_N4_TX_LANE_MODE_3 0x80
#define QSERDES_V6_N4_RX_UCDR_FO_GAIN_RATE2 0x8
#define QSERDES_V6_N4_RX_UCDR_SO_GAIN_RATE2 0x18
#define QSERDES_V6_N4_RX_UCDR_PI_CONTROLS 0x20
#define QSERDES_V6_N4_RX_IVCM_CAL_CODE_OVERRIDE 0x94
#define QSERDES_V6_N4_RX_RX_IVCM_CAL_CTRL2 0x9c
#define QSERDES_V6_N4_RX_RX_IVCM_POSTCAL_OFFSET 0xa0
#define QSERDES_V6_N4_RX_DFE_3 0xb4
#define QSERDES_V6_N4_RX_VGA_CAL_CNTRL1 0xe0
#define QSERDES_V6_N4_RX_VGA_CAL_MAN_VAL 0xe8
#define QSERDES_V6_N4_RX_GM_CAL 0x10c
#define QSERDES_V6_N4_RX_SIGDET_ENABLES 0x148
#define QSERDES_V6_N4_RX_SIGDET_CNTRL 0x14c
#define QSERDES_V6_N4_RX_SIGDET_DEGLITCH_CNTRL 0x154
#define QSERDES_V6_N4_RX_DFE_CTLE_POST_CAL_OFFSET 0x194
#define QSERDES_V6_N4_RX_Q_PI_INTRINSIC_BIAS_RATE32 0x1dc
#define QSERDES_V6_N4_RX_UCDR_PI_CTRL1 0x23c
#define QSERDES_V6_N4_RX_UCDR_PI_CTRL2 0x240
#define QSERDES_V6_N4_RX_UCDR_SB2_GAIN2_RATE2 0x27c
#define QSERDES_V6_N4_RX_DFE_DAC_ENABLE1 0x298
#define QSERDES_V6_N4_RX_MODE_RATE_0_1_B0 0x2b8
#define QSERDES_V6_N4_RX_MODE_RATE_0_1_B1 0x2bc
#define QSERDES_V6_N4_RX_MODE_RATE_0_1_B2 0x2c0
#define QSERDES_V6_N4_RX_MODE_RATE_0_1_B3 0x2c4
#define QSERDES_V6_N4_RX_MODE_RATE_0_1_B4 0x2c8
#define QSERDES_V6_N4_RX_MODE_RATE_0_1_B5 0x2cc
#define QSERDES_V6_N4_RX_MODE_RATE_0_1_B6 0x2d0
#define QSERDES_V6_N4_RX_MODE_RATE2_B0 0x2d4
#define QSERDES_V6_N4_RX_MODE_RATE2_B1 0x2d8
#define QSERDES_V6_N4_RX_MODE_RATE2_B2 0x2dc
#define QSERDES_V6_N4_RX_MODE_RATE2_B3 0x2e0
#define QSERDES_V6_N4_RX_MODE_RATE2_B4 0x2e4
#define QSERDES_V6_N4_RX_MODE_RATE2_B5 0x2e8
#define QSERDES_V6_N4_RX_MODE_RATE2_B6 0x2ec
#define QSERDES_V6_N4_RX_RX_SUMMER_CAL_SPD_MODE 0x30c
#define QSERDES_V6_N4_RX_RX_BKUP_CTRL1 0x310
#endif
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (c) 2023, Linaro Limited
*/
#ifndef QCOM_PHY_QMP_QSERDES_TXRX_V7_H_
#define QCOM_PHY_QMP_QSERDES_TXRX_V7_H_
#define QSERDES_V7_TX_CLKBUF_ENABLE 0x08
#define QSERDES_V7_TX_RESET_TSYNC_EN 0x1c
#define QSERDES_V7_TX_PRE_STALL_LDO_BOOST_EN 0x20
#define QSERDES_V7_TX_TX_BAND 0x24
#define QSERDES_V7_TX_INTERFACE_SELECT 0x2c
#define QSERDES_V7_TX_RES_CODE_LANE_TX 0x34
#define QSERDES_V7_TX_RES_CODE_LANE_RX 0x38
#define QSERDES_V7_TX_RES_CODE_LANE_OFFSET_TX 0x3c
#define QSERDES_V7_TX_RES_CODE_LANE_OFFSET_RX 0x40
#define QSERDES_V7_TX_PARRATE_REC_DETECT_IDLE_EN 0x60
#define QSERDES_V7_TX_BIST_PATTERN7 0x7c
#define QSERDES_V7_TX_LANE_MODE_1 0x84
#define QSERDES_V7_TX_LANE_MODE_2 0x88
#define QSERDES_V7_TX_LANE_MODE_3 0x8c
#define QSERDES_V7_TX_LANE_MODE_4 0x90
#define QSERDES_V7_TX_LANE_MODE_5 0x94
#define QSERDES_V7_TX_RCV_DETECT_LVL_2 0xa4
#define QSERDES_V7_TX_TRAN_DRVR_EMP_EN 0xc0
#define QSERDES_V7_TX_TX_INTERFACE_MODE 0xc4
#define QSERDES_V7_TX_VMODE_CTRL1 0xc8
#define QSERDES_V7_TX_PI_QEC_CTRL 0xe4
#define QSERDES_V7_RX_UCDR_FO_GAIN 0x08
#define QSERDES_V7_RX_UCDR_SO_GAIN 0x14
#define QSERDES_V7_RX_UCDR_FASTLOCK_FO_GAIN 0x30
#define QSERDES_V7_RX_UCDR_SO_SATURATION_AND_ENABLE 0x34
#define QSERDES_V7_RX_UCDR_FASTLOCK_COUNT_LOW 0x3c
#define QSERDES_V7_RX_UCDR_FASTLOCK_COUNT_HIGH 0x40
#define QSERDES_V7_RX_UCDR_PI_CONTROLS 0x44
#define QSERDES_V7_RX_UCDR_SB2_THRESH1 0x4c
#define QSERDES_V7_RX_UCDR_SB2_THRESH2 0x50
#define QSERDES_V7_RX_UCDR_SB2_GAIN1 0x54
#define QSERDES_V7_RX_UCDR_SB2_GAIN2 0x58
#define QSERDES_V7_RX_AUX_DATA_TCOARSE_TFINE 0x60
#define QSERDES_V7_RX_TX_ADAPT_POST_THRESH 0xcc
#define QSERDES_V7_RX_VGA_CAL_CNTRL1 0xd4
#define QSERDES_V7_RX_VGA_CAL_CNTRL2 0xd8
#define QSERDES_V7_RX_GM_CAL 0xdc
#define QSERDES_V7_RX_RX_EQU_ADAPTOR_CNTRL2 0xec
#define QSERDES_V7_RX_RX_EQU_ADAPTOR_CNTRL3 0xf0
#define QSERDES_V7_RX_RX_EQU_ADAPTOR_CNTRL4 0xf4
#define QSERDES_V7_RX_RX_IDAC_TSETTLE_LOW 0xf8
#define QSERDES_V7_RX_RX_IDAC_TSETTLE_HIGH 0xfc
#define QSERDES_V7_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1 0x110
#define QSERDES_V7_RX_SIDGET_ENABLES 0x118
#define QSERDES_V7_RX_SIGDET_CNTRL 0x11c
#define QSERDES_V7_RX_SIGDET_DEGLITCH_CNTRL 0x124
#define QSERDES_V7_RX_RX_MODE_00_LOW 0x15c
#define QSERDES_V7_RX_RX_MODE_00_HIGH 0x160
#define QSERDES_V7_RX_RX_MODE_00_HIGH2 0x164
#define QSERDES_V7_RX_RX_MODE_00_HIGH3 0x168
#define QSERDES_V7_RX_RX_MODE_00_HIGH4 0x16c
#define QSERDES_V7_RX_RX_MODE_01_LOW 0x170
#define QSERDES_V7_RX_RX_MODE_01_HIGH 0x174
#define QSERDES_V7_RX_RX_MODE_01_HIGH2 0x178
#define QSERDES_V7_RX_RX_MODE_01_HIGH3 0x17c
#define QSERDES_V7_RX_RX_MODE_01_HIGH4 0x180
#define QSERDES_V7_RX_RX_MODE_10_LOW 0x184
#define QSERDES_V7_RX_RX_MODE_10_HIGH 0x188
#define QSERDES_V7_RX_RX_MODE_10_HIGH2 0x18c
#define QSERDES_V7_RX_RX_MODE_10_HIGH3 0x190
#define QSERDES_V7_RX_RX_MODE_10_HIGH4 0x194
#define QSERDES_V7_RX_DFE_EN_TIMER 0x1a0
#define QSERDES_V7_RX_DFE_CTLE_POST_CAL_OFFSET 0x1a4
#define QSERDES_V7_RX_DCC_CTRL1 0x1a8
#define QSERDES_V7_RX_VTH_CODE 0x1b0
#define QSERDES_V7_RX_SIGDET_CAL_CTRL1 0x1e4
#define QSERDES_V7_RX_SIGDET_CAL_TRIM 0x1f8
#endif
...@@ -763,22 +763,26 @@ static const struct qmp_phy_init_tbl sm8550_ufsphy_serdes[] = { ...@@ -763,22 +763,26 @@ static const struct qmp_phy_init_tbl sm8550_ufsphy_serdes[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x14), QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x14),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x7f), QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x7f),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x06), QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x06),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x4c), QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE1, 0x4c),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x0a), QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE1, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE0, 0x18), QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE1, 0x18),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x14), QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE1, 0x14),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x99), QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE1, 0x99),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x07), QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE1, 0x07),
};
static const struct qmp_phy_init_tbl sm8550_ufsphy_hs_b_serdes[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x44),
}; };
static const struct qmp_phy_init_tbl sm8550_ufsphy_tx[] = { static const struct qmp_phy_init_tbl sm8550_ufsphy_tx[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_TX_LANE_MODE_1, 0x05), QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_LANE_MODE_1, 0x05),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_TX, 0x07), QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_TX, 0x07),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_FR_DCC_CTRL, 0x4c),
}; };
static const struct qmp_phy_init_tbl sm8550_ufsphy_rx[] = { static const struct qmp_phy_init_tbl sm8550_ufsphy_rx[] = {
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE2, 0x0c), QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE2, 0x0c),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FASTLOCK_FO_GAIN_RATE4, 0x0f),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL, 0x0e), QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL, 0x0e),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B0, 0xc2), QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B0, 0xc2),
...@@ -801,6 +805,69 @@ static const struct qmp_phy_init_tbl sm8550_ufsphy_pcs[] = { ...@@ -801,6 +805,69 @@ static const struct qmp_phy_init_tbl sm8550_ufsphy_pcs[] = {
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_MID_TERM_CTRL1, 0x43), QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_MID_TERM_CTRL1, 0x43),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x2b), QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x2b),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_MULTI_LANE_CTRL1, 0x02), QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_MULTI_LANE_CTRL1, 0x02),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_HSGEAR_CAPABILITY, 0x04),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HSGEAR_CAPABILITY, 0x04),
};
static const struct qmp_phy_init_tbl sm8650_ufsphy_serdes[] = {
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYSCLK_EN_SEL, 0xd9),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CMN_CONFIG_1, 0x16),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x11),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_HS_SWITCH_SEL_1, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x01),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO, 0x0f),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x44),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_INITVAL2, 0x00),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x41),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE0, 0x18),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x14),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0x7f),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x06),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE1, 0x4c),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE1, 0x0a),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE1, 0x18),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE1, 0x14),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE1, 0x99),
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE1, 0x07),
};
static const struct qmp_phy_init_tbl sm8650_ufsphy_tx[] = {
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_LANE_MODE_1, 0x05),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_TX_RES_CODE_LANE_OFFSET_TX, 0x07),
};
static const struct qmp_phy_init_tbl sm8650_ufsphy_rx[] = {
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE2, 0x0c),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_FO_GAIN_RATE4, 0x0f),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_VGA_CAL_MAN_VAL, 0x0e),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B0, 0xc2),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B1, 0xc2),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B3, 0x1a),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE_0_1_B6, 0x60),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE2_B3, 0x9e),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE2_B6, 0x60),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE3_B3, 0x9e),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE3_B4, 0x0e),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE3_B5, 0x36),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE3_B8, 0x02),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE4_B3, 0xb9),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_MODE_RATE4_B6, 0xff),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_SO_SATURATION, 0x1f),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_UCDR_PI_CTRL1, 0x94),
QMP_PHY_INIT_CFG(QSERDES_UFS_V6_RX_RX_TERM_BW_CTRL0, 0xfa),
};
static const struct qmp_phy_init_tbl sm8650_ufsphy_pcs[] = {
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_MULTI_LANE_CTRL1, 0x00),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_MID_TERM_CTRL1, 0x43),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PCS_CTRL1, 0xc1),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x33),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_HSGEAR_CAPABILITY, 0x04),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HSGEAR_CAPABILITY, 0x04),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x0f),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_SIGDET_CTRL2, 0x69),
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_MULTI_LANE_CTRL1, 0x02),
}; };
struct qmp_ufs_offsets { struct qmp_ufs_offsets {
...@@ -1296,6 +1363,32 @@ static const struct qmp_phy_cfg sm8550_ufsphy_cfg = { ...@@ -1296,6 +1363,32 @@ static const struct qmp_phy_cfg sm8550_ufsphy_cfg = {
.pcs = sm8550_ufsphy_pcs, .pcs = sm8550_ufsphy_pcs,
.pcs_num = ARRAY_SIZE(sm8550_ufsphy_pcs), .pcs_num = ARRAY_SIZE(sm8550_ufsphy_pcs),
}, },
.tbls_hs_b = {
.serdes = sm8550_ufsphy_hs_b_serdes,
.serdes_num = ARRAY_SIZE(sm8550_ufsphy_hs_b_serdes),
},
.clk_list = sdm845_ufs_phy_clk_l,
.num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l),
.vreg_list = qmp_phy_vreg_l,
.num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
.regs = ufsphy_v6_regs_layout,
};
static const struct qmp_phy_cfg sm8650_ufsphy_cfg = {
.lanes = 2,
.offsets = &qmp_ufs_offsets_v6,
.tbls = {
.serdes = sm8650_ufsphy_serdes,
.serdes_num = ARRAY_SIZE(sm8650_ufsphy_serdes),
.tx = sm8650_ufsphy_tx,
.tx_num = ARRAY_SIZE(sm8650_ufsphy_tx),
.rx = sm8650_ufsphy_rx,
.rx_num = ARRAY_SIZE(sm8650_ufsphy_rx),
.pcs = sm8650_ufsphy_pcs,
.pcs_num = ARRAY_SIZE(sm8650_ufsphy_pcs),
},
.clk_list = sdm845_ufs_phy_clk_l, .clk_list = sdm845_ufs_phy_clk_l,
.num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l), .num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l),
.vreg_list = qmp_phy_vreg_l, .vreg_list = qmp_phy_vreg_l,
...@@ -1826,6 +1919,9 @@ static const struct of_device_id qmp_ufs_of_match_table[] = { ...@@ -1826,6 +1919,9 @@ static const struct of_device_id qmp_ufs_of_match_table[] = {
}, { }, {
.compatible = "qcom,sm8550-qmp-ufs-phy", .compatible = "qcom,sm8550-qmp-ufs-phy",
.data = &sm8550_ufsphy_cfg, .data = &sm8550_ufsphy_cfg,
}, {
.compatible = "qcom,sm8650-qmp-ufs-phy",
.data = &sm8650_ufsphy_cfg,
}, },
{ }, { },
}; };
......
This diff is collapsed.
...@@ -24,8 +24,12 @@ ...@@ -24,8 +24,12 @@
#include "phy-qcom-qmp-qserdes-com-v6.h" #include "phy-qcom-qmp-qserdes-com-v6.h"
#include "phy-qcom-qmp-qserdes-txrx-v6.h" #include "phy-qcom-qmp-qserdes-txrx-v6.h"
#include "phy-qcom-qmp-qserdes-txrx-v6_20.h" #include "phy-qcom-qmp-qserdes-txrx-v6_20.h"
#include "phy-qcom-qmp-qserdes-txrx-v6_n4.h"
#include "phy-qcom-qmp-qserdes-ln-shrd-v6.h" #include "phy-qcom-qmp-qserdes-ln-shrd-v6.h"
#include "phy-qcom-qmp-qserdes-com-v7.h"
#include "phy-qcom-qmp-qserdes-txrx-v7.h"
#include "phy-qcom-qmp-qserdes-pll.h" #include "phy-qcom-qmp-qserdes-pll.h"
#include "phy-qcom-qmp-pcs-v2.h" #include "phy-qcom-qmp-pcs-v2.h"
...@@ -44,6 +48,8 @@ ...@@ -44,6 +48,8 @@
#include "phy-qcom-qmp-pcs-v6_20.h" #include "phy-qcom-qmp-pcs-v6_20.h"
#include "phy-qcom-qmp-pcs-v7.h"
/* Only for QMP V3 & V4 PHY - DP COM registers */ /* Only for QMP V3 & V4 PHY - DP COM registers */
#define QPHY_V3_DP_COM_PHY_MODE_CTRL 0x00 #define QPHY_V3_DP_COM_PHY_MODE_CTRL 0x00
#define QPHY_V3_DP_COM_SW_RESET 0x04 #define QPHY_V3_DP_COM_SW_RESET 0x04
......
...@@ -13,7 +13,7 @@ config PHY_R8A779F0_ETHERNET_SERDES ...@@ -13,7 +13,7 @@ config PHY_R8A779F0_ETHERNET_SERDES
config PHY_RCAR_GEN2 config PHY_RCAR_GEN2
tristate "Renesas R-Car generation 2 USB PHY driver" tristate "Renesas R-Car generation 2 USB PHY driver"
depends on ARCH_RENESAS depends on ARCH_RENESAS
depends on GENERIC_PHY select GENERIC_PHY
help help
Support for USB PHY found on Renesas R-Car generation 2 SoCs. Support for USB PHY found on Renesas R-Car generation 2 SoCs.
......
...@@ -248,7 +248,7 @@ static const ...@@ -248,7 +248,7 @@ static const
struct phy_gmii_sel_soc_data phy_gmii_sel_cpsw9g_soc_j784s4 = { struct phy_gmii_sel_soc_data phy_gmii_sel_cpsw9g_soc_j784s4 = {
.use_of_data = true, .use_of_data = true,
.regfields = phy_gmii_sel_fields_am654, .regfields = phy_gmii_sel_fields_am654,
.extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII) | .extra_modes = BIT(PHY_INTERFACE_MODE_QSGMII) | BIT(PHY_INTERFACE_MODE_SGMII) |
BIT(PHY_INTERFACE_MODE_USXGMII), BIT(PHY_INTERFACE_MODE_USXGMII),
.num_ports = 8, .num_ports = 8,
.num_qsgmii_main_ports = 2, .num_qsgmii_main_ports = 2,
......
...@@ -1240,6 +1240,7 @@ static int wiz_phy_fullrt_div(struct wiz *wiz, int lane) ...@@ -1240,6 +1240,7 @@ static int wiz_phy_fullrt_div(struct wiz *wiz, int lane)
case J721E_WIZ_10G: case J721E_WIZ_10G:
case J7200_WIZ_10G: case J7200_WIZ_10G:
case J721S2_WIZ_10G: case J721S2_WIZ_10G:
case J784S4_WIZ_10G:
if (wiz->lane_phy_type[lane] == PHY_TYPE_SGMII) if (wiz->lane_phy_type[lane] == PHY_TYPE_SGMII)
return regmap_field_write(wiz->p0_fullrt_div[lane], 0x2); return regmap_field_write(wiz->p0_fullrt_div[lane], 0x2);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment