PCI: qcom: don't clear out PHY_REFCLK_USE_PAD
Subsystems (4)
PATCH 1/1 PCI: qcom: don't clear out PHY_REFCLK_USE_PAD
This makes PCIe links come up again on ifc6410 (apq8064).
--- drivers/pci/controller/dwc/pcie-qcom.c | 1 - 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -1
@@ -387,7 +387,6 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)/* enable external reference clock */ val =readl (pcie->parf +PCIE20_PARF_PHY_REFCLK ); - val &= ~PHY_REFCLK_USE_PAD ; val |=PHY_REFCLK_SSP_EN ;writel (val, pcie->parf +PCIE20_PARF_PHY_REFCLK );
Signature · 1 line
2.26.2
R: [PATCH] PCI: qcom: don't clear out PHY_REFCLK_USE_PAD
Quoted 25 lines
-----Messaggio originale-----
Da: Ilia Mirkin <[email protected]> Per conto di Ilia Mirkin
Inviato: lunedì 7 settembre 2020 03:13
A: [email protected]
Cc: [email protected]; [email protected]; Ilia Mirkin <[email protected]>
Oggetto: [PATCH] PCI: qcom: don't clear outPHY_REFCLK_USE_PADThis makes PCIe links come up again on ifc6410 (apq8064).
Fixes de3c4bf6489 ("PCI: qcom: Add support for tx term offset for rev2.1.0")
Signed-off-by Ilia Mirkin <[email protected]>--- drivers/pci/controller/dwc/pcie-qcom.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/controller/dwc/pcie-qcom.c +0
-0
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_init_2_1_0(struct qcom_pcie · line 391
Quoted 5 lines
drivers/pci/controller/dwc/pcie-qcom.c +0
-1@@ -387,7 +387,6 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)/* enable external reference clock */ val =readl (pcie->parf +PCIE20_PARF_PHY_REFCLK ); - val &= ~PHY_REFCLK_USE_PAD ;
To make sure this doesn't brake ipq806x, why not limit the &= to the ipq806x compatible like we do up in the code? (or use the use_pad only if apq8064 compatible is not detected, to address ipq8064-v2 added later?)
Quoted 5 lines
drivers/pci/controller/dwc/pcie-qcom.c +0
-1val |=PHY_REFCLK_SSP_EN ;writel (val, pcie->parf +PCIE20_PARF_PHY_REFCLK ); --2.26.2
Quoted 28 lines · On Sun, Sep 6, 2020 at 9:18 PM <[email protected]> wrote:
Quoted 28 lines
-----Messaggio originale-----
Da: Ilia Mirkin <[email protected]> Per conto di Ilia Mirkin
Inviato: lunedì 7 settembre 2020 03:13
A: [email protected]
Cc: [email protected]; [email protected]; Ilia Mirkin <[email protected]>
Oggetto: [PATCH] PCI: qcom: don't clear outPHY_REFCLK_USE_PADThis makes PCIe links come up again on ifc6410 (apq8064).
Fixes de3c4bf6489 ("PCI: qcom: Add support for tx term offset for rev2.1.0")
Signed-off-by Ilia Mirkin <[email protected]>--- drivers/pci/controller/dwc/pcie-qcom.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/controller/dwc/pcie-qcom.c +0
-0@@ -387,7 +387,6 @@ static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie)
Quoted 7 lines
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) · line 390
Quoted 3 lines
drivers/pci/controller/dwc/pcie-qcom.c +0
-1/* enable external reference clock */ val =readl (pcie->parf +PCIE20_PARF_PHY_REFCLK ); - val &= ~PHY_REFCLK_USE_PAD ;To make sure this doesn't brake ipq806x, why not limit the &= to the ipq806x compatible like we do up in the code? (or use the
use_padonly if apq8064 compatible is not detected, to address ipq8064-v2 added later?)
Do you mean something like
if (!of_device_is_compatible(node, "qcom,pcie-apq8064")) val &= ~PHY_REFCLK_USE_PAD;
I'm not sure what's considered acceptable in these cases. It does seem odd that this bit should not be cleared on apq8064 but should be on ipq8064 -- perhaps there's more going on there? Unfortunately I haven't the faintest clue as to what it is...
-ilia
R: [PATCH] PCI: qcom: don't clear out PHY_REFCLK_USE_PAD
Quoted 53 lines
-----Messaggio originale-----
Da: Ilia Mirkin <[email protected]>
Inviato: lunedì 7 settembre 2020 05:29
A: Ansuel Smith <[email protected]>
Cc: [email protected]; Linux PCI <[email protected]>
Oggetto: Re: [PATCH] PCI: qcom: don't clear outPHY_REFCLK_USE_PADQuoted 8 lines · On Sun, Sep 6, 2020 at 9:18 PM <[email protected]> wrote:
Quoted 8 lines
-----Messaggio originale-----
Da: Ilia Mirkin <[email protected]> Per conto di Ilia Mirkin
Inviato: lunedì 7 settembre 2020 03:13
A: [email protected]
Cc: [email protected]; [email protected]; IliaMirkin
Quoted 12 lines
Quoted 12 lines
<[email protected]>
Oggetto: [PATCH] PCI: qcom: don't clear outPHY_REFCLK_USE_PADThis makes PCIe links come up again on ifc6410 (apq8064).
Fixes de3c4bf6489 ("PCI: qcom: Add support for tx term offset for rev2.1.0")
Signed-off-by Ilia Mirkin <[email protected]>--- drivers/pci/controller/dwc/pcie-qcom.c | 1 - 1 file changed, 1 deletion(-)Quoted 6 lines
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_init_2_1_0(struct
Quoted 6 lines
drivers/pci/controller/dwc/pcie-qcom.c +0
-0@@ -387,7 +387,6 @@ static int qcom_pcie_init_2_1_0(struct
qcom_pcieQuoted 7 lines
drivers/pci/controller/dwc/pcie-qcom.c static int qcom_pcie_init_2_1_0(struct qcom_pcie *pcie) · line 390
Quoted 5 lines
drivers/pci/controller/dwc/pcie-qcom.c +0
-1*pcie)/* enable external reference clock */ val =readl (pcie->parf +PCIE20_PARF_PHY_REFCLK ); - val &= ~PHY_REFCLK_USE_PAD ;To make sure this doesn't brake ipq806x, why not limit the &= to the
ipq806x
Quoted 1 line
compatible like we do up in the code? (or use the
use_padonly ifapq8064
Quoted 1 line
compatible is not detected, to address ipq8064-v2 added later?)
Do you mean something like
if (!of_device_is_compatible(node, "qcom,pcie-apq8064")) val &= ~PHY_REFCLK_USE_PAD;
Quoted 6 lines
I'm not sure what's considered acceptable in these cases. It does seem odd that this bit should not be cleared on apq8064 but should be on ipq8064 -- perhaps there's more going on there? Unfortunately I haven't the faintest clue as to what it is...
-ilia
Ok i did some test... Can confirm that the condition is needed. ipq806x needs the USE_PAD or the kernel just hangs.
When the pci interface is init the regs are 1019... For ipq806x this need to change to 10019 (external ref clk enabled and something else disabled that we don't know without documentation)
So to sum up... without the condition this patch would cause a regression for ipq8064/5.