[2/4] pcie-rcar: remove PHYRDY polling from rcar_pcie_hw_init_h1()

Message ID 5322b1c2-109d-bd0c-7785-697ca6a5324a@cogentembedded.com
State Superseded
Delegated to: Lorenzo Pieralisi
Headers show
Series
  • Add R8A77980 PCIe support & some driver cleanups
Related show

Commit Message

Sergei Shtylyov April 6, 2018, 11:04 a.m.
Now that we've added PCIEPHYSR.PHYRDY polling to rcar_pcie_hw_init(),
there is no need anymore  for polling the PHY specific register in
rcar_pcie_hw_init_h1() -- remove it.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
 drivers/pci/host/pcie-rcar.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

Comments

Simon Horman April 9, 2018, 10:56 a.m. | #1
On Fri, Apr 06, 2018 at 02:04:52PM +0300, Sergei Shtylyov wrote:
> Now that we've added PCIEPHYSR.PHYRDY polling to rcar_pcie_hw_init(),
> there is no need anymore  for polling the PHY specific register in
> rcar_pcie_hw_init_h1() -- remove it.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

This looks good, but has it been tested?
Sergei Shtylyov April 9, 2018, 3:33 p.m. | #2
On 04/09/2018 01:56 PM, Simon Horman wrote:

>> Now that we've added PCIEPHYSR.PHYRDY polling to rcar_pcie_hw_init(),
>> there is no need anymore  for polling the PHY specific register in
>> rcar_pcie_hw_init_h1() -- remove it.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> This looks good, but has it been tested?

   Unfortunately, no. Yet it fully matches the R-Car H1 manual v1.00.

MBR, Sergei

Patch

Index: pci/drivers/pci/host/pcie-rcar.c
===================================================================
--- pci.orig/drivers/pci/host/pcie-rcar.c
+++ pci/drivers/pci/host/pcie-rcar.c
@@ -102,7 +102,6 @@ 
 #define  LANE_POS		8
 #define  ADR_POS		0
 #define H1_PCIEPHYDOUTR		0x040014
-#define H1_PCIEPHYSR		0x040018
 
 /* R-Car Gen2 PHY */
 #define GEN2_PCIEPHYADDR	0x780
@@ -627,8 +626,6 @@  static int rcar_pcie_hw_init(struct rcar
 
 static int rcar_pcie_hw_init_h1(struct rcar_pcie *pcie)
 {
-	unsigned int timeout = 10;
-
 	/* Initialize the phy */
 	phy_write_reg(pcie, 0, 0x42, 0x1, 0x0EC34191);
 	phy_write_reg(pcie, 1, 0x42, 0x1, 0x0EC34180);
@@ -647,14 +644,7 @@  static int rcar_pcie_hw_init_h1(struct r
 	phy_write_reg(pcie, 0, 0x64, 0x1, 0x3F0F1F0F);
 	phy_write_reg(pcie, 0, 0x66, 0x1, 0x00008000);
 
-	while (timeout--) {
-		if (rcar_pci_read_reg(pcie, H1_PCIEPHYSR))
-			return rcar_pcie_hw_init(pcie);
-
-		msleep(5);
-	}
-
-	return -ETIMEDOUT;
+	return rcar_pcie_hw_init(pcie);
 }
 
 static int rcar_pcie_hw_init_gen2(struct rcar_pcie *pcie)