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

2018-04-09 Thread Sergei Shtylyov
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 
> 
> This looks good, but has it been tested?

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

MBR, Sergei




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

2018-04-09 Thread Simon Horman
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 

This looks good, but has it been tested?


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

2018-04-06 Thread Sergei Shtylyov
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 

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

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_PCIEPHYDOUTR0x040014
-#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, 0x8000);
 
-   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)