public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error
@ 2021-06-05 14:38 Anand Moon
  2021-06-05 14:38 ` [PATCHv4 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning Anand Moon
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anand Moon @ 2021-06-05 14:38 UTC (permalink / raw)
  To: u-boot; +Cc: Neil Armstrong, Kever Yang, Patrick Wildt

Use the generic error number instead of specific error number.
Changes fix the below error.

drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_read':
drivers/pci/pcie_dw_rockchip.c:70:10: error: 'PCIBIOS_UNSUPPORTED'
                        undeclared (first use in this function)
   70 |   return PCIBIOS_UNSUPPORTED;
      |          ^~~~~~~~~~~~~~~~~~~
drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_write':
drivers/pci/pcie_dw_rockchip.c:90:10: error: 'PCIBIOS_UNSUPPORTED'
                        undeclared (first use in this function)
   90 |   return PCIBIOS_UNSUPPORTED;
      |          ^~~~~~~~~~~~~~~~~~~

Cc: Patrick Wildt <patrick@blueri.se>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/pci/pcie_dw_rockchip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c
index bc22af4230..3ac2434b69 100644
--- a/drivers/pci/pcie_dw_rockchip.c
+++ b/drivers/pci/pcie_dw_rockchip.c
@@ -67,7 +67,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val)
 {
 	if ((uintptr_t)addr & (size - 1)) {
 		*val = 0;
-		return PCIBIOS_UNSUPPORTED;
+		return -EOPNOTSUPP;
 	}
 
 	if (size == 4) {
@@ -87,7 +87,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val)
 static int rk_pcie_write(void __iomem *addr, int size, u32 val)
 {
 	if ((uintptr_t)addr & (size - 1))
-		return PCIBIOS_UNSUPPORTED;
+		return -EOPNOTSUPP;
 
 	if (size == 4)
 		writel(val, addr);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCHv4 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning
  2021-06-05 14:38 [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Anand Moon
@ 2021-06-05 14:38 ` Anand Moon
  2021-06-18  2:29   ` Kever Yang
  2021-06-05 14:38 ` [PATCHv4 3/3] pci: pcie_dw_rockchip: Replace msleep occurences by udelay Anand Moon
  2021-06-18  2:29 ` [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Kever Yang
  2 siblings, 1 reply; 6+ messages in thread
From: Anand Moon @ 2021-06-05 14:38 UTC (permalink / raw)
  To: u-boot; +Cc: Neil Armstrong, Kever Yang, Patrick Wildt

Drop the unused variable warning below.

drivers/pci/pcie_dw_rockchip.c:161:6: warning: unused variable
'val' [-Wunused-variable]
  161 |  u32 val;
       |      ^~~
Cc: Patrick Wildt <patrick@blueri.se>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/pci/pcie_dw_rockchip.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c
index 3ac2434b69..4e448c0a3d 100644
--- a/drivers/pci/pcie_dw_rockchip.c
+++ b/drivers/pci/pcie_dw_rockchip.c
@@ -158,8 +158,6 @@ static inline void rk_pcie_writel_apb(struct rk_pcie *rk_pcie, u32 reg,
  */
 static void rk_pcie_configure(struct rk_pcie *pci, u32 cap_speed)
 {
-	u32 val;
-
 	dw_pcie_dbi_write_enable(&pci->dw, true);
 
 	clrsetbits_le32(pci->dw.dbi_base + PCIE_LINK_CAPABILITY,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCHv4 3/3] pci: pcie_dw_rockchip: Replace msleep occurences by udelay
  2021-06-05 14:38 [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Anand Moon
  2021-06-05 14:38 ` [PATCHv4 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning Anand Moon
@ 2021-06-05 14:38 ` Anand Moon
  2021-06-18  2:30   ` Kever Yang
  2021-06-18  2:29 ` [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Kever Yang
  2 siblings, 1 reply; 6+ messages in thread
From: Anand Moon @ 2021-06-05 14:38 UTC (permalink / raw)
  To: u-boot; +Cc: Neil Armstrong, Kever Yang, Patrick Wildt

Replace msleep occurences by udelay.

drivers/pci/pcie_dw_rockchip.c:254:3: warning: implicit
     declaration of function 'msleep' [-Wimplicit-function-declaration]

Cc: Patrick Wildt <patrick@blueri.se>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
Keep is simple...sorry !!!
---
 drivers/pci/pcie_dw_rockchip.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c
index 4e448c0a3d..9322e735b9 100644
--- a/drivers/pci/pcie_dw_rockchip.c
+++ b/drivers/pci/pcie_dw_rockchip.c
@@ -61,7 +61,7 @@ struct rk_pcie {
 #define PCIE_CLIENT_DBF_EN		0xffff0003
 
 /* Parameters for the waiting for #perst signal */
-#define PERST_WAIT_MS			1000
+#define MACRO_US			1000
 
 static int rk_pcie_read(void __iomem *addr, int size, u32 *val)
 {
@@ -249,7 +249,7 @@ static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed)
 		 * some wired devices need much more, such as 600ms.
 		 * Add a enough delay to cover all cases.
 		 */
-		msleep(PERST_WAIT_MS);
+		udelay(MACRO_US * 1000);
 		dm_gpio_set_value(&priv->rst_gpio, 1);
 	}
 
@@ -271,12 +271,12 @@ static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed)
 		dev_info(priv->dw.dev, "PCIe Linking... LTSSM is 0x%x\n",
 			 rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS));
 		rk_pcie_debug_dump(priv);
-		msleep(1000);
+		udelay(MACRO_US * 1000);
 	}
 
 	dev_err(priv->dw.dev, "PCIe-%d Link Fail\n", dev_seq(priv->dw.dev));
 	/* Link maybe in Gen switch recovery but we need to wait more 1s */
-	msleep(1000);
+	udelay(MACRO_US * 1000);
 	return -EIO;
 }
 
@@ -296,7 +296,7 @@ static int rockchip_pcie_init_port(struct udevice *dev)
 		}
 	}
 
-	msleep(1000);
+	udelay(MACRO_US * 1000);
 
 	ret = generic_phy_init(&priv->phy);
 	if (ret) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error
  2021-06-05 14:38 [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Anand Moon
  2021-06-05 14:38 ` [PATCHv4 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning Anand Moon
  2021-06-05 14:38 ` [PATCHv4 3/3] pci: pcie_dw_rockchip: Replace msleep occurences by udelay Anand Moon
@ 2021-06-18  2:29 ` Kever Yang
  2 siblings, 0 replies; 6+ messages in thread
From: Kever Yang @ 2021-06-18  2:29 UTC (permalink / raw)
  To: Anand Moon, u-boot; +Cc: Neil Armstrong, Patrick Wildt


On 2021/6/5 下午10:38, Anand Moon wrote:
> Use the generic error number instead of specific error number.
> Changes fix the below error.
>
> drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_read':
> drivers/pci/pcie_dw_rockchip.c:70:10: error: 'PCIBIOS_UNSUPPORTED'
>                          undeclared (first use in this function)
>     70 |   return PCIBIOS_UNSUPPORTED;
>        |          ^~~~~~~~~~~~~~~~~~~
> drivers/pci/pcie_dw_rockchip.c: In function 'rk_pcie_write':
> drivers/pci/pcie_dw_rockchip.c:90:10: error: 'PCIBIOS_UNSUPPORTED'
>                          undeclared (first use in this function)
>     90 |   return PCIBIOS_UNSUPPORTED;
>        |          ^~~~~~~~~~~~~~~~~~~
>
> Cc: Patrick Wildt <patrick@blueri.se>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
> Reviewed-by: Patrick Wildt <patrick@blueri.se>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/pci/pcie_dw_rockchip.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c
> index bc22af4230..3ac2434b69 100644
> --- a/drivers/pci/pcie_dw_rockchip.c
> +++ b/drivers/pci/pcie_dw_rockchip.c
> @@ -67,7 +67,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val)
>   {
>   	if ((uintptr_t)addr & (size - 1)) {
>   		*val = 0;
> -		return PCIBIOS_UNSUPPORTED;
> +		return -EOPNOTSUPP;
>   	}
>   
>   	if (size == 4) {
> @@ -87,7 +87,7 @@ static int rk_pcie_read(void __iomem *addr, int size, u32 *val)
>   static int rk_pcie_write(void __iomem *addr, int size, u32 val)
>   {
>   	if ((uintptr_t)addr & (size - 1))
> -		return PCIBIOS_UNSUPPORTED;
> +		return -EOPNOTSUPP;
>   
>   	if (size == 4)
>   		writel(val, addr);



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv4 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning
  2021-06-05 14:38 ` [PATCHv4 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning Anand Moon
@ 2021-06-18  2:29   ` Kever Yang
  0 siblings, 0 replies; 6+ messages in thread
From: Kever Yang @ 2021-06-18  2:29 UTC (permalink / raw)
  To: Anand Moon, u-boot; +Cc: Neil Armstrong, Patrick Wildt


On 2021/6/5 下午10:38, Anand Moon wrote:
> Drop the unused variable warning below.
>
> drivers/pci/pcie_dw_rockchip.c:161:6: warning: unused variable
> 'val' [-Wunused-variable]
>    161 |  u32 val;
>         |      ^~~
> Cc: Patrick Wildt <patrick@blueri.se>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
> Reviewed-by: Patrick Wildt <patrick@blueri.se>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
>   drivers/pci/pcie_dw_rockchip.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c
> index 3ac2434b69..4e448c0a3d 100644
> --- a/drivers/pci/pcie_dw_rockchip.c
> +++ b/drivers/pci/pcie_dw_rockchip.c
> @@ -158,8 +158,6 @@ static inline void rk_pcie_writel_apb(struct rk_pcie *rk_pcie, u32 reg,
>    */
>   static void rk_pcie_configure(struct rk_pcie *pci, u32 cap_speed)
>   {
> -	u32 val;
> -
>   	dw_pcie_dbi_write_enable(&pci->dw, true);
>   
>   	clrsetbits_le32(pci->dw.dbi_base + PCIE_LINK_CAPABILITY,



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCHv4 3/3] pci: pcie_dw_rockchip: Replace msleep occurences by udelay
  2021-06-05 14:38 ` [PATCHv4 3/3] pci: pcie_dw_rockchip: Replace msleep occurences by udelay Anand Moon
@ 2021-06-18  2:30   ` Kever Yang
  0 siblings, 0 replies; 6+ messages in thread
From: Kever Yang @ 2021-06-18  2:30 UTC (permalink / raw)
  To: Anand Moon, u-boot; +Cc: Neil Armstrong, Patrick Wildt


On 2021/6/5 下午10:38, Anand Moon wrote:
> Replace msleep occurences by udelay.
>
> drivers/pci/pcie_dw_rockchip.c:254:3: warning: implicit
>       declaration of function 'msleep' [-Wimplicit-function-declaration]
>
> Cc: Patrick Wildt <patrick@blueri.se>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Kever Yang <kever.yang@rock-chips.com>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
> ---
> Keep is simple...sorry !!!
> ---
>   drivers/pci/pcie_dw_rockchip.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/pcie_dw_rockchip.c b/drivers/pci/pcie_dw_rockchip.c
> index 4e448c0a3d..9322e735b9 100644
> --- a/drivers/pci/pcie_dw_rockchip.c
> +++ b/drivers/pci/pcie_dw_rockchip.c
> @@ -61,7 +61,7 @@ struct rk_pcie {
>   #define PCIE_CLIENT_DBF_EN		0xffff0003
>   
>   /* Parameters for the waiting for #perst signal */
> -#define PERST_WAIT_MS			1000
> +#define MACRO_US			1000
>   
>   static int rk_pcie_read(void __iomem *addr, int size, u32 *val)
>   {
> @@ -249,7 +249,7 @@ static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed)
>   		 * some wired devices need much more, such as 600ms.
>   		 * Add a enough delay to cover all cases.
>   		 */
> -		msleep(PERST_WAIT_MS);
> +		udelay(MACRO_US * 1000);
>   		dm_gpio_set_value(&priv->rst_gpio, 1);
>   	}
>   
> @@ -271,12 +271,12 @@ static int rk_pcie_link_up(struct rk_pcie *priv, u32 cap_speed)
>   		dev_info(priv->dw.dev, "PCIe Linking... LTSSM is 0x%x\n",
>   			 rk_pcie_readl_apb(priv, PCIE_CLIENT_LTSSM_STATUS));
>   		rk_pcie_debug_dump(priv);
> -		msleep(1000);
> +		udelay(MACRO_US * 1000);
>   	}
>   
>   	dev_err(priv->dw.dev, "PCIe-%d Link Fail\n", dev_seq(priv->dw.dev));
>   	/* Link maybe in Gen switch recovery but we need to wait more 1s */
> -	msleep(1000);
> +	udelay(MACRO_US * 1000);
>   	return -EIO;
>   }
>   
> @@ -296,7 +296,7 @@ static int rockchip_pcie_init_port(struct udevice *dev)
>   		}
>   	}
>   
> -	msleep(1000);
> +	udelay(MACRO_US * 1000);
>   
>   	ret = generic_phy_init(&priv->phy);
>   	if (ret) {



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-18  2:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-05 14:38 [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Anand Moon
2021-06-05 14:38 ` [PATCHv4 2/3] pci: pcie_dw_rockchip: Drop the unused variable warning Anand Moon
2021-06-18  2:29   ` Kever Yang
2021-06-05 14:38 ` [PATCHv4 3/3] pci: pcie_dw_rockchip: Replace msleep occurences by udelay Anand Moon
2021-06-18  2:30   ` Kever Yang
2021-06-18  2:29 ` [PATCHv4 1/3] pci: pcie_dw_rockchip: Fixed the below compilation error Kever Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox