All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
@ 2021-08-19 12:59 ` Jianjun Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Jianjun Wang @ 2021-08-19 12:59 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyski,
	Bjorn Helgaas, Ryder Lee, Matthias Brugger
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	Jianjun Wang, qizhong.cheng, Ryan-JH.Yu

When the DVFSRC feature is not implemented, the MAC layer will
assert a voltage request signal when exit from the L1ss state,
but cannot receive the voltage ready signal, which will cause
the link to fail to exit the L1ss state correctly.

Disable DVFSRC voltage request by default, we need to find
a common way to enable it in the future.

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
---
 drivers/pci/controller/pcie-mediatek-gen3.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index f3aeb8d4eaca..79fb12fca6a9 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -79,6 +79,9 @@
 #define PCIE_ICMD_PM_REG		0x198
 #define PCIE_TURN_OFF_LINK		BIT(4)
 
+#define PCIE_MISC_CTRL_REG		0x348
+#define PCIE_DISABLE_DVFSRC_VLT_REQ	BIT(1)
+
 #define PCIE_TRANS_TABLE_BASE_REG	0x800
 #define PCIE_ATR_SRC_ADDR_MSB_OFFSET	0x4
 #define PCIE_ATR_TRSL_ADDR_LSB_OFFSET	0x8
@@ -297,6 +300,11 @@ static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
 	val &= ~PCIE_INTX_ENABLE;
 	writel_relaxed(val, port->base + PCIE_INT_ENABLE_REG);
 
+	/* Disable DVFSRC voltage request */
+	val = readl_relaxed(port->base + PCIE_MISC_CTRL_REG);
+	val |= PCIE_DISABLE_DVFSRC_VLT_REQ;
+	writel_relaxed(val, port->base + PCIE_MISC_CTRL_REG);
+
 	/* Assert all reset signals */
 	val = readl_relaxed(port->base + PCIE_RST_CTRL_REG);
 	val |= PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB;
-- 
2.18.0


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

* [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
@ 2021-08-19 12:59 ` Jianjun Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Jianjun Wang @ 2021-08-19 12:59 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyski,
	Bjorn Helgaas, Ryder Lee, Matthias Brugger
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	Jianjun Wang, qizhong.cheng, Ryan-JH.Yu

When the DVFSRC feature is not implemented, the MAC layer will
assert a voltage request signal when exit from the L1ss state,
but cannot receive the voltage ready signal, which will cause
the link to fail to exit the L1ss state correctly.

Disable DVFSRC voltage request by default, we need to find
a common way to enable it in the future.

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
---
 drivers/pci/controller/pcie-mediatek-gen3.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index f3aeb8d4eaca..79fb12fca6a9 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -79,6 +79,9 @@
 #define PCIE_ICMD_PM_REG		0x198
 #define PCIE_TURN_OFF_LINK		BIT(4)
 
+#define PCIE_MISC_CTRL_REG		0x348
+#define PCIE_DISABLE_DVFSRC_VLT_REQ	BIT(1)
+
 #define PCIE_TRANS_TABLE_BASE_REG	0x800
 #define PCIE_ATR_SRC_ADDR_MSB_OFFSET	0x4
 #define PCIE_ATR_TRSL_ADDR_LSB_OFFSET	0x8
@@ -297,6 +300,11 @@ static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
 	val &= ~PCIE_INTX_ENABLE;
 	writel_relaxed(val, port->base + PCIE_INT_ENABLE_REG);
 
+	/* Disable DVFSRC voltage request */
+	val = readl_relaxed(port->base + PCIE_MISC_CTRL_REG);
+	val |= PCIE_DISABLE_DVFSRC_VLT_REQ;
+	writel_relaxed(val, port->base + PCIE_MISC_CTRL_REG);
+
 	/* Assert all reset signals */
 	val = readl_relaxed(port->base + PCIE_RST_CTRL_REG);
 	val |= PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB;
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
@ 2021-08-19 12:59 ` Jianjun Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Jianjun Wang @ 2021-08-19 12:59 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyski,
	Bjorn Helgaas, Ryder Lee, Matthias Brugger
  Cc: linux-pci, linux-mediatek, linux-kernel, linux-arm-kernel,
	Jianjun Wang, qizhong.cheng, Ryan-JH.Yu

When the DVFSRC feature is not implemented, the MAC layer will
assert a voltage request signal when exit from the L1ss state,
but cannot receive the voltage ready signal, which will cause
the link to fail to exit the L1ss state correctly.

Disable DVFSRC voltage request by default, we need to find
a common way to enable it in the future.

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
---
 drivers/pci/controller/pcie-mediatek-gen3.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
index f3aeb8d4eaca..79fb12fca6a9 100644
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
@@ -79,6 +79,9 @@
 #define PCIE_ICMD_PM_REG		0x198
 #define PCIE_TURN_OFF_LINK		BIT(4)
 
+#define PCIE_MISC_CTRL_REG		0x348
+#define PCIE_DISABLE_DVFSRC_VLT_REQ	BIT(1)
+
 #define PCIE_TRANS_TABLE_BASE_REG	0x800
 #define PCIE_ATR_SRC_ADDR_MSB_OFFSET	0x4
 #define PCIE_ATR_TRSL_ADDR_LSB_OFFSET	0x8
@@ -297,6 +300,11 @@ static int mtk_pcie_startup_port(struct mtk_pcie_port *port)
 	val &= ~PCIE_INTX_ENABLE;
 	writel_relaxed(val, port->base + PCIE_INT_ENABLE_REG);
 
+	/* Disable DVFSRC voltage request */
+	val = readl_relaxed(port->base + PCIE_MISC_CTRL_REG);
+	val |= PCIE_DISABLE_DVFSRC_VLT_REQ;
+	writel_relaxed(val, port->base + PCIE_MISC_CTRL_REG);
+
 	/* Assert all reset signals */
 	val = readl_relaxed(port->base + PCIE_RST_CTRL_REG);
 	val |= PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB;
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
  2021-08-19 12:59 ` Jianjun Wang
  (?)
@ 2021-08-20  3:25   ` Tzung-Bi Shih
  -1 siblings, 0 replies; 10+ messages in thread
From: Tzung-Bi Shih @ 2021-08-20  3:25 UTC (permalink / raw)
  To: Jianjun Wang
  Cc: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyski,
	Bjorn Helgaas, Ryder Lee, Matthias Brugger, linux-pci,
	linux-mediatek, linux-kernel, linux-arm-kernel, qizhong.cheng,
	Ryan-JH.Yu

On Thu, Aug 19, 2021 at 08:59:39PM +0800, Jianjun Wang wrote:
> Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>

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

* Re: [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
@ 2021-08-20  3:25   ` Tzung-Bi Shih
  0 siblings, 0 replies; 10+ messages in thread
From: Tzung-Bi Shih @ 2021-08-20  3:25 UTC (permalink / raw)
  To: Jianjun Wang
  Cc: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyski,
	Bjorn Helgaas, Ryder Lee, Matthias Brugger, linux-pci,
	linux-mediatek, linux-kernel, linux-arm-kernel, qizhong.cheng,
	Ryan-JH.Yu

On Thu, Aug 19, 2021 at 08:59:39PM +0800, Jianjun Wang wrote:
> Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
@ 2021-08-20  3:25   ` Tzung-Bi Shih
  0 siblings, 0 replies; 10+ messages in thread
From: Tzung-Bi Shih @ 2021-08-20  3:25 UTC (permalink / raw)
  To: Jianjun Wang
  Cc: Lorenzo Pieralisi, Rob Herring, Krzysztof Wilczyski,
	Bjorn Helgaas, Ryder Lee, Matthias Brugger, linux-pci,
	linux-mediatek, linux-kernel, linux-arm-kernel, qizhong.cheng,
	Ryan-JH.Yu

On Thu, Aug 19, 2021 at 08:59:39PM +0800, Jianjun Wang wrote:
> Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
  2021-08-20  3:25   ` Tzung-Bi Shih
  (?)
  (?)
@ 2021-09-02  2:29   ` Jianjun Wang (王建军)
  2021-09-22  6:02       ` Jianjun Wang
  -1 siblings, 1 reply; 10+ messages in thread
From: Jianjun Wang (王建军) @ 2021-09-02  2:29 UTC (permalink / raw)
  To: lorenzo.pieralisi, kw, bhelgaas, tzungbi, robh+dt
  Cc: linux-mediatek, linux-kernel,
	Ryan-JH Yu (余家豪),
	Qizhong Cheng (程啟忠),
	linux-arm-kernel, matthias.bgg, linux-pci,
	Ryder Lee (李庚諺)

Hi Maintainers,

Just gentle ping for this patch, if there is anything I need to modify,
please kindly let me know.

Thanks.

On Fri, 2021-08-20 at 11:25 +0800, Tzung-Bi Shih wrote:
> On Thu, Aug 19, 2021 at 08:59:39PM +0800, Jianjun Wang wrote:
> > Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
> 
> Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>

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

* Re: [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
  2021-09-02  2:29   ` Jianjun Wang (王建军)
  2021-09-22  6:02       ` Jianjun Wang
@ 2021-09-22  6:02       ` Jianjun Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Jianjun Wang @ 2021-09-22  6:02 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyski, Tzung-Bi Shih
  Cc: Ryder Lee, Matthias Brugger, linux-pci, linux-mediatek,
	linux-kernel, linux-arm-kernel, qizhong.cheng, Ryan-JH.Yu

Hi Bjorn, Lorenzo,

Just gentle ping for this patch, please kindly let me know your
comments about this patch.

Thanks.

On Thu, 2021-09-02 at 10:27 +0800, Jianjun Wang wrote:
> Hi Maintainers,
> 
> Just gentle ping for this patch, if there is anything I need to
> modify,
> please kindly let me know.
> 
> Thanks.
> 
> On Fri, 2021-08-20 at 11:25 +0800, Tzung-Bi Shih wrote:
> > On Thu, Aug 19, 2021 at 08:59:39PM +0800, Jianjun Wang wrote:
> > > Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
> > 
> > Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>

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

* Re: [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
@ 2021-09-22  6:02       ` Jianjun Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Jianjun Wang @ 2021-09-22  6:02 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyski, Tzung-Bi Shih
  Cc: Ryder Lee, Matthias Brugger, linux-pci, linux-mediatek,
	linux-kernel, linux-arm-kernel, qizhong.cheng, Ryan-JH.Yu

Hi Bjorn, Lorenzo,

Just gentle ping for this patch, please kindly let me know your
comments about this patch.

Thanks.

On Thu, 2021-09-02 at 10:27 +0800, Jianjun Wang wrote:
> Hi Maintainers,
> 
> Just gentle ping for this patch, if there is anything I need to
> modify,
> please kindly let me know.
> 
> Thanks.
> 
> On Fri, 2021-08-20 at 11:25 +0800, Tzung-Bi Shih wrote:
> > On Thu, Aug 19, 2021 at 08:59:39PM +0800, Jianjun Wang wrote:
> > > Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
> > 
> > Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request
@ 2021-09-22  6:02       ` Jianjun Wang
  0 siblings, 0 replies; 10+ messages in thread
From: Jianjun Wang @ 2021-09-22  6:02 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Rob Herring,
	Krzysztof Wilczyski, Tzung-Bi Shih
  Cc: Ryder Lee, Matthias Brugger, linux-pci, linux-mediatek,
	linux-kernel, linux-arm-kernel, qizhong.cheng, Ryan-JH.Yu

Hi Bjorn, Lorenzo,

Just gentle ping for this patch, please kindly let me know your
comments about this patch.

Thanks.

On Thu, 2021-09-02 at 10:27 +0800, Jianjun Wang wrote:
> Hi Maintainers,
> 
> Just gentle ping for this patch, if there is anything I need to
> modify,
> please kindly let me know.
> 
> Thanks.
> 
> On Fri, 2021-08-20 at 11:25 +0800, Tzung-Bi Shih wrote:
> > On Thu, Aug 19, 2021 at 08:59:39PM +0800, Jianjun Wang wrote:
> > > Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
> > 
> > Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-09-22  6:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 12:59 [PATCH] PCI: mediatek-gen3: Disable DVFSRC voltage request Jianjun Wang
2021-08-19 12:59 ` Jianjun Wang
2021-08-19 12:59 ` Jianjun Wang
2021-08-20  3:25 ` Tzung-Bi Shih
2021-08-20  3:25   ` Tzung-Bi Shih
2021-08-20  3:25   ` Tzung-Bi Shih
2021-09-02  2:29   ` Jianjun Wang (王建军)
2021-09-22  6:02     ` Jianjun Wang
2021-09-22  6:02       ` Jianjun Wang
2021-09-22  6:02       ` Jianjun Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.