devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude
@ 2020-10-01  3:19 Florian Fainelli
  2020-10-01  3:19 ` [PATCH 1/2] dt-bindings: phy: Allow defining the " Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Florian Fainelli @ 2020-10-01  3:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli,
	Kishon Vijay Abraham I, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Hi Kishon,

This patch series allows the configuration of the Broadcom SATA PHY TX
amplitude which may be required in order to meet specific tests.

Thanks!

Florian Fainelli (2):
  dt-bindings: phy: Allow defining the SATA AFE TX amplitude
  phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude

 .../devicetree/bindings/phy/brcm-sata-phy.txt |  3 ++
 drivers/phy/broadcom/phy-brcm-sata.c          | 32 +++++++++++++++++++
 2 files changed, 35 insertions(+)

-- 
2.25.1


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

* [PATCH 1/2] dt-bindings: phy: Allow defining the SATA AFE TX amplitude
  2020-10-01  3:19 [PATCH 0/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude Florian Fainelli
@ 2020-10-01  3:19 ` Florian Fainelli
  2020-10-06 20:21   ` Rob Herring
  2020-10-01  3:19 ` [PATCH 2/2] phy: phy-brcm-sata: Allow configuration " Florian Fainelli
  2020-10-05  2:56 ` [PATCH 0/2] " Florian Fainelli
  2 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2020-10-01  3:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli,
	Kishon Vijay Abraham I, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Document a new property which allows the selection of the SATA AFE TX
amplitude in milli Volts. Possible values are 400, 500, 600 and 800mV.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 Documentation/devicetree/bindings/phy/brcm-sata-phy.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt b/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt
index c03ad2198410..e5abbace93a3 100644
--- a/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt
+++ b/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt
@@ -38,6 +38,9 @@ Sub-nodes optional properties:
 - brcm,rxaeq-value: when 'rxaeq-mode' is set to "manual", provides the RX
   equalizer value that should be used. Allowed range is 0..63.
 
+- brcm,tx-amplitude-millivolt: transmit amplitude voltage in millivolt.
+  Possible values are 400, 500, 600 or 800 mV.
+
 Example
 	sata-phy@f0458100 {
 		compatible = "brcm,bcm7445-sata-phy", "brcm,phy-sata3";
-- 
2.25.1


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

* [PATCH 2/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude
  2020-10-01  3:19 [PATCH 0/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude Florian Fainelli
  2020-10-01  3:19 ` [PATCH 1/2] dt-bindings: phy: Allow defining the " Florian Fainelli
@ 2020-10-01  3:19 ` Florian Fainelli
  2020-10-05  2:56 ` [PATCH 0/2] " Florian Fainelli
  2 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2020-10-01  3:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli,
	Kishon Vijay Abraham I, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Read the 'brcm,tx-amplitude-millivolt' property from Device Tree and
propagate its value into the appropriate test transmit register to
change the TX amplitude.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/phy/broadcom/phy-brcm-sata.c | 32 ++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
index 18251f232172..7be3586b16cb 100644
--- a/drivers/phy/broadcom/phy-brcm-sata.c
+++ b/drivers/phy/broadcom/phy-brcm-sata.c
@@ -65,6 +65,7 @@ struct brcm_sata_port {
 	bool ssc_en;
 	enum brcm_sata_phy_rxaeq_mode rxaeq_mode;
 	u32 rxaeq_val;
+	u32 tx_amplitude_val;
 };
 
 struct brcm_sata_phy {
@@ -84,6 +85,10 @@ enum sata_phy_regs {
 	BLOCK0_SPARE_OOB_CLK_SEL_MASK		= 0x3,
 	BLOCK0_SPARE_OOB_CLK_SEL_REFBY2		= 0x1,
 
+	BLOCK1_REG_BANK				= 0x10,
+	BLOCK1_TEST_TX				= 0x83,
+	BLOCK1_TEST_TX_AMP_SHIFT		= 12,
+
 	PLL_REG_BANK_0				= 0x050,
 	PLL_REG_BANK_0_PLLCONTROL_0		= 0x81,
 	PLLCONTROL_0_FREQ_DET_RESTART		= BIT(13),
@@ -379,6 +384,29 @@ static int brcm_stb_sata_16nm_ssc_init(struct brcm_sata_port *port)
 	brcm_sata_phy_wr(port, RXPMD_REG_BANK, RXPMD_RX_FREQ_MON_CONTROL1,
 			 ~tmp, RXPMD_MON_CORRECT_EN | value);
 
+	tmp = GENMASK(15, 12);
+	switch (port->tx_amplitude_val) {
+	case 400:
+		value = BIT(12) | BIT(13);
+		break;
+	case 500:
+		value = BIT(13);
+		break;
+	case 600:
+		value = BIT(12);
+		break;
+	case 800:
+		value = 0;
+		break;
+	default:
+		value = tmp;
+		break;
+	}
+
+	if (value != tmp)
+		brcm_sata_phy_wr(port, BLOCK1_REG_BANK, BLOCK1_TEST_TX, ~tmp,
+				 value);
+
 	/* Turn on/off SSC */
 	brcm_sata_phy_wr(port, TX_REG_BANK, TX_ACTRL5, ~TX_ACTRL5_SSC_EN,
 			 port->ssc_en ? TX_ACTRL5_SSC_EN : 0);
@@ -791,6 +819,10 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
 		if (port->rxaeq_mode == RXAEQ_MODE_MANUAL)
 			of_property_read_u32(child, "brcm,rxaeq-value",
 					     &port->rxaeq_val);
+
+		of_property_read_u32(child, "brcm,tx-amplitude-millivolt",
+				     &port->tx_amplitude_val);
+
 		port->ssc_en = of_property_read_bool(child, "brcm,enable-ssc");
 		if (IS_ERR(port->phy)) {
 			dev_err(dev, "failed to create PHY\n");
-- 
2.25.1


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

* Re: [PATCH 0/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude
  2020-10-01  3:19 [PATCH 0/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude Florian Fainelli
  2020-10-01  3:19 ` [PATCH 1/2] dt-bindings: phy: Allow defining the " Florian Fainelli
  2020-10-01  3:19 ` [PATCH 2/2] phy: phy-brcm-sata: Allow configuration " Florian Fainelli
@ 2020-10-05  2:56 ` Florian Fainelli
  2020-10-05  5:43   ` Vinod Koul
  2 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2020-10-05  2:56 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel, Vinod Koul
  Cc: bcm-kernel-feedback-list, Kishon Vijay Abraham I, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS



On 9/30/2020 8:19 PM, Florian Fainelli wrote:
> Hi Kishon,
> 
> This patch series allows the configuration of the Broadcom SATA PHY TX
> amplitude which may be required in order to meet specific tests.

Hi Vinod,

Would you need me to resend these two patches? For some reason 
get_maintainers.pl did not pick up your email. If not, here are the two 
patches from lore:

https://lore.kernel.org/linux-devicetree/20201001031916.411999-2-f.fainelli@gmail.com/
https://lore.kernel.org/linux-devicetree/20201001031916.411999-3-f.fainelli@gmail.com/

Thanks
-- 
Florian

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

* Re: [PATCH 0/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude
  2020-10-05  2:56 ` [PATCH 0/2] " Florian Fainelli
@ 2020-10-05  5:43   ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2020-10-05  5:43 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: linux-kernel, bcm-kernel-feedback-list, Kishon Vijay Abraham I,
	Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Hi Florian,

On 04-10-20, 19:56, Florian Fainelli wrote:
> 
> 
> On 9/30/2020 8:19 PM, Florian Fainelli wrote:
> > Hi Kishon,
> > 
> > This patch series allows the configuration of the Broadcom SATA PHY TX
> > amplitude which may be required in order to meet specific tests.
> 
> Hi Vinod,
> 
> Would you need me to resend these two patches? For some reason
> get_maintainers.pl did not pick up your email. If not, here are the two
> patches from lore:

Yes I dont have these in my inbox. Unfortunately it is late in the cycle
and I have already sent PR to greg for 5.10 so I am not accepting
patches till rc1. Please rebase on rc1 and resend...

> https://lore.kernel.org/linux-devicetree/20201001031916.411999-2-f.fainelli@gmail.com/
> https://lore.kernel.org/linux-devicetree/20201001031916.411999-3-f.fainelli@gmail.com/
> 
> Thanks
> -- 
> Florian

-- 
~Vinod

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

* Re: [PATCH 1/2] dt-bindings: phy: Allow defining the SATA AFE TX amplitude
  2020-10-01  3:19 ` [PATCH 1/2] dt-bindings: phy: Allow defining the " Florian Fainelli
@ 2020-10-06 20:21   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2020-10-06 20:21 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Kishon Vijay Abraham I, bcm-kernel-feedback-list, linux-kernel,
	devicetree, Rob Herring

On Wed, 30 Sep 2020 20:19:15 -0700, Florian Fainelli wrote:
> Document a new property which allows the selection of the SATA AFE TX
> amplitude in milli Volts. Possible values are 400, 500, 600 and 800mV.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  Documentation/devicetree/bindings/phy/brcm-sata-phy.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2020-10-06 20:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-01  3:19 [PATCH 0/2] phy: phy-brcm-sata: Allow configuration SATA AFE TX amplitude Florian Fainelli
2020-10-01  3:19 ` [PATCH 1/2] dt-bindings: phy: Allow defining the " Florian Fainelli
2020-10-06 20:21   ` Rob Herring
2020-10-01  3:19 ` [PATCH 2/2] phy: phy-brcm-sata: Allow configuration " Florian Fainelli
2020-10-05  2:56 ` [PATCH 0/2] " Florian Fainelli
2020-10-05  5:43   ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).