Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1661071 > unrolled thread
| Started by | Srinath Mannam <srinath.mannam@broadcom.com> |
|---|---|
| First post | 2017-06-08 13:40 +0200 |
| Last post | 2017-06-16 07:50 +0200 |
| Articles | 9 — 5 participants |
Back to article view | Back to linux.kernel
[PATCH v2 0/2] Broadcom Stingray SATA PHY support Srinath Mannam <srinath.mannam@broadcom.com> - 2017-06-08 13:40 +0200
[PATCH v2 2/2] phy: Add stingray SATA phy support Srinath Mannam <srinath.mannam@broadcom.com> - 2017-06-08 13:40 +0200
Re: [PATCH v2 2/2] phy: Add stingray SATA phy support Florian Fainelli <florian.fainelli@broadcom.com> - 2017-06-08 18:40 +0200
Re: [PATCH v2 2/2] phy: Add stingray SATA phy support Srinath Mannam <srinath.mannam@broadcom.com> - 2017-06-15 10:20 +0200
[PATCH v2 1/2] dt-bindings: Update documentation for stingray SATA phy Srinath Mannam <srinath.mannam@broadcom.com> - 2017-06-08 13:40 +0200
Re: [PATCH v2 1/2] dt-bindings: Update documentation for stingray SATA phy Florian Fainelli <f.fainelli@gmail.com> - 2017-06-08 18:40 +0200
Re: [PATCH v2 1/2] dt-bindings: Update documentation for stingray SATA phy Rob Herring <robh@kernel.org> - 2017-06-12 18:40 +0200
Re: [PATCH v2 0/2] Broadcom Stingray SATA PHY support Florian Fainelli <f.fainelli@gmail.com> - 2017-06-08 18:40 +0200
Re: [PATCH v2 0/2] Broadcom Stingray SATA PHY support Kishon Vijay Abraham I <kishon@ti.com> - 2017-06-16 07:50 +0200
| From | Srinath Mannam <srinath.mannam@broadcom.com> |
|---|---|
| Date | 2017-06-08 13:40 +0200 |
| Subject | [PATCH v2 0/2] Broadcom Stingray SATA PHY support |
| Message-ID | <tQ3Xb-3Gr-3@gated-at.bofh.it> |
This patchset extends the Broadcom SATA PHY driver to add support for Stingray SATA PHY. All patches are based on linux-phy/next Changes since v1: - Rebased patchset on linux-phy/next Srinath Mannam (2): dt-bindings: Update documentation for stingray SATA phy phy: Add stingray SATA phy support .../devicetree/bindings/phy/brcm-sata-phy.txt | 7 ++- drivers/phy/broadcom/phy-brcm-sata.c | 73 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 3 deletions(-) -- 2.7.4
[toc] | [next] | [standalone]
| From | Srinath Mannam <srinath.mannam@broadcom.com> |
|---|---|
| Date | 2017-06-08 13:40 +0200 |
| Subject | [PATCH v2 2/2] phy: Add stingray SATA phy support |
| Message-ID | <tQ3Xc-3Gr-15@gated-at.bofh.it> |
| In reply to | #1661071 |
This patch adds support for stingray SATA phy in the
SATA BRCM phy driver.
Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
---
drivers/phy/broadcom/phy-brcm-sata.c | 73 ++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/drivers/phy/broadcom/phy-brcm-sata.c b/drivers/phy/broadcom/phy-brcm-sata.c
index ccbc3d9..e6544c8 100644
--- a/drivers/phy/broadcom/phy-brcm-sata.c
+++ b/drivers/phy/broadcom/phy-brcm-sata.c
@@ -46,6 +46,7 @@ enum brcm_sata_phy_version {
BRCM_SATA_PHY_STB_40NM,
BRCM_SATA_PHY_IPROC_NS2,
BRCM_SATA_PHY_IPROC_NSP,
+ BRCM_SATA_PHY_IPROC_SR,
};
struct brcm_sata_port {
@@ -81,12 +82,17 @@ enum sata_phy_regs {
PLL_ACTRL2 = 0x8b,
PLL_ACTRL2_SELDIV_MASK = 0x1f,
PLL_ACTRL2_SELDIV_SHIFT = 9,
+ PLL_ACTRL6 = 0x86,
PLL1_REG_BANK = 0x060,
PLL1_ACTRL2 = 0x82,
PLL1_ACTRL3 = 0x83,
PLL1_ACTRL4 = 0x84,
+ TX_REG_BANK = 0x070,
+ TX_ACTRL0 = 0x80,
+ TX_ACTRL0_TXPOL_FLIP = BIT(6),
+
OOB_REG_BANK = 0x150,
OOB1_REG_BANK = 0x160,
OOB_CTRL1 = 0x80,
@@ -347,6 +353,68 @@ static int brcm_nsp_sata_init(struct brcm_sata_port *port)
return 0;
}
+/* SR PHY PLL0 registers */
+#define SR_PLL0_ACTRL6_MAGIC 0xa
+
+/* SR PHY PLL1 registers */
+#define SR_PLL1_ACTRL2_MAGIC 0x32
+#define SR_PLL1_ACTRL3_MAGIC 0x2
+#define SR_PLL1_ACTRL4_MAGIC 0x3e8
+
+static int brcm_sr_sata_init(struct brcm_sata_port *port)
+{
+ struct brcm_sata_phy *priv = port->phy_priv;
+ struct device *dev = port->phy_priv->dev;
+ void __iomem *base = priv->phy_base;
+ unsigned int val, try;
+
+ /* Configure PHY PLL register bank 1 */
+ val = SR_PLL1_ACTRL2_MAGIC;
+ brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL2, 0x0, val);
+ val = SR_PLL1_ACTRL3_MAGIC;
+ brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL3, 0x0, val);
+ val = SR_PLL1_ACTRL4_MAGIC;
+ brcm_sata_phy_wr(base, PLL1_REG_BANK, PLL1_ACTRL4, 0x0, val);
+
+ /* Configure PHY PLL register bank 0 */
+ val = SR_PLL0_ACTRL6_MAGIC;
+ brcm_sata_phy_wr(base, PLL_REG_BANK_0, PLL_ACTRL6, 0x0, val);
+
+ /* Wait for PHY PLL lock by polling pll_lock bit */
+ try = 50;
+ do {
+ val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
+ BLOCK0_XGXSSTATUS);
+ if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)
+ break;
+ msleep(20);
+ try--;
+ } while (try);
+
+ if ((val & BLOCK0_XGXSSTATUS_PLL_LOCK) == 0) {
+ /* PLL did not lock; give up */
+ dev_err(dev, "port%d PLL did not lock\n", port->portnum);
+ return -ETIMEDOUT;
+ }
+
+ /* Invert Tx polarity */
+ brcm_sata_phy_wr(base, TX_REG_BANK, TX_ACTRL0,
+ ~TX_ACTRL0_TXPOL_FLIP, TX_ACTRL0_TXPOL_FLIP);
+
+ /* Configure OOB control to handle 100MHz reference clock */
+ val = ((0xc << OOB_CTRL1_BURST_MAX_SHIFT) |
+ (0x4 << OOB_CTRL1_BURST_MIN_SHIFT) |
+ (0x8 << OOB_CTRL1_WAKE_IDLE_MAX_SHIFT) |
+ (0x3 << OOB_CTRL1_WAKE_IDLE_MIN_SHIFT));
+ brcm_sata_phy_wr(base, OOB_REG_BANK, OOB_CTRL1, 0x0, val);
+ val = ((0x1b << OOB_CTRL2_RESET_IDLE_MAX_SHIFT) |
+ (0x2 << OOB_CTRL2_BURST_CNT_SHIFT) |
+ (0x9 << OOB_CTRL2_RESET_IDLE_MIN_SHIFT));
+ brcm_sata_phy_wr(base, OOB_REG_BANK, OOB_CTRL2, 0x0, val);
+
+ return 0;
+}
+
static int brcm_sata_phy_init(struct phy *phy)
{
int rc;
@@ -363,6 +431,9 @@ static int brcm_sata_phy_init(struct phy *phy)
case BRCM_SATA_PHY_IPROC_NSP:
rc = brcm_nsp_sata_init(port);
break;
+ case BRCM_SATA_PHY_IPROC_SR:
+ rc = brcm_sr_sata_init(port);
+ break;
default:
rc = -ENODEV;
}
@@ -384,6 +455,8 @@ static const struct of_device_id brcm_sata_phy_of_match[] = {
.data = (void *)BRCM_SATA_PHY_IPROC_NS2 },
{ .compatible = "brcm,iproc-nsp-sata-phy",
.data = (void *)BRCM_SATA_PHY_IPROC_NSP },
+ { .compatible = "brcm,iproc-sr-sata-phy",
+ .data = (void *)BRCM_SATA_PHY_IPROC_SR },
{},
};
MODULE_DEVICE_TABLE(of, brcm_sata_phy_of_match);
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <florian.fainelli@broadcom.com> |
|---|---|
| Date | 2017-06-08 18:40 +0200 |
| Subject | Re: [PATCH v2 2/2] phy: Add stingray SATA phy support |
| Message-ID | <tQ8Dw-6E7-21@gated-at.bofh.it> |
| In reply to | #1661074 |
On 06/08/2017 04:31 AM, Srinath Mannam wrote: > This patch adds support for stingray SATA phy in the > SATA BRCM phy driver. > > Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Srinath Mannam <srinath.mannam@broadcom.com> |
|---|---|
| Date | 2017-06-15 10:20 +0200 |
| Subject | Re: [PATCH v2 2/2] phy: Add stingray SATA phy support |
| Message-ID | <tSyat-8uk-7@gated-at.bofh.it> |
| In reply to | #1661074 |
Hi Kishon, I have re-based this patch to "linux-phy -next". Please review this. Thank you. Regards, Srinath.
[toc] | [prev] | [next] | [standalone]
| From | Srinath Mannam <srinath.mannam@broadcom.com> |
|---|---|
| Date | 2017-06-08 13:40 +0200 |
| Subject | [PATCH v2 1/2] dt-bindings: Update documentation for stingray SATA phy |
| Message-ID | <tQ3Xc-3Gr-17@gated-at.bofh.it> |
| In reply to | #1661071 |
Update BRCM SATA phy dt-binding documentation for stingray.
Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
---
Documentation/devicetree/bindings/phy/brcm-sata-phy.txt | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt b/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt
index 6ccce09..97977cd 100644
--- a/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt
+++ b/Documentation/devicetree/bindings/phy/brcm-sata-phy.txt
@@ -7,12 +7,13 @@ Required properties:
"brcm,iproc-ns2-sata-phy"
"brcm,iproc-nsp-sata-phy"
"brcm,phy-sata3"
+ "brcm,iproc-sr-sata-phy"
- address-cells: should be 1
- size-cells: should be 0
- reg: register ranges for the PHY PCB interface
- reg-names: should be "phy" and "phy-ctrl"
The "phy-ctrl" registers are only required for
- "brcm,iproc-ns2-sata-phy".
+ "brcm,iproc-ns2-sata-phy" and "brcm,iproc-sr-sata-phy".
Sub-nodes:
Each port's PHY should be represented as a sub-node.
@@ -23,8 +24,8 @@ Sub-nodes required properties:
Sub-nodes optional properties:
- brcm,enable-ssc: use spread spectrum clocking (SSC) on this port
- This property is not applicable for "brcm,iproc-ns2-sata-phy" and
- "brcm,iproc-nsp-sata-phy".
+ This property is not applicable for "brcm,iproc-ns2-sata-phy",
+ "brcm,iproc-nsp-sata-phy" and "brcm,iproc-sr-sata-phy".
Example:
sata-phy@f0458100 {
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-06-08 18:40 +0200 |
| Subject | Re: [PATCH v2 1/2] dt-bindings: Update documentation for stingray SATA phy |
| Message-ID | <tQ8Dx-6E7-35@gated-at.bofh.it> |
| In reply to | #1661076 |
On 06/08/2017 04:31 AM, Srinath Mannam wrote: > Update BRCM SATA phy dt-binding documentation for stingray. > > Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com> > Reviewed-by: Ray Jui <ray.jui@broadcom.com> > Reviewed-by: Scott Branden <scott.branden@broadcom.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Date | 2017-06-12 18:40 +0200 |
| Subject | Re: [PATCH v2 1/2] dt-bindings: Update documentation for stingray SATA phy |
| Message-ID | <tRAxI-4uO-3@gated-at.bofh.it> |
| In reply to | #1661076 |
On Thu, Jun 08, 2017 at 05:01:38PM +0530, Srinath Mannam wrote: > Update BRCM SATA phy dt-binding documentation for stingray. > > Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com> > Reviewed-by: Ray Jui <ray.jui@broadcom.com> > Reviewed-by: Scott Branden <scott.branden@broadcom.com> > --- > Documentation/devicetree/bindings/phy/brcm-sata-phy.txt | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) Acked-by: Rob Herring <rob@kernel.org>
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-06-08 18:40 +0200 |
| Message-ID | <tQ8Dw-6E7-17@gated-at.bofh.it> |
| In reply to | #1661071 |
On 06/08/2017 04:31 AM, Srinath Mannam wrote: > This patchset extends the Broadcom SATA PHY driver to add > support for Stingray SATA PHY. > > All patches are based on linux-phy/next When you rebase and you don't make major changes to the patch, please carry the Reviewed, Acked, etc. tags that you got from the previous submission. Thank you > > Changes since v1: > - Rebased patchset on linux-phy/next > > Srinath Mannam (2): > dt-bindings: Update documentation for stingray SATA phy > phy: Add stingray SATA phy support > > .../devicetree/bindings/phy/brcm-sata-phy.txt | 7 ++- > drivers/phy/broadcom/phy-brcm-sata.c | 73 ++++++++++++++++++++++ > 2 files changed, 77 insertions(+), 3 deletions(-) > -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Kishon Vijay Abraham I <kishon@ti.com> |
|---|---|
| Date | 2017-06-16 07:50 +0200 |
| Message-ID | <tSSiR-4jS-3@gated-at.bofh.it> |
| In reply to | #1661071 |
On Thursday 08 June 2017 05:01 PM, Srinath Mannam wrote: > This patchset extends the Broadcom SATA PHY driver to add > support for Stingray SATA PHY. > > All patches are based on linux-phy/next > > Changes since v1: > - Rebased patchset on linux-phy/next > merged, thanks! -Kishon > Srinath Mannam (2): > dt-bindings: Update documentation for stingray SATA phy > phy: Add stingray SATA phy support > > .../devicetree/bindings/phy/brcm-sata-phy.txt | 7 ++- > drivers/phy/broadcom/phy-brcm-sata.c | 73 ++++++++++++++++++++++ > 2 files changed, 77 insertions(+), 3 deletions(-) >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web