From: Roger Quadros <rogerq@ti.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: <bcousson@baylibre.com>, <tony@atomide.com>, <balbi@ti.com>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-omap@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-usb@vger.kernel.org>, <robh+dt@kernel.org>,
<pawel.moll@arm.com>, <mark.rutland@arm.com>,
<ijc+devicetree@hellion.org.uk>, <galak@codeaurora.org>,
<linux@arm.linux.org.uk>, <gregkh@linuxfoundation.org>,
<nsekhar@ti.com>
Subject: Re: [PATCH 03/17] phy: ti-pipe3: use *syscon* framework to set PCS value of the PHY
Date: Wed, 24 Jun 2015 16:48:13 +0300 [thread overview]
Message-ID: <20150624164813.5624c9aa34df0d1cfdda5c19@ti.com> (raw)
In-Reply-To: <558AAD98.1090602@ti.com>
On Wed, 24 Jun 2015 18:46:08 +0530
Kishon Vijay Abraham I <kishon@ti.com> wrote:
> Hi,
>
> On Wednesday 24 June 2015 04:04 PM, Roger Quadros wrote:
> > On Tue, 23 Jun 2015 17:28:48 +0530
> > Kishon Vijay Abraham I <kishon@ti.com> wrote:
> >
> >> Deprecate using phy-omap-control driver to set PCS value of the PHY
> >> and start using *syscon* framework to do the same.
> >>
> >> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> >> ---
> >> Documentation/devicetree/bindings/phy/ti-phy.txt | 2 ++
> >> drivers/phy/phy-ti-pipe3.c | 32 +++++++++++++++++++++-
> >> 2 files changed, 33 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/phy/ti-phy.txt b/Documentation/devicetree/bindings/phy/ti-phy.txt
> >> index d3ad3bf..52c7a92 100644
> >> --- a/Documentation/devicetree/bindings/phy/ti-phy.txt
> >> +++ b/Documentation/devicetree/bindings/phy/ti-phy.txt
> >> @@ -83,6 +83,8 @@ Optional properties:
> >> - syscon-pllreset: Handle to system control region that contains the
> >> CTRL_CORE_SMA_SW_0 register and register offset to the CTRL_CORE_SMA_SW_0
> >> register that contains the SATA_PLL_SOFT_RESET bit. Only valid for sata_phy.
> >> + - syscon-pcs : phandle/offset pair. Phandle to the system control module and the
> >> + register offset to write the PCS delay value.
> >
> > What is PCS?
>
> IIRC physical coding subsystem.
> > Is this valid only for PCIe? If yes we could mention it here.
>
> This is introduced specifically for PCIe. But there are other PCS registers
> with a different register map altogether for USB. I'm not sure if we will ever
> have to do those settings.
OK then let's not say it is PCIe specific.
cheers,
-roger
>
> >
> >>
> >> Deprecated properties:
> >> - ctrl-module : phandle of the control module used by PHY driver to power on
> >> diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c
> >> index 78bac00..e2f9ad7 100644
> >> --- a/drivers/phy/phy-ti-pipe3.c
> >> +++ b/drivers/phy/phy-ti-pipe3.c
> >> @@ -65,6 +65,9 @@
> >> #define PIPE3_PHY_TX_RX_POWERON 0x3
> >> #define PIPE3_PHY_TX_RX_POWEROFF 0x0
> >>
> >> +#define PCIE_PCS_MASK 0xFF0000
> >> +#define PCIE_PCS_DELAY_COUNT_SHIFT 0x10
> >> +
> >> /*
> >> * This is an Empirical value that works, need to confirm the actual
> >> * value required for the PIPE3PHY_PLL_CONFIGURATION2.PLL_IDLE status
> >> @@ -96,9 +99,11 @@ struct ti_pipe3 {
> >> struct clk *div_clk;
> >> struct pipe3_dpll_map *dpll_map;
> >> struct regmap *phy_power_syscon; /* ctrl. reg. acces */
> >> + struct regmap *pcs_syscon; /* ctrl. reg. acces */
> >> struct regmap *dpll_reset_syscon; /* ctrl. reg. acces */
> >> unsigned int dpll_reset_reg; /* reg. index within syscon */
> >> unsigned int power_reg; /* power reg. index within syscon */
> >> + unsigned int pcie_pcs_reg; /* pcs reg. index in syscon */
> >> bool sata_refclk_enabled;
> >> };
> >>
> >> @@ -271,7 +276,16 @@ static int ti_pipe3_init(struct phy *x)
> >> * 18-1804.
> >> */
> >> if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) {
> >> - omap_control_pcie_pcs(phy->control_dev, 0x96);
> >> + if (phy->pcs_syscon) {
> >> + val = 0x96 << OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT;
> >> + ret = regmap_update_bits(phy->pcs_syscon,
> >> + phy->pcie_pcs_reg,
> >> + PCIE_PCS_MASK, val);
> >> + if (ret < 0)
> >> + return ret;
> >> + } else {
> >> + omap_control_pcie_pcs(phy->control_dev, 0x96);
> >> + }
> >> return 0;
> >> }
> >>
> >> @@ -455,6 +469,22 @@ static int ti_pipe3_probe(struct platform_device *pdev)
> >> dev_err(&pdev->dev, "unable to get div-clk\n");
> >> return PTR_ERR(phy->div_clk);
> >> }
> >> +
> >> + phy->pcs_syscon = syscon_regmap_lookup_by_phandle(node,
> >> + "syscon-pcs");
> >> + if (IS_ERR(phy->pcs_syscon)) {
> >> + dev_dbg(&pdev->dev,
> >> + "can't get syscon-pcs, using omap control\n");
> >> + phy->pcs_syscon = NULL;
> >> + } else {
> >> + if (of_property_read_u32_index(node,
> >> + "syscon-pcs", 1,
> >> + &phy->pcie_pcs_reg)) {
> >> + dev_err(&pdev->dev,
> >> + "couldn't get pcie pcs reg. offset\n");
> >> + return -EINVAL;
> >> + }
> >> + }
> >> } else {
> >> phy->div_clk = ERR_PTR(-ENODEV);
> >> }
> >> --
> >> 1.7.9.5
> >>
> >
> > Other than that,
> >
> > Acked-by: Roger Quadros <rogerq@ti.com>
> >
> > cheers,
> > -roger
> >
next prev parent reply other threads:[~2015-06-24 13:49 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-23 11:58 [PATCH 00/17] Deprecate phy-omap-control and use SYSCON Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 01/17] phy: ti-pipe3: use ti_pipe3_power_off to power off the PHY during probe Kishon Vijay Abraham I
2015-06-23 14:47 ` Roger Quadros
2015-06-23 11:58 ` [PATCH 02/17] phy: ti-pipe3: use *syscon* framework to power on/off the PHY Kishon Vijay Abraham I
2015-06-23 14:53 ` Roger Quadros
2015-06-24 11:26 ` Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 03/17] phy: ti-pipe3: use *syscon* framework to set PCS value of " Kishon Vijay Abraham I
2015-06-24 10:34 ` Roger Quadros
2015-06-24 13:16 ` Kishon Vijay Abraham I
2015-06-24 13:48 ` Roger Quadros [this message]
2015-06-23 11:58 ` [PATCH 04/17] phy: omap-usb2: use omap_usb_power_off to power off the PHY during probe Kishon Vijay Abraham I
2015-06-24 10:58 ` Roger Quadros
2015-06-23 11:58 ` [PATCH 05/17] phy: omap-usb2: Add a new compatible string for USB2 PHY2 Kishon Vijay Abraham I
2015-06-24 11:03 ` Roger Quadros
2015-06-24 13:21 ` Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 06/17] phy: omap-usb2: use *syscon* framework to power on/off the PHY Kishon Vijay Abraham I
2015-06-24 11:33 ` Roger Quadros
2015-06-24 12:59 ` Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 07/17] usb: musb: omap2430: use *syscon* framework to write to mailbox register Kishon Vijay Abraham I
2015-06-24 11:39 ` Roger Quadros
2015-06-24 13:21 ` Kishon Vijay Abraham I
2015-06-24 11:49 ` Tony Lindgren
2015-06-24 13:06 ` Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 08/17] ARM: dts: dra7: Add dt node for the sycon pcie Kishon Vijay Abraham I
2015-06-24 11:50 ` Roger Quadros
2015-06-24 11:56 ` Roger Quadros
2015-06-24 12:09 ` Tony Lindgren
2015-06-24 12:19 ` Roger Quadros
2015-06-24 12:49 ` Tony Lindgren
2015-06-24 13:30 ` Kishon Vijay Abraham I
2015-06-24 13:29 ` Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 09/17] ARM: dts: dra7: Use "syscon-phy-power" instead of "ctrl-module" in SATA PHY node Kishon Vijay Abraham I
2015-06-24 12:06 ` Roger Quadros
2015-06-24 12:12 ` Roger Quadros
2015-06-24 13:31 ` Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 10/17] ARM: dts: dra7: Use "syscon-phy-power" and "syscon-pcs" in PCIe " Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 11/17] ARM: dts: dra7: Use "ti,dra7x-usb2-phy2" compatible string for USB2 PHY2 Kishon Vijay Abraham I
2015-06-24 12:07 ` Roger Quadros
2015-06-24 13:10 ` Kishon Vijay Abraham I
2015-06-24 13:50 ` Roger Quadros
2015-06-23 11:58 ` [PATCH 12/17] ARM: dts: dra7: Use "syscon-phy-power" instead of "ctrl-module" in USB PHY node Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 13/17] ARM: dts: am4372: " Kishon Vijay Abraham I
2015-06-23 11:58 ` [PATCH 14/17] ARM: dts: OMAP5: " Kishon Vijay Abraham I
2015-06-23 11:59 ` [PATCH 15/17] ARM: dts: OMAP5: Use "syscon-phy-power" instead of "ctrl-module" in SATA " Kishon Vijay Abraham I
2015-06-23 11:59 ` [PATCH 16/17] ARM: dts: omap4: Use "syscon-phy-power" instead of "ctrl-module" in USB " Kishon Vijay Abraham I
2015-06-23 11:59 ` [PATCH 17/17] ARM: dts: omap4: Use "syscon-otghs" instead of "ctrl-module" in USB node Kishon Vijay Abraham I
2015-06-24 10:41 ` Tony Lindgren
2015-06-24 11:21 ` Kishon Vijay Abraham I
2015-06-24 11:46 ` Tony Lindgren
2015-06-24 12:02 ` Roger Quadros
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150624164813.5624c9aa34df0d1cfdda5c19@ti.com \
--to=rogerq@ti.com \
--cc=balbi@ti.com \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=nsekhar@ti.com \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox