phy: ti-pipe3: dra7: sata: allow suspend to RAM (core-retention)
Subsystems (2)
v3 cover phy: ti-pipe3: dra7: sata: allow suspend to RAM (core-retention)
Hi,
Implement workaround for SATA errata i783 (SATA Lockup After SATA DPLL Unlock/Relock) so that we can now turn off sata_refclk to support suspend-to-ram without preventing core-retention.
Depends on http://article.gmane.org/gmane.linux.ports.arm.omap/126670.
Changelog:
v3:
- used scm_conf node in dra7.dtsi for control register access.
v2:
- Fixed pcie disable_clocks. Addressed review comments.
cheers,
-roger
Roger Quadros (3):
phy: ti-pipe3: i783 workaround for SATA lockup after dpll
unlock/relock
ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes
Documentation/devicetree/bindings/phy/ti-phy.txt | 16 +++++++ arch/arm/boot/dts/dra7.dtsi | 20 ++++---- drivers/phy/phy-ti-pipe3.c | 61 +++++++++++++++++++++--- 3 files changed, 80 insertions(+), 17 deletions(-)
Signature · 1 line
2.1.4
PATCH v3 1/3 phy: ti-pipe3: i783 workaround for SATA lockup after dpll unlock/relock
SATA_PLL_SOFT_RESET bit of CTRL_CORE_SMA_SW_0 must be toggled between a SATA DPLL unlock and re-lock to prevent SATA lockup.
Introduce a new DT parameter 'syscon-pllreset' to provide the syscon regmap access to this register which sits in the control module.
If the register is not provided we fallback to the old behaviour i.e. SATA DPLL refclk will not be disabled and we prevent SoC low power states.
--- Documentation/devicetree/bindings/phy/ti-phy.txt | 16 +++++++ drivers/phy/phy-ti-pipe3.c | 61 +++++++++++++++++++++--- 2 files changed, 71 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/phy/ti-phy.txt +16 -0
@@ -82,6 +82,9 @@ Optional properties: - id: If there are multiple instance of the same type, in order to differentiate between each instance "id" can be used (e.g., multi-lane PCIe PHY). If "id" is not provided, it is set to default value of '1'. + - 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. This is usually a subnode of ocp2scp to which it is connected.
@@ -100,3 +103,16 @@ usb3phy@4a084400 { "sysclk", "refclk"; }; + +sata_phy: phy@4A096000 { + compatible = "ti,phy-pipe3-sata"; + reg = <0x4A096000 0x80>, /* phy_rx */ + <0x4A096400 0x64>, /* phy_tx */ + <0x4A096800 0x40>; /* pll_ctrl */ + reg-names = "phy_rx", "phy_tx", "pll_ctrl"; + ctrl-module = <&omap_control_sata>; + clocks = <&sys_clkin1>, <&sata_ref_clk>; + clock-names = "sysclk", "refclk"; + syscon-pllreset = <&scm_conf 0x3fc>; + #phy-cells = <0>; +};
drivers/phy/phy-ti-pipe3.c +55 -6
111 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v3 2/3 ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
In reply to Roger QuadrosThis register is required to be passed to the SATA PHY driver to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).
--- arch/arm/boot/dts/dra7.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/dra7.dtsi +1 -0
@@ -1140,6 +1140,7 @@ ctrl-module = <&omap_control_sata>; clocks = <&sys_clkin1>, <&sata_ref_clk>; clock-names = "sysclk", "refclk"; + syscon-pllreset = <&scm_conf 0x3fc>; #phy-cells = <0>; };
Signature · 1 line
2.1.4
Re: [PATCH v3 2/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
Quoted 14 lines · Roger Quadros
This register is required to be passed to the SATA PHY driver to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).
Signed-off-by Roger Quadros <[email protected]>--- arch/arm/boot/dts/dra7.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/dra7.dtsi +0
-0
arch/arm/boot/dts/dra7.dtsi line 1146
Quoted 7 lines
arch/arm/boot/dts/dra7.dtsi +1
-0@@ -1140,6 +1140,7 @@ ctrl-module = <&omap_control_sata>; clocks = <&sys_clkin1>, <&sata_ref_clk>; clock-names = "sysclk", "refclk"; + syscon-pllreset = <&scm_conf 0x3fc>; #phy-cells = <0>; };
Looks fine to me.
Make sure you use this register via regmap_update_bits only, seeing there is another potential user for the same register.
-Tero
Re: [PATCH v3 2/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
Quoted 25 lines · Tero Kristo
Quoted 14 lines · Roger Quadros
This register is required to be passed to the SATA PHY driver to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).
Signed-off-by Roger Quadros <[email protected]>--- arch/arm/boot/dts/dra7.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/dra7.dtsi +0
-0arch/arm/boot/dts/dra7.dtsi line 1146
Quoted 7 lines
arch/arm/boot/dts/dra7.dtsi +1
-0@@ -1140,6 +1140,7 @@ ctrl-module = <&omap_control_sata>; clocks = <&sys_clkin1>, <&sata_ref_clk>; clock-names = "sysclk", "refclk"; + syscon-pllreset = <&scm_conf 0x3fc>; #phy-cells = <0>; };Looks fine to me.
Quoted 1 line
Make sure you use this register via
regmap_update_bitsonly, seeing there is another potential user for the same register.
Yes. Patch 1 is the user using regmap_update_bits.
cheers,
-roger
Re: [PATCH v3 2/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
In reply to Roger QuadrosTony,
Quoted 4 lines · Roger Quadros
This register is required to be passed to the SATA PHY driver to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).
Signed-off-by Roger Quadros <[email protected]>
Can you please Ack or pick this for -fixes. Kishon has already picked patch 1 in this series. Thanks.
cheers,
-roger
Quoted 17 lines
--- arch/arm/boot/dts/dra7.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/dra7.dtsi +1
-0@@ -1140,6 +1140,7 @@ ctrl-module = <&omap_control_sata>; clocks = <&sys_clkin1>, <&sata_ref_clk>; clock-names = "sysclk", "refclk"; + syscon-pllreset = <&scm_conf 0x3fc>; #phy-cells = <0>; };
Tony Lindgren
Acked-byRe: [PATCH v3 2/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
Quoted 10 lines · Roger Quadros
Tony,
Quoted 4 lines · Roger Quadros
This register is required to be passed to the SATA PHY driver to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).
Signed-off-by Roger Quadros <[email protected]>Can you please Ack or pick this for -fixes. Kishon has already picked patch 1 in this series. Thanks.
Best that Kishon takes both then:
Quoted 17 lines
Quoted 17 lines
--- arch/arm/boot/dts/dra7.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/dra7.dtsi +1
-0@@ -1140,6 +1140,7 @@ ctrl-module = <&omap_control_sata>; clocks = <&sys_clkin1>, <&sata_ref_clk>; clock-names = "sysclk", "refclk"; + syscon-pllreset = <&scm_conf 0x3fc>; #phy-cells = <0>; };
Kishon Vijay Abraham I
AppliedRe: [PATCH v3 2/3] ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
Quoted 7 lines · Tony Lindgren
Quoted 6 lines · Roger Quadros
Tony,
Quoted 3 lines · Roger Quadros
This register is required to be passed to the SATA PHY driver to workaround errata i783 (SATA Lockup After SATA DPLL Unlock/Relock).
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Roger Quadros <[email protected]>Can you please Ack or pick this for -fixes. Kishon has already picked patch 1 in this series. Thanks.
Best that Kishon takes both then:
Acked-by Tony Lindgren <[email protected]>
merged, thanks.
-Kishon
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
--- arch/arm/boot/dts/dra7.dtsi | 1 + 1 file changed, 1 insertion(+)arch/arm/boot/dts/dra7.dtsi +1
-0@@ -1140,6 +1140,7 @@ ctrl-module = <&omap_control_sata>; clocks = <&sys_clkin1>, <&sata_ref_clk>; clock-names = "sysclk", "refclk"; + syscon-pllreset = <&scm_conf 0x3fc>; #phy-cells = <0>; };
PATCH v3 3/3 ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes
In reply to Roger Quadrosscm_conf1 maps the control register address space after the padconf till the end.
Fix the scm_conf and pmx_core resource lengths. We need to add 4 bytes to include the last 32-bit register space.
Remove the redundant dra7_ctrl_core and dra7_ctrl_general nodes. They are not used by anyone and no longer needed as they are covered by scm_conf and scm_conf1.
--- arch/arm/boot/dts/dra7.dtsi | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
arch/arm/boot/dts/dra7.dtsi +8 -11
@@ -141,7 +141,7 @@ dra7_pmx_core: pinmux@1400 { compatible = "ti,dra7-padconf", "pinctrl-single"; - reg = <0x1400 0x0464>; + reg = <0x1400 0x0468>; #address-cells = <1>; #size-cells = <0>; #interrupt-cells = <1>;
@@ -149,6 +149,13 @@ pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x3fffffff>; }; + + scm_conf1: scm_conf@1 { + compatible = "syscon"; + reg = <0x1868 0x03e0>; + #address-cells = <1>; + #size-cells = <1>; + }; }; cm_core_aon: cm_core_aon@5000 {
@@ -286,16 +293,6 @@ #thermal-sensor-cells = <1>; }; - dra7_ctrl_core: ctrl_core@4a002000 { - compatible = "syscon"; - reg = <0x4a002000 0x6d0>; - }; - - dra7_ctrl_general: tisyscon@4a002e00 { - compatible = "syscon"; - reg = <0x4a002e00 0x7c>; - }; - sdma: dma-controller@4a056000 { compatible = "ti,omap4430-sdma"; reg = <0x4a056000 0x1000>;
Signature · 1 line
2.1.4
Re: [PATCH v3 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes
Quoted 9 lines · Roger Quadros
scm_conf1maps the control register address space after the padconf till the end.Fix the
scm_confandpmx_coreresource lengths. We need to add 4 bytes to include the last 32-bit register space.Remove the redundant
dra7_ctrl_coreanddra7_ctrl_generalnodes. They are not used by anyone and no longer needed as they are covered byscm_confandscm_conf1.
Looks like you are doing three things in this patch, maybe split it up as such?
Quoted 20 lines
Signed-off-by Roger Quadros <[email protected]>--- arch/arm/boot/dts/dra7.dtsi | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)arch/arm/boot/dts/dra7.dtsi +1
-1@@ -141,7 +141,7 @@ dra7_pmx_core: pinmux@1400 { compatible = "ti,dra7-padconf", "pinctrl-single"; - reg = <0x1400 0x0464>; + reg = <0x1400 0x0468>; #address-cells = <1>; #size-cells = <0>; #interrupt-cells = <1>;
arch/arm/boot/dts/dra7.dtsi line 153
Quoted 5 lines
arch/arm/boot/dts/dra7.dtsi +2
-0@@ -149,6 +149,13 @@ pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x3fffffff>; }; + + scm_conf1: scm_conf@1 {
Should be ... scm_conf@1868?
Are there any users for this area anyway? I don't think we should map this area just for fun of it. Mostly it looks like this contains efuse values for OPPs, which should be mapped from the OPP layer, not as a generic syscon.
Quoted 11 lines
arch/arm/boot/dts/dra7.dtsi +5
-0+ compatible = "syscon"; + reg = <0x1868 0x03e0>; + #address-cells = <1>; + #size-cells = <1>; + }; }; cm_core_aon: cm_core_aon@5000 {@@ -286,16 +293,6 @@ #thermal-sensor-cells = <1>; };
arch/arm/boot/dts/dra7.dtsi line 297
Quoted 10 lines
arch/arm/boot/dts/dra7.dtsi +0
-9- dra7_ctrl_core: ctrl_core@4a002000 { - compatible = "syscon"; - reg = <0x4a002000 0x6d0>; - }; - - dra7_ctrl_general: tisyscon@4a002e00 { - compatible = "syscon"; - reg = <0x4a002e00 0x7c>; - };
I thought I had removed these already and yes... this was done in commit d919501feffa8715147582c3ffce96fad0c7016f already, but seems they were added back in a resolution for a merge conflict later.
-Tero
Quoted 5 lines
arch/arm/boot/dts/dra7.dtsi +0
-1- sdma: dma-controller@4a056000 { compatible = "ti,omap4430-sdma"; reg = <0x4a056000 0x1000>;
Re: [PATCH v3 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes
Hi,
Quoted 42 lines · Tero Kristo
Quoted 9 lines · Roger Quadros
scm_conf1maps the control register address space after the padconf till the end.Fix the
scm_confandpmx_coreresource lengths. We need to add 4 bytes to include the last 32-bit register space.Remove the redundant
dra7_ctrl_coreanddra7_ctrl_generalnodes. They are not used by anyone and no longer needed as they are covered byscm_confandscm_conf1.Looks like you are doing three things in this patch, maybe split it up as such?
Quoted 20 lines
Signed-off-by Roger Quadros <[email protected]>--- arch/arm/boot/dts/dra7.dtsi | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)arch/arm/boot/dts/dra7.dtsi +1
-1@@ -141,7 +141,7 @@ dra7_pmx_core: pinmux@1400 { compatible = "ti,dra7-padconf", "pinctrl-single"; - reg = <0x1400 0x0464>; + reg = <0x1400 0x0468>; #address-cells = <1>; #size-cells = <0>; #interrupt-cells = <1>;arch/arm/boot/dts/dra7.dtsi line 153
Quoted 5 lines
arch/arm/boot/dts/dra7.dtsi +2
-0@@ -149,6 +149,13 @@ pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x3fffffff>; }; + + scm_conf1: scm_conf@1 {Should be ... scm_conf@1868?
Quoted 4 lines
Are there any users for this area anyway? I don't think we should map this area just for fun of it. Mostly it looks like this contains efuse values for OPPs, which should be mapped from the OPP layer, not as a generic syscon.
The last few registers are used for PCIe PHY and I'll be needing it for the next version of my patch series.
Thanks
Kishon
Re: [PATCH v3 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes
Quoted 45 lines · Kishon Vijay Abraham I
Hi,
Quoted 42 lines · Tero Kristo
Quoted 9 lines · Roger Quadros
scm_conf1maps the control register address space after the padconf till the end.Fix the
scm_confandpmx_coreresource lengths. We need to add 4 bytes to include the last 32-bit register space.Remove the redundant
dra7_ctrl_coreanddra7_ctrl_generalnodes. They are not used by anyone and no longer needed as they are covered byscm_confandscm_conf1.Looks like you are doing three things in this patch, maybe split it up as such?
Quoted 20 lines
Signed-off-by Roger Quadros <[email protected]>--- arch/arm/boot/dts/dra7.dtsi | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)arch/arm/boot/dts/dra7.dtsi +1
-1@@ -141,7 +141,7 @@ dra7_pmx_core: pinmux@1400 { compatible = "ti,dra7-padconf", "pinctrl-single"; - reg = <0x1400 0x0464>; + reg = <0x1400 0x0468>; #address-cells = <1>; #size-cells = <0>; #interrupt-cells = <1>;arch/arm/boot/dts/dra7.dtsi line 153
Quoted 5 lines
arch/arm/boot/dts/dra7.dtsi +2
-0@@ -149,6 +149,13 @@ pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x3fffffff>; }; + + scm_conf1: scm_conf@1 {Should be ... scm_conf@1868?
Quoted 7 lines
Quoted 4 lines
Are there any users for this area anyway? I don't think we should map this area just for fun of it. Mostly it looks like this contains efuse values for OPPs, which should be mapped from the OPP layer, not as a generic syscon.
The last few registers are used for PCIe PHY and I'll be needing it for the next version of my patch series.
OK noted. Will exclude the PCIe registers from this region.
cheers,
-roger
Re: [PATCH v3 3/3] ARM: dts: dra7: Add scm_conf1 node and remove redundant nodes
In reply to Tero KristoQuoted 4 lines · Tero Kristo
Quoted 3 lines · Roger Quadros
scm_conf1maps the control register address space after the padconf till the end.
Quoted 8 lines
Quoted 6 lines
Fix the
scm_confandpmx_coreresource lengths. We need to add 4 bytes to include the last 32-bit register space.Remove the redundant
dra7_ctrl_coreanddra7_ctrl_generalnodes. They are not used by anyone and no longer needed as they are covered byscm_confandscm_conf1.Looks like you are doing three things in this patch, maybe split it up as such?
OK.
Quoted 20 lines
Quoted 20 lines
Signed-off-by Roger Quadros <[email protected]>--- arch/arm/boot/dts/dra7.dtsi | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)arch/arm/boot/dts/dra7.dtsi +1
-1@@ -141,7 +141,7 @@ dra7_pmx_core: pinmux@1400 { compatible = "ti,dra7-padconf", "pinctrl-single"; - reg = <0x1400 0x0464>; + reg = <0x1400 0x0468>; #address-cells = <1>; #size-cells = <0>; #interrupt-cells = <1>;
Quoted 8 lines
arch/arm/boot/dts/dra7.dtsi line 153
Quoted 6 lines
arch/arm/boot/dts/dra7.dtsi +2
-0@@ -149,6 +149,13 @@ pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x3fffffff>; }; + + scm_conf1: scm_conf@1 {Should be ... scm_conf@1868?
OK.
Quoted 2 lines
Are there any users for this area anyway? I don't think we should map this area just for fun of it. Mostly it looks like this contains efuse values for OPPs, which should be mapped from the OPP layer, not as a generic syscon.
OK then, I'll only include the CTRL_CORE_SMA_SW_2..9 registers in this region.
cheers,
-roger
Quoted 33 lines
Quoted 12 lines
arch/arm/boot/dts/dra7.dtsi +5
-0+ compatible = "syscon"; + reg = <0x1868 0x03e0>; + #address-cells = <1>; + #size-cells = <1>; + }; }; cm_core_aon: cm_core_aon@5000 {@@ -286,16 +293,6 @@ #thermal-sensor-cells = <1>; };arch/arm/boot/dts/dra7.dtsi line 297
Quoted 10 lines
arch/arm/boot/dts/dra7.dtsi +0
-9- dra7_ctrl_core: ctrl_core@4a002000 { - compatible = "syscon"; - reg = <0x4a002000 0x6d0>; - }; - - dra7_ctrl_general: tisyscon@4a002e00 { - compatible = "syscon"; - reg = <0x4a002e00 0x7c>; - };I thought I had removed these already and yes... this was done in commit
d919501feffa8715147582c3ffce96fad0c7016falready, but seems they were added back in a resolution for a merge conflict later.-Tero
Quoted 5 lines
arch/arm/boot/dts/dra7.dtsi +0
-1- sdma: dma-controller@4a056000 { compatible = "ti,omap4430-sdma"; reg = <0x4a056000 0x1000>;
Kishon & Tony,
You can please pick the first 2 patches for -next.
The 3rd patch is not required for SATA and I will send it as a separate series.
cheers,
-roger
Quoted 29 lines · Roger Quadros
Hi,
Implement workaround for SATA errata i783 (SATA Lockup After SATA DPLL Unlock/Relock) so that we can now turn off
sata_refclkto support suspend-to-ram without preventing core-retention.Depends on http://article.gmane.org/gmane.linux.ports.arm.omap/126670.
Changelog:
v3:
- usedscm_confnode indra7.dtsifor control register access.v2:
- Fixed pciedisable_clocks. Addressed review comments.cheers,
-rogerRoger Quadros (3):
phy: ti-pipe3: i783 workaround for SATA lockup after dpll
unlock/relock
ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
ARM: dts: dra7: Addscm_conf1node and remove redundant nodesDocumentation/devicetree/bindings/phy/ti-phy.txt | 16 +++++++ arch/arm/boot/dts/dra7.dtsi | 20 ++++---- drivers/phy/phy-ti-pipe3.c | 61 +++++++++++++++++++++--- 3 files changed, 80 insertions(+), 17 deletions(-)
Quoted 3 lines · Roger Quadros
Kishon & Tony,
You can please pick the first 2 patches for -next.
Sorry, I meant for -rc.
Quoted 3 lines
The 3rd patch is not required for SATA and I will send it as a separate series.
This can go in -next.
cheers,
-roger
Quoted 34 lines
cheers,
-rogerQuoted 29 lines · Roger Quadros
Hi,
Implement workaround for SATA errata i783 (SATA Lockup After SATA DPLL Unlock/Relock) so that we can now turn off
sata_refclkto support suspend-to-ram without preventing core-retention.Depends on http://article.gmane.org/gmane.linux.ports.arm.omap/126670.
Changelog:
v3:
- usedscm_confnode indra7.dtsifor control register access.v2:
- Fixed pciedisable_clocks. Addressed review comments.cheers,
-rogerRoger Quadros (3):
phy: ti-pipe3: i783 workaround for SATA lockup after dpll
unlock/relock
ARM: dts: dra7: Add syscon-pllreset syscon to SATA PHY
ARM: dts: dra7: Addscm_conf1node and remove redundant nodesDocumentation/devicetree/bindings/phy/ti-phy.txt | 16 +++++++ arch/arm/boot/dts/dra7.dtsi | 20 ++++---- drivers/phy/phy-ti-pipe3.c | 61 +++++++++++++++++++++--- 3 files changed, 80 insertions(+), 17 deletions(-)