2016-03-18 01:15:33

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH v3 0/3] ARM: am335x/am437x: Correct PWM bindings

Unlike the majority of other SOCs the PWM node uses ehrpwm instead of
the generic pwm node name. This patch series switches to the pwm node
name and while at it fix some other minor binding documentation issues.

This patch series also includes a patch to insure ABI compatibility.

This series was tested on AM335x and AM437x GP evm. I also validated that
ABI compatibility was maintained.

V3 changes:
Update am335x-shc.dts

V2 changes:
Dropped patches related to the ranges property.

Franklin S Cooper Jr (3):
clk: ti: am335x/am4372: Add tbclk to pwm node
ARM: DTS: da850/am4372/am33xx: Use generic node name for ehrpwm
pwm: pwm-tiehrpwm: Update dt binding document to use generic node name

Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt | 4 ++--
arch/arm/boot/dts/am335x-shc.dts | 2 +-
arch/arm/boot/dts/am33xx.dtsi | 6 +++---
arch/arm/boot/dts/am4372.dtsi | 12 ++++++------
arch/arm/boot/dts/da850.dtsi | 4 ++--
drivers/clk/ti/clk-33xx.c | 3 +++
drivers/clk/ti/clk-43xx.c | 6 ++++++
7 files changed, 23 insertions(+), 14 deletions(-)

--
2.7.0


2016-03-18 01:15:45

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH v3 2/3] ARM: DTS: da850/am4372/am33xx: Use generic node name for ehrpwm

When possible generic node names should be used. So change the node name
from ehrpwm to pwm.

Signed-off-by: Franklin S Cooper Jr <[email protected]>
---
Version 3 changes:
Also update am335x-shc.dts

arch/arm/boot/dts/am335x-shc.dts | 2 +-
arch/arm/boot/dts/am33xx.dtsi | 6 +++---
arch/arm/boot/dts/am4372.dtsi | 12 ++++++------
arch/arm/boot/dts/da850.dtsi | 4 ++--
4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-shc.dts b/arch/arm/boot/dts/am335x-shc.dts
index 1b5b044..a10f8be 100644
--- a/arch/arm/boot/dts/am335x-shc.dts
+++ b/arch/arm/boot/dts/am335x-shc.dts
@@ -138,7 +138,7 @@
&epwmss1 {
status = "okay";

- ehrpwm1: ehrpwm@48302200 {
+ ehrpwm1: pwm@48302200 {
pinctrl-names = "default";
pinctrl-0 = <&ehrpwm1_pins>;
status = "okay";
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 1fafaad..4016254 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -688,7 +688,7 @@
status = "disabled";
};

- ehrpwm0: ehrpwm@48300200 {
+ ehrpwm0: pwm@48300200 {
compatible = "ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48300200 0x80>;
@@ -718,7 +718,7 @@
status = "disabled";
};

- ehrpwm1: ehrpwm@48302200 {
+ ehrpwm1: pwm@48302200 {
compatible = "ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48302200 0x80>;
@@ -748,7 +748,7 @@
status = "disabled";
};

- ehrpwm2: ehrpwm@48304200 {
+ ehrpwm2: pwm@48304200 {
compatible = "ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48304200 0x80>;
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 92068fb..33f417c 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -679,7 +679,7 @@
status = "disabled";
};

- ehrpwm0: ehrpwm@48300200 {
+ ehrpwm0: pwm@48300200 {
compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48300200 0x80>;
@@ -705,7 +705,7 @@
status = "disabled";
};

- ehrpwm1: ehrpwm@48302200 {
+ ehrpwm1: pwm@48302200 {
compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48302200 0x80>;
@@ -731,7 +731,7 @@
status = "disabled";
};

- ehrpwm2: ehrpwm@48304200 {
+ ehrpwm2: pwm@48304200 {
compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48304200 0x80>;
@@ -749,7 +749,7 @@
ti,hwmods = "epwmss3";
status = "disabled";

- ehrpwm3: ehrpwm@48306200 {
+ ehrpwm3: pwm@48306200 {
compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48306200 0x80>;
@@ -767,7 +767,7 @@
ti,hwmods = "epwmss4";
status = "disabled";

- ehrpwm4: ehrpwm@48308200 {
+ ehrpwm4: pwm@48308200 {
compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48308200 0x80>;
@@ -785,7 +785,7 @@
ti,hwmods = "epwmss5";
status = "disabled";

- ehrpwm5: ehrpwm@4830a200 {
+ ehrpwm5: pwm@4830a200 {
compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x4830a200 0x80>;
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 226cda7..c3910e2 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -247,13 +247,13 @@
dma-names = "rx", "tx";
status = "disabled";
};
- ehrpwm0: ehrpwm@01f00000 {
+ ehrpwm0: pwm@01f00000 {
compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x300000 0x2000>;
status = "disabled";
};
- ehrpwm1: ehrpwm@01f02000 {
+ ehrpwm1: pwm@01f02000 {
compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x302000 0x2000>;
--
2.7.0

2016-03-18 01:16:00

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH v3 3/3] pwm: pwm-tiehrpwm: Update dt binding document to use generic node name

Now that the node name has been changed from ehrpwm to pwm the document
should show this proper usage. Also change the unit address in the example
from 0 to the proper physical address value that should be used.

Signed-off-by: Franklin S Cooper Jr <[email protected]>
---
Version 3 changes:
N/A

Version 2 changes:
Changed the unit address for da850 to match the value in the reg property.

Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
index 9c100b2..0f9ba50 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt
@@ -15,14 +15,14 @@ Optional properties:

Example:

-ehrpwm0: ehrpwm@0 { /* EHRPWM on am33xx */
+ehrpwm0: pwm@48300200 { /* EHRPWM on am33xx */
compatible = "ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x48300200 0x100>;
ti,hwmods = "ehrpwm0";
};

-ehrpwm0: ehrpwm@0 { /* EHRPWM on da850 */
+ehrpwm0: pwm@300000 { /* EHRPWM on da850 */
compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
#pwm-cells = <3>;
reg = <0x300000 0x2000>;
--
2.7.0

2016-03-18 01:16:16

by Franklin S Cooper Jr

[permalink] [raw]
Subject: [PATCH v3 1/3] clk: ti: am335x/am4372: Add tbclk to pwm node

Add tblck to the pwm nodes. This insures that the ehrpwm driver has access
to the time-based clk.

Do not remove similar entries for ehrpwm node. Later patches will switch
from using ehrpwm node name to pwm. But to maintain ABI compatibility we
shouldn't remove the old entries.

Signed-off-by: Franklin S Cooper Jr <[email protected]>
---
drivers/clk/ti/clk-33xx.c | 3 +++
drivers/clk/ti/clk-43xx.c | 6 ++++++
2 files changed, 9 insertions(+)

diff --git a/drivers/clk/ti/clk-33xx.c b/drivers/clk/ti/clk-33xx.c
index ef2ec64..0e47d95 100644
--- a/drivers/clk/ti/clk-33xx.c
+++ b/drivers/clk/ti/clk-33xx.c
@@ -108,6 +108,9 @@ static struct ti_dt_clk am33xx_clks[] = {
DT_CLK("48300200.ehrpwm", "tbclk", "ehrpwm0_tbclk"),
DT_CLK("48302200.ehrpwm", "tbclk", "ehrpwm1_tbclk"),
DT_CLK("48304200.ehrpwm", "tbclk", "ehrpwm2_tbclk"),
+ DT_CLK("48300200.pwm", "tbclk", "ehrpwm0_tbclk"),
+ DT_CLK("48302200.pwm", "tbclk", "ehrpwm1_tbclk"),
+ DT_CLK("48304200.pwm", "tbclk", "ehrpwm2_tbclk"),
{ .node_name = NULL },
};

diff --git a/drivers/clk/ti/clk-43xx.c b/drivers/clk/ti/clk-43xx.c
index 097fc90..7255aa8 100644
--- a/drivers/clk/ti/clk-43xx.c
+++ b/drivers/clk/ti/clk-43xx.c
@@ -115,6 +115,12 @@ static struct ti_dt_clk am43xx_clks[] = {
DT_CLK("48306200.ehrpwm", "tbclk", "ehrpwm3_tbclk"),
DT_CLK("48308200.ehrpwm", "tbclk", "ehrpwm4_tbclk"),
DT_CLK("4830a200.ehrpwm", "tbclk", "ehrpwm5_tbclk"),
+ DT_CLK("48300200.pwm", "tbclk", "ehrpwm0_tbclk"),
+ DT_CLK("48302200.pwm", "tbclk", "ehrpwm1_tbclk"),
+ DT_CLK("48304200.pwm", "tbclk", "ehrpwm2_tbclk"),
+ DT_CLK("48306200.pwm", "tbclk", "ehrpwm3_tbclk"),
+ DT_CLK("48308200.pwm", "tbclk", "ehrpwm4_tbclk"),
+ DT_CLK("4830a200.pwm", "tbclk", "ehrpwm5_tbclk"),
{ .node_name = NULL },
};

--
2.7.0

2016-03-20 00:40:30

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3 3/3] pwm: pwm-tiehrpwm: Update dt binding document to use generic node name

On Thu, Mar 17, 2016 at 08:15:23PM -0500, Franklin S Cooper Jr wrote:
> Now that the node name has been changed from ehrpwm to pwm the document
> should show this proper usage. Also change the unit address in the example
> from 0 to the proper physical address value that should be used.
>
> Signed-off-by: Franklin S Cooper Jr <[email protected]>
> ---
> Version 3 changes:
> N/A
>
> Version 2 changes:
> Changed the unit address for da850 to match the value in the reg property.
>
> Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Rob Herring <[email protected]>

2016-03-21 19:19:30

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] clk: ti: am335x/am4372: Add tbclk to pwm node

On 03/17, Franklin S Cooper Jr wrote:
> Add tblck to the pwm nodes. This insures that the ehrpwm driver has access
> to the time-based clk.
>
> Do not remove similar entries for ehrpwm node. Later patches will switch
> from using ehrpwm node name to pwm. But to maintain ABI compatibility we
> shouldn't remove the old entries.
>
> Signed-off-by: Franklin S Cooper Jr <[email protected]>
> ---

Acked-by: Stephen Boyd <[email protected]>

Are there any plans to get off these DT_CLK entries entirely?

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

2016-03-21 19:35:07

by Tero Kristo

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] clk: ti: am335x/am4372: Add tbclk to pwm node

On 03/21/2016 08:43 PM, Stephen Boyd wrote:
> On 03/17, Franklin S Cooper Jr wrote:
>> Add tblck to the pwm nodes. This insures that the ehrpwm driver has access
>> to the time-based clk.
>>
>> Do not remove similar entries for ehrpwm node. Later patches will switch
>> from using ehrpwm node name to pwm. But to maintain ABI compatibility we
>> shouldn't remove the old entries.
>>
>> Signed-off-by: Franklin S Cooper Jr <[email protected]>
>> ---
>
> Acked-by: Stephen Boyd <[email protected]>
>
> Are there any plans to get off these DT_CLK entries entirely?

The series that adds support for the hwmod clock type for OMAPs has a
support patch that should address this problem at least partially; I am
planning to post next rev of that set soonish. It should allow getting
rid of majority of the clock aliases, I will remove any aliases I can at
the same time.

-Tero

2016-04-12 21:08:04

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] ARM: DTS: da850/am4372/am33xx: Use generic node name for ehrpwm

* Franklin S Cooper Jr <[email protected]> [160317 18:16]:
> When possible generic node names should be used. So change the node name
> from ehrpwm to pwm.

Picking this patch into omap-for-v4.7/dt thanks.

Tony