Skip to contentSkip to conversation

Platform support for EHRPWM & ECAP devices in DAVINCI.

PATCH In review Philip Avinash 2 participants 22 messages Mar 25, 2013 – Apr 10, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover Platform support for EHRPWM & ECAP devices in DAVINCI.

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Philip Avinash (3):
ARM: davinci: clk framework support for enable/disable functionality
arm: davinci: clock node support for ECAP & EHRPWM
ARM: davinci: da850: add EHRPWM & ECAP DT node

 arch/arm/boot/dts/da850.dtsi               |   30 ++++++++++++++++++
 arch/arm/mach-davinci/clock.c              |   21 ++++++++-----
 arch/arm/mach-davinci/clock.h              |    2 ++
 arch/arm/mach-davinci/da850.c              |   46 ++++++++++++++++++++++++++++
 arch/arm/mach-davinci/da8xx-dt.c           |    5 +++
 arch/arm/mach-davinci/include/mach/da8xx.h |    1 +
 6 files changed, 98 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/3 ARM: davinci: clk framework support for enable/disable functionality

Davinci clock framework currently not supporting clock enable/disable functionality on clock nodes. In Davinci platform, EHRPWM module requires support for clock enable/disable for TBCLK support. Hence this patch adds support for enabling/disabling clocks depends on the availability of the functionality.

---
Changes since v2:
- start using "usecount" field in clk structure to enable/disable clocks.

Changes since v1:
- Add support for clock enable/disable functionality.

 arch/arm/mach-davinci/clock.c |   21 ++++++++++++++-------
 arch/arm/mach-davinci/clock.h |    2 ++
 2 files changed, 16 insertions(+), 7 deletions(-)
arch/arm/mach-davinci/clock.c +14 -7
index d458558..960c7a5 100644
@@ -35,19 +35,26 @@ static void __clk_enable(struct clk *clk)
 {
 	if (clk->parent)
 		__clk_enable(clk->parent);
-	if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
-		davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
-				true, clk->flags);
+	if (clk->usecount++ == 0) {
+		if (clk->flags & CLK_PSC)
+			davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
+					true, clk->flags);
+		else if (clk->clk_enable)
+			clk->clk_enable(clk);
+	}
 }
 
 static void __clk_disable(struct clk *clk)
 {
 	if (WARN_ON(clk->usecount == 0))
 		return;
-	if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) &&
-	    (clk->flags & CLK_PSC))
-		davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
-				false, clk->flags);
+	if (--clk->usecount == 0) {
+		if (!(clk->flags & CLK_PLL) && (clk->flags & CLK_PSC))
+			davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
+					false, clk->flags);
+		else if (clk->clk_disable)
+			clk->clk_disable(clk);
+	}
 	if (clk->parent)
 		__clk_disable(clk->parent);
 }
arch/arm/mach-davinci/clock.h +2 -0
index 8694b39..1e4e836 100644
@@ -104,6 +104,8 @@ struct clk {
 	int (*set_rate) (struct clk *clk, unsigned long rate);
 	int (*round_rate) (struct clk *clk, unsigned long rate);
 	int (*reset) (struct clk *clk, bool reset);
+	void (*clk_enable) (struct clk *clk);
+	void (*clk_disable) (struct clk *clk);
 };
 
 /* Clock flags: SoC-specific flags start at BIT(16) */
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v3 1/3 ARM: davinci: clk framework support for enable/disable functionality

Quoted 1 line · Philip Avinash

Davinci clock framework currently not supporting clock enable/disable

This is incorrect. We do support enable disable of PSCs in davinci clock implementation.

Quoted 1 line

functionality on clock nodes. In Davinci platform, EHRPWM module requires

s/In Davinci platform/On DA850 SoC/

Quoted 3 lines

support for clock enable/disable for TBCLK support. Hence this patch adds support for enabling/disabling clocks depends on the availability of the functionality.

I reworded the path description as below. Taking care of above and making some other minor changes:

DaVinci clock implementation does not support clock enable/disable functionality on non-PSC clock nodes.

On DA850 SoC, EHRPWM module requires support for enable/disable of TBCLK controlled using a system module register.

This patch adds a method for enabling/disabling non-PSC clocks into DaVinci clock implementation.

Quoted 19 lines

---
Changes since v2:
- start using "usecount" field in clk structure to enable/disable clocks.

Changes since v1:
- Add support for clock enable/disable functionality.

 arch/arm/mach-davinci/clock.c |   21 ++++++++++++++-------
 arch/arm/mach-davinci/clock.h |    2 ++
 2 files changed, 16 insertions(+), 7 deletions(-)
arch/arm/mach-davinci/clock.c +0 -0
index d458558..960c7a5 100644

arch/arm/mach-davinci/clock.c static void __clk_enable(struct clk *clk) · line 41

Quoted 10 lines
arch/arm/mach-davinci/clock.c +4 -3
@@ -35,19 +35,26 @@ static void __clk_enable(struct clk *clk)
 {
 	if (clk->parent)
 		__clk_enable(clk->parent);
-	if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
-		davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
-				true, clk->flags);
+	if (clk->usecount++ == 0) {
+		if (clk->flags & CLK_PSC)
+			davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
+					true, clk->flags);

This line break can be aligned to open parenthesis. This is reported by checkpatch --strict. I fixed this locally.

With these changed, I am queuing this patch for v3.10

Thanks,
Sekhar

#3 lore raw

PATCH v3 1/3 ARM: davinci: clk framework support for enable/disable functionality

Quoted 59 lines · Sekhar
Quoted 1 line · Philip Avinash

Davinci clock framework currently not supporting clock enable/disable

This is incorrect. We do support enable disable of PSCs in davinci clock implementation.

Quoted 1 line

functionality on clock nodes. In Davinci platform, EHRPWM module requires

s/In Davinci platform/On DA850 SoC/

Quoted 3 lines

support for clock enable/disable for TBCLK support. Hence this patch adds support for enabling/disabling clocks depends on the availability of the functionality.

I reworded the path description as below. Taking care of above and making some other minor changes:

DaVinci clock implementation does not support clock enable/disable functionality on non-PSC clock nodes.

On DA850 SoC, EHRPWM module requires support for enable/disable of TBCLK controlled using a system module register.

This patch adds a method for enabling/disabling non-PSC clocks into DaVinci clock implementation.

Quoted 19 lines

---
Changes since v2:
- start using "usecount" field in clk structure to enable/disable clocks.

Changes since v1:
- Add support for clock enable/disable functionality.

 arch/arm/mach-davinci/clock.c |   21 ++++++++++++++-------
 arch/arm/mach-davinci/clock.h |    2 ++
 2 files changed, 16 insertions(+), 7 deletions(-)
arch/arm/mach-davinci/clock.c +0 -0
index d458558..960c7a5 100644

arch/arm/mach-davinci/clock.c static void __clk_enable(struct clk *clk) · line 41

Quoted 10 lines
arch/arm/mach-davinci/clock.c +4 -3
@@ -35,19 +35,26 @@ static void __clk_enable(struct clk *clk)
 {
 	if (clk->parent)
 		__clk_enable(clk->parent);
-	if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
-		davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
-				true, clk->flags);
+	if (clk->usecount++ == 0) {
+		if (clk->flags & CLK_PSC)
+			davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
+					true, clk->flags);

This line break can be aligned to open parenthesis. This is reported by checkpatch --strict. I fixed this locally.

Quoted 1 line

With these changed, I am queuing this patch for v3.10

Thanks for correction and queuing. checkpatch --strict is new to me.

Avinash

Quoted 4 lines

Thanks,
Sekhar

#4 lore raw

PATCH v3 2/3 arm: davinci: clock node support for ECAP & EHRPWM

In reply to Philip Avinash

Add clock node support for ECAP and EHRPWM modules. Also adds TBCLK for EHRWPM TBCLK to comply with pwm-tiehrpwm driver.

---
Changes Since v2:
- Add prefix of ehrpwm to tblck_enable and tblck_disable functions
- Make functions as static.

Changes Since v1:
- TBCLK make it as actual clock with enable/disable feature.

 arch/arm/mach-davinci/da850.c              |   46 ++++++++++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/da8xx.h |    1 +
 2 files changed, 47 insertions(+)
arch/arm/mach-davinci/da850.c +46 -0
index 0c4a26d..2a2f60c 100644
@@ -383,6 +383,49 @@ static struct clk dsp_clk = {
 	.flags		= PSC_LRST | PSC_FORCE,
 };
 
+static struct clk ehrpwm_clk = {
+	.name		= "ehrpwm",
+	.parent		= &pll0_sysclk2,
+	.lpsc		= DA8XX_LPSC1_PWM,
+	.gpsc		= 1,
+	.flags		= DA850_CLK_ASYNC3,
+};
+
+#define DA8XX_EHRPWM_TBCLKSYNC	BIT(12)
+
+static void ehrpwm_tblck_enable(struct clk *clk)
+{
+	u32 val;
+
+	val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+	val |= DA8XX_EHRPWM_TBCLKSYNC;
+	writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+}
+
+static void ehrpwm_tblck_disable(struct clk *clk)
+{
+	u32 val;
+
+	val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+	val &= ~DA8XX_EHRPWM_TBCLKSYNC;
+	writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+}
+
+static struct clk ehrpwm_tbclk = {
+	.name		= "ehrpwm_tbclk",
+	.parent		= &ehrpwm_clk,
+	.clk_enable	= ehrpwm_tblck_enable,
+	.clk_disable	= ehrpwm_tblck_disable,
+};
+
+static struct clk ecap_clk = {
+	.name		= "ecap",
+	.parent		= &pll0_sysclk2,
+	.lpsc		= DA8XX_LPSC1_ECAP,
+	.gpsc		= 1,
+	.flags		= DA850_CLK_ASYNC3,
+};
+
 static struct clk_lookup da850_clks[] = {
 	CLK(NULL,		"ref",		&ref_clk),
 	CLK(NULL,		"pll0",		&pll0_clk),
@@ -430,6 +473,9 @@ static struct clk_lookup da850_clks[] = {
 	CLK("vpif",		NULL,		&vpif_clk),
 	CLK("ahci",		NULL,		&sata_clk),
 	CLK("davinci-rproc.0",	NULL,		&dsp_clk),
+	CLK("ehrpwm",		"fck",		&ehrpwm_clk),
+	CLK("ehrpwm",		"tbclk",	&ehrpwm_tbclk),
+	CLK("ecap",		"fck",		&ecap_clk),
 	CLK(NULL,		NULL,		NULL),
 };
 
arch/arm/mach-davinci/include/mach/da8xx.h +1 -0
index de439b7..be77ce2 100644
@@ -55,6 +55,7 @@ extern unsigned int da850_max_speed;
 #define DA8XX_SYSCFG0_VIRT(x)	(da8xx_syscfg0_base + (x))
 #define DA8XX_JTAG_ID_REG	0x18
 #define DA8XX_CFGCHIP0_REG	0x17c
+#define DA8XX_CFGCHIP1_REG	0x180
 #define DA8XX_CFGCHIP2_REG	0x184
 #define DA8XX_CFGCHIP3_REG	0x188
 
Signature · 1 line
1.7.9.5
#5 lore raw

Re: [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM

Quoted 5 lines · Philip Avinash

Add clock node support for ECAP and EHRPWM modules. Also adds TBCLK for EHRWPM TBCLK to comply with pwm-tiehrpwm driver.

Queuing this for v3.10

Thanks,
Sekhar

#6 lore raw
In reply to Philip Avinash
Quoted 9 lines · Philip Avinash

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Quoted 6 lines

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Philip Avinash (3):
ARM: davinci: clk framework support for enable/disable functionality

Patch 1/3 did not reach me. I cant find it in archives either so most likely no one received it. Can you please send that one patch again?

Quoted 1 line

arm: davinci: clock node support for ECAP & EHRPWM

For future, please be consistent and capitalize 'ARM' in subject line.

Quoted 10 lines

ARM: davinci: da850: add EHRPWM & ECAP DT node

 arch/arm/boot/dts/da850.dtsi               |   30 ++++++++++++++++++
 arch/arm/mach-davinci/clock.c              |   21 ++++++++-----
 arch/arm/mach-davinci/clock.h              |    2 ++
 arch/arm/mach-davinci/da850.c              |   46 ++++++++++++++++++++++++++++
 arch/arm/mach-davinci/da8xx-dt.c           |    5 +++
 arch/arm/mach-davinci/include/mach/da8xx.h |    1 +
 6 files changed, 98 insertions(+), 7 deletions(-)

Thanks,
Sekhar

#7 lore raw
Quoted 14 lines · Sekhar
Quoted 13 lines · Philip Avinash

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Quoted 5 lines
Quoted 2 lines

Philip Avinash (3):
ARM: davinci: clk framework support for enable/disable functionality

Patch 1/3 did not reach me. I cant find it in archives either so most likely no one received it. Can you please send that one patch again?

Done.

Quoted 4 lines
Quoted 2 lines

arm: davinci: clock node support for ECAP & EHRPWM

For future, please be consistent and capitalize 'ARM' in subject line.

Ok I will take care.

Thanks
Avinash

Quoted 15 lines
Quoted 11 lines

ARM: davinci: da850: add EHRPWM & ECAP DT node

 arch/arm/boot/dts/da850.dtsi               |   30 ++++++++++++++++++
 arch/arm/mach-davinci/clock.c              |   21 ++++++++-----
 arch/arm/mach-davinci/clock.h              |    2 ++
 arch/arm/mach-davinci/da850.c              |   46 ++++++++++++++++++++++++++++
 arch/arm/mach-davinci/da8xx-dt.c           |    5 +++
 arch/arm/mach-davinci/include/mach/da8xx.h |    1 +
 6 files changed, 98 insertions(+), 7 deletions(-)

Thanks,
Sekhar

#8 lore raw

PATCH v3 3/3 ARM: davinci: da850: add EHRPWM & ECAP DT node

In reply to Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

---
Changes since v1:
- Reusing ti,am33xx<ecap/ehrpwm> as compatible field as both IP's are similar with am33xx platform and da850 has no platform specific dependency.

 arch/arm/boot/dts/da850.dtsi     |   30 ++++++++++++++++++++++++++++++
 arch/arm/mach-davinci/da8xx-dt.c |    5 +++++
 2 files changed, 35 insertions(+)
arch/arm/boot/dts/da850.dtsi +30 -0
index 3ec1bda..62fd2d4 100644
@@ -107,6 +107,36 @@
 			reg = <0x21000 0x1000>;
 			status = "disabled";
 		};
+		ehrpwm0: ehrpwm at 01f00000 {
+			compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
+			#pwm-cells = <3>;
+			reg = <0x300000 0x2000>;
+			status = "disabled";
+		};
+		ehrpwm1: ehrpwm at 01f02000 {
+			compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
+			#pwm-cells = <3>;
+			reg = <0x302000 0x2000>;
+			status = "disabled";
+		};
+		ecap0: ecap at 01f06000 {
+			compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+			#pwm-cells = <3>;
+			reg = <0x306000 0x80>;
+			status = "disabled";
+		};
+		ecap1: ecap at 01f07000 {
+			compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+			#pwm-cells = <3>;
+			reg = <0x307000 0x80>;
+			status = "disabled";
+		};
+		ecap2: ecap at 01f08000 {
+			compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+			#pwm-cells = <3>;
+			reg = <0x308000 0x80>;
+			status = "disabled";
+		};
 	};
 	nand_cs3 at 62000000 {
 		compatible = "ti,davinci-nand";
arch/arm/mach-davinci/da8xx-dt.c +5 -0
index 6b7a0a2..89ee974 100644
@@ -40,6 +40,11 @@ static void __init da8xx_init_irq(void)
 struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("ti,davinci-i2c", 0x01c22000, "i2c_davinci.1", NULL),
 	OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "watchdog", NULL),
+	OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f00000, "ehrpwm", NULL),
+	OF_DEV_AUXDATA("ti,da850-ehrpwm", 0x01f02000, "ehrpwm", NULL),
+	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f06000, "ecap", NULL),
+	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f07000, "ecap", NULL),
+	OF_DEV_AUXDATA("ti,da850-ecap", 0x01f08000, "ecap", NULL),
 	{}
 };
 
Signature · 1 line
1.7.9.5
#9 lore raw

Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Thanks,
Sekhar

#10 lore raw

RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 7 lines · Sekhar
Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Sekhar,

Binding document got accepted in PWM tree [1].
Can you accept this patch?

1. https://gitorious.org/linux-pwm

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar

#11 lore raw

Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 6 lines · Avinash
Quoted 5 lines · Sekhar
Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

Quoted 7 lines
Quoted 2 lines

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Sekhar,

Binding document got accepted in PWM tree [1].
Can you accept this patch?

Can you also add the pinmux definitions and resend just this patch? Sorry I did not notice those were missing earlier.

Thanks,
Sekhar

#12 lore raw

RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 11 lines · Sekhar
Quoted 9 lines · Avinash
Quoted 7 lines · Sekhar
Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Quoted 7 lines
Quoted 4 lines

Sekhar,

Binding document got accepted in PWM tree [1].
Can you accept this patch?

Can you also add the pinmux definitions and resend just this patch? Sorry I did not notice those were missing earlier.

According to latest schematics, ECAP instance 2 being used for PWM backlight control. Should I add pin-mux only for ECAP2 or for all PWM instances?

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar

#13 lore raw

Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 14 lines · Avinash
Quoted 13 lines · Sekhar
Quoted 11 lines · Avinash
Quoted 7 lines · Sekhar
Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Sekhar,

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Binding document got accepted in PWM tree [1].
Can you accept this patch?

Can you also add the pinmux definitions and resend just this patch? Sorry I did not notice those were missing earlier.

According to latest schematics, ECAP instance 2 being used for PWM backlight control. Should I add pin-mux only for ECAP2 or for all PWM instances?

I meant add definitions in .dtsi. Since there is only one pin a given functionality can be present on in DaVinci, it can be done in a board independent manner. See examples for other peripherals in existing da850.dtsi file.

Thanks,
Sekhar

#14 lore raw

RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 21 lines · Sekhar
Quoted 20 lines · Avinash
Quoted 18 lines · Sekhar
Quoted 6 lines · Avinash
Quoted 5 lines · Sekhar
Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

Quoted 7 lines
Quoted 2 lines

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Sekhar,

Binding document got accepted in PWM tree [1].
Can you accept this patch?

Can you also add the pinmux definitions and resend just this patch? Sorry I did not notice those were missing earlier.

Quoted 6 lines
Quoted 2 lines

According to latest schematics, ECAP instance 2 being used for PWM backlight control. Should I add pin-mux only for ECAP2 or for all PWM instances?

I meant add definitions in .dtsi. Since there is only one pin a given functionality can be present on in DaVinci, it can be done in a board independent manner.

I think here the expectation would be that .dtsi should populate the complete pin-mux for SOC and board files should just be able to re-use it (add it as a phandler). Also as per the above description .dtsi file will end up contain majorly pin-mux info rather than the hardware data. Is it a good idea?

On looking da850.dtsi file NAND pins were defined for 8-bit part.
In case of NAND flash, the device might be sitting under different chip-select or may have 16 bit part on different boards. So pin-mux defined in soc.dtsi has to be split separately for CS, DATA, Address.

So it is always challenging to create pin-mux info in .dtsi file. So more useful/meaningful way is to actually create pin-mux in board file rather in .dtsi file.

Quoted 2 lines

See examples for other peripherals in existing
da850.dtsi file.

I have gone through .dtsi. But it didn't describe the complete pin-mux like I2C1, MMC1, etc. So the expectation here is only to add ECAP2 pin-mux. Is it correct?

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar

#15 lore raw

Re: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 25 lines · Avinash
Quoted 24 lines · Sekhar
Quoted 22 lines · Avinash
Quoted 11 lines · Sekhar
Quoted 9 lines · Avinash
Quoted 7 lines · Sekhar
Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Quoted 7 lines
Quoted 4 lines

Sekhar,

Binding document got accepted in PWM tree [1].
Can you accept this patch?

Can you also add the pinmux definitions and resend just this patch? Sorry I did not notice those were missing earlier.

According to latest schematics, ECAP instance 2 being used for PWM backlight control. Should I add pin-mux only for ECAP2 or for all PWM instances?

Quoted 6 lines
Quoted 3 lines

I meant add definitions in .dtsi. Since there is only one pin a given functionality can be present on in DaVinci, it can be done in a board independent manner.

I think here the expectation would be that .dtsi should populate the complete pin-mux for SOC and board files should just be able to re-use it (add it as a phandler).

Yes, that's the idea.

Quoted 2 lines

Also as per the above description .dtsi file will end up contain majorly pin-mux info rather than the hardware data. Is it a good idea?

Pinmux is also hardware data, no? Thats why its present in DT.

Quoted 4 lines

On looking da850.dtsi file NAND pins were defined for 8-bit part.
In case of NAND flash, the device might be sitting under different chip-select or may have 16 bit part on different boards. So pin-mux defined in soc.dtsi has to be split separately for CS, DATA, Address.

The idea is to define pin groups that most of the time can be reused by .dts file as-is and if there are any board specific extra pins needed then they can be handled directly in .dts files. But the common cases don't have to be repeated in all boards. In case of NAND, CS and the top 8-pins when using a 16-bit bus can be moved to a different group. So, I agree instead of nand_cs3_pins, we could have had nand_pins and moved cs definitions to another re-usable group.

Quoted 2 lines

So it is always challenging to create pin-mux info in .dtsi file. So more useful/meaningful way is to actually create pin-mux in board file rather in .dtsi file.

I don't see why it is so challenging. Repeating the same pinmux information over multiple .dts file (while making errors copying) will be challenging. And its not as if this is my original idea. imx (and I think some others) are doing it as well. See how pinmux is defined in imx53.dtsi and reused in a number of boards like evk, qsb, smd and so on.

Quoted 4 lines
Quoted 2 lines

See examples for other peripherals in existing
da850.dtsi file.

I have gone through .dtsi. But it didn't describe the complete pin-mux like I2C1, MMC1, etc.

pinmux should be added for whatever nodes are added since pimux is part of node.

Quoted 1 line

So the expectation here is only to add ECAP2 pin-mux. Is it correct?

No, please add pinmux information for all the IP nodes you are adding. I am not insisting that you add all IP nodes at the same time. You can add whatever you have tested.

Thanks,
Sekhar

#16 lore raw

RE: [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node

Quoted 26 lines · Sekhar
Quoted 25 lines · Avinash
Quoted 24 lines · Sekhar
Quoted 22 lines · Avinash
Quoted 11 lines · Sekhar
Quoted 9 lines · Avinash
Quoted 7 lines · Sekhar
Quoted 3 lines · Philip Avinash

Add da850 EHRPWM & ECAP DT node.
Also adds OF_DEV_AUXDATA for EHRPWM & ECAP driver to use EHRPWM & ECAP clock.

This looks fine to me but I will wait for the bindings to get accepted before taking this one.

Quoted 7 lines
Quoted 4 lines

Sekhar,

Binding document got accepted in PWM tree [1].
Can you accept this patch?

Can you also add the pinmux definitions and resend just this patch? Sorry I did not notice those were missing earlier.

According to latest schematics, ECAP instance 2 being used for PWM backlight control. Should I add pin-mux only for ECAP2 or for all PWM instances?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

I meant add definitions in .dtsi. Since there is only one pin a given functionality can be present on in DaVinci, it can be done in a board independent manner.

I think here the expectation would be that .dtsi should populate the complete pin-mux for SOC and board files should just be able to re-use it (add it as a phandler).

Yes, that's the idea.

Ok

Quoted 5 lines
Quoted 3 lines

Also as per the above description .dtsi file will end up contain majorly pin-mux info rather than the hardware data. Is it a good idea?

Pinmux is also hardware data, no? Thats why its present in DT.

I understood.

Quoted 6 lines
Quoted 5 lines

On looking da850.dtsi file NAND pins were defined for 8-bit part.
In case of NAND flash, the device might be sitting under different chip-select or may have 16 bit part on different boards. So pin-mux defined in soc.dtsi has to be split separately for CS, DATA, Address.

Quoted 7 lines

The idea is to define pin groups that most of the time can be reused by .dts file as-is and if there are any board specific extra pins needed then they can be handled directly in .dts files. But the common cases don't have to be repeated in all boards. In case of NAND, CS and the top 8-pins when using a 16-bit bus can be moved to a different group. So, I agree instead of nand_cs3_pins, we could have had nand_pins and moved cs definitions to another re-usable group.

Ok, thanks for the detailed explanation.

Quoted 15 lines
Quoted 3 lines

So it is always challenging to create pin-mux info in .dtsi file. So more useful/meaningful way is to actually create pin-mux in board file rather in .dtsi file.

I don't see why it is so challenging. Repeating the same pinmux information over multiple .dts file (while making errors copying) will be challenging. And its not as if this is my original idea. imx (and I think some others) are doing it as well. See how pinmux is defined in imx53.dtsi and reused in a number of boards like evk, qsb, smd and so on.

Quoted 4 lines
Quoted 2 lines

See examples for other peripherals in existing
da850.dtsi file.

I have gone through .dtsi. But it didn't describe the complete pin-mux like I2C1, MMC1, etc.

Quoted 8 lines

pinmux should be added for whatever nodes are added since pimux is part of node.

Quoted 1 line

So the expectation here is only to add ECAP2 pin-mux. Is it correct?

No, please add pinmux information for all the IP nodes you are adding. I am not insisting that you add all IP nodes at the same time. You can add whatever you have tested.

I actually tested EHRPWM1A and EHRPWM1B in older boards for back light support. But in latest schematics shows ECAP2 being used for backlight control and can't be tested as boards with this change is not accessible to me.
So I will add tested pin-mux details.

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar

#17 lore raw
In reply to Philip Avinash
Quoted 5 lines · Philip Avinash

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

Quoted 7 lines

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Can you check if this is really true even in newer boards (have a look at the latest schematics)? I remember this used to be a problem in very early versions but was fixed later.

Thanks,
Sekhar

#18 lore raw
Quoted 10 lines · Sekhar
Quoted 9 lines · Philip Avinash

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Quoted 7 lines
Quoted 3 lines

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Can you check if this is really true even in newer boards (have a look at the latest schematics)? I remember this used to be a problem in very early versions but was fixed later.

On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR, LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used to control GPIO functionality. But with DT support, I have to check how platform callbacks can be used.

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar

#19 lore raw
Quoted 15 lines · Avinash
Quoted 14 lines · Sekhar
Quoted 12 lines · Philip Avinash

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Quoted 8 lines
Quoted 3 lines

Can you check if this is really true even in newer boards (have a look at the latest schematics)? I remember this used to be a problem in very early versions but was fixed later.

On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR, LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals

By controlling above you mean "switching on/off"? Otherwise this seems to be contradicting the statement just before.

Quoted 3 lines

to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used to control GPIO functionality. But with DT support, I have to check how platform callbacks can be used.

Platform callbacks are not possible with DT. You can look at what freescale mxsfb.c does. Look for panel-enable-gpios DT binding.

Thanks,
Sekhar

#20 lore raw
Quoted 20 lines · Sekhar
Quoted 19 lines · Avinash
Quoted 17 lines · Sekhar
Quoted 5 lines · Philip Avinash

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

Quoted 7 lines

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Can you check if this is really true even in newer boards (have a look at the latest schematics)? I remember this used to be a problem in very early versions but was fixed later.

Quoted 7 lines
Quoted 4 lines

On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR, LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals

By controlling above you mean "switching on/off"? Otherwise this seems to be contradicting the statement just before.

Yes these lines should be switching on/off.

Quoted 6 lines
Quoted 4 lines

to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used to control GPIO functionality. But with DT support, I have to check how platform callbacks can be used.

Platform callbacks are not possible with DT.

Ok.

Quoted 1 line

You can look at what freescale mxsfb.c does. Look for panel-enable-gpios DT binding.

I will use GPIO pin configuration info from DT nodes. From probe GPIO pin make active and in remove disable GPIO pin.

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar

#21 lore raw
In reply to Sekhar Nori
Quoted 36 lines · Avinash
Quoted 20 lines · Sekhar
Quoted 19 lines · Avinash
Quoted 17 lines · Sekhar
Quoted 5 lines · Philip Avinash

Add platform support for EHRPWM and ECAP by providing clock nodes and device tree nodes.
This series depends on [1] and [2] and is available for testing at [3]. Tested for back light support in da850 EVM with EHRPWM PWM device.

Quoted 7 lines

[1] http://gitorious.org/linux-davinci/linux-davinci/trees/davinci-for-v3.9/dt-2
[2] https://gitorious.org/linux-pwm/linux-pwm/trees/for-next
[3] https://github.com/avinashphilip/am335x_linux/tree/davinci-for-v3.9_soc_pwm

Note:
DT support for EHRPWM backlight has not been added in da850-evm.dts as there is conflicting pin-mux requirement with SPI flash.

Can you check if this is really true even in newer boards (have a look at the latest schematics)? I remember this used to be a problem in very early versions but was fixed later.

Quoted 7 lines
Quoted 4 lines

On looking schematics, panel has three power controls LCD_BACKLIGHT_PWR, LCD_PANEL_PWR, LCD_PWM0. On latest schematic, LCD_PWM0 is connected to ECAP instance 2. So backlight can control through ECAP2 (not conflicting with SPI1 cs0). Still for controlling backlight, require support for LCD_BACKLIGHT_PWR & LCD_PANEL_PWR. These signals

By controlling above you mean "switching on/off"? Otherwise this seems to be contradicting the statement just before.

Yes these lines should be switching on/off.

Quoted 5 lines
Quoted 4 lines

to be controlled by GPIO 2[8] & GPIO 2[15]. In release platform callbacks used to control GPIO functionality. But with DT support, I have to check how platform callbacks can be used.

Quoted 8 lines
Quoted 1 line

Platform callbacks are not possible with DT.

Ok.

Quoted 1 line

You can look at what freescale mxsfb.c does. Look for panel-enable-gpios DT binding.

I will use GPIO pin configuration info from DT nodes. From probe GPIO pin make active and in remove disable GPIO pin.

For passing from GPIO pins from DT, GPIO DT node has to be populated. So this has dependency on GPIO driver conversion for davinci platforms.

Thanks
Avinash

Quoted 10 lines

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar