linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
@ 2013-03-25  7:49 Philip Avinash
  2013-03-25  7:49 ` [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM Philip Avinash
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Philip Avinash @ 2013-03-25  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

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(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM
  2013-03-25  7:49 [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Philip Avinash
@ 2013-03-25  7:49 ` Philip Avinash
  2013-04-02  8:16   ` Sekhar Nori
  2013-03-25  7:49 ` [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node Philip Avinash
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Philip Avinash @ 2013-03-25  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
---
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(+)

diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 0c4a26d..2a2f60c 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -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),
 };
 
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index de439b7..be77ce2 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -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
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-03-25  7:49 [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Philip Avinash
  2013-03-25  7:49 ` [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM Philip Avinash
@ 2013-03-25  7:49 ` Philip Avinash
  2013-04-02  8:33   ` Sekhar Nori
  2013-03-25  8:14 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Philip Avinash @ 2013-03-25  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
---
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(+)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 3ec1bda..62fd2d4 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -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";
diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index 6b7a0a2..89ee974 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -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),
 	{}
 };
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
  2013-03-25  7:49 [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Philip Avinash
  2013-03-25  7:49 ` [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM Philip Avinash
  2013-03-25  7:49 ` [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node Philip Avinash
@ 2013-03-25  8:14 ` Sekhar Nori
  2013-03-25  8:30   ` Philip, Avinash
  2013-03-25  9:37 ` [PATCH v3 1/3] ARM: davinci: clk framework support for enable/disable functionality Philip Avinash
  2013-04-02  8:35 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
  4 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-03-25  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> 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

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?

>   arm: davinci: clock node support for ECAP & EHRPWM

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

>   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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
  2013-03-25  8:14 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
@ 2013-03-25  8:30   ` Philip, Avinash
  0 siblings, 0 replies; 22+ messages in thread
From: Philip, Avinash @ 2013-03-25  8:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 25, 2013 at 13:44:37, Nori, Sekhar wrote:
> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > 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
> 
> 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.

> 
> >   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
> 
> >   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
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 1/3] ARM: davinci: clk framework support for enable/disable functionality
  2013-03-25  7:49 [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Philip Avinash
                   ` (2 preceding siblings ...)
  2013-03-25  8:14 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
@ 2013-03-25  9:37 ` Philip Avinash
  2013-04-01 11:35   ` Sekhar Nori
  2013-04-02  8:35 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
  4 siblings, 1 reply; 22+ messages in thread
From: Philip Avinash @ 2013-03-25  9:37 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
---
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(-)

diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index d458558..960c7a5 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -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);
 }
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 8694b39..1e4e836 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -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) */
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v3 1/3] ARM: davinci: clk framework support for enable/disable functionality
  2013-03-25  9:37 ` [PATCH v3 1/3] ARM: davinci: clk framework support for enable/disable functionality Philip Avinash
@ 2013-04-01 11:35   ` Sekhar Nori
  2013-04-03  3:58     ` Philip, Avinash
  0 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-04-01 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 3/25/2013 3:07 PM, Philip Avinash wrote:
> Davinci clock framework currently not supporting clock enable/disable

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

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

s/In Davinci platform/On DA850 SoC/

> 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.

> 
> Signed-off-by: Philip Avinash <avinashphilip@ti.com>
> ---
> 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(-)
> 
> diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
> index d458558..960c7a5 100644
> --- a/arch/arm/mach-davinci/clock.c
> +++ b/arch/arm/mach-davinci/clock.c
> @@ -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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM
  2013-03-25  7:49 ` [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM Philip Avinash
@ 2013-04-02  8:16   ` Sekhar Nori
  0 siblings, 0 replies; 22+ messages in thread
From: Sekhar Nori @ 2013-04-02  8:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> Add clock node support for ECAP and EHRPWM modules.
> Also adds TBCLK for EHRWPM TBCLK to comply with pwm-tiehrpwm
> driver.
> 
> Signed-off-by: Philip Avinash <avinashphilip@ti.com>

Queuing this for v3.10

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-03-25  7:49 ` [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node Philip Avinash
@ 2013-04-02  8:33   ` Sekhar Nori
  2013-04-08  9:09     ` Philip, Avinash
  0 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-04-02  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
  2013-03-25  7:49 [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Philip Avinash
                   ` (3 preceding siblings ...)
  2013-03-25  9:37 ` [PATCH v3 1/3] ARM: davinci: clk framework support for enable/disable functionality Philip Avinash
@ 2013-04-02  8:35 ` Sekhar Nori
  2013-04-04  4:39   ` Philip, Avinash
  4 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-04-02  8:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 3/25/2013 1:19 PM, Philip Avinash wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 1/3] ARM: davinci: clk framework support for enable/disable functionality
  2013-04-01 11:35   ` Sekhar Nori
@ 2013-04-03  3:58     ` Philip, Avinash
  0 siblings, 0 replies; 22+ messages in thread
From: Philip, Avinash @ 2013-04-03  3:58 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 01, 2013 at 17:05:36, Nori, Sekhar wrote:
> On 3/25/2013 3:07 PM, Philip Avinash wrote:
> > Davinci clock framework currently not supporting clock enable/disable
> 
> This is incorrect. We do support enable disable of PSCs in davinci clock
> implementation.
> 
> > functionality on clock nodes. In Davinci platform, EHRPWM module requires
> 
> s/In Davinci platform/On DA850 SoC/
> 
> > 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.
> 
> > 
> > Signed-off-by: Philip Avinash <avinashphilip@ti.com>
> > ---
> > 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(-)
> > 
> > diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
> > index d458558..960c7a5 100644
> > --- a/arch/arm/mach-davinci/clock.c
> > +++ b/arch/arm/mach-davinci/clock.c
> > @@ -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 for correction and queuing. checkpatch --strict is new to me.

Avinash

> 
> Thanks,
> Sekhar
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
  2013-04-02  8:35 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
@ 2013-04-04  4:39   ` Philip, Avinash
  2013-04-04  5:49     ` Sekhar Nori
  0 siblings, 1 reply; 22+ messages in thread
From: Philip, Avinash @ 2013-04-04  4:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > 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.
> 
> 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

> 
> Thanks,
> Sekhar
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
  2013-04-04  4:39   ` Philip, Avinash
@ 2013-04-04  5:49     ` Sekhar Nori
  2013-04-04  6:38       ` Philip, Avinash
  2013-04-04 10:10       ` Philip, Avinash
  0 siblings, 2 replies; 22+ messages in thread
From: Sekhar Nori @ 2013-04-04  5:49 UTC (permalink / raw)
  To: linux-arm-kernel

On 4/4/2013 10:09 AM, Philip, Avinash wrote:
> On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>> 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.
>>
>> 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.

> 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
  2013-04-04  5:49     ` Sekhar Nori
@ 2013-04-04  6:38       ` Philip, Avinash
  2013-04-04 10:10       ` Philip, Avinash
  1 sibling, 0 replies; 22+ messages in thread
From: Philip, Avinash @ 2013-04-04  6:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 04, 2013 at 11:19:44, Nori, Sekhar wrote:
> On 4/4/2013 10:09 AM, Philip, Avinash wrote:
> > On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
> >> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>> 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.
> >>
> >> 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.

Yes these lines should be switching on/off.

> 
> > 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.

> 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

> 
> Thanks,
> Sekhar
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI.
  2013-04-04  5:49     ` Sekhar Nori
  2013-04-04  6:38       ` Philip, Avinash
@ 2013-04-04 10:10       ` Philip, Avinash
  1 sibling, 0 replies; 22+ messages in thread
From: Philip, Avinash @ 2013-04-04 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 04, 2013 at 12:07:44, Philip, Avinash wrote:
> On Thu, Apr 04, 2013 at 11:19:44, Nori, Sekhar wrote:
> > On 4/4/2013 10:09 AM, Philip, Avinash wrote:
> > > On Tue, Apr 02, 2013 at 14:05:09, Nori, Sekhar wrote:
> > >> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > >>> 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.
> > >>
> > >> 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.
> 
> Yes these lines should be switching on/off.
> 
> > 
> > > 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.
> 
> > 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

> 
> Thanks
> Avinash
> 
> > 
> > Thanks,
> > Sekhar
> > 
> 
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-04-02  8:33   ` Sekhar Nori
@ 2013-04-08  9:09     ` Philip, Avinash
  2013-04-08 13:09       ` Sekhar Nori
  0 siblings, 1 reply; 22+ messages in thread
From: Philip, Avinash @ 2013-04-08  9:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> > 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

> 
> Thanks,
> Sekhar
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-04-08  9:09     ` Philip, Avinash
@ 2013-04-08 13:09       ` Sekhar Nori
  2013-04-09  8:42         ` Philip, Avinash
  0 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-04-08 13:09 UTC (permalink / raw)
  To: linux-arm-kernel


On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>> 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?

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

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-04-08 13:09       ` Sekhar Nori
@ 2013-04-09  8:42         ` Philip, Avinash
  2013-04-09 11:35           ` Sekhar Nori
  0 siblings, 1 reply; 22+ messages in thread
From: Philip, Avinash @ 2013-04-09  8:42 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
> 
> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> > On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> >> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>> 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?
> 
> 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

> 
> Thanks,
> Sekhar
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-04-09  8:42         ` Philip, Avinash
@ 2013-04-09 11:35           ` Sekhar Nori
  2013-04-10  5:30             ` Philip, Avinash
  0 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-04-09 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 4/9/2013 2:12 PM, Philip, Avinash wrote:
> On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
>>
>> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
>>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
>>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>>>> 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?
>>
>> 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-04-09 11:35           ` Sekhar Nori
@ 2013-04-10  5:30             ` Philip, Avinash
  2013-04-10  5:55               ` Sekhar Nori
  0 siblings, 1 reply; 22+ messages in thread
From: Philip, Avinash @ 2013-04-10  5:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 09, 2013 at 17:05:25, Nori, Sekhar wrote:
> On 4/9/2013 2:12 PM, Philip, Avinash wrote:
> > On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
> >>
> >> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> >>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> >>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>>>> 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?
> >>
> >> 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.

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.

> 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

> 
> Thanks,
> Sekhar
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-04-10  5:30             ` Philip, Avinash
@ 2013-04-10  5:55               ` Sekhar Nori
  2013-04-10  6:07                 ` Philip, Avinash
  0 siblings, 1 reply; 22+ messages in thread
From: Sekhar Nori @ 2013-04-10  5:55 UTC (permalink / raw)
  To: linux-arm-kernel

On 4/10/2013 11:00 AM, Philip, Avinash wrote:
> On Tue, Apr 09, 2013 at 17:05:25, Nori, Sekhar wrote:
>> On 4/9/2013 2:12 PM, Philip, Avinash wrote:
>>> On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
>>>>
>>>> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
>>>>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
>>>>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
>>>>>>> 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?
>>>>
>>>> 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.
> 
> 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.

> 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.

> 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.

> 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.

>> 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.

> 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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node
  2013-04-10  5:55               ` Sekhar Nori
@ 2013-04-10  6:07                 ` Philip, Avinash
  0 siblings, 0 replies; 22+ messages in thread
From: Philip, Avinash @ 2013-04-10  6:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Apr 10, 2013 at 11:25:19, Nori, Sekhar wrote:
> On 4/10/2013 11:00 AM, Philip, Avinash wrote:
> > On Tue, Apr 09, 2013 at 17:05:25, Nori, Sekhar wrote:
> >> On 4/9/2013 2:12 PM, Philip, Avinash wrote:
> >>> On Mon, Apr 08, 2013 at 18:39:57, Nori, Sekhar wrote:
> >>>>
> >>>> On 4/8/2013 2:39 PM, Philip, Avinash wrote:
> >>>>> On Tue, Apr 02, 2013 at 14:03:34, Nori, Sekhar wrote:
> >>>>>> On 3/25/2013 1:19 PM, Philip Avinash wrote:
> >>>>>>> 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?
> >>>>
> >>>> 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.
> > 
> > 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

> 
> > 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.

> 
> > 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.

Ok, thanks for the detailed explanation.

> 
> > 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.
> 
> >> 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.
> 
> > 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

> 
> Thanks,
> Sekhar
> 

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-04-10  6:07 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25  7:49 [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Philip Avinash
2013-03-25  7:49 ` [PATCH v3 2/3] arm: davinci: clock node support for ECAP & EHRPWM Philip Avinash
2013-04-02  8:16   ` Sekhar Nori
2013-03-25  7:49 ` [PATCH v3 3/3] ARM: davinci: da850: add EHRPWM & ECAP DT node Philip Avinash
2013-04-02  8:33   ` Sekhar Nori
2013-04-08  9:09     ` Philip, Avinash
2013-04-08 13:09       ` Sekhar Nori
2013-04-09  8:42         ` Philip, Avinash
2013-04-09 11:35           ` Sekhar Nori
2013-04-10  5:30             ` Philip, Avinash
2013-04-10  5:55               ` Sekhar Nori
2013-04-10  6:07                 ` Philip, Avinash
2013-03-25  8:14 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
2013-03-25  8:30   ` Philip, Avinash
2013-03-25  9:37 ` [PATCH v3 1/3] ARM: davinci: clk framework support for enable/disable functionality Philip Avinash
2013-04-01 11:35   ` Sekhar Nori
2013-04-03  3:58     ` Philip, Avinash
2013-04-02  8:35 ` [PATCH v3 0/3] Platform support for EHRPWM & ECAP devices in DAVINCI Sekhar Nori
2013-04-04  4:39   ` Philip, Avinash
2013-04-04  5:49     ` Sekhar Nori
2013-04-04  6:38       ` Philip, Avinash
2013-04-04 10:10       ` Philip, Avinash

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).