Skip to contentSkip to conversation

Platform support for EHRPWM & ECAP devices in DAVINCI.

PATCH Superseded Philip Avinash 3 participants 13 messages Mar 20, 2013 – Mar 22, 2013

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 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 backlight 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              |    4 +++
 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, 88 insertions(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 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 v1:
- Add support for clock enable/disable functionality.

:100644 100644 d458558... aa89e5e... M arch/arm/mach-davinci/clock.c
:100644 100644 8694b39... 1e4e836... M arch/arm/mach-davinci/clock.h

 arch/arm/mach-davinci/clock.c |    4 ++++
 arch/arm/mach-davinci/clock.h |    2 ++
 2 files changed, 6 insertions(+)
arch/arm/mach-davinci/clock.c +4 -0
index d458558..aa89e5e 100644
@@ -35,6 +35,8 @@ static void __clk_enable(struct clk *clk)
 {
 	if (clk->parent)
 		__clk_enable(clk->parent);
+	if (clk->clk_enable)
+		clk->clk_enable(clk);
 	if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))
 		davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
 				true, clk->flags);
@@ -44,6 +46,8 @@ static void __clk_disable(struct clk *clk)
 {
 	if (WARN_ON(clk->usecount == 0))
 		return;
+	if (clk->clk_disable)
+		clk->clk_disable(clk);
 	if (--clk->usecount == 0 && !(clk->flags & CLK_PLL) &&
 	    (clk->flags & CLK_PSC))
 		davinci_psc_config(clk->domain, clk->gpsc, clk->lpsc,
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

Re: [PATCH v2 1/3] ARM: davinci: clk framework support for enable/disable functionality

Quoted 2 lines · Philip Avinash

DAVINCI clock framework currently not supporting clock enable/disable functionality on clock nodes. In DAVINCI platform EHRPWM module requires

Wrong. clock enable/disable is supported in the DaVinci clock implementation, but just for PSC clocks.

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

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

:100644 100644 d458558... aa89e5e... M arch/arm/mach-davinci/clock.c
:100644 100644 8694b39... 1e4e836... M arch/arm/mach-davinci/clock.h

 arch/arm/mach-davinci/clock.c |    4 ++++
 arch/arm/mach-davinci/clock.h |    2 ++
 2 files changed, 6 insertions(+)
arch/arm/mach-davinci/clock.c +0 -0
index d458558..aa89e5e 100644

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

Quoted 5 lines
arch/arm/mach-davinci/clock.c +2 -0
@@ -35,6 +35,8 @@ static void __clk_enable(struct clk *clk)
 {
 	if (clk->parent)
 		__clk_enable(clk->parent);
+	if (clk->clk_enable)
+		clk->clk_enable(clk);

Why ignore usecount in this case?

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

Quoted 1 line
arch/arm/mach-davinci/clock.c +0 -0
 	if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))

if clk->enable is available, no need to check for 'clk->flags & CLK_PSC'

Thanks,
Sekhar

#3 lore raw

RE: [PATCH v2 1/3] ARM: davinci: clk framework support for enable/disable functionality

Quoted 22 lines · Sekhar
Quoted 2 lines · Philip Avinash

DAVINCI clock framework currently not supporting clock enable/disable functionality on clock nodes. In DAVINCI platform EHRPWM module requires

Wrong. clock enable/disable is supported in the DaVinci clock implementation, but just for PSC clocks.

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

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

:100644 100644 d458558... aa89e5e... M arch/arm/mach-davinci/clock.c
:100644 100644 8694b39... 1e4e836... M arch/arm/mach-davinci/clock.h

 arch/arm/mach-davinci/clock.c |    4 ++++
 arch/arm/mach-davinci/clock.h |    2 ++
 2 files changed, 6 insertions(+)
Quoted 12 lines

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

Quoted 10 lines
arch/arm/mach-davinci/clock.c +2 -0
index d458558..aa89e5e 100644
@@ -35,6 +35,8 @@ static void __clk_enable(struct clk *clk)
 {
 	if (clk->parent)
 		__clk_enable(clk->parent);
+	if (clk->clk_enable)
+		clk->clk_enable(clk);

Why ignore usecount in this case?

Will check usecount & do enable.

Quoted 4 lines

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

Quoted 2 lines
arch/arm/mach-davinci/clock.c +0 -0
 	if (clk->usecount++ == 0 && (clk->flags & CLK_PSC))

if clk->enable is available, no need to check for 'clk->flags & CLK_PSC'

I will correct it.

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar

#4 lore raw

PATCH v2 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 v1:
- TBCLK make it as actual clock with enable/disable feature.

:100644 100644 0c4a26d... dbed75c... M arch/arm/mach-davinci/da850.c
:100644 100644 de439b7... be77ce2... M arch/arm/mach-davinci/include/mach/da8xx.h

 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..dbed75c 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)
+
+void 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));
+}
+
+void 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	= tblck_enable,
+	.clk_disable	= 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 v2 2/3] arm: davinci: clock node support for ECAP & EHRPWM

Quoted 24 lines · 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 v1:
- TBCLK make it as actual clock with enable/disable feature.

:100644 100644 0c4a26d... dbed75c... M arch/arm/mach-davinci/da850.c
:100644 100644 de439b7... be77ce2... M arch/arm/mach-davinci/include/mach/da8xx.h

 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 +1 -0
index 0c4a26d..dbed75c 100644
@@ -383,6 +383,49 @@ static struct clk dsp_clk = {
 	.flags		= PSC_LRST | PSC_FORCE,
 };
 
+static struct clk ehrpwm_clk = {

arch/arm/mach-davinci/da850.c static struct clk dsp_clk = { · line 396

Quoted 10 lines
arch/arm/mach-davinci/da850.c +10 -0
+	.name		= "ehrpwm",
+	.parent		= &pll0_sysclk2,
+	.lpsc		= DA8XX_LPSC1_PWM,
+	.gpsc		= 1,
+	.flags		= DA850_CLK_ASYNC3,
+};
+
+#define DA8XX_EHRPWM_TBCLKSYNC	BIT(12)
+
+void tblck_enable(struct clk *clk)

This should be static. Also, since tbclk is associated with ehrpwm, please call the function ehrpwm_tbclk_enable().

arch/arm/mach-davinci/da850.c static struct clk dsp_clk = { · line 405

Quoted 9 lines
arch/arm/mach-davinci/da850.c +9 -0
+{
+	u32 val;
+
+	val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+	val |= DA8XX_EHRPWM_TBCLKSYNC;
+	writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+}
+
+void tblck_disable(struct clk *clk)

Same comment as above applies.

Thanks,
Sekhar

#6 lore raw

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

Quoted 24 lines · Sekhar
Quoted 23 lines · 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 v1:
- TBCLK make it as actual clock with enable/disable feature.

:100644 100644 0c4a26d... dbed75c... M arch/arm/mach-davinci/da850.c
:100644 100644 de439b7... be77ce2... M arch/arm/mach-davinci/include/mach/da8xx.h

 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 +0 -0
index 0c4a26d..dbed75c 100644
@@ -383,6 +383,49 @@ static struct clk dsp_clk = {
 	.flags		= PSC_LRST | PSC_FORCE,
 };
 
Quoted 14 lines

arch/arm/mach-davinci/da850.c static struct clk dsp_clk = { · line 396

Quoted 11 lines
arch/arm/mach-davinci/da850.c +11 -0
+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)
+
+void tblck_enable(struct clk *clk)

This should be static. Also, since tbclk is associated with ehrpwm, please call the function ehrpwm_tbclk_enable().

Ok I will correct it.

Thanks
Avinash

Quoted 16 lines

arch/arm/mach-davinci/da850.c static struct clk dsp_clk = { · line 405

Quoted 10 lines
arch/arm/mach-davinci/da850.c +9 -0
+{
+	u32 val;
+
+	val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+	val |= DA8XX_EHRPWM_TBCLKSYNC;
+	writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG));
+}
+
+void tblck_disable(struct clk *clk)

Same comment as above applies.

Thanks,
Sekhar

#7 lore raw

PATCH v2 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 same with am33xx platform and da850 has no platform specific dependency.

:100644 100644 3ec1bda... 62fd2d4... M arch/arm/boot/dts/da850.dtsi
:100644 100644 6b7a0a2... 89ee974... M arch/arm/mach-davinci/da8xx-dt.c

 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@01f00000 {
+			compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
+			#pwm-cells = <3>;
+			reg = <0x300000 0x2000>;
+			status = "disabled";
+		};
+		ehrpwm1: ehrpwm@01f02000 {
+			compatible = "ti,da850-ehrpwm", "ti,am33xx-ehrpwm";
+			#pwm-cells = <3>;
+			reg = <0x302000 0x2000>;
+			status = "disabled";
+		};
+		ecap0: ecap@01f06000 {
+			compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+			#pwm-cells = <3>;
+			reg = <0x306000 0x80>;
+			status = "disabled";
+		};
+		ecap1: ecap@01f07000 {
+			compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+			#pwm-cells = <3>;
+			reg = <0x307000 0x80>;
+			status = "disabled";
+		};
+		ecap2: ecap@01f08000 {
+			compatible = "ti,da850-ecap", "ti,am33xx-ecap";
+			#pwm-cells = <3>;
+			reg = <0x308000 0x80>;
+			status = "disabled";
+		};
 	};
 	nand_cs3@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
#8 lore raw

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

Quoted 10 lines · 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 same with am33xx platform and da850 has no platform specific dependency.

Which is fine, but I think the binding documentation still needs to be updated to document the ti,da850-ehrpwm binding. Looping Peter (it is always a good idea to CC folks who reviewed your patch last time around). Also, please Cc the DT folks and devicetree-discuss list too for their opinion.

Thanks,
Sekhar

Quoted 65 lines

:100644 100644 3ec1bda... 62fd2d4... M arch/arm/boot/dts/da850.dtsi
:100644 100644 6b7a0a2... 89ee974... M arch/arm/mach-davinci/da8xx-dt.c

 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),
 	{}
 };
 
#9 lore raw

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

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sekhar" == Sekhar Nori <[email protected]> writes:

Quoted 10 lines · Philip Avinash
Quoted 10 lines

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 same with am33xx platform and da850 has no platform specific dependency.

Sekhar> Which is fine, but I think the binding documentation still needs to be Sekhar> updated to document the ti,da850-ehrpwm binding. Looping Peter (it is Sekhar> always a good idea to CC folks who reviewed your patch last time Sekhar> around). Also, please Cc the DT folks and devicetree-discuss list too Sekhar> for their opinion.

Yes, thanks for CC'ing me. I also think da850-* should be documented. See Documentation/devicetree/bindings/gpio/8xxx_gpio.txt for an similar (old) example.

Signature · 1 line
Bye, Peter Korsgaard
#10 lore raw

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

Quoted 20 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sekhar" == Sekhar Nori <[email protected]> writes:

Quoted 10 lines · Philip Avinash
Quoted 10 lines

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 same with am33xx platform and da850 has no platform specific dependency.

Sekhar> Which is fine, but I think the binding documentation still needs to be Sekhar> updated to document the ti,da850-ehrpwm binding. Looping Peter (it is Sekhar> always a good idea to CC folks who reviewed your patch last time Sekhar> around). Also, please Cc the DT folks and devicetree-discuss list too Sekhar> for their opinion.

Quoted 3 lines

Yes, thanks for CC'ing me. I also think da850-* should be documented. See Documentation/devicetree/bindings/gpio/8xxx_gpio.txt for an similar (old) example.

Peter,

In this binding file also, only initial compatible field is updated. Later on many compatible were added in driver. But not update back to binding doc.

<Documentation/devicetree/bindings/gpio/8xxx_gpio.txt>
---

	followed by "fsl,mpc8349-gpio" for 83xx, "fsl,mpc8572-gpio" for 85xx and
	"fsl,mpc8610-gpio" for 86xx.
---
<drivers/gpio/gpio-mpc8xxx.c>
---
static struct of_device_id mpc8xxx_gpio_ids[] __initdata = {
        { .compatible = "fsl,mpc8349-gpio", },
        { .compatible = "fsl,mpc8572-gpio", },
        { .compatible = "fsl,mpc8610-gpio", },
        { .compatible = "fsl,mpc5121-gpio", .data = mpc512x_irq_set_type, },
        { .compatible = "fsl,pq3-gpio",     },
        { .compatible = "fsl,qoriq-gpio",   },
        {}
};

---

Grant/Rob,
With respect peters explanation (below), what is your opinion on adding information to binding doc for da850 support?

Peter --> if the hardware block is identical the dts should simply list:
Peter --> compatible = "ti,da850-ecap", "ti,am33xx-ecap"
Peter --> And the driver only bind to ti,am33xx-ecap (unless there ever needs to Peter --> be a da850 specific workaround.

Or
Should I update both binding doc & the driver to use new compatible option "ti,da830-ecap" (as da830 platform has initial IP support)?
Even with this, platforms da830, da850 and am33xx can reuse "ti,da830-ecap" compatible field.

Thanks
Avinash

Quoted 8 lines
Signature · 6 lines
-- 
Bye, Peter Korsgaard
_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source at linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
#11 lore raw

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

Quoted 21 lines · Avinash
Quoted 20 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sekhar" == Sekhar Nori <[email protected]> writes:

Quoted 10 lines · Philip Avinash
Quoted 10 lines

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 same with am33xx platform and da850 has no platform specific dependency.

Sekhar> Which is fine, but I think the binding documentation still needs to be Sekhar> updated to document the ti,da850-ehrpwm binding. Looping Peter (it is Sekhar> always a good idea to CC folks who reviewed your patch last time Sekhar> around). Also, please Cc the DT folks and devicetree-discuss list too Sekhar> for their opinion.

Quoted 8 lines
Quoted 3 lines

Yes, thanks for CC'ing me. I also think da850-* should be documented. See Documentation/devicetree/bindings/gpio/8xxx_gpio.txt for an similar (old) example.

Peter,

In this binding file also, only initial compatible field is updated. Later on many compatible were added in driver. But not update back to binding doc.

Probably someone forgot to keep updating the binding doc after a point.

Quoted 28 lines

<Documentation/devicetree/bindings/gpio/8xxx_gpio.txt>
---

	followed by "fsl,mpc8349-gpio" for 83xx, "fsl,mpc8572-gpio" for 85xx and
	"fsl,mpc8610-gpio" for 86xx.
---
<drivers/gpio/gpio-mpc8xxx.c>
---
static struct of_device_id mpc8xxx_gpio_ids[] __initdata = {
        { .compatible = "fsl,mpc8349-gpio", },
        { .compatible = "fsl,mpc8572-gpio", },
        { .compatible = "fsl,mpc8610-gpio", },
        { .compatible = "fsl,mpc5121-gpio", .data = mpc512x_irq_set_type, },
        { .compatible = "fsl,pq3-gpio",     },
        { .compatible = "fsl,qoriq-gpio",   },
        {}
};

---

Grant/Rob,
With respect peters explanation (below), what is your opinion on adding information to binding doc for da850 support?

Peter --> if the hardware block is identical the dts should simply list:
Peter --> compatible = "ti,da850-ecap", "ti,am33xx-ecap"
Peter --> And the driver only bind to ti,am33xx-ecap (unless there ever needs to Peter --> be a da850 specific workaround.

Quoted 4 lines

Or
Should I update both binding doc & the driver to use new compatible option "ti,da830-ecap" (as da830 platform has initial IP support)?
Even with this, platforms da830, da850 and am33xx can reuse "ti,da830-ecap" compatible field.

To me updating the driver to keep adding a .compatible even when not using it elsewhere in code is not required. Adding the new binding in .dts file is must since you may need to do something specific to da830 at a later time (and the .dtb should be considered ROM'ed so you wont be able to change it then). Adding documentation for the binding is also required to help anyone wanting to know more about the binding after reading the .dts file.

Thanks,
Sekhar

#12 lore raw

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

Quoted 66 lines · Sekhar
Quoted 21 lines · Avinash
Quoted 20 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sekhar" == Sekhar Nori <[email protected]> writes:

Quoted 10 lines · Philip Avinash
Quoted 10 lines

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 same with am33xx platform and da850 has no platform specific dependency.

Sekhar> Which is fine, but I think the binding documentation still needs to be Sekhar> updated to document the ti,da850-ehrpwm binding. Looping Peter (it is Sekhar> always a good idea to CC folks who reviewed your patch last time Sekhar> around). Also, please Cc the DT folks and devicetree-discuss list too Sekhar> for their opinion.

Quoted 8 lines
Quoted 3 lines

Yes, thanks for CC'ing me. I also think da850-* should be documented. See Documentation/devicetree/bindings/gpio/8xxx_gpio.txt for an similar (old) example.

Peter,

In this binding file also, only initial compatible field is updated. Later on many compatible were added in driver. But not update back to binding doc.

Probably someone forgot to keep updating the binding doc after a point.

Quoted 28 lines

<Documentation/devicetree/bindings/gpio/8xxx_gpio.txt>
---

	followed by "fsl,mpc8349-gpio" for 83xx, "fsl,mpc8572-gpio" for 85xx and
	"fsl,mpc8610-gpio" for 86xx.
---
<drivers/gpio/gpio-mpc8xxx.c>
---
static struct of_device_id mpc8xxx_gpio_ids[] __initdata = {
        { .compatible = "fsl,mpc8349-gpio", },
        { .compatible = "fsl,mpc8572-gpio", },
        { .compatible = "fsl,mpc8610-gpio", },
        { .compatible = "fsl,mpc5121-gpio", .data = mpc512x_irq_set_type, },
        { .compatible = "fsl,pq3-gpio",     },
        { .compatible = "fsl,qoriq-gpio",   },
        {}
};

---

Grant/Rob,
With respect peters explanation (below), what is your opinion on adding information to binding doc for da850 support?

Peter --> if the hardware block is identical the dts should simply list:
Peter --> compatible = "ti,da850-ecap", "ti,am33xx-ecap"
Peter --> And the driver only bind to ti,am33xx-ecap (unless there ever needs to Peter --> be a da850 specific workaround.

Quoted 4 lines

Or
Should I update both binding doc & the driver to use new compatible option "ti,da830-ecap" (as da830 platform has initial IP support)?
Even with this, platforms da830, da850 and am33xx can reuse "ti,da830-ecap" compatible field.

Quoted 5 lines

To me updating the driver to keep adding a .compatible even when not using it elsewhere in code is not required. Adding the new binding in .dts file is must since you may need to do something specific to da830 at a later time (and the .dtb should be considered ROM'ed so you wont be able to change it then).

Thanks for the explanation.
I will add "ti,da850-ecap" for da850.dtsi along with "ti,am33xx-ecap" as compatible fields.

Quoted 3 lines

Adding documentation for the binding is also
required to help anyone wanting to know more about the binding after reading the .dts file.

I will adding documentation part for "ti,da850-ecap".

Thanks
Avinash

Quoted 4 lines

Thanks,
Sekhar