linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add device tree data for AM33XX devices
@ 2012-08-16 12:20 AnilKumar Ch
  2012-08-16 12:20 ` [PATCH v4 1/4] arm/dts: AM33XX: Add basic pinctrl device tree data AnilKumar Ch
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: AnilKumar Ch @ 2012-08-16 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

Add pinctrl and d_can device tree data to AM33XX family of devices.
First two patches add support for pinctrl DT data and rest adds
dcan DT data.

Reason behind combining these patches is to apply cleanly on
linux-omap devel-dt tree because these are sequential patches.

These patches were tested on AM335x-Bone and AM335x-EVM apply
on linux-omap:devel-dt tree with this patch
http://lkml.org/lkml/2012/8/15/106

AnilKumar Ch (4):
  arm/dts: AM33XX: Add basic pinctrl device tree data
  arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone
  arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM
  arm/dts: AM33XX: Add D_CAN device tree data

 arch/arm/boot/dts/am335x-bone.dts |   14 ++++++++++++++
 arch/arm/boot/dts/am335x-evm.dts  |   16 ++++++++++++++++
 arch/arm/boot/dts/am33xx.dtsi     |   27 +++++++++++++++++++++++++++
 3 files changed, 57 insertions(+)

-- 
1.7.9.5

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

* [PATCH v4 1/4] arm/dts: AM33XX: Add basic pinctrl device tree data
  2012-08-16 12:20 [PATCH 0/4] Add device tree data for AM33XX devices AnilKumar Ch
@ 2012-08-16 12:20 ` AnilKumar Ch
  2012-08-16 12:20 ` [PATCH v4 2/4] arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone AnilKumar Ch
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: AnilKumar Ch @ 2012-08-16 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

Adds basic pinctrl device tree data for AM33XX family of devices.
This patch is based on the pinctrl-single driver.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
Changes from v3:
	- Updated the reg length based on latest AM335x TRM.

Changes from v2:
	- user led pinmux comments updated according to Tony's
	  comment.

Changes from v1:
	- Rebased the patches based on latest pinctrl-single driver

 arch/arm/boot/dts/am33xx.dtsi |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index dde76f7..dfe9c559 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -40,6 +40,15 @@
 		};
 	};
 
+	am3358_pinmux: pinmux at 44E10800 {
+		compatible = "pinctrl-single";
+		reg = <0x44E10800 0x0238>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-single,register-width = <32>;
+		pinctrl-single,function-mask = <0x7F>;
+	};
+
 	/*
 	 * XXX: Use a flat representation of the AM33XX interconnect.
 	 * The real AM33XX interconnect network is quite complex.Since
-- 
1.7.9.5

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

* [PATCH v4 2/4] arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone
  2012-08-16 12:20 [PATCH 0/4] Add device tree data for AM33XX devices AnilKumar Ch
  2012-08-16 12:20 ` [PATCH v4 1/4] arm/dts: AM33XX: Add basic pinctrl device tree data AnilKumar Ch
@ 2012-08-16 12:20 ` AnilKumar Ch
  2012-08-16 12:20 ` [PATCH v3 3/4] arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM AnilKumar Ch
  2012-08-16 12:20 ` [PATCH v3 4/4] arm/dts: AM33XX: Add D_CAN device tree data AnilKumar Ch
  3 siblings, 0 replies; 7+ messages in thread
From: AnilKumar Ch @ 2012-08-16 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

Adds GPIO pinctrl nodes to am3358_pinmux master node to control
user leds (USR0, USR1, USR2 and USR3) present on BeagleBone.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
 arch/arm/boot/dts/am335x-bone.dts |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index a7906cb..58f5042 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -18,6 +18,20 @@
 		reg = <0x80000000 0x10000000>; /* 256 MB */
 	};
 
+	am3358_pinmux: pinmux at 44E10800 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&userled_pins>;
+
+		userled_pins: pinmux_userled_pins {
+			pinctrl-single,pins = <
+				0x54 0x7	/* gpmc_a5.gpio1_21, OUTPUT | MODE7 */
+				0x58 0x17	/* gpmc_a6.gpio1_22, OUTPUT_PULLUP | MODE7 */
+				0x5C 0x7	/* gpmc_a7.gpio1_23, OUTPUT | MODE7 */
+				0x60 0x17	/* gpmc_a8.gpio1_24, OUTPUT_PULLUP | MODE7 */
+			>;
+		};
+	};
+
 	ocp {
 		uart1: serial at 44E09000 {
 			status = "okay";
-- 
1.7.9.5

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

* [PATCH v3 3/4] arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM
  2012-08-16 12:20 [PATCH 0/4] Add device tree data for AM33XX devices AnilKumar Ch
  2012-08-16 12:20 ` [PATCH v4 1/4] arm/dts: AM33XX: Add basic pinctrl device tree data AnilKumar Ch
  2012-08-16 12:20 ` [PATCH v4 2/4] arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone AnilKumar Ch
@ 2012-08-16 12:20 ` AnilKumar Ch
  2012-08-24 20:14   ` Tony Lindgren
  2012-08-16 12:20 ` [PATCH v3 4/4] arm/dts: AM33XX: Add D_CAN device tree data AnilKumar Ch
  3 siblings, 1 reply; 7+ messages in thread
From: AnilKumar Ch @ 2012-08-16 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

Add D_CAN1 pinctrl node to am3358_pinmux master node to export
D_CAN functionality on AM335x EVM according to pinctrl-single
driver.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
Changes from v2:
	- Incorporated Vaibhav H's comments on v2
	  * Added dcan0 instances to am33xx.dtsi file

Changes from v1:
	- These two patches separated from c_can DT support
	  patch series.

 arch/arm/boot/dts/am335x-evm.dts |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 5dd8a6b..a64c30a 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -18,6 +18,18 @@
 		reg = <0x80000000 0x10000000>; /* 256 MB */
 	};
 
+	am3358_pinmux: pinmux at 44E10800 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&d_can1_pins>;
+
+		d_can1_pins: pinmux_d_can_pins {
+			pinctrl-single,pins = <
+				0x168 0x2	/* uart0_ctsn.d_can1_tx, OUTPUT | MODE2 */
+				0x16C 0x32	/* uart0_rtsn.d_can1_rx, INPUT_PULLUP | MODE2 */
+			>;
+		};
+	};
+
 	ocp {
 		uart1: serial at 44E09000 {
 			status = "okay";
-- 
1.7.9.5

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

* [PATCH v3 4/4] arm/dts: AM33XX: Add D_CAN device tree data
  2012-08-16 12:20 [PATCH 0/4] Add device tree data for AM33XX devices AnilKumar Ch
                   ` (2 preceding siblings ...)
  2012-08-16 12:20 ` [PATCH v3 3/4] arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM AnilKumar Ch
@ 2012-08-16 12:20 ` AnilKumar Ch
  3 siblings, 0 replies; 7+ messages in thread
From: AnilKumar Ch @ 2012-08-16 12:20 UTC (permalink / raw)
  To: linux-arm-kernel

Add Bosch D_CAN controller device tree data to AM33XX dtsi
file by adding d_can device nodes with all the necessary
parameters.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
---
 arch/arm/boot/dts/am335x-evm.dts |    4 ++++
 arch/arm/boot/dts/am33xx.dtsi    |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index a64c30a..1e1fc15 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -34,5 +34,9 @@
 		uart1: serial at 44E09000 {
 			status = "okay";
 		};
+
+		dcan1: d_can at 481D0000 {
+			status = "okay";
+		};
 	};
 };
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index dfe9c559..d965137 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -177,5 +177,23 @@
 			compatible = "ti,omap3-wdt";
 			ti,hwmods = "wd_timer2";
 		};
+
+		dcan0: d_can at 481CC000 {
+			compatible = "bosch,d_can";
+			ti,hwmods = "d_can0";
+			reg = <0x481CC000 0x2000>;
+			interrupts = <52>;
+			interrupt-parent = <&intc>;
+			status = "disabled";
+		};
+
+		dcan1: d_can at 481D0000 {
+			compatible = "bosch,d_can";
+			ti,hwmods = "d_can1";
+			reg = <0x481D0000 0x2000>;
+			interrupts = <55>;
+			interrupt-parent = <&intc>;
+			status = "disabled";
+		};
 	};
 };
-- 
1.7.9.5

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

* [PATCH v3 3/4] arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM
  2012-08-16 12:20 ` [PATCH v3 3/4] arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM AnilKumar Ch
@ 2012-08-24 20:14   ` Tony Lindgren
  2012-08-28  6:21     ` Vaibhav Hiremath
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2012-08-24 20:14 UTC (permalink / raw)
  To: linux-arm-kernel

* AnilKumar Ch <anilkumar@ti.com> [120816 05:20]:
> Add D_CAN1 pinctrl node to am3358_pinmux master node to export
> D_CAN functionality on AM335x EVM according to pinctrl-single
> driver.
> 
> Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
> ---
> Changes from v2:
> 	- Incorporated Vaibhav H's comments on v2
> 	  * Added dcan0 instances to am33xx.dtsi file
> 
> Changes from v1:
> 	- These two patches separated from c_can DT support
> 	  patch series.
> 
>  arch/arm/boot/dts/am335x-evm.dts |   12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
> index 5dd8a6b..a64c30a 100644
> --- a/arch/arm/boot/dts/am335x-evm.dts
> +++ b/arch/arm/boot/dts/am335x-evm.dts
> @@ -18,6 +18,18 @@
>  		reg = <0x80000000 0x10000000>; /* 256 MB */
>  	};
>  
> +	am3358_pinmux: pinmux at 44E10800 {

This should be just &am3358_pinmux as you already include it.

> +		pinctrl-names = "default";
> +		pinctrl-0 = <&d_can1_pins>;
> +
> +		d_can1_pins: pinmux_d_can_pins {
> +			pinctrl-single,pins = <
> +				0x168 0x2	/* uart0_ctsn.d_can1_tx, OUTPUT | MODE2 */
> +				0x16C 0x32	/* uart0_rtsn.d_can1_rx, INPUT_PULLUP | MODE2 */
> +			>;
> +		};
> +	};
> +

It would better to claim these pins in the dcan driver entry
rather than set them as pins enabled by the pinctrl driver.
The reason is that in case you want to enable runtime PM related
stuff, like some more advanced wake-up features, for the rx pin
you can do it in the driver.

Then one nit.. Please lowercase all hex number in this series as that's the style
here.

Regards,

Tony

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

* [PATCH v3 3/4] arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM
  2012-08-24 20:14   ` Tony Lindgren
@ 2012-08-28  6:21     ` Vaibhav Hiremath
  0 siblings, 0 replies; 7+ messages in thread
From: Vaibhav Hiremath @ 2012-08-28  6:21 UTC (permalink / raw)
  To: linux-arm-kernel



On 8/25/2012 1:44 AM, Tony Lindgren wrote:
> * AnilKumar Ch <anilkumar@ti.com> [120816 05:20]:
>> Add D_CAN1 pinctrl node to am3358_pinmux master node to export
>> D_CAN functionality on AM335x EVM according to pinctrl-single
>> driver.
>>
>> Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
>> ---
>> Changes from v2:
>> 	- Incorporated Vaibhav H's comments on v2
>> 	  * Added dcan0 instances to am33xx.dtsi file
>>
>> Changes from v1:
>> 	- These two patches separated from c_can DT support
>> 	  patch series.
>>
>>  arch/arm/boot/dts/am335x-evm.dts |   12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
>> index 5dd8a6b..a64c30a 100644
>> --- a/arch/arm/boot/dts/am335x-evm.dts
>> +++ b/arch/arm/boot/dts/am335x-evm.dts
>> @@ -18,6 +18,18 @@
>>  		reg = <0x80000000 0x10000000>; /* 256 MB */
>>  	};
>>  
>> +	am3358_pinmux: pinmux at 44E10800 {
> 
> This should be just &am3358_pinmux as you already include it.
> 

I think it won't work this way, it will result into syntax error.
The reason being is, unlike OMAP (and like other platforms, like, imx)
here we are again representing device hierarchy starting from root,

am335x-evm.dts:
/ {

	ocp {
		...
	};

};

Although I am not too familiar with DTS compiler, but below code results
in syntax error:

am335x-evm.dts:
/ {

	ocp {
		...
		&am3358_pinmux {
			...
		};
	};

};


Thanks,
Vaibhav

>> +		pinctrl-names = "default";
>> +		pinctrl-0 = <&d_can1_pins>;
>> +
>> +		d_can1_pins: pinmux_d_can_pins {
>> +			pinctrl-single,pins = <
>> +				0x168 0x2	/* uart0_ctsn.d_can1_tx, OUTPUT | MODE2 */
>> +				0x16C 0x32	/* uart0_rtsn.d_can1_rx, INPUT_PULLUP | MODE2 */
>> +			>;
>> +		};
>> +	};
>> +
> 
> It would better to claim these pins in the dcan driver entry
> rather than set them as pins enabled by the pinctrl driver.
> The reason is that in case you want to enable runtime PM related
> stuff, like some more advanced wake-up features, for the rx pin
> you can do it in the driver.
> 
> Then one nit.. Please lowercase all hex number in this series as that's the style
> here.
> 
> Regards,
> 
> Tony
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
> 

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

end of thread, other threads:[~2012-08-28  6:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16 12:20 [PATCH 0/4] Add device tree data for AM33XX devices AnilKumar Ch
2012-08-16 12:20 ` [PATCH v4 1/4] arm/dts: AM33XX: Add basic pinctrl device tree data AnilKumar Ch
2012-08-16 12:20 ` [PATCH v4 2/4] arm/dts: AM33XX: Configure pinmuxs for user leds control on Bone AnilKumar Ch
2012-08-16 12:20 ` [PATCH v3 3/4] arm/dts: AM33XX: Configure pinmuxs for D_CAN1 on AM335x-EVM AnilKumar Ch
2012-08-24 20:14   ` Tony Lindgren
2012-08-28  6:21     ` Vaibhav Hiremath
2012-08-16 12:20 ` [PATCH v3 4/4] arm/dts: AM33XX: Add D_CAN device tree data AnilKumar Ch

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