diff mbox

[3/3] ARM: dts: omap4-sdp: add dynamic pin states for uart3/4

Message ID 1374061312-25469-4-git-send-email-grygorii.strashko@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Grygorii Strashko July 17, 2013, 11:41 a.m. UTC
Add dynamic "active"/"idle" pin states for uart3/4 which will be applied
when uart3/4 state is switched from active to idle and back by Runtime
PM or during system suspend.

CC: Benoit Cousson <benoit.cousson@linaro.org>
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 arch/arm/boot/dts/omap4-sdp.dts |   34 ++++++++++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

Comments

Tony Lindgren July 17, 2013, 3:32 p.m. UTC | #1
* Grygorii Strashko <grygorii.strashko@ti.com> [130717 04:49]:
> Add dynamic "active"/"idle" pin states for uart3/4 which will be applied
> when uart3/4 state is switched from active to idle and back by Runtime
> PM or during system suspend.

This is good for testing code, but should not be merged because
omap4 has the iopad wake-ups available for uarts. So those can
be always enabled.
 
> --- a/arch/arm/boot/dts/omap4-sdp.dts
> +++ b/arch/arm/boot/dts/omap4-sdp.dts
> @@ -181,18 +181,40 @@
>  		pinctrl-single,pins = <
>  			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart3_cts_rctx.uart3_cts_rctx */
>  			0x102 (PIN_OUTPUT | MUX_MODE0)		/* uart3_rts_sd.uart3_rts_sd */
> -			0x104 (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
>  			0x106 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
>  		>;
>  	};

This just need to become:
		pinctrl-single,pins = <
			...
			0x104 (WAKEUP_EN | PIN_INPUT_MUX_MODE0)	/* uart3_rx_irrx.uart3_rx_irrx */
			...
		>;
		interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
	};

And so on. For am33xx you need to remux things to GPIO for the wake-up
events, so you should maybe test on that instead.

Regards,

Tony
Grygorii Strashko July 17, 2013, 4:41 p.m. UTC | #2
Hi,

On 07/17/2013 06:32 PM, Tony Lindgren wrote:
> * Grygorii Strashko <grygorii.strashko@ti.com> [130717 04:49]:
>> Add dynamic "active"/"idle" pin states for uart3/4 which will be applied
>> when uart3/4 state is switched from active to idle and back by Runtime
>> PM or during system suspend.
>
> This is good for testing code, but should not be merged because
> omap4 has the iopad wake-ups available for uarts. So those can
> be always enabled.

In this case, 2 IRQ will be received per each UART RX event - one from
PRCM and from UART - and that's not good from PM perspective (It will
affect on CPUIdle and CPUFreq at least).

-- log when wake-up enabled always
106:        729          0       GIC 106  OMAP UART2
115:         13          0       GIC 115  mmc0
118:         68          0       GIC 118  mmc1
151:          0          0       GIC 151  twl6040
361:        322          0      PRCM  hwmod_io
             ^^^^
-- log when wake-up enabled only when UART3 (console) is active
106:       1104          0       GIC 106  OMAP UART2
115:         13          0       GIC 115  mmc0
118:         68          0       GIC 118  mmc1
151:          0          0       GIC 151  twl6040
361:          7          0      PRCM  hwmod_io

The same is valid for all devices which will leave WAKEUP_EN set
all the time (

>
>> --- a/arch/arm/boot/dts/omap4-sdp.dts
>> +++ b/arch/arm/boot/dts/omap4-sdp.dts
>> @@ -181,18 +181,40 @@
>>   		pinctrl-single,pins = <
>>   			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart3_cts_rctx.uart3_cts_rctx */
>>   			0x102 (PIN_OUTPUT | MUX_MODE0)		/* uart3_rts_sd.uart3_rts_sd */
>> -			0x104 (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
>>   			0x106 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
>>   		>;
>>   	};
>
> This just need to become:
> 		pinctrl-single,pins = <
> 			...
> 			0x104 (WAKEUP_EN | PIN_INPUT_MUX_MODE0)	/* uart3_rx_irrx.uart3_rx_irrx */
> 			...
> 		>;
> 		interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
> 	};
>
> And so on. For am33xx you need to remux things to GPIO for the wake-up
> events, so you should maybe test on that instead.
>
> Regards,
>
> Tony
>

Regards,
- grygorii
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index 7951b4e..2624504 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -181,18 +181,40 @@ 
 		pinctrl-single,pins = <
 			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart3_cts_rctx.uart3_cts_rctx */
 			0x102 (PIN_OUTPUT | MUX_MODE0)		/* uart3_rts_sd.uart3_rts_sd */
-			0x104 (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
 			0x106 (PIN_OUTPUT | MUX_MODE0)		/* uart3_tx_irtx.uart3_tx_irtx */
 		>;
 	};
 
+	uart3_pins_active: pinmux_uart3_pins_active {
+		pinctrl-single,pins = <
+			0x104 (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+		>;
+	};
+
+	uart3_pins_idle: pinmux_uart3_pins_idle {
+		pinctrl-single,pins = <
+			0x104 (WAKEUP_EN | PIN_INPUT | MUX_MODE0)	/* uart3_rx_irrx.uart3_rx_irrx */
+		>;
+	};
+
 	uart4_pins: pinmux_uart4_pins {
 		pinctrl-single,pins = <
-			0x11c (PIN_INPUT | MUX_MODE0)		/* uart4_rx.uart4_rx */
 			0x11e (PIN_OUTPUT | MUX_MODE0)		/* uart4_tx.uart4_tx */
 		>;
 	};
 
+	uart4_pins_active: pinmux_uart4_pins_active {
+		pinctrl-single,pins = <
+			0x11c (PIN_INPUT | MUX_MODE0)		/* uart3_rx_irrx.uart3_rx_irrx */
+		>;
+	};
+
+	uart4_pins_idle: pinmux_uart4_pins_idle {
+		pinctrl-single,pins = <
+			0x11c (WAKEUP_EN | PIN_INPUT | MUX_MODE0)	/* uart3_rx_irrx.uart3_rx_irrx */
+		>;
+	};
+
 	twl6030_pins: pinmux_twl6030_pins {
 		pinctrl-single,pins = <
 			0x15e (WAKEUP_EN | PIN_INPUT_PULLUP | MUX_MODE0)	/* sys_nirq1.sys_nirq1 */
@@ -510,13 +532,17 @@ 
 };
 
 &uart3 {
-	pinctrl-names = "default";
+	pinctrl-names = "default", "active", "idle";
 	pinctrl-0 = <&uart3_pins>;
+	pinctrl-1 = <&uart3_pins_active>;
+	pinctrl-2 = <&uart3_pins_idle>;
 };
 
 &uart4 {
-	pinctrl-names = "default";
+	pinctrl-names = "default", "active", "idle";
 	pinctrl-0 = <&uart4_pins>;
+	pinctrl-1 = <&uart4_pins_active>;
+	pinctrl-2 = <&uart4_pins_idle>;
 };
 
 &mcbsp3 {