All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: at91/dt: fixes dbgu pinctrl, set pullup on rx, clear pullup on tx
@ 2015-09-07 15:22 Sylvain Rochet
  2015-09-07 16:38 ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Sylvain Rochet @ 2015-09-07 15:22 UTC (permalink / raw)
  To: linux-arm-kernel

Remove pullup on dbgu DTXD signal, it is a push-pull output thus the
pullup only increase power consumption while transmitting with no value
added.

Add pullup on dbgu DRXD signal, it prevents the DRXD signal to be left
floating and so consuming a useless extra amount of power if nothing is
externally connected to dbgu.

Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
---
 arch/arm/boot/dts/at91rm9200.dtsi  | 4 ++--
 arch/arm/boot/dts/at91sam9260.dtsi | 4 ++--
 arch/arm/boot/dts/at91sam9261.dtsi | 4 ++--
 arch/arm/boot/dts/at91sam9263.dtsi | 4 ++--
 arch/arm/boot/dts/at91sam9g45.dtsi | 2 +-
 arch/arm/boot/dts/at91sam9n12.dtsi | 4 ++--
 arch/arm/boot/dts/at91sam9rl.dtsi  | 4 ++--
 arch/arm/boot/dts/at91sam9x5.dtsi  | 4 ++--
 arch/arm/boot/dts/sama5d3.dtsi     | 4 ++--
 arch/arm/boot/dts/sama5d4.dtsi     | 4 ++--
 10 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
index 60edd8b..12815f6d 100644
--- a/arch/arm/boot/dts/at91rm9200.dtsi
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -481,8 +481,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA30 periph A */
-							 AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PA31 periph with pullup */
+							<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PA30 periph A with pullup */
+							 AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA31 periph */
 					};
 				};
 
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index be9c027..f33902d 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -412,8 +412,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB14 periph A */
-							 AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PB15 periph with pullup */
+							<AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PB14 periph A with pullup */
+							 AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB15 periph */
 					};
 				};
 
diff --git a/arch/arm/boot/dts/at91sam9261.dtsi b/arch/arm/boot/dts/at91sam9261.dtsi
index ce1e3e9..f667bb9 100644
--- a/arch/arm/boot/dts/at91sam9261.dtsi
+++ b/arch/arm/boot/dts/at91sam9261.dtsi
@@ -302,8 +302,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOA 9  AT91_PERIPH_A AT91_PINCTRL_NONE>,
-							<AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
+							<AT91_PIOA 9  AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
+							<AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE>;
 					};
 				};
 
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index f1f5fa3..97a501a 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -412,8 +412,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOC 30 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PC30 periph A */
-							 AT91_PIOC 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PC31 periph with pullup */
+							<AT91_PIOC 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PC30 periph A with pullup */
+							 AT91_PIOC 31 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PC31 periph */
 					};
 				};
 
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 18b8b9e..41b87b6 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -478,7 +478,7 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB12 periph A */
+							<AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PB12 periph A with pullup */
 							 AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB13 periph A */
 					};
 				};
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 32bc9a1..48dc782 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -500,8 +500,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA9 periph A */
-							 AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PA10 periph with pullup */
+							<AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PA9 periph A with pullup */
+							 AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA10 periph */
 					};
 				};
 
diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi
index a0b90ae..ec14c9e 100644
--- a/arch/arm/boot/dts/at91sam9rl.dtsi
+++ b/arch/arm/boot/dts/at91sam9rl.dtsi
@@ -442,8 +442,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOA 21 AT91_PERIPH_A AT91_PINCTRL_NONE>,
-							<AT91_PIOA 22 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
+							<AT91_PIOA 21 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
+							<AT91_PIOA 22 AT91_PERIPH_A AT91_PINCTRL_NONE>;
 					};
 				};
 
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 747d8f0..92378a7 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -460,8 +460,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA9 periph A */
-							 AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PA10 periph A with pullup */
+							<AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PA9 periph A with pullup */
+							 AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA10 periph A */
 					};
 				};
 
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index 7fa2765..ad686673 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -545,8 +545,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOB 30 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PB30 periph A */
-							 AT91_PIOB 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PB31 periph A with pullup */
+							<AT91_PIOB 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PB30 periph A with pullup */
+							 AT91_PIOB 31 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PB31 periph A */
 					};
 				};
 
diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi
index 8d1de29..76f06e0 100644
--- a/arch/arm/boot/dts/sama5d4.dtsi
+++ b/arch/arm/boot/dts/sama5d4.dtsi
@@ -1441,8 +1441,8 @@
 				dbgu {
 					pinctrl_dbgu: dbgu-0 {
 						atmel,pins =
-							<AT91_PIOB 24 AT91_PERIPH_A AT91_PINCTRL_NONE>,     /* conflicts with D14 and TDI */
-							<AT91_PIOB 25 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;  /* conflicts with D15 and TDO */
+							<AT91_PIOB 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* conflicts with D14 and TDI */
+							 AT91_PIOB 25 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* conflicts with D15 and TDO */
 					};
 				};
 
-- 
2.5.1

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

* [PATCH] ARM: at91/dt: fixes dbgu pinctrl, set pullup on rx, clear pullup on tx
  2015-09-07 15:22 [PATCH] ARM: at91/dt: fixes dbgu pinctrl, set pullup on rx, clear pullup on tx Sylvain Rochet
@ 2015-09-07 16:38 ` Alexandre Belloni
  2015-09-08 14:16   ` Sylvain Rochet
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2015-09-07 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 07/09/2015 at 17:22:08 +0200, Sylvain Rochet wrote :
> Remove pullup on dbgu DTXD signal, it is a push-pull output thus the
> pullup only increase power consumption while transmitting with no value
> added.
> 
> Add pullup on dbgu DRXD signal, it prevents the DRXD signal to be left
> floating and so consuming a useless extra amount of power if nothing is
> externally connected to dbgu.
> 
> Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com>
> ---
>  arch/arm/boot/dts/at91rm9200.dtsi  | 4 ++--
>  arch/arm/boot/dts/at91sam9260.dtsi | 4 ++--
>  arch/arm/boot/dts/at91sam9261.dtsi | 4 ++--
>  arch/arm/boot/dts/at91sam9263.dtsi | 4 ++--
>  arch/arm/boot/dts/at91sam9g45.dtsi | 2 +-
>  arch/arm/boot/dts/at91sam9n12.dtsi | 4 ++--
>  arch/arm/boot/dts/at91sam9rl.dtsi  | 4 ++--
>  arch/arm/boot/dts/at91sam9x5.dtsi  | 4 ++--
>  arch/arm/boot/dts/sama5d3.dtsi     | 4 ++--
>  arch/arm/boot/dts/sama5d4.dtsi     | 4 ++--
>  10 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
> index 60edd8b..12815f6d 100644
> --- a/arch/arm/boot/dts/at91rm9200.dtsi
> +++ b/arch/arm/boot/dts/at91rm9200.dtsi
> @@ -481,8 +481,8 @@
>  				dbgu {
>  					pinctrl_dbgu: dbgu-0 {
>  						atmel,pins =
> -							<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_NONE	/* PA30 periph A */
> -							 AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;	/* PA31 periph with pullup */
> +							<AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_PULL_UP	/* PA30 periph A with pullup */
> +							 AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE>;	/* PA31 periph */

I would prefer dropping those useless (and sometimes wrong) comments
when reworking the pinctrl. This is also valid for 2/2

Else, the change makes sense.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [PATCH] ARM: at91/dt: fixes dbgu pinctrl, set pullup on rx, clear pullup on tx
  2015-09-07 16:38 ` Alexandre Belloni
@ 2015-09-08 14:16   ` Sylvain Rochet
  0 siblings, 0 replies; 3+ messages in thread
From: Sylvain Rochet @ 2015-09-08 14:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, Sep 07, 2015 at 06:38:59PM +0200, Alexandre Belloni wrote:
> On 07/09/2015 at 17:22:08 +0200, Sylvain Rochet wrote :
> > Remove pullup on dbgu DTXD signal, it is a push-pull output thus the
> > pullup only increase power consumption while transmitting with no value
> > added.
> > 
> > Add pullup on dbgu DRXD signal, it prevents the DRXD signal to be left
> > floating and so consuming a useless extra amount of power if nothing is
> > externally connected to dbgu.
> 
> I would prefer dropping those useless (and sometimes wrong) comments
> when reworking the pinctrl. This is also valid for 2/2

I fully agree, will do.


> Else, the change makes sense.

Before sending v2, I noticed something which should be taken into 
account.

I am lucky enough to currently have on my desk a PCB with almost all 
SAMA5D31 muxed pins not connected to anything and here are my 
consumption measurement will "all" muxed pads set to GPIO in multiple 
configurations of direction and pull-down/pull-up:

Pads are set in a modified boot loader which doesn't do anything after 
setting the pads, clocks are still enabled as well as MPDDRC and 
Nandflash, so we are sure that we don't have peripherals on floating 
wires.

all 160 PIO output, set low,  pull up enabled:            76.57 mA
all 160 PIO output, set low,  pull down enabled:          76.56 mA  
all 160 PIO output, set high, pull down enabled:          76.72 mA
all 160 PIO output, set high, pull up enabled:            76.68 mA
all 160 PIO output, set low,  pull up and down disabled:  78.22 mA
all 160 PIO output, set high, pull up and down disabled:  78.60 mA
 ( all 160 PIO input, pull up enabled:                    77.78 mA )

(that's not exactly 160, that's 160 minus DRXD, DTXD, 4 leds clamped to
low, and ALE CLE nandflash pads clamped as well).

Those results are a bit surprising, we would expect a higher power 
consumption when output value and pull-something do not match of about 
160*3.3/70000 = 7.5 mA. We also would expect that disabling pull up and 
pull down will reduce current consumption on a push pull output instead 
of increasing. The PIO simplified schematics in datasheet does not have 
a clue that could explain this behavior.

Atmel guys, could you confirm that a pad currently driven with a 
push-pull output (either with peripheral or pio) stage automatically 
disengage any pull up or pull down set and could you confirm that 
manually disabling pull up and pull down on an output port actually 
increase (10 ?A/pad) power consumption ?

Sylvain

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

end of thread, other threads:[~2015-09-08 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-07 15:22 [PATCH] ARM: at91/dt: fixes dbgu pinctrl, set pullup on rx, clear pullup on tx Sylvain Rochet
2015-09-07 16:38 ` Alexandre Belloni
2015-09-08 14:16   ` Sylvain Rochet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.