[linux-sunxi] Re: [PATCH] ARM: dts: sun7i: Add dts file for pcDuino 3 Nano board

2015-01-27 Thread Adam Sampson
On Tue, Jan 27, 2015 at 06:00:35PM +0100, Maxime Ripard wrote:
  How about pcduino3-nano:green:usr-led3/4? Or ...:usr1/2, and a comment
  in the .dts explaining how they're labelled on the board?
 The latter looks better yes. tx and rx would do too, if you know what
 tx and what rx we're talking about here.

I've changed it to usr1/2 with comments. (I don't know if they were
intended to be TX/RX; the documentation doesn't suggest so.)

  They're multipurpose pins on Arduino-compatible headers:
...
  So should we [...]
 None of the above, if there's no hardware default, we won't enforce
 any default either. This is a case for the DT overlays.

OK -- that simplifies it quite a bit, then. v3 of the patch incoming!

Thanks very much,

-- 
Adam Sampson a...@offog.org http://offog.org/

-- 
You received this message because you are subscribed to the Google Groups 
linux-sunxi group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH] ARM: dts: sun7i: Add dts file for pcDuino 3 Nano board

2015-01-27 Thread Maxime Ripard
On Mon, Jan 26, 2015 at 01:59:31PM +, Adam Sampson wrote:
 Hi Maxime,
 
 On Mon, Jan 26, 2015 at 11:09:21AM +0100, Maxime Ripard wrote:
  If you read Documentation/leds/leds-class.txt, the pattern to follow is:
  devicename:colour:function
  so it should rather be pcduino3-nano:green:usr1 and usr2, or some
  other thing.
 
 How about pcduino3-nano:green:usr-led3/4? Or ...:usr1/2, and a comment
 in the .dts explaining how they're labelled on the board?

The latter looks better yes. tx and rx would do too, if you know what
tx and what rx we're talking about here.

 There are a couple of other sunxi boards that have the same problem
 (multiple user-controllable LEDs of the same colour):
 
 sun4i-a10-marsboard.dts: label = marsboard:red1:usr;
 sun4i-a10-marsboard.dts: label = marsboard:red2:usr;
 sun4i-a10-marsboard.dts: label = marsboard:red3:usr;
 sun4i-a10-marsboard.dts: label = marsboard:red4:usr;
 sun9i-a80-optimus.dts: label = optimus:led2:usr;
 sun9i-a80-optimus.dts: label = optimus:led4:usr;

Thing is, it's too late for those. If we change the label, we would
break the user space scripts that might depend on these names.

   More generally, is it correct to add nodes like these (uart2, spi0,
   i2c2) for features that appear on the Arduino GPIO headers?
  If those pins are specifically dedicated to this feature, then yes.
 
 They're multipurpose pins on Arduino-compatible headers:
 http://learn.linksprite.com/wp-content/uploads/2014/10/pcDuino3-Nano_header-Model.jpg
 
 How you want them to be configured will depend on what you have plugged
 in; for example, some Arduino add-on boards will expect J11 P1/2 to be
 serial RX/TX and some will expect them to be GPIOs. So should we
 configure i2c2 etc. by default (and let the user turn them into GPIOs
 if required), or just provide the GPIOs (and require the user to adjust
 the .dts)?

None of the above, if there's no hardware default, we won't enforce
any default either. This is a case for the DT overlays.

Maxime

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

-- 
You received this message because you are subscribed to the Google Groups 
linux-sunxi group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


[linux-sunxi] Re: [PATCH] ARM: dts: sun7i: Add dts file for pcDuino 3 Nano board

2015-01-26 Thread Adam Sampson
Hi Maxime,

On Mon, Jan 26, 2015 at 11:09:21AM +0100, Maxime Ripard wrote:
 If you read Documentation/leds/leds-class.txt, the pattern to follow is:
 devicename:colour:function
 so it should rather be pcduino3-nano:green:usr1 and usr2, or some
 other thing.

How about pcduino3-nano:green:usr-led3/4? Or ...:usr1/2, and a comment
in the .dts explaining how they're labelled on the board?

There are a couple of other sunxi boards that have the same problem
(multiple user-controllable LEDs of the same colour):

sun4i-a10-marsboard.dts: label = marsboard:red1:usr;
sun4i-a10-marsboard.dts: label = marsboard:red2:usr;
sun4i-a10-marsboard.dts: label = marsboard:red3:usr;
sun4i-a10-marsboard.dts: label = marsboard:red4:usr;
sun9i-a80-optimus.dts: label = optimus:led2:usr;
sun9i-a80-optimus.dts: label = optimus:led4:usr;

I can send a patch for those if you'd like as well?

  Should there be aliases for I2C as well, since the same situation
  applies (i2c0 and i2c2)?
 Yep.

Added.

  More generally, is it correct to add nodes like these (uart2, spi0,
  i2c2) for features that appear on the Arduino GPIO headers?
 If those pins are specifically dedicated to this feature, then yes.

They're multipurpose pins on Arduino-compatible headers:
http://learn.linksprite.com/wp-content/uploads/2014/10/pcDuino3-Nano_header-Model.jpg

How you want them to be configured will depend on what you have plugged
in; for example, some Arduino add-on boards will expect J11 P1/2 to be
serial RX/TX and some will expect them to be GPIOs. So should we
configure i2c2 etc. by default (and let the user turn them into GPIOs
if required), or just provide the GPIOs (and require the user to adjust
the .dts)?

Cheers,

-- 
Adam Sampson a...@offog.org http://offog.org/

-- 
You received this message because you are subscribed to the Google Groups 
linux-sunxi group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.