[MinnowBoard] MinnowBoard MAX getting started with GPIO

Martin Oldfield elinux-mbmx-2014-11 at mjoldfield.com
Tue Nov 11 22:58:33 UTC 2014


Hi Darren,

Thanks for your help.

John Hawley's helpful note above points to both
  http://www.elinux.org/Minnowboard:MinnowMax#Low_Speed_Expansion_.28Top.29
and
  https://github.com/MinnowBoard/minnow-max-extras/tree/master/calamari

They seem to suggest that pin 25 of JP1 should be Linux GPIO #84 and the
signal name
is GPIO_S5_4.

The gpiochip ranges in /sys don't include 84 though.

Happily I have now got it working, but I think there are still gaps in my
knowledge, 
which include understanding what 'set via the firmware lpss config' means.

Anyway, here's what I did:

If I trace pin 25 on the PDF schematic at  
http://www.elinux.org/images/f/fd/MinnowMax_RevA1_sch.pdf
it goes to pin C18 on the E3825 and is labeled GPIO_S5_2 or GPIO_S5[02].

The E3825 data sheet talks about SSUS being another name for S5 (in some
loose sense),
and if I look in the pinctrl/pinctrl-baytrail.c kernel device driver, I find
that the block of 44 GPIOs is called 'SUS'.

Following your advice I looked in /sys/kernel/debug/gpio and found that the
block of 44 GPIOs runs from 338 to 381, and so a reasonable guess might be
that pin 25 on JP1 is gpio340.

Sure enough, if I attach an LED to that pin I can make it flash with:

# echo 340 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio340/direction
# echo 0 > /sys/class/gpio/gpio340/value 
# echo 1 > /sys/class/gpio/gpio340/value 
...

I rather feel that I only got to this point by flailing around, and there
ought to be a better way.

Specifically:

1. Where do the offsets for the GPIO numbers come from ? Is this the
'firmware lpss config' ?

2. Is my Minnowboard Max unusual in some sense because my gpio340 seems to
be referred to as gpio84 elsewhere.

If anyone's got any useful advice to understand all this, I'd be most
grateful to hear it.

Thanks again to everyone who's helped me get thus far.



--
View this message in context: http://minnowboard.57273.x6.nabble.com/MinnowBoard-MinnowBoard-MAX-getting-started-with-GPIO-tp736p756.html
Sent from the MinnowBoard mailing list archive at Nabble.com.


More information about the elinux-MinnowBoard mailing list