[Arm-netbook] Testing: GPIO

Luke Kenneth Casson Leighton lkcl at lkcl.net
Tue May 15 21:30:20 BST 2018

crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68

On Tue, May 15, 2018 at 9:14 PM, Richard Wilbur
<richard.wilbur at gmail.com> wrote:
> On May 14, 2018, at 12:24, Luke Kenneth Casson Leighton <lkcl at lkcl.net> wrote:
>> Look up sunxi-tools fex2bin bin2fex and wiki sunxi fex.
> I did look up and read some about those topics--and I will read more!
> What I'm wondering is what does the script.bin configure presently at
> boot?

 whatever you ask it to.  it's the exact analogous equivalent of device-tree.

>  Then I can figure out whether we need to change it in order to
> be able to test the GPIO pins.  With sunxi 3.4 kernel it looks like
> whatever we have configured in script.bin is what we have to work with
> on that load of the gpio-sunxi kernel module so I'm interested in
> making sure the GPIO pins we want to test are configured into the
> /sys/class/gpio namespace, and at what names they appear.
> I read in the sunxi GPIO wiki page[1] that script.bin can specify the
> mapping between the GPIO number NNN and PORT:BIT that determines the
> sysfs name /sys/class/gpio/gpioNNN_PORTBIT brought about by
> sudo echo NNN >/sys/class/gpio/export
> # A request to export control over gpio mapping NNN (as defined in
> script.bin) from kernel space to user space.


> So, to track down the pins we want, we need to know the mapping that
> is currently in script.bin (or specify it ourselves).

 yyep.  that means looking at the schematic DS113 PDF (oh, you have
the A20 pin names already don't you?), so just... drop those into the
fex gpio section, and as long as CONFIG_SUNXI_GPIO is enabled on
kernel compiles they'll get dropped into /sys/class/gpio as expected.

> There is a scheme outlined in the sunxi GPIO wiki page[1] for
> associating the numbers NNN with PORT:BIT that is followed on the
> A20/PIO page[2] and seems useful as it is consistent and reversible.
> So if we haven't already created a version of script.bin (for the
> sunxi-gpio module) that maps the A20's Programmable Input/Output pins
> for the DS113 card, I'd recommend we follow that scheme.
> NNN := (PORT - 'A') * 32 + BIT
> PORT:BIT  NNN  sysfs
> PI11  267  gpio267_pi11
> PI10  266  gpio266_pi10
> PI13  269  gpio269_pi13
> PI12  268  gpio268_pi12
> PI3  259  gpio259_pi3
> PB4   36  gpio36_pb4
> PH0  224  gpio224_ph0
> PB3   35  gpio35_pb3

 ok - hum i need to send you that card, don't i.  you'll be able to
try this out.


More information about the arm-netbook mailing list