GPIO offsets used by userspace

Hergert, Nolan nolan.hergert at intel.com
Tue Jan 31 11:50:00 AEDT 2017


Correct me if I'm wrong, but I think the maintainers are moving away from literal gpio numbers to named descriptors ("disk_led") in the device tree, as we're moving to more dynamic hardware https://lwn.net/Articles/533632/. Linus Walleij's talk was helpful  for me too: http://elinux.org/images/9/9b/GPIO_for_Engineers_and_Makers.pdf 

Nolan

-----Original Message-----
From: openbmc [mailto:openbmc-bounces+nolan.hergert=intel.com at lists.ozlabs.org] On Behalf Of Joel Stanley
Sent: Monday, January 30, 2017 4:26 PM
To: Andrew Jeffery <andrew at aj.id.au>
Cc: OpenBMC <openbmc at lists.ozlabs.org>
Subject: Re: GPIO offsets used by userspace

On Mon, Jan 30, 2017 at 12:04 PM, Andrew Jeffery <andrew at aj.id.au> wrote:
> Hi all,
>
> Just a heads up that when the linked patch is pulled into the OpenBMC 
> kernel it will break our userspace. We will need to synchronise the 
> kernel bump with the fixes for the machine configs to update the magic 
> GPIO offset number.
>
> https://lkml.org/lkml/2017/1/26/786
>
> The magic offset is essentially 512-(ngpios) (I don't know why, but 
> that's the behaviour), and this now varies between AST2400 and AST2500 
> systems due to the AST2500 having an extra bank, and also because the
> AST2400 has a "hole" at the end of its GPIO number space.

Can you suggest a way to detect this from userspace?

Would using the chardev api make this easier?

Cheers,

Joel
_______________________________________________
openbmc mailing list
openbmc at lists.ozlabs.org
https://lists.ozlabs.org/listinfo/openbmc


More information about the openbmc mailing list