GPIO offsets used by userspace

Hergert, Nolan nolan.hergert at
Tue Jan 31 12:23:13 AEDT 2017

-----Original Message-----
From: Andrew Jeffery [mailto:andrew at] 
Sent: Monday, January 30, 2017 5:13 PM
To: Hergert, Nolan <nolan.hergert at>; Joel Stanley <joel at>; Patrick Williams <patrick at>
Cc: OpenBMC <openbmc at>
Subject: Re: GPIO offsets used by userspace

Hi Nolan!

On Tue, 2017-01-31 at 00:50 +0000, Hergert, Nolan wrote:
> 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 
> Linus Walleij's talk was helpful  
> for me too:

You're right, and that's what we should be aiming for if someone has the time to do the work. In the short term, we *can* just change the hacky offset numbers that already exist in the userspace to work around the problem. It's distasteful, but not worse than what we already have.

Patrick: Did you have any plans for reworking the userspace bits?



PS: please try to reply in-line rather than top-posting, that way the context of the conversation is a bit easier to track.

Glad to, thanks for the heads up. 

> Nolan
> -----Original Message-----
> From: openbmc [ at lists.o
>] On Behalf Of Joel Stanley
> Sent: Monday, January 30, 2017 4:26 PM
> To: Andrew Jeffery <andrew at>
> Cc: OpenBMC <openbmc at>
> Subject: Re: GPIO offsets used by userspace
> On Mon, Jan 30, 2017 at 12:04 PM, Andrew Jeffery <andrew at>
> 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.
> > 
> >
> > 
> > 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

More information about the openbmc mailing list