All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@aj.id.au>
To: "Hergert, Nolan" <nolan.hergert@intel.com>,
	Joel Stanley <joel@jms.id.au>,
	 Patrick Williams <patrick@stwcx.xyz>
Cc: OpenBMC <openbmc@lists.ozlabs.org>
Subject: Re: GPIO offsets used by userspace
Date: Tue, 31 Jan 2017 11:42:35 +1030	[thread overview]
Message-ID: <1485825155.4137.23.camel@aj.id.au> (raw)
In-Reply-To: <20F6DE8D093BC149AEF7D895510943F51447A0ED@ORSMSX101.amr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2284 bytes --]

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
> 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 

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?

Cheers,

Andrew

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

> 
> Nolan
> 
> -----Original Message-----
> From: openbmc [mailto:openbmc-bounces+nolan.hergert=intel.com@lists.o
> zlabs.org] On Behalf Of Joel Stanley
> Sent: Monday, January 30, 2017 4:26 PM
> To: Andrew Jeffery <andrew@aj.id.au>
> Cc: OpenBMC <openbmc@lists.ozlabs.org>
> Subject: Re: GPIO offsets used by userspace
> 
> On Mon, Jan 30, 2017 at 12:04 PM, Andrew Jeffery <andrew@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@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-01-31  1:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30  1:34 GPIO offsets used by userspace Andrew Jeffery
2017-01-31  0:25 ` Joel Stanley
2017-01-31  0:50   ` Hergert, Nolan
2017-01-31  1:12     ` Andrew Jeffery [this message]
2017-01-31  1:23       ` Hergert, Nolan
2017-01-31 18:06       ` Patrick Williams
2017-01-31  1:15   ` Andrew Jeffery
2017-01-31 22:15     ` Xo Wang
2017-01-31 23:25       ` Joel Stanley
2017-02-01  1:26         ` Xo Wang
2017-02-01  2:20         ` Andrew Jeffery
2017-02-07  1:41 ` Andrew Jeffery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485825155.4137.23.camel@aj.id.au \
    --to=andrew@aj.id.au \
    --cc=joel@jms.id.au \
    --cc=nolan.hergert@intel.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=patrick@stwcx.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.