Hi all,
We have several pieces of software that make use of the /sys/class/gpio userspace interface to the GPIO subsystem.
One important prerequisite to being able to use the userspace GPIO interface is to be able to put the corresponding package pins into GPIO mode, by modifying the chip's mux settings.
With Fedora 19 on the Pandaboard, we were able to achieve this by poking around in /sys/kernel/debug/omap_mux. However, when running Fedora 20, this directory is empty. My assumption is that this functionality has been subsumed by the pinctrl subsystem in recent kernels. Unfortunately, there doesn't seem to be any documented userspace API.
I'd greatly appreciate it if someone could give me some pointers about how to deal with this issue!
Many thanks,
Peter
Hi Peter,
We have several pieces of software that make use of the /sys/class/gpio userspace interface to the GPIO subsystem.
One important prerequisite to being able to use the userspace GPIO interface is to be able to put the corresponding package pins into GPIO mode, by modifying the chip's mux settings.
With Fedora 19 on the Pandaboard, we were able to achieve this by poking around in /sys/kernel/debug/omap_mux. However, when running Fedora 20, this directory is empty. My assumption is that this functionality has been subsumed by the pinctrl subsystem in recent kernels. Unfortunately, there doesn't seem to be any documented userspace API.
I'd greatly appreciate it if someone could give me some pointers about how to deal with this issue!
Recently, sorry don't remember which kernel, most of the gpio stuff moved over to the gpiolib interface which changed some of the user space access but it at least appears to be documented in Documentation/gpio/sysfs.txt and at least on my Panda-es running 3.15rc3 there is /sys/class/gpio/export interface which is I suspect what you'll
From the pinctl PoV looking at a presentation [1] on the topic I'm not
sure there is a userspace API yet according to page 18, although there's been quite some water under the bridge since 3.9 but it might be that the gpiolib stuff above is all you need.
But if you do need the pinctrl stuff there's a bunch of options in /sys/kernel/debug/pinctrl/ and the files in there map out how the pins are currently mapped and there's means to change them there too.
I've not had time to play with any of the above but hopefully it gives you enough of a start/help.
Peter
[1] http://www.df.lth.se/~triad/papers/pincontrol-gpio-update.pdf
On 2014-04-30 10:45, Peter Robinson wrote:
Hi Peter,
We have several pieces of software that make use of the /sys/class/gpio userspace interface to the GPIO subsystem.
One important prerequisite to being able to use the userspace GPIO interface is to be able to put the corresponding package pins into GPIO mode, by modifying the chip's mux settings.
With Fedora 19 on the Pandaboard, we were able to achieve this by poking around in /sys/kernel/debug/omap_mux. However, when running Fedora 20, this directory is empty. My assumption is that this functionality has been subsumed by the pinctrl subsystem in recent kernels. Unfortunately, there doesn't seem to be any documented userspace API.
I'd greatly appreciate it if someone could give me some pointers about how to deal with this issue!
Recently, sorry don't remember which kernel, most of the gpio stuff moved over to the gpiolib interface which changed some of the user space access but it at least appears to be documented in Documentation/gpio/sysfs.txt and at least on my Panda-es running 3.15rc3 there is /sys/class/gpio/export interface which is I suspect what you'll
Yes, we're already using the /sys/class/gpio interface for all our GPIO stuff. It does everything we need it to do -- other than change pinmux settings to make the GPIOs actually work.
From the pinctl PoV looking at a presentation [1] on the topic I'm not sure there is a userspace API yet according to page 18, although there's been quite some water under the bridge since 3.9 but it might be that the gpiolib stuff above is all you need.
But if you do need the pinctrl stuff there's a bunch of options in /sys/kernel/debug/pinctrl/ and the files in there map out how the pins are currently mapped and there's means to change them there too.
Hmm, yes, I found the /sys/kernel/debug/pinctrl interface, but I can't find any documentation *at all* about what can be written into those files to change the configuration, despite extensive googling. Do you know of any documentation or examples? Or is the only option to read the kernel sources?
Thanks,
Peter
Hi Peter,
We have several pieces of software that make use of the /sys/class/gpio userspace interface to the GPIO subsystem.
One important prerequisite to being able to use the userspace GPIO interface is to be able to put the corresponding package pins into GPIO mode, by modifying the chip's mux settings.
With Fedora 19 on the Pandaboard, we were able to achieve this by poking around in /sys/kernel/debug/omap_mux. However, when running Fedora 20, this directory is empty. My assumption is that this functionality has been subsumed by the pinctrl subsystem in recent kernels. Unfortunately, there doesn't seem to be any documented userspace API.
I'd greatly appreciate it if someone could give me some pointers about how to deal with this issue!
Recently, sorry don't remember which kernel, most of the gpio stuff moved over to the gpiolib interface which changed some of the user space access but it at least appears to be documented in Documentation/gpio/sysfs.txt and at least on my Panda-es running 3.15rc3 there is /sys/class/gpio/export interface which is I suspect what you'll
Yes, we're already using the /sys/class/gpio interface for all our GPIO stuff. It does everything we need it to do -- other than change pinmux settings to make the GPIOs actually work.
From the pinctl PoV looking at a presentation [1] on the topic I'm not sure there is a userspace API yet according to page 18, although there's been quite some water under the bridge since 3.9 but it might be that the gpiolib stuff above is all you need.
But if you do need the pinctrl stuff there's a bunch of options in /sys/kernel/debug/pinctrl/ and the files in there map out how the pins are currently mapped and there's means to change them there too.
Hmm, yes, I found the /sys/kernel/debug/pinctrl interface, but I can't find any documentation *at all* about what can be written into those files to change the configuration, despite extensive googling. Do you know of any documentation or examples? Or is the only option to read the kernel sources?
I'm not aware of anything else other than the pdf I referenced above and the kernel documentation like pinctrl.txt gpio/* etc.
Peter
On 2014-04-29 10:36, Peter TB Brett wrote:
Hi all,
We have several pieces of software that make use of the /sys/class/gpio userspace interface to the GPIO subsystem.
One important prerequisite to being able to use the userspace GPIO interface is to be able to put the corresponding package pins into GPIO mode, by modifying the chip's mux settings.
With Fedora 19 on the Pandaboard, we were able to achieve this by poking around in /sys/kernel/debug/omap_mux. However, when running Fedora 20, this directory is empty. My assumption is that this functionality has been subsumed by the pinctrl subsystem in recent kernels. Unfortunately, there doesn't seem to be any documented userspace API.
I'd greatly appreciate it if someone could give me some pointers about how to deal with this issue!
I'm still looking for a solution to this problem!
Is there any way that I can simply amend the device tree in order to change a couple of mux settings?
I've figured out that I would need a stanza that looks something like:
&omap4_pmx_core { foo_pins: pinmux_foo_pins { pinctrl-single,pins = < 0x5e (PIN_INPUT | MUX_MODE3) /* gpmc_ad15.gpio_39 */ /* IRQ */ 0x12e (PIN_INPUT | MUX_MODE3) /* i2c4_scl.gpio_132 */ /* RST */ }; };
But I can't work out what else I need to modify in order for these mux settings to take effect.
Thanks for any pointers!
Peter
We have several pieces of software that make use of the /sys/class/gpio userspace interface to the GPIO subsystem.
One important prerequisite to being able to use the userspace GPIO interface is to be able to put the corresponding package pins into GPIO mode, by modifying the chip's mux settings.
With Fedora 19 on the Pandaboard, we were able to achieve this by poking around in /sys/kernel/debug/omap_mux. However, when running Fedora 20, this directory is empty. My assumption is that this functionality has been subsumed by the pinctrl subsystem in recent kernels. Unfortunately, there doesn't seem to be any documented userspace API.
I'd greatly appreciate it if someone could give me some pointers about how to deal with this issue!
I'm still looking for a solution to this problem!
Is there any way that I can simply amend the device tree in order to change a couple of mux settings?
Not at the moment. Basically as it stands you'll need to patch the appropriate .dts and recompile the device tree. There's been a number of proposals surrounding DT overlays but to date none have made them upstream.
There was one for the BeagleBone for support of different cape combinations and I've seen at least one other. It involves both kernel and DTC (compiler) changed but until something stable lands upstream it's not something that's easy for us to support in Fedora.
I've figured out that I would need a stanza that looks something like:
&omap4_pmx_core { foo_pins: pinmux_foo_pins { pinctrl-single,pins = < 0x5e (PIN_INPUT | MUX_MODE3) /* gpmc_ad15.gpio_39 */ /* IRQ */ 0x12e (PIN_INPUT | MUX_MODE3) /* i2c4_scl.gpio_132 */ /* RST */ }; };
But I can't work out what else I need to modify in order for these mux settings to take effect.
Basically you'll need to work out where it needs to go in the existing .dts/.dtsi files, patch it and rebuild the .dtb
Peter