Chris Narkiewicz [he...@ezaquarii.com] wrote:
> On Wed, Jan 29, 2020 at 10:47:28PM +0800, Nathanael Rensen wrote:
> > The diff below adds gpio(4) support to wbsio(4) for Nuvoton NCT5104D
> > (pcengines APU2).
> 
> I'm resurrecting this thread. I was looking for GPIO support for APU2
> board and found this patch in archives.
> 
> Any chance of taking it in?
> 

This is not the first patch to support gpio on wbsio, it's at least
the third, but arguably the best :)

Mark Kettenis said:

"But as before this diff does nothing to make sure it is actually
safe to touch these gpio pins.  Other machines might have the same
chip but use the pins internally to switch power to on-board
components."

A simple way to do this could be some kind of description file
specific to the board. Kind of like an FDT, but just for GPIO pins. 
GPIO Descriptor Tree?

So, when you are using an APU1/APU2, copy apu.gpiodt to /etc/gpiodt
and the kernel will load it on boot like a firmware image to decide
what pins you get access to from userland. Or maybe gpioctl would
load allowed pin use settings in rc.securelevel ?

Is this a sane way to go? If so, what attributes would be needed for
each pin? Something like user, locked, kernel?

apu.gpiodt:

gpio0@wbsio {
        hwproduct = "APU";
        pin0 = "locked";
        pin1 = "locked";
        pin2 = "locked";
        pin3 = "user";
        pin4 = "user";
        pin5 = "user";
        pin6 = "user";
        pin7 = "user";
        pin8 = "user";
        pin9 = "user";
        pin10 = "user";
        pin11 = "user";
        pin12 = "user";
        pin13 = "user";
        pin14 = "user";
        pin15 = "user";
};

Chris

Reply via email to