On Sun, Jun 29, 2014 at 12:31:16AM -0700, patrick keshishian wrote:
> On 6/29/14, Benjamin Baier <program...@netzbasis.de> wrote:
> > You can set the default securelevel in /etc/rc.securelevel.
> > The "logic behind that" is described in securelevel(7).
> 
> locking down pins when/if another device driver is attached
> to them makes sense, but locking down idle pins ... i'm not
> too sure. especially since using them requires permission to
> the gpio device file in the first place.

The difficulty is that from board to board supported by the same
kernel this wiring of the existing GPIO can vary. So you can't rely on
the kernel to know which pins are safe and wich are not.

There are board design with really dangerous pins that are not
explicitely used by a given driver. Iirc on the armish Thecus N2000
you can shut down the fans (and thus damage the disks insinde by
overheating) or cause an hard reboot.

So better safe than sorry, you really need to know what you're doing. 

Nothing prevents you to run permanently at securelevel 0 if you
need it and can afford the risk. 

> 
> --patrick
> 
> 
> > On 06/29/14 06:18, patrick keshishian wrote:
> >> On 6/27/14, Raphael Graf <r...@undefined.ch> wrote:
> >>> On 06/27/14 06:58, patrick keshishian wrote:
> >>>
> >>> The direction of the pin has to be configured at securelevel 0.
> >>> You can put something like the following line in /etc/rc.securelevel:
> >>> gpioctl gpio1 23 set out
> >>>
> >>> Then you should be able to toggle the pin:
> >>> # gpioctl gpio1 23 on
> >>> pin 23: state 0 -> 1
> >>> # gpioctl gpio1 23 off
> >>> pin 23: state 1 -> 0
> >>
> >> Thanks for the hint!
> >>
> >> Though, this seems a rather painful way to play with those
> >> pins. Every time one wants to change a pin's direction or
> >> make use of a new pin, one has to reboot.
> >>
> >> Oh well... must be some logic behind that.
> >>
> >> --patrick
> 

-- 
Matthieu Herrb

Reply via email to