cancel
Showing results for 
Search instead for 
Did you mean: 

Excluding gpio from Linux

Bennny
Associate II

Hello.

Is there any way to exclude some GPIOs from Linux, when I control them from M4 core and I don't want to give an ability to control them from Linux apps? I would like to exclude e.g. PG12. I tried this, which should be exactly for such use:

&gpiog {
   gpio-reserved-ranges = <12 1>; /* Reserve PG12 for M4 */
};

 
But it doesn't help, still the GPIO is listed and possible to control under Linux.

We use OpenSTLinux custom Yocto build with kernel 5.15.67

Thanks

3 REPLIES 3
OlivierK
ST Employee

Hi @Bennny,

 

Have you tried m4_reserved_gpios ?

 

m4_reserved_gpios {

    compatible = "st,m4-reserved-gpios";

    gpio-reserved-ranges = <...>;

};

 

Bear in mind that OpenSTLinux 5.15 is not anymore supported, if possible please point to the latest OSTL release.

 

Regards,

Olivier

Bennny
Associate II

Thanks for the reply.
I tried to find any info about the m4-reserved-gpios, but I didn't find any definition of it in docs, source code nor google.
Also the gpio-reserved-ranges = <...>; is in such case counted from GPIOA 0 (so PG12 is 108)?

Bennny
Associate II

Could you please provide the description/documentation of the m4_reserved_gpios and the gpio-reserved-ranges calculation?