Controlling the System Controller GPIO from Linux IMX8QM

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Controlling the System Controller GPIO from Linux IMX8QM

562件の閲覧回数
st3v3n
Contributor I

I have a custom board using the IMX8QM and I need to be able to control the SCU GPIO from linux.

I have enabled the scu gpio from the kernel found the imx_scu gpio driver.


Added the libgpiod and when doing gpioinfo I was able to see scu gpio showing with 8 lines, but when I try to read a value from it using 'gpioget gpiochip8 4'   I get the following:


imxscfw_get: failed -22

gpioget: error reading GPIO values: Invalid argument

 


Added this to the device tree:


scu_gpio0: scu-gpio0 {
compatible = "fsl,imx-scu-gpio";
gpio-controller;
#gpio-cells = <2>;
#interrupt-cells = <2>;
};

 

Using buildroot to build the linux(5.15.5) and bootloader.

SCFW Version:

imx-scfw-porting-kit-1.14.0

ラベル(1)
タグ(4)
0 件の賞賛
返信
1 返信

533件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

pls add more debug information in the function as below to check which one is wrong, it seems this gpio you add doesn't controlled by the scu correctly,

if (offset >= sizeof(sc_arr)/sizeof(unsigned int))
return err;

err = imx_sc_misc_get_control(scu->handle, sc_arr[offset],
0, &level)

https://github.com/nxp-imx/linux-imx/blob/lf-5.15.y/drivers/gpio/gpio-scu.c#L37

0 件の賞賛
返信