Controlling the System Controller GPIO from Linux IMX8QM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Controlling the System Controller GPIO from Linux IMX8QM

571 次查看
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 回复

542 次查看
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 项奖励
回复