SPI Delay Probing

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

SPI Delay Probing

跳至解决方案
3,149 次查看
manish-sharma
NXP Employee
NXP Employee

Hi All,

We have one SPI device (spi-device-1)which needs reset HIGH before probe happen. To make it, we used 

pinctrl-assert-gpios = <&gpio4 20 GPIO_ACTIVE_HIGH>;

Now, probe fails even adding above property so we added some delay around 1.5s which made it work but we need a property in the device tree which can handle such case.

&lpspi3 {
        #address-cells = <1>;
        #size-cells = <0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_lpspi3>;
        pinctrl-assert-gpios = <&gpio4 20 GPIO_ACTIVE_HIGH>;
        num-cs = <1>;
        status = "okay";
        cs-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
 
spi-device-1: device1@0 {
compatible = "device-nxp, device1";
reg = <0x0>;
        spi-max-frequency = <12000000>;
interrupt-parent = <&gpio1>;      /* GPIO Bank 3 */
interrupts = <9 0x1>;            /* Index: 25, rising edge */
spi-cpha;                         /* SPI mode: CPHA=1 */
spi-cpol;                         /* SPI mode: CPOL=1 */
local-mac-address = [ A0 B0 C0 D0 E0 F0 ];
};
};
 
Regards,
MKS
 
iMX8X #linux
标签 (1)
0 项奖励
回复
1 解答
3,092 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @manish-sharma!

There's no existing mechanism that device tree can handle the delay. User needs to create a new property and handle it in the driver.

Best Regards!

Chavira

在原帖中查看解决方案

0 项奖励
回复
3 回复数
3,131 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @manish-sharma!
Thank you for contacting NXP Support!

You can add the gpio like the "gpio-leds" device.

If you need the pin in high state since the u-boot stage, you can add on the device tree of the u-boot and the device tree of the Linux kernel.

https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts#L20

https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/arch/arm/dts/imx8mp-evk.dts#L20

Best Regards!
Chavira

0 项奖励
回复
3,107 次查看
manish-sharma
NXP Employee
NXP Employee

Hi @Chavira ,

Thanks for the response.

I rephrase the problem: The gpio4 (RESET) goes high before device1 probe but device1 needs some more time before it invokes probe function, however, in my case it happens immediately while we checked manual insertion (module-based insertion as .ko) and found that device1 needs 1.5 seconds before invocation of its probe function so need a mechanism where probe happens after 1.5s of gpio4 goes high. Is the any mechanism in device tree to achieve this?

 

nxg04383_0-1705409113233.png

 

Please see above diagram which needs to be achieved using above dts (kindly see above dts)

 

Regards,

MKS

0 项奖励
回复
3,093 次查看
Chavira
NXP TechSupport
NXP TechSupport

Hi @manish-sharma!

There's no existing mechanism that device tree can handle the delay. User needs to create a new property and handle it in the driver.

Best Regards!

Chavira

0 项奖励
回复