SPI Delay Probing

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
3,000件の閲覧回数
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 解決策
2,943件の閲覧回数
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 返答(返信)
2,982件の閲覧回数
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 件の賞賛
返信
2,958件の閲覧回数
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 件の賞賛
返信
2,944件の閲覧回数
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 件の賞賛
返信