GPIO definition in SPI-device in device tree

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO definition in SPI-device in device tree

1,055 Views
Maddis
Contributor IV

We have i.MX6 based HW that has been running Yocto 2.2 and kernel 4.1.x up until now. Now I'm starting to test Yocto 2.4 with kernel 4.14 and ran to some problems that hopefully someone here could help with.

We have second supervisor MCU connected to i.MX6 via SPI. There is extra GPIO that MCU uses to tell for i.MX6 if it's ready to transmit data or not.

In Yocto 2.2 that is defined like this in device tree:

&ecspi1 {
   fsl,spi-num-chipselects = <1>;
   cs-gpios = <&gpio5 25 0>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ecspi1>;
   status = "okay";

   supervisor: ss@0 {
      #address-cells = <1>;
      #size-cells = <1>;
      compatible = "ss";
      spi-max-frequency = <1000000>;
      reg = <0>;
      rdy-gpios = <&gpio4 5 0>;

   };

};

That worked just fine and in driver I could use following line to read if the rdy-gpios is available:

nb = of_gpio_named_count(np, "rdy-gpios");

When I try that same driver with Yocto 2.4 and Linux 4.14 the of_gpio_named_count returns -ENOENT - error which in turn means "No such file or directory". Also this is confirmed if I look from sysfs: 

/sys/devices/soc0/soc/2000000.aips-bus/2000000.spba-bus/2008000.ecspi/of_node/ss@0

In older system there is rdy-gpios - listed, but it's missing from newer system.

Does anyone know how should it be defined in Linux 4.14? Seems that it's more of device tree issue and not so much driver.

Labels (3)
0 Kudos
2 Replies

718 Views
Maddis
Contributor IV

Well, this is somewhat embarrassing. It turns out that I was editing wrong device tree file since old kernel was linux-fslc-imx and new linux-fslc so also device trees are stored in different directories. Didn't noticed that until now.

I would have deleted this discussion, but seems that there is no such an option. So forget that you ever saw this. :smileyhappy:

0 Kudos

718 Views
igorpadykov
NXP Employee
NXP Employee

Hi mc

this may be kernel issue as not all kernels have full support for

all i.mx capabilities, just for short description one can refer to

[meta-freescale] Issue with freescale git server at git.freescale.com 

May be recommended try nxp bsps described on

i.MX Software|NXP 

As for linux 4.14, it is not supported by nxp and may be posted on kernel mail list.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos