AnsweredAssumed Answered

imx6sx - mrf24j40 - udooneo - devicetree

Question asked by Jo Ca on May 8, 2018
Latest reply on May 14, 2018 by Jo Ca



I'm having trouble setting my device tree to use the MRF24J40 linux driver on my UDOO Neo Full board.


I'm using this kernel : GitHub - fmntf/linux_kernel: Kernel Linux Repository for UDOO  on branch 4.1.5_2.x-udoo


I have the following configuration in imx6sx-udoo-neo-externalpins.dtsi (Device Tree used : /boot/imx6sx-udoo-neo-full-lvds7.dtb)


//MX6SX_PAD_SD4_CLK__GPIO6_IO_12 0x80000000 // {{external-gpio-20}}
//MX6SX_PAD_SD4_CMD__GPIO6_IO_13 0x80000000 // {{external-gpio-21}}

//MX6SX_PAD_SD4_DATA1__GPIO6_IO_15 0x80000000 // {{external-gpio-38}}
//MX6SX_PAD_SD4_DATA0__GPIO6_IO_14 0x80000000 // {{external-gpio-39}}


/* ... */


pinctrl_ecspi2: ecspi2grp {
fsl,pins = <
/* CS SPI 1 */
MX6SX_PAD_SD4_DATA0__GPIO6_IO_14 0x0b0b1


/* ... */


&ecspi2 {
   fsl,spi-num-chipselects = <1>;
   cs-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ecspi2>;
   status = "okay";
   #address-cells = <1>;
   #size-cells = <0>;


   mrf24j40@0 {
      compatible = "mrf24j40";
      reg = <0>;
      spi-max-frequency = <1000000>;
      interrupt-parent = <&gpio1>;
      interrupts = <17 8>;



The issue is that the SPI bus isn't fully working then. With an oscilloscope, I can see correct messages on the MOSI, CLK and CS wires, the IRQ is setted but I have nothing on the MISO wire.


The INT pin of the MRF24J40 is wired (hard) on GPIO_17 (29) of the Udoo Neo.


A friend developped in the past a custom driver for the mrf24j40 which worked with spidev. It was working. I tested today with this driver and his old device tree configuration and everything works. But we have to use this standard driver now as his driver is limited.


Does anyone know what I messed in my configuration ? It would save my life


Best regards