AnsweredAssumed Answered

MCP2515 on ECSPI3 not working

Question asked by jsmith883 on Jun 18, 2018
Latest reply on Jun 20, 2018 by igorpadykov

Hello,

 

We have designed a custom board using the i.MX6UL that will have three CAN buses.  I'm using flexcan for the first two CAN buses, and using the Microchip MCP2515 via SPI on the thrird CAN bus.  I'm using kernel 4.1.15.  I have added the MCP251X driver to the kernel, but the driver is never loaded.  The only output from dmesg says the following:

 

# dmesg | grep spi
[ 0.437217] spi_imx 2010000.ecspi: probed

 

If I add a spidev node, it will load but not the driver for the MCP2515.  Could u-boot be doing something to the pins that would mess up spi in the kernel?  My device tree is found below...  any ideas why this is not working?

 

i.MX6UL

 

MCP2515

 

clocks {
      mcp251x_clock: mcp251x_clock {
      compatible = "fixed-clock";
      reg = <1>;
      #clock-cells = <0>;
      clock-frequency = <8000000>;
      clock-output-names = "mcp251x_clock";
   };
};

 

&ecspi3 {

   fsl,spi-num-chipselects = <1>;
   cs-gpios = <&gpio4 12 1>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ecspi3>;
   status = "okay";

 

   /* spidev@0x00 {
      compatible = "spidev";
      spi-max-frequency = <10000000>;
      reg = <0>;
   };*/

 

   can0: mcp2515@0 {
      compatible = "microchip,mcp2515";
      reg = <0>;
      clocks = <&mcp251x_clock>;
      interrupt-parent = <&gpio4>;
      interrupts = <11 0x2>;
      spi-max-frequency = <10000000>;
      xceiver-supply = <&reg_can_3v3>;
      vdd-supply = <&reg_can_3v3>;
      status = "okay";
      };
   };

 

/**iomuxc**/
pinctrl_ecspi3: ecspi3grp {
   fsl,pins = <
   MX6UL_PAD_NAND_CLE__ECSPI3_MISO 0x100B1
   MX6UL_PAD_NAND_CE1_B__ECSPI3_MOSI 0x100B1
   MX6UL_PAD_NAND_CE0_B__ECSPI3_SCLK 0x100B1
   MX6UL_PAD_NAND_WP_B__ECSPI3_RDY 0x100B1
   /*MX6UL_PAD_NAND_READY_B__ECSPI3_SS0 0x100B1*/
   MX6UL_PAD_NAND_READY_B__GPIO4_IO12 0x000B1
   >;
};

Outcomes