Problem enabling I2C3 in Wandboard Quad

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

Problem enabling I2C3 in Wandboard Quad

663 Views
raulina
Contributor I

Dear all,

I have a wandboard Quad rev B1 with ubuntu and kernel 4.9.35. I need to use 2 I2C different ports. I developed a code that works well in I2C2, but fails in I2C1. I remember having read many people saying that I2C1 is not properly working because of the hdmi CEC (which shouldn't affect me because I am not using a monitor), so I decided to enable I2C3 while I try to figure what is wrong with I2C1. I also want to enable spidev to get /dev/spidev0.0.

I must say I am a newbie in the world of embedded systems and device trees.

To do so, I firstly followed Robert's Nelson tutorial, and then I modified imx6q-wandboard-revb1.dts from the files I with the following code:

/*
 * Copyright 2013 Freescale Semiconductor, Inc.
 *
 * Author: Fabio Estevam <fabio.estevam@freescale.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */
/dts-v1/;
#include "imx6q.dtsi"
#include "imx6qdl-wandboard-revb1.dtsi"

/ {
   model = "Wandboard i.MX6 Quad Board rev B1";
   compatible = "wand,imx6q-wandboard", "fsl,imx6q";

   memory {
      reg = <0x10000000 0x80000000>;
   };
};

&sata {
   status = "okay";
};

&ecspi1 {
    fsl,spi-num-chipselects = <1>;
   cs-gpios = <&gpio2 30 0>; /* EIM_EB2 */
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ecspi1>;
   status = "okay";

        spidev@0 {
        compatible = "rohm,dh2228fv";
        spi-max-frequency = <10000000>;
        reg = <0>;
        };
};


&i2c3 {
   clock-frequency = <100000>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_i2c3>;
   status = "okay";
};

&iomuxc {
   pinctrl-names = "default";

   imx6q-wandboard-revb1 {
      pinctrl_ecspi1: ecspi1grp-1 {
                  fsl,pins = <
            MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
            MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
            MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
            MX6QDL_PAD_EIM_EB2__GPIO2_IO30  0x000f0b0
            MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x000f0b0
                  >;
           };
      pinctrl_i2c3: i2c3grp {
         fsl,pins = <
            MX6QDL_PAD_GPIO_5__I2C3_SCL      0x4001b8b1
            MX6QDL_PAD_GPIO_16__I2C3_SDA      0x4001b8b1
         >;
      };

   };
};

Then I execute

make imx6q-wandboard-revb1.dtb

and I copy it to /boot/dtbs/4.9.35-armv7-x4/imx6q-wandboard-revb1.dtb

/dev/i2c-2 now appears, but always gives timeout when I try to write on it. With an oscilloscope I don't see any change in the voltage of the lines that theoretically are assigned to the pins I chose. Besides, Ethernet stops working. All this makes me thing I am using the wrong pins, but according to the page 17 on the schematics, I2C3 is wired to GPIO5 and GPIO16...

What am I doing wrong?

Thank you very much

Labels (2)
0 Kudos
0 Replies