i2c on armStone A9r2

      i2c on armStone A9r2

      I am trying to use I2C on the armstone A9r2 (Quad) but I cannot determine which pins on the feature connector is used for I2C. The docs says that I2C is on pin 16 and 17, which is the same as SPI, but I cannot measure any activity on those pins. The device tree file has a comment that says Feature Connector (SKIT) on I2C_A and the pins are MX6QDL_PAD_GPIO_3__I2C3_SCL and MX6QDL_PAD_GPIO_16__I2C3_SDA, but I can't determine which pins this is on the feature connector. Do I need to set up another I2C bus for my device and in that case, which pins can I use?

      Kind regards,
      Hein Gustavsen
      Miros AS
      To have an I2C available instead of SPI on pins 16 and 17 was intended. But at the current state it is only possible through a SoftwareI2C with pins 16 and 17 configured as GPIOs.
      If you don't have a touch controller you can use the hardware I2C bus on the Hirose 6 pin connector.

      Best Regards
      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.
      The pins 16/17 are available on the connector. They can be used as GPIO etc. or as (bitbangig/SW)i2c too. This makes no difference as the i2c bitbangig driver uses these pins just as simple GPIOS.
      So in both cases there are no changes on the hardware it's just a software feature. This will be set in the device tree.
      For example on armstonea9 we are using a software i2c for the audio chip. The device tree nodes looks like this:

      i2c node:

      Source Code

      1. /* Bitbanging I2C */
      2. i2c_gpio: i2c-gpio {
      3. compatible = "i2c-gpio";
      4. gpios = <&gpio1 11 GPIO_ACTIVE_HIGH /* sda */
      5. &gpio1 10 GPIO_ACTIVE_HIGH /* scl */
      6. >;
      7. pinctrl-names = "default";
      8. pinctrl-0 = <&pinctrl_i2c5_gpio>;
      9. i2c-gpio,delay-us = <2>; /* ~100 kHz */
      10. #address-cells = <1>;
      11. #size-cells = <0>;
      12. };


      iomux controller:

      Source Code

      1. pinctrl_i2c5_gpio: i2c5_gpio_grp {
      2. fsl,pins = <
      3. MX6QDL_PAD_SD2_CMD__GPIO1_IO11 0x4001b0b0
      4. MX6QDL_PAD_SD2_CLK__GPIO1_IO10 0x4001b0b0
      5. >;
      6. };


      Best Regards
      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.
      Dear Support-Team,

      is it possible to use the SX825x touch controller on the i2c5 instead of i2c2? If yes we can reduce a connector from our board to the 6 pin connector on armstoneA9r2 and use the pin 16/17 from the feature connector. Do we have to move the following code in armstonea9r2dlq.dtsi i2c2 section to a i2c5 section?

      Source Code

      1. #ifdef CONFIG_ARMSTONEA9R2_4WTOUCH_SX8656
      2. /* 4/5 wire analog resistive touch on Touch Connector (I2C) */
      3. sx8654@48 {
      4. compatible = "semtech,sx8656";
      5. reg = <0x48>;
      6. touchrate = <0x30>;
      7. powdly = <0x06>;
      8. filt = <0x02>;
      9. setdly = <0x08>;
      10. pinctrl-names = "default";
      11. interrupt-parent = <&gpio1>;
      12. interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
      13. reset-gpio = <&gpio1 29 GPIO_ACTIVE_LOW>;
      14. };
      15. #endif

      Thanks and kind regards.
      Hmm, probably that was not completely clear before, but I2C5 is a bit-banging I2C on armStoneA9r2 that is located on the LVDS connector. It is *not* the one on pins 16/17 on the feature connector. If you want to have another bit-banging I2C on pins 16/17, you first have to define it in the device tree. We have no pre-defined node for this, yet. The example above from my colleague was taken from armStoneA9 (without r2), just to show how easy a bit-banging I2C can be set up. Please do not take these settings verbatim on armStoneA9r2, it will not work.

      Please note that for this touch controller, you also need two additional GPIOs for Reset and IRQ. And you have to configure these GPIOs in the fragment you quoted above in entries interrupt-parent, interrupts and reset-gpio.

      Please also note that touch traffic is rather high, so using a bit-banging I2C bus is not a very good solution and may cause very high CPU load. The dedicated 6-pin touch connector has a real hardware I2C bus on it. So this will not cause any significant CPU load.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.
      I tried to define my own bit-banging I2C on the GPIO pins 16/17 on an armStoneA9r2, as supposed here. But had no luck yet. I see no appropriate i2c bus after booting the linux kernel.

      Here is my modification of the shipped armstonea9r2qdl.dtsi.

      Source Code

      1. /* Bitbanging I2C */
      2. i2c_gpio: i2c-gpio-rtc {
      3. compatible = "i2c-gpio";
      4. gpios = <&gpio2 25 GPIO_ACTIVE_HIGH /* sda */
      5. &gpio2 24 GPIO_ACTIVE_HIGH /* scl */
      6. >;
      7. pinctrl-names = "default";
      8. pinctrl-0 = <&pinctrl_i2c_gpio>;
      9. i2c-gpio,delay-us = <2>; /* ~100 kHz */
      10. #address-cells = <1>;
      11. #size-cells = <0>;
      12. };
      13. pinctrl_i2c_gpio: i2c_gpio_grp {
      14. fsl,pins = <
      15. MX6QDL_PAD_EIM_OE__GPIO2_IO25 0x70B1
      16. MX6QDL_PAD_EIM_CS1__GPIO2_IO24 0x70B1
      17. >;
      18. };


      I disabled SPI_A by commenting out
      //#define CONFIG_ARMSTONEA9R2_SPI_A
      in armstonea9r2dl.dts

      Any hint what is wrong is welcome :)

      Thanks and kind regards

      Michael Frommberger
      Dear Mr. Frommberger,

      normally this configuration should work. I tried it and i see in the /dev directory i2c-6. This i2c-6 is the new Bitbanging I2C (i2c_gpio). Do you get any error messages?

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.