Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: tcmichals on September 16, 2012, 01:06:18 am

Title: Support i2c micro using 3.x kernel
Post by: tcmichals on September 16, 2012, 01:06:18 am
I'm using a OE rootfs  and this kernel git://github.com/Freescale/linux-mainline.git. 
It boots, wifi works, etc.  But no i2c support icdetect -l
returns nothing. I don't know if if it has anything to do with:
The device tree having no default mapping to fsl,imx28-i2c. 
If I load the i2c-mxs.ko module using insmod
insmod: error inserting './i2c-mxs.ko': -1 No such device

I will try and see what it is wrong..
<If anyone wants to know to I'm debugging and adding kernel modules to the SDCard.. just post this>
Updated the driver to put printks.. i2c-mxs.c and yes I think it has to do with the device tree.
modprobe i2c-mxs
[  503.790000] LINE 489
FATAL: Error inserting i2c_mxs (/lib/modules/3.6.0-rc2-09647-gddee6b1-dirty/kernel/drivers/i2c/busses/i2c-mxs.ko): No such device
root@imx233-olinuxino-micro:~#
So, looking at the code..

static const struct of_device_id mxs_i2c_dt_ids[] = {  <-- device tree info..
   { .compatible = "fsl,imx28-i2c", },
   { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mxs_i2c_dt_ids);

static struct platform_driver mxs_i2c_driver = {
   .driver = {
         .name = DRIVER_NAME,
         .owner = THIS_MODULE,
         .of_match_table = mxs_i2c_dt_ids,
         },
   .remove = __devexit_p(mxs_i2c_remove),
};

static int __init mxs_i2c_init(void)
{
printk("LINE %d\n", __LINE__);
   return platform_driver_probe(&mxs_i2c_driver, mxs_i2c_probe); <-- this uses the device tree info
}



So, see if I can update the device tree info.. maybe..


Title: Re: Support i2c micro using 3.x kernel
Post by: davidjf2001 on September 16, 2012, 06:07:40 am
I am using I2C on my OpenRD with the arch build. Kernel is 3.1.  I believe I used modprobe i2c-mc64xxx then modprobe i2c-dev.  For olinuxino i2c-imx would be needed unless you compile it in then maybe only i2c-dev is needed.  With 3.1 I2C works great on the OpenRD, So far I have only used 2.6 in the olinuxino and cannot get read words to work correctly.
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on September 16, 2012, 07:39:46 am
Well, finally got some of it working for the 3.6.0-rc2 kernel.  I had to update the device tree files and now..

root@imx233-olinuxino-micro:~# i2cdetect -l
i2c-0   i2c             MXS I2C adapter                         I2C adapter

I will hook up logic analyzer and see if it works..
Also, the 2.6.x i2c-mxs supports DMA, then 3.6.x does not.  So, will look into getting that moved.  Most of i2c needs are simple sensor, so DMA will not help much.  Also, changed the tree to use 400khz so, see of that works..

(hum.. I as going to add the files.. but cannot find a way to attach.. maybe to long of day...)
imx23-olinux.dts
   usbphy0: usbphy@8007c000 {
            status = "okay";
         };
         i2c0: i2c@80058000 {
            pinctrl-names = "default";
            pinctrl-0 = <&i2c0_pins_a>;
            status = "okay";

         };
imx23.dtsi (complete file)
/*
* Copyright 2012 Freescale Semiconductor, Inc.
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/

/include/ "skeleton.dtsi"

/ {
   interrupt-parent = <&icoll>;

   aliases {
      gpio0 = &gpio0;
      gpio1 = &gpio1;
      gpio2 = &gpio2;
      serial0 = &auart0;
      serial1 = &auart1;
   };

   cpus {
      cpu@0 {
         compatible = "arm,arm926ejs";
      };
   };

   apb@80000000 {
      compatible = "simple-bus";
      #address-cells = <1>;
      #size-cells = <1>;
      reg = <0x80000000 0x80000>;
      ranges;

      apbh@80000000 {
         compatible = "simple-bus";
         #address-cells = <1>;
         #size-cells = <1>;
         reg = <0x80000000 0x40000>;
         ranges;

         icoll: interrupt-controller@80000000 {
            compatible = "fsl,imx23-icoll", "fsl,mxs-icoll";
            interrupt-controller;
            #interrupt-cells = <1>;
            reg = <0x80000000 0x2000>;
         };

         dma-apbh@80004000 {
            compatible = "fsl,imx23-dma-apbh";
            reg = <0x80004000 0x2000>;
         };

         ecc@80008000 {
            reg = <0x80008000 0x2000>;
            status = "disabled";
         };

         gpmi-nand@8000c000 {
            compatible = "fsl,imx23-gpmi-nand";
            #address-cells = <1>;
            #size-cells = <1>;
            reg = <0x8000c000 0x2000>, <0x8000a000 0x2000>;
            reg-names = "gpmi-nand", "bch";
            interrupts = <13>, <56>;
            interrupt-names = "gpmi-dma", "bch";
            fsl,gpmi-dma-channel = <4>;
            status = "disabled";
         };

         ssp0: ssp@80010000 {
            reg = <0x80010000 0x2000>;
            interrupts = <15 14>;
            fsl,ssp-dma-channel = <1>;
            status = "disabled";
         };

         etm@80014000 {
            reg = <0x80014000 0x2000>;
            status = "disabled";
         };

         pinctrl@80018000 {
            #address-cells = <1>;
            #size-cells = <0>;
            compatible = "fsl,imx23-pinctrl", "simple-bus";
            reg = <0x80018000 0x2000>;

            gpio0: gpio@0 {
               compatible = "fsl,imx23-gpio", "fsl,mxs-gpio";
               interrupts = <16>;
               gpio-controller;
               #gpio-cells = <2>;
               interrupt-controller;
               #interrupt-cells = <2>;
            };

            gpio1: gpio@1 {
               compatible = "fsl,imx23-gpio", "fsl,mxs-gpio";
               interrupts = <17>;
               gpio-controller;
               #gpio-cells = <2>;
               interrupt-controller;
               #interrupt-cells = <2>;
            };

            gpio2: gpio@2 {
               compatible = "fsl,imx23-gpio", "fsl,mxs-gpio";
               interrupts = <18>;
               gpio-controller;
               #gpio-cells = <2>;
               interrupt-controller;
               #interrupt-cells = <2>;
            };

            duart_pins_a: duart@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x11a2 /* MX23_PAD_PWM0__DUART_RX */
                  0x11b2 /* MX23_PAD_PWM1__DUART_TX */
               >;
               fsl,drive-strength = <0>;
               fsl,voltage = <1>;
               fsl,pull-up = <0>;
            };

            auart0_pins_a: auart0@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x01c0 /* MX23_PAD_AUART1_RX__AUART1_RX */
                  0x01d0 /* MX23_PAD_AUART1_TX__AUART1_TX */
                  0x01a0 /* MX23_PAD_AUART1_CTS__AUART1_CTS */
                  0x01b0 /* MX23_PAD_AUART1_RTS__AUART1_RTS */
               >;
               fsl,drive-strength = <0>;
               fsl,voltage = <1>;
               fsl,pull-up = <0>;
            };

            i2c0_pins_a: i2c0@0 {
               reg = <0>;
               fsl,pinmux-ids = <
               0x1170 /* MX23_PAD_LCD_ENABLE__LCD_ENABLE */
               0x1180 /* MX23_PAD_LCD_HSYNC__LCD_HSYNC */
               >;
               fsl,drive-strength = <1>;
               fsl,voltage = <1>;
               fsl,pull-up = <1>;
            };

            auart0_2pins_a: auart0-2pins@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x01e2 /* MX23_PAD_I2C_SCL__AUART1_TX */
                  0x01f2 /* MX23_PAD_I2C_SDA__AUART1_RX */
               >;
               fsl,drive-strength = <0>;
               fsl,voltage = <1>;
               fsl,pull-up = <0>;
            };

            gpmi_pins_a: gpmi-nand@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x0000 /* MX23_PAD_GPMI_D00__GPMI_D00 */
                  0x0010 /* MX23_PAD_GPMI_D01__GPMI_D01 */
                  0x0020 /* MX23_PAD_GPMI_D02__GPMI_D02 */
                  0x0030 /* MX23_PAD_GPMI_D03__GPMI_D03 */
                  0x0040 /* MX23_PAD_GPMI_D04__GPMI_D04 */
                  0x0050 /* MX23_PAD_GPMI_D05__GPMI_D05 */
                  0x0060 /* MX23_PAD_GPMI_D06__GPMI_D06 */
                  0x0070 /* MX23_PAD_GPMI_D07__GPMI_D07 */
                  0x0100 /* MX23_PAD_GPMI_CLE__GPMI_CLE */
                  0x0110 /* MX23_PAD_GPMI_ALE__GPMI_ALE */
                  0x0130 /* MX23_PAD_GPMI_RDY0__GPMI_RDY0 */
                  0x0140 /* MX23_PAD_GPMI_RDY1__GPMI_RDY1 */
                  0x0170 /* MX23_PAD_GPMI_WPN__GPMI_WPN */
                  0x0180 /* MX23_PAD_GPMI_WRN__GPMI_WRN */
                  0x0190 /* MX23_PAD_GPMI_RDN__GPMI_RDN */
                  0x21b0 /* MX23_PAD_GPMI_CE1N__GPMI_CE1N */
                  0x21c0 /* MX23_PAD_GPMI_CE0N__GPMI_CE0N   */
               >;
               fsl,drive-strength = <0>;
               fsl,voltage = <1>;
               fsl,pull-up = <0>;
            };

            gpmi_pins_fixup: gpmi-pins-fixup {
               fsl,pinmux-ids = <
                  0x0170 /* MX23_PAD_GPMI_WPN__GPMI_WPN */
                  0x0180 /* MX23_PAD_GPMI_WRN__GPMI_WRN */
                  0x0190 /* MX23_PAD_GPMI_RDN__GPMI_RDN */
               >;
               fsl,drive-strength = <2>;
            };

            mmc0_4bit_pins_a: mmc0-4bit@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x2020 /* MX23_PAD_SSP1_DATA0__SSP1_DATA0 */
                  0x2030 /* MX23_PAD_SSP1_DATA1__SSP1_DATA1 */
                  0x2040 /* MX23_PAD_SSP1_DATA2__SSP1_DATA2 */
                  0x2050 /* MX23_PAD_SSP1_DATA3__SSP1_DATA3 */
                  0x2000 /* MX23_PAD_SSP1_CMD__SSP1_CMD */
                  0x2010 /* MX23_PAD_SSP1_DETECT__SSP1_DETECT */
                  0x2060 /* MX23_PAD_SSP1_SCK__SSP1_SCK */
               >;
               fsl,drive-strength = <1>;
               fsl,voltage = <1>;
               fsl,pull-up = <1>;
            };

            mmc0_8bit_pins_a: mmc0-8bit@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x2020 /* MX23_PAD_SSP1_DATA0__SSP1_DATA0 */
                  0x2030 /* MX23_PAD_SSP1_DATA1__SSP1_DATA1 */
                  0x2040 /* MX23_PAD_SSP1_DATA2__SSP1_DATA2 */
                  0x2050 /* MX23_PAD_SSP1_DATA3__SSP1_DATA3 */
                  0x0082 /* MX23_PAD_GPMI_D08__SSP1_DATA4 */
                  0x0092 /* MX23_PAD_GPMI_D09__SSP1_DATA5 */
                  0x00a2 /* MX23_PAD_GPMI_D10__SSP1_DATA6 */
                  0x00b2 /* MX23_PAD_GPMI_D11__SSP1_DATA7 */
                  0x2000 /* MX23_PAD_SSP1_CMD__SSP1_CMD */
                  0x2010 /* MX23_PAD_SSP1_DETECT__SSP1_DETECT */
                  0x2060 /* MX23_PAD_SSP1_SCK__SSP1_SCK */
               >;
               fsl,drive-strength = <1>;
               fsl,voltage = <1>;
               fsl,pull-up = <1>;
            };

            mmc0_pins_fixup: mmc0-pins-fixup {
               fsl,pinmux-ids = <
                  0x2010 /* MX23_PAD_SSP1_DETECT__SSP1_DETECT */
                  0x2060 /* MX23_PAD_SSP1_SCK__SSP1_SCK */
               >;
               fsl,pull-up = <0>;
            };

            pwm2_pins_a: pwm2@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x11c0 /* MX23_PAD_PWM2__PWM2 */
               >;
               fsl,drive-strength = <0>;
               fsl,voltage = <1>;
               fsl,pull-up = <0>;
            };

            lcdif_24bit_pins_a: lcdif-24bit@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x1000 /* MX23_PAD_LCD_D00__LCD_D0 */
                  0x1010 /* MX23_PAD_LCD_D01__LCD_D1 */
                  0x1020 /* MX23_PAD_LCD_D02__LCD_D2 */
                  0x1030 /* MX23_PAD_LCD_D03__LCD_D3 */
                  0x1040 /* MX23_PAD_LCD_D04__LCD_D4 */
                  0x1050 /* MX23_PAD_LCD_D05__LCD_D5 */
                  0x1060 /* MX23_PAD_LCD_D06__LCD_D6 */
                  0x1070 /* MX23_PAD_LCD_D07__LCD_D7 */
                  0x1080 /* MX23_PAD_LCD_D08__LCD_D8 */
                  0x1090 /* MX23_PAD_LCD_D09__LCD_D9 */
                  0x10a0 /* MX23_PAD_LCD_D10__LCD_D10 */
                  0x10b0 /* MX23_PAD_LCD_D11__LCD_D11 */
                  0x10c0 /* MX23_PAD_LCD_D12__LCD_D12 */
                  0x10d0 /* MX23_PAD_LCD_D13__LCD_D13 */
                  0x10e0 /* MX23_PAD_LCD_D14__LCD_D14 */
                  0x10f0 /* MX23_PAD_LCD_D15__LCD_D15 */
                  0x1100 /* MX23_PAD_LCD_D16__LCD_D16 */
                  0x1110 /* MX23_PAD_LCD_D17__LCD_D17 */
                  0x0081 /* MX23_PAD_GPMI_D08__LCD_D18 */
                  0x0091 /* MX23_PAD_GPMI_D09__LCD_D19 */
                  0x00a1 /* MX23_PAD_GPMI_D10__LCD_D20 */
                  0x00b1 /* MX23_PAD_GPMI_D11__LCD_D21 */
                  0x00c1 /* MX23_PAD_GPMI_D12__LCD_D22 */
                  0x00d1 /* MX23_PAD_GPMI_D13__LCD_D23 */
                  0x1160 /* MX23_PAD_LCD_DOTCK__LCD_DOTCK */
                  0x1190 /* MX23_PAD_LCD_VSYNC__LCD_VSYNC */
               >;
               fsl,drive-strength = <0>;
               fsl,voltage = <1>;
               fsl,pull-up = <0>;
            };
         };

         digctl@8001c000 {
            reg = <0x8001c000 2000>;
            status = "disabled";
         };

         emi@80020000 {
            reg = <0x80020000 0x2000>;
            status = "disabled";
         };

         dma-apbx@80024000 {
            compatible = "fsl,imx23-dma-apbx";
            reg = <0x80024000 0x2000>;
         };

         dcp@80028000 {
            reg = <0x80028000 0x2000>;
            status = "disabled";
         };

         pxp@8002a000 {
            reg = <0x8002a000 0x2000>;
            status = "disabled";
         };

         ocotp@8002c000 {
            reg = <0x8002c000 0x2000>;
            status = "disabled";
         };

         axi-ahb@8002e000 {
            reg = <0x8002e000 0x2000>;
            status = "disabled";
         };

         lcdif@80030000 {
            compatible = "fsl,imx23-lcdif";
            reg = <0x80030000 2000>;
            interrupts = <46 45>;
            status = "disabled";
         };

         ssp1: ssp@80034000 {
            reg = <0x80034000 0x2000>;
            interrupts = <2 20>;
            fsl,ssp-dma-channel = <2>;
            status = "disabled";
         };

         tvenc@80038000 {
            reg = <0x80038000 0x2000>;
            status = "disabled";
         };
                };

      apbx@80040000 {
         compatible = "simple-bus";
         #address-cells = <1>;
         #size-cells = <1>;
         reg = <0x80040000 0x40000>;
         ranges;

         clkctl@80040000 {
            reg = <0x80040000 0x2000>;
            status = "disabled";
         };

         saif0: saif@80042000 {
            reg = <0x80042000 0x2000>;
            status = "disabled";
         };

         power@80044000 {
            reg = <0x80044000 0x2000>;
            status = "disabled";
         };

         saif1: saif@80046000 {
            reg = <0x80046000 0x2000>;
            status = "disabled";
         };

         audio-out@80048000 {
            reg = <0x80048000 0x2000>;
            status = "disabled";
         };

         audio-in@8004c000 {
            reg = <0x8004c000 0x2000>;
            status = "disabled";
         };

         lradc@80050000 {
            reg = <0x80050000 0x2000>;
            status = "disabled";
         };

         spdif@80054000 {
            reg = <0x80054000 2000>;
            status = "disabled";
         };

         i2c0: i2c@80058000 {
            compatible = "fsl,imx28-i2c";
            reg = <0x80058000 0x2000>;
            interrupts = <26 27>;
            clock-frequency = <400000>;
            status = "disabled";
         };

         rtc@8005c000 {
            compatible = "fsl,imx23-rtc", "fsl,stmp3xxx-rtc";
            reg = <0x8005c000 0x2000>;
            interrupts = <22>;
         };

         pwm: pwm@80064000 {
            compatible = "fsl,imx23-pwm";
            reg = <0x80064000 0x2000>;
            #pwm-cells = <2>;
            fsl,pwm-number = <5>;
            status = "disabled";
         };

         timrot@80068000 {
            reg = <0x80068000 0x2000>;
            status = "disabled";
         };

         auart0: serial@8006c000 {
            compatible = "fsl,imx23-auart";
            reg = <0x8006c000 0x2000>;
            interrupts = <24 25 23>;
            status = "disabled";
         };

         auart1: serial@8006e000 {
            compatible = "fsl,imx23-auart";
            reg = <0x8006e000 0x2000>;
            interrupts = <59 60 58>;
            status = "disabled";
         };

         duart: serial@80070000 {
            compatible = "arm,pl011", "arm,primecell";
            reg = <0x80070000 0x2000>;
            interrupts = <0>;
            status = "disabled";
         };

         usbphy0: usbphy@8007c000 {
            compatible = "fsl,imx23-usbphy";
            reg = <0x8007c000 0x2000>;
            status = "disabled";
         };
      };
   };

   ahb@80080000 {
      compatible = "simple-bus";
      #address-cells = <1>;
      #size-cells = <1>;
      reg = <0x80080000 0x80000>;
      ranges;

      usb0: usb@80080000 {
         compatible = "fsl,imx23-usb", "fsl,imx27-usb";
         reg = <0x80080000 0x40000>;
         interrupts = <11>;
         fsl,usbphy = <&usbphy0>;
         status = "disabled";
      };
   };
};
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on September 17, 2012, 12:07:31 am
The pins are not correct..
i2c0_pins_a: i2c0@0 {
   reg = <0>;
   fsl,pinmux-ids = <
         0x1170 /* MX23_PAD_LCD_ENABLE__LCD_ENABLE */
         0x1180 /* MX23_PAD_LCD_HSYNC__LCD_HSYNC */
         >;
         fsl,drive-strength = <1>;
         fsl,voltage = <1>;
         fsl,pull-up = <1>;
   };
I'm trying to figure out the pin mapping, the issue is taking the LCD_ENABLE and LCD_HYSNC and moving this to i2c mode 1.
Title: Re: Support i2c micro using 3.x kernel
Post by: earny on September 17, 2012, 02:27:03 am
Hint: dma support:

https://patchwork.kernel.org/patch/1369781/

Tried on maxi and micro, scope shows always high om SDA/SCL
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on September 17, 2012, 04:02:17 pm
I guess the DMA patch is in the next Linux tree or still in patches, so, back to figuring out the pin mapping on the device tree.  I think this pin mapping is the last remaining issue with 3.X for I2C to work. I think this is what is causing your issue also.
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 01, 2012, 08:45:43 pm
Hi,

There is a working solution for have i2c on 3.6 kernel ?
I tested with adding i2c diff to dts file, and I applied DMA patch.

I've got an i2c device :

root@micro:~# i2cdetect -l
i2c-0 i2c        MXS I2C adapter                  I2C adapter


But when I scan, I've got that error (maybe missing support for smbus, who are not available without ACPI) :

root@micro:~# i2cdetect 0
Error: Can't use SMBus Quick Write command on this bus (ISA bus?)


With -r option, scan works but detects nothing.
I've make an error, or I've missing something ? (another things than bad wiring :]).

Regards
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 02, 2012, 01:43:48 am
I'm going to try 3.6, later this week.  Yes. I'm seeing the same thing, I've put a logic analyzer, and the data is crap. Load 2.6.35.3 it looks OK.  Between getting panics, posted in another forum, this is becoming a long debug task. 

If you can please post your device tree, see if we did the same thing.. there is some additional fixes in the i2c in 3.6 for the i2c-mxs.c driver.
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 02, 2012, 11:07:39 am
What do you mean by "device tree" ?
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 02, 2012, 04:20:43 pm
The device tree files: (imx23.dtsi  imx23-olinuxino.dts

I have no idea how to post a file in this forum.. guess have to start github or something else.  I'm using buildroot and making at patch file for all of this and the usb phy.  Looking at the current tree, to me the debug port is not assigned, auart0 only the dual-uart is enabled.  Maybe I'm off base with this..

But here are my basic changes..
diff -uNr linux-3.6.tcm/arch/arm/boot/dts/imx23.dtsi linux-3.6/arch/arm/boot/dts/imx23.dtsi
--- linux-3.6.tcm/arch/arm/boot/dts/imx23.dtsi   2012-10-01 13:31:32.909159348 -0500
+++ linux-3.6/arch/arm/boot/dts/imx23.dtsi   2012-09-30 18:47:46.000000000 -0500
@@ -257,26 +257,14 @@
                  0x00c1 /* MX23_PAD_GPMI_D12__LCD_D22 */
                  0x00d1 /* MX23_PAD_GPMI_D13__LCD_D23 */
                  0x1160 /* MX23_PAD_LCD_DOTCK__LCD_DOTCK */
-               //   0x1170 /* MX23_PAD_LCD_ENABLE__LCD_ENABLE */
-               //   0x1180 /* MX23_PAD_LCD_HSYNC__LCD_HSYNC */
+                  0x1170 /* MX23_PAD_LCD_ENABLE__LCD_ENABLE */
+                  0x1180 /* MX23_PAD_LCD_HSYNC__LCD_HSYNC */
                  0x1190 /* MX23_PAD_LCD_VSYNC__LCD_VSYNC */
               >;
               fsl,drive-strength = <0>;
               fsl,voltage = <1>;
               fsl,pull-up = <0>;
            };
-
-            i2c0_pins_a: i2c0@0 {
-               reg = <0>;
-               fsl,pinmux-ids = <
-               0x1170 /* MX23_PAD_LCD_ENABLE__LCD_ENABLE */
-               0x1180 /* MX23_PAD_LCD_HSYNC__LCD_HSYNC */
-               >;
-               fsl,drive-strength = <1>;
-               fsl,voltage = <1>;
-               fsl,pull-up = <1>;
-            }
-
         };

         digctl@8001c000 {
@@ -383,11 +371,6 @@

         i2c@80058000 {
            reg = <0x80058000 0x2000>;
-            #address-cells = <1>;
-            #size-cells = <0>;
-            compatible = "fsl,imx28-i2c";
-            interrupts = <27 26>;
-            clock-frequency = <100000>;
            status = "disabled";
         };

diff -uNr linux-3.6.tcm/arch/arm/boot/dts/imx23-olinuxino.dts linux-3.6/arch/arm/boot/dts/imx23-olinuxino.dts
--- linux-3.6.tcm/arch/arm/boot/dts/imx23-olinuxino.dts   2012-10-01 13:31:37.141159336 -0500
+++ linux-3.6/arch/arm/boot/dts/imx23-olinuxino.dts   2012-09-30 18:47:46.000000000 -0500
@@ -39,24 +39,6 @@
            pinctrl-0 = <&duart_pins_a>;
            status = "okay";
         };
-
-         auart0: serial@8006c000
-         {
-              pinctrl-names = "default";
-            pinctrl-0 = <&auart0_2pins_a>;
-              status = "okay";
-         };
-
-         i2c0: i2c@80058000 {
-            pinctrl-names = "default";
-            pinctrl-0 = <&i2c0_pins_a>;
-            status = "okay";
-
-         };
-
-         usbphy@8007c000 {
-            status = "okay";
-         };
      };
   };
};
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 02, 2012, 06:03:48 pm
File imx23.dtsi is processors device tree file defining i.MX23 processor, and  imx23-olinuxino.dts is board device tree file defining olinuxino board resources.

- Processors device tree file  is provided by chip manufacturer - in this case Freescale. By default, no need to modify processors device tree file, except if something missing there.
- Board device tree file should be provided by board manufacturer - in this case Olimex. Initial kernel 3.x support is done by Freescale kernel developers.

Both files are not complete so i2c does not work. Since i2c interface is present in three different pin combinations, need 1st to define them in  imx23.dtsi and based on pins used by olinuxino to define them in imx23-olinuxino.dts.

Fadil Berisha


 

Title: Re: Support i2c micro using 3.x kernel
Post by: olimex on October 02, 2012, 07:24:27 pm
Hi Fadil

I'm not sure anybody here at Olimex have the necessary knowledge to add these manufacturer dts files, but I do not understand why in 2.6.x we had everything like audio, video encoder, i2c etc working and now in 3.x they are all broken :) is't there easy way to copy these from the early kernel and just "add" them to the new one?
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 02, 2012, 09:48:17 pm
Quotein 2.6.x we had everything like audio, video encoder, i2c etc working and now in 3.x they are all broken


Needed all drivers to adapt for device tree support. Most of them are already  in kernel 3.x, including usb suport, spi, i2c, lradc etc. I don't have info if somebody working on video and audio.

I did some work on spi and i2c patches for board device tree file - imx23-olinuxino.dts. I will post in this forum as soon I get done some breakout boards for hardware verification. 

Regards
Fadil Berisha
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 02, 2012, 10:01:15 pm
>I will post in this forum as soon I get done some breakout boards for hardware verification.
Or simply post your dts file if you want some tests :).
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 03, 2012, 12:00:08 am
Quote
Or simply post your dts file if you want some tests :).


No problem. Here is patch for i2c, both for imx23.dtsi and imx23-olinuxino.dts:

http://pastebin.com/HrgB1hAW

Patch apply to linux-next-20120914. As I stated before, i2c is present in three pin combinations (see part for imx23.dtsi). In olinuxino board, i2c interface is present in UEXT and extension connector. Patch imx23-olinuxino.dts is refered to chip  sgtl5000 and 2-Wire Serial EEPROM 24c32. If you don't have handy those breakout board, change code accordingly with your chip.

Please, post your finding.
Regards
Fadil Berisha
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 03, 2012, 12:21:46 am
For the micro, does USB phy have to be setup also?
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 03, 2012, 12:59:06 am
QuoteFor the micro, does USB phy have to be setup also?

I patched linux-next-20120914 with usb patch but was rejected. I did not study reason, but 1st think was probably Mike Thomson usb patch arrived on linux-next and no need any more to patch, so I reversed patch. I do not have micro. Please try without - if you get any micro's usb problem - post results.

Regards
Fadil Berisha
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 03, 2012, 01:39:30 am
Location of linux-next-2012091? Sorry rookie question...
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 03, 2012, 02:49:39 am
QuoteLocation of linux-next-2012091?


http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=194e4c45889657361868c10afac695cafbe72cd7

click on tag snapshot

Regards
Fadil Berisha

Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 03, 2012, 06:54:36 am
OK, built kernel using (buildroot for fs) used mxs_defconfig
USB
- Don't think it is finding the host controller
i2c
# i2cdetect -r 0
Error: Could not open file `/dev/i2c-0': No such device
# i2cdetect -l
Here is the boot:

[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Linux version 3.6.0-rc5-next-20120914 (tcmichals@tcmichals-RP8292
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine: Freescale i.MX23 (Device Tree), model: i.MX23 Olinuxinod
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat c04b95fc, node_mem_map c0a0c00
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16256 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc:
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 03, 2012, 07:56:08 pm
Hi tcmichals

I found source of error:

Quote# i2cdetect -r 0
Error: Could not open file `/dev/i2c-0': No such device


Error is because MXS I2C Adapter is not registered. I have look at mxs-i2c driver and found that is declared only for i.MX28. To go forward with our test, fastest way is to adapt patched file imx23.dtsi:

compatible = "fsl,imx23-i2c";
compatible = "fsl,imx28-i2c";

After booting, please run command:
dmesg | grep i2c

here is my result:
[    0.130000] i2c-core: driver [dummy] registered
[    0.470000] i2c i2c-0: adapter [MXS I2C adapter] registered
[    0.480000] i2c 0-000a: uevent
[    0.480000] i2c i2c-0: client [sgtl5000] registered with bus id 0-000a
[    0.480000] i2c 0-0051: uevent
[    0.480000] i2c i2c-0: client [24c32] registered with bus id 0-0051
[    0.950000] imx23-pinctrl 80018000.pinctrl: pin I2C_SCL already requested by 80058000.i2c; cannot claim for 8006c000.serial
[    1.200000] i2c /dev entries driver
[    1.200000] i2c-dev: adapter [MXS I2C adapter] registered as minor 0
[    1.300000] i2c-core: driver [sgtl5000] registered
[    8.520000] i2c 0-0051: uevent
[   10.830000] i2c 0-0051: uevent
[   10.830000] i2c 0-0051: uevent
[   11.510000] i2c 0-0051: uevent


As you can see, MXS I2C adapter is registered and also created /dev/i2c-0.

Could you please continue with testing. If everything is OK, I will submit patch http://pastebin.com/HrgB1hAW to kernel list and also fix mxs-i2c driver declaration for imx23.

Regads

Fadil Berisha
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 03, 2012, 09:26:12 pm
I tested on 3.6-rc2, i2c device is correctly created but I've got no activity on SDA/SCL.
I only tested with i2c0_pins_a configuration, nothing on CON1 55/56 and CON2 7/8-26/27 with OLS.
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 03, 2012, 11:06:41 pm

Thank you Niii,

I tested on 3.6-rc2, i2c device is correctly created but I've got no activity on SDA/SCL.

What breakout board - chip you have connected to i2c interface?
If you are looking only with oscilloscope, run this command:

echo "test" > /dev/i2c-0   

and check response in oscilloscope and screen.
Here is response in my system:
[  488.180000] i2c-dev: i2c-0 writing 5 bytes.
[  488.180000] i2c i2c-0: master_xfer[0] W, addr=0x00, len=5
[  488.190000] mxs-i2c 80058000.i2c: addr: 0x0000, len: 5, flags: 0x0, stop: 1
[  489.200000] mxs-i2c 80058000.i2c: Timeout!
-sh: echo: write error: Connection timed out

Looks good to me. I will make some breakout boards and post hardware verification.

Regards
Fadil Berisha
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 03, 2012, 11:17:29 pm

What breakout board

Micro board.

chip you have connected to i2c interface?

With and without tmp102 chip.

With echo "test" > /dev/i2c-0 :

root@micro:~# dmesg | grep i2c
[    1.010000] i2c /dev entries driver
root@micro:~# ls /dev/i2c*
/dev/i2c-0
root@micro:~# i2cdetect -l
i2c-0 i2c        MXS I2C adapter                  I2C adapter
root@micro:~# echo "test" > /dev/i2c-0
-bash: echo: erreur d'écriture : Connexion terminée par expiration du délai d'attente


Can you send me your sd_mmc_bootstream.raw file for test ?
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 03, 2012, 11:35:47 pm
Also, please remember on the micro PIN22, PIN21 must have pull ups, unless you cut and solder to the UEXT.  I cannot test until I get home.

Tim
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 03, 2012, 11:42:20 pm
I had not thought of that, let me try with.
[edit] Same with other i2c pins like pins 7/8 on con2 (for i2c0_pins_a) ?
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 04, 2012, 12:01:20 am
Niii,

At this time CON2, pins 7/8 are software based i2c and have pull-ups.  Chapter 6.11 of the manual and schematic may help you out.

Tim
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 04, 2012, 07:02:51 am
OK, yes it loads, but I have the same problem as before.  Same as Niii.  I did test the "wiring" with 2.6.35.x couple of weeks ago, guess can retry it.

I was debugging the same issue with linux-mainline, I had the same issue... But should the pins be:
i2c0_pins_a: i2c0@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x1171 /* MX23_PAD_LCD_ENABLE__I2C_SCL */
                  0x1181 /* MX23_PAD_LCD_HSYNC__I2C_SDA  */
               >;
               fsl,drive-strength = <1>;
               fsl,voltage = <1>;
               fsl,pull-up = <1>;
            };
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 04, 2012, 07:11:49 am
Which pins are you connected to?
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 04, 2012, 07:44:10 am
Question, when booting, urart, duart are found and a message appears:

[    0.110000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.150000] Serial: AMBA PL011 UART driver
[    0.150000] 80070000.serial: ttyAMA0 at MMIO 0x80070000 (irq = 127) is a PL011 rev2
[    0.330000] console [ttyAMA0] enabled
.....
[    0.880000] uart-pl011 80070000.serial: no DMA platform data
[    0.890000] 8006c000.serial: ttyAPP0 at MMIO 0x8006c000 (irq = 124) is a 8006c000.serial
[    0.900000] mxs-auart 8006c000.serial: Found APPUART 3.0.0


[    1.020000] stmp3xxx-rtc 8005c000.rtc: rtc core: registered 8005c000.rtc as rtc0
[    1.030000] i2c /dev entries driver
but there is no address info for i2c, like there is for RTC, dual, uart, so it is not finding it? or still an Init issue?
Also, still no USB... wonder if there is something in common.. also, no LED...
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 04, 2012, 06:55:12 pm
Oh, OK see why USB does not work, must have:
.compatible = "fsl,imx27-usb"
defined in the device tree or the chipidea driver is not loaded.  Will fix that tonight..
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on October 04, 2012, 07:41:29 pm
Quote from: tcmichals on October 04, 2012, 07:02:51 am
... But should the pins be:
i2c0_pins_a: i2c0@0 {
               reg = <0>;
               fsl,pinmux-ids = <
                  0x1171 /* MX23_PAD_LCD_ENABLE__I2C_SCL */
                  0x1181 /* MX23_PAD_LCD_HSYNC__I2C_SDA  */
               >;
               fsl,drive-strength = <1>;
               fsl,voltage = <1>;
               fsl,pull-up = <1>;
            };

Yes, pins are correct, please refer to attached schematic:
https://docs.google.com/open?id=0B5yGbFXTEhQpaTRWaE1zWU0ycVU (https://docs.google.com/open?id=0B5yGbFXTEhQpaTRWaE1zWU0ycVU) (Mozilla: right click, View Image --> Zoom).
As you can see, pins are present on GPIO Connector, but you wish, you can switch I2C pins on UEXT connector.
Please note also that device tree pin nomenclature is in format:
<PIN_NAME__PIN_FUNCTION>.
Example: PIN_NAME -> LCD_ENABLE with function I2C_SCL became LCD_ENABLE__I2C_SCL.

Regards
Fadil Berisha
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 04, 2012, 08:47:06 pm
Yes, I did that last night, still not working... Guess will reload an older kernel to validate everything is working..
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 06, 2012, 07:15:41 am
loaded OE, Linux imx233-olinuxino-micro 2.6.35.3-10.12.01+yocto+g0ea8cb9 #1 PREEMPT Fri Oct 5 21:07:30 CDT 2012 armv5tejl GNU/Linux.  Did not move any wiring and it all worked fine.  So, guess little lost on what is wrong.
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 07, 2012, 01:18:58 am
Just another test with debug output (on r3.2):

root@micro:~# dmesg | grep i2c
[    0.120000] i2c-core: driver [dummy] registered
[    0.430000] i2c i2c-0: adapter [MXS I2C adapter] registered
[    0.440000] i2c 0-000a: uevent
[    0.440000] i2c i2c-0: client [sgtl5000] registered with bus id 0-000a
[    0.440000] i2c 0-0051: uevent
[    0.440000] i2c i2c-0: client [24c32] registered with bus id 0-0051
[    1.030000] i2c /dev entries driver
[    1.030000] i2c-dev: adapter [MXS I2C adapter] registered as minor 0
[    1.120000] i2c-core: driver [sgtl5000] registered
[    4.200000] i2c 0-0051: uevent
[    5.020000] i2c 0-0051: uevent
[    5.560000] i2c 0-0051: uevent
root@micro:~# i2cdetect -l
i2c-0 i2c        MXS I2C adapter                  I2C adapter
root@micro:~# i2cdetect 0
Error: Can't use SMBus Quick Write command on this bus (ISA bus?)
root@micro:~# i2cdetect -r 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n]
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- UU -- ^C
root@micro:~# dmesg | grep i2c
[    0.120000] i2c-core: driver [dummy] registered
[    0.430000] i2c i2c-0: adapter [MXS I2C adapter] registered
[    0.440000] i2c 0-000a: uevent
[    0.440000] i2c i2c-0: client [sgtl5000] registered with bus id 0-000a
[    0.440000] i2c 0-0051: uevent
[    0.440000] i2c i2c-0: client [24c32] registered with bus id 0-0051
[    1.030000] i2c /dev entries driver
[    1.030000] i2c-dev: adapter [MXS I2C adapter] registered as minor 0
[    1.120000] i2c-core: driver [sgtl5000] registered
[    4.200000] i2c 0-0051: uevent
[    5.020000] i2c 0-0051: uevent
[    5.560000] i2c 0-0051: uevent
[  172.280000] i2c i2c-0: ioctl, cmd=0x705, arg=0xbeae8bf0
[  174.600000] i2c i2c-0: ioctl, cmd=0x705, arg=0xbe8ecc98
[  178.520000] i2c i2c-0: ioctl, cmd=0x705, arg=0xbecabc98
[  179.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x03
[  179.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  179.770000] i2c i2c-0: master_xfer[0] R, addr=0x03, len=1
[  179.770000] mxs-i2c 80058000.i2c: addr: 0x0003, len: 1, flags: 0x1, stop: 1
[  180.770000] mxs-i2c 80058000.i2c: Timeout!
[  180.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x04
[  180.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  180.770000] i2c i2c-0: master_xfer[0] R, addr=0x04, len=1
[  180.770000] mxs-i2c 80058000.i2c: addr: 0x0004, len: 1, flags: 0x1, stop: 1
[  181.770000] mxs-i2c 80058000.i2c: Timeout!
[  181.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x05
[  181.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  181.770000] i2c i2c-0: master_xfer[0] R, addr=0x05, len=1
[  181.770000] mxs-i2c 80058000.i2c: addr: 0x0005, len: 1, flags: 0x1, stop: 1
[  182.770000] mxs-i2c 80058000.i2c: Timeout!
[  182.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x06
[  182.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  182.770000] i2c i2c-0: master_xfer[0] R, addr=0x06, len=1
[  182.770000] mxs-i2c 80058000.i2c: addr: 0x0006, len: 1, flags: 0x1, stop: 1
[  183.770000] mxs-i2c 80058000.i2c: Timeout!
[  183.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x07
[  183.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  183.770000] i2c i2c-0: master_xfer[0] R, addr=0x07, len=1
[  183.770000] mxs-i2c 80058000.i2c: addr: 0x0007, len: 1, flags: 0x1, stop: 1
[  184.770000] mxs-i2c 80058000.i2c: Timeout!
[  184.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x08
[  184.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  184.770000] i2c i2c-0: master_xfer[0] R, addr=0x08, len=1
[  184.770000] mxs-i2c 80058000.i2c: addr: 0x0008, len: 1, flags: 0x1, stop: 1
[  185.770000] mxs-i2c 80058000.i2c: Timeout!
[  185.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x09
[  185.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  185.770000] i2c i2c-0: master_xfer[0] R, addr=0x09, len=1
[  185.770000] mxs-i2c 80058000.i2c: addr: 0x0009, len: 1, flags: 0x1, stop: 1
[  186.770000] mxs-i2c 80058000.i2c: Timeout!
[  186.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x0a
[  186.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x0b
[  186.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  186.770000] i2c i2c-0: master_xfer[0] R, addr=0x0b, len=1
[  186.770000] mxs-i2c 80058000.i2c: addr: 0x000b, len: 1, flags: 0x1, stop: 1
[  187.770000] mxs-i2c 80058000.i2c: Timeout!
[  187.770000] i2c i2c-0: ioctl, cmd=0x703, arg=0x0c
[  187.770000] i2c i2c-0: ioctl, cmd=0x720, arg=0xbecabc8c
[  187.770000] i2c i2c-0: master_xfer[0] R, addr=0x0c, len=1
[  187.770000] mxs-i2c 80058000.i2c: addr: 0x000c, len: 1, flags: 0x1, stop: 1
[  188.770000] mxs-i2c 80058000.i2c: Timeout!
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 07, 2012, 03:16:17 am
Oh, found an issue with the device tree, the interrupts are backwards..

                      i2c@80058000 {
+                       i2c0: i2c@80058000 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "fsl,imx23-i2c";
                                reg = <0x80058000 0x2000>;
+                               interrupts = <26 27>;  <-----  needs to be 27, 26  Error first, DMA second.. this is with 3.6 I have no idea about linux-next with DMA... the ERROR int 27 and DMA is 26...
+                               clock-frequency = <100000>;
                                status = "disabled";
                        };

Oh course that did not do anything, I'm tracing multiple issues..
1) USB, think it is a voltage/phy..
2) I2c, I was using linux-mainline.. and that is where I found the issue with the ISR... so.. moving to 3.6, because there are fixes about the data rate..
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 07, 2012, 04:40:25 am
OK found out the issue with usb on 3.6:
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-June/105247.html
Need this patch... but now it will not enumerate.. does this over and over..
There must be another patch somewhere because the linux-mainline has this fixed.. so.. hope some one can point that out..
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 07, 2012, 07:12:30 am
Where is the latest driver i2c-mxs.c with DMA support?  the old 2.6.35 driver, I cannot find where the ABPX timings are set.  I see clocks.. but I think these are to slow.. need to figure out if this is the issue..
Title: Re: Support i2c micro using 3.x kernel
Post by: earny on October 07, 2012, 12:27:50 pm
[V4] MXS: Implement DMA support into mxs-i2c

https://patchwork.kernel.org/patch/1369781/

"On a mx28evk: Tested-by: Fabio Estevam <fabio.estevam@freescale.com>"
:-)
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on October 07, 2012, 01:08:57 pm
Same result with DMA patch and interrupts backwards on 3.6-rc2.
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 08, 2012, 04:11:20 am
OK.. I move the I2C to the default pins, 127/128 and nothing... So to me it has to be the APBX clock.. A lot of the code is different so.. maybe that is it..
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 08, 2012, 05:15:37 pm
The imx233 support is being added and should be complete in 3.7-rc1, in a couple of weeks. So, I'm going to wait until then or when i2c-mxs.c changes in the linux-next tree.

Here is a thread on google groups.
https://groups.google.com/forum/#!topic/meta-fsl-arm/rxoukULHqZQ
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on October 13, 2012, 05:53:42 am
Well Linux version 3.6.0-next-20121012 is a lot better then the 3.2, reboots, USB works out of the box. Can unplug/replug etc.  SPI driver, but i2c is still having issues:
-- [  100.630000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.

But, posted email back to the kernel people see what I did wrong...
Title: Re: Support i2c micro using 3.x kernel
Post by: tcmichals on November 05, 2012, 05:20:38 pm
Finally my message got posted to the linux-arm group on why the following message appears using i2c...
Testing i2c in 3.6.0-next-20121012 for i.mx233
Even with the 3.7-rc2 I get the same message...

Using the 3.6.0-next-20121012  to test i2c DMA support on a imx233-Olinuxino-micro board.  When using the i2cdetect -r 0 to scan a devices on the i2c bus,  the following message is displayed on the console:

-- [  129.130000] mxs-i2c 80058000.i2c: Failed to get PIO reg. write descriptor.

imx23.dtsi support for i2c:
i2c0_pins_a: i2c0@0 {
reg = <0>;
fsl,pinmux-ids = <
0x1171 /* MX23_PAD_LCD_ENABLE__LCD_ENABLE */
0x1181 /* MX23_PAD_LCD_HSYNC__LCD_HSYNC */
>;
fsl,drive-strength = <1>;
fsl,voltage = <1>;
fsl,pull-up = <1>;
};
...
i2c@80058000 {
#address-cells = <1>;
                               #size-cells = <0>;
compatible = "fsl,imx28-i2c";
reg = <0x80058000 0x2000>;
interrupts = <27 26>;
clock-frequency = <400000>;
fsl,i2c-dma-channel = <3>;
status = "disabled";
};
imx23-olinuxino.dts
i2c0: i2c@80058000 {
     pinctrl-names = "default";
                               pinctrl-0 = <&i2c0_pins_a>;
                               status = "okay";
                       };
Title: Re: Support i2c micro using 3.x kernel
Post by: Niii on December 18, 2012, 08:06:14 pm
Hi,

There are news about i2c on kernel 3.x on micro board ?
It's still not working ?
Title: Re: Support i2c micro using 3.x kernel
Post by: Fadil Berisha on December 18, 2012, 10:44:32 pm
Quote from: Niii on December 18, 2012, 08:06:14 pm
Hi,

There are news about i2c on kernel 3.x on micro board ?
It's still not working ?

You can find olinuxino patches following this link:
https://www.olimex.com/forum/index.php?topic=283.msg1236#msg1236

Fadil Berisha