IMX6sx I2C-2 dose not work

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

IMX6sx I2C-2 dose not work

2,141 Views
wangrui
Contributor I

Hi

imx6sx was used on my board.  I am using i2c to read information of optical module.  DTS of my board is like this:

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

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

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


        pinctrl_i2c1: i2c1grp {
            fsl,pins = <
                MX6SX_PAD_GPIO1_IO01__I2C1_SDA        0x4001b8b1
                MX6SX_PAD_GPIO1_IO00__I2C1_SCL        0x4001b8b1
            >;
        };

        pinctrl_i2c2: i2c2grp {
            fsl,pins = <
                MX6SX_PAD_QSPI1B_DATA2__I2C2_SDA    0x4001b8b1
                MX6SX_PAD_QSPI1B_DATA3__I2C2_SCL    0x4001b8b1
            >;
        };

        pinctrl_i2c3: i2c3grp {
            fsl,pins = <
                MX6SX_PAD_KEY_ROW4__I2C3_SDA        0x4001b8b1
                MX6SX_PAD_KEY_COL4__I2C3_SCL        0x4001b8b1
            >;
        };

Pads of i2c1 & i2c3 are similar to imx6sxsabresd, but i2c2 is different(QSPI1B_DATA2->i2c sda, QSPI1B_DATA3->i2c scl).   

I can access the optical module via i2c1. but i2c2 dose not work. no signal was found on pad QSPI1B_DATA2 & pad QSPI1B_DATA3 when i am trying to read from i2c2.

But I can control the voltage of pad QSPI1B_DATA2 & pad QSPI1B_DATA3 under u-boot, therefore, it seems that the hardware is correct. 

is there anyone who can help me?   thx...

Labels (3)
Tags (3)
0 Kudos
3 Replies

1,386 Views
wangrui
Contributor I

hi Diego

   thanks for your reply.

   But I have another question aboot "SION".

"

SION(1 << 30): Software Input On Field. Force the selected mux mode input path no matter of MUX_MODE functionality. By default the input path is determined by functionality of the selected mux mode (regular).

"

MX6SX_PAD_QSPI1B_DATA3__I2C2_SCL    0x4001b8b1

0x40000000 means that "SION" is set. which means reg:0x20e01ac was set to 0x11 when i2c-2 was initialized by linux

also,

MX6SX_PAD_GPIO1_IO00__I2C1_SCL        0x4001b8b1

0x40000000 means that "SION" is set. which means reg:0x20e0014 was set to 0x10 when i2c-1 was initialized by linux

I don't quite understand. is PAD GPIO1 IO00 work in GPIO mode,but not i2c mode,if reg:0x20e0014 was set to 0x10?  is PAD QSPI1B_DATA3 work in QSPI1B_DATA3 mode,but not i2c mode if 0x20e01ac was set to 0x11.   I thought that was wrong, but when I change the value like this:

 pinctrl_i2c1: i2c1grp {
            fsl,pins = <
                MX6SX_PAD_GPIO1_IO01__I2C1_SDA        0x0001b8b1
                MX6SX_PAD_GPIO1_IO00__I2C1_SCL        0x0001b8b1
            >;
        };

without "SION" , even the i2c-1 does not work either.   why?

0 Kudos

1,386 Views
wangrui
Contributor I

plus, OS: linux 4.19.2

dmesg  about  I2C

******driver_probe_device:drv->name=imx-i2c, drv->bus->name=platform
pinctrl_bind_pins 1
pinctrl_select_state
pin_request 6 3 (null)->21a0000.i2c!
pin_request 5 3 (null)->21a0000.i2c!
I2C clock done!
i2c i2c-0: IMX I2C adapter registered
i2c i2c-0: can't use DMA, using PIO instead.
******driver_probe_device:drv->name=imx-i2c, drv->bus->name=platform
pinctrl_bind_pins 1
pinctrl_select_state
pin_request 106 3 (null)->21a4000.i2c!
pin_request 107 3 (null)->21a4000.i2c!
I2C clock done!
i2c i2c-1: IMX I2C adapter registered
i2c i2c-1: can't use DMA, using PIO instead.
******driver_probe_device:drv->name=imx-i2c, drv->bus->name=platform
pinctrl_bind_pins 1
pinctrl_select_state
pin_request 50 3 (null)->21a8000.i2c!
pin_request 45 3 (null)->21a8000.i2c!
I2C clock done!
i2c i2c-2: IMX I2C adapter registered
i2c i2c-2: can't use DMA, using PIO instead.
videodev: Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

0 Kudos

1,386 Views
diegoadrian
NXP Employee
NXP Employee

Hello,

Unfortunately, you are not using an official BSP from NXP is hard for us to help you in that way. We recommend you to use our official BSPs otherwise we cannot guarantee anything. Nevertheless, the problem seems to be that you are configuring in the wrong way the pin muxing on the device tree. Please see the below link. Probably it could help you.

fsl,imx-pinctrl.txt\pinctrl\bindings\devicetree\Documentation - linux-imx - i.MX Linux kernel 

Best Regards,

Diego.

0 Kudos