This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: Try to use i2c1 as u-boot command

Part Number: AM3358


Tool/software: Linux

Hi all,

I try to use i2c1 in u-boot. First, I enabled i2c1 as dts file like below:

&am33xx_pinmux {
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
0x158 (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_d1.i2c1_sda */
0x15c (PIN_INPUT_PULLUP | MUX_MODE2) /* spi0_cs0.i2c1_scl */
>;
};
};

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

};

When power my board, I can see i2c bus 1. But I can probe any address on this bus.

=> i2c dev 1
Setting bus to 1
=> i2c probe
Valid chip addresses: 18 68i2c_probe: pads on bus probably not configured (status=0x10)
i2c_probe: pads on bus probably not configured (status=0x10)
i2c_probe: pads on bus probably not configured (status=0x10)
i2c_probe: pads on bus probably not configured (status=0x10)

=> i2c bus
Bus 0: i2c@44e0b000
Bus 1: i2c@4802a000 (active 1)
18: generic_18, offset len 1, flags 0
68: generic_68, offset len 1, flags 0
Bus 2: i2c@4819c000

When I try to read value of register as address 0x18

=> i2c md 0x18 0.1 0x00
Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus are properly configured

In the kernel, I can use i2c bus 1. Please give me some advances for this case. My u-boot version is 2016.11-rc3

Thank you,

Hiep Nguyen

 

  • Hi Hiep,

    Do you use AM335x TI board or custom board?

    Do you use AM335x TI PSDK? If yes, which version?

    Regards,
    Pavel
  • I'm working on custom board base on Beaglebone Black. I clone u-boot source code from github with version above.
    Regards,
    Hiep Nguyen
  • Hiep,

    I would suggest you to try with u-boot coming with AM335x PSDK (link below) or below git branch.

    software-dl.ti.com/.../index_FDS.html


    uBoot Version: 2018.01
    uBoot Description: v2018.01-227-g131dc82
    Clone: git://git.ti.com/ti-u-boot/ti-u-boot.git
    Branch: ti-u-boot-2018.01
    uBoot Tag: ti2018.01


    Regards,
    Pavel
  • Hi Pavel,

    In this version, How can I enable i2c bus 1 in the source code?
    Thanks,
    Hiep Nguyen
  • Hiep,

    Nguyen Hiep said:

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

    };

    Nguyen Hiep said:
    When I try to read value of register as address 0x18

    You need to add a node describing the device you have attached on i2c1 bus addr 0x18. See for example AM335x TI EVM, it has LIS331DLH accelerometer attached on i2c1 addr 0x18:

    u-boot/arch/arm/dts/am335x-evm.dts

    &i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins>;

        status = "okay";
        clock-frequency = <100000>;

        lis331dlh: lis331dlh@18 {
            compatible = "st,lis331dlh", "st,lis3lv02d";
            reg = <0x18>;
            Vdd-supply = <&lis3_reg>;
            Vdd_IO-supply = <&lis3_reg>;

            st,click-single-x;
            st,click-single-y;
            st,click-single-z;
            st,click-thresh-x = <10>;
            st,click-thresh-y = <10>;
            st,click-thresh-z = <10>;
            st,irq1-click;
            st,irq2-click;
            st,wakeup-x-lo;
            st,wakeup-x-hi;
            st,wakeup-y-lo;
            st,wakeup-y-hi;
            st,wakeup-z-lo;
            st,wakeup-z-hi;
            st,min-limit-x = <120>;
            st,min-limit-y = <120>;
            st,min-limit-z = <140>;
            st,max-limit-x = <550>;
            st,max-limit-y = <550>;
            st,max-limit-z = <750>;
        };

    Regards,
    Pavel

  • If you have no more questions related to the subject of this e2e thread, please close/verify/resolve this thread.

    Regards,
    Pavel