Hi All,
We are planing to use AM335x in one of our projects.
I have the following observation or issue with I2C1 controller on BeagleBoneBlack.
Note: I have a slave device that is having pull-up resistor on the bus.
From the BeagleBoneBlack software user-manual I understand we can use Header-P9 for using the I2C1 controller and it can be used in the following two ways
I have did this modification in the file arch/arm/boot/dts/am335x-bone-common.dtsi
1) using P9-18 (B16) & P9-17 (A16) pins of Header, for this I have added the following pin-mux, and enabled the device as shown below
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
0x158 0x72 /* P9-18 (B16) spi0_d1.I2C1_SDA, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
0x15c 0x72 /* P9-17 (A16) spi0_cs0.I2C1_SCL, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
>;
};
&i2c1 {
status = "okay";
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
myslave: myslave@38 {
compatible = "gvk,myslave";
reg = <0x38>;
};
};
With this I am able to access the slave device and I have verified it is working fine with i2cdetect -r 1
# i2cdetect -r 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 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: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- 14 -- -- -- -- -- -- 1b -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
50: 50 -- UU 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
70: -- -- -- -- -- -- -- --
#
2) using P9-24 (D16) & P9-26 (D15) pins of Header, for this I have added the following pin-mux,
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
0x180 0x73 /* P9-24 (D16) uart1_rxd.I2C1_SDA, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
0x184 0x73 /* P9-26 (D15) uart1_txd.I2C1_SCL, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
>;
};
&i2c1 {
status = "okay";
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pins>;
myslave: myslave@38 {
compatible = "gvk,myslave";
reg = <0x38>;
};
};
With this I am failing to access my slave and i2cdectect is throwing the below output
# i2cdetect -r 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 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: [ 298.922093] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [ 299.931852] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [ 300.941619] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [ 301.951383] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [ 302.961148] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- [ 303.970914] omap_i2c 4802a000.i2c: timeout waiting for bus ready
-- ^C[ 304.980684] omap_i2c 4802a000.i2c: timeout waiting for bus ready
Please help me If I am missing any configurations.
I have observed the following behaviour
I have done configuration as scenario-2 explained above.
i2c1_pins: pinmux_i2c1_pins {
pinctrl-single,pins = <
0x180 0x73 /* P9-24 (D16) uart1_rxd.I2C1_SDA, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
0x184 0x73 /* P9-26 (D15) uart1_txd.I2C1_SCL, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
>;
};
With this mux configuration I should use P9header 24& 26 pins, which is failing to work, but with the same configuration
I am able to access the slave device from the P9 Header 17 & 18 pins, does this mean mux configurations are over-written?
Please give inputs/pointer for debugging this.
Need help at the earliest,
Thanks & Regards,
Vamshi G.