I2C woes

47 views
Skip to first unread message

evilwulfie

unread,
Feb 10, 2018, 4:19:05 PM2/10/18
to BeagleBoard
More infos

after reading a bit and seeing where to look I may have found the error msg.

root@beaglebone:/home/debian# dmesg | grep i2c
[    0.817817] omap_i2c 44e0b000.i2c: could not find pctldev for node
/ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring
probe
[    0.818857] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[    0.820424] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    1.710864] i2c /dev entries driver
[    1.942267] input: tps65217_pwr_but as
/devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0
[    1.943439] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[  205.003986] omap_i2c 4802a000.i2c: timeout waiting for bus ready
[  206.012018] omap_i2c 4802a000.i2c: timeout waiting for bus ready
[  207.020050] omap_i2c 4802a000.i2c: timeout waiting for bus ready
root@beaglebone:/home/debian#

4802a000.i2c seems to be I2C1

 aliases {
                i2c0 = "/ocp/i2c@44e0b000";
                i2c1 = "/ocp/i2c@4802a000";
                i2c2 = "/ocp/i2c@4819c000";

so it seems there may be a pinmux issue ?

this is on a stock image free standing BBG

I am a hardware dude.      Whats all this software stuff anyhow?  ;)


evilwulfie

unread,
Feb 10, 2018, 5:27:17 PM2/10/18
to BeagleBoard
I will keep looking into this.
more infos

I took the current DTB file and decompiled it
I looked at the I2C sections

i2c0 = "/ocp/i2c@44e0b000";
i2c1 = "/ocp/i2c@4802a000";
i2c2 = "/ocp/i2c@4819c000";


                i2c@44e0b000 {
                        compatible = "ti,omap4-i2c";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        ti,hwmods = "i2c1";
                        reg = <0x44e0b000 0x1000>;
                        interrupts = <0x46>;
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0 = <0x32>;
                        clock-frequency = <0x61a80>;
                        linux,phandle = <0xa0>;
                        phandle = <0xa0>;


                        with PMIC infos below this


               i2c@4802a000 {
                        compatible = "ti,omap4-i2c";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        ti,hwmods = "i2c2";
                        reg = <0x4802a000 0x1000>;
                        interrupts = <0x47>;
                        status = "disabled";                           
<---------------------------  anybody know why this is listed as disabled ?
                        linux,phandle = <0xa9>;
                        phandle = <0xa9>;

nothing below this as the processor pins are not connected to anything
except  
"P9.18",    /* i2c1_sda */         "P9.17", /* i2c1_scl */


 i2c@4819c000 {
                        compatible = "ti,omap4-i2c";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        ti,hwmods = "i2c3";
                        reg = <0x4819c000 0x1000>;
                        interrupts = <0x1e>;
                        status = "okay";
                        pinctrl-names = "default";
                        pinctrl-0;
                        clock-frequency = <0x186a0>;
                        linux,phandle = <0xaa>;
                        phandle = <0xaa>;

                        With cape eprom infos below.

It would seem to me that even though we have a /dev/I2C-1 its somehow
not enabled for use
IF i do a i2cdetect and grep dmesg it just repeats a bus timeout

I am at a dead end on this for my knowledge any help would be appreciated

   


Graham

unread,
Feb 10, 2018, 8:43:06 PM2/10/18
to BeagleBoard
Wulfie:

I am not an expert at Device Tree stuff, but this is what I think I know.
I2C-0 is intended for internal board management, so sort of reserved, except as a last resort.
I2C-1 is available, but not enabled, on the BBB and is enabled/implemented on the PocketBeagle, so you could always look at the PocketBeagle implementation.
The I2C-1 pins are default assigned to other things, so they will need to be re-assigned to the I2C-1 peripheral if used.
It would make sense that I2C-1 was not enabled, if not used by default on the BBB.
I2C-2 is enabled/implemented on the BBB and the PocketBeagle.  It is the primary bus for cape memory access, so it is always there.
The DTB you were looking at seems to have an off-by-one number assignment, with respect to the bus numbers used by Linux.
I don't understand why or how.
There was a definite off-by-one issue with the I2C bus assignments for Debian 7 and prior.

--- Graham

==

Stuart Longland

unread,
Feb 10, 2018, 8:56:23 PM2/10/18
to beagl...@googlegroups.com
On 11/02/18 11:43, Graham wrote:
> I am not an expert at Device Tree stuff, but this is what I think I know.
> I2C-0 is intended for internal board management, so sort of reserved,
> except as a last resort.
> I2C-1 is available, but not enabled, on the BBB and is
> enabled/implemented on the PocketBeagle, so you could always look at the
> PocketBeagle implementation.

I figure then, if we want to hook our own stuff up, then I²C1 is the
preferred port to use? In my case I'm running a PocketBeagle, and while
I've hooked up headers to I²C0, I haven't yet exposed those.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
...it's backed up on a tape somewhere.

evilwulfie

unread,
Feb 10, 2018, 9:01:07 PM2/10/18
to beagl...@googlegroups.com
This is the DTB file on the green  downloaded yesterday.
I dont understand that if its disabled why is there a /dev/i2c-1 file ?
They fixed the numbering starting with the 9.1 images from what i can read.
If it needs to be enabled how would one go about enabling it ?
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/ffb81f8b-92dd-4c7d-bde8-42ddcf981e92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

evilwulfie

unread,
Feb 10, 2018, 10:27:35 PM2/10/18
to beagl...@googlegroups.com
Robert nelson had answered this back in december
I searched this once and must have missed this.



Robert Nelson
12/27/17
Other recipients: simo...@gmail.com
- show quoted text -
We've moved to u-boot overlays, to achieve the same follow:

https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays

and set:

uboot_overlay_addr0=/lib/
firmware/BB-I2C1-00A0.dtbo

in /boot/uEnv.txt

Regards,

--
Robert Nelson
https://rcn-ee.com/

once done its working great now.


its odd that there is a /dev/i2c-1 file before this overlay is loaded. Its what threw me for a loop.



On 2/10/2018 6:43 PM, Graham wrote:

Graham Haddock

unread,
Feb 10, 2018, 11:43:07 PM2/10/18
to BeagleBoard
On the PocketBeagle, both I2C-1 and I2C-2 are both brought out to the headers and both enabled by default.
I don't know that there is any reason to prefer one over the other on the PocketBeagle.

--- Graham

==

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/RU6TUpBEwpI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/84e8df94-7cfc-e50c-d188-b9507631cdb9%40longlandclan.id.au.
Reply all
Reply to author
Forward
0 new messages