Jump to content

Overlays in armbianEnv.txt


Recommended Posts

Hi,

I am using mainline 4.10.0-sun8i and to enable I2C I added:

overlays=sun8i-h3-i2c0

to  armbianEnv.txt and rebooted, then I checked:

cat /proc/device-tree/soc/i2c\@01c2b400/status

and still found that it was disabled, I feel that I may be missing a step, like having to compile armbianEnv.txt into the config script, is that so?

 

Just to make sure it wasn't working, i changes the pins to I2C using:

sunxi-pio -m PA11'<2>'
sunxi-pio -m PA12'<2>'

BTW. sunxi-pio has very few code comments, did not specify the field order and finding which bits to flip in the H3 data sheet was annoying, did you want me to fix and submit a pull request adding these things? Or is this tool only for devs anyway?

 

Then I attached a logic analyser and an I2C device to the bus and found no clock or signal and i2cdetect found no devices.

 

Could you please let me know what I am not doing with the overlay config that enables /soc/i2c@01c2ac00 or do i just have to DTS the sun8i-h3-orangepi-pc.dtb and change the status to "okay" manually then recompile?

 

Thanks for your assistance,

Matt.

Link to comment
Share on other sites

you wish to have i2c0 with /soc/i2c@01c2ac00 enabled, but you confusingly doing a "cat /proc/device-tree/soc/i2c\@01c2b400/status" which is not the same port.

Are you sure that none of the port shows up ? Did you check "dmesg" output ? Which board do you have ?

 

Link to comment
Share on other sites

Hi Martinayotte,

Thanks very much for replying, good pick up, sorry about that, I copy/pasted the wrong bit of text, but i did check /proc/device-tree/soc/i2c\@01c2ac00/status .

 

The board I am using is the Orange Pi PC, I didn't mention it as i specified the sun8i-h3-orangepi-pc.dtb, but i guess that can be used for another H3 board, I really must stop making silly assumptions.

 

I'll add a bit more info to make it clearer what is happening:

 

i2cdetect -l returns:

i2c-0	i2c       	mv64xxx_i2c adapter             	I2C adapter

 

and even though I have two I2C devices powered on and plugged in, i2cdetect -y 0 returns:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

dmesg:

matt@orangepipc:~$ dmesg | grep i2c
[    3.682470] i2c /dev entries driver

 

Thanks again for your valuable assistance.

 

Link to comment
Share on other sites

Hi Guys,

 

The regulator at 0x65 is on bus i2c@01f02400,  this bus is not connected to the gpio header pins and is enabled by default (i did not need to enable it) as the cpu needs it.

 

The overlay sun8i-h3-i2c0.dtbo enables the /soc/i2c@01c2ac00 bus, this is the bus that connects to pins PA11 and PA12 on the header:

 

root@orangepipc:/# dtc -I dtb -O dts /boot/dtb/overlay/sun8i-h3-i2c0.dtbo
/dts-v1/;

/ {
	compatible = "allwinner,sun8i-h3";

	fragment@0 {
		target-path = "/aliases";

		__overlay__ {
			i2c0 = "/soc/i2c@01c2ac00";
		};
	};

	fragment@1 {
		target = <0xffffffff>;

		__overlay__ {
			status = "okay";
		};
	};

	__fixups__ {
		i2c0 = "/fragment@1:target:0";
	};
};

I'm pretty sure it isn't a wiring issue as i am checking the clock and data lines directly with a logic analyser, and i'm not getting a signal on either line, I would also think that if the /soc/i2c@01c2ac00 bus was working it would not have a status of "disabled".

 

Any other ideas to get this overlay to work or should I just go ahead and and adjust the sun8i-h3-orangepi-pc.dtb and change the status to "okay" manually then recompile?

Link to comment
Share on other sites

Yeah, I have found that the only active I2c bus is the one reported by i2cdetect -l above, and that happens to be the one with the regulator.

 

Thanks for all you assistance and suggestions.

Link to comment
Share on other sites

Just to finalise this thread, I got the other I2c bus working by editing the sun8i-h3-orangepi-pc.dtb (converted to dts first then recompiled) directly, as it looks like the overlay is wrong that ships with the mainline stable distro.

It seems that @zador.blood.stained has fixed it already in the overlays repo:  https://github.com/zador-blood-stained/sunxi-DT-overlays-armbian

(see sun8i-h3-i2c0.dts for more info)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines