AML-S905-CC i2c-1 pull-up resistors

Out of curiosity, would the I2C-1 port (the one that goes to 7J1 pins 3&5) have built-in pull-up resistors on the AML-S905X-CC or would it need external ones? They’re not present on the schematic but might be integrated in the CPU itself and the datasheets seem to be only available to Amlogic customers and partners.

I’m not sure that AML-S805X-AC can do hardware I2C on pin 3 and 5. Will probably have to do software GPIO per AML-S805X-AC Headers - Google Tabellen
I don’t think the overlay is in https://github.com/libre-computer-project/libretech-wiring-tool as most of the AML-S805X-AC overlays were copied over and haven’t been thoroughly tested yet.

The pin biases are set in the device tree in the bootloader. If you notice some bugs with pin biases for various functions, let us know and we can fix them.

Sorry, I misread. The pin biases should be fixed in the latest AML-S905X-CC bootloaders already. I think I tested the I2C-1 functions last week.

https://boot.libre.computer/ci/

dd if=aml-s905x-cc of=/dev/mmcblk1 bs=512 seek=1

Thanks! Sorry that was a typo on my part, I did mean the AML-S905X-CC, not the 805. I design my daughterboards with provisions for pull-up resistors just in case, so I wanted to figure out if I should leave the pads unpopulated or not. If the pin biases are already fixed I’ll leave the resistors off the board.

1 Like

Yes, you shouldn’t need the pull-ups anymore. By default they were set without bias in the device tree. We have modified them with the proper pull-ups when used as I2C.

Hi,

I’m a bit confused here. When I apply sudo ldto enable i2c-ao then I have an I2C device called i2c-0 when running i2cdetect -l (i2cdetect is part of the i2c-tools package: sudo apt install i2c-tools):

pi@librecomputer:~/mystuff/librecomp $ i2cdetect -l
i2c-0   i2c             Meson I2C adapter                       I2C adapter

Also, when checking the content of the /dev directory, then I see:

pi@librecomputer:~/mystuff/librecomp $ lla /dev | grep i2c
0 crw-rw----  1 root i2c      89,   0 Nov 20 10:21 i2c-0

And this is related to pins 3 and 5 of the header 7J1. So, I nowhere see i2c-1 appearing.

You’re talking about I2C-1 for those pins. That confuses me.

And my question to the people of Libre Computer (since I couldn’t read a firm statement about this in here): does the I2C bus on pins 3 and 5 of header 7J1 has built-in pull-ups and if so, what’s the value of those pull-ups? When looking to the scheme of the S905X (not the S805X), I can’t see/find them on the schematics.

Best rgds,
–Geert

$ sudo ldto enable i2c-ao                                                                                                                                                                 
[  120.691719] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /aliases/i2c1
[  120.695359] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c8100000/i2c@500/status
[  120.706167] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c8100000/i2c@500/pinctrl-0
[  120.717021] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c8100000/i2c@500/pinctrl-names
Overlay i2c-ao: applied
$ ls /dev/i2c-*
/dev/i2c-0  /dev/i2c-1

The pull-ups are pinmux GPIO pull-ups which are controlled in software. These are not physical resistor pull ups.

Hmm… Strange you see two I2C buses with the same command as I used, while I only see one I2C bus.

What does dmesg say when you enable the overlay?

I see this:

[  248.827547] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /aliases/i2c1
[  248.835534] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c8100000/i2c@500/status
[  248.844022] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c8100000/i2c@500/pinctrl-0
[  248.855032] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/bus@c8100000/i2c@500/pinctrl-names

I see something about /aliases/i2c-1 in the above output but I still only see /dev/i2c-0 in my /dev directory:

pi@librecomputer:~ $ ls /dev/i2c*
/dev/i2c-0

PS: not sure if this is relevant, but I’m using an image that has undergone the portability conversion according this page: GitHub - libre-computer-project/libretech-raspbian-portability

FYI: I had a set-up with an MCP23017 controlled by the i2cset command of the i2c-tools package. The setup initially had pull up resistors of 2k2 and all was working fine (had a script running that continuously toggled 2 output pins of the 2 ports of the MCP IO expander).

After I read your comments, I removed those resistors to see if the SBC was having the pull-ups activated when activating the ic2-ao in the device tree (sudo ldto i2c-ao).

Result: that doesn’t seem to work, my I2C communication failed.

Then I put back the resistors and all is fine again.

So, apart from activating the i2c-ao section in the device tree, what else has to be done to get those internal pull-ups activated? Or am I missing something here?

We enabled i2c-ao pull up bias on the device tree. You have to use the new images or re-flash the bootloader using libretech-flash-tool to enable the pull ups: https://boot.libre.computer/ci/aml-s905x-cc.dts

				i2c_ao {
					phandle = <0x63>;

					mux {
						groups = "i2c_sck_ao\0i2c_sda_ao";
						function = "i2c_ao";
						bias-pull-up;
					};
				};

That might have to do with using a converted raspbian image instead of one of the ‘native’ LibreComputer debian images?

I haven’t had a chance to tinker with my board in a while but iirc on the native images i2c-0 would be assigned to the i2c bus integrated into the HDMI port, so any other i2c bus would increment that number.