How to Enable I2C on AML-A311D-CC

While the AML-S905X-CC Le Potato has overlays to enable both, I2C AO and I2C B, the AML-A311D-CC currently has I2C AO enabled by default but no overlay for I2C B is available, yet.

$ ldto list
#Overlays available
cpu-b-opp-2304
cpu-l-opp-2208
npu
spifc-nor

I did find the AML-S905X-CC i2c-b.dts, but I don’t know if I can just reuse it for the AML-A311D-CC. Also the commented pins 27/28 and the used ones 26/27 seem off by one.

And pointers welcome.

I am doing this to investigate replacing the Raspberry Pi 3B+ in a pi-top[3] with the AML-A311D-CC. The pi-tobHub v2 does fit nicely and I’ll report back with my findings.

I created a pull request with my attemt at an i2c_b overlay for the AML-A311D-CC in Add i2c_b.dts for aml-a311d-cc by butonic · Pull Request #13 · libre-computer-project/libretech-wiring-tool · GitHub

Hello,
I’m also looking at enabling i2c, connecting a PWM board
Tried wiring both on pins 3,5 and 27,28, but I’m still not getting it discovered:

~ » sudo i2cdetect -y 0                                                                                       ubuntu@strong-selfo
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Any updates? or steps that I’m missing?

1 Like

Nice to see another person picking this up! The advice from Tomeu Vizoso (who worked on the NPU driver but has worked on I2C in the past) was:
“I unfortunately don’t remember much about I2C (has been quite a few years), but I think you could try asking in #linux-amlogic on Libera.Chat. Or on the mailing list: http://lists.infradead.org/mailman/listinfo/linux-amlogic
Hope the mailing list proves fruitful!

I’ll post there, thanks!

Could be efficient if someone from Libre.Computer would’ve picked it up. I had great experience with Le-Potato, but this is a regression to me as

  1. I don’t have the correct background to debug it myself
  2. It was a simple straight command with the Le-Potato.
1 Like

Couldn’t agree more! @librecomputer would you mind helping us out here?

I’m in a similar position as 1. (though I don’t even have an inkling of an idea to know what I’m doing)

hi, sorry for late reply…

We’ve submitted a patch[1] to enable i2c2 for Alta, tested with i2c device connected

so, can you give it a try? thanks

[1] aml-a311d-cc: enable i2c-2 controller · libre-computer-project/libretech-wiring-tool@771185a · GitHub

1 Like

Thank you very much!
I’m afraid this is a bit beyond me for the moment but I’m sure @butonic and @gauntlet114 will be able to test it for you and I look forward to reading their feedback!

Hi @Luke ,
Would I assume that I need to build the wiring tool and install it on the Alta board? the use it to enable the overlay?

technically, yes, since it’s a dtb overlay

just download the wiring-tools repo [1], build the dtbo file (just type: make, need dtc tool installed first - can do this step either in x86 host environment or in Alta board)

then enable it use “ldto enable i2c-2”, similar as this post AML-S905X-CC (Le Potato) 480x320 ILI9486 3.5" SPI Touchscreen Display

you might want to explicitly tell ldto as following:
export VENDOR=libre-computer
export BOARD=aml-a311d-cc

[1] GitHub - libre-computer-project/libretech-wiring-tool

1 Like

I’ve installed it before reading this message:

  1. Cloned the wiring tool repo - git clone https://github.com/libre-computer-project/libretech-wiring-tool.git
  2. Install debhelper - sudo apt install debhelper
  3. Invoke ./build.sh
  4. Invoke sudo ./install.sh
  5. Issue i2c enablement command - sudo ldto enable i2c-2
    5.1 If you want it to be permanent, issue the following command sudo ldto merge

Test that is works:

~/src/libretech-wiring-tool (master*) » sudo i2cdetect -y 1                                         ubuntu@strong-selfo
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

Probable note: if you did merge the device-tree, post reboot, the i2c interface numbers will swap, so one should use index 0 (zero) to interact with it. (the one the used to be 0, is now 1). there are numerous posts about that swap.

Thanks @Luke and team. (I see you responded to @butonic .

Last request, I’d like to understand the difference between I2C AO and EE, but was not able to find something that I can actually make sense of, can someone provide a useful link?

1 Like

re AO vs EE, generally speaking, the AO means power always-on, so devices in this domain is accessible by power management auxiliary processor (a Cortex-m or riscv processor?) even during suspend or power off mode…

3 Likes

Just wondering about a timeline for how long we might expect before seeing this patch shipped in standard images?

Hi @Luke @librecomputer ,
When I merge and reboot the Alta board, the overlays do not persist.
Should I open a new post?

They are updated weekly on a continual basis via our deb servers. Images are updated every quarter or so.

1 Like

They do persist. Once merged, it will be part of the base tree.

Reading the ldto script I see that the overlay name needs to be passed to the merge sub-command