AML-S905D3-CC (Solitude) I2C & Device Tree Overlays

I recently purchased a Solitude board, and have it up an running on on the Ubuntu 22.04.4 LTS image. I have an i2c relay hat that I intend on using with it for a project, but it doesn’t look like there are any overlays available, really at all, for this board yet in the libretech wiring tool. Not being familiar with overlays at all, I manged to fudge through copying one of the overlays for the LePotato board, but things must be different enough between the two boards, that it’s not a simple copy/paste.

All I really did was take the LePotato one and add to the compatibility section, and then I also fiddled with trying to change the address on the line in the top half ( i2c1 = “/soc/bus@ffd00000/i2c@1e000”; ) line based on some addresses I saw referenced when I ran

sudo ldto current | grep i2c

So this is the dts file as I currently have it:

/*
 * Copyright (c) 2017 BayLibre, SAS.
 * Author: Neil Armstrong <narmstrong@baylibre.com>
 *
 * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 */

/*
 * Overlay aimed to enable I2C_AO on Header 7J1 :
 * Pins 3 (SDA), 5 (SCL)
 */

/dts-v1/;
/plugin/;

/ {
        compatible ="libretech,aml-s905d3-cc\0amlogic,sm1", "libretech,cc", "amlogic,s905x", "amlogic,meson-gxl";

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

                __overlay__ {
                        i2c1 = "/soc/bus@ffd00000/i2c@1e000";
                };
        };


        fragment@1 {
                target = <&i2c_AO>;

                __overlay__ {
                        status = "okay";
                        pinctrl-0 = <&i2c_ao_pins>;
                        pinctrl-names = "default";
                };
        };
};

and below is the output ‘sudo ldto current | grep i2c’ for this board:

i2c0-sda-c {
							groups = "i2c0_sda_c";
							function = "i2c0";
					i2c0-sck-c {
							groups = "i2c0_sck_c";
							function = "i2c0";
					i2c0-sda-z0 {
							groups = "i2c0_sda_z0";
							function = "i2c0";
					i2c0-sck-z1 {
							groups = "i2c0_sck_z1";
							function = "i2c0";
					i2c0-sda-z7 {
							groups = "i2c0_sda_z7";
							function = "i2c0";
					i2c0-sda-z8 {
							groups = "i2c0_sda_z8";
							function = "i2c0";
					i2c1-sda-x {
							groups = "i2c1_sda_x";
							function = "i2c1";
					i2c1-sck-x {
							groups = "i2c1_sck_x";
							function = "i2c1";
					i2c1-sda-h2 {
							groups = "i2c1_sda_h2";
							function = "i2c1";
					i2c1-sck-h3 {
							groups = "i2c1_sck_h3";
							function = "i2c1";
					i2c1-sda-h6 {
							groups = "i2c1_sda_h6";
							function = "i2c1";
					i2c1-sck-h7 {
							groups = "i2c1_sck_h7";
							function = "i2c1";
					i2c2-sda-x {
							groups = "i2c2_sda_x";
							function = "i2c2";
					i2c2-sck-x {
							groups = "i2c2_sck_x";
							function = "i2c2";
					i2c2-sda-z {
							groups = "i2c2_sda_z";
							function = "i2c2";
					i2c2-sck-z {
							groups = "i2c2_sck_z";
							function = "i2c2";
					i2c3-sda-h {
							groups = "i2c3_sda_h";
							function = "i2c3";
					i2c3-sck-h {
							groups = "i2c3_sck_h";
							function = "i2c3";
					i2c3-sda-a {
							groups = "i2c3_sda_a";
							function = "i2c3";
					i2c3-sck-a {
							groups = "i2c3_sck_a";
							function = "i2c3";
					i2c_ao_sck_pins {
							groups = "i2c_ao_sck";
							function = "i2c_ao";
					i2c_ao_sda {
							groups = "i2c_ao_sda";
							function = "i2c_ao";
					i2c_ao_sck_e {
							groups = "i2c_ao_sck_e";
							function = "i2c_ao";
					i2c_ao_sda_e {
							groups = "i2c_ao_sda_e";
							function = "i2c_ao";
			i2c@5000 {
				compatible = "amlogic,meson-axg-i2c";
			i2c@1c000 {
				compatible = "amlogic,meson-axg-i2c";
			i2c@1d000 {
				compatible = "amlogic,meson-axg-i2c";
			i2c@1e000 {
				compatible = "amlogic,meson-axg-i2c";
			i2c@1f000 {
				compatible = "amlogic,meson-axg-i2c";
		i2c0_sda_c_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c0-sda-c";
		i2c0_sck_c_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c0-sck-c";
		i2c0_sda_z0_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c0-sda-z0";
		i2c0_sck_z1_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c0-sck-z1";
		i2c0_sda_z7_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c0-sda-z7";
		i2c0_sda_z8_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c0-sda-z8";
		i2c1_sda_x_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c1-sda-x";
		i2c1_sck_x_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c1-sck-x";
		i2c1_sda_h2_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c1-sda-h2";
		i2c1_sck_h3_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c1-sck-h3";
		i2c1_sda_h6_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c1-sda-h6";
		i2c1_sck_h7_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c1-sck-h7";
		i2c2_sda_x_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c2-sda-x";
		i2c2_sck_x_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c2-sck-x";
		i2c2_sda_z_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c2-sda-z";
		i2c2_sck_z_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c2-sck-z";
		i2c3_sda_h_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c3-sda-h";
		i2c3_sck_h_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c3-sck-h";
		i2c3_sda_a_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c3-sda-a";
		i2c3_sck_a_pins = "/soc/bus@ff600000/bus@34400/pinctrl@40/i2c3-sck-a";
		i2c_ao_sck_pins = "/soc/bus@ff800000/sys-ctrl@0/pinctrl/i2c_ao_sck_pins";
		i2c_ao_sda_pins = "/soc/bus@ff800000/sys-ctrl@0/pinctrl/i2c_ao_sda";
		i2c_ao_sck_e_pins = "/soc/bus@ff800000/sys-ctrl@0/pinctrl/i2c_ao_sck_e";
		i2c_ao_sda_e_pins = "/soc/bus@ff800000/sys-ctrl@0/pinctrl/i2c_ao_sda_e";
		i2c_AO = "/soc/bus@ff800000/i2c@5000";
		i2c3 = "/soc/bus@ffd00000/i2c@1c000";
		i2c2 = "/soc/bus@ffd00000/i2c@1d000";
		i2c1 = "/soc/bus@ffd00000/i2c@1e000";
		i2c0 = "/soc/bus@ffd00000/i2c@1f000";

So as a total noob to Device Tree Overlays I guess my questions are:

  1. Is figuring out the correct address to put in the line ’ i2c1 = “/soc/bus@ffd00000/i2c@1e000” ’ all I need to do, or am I way off?

  2. If it is just a question of getting the correct address, is the address I need somewhere in the output of ‘sudo ldto current | grep i2c’ or do I need to look somewhere else (I saw reference to that maybe being on the schematics somewhere, but the links for the schematics from the main website go to schematics for AML-311D-CC. I’m not sure if that’s an error or if they are actually the same)

  3. If I’m way off, what’s a good ‘Writing Device Tree Overlays for Dummies’ type of resource?

  4. Is there some other, simpler way through a config option similar to raspi-config to enable I2C, that I just overlooked?

Thanks for any gentle nudges in the right direction anyone can provide!

Looks like there was an update to the wiring tool last week that includes this - looks like one of the contributors on the github, Luke, added them - thanks Luke!