I am able to get I2C to work on pin 27 and 28 (on La Frite) by using and modifying i2c-b.dts. According to the spreadsheet pins 27 and 28 are GPIODV 24 and 25. And these two are i2c_A instead of i2c_B.
Open i2c-b.dts for aml-s805 (path: libretech-wiring-tool/libre-computer/aml-s805x-ac/dt/i2c-b.dts).
Modify these:
- replace &i2c_b_pins to &i2c_a_pins.
- replace “GPIODV_26”,“GPIODV_27” with “GPIODV_24”,“GPIODV_25”
- replace <&i2c_B> in target of fragment@2 with <&i2c_A>.
- save changes
- delete i2c-b.dtbo if it is already generated
- compile the entire library by executing: sudo make. This should only generate a new i2c-b.dtbo since we delete this in earlier step.
- merge it: sudo ./ldto merge i2c-b
- reboot the computer
- once rebooted, issue i2cdetect -y 2. You should see your I2C device/s there.
Hope I am not forgetting anything.
/*
- Copyright (c) 2017 BayLibre, SAS.
- Author: Neil Armstrong narmstrong@baylibre.com
- SPDX-License-Identifier: (GPL-2.0+ OR MIT)
*/
/*
- Overlay aimed to enable I2C_B on Header 7J1 :
- Pins 27 (SDA), 28 (SCL)
*/
/dts-v1/;
/plugin/;
/ {
compatible = “libretech,aml-s805x-ac”, “amlogic,s805x”, “amlogic,meson-gxl”;
fragment@0 {
target-path = "/aliases";
__overlay__ {
i2c2 = "/soc/cbus@c1100000/i2c@87c0";
};
};
fragment@1 {
target = <&i2c_a_pins>;
__overlay__ {
cfg {
pins = "GPIODV_24", "GPIODV_25";
bias-pull-up;
};
};
};
fragment@2 {
target = <&i2c_A>;
__overlay__ {
status = "okay";
pinctrl-0 = <&i2c_a_pins>;
pinctrl-names = "default";
};
};
};