micsa
Validating
-
Joined
-
Last visited
Reputation Activity
-
micsa got a reaction from Hammerill in i2c BananaPi M5well, I struggled a little bit with these i2c dts files, too, but it didn't work...
so, I created a dts file with software i2c (i2c-gpio) for my hardware rtc i2c module:
// Overlay for i2c_gpio bitbanging host bus. /dts-v1/; /plugin/; / { compatible = "amlogic,meson-gxbb"; fragment@0 { target-path = "/"; __overlay__ { i2c_gpio: i2c@2 { compatible = "i2c-gpio"; gpios = <&gpio 82 0 /* sda */ &gpio 83 0 /* scl */ >; i2c-gpio,delay-us = <2>; /* ~100 kHz */ #address-cells = <1>; #size-cells = <0>; ds3231: rtc@68 { status = "okay"; compatible = "ds3231"; reg = <0x68>; }; }; }; }; };
according to gpioinfo and the banana pi m5 wiki, the CON1-P03 is the I2C_M2_SDA and CON1-P05 is the I2C_M2_SCL.
line 81: "CON1-P26" unused input active-high line 82: "CON1-P03" unused input active-high line 83: "CON1-P05" unused input active-high line 84: "CON1-P32" unused input active-high
After this, I have:
root@bpim5:~# i2cdetect -l i2c-0 i2c DesignWare HDMI I2C adapter i2c-1 i2c i2c@2 I2C adapter root@bpim5:~# i2cdetect -y 1 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: -- -- -- -- -- -- -- --
(the UU was 0x68, but it's currently used by the rtc module)
so, when I load the rtc_ds1307.ko kernel module, it automatically detects the device and the /dev/rtc1 appears...