Hi
I have just installed new OS: OpenWrt SNAPSHOT, r25331-0c18c5679a, kernel 6.1.79
. Now trying to work with some I2C devices attached but it seems it is not enabled.
Any idea how I can do it?
root@BPI-R4:/sys/class/i2c-dev/i2c-1# ls -ltr /sys/class/i2c-dev/i2c-1/new_device
ls: /sys/class/i2c-dev/i2c-1/new_device: No such file or directory
root@BPI-R4:/sys/class/i2c-dev/i2c-1# ls -ltr /sys/class/i2c-dev/i2c-0/new_device
ls: /sys/class/i2c-dev/i2c-0/new_device: No such file or directory
Good will be to get also any hint to get some wiring for Banana BPI-R4
Kindly
No idea as Im using what I get from openwrt firmware selector.
If it is dsabled in the kernel how to request to enable it?
Unless point 1 possible that in BPI-R4 first of all we need to enable I2C on GPIO side loading some dts overlays as I know from RaspeberryPi or OrangePi. Maybe not needed here....
Issue on hardware level with pullup resitors as I read on some BPI boards.
I2C on the MT7988 works very well, we are using 2 out of the 3 busses it on-board:
One for connecting the PMIC, the other bus is connected to I2C mux for SFP cages, RTC and some EEPROMs. All that works, so from driver and hardware point of view I2C it's all just fine.
Now to how to integrate your use of I2C for adding a peripheral device: mt7988a-bananapi-bpi-r4.dts is representing the bare board, without anything added. The proper way to add a peripheral would be to create a Device Tree Overlay enabling the (in this case) i2c bus used and defining the peripheral there as a bus client with address and compatible string. If you want to control the peripheral from userspace, just enable the bus in the DT overlay.
Other than RaspberryPi there is no filesystem to store the DT overlays, but rather you have to include them in the uImage.FIT, like it is already done for the DT overlays selecting either SD or eMMC, for example.
thank you for your prompt answer and confirmation that all could be fine with hardware
Im rather new here as I started working with openwrt 8 days ago
Im a bit familiar with dts overaly as I was doing similar things for my orange pi board but here it is a bit complicated as I see. also for previous banana pi BPI-R router i2c was working from the box...
Anyway is it any tutorial how I can do that?
root@BPI-R4:~# ls -ltr /sys/class/i2c-dev/i2c-1/new_device
ls: /sys/class/i2c-dev/i2c-1/new_device: No such file or directory
root@BPI-R4:~# ls -ltr /sys/class/i2c-dev/i2c-0/new_device
ls: /sys/class/i2c-dev/i2c-0/new_device: No such file or directory
Not sure what's wrong here, but for the check you need to run i2cdetect -l first and then, depending on the results, use numbers 0,1,2,etc : i2cdetect 0
it is discovering nothing...
Im rather thinking about dts file is not complete...maybe some sections are missing like:
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins>;
status = "okay";
but all that is already included in parent mt7988a-bananapi-bpi-r4.dts