U-Boot and kernel 5.14

Hi, Frank, I used irqpoll option and the kernel warning is gone. Now I find out that the gpio acces is more simple by installing the package gpiod but I dot’ know how to use i2c for rtc rtc ds3231.

apt install alsa-utils -y

alsactl init

alsactl store

amixer sset ‘FRDDR_A SINK 1 SEL’ ‘OUT 1’

amixer sset ‘FRDDR_A SRC 1 EN’ on

amixer sset ‘TDMOUT_B SRC SEL’ ‘IN 0’

amixer sset ‘TOHDMITX’ on

amixer sset ‘TOHDMITX I2S SRC’ ‘I2S B’

alsactl store

reboot

1 Like

Do you have acces to /dev/i2cX? in debian there are i2c tools with i2cdetect to communicate with i2c devices.

https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/gpio#i2c

Maybe there is also an linux kernel-module for rtc which only needs to configured in userspace

Hi Frank I did it but doesn’t detect any device on the i2c bus, there isn’t mistakes with the connection because I already test with the debian distro by Sinovoip and works well. I suppose is something todo with my kernel build or the overlay files, by the way, I try to use Sinovoip overlays but it doesn’t work with my kernel build, I suppose that is happen because they are diferent kernel versions.

This is my otuput with my kernel build:

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – -- – -- – -- – -- – -- – -- –

10: – -- – -- – -- – -- – -- – -- – -- – --

20: – -- – -- – -- – -- – -- – -- – -- – --

30: 30 – -- – -- – -- – -- – -- – -- – -- –

40: – -- – -- – -- – -- – -- – -- – -- – --

50: 50 – -- – -- – -- – -- – -- – -- – -- –

60: – -- – -- – -- – -- – -- – -- – -- – --

70: – -- – -- – -- – --

This is my otuput with Sinovoip kernel build:

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – -- – -- – -- – -- – -- – -- –

10: – -- – -- – -- – -- – -- – -- – -- – --

20: – -- – -- – -- – -- – -- – -- – -- – --

30: – -- – -- – -- – -- – -- – -- – -- – --

40: – -- – -- – -- – -- – -- – -- – -- – --

50: – -- – -- – -- – 57 – -- – -- – -- – --

60: – -- – -- – -- – -- 68 – -- – -- – -- –

70: – -- – -- – -- – --

Any ideas?

Hi Frank, I’m trying to load i2c overlay but I got an error:

failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND base fdt does did not have a /symbols node make sure you’ve compiled with -@

The console log is attached in this post.

overlay boot log.txt (1,4 KB)

Mhm, i thought i had it documented somewhere,but have not found it…as your message says you need to compile your dtb with -@ flag. Afair i had modified the Makefile in arch/arm/boot

You can first modify your dts instead of creating an dtb…just for testing

My steps were here: Set MAC-Address on boot

This is dtbo

dtc -@ -I dts -O dtb -o bpi-r2-mac.dtb bpi-r2-mac.dts

And you have to compile your main dtb with -@ too…have done it this way:

added

export DTC_FLAGS=-@

to my build.sh and now i see the symbols

Where I add this line?

When building dtbs…this is mostly done together with kernel itself and modules

DTC_FLAGS=-@ make -j4 dtbs modules

Or using export before

You can verify with

fdtdump arch/*/boot/dts/.../board.dtb | grep -C3 __symbols__

$ fdtdump meson-sm1-bananapi-m5.dtb | grep -C3 symbols

**** fdtdump is a low-level debugging tool, not meant for general use.

**** If you want to decompile a dtb, you probably want

**** dtc -I dtb -O dts

Warning is ok,but have you added path to your dtb? It should look like in the linked thread

But no other output can mean you have no symbols

I executed the command where the dtb file is located.

Ok,then it seems it was not working passing dtc_flags this way…you can try the export way

Hi Frank, I used command line that you told me and now boots without any error or warning when I load the i2c overlay but still no i2c device is detected connected to the bus. I attached the commands and outputs before and after loading the overlay.

LOG I2C.txt (2,4 KB)

But i2c adapter is visible with overlay (meson i2c controller). Maybe some error in new i2c node (something new driver needs compared to old)?

Do you have any info/warn/error in dmesg?

Hi Christian, I found some kind of audio routing on the specific DTS file for BPI-M5 but I don’t understand how to modify it accordingly your instructions for audio routing. I added to this post the DTS file. I appreciate if you can check out and help me whit this.

meson-sm1.dtsi (13,7 KB) meson-sm1-bananapi-m5.dts (12,7 KB)

The board device-tree describes (not configures) the hardware. Configuration of the audio card device is done using amixer in userspace. Thus I will repeat one final time for luck and using capitals in the hope you get the hint … YOU DO NOT SET AUDIO ROUTING IN THE BOARD DTS FILE. I’ve already linked the amixer commands used for routing. In English we have a saying “You can lead a horse to water, but you cannot make it drink”

Hi Christian, I Understand and I’m grateful for your tips, I tried what you said before and works well but I’m not an expert on this area, I’m just an enthusiast so my intention is not argue your knoledge. I’m asking because I was viewin the DTS file to make some overlays and I see this:

	audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
			"TDMOUT_B IN 1", "FRDDR_B OUT 1",
			"TDMOUT_B IN 2", "FRDDR_C OUT 1",
			"TDM_B Playback", "TDMOUT_B OUT",
			"TDMOUT_C IN 0", "FRDDR_A OUT 2",
			"TDMOUT_C IN 1", "FRDDR_B OUT 2",
			"TDMOUT_C IN 2", "FRDDR_C OUT 2",
			"TDM_C Playback", "TDMOUT_C OUT",
			"TDMIN_A IN 4", "TDM_B Loopback",
			"TDMIN_B IN 4", "TDM_B Loopback",
			"TDMIN_C IN 4", "TDM_B Loopback",
			"TDMIN_A IN 5", "TDM_C Loopback",
			"TDMIN_B IN 5", "TDM_C Loopback",
			"TDMIN_C IN 5", "TDM_C Loopback",
			"TODDR_A IN 0", "TDMIN_A OUT",
			"TODDR_B IN 0", "TDMIN_A OUT",
			"TODDR_C IN 0", "TDMIN_A OUT",
			"TODDR_A IN 1", "TDMIN_B OUT",
			"TODDR_B IN 1", "TDMIN_B OUT",
			"TODDR_C IN 1", "TDMIN_B OUT",
			"TODDR_A IN 2", "TDMIN_C OUT",
			"TODDR_B IN 2", "TDMIN_C OUT",
			"TODDR_C IN 2", "TDMIN_C OUT",
			"Lineout", "ACODEC LOLP",
			"Lineout", "ACODEC LORP";

If you say can’t be done from DTS file it’s ok, as I said, I’m not an expert on this, but the strange thing is that I use the same root file system with the kernel 4.9 from Sinovoip and works without any audio routing using amixer commands.

He said this SHOULD not be done…as audio routing is software and dts is for describing hardware

But i wonder why this key is implemented…but maybe this key does not exist in mainline driver

The audio-routing nodes are simply mapping the source/sink relationships. The one important thing to note from the dts is the output device:

This tells you TDM_B is being used, so in userspace to get HDMI audio output:

amixer sset ‘FRDDR_A SINK 1 SEL’ ‘OUT 1’
amixer sset ‘FRDDR_A SRC 1 EN’ on
amixer sset ‘TDMOUT_B SRC SEL’ ‘IN 0’
amixer sset ‘TOHDMITX’ on
amixer sset ‘TOHDMITX I2S SRC’ ‘I2S B’

This might help (or confuse) your understanding of the hardware:

axg-audio-routing

NB: The vendor driver (AUGE) and mainline driver (AXG) both exist to run on the same hardware so there is derivative and similar naming of things in the upstream driver code, but there is really no code in common between them and you will not be able to reuse 4.9 kernel overlays on upstream kernels.

I find out that the IRQ 39 error is related to ethernet driver (meson8b-dwmac). This error is present in the kernel 5.14.y and 5.15.y. With the kernel 5.10, IRQ 40 is used and don’t throw any errors related to ethernet so I guess is something to do with the (meson8b-dwmac) driver. I edited the driver’s source code and I can’t see any thing about the IRQ used. The boot log is attached to this post for if anyone can helpme with this issue.

boot log k5.10 debian 11.txt (27,6 KB) boot log k5.15.4 debian 11.txt (29,6 KB)