PINE64 no network on boot

I downloaded DietPi Bullseye for a PINE64 512MB board. On booting the network interface was not detected.
Upon inspection I found out that the sun50i-a64-pine64-plus.dtb dtb file was being used, the A64+ has a different Ethernet chip because it supports 1GB/s and the A64 only up to 100MB/s. I overwrote the file with sun50i-a64-pine64.dtb which is the correct one and now the network connection is OK.
I tried to find how the board type is detected but I could not find it, maybe I can help to fix this problem.
I am asking for help in finding where the board type is detected so the boot procedure can choose the proper .dtb file.

Best regards

ferlicht
I guess it’s not our scripts who decide wich dtb is being used.

MichaIng can you have a look

That is indeed strange. The device tree should be correctly detected by the bootloader itself based on the detected hardware. It it not hardcoded anyway else :thinking:. Probably something to report to Armbian: https://forum.armbian.com/forum/27-allwinner-a64-h5-h6-and-h616/
So you the A64+ device tree was used even that its an A64 non-plus model, right?

Right, the board is a 64, not a 64+ but on boot it is incorrectly identified as a 64+, the network interface definitions are different. I worked around this by copying the correct .dtb file over the 64+ one.
I could not find the part of the code which identifies the board.

Best regards,

The identification should be done in the U-Boot image. I do not see any patch for PINE A64 in the Armbian repo: build/patch/u-boot/u-boot-sunxi at master · armbian/build · GitHub
So it then should be in upstream… here it is: u-boot/board/sunxi/board.c at 151a030063898e5c8b03b40c3a96b073db0b0dc7 · u-boot/u-boot · GitHub
Not sure whether it’s the only place, but there it is differentiated by the RAM size: 512 MiB == non-plus, else plus. Is this correct? It is indirectly documented in the wiki: PINE A64 - PINE64

PINE A64 512MB Rev B Board Schematic
PINE A64+ 1GB Rev B Board Schematic
PINE A64+ 2GB Rev C Board Schematic

The question is also whether the dram_size is derived as exactly 512 MiB, or as the real lower value. In this case the check would be wrong and should be better like if dram_size > 512; then plus; else non-plus from the logic. It was actually like the before ~2 years ago it was “simplified”: sunxi: board: Simplify Pine A64 DT selection logic · u-boot/u-boot@54ac5aa · GitHub
Probably one of the recent Armbian U-Boot updates included this commit, which broke correct estimation then.

Do you see the U-Boot version on serial console or so? Probably installing and flashing an older package (sadly there are not so many) solves it: Index of /armbian/pool/main/l/linux-u-boot-pine64-current/
The “legacy” ones, AFAIK, are for a too old kernel and may not boot at all with recent kernel: Index of /armbian/pool/main/l/linux-u-boot-pine64-legacy/

Hello,

I checked the changes and now U-boot checks the memory size correctly. I flashed an SD and the networks started normally. Sorry for the delay.

Best regards,

Fernando

1.5 years later :smile:. But I’m glad that it works now.