BPI-R4:Beginner questions for kernel building

Looking at driver code ref-clock seems needed

But have not noticed any broken behaviour,from dts it is linked to first ssusb controller

Maybe it is the usb mapped to the top m.2 slot. But based on schematic it is the pcie from this and usb from hub port4,so xsphy possibly unused

Ok, so all good anyway, right?

imho for current state yes…not sure if xsphy and socinfo is needed

Ok.

Frank, an off topic matter, is firewalld / nftables working good for you? Right after a fresh install and installing firewalld,doing a firewall-cmd --add-interface=eth1 --zone=internal, throws an error.

Error: COMMAND_FAILED: 'python-nftables' failed: internal:0:0-0: Error: No such file or directory; did you mean chain ‘filter_IN_external’ in table inet ‘firewalld’?

internal:0:0-0: Error: No such file or directory; did you mean chain ‘filter_FWD_external_allow’ in table inet ‘firewalld’?

That only happens with zones internal ou home, not the other ones. I have opened a issue here: Error on debian 12 (arm64), Error: COMMAND_FAILED: 'python-nftables' failed · Issue #1410 · firewalld/firewalld · GitHub

This does not happen on a x64 machine.

i do not use firewalld (i’m using nftables) so cannot help here…no idea what firewalld tries to do here

i tested nftables on bpi-r3 and afair added kernel-options from r3 defconfig to the r4 one

1 Like

@frank-w What is the procedure for upgrading the kernel?

I built a deb package from your repo, but doing dpkg -i bananapi-r4-image-6.13-main_6.13.0-1_arm64.deb and rebooting, is not using that new kernel.

I also did these commands:

cp /boot/bananapi/bpi-r4/linux/dtb/bpi-r4-6.13.0-main.dtb     /boot/bpi-r4.dtb
cp /boot/bananapi/bpi-r4/linux/uEnv.txt   /boot/uEnv.txt
cp /boot/bananapi/bpi-r4/linux/uImage_6.13.0-main_nodt   /boot/uImage_nodt

Right now, there are these files on /boot:

/boot/
/boot/uEnv.txt
/boot/bpi-r4.dtb
/boot/uImage_nodt
/boot/bpi-r4.itb
/boot/bananapi
/boot/bananapi/bpi-r4
/boot/bananapi/bpi-r4/linux
/boot/bananapi/bpi-r4/linux/uEnv.txt
/boot/bananapi/bpi-r4/linux/dtb
/boot/bananapi/bpi-r4/linux/dtb/bpi-r4-6.13.0-main.dtb
/boot/bananapi/bpi-r4/linux/dtb/bpi-r4-6.12.7-main.dtb
/boot/bananapi/bpi-r4/linux/uImage_6.13.0-main_nodt
/boot/bananapi/bpi-r4/linux/uImage_6.12.7-main_nodt

I see there are references to the old kernel, 6.12.7 on the bpi-r4.itb file, but i don’t see a .itb file for the new kernel 6.13.

EDIT: Not sure if this matters, but i’m using Openwrt’s boot loader, as i used it to install Debian 12 in the EMMC.

SOLUTION: copy the new .itb file from compilation machine. `

scp ./build/bpi-r4.itb BANANA-R4:/boot

The itb is the important part,maybe it is missing in 6.13 somehow…needed to patch deb creation script to include the files,maybe something has changed recently. If the deb contains no itb there is the problem. If the itb has version in name (as i guess) you have to change fit var in uEnv.txt to boot it (of course it need to exist). The dtb/no_dt is not needed here,but created for compatibility reasons with r64 and for manual try to apply dtb

Ok, i just copied the .itb file from compilation machine and now 6.13 kernel boots.

scp ./build/bpi-r4.itb BANANA-R4:/boot

Yes,this is the way i use it too,but with install option to sdcard which installs modules too (which are installed through deb i guess) :slight_smile: but you should make backup of your last itb before overwriting it

For missing itb,i wonder why dtb and uimage_nodt are packed for r4 as this should be done only for r64 based on my patch

Maybe there are better ways.

1 Like

@frank-w I’m not very proficient with github. Is there a way to know when you update the kernel repo for a specific branch?

Basicly github has an api where you can get the last commits and push timestamp.

Idk if there is a out-of-box notification mechanism…i did some tests years ago to get updates for forks of my repos,but cannot tell how exactly i did this without looking in the (really dirty) code.

1 Like

@frank-w i tried your 6.16-mt7988upstream branch and now the sfp ports don’t work. Did i forget to enable some module on compilation?

Sfps need pcs and the usxgmii patches which are not for upstream yet. The mt7988upstream branches are only for the upstream process not for direct usage,so missing functionality :slight_smile: and these branches are often rebased.

It is still discussion how pcs should be upstreamed. Afaik last steps are done by sean anderson.

https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

I guess he will send v6 when rc1 is out. When pcs is clear then the usxgmii patches can follow. I only added sfp in upstream to allow access via i2c.

For testing better use main or the rc branches…as there is no 6.16-rc1 yet i have not created the 6.16-rc yet…only upstream to send dts patches as soon as possible

Ok Frank, thanks for the explanation. So, your 6.12 branch is still on 6.12.30, how to update to 6.12.32? Will this work? [BPI-R2] mt7925 - #10 by SDXC

Tried add a remote, but says already exists:

git remote add origin https://github.com/torvalds/linux.git
error: remote origin already exists.

EDIT2: Ok i did git remote add torvalds https://github.com/torvalds/linux.git , but how to use the 6.12.32 sources?

You have to add stable tree…but you can do this automaticly with “./build.sh updatesrc”

But have to make your working dir clean (e.g. git stash)

Would it be an option to use 1 fixed branch name, that always has the latest patches? Me too I’m always searching which branch.

That’s why I stick with dangowrt’s mt7988-for-next branch for R4, which holds most latest patches and is always rebased. Then I don’t need to search and just build this one, even using a script.

No it’s no option as i need to look when a problem starts or till which it works…and there are lts kernels for productive use.

Ok, i did this:

git clone --depth 1  -b  6.12-main https://github.com/frank-w/BPI-Router-Linux.git
git stash
cd BPI-Router-Linux/
git config --global --add safe.directory $PWD
git stash


./build.sh  updatesrc
# error:
Update kernel source
fatal: 'stable' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


# So i ran it again:
./build.sh  updatesrc
Update kernel source
remote: Enumerating objects: 13545655, done.
# ***  SNIP ***

 * [new tag]                   v6.9.7               -> v6.9.7
 * [new tag]                   v6.9.8               -> v6.9.8
 * [new tag]                   v6.9.9               -> v6.9.9
newkernver:6.12.31 (max:6.12.32)
fatal: refusing to merge unrelated histories


./build.sh importconfig

grep 6.12 ../build/.config
# Linux/arm64 6.12.30 Kernel Configuration

So, no 6.12.32, any other alternative Frank?

So actually running 6.15.0, which came from your branch 6.16-mt7988 branch, the problems with the mt7922 seem to be been fixed, but again, the fiber ports don’t work. So, hopefully 6.12.32 has the fixes for this card.

build.sh should add it on this error (seems it did in your case because error-message changed)…

but the new error (refusing to merge unrelated histories) is strange…are you on 6.12-main (i see you cloned only this branch which should be ok - calculation of newkernver is right so far)?

i had done the last merges with another laptop, so my current sync also contains already merged tags, but basicly works

$ ./build.sh updatesrc
Update kernel source
remote: Enumerating objects: 862356, done.
remote: Counting objects: 100% (109197/109197), done.
remote: Compressing objects: 100% (3222/3222), done.
remote: Total 862356 (delta 106563), reused 106960 (delta 105975), pack-reused 753159
Receiving objects: 100% (862356/862356), 633.08 MiB | 3.02 MiB/s, done.
Resolving deltas: 100% (633397/633397), completed with 41345 local objects.
From https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable
...
 * [new tag]                   v6.12.24             -> v6.12.24
 * [new tag]                   v6.12.25             -> v6.12.25
 * [new tag]                   v6.12.26             -> v6.12.26
 * [new tag]                   v6.12.27             -> v6.12.27
 * [new tag]                   v6.12.28             -> v6.12.28
 * [new tag]                   v6.12.29             -> v6.12.29
 * [new tag]                   v6.12.30             -> v6.12.30
 * [new tag]                   v6.12.32             -> v6.12.32
....
newkernver:6.12.31 (max:6.12.32)
...

and similar for 6.12.32 without errors, maybe issue with shallow clone…maybe you need the --single-branch too, but manpage says that depth implies single-branch?

pushed the updated tree

I don’t i know Frank, but i cloned the tree again and yes, 6.12.32 came. Running it now. Fiber working again, thanks for the update Frank. Nex time, i try without --depth 1.