[BPI-M7] ArchLinuxArm build script

Today I received my BPI-M7 (ArmSoM-Sige7).

So I can now introduce my buildscript for the BPI-M7. Still in Alfa phase, but the boards boots. Should even be able to boot from nvme :slight_smile:

It boots mainline U-Boot and mainline linux (collabora version).

For now, only input/output on UART2 (on 40pin header). Be carefull, 3.3V only!

So only booting until command prompt tested, the rest all still have to test.

1 of the two ethernet ports should be setup to have an ip number (still have to figure out which one). Should be ssh access to it.

1 Like

So after testing, the build image looks pretty good:

  • u-boot mainline
  • linux based on linux-6.10-rc1, with collabora’s patches, so no more rockchip-linux
  • nvme is recognized
  • gnome running ok
  • mesa seems to work ok (panfrost/panthor)
  • ffmpeg-v4l2-request decoding seems to use the hantro-vpu, after adding vpu to dts
  • outer rj45 gets ip which is entered during setup

Building image with script works fine, no need to fix secondary gpt. However, I also have some prebuild images here:

www.woudstra.mywire.org/images/

Use the command sudo rockchip-postinstall to install gnome + mesa + ffmpeg-v4l2request-git (and kodi, still working on it).

1 Like

@koutheir

I do not have a pre-build image ready, but I have a script that will create one.

ericwoud/buildRKarch: Build script for building an image for Rockchip devices running ArchLinux (RK3288/RK3588 for now) (github.com)

The script itself runs on Debian/Ubuntu/Archlinux x86-64. Follow the readme.

I am running an image created by his script daily, but it has been a while since I tested the script itself, should be okay.

You could give this a try, if you are interested in Archlinuxarm, or I could build an image already if you do not have a system to run the script.

It is mainline U-Boot, Collabora’s mainline linux kernel fork (a few months old, so no hdmi-rx)

Postinstall script installs standard Gnome, Mesa, Kodi and a patched ffmpeg (from LibreElec) for hardware decoding.

So no tweaks and no extensive tests done. You can use it to start with and tweak further, but this is not suitable if you just need a ready to go image with everything immediately functional 100%.

@koutheir

I now have a prebuild image ready, just to check if this does boot…

http://woudstra.mywire.org/images/bpim7-server.img.gz

Or check:

ftp://ftp.woudstra.mywire.org/images/

Thank you for your efforts, Eric!

I tried it with a serial console. It boots successfully and reaches a login prompt. I logged in as root/password=admin. I run a few commands, mainly checking for the presence of the RockChip NPU module, as that is my main use case for this board, but I couldn’t find the kernel object file (rknpu.ko) nor was the rknpu module built into the kernel.

I didn’t try to build the image on my machine, but instead used your provided image file bpim7-server.img. I use ArchLinuxARM daily on other boards and I love it. My use case for this board requires the availability of the NPU module, so I cannot use verbatim ArchLinuxARM, as the RKNPU module has not been integrated into the mainline Linux kernel.

I didn’t try anything graphical as I don’t use that on this board. I didn’t even connect an HDMI cable. If you’d like me to test things, then I can do so from time to time.

I’d be totally fine using vanilla ArchLinuxARM with the RKNPU module, but doing that on my own is probably a tall order, at least for now.

The npu was submitted upstream in june. Don’t know exactly the status. So it is already there and only need to add kernel options, or you may need to add the patches to kernel and mesa.

At least you know your board can boot properly.

Do you know if the module was accepted into the mainline kernel?

Changing a few kernel configuration options shouldn’t be a big deal, but patching the kernel requires more knowledge that what I currently have.

So far, the boards boots correctly with your provided image, and with the Armbian unofficial 24.5.0 provided in the Banana Pi M7 documentation but only when the package linux-dtb-legacy-rk35xx is not upgraded (I held its current version in apt). The Armbian unofficial 24.5.0 provides the rknpu module, so I’m currently running that.

Did anyone try if suspend-to-ram and wakeup work?

And does the wifi interface work? (I couldn’t get the wifi interface running with mainline linux + brcmfmac driver - firmware doesn’t load).

I haven’t tried suspend. I’ve disabled it cause I want it to keep running.

Wifi works fine.

Does it use the bcmdhd module (not in mainline afaik) or the brcmfmac one? (If you like, you could attach a dmesg output of the boot in your OP to get more people from search engines and having a look.)

I use all mainline

Just try my image and see for your self:

https://ftp.woudstra.mywire.org/images/

I have a new site :slight_smile:

Correction:

Wifi does not work on my image. Must have confused it with another board.

(su)
modprobe
echo brcmfmac > /sys/bus/pci/devices/0003\:31\:00.0/driver_override 
echo 0003:31:00.0 > /sys/bus/pci/drivers/brcmfmac/bind

I get:

[  731.711755] brcmfmac: brcmf_fw_alloc_request: Unknown chip BCM43752/2
[  731.717767] brcmfmac: brcmf_pcie_probe: failed 14e4:449d
[  731.720882] brcmfmac 0003:31:00.0: probe with driver brcmfmac failed with error -12

but:

cat  drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | grep 43752
BRCMF_FW_CLM_DEF(43752, "brcmfmac43752-pcie");
	BRCMF_FW_ENTRY(BRCM_CC_43752_CHIP_ID, 0xFFFFFFFF, 43752),
	BRCMF_PCIE_DEVICE(BRCM_PCIE_43752_DEVICE_ID, WCC_SEED),

So need to figure out why the chip is not recognised… or is it only the fw?

It looks the firmware is in:

https://github.com/JeffyCN/mirrors/tree/rkwifibt/firmware/broadcom/AP6275_PCIE

But need to try out…

Looks like they need to go in /lib/firmware/ or /lib/firmware/brcm/

I’m using 6.13.0-rc2 master and I get (with loglevel=8):

[    4.099188] brcmfmac: brcmf_pcie_register Enter                                                                                                                                                                 
[    4.099690] brcmfmac: brcmf_pcie_probe Enter 14e4:449d                                                                                                                                                          
[    4.100163] brcmfmac 0003:31:00.0: enabling device (0000 -> 0002)                                                                                                                                               
[    4.100765] brcmfmac: brcmf_pcie_get_resource Phys addr : reg space = (____ptrval____) base addr 0x000000f3200000                                                                                               
[    4.101670] brcmfmac: brcmf_pcie_get_resource Phys addr : mem space = (____ptrval____) base addr 0x000000f3400000 size 0x400000                                                                                 
[    4.102683] brcmfmac: brcmf_chip_recognition found AXI chip: BCM43752/2                                                                                                                                         
[    4.104198] brcmfmac: brcmf_chip_cores_check  [1 ] core 0x800:65  base 0x18000000 wrap 0x18100000                                                                                                               
[    4.104978] brcmfmac: brcmf_chip_cores_check  [2 ] core 0x812:82  base 0x18001000 wrap 0x18101000                                                                                                               
[    4.105758] brcmfmac: brcmf_chip_cores_check  [3 ] core 0x83e:16  base 0x18002000 wrap 0x18102000                                                                                                               
[    4.106537] brcmfmac: brcmf_chip_cores_check  [4 ] core 0x83c:65  base 0x18003000 wrap 0x18103000                                                                                                               
[    4.107316] brcmfmac: brcmf_chip_cores_check  [5 ] core 0x829:26  base 0x18004000 wrap 0x18104000                                                                                                               
[    4.108096] brcmfmac: brcmf_chip_cores_check  [6 ] core 0x844:2   base 0x18005000 wrap 0x18105000                                                                                                               
[    4.108874] brcmfmac: brcmf_chip_cores_check  [7 ] core 0x840:15  base 0x18010000 wrap 0x00000000                                                                                                               
[    4.109654] brcmfmac: brcmf_chip_cores_check  [8 ] core 0x827:35  base 0x18012000 wrap 0x00000000
[    4.110448] brcmfmac: brcmf_chip_cores_check  [9 ] core 0x240:0   base 0x00000000 wrap 0x1810a000
[    4.111229] brcmfmac: brcmf_chip_cores_check  [10] core 0x135:0   base 0x00000000 wrap 0x18112000
[    4.112008] brcmfmac: brcmf_chip_cores_check  [11] core 0x135:0   base 0x00000000 wrap 0x18113000
[    4.112788] brcmfmac: brcmf_chip_set_passive Enter
[    4.220426] brcmfmac: brcmf_chip_set_passive Enter
[    4.221196] brcmfmac: brcmf_chip_get_raminfo RAM: base=0x170000 size=1310720 (0x140000) sr=0 (0x0)
[    4.222002] brcmfmac: brcmf_chip_setup ccrev=65, pmurev=35, pmucaps=0x84565f23
[    4.222634] brcmfmac: brcmf_get_module_param Enter, bus=2, chip=43752, rev=2
[    4.223257] brcmfmac: brcmf_of_probe no LPO clock
[    4.223670] brcmfmac: brcmf_alloc Enter
[    4.224019] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-pcie for chip BCM43752/2
[    4.224780] brcmfmac: brcmf_pcie_prepare_fw_request Board: armsom,sige7
[    4.225357] brcmfmac: brcmf_fw_get_firmwares enter: dev=0003:31:00.0
[    4.225913] brcmfmac: brcm_alt_fw_path FW alt path: brcm/brcmfmac43752-pcie.armsom,sige7.bin
[    4.258083] brcmfmac: brcmf_fw_complete_request firmware brcm/brcmfmac43752-pcie.bin found
[    4.258820] brcmfmac: brcm_alt_fw_path FW alt path: brcm/brcmfmac43752-pcie.armsom,sige7.txt
[    4.262903] brcmfmac: brcmf_fw_complete_request firmware brcm/brcmfmac43752-pcie.txt found
[    4.263638] brcmfmac: brcmf_fw_request_nvram_done enter: dev=0003:31:00.0
[    4.264339] brcmfmac: brcmf_fw_request_nvram_done nvram (____ptrval____) len 6040
[    4.264996] brcmfmac: brcm_alt_fw_path FW alt path: brcm/brcmfmac43752-pcie.armsom,sige7.clm_blob
[    4.267187] brcmfmac: brcmf_fw_complete_request firmware brcm/brcmfmac43752-pcie.clm_blob found
[    4.267961] brcmfmac: brcm_alt_fw_path FW alt path: brcm/brcmfmac43752-pcie.armsom,sige7.txcap_blob
[    4.268826] brcmfmac 0003:31:00.0: Direct firmware load for brcm/brcmfmac43752-pcie.txcap_blob failed with error -2
[    4.269738] brcmfmac: brcmf_fw_complete_request firmware brcm/brcmfmac43752-pcie.txcap_blob not found
[    4.270778] brcmfmac: brcmf_chip_get_raminfo RAM: base=0x170000 size=1310720 (0x140000) sr=0 (0x0)
[    4.271562] brcmfmac: brcmf_pcie_download_fw_nvram Halt ARM.
[    4.272057] brcmfmac: brcmf_pcie_download_fw_nvram Download FW brcm/brcmfmac43752-pcie.bin
[    4.366754] brcmfmac: brcmf_pcie_download_fw_nvram Download NVRAM brcm/brcmfmac43752-pcie.txt
[    4.368085] brcmfmac: brcmf_pcie_download_fw_nvram Download random seed
[    4.368718] brcmfmac: brcmf_pcie_download_fw_nvram Bring ARM in running state
[    4.369339] brcmfmac: brcmf_chip_set_active Enter
[    4.369941] brcmfmac: brcmf_pcie_download_fw_nvram Wait for FW init

...

[   10.380463] brcmfmac 0003:31:00.0: brcmf_pcie_download_fw_nvram: FW failed to initialize
[   10.381184] brcmfmac 0003:31:00.0: brcmf_pcie_setup: Dongle setup failed
[   10.381771] ieee80211 phy0: brcmf_fw_crashed: Firmware has halted or crashed
[   10.382647] brcmfmac: brcmf_pcie_get_memdump dump at 0x00170000: len=1310720
[   11.036028] brcmfmac: brcmf_detach Enter
[   11.120898] brcmfmac: brcmf_bus_change_state 0 -> 0
[   11.121343] brcmfmac: brcmf_proto_detach Enter
[   11.121733] brcmfmac: brcmf_fwvid_detach mod=wcc: enter: dev 0003:31:00.0

The BCM43752/2 is detected successfully and firmware is uploaded, but it doesn’t seem to initialize correctly. Also I can’t get the USB-C port and wakeup-from-suspend working.

EDIT: I tried pretty much all firmware binaries I could find for that chip. rfkill list shows nothing which could be related to the issue.

My headache I cannot force my BPI-M7 to use high voltage power like 9V, 12V, 15V instead of 5V. Seems like support in u-boot needed and the only board that will get support soon is Radxa 5B, in the future v2025.01 release:

$ git tag --contains 6852a2c82e695c418c744b0fcb4298bc0e759842
v2025.01-rc1
v2025.01-rc2
v2025.01-rc3
v2025.01-rc4
v2025.01-rc5
v2025.01-rc6

see Sebastian Reichel’ text

Can bm7 be used not as a toy without proper powering?

Is your supply stuck at 5v? It should have negotiated to 20v. Does not need a driver for it.

Anyway, if you have pd trouble, there is an easy fix. Use a fixed voltage power supply.

Nice work, the script’s looking solid! Excited to see how the rest of it shapes up

Not sure what you mean by fixed voltage power supply because I need one with Type-C connector, and I don’t see such one to buy (any one with Type-C connector are PD enabled or similar).

Can you pls give me an example with 20V or e.g. with 12V (fixed voltage power supply).

Or, do you mean to use a standard 12DC charger plus connector DC<->Type-C like this one

In case of BPI-M7, it supports 9/12/15V only, not 20V, right?

USB Type-C PD 2.0, 9V/2A, 12V/2A, 15V/2A

(quote from BPI-M7 tech spec). Are you sure it functions with 20V, too?

I power another rk3588 board with fixed voltage. It is almost the same as the M7.

That is possible, other solutions require soldering.

I believe so, but ask bananapi to make sure.

But anyway, unless you are experiencing bootloops or other strange crashes, no need to worry about the supply.