[BPI-M7] ArchLinuxArm build script

I got something up now:

[root@rk3588 ~]# dmesg | grep brc
[    5.794138] usbcore: registered new interface driver brcmfmac
[    5.798671] brcmfmac 0003:31:00.0: enabling device (0000 -> 0002)
[    5.904340] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43752-pcie for chip BCM43752/2
[    5.910296] brcmfmac 0003:31:00.0: Direct firmware load for brcm/brcmfmac43752-pcie.txcap_blob failed with error -2
[    6.143371] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[    6.146125] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43752/2 wl0: Jul 12 2022 18:54:54 version 18.35.387.23.146 (g412cc5ec) FWID 01-93c53be6
[    6.181934] brcmfmac 0003:31:00.0 wlP3p49s0: renamed from wlan0
[   11.361057] ieee80211 phy0: brcmf_p2p_create_p2pdev: timeout occurred
[   11.361735] ieee80211 phy0: brcmf_cfg80211_add_iface: add iface p2p-dev-wlP3p49 type 10 failed: err=-5
[root@rk3588 ~]# iw dev
phy#0
        Interface wlP3p49s0
                ifindex 4
                wdev 0x1
                addr ee:9c:39:e2:d7:8e
                type managed
                channel 34 (5170 MHz), width: 20 MHz, center1: 5170 MHz
                txpower 31.00 dBm
[root@rk3588 ~]# 

Needed a devicetree overlay:

[root@rk3588 ~]# cat /boot/dtbos/linux-aarch64-rk-rc/rk3588-armsom-sige7-wifi.dts
/dts-v1/;
/plugin/;

&pcie2x1l1 {
        pcie@0,0 {
                reg = <0x400000 0 0 0 0>;
                #address-cells = <3>;
                #size-cells = <2>;
                ranges;
                device_type = "pci";
                bus-range = <0x40 0x4f>;

                wifi: wifi@0,0 {
                        compatible = "pci14e4,449d";
                        reg = <0x410000 0 0 0 0>;
                        clocks = <&hym8563>;
                        clock-names = "lpo";
                };
        };
};

But my time is up for now to actually test it. Btw, used armbians firmware files.

1 Like

got it, thx. To be honest, I didn’t hold a soldering iron quite some time. Maybe I will.

That’s awesome! Thank you.

Now if also USB-C works, I guess we pretty much have “full” (usable) mainline support.

Just copy it from dts of rock5b.

One thing mainline cannot do (yet) is hardware video encoding…

1 Like

Why do you think it does not work?

Because when I connect a USB-C mass storage device (USB->NVMe adapter), it doesn’t show up as a SCSI device and dmesg stays silent. Armbian uses the bcmdhd for that and it’s not included in the kernel.

Are we still talking about mainline kernel? Sorry, I just noticed you said “collabora version” which I believe includes patches from rockchip. Previously, I was able to use wifi with most recent GitHub - torvalds/linux: Linux kernel source tree with brcmfmac using your DTS overlay.

EDIT: Here’s an interesting matrix of all features which already went into mainline and what’s missing.

EDIT2: This seems to be the patch for USB-C support into mainline.

I know, that is what I meant before. I will add to image later.

It can cause random reboots on the Rock 5B tho which seems to be unresolved, yet.

Not on M7, as supply is on another fusb302, on another usb-c connector. I’ll leave that one out of the dts for now…

Edit:

See this what to add to mainline kernel sige7 dts for functional usbc and hdmi:

Use the usb-c connector on the corner of the board to power the board, the other has usb-c host functionality (and may have problems when used as power input)

1 Like

This worked! When I connect a device to the USB-C port, the host comes up:

[   33.301531] xhci-hcd xhci-hcd.6.auto: xHCI Host Controller                                                                                                                                
[   33.302033] xhci-hcd xhci-hcd.6.auto: new USB bus registered, assigned bus number 5                                                                                                                               
[   33.302794] xhci-hcd xhci-hcd.6.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000808002000010                                                                                                           
[   33.303640] xhci-hcd xhci-hcd.6.auto: irq 134, io mem 0xfc000000
[   33.304248] xhci-hcd xhci-hcd.6.auto: xHCI Host Controller
[   33.304733] xhci-hcd xhci-hcd.6.auto: new USB bus registered, assigned bus number 6
[   33.305406] xhci-hcd xhci-hcd.6.auto: Host supports USB 3.0 SuperSpeed
[   33.306057] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.13
[   33.306784] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   33.307418] usb usb5: Product: xHCI Host Controller
[   33.307848] usb usb5: Manufacturer: Linux 6.13.0-rc6+ xhci-hcd
[   33.308362] usb usb5: SerialNumber: xhci-hcd.6.auto
[   33.309125] hub 5-0:1.0: USB hub found
[   33.309470] hub 5-0:1.0: 1 port detected
[   33.309983] usb usb6: We don't know the algorithms for LPM for this host, disabling LPM.
[   33.310024] cpu cpu0: Looking up cpu-supply from device node /cpus/cpu@0
[   33.310729] usb usb6: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.13
[   33.312037] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   33.312386] cpu cpu4: Looking up cpu-supply from device node /cpus/cpu@400
[   33.312672] usb usb6: Product: xHCI Host Controller
[   33.312677] usb usb6: Manufacturer: Linux 6.13.0-rc6+ xhci-hcd
[   33.314224] usb usb6: SerialNumber: xhci-hcd.6.auto
[   33.314979] hub 6-0:1.0: USB hub found
[   33.315321] hub 6-0:1.0: 1 port detected
[   33.315920] cpu cpu0: Looking up cpu-supply from device node /cpus/cpu@0
[   33.317422] cpu cpu4: Looking up cpu-supply from device node /cpus/cpu@400

But no device detection (yet).

EDIT: I found when rotating the connector, the device gets correctly enumerated. Since /sys/class/typec/port*/orientation correctly detects the orientation, I suspect the mux isn’t acting accordingly and thus prevents the device from being detected.

Ive added the wifi to the sige7.dts for my linux-aarch64-rk-rc package. It is standard disabled, because we do not know if there is an antenna installed. Add wifi by enabling it:

[root@rk3588 ~]# nano /boot/dtbos/linux-aarch64-rk-rc/rk3588-armsom-sige7-wifi.dts
/dts-v1/;
/plugin/;

&pcie2x1l1 {
        status = "okay";
};

The image is also updated.

For me it works both ways… (I’m only having trouble with my rock5b, where it stays in device mode and won’t go in host mode. I have a hacked usbc-hub with shorted mosfets and fixed power supply to prevent bootloops.)

Thanks for making this project. I really want to run vanilla Arch but I’m having one major issue – no WiFi.

In fact, lspci doesn’t list the pci device at all:

[root@rk3588 ~]# lspci                                                                                                                                                                                           
0000:00:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01)                                                                                                                                           
0002:20:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01)                                                                                                                                           
0002:21:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)                                                                                                             
0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01)                                                                                                                                           
0004:41:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05)

I imagine it’s related to power and probably because of something in u-boot not configuring the proper voltages. What’s weird to me is that both BPI’s builds of Ubuntu and Debian both work. dmesg output is vastly different on Ubuntu/Debian than what I get on arch with this project. Notably – lots of voltage regulator messages and other module messages that detect wifi and other pci devices.

I’m using a usb-c PD device for powering – and since ubuntu/debian from RPI work it shouldn’t be the power supply causing the problem.

This ‘phy link never came up’ message is interesting:

[    1.864288] rockchip-dw-pcie a40000000.pcie: host bridge /pcie@fe150000 ranges:                                                                                                                               [    1.865012] rockchip-dw-pcie a40000000.pcie:       IO 0x00f0100000..0x00f01fffff -> 0x00f0100000                                                                                                              [    1.865832] rockchip-dw-pcie a40000000.pcie:      MEM 0x00f0200000..0x00f0ffffff -> 0x00f0200000                                                                                                              [    1.866639] rockchip-dw-pcie a40000000.pcie:      MEM 0x0900000000..0x093fffffff -> 0x0040000000                                                                                                              [    1.875296] rockchip-dw-pcie a40000000.pcie: iATU: unroll T, 8 ob, 8 ib, align 64K, limit 8G                                                                                                                  [    2.910851] rockchip-dw-pcie a40000000.pcie: Phy link never came up                                                                                                                                           [    2.911486] rockchip-dw-pcie a40000000.pcie: PCI host bridge to bus 0000:00     

Does anyone have any suggestions? Cheers & TIA

Wifi is disabled by default, it should not be enabled without antenna.

When using my image:

Add

cat /boot/dtbos/enable-wifi.dts
/dts-v1/;
/plugin/;

&pcie2x1l1 {
	status = "okay"; // Do not use this without antenna
};

Run:

rockchip-toolbox --dtbs

You will need /usr/lib/firmware/brcm/

brcmfmac43752-pcie.bin 
brcmfmac43752-pcie.clm_blob 
brcmfmac43752-pcie.txt

So install linux-firmware-brcm43752 package.

Last time I checked this, the driver for this chipset was not in a very good state.

Why is it not OK to use without antenna? Both the Ubuntu and Debian images from Banana Pi work fine without antenna.

Some people may say that the hardware can get damaged, when no antenna is connected.

Although I am not sure if this is the case, as the plug can get loose or poorly connected, will the hardware also get damaged?

Just to be on the safe side, not getting blamed for some vague issues, I disabled it and the user can enable it.

Great! Thanks, with those changes, WiFi works.

I ran the postinstaller you created but still don’t have any GUI (I disabled the Kodi installation, as I don’t want kodi). Was I supposed to install xf86-video-armsoc-meson? Or, which display driver does Xorg use? And have any of you been able to get Wayland working?

Thanks!

GUI should start when gdm is started:

sudo systemctl start gdm

So at least would need:

linux-firmware gnome xorg mesa mesa-utils gl4es-git ffmpeg-v4l2-request-git

I removed the armsoc xorg drivers and now gdm starts. However, no hardware acceleration. Everything is exceptionally slow/choppy.