[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.)