I spent my weekend (and some evenings) updating the OpenWrt build for the BPi-R2.
What I did:
bumped Linux to 5.10.51
updated U-Boot to 2021.04, many new features enabled
colorful bootmenu and recovery vs. production dual-boot, just like on the R64 (but no PSTORE yet, not sure if that’s even possible with the old preloader)
no more external scripts and helpers involved in build, all the magic happens in target/linux/mediatek/image/mt7623.mk now.
no more bootfs FAT partition – now that we have support for parsing uImage.FIT in Linux, there is no need to imitate this anti-pattern originating from the IBM PC and MSDOS…
just like on the R64, bootdevice is auto-detected when accessing U-Boot environment from inside OpenWrt (fw_printenv now installed by default) and also sysupgrade works on both, eMMC and SD card, depending on what was used for booting.
What is not working yet:
HDMI and multimedia features (@frank-w is working on that with upstream afaik)
2nd CPU port connected to MT7530 switch (making use of dsa-tag-protocol could help)
on-board IEEE802.11bgn 1T1R WiFi (no driver)
Bluetooth (?)
some LEDs are not mapped correctly (volunteers?)
AHCI driver triggers some MSI related warnings, SATA seems to work nice anyway
I see this patch is not yet approved to be merged, but well, it fixed accessing SATA disks in my case using branch 21.02. Can you try it as well and see if it works ? I could imagine this module gets loaded from another one in your configurations.
@pleira I only see your patch now, should have scanned patchwork before getting started. Anyway, it’s part of the changes I did, because I also noticed that we are dealing with “normal” PCIe AHCI here.
Maybe I’m lacking some things in DTS? I’m using the device-tree which got shipped with Linux, this is what the revelant part of the bootlog looks like:
...
[ 0.466476] mediatek-hdmi-phy 10209100.phy: Using default TX DRV impedance: 4.2k/36
...
[ 1.056720] mediatek-disp-ovl 14007000.ovl: error -2 can't parse gce-client-reg property (0)
[ 1.058591] random: crng init done
[ 1.067773] mediatek-disp-rdma 14008000.rdma: error -2 can't parse gce-client-reg property (0)
[ 1.079393] mediatek-disp-rdma 14012000.rdma: error -2 can't parse gce-client-reg property (0)
[ 1.090035] mediatek-drm mediatek-drm.1.auto: Adding component match for /ovl@14007000
[ 1.098004] mediatek-drm mediatek-drm.1.auto: Adding component match for /rdma@14008000
[ 1.106080] mediatek-drm mediatek-drm.1.auto: Adding component match for /color@1400b000
[ 1.114238] mediatek-drm mediatek-drm.1.auto: Adding component match for /rdma@14012000
[ 1.122259] mediatek-drm mediatek-drm.1.auto: Adding component match for /dpi@14014000
[ 1.130983] mediatek-mipi-tx 10010000.mipi-dphy: can't get nvmem_cell_get, ignore it
[ 1.141437] [drm] hdmi-audio-codec driver bound to HDMI
...
[ 2.119677] mediatek-dpi 14014000.dpi: Found bridge node: /hdmi@14015000
[ 2.126594] mediatek-dpi 14014000.dpi: Failed to add component: -517
...
[ 2.226750] mediatek-dpi 14014000.dpi: Found bridge node: /hdmi@14015000
[ 2.233641] mediatek-dpi 14014000.dpi: Failed to add component: -517
[ 2.240918] mediatek-dpi 14014000.dpi: Found bridge node: /hdmi@14015000
[ 2.247823] mediatek-dpi 14014000.dpi: Failed to add component: -517
...
That looks a bit like the good-old Ralink driver and will most likely also require a modified version of hostapd for anything else than Android-like use… Does AP-mode actually work with this driver in OpenWrt?
At least in U-Boot, the green and blue LEDs are swapped and polarity is inverted. The red LED cannot be controlled at all atm. I didn’t find the time to investigate this further…
Can you share a link to the (portable) variant of that patch which got merged in 5.12/5.13?
Hdmi:
parse gce-client-reg property is new to me…hdmi should work without modifications at least till 5.12. If you have the dtsnodes i’ve added to mainline (in new mt7623n.dtsi) then my series is working for hdmi (not tested mipi). Errors don’t look like compatibility problem (screen mode)
Ok,did not tested leds in uboot,but fixed them in linux some time ago.afair blue and green were swapped and active_low instead of high (ah you’ve wrote it).just make same changes i did in linux
Which kernel do you use,are there any backports for hdmi? I wonder why this seems required in openwrt for r2. I do not need it in 5.14…but some fixes like described above
Actually I want to have a PCIE WiFI Card with which I can play around. However, I wanted to let the some university buy the stuff and then you have the issue that you can not order from asia-rf…I need a europe shop.
No. This now works exactly like on the new OpenWrt image of the R64 (ie. much easier, no need to build from source, you can just install from SD card to eMMC):
I made some tests with otg on bpi-r2 (see x-otg branches in my repo including otg nodes). Got it so far that i can mount usb storage (with debugfs) but driver is unstable on poweroff (traceback),so i have not merged it.
Yep, I saw your work, but in my case quectel modem is not detected at all – while it’s working fine if connected to normal usb using external enclosure.
To initialize otg afair i need to enter some commands in debugfs. Seems like roleswitch does not work properly and the traceback on regulator on poweroff