LibreELEC.tv
LibreELEC.tv copied to clipboard
Rockchip: RK3399: add support for Orange Pi 4 LTS
This patch adds support for Orange Pi 4 LTS. This device is similar to the already supported Orange Pi 4, but it uses Motorcomm YT8531C ethernet controller and CDW 20U5622-00 Wi-Fi + BT controller. There's no indication of attempts to mainline CDW driver so wireless and BT don't work at the moment.
The patches for Motorcomm driver and device tree are taken from manjaro-arm's linux-opi repository: https://gitlab.manjaro.org/manjaro-arm/packages/core/linux-opi
Support for YT8531C is mainlined and present in v6.3-rc1 branch, so once LibreELEC switches to Linux v6.3, that patch can be dropped.
Additionally, U-Boot is patched to add OPi 4 LTS support too. This is not strictly required, but as LibreELEC's build system uses U-Boot's configured dtb name for Linux dtb as well, this solution is simpler than overhauling the build scripts. Since U-Boot doesn't support Motorcomm PHY, the support is added by simply copying existing rk3399-orangepi dts and defconfig as rk3399-orangepi-4-lts. This means that networking won't work on 4 LTS, but there's no big impact because LibreELEC doesn't rely on network functionality in U-Boot.
@danijelt How about submitting this DT upstream? I'd like to avoid having (so simple) patches here forever, as they also need to be maintained forever. If you need help doing it: ping me. Once it is on a mailing list, update the patch (if necessary), post the link in this PR and it's going to be merged here instantly.
@knaerzche Good question, and I agree. I don't see any attempts on mainlining it. It's present only in Manjaro's tree. I have contacted the author, Furkan Kardame, to see what's up with it.
Hello @knaerzche
I hope I will be able to upstream it soon.
@danijelt if @spikerguy doesn't have the time to do it, you can do so either and keep the authorship. This DT is floating around in so many different repos for a long time now: I think it's time to push it upstream :)
@knaerzche I'll leave it to @spikerguy for now because there's more work to this than I initially imagined. Long story short, U-Boot patched this way doesn't actually work and I didn't notice it because I forgot (again) that RK3399 prioritizes the eMMC bootloader if it's present. @spikerguy linked me his U-Boot patch so I'll have to try it in the next couple of days.
upstream kernel (6.3.y) already supports YT8531, and Rockchip kernel is 6.3.4, please drop related patch.
@zhangn1985 I was actually trying this last week, but the build from updated master doesn't work anymore - the board has no video output and there's constant reboot loop after systemd logs that Kodi service started. My guess is that something in dts files changed in the meantime, but it was just a quick test and won't have time to take a better look at it for a few more weeks.
you can check: https://github.com/armbian/build/pull/5291
Hi, here I wrote a list of problems I could find without normal OPi4 LTS support:
- Problems with screen resolution (maximum 1024x768 instead of 1920x1080)
- No sound output
- On the last commit of the master branch ethernet gets IP-address 169.254.-.-, and should be 192.168.-.- (in my case), after merging opi4lts and master branch and also a little editing of the patch - ethernet works as it should (patch can be found here - https://gist.github.com/JDM170/a77d0a69bf1d065fc0fb2f6424c3227c).
Also I did some information search and found out that the main Wifi and BT chipset is called UWE5622 (analogs - AW859A, SC2355). I found drivers for it in armbian repository on Github as patches. I tried adding them to LibreELEC, the build completes successfully, but the system does not start with a partition mount error. I think I need to add some kind of definition to the dts file so that the board knows it has such an adapter (UWE5622). I tried to get the dts file from armbian, I also tried to add only the wifi adapter to the dts file, but unfortunately it didn't work.
P.S. I have this board, and can test different builds if any become available
I was able to boot from master the other day with DTS from Armbian as suggested by @zhangn1985, but CEC is not working. Other than that, everything else works fine like it does in v11 release. (Still have to test U-Boot, though.)
I would like to echo that I am available as well as any builds become available. For now, I will look at docs on how to build this myself. Using this branch. Currently I tried to use the build "LibreELEC-RK3399.aarch64-11.95.1-orangepi.img.gz" from here https://libreelec.tv/downloads/rockchip/ but it just "boot loops"
Edit: I also used image LibreELEC-RK3399.arm-11.0.6-orangepi.img.gz same boot loop. I am currently building this PR using PROJECT=Rockchip ARCH=arm DEVICE=RK3399 make image
I managed to build but didn't get a orange pi 4 LTS image
I burned LibreELEC-RK3399.arm-12.0-devel-20240329165856-20d54cf-orangepi.img
and I still get a boot loop