[R2Pro] Mainline Linux Support

Hi,

FYI: i’ve sent out the first Series for Mainline Support in Linux Kernel

Patchwork - Bpi-R2-Pro basic Support

in my repo i have working:

  • GMAC1 needs rtl8367 driver (DSA driver on the way), or if ready a modification for mt7531
  • USB3/SATA needs NANENG CombPhy Driver to be merged first, V7 needs some redesign, so this will take a while
  • PCIe is partially working (only after second bootup, maybe some clock issue), but needs pciev3 driver and bifurcation Patches
  • rtc and reset switch are reported broken in my board version. Rtc is added,but i can not verify function
  • functions on gpio header are verified (i2c,spi,uart,pwm)
  • hdmi working with v3 of vop2 series +reg-fix, but not merged to next2 tree yet

most complete support is here

Hdmi only in 5.16-next-hdmi

2 Likes

basic dts is now merged to rk-dts tree and will be in Mainline in 5.18.

@sinovoip if you change anything based on this basic dts (no switch included) please let me know.

edit: barebox now knows the board too :slight_smile:

:bangbang: Attention :bangbang:

it seems new HW-rev with mt7531 switch changed IO-domains

so do not use the current mainline/my dts without checking

if you use a mt7531-bpi-r2pro currently you need to apply at least this patch

else your board may be damaged.

@sinovoip can you confirm this patch for sending upstream to mainline dts is save to use for sale versions of r2pro?

Seems like gmac-connection is changed too. I see you now connect mt7531 switch to mdio0, rtl8367 switch was connected to mdio1

i will rebase my tree / send followup to correct it, but i need someone with the board for testing.

1 Like

patch for BPI-R2-Pro fixing io-domains/gmacs is already applied (for 5.19).

had some trouble with usb on 5.18 (5.17 works after adding second gpio regulator). It was caused by grabbing clocks by name. Peter sent a patch using rockchip names too and now usb is working with his series. 5.19 will have usb3 and sata support for r2pro.

Got pcie3 working (with same code as i tried on v00 where is had worked only sometimes) and sent out rfc patchset for wider testing. Sent a v2 (still rfc/rft) with a lane-map suggested in v1

Rtc is visible,but does not respond on driver init.

Hdmi- and analog- Sound seems broken,hp-detection is still not working.

Mt7531 phy driver is working, dsa driver recognizes/initializes switch after making reset optional. traffic works now too after making fixed cpu-port 6 dynamic. Sent put a RFC series to mailinglist for mt7531 driver changes and adding dts node.

I took the latest version of the Armbian image for Station P2 and immediately launched on BPIR2Pro without changes. Immediately works HDMI LAN (first port), HDMI sound, 3.5 analog sound, eMMC, USB, power button. :slight_smile:

https://forum.armbian.com/topic/20513-banana-pi-bpi-m2s-bpi-r2-pro/?do=findComment&comment=138950

Hi,

Can you show me your changes? I wonder why hdmi/analogue audio is working because i had them working on the older hw rev.

Currently i work on getting switch and pcie3 mainline. You can look on my repo (5.18-r2pro-hdmi-mainline2 and 5.18-mt7531-mainline branches).

Have you got rtc working? I see it on i2c but driver cannot find it.

As the first test, I used the existing ArmbianTV image

that I am developing for Station P2 (with DTB for this model, without special fixes for BPI R2 pro). Everything works with it as I described (only the lower USB port works). In the near future, I plan to add a separate DTB (with the necessary fixes) specifically for BPIr2pro to my build system. You can see all the patches I use in my GIT.

By the way, I checked the launch and operation of LibreELEC on BPIR2pro, everything starts and works (including directly from USB media using an Armbian SD card, with a new u-boot with support for direct launch of different systems directly from USB). ie, you can easily launch different systems by simply connecting a USB flash drive with test systems.

let me know when you have the dedicated dts for r2pro, or could you look what part may be missing in my hdmi branch for hdmi/analog audio? hdmi soundcard is deferred in my kernel and analogue was found, but left/right is not separated. no response to hp-detect when plugging in/out

maybe my board has a hardware-problem (as i had these 2 working with v00 board), maybe i miss some config-option (use the q64 one for hdmi).

does the hp-detect works for you (using headphone-microphone when 4pin plugged in?)

I see this is a BSP branch, I’m using the 5.17 and 5.18 core core. Why waste time on the old core?

I don’t have a 4 pin connector, I use regular speakers with 3 pins. You can easily check your equipment, use the latest version of Armbian with XFCE (download, unpack and burn to an SD card, you don’t need to change anything), connect and check whether your headphones will work or not. There is already a test clip in the composition that can be quickly launched, do not forget to switch the output from HDMI to analog in the mixer settings. My analog sound works well on BPIR2pro.

?? this branch is 5.18 and using basicly last hdmi series from Sascha (name v10 but added the missing patch added in v11)

Edit: changed link

The link in your message leads to

frank-w/BPI-R2-4.14

perhaps you gave an incorrect link in the previous message ?

my repo starts at 4.14, but goes up to 5.18-rc4 :wink:

r2pro parts are 5.18 (hdmi is not yet rebased to rc4, but rc1)

your last link sends a comparison of branches, which is not suitable for analyzing the full code. :slight_smile:

perhaps this branch is meant ?

Ah sorry,right,copied the branchlink from commit. Yes i mean the 5.18-r2pro-hdmiv10 which is basicly v11 (have not renamed it after doing rever/add difference patch).

For the VOP2 series 11 patches to work, you need to make a small correction. I’m not sure if this is a bug, but this line is causing the build issue. After it is turned off, the assembly passes without errors and the HDMI output works. By the way, with the patches of the 11 series, the choice of screen resolution in the latest version of Libreelec began to work for me.

Happy to see Oleg back to contributing to multiple vendors :smiley: I have Station P2 patch too, I plan to upstream it soon.

Do you have any plan to upstream it @balbes150 ?

While @sinovoip is still not sent me any R2Pro sample even after confirming that it will be sent out soon.

i have this line in place, but no build error…

function is defined in drivers/gpu/drm/rockchip/rockchip_drm_drv.h (rockchip_drm_drv.c) and always build in…maybe you miss an include?

:slight_smile:

I think this is a temporary error and it will be fixed without me :slight_smile:

I am using the full set of patches of the entire series along with the latest version of the kernel sources (without intermediate patches). Perhaps the reason for the build error is this. But I know for sure that HDMI works with the latest kernel version and the latest V11 patches on all my rk356x devices. :slight_smile: By the way, I checked DTB for BPIR2pro only with your patches on my 5.18-rc4 core, HDMI works without problems.

hdmi itself works for me too, but not the hdmi-sound which is deferred on hdmi-node i don’t know why. analoge audio soundcard is initialized but left/right channel was mixed in my last test

This is a patch that also included HDMI and analog audio on BPIR2pro.