Jump to content

CSC Armbian for RK322x TV box boards


jock

Recommended Posts

Thanks so much @jock and of course @hexdump and @fabiobassa...

 

I followed the @hexdump instruction about how to mix the LibreELEC for the mk809iv and one of the latest Armbian image from this page (the Armbian 20 05 0 trunk R329q bionic legacy 4.4.194 desktop). 
 

it worked at first try... wired eth working. Imam checking all the other features.

 

I‘ll keep you posted.

 

thanks so much, Alessandro 

B2FB7871-EF27-46DF-B181-6F59030E21A2.jpeg

Link to comment
Share on other sites

@jock - what is this repo for actually? - https://github.com/paolosabatino/rockchip-4.4-mali - i thought that the rockchip tree already comes with its gpu subtree (https://github.com/rockchip-linux/kernel/tree/stable-4.4-rk3288-linux-v2.x/drivers/gpu/arm) ... and: did you already try to get the mali blobs somehow working with mainline on the rk322x?

 

a lot of thanks in advance and best wishes - hexdump

Link to comment
Share on other sites

6 minutes ago, hexdump said:

@jock - what is this repo for actually? - https://github.com/paolosabatino/rockchip-4.4-mali - i thought that the rockchip tree already comes with its gpu subtree (https://github.com/rockchip-linux/kernel/tree/stable-4.4-rk3288-linux-v2.x/drivers/gpu/arm) ... and: did you already try to get the mali blobs somehow working with mainline on the rk322x?

 

a lot of thanks in advance and best wishes - hexdump

It is an attempt to port r7p0 mali kernel driver to work with legacy kernel 4.4. It compiles and the module loads, but then does not actually work well when an application tries to use the GPU.

The rockchip legacy kernel already comes with r5p0 mali driver and, despite the version mismatch, I confirm that r7p0 userland blobs works with it. I was able to run quake2 - which is my favorite benchmark - but it was not pretty solid and after a while some GPU errors comes up in dmesg. I didn't found the cause, but it could be that I was just "overclocking" the rk3228a I was using to make the tests.

Link to comment
Share on other sites

@jock - i did some more tests: i build a kernel myself based on your sources and patches but with HIGHMEM disabled again and the 4.4.194 kernel still hangs in the middle of the boot on my 2gb r39-4k rk3229 box (4.4.189 works fine with just showing 1gb ram and 4.4.194 works well on my 1gb mk809iv rk3228 box) - does it work for you on any rk3229 2gb box? do you have an idea which of the patches between your 4.4.189 and 4.4.194 kernels might trigger this hanging?

 

i also built a 5.4.22 mainline kernel based on your patches - it boots further (i can get into x11 even with it) but starts to be quite erratic and eventually hangs later - but it at least discovers the 2gb ram properly according to the logs :)

 

best wishes - hexdump

Link to comment
Share on other sites

13 minutes ago, hexdump said:

@jock - i did some more tests: i build a kernel myself based on your sources and patches but with HIGHMEM disabled again and the 4.4.194 kernel still hangs in the middle of the boot on my 2gb r39-4k rk3229 box (4.4.189 works fine with just showing 1gb ram and 4.4.194 works well on my 1gb mk809iv rk3228 box) - does it work for you on any rk3229 2gb box? do you have an idea which of the patches between your 4.4.189 and 4.4.194 kernels might trigger this hanging?

 

i also built a 5.4.22 mainline kernel based on your patches - it boots further (i can get into x11 even with it) but starts to be quite erratic and eventually hangs later - but it at least discovers the 2gb ram properly according to the logs :)

 

best wishes - hexdump

It could be that your rk3229 board (the 2gb one) is not really a rk3229 but an rk3228a. Try removing from the device tree the operating points above 1.2ghz and try again. Just yesterday I discovered that on the rk3228a both the lima kernel module and the higher operating points are causing erratic issues. Lima was causing the system to hang without any further message during systemd boot. Blacklisting lima, the boot process proceeded further but then I got kernel stack dumps, which were finally solved removing the operating points from the dtb. This is about mainline kernel.

Regarding the legacy kernel you can bring the highest frequency to 400 Mhz (instead of 500) in the GPU operating points table changing again the dtb.

 

 

Link to comment
Share on other sites

@jock - i tried reducing the opp tables on mainline to 1.2ghz and to lower the opp and gpu clocks on the rockchip kernel - nothing changed. also with the working 4.4.189 kernel it works with the full opp and gpu clocks without any problem.

 

@fabiobassa - here is the efuse content:

root@r39-4k:~# hexdump -C /sys/bus/nvmem/devices/rockchip-efuse0/nvmem
00000000  52 4b 23 82 81 d4 70 55  52 4b 4e 30 39 30 32 35  |RK#...pURKN09025|
00000010  00 00 00 00 01 2c 15 03  00 03 81 00 00 80 00 00  |.....,..........|

 

how to interpret this?

 

update: i also tried to boot the 4.4.194 kernel with the 4.4.189 dtb to rule out potential dtb changes - it does not work the same way the 4.4.194 kernel with its own dtb does not work, so the reason for the problems should be somewhere in code changes between 4.4.189 and 4.4.194 i guess ...

 

a lot of thanks in advance and best wishes - hexdump

Link to comment
Share on other sites

@hexdump

thanks for replayng ;   you have a 3228 and not a 3229 , probabily a 3228b

00000000  52 4b 23 82 the numbers 23 82 are 3228 in reverse mode
so you must use trust os for 3228, the trust os for 3229 simply will not boot the board but this you already knew

regarding the changing in code in kernel I did the following ( but no changes in code, maybe in make config )


in my long post linux on 3229  I used too the kernel 4.4.189 and it worked fine. I booted in 4.4.189 and take the config.gz and then recompile 4.4.194 with that same .config and it worked with SAME dtb .

last info : I am pretty sure you have uart debug. At very early booting ( power on) what ddr it says ?

ddr3 or ddr2 ? because ddr2 on 3228 HAVEN'T dmc ( ddr frequency scaling) so they will run at the speed that uboot set , probabily at 333 mhz ( all this infos thanks to @knaerzche that explained in his work on libreelec ).

If you have ddr2 you must DISABLE dmc node in dtb


boards with 3228b and ddr2..... well.... they are a bit slower than others


EDIT:

i realized the different behaviour from kernel 4.4.194 to 4.4.189

in @jock config many thing are compiled as modules so then you must insert right modules under /lib/modules

in 4.4.189 compilation many things are compiled IN kernel so they work  out of box, but yet you should check if have ddr2 or ddr3
 

Link to comment
Share on other sites

@fabiobassa - good point - i now used the config from the 4.4.189 kernel plus make oldconfig for building 4.4.194 and the resulting kernel now boots and works perfectly fine :)

 

update: i did not yet find the console connector on this box, but of all the librelec images it only booted the ddr2 one, so i assume it has dd2 memory ... about the rk3228: the funny thing is that it runs nicely with the 1.4ghz clock speed of the rk3229-xt-mx4vr-v01.dtb ...

 

@jock - maybe your 4.4.194 kernel config should be reviewed and potentially adjusted? btw. i can confirm that your above suggested cursor fix for your armsoc xorg server works well ...

 

a lot of thanks and best wishes - hexdump

Link to comment
Share on other sites

I was sure in the meanwhile you found the uart :(

 

Btw yes , most probability you have DDR2 and a bit of overclocking will do the board sure work with some erratic hanging, but work !

About the config , you can still use 4.4.194 config and kernel, just be sure to make modules and install modules in some dir during compilation and then copy the whole folder under /lib/modules/4.4.194 in your root.

 

It gives you more " control" to load and unload unwilled modules

Link to comment
Share on other sites

@hexdump

It could certainly be that the 4.4.194 config requires some adjustment. I just tried to boot the ubuntu 18.04 - 4.4.194 image on my xt-mx4vt-v01 (which I suppose it has a rk3228a) and it boots with cpu@1.4ghz and gpu@500Mhz :unsure:

 

I have some possible explanation for your hang during boot: the DMC (ie: DDR memory controller) kernel driver can work only when there is the original boot loader. To be specific it requires a "function call" in the trust OS. Since you're using the original bootloader chain, you get the original trust OS which has this function call. Now the DMC kernel driver has no support for DDR2 memory reclocking. If your board has DDR2 memories, when the DMC driver loads up, your machine hangs up.

 

The bootloader chain in the images I published are instead based on mainline u-boot and use OPTEE as trust OS, which is partially opensource. OPTEE has no such function call to do memory reclocking, so the DMC kernel driver does not start and the machine boots fine.

 

This is just an hypothesis,. Could you post here your dmesg log and the 4.4.189 config here?

 

Link to comment
Share on other sites

@jock - your theory sounds good i think - might be the case ... the 4.4.189 kernel config i used as starting point was the one from your last 4.4.189 based images ... this is the one i used then after a "make oldconfig" which resulted in the working 4.4.194 kernel: https://github.com/hexdump0815/linux-rockchip-rk322x-kernel/blob/96bf87bd0014f2d5a17ddcd1202980d2023d2302/config.322

 

best wishes - hexdump

Link to comment
Share on other sites

28 minutes ago, hexdump said:

@jock - your theory sounds good i think - might be the case ... the 4.4.189 kernel config i used as starting point was the one from your last 4.4.189 based images ... this is the one i used then after a "make oldconfig" which resulted in the working 4.4.194 kernel: https://github.com/hexdump0815/linux-rockchip-rk322x-kernel/blob/96bf87bd0014f2d5a17ddcd1202980d2023d2302/config.322

 

best wishes - hexdump

ahhh, right I remember that kernel config :lol: I had to disable the DMC devfreq config option because it was refusing to compile. Now it turned out that it was better to not have it.

I'm going to publish new images with the dmc node disabled from the device tree, so there won't be any more issues.

Link to comment
Share on other sites

Hello !

I am trying to run on the T95N-RK3229_512X4-20170803_V1.5 board (RK3229, RAM K4B2G0446D, wi-fi SV6051P).

I tried all the pre-assembled firmware from the first message. Cannot start completely.

I recorded the TF-card with RUFUS.

What program do you record the image?

 

ps On this board, I managed to successfully run only Respeaker Core V2.0 (without wifi)

Edited by Maker39
Link to comment
Share on other sites

Quote

Cannot start completely.

@Maker39 
would you explain the meaning of this sentence ?
It hangs ? no video ? video and not audio ? What exactly

If you have read all the posts in this 3ad you should have realized that just giving the COMMERCIAL name or the advertizing on ram and or processor doesn't help very much

so please try to enumerate in more detailled way  all the problems you are experimenting

BTW i am using win32 disk imager

Link to comment
Share on other sites

There is video, but the download stops either with an error or without an error. I connected UART and recorded the logs.

(Armbian_20.05.0-trunk_Xt-mx4vr-v01_focal_legacy_4.4.194_desktop.img.log and Armbian_20.05.0-trunk_Xt-mx4vr-v01_buster_current_5.4.21_minimal.img.log attached)

Armbian_20.05.0-trunk_Xt-mx4vr-v01_focal_legacy_4.4.194_desktop.jpg

Armbian_20.05.0-trunk_Xt-mx4vr-v01_buster_current_5.4.21_minimal.jpg

Armbian_20.05.0-trunk_Xt-mx4vr-v01_focal_legacy_4.4.194_desktop.img.log Armbian_20.05.0-trunk_Xt-mx4vr-v01_buster_current_5.4.21_minimal.img.log

Link to comment
Share on other sites

@Maker39

Download a new fresh copy of the legacy kernel image.

 

You were just unlucky because for a bunch of days during early march I uploaded an image which was not working: initramfs compression changed to lz4 and I forgot to enable the kernel flag.

 

The mainline kernel is still a bit itchy, especially if you have an RK3228a device: despite most of the boards are sold as RK3299, they may actually have rk3228a, rk3228b or rk3229 socs.

Link to comment
Share on other sites

@Maker39 
you have a
 nice board with ddr3 ram . This is good since you will have really good performances
use the r329 q ONLY and please post output of:
 

cat /sys/class/devfreq/dmc/trans_stat
hexdump -C /sys/bus/nvmem/devices/rockchip-efuse0/nvmem
dmesg | grep wlan

maybe you should blacklist some modules under /lib/modules

Link to comment
Share on other sites

Launched R329q_focal_legacy_4.4.194_desktop.

 

Spoiler

root@r329q:~# cat /sys/class/devfreq/dmc/trans_stat
cat: /sys/class/devfreq/dmc/trans_stat: No such file or directory

root@r329q:~# hexdump -C /sys/bus/nvmem/devices/rockchip-efuse0/nvmem
00000000  52 4b 23 92 81 f0 70 55  52 4b 4e 35 31 30 31 35  |RK#...pURKN51015|
00000010  00 00 00 00 0b 13 2f 04  00 03 01 00 00 88 00 00  |....../.........|
00000020

root@r329q:~# dmesg | grep wlan
[    4.927834] usbcore: registered new interface driver rndis_wlan
[    6.175363] [WLAN_RFKILL]: Enter rfkill_wlan_init
[    6.175639] [WLAN_RFKILL]: Enter rfkill_wlan_probe
[    6.175661] [WLAN_RFKILL]: wlan_platdata_parse_dt: wifi_chip_type = ssvb6501
[    6.175665] [WLAN_RFKILL]: wlan_platdata_parse_dt: enable wifi power control.
[    6.175668] [WLAN_RFKILL]: wlan_platdata_parse_dt: wifi power controled by gpio.
[    6.175673] of_get_named_gpiod_flags: can't parse 'WIFI,poweren_gpio' property of node

'/wireless-wlan[0]'
[    6.175678] of_get_named_gpiod_flags: can't parse 'WIFI,vbat_gpio' property of node

'/wireless-wlan[0]'
[    6.175683] of_get_named_gpiod_flags: can't parse 'WIFI,reset_gpio' property of node

'/wireless-wlan[0]'
[    6.175712] of_get_named_gpiod_flags: parsed 'WIFI,host_wake_irq' property of node

'/wireless-wlan[0]' - status (0)
[    6.175715] [WLAN_RFKILL]: wlan_platdata_parse_dt: get property: WIFI,host_wake_irq = 28,

flags = 0.
[    6.175727] [WLAN_RFKILL]: wlan_platdata_parse_dt: The ref_wifi_clk not found !
[    6.175729] [WLAN_RFKILL]: rfkill_wlan_probe: init gpio
[    6.175737] [WLAN_RFKILL]: Exit rfkill_wlan_probe
root@r329q:~#

As written jock in the first post , i remove from /etc/modprobe.d/blacklist-r329q.conf  ssv6051.

Wi-Fi enabled now.

And I managed to connect to the access point, though only in p2p0 mode.

 

Link to comment
Share on other sites

@Maker39

sv6051 wifi is blacklisted in /etc/modprobe.d since sometimes makes the system unstable. You can enable it removing the blacklist file from that directory.

 

edit: just read you already unblacklisted the module :lol:, btw p2p0 and wlan0 works the same way on my boards, but didn't test them really well because I'm away from the access point and the connection is not very reliable.

Link to comment
Share on other sites

@jock

Thanks for the answer. I have an attempt to connect wlan0 fails .

The next step is another problem.

I tried to transfer the system to eMMC via armbian-config, but it turned out that the eMMC utility does not see it.

When a USBstick is connected, I can transfer system to it, but still, without an external SD, loading does not occur.

What am I doing wrong ?

eMMC.PNG

Link to comment
Share on other sites

@Maker39 which image did you use?

Don't use r329q image: eMMC on that image is deactivated because r329q boards have NAND chips instead of eMMCs.

 

You should use xt-mx4vr-v01 images instead: you posted a dmesg log from the xt-mx4vr-v01 image that shows the emmc is detected and should work fine. Be sure that  lsblk utility shows mmcblk2 device

Link to comment
Share on other sites

@Maker39

you are welcome

 

Quote

'll try to install Domoticz and NodeRed now.


yes , me too I use it with some economic relais

https://www.ebay.it/itm/NEW-2-Channel-USB-Relay-5V-Programmable-Computer-Control-For-Smart-Home/352565804995?hash=item52168f3fc3:g:SA0AAOSwWI5cN~Ff


and this project :

https://github.com/ondrej1024/crelay

with this app on telephone, even idf made for raspberry  it works perfectly

https://apk.support/app/com.jasonfindlay.pirelaypro

 

Link to comment
Share on other sites

It turned out that packages are not being installed. :o

Apt-get update apt-get upgrade does not work.

Some kind of wrong repository?

Spoiler

root@xt-mx4vr-v01:~# apt-get update
Get:1 https://apt.armbian.com focal InRelease [18.2 kB]
Get:2 http://ports.ubuntu.com focal InRelease [264 kB]
Get:3 http://ports.ubuntu.com focal-security InRelease [97.4 kB]
Get:4 http://ports.ubuntu.com focal-updates InRelease [88.6 kB]
Get:5 http://ports.ubuntu.com focal-backports InRelease [88.7 kB]
Reading package lists... Done
E: Release file for http://apt.armbian.com/dists/focal/InRelease is not valid yet (invalid

for another 17d 12h 35min 30s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/dists/focal/InRelease is not valid yet (invalid

for another 17d 18h 19min 14s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/dists/focal-security/InRelease is not valid yet

(invalid for another 17d 13h 23min 58s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/dists/focal-updates/InRelease is not valid yet

(invalid for another 17d 11h 27min 52s). Updates for this repository will not be applied.
E: Release file for http://ports.ubuntu.com/dists/focal-backports/InRelease is not valid yet

(invalid for another 17d 11h 28min 4s). Updates for this repository will not be applied.
root@xt-mx4vr-v01:~#

OOps...  date/ time is wrong ! ( Sun 15 Mar 2020 09:23:54 PM EET).

Maybe NTP wont work..

 

P.S. Solved ;)

Manually set date/time

Update/Upgrade worked.

Install NTP client : sudo apt-get install ntp ntpdate

 

IMHO, image not include ntp client.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines