Jump to content

Efforts to develop firmware for H96 MAX V56 RK3566 4G/32G


hotnikq
 Share

Recommended Posts

On 11/17/2022 at 11:12 PM, tmm1 said:
Does /dev/dri actually exist?


Yes, it's working fine on my ubuntu 20.04 Kernel 4.19.219 RK3566 H96MAX ,

I use /dev/dri/renderD128 on Tdarr to ffmpeg videos over lan to h264 mp4.

What you trying to do?  👀

Be sure thar your device have Vaapi capable on chip
be sure that you kernel SDK have drivers to run it
be sure that your DTS / DTB shows where the Api Run and How it Run.

 

 

Edited by hotnikq
Link to comment
Share on other sites

Search Before Posting!

@tmm1 you were right, it is not possible to allocate memory to the device, I believe that because RKNPU dont work on this compilation.
i think ffmpeg fallback to CPU when vaapi fail.
driver rknpu version 0.4.2. dont find the RKNPU or memory allocation. 

Sem-t-tulo.jpg

 

/usr/lib/jellyfin-ffmpeg/ffmpeg -v debug -init_hw_device drm=dr:/dev/dri/renderD128 -init_hw_device vaapi=va@dr



Sem-t-tu2lo.jpg

Edited by hotnikq
Link to comment
Share on other sites

@tmm1 can you work around the DTS / DTB file to make RKnpu working on this device?
i think it's about rknpu_reserved memory 
it's different from android
Linux use iommu to load rknpu

the SDK to compile is the Pine64 Custom


Partition Parameter.txt

Quote

FIRMWARE_VER: 1.0
MACHINE_MODEL: RK3568
MACHINE_ID: 007
MANUFACTURER: RK3568
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 0xffffffff
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE: mtdparts=rk29xxnand:0x00002000@0x00004000(uboot),0x00002000@0x00006000(misc),0x00010000@0x00008000(boot),0x00010000@0x00018000(recovery),0x00010000@0x00028000(backup),-@0x00038000(rootfs:grow)
uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9

 

 

 

 

Edited by hotnikq
Link to comment
Share on other sites

@tmm1

 

currently the execution takes place via iommu and not with memory allocation.
to use memory allocation via CMA DMA, you need to disable the iommu framework.
and that's a job for another, I don't intend to spend another 30 days on this development.



DTS structure: 

set NPU

 

Quote

    npu@fde40000 {
        compatible = "rockchip,rknpu";
        reg = <0x00000000 0xfde40000 0x00000000 0x00010000>;
        interrupts = <0x00000000 0x00000097 0x00000004>;
        clocks = <0x00000002 0x00000002 0x0000001f 0x00000023 0x0000001f 0x00000028 0x0000001f 0x00000029>;
        clock-names = "scmi_clk", "clk", "aclk", "hclk";
        assigned-clocks = <0x0000001f 0x00000023>;
        assigned-clock-rates = <0x23c34600>;
        resets = <0x0000001f 0x0000002b 0x0000001f 0x0000002c>;
        reset-names = "srst_a", "srst_h";
        power-domains = <0x00000021 0x00000006>;
        operating-points-v2 = <0x0000005d>;
        iommus = <0x0000005e>;
        status = "okay";
        rknpu-supply = <0x0000005f>;
        phandle = <0x00000171>;

 

set Power domain to NPU
 

Quote

 power-management@fdd90000 {
        compatible = "rockchip,rk3568-pmu", "syscon", "simple-mfd";
        reg = <0x00000000 0xfdd90000 0x00000000 0x00001000>;
        phandle = <0x00000170>;
        power-controller {
            compatible = "rockchip,rk3568-power-controller";
            #power-domain-cells = <0x00000001>;
            #address-cells = <0x00000001>;
            #size-cells = <0x00000000>;
            status = "okay";
            phandle = <0x00000021>;
            pd_npu@6 {
                reg = <0x00000006>;
                clocks = <0x0000001f 0x00000027 0x0000001f 0x00000025 0x0000001f 0x00000026>;
                pm_qos = <0x00000045>;
            };


iommu NPU
 

Quote

    iommu@fde4b000 {
        compatible = "rockchip,iommu-v2";
        reg = <0x00000000 0xfde4b000 0x00000000 0x00000040>;
        interrupts = <0x00000000 0x00000097 0x00000004>;
        interrupt-names = "rknpu_mmu";
        clocks = <0x0000001f 0x00000028 0x0000001f 0x00000029>;
        clock-names = "aclk", "iface";
        power-domains = <0x00000021 0x00000006>;
        #iommu-cells = <0x00000000>;
        status = "okay";
        phandle = <0x0000005e>;
    };


 

Link to comment
Share on other sites

Release Version v0.3 BETA
 No Video out (device tree bad arg)
 No Virtualization (kernel config)
 No Docker (kernel capability)
H96 MAX RK3566 Board V56
Kernel 4.19.219
Linux FIT Image Rockchip EMMC
Ubuntu 20.04 LTS
This image has been compiled without any standardization and should be used for experimental purposes only,
there is no guarantee of compatibility with your device

Download Link: Ubuntu_20.04.5_K4.19.219_RK3566_H96_MAX_4GB 👈

Download Link: Ubuntu_20.04.5_K4.19.219_RK3566_H96_MAX_8GB 👈
 

This FIT image needs to be flashed on the internal storage, this board don't have SD CARD Reader.
Just Press the RESET Button when connect male-male USB 2.0 (BLACK) to Desktop

MAKE Backup Rockchip Firmware emmc

Install Drivers, Driver Assistant Download
RkDevTool Download

Upgrade Rockchip Firmware eemc
Maskrom mode

Loader mode


when the Board Boot UP you will need to conect RJ45 LAN, Find the IP Addres on your PiHole, Firewall or  Lan Router
and SSH to the ubuntu.
 

Quote

User: ubuntu
Password: ubuntu



First BOOT COMANDS:

Quote

### Partition " / " resized to FULL DISK ###
$ df -h
 sudo resize2fs /dev/mmcblk2p6
$ df -h


🏆 help to add this board in armbian standart, you don't need to be a programmer to help the community,
just need a copy of the V56 board and a x86 computer to compile new versions.

Base Parameters to build:

H96-MAX-Uboot-legacy.img

Partition-Parameter.txt

H96-MAX-8gb-MiniLoaderAll.bin

H96-MAX-4gb-MiniLoaderAll.bin
DTB + DTS + rockchip_defconfig


SDK Used into this Build:

SDK 4.19.219 LINUX to RK3566 H96 MAX

Please, Use a debug Tool TTL UART
Baud rate: 1500000

Data bit: 8

Stop bit: 1

Parity check: none

Flow control: none
☑️ CP2104 TTL Tested!
☑️ CP2102 TTL Tested!
☑️ CP210X TTL Tested!



Rockchip boards are unbrikable
in a worse case  you need to short the EMMC CLK pin to GND on the other side of the board 
and upload the righ LoaderALL.bin File from a linux machine that you backup.
to connect the RK3566 on Desktop USB Maskrom Mode.


@tmm1 @Walma @mvpwar @Carol

Let's debug it!

Link to comment
Share on other sites

@tmm1  as i mentioned for the russians.

Find your Backup ROM or download from WEB.
"4G-RK3566_userdebug_H96_Max_RK3566_11_20210810.1920.img"
"8G-RK3566_userdebug_H96_Max_RK3566_11_20210421.2051.img"
 

extract the image using the "windows" app or use it on "linux" app
imgRePackerRK_107h_test
imgRePackerRK_107m_test
imgRePackerRK_107

Under Linux extract image:

Quote

$ sudo ./imgrepackerrk /cid imagefile.img


👆👆
it was solved by RedScorpio From XDA

inside the extracted ROM image folder of your  device, you will find the file MiniLoaderAll.bin

 

Edited by hotnikq
Link to comment
Share on other sites

The box I found is RUPA 4GB RK3566. It had a SD card port so I realized it's more similar to T95 Plus. I tried the firmware from t95plus.com and it is working with HDMI.

 

I will try to find a H96 Max V56 also to help out. I assume you already tried t95 firmware and it doesn't boot on your device?

 

I am very interested in 5.10 kernel (for docker) and video encoding with rkmppenc on this chipset.

Link to comment
Share on other sites

2 hours ago, hotnikq said:

did you have a TTL UART tool to debug?


I have one (CP2102N) but I have to learn how to use it. I guess I have to open the box to be able to connect it?

 

When I tried 5.10 image it didn't boot so I need to attach debug next to make better progress.

 

Unfortunately it is now the holiday season so I will be traveling for the next week.

Link to comment
Share on other sites

@tmm1 T95 is a much easier box to work with as it is more widespread among users, I have already tried their firmware, very incompatible.

UART TTL debug needs to be soldered on board pins RX-TX and TX-RX, GND-GND.

 RUPA 4GB RK3566 makes me fell X88 Pro 20 Rk3566 

i'm runing jellyfin and nextcloud at H96 MAX V56 RK3566 Kernel 4.19
SATA3 Devices at Full speed on USB3 HUB, Gigabit Ethernet,
I dont need HDMi on this device and i dont expect full GPU acceleration with this.
it's fine to a 60U$ TV box to run as proxy / data / DNS service.
Today i received the H96 MAX RK3318 V12 4gb/64gb 

and soon will arrive here a Rock Pi 3a 8GB/ with NVME board

EDIT: RK3318, RK3328 is to slow 4core 1ghz DDR3 "fast ethernet 10/100mb" Tested: kernel 5.15 and 6.09
EDIT: RK3566 with kernel 4.19 still a better througput speed over USB-SATA and Lan link

Edited by hotnikq
Link to comment
Share on other sites

Quote

This FIT image needs to be flashed on the internal storage, this board don't have SD CARD Reader.
Just Press the RESET Button when connect male-male USB 2.0 (BLACK) to Desktop

MAKE Backup Rockchip Firmware emmc

Install Drivers, Driver Assistant Download
RkDevTool Download

Upgrade Rockchip Firmware eemc
Maskrom mode

Loader mode

 

Make backup fail by rkDumper v1.1.1.2(latest)

How did you backup? "short the EMMC CLK pin to GND"?

Thanks!!

 

        Found:  LOADER device (RK3566 2207:350a) #9

        --- Firmware dumping ---


        Found LOADER Rockchip device

        First 0x0010 NAND blocks reading

        Command to read failed

        -- Rockchip device resetting --

        Found LOADER Rockchip device

        Command to reset failed

 

DriverAssitant_v4.91 (the same error at v5.11)

rkDumper 1.1.1.2 (1.08 no support rk3566)

Link to comment
Share on other sites

Today i received Rock 3A rk3568 User interface X11 Feels Laggy "dont have hardware acceleration to"
Mali Panfrost drivers are not Opensource for linux, just android
Manjaro-ARM-gnome-rock3a-22.10 Works Amazing with hardware acceleration on Rock 3A rk3568 Desktop
for desktop environment i recomend the original Android or LibreElec "android"
for server, we are on the right path here!

@tmm1 you need to slide the bottom of the box with plastic straws to find the screws.

@mvpwar to backup, i use linux, i think windows drivers for RK35xx are outdated, I didn't stop to see this

To backup

Quote

$ sudo rkdeveloptool -h
$ sudo rkdeveloptool rl 0 9999999  dump_with_rk_tool.img

#### change 9999999 to the number of sectors from your flash
 


To Restore
 

Quote

$ sudo rkdeveloptool wl 0 dump_with_rk_tool.img

 

Edited by hotnikq
Link to comment
Share on other sites

#rkdeveloptool rfi
Flash Info:
	Manufacturer: SAMSUNG, value=00
	Flash Size: 59640 MB
	Flash Size: 122142720 Sectors
	Block Size: 512 KB
	Page Size: 2 KB
	ECC Bits: 0
	Access Time: 40
	Flash CS: Flash<0> 
      
#rkdeveloptool rl 0 122142720 h96_max_flash.img
Read LBA to file (100%)

#ll -h h96_max_flash.img
-rw-r--r--   1 root root  59G 12月  2 22:32 h96_max_flash.img

 

How to flash PARTITIONING.img<Ubuntu_20.04.5_K4.19.219_RK3566_H96_MAX_8GB_No_Video_OUT_WIFI_OK_PARTITIONING.img>  to  internal storage ?

Use rkdeveloptool wl ? 

WriteLBA:		wl  <BeginSec> <File>
WriteLBA:		wlx  <PartitionName> <File>
WriteGPT:		gpt <gpt partition table>
WriteParameter:		prm <parameter>

 

I found the FIT PARTITIONING.img is quite different from my backup img file when using fdisk command to list the partitions

Disk Ubuntu_20.04.5_K4.19.219_RK3566_H96_MAX_8GB_No_Video_OUT_WIFI_OK_PARTITIONING.img:6.92 GiB,7430220288 字节,14512149 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x38e8005b

 

Disk h96_max_flash.img:58.24 GiB,62537072640 字节,122142720 个扇区
单元:扇区 / 1 * 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:gpt
磁盘标识符:FA7B0000-0000-4212-8000-216500001AD8

设备                   起点      末尾      扇区  大小 类型
h96_max_flash.img1    16384     24575      8192    4M 未知
h96_max_flash.img2    24576     32767      8192    4M 未知
h96_max_flash.img3    32768     40959      8192    4M 未知
h96_max_flash.img4    40960     49151      8192    4M 未知
h96_max_flash.img5    49152     51199      2048    1M 未知
h96_max_flash.img6    51200    133119     81920   40M 未知
h96_max_flash.img7   133120    141311      8192    4M 未知
h96_max_flash.img8   141312    337919    196608   96M 未知
h96_max_flash.img9   337920   1124351    786432  384M 未知
h96_max_flash.img10 1124352   2009086    884735  432M 未知
h96_max_flash.img11 2009087   2041854     32768   16M 未知
h96_max_flash.img12 2041855   2042878      1024  512K 未知
h96_max_flash.img13 2042879   2044926      2048    1M 未知
h96_max_flash.img14 2044927   2077694     32768   16M 未知
h96_max_flash.img15 2077695   9122814   7045120  3.4G 未知
h96_max_flash.img16 9122815 122142686 113019872 53.9G 未知

 

Should I WriteParameter by Parameter.txt, flash the MiniLoaderAll.bin to Loader, finally flash the FIT PARTITIONING.img to rootfs ?

THX! @hotnikq

Link to comment
Share on other sites

@mvpwar after backup into linux, to flash the Linux distro inside the box i use a Windows computer

The image Type is "UPDATE IMG" is easy to handle on windows
Just Flash the whole firmware.img

This tutorial is from the Rock 3a i'm working on https://wiki.radxa.com/Rock/flash_the_image
but it works on h96 max
The linux filesystem used on this project is different from original android filesystem

 

Flash_whole_firmware_1.png

 

Edited by hotnikq
Link to comment
Share on other sites

@mvpwar  you be the first to test a 8gb device, please report your experience and application here.
 No Video out (device tree bad arg)
 No Virtualization (kernel config)
 No Docker (kernel capability)

This is a "server" image, without display
Follow this instructions after flash, to use the machine you will need to SSH inside it.

 

On 11/21/2022 at 11:04 PM, hotnikq said:

This FIT image needs to be flashed on the internal storage, this board don't have SD CARD Reader.
Just Press the RESET Button when connect male-male USB 2.0 (BLACK) to Desktop

MAKE Backup Rockchip Firmware emmc

Install Drivers, Driver Assistant Download
RkDevTool Download

Upgrade Rockchip Firmware eemc
Maskrom mode

Loader mode


when the Board Boot UP you will need to conect RJ45 LAN, Find the IP Addres on your PiHole, Firewall or  Lan Router
and SSH to the ubuntu.
 

Quote

User: ubuntu
Password: ubuntu



First BOOT COMANDS:

Quote

### Partition " / " resized to FULL DISK ###
$ df -h
 sudo resize2fs /dev/mmcblk2p6
$ df -h


🏆 help to add this board in armbian standart, you don't need to be a programmer to help the community,
just need a copy of the V56 board and a x86 computer to compile new versions.

 

Edited by hotnikq
Link to comment
Share on other sites

@hotnikq THX !

Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 4.19.219+ aarch64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, you can run the 'unminimize' command.

0 updates can be applied immediately.

New release '22.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Last login: Sat Dec  3 01:47:41 2022 from 192.168.2.186
ubuntu@rk3566-evb3-ddr3-v10:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           394M  1.1M  393M   1% /run
/dev/mmcblk2p6   58G  5.9G   49G  11% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           394M     0  394M   0% /run/user/0
tmpfs           394M  4.0K  394M   1% /run/user/1000
ubuntu@rk3566-evb3-ddr3-v10:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3930         167        3122           1         639        3721
Swap:             0           0           0

 

The Ubuntu os only recognizes 4G  memory which flashed the 8G image

Link to comment
Share on other sites

@mvpwar i think i know what is happend here.
is something i make to solve "swiotlb buffer is full" errors
i set the kernel memory to 4gb to make the iommu stop address "2⁶⁴" 64bit
this kernel trik Stop buffer overflow errors and memory leak
you can change it to 8gb
i'm searching here how to change it 


EDIT: i did this
You can limit the amount of RAM the kernel addresses by adding this to boot parameters:
mem=4096M

i make it via DTS File Before compile

 rk3566-quartz64-a.dts

Quote

chosen {
        bootargs = "earlycon=uart8250,mmio32,0xfe660000 swiotlb=8192 mem=4096M console=ttyFIQ0 root=PARTUUID=614e0000-0000-4b53-8000-1d28000054a9 rw rootwait";


i make this change to rk3566-quartz64-a.dtb
you can change it and debug,
if it doesnt work you can reflash the update image again to repair

rk3566-quartz64-a.dtb

Edited by hotnikq
Link to comment
Share on other sites

@hotnikq How to mount the emmc boot partition? 

 

root@rk3566-evb3-ddr3-v10:/# ls -l /dev/disk/by-partlabel/boot
lrwxrwxrwx 1 root root 15 Dec  3 20:25 /dev/disk/by-partlabel/boot -> ../../mmcblk2p3

root@rk3566-evb3-ddr3-v10:/# mount /dev/mmcblk2p3 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mmcblk2p3, missing codepage or helper program, or other error.

root@rk3566-evb3-ddr3-v10:/home/ubuntu# find / -name "*.dtb"
find: ‘/proc/1507’: No such file or directory

 

or how to replace the dtb file?

 

root@rk3566-evb3-ddr3-v10:/# fdisk  -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk2: 58.25 GiB, 62537072640 bytes, 122142720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 37250000-0000-4851-8000-2F1900005AC0

Device          Start       End   Sectors  Size Type
/dev/mmcblk2p1  16384     24575      8192    4M unknown
/dev/mmcblk2p2  24576     32767      8192    4M unknown
/dev/mmcblk2p3  32768     98303     65536   32M unknown
/dev/mmcblk2p4  98304    163839     65536   32M unknown
/dev/mmcblk2p5 163840    229375     65536   32M unknown
/dev/mmcblk2p6 229376 122142655 121913280 58.1G unknown


root@rk3566-evb3-ddr3-v10:/etc/grub.d# parted
GNU Parted 3.3
Using /dev/mmcblk2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: MMC CJNB4R (sd/mmc)
Disk /dev/mmcblk2: 62.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name      Flags
 1      8389kB  12.6MB  4194kB               uboot
 2      12.6MB  16.8MB  4194kB               misc
 3      16.8MB  50.3MB  33.6MB               boot
 4      50.3MB  83.9MB  33.6MB               recovery
 5      83.9MB  117MB   33.6MB               backup
 6      117MB   62.5GB  62.4GB  ext4         rootfs

(parted) quit

 

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...
 Share

×
×
  • Create New...