Jump to content

First attempt to add support for Radxa Rock 3C


Recommended Posts

  

I noticed today that there was no build created yet for Radxa Rock 3C.

 

I found the Rock 3A config file at build/config/boards/rock-3a.conf :

 

# Rockchip RK3568 quad core 1-8GB SoC GBe eMMC USB3
BOARD_NAME="Rock 3A"
BOARDFAMILY="rk35xx"
BOOTCONFIG="rock-3a-rk3568_defconfig"
KERNEL_TARGET="legacy,current,edge"
FULL_DESKTOP="yes"
BOOT_LOGO="desktop"
BOOT_FDT_FILE="rockchip/rk3568-rock-3a.dtb"
BOOT_SCENARIO="spl-blobs"
WIREGUARD="no"
BOOT_SUPPORT_SPI="yes"
BOOT_SPI_RKSPI_LOADER="yes"
IMAGE_PARTITION_TABLE="gpt"
BOOTFS_TYPE="fat"

And copied it to build/boards/rock-3c.conf . Then modified it to

# Rockchip RK3566 quad core 1-8GB SoC GBe eMMC USB3
BOARD_NAME="Rock 3C"
BOARDFAMILY="rk35xx"
BOOTCONFIG="rock-3c-rk3566_defconfig"
KERNEL_TARGET="legacy,current,edge"
FULL_DESKTOP="yes"
BOOT_LOGO="desktop"
BOOT_FDT_FILE="rockchip/rk3566-rock-3c.dtb"
BOOT_SCENARIO="spl-blobs"
BOOT_SUPPORT_SPI="yes"
BOOT_SPI_RKSPI_LOADER="yes"
IMAGE_PARTITION_TABLE="gpt"
BOOTFS_TYPE="fat"

And was pleasantly surprised when it was able to build an image! 🙂

 

However, the booting was not so successful I get this on the UART (1500000 bps 8N1):

 

DDR Version V1.10 20210810
ln
ddrconfig:0
LP4 MR14:0x4d
LPDDR4, 324MHz
BW=32 Col=10 Bk=8 CS0 Row=17 CS=1 Die BW=16 Size=4096MB
tdqss: cs0 dqs0: 361ps, dqs1: 289ps, dqs2: 313ps, dqs3: 217ps, 

change to: 324MHz
PHY drv:clk:38,ca:38,DQ:30,odt:0
vrefinner:41%, vrefout:41%
dram drv:40,odt:0
clk skew:0x58

change to: 528MHz
PHY drv:clk:38,ca:38,DQ:30,odt:60
vrefinner:16%, vrefout:41%
dram drv:40,odt:0
clk skew:0x78

change to: 780MHz
PHY drv:clk:38,ca:38,DQ:30,odt:60
vrefinner:16%, vrefout:41%
dram drv:40,odt:0
clk skew:0x5c

change to: 1056MHz(final freq)
PHY drv:clk:38,ca:38,DQ:30,odt:60
vrefinner:16%, vrefout:29%
dram drv:40,odt:80
vref_ca:00000068
clk skew:0x3f
cs 0:
the read training result:
DQS0:0x3b, DQS1:0x3d, DQS2:0x3d, DQS3:0x38, 
min  : 0x9  0xa  0xc  0x9  0x1  0x2  0x5  0x2 , 0x8  0x9  0x5  0x1  0xb  0xd  0xf  0x9 ,
       0xd  0xb  0xc  0x8  0x4  0x1  0x4  0x6 , 0xb  0x6  0x6  0x1  0xf  0xe  0xd  0xe ,
mid  :0x28 0x29 0x2b 0x28 0x1f 0x21 0x23 0x21 ,0x26 0x27 0x22 0x1f 0x29 0x2b 0x2c 0x27 ,
      0x2b 0x2a 0x29 0x27 0x22 0x1f 0x21 0x23 ,0x28 0x23 0x23 0x1f 0x2b 0x2b 0x29 0x2b ,
max  :0x48 0x49 0x4b 0x47 0x3e 0x40 0x42 0x41 ,0x45 0x45 0x40 0x3e 0x47 0x49 0x4a 0x46 ,
      0x4a 0x49 0x46 0x46 0x41 0x3e 0x3f 0x41 ,0x45 0x41 0x40 0x3d 0x48 0x48 0x46 0x49 ,
range:0x3f 0x3f 0x3f 0x3e 0x3d 0x3e 0x3d 0x3f ,0x3d 0x3c 0x3b 0x3d 0x3c 0x3c 0x3b 0x3d ,
      0x3d 0x3e 0x3a 0x3e 0x3d 0x3d 0x3b 0x3b ,0x3a 0x3b 0x3a 0x3c 0x39 0x3a 0x39 0x3b ,
the write training result:
DQS0:0x6f, DQS1:0x66, DQS2:0x69, DQS3:0x5c, 
min  :0x95 0x97 0x99 0x97 0x8f 0x92 0x94 0x94 0x94 ,0x88 0x88 0x86 0x83 0x8d 0x8e 0x8e 0x8d 0x89 ,
      0x92 0x91 0x8e 0x8e 0x89 0x87 0x8a 0x8e 0x8d ,0x86 0x85 0x83 0x7f 0x8a 0x8a 0x88 0x8c 0x85 ,
mid  :0xb2 0xb4 0xb6 0xb3 0xab 0xad 0xaf 0xae 0xae ,0xa6 0xa5 0xa1 0x9e 0xaa 0xaa 0xa9 0xa9 0xa6 ,
      0xaf 0xae 0xab 0xaa 0xa5 0xa1 0xa3 0xa9 0xa9 ,0xa4 0xa1 0xa0 0x9b 0xa7 0xa7 0xa5 0xa8 0xa2 ,
max  :0xd0 0xd1 0xd3 0xcf 0xc7 0xc9 0xcb 0xc9 0xc9 ,0xc4 0xc3 0xbd 0xba 0xc7 0xc7 0xc5 0xc5 0xc3 ,
      0xcd 0xcb 0xc8 0xc6 0xc2 0xbc 0xbc 0xc4 0xc6 ,0xc2 0xbd 0xbd 0xb8 0xc5 0xc5 0xc2 0xc5 0xc0 ,
range:0x3b 0x3a 0x3a 0x38 0x38 0x37 0x37 0x35 0x35 ,0x3c 0x3b 0x37 0x37 0x3a 0x39 0x37 0x38 0x3a ,
      0x3b 0x3a 0x3a 0x38 0x39 0x35 0x32 0x36 0x39 ,0x3c 0x38 0x3a 0x39 0x3b 0x3b 0x3a 0x39 0x3b ,
CA Training result:
cs:0 min  :0x3d 0x35 0x37 0x2d 0x37 0x2c 0x38 ,0x3f 0x34 0x37 0x2c 0x37 0x2a 0x3c ,
cs:0 mid  :0x78 0x79 0x71 0x70 0x71 0x6f 0x63 ,0x79 0x77 0x71 0x6f 0x70 0x6e 0x67 ,
cs:0 max  :0xb3 0xbd 0xab 0xb3 0xab 0xb3 0x8e ,0xb4 0xbb 0xac 0xb2 0xaa 0xb2 0x92 ,
cs:0 range:0x76 0x88 0x74 0x86 0x74 0x87 0x56 ,0x75 0x87 0x75 0x86 0x73 0x88 0x56 ,
out
U-Boot SPL board init
U-Boot SPL 2017.09-armbian (Jun 10 2023 - 09:59:15)
unknown raw ID phN
unrecognized JEDEC id bytes: 00, 00, 00
Trying to boot from MMC2
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(5938a9cdfc...) + OK
## Checking uboot 0x00a00000 ... sha256(d801f0f359...) + OK
## Checking fdt 0x00b2e6f8 ... sha256(3ccee0dc53...) + OK
## Checking atf-2 0x00068000 ... sha256(0965dc8022...) + OK
## Checking atf-3 0xfdcd0000 ... sha256(be991af043...) + OK
## Checking atf-4 0xfdcc9000 ... sha256(695349eb36...) + OK
## Checking atf-5 0x00066000 ... sha256(315a4195a9...) + OK
Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000)
Total: 237.208 ms

INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-167-g81e0b993a-dirty:xsf
NOTICE:  BL31: Built : 11:20:08, Sep  6 2021
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    pmu v1 is valid
INFO:    dfs DDR fsp_param[0].freq_mhz= 1056MHz
INFO:    dfs DDR fsp_param[1].freq_mhz= 324MHz
INFO:    dfs DDR fsp_param[2].freq_mhz= 528MHz
INFO:    dfs DDR fsp_param[3].freq_mhz= 780MHz
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0xa00000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-armbian (Jun 10 2023 - 09:59:15 +0200)

Model: Radxa ROCK3 Model C
PreSerial: 2, raw, 0xfe660000
DRAM:  4 GiB
Sysmem: init
Relocation Offset: ed34a000
Relocation fdt: eb9f63c0 - eb9fecc8
CR: M/C/I
Using default environment

failed to find reset-gpios property
no mmc device at slot 1
dwmmc@fe2b0000: 1 (SD), dwmmc@fe2c0000: 2, sdhci@fe310000: 0
Bootdev(atags): mmc 1
MMC1: Legacy, 52Mhz
PartType: EFI
No misc partition
boot mode: None
FIT: No boot partition
No resource partition
No resource partition
Failed to load DTB, ret=-19
Failed to get kernel dtb, ret=-19
I2c0 speed: 100000Hz
vsel-gpios- not found! Error: -2
vdd_cpu init 900000 uV
PMIC:  RK8090 (on=0x40, off=0x00)
vdd_logic init 900000 uV
vdd_gpu init 900000 uV
vdd_npu init 900000 uV
io-domain: OK
Model: Radxa ROCK3 Model C
rockchip_set_serialno: could not find efuse/otp device
CLK: (sync kernel. arm: enter 816000 KHz, init 816000 KHz, kernel 0N/A)
  apll 816000 KHz
  dpll 528000 KHz
  gpll 1188000 KHz
  cpll 1000000 KHz
  npll 1200000 KHz
  vpll 24000 KHz
  hpll 24000 KHz
  ppll 200000 KHz
  armclk 816000 KHz
  aclk_bus 150000 KHz
  pclk_bus 100000 KHz
  aclk_top_high 300000 KHz
  aclk_top_low 200000 KHz
  hclk_top 150000 KHz
  pclk_top 100000 KHz
  aclk_perimid 300000 KHz
  hclk_perimid 150000 KHz
  pclk_pmu 100000 KHz
No misc partition
Net:   eth1: ethernet@fe010000
Hit key to stop autoboot('CTRL+C'):  0 
failed to find reset-gpios property

Device 0: unknown device
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
reading /boot.scr
3252 bytes read in 2 ms (1.6 MiB/s)
## Executing script at 00c00000
Boot script loaded from mmc 1
reading /armbianEnv.txt
151 bytes read in 1 ms (147.5 KiB/s)
reading /uInitrd
21588378 bytes read in 1795 ms (11.5 MiB/s)
reading /Image
29331968 bytes read in 2437 ms (11.5 MiB/s)
** Unable to read file /dtb/rockchip/rk3566-rock-3c.dtb **
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Default at 0xeb9f63c0
** Unable to read file /dtb/rockchip/overlay/rk35xx-fixup.scr **
Unknown command 'kaslrseed' - try 'help'
Fdt Ramdisk skip relocation
No misc partition
## Loading init Ramdisk from Legacy Image at 0a200000 ...
   Image Name:   uInitrd
   Image Type:   AArch64 Linux RAMDisk Image (gzip compressed)
   Data Size:    21588314 Bytes = 20.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
SCRIPT FAILED: continuing...
MMC error: The cmd index is 0, ret is -110
mmc_init: -110, time 4
starting USB...
Bus dwc3@fcc00000: 
CTRL-A Z for help | 1500000 8N1 | NOR | Minicom 2.8 | VT102 | Offline | ttyUSB0                                                                                                                      

And no output on the HDMI.

 

Any hints on what direction to dig for getting it closer to booting would be appreciated?

 

/ Kenneth

Link to comment
Share on other sites

The important error message there, I think, is:

** Unable to read file /dtb/rockchip/rk3566-rock-3c.dtb **

 

I am not an Armbian expert. But this sounds like you need to get hold of a dts file and put it in the right place so that it will be built as a dtb file and included in the image.

 

I think the DTS file you need is this one: https://github.com/radxa/u-boot/blob/next-dev/arch/arm/dts/rk3566-rock-3c.dts

Edited by Philip Couling
Link to comment
Share on other sites

Hmmm, no.

 

I tried to add this manually, creating a patch with this command:

 

./compile.sh CREATE_PATCHES=yes BOARD=rock-3c BRANCH=current uboot-patch

 

But when I looked the file rk3566-rock-3c.dts is already present.

 

AFAIK It gets brought in here:

 

[🌱] Fetching SHA1 of 'branch' 'refs/heads/stable-4.19-rock3' [ https://github.com/radxa/u-boot.git ]

 

So I guess there needs to be something else get the dtb file compiled. Not found it yet.

Link to comment
Share on other sites

Yes, true, but on the other hand, shouldn't it be possible to just copy the older dts files and try with those?

 

I have not worked with device tree before, but the device-tree files does seem to be kind-of kernel-version independent...?

What would happen if we tried to copy the ones from 4.19 and reuse those together with one of the newer kernels?

Link to comment
Share on other sites

@Endian

 

Warning... this didn't work

 

Yeah I think so... AFAIK they are mostly independent of kernel version. The syntax could theoretically change between Kernel or driver versions. But the theory of them is that it's easier to keep them stable as abstract text... at least that's what I read somewhere.

 

So here's what I tried:

 

Start creating a kernel patch...

./compile.sh CREATE_PATCHES=yes BOARD=rock-3c BRANCH=current kernel-patch

 

Pull the DTS files from Radxa's kernel 4.19.  Think dts files might be compatible across major kernel versions.

Notes these are NOT the ones I linked above which was u-boot DTS, not Linux DTS

cd arch/arm/boot/dts
sudo curl -O https://raw.githubusercontent.com/radxa/kernel/stable-4.19-rock3/arch/arm64/boot/dts/rockchip/rk3566.dtsi
sudo curl -O https://raw.githubusercontent.com/radxa/kernel/stable-4.19-rock3/arch/arm64/boot/dts/rockchip/rk3566-rock-3c-camera.dtsi
sudo curl -O https://raw.githubusercontent.com/radxa/kernel/stable-4.19-rock3/arch/arm64/boot/dts/rockchip/rk3566-rock-3c.dts

 

Copy the created patch file in place

sudo cp output/patch/kernel-rockchip64-current.patch patch/kernel/rockchip64-current

 

./compile.sh

 

Compiling...

 

Edited by Philip Couling
Link to comment
Share on other sites

Hi all,

 

I tried to build armbian for Rock 3C in the same way:

 

Make a copy of build/config/boards/rock-3a.conf

Build the image and copy it to a SD card.

Mount the SD card and add rk3566-rock-3c.dtb.

 

Unfortunately it did not boot. I did not get any further that "Starting Linux".

 

Link to comment
Share on other sites

Hello,

 

I tried the new desktop image and it boots nicely off an SD card, I haven' tried my nvme drive yet. The desktop user experience is very smooth, so well done to everyone who made this work!

 

The ethernet port works well, but unfortunately wifi and bluetooth does not work at all, I do not even see a wifi interface if I use "ip a" (but loopback and ethernet show up).

 

Is this a case of a missing driver in Ambian? How do I add the missing driver?

 

Wifi and bluetooth works under debian (as provided by Radxa), so I ran "sudo lshw -C network" under debian and get the output below:

 

       description: Wireless interface
       physical id: a
       logical name: wlan0
       serial: 98:03:cf:d2:32:7c
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=aicwf_sdio driverversion=5.10.160-33-rk356x multicast=yes wireless=IEEE 802.11

 

Finally, please see this link for log data and information about my set-up etc, I notice there are some bluetooth error messages.

 

https://paste.armbian.com/umazejomut

 

 

Link to comment
Share on other sites

Posted (edited)

@north1 The current Rock 3C image is for the older board revisions with wifi 5 module. For board rev 1.4 with wifi 6 module, the driver is available as a dkms package from Radxa's github. The board uses SDIO for the module, therefore for the latest version firmware release as of writing:
 

wget -O aic8800-firmware.deb https://github.com/radxa-pkg/aic8800/releases/download/3.0%2Bgit20240116.ec460377-8/aic8800-firmware_3.0+git20240116.ec460377-8_arm64.deb
wget -O aic8800-sdio-dkms.deb https://github.com/radxa-pkg/aic8800/releases/download/3.0%2Bgit20240116.ec460377-8/aic8800-sdio-dkms_3.0+git20240116.ec460377-8_all.deb
sudo apt install linux-headers-current-rockchip64
sudo dpkg -i aic8800-firmware.deb
sudo dpkg -i aic8800-sdio-dkms.deb

 

and then reboot.

Edited by Zokhoi
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