Yocto layer for Radxa boards

Hi. I’m maintaining a yocto layer called meta-radxa. Currently it has support for Rockpi-4, RockPi-S and the RockPi-E. Here is the link to meta-radxa if you want to build your own image. I currently don’t have the RockPi-4 and the RockPi-E and hence I’ve not been able to test the current builds. If anyone is up for testing these builds here are the images.

RockPi-4 Thud Builds

RockPi-E Thud Builds

Would really appreciate if someone could send me the console logs of it.

2 Likes

Update:

I’ve updated the boot.cmd and uEnv.txt for RockPi-E in the meta-radxa layer. The board should boot up now. Anyone up for testing please use the link above and do send the debug logs. Serial console should be available on UART-2.

1 Like

A quick update:

There was an issue with the trust.img for RockPi-4 and RockPi-E. That has been fixed and the images have been updated on the above links. I received my RockPi-E(D8W2) sample today and have tried the fixed RockPi-E builds. They work perfectly fine. So you can now build your custom image for the RockPi-E board successfully using the meta-radxa layer.

Hi, @nish

I run system image, https://www.dropbox.com/sh/mt9f47u5mkm7kpz/AADV3EIY3nolImBpigmktMUOa/radxa-console-image-rockpi-4b-rk3399-gpt.img?dl=0 on ROCK Pi 4B. The Ethernet, HDMI, USB and so on are working well. But there is one problem with Wi-Fi connection.

From the boot log, I find that there is not AP6256 firmware in /system/etc/firmware/ directory.

To fix that, you can get the AP6256 firmware from this package, https://github.com/radxa/apt/blob/gh-pages/stretch-testing/pool/main/b/broadcom-wifibt-firmware/broadcom-wifibt-firmware_0.6_all.deb . And add the following three files in /system/etc/firmware directory.

root@rockpi-4b-rk3399:~# ls /system/etc/firmware/
fw_bcm43456c5_ag.bin  fw_bcm43456c5_ag_p2p.bin  nvram_ap6256.txt
1 Like

Hey @Stephen

Thank you for taking time out to test the image for RockPi-4. Yes the firmware for AP6256 was missing. I’ve included the firmware to the new builds and also updated the meta-radxa layer for the same. The wifi for RockPi-4 should work now. If you want to try it out here is the link: https://www.dropbox.com/s/767wgi4ktgbo6rr/radxa-console-image-rockpi-4b-rk3399-gpt.img?dl=0

Just a quick update:

I’ve updated to warrior. Here is the change log from thud to warrior:

  1. RockPi-S Kernel updated to 4.4.143-39-daf243b9655a73ee14568e36cf76ac8a094e68e6
  2. RockPi-S U-Boot updated to 2017.09-c3d3bc84bef5ee95d7199c23e1a34e47ea8f0daf (Supports boot.cmd and uEnv.txt)
  3. RockPi-4 Kernel updated to 4.4.154-95-d2ab1f26e1b33970a6ccda18633a681a7730665e
  4. Firmware file location fixed for RockPi-E
  5. Bluetooth works for RockPi-S, RockPi-E and RockPi-4
  6. Added instructions on how to setup bluetooth for each board
  7. RockPi-S serial console changed from UART-2 to UART-0
  8. Radxa binaries are now taken from the radxa official repository

nish,
thanks for your yocto support. I cloned meta-raxda and build successfully the image for the rock pi S. Nice and easy.

Trying to modify the kernel to include gadget audio support, here my steps:

   bitbake linux-rockpi-s -c menuconfig
   bitbake linux-rockpi-s -c do_compile -f
   bitbake linux-rockpi-s
   bitbake -k radxa-console-image

But still no gadget support.
You have any recommendation how to build a custom kernel?

found the issue, the gadget support needs to be set as ‘Module’. the default config has it set in a ‘linked in’ to the kernel.
(I like module support, as it allows you to enable/disable specific Gadget modules.)

I think you can change the ROCK Pi S kernel commit id to 5e1be82eb296ba36f9f656a1b9ee9c2df7e5a1db in file linux-rockpi-s_4.4.bb since ROCK Pi S kernel in Radxa repo helps fixed the issue.

2 Likes

Hi @mattes. I’m glad you found it easy. I checked the commits in the radxa kernel repo for the rockpi-s and this has been solved there as @Stephen rightly pointed out. I’ll update the recipe to the latest commit and this should solve the problem.

Hi @nish,

Thanks again for maintaining this layer :smile:. I’m trying to generate and boot a FIT image for Rock Pi S via Yocto, and I’m not being able to boot it… I’ve moved my changes from my layer to the fitimage branch on my meta-radxa fork on github. Only the last commit (actually changing image type to fitImage) is not working (hanging after Starting kernel ....

On the first 2 commits I patch the device tree to enable uart0 without overlay and disable overlays, to prevent any overlay loading problems.

I’ve also tried to modify the load address and kernel entry point to some common addresses on the machine config by using the following resulting in an abort.

UBOOT_LOADADDRESS = "0x00080000"
UBOOT_ENTRYPOINT  = "0x00080000"

Both bootm and booti fail, but with different outputs. Also I’ve tried to patch the kernel to panic as first statement, but it still hangs.

Logs (for try exactly as in repository):

DDR Version V1.26
REGFB: 0x00000031, 0x00000031
In
589MHz
DDR3
 Col=10 Bank=8 Row=15 Size=512MB
msch:1
Returning to boot ROM...
INFO:    Preloader serial: 0
NOTICE:  BL31: v1.3(release):3a579d3
NOTICE:  BL31: Built : 09:09:17, Jan 29 2019
INFO:    Lastlog: last=0x100000, realtime=0x102000, size=0x2000
INFO:    ARM GICv2 driver initialized
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 1
INFO:    plat_rockchip_pmu_init: pd status 0xe
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 = 0x600000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-02383-g233a23e3ed-dirty (Nov 12 2020 - 05:21:59 +0000)

Model: Radxa ROCK Pi S
PreSerial: 0
DRAM:  510 MiB
Relocation Offset is: 1f91b000
vdd_core 1044000 uV
vdd-core init 1044000 uV
MMC:   dwmmc@ff480000: 0, dwmmc@ff490000: 1
Using default environment

In:    serial@ff0c0000
Out:   serial@ff0c0000
Err:   serial@ff0c0000
Model: Radxa ROCK Pi S
Bootdev(atags): mmc 1
PartType: EFI
## Error: Can't overwrite "serial#"
## Error inserting "serial#" variable, errno=1
get part misc fail -1
boot mode: None
CLK:
apll 816000 KHz
dpll 1300000 KHz
vpll0 1179647 KHz
vpll1 903167 KHz
aclk_bus 185714 KHz
hclk_bus 100000 KHz
pclk_bus 100000 KHz
aclk_peri 185714 KHz
hclk_peri 100000 KHz
pclk_peri 100000 KHz
hclk_audio 98303 KHz
pclk_audio 98303 KHz
Net:   Net Initialization Skipped
No ethernet found.
Hit key to stop autoboot('CTRL+C'):  0 
starting USB...
USB0:   Core Release: 3.10a
USB1:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
Card did not respond to voltage select!
mmc_init: -95, time 9
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
reading /boot.scr
1152 bytes read in 7 ms (160.2 KiB/s)
## Executing script at 00500000
Boot script loaded from mmc 1
reading /uEnv.txt
152 bytes read in 5 ms (29.3 KiB/s)
reading /fitImage
5397456 bytes read in 280 ms (18.4 MiB/s)
## Loading kernel from FIT Image at 00280000 ...
   Using 'conf@rockchip_rk3308-rock-pi-s.dtb' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x00280104
     Data Size:    5331929 Bytes = 5.1 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x01314c40
     Entry Point:  0x01314c40
     Hash algo:    sha256
     Hash value:   72ec01ea0e9378b94faf73bc0dd65b5f6e116053bb38144fd019baef5519ef3b
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 00280000 ...
   Using 'conf@rockchip_rk3308-rock-pi-s.dtb' configuration
   Trying 'fdt@rockchip_rk3308-rock-pi-s.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x00795e00
     Data Size:    63542 Bytes = 62.1 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   29a12c015771edcef94ec01822529e5b195162d2f096c1ca7624758d760d9c97
   Verifying Hash Integrity ... sha256+ OK
   Booting using the fdt blob at 0x795e00
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 000000001f4f7000, end 000000001f509835 ... OK
Adding bank: 0x00200000 - 0x20000000 (size: 0x1fe00000)

Starting kernel ...



Do you have any idea on how to boot correctly the FIT Image?

I’ll go through the commits and get back to you. From a quick glance of the commits, the first 2 seem to be fine and should not be causing this. The 3rd commit is the one I’ll need to check. I haven’t worked with fitImages but surely I’ll go through it.

@Stephen could you take a look at this when you get time?

To boot the FIT Image, a new feature. Sure, I will look at this.

@pheki From the uboot log, I think you have modified the U-Boot. Can you share what you have done to it?

I’ve actually only enabled the iminfo command to get kernel info from u-boot without booting, just added it to my branch: https://github.com/pheki/meta-radxa/blob/fitimage/recipes-bsp/u-boot/files/0001-Enable-iminfo-command-for-rockpi-s-rk3308.patch

There were actually two more patches already on the yocto layer (for Rock Pi S):

  • recipes-bsp/u-boot/files/0001-Makefile-disable-gcc9-s-address-of-packed-member-war.patch
  • recipes-bsp/u-boot/files/0001-Use-local-command.h-file-instead-of-system-file.patch

I also forgot to mention, but I temporarily modified meta/clases/kernel-fitimage.bbclass and removed u-boot-tools-native from

depends = "%s u-boot-tools-native dtc-native" % depends

I don’t think it shows anything new but here is the iminfo output:

=> iminfo ${kernel_addr_r}

## Checking Image at 00280000 ...
   FIT image found
   FIT description: U-Boot fitImage for Poky (Yocto Project Reference Distro)/4.4.143/rockpi-s-rk3308
    Image 0 (kernel@1)
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x00280104
     Data Size:    5331929 Bytes = 5.1 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x01314c40
     Entry Point:  0x01314c40
     Hash algo:    sha256
     Hash value:   72ec01ea0e9378b94faf73bc0dd65b5f6e116053bb38144fd019baef5519ef3b
    Image 1 (fdt@rockchip_rk3308-rock-pi-s.dtb)
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x00795e00
     Data Size:    63542 Bytes = 62.1 KiB
     Architecture: AArch64
     Hash algo:    sha256
     Hash value:   29a12c015771edcef94ec01822529e5b195162d2f096c1ca7624758d760d9c97
    Default Configuration: 'conf@rockchip_rk3308-rock-pi-s.dtb'
    Configuration 0 (conf@rockchip_rk3308-rock-pi-s.dtb)
     Description:  1 Linux kernel, FDT blob
     Kernel:       kernel@1
     FDT:          fdt@rockchip_rk3308-rock-pi-s.dtb
## Checking hash(es) for FIT Image at 00280000 ...
   Hash(es) for Image 0 (kernel@1): sha256+ 
   Hash(es) for Image 1 (fdt@rockchip_rk3308-rock-pi-s.dtb): sha256+