rock-pi-e: add

Add support for Radxa's ROCK Pi E device
https://wiki.radxa.com/RockpiE

It's a great surprise to find upstream U-Boot and the Linux kernel already
provide support for this board! On the kernel side this support was
added in 5.11. However, that support is so new that even linux-yocto-dev
(which is based on 5.11) doesn't include the commits that add support
for this board yet. As a result I've added a custom Linux kernel recipe
(linux-stable-bleeding) which should, in time, become unnecessary.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
This commit is contained in:
Trevor Woerner 2021-02-25 09:47:59 -05:00
parent ad65fd7736
commit 43de504d48
7 changed files with 91 additions and 2 deletions

View File

@ -0,0 +1,42 @@
#@TYPE: Machine
#@NAME: ROCK Pi E rk3328
#@DESCRIPTION: ROCK Pi E is a Rockchip RK3328-based SBC by Radxa. E is for Ethernets.
#https://wiki.radxa.com/RockpiE
MACHINEOVERRIDES =. "rock-pi-e:"
SOC_FAMILY = "rk3328"
DEFAULTTUNE = "cortexa53-crypto"
require conf/machine/include/soc-family.inc
require conf/machine/include/tune-cortexa53.inc
require conf/machine/include/rockchip-defaults.inc
PREFERRED_PROVIDER_virtual/kernel = "linux-stable-bleeding"
KERNEL_DEVICETREE = "rockchip/rk3328-rock-pi-e.dtb"
KBUILD_DEFCONFIG = "defconfig"
KERNEL_CLASSES = "kernel-fitimage"
KERNEL_IMAGETYPE = "fitImage"
MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
TFA_PLATFORM = "rk3328"
TFA_BUILD_TARGET = "bl31"
UBOOT_MACHINE = "rock-pi-e-rk3328_defconfig"
UBOOT_SUFFIX = "itb"
UBOOT_ENTRYPOINT = "0x06000000"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
SPL_BINARY = "idbloader.img"
WKS_FILE = "rock-pi-e.wks"
IMAGE_FSTYPES += "wic.xz wic.bmap"
WKS_FILE_DEPENDS = " \
mtools-native \
dosfstools-native \
virtual/bootloader \
virtual/kernel \
"
IMAGE_BOOT_FILES ?= " \
${KERNEL_IMAGETYPE} \
"
SERIAL_CONSOLES = "1500000;ttyS2"

View File

@ -3,4 +3,4 @@
DEPENDS_append_rk3399 = " virtual/arm-none-eabi-gcc-native"
COMPATIBLE_MACHINE_append_rk3399 = "|rk3399"
COMPATIBLE_MACHINE_append_rk3328 = "|rk3328"

View File

@ -9,6 +9,8 @@ ATF_DEPENDS ??= ""
EXTRA_OEMAKE_append_rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
ATF_DEPENDS_rk3399 = " virtual/trusted-firmware-a:do_deploy"
EXTRA_OEMAKE_append_rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
ATF_DEPENDS_rk3328 = " virtual/trusted-firmware-a:do_deploy"
do_compile[depends] .= "${ATF_DEPENDS}"

View File

@ -0,0 +1,18 @@
# the rock-pi-e is very new
# it's exciting that support has already been added upstream
# but it's so new that even linux-yocto-dev doesn't have it yet
#
# in time we should see the need for this recipe going away
inherit kernel
require recipes-kernel/linux/linux-yocto.inc
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"
SRCREV = "c03c21ba6f4e95e406a1a7b4c34ef334b977c194"
LINUX_VERSION = "5.11"
LINUX_VERSION_EXTENSION = ""
PV = "${LINUX_VERSION}"
COMPATIBLE_MACHINE = "(rock-pi-e)"

View File

@ -1 +1 @@
COMPATIBLE_MACHINE .= "|firefly-rk3288|marsboard-rk3066|radxarock|rock-pi-4|rock2-square|tinker-board-s|tinker-board|vyasa-rk3288"
COMPATIBLE_MACHINE .= "|firefly-rk3288|marsboard-rk3066|radxarock|rock-pi-4|rock2-square|tinker-board-s|tinker-board|vyasa-rk3288|rock-pi-e"

23
wic/rk3328-boot.wks Normal file
View File

@ -0,0 +1,23 @@
# Copyright (C) 2021 Trevor Woerner
# Released under the MIT license (see COPYING.MIT for the terms)
#
# Disk layout
# Note that the reference documentation refers to 512 byte disk sectors, but
# wic uses 1KB blocks
#
# Partition Start Sector Number of Sectors
# loader1 64 8000
# reserved1 8064 128
# reserved2 8192 8192
# loader2 16384 8192
# atf 24576 8192
# boot 32768 229376
# root 262144 - (suggested)
#
part loader1 --offset 32 --fixed-size 4000K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=idbloader.img"
part reserved1 --offset 4032 --fixed-size 64K --ondisk ${RK_BOOT_DEVICE}
part reserved2 --offset 4096 --fixed-size 4096K --ondisk ${RK_BOOT_DEVICE}
part loader2 --offset 8192 --fixed-size 4096K --ondisk ${RK_BOOT_DEVICE} --source rawcopy --sourceparams="file=u-boot.itb"
part atf --offset 12288 --fixed-size 4096K --ondisk ${RK_BOOT_DEVICE}
part /boot --offset 16384 --size 114688K --active --ondisk ${RK_BOOT_DEVICE} --source bootimg-partition --fstype=vfat --label boot --sourceparams="loader=u-boot"

4
wic/rock-pi-e.wks Normal file
View File

@ -0,0 +1,4 @@
include rk3328-boot.wks
part / --ondisk ${RK_BOOT_DEVICE} --source rootfs --fstype=ext4 --label root
bootloader --ptable gpt --append="console=tty1 console=ttyS2,1500000n8 rw root=/dev/${RK_BOOT_DEVICE}p7 rootfstype=ext4 init=/sbin/init"