Skip to contentSkip to conversation

Rock64: add machine

PATCH Yann Dirson 1 participant 1 message May 31, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 11 lines · Yann Dirson via lists.yoctoproject.org

From: Yann Dirson <[email protected]>

This is a RK3328 board from Pine64.
Board details at https://wiki.pine64.org/wiki/ROCK64.

---

This is just basic initial support without a kernel BSP. As is the board boots with a serial console.

This statement was refering to core-image-minimal. The board does get working ethernet, usb, hdmi with core-image-base, the only major devices not handled are audio (not even hdmi-audio by default) and emmc (see below).

Quoted 55 lines

Note I had to create the SoC definition for rk3328, and rather than setting serial at 115200 there just to have the board definition override it with rockchip-standard 1500000 I've set the latter right in rk3328.inc.

 conf/machine/include/rk3328.inc            | 25 +++++++++++++++++++
 conf/machine/rock64.conf                   | 28 ++++++++++++++++++++++
 recipes-kernel/linux/linux-yocto%.bbappend |  1 +
 3 files changed, 54 insertions(+)
 create mode 100644 conf/machine/include/rk3328.inc
 create mode 100644 conf/machine/rock64.conf
conf/machine/include/rk3328.inc new file +25 -0
new file mode 100644
index 0000000..7d67627
@@ -0,0 +1,25 @@
+# Copyright (C) 2020 Garmin Ltd. or its subsidaries
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+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
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+TFA_PLATFORM = "rk3328"
+TFA_BUILD_TARGET = "bl31"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x06000000"
+
+SERIAL_CONSOLES = "1500000;ttyS2"
+
+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
+SPL_BINARY ?= "idbloader.img"
conf/machine/rock64.conf new file +5 -0
new file mode 100644
index 0000000..88a8434
@@ -0,0 +1,28 @@
+# Copyright (C) 2021 Blade SAS
+
+#@TYPE: Machine
+#@NAME: Rock64
+#@DESCRIPTION: Rock64 RK3328 board from Pine64

conf/machine/rock64.conf

Quoted 10 lines
conf/machine/rock64.conf new file +9 -0
+
+require include/rk3328.inc
+
+MACHINE_FEATURES += "usbhost serial"
+
+UBOOT_MACHINE = "rock64-rk3328_defconfig"
+KERNEL_DEVICETREE = "rockchip/rk3328-rock64.dtb"
+
 
+RK_BOOT_DEVICE = "mmcblk0"

I realize now that this part is problematic:
- booting core-image-minimal from sdcard with or without an eMMC plugged indeed works, as does core-image-base without an eMMC
- booting core-image-base from sdcard with an eMMC plugged gets the sd as mmcblk1

This seems to indicate that upstream dts lacks "/aliases/mmc*" statements in the dts, I'll have to dig and see
what the proper aliases should be.

Quoted 29 lines
conf/machine/rock64.conf new file +14 -0
+WKS_FILE ?= "rock-pi-4.wks"
+IMAGE_FSTYPES += "wic wic.bmap"
+
+WKS_FILE_DEPENDS ?= " \
+    mtools-native \
+    dosfstools-native \
+    virtual/bootloader \
+    virtual/kernel \
+    "
+IMAGE_BOOT_FILES ?= "\
+    ${KERNEL_IMAGETYPE} \
+    "
+
+KBUILD_DEFCONFIG = "defconfig"
recipes-kernel/linux/linux-yocto%.bbappend +1 -1
index 7702e3f..f453281 100644
@@ -8,3 +8,4 @@ COMPATIBLE_MACHINE_tinker-board-s = "tinker-board-s"
 COMPATIBLE_MACHINE_rock-pi-4 = "rock-pi-4"
 COMPATIBLE_MACHINE_nanopi-m4 = "nanopi-m4"
 COMPATIBLE_MACHINE_nanopi-m4-2gb = "nanopi-m4-2gb"
+COMPATIBLE_MACHINE_rock64 = "rock64"
--

2.30.2

Signature · 2 lines
Yann Dirson <[email protected]>
Blade / Shadow -- http://shadow.tech