diff --git a/README b/README index bcf1e0b..e5beaa0 100644 --- a/README +++ b/README @@ -33,11 +33,33 @@ Status of supported boards: rock-5b nanopi-r2s nanopi-m4b + rock-pi-s builds: marsboard-rk3066 radxarock rock2-square +Notes: +----- + The latest ddr initializer for the rk3308 platform (currently only + used by the rock-pi-s machine) does not output diagnostic messages + to uart0. This causes a bunch of gibberish to be printed to the + console window which only becomes legible once the linux kernel + starts. I.e. the console output of the ddr initialization routine, + as well as u-boot is lost. An older version of this same binary + blob does, however, support output to uart0 (making its diagnostic + messages as well as u-boot available on the console). By default + the build assumes the user would like to see these message and be + able to have the option to interact with u-boot. Iow: for the + rock-pi-s an older version of rkbin is used. + + If, however, the user would prefer to use the latest binary ddr + initializer from rkbin, simply set: + + RKBIN_RK3308_LATEST = "1" + + in the configuration (e.g. conf/local.conf). + Maintenance: ----------- Please send pull requests, patches, comments, or questions to the diff --git a/conf/machine/include/rk3308.inc b/conf/machine/include/rk3308.inc new file mode 100644 index 0000000..19cabaf --- /dev/null +++ b/conf/machine/include/rk3308.inc @@ -0,0 +1,18 @@ +SOC_FAMILY = "rk3308" + +DEFAULTTUNE ?= "cortexa35-crypto" + +require conf/machine/include/soc-family.inc +require conf/machine/include/arm/armv8a/tune-cortexa35.inc +require conf/machine/include/rockchip-defaults.inc +require conf/machine/include/rockchip-wic.inc + +SERIAL_CONSOLES = "1500000;ttyS0" + +KBUILD_DEFCONFIG ?= "defconfig" +KERNEL_FEATURES:append:rk3308 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc" +KERNEL_CLASSES = "kernel-fitimage" +KERNEL_IMAGETYPE = "fitImage" + +UBOOT_SUFFIX ?= "itb" +UBOOT_ENTRYPOINT ?= "0x06000000" diff --git a/conf/machine/rock-pi-s.conf b/conf/machine/rock-pi-s.conf new file mode 100644 index 0000000..79ea73c --- /dev/null +++ b/conf/machine/rock-pi-s.conf @@ -0,0 +1,11 @@ +#@TYPE: Machine +#@NAME: Radxa Rock Pi S +#@DESCRIPTION: ROCK Pi S is a Rockchip RK3308 based SBC by Radxa. "S" stands for "small square" +#https://wiki.radxa.com/RockpiS + +require conf/machine/include/rk3308.inc + +KERNEL_DEVICETREE = "rockchip/rk3308-rock-pi-s.dtb" +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules" + +UBOOT_MACHINE = "rock-pi-s-rk3308_defconfig" diff --git a/recipes-bsp/rkbin/rk3308-rkbin_git.bb b/recipes-bsp/rkbin/rk3308-rkbin_git.bb new file mode 100644 index 0000000..c6b05b2 --- /dev/null +++ b/recipes-bsp/rkbin/rk3308-rkbin_git.bb @@ -0,0 +1,41 @@ +DESCRIPTION = "Rockchip Firmware and Tool Binaries" +LICENSE = "CLOSED" +LIC_FILES_CHKSUM:rk3308 = "file://README;md5=39cc9df955478b8df26158d489fdcc95" + +SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master" +SRCREV = "e65b97b511f1349156702db40694454c141d8fe2" + +PROVIDES += "trusted-firmware-a" +PROVIDES += "optee-os" + +inherit bin_package deploy + +S = "${WORKDIR}/git" + +COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:rk3308 = "rk3308" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_install() { + # Nothing in this recipe is useful in a filesystem + : +} + +PACKAGES = "${PN}" +ALLOW_EMPTY:${PN} = "1" + +do_deploy:rk3308() { + # Prebuilt TF-A + install -m 644 ${S}/bin/rk33/rk3308_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3308.elf + # Prebuilt OPTEE-OS + install -m 644 ${S}/bin/rk33/rk3308_bl32_v*.bin ${DEPLOYDIR}/tee-rk3308.bin + # Prebuilt U-Boot TPL (DDR init) + install -m 644 ${S}/bin/rk33/rk3308_ddr_589MHz_uart0_m0_v*.bin ${DEPLOYDIR}/ddr-rk3308.bin +} + +do_deploy() { + bbfatal "COMPATIBLE_MACHINE requires a corresponding do_deploy:() override" +} + +addtask deploy after do_install diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb b/recipes-bsp/rkbin/rockchip-rkbin_git.bb index a3ab341..f1609c7 100644 --- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb +++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb @@ -13,6 +13,7 @@ inherit bin_package deploy S = "${WORKDIR}/git" COMPATIBLE_MACHINE = "^$" +COMPATIBLE_MACHINE:rk3308 = "rk3308" COMPATIBLE_MACHINE:rk3588s = "rk3588s" PACKAGE_ARCH = "${MACHINE_ARCH}" @@ -25,6 +26,15 @@ do_install() { PACKAGES = "${PN}" ALLOW_EMPTY:${PN} = "1" +do_deploy:rk3308() { + # Prebuilt TF-A + install -m 644 ${S}/bin/rk33/rk3308_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3308.elf + # Prebuilt OPTEE-OS + install -m 644 ${S}/bin/rk33/rk3308_bl32_v*.bin ${DEPLOYDIR}/tee-rk3308.bin + # Prebuilt U-Boot TPL (DDR init) + install -m 644 ${S}/bin/rk33/rk3308_ddr_589MHz_uart?_m0_v*.bin ${DEPLOYDIR}/ddr-rk3308.bin +} + do_deploy:rk3588s() { # Prebuilt TF-A install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3588.elf diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend index e79c471..d902c9a 100644 --- a/recipes-bsp/u-boot/u-boot%.bbappend +++ b/recipes-bsp/u-boot/u-boot%.bbappend @@ -1,8 +1,10 @@ # various machines require the pyelftools library for parsing dtb files DEPENDS:append = " python3-pyelftools-native" +DEPENDS:append:rock-pi-s = " u-boot-tools-native" DEPENDS:append:rock-pi-4 = " gnutls-native" EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf" +EXTRA_OEMAKE:append:rk3308 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3308.elf" EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf" EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf" EXTRA_OEMAKE:append:rk3588s = " \ @@ -12,6 +14,7 @@ EXTRA_OEMAKE:append:rk3588s = " \ INIT_FIRMWARE_DEPENDS ??= "" INIT_FIRMWARE_DEPENDS:px30 = " trusted-firmware-a:do_deploy" +INIT_FIRMWARE_DEPENDS:rk3308 = " ${@bb.utils.contains('RKBIN_RK3308_LATEST', '1', 'rockchip-rkbin', 'rk3308-rkbin', d)}:do_deploy" INIT_FIRMWARE_DEPENDS:rk3328 = " trusted-firmware-a:do_deploy" INIT_FIRMWARE_DEPENDS:rk3399 = " trusted-firmware-a:do_deploy" INIT_FIRMWARE_DEPENDS:rk3588s = " rockchip-rkbin:do_deploy" @@ -23,3 +26,8 @@ do_compile:append:rock2-square () { cp ${B}/spl/${SPL_BINARY} ${B} fi } + +do_compile:append:rk3308() { + mkimage -n rk3308 -T rksd -d ${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin ${B}/idbloader.img + cat ${B}/spl/u-boot-spl.bin >> ${B}/idbloader.img +} diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend b/recipes-kernel/linux/linux-yocto_%.bbappend index 7da92db..7d8fb8b 100644 --- a/recipes-kernel/linux/linux-yocto_%.bbappend +++ b/recipes-kernel/linux/linux-yocto_%.bbappend @@ -15,6 +15,7 @@ COMPATIBLE_MACHINE:rock-pi-e = "rock-pi-e" COMPATIBLE_MACHINE:nanopi-r4s = "nanopi-r4s" COMPATIBLE_MACHINE:nanopi-r2s = "nanopi-r2s" COMPATIBLE_MACHINE:nanopi-m4b = "nanopi-m4b" +COMPATIBLE_MACHINE:rock-pi-s = "rock-pi-s" SRC_URI:append = " file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta" SRC_URI:append:nanopi-r4s = " file://nanopi-r4s.scc"