From 7a677f1eef9ea8fb358afc6d87a705706895137f Mon Sep 17 00:00:00 2001 From: alichinese Date: Tue, 15 Jul 2025 19:59:53 +0800 Subject: [PATCH] tspi-3566: adapt tspi-3566 bootloader * restructured the file organization within the TaishanPi U-Boot Signed-off-by: alichinese --- .../conf/machine/tspi-3566.conf | 2 + .../u-boot/files/tspi-3566-parameter | 13 ++++++ .../recipes-bsp/u-boot/rockchip-common.inc | 40 ++++++++++++++++++ .../recipes-bsp/u-boot/u-boot-rockchip.bb | 41 ++---------------- .../recipes-bsp/u-boot/u-boot-tspi-3566.bb | 42 +++++++++++++++++++ .../recipes-core/images/tspi-3566.inc | 0 6 files changed, 100 insertions(+), 38 deletions(-) create mode 100644 bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/files/tspi-3566-parameter create mode 100644 bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/rockchip-common.inc create mode 100644 bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-tspi-3566.bb create mode 100644 bsp/meta-openeuler-bsp/rockchip/recipes-core/images/tspi-3566.inc diff --git a/bsp/meta-openeuler-bsp/conf/machine/tspi-3566.conf b/bsp/meta-openeuler-bsp/conf/machine/tspi-3566.conf index 1577fe516e5..9831d50e5b4 100644 --- a/bsp/meta-openeuler-bsp/conf/machine/tspi-3566.conf +++ b/bsp/meta-openeuler-bsp/conf/machine/tspi-3566.conf @@ -1,5 +1,7 @@ require conf/machine/include/openeuler-rockchip-rk3568-evb.conf +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-tspi-3566" + ROCKCHIP_KERNEL_DTB_NAME = "tspi-rk3566-user-v10-linux.dtb" # auto load module during startup diff --git a/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/files/tspi-3566-parameter b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/files/tspi-3566-parameter new file mode 100644 index 00000000000..7d9f7f59291 --- /dev/null +++ b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/files/tspi-3566-parameter @@ -0,0 +1,13 @@ +FIRMWARE_VER: 1.0 +MACHINE_MODEL: RK3568 +MACHINE_ID: 007 +MANUFACTURER: RK3568 +MAGIC: 0x5041524B +ATAG: 0x00200800 +MACHINE: 0xffffffff +CHECK_MASK: 0x80 +PWR_HLD: 0,0,A,0,1 +TYPE: GPT +GROW_ALIGN: 0 +CMDLINE: mtdparts=:0x00002000@0x00004000(uboot),0x00040000@0x00008000(boot:bootable),-@0x00048000(rootfs:grow) +uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9 diff --git a/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/rockchip-common.inc b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/rockchip-common.inc new file mode 100644 index 00000000000..fe7595d2aed --- /dev/null +++ b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/rockchip-common.inc @@ -0,0 +1,40 @@ +# Copyright (C) 2019, Fuzhou Rockchip Electronics Co., Ltd +# Released under the MIT license (see COPYING.MIT for the terms) + +PATCHPATH = "${CURDIR}/u-boot-rockchip" +inherit auto-patch + +inherit python3-dir + +require recipes-bsp/u-boot/u-boot.inc +require recipes-bsp/u-boot/u-boot-common.inc + +# PROVIDES = "virtual/bootloader" + +DEPENDS += "bc-native dtc-native" + +OPENEULER_REPO_NAMES = "rk-binary-native u-boot-rockchip" + +PV = "2017.09" + +LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" + +FILEEXTRAPATHS:prepend := "${THISDIR}/files" + +SRC_URI = " \ + file://u-boot-rockchip \ + file://rk-binary-native;destsuffix=u-boot-rockchip/ \ +" + +S = "${WORKDIR}/u-boot-rockchip" + +SRCREV_FORMAT = "default_rk-binary-native" + +DEPENDS:append = " ${PYTHON_PN}-native" + +# Needed for packing BSP u-boot +DEPENDS:append = " coreutils-native ${PYTHON_PN}-pyelftools-native" + +do_unpack:append() { + bb.build.exec_func('do_copy_rkbin_source', d) +} diff --git a/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-rockchip.bb b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-rockchip.bb index f82121c7583..6b62d0437ab 100644 --- a/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-rockchip.bb +++ b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-rockchip.bb @@ -1,41 +1,4 @@ -# Copyright (C) 2019, Fuzhou Rockchip Electronics Co., Ltd -# Released under the MIT license (see COPYING.MIT for the terms) - -PATCHPATH = "${CURDIR}/u-boot-rockchip" -inherit auto-patch - -inherit python3-dir - -require recipes-bsp/u-boot/u-boot.inc -require recipes-bsp/u-boot/u-boot-common.inc - -PROVIDES = "virtual/bootloader" - -DEPENDS += "bc-native dtc-native" - -OPENEULER_REPO_NAMES = "rk-binary-native u-boot-rockchip" - -PV = "2017.09" - -LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6" - -SRC_URI = " \ - file://u-boot-rockchip \ - file://rk-binary-native;destsuffix=u-boot-rockchip/ \ -" - -S = "${WORKDIR}/u-boot-rockchip" - -SRCREV_FORMAT = "default_rk-binary-native" - -DEPENDS:append = " ${PYTHON_PN}-native" - -# Needed for packing BSP u-boot -DEPENDS:append = " coreutils-native ${PYTHON_PN}-pyelftools-native" - -do_unpack:append() { - bb.build.exec_func('do_copy_rkbin_source', d) -} +require recipes-bsp/u-boot/rockchip-common.inc do_copy_rkbin_source() { mv rk-binary-native rkbin @@ -117,3 +80,5 @@ do_deploy:append() { ln -sf "${binary}-${PV}" "${DEPLOYDIR}/${binary}" done } + +include recipes-bsp/u-boot/${MACHINE}.inc diff --git a/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-tspi-3566.bb b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-tspi-3566.bb new file mode 100644 index 00000000000..e0571b13341 --- /dev/null +++ b/bsp/meta-openeuler-bsp/rockchip/recipes-bsp/u-boot/u-boot-tspi-3566.bb @@ -0,0 +1,42 @@ +require recipes-bsp/u-boot/rockchip-common.inc + +PARAMETER = "tspi-3566-parameter" + +SRC_URI:append = " \ + file://${PARAMETER} \ +" + +do_copy_rkbin_source() { + mv rk-binary-native rkbin +} + +do_configure:prepend() { + # the python scripts need python2, so we create tmp soft link + ln -s $(which python) ${RECIPE_SYSROOT_NATIVE}${bindir_native}/python2 +} + +do_compile() { + cd ${S} + ./make.sh CROSS_COMPILE=aarch64-openeuler-linux- rk3566 +} + +do_install() { +} + +do_deploy() { + cd ${S} + test -d "${OUTPUT_DIR}" || mkdir -p "${OUTPUT_DIR}" + if [ -f "uboot.img" ]; then + install uboot.img ${OUTPUT_DIR} + fi + if ls *_loader*.bin 1> /dev/null 2>&1; then + install *_loader*.bin ${OUTPUT_DIR}/MiniLoaderAll.bin + fi +} + +# add parameter to deploy directory +do_deploy:append() { + if [ -f "${WORKDIR}/${PARAMETER}" ]; then + install ${WORKDIR}/${PARAMETER} ${OUTPUT_DIR}/parameter + fi +} diff --git a/bsp/meta-openeuler-bsp/rockchip/recipes-core/images/tspi-3566.inc b/bsp/meta-openeuler-bsp/rockchip/recipes-core/images/tspi-3566.inc new file mode 100644 index 00000000000..e69de29bb2d -- Gitee