# Rockchip RK3568 quad core 1-8GB SoC GBe eMMC USB3 BOARD_NAME="Rock 3A" BOARDFAMILY="rk35xx" BOARD_MAINTAINER="ZazaBR amazingfate catalinii vamzii" BOOTCONFIG="rock-3a-rk3568_defconfig" BOOTCONFIG_SATA="rock-3a-sata-rk3568_defconfig" KERNEL_TARGET="current,edge,vendor" KERNEL_TEST_TARGET="current,vendor" FULL_DESKTOP="yes" BOOT_LOGO="desktop" BOOT_FDT_FILE="rockchip/rk3568-rock-3a.dtb" BOOT_SCENARIO="spl-blobs" BOOT_SUPPORT_SPI="yes" BOOT_SPI_RKSPI_LOADER="yes" IMAGE_PARTITION_TABLE="gpt" BOOTFS_TYPE="fat" function post_family_config__rock-3a_use_mainline_uboot_except_vendor_and_add_sata_target() { display_alert "$BOARD" "Configuring ($BOARD) standard and sata uboot target map" "info" UBOOT_TARGET_MAP=" BL31=$RKBIN_DIR/$BL31_BLOB $BOOTCONFIG spl/u-boot-spl.bin u-boot.dtb u-boot.itb;;idbloader.img u-boot.itb rkspi_loader.img BL31=$RKBIN_DIR/$BL31_BLOB $BOOTCONFIG_SATA spl/u-boot-spl.bin u-boot.dtb u-boot.itb;; rkspi_loader_sata.img" # use mainline uboot for _current_ and _edge_ if [[ "$BRANCH" != "current" && "$BRANCH" != "edge" ]]; then return 0 fi display_alert "$BOARD" "Mainline U-Boot overrides for $BOARD - $BRANCH" "info" unset BOOTFS_TYPE # fixes armbian-install and unneeded for modern uboot anyway declare -g BOOTCONFIG="rock-3a-rk3568_defconfig" declare -g BOOTDELAY=1 declare -g BOOTSOURCE="https://github.com/u-boot/u-boot" declare -g BOOTBRANCH="tag:v2025.04" declare -g BOOTPATCHDIR="v2025.04" declare -g BOOTDIR="u-boot-${BOARD}" # do not share u-boot directory declare -g UBOOT_TARGET_MAP="BL31=${RKBIN_DIR}/${BL31_BLOB} ROCKCHIP_TPL=${RKBIN_DIR}/${DDR_BLOB};;u-boot-rockchip.bin u-boot-rockchip-spi.bin" unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd # disable stuff from rockchip64_common; we're using binman here which does all the work already # Just use the binman-provided u-boot-rockchip.bin, which is ready-to-go function write_uboot_platform() { dd "if=$1/u-boot-rockchip.bin" "of=$2" bs=32k seek=1 conv=notrunc status=none } function write_uboot_platform_mtd() { flashcp -v -p "$1/u-boot-rockchip-spi.bin" /dev/mtd0 } } function post_uboot_custom_postprocess__create_sata_spi_image() { display_alert "$BOARD" "Create rkspi_loader_sata.img" "info" dd if=/dev/zero of=rkspi_loader_sata.img bs=1M count=0 seek=16 /sbin/parted -s rkspi_loader_sata.img mklabel gpt /sbin/parted -s rkspi_loader_sata.img unit s mkpart idbloader 64 7167 /sbin/parted -s rkspi_loader_sata.img unit s mkpart vnvm 7168 7679 /sbin/parted -s rkspi_loader_sata.img unit s mkpart reserved_space 7680 8063 /sbin/parted -s rkspi_loader_sata.img unit s mkpart reserved1 8064 8127 /sbin/parted -s rkspi_loader_sata.img unit s mkpart uboot_env 8128 8191 /sbin/parted -s rkspi_loader_sata.img unit s mkpart reserved2 8192 16383 /sbin/parted -s rkspi_loader_sata.img unit s mkpart uboot 16384 32734 dd if=idbloader.img of=rkspi_loader_sata.img seek=64 conv=notrunc dd if=u-boot.itb of=rkspi_loader_sata.img seek=16384 conv=notrunc }