diff --git a/rk1808/BoardConfig_rk1808_compute_stick.mk b/rk1808/BoardConfig_rk1808_compute_stick.mk new file mode 100755 index 0000000..0508b70 --- /dev/null +++ b/rk1808/BoardConfig_rk1808_compute_stick.mk @@ -0,0 +1,26 @@ +#!/bin/bash + +# Target arch +export RK_ARCH=arm64 +# Uboot defconfig +export RK_UBOOT_DEFCONFIG=rknpu-lion +# Kernel defconfig +export RK_KERNEL_DEFCONFIG=rk1808_linux_defconfig +# Kernel dts +export RK_KERNEL_DTS=rk1808-compute-v10 +# boot image type +export RK_BOOT_IMG=boot.img +# kernel image path +export RK_KERNEL_IMG=kernel/arch/arm64/boot/Image +# Buildroot config +export RK_CFG_BUILDROOT=rockchip_rk1808_compute_stick +# ramboot config +export RK_CFG_RAMBOOT=rockchip_rk1808_compute_stick +# Pcba config +export RK_CFG_PCBA=rockchip_rk1808_pcba +# Build jobs +export RK_JOBS=12 +# target chip +export RK_TARGET_PRODUCT=rk1808 +#choose enable distro module +export RK_DISTRO_MODULE= diff --git a/rk1808/parameter-compute-stick.txt b/rk1808/parameter-compute-stick.txt new file mode 100644 index 0000000..65599dd --- /dev/null +++ b/rk1808/parameter-compute-stick.txt @@ -0,0 +1,11 @@ +FIRMWARE_VER: 8.1 +MACHINE_MODEL: RK1808 +MACHINE_ID: 007 +MANUFACTURER: RK1808 +MAGIC: 0x5041524B +ATAG: 0x00200800 +MACHINE: 1808 +CHECK_MASK: 0x80 +PWR_HLD: 0,0,A,0,1 +TYPE: GPT +CMDLINE:mtdparts=rk29xxnand:0x000001000@0x00002000(uboot),0x000001000@0x00003000(trust),0x000020000@0x00004000(boot) diff --git a/rk1808/rk1808_compute_stick_tool/npu_upgrade b/rk1808/rk1808_compute_stick_tool/npu_upgrade new file mode 100755 index 0000000..2e5bec3 --- /dev/null +++ b/rk1808/rk1808_compute_stick_tool/npu_upgrade @@ -0,0 +1,116 @@ +#!/bin/bash + +PROGRAM=${0##*/} +SCRIPT_ROOT=$(dirname $(readlink -f "$0")) + +if [ $# -ne 4 ]; then + echo 'Usage: '$PROGRAM' loader uboot trust boot' + exit +fi + +cat /proc/cpuinfo |grep Intel +if [ $? -ne 0 ]; then + echo "use arm version" + UPGRADE_TOOL=$SCRIPT_ROOT/upgrade_tool_arm +else + UPGRADE_TOOL=$SCRIPT_ROOT/upgrade_tool_x86 +fi + +LOADER=$1 +UBOOT=$2 +TRUST=$3 +BOOT=$4 +UBOOT_ADDR=0x52000 +TRUST_ADDR=0x52800 +BOOT_ADDR=0x20000 + +if [ ! -f $UPGRADE_TOOL ]; then + echo $UPGRADE_TOOL 'is not existed!' + exit +fi + +if [ ! -f $LOADER ]; then + echo $LOADER 'is not existed!' + exit +fi + +if [ ! -f $UBOOT ]; then + echo $UBOOT 'is not existed!' + exit +fi + +if [ ! -f $TRUST ]; then + echo $TRUST 'is not existed!' + exit +fi + +if [ ! -f $BOOT ]; then + echo $BOOT 'is not existed!' + exit +fi + +echo 'start to wait device...' +i=0 +while [ $i -lt 5 ]; do + $UPGRADE_TOOL ld > /dev/null + if [ $? -ne 0 ]; then + i=$((i+1)) + echo $i + sleep 0.01 + else + break + fi +done +if [ $i -ge 5 ]; then + echo 'failed to wait device!' + exit +fi +echo 'device is ready' + +echo 'start to download loader...' +$UPGRADE_TOOL db $LOADER > /dev/null +if [ $? -ne 0 ]; then + echo 'failed to download loader!' + exit +fi +echo 'download loader ok' + +echo 'start to wait loader...' +$UPGRADE_TOOL td > /dev/null +if [ $? -ne 0 ]; then + echo 'failed to wait loader!' + exit +fi +echo 'loader is ready' + +echo 'start to write uboot...' +$UPGRADE_TOOL wl $UBOOT_ADDR $UBOOT > /dev/null +if [ $? -ne 0 ]; then + echo 'failed to write uboot!' + exit +fi +echo 'write uboot ok' + +echo 'start to write trust...' +$UPGRADE_TOOL wl $TRUST_ADDR $TRUST > /dev/null +if [ $? -ne 0 ]; then + echo 'failed to write trust!' + exit +fi +echo 'write trust ok' + +echo 'start to write boot...' +$UPGRADE_TOOL wl $BOOT_ADDR $BOOT > /dev/null +if [ $? -ne 0 ]; then + echo 'failed to write boot!' + exit +fi +echo 'write boot ok' + +echo 'start to run system...' +$UPGRADE_TOOL rs $UBOOT_ADDR $TRUST_ADDR $BOOT_ADDR $UBOOT $TRUST $BOOT > /dev/null +if [ $? -ne 0 ]; then + echo 'failed to run system!' + exit +fi +echo 'run system ok' diff --git a/rk1808/rk1808_compute_stick_tool/upgrade_tool_arm b/rk1808/rk1808_compute_stick_tool/upgrade_tool_arm new file mode 100755 index 0000000..a03e759 Binary files /dev/null and b/rk1808/rk1808_compute_stick_tool/upgrade_tool_arm differ diff --git a/rk1808/rk1808_compute_stick_tool/upgrade_tool_x86 b/rk1808/rk1808_compute_stick_tool/upgrade_tool_x86 new file mode 100755 index 0000000..34ab9b1 Binary files /dev/null and b/rk1808/rk1808_compute_stick_tool/upgrade_tool_x86 differ