rk1808: add rk1808 compute stick support

Change-Id: Id912c4903c269b74296fc237901c2d79d2b8e61a
Signed-off-by: Lin Huang <hl@rock-chips.com>
This commit is contained in:
Lin Huang
2019-04-11 17:13:36 +08:00
parent c018c01324
commit 35f2312e3b
5 changed files with 153 additions and 0 deletions

View File

@ -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=

View File

@ -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)

View File

@ -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'

Binary file not shown.

Binary file not shown.