Skip to content

Commit

Permalink
Switch ROCK Pi 4 to all blobs u-boot for Radxa's SPI compatibility (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
piter75 committed Dec 3, 2020
1 parent b3ad046 commit 4c4193b
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions config/sources/families/include/rockchip64_common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ elif [[ $BOARD == pinebook-pro ]]; then
BOOT_SOC=rk3399
ATFPATCHDIR='atf-rk3399'

elif [[ $BOARD == rockpi-4* || $BOARD == rockpro64 ]]; then
elif [[ $BOARD == rockpi-4* ]]; then

BOOT_USE_BLOBS=yes
BOOT_SUPPORT_SPI=yes
BOOT_SOC=rk3399
DDR_BLOB='rk33/rk3399_ddr_933MHz_v1.24.bin'
MINILOADER_BLOB='rk33/rk3399_miniloader_v1.19.bin'
BL31_BLOB='rk33/rk3399_bl31_v1.30.elf'

elif [[ $BOARD == rockpro64 ]]; then

BOOT_USE_TPL_SPL_BLOB=yes
BOOT_SUPPORT_SPI=yes
Expand Down Expand Up @@ -142,7 +151,7 @@ prepare_boot_configuration()

if [[ $BOOT_SUPPORT_SPI == yes ]]; then

UBOOT_TARGET_MAP+=" rkspi_loader.img"
UBOOT_TARGET_MAP="BL31=$RKBIN_DIR/$BL31_BLOB tpl/u-boot-tpl.bin spl/u-boot-spl.bin u-boot.itb ${UBOOT_TARGET_MAP} rkspi_loader.img"

fi
}
Expand All @@ -165,14 +174,7 @@ legacy_uboot_locations()
uboot_custom_postprocess()
{
if [[ $BOOT_USE_MAINLINE_ATF == yes || $BOOT_USE_TPL_SPL_BLOB == yes ]]; then

if [[ $BOOT_SUPPORT_SPI == yes ]]; then
tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin rkspi_tpl_spl.img
dd if=/dev/zero of=rkspi_loader.img count=8128 status=none
dd if=rkspi_tpl_spl.img of=rkspi_loader.img conv=notrunc status=none
dd if=u-boot.itb of=rkspi_loader.img seek=768 conv=notrunc status=none
fi

:
elif [[ $BOOT_USE_BLOBS == yes ]]; then

local tempfile=$(mktemp)
Expand Down Expand Up @@ -206,6 +208,13 @@ uboot_custom_postprocess()
echo "Unsupported u-boot processing configuration!"
exit 1
fi

if [[ $BOOT_SUPPORT_SPI == yes ]]; then
tools/mkimage -n $BOOT_SOC -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin rkspi_tpl_spl.img
dd if=/dev/zero of=rkspi_loader.img count=8128 status=none
dd if=rkspi_tpl_spl.img of=rkspi_loader.img conv=notrunc status=none
dd if=u-boot.itb of=rkspi_loader.img seek=768 conv=notrunc status=none
fi
}

write_uboot_platform()
Expand Down Expand Up @@ -237,7 +246,7 @@ write_uboot_platform_mtd()
if [[ -f $1/rkspi_loader.img ]]; then

dd if=$1/rkspi_loader.img of=$2 conv=notrunc status=none >/dev/null 2>&1

else

echo "SPI u-boot image not found!"
Expand Down Expand Up @@ -311,7 +320,7 @@ family_tweaks()
family_tweaks_bsp()
{

if [[ $BOOTCONFIG == *3328* ]] && [[ $BRANCH != legacy ]]; then
if [[ $BOOTCONFIG == *3328* ]] && [[ $BRANCH != legacy ]]; then
mkdir -p "$destination"/etc/X11/xorg.conf.d
cat <<-EOF > "$destination"/etc/X11/xorg.conf.d/02-driver.conf
# set fbdev as default driver.
Expand Down Expand Up @@ -349,7 +358,7 @@ family_tweaks_bsp()
mkdir -p $destination/etc/udev/hwdb.d/
cp $SRC/packages/bsp/pinebook-pro/10-usb-kbd.hwdb $destination/etc/udev/hwdb.d/
## brightness and power management defaults
mkdir -p $destination/usr/local/share/xdg/xfce4/xfconf/xfce-perchannel-xml/
mkdir -p $destination/usr/local/share/xdg/xfce4/xfconf/xfce-perchannel-xml/
cp $SRC/packages/bsp/pinebook-pro/xfce4-power-manager.xml $destination/usr/local/share/xdg/xfce4/xfconf/xfce-perchannel-xml/
## additional keyboard configs in lib/desktop.sh

Expand Down

0 comments on commit 4c4193b

Please sign in to comment.