Reason for disabling Realtek 8822 SDIO Wifi driver: https://github.com/rockchip-linux/kernel/issues/114 GCC 7 (with -Wmisleading-indentation) discovered programming mistakes in Realtek SDIO Wifi drivers. As these drivers are not really required for Rockchip64 devices, building them for default Linux kernel has been disabled until Realtek provides fixed drivers.
121 lines
3.2 KiB
Plaintext
121 lines
3.2 KiB
Plaintext
ARCH=arm64
|
|
KERNEL_IMAGE_TYPE=Image
|
|
OFFSET=16
|
|
|
|
BOOTSCRIPT='boot-rockchip64.cmd:boot.cmd'
|
|
BOOTENV_FILE='rockchip-default.txt'
|
|
|
|
UBOOT_TARGET_MAP=";;idbloader.bin uboot.img trust.bin"
|
|
UBOOT_USE_GCC='> 7.0'
|
|
|
|
BOOTSOURCE='https://github.com/ayufan-rock64/linux-u-boot'
|
|
BOOTDIR='u-boot-rockchip64'
|
|
BOOTPATCHDIR="u-boot-rockchip64-${BRANCH}"
|
|
BOOTBRANCH='branch:rockchip-master'
|
|
|
|
BOOTDELAY=0
|
|
HAS_UUID_SUPPORT=yes
|
|
OVERLAY_PREFIX='rockchip'
|
|
SERIALCON=ttyS2
|
|
|
|
ATFSOURCE='https://github.com/ayufan-rock64/arm-trusted-firmware'
|
|
ATFDIR='arm-trusted-firmware-rockchip64'
|
|
ATFBRANCH='branch:rockchip'
|
|
ATF_USE_GCC='> 6.3'
|
|
GOVERNOR="ondemand"
|
|
|
|
if [[ $BOARD == rockpro64 ]]; then
|
|
|
|
ATF_TARGET_MAP='M0_CROSS_COMPILE=arm-linux-gnueabi- PLAT=rk3399 DEBUG=1 bl31;;trust.bin'
|
|
ATF_TOOLCHAIN2="arm-linux-gnueabi-:> 5.0"
|
|
CPUMIN="600000"
|
|
CPUMAX="1900000"
|
|
|
|
else
|
|
|
|
ATF_TARGET_MAP='PLAT=rk322xh DEBUG=1 bl31;;trust.bin'
|
|
CPUMIN="600000"
|
|
CPUMAX="1390000"
|
|
|
|
fi
|
|
|
|
case $BRANCH in
|
|
default)
|
|
KERNELSOURCE='https://github.com/ayufan-rock64/linux-kernel'
|
|
KERNELBRANCH='tag:4.4.138-1094-rockchip-ayufan'
|
|
KERNELDIR='linux-rockchip64'
|
|
KERNEL_USE_GCC='> 7.0'
|
|
;;
|
|
|
|
dev)
|
|
KERNELSOURCE='https://github.com/ayufan-rock64/linux-mainline-kernel'
|
|
KERNELBRANCH='tag:4.18.0-rc8-1060-ayufan'
|
|
KERNELDIR='linux-rockchip64'
|
|
KERNEL_USE_GCC='> 7.0'
|
|
;;
|
|
esac
|
|
|
|
write_uboot_platform()
|
|
{
|
|
dd if=$1/idbloader.bin of=$2 seek=64 conv=notrunc status=none >/dev/null 2>&1
|
|
dd if=$1/uboot.img of=$2 seek=16384 conv=notrunc status=none >/dev/null 2>&1
|
|
dd if=$1/trust.bin of=$2 seek=24576 conv=notrunc status=none >/dev/null 2>&1
|
|
}
|
|
|
|
setup_write_uboot_platform()
|
|
{
|
|
if grep -q "ubootpart" /proc/cmdline; then
|
|
local tmp=$(cat /proc/cmdline)
|
|
tmp="${tmp##*ubootpart=}"
|
|
tmp="${tmp%% *}"
|
|
[[ -n $tmp ]] && local part=$(findfs PARTUUID=$tmp 2>/dev/null)
|
|
[[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2>/dev/null)
|
|
[[ -n $dev ]] && DEVICE="/dev/$dev"
|
|
fi
|
|
}
|
|
|
|
uboot_custom_postprocess()
|
|
{
|
|
# bootloader image
|
|
if [[ $BOARD == rockpro64 ]]; then
|
|
# 3399
|
|
echo "TBD"
|
|
else
|
|
# 3328
|
|
tools/mkimage -n rk3328 -T rksd -d $SRC/cache/sources/rkbin-tools/rk33/rk3328_ddr_786MHz_v1.06.bin idbloader.bin
|
|
cat $SRC/cache/sources/rkbin-tools/rk33/rk3328_miniloader_v2.43.bin >> idbloader.bin
|
|
loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x200000
|
|
fi
|
|
}
|
|
|
|
atf_custom_postprocess()
|
|
{
|
|
# remove bl31.bin which can be 4+GiB in size and thus may fill the tmpfs mount
|
|
rm -f build/rk322xh/debug/bl31.bin
|
|
# ATF
|
|
trust_merger trust.ini
|
|
}
|
|
|
|
family_tweaks()
|
|
{
|
|
# enable root login via the serial console ttys2 may be deprecated
|
|
echo "ttyS2" >> $SDCARD/etc/securetty
|
|
echo "ttyFIQ0" >> $SDCARD/etc/securetty
|
|
|
|
|
|
if [[ $BOARD == z28pro ]]; then
|
|
echo "fdtfile=rockchip/rk3328-z28pro.dtb" >> $SDCARD/boot/armbianEnv.txt
|
|
chroot $SDCARD /bin/bash -c "systemctl --no-reload enable z28pro-bluetooth.service >/dev/null 2>&1"
|
|
fi
|
|
}
|
|
|
|
family_tweaks_bsp()
|
|
{
|
|
if [[ $BOARD == z28pro ]]; then
|
|
mkdir -p $destination/usr/local/bin
|
|
# Bluetooth
|
|
install -m 755 $SRC/packages/bsp/rk3328/z28pro/8822b_hciattach $destination/usr/bin
|
|
install -m 755 $SRC/packages/bsp/rk3328/z28pro/start_bt.sh $destination/usr/local/bin
|
|
cp $SRC/packages/bsp/rk3328/z28pro/z28pro-bluetooth.service $destination/lib/systemd/system/
|
|
fi
|
|
} |