#
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2013-2023 Igor Pecovnik, igor@armbian.com
#
# This file is a part of the Armbian Build Framework
# https://github.com/armbian/build/
#
source "${BASH_SOURCE%/*}/include/rockchip64_common.inc"

if [[ $BOARD == station-p2 || $BOARD == station-m2 ]]; then
	BOOTSOURCE='https://github.com/150balbes/u-boot-rk'
	BOOTBRANCH='branch:rk356x'
	BOOTPATCHDIR="u-boot-station-p2"
elif [[ $BOARD == quartz64a || $BOARD == quartz64b ]]; then
	BOOTSOURCE='https://github.com/150balbes/u-boot-rk'
	BOOTBRANCH='branch:rk35xx'
	BOOTPATCHDIR="u-boot-station-p2"
elif [[ $BOARD == khadas-edge2 ]]; then
	BOOTSOURCE='https://github.com/150balbes/u-boot-rk'
	BOOTBRANCH='branch:rk3588'
	BOOTPATCHDIR="u-boot-station-p2"
else
	BOOTBRANCH="tag:v2022.04"
	BOOTPATCHDIR="u-boot-media"
fi

case $BRANCH in

	legacy)
		KERNELSOURCE='https://github.com/150balbes/rockchip-kernel'
		declare -g KERNEL_MAJOR_MINOR="5.10" # Major and minor versions of this kernel.
		KERNELBRANCH='commit:9db2691ddfbdc7013d507df665f3e038eea7bf93'
		LINUXFAMILY=media
		LINUXCONFIG='linux-media-'$BRANCH
		KERNELPATCHDIR='media-'$BRANCH
		;;

	current)
		declare -g KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel.
		KERNELBRANCH="branch:linux-6.1.y"
		LINUXCONFIG='linux-media-'$BRANCH
		KERNELPATCHDIR='media-'$BRANCH
		LINUXFAMILY=media
		;;

	edge)
		declare -g KERNEL_MAJOR_MINOR="6.2" # Major and minor versions of this kernel.
		KERNELBRANCH="branch:linux-6.2.y"
		KERNELPATCHDIR='media-'$BRANCH
		LINUXFAMILY=media
		LINUXCONFIG='linux-media-'$BRANCH
		;;
esac

prepare_boot_configuration
