125 lines
3.6 KiB
Plaintext
125 lines
3.6 KiB
Plaintext
OFFSET=4
|
|
|
|
BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
|
|
BOOTSCRIPT='boot-odroid-xu4-default.ini:boot.ini'
|
|
BOOTDIR='u-boot-odroidxu'
|
|
BOOTENV_FILE='odroidxu4-default.txt'
|
|
HAS_UUID_SUPPORT=yes
|
|
|
|
case $BRANCH in
|
|
default)
|
|
BOOTBRANCH='branch:odroidxu3-v2012.07'
|
|
BOOTPATCHDIR='u-boot-odroidxu4-default'
|
|
UBOOT_TARGET_MAP=';;sd_fuse/hardkernel/bl1.bin.hardkernel sd_fuse/hardkernel/bl2.bin.hardkernel u-boot.bin sd_fuse/hardkernel/tzsw.bin.hardkernel'
|
|
UBOOT_USE_GCC='< 4.9'
|
|
|
|
KERNELSOURCE='https://github.com/hardkernel/linux'
|
|
KERNELBRANCH='branch:odroidxu3-3.10.y'
|
|
KERNELDIR='linux-odroidxu4'
|
|
CAN_BUILD_STRETCH=no
|
|
;;
|
|
|
|
next)
|
|
BOOTBRANCH='branch:odroidxu4-v2017.05'
|
|
BOOTPATCHDIR='u-boot-odroidxu4-next'
|
|
UBOOT_TARGET_MAP=';;sd_fuse/bl1.bin.hardkernel sd_fuse/bl2.bin.hardkernel.720k_uboot u-boot-dtb.bin sd_fuse/tzsw.bin.hardkernel'
|
|
UBOOT_USE_GCC='> 6.3'
|
|
|
|
KERNELSOURCE='https://github.com/hardkernel/linux'
|
|
KERNELBRANCH='branch:odroidxu4-4.9.y'
|
|
KERNELDIR='linux-odroidxu-mainline'
|
|
|
|
KERNEL_USE_GCC='> 6.3'
|
|
;;
|
|
esac
|
|
|
|
CPUMIN=600000
|
|
CPUMAX=2000000
|
|
GOVERNOR=ondemand
|
|
|
|
SERIALCON=ttySAC2
|
|
|
|
setup_write_uboot_platform()
|
|
{
|
|
# this will update u-boot on the device rootfs is located on
|
|
# in case it's a mmc device, otherwise DEVICE will not be changed
|
|
# and will default to /dev/mmcblk0
|
|
local tmp=$(cat /proc/cmdline)
|
|
tmp="${tmp##*root=}"
|
|
tmp="${tmp%% *}"
|
|
[[ -n $tmp ]] && local part=$(findfs $tmp 2>/dev/null)
|
|
[[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2>/dev/null)
|
|
[[ -n $dev && $dev == mmcblk* ]] && DEVICE="/dev/${dev}"
|
|
}
|
|
|
|
write_uboot_platform()
|
|
{
|
|
# handle writing to eMMC on package upgrades
|
|
# assuming $2 points to a correct device
|
|
|
|
if [[ $2 == /dev/mmcblk* && -b ${2}boot0 ]]; then
|
|
local device=${2}boot0
|
|
echo 0 > /sys/block/$(basename $device)/force_ro
|
|
local is_emmc=1
|
|
signed_bl1_position=0
|
|
bl2_position=30
|
|
uboot_position=62
|
|
else
|
|
local device=${2}
|
|
signed_bl1_position=1
|
|
bl2_position=31
|
|
uboot_position=63
|
|
fi
|
|
|
|
if [[ -f $1/u-boot.bin ]]; then
|
|
# default branch
|
|
if [[ $is_emmc == 1 ]]; then
|
|
tzsw_position=718
|
|
env_position=1230
|
|
else
|
|
tzsw_position=719
|
|
env_position=1231
|
|
fi
|
|
|
|
dd if=$1/bl1.bin.hardkernel of=$device seek=$signed_bl1_position conv=fsync > /dev/null 2>&1
|
|
dd if=$1/bl2.bin.hardkernel of=$device seek=$bl2_position conv=fsync > /dev/null 2>&1
|
|
dd if=$1/u-boot.bin of=$device bs=512 seek=$uboot_position conv=fsync > /dev/null 2>&1
|
|
dd if=$1/tzsw.bin.hardkernel of=$device seek=$tzsw_position conv=fsync > /dev/null 2>&1
|
|
|
|
dd if=/dev/zero of=$device seek=$env_position count=32 bs=512 conv=fsync > /dev/null 2>&1
|
|
|
|
else
|
|
# next branch
|
|
if [[ $is_emmc == 1 ]]; then
|
|
tzsw_position=1502
|
|
else
|
|
tzsw_position=1503
|
|
fi
|
|
env_position=2015
|
|
|
|
dd if=$1/bl1.bin.hardkernel of=$device seek=$signed_bl1_position conv=fsync > /dev/null 2>&1
|
|
dd if=$1/bl2.bin.hardkernel.720k_uboot of=$device seek=$bl2_position conv=fsync > /dev/null 2>&1
|
|
dd if=$1/u-boot-dtb.bin of=$device bs=512 seek=$uboot_position conv=fsync > /dev/null 2>&1
|
|
dd if=$1/tzsw.bin.hardkernel of=$device seek=$tzsw_position conv=fsync > /dev/null 2>&1
|
|
|
|
dd if=/dev/zero of=$device seek=$env_position bs=512 count=32 conv=fsync > /dev/null 2>&1
|
|
fi
|
|
}
|
|
|
|
family_tweaks()
|
|
{
|
|
echo "blacklist ina231_sensor" > $SDCARD/etc/modprobe.d/blacklist-odroid.conf
|
|
echo "#Serial console allow root" >> $SDCARD/etc/securetty
|
|
echo "ttySAC2" >> $SDCARD/etc/securetty
|
|
}
|
|
|
|
family_tweaks_bsp()
|
|
{
|
|
if [[ $BRANCH != default ]]; then
|
|
mkdir -p $destination/etc/udev/rules.d
|
|
mkdir -p $destination/usr/local/bin
|
|
cp $SRC/packages/bsp/rockchip/hdmi.rules $destination/etc/udev/rules.d
|
|
install -m 755 $SRC/packages/bsp/rockchip/hdmi-hotplug $destination/usr/local/bin
|
|
fi
|
|
}
|