2023-03-09 18:30:40 +01:00
|
|
|
#
|
|
|
|
|
# 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/
|
|
|
|
|
#
|
2019-11-19 23:25:39 +01:00
|
|
|
ARCH=arm64
|
2017-08-14 22:06:34 +02:00
|
|
|
BOOTSOURCE='https://github.com/rafaello7/u-boot-nanopi-m3'
|
|
|
|
|
BOOTBRANCH='branch:master'
|
|
|
|
|
BOOTDIR='u-boot-s5p6818'
|
2022-11-06 20:32:46 +01:00
|
|
|
BOOTPATCHDIR='legacy/u-boot-s5p6818'
|
2017-08-14 22:06:34 +02:00
|
|
|
BOOTSCRIPT='boot-s5p6818.cmd:boot.cmd'
|
2020-06-27 19:14:38 +02:00
|
|
|
BOOTENV_FILE='s5p6818.txt'
|
2018-09-06 20:22:51 +02:00
|
|
|
UBOOT_TARGET_MAP=";;boot.img bootemmc.img"
|
2019-11-19 23:25:39 +01:00
|
|
|
ATF_COMPILE="no"
|
2017-12-06 22:27:43 +01:00
|
|
|
case $BRANCH in
|
2022-10-08 13:18:00 +02:00
|
|
|
legacy | current)
|
2020-11-01 19:54:39 +01:00
|
|
|
KERNELSOURCE='https://github.com/armbian/linux'
|
2022-10-08 13:25:04 +02:00
|
|
|
export KERNEL_MAJOR_MINOR="4.14" # Major and minor versions of this kernel. See https://github.com/armbian/linux/blob/s5p6818/Makefile
|
2020-11-01 19:54:39 +01:00
|
|
|
KERNELBRANCH='branch:s5p6818'
|
|
|
|
|
KERNELDIR='linux-mainline'
|
2022-10-08 13:18:00 +02:00
|
|
|
;;
|
2017-12-06 22:27:43 +01:00
|
|
|
esac
|
2017-08-14 22:06:34 +02:00
|
|
|
|
2019-11-19 23:25:39 +01:00
|
|
|
CPUMIN="400000"
|
|
|
|
|
CPUMAX="1400000"
|
2017-08-25 05:11:44 -07:00
|
|
|
GOVERNOR=ondemand
|
2017-08-14 22:06:34 +02:00
|
|
|
|
2022-10-08 13:18:00 +02:00
|
|
|
write_uboot_platform() {
|
2018-09-06 20:22:51 +02:00
|
|
|
if [[ "$2" != /dev/mmcblk0 ]]; then
|
2022-10-08 13:18:00 +02:00
|
|
|
dd if=$1/boot.img of=$2 seek=1 status=noxfer > /dev/null 2>&1
|
2018-09-06 20:22:51 +02:00
|
|
|
else
|
2022-10-08 13:18:00 +02:00
|
|
|
dd if=$1/bootemmc.img of=$2 seek=1 status=noxfer > /dev/null 2>&1
|
2018-09-06 20:22:51 +02:00
|
|
|
fi
|
2017-08-19 19:50:56 +03:00
|
|
|
}
|
|
|
|
|
|
2022-10-08 13:18:00 +02:00
|
|
|
uboot_custom_postprocess() {
|
2018-05-24 15:46:51 +02:00
|
|
|
# 2GB differnt bl1 https://github.com/friendlyarm/linux-3.4.y/issues/3#issuecomment-387214487
|
|
|
|
|
if [[ $BOARD == nanopct3plus ]]; then
|
|
|
|
|
cp $SRC/packages/blobs/nanopi/2g-bl1-nanopi.bin boot.img
|
|
|
|
|
else
|
|
|
|
|
cp $SRC/packages/blobs/nanopi/1g-bl1-nanopi.bin boot.img
|
|
|
|
|
fi
|
2017-08-16 16:03:49 +02:00
|
|
|
i=0
|
|
|
|
|
merge=""
|
|
|
|
|
while [ $i -lt 512 ]; do
|
2022-10-08 13:18:00 +02:00
|
|
|
val="00000000"
|
|
|
|
|
[ $i -eq 68 ] && val="00060000" # 0x44 load size
|
|
|
|
|
[ $i -eq 72 ] && val="43bffe00" # 0x48 load address
|
|
|
|
|
[ $i -eq 76 ] && val="43c00000" # 0x4c launch address
|
|
|
|
|
[ $i -eq 504 ] && val="68180300" # 0x1f8 version
|
|
|
|
|
[ $i -eq 508 ] && val="4849534E" # 0x1fc "NSIH"
|
2017-08-16 16:03:49 +02:00
|
|
|
# put in little endian
|
|
|
|
|
vallo=${val#????}
|
|
|
|
|
valhi=${val%????}
|
|
|
|
|
merge=$merge"${vallo#??}${vallo%??}${valhi#??}${valhi%??}"
|
2022-10-08 13:18:00 +02:00
|
|
|
i=$((i + 4))
|
2017-08-16 16:03:49 +02:00
|
|
|
done
|
2017-08-19 19:50:56 +03:00
|
|
|
echo $merge | xxd -r -p | dd of=boot.img seek=63 status=none
|
|
|
|
|
cat u-boot.bin >> boot.img
|
2018-09-06 20:22:51 +02:00
|
|
|
cp boot.img bootemmc.img
|
|
|
|
|
printf "\2" | dd of=bootemmc.img bs=1 seek=80 conv=notrunc
|
2017-08-14 22:06:34 +02:00
|
|
|
}
|
|
|
|
|
|
2022-10-08 13:18:00 +02:00
|
|
|
family_tweaks() {
|
2019-11-19 23:25:39 +01:00
|
|
|
:
|
2017-08-25 05:11:44 -07:00
|
|
|
}
|