Files
orangepi-build/external/config/sources/families/sun50iw9.conf
orangepi-xunlong 206214916c Bump to next branch
Host: Ubuntu 21.04
2022-03-07 16:26:01 +08:00

114 lines
4.3 KiB
Plaintext

source "${BASH_SOURCE%/*}/include/sunxi64_common.inc"
LINUXFAMILY=sun50iw9
[[ -z $CPUMIN ]] && CPUMIN=480000
[[ -z $CPUMAX ]] && CPUMAX=1512000
GOVERNOR=ondemand
case $BRANCH in
legacy)
KERNELBRANCH="branch:orange-pi-4.9-sun50iw9"
KERNELPATCHDIR=${BOARDFAMILY}-${BRANCH}
BOOTBRANCH='branch:v2018.05-sun50iw9'
UBOOT_TARGET_MAP=";;dts/${BOARD}-u-boot.dts boot0_sdcard.fex boot_package.fex"
UBOOT_COMPILER="arm-linux-gnueabi-"
UBOOT_USE_GCC='> 6.0'
BOOTENV_FILE=sun50iw9-default.txt
BOOTSCRIPT='boot-sun50iw9.cmd:boot.cmd'
OFFSET=20
ATFSOURCE=""
ATF_COMPILE="no"
INITRD_ARCH=arm
[[ ${BOARD} =~ orangepizero2|orangepizero2-b|orangepizero2-lts ]] && ASOUND_STATE='asound.state.sun50iw9-legacy'
[[ ${BOARD} == orangepi400 ]] && ASOUND_STATE='asound.state.orangepi400-es8316'
;;
current)
OVERLAY_PREFIX='sun50i-h616'
ATFSOURCE='https://github.com/ARM-software/arm-trusted-firmware'
ATFBRANCH='branch:master'
ATF_PLAT="sun50i_h616";
ATF_TARGET_MAP='PLAT=sun50i_h616 DEBUG=1 bl31;;build/sun50i_h616/debug/bl31.bin'
UBOOT_TARGET_MAP=';;u-boot-sunxi-with-spl.bin'
BOOTBRANCH='branch:v2021.07-sunxi'
BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd'
KERNELBRANCH='branch:orange-pi-5.13-sunxi64'
LINUXCONFIG='linux-5.13-sunxi64'
ASOUND_STATE='asound.state.sun50iw9-current'
;;
esac
family_tweaks_s()
{
if [[ $BOARD =~ orangepizero2|orangepizero2-lts|orangepizero2-b ]]; then
chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools" >/dev/null 2>&1
fi
if [[ $BUILD_DESKTOP == yes ]]; then
sed -i "s/auto-profiles = yes/auto-profiles = no/" ${SDCARD}/usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf
if [[ $BRANCH == legacy ]]; then
echo "load-module module-alsa-sink device=hw:0,0 sink_name=AudioCodec-Playback sink_properties=\"device.description='Audio Codec'\"" >> ${SDCARD}/etc/pulse/default.pa
echo "load-module module-alsa-sink device=hw:1,0 sink_name=HDMI-Playback sink_properties=\"device.description='HDMI Audio'\"" >> ${SDCARD}/etc/pulse/default.pa
elif [[ $BRANCH == current ]]; then
echo "load-module module-alsa-sink device=hw:2,0 sink_name=AudioCodec-Playback sink_properties=\"device.description='Audio Codec'\"" >> ${SDCARD}/etc/pulse/default.pa
echo "load-module module-alsa-sink device=hw:0,0 sink_name=HDMI-Playback sink_properties=\"device.description='HDMI Audio'\"" >> ${SDCARD}/etc/pulse/default.pa
fi
fi
}
family_tweaks_bsp()
{
:
}
uboot_custom_postprocess()
{
if [[ ${BRANCH} == legacy ]]; then
rm dts/*.dts sys_config ${BOARD}-u-boot.dtb -r >/dev/null 2>&1
export PATH=${EXTER}/packages/pack-uboot/${BOARDFAMILY}/tools/:$PATH
cp ${EXTER}/packages/pack-uboot/${BOARDFAMILY}/bin/* . -r
cp sys_config/sys_config_${BOARD}.fex sys_config.fex
cp u-boot.bin u-boot.fex
[[ ${BOARD} =~ orangepizero2-b|orangepizero2-lts ]] && mv boot0_sdcard_new.fex boot0_sdcard.fex
# make u-boot dtb
$EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/dtc -p 2048 -W no-unit_address_vs_reg -@ -O dtb -o ${BOARD}-u-boot.dtb -b 0 dts/${BOARD}-u-boot.dts >/dev/null 2>&1
[[ ! -f ${BOARD}-u-boot.dtb ]] && exit_with_error "dts compilation failed"
busybox unix2dos sys_config.fex
$EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/script sys_config.fex >/dev/null 2>&1
cp ${BOARD}-u-boot.dtb sunxi.fex
$EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/update_dtb sunxi.fex 4096 >/dev/null 2>&1
$EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/update_boot0 boot0_sdcard.fex sys_config.bin SDMMC_CARD >/dev/null 2>&1
$EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/update_uboot -no_merge u-boot.fex sys_config.bin >/dev/null 2>&1
update_uboot -no_merge u-boot.bin sys_config.bin >/dev/null 2>&1
#pack boot package
busybox unix2dos boot_package.cfg
$EXTER/packages/pack-uboot/${BOARDFAMILY}/tools/dragonsecboot -pack boot_package.cfg >/dev/null 2>&1
if [[ ${MERGE_UBOOT} == yes ]]; then
display_alert "Merge u-boot" "u-boot-${BOARD}-merged.bin" "info"
dd if=/dev/zero of=u-boot-${BOARD}-merged.bin bs=1M count=20 > /dev/null 2>&1
dd if=boot0_sdcard.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=1 conv=fsync > /dev/null 2>&1
dd if=boot_package.fex of=u-boot-${BOARD}-merged.bin bs=8k seek=2050 conv=fsync > /dev/null 2>&1
mv u-boot-${BOARD}-merged.bin ${DEB_STORAGE}/u-boot/
fi
fi
}