Files
build/config/boards/khadas-vim4.wip
Gunjan Gupta c0e2bb910c meson-s4t7: add systemd service to enable fan in automatic mode
The service is only enabled by default on Vim4 as that board heats
a lot and a fan is absolutely necessary. Service will be available
on vim1s as well and if someone has purchased the fan for it, they
would be able to enable it themselves.

The service is only added for legacy kernel right now as I am not
sure if the upcoming 5.15 kernel will have same sysfs interface for
fan.
2023-10-11 11:05:45 +02:00

35 lines
1.4 KiB
Plaintext

# Amlogic A311D2 8GB
BOARD_NAME="Khadas VIM4"
BOARDFAMILY="meson-s4t7"
KERNEL_TARGET="legacy"
BOARD_MAINTAINER="viraniac rpardini"
SERIALCON="ttyS0" # for vendor kernel
# BOOT_FDT_FILE="amlogic/kvim4.dtb" # not set on purpose; u-boot auto-selects kvim4.dtb or kvim4n.dtb for "new VIM4"
# build uboot from source
BOOTCONFIG="kvim4_defconfig"
KHADAS_BOARD_ID="kvim4" # used to compile the fip blobs
declare -g KHADAS_OOWOW_BOARD_ID="VIM4" # for use with EXT=output-image-oowow
OVERLAY_PREFIX='t7-a311d2'
# Add modprobe configuration for the ISP, see https://github.com/khadas/fenix/blob/master/archives/filesystem/special/VIM4/etc/modprobe.d/isp.conf
# This avoids a kernel panic related to the ISP firmware; see https://armbian.atlassian.net/browse/AR-1801?focusedCommentId=11995
function post_family_tweaks_bsp__kvim4_isp_modprobe() {
: "${destination:?}"
display_alert "${BOARD}" "Adding modprobe configuration for the ISP" "info"
mkdir -p "${destination}"/etc/modprobe.d
cat <<- EOD > "${destination}"/etc/modprobe.d/isp.conf
options iv009_isp dcam=2
softdep iv009_isp pre: iv009_isp_iq iv009_isp_lens iv009_isp_sensor
EOD
}
function post_family_tweaks_bsp__enable_fan_service() {
if [[ ${BRANCH} = "legacy" ]]; then
run_host_command_logged mkdir -p "${destination}"/etc/systemd/system/mutli-user.target.wants
run_host_command_logged ln -sf /etc/systemd/system/fan.service "${destination}"/etc/systemd/system/mutli-user.target.wants/fan.service
fi
}