Files
BPI-CM9-Linux/amlbian/config/boards/s6-bq201-6.12-bookworm-gnome.conf

282 lines
9.5 KiB
Plaintext

# BQ201 Board Configuration with Kernel 6.12 and U-Boot 2023
# This file is the entry point for mesons6-bq201 board building
#
# Configuration loading order:
# 1. amlogic_common.inc - Common Amlogic configuration
# 2. amlogic_k6.12.inc - Kernel 6.12 specific configuration
# 3. amlogic_uboot2023.inc - U-Boot 2023 specific configuration
# 4. Board-specific settings
# AMLOGIC TODO: Board configuration loading
display_alert "AMLOGIC TODO: Loading s6-bq201 board configuration" "s6-bq201" "info"
load_common_inc() {
local name="$1"
if [[ -z "$name" ]]; then
echo "Usage: load_common_inc amlogic${name}"
return 1
fi
local -a paths=(
"${AMLBIAN_DIR}/config/boards/include/amlogic${name}.inc"
"${SRC}/userpatches/config/boards/include/amlogic${name}.inc"
"${USERPATCHES_PATH}/config/boards/include/amlogic${name}.inc"
"amlogic${name}.inc"
)
for path in "${paths[@]}"; do
if [[ -f "${path}" ]]; then
display_alert "${name^^} TODO: Loading common config from" "${path}" "info"
source "${path}"
return 0
fi
done
echo "No amlogic${name}.inc found"
return 1
}
# ==============================================================================
# Section 1: Load Common Configuration from include/
# ==============================================================================
# Try multiple paths to handle different Armbian loading scenarios
load_common_inc -local-sources
load_common_inc -noninteractive
load_common_inc _common
load_common_inc _k6.12
load_common_inc _uboot2023
load_common_inc _vale
# ==============================================================================
# Section 2: Set bookworm gnome setting
# ==============================================================================
# Release
RELEASE="${RELEASE:-bookworm}"
# Build type
BUILD_DESKTOP="${BUILD_DESKTOP:-yes}"
BUILD_MINIMAL="${BUILD_MINIMAL:-no}"
# Desktop environment (if building desktop)
FULL_DESKTOP="gnome"
DESKTOP_ENVIRONMENT="gnome"
# Image type
IMAGE_TYPE="stable"
# Compress output
COMPRESS_OUTPUTIMAGE="${COMPRESS_OUTPUTIMAGE:-sha,img.xz}"
LINUX_DEFCONFIG="s6.cfg"
PACKAGE_LIST_AML="\
libva2 libva-dev libva-drm2 libva-x11-2 \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libdbus-1-dev libical-dev libreadline-dev python3-docutils libsystemd-dev \
libavcodec-dev libavformat-dev libavutil-dev libglib2.0-dev libdrm-dev \
gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-libav v4l-utils"
# # ==============================================================================
# # Section 3: Load U-Boot Configuration (2023) from include/
# # ==============================================================================
# declare -a uboot_paths=(
# "${AMLBIAN_DIR}/config/boards/include/amlogic_uboot2023.inc"
# "${SRC}/userpatches/config/boards/include/amlogic_uboot2023.
# "${USERPATCHES_PATH}/config/boards/uboot/amlogic_uboot2023.inc"
# "${AMLBIAN_DIR}/config/boards/uboot/amlogic_uboot2023.inc"
# )
# for path in "${uboot_paths[@]}"; do
# if [[ -f "${path}" ]]; then
# display_alert "AMLOGIC TODO: Loading uboot config from" "${path}" "info"
# source "${path}"
# break
# fi
# done
# ==============================================================================
# Section 4: Board Identification
# ==============================================================================
BOARD="s6-bq201"
BOARD_NAME="Amlogic S905D5 BQ201 Reference Board"
BOARDFAMILY="meson-s6"
BOARD_MAINTAINER="Amlogic Armbian Team"
# Boot configuration
#BOOTCONFIG="s6_bq201_debian"
BOOTCONFIG="s6_bq201"
UBOOT_MACHINE="${BOOTCONFIG}"
# Build policy
RELEASE="${RELEASE:-bookworm}"
BUILD_DESKTOP="${BUILD_DESKTOP:-no}"
BUILD_MINIMAL="${BUILD_MINIMAL:-yes}"
FULL_DESKTOP="gnome"
# Hardware configuration
SERIALCON="ttyAML0"
BOOT_LOGO="desktop"
BOOT_FDT_FILE="amlogic/s6_s905d5_bq201_linux.dtb"
ASOUND_STATE="asound.state.amlogic-bq201"
# Chipset info
CHIPSET_NAME="S905D5"
INSTALL_TYPE="EMMC"
# Initramfs modules
MODULES_INITRD="mesons6-bq201-initrd"
# Work name for logging
WORK_BOARD="S905D5-BQ201"
KERNEL_DEVICETREE="s6_s905d5_bq201_linux.dtb"
# wifi config
WIFI_MODE="w2l"
WIFI_COMM="yes"
MACHINE_EXTRA_RRECOMMENDS+=" aml-wifi-w2l"
DISTRO_FEATURES+=" aml-wifi-w2l"
BT_MODE="w2l"
BT_HCIATTACH="yes"
BT_BLUEZ="yes"
MEDIA_DECODER_SUPPORTED_FORMATS="${MEDIA_DECODER_SUPPORTED_FORMATS} AVS3 H266"
MEDIA_ENCODER_HW_CONFIG="VC9000E HCODEC_JPEG"
TDK_VERSION="v3.8/dev/S905D5"
PLATFORM_TDK_VERSION="v3.18.0"
MEDIA_FEATURES="libversenc-prebuilt"
AUTOLOGIN="${AUTOLOGIN:-yes}"
# ==============================================================================
# Section 5: Board-Specific U-Boot Functions
# ==============================================================================
# Smarter/faster/better to-spi writer
function write_uboot_platform_mtd__s6_bq201() {
declare -a extra_opts_flashcp=("--verbose")
echo "Writing U-Boot to SPI flash /dev/mtd0 using flashcp... ${extra_opts_flashcp}" >&2
if flashcp -h 2>/dev/null | grep -q -e '--partition'; then
echo "Confirmed flashcp supports --partition" >&2
extra_opts_flashcp+=("--partition")
else
echo "flashcp does not support --partition, will write full blocks" >&2
fi
flashcp "${extra_opts_flashcp[@]}" "${1}/u-boot-spi.bin" /dev/mtd0
}
# Board-specific FIP post-processing
function post_uboot_custom_postprocess__s6_bq201() {
display_alert "AMLOGIC TODO: s6-bq201 Signing u-boot FIP" "${BOARD}" "info"
# AMLOGIC TODO: Implement FIP signing for BQ201
# uboot_s6_postprocess "${SRC}"/cache/sources/amlogic-boot-fip/mesons6-bq201 s6
}
# Board-specific extra U-Boot config options
function post_config_uboot_target__s6_bq201_extra_configs() {
display_alert "AMLOGIC TODO: post_config_uboot_target for s6-bq201" "${BOARD}" "info"
# AMLOGIC TODO: Add BQ201-specific U-Boot config options
return 0
}
# ==============================================================================
# Section 6: Board-Specific Packaging
# ==============================================================================
function custom_image_packaging__s6_bq201() {
display_alert "AMLOGIC TODO: Starting custom image packaging for s6-bq201" "${BOARD}" "info"
# Call common implementation
custom_image_packaging__amlbian
}
function post_image_creation__s6_bq201_custom_packaging() {
display_alert "AMLOGIC TODO: Post image creation hook for s6-bq201" "${BOARD}" "info"
custom_image_packaging__s6_bq201
}
# ==============================================================================
# Section 7: Enable AMLBIAN Extension
# ==============================================================================
ENABLE_EXTENSIONS="amlogic-overlay"
MODS=(amlogic_snd_codec_t9015 amlogic_snd_codec_tl1 amlogic-realtek rfcomm)
# ==============================================================================
# Section 8: Board-Specific Notes
# ==============================================================================
# To enable the SPI NOR, the -spi .dtb is required, because eMMC shares a pin with SPI on the REF board.
# To use SPI:
# fdtfile=amlogic/s6_s905d5_bq201_linux-spinor.dtb in armbianEnv.txt and reboot, then run armbian-install
# After deploying to SPI-NOR/MTD, return back to the normal DTB, otherwise eMMC speed is impaired.
tweaks_platform() {
echo "tweaks_platform"
# audio server settings
if [ -f $ROOTFS_TEMP/etc/pulse/default.pa ]; then
echo 'load-module module-alsa-source device=hw:AMLAUGESOUND,3' | tee -a $ROOTFS_TEMP/etc/pulse/default.pa
sed -i "s/#set-default-source input/set-default-source alsa_input.hw_AMLAUGESOUND_3/" $ROOTFS_TEMP/etc/pulse/default.pa
elif [ -f $ROOTFS_TEMP/usr/share/pipewire/pipewire.conf ]; then
[ -d $ROOTFS_TEMP/etc/pipewire ] || mkdir -p $ROOTFS_TEMP/etc/pipewire
cp $ROOTFS_TEMP/usr/share/pipewire/pipewire.conf $ROOTFS_TEMP/etc/pipewire
cat <<-EOF >> $ROOTFS_TEMP/etc/pipewire/pipewire.conf
context.objects = [
# Configure properties in the system.
{ factory = adapter
args = {
factory.name = api.alsa.pcm.sink
node.name = "AML-PCM-Sink"
node.description = "alsa-sink"
media.class = "Audio/Sink"
api.alsa.path = "hw:AMLAUGESOUND,2"
audio.format = "S16LE"
audio.rate = 48000
audio.channels = 2
audio.position = "FL,FR"
}
}
{ factory = adapter
args = {
factory.name = api.alsa.pcm.sink
node.name = "AML-HDMI-Sink"
node.description = "hdmi-audio"
media.class = "Audio/Sink"
api.alsa.path = "hw:AMLAUGESOUND,4"
audio.format = "S16LE"
audio.rate = 48000
audio.channels = 2
audio.position = "FL,FR"
}
}
{ factory = adapter
args = {
factory.name = api.alsa.pcm.source
node.name = "AML-PCM-Source"
node.description = "alsa-source"
media.class = "Audio/Source"
api.alsa.path = "hw:AMLAUGESOUND,3"
audio.format = "S16LE"
audio.rate = 48000
audio.channels = 2
audio.position = "FL,FR"
}
}
]
EOF
fi
}
# ==============================================================================
# End of s6-bq201-6.12-bookworm-gnome.conf
# ==============================================================================