315 lines
10 KiB
Plaintext
315 lines
10 KiB
Plaintext
# mesons6-bq201 Board Configuration
|
|
# Main board configuration file for Amlogic S905D5 BQ201 board
|
|
#
|
|
# This is the entry point for the mesons6-bq201 board in Armbian build
|
|
# All configuration should be done through this file
|
|
#
|
|
# Usage in Armbian build:
|
|
# ./compile.sh BOARD=mesons6-bq201
|
|
#
|
|
# The configuration loads common, kernel, and uboot settings from the amlbian overlay
|
|
|
|
# AMLOGIC TODO: mesons6-bq201 board configuration loading
|
|
display_alert "AMLOGIC TODO: Loading mesons6-bq201 board configuration" "mesons6-bq201" "info"
|
|
|
|
# ==============================================================================
|
|
# Section 1: Load AMLBIAN Overlay Configuration
|
|
# ==============================================================================
|
|
|
|
# Determine the AMLBIAN overlay directory
|
|
# Try multiple paths to handle different loading scenarios
|
|
AMLBIAN_FOUND="no"
|
|
for amlbian_path in \
|
|
"${USERPATCHES_PATH}/.." \
|
|
"${SRC}/userpatches/.." \
|
|
"$(dirname "$(realpath "${BASH_SOURCE[0]}")")/.." \
|
|
"../amlbian"; do
|
|
if [[ -f "${amlbian_path}/lib/function-common.sh" ]]; then
|
|
export AMLBIAN_DIR="${amlbian_path}"
|
|
AMLBIAN_FOUND="yes"
|
|
display_alert "AMLOGIC TODO: Found AMLBIAN overlay at" "${AMLBIAN_DIR}" "info"
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [[ "${AMLBIAN_FOUND}" != "yes" ]]; then
|
|
display_alert "AMLOGIC TODO: AMLBIAN overlay not found" "Using inline configuration" "warn"
|
|
fi
|
|
|
|
# Load configuration from include directory
|
|
declare -a include_configs=(
|
|
"amlogic_common.inc"
|
|
"amlogic_k6.12.inc"
|
|
"amlogic_uboot2023.inc"
|
|
"amlogic-local-sources.inc"
|
|
"amlogic-noninteractive.inc"
|
|
)
|
|
|
|
for config in "${include_configs[@]}"; do
|
|
declare -a config_paths=(
|
|
"${AMLBIAN_DIR}/config/boards/include/${config}"
|
|
"${SRC}/userpatches/config/boards/include/${config}"
|
|
"${USERPATCHES_PATH}/config/boards/include/${config}"
|
|
"${config}"
|
|
)
|
|
|
|
for path in "${config_paths[@]}"; do
|
|
if [[ -f "${path}" ]]; then
|
|
display_alert "AMLOGIC TODO: Loading config from" "${path}" "info"
|
|
source "${path}"
|
|
break
|
|
fi
|
|
done
|
|
done
|
|
|
|
# ==============================================================================
|
|
# Section 2: Board Identification
|
|
# ==============================================================================
|
|
|
|
BOARD="mesons6-bq201"
|
|
BOARD_NAME="Amlogic S905D5 BQ201 Reference Board"
|
|
BOARDFAMILY="meson-s6"
|
|
BOARD_MAINTAINER="Amlogic Armbian Team"
|
|
|
|
# Board description
|
|
BOARD_DESCRIPTION='Amlogic S905D5 BQ201 Reference Board with Kernel 6.12'
|
|
|
|
# ==============================================================================
|
|
# Section 3: Kernel Configuration
|
|
# ==============================================================================
|
|
|
|
# Kernel version
|
|
KERNEL_VERSION="6.12"
|
|
KERNEL_MAJOR_MINOR="6.12"
|
|
KERNEL_VERSION_FULL="6.12.58"
|
|
KERNEL_VER="aml-6.12"
|
|
|
|
# Kernel branch
|
|
KERNELBRANCH="${KERNELBRANCH:-android16-6.12}"
|
|
|
|
# Kernel source - use local if available
|
|
if [[ "${USE_LOCAL_SOURCES}" == "yes" ]]; then
|
|
KERNELSOURCE=""
|
|
KERNELBRANCH="local"
|
|
KERNELPATCHDIR="none"
|
|
display_alert "AMLOGIC TODO: Using local kernel source" "${LOCAL_KERNEL_PATH:-not set}" "info"
|
|
else
|
|
KERNELSOURCE="https://github.com/amlogic/linux"
|
|
KERNELPATCHDIR="archive/amlogic-${KERNEL_MAJOR_MINOR}"
|
|
display_alert "AMLOGIC TODO: Using remote kernel source" "${KERNELSOURCE}" "info"
|
|
fi
|
|
|
|
# Kernel build configuration
|
|
LINUX_DEFCONFIG="s6_bq201_defconfig"
|
|
LINUX_DEFCONFIG_FALLBACK="s6.cfg"
|
|
KERNEL_DEVICETREE="amlogic/s6_s905d5_bq201_linux.dtb"
|
|
|
|
# Kernel target
|
|
KERNEL_TARGET=" Image dtbs modules"
|
|
|
|
# ==============================================================================
|
|
# Section 4: U-Boot Configuration
|
|
# ==============================================================================
|
|
|
|
# U-Boot version
|
|
UBOOT_VERSION="2023"
|
|
UBOOT_MAJOR="2023"
|
|
|
|
# U-Boot branch
|
|
BOOTBRANCH="${BOOTBRANCH:-amlogic-dev-2023}"
|
|
|
|
# U-Boot source - use local if available
|
|
if [[ "${USE_LOCAL_SOURCES}" == "yes" ]]; then
|
|
BOOTSOURCE=""
|
|
BOOTBRANCH="local"
|
|
BOOTPATCHDIR="none"
|
|
display_alert "AMLOGIC TODO: Using local uboot source" "${LOCAL_UBOOT_PATH:-not set}" "info"
|
|
else
|
|
BOOTSOURCE="https://github.com/amlogic/u-boot"
|
|
BOOTPATCHDIR="v2023"
|
|
display_alert "AMLOGIC TODO: Using remote uboot source" "${BOOTSOURCE}" "info"
|
|
fi
|
|
|
|
# U-Boot build configuration
|
|
BOOTCONFIG="s6_bq201_debian"
|
|
UBOOT_MACHINE="${BOOTCONFIG}"
|
|
|
|
# U-Boot target map
|
|
UBOOT_TARGET_MAP="u-boot-dtb.img;;u-boot.bin.sd.bin.signed:u-boot.bin u-boot.bin.signed u-boot.bin.usb.signed:u-boot-usb.bin"
|
|
|
|
# U-Boot FIP configuration
|
|
UBOOT_FIP="yes"
|
|
UBOOT_FIP_ARGS="--atf-branch=v2.5.0 --bl33 --a55-rcode=ignore"
|
|
|
|
# ==============================================================================
|
|
# Section 5: Hardware Configuration
|
|
# ==============================================================================
|
|
|
|
# Serial console
|
|
SERIALCON="ttyAML0"
|
|
|
|
# Boot logo
|
|
BOOT_LOGO="desktop"
|
|
|
|
# Boot FDT file
|
|
BOOT_FDT_FILE="amlogic/s6_s905d5_bq201_linux.dtb"
|
|
|
|
# Audio state file
|
|
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"
|
|
|
|
# ==============================================================================
|
|
# Section 6: Build Configuration
|
|
# ==============================================================================
|
|
|
|
# Release
|
|
RELEASE="${RELEASE:-bookworm}"
|
|
|
|
# Build type
|
|
BUILD_DESKTOP="${BUILD_DESKTOP:-no}"
|
|
BUILD_MINIMAL="${BUILD_MINIMAL:-yes}"
|
|
|
|
# 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}"
|
|
|
|
# ==============================================================================
|
|
# Section 7: Extensions Configuration
|
|
# ==============================================================================
|
|
|
|
# Enable AMLBIAN extension
|
|
ENABLE_EXTENSIONS="${ENABLE_EXTENSIONS:-amlogic-overlay}"
|
|
|
|
# ==============================================================================
|
|
# Section 8: Boot Configuration
|
|
# ==============================================================================
|
|
|
|
# Boot environment
|
|
BOOTENV_FILE="meson64"
|
|
|
|
# Boot distribution
|
|
DISTRO_BOARDCONFIG="bananapipro"
|
|
|
|
# Enable network boot
|
|
ENABLE_NETWORK_BOOT="yes"
|
|
|
|
# Boot scripts
|
|
BOOTSCRIPT='boot-meson.cmd'
|
|
|
|
# ==============================================================================
|
|
# Section 9: Rootfs Configuration
|
|
# ==============================================================================
|
|
|
|
# Rootfs type
|
|
ROOTFS_TYPE="ext4"
|
|
|
|
# Use Armbian native rootfs building
|
|
display_alert "AMLOGIC TODO: Using Armbian native rootfs building" "${BOARD}" "info"
|
|
|
|
# ==============================================================================
|
|
# Section 10: Package Configuration
|
|
# ==============================================================================
|
|
|
|
# Extra packages
|
|
PACKAGE_LIST_BOARD="${PACKAGE_LIST_BOARD:-} \
|
|
linux-firmware \
|
|
amlogic-firmware \
|
|
"
|
|
|
|
# Package remove list
|
|
PACKAGE_LIST_BOARD_REMOVE="${PACKAGE_LIST_BOARD_REMOVE:-} \
|
|
generic-trusted-firmware-arm64 \
|
|
"
|
|
|
|
# ==============================================================================
|
|
# Section 11: Hook Functions
|
|
# ==============================================================================
|
|
|
|
# Smarter/faster/better to-spi writer using flashcp
|
|
write_uboot_platform_mtd__mesons6_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
|
|
post_uboot_custom_postprocess__mesons6_bq201() {
|
|
display_alert "AMLOGIC TODO: mesons6-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
|
|
post_config_uboot_target__mesons6_bq201_extra_configs() {
|
|
display_alert "AMLOGIC TODO: post_config_uboot_target for mesons6-bq201" "${BOARD}" "info"
|
|
# AMLOGIC TODO: Add BQ201-specific U-Boot config options
|
|
return 0
|
|
}
|
|
|
|
# Kernel post-processing
|
|
post_kernel_custom_postprocess__mesons6_bq201() {
|
|
display_alert "AMLOGIC TODO: mesons6-bq201 kernel post-processing" "${BOARD}" "info"
|
|
# AMLOGIC TODO: Add custom kernel post-processing if needed
|
|
return 0
|
|
}
|
|
|
|
# Custom image packaging
|
|
custom_image_packaging__mesons6_bq201() {
|
|
display_alert "AMLOGIC TODO: mesons6-bq201 custom image packaging" "${BOARD}" "info"
|
|
# AMLOGIC TODO: Implement custom image packaging if needed
|
|
return 0
|
|
}
|
|
|
|
# ==============================================================================
|
|
# Section 12: 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.
|
|
|
|
# ==============================================================================
|
|
# Section 13: Display Configuration Summary
|
|
# ==============================================================================
|
|
|
|
function show_amlbian_config_summary() {
|
|
display_alert "AMLIbian mesons6-bq201 Configuration Summary" \
|
|
"========================================" "info"
|
|
display_alert "Board" "${BOARD}" "info"
|
|
display_alert "Board Family" "${BOARDFAMILY}" "info"
|
|
display_alert "Kernel" "${KERNEL_VERSION_FULL} (${KERNELBRANCH})" "info"
|
|
display_alert "U-Boot" "${UBOOT_VERSION} (${BOOTBRANCH})" "info"
|
|
display_alert "Release" "${RELEASE}" "info"
|
|
display_alert "Use Local Sources" "${USE_LOCAL_SOURCES:-yes}" "info"
|
|
display_alert "Local Kernel Path" "${LOCAL_KERNEL_PATH:-not set}" "info"
|
|
display_alert "Local U-Boot Path" "${LOCAL_UBOOT_PATH:-not set}" "info"
|
|
}
|
|
|
|
# Display configuration summary
|
|
show_amlbian_config_summary
|
|
|
|
# ==============================================================================
|
|
# End of mesons6-bq201.conf
|
|
# ============================================================================== |