# CB400 Board Configuration with Kernel 6.12 and U-Boot 2025 # This file is the entry point for c5-cb400 board building # # Configuration loading order: # 1. amlogic_common.inc - Common Amlogic configuration # 2. amlogic_k6.12.inc - Kernel 6.12 specific configuration # 3. amlogic_uboot2025.inc - U-Boot 2025 specific configuration # 4. Board-specific settings # AMLOGIC TODO: Board configuration loading display_alert "AMLOGIC TODO: Loading c5-cb400 board configuration" "c5-cb400" "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 _uboot2025 load_common_inc _avalon # ============================================================================== # Section 2: Set bookworm gnome setting # ============================================================================== # Release RELEASE="${RELEASE:-bookworm}" # Build type BUILD_DESKTOP="${BUILD_DESKTOP:-yes}" BUILD_MINIMAL="${BUILD_MINIMAL:-no}" # Desktop environment — only set when actually building desktop, otherwise # Armbian validator errors with "DESKTOP_ENVIRONMENT is set, but BUILD_DESKTOP # is not ==yes". Section 4 below may override BUILD_DESKTOP to "no". if [[ "${BUILD_DESKTOP}" == "yes" ]]; then FULL_DESKTOP="gnome" DESKTOP_ENVIRONMENT="gnome" fi # Image type IMAGE_TYPE="stable" # Compress output COMPRESS_OUTPUTIMAGE="${COMPRESS_OUTPUTIMAGE:-sha,img.xz}" LINUX_DEFCONFIG="c5.cfg" BUILD_UNITS=( uboot kernel rootfs modules-load udev npu wifi bt media-modules libion libge2d liblog libencoder dma-allocator gst-aml gst-aml-vendor isp devtool screencapture linux-uapi-headers mediactrlsrc ) PACKAGE_LIST_AML="\ screen libdbus-1-dev libical-dev libreadline-dev python3-docutils libsystemd-dev \ systemd-timesyncd xterm \ gdm3 gnome-session gnome-shell dbus-x11 task-gnome-desktop \ libva2 libva-dev libva-drm2 libva-x11-2 \ tcpdump netcat-openbsd network-manager adbd/bookworm-backports android-libcutils/bookworm-backports \ libgstreamer1.0-dev libgstreamer-plugins-base1.0-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 \ systemd libsystemd-dev" # # ============================================================================== # # 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="c5-cb400" BOARD_NAME="Amlogic A123X CB400 Reference Board" BOARDFAMILY="meson-c5" BOARD_MAINTAINER="Amlogic Armbian Team" # Boot configuration #BOOTCONFIG="c5_cb400_debian" BOOTCONFIG="c5_cb400" 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/c5_a123x_cb400_linux.dtb" ASOUND_STATE="asound.state.amlogic-cb400" # Chipset info CHIPSET_NAME="A123X" INSTALL_TYPE="EMMC" # Initramfs modules MODULES_INITRD="mesonc5-cb400-initrd" # Work name for logging WORK_BOARD="A123X-CB40X" # if [ ${HDMIONLY} = "yes" ];then # KERNEL_DEVICETREE="c5_a123x_cb400_hdmi_linux.dtb" # else # KERNEL_DEVICETREE="c5_a123x_cb400_linux.dtb" # fi KERNEL_DEVICETREE="c5_a123x_cb400_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_ENCODER_HW_CONFIG="TAHOE HCODEC_JPEG" TDK_VERSION="v3.8/dev/A123X" PLATFORM_TDK_VERSION="v4.4.0" MEDIA_FEATURES="libamljpegenc libtahoevenc gst-plugin-venc-jpeg" DISTRO_FEATURES+=" vendor-files vendor-partition bluetooth amlogic-tv tvserver mediactrlsrc" MACHINE_EXTRA_RRECOMMENDS+=" aml-bt-w2 aml-bt-w2l" AUTOLOGIN="${AUTOLOGIN:-yes}" # ============================================================================== # Section 5: Board-Specific U-Boot Functions # ============================================================================== # Smarter/faster/better to-spi writer function write_uboot_platform_mtd__c5_cb400() { 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__c5_cb400() { display_alert "AMLOGIC TODO: c5-cb400 Signing u-boot FIP" "${BOARD}" "info" # AMLOGIC TODO: Implement FIP signing for cb400 # uboot_c5_postprocess "${SRC}"/cache/sources/amlogic-boot-fip/mesonc5-cb400 c5 } # Board-specific extra U-Boot config options function post_config_uboot_target__c5_cb400_extra_configs() { display_alert "AMLOGIC TODO: post_config_uboot_target for c5-cb400" "${BOARD}" "info" # AMLOGIC TODO: Add cb400-specific U-Boot config options return 0 } # ============================================================================== # Section 6: Board-Specific Packaging # ============================================================================== function custom_image_packaging__c5_cb400() { display_alert "AMLOGIC TODO: Starting custom image packaging for c5-cb400" "${BOARD}" "info" # Call common implementation custom_image_packaging__amlbian } function post_image_creation__c5_cb400_custom_packaging() { display_alert "AMLOGIC TODO: Post image creation hook for c5-cb400" "${BOARD}" "info" custom_image_packaging__c5_cb400 } # ============================================================================== # Section 7: Enable AMLBIAN Extension # ============================================================================== ENABLE_EXTENSIONS="amlogic-overlay" MODS=(amlogic_reset amlogic_snd_codec_es8389 amlogic_snd_codec_ad82120b 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/c5_s905d5_cb400_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,1" 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" } } ] context.exec = [ { path = "/usr/bin/pactl" args = "set-default-sink AML-PCM-Sink" } { path = "/usr/bin/pactl" args = "set-default-source AML-PCM-Source" } ] EOF fi } # ============================================================================== # End of c5-cb400-6.12-bookworm-gnome.conf # ==============================================================================