Skip to content

Conversation

chainsx
Copy link
Member

@chainsx chainsx commented Jul 21, 2025

Description

add community support for MediaTek Filogic device (BananaPi R4 Router)

Device info: https://docs.banana-pi.org/en/BPI-R4/BananaPi_BPI-R4

These u-boot patches are from: https://github.com/openwrt/openwrt/tree/main/package/boot/uboot-mediatek/patches

The kernel is from: https://github.com/openwrt/openwrt/tree/main/target/linux/mediatek/patches-6.12

How Has This Been Tested?

  • Successfully compiled without errors.
  • The system can start up successfully.
  • mPCIE
  • USB 3.0
  • GbE *4
  • PWM fan
  • SFP *2

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@chainsx chainsx requested review from a team and igorpecovnik as code owners July 21, 2025 07:25
Copy link
Contributor

coderabbitai bot commented Jul 21, 2025

Walkthrough

This change introduces support for the Banana Pi R4 board and the Filogic family in the build system. It adds a new board configuration file for Banana Pi R4, specifying hardware details, kernel targets, boot configuration, and a post-family tweak for firmware placement. A comprehensive Linux kernel configuration for MediaTek Filogic ARM64 SoCs is included, enabling a wide range of hardware, networking, filesystem, and security features. Additionally, a new family configuration file sets up build dependencies, kernel and bootloader sources, and custom functions for U-Boot post-processing and platform-specific bootloader image assembly.

Estimated code review effort

3 (30–60 minutes)

Suggested labels

Ready to merge, 08, Needs review, size/large, Hardware, Patches, BSP

Suggested reviewers

  • rpardini
  • krachlatte
  • EvilOlaf
  • igorpecovnik
  • catalinii
  • SuperKali
  • Tonymac32
  • TheSnowfield
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added size/large PR with 250 lines or more 08 Milestone: Third quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... BSP Board Support Packages labels Jul 21, 2025
@coderabbitai coderabbitai bot added the Ready to merge Reviewed, tested and ready for merge label Jul 21, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
config/boards/bananapir4.csc (1)

12-18: Consider adding error checking for firmware blob files.

The function correctly implements firmware deployment but could be more robust with error checking.

Consider adding existence checks for the source firmware files:

function post_family_tweaks__bpi-r4() {
	display_alert "Applying eth blobs"
	
	mkdir -p "$SDCARD/lib/firmware/mediatek/mt7988"
+	
+	# Check if firmware files exist before copying
+	if [[ ! -f "$SRC/packages/blobs/filogic/firmware/mediatek/mt7988/mt7988_wo_0.bin" ]]; then
+		exit_with_error "Missing firmware file: mt7988_wo_0.bin"
+	fi
+	if [[ ! -f "$SRC/packages/blobs/filogic/firmware/mediatek/mt7988/mt7988_wo_1.bin" ]]; then
+		exit_with_error "Missing firmware file: mt7988_wo_1.bin"
+	fi
+	
	cp -v "$SRC/packages/blobs/filogic/firmware/mediatek/mt7988/mt7988_wo_0.bin" "$SDCARD/lib/firmware/mediatek/mt7988/mt7988_wo_0.bin"
	cp -v "$SRC/packages/blobs/filogic/firmware/mediatek/mt7988/mt7988_wo_1.bin" "$SDCARD/lib/firmware/mediatek/mt7988/mt7988_wo_1.bin"
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1d89b0e and 737a62c.

⛔ Files ignored due to path filters (47)
  • packages/blobs/filogic/firmware/mediatek/mt7988/mt7988_wo_0.bin is excluded by !**/*.bin
  • packages/blobs/filogic/firmware/mediatek/mt7988/mt7988_wo_1.bin is excluded by !**/*.bin
  • patch/u-boot/u-boot-filogic/100-02-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-03-mtd-mtk-snand-add-support-for-SPL.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-04-env-add-support-for-generic-MTD-device.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-05-mtd-add-a-new-mtd-device-type-for-NMBM.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-06-mtd-add-core-facility-code-of-NMBM.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-07-mtd-nmbm-add-support-for-mtd.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-08-common-board_r-add-support-to-initialize-NMBM-after-.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-09-cmd-add-nmbm-command.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-10-cmd-mtd-add-markbad-subcommand-for-NMBM-testing.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-12-mtd-mtk-snand-add-NMBM-support-for-SPL.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-17-common-spl-spl_nand-enable-CONFIG_SYS_NAND_U_BOOT_OF.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-21-mtd-spi-nor-add-more-flash-ids.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-22-mtd-spi-nand-backport-from-upstream-kernel.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-25-cmd-ubi-allow-creating-volume-with-all-free-spaces.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-26-env-ubi-add-support-to-create-environment-volume-if-.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-27-mtd-ubi-add-support-for-UBI-end-of-filesystem-marker.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/100-29-board-mediatek-wire-up-NMBM-support.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/101-01-mtd-spinand-add-support-for-FORESEE-F35SQA002G.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/101-02-mtd-spinand-add-support-for-FORESEE-F35SQA001G.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/101-03-mtd-spinand-fix-support-for-FORESEE.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/103-04-mt7988-enable-pstore.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/105-configs-add-usefull-stuff-to-mt7988-rfb.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/120-use-xz-instead-of-lzma.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/130-fix-mkimage-host-build.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/160-net-phy-add-support-for-Airoha-ethernet-PHY-driver.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/170-cmd-bootmenu-permit-to-select-bootmenu-entry-with.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/200-cmd-add-imsz-and-imszb.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/211-cmd-bootmenu-custom-title.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/220-cmd-env-readmem.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/230-cmd-add-pstore-check.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/250-fix-mmc-erase-timeout.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/305-mt7988-generic-reset-button-ignore-env.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/310-mt7988-select-rootdisk.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/341-mtd-spinand-Support-dosilicon.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/342-mtd-spinand-Support-fmsh.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/343-mtd-spinand-gsto-Add-code.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/450-add-bpi-r4.patch is excluded by !patch/**
  • patch/u-boot/u-boot-filogic/500-add-distro-boot-support.patch is excluded by !patch/**
📒 Files selected for processing (3)
  • config/boards/bananapir4.csc (1 hunks)
  • config/kernel/linux-filogic-current.config (1 hunks)
  • config/sources/families/filogic.conf (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: EvilOlaf
PR: armbian/build#8328
File: lib/functions/compilation/patch/drivers_network.sh:542-545
Timestamp: 2025-06-24T10:08:40.313Z
Learning: In the Armbian build system, when a PR removes build support for a specific kernel version, version check issues for that removed version become practically irrelevant even if they appear incorrect in isolation. Context about which kernel versions are being deprecated/removed is important for understanding the impact of version-related code changes.
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.
Learnt from: pyavitz
PR: armbian/build#8361
File: config/kernel/linux-sunxi64-edge.config:594-597
Timestamp: 2025-07-06T16:27:45.349Z
Learning: In Armbian sunxi64-edge kernel configurations, PCI/PCIe support may be enabled for future-proofing purposes to support upcoming Allwinner SoCs like the T536 that include PCIe Gen2 interfaces, even if current primary targets like H616 lack PCIe controllers. This forward-looking approach prepares the configuration for next-generation hardware in the same SoC family.
Learnt from: rpardini
PR: armbian/build#8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.
Learnt from: pyavitz
PR: armbian/build#8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.125Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.
Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.
Learnt from: EvilOlaf
PR: armbian/build#8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.
Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-06-16T03:24:00.458Z
Learning: In Armbian board configuration files (.csc), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features.
Learnt from: Grippy98
PR: armbian/build#8152
File: lib/functions/configuration/interactive.sh:209-266
Timestamp: 2025-05-05T12:35:07.143Z
Learning: For the interactive kernel selection in Armbian, KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION are parsed from family.conf but deliberately not set as environment variables to avoid potential interference with other parts of the build system.
Learnt from: libiunc
PR: armbian/build#8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-03-31T12:57:13.880Z
Learning: For StarFive2 platform kernel configurations, maintain alignment with vendor-provided configurations rather than modifying security settings like SECCOMP. This ensures hardware compatibility as intended by the manufacturer.
Learnt from: The-going
PR: armbian/build#8147
File: config/sources/families/include/sunxi64_common.inc:38-39
Timestamp: 2025-04-30T16:16:47.150Z
Learning: The Armbian build system references Linux kernel versions in the form "tag:v6.14.4" in the KERNELBRANCH variable, even when point release tags might not be directly visible in the upstream repository in the same form.
config/boards/bananapir4.csc (10)

Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-06-16T03:24:00.458Z
Learning: In Armbian board configuration files (.csc), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features.

Learnt from: pyavitz
PR: #8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.125Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.

Learnt from: pyavitz
PR: #8361
File: config/kernel/linux-sunxi64-edge.config:594-597
Timestamp: 2025-07-06T16:27:45.349Z
Learning: In Armbian sunxi64-edge kernel configurations, PCI/PCIe support may be enabled for future-proofing purposes to support upcoming Allwinner SoCs like the T536 that include PCIe Gen2 interfaces, even if current primary targets like H616 lack PCIe controllers. This forward-looking approach prepares the configuration for next-generation hardware in the same SoC family.

Learnt from: EvilOlaf
PR: #8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.

Learnt from: djurny
PR: #8272
File: config/bootscripts/boot-mvebu.cmd:182-186
Timestamp: 2025-06-04T23:45:38.860Z
Learning: In config/bootscripts/boot-mvebu.cmd, the fdtfile variable is mandatory for booting and is pre-set by U-Boot, but can be overridden via armbianEnv.txt. If fdtfile is empty, the subsequent device tree file search logic will eventually fail and trigger the critical error "Cannot find DT!" with proper error handling.

Learnt from: rpardini
PR: #8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-07-21T04:12:02.407Z
Learning: In the Armbian build system, for recurring maintenance tasks like kernel version bumping, TODO comments should use generic version formats (e.g., "MAJOR.MINOR-rc1") rather than specific version numbers (e.g., "6.17-rc1") to avoid the need for frequent comment updates that would create unnecessary maintenance overhead.

Learnt from: EvilOlaf
PR: #8298
File: extensions/https_proxy.sh:1-9
Timestamp: 2025-06-14T05:53:10.627Z
Learning: Armbian build framework extensions are NOT designed to run standalone but are called by the supervisor. The framework provides environment variables like USERPATCHES_PATH and SDCARD, and commands are executed with protection via run_host_command_logged and chroot_sdcard functions that use bash -e -o pipefail.

Learnt from: rpardini
PR: #8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.

Learnt from: EvilOlaf
PR: #8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

config/sources/families/filogic.conf (14)

Learnt from: pyavitz
PR: #8388
File: config/boards/kickpik2b.conf:1-14
Timestamp: 2025-07-17T04:12:33.125Z
Learning: In the Armbian build system, board configuration files (*.conf) follow a project standard of not including shebang lines, even though they contain bash code and are sourced by the build system. This is an established Armbian convention that individual contributors are expected to follow, and changes to this standard would require broader project maintainer approval.

Learnt from: EvilOlaf
PR: #8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.

Learnt from: EvilOlaf
PR: #8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

Learnt from: djurny
PR: #8272
File: config/bootscripts/boot-mvebu.cmd:182-186
Timestamp: 2025-06-04T23:45:38.860Z
Learning: In config/bootscripts/boot-mvebu.cmd, the fdtfile variable is mandatory for booting and is pre-set by U-Boot, but can be overridden via armbianEnv.txt. If fdtfile is empty, the subsequent device tree file search logic will eventually fail and trigger the critical error "Cannot find DT!" with proper error handling.

Learnt from: rpardini
PR: #8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:76-86
Timestamp: 2025-03-31T22:20:48.475Z
Learning: For the Armbian build project, maintaining consistency with existing patches across U-Boot versions (such as between 2025.01 and 2025.04) is prioritized over refactoring individual patches for code improvements.

Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-06-16T03:24:00.458Z
Learning: In Armbian board configuration files (.csc), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features.

Learnt from: djurny
PR: #8287
File: config/bootscripts/boot-sunxi.cmd:38-44
Timestamp: 2025-06-12T21:14:36.024Z
Learning: In config/bootscripts/boot-sunxi.cmd the unconditional "+1" increment in func_align_addr_next (when align_overlap_oboe_avoidance="on") is intentional. It compensates for a known off-by-one error in U-Boot where the end address is calculated as start+size instead of start+size-1, so the extra page prevents overlap. This behavior should not be “optimized away”.

Learnt from: Grippy98
PR: #8152
File: lib/functions/configuration/interactive.sh:209-266
Timestamp: 2025-05-05T12:35:07.143Z
Learning: For the interactive kernel selection in Armbian, KERNEL_MAJOR_MINOR and KERNEL_DESCRIPTION are parsed from family.conf but deliberately not set as environment variables to avoid potential interference with other parts of the build system.

Learnt from: djurny
PR: #8315
File: lib/functions/rootfs/distro-agnostic.sh:54-68
Timestamp: 2025-06-22T00:45:26.182Z
Learning: In Armbian build system, external command dependencies like envsubst are handled by adding the required packages (e.g., gettext for envsubst) to host_dependencies in adaptative_prepare_host_dependencies function in lib/functions/host/prepare-host.sh, rather than checking command availability at runtime.

Learnt from: EvilOlaf
PR: #8298
File: extensions/https_proxy.sh:1-9
Timestamp: 2025-06-14T05:53:10.627Z
Learning: Armbian build framework extensions are NOT designed to run standalone but are called by the supervisor. The framework provides environment variables like USERPATCHES_PATH and SDCARD, and commands are executed with protection via run_host_command_logged and chroot_sdcard functions that use bash -e -o pipefail.

Learnt from: rpardini
PR: #8044
File: patch/u-boot/v2025.04/cmd-fileenv-read-string-from-file-into-env.patch:73-75
Timestamp: 2025-03-31T22:20:41.849Z
Learning: When porting patches between U-Boot versions (like from 2025.01 to 2025.04), rpardini prefers to maintain patches as-is rather than introducing refactoring changes, even when potential improvements are identified. This approach prioritizes consistency and reduces the risk of introducing new issues.

Learnt from: djurny
PR: #8166
File: config/bootscripts/boot-mvebu.cmd:38-50
Timestamp: 2025-05-07T20:49:40.969Z
Learning: The 4KB (0x1000) boundary used for device tree size calculations in U-Boot scripts is specific to how the fdt resize command works internally and should remain hardcoded rather than being tied to adjustable alignment variables.

Learnt from: djurny
PR: #8287
File: config/bootscripts/boot-sunxi.cmd:148-161
Timestamp: 2025-06-12T21:03:39.686Z
Learning: In Armbian U-Boot bootscripts, the ${cpu} environment variable is always pre-set by U-Boot (or defaults to a valid value), so additional guards against it being unset are unnecessary.

Learnt from: Grippy98
PR: #8202
File: config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh:2-3
Timestamp: 2025-05-16T15:34:34.672Z
Learning: The shell scripts in the Armbian build system's desktop configuration files, such as config/desktop/trixie/environments/gnome/armbian/create_desktop_package.sh, rely on environment variables like $SRC and $destination that are expected to be set externally before the script is executed.

config/kernel/linux-filogic-current.config (8)

Learnt from: lanefu
PR: #8377
File: config/kernel/linux-uefi-arm64-cloud.config:165-170
Timestamp: 2025-07-19T00:03:42.955Z
Learning: CONFIG_NETKIT was introduced in Linux kernel 4.14.330 (November 2023) and enables BPF-programmable network devices that can operate in Layer 3 or Layer 2 mode. It's a valid configuration option in modern kernels including 6.12.

Learnt from: lanefu
PR: #8377
File: config/kernel/linux-uefi-arm64-cloud.config:165-170
Timestamp: 2025-07-19T00:03:42.955Z
Learning: CONFIG_NETKIT is a valid kernel configuration option in Linux kernel 6.12 and later versions, despite not being present in earlier versions like 6.9/6.10-rc.

Learnt from: libiunc
PR: #8033
File: config/kernel/linux-starfive2-vendor.config:43-43
Timestamp: 2025-03-31T12:57:13.880Z
Learning: For StarFive2 platform kernel configurations, maintain alignment with vendor-provided configurations rather than modifying security settings like SECCOMP. This ensures hardware compatibility as intended by the manufacturer.

Learnt from: pyavitz
PR: #8361
File: config/kernel/linux-sunxi64-edge.config:594-597
Timestamp: 2025-07-06T16:27:45.349Z
Learning: In Armbian sunxi64-edge kernel configurations, PCI/PCIe support may be enabled for future-proofing purposes to support upcoming Allwinner SoCs like the T536 that include PCIe Gen2 interfaces, even if current primary targets like H616 lack PCIe controllers. This forward-looking approach prepares the configuration for next-generation hardware in the same SoC family.

Learnt from: EvilOlaf
PR: armbian/build#0
File: :0-0
Timestamp: 2025-06-16T03:24:00.458Z
Learning: In Armbian board configuration files (.csc), the standard pattern is to have only one line as a comment describing the board hardware specifications. This single-line description typically includes the SoC model, core count, RAM options, and key features like connectivity options, storage interfaces, and special features.

Learnt from: EvilOlaf
PR: #8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:42:09.086Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, KERNELSOURCE is explicitly declared when using unofficial or 3rd party kernel repositories (like the "dev" branch using https://github.com/apritzel/linux), but can be omitted when using the standard mainline kernel (like the "edge" branch) since it will fall back to the default mainline source.

Learnt from: EvilOlaf
PR: #8330
File: config/sources/families/sun55iw3.conf:32-36
Timestamp: 2025-06-25T03:40:52.109Z
Learning: In Armbian build system configuration files like config/sources/families/*.conf, when KERNELSOURCE is not explicitly declared in a case branch, the system falls back to a default KERNELSOURCE value, so missing KERNELSOURCE declarations are not critical issues.

Learnt from: pyavitz
PR: #8383
File: config/kernel/linux-sunxi64-edge.config:57-64
Timestamp: 2025-07-15T21:09:23.252Z
Learning: In Linux kernel configuration, when CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y is set, the ondemand governor is implicitly enabled by default, making the explicit CONFIG_CPU_FREQ_GOV_ONDEMAND=y line redundant. The make menuconfig tool automatically removes such redundant lines. This behavior applies to CPU frequency governor configurations in general - setting a default governor automatically enables that governor.

🔇 Additional comments (13)
config/boards/bananapir4.csc (2)

1-1: Header comment follows Armbian conventions.

The single-line hardware description correctly includes SoC model, core specifications, RAM options, and key connectivity features as per Armbian standards.


2-10: Board configuration variables are correctly set.

All variables are appropriately configured for the MediaTek MT7988a platform. The kernel command line includes comprehensive parameters for console, logging, and cgroups that align with the kernel configuration features.

config/sources/families/filogic.conf (5)

1-22: Family configuration variables are correctly set.

The global configuration properly defines ARM64 architecture, MediaTek-specific ATF source, U-Boot version, and GPT partition table suitable for the Filogic platform.


23-27: Host dependencies function follows Armbian conventions.

The function correctly adds required build tools for bootloader compilation, following the established pattern for adding host dependencies.


29-36: U-Boot post-processing function correctly implements FIP blob creation.

The function properly handles MediaTek FIP blob assembly using fiptool, combining ARM Trusted Firmware and U-Boot binaries as required for the platform.


38-48: Verified kernel source repository and branch accessibility

The linux-6.12.35 branch exists in https://github.com/chainsx/linux-filogic.git, and the configuration correctly declares KERNELSOURCE, KERNELBRANCH, KERNEL_MAJOR_MINOR, KERNELPATCHDIR, and LINUXCONFIG for the current branch. No further changes needed.


52-63: Bootloader writing function – file paths verified

  • packages/blobs/filogic/gpt is present (17408 bytes)
  • ARM Trusted Firmware bl2.img is expected in $SRC/cache/.../release/bl2.img (external to the repo)

No code changes required. Paths and offsets look correct; please proceed with hardware/integration tests to confirm GPT integrity.

config/kernel/linux-filogic-current.config (6)

1-98: Basic kernel configuration appropriate for MediaTek ARM64 platform.

The configuration correctly enables MediaTek architecture support, sets appropriate CPU count (4 cores), and configures essential kernel features like BPF, cgroups, and namespaces.


94-106: Power management configuration is well-configured.

CPU frequency scaling with multiple governors and MediaTek-specific drivers are properly enabled for optimal power management on the platform.


128-389: Comprehensive networking configuration suitable for router platform.

The extensive networking features including netfilter, nftables, bridging, VLAN filtering, and MediaTek-specific drivers are well-configured for the BananaPi R4 router use case.


277-532: MediaTek hardware support appropriately configured.

MTD/NAND support, thermal drivers, GPIO/PWM/SPI/I2C peripherals, and PCIe Gen3 support are properly enabled for the MT7988a SoC platform.


536-588: Excellent filesystem support for router platform.

Comprehensive support for traditional filesystems (ext4, XFS), modern filesystems (Btrfs, F2FS), flash-specific filesystems (JFFS2, UBIFS), and network filesystems provides excellent flexibility.


589-643: Security and debugging configuration appropriately balanced.

Security hardening features, cryptographic acceleration, and debugging capabilities are well-configured for a development-friendly yet secure router platform.

@igorpecovnik igorpecovnik merged commit 2576cd1 into armbian:main Jul 26, 2025
1 check passed
@igorpecovnik
Copy link
Member

Something is not right: https://paste.armbian.com/seruponiso

@chainsx
Copy link
Member Author

chainsx commented Aug 6, 2025

Something is not right: https://paste.armbian.com/seruponiso

OK, I will fix it as soon as possible.

@chainsx chainsx deleted the filogic branch August 6, 2025 09:13
@chainsx chainsx mentioned this pull request Aug 6, 2025
6 tasks
@leggewie
Copy link
Collaborator

leggewie commented Aug 7, 2025

There's a knowledgeable and active tester for this board in the forum. Happy to see some momentum building for this board.

@chainsx
Copy link
Member Author

chainsx commented Aug 7, 2025

There's a knowledgeable and active tester for this board in the forum. Happy to see some momentum building for this board.

This issue has been fixed by this PR:
#8464

@leggewie
Copy link
Collaborator

leggewie commented Aug 7, 2025

There's a knowledgeable and active tester for this board in the forum. Happy to see some momentum building for this board.

This issue has been fixed by this PR: #8464

Yes, one of them as he pointed out as well. He mentioned a lot more, some of them cosmetic. I see it as a chance to polish up this board.

@coderabbitai coderabbitai bot mentioned this pull request Aug 20, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
08 Milestone: Third quarter release BSP Board Support Packages Hardware Hardware related like kernel, U-Boot, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/large PR with 250 lines or more
Development

Successfully merging this pull request may close these issues.

4 participants