-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
BananaPi BPI-M4-Zero: Bluetooth, RTC and General H616 Fixups
#8361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These two patches break RTC and don't allow for Bluetooth to come up properly. Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Allows for the wifi-pwrseq and bluetooth to come up properly. Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Prevent dmesg spam: brcmf_set_channel set chanspec xxxxxxx fail Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Fails on Edge builds. Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
WalkthroughA new function Suggested labels
Suggested reviewers
Warning Review ran into problems🔥 ProblemsGitHub checks timed out after 90 seconds. Some checks were still in progress when the timeout was reached. Consider increasing the 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
✨ Finishing Touches🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (7)
config/kernel/linux-sunxi64-edge.config (7)
330-341
:IP_NF_FILTER
/IP_NF_SECURITY
built-in – watch kernel image sizePerfectly fine functionally, just note the cumulative +≈200 KiB that each built-in networking feature adds.
560-563
: Ceph + NFC compiled-in: heavyweight for an SBC imageBoth subsystems pull in sizable code & crypto deps (≈1.5 MiB). If they aren’t part of the default Armbian user story, consider keeping them as modules to keep RAM-constrained boards happy.
638-644
: All ZRAM back-ends enabled – harmless but redundantOnly one backend is selectable at runtime; carrying five compressors just inflates
.text
. You can trim to the two you realistically use (LZ4 & ZSTD?).
1479-1494
: Extra regulator drivers built-in – OK, but watch boot-time probing noiseThese parts aren’t present on BPI-M4-Zero; they’ll probe-fail at boot, adding ~40 ms. If boot time is critical, leave them as modules.
1533-1533
:MEDIA_SUPPORT=y
turns the kernel into a “multimedia kitchen sink”Adds ~4 MiB. If v4l2 isn’t required before modules can load, keep it as
m
.
2436-2440
:REMOTEPROC{, _CDEV}=y
without a remote MCUAdds dead code paths unless you plan to expose ARISC or RISC-V co-processors later. Safe, but consider
m
.
2691-2692
:SRF04
ultrasonic sensor driver built-in is oddUnlikely to exist on the board; propose reverting to module to keep base image lean.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
patch/kernel/archive/sunxi-6.12/series.armbian
is excluded by!patch/**
patch/kernel/archive/sunxi-6.12/series.conf
is excluded by!patch/**
patch/kernel/archive/sunxi-6.15/series.armbian
is excluded by!patch/**
patch/kernel/archive/sunxi-6.15/series.conf
is excluded by!patch/**
📒 Files selected for processing (3)
config/boards/bananapim4zero.conf
(1 hunks)config/kernel/linux-sunxi64-current.config
(38 hunks)config/kernel/linux-sunxi64-edge.config
(38 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: 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: 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#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: 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.
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: djurny
PR: armbian/build#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”.
config/boards/bananapim4zero.conf (2)
Learnt from: Grippy98
PR: armbian/build#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.
Learnt from: djurny
PR: armbian/build#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.
config/kernel/linux-sunxi64-current.config (9)
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: 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: 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#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: 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: 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: djurny
PR: armbian/build#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: djurny
PR: armbian/build#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.
config/kernel/linux-sunxi64-edge.config (6)
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: 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: 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: djurny
PR: armbian/build#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: djurny
PR: armbian/build#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.
🔇 Additional comments (20)
config/kernel/linux-sunxi64-current.config (9)
70-71
: LGTM: Virtualization support enabled.Enabling KVM virtualization support as built-in is appropriate for this platform and aligns with modern ARM64 capabilities.
83-85
: Advanced partitioning support enabled.Good addition of advanced partitioning options including BSD disklabel and command line partition support, which enhances flexibility for various storage configurations.
166-341
: Comprehensive netfilter and networking stack built-in.The extensive networking and firewall configuration changes from modules to built-in are appropriate for embedded systems where network functionality is critical during early boot.
515-547
: Bluetooth subsystem properly configured.Enabling Bluetooth core and various drivers as built-in, including MTK USB and NXPUART support, aligns well with the PR objective to improve Bluetooth functionality on the BananaPi M4 Zero.
594-597
: PCI/PCIe host support enabled.Adding PCI subsystem support with Cadence and DesignWare platform host controllers is appropriate for this ARM64 platform.
638-644
: ZRAM compression backends enabled.Good comprehensive enabling of ZRAM compression algorithms and memory tracking, which will benefit memory-constrained embedded systems.
1126-1143
: Comprehensive Sunxi pin control drivers enabled.Enabling all Allwinner/Sunxi pin control drivers as built-in ensures proper GPIO and pin multiplexing support across different SoC variants in the family.
2301-2301
: AC100 RTC driver enabled as built-in.This change aligns with the PR objective to fix RTC functionality. The AC100 is commonly used with Allwinner SoCs for RTC functionality.
2514-2515
: AXP and Sunxi ADC drivers enabled.Enabling AXP20X/288 and Sun4I/20I GPADC as built-in provides proper power management and analog-to-digital conversion support for the platform.
Also applies to: 2536-2537
config/kernel/linux-sunxi64-edge.config (11)
83-85
: 👍 Advanced partition support is a sensible default
The switch toCONFIG_PARTITION_ADVANCED
,CONFIG_BSD_DISKLABEL
andCONFIG_CMDLINE_PARTITION
makes sense for board-agnostic images and won’t bloat the kernel.
91-91
: Verify the new default ZSWAP pool (ZBUD
) fits your memory/CPU trade-off
ZBUD
halves memory waste but compresses slower than the previousZS…
pools. On 4-core H616 boards the compression CPU cost may show up under memory pressure. Double-check with stress-ng or similar before shipping.
166-187
: Netfilter core now built-in – good for early-boot networkingEmbedding
NF_CONNTRACK
/NF_TABLES
avoids init-order races seen with early userspace (e.g.iptables-restore
in initramfs). No objections.
515-547
: Bluetooth stack moved toy
; make sure firmware is in the initramfsWith BT core and the MediaTek/NXP UART drivers now built-in the HCI devices appear early, but firmware blobs must be available before root-fs hand-off. Confirm
armbian-next-initrd
packs*.hcd
for BCM4345C0; otherwise BT will silently fail.
554-557
: RFKill as built-in is 👍Early-boot radio toggling is required for regulatory db load – good call.
652-655
:NVME_MULTIPATH=y
+DUMMY_IRQ=m
+ENCLOSURE_SERVICES=m
Fine for generic kernels; no functional issues spotted.
738-739
:CONFIG_NETKIT=y
appears experimental
netkit
is still marked “staging” upstream; if you don’t ship userspace that consumes it, better keep it asm
to avoid exposing an un-hardened interface.
1126-1143
: Large batch of sunxi pinctrl drivers set toy
Makes sense for a single edge kernel supporting many boards; compile-time impact only.
2370-2372
: UIO core now built-in – 👍 for user-space driversNo concerns.
2710-2714
: Good call making PWM core + Sunxi drivers built-inRequired very early by panel back-light and eMMC regulators; LGTM.
2763-2764
:XFS_QUOTA=y
– fineMatches the existing
XFS_FS=m
; no issues.
CONFIG_VIRTUALIZATION=y | ||
CONFIG_KVM=y | ||
CONFIG_KPROBES=y | ||
CONFIG_JUMP_LABEL=y | ||
CONFIG_MODULES=y | ||
CONFIG_MODULE_FORCE_LOAD=y | ||
CONFIG_MODULE_UNLOAD=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-consider CONFIG_MODULE_FORCE_LOAD=y
; it weakens module version safety
Forcing a load even on vermagic / version mismatches can mask ABI breakage and crash the kernel at boot. Nothing in this PR appears to justify relaxing that guard. Strongly advise reverting to n
(default) unless you have a very specific, documented use-case.
-CONFIG_MODULE_FORCE_LOAD=y
+# CONFIG_MODULE_FORCE_LOAD is not set
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
CONFIG_VIRTUALIZATION=y | |
CONFIG_KVM=y | |
CONFIG_KPROBES=y | |
CONFIG_JUMP_LABEL=y | |
CONFIG_MODULES=y | |
CONFIG_MODULE_FORCE_LOAD=y | |
CONFIG_MODULE_UNLOAD=y | |
CONFIG_VIRTUALIZATION=y | |
CONFIG_KVM=y | |
CONFIG_KPROBES=y | |
CONFIG_JUMP_LABEL=y | |
CONFIG_MODULES=y | |
# CONFIG_MODULE_FORCE_LOAD is not set | |
CONFIG_MODULE_UNLOAD=y |
🤖 Prompt for AI Agents
In config/kernel/linux-sunxi64-edge.config lines 70 to 76, the
CONFIG_MODULE_FORCE_LOAD option is set to 'y', which disables module version
safety and can cause kernel crashes due to ABI mismatches. To fix this, change
CONFIG_MODULE_FORCE_LOAD from 'y' to 'n' to enforce version checks and maintain
kernel stability unless there is a documented, specific reason to override this
behavior.
Check connection with curl before cloning wireless-regdb. Check for the regulatory.db && regulatory.db.p7s files before adding them the img. Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
I propose that the defconfig(s) need to be re-done either from scratch or a cleaner base. I will re-open or re-submit when I have the time to work on this. |
NOTE: This PR may or may not break RTC functionality on other units.
On the M4-Zero I use the following in the wifi-pwrseq node.
I've noticed others using:
Disable Allwinner H616 RTC support patches:
The two patches break RTC and muddle up Bluetooth.
Defconfigs: General update:
Allows for the wifi-pwrseq and bluetooth to come up properly. Basically set more to
y
instead ofm
and tick on other misc bits.Install upstream wireless-regdb:
Prevent dmesg spam: brcmf_set_channel set chanspec xxxxxxx fail
https://forum.armbian.com/topic/53113-bluetooth-support-missing-for-rev-2/