Skip to content

Gateway GZ80x: Add rtl8723ds bluetooth support #8351

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

Merged
merged 5 commits into from
Jul 4, 2025

Conversation

pyavitz
Copy link
Collaborator

@pyavitz pyavitz commented Jul 3, 2025

Add bluetooth support to the DTS and $board.conf, as well as the needed firmware
Enable CONFIG_RTL8723DS=m in the meson64 defconfig(s)

root@gateway-gz80x:~# dmesg | grep hci0
[   15.543929] Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000d lmp_ver=08 lmp_subver=8723
[   15.550293] Bluetooth: hci0: RTL: rom_version status=0 version=2
[   15.552956] Bluetooth: hci0: RTL: loading rtl_bt/rtl8723ds_fw.bin
[   15.565000] Bluetooth: hci0: RTL: loading rtl_bt/rtl8723ds_config.bin
[   15.600302] Bluetooth: hci0: RTL: cfg_sz 47, total sz 33139
[   16.219493] Bluetooth: hci0: RTL: fw version 0xaa7a8cb2
root@gateway-gz80x:~# rfkill
ID TYPE      DEVICE      SOFT      HARD
 0 wlan      phy0   unblocked unblocked
 1 bluetooth hci0   unblocked unblocked
root@gateway-gz80x:~# bluetoothctl
hci0 new_settings: powered bondable ssp br/edr le secure-conn 
Agent registered
[CHG] Controller A4:E8:8D:4C:73:B1 Pairable: yes
[bluetoothctl]> show
Controller A4:E8:8D:4C:73:B1 (public)
	Manufacturer: 0x005d (93)
	Version: 0x07 (7)
	Name: gateway-gz80x
	Alias: gateway-gz80x
	Class: 0x00400000 (4194304)
	Powered: yes
	PowerState: on
	Discoverable: no
	DiscoverableTimeout: 0x000000b4 (180)
	Pairable: yes
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	UUID: SIM Access                (0000112d-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v1D6Bp0246d0552
	Discovering: no
	Roles: central
	Roles: peripheral
Advertising Features:
	ActiveInstances: 0x00 (0)
	SupportedInstances: 0x05 (5)
	SupportedIncludes: tx-power
	SupportedIncludes: appearance
	SupportedIncludes: local-name
	SupportedCapabilities.MaxAdvLen: 0x1f (31)
	SupportedCapabilities.MaxScnRspLen: 0x1f (31)
[bluetoothctl]> exit
root@gateway-gz80x:~# lsmod
Module                  Size  Used by
rfcomm                 73728  2
algif_hash             12288  1
algif_skcipher         12288  1
af_alg                 20480  6 algif_hash,algif_skcipher
bnep                   28672  2
sunrpc                278528  1
8723ds               1331200  0
hci_uart              143360  0
btqca                  24576  1 hci_uart
btrtl                  28672  1 hci_uart
btintel                53248  1 hci_uart
btbcm                  20480  1 hci_uart
bluetooth             663552  30 btrtl,btqca,btintel,hci_uart,btbcm,bnep,rfcomm
ge2d                   16384  0
cfg80211              385024  1 8723ds
videobuf2_dma_contig    20480  1 ge2d
ecdh_generic           12288  2 bluetooth
v4l2_mem2mem           24576  1 ge2d
rfkill                 24576  5 bluetooth,cfg80211
ecc                    32768  1 ecdh_generic
videobuf2_memops       16384  1 videobuf2_dma_contig
videobuf2_v4l2         20480  2 v4l2_mem2mem,ge2d
polyval_ce             12288  0
videodev              221184  3 videobuf2_v4l2,v4l2_mem2mem,ge2d
polyval_generic        12288  1 polyval_ce
videobuf2_common       49152  5 videobuf2_dma_contig,videobuf2_v4l2,v4l2_mem2mem,ge2d,videobuf2_memops
mc                     53248  4 videodev,videobuf2_v4l2,videobuf2_common,v4l2_mem2mem
meson_rng              12288  0
scpi_hwmon             12288  0
sg                     28672  0
zram                   28672  1
binfmt_misc            20480  1
efi_pstore             12288  0
autofs4                45056  2
uas                    24576  0
dwmac_generic          12288  0
realtek                36864  1
meson_gxbb_wdt         12288  0
axg_audio              45056  1
reset_meson_audio_arb    12288  0
sclk_div               12288  1 axg_audio
clk_phase              12288  1 axg_audio
dwmac_meson8b          12288  0
nvmem_meson_efuse      12288  0

Blacklist meson_nand, it loads the mmc-pwrseq twice and produces pinctrl errors.

[    9.860451] meson-axg-pinctrl ff634000.bus:pinctrl@480: pin BOOT_0 already requested by ffe07000.mmc; cannot claim for ffe07800.nand-controller
[    9.867791] meson-axg-pinctrl ff634000.bus:pinctrl@480: error -EINVAL: pin-11 (ffe07800.nand-controller)
[    9.870272] systemd[1]: Reached target usb-gadget.target - Hardware activated USB gadget.
[    9.877181] meson-axg-pinctrl ff634000.bus:pinctrl@480: error -EINVAL: could not request pin 11 (BOOT_0) from group emmc_nand_d0 on device pinctrl-meson
[    9.898837] meson-nand ffe07800.nand-controller: Error applying setting, reverse things back

pyavitz added 4 commits July 3, 2025 16:26
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
It loads the mmc-pwrseq twice and produces pinctrl errors.

[    9.860451] meson-axg-pinctrl ff634000.bus:pinctrl@480: pin BOOT_0 already requested by ffe07000.mmc; cannot claim for ffe07800.nand-controller
[    9.867791] meson-axg-pinctrl ff634000.bus:pinctrl@480: error -EINVAL: pin-11 (ffe07800.nand-controller)
[    9.870272] systemd[1]: Reached target usb-gadget.target - Hardware activated USB gadget.
[    9.877181] meson-axg-pinctrl ff634000.bus:pinctrl@480: error -EINVAL: could not request pin 11 (BOOT_0) from group emmc_nand_d0 on device pinctrl-meson
[    9.898837] meson-nand ffe07800.nand-controller: Error applying setting, reverse things back

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
Copy link
Contributor

coderabbitai bot commented Jul 3, 2025

Walkthrough

The Gateway GZ80x board configuration was updated with a blacklist for kernel modules (rtw88_8723d, rtw88_8723ds, and meson_nand) and additional board packages (rfkill, bluetooth, bluez, and bluez-tools). A new function was added to conditionally install Bluetooth firmware files with an informational alert. The existing udev rule installation function's alert message was modified for consistency. Additionally, the linux-meson64 and linux-meson64-edge kernel configurations were updated to include the CONFIG_RTL8723DS=m option, enabling the Realtek RTL8723DS wireless driver as a loadable module.

Suggested labels

Ready to merge, 05, Needs review, Hardware, Patches, BSP

Suggested reviewers

  • brentr
  • igorpecovnik

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 816fa45 and fcdea88.

📒 Files selected for processing (2)
  • config/kernel/linux-meson64-current.config (1 hunks)
  • config/kernel/linux-meson64-edge.config (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • config/kernel/linux-meson64-current.config
  • config/kernel/linux-meson64-edge.config
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Check kernel security options
  • GitHub Check: Shell script analysis
✨ 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 auto-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/medium PR with more then 50 and less then 250 lines 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 3, 2025
@coderabbitai coderabbitai bot requested a review from brentr July 3, 2025 22:14
@coderabbitai coderabbitai bot added 05 Milestone: Second quarter release Ready to merge Reviewed, tested and ready for merge labels Jul 3, 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/gateway-gz80x.conf (1)

17-23: Improve path quoting and error handling.

The firmware installation function is functionally correct but could benefit from better practices:

  1. Inconsistent quoting of the source path variable
  2. Missing error handling for the copy operation

Apply this diff to improve path quoting and add basic error handling:

 function post_family_tweaks_bsp__gateway_gz80x_firmware() {
-	if [[ -d "$SRC/packages/bsp/gateway-gz80x/rtl_bt" ]]; then
+	if [[ -d "${SRC}/packages/bsp/gateway-gz80x/rtl_bt" ]]; then
 		mkdir -p "${destination}"/lib/firmware/updates/rtl_bt
 		display_alert "$BOARD" "Installing bluetooth firmware" "info"
-		cp -fr $SRC/packages/bsp/gateway-gz80x/rtl_bt/* "${destination}"/lib/firmware/updates/rtl_bt/
+		cp -fr "${SRC}"/packages/bsp/gateway-gz80x/rtl_bt/* "${destination}"/lib/firmware/updates/rtl_bt/ || {
+			display_alert "$BOARD" "Failed to install bluetooth firmware" "err"
+			return 1
+		}
 	fi
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d6eaf2d and 816fa45.

⛔ Files ignored due to path filters (9)
  • packages/bsp/gateway-gz80x/rtl_bt/rtl8723d_config.bin is excluded by !**/*.bin
  • packages/bsp/gateway-gz80x/rtl_bt/rtl8723d_config_1000000_noflow.bin is excluded by !**/*.bin
  • packages/bsp/gateway-gz80x/rtl_bt/rtl8723d_fw.bin is excluded by !**/*.bin
  • packages/bsp/gateway-gz80x/rtl_bt/rtl8723ds_config.bin is excluded by !**/*.bin
  • packages/bsp/gateway-gz80x/rtl_bt/rtl8723ds_fw.bin is excluded by !**/*.bin
  • patch/kernel/archive/meson64-6.12/dt/meson-axg-amper-gateway-am-gz80x.dts is excluded by !patch/**
  • patch/kernel/archive/meson64-6.12/dt/meson-axg-amper-gateway-gz80x.dtsi is excluded by !patch/**
  • patch/kernel/archive/meson64-6.15/dt/meson-axg-amper-gateway-am-gz80x.dts is excluded by !patch/**
  • patch/kernel/archive/meson64-6.15/dt/meson-axg-amper-gateway-gz80x.dtsi is excluded by !patch/**
📒 Files selected for processing (1)
  • config/boards/gateway-gz80x.conf (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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: 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.
config/boards/gateway-gz80x.conf (7)
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: 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: 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.
Learnt from: djurny
PR: armbian/build#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: 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: 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.
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Shell script analysis
  • GitHub Check: Check kernel security options
🔇 Additional comments (3)
config/boards/gateway-gz80x.conf (3)

14-14: LGTM! Module blacklisting addresses pinctrl conflicts.

The blacklisting of rtw88_8723d, rtw88_8723ds, and meson_nand modules correctly addresses the pin control conflicts described in the PR objectives, preventing the MMC power sequence driver from loading twice and avoiding BOOT_0 pin conflicts.


15-15: LGTM! Bluetooth packages added for rtl8723ds support.

The addition of rfkill, bluetooth, bluez, and bluez-tools packages properly supports the Bluetooth functionality being added to the Gateway GZ80x platform.


27-27: LGTM! Improved alert message consistency.

The change from "Install zwave udev rule" to "Installing zwave udev rule" improves consistency with the present tense used in the new firmware function's alert message.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
@github-actions github-actions bot removed the Ready to merge Reviewed, tested and ready for merge label Jul 3, 2025
Copy link
Member

@EvilOlaf EvilOlaf left a comment

Choose a reason for hiding this comment

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

lgtm

@pyavitz pyavitz merged commit 5da43c1 into armbian:main Jul 4, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
05 Milestone: Second quarter release 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, ... size/medium PR with more then 50 and less then 250 lines
Development

Successfully merging this pull request may close these issues.

2 participants