Skip to content

mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly - #25393

Draft
georgemoussalem wants to merge 1 commit into
openwrt:mainfrom
georgemoussalem:ipq50xx-ath11k-mpd
Draft

georgemoussalem wants to merge 1 commit into
openwrt:mainfrom
georgemoussalem:ipq50xx-ath11k-mpd

Conversation

@georgemoussalem

Copy link
Copy Markdown
Contributor

Add native multiPD support to the ath11k driver and refactor QCN6122 support accordingly.

The IPQ5018 platform is a multiPD platform and the current ath11k driver supports standalone IPQ5018 WiFi only. However, IPQ5018 boards come with up to two optional SoC-specific QCN6122 WiFi companion chips for 5G/6G WiFi.

IPQ5018 implements the multi-PD architecture as follows:

                 +-----------------------------+
                 |     Q6 Remote Processor     |
                 |            RootPD           |
                 +--------------+--------------+
                                |
                                |
                                |
          +---------------------+---------------------+
          |                     |                     |
    +-----v-----+         +-----v-----+         +-----v-----+
    |  UserPD1  |         |  UserPD2  |         |  UserPD3  |
    |  IPQ5018  |         | QCN6122 #1|         | QCN6122 #2|
    |  (Radio)  |         |  (Radio)  |         |  (Radio)  |
    +-----------+         +-----------+         +-----------+

The rootPD is responsible for managing the lifecycle of the UserPD and shared resources and providing SSR notifiers. There are different firmware blobs that include either the rootPD and userPD binaries for IPQ5018-only which auto-spawns the userPD for IPQ5018 WiFi, or for IPQ5018 and QCN6122 for which the userPDs for each radio must be spawned by the ath11k driver.

Upstream direction is to have the WCSS rproc driver load the Q6 firmware and have the ath11k driver load the M3 firmware just like ath12k loads the IU firmware.

In addition, new firmware blobs are expected to be published in a single MBN format which contains all MDT segments. In the meantime, to facilitate a migration from MDT split firmware files to MBN, add new symlinks for both Q6 and M3 firmware files, pointing .mbn to the existing respective .mdt files.

Ath11k now looks for specific hardware interrupts and SMEM entries to spawn and stop a user PD from the root PD which is loaded by the rproc driver. The driver then looks up the user PD ID from SMEM which the firmware sets upon rproc boot. When these aren't defined in the devicetree, it continues normal AHB bringup and initialization.

As user PD loading is now handled by the ath11k wifi driver, drop support for the downstream MPD rproc driver which wasn't accepted upstream and other related patches.

@openwrt openwrt Bot added core packages pull request/issue for core (in-tree) packages kernel pull request/issue with Linux kernel related changes target/qualcommax pull request/issue for qualcommax target labels Sep 25, 2026
@openwrt

openwrt Bot commented Sep 25, 2026

Copy link
Copy Markdown

Formality Check: Suggestions Available

We checked this pull request against the contribution guidelines. Here is what needs your attention:

⚠️ STYLISTIC WARNINGS & SUGGESTIONS

Package Release Audit:

  • ⚠️ Content changed in these packages, but without a PKG_RELEASE or version bump:

    • package/firmware/ath11k-firmware
    • package/firmware/linux-firmware
    • package/kernel/mac80211

    Increment PKG_RELEASE by 1 (or bump PKG_VERSION/PKG_SOURCE_DATE and reset PKG_RELEASE to 1) so users receive the update.

Do not increment release for minor changes. Cosmetic edits (e.g., typos in comments, copyright updates, formatting/whitespace), changing the package maintainer (PKG_MAINTAINER), or updating source download info (PKG_SOURCE_URL / PKG_HASH) do not require incrementing PKG_RELEASE.


Something broken? Consider reporting an issue.
Running version 26ec621 deployed on 2026-09-20 09:46:35 CEST

@georgemoussalem

Copy link
Copy Markdown
Contributor Author

ath11k patches sent upstream for review for official support for MPD architecture and QCN6122 support:
Link: https://lore.kernel.org/linux-wireless/[email protected]/

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 4eab0a4 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the mac80211: ath11k: scope doesn't cover most of the commit. It also drops the qualcommax MPD rproc/SCM/mdt_loader kernel patches, adds a new qcom_scm patch, rewrites 17 ipq5018 DTS files and adds firmware-package symlinks. Split it into per-area commits (qualcommax:, ath11k-firmware:/linux-firmware:, mac80211:) or widen the subject.

Generated by Claude Code

Comment on lines +187 to +189
+ init_completion(&ab_ahb->userpd_spawned);
+ init_completion(&ab_ahb->userpd_ready);
+ init_completion(&ab_ahb->userpd_stopped);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The completions are initialised only after the spawn/ready/stop-ack IRQs are requested, so an early IRQ calls complete() on an uninitialised completion. The same happens if a later platform_get_irq_byname_optional() returns -ENXIO: the caller ignores that error, userpd_id is already set, and ath11k_ahb_power_up() then waits on these completions. Move the three init_completion() calls before ath11k_ahb_init_userpd() and the IRQ loop.


Generated by Claude Code

Comment on lines +219 to +221
+ if (ret && ret != -ENXIO)
+ return dev_err_probe(&ab->pdev->dev, ret,
+ "failed to configure userpd interrupts\n");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This error return runs after ath11k_ahb_init_userpd() has already put ab_ahb in g_rproc_info->userpd[] and bumped num_userpd, but it skips ath11k_ahb_cleanup_userpd(). The probe then jumps to err_ce_free, not err_rproc_deconfigure. That leaves a dangling userpd[] pointer, and num_userpd never reaches 0, so the notifier and the rproc reference are never released. On this path, take the lock and run the same cleanup as err_cleanup_userpd.


Generated by Claude Code

Comment on lines +225 to +226
err_unreg_notifier:
ath11k_ahb_unregister_rproc_notifier();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All user PDs share the root-PD SSR notifier. If a second device (for example QCN6122) fails M3 load or root-PD boot, this path unregisters the notifier while other user PDs are still registered. Only the rproc put/free below is guarded by num_userpd. Put the unregister under the same !g_rproc_info->num_userpd check.


Generated by Claude Code

+
+ mem_phys = res.start;
+ mem_size = resource_size(&res);
+ mem_region = devm_memremap(ab->dev, mem_phys, mem_size, MEMREMAP_WC);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

devm_memremap() returns an ERR_PTR on failure, and that value goes unchecked into qcom_mdt_load_no_init(). Add an IS_ERR(mem_region) check that returns PTR_ERR(), then refresh the patch with make package/mac80211/refresh.


Generated by Claude Code

Comment on lines +90 to +91
+ case M3_DUMP_REGION_TYPE:
+ ret = ath11k_qmi_reserved_memory_to_resource(ab, M3_DUMP_REGION_TYPE, &res);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This replaces the dropped 931 patch, which read qcom,m3-dump-addr. ipq6010-wax610-base.dtsi:208 still sets that property and is not converted. As a result, the WAX610 silently loses its M3 dump segment. Convert that board to an m3-dump memory-region, or keep the property as a fallback.


Generated by Claude Code

Comment on lines +41 to +44
+ ret = qcom_scm_pas_set_wifi_power_mode(MPD_WCNSS_PAS_ID, true);
+ if (ret) {
+ ath11k_err(ab, "failed to power up wifi: %d\n", ret);
+ return ret;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The 0192 SCM patch says "Not all Trusted Execution Environment (QSEE) images support this call" and returns -EOPNOTSUPP in that case. Here any error aborts the IPQ5018 user-PD boot. Is it intentional that such TZ images cannot bring up the IPQ5018 radio, or should -EOPNOTSUPP be tolerated here?


Generated by Claude Code

EXPORT_SYMBOL_GPL(qcom_scm_pas_supported);

+/**
+ * qcom_scm_pas_set_wifi_power_mode() - Power on/off internal wifi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: trailing whitespace.

Suggested change
+ * qcom_scm_pas_set_wifi_power_mode() - Power on/off internal wifi
+ * qcom_scm_pas_set_wifi_power_mode() - Power on/off internal wifi

Generated by Claude Code

+ * Multi-UserPD Architecture:
+ *
+ * One Q6 RootPD (managed by separate rproc driver) supports multiple
+ * ath12k UserPDs. Each UserPD represents a WiFi radio instance.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: this is the ath11k driver.

Suggested change
+ * ath12k UserPDs. Each UserPD represents a WiFi radio instance.
+ * ath11k UserPDs. Each UserPD represents a WiFi radio instance.

Generated by Claude Code

qcom,userpd-subsys-name = "q6v5_wcss_userpd2";
qcom,rproc = <&q6v5_wcss>;
qcom,ath11k-calibration-variant = "CMCC-PZ-L8";
qcom,ath11k-fw-memory-mode = <1>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: every other QCN6122 board that dropped qcom,bdf-addr/qcom,m3-dump-addr gained memory-region/memory-region-names on &wifi1, but this one did not. The node is still disabled, but enabling it would fall back to the hardcoded BDF address with no M3 dump. Is this omission intentional?


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

fixed, thanks


Generated by Claude Code

CONFIG_PWM_IPQ=y
CONFIG_QCA83XX_PHY=y
CONFIG_QCOM_APM=y
CONFIG_QCOM_Q6V5_MPD=y

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: the MPD rproc driver patches are gone, so # CONFIG_QCOM_Q6V5_MPD is not set in config-6.18:449 now refers to a symbol that no longer exists. Drop that line as well.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

fixed, thanks


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 38d4e93 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the mac80211: ath11k: scope covers only part of this commit. It also changes qualcommax kernel patches, config, and 17 ipq5018 DTS files, plus the firmware packages. Split it by area (qualcommax:, firmware, mac80211:) or widen the subject to match.

Generated by Claude Code

* available for users. To prevent OOM when using LuCI or other softwares,
* disable Wi-Fi related peripherals at the moment.
*/
&q6_region {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: stray leading space before the node reference.

Suggested change
&q6_region {
&q6_region {

Generated by Claude Code

Comment on lines +299 to +302
/* type: */ 0x1 /* PCIe0 */
/* length: */ 2
/* UPD ID: */ 2
/* reset GPIO: */ 15>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This board passes length = 2 and leaves out the two reserved words. Every other ipq5018 board uses length = 4 with the trailing 0 0, and the v1 layout table in the wcss_sec bootargs patch also lists length 0x04. Is the shorter form intentional for the B3000 firmware? If not, use the same shape as the siblings.

Suggested change
/* type: */ 0x1 /* PCIe0 */
/* length: */ 2
/* UPD ID: */ 2
/* reset GPIO: */ 15>;
/* type: */ 0x1 /* PCIe0 */
/* length: */ 4
/* UPD ID: */ 2
/* reset GPIO: */ 15
/* reserved: */ 0 0>;

Generated by Claude Code

@georgemoussalem georgemoussalem Sep 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is by design as the b3000's bootloader pre-allocates 8 bytes for SMEM item 507 only which is used to pass the boot-args from the host to the firmware and this can't be adjusted in runtime.
The firmware accepts a TLV of which the first two bytes of the value really matter: UPD ID and reset-gpio.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 0d843a2 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the mac80211: ath11k: scope still covers only part of this commit. It also touches qualcommax kernel patches, config and ipq5018 DTS files (now including gl-x2000), plus the firmware packages. Split it by area or widen the subject.

Generated by Claude Code

Add native multiPD support to the ath11k driver and refactor QCN6122
support accordingly.

The IPQ5018 platform is a multiPD platform and the current ath11k driver
supports standalone IPQ5018 WiFi only. However, IPQ5018 boards come with
up to two optional SoC-specific QCN6122 WiFi companion chips for 5G/6G
WiFi.

IPQ5018 implements the multi-PD architecture as follows:

                     +-----------------------------+
                     |     Q6 Remote Processor     |
                     |            RootPD           |
                     +--------------+--------------+
                                    |
                                    |
                                    |
              +---------------------+---------------------+
              |                     |                     |
        +-----v-----+         +-----v-----+         +-----v-----+
        |  UserPD1  |         |  UserPD2  |         |  UserPD3  |
        |  IPQ5018  |         | QCN6122 openwrt#1|         | QCN6122 openwrt#2|
        |  (Radio)  |         |  (Radio)  |         |  (Radio)  |
        +-----------+         +-----------+         +-----------+

The rootPD is responsible for managing the lifecycle of the UserPD and
shared resources and providing SSR notifiers. There are different
firmware blobs that include either the rootPD and userPD binaries for
IPQ5018-only which auto-spawns the userPD for IPQ5018 WiFi, or for
IPQ5018 and QCN6122 for which the userPDs for each radio must be spawned
by the ath11k driver.

Upstream direction is to have the WCSS rproc driver load the Q6 firmware
and have the ath11k driver load the M3 firmware just like ath12k loads
the IU firmware.

In addition, new firmware blobs are expected to be published in a single
MBN format which contains all MDT segments. In the meantime, to
facilitate a migration from MDT split firmware files to MBN, add new
symlinks for both Q6 and M3 firmware files, pointing .mbn to the
existing respective .mdt files.

Ath11k now looks for specific hardware interrupts and SMEM entries to
spawn and stop a user PD from the root PD which is loaded by the rproc
driver. The driver then looks up the user PD ID from SMEM which the
firmware sets upon rproc boot. When these aren't defined in the
devicetree, it continues normal AHB bringup and initialization.

As user PD loading is now handled by the ath11k wifi driver, drop
support for the downstream MPD rproc driver which wasn't accepted
upstream and other related patches.

Signed-off-by: George Moussalem <[email protected]>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 0135e61 "mac80211: ath11k: add multiPD support and refactor QCN6122 accordingly": the mac80211: ath11k: scope still covers only part of the commit. It also changes qualcommax kernel patches, config, ipq5018 DTS files (now including mr80x-v2 and re700x) and the firmware packages. Split the commit by area or widen the subject.

Generated by Claude Code

/*
* QCN6122 5 GHz. Uses the canonical OpenWrt PD2 memory layout
* (bdf 0x4d100000 / m3-dump 0x4df00000) and the stock-derived
* (bdf 0x4d200000 / m3-dump 0x4df00000) and the stock-derived

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: this node no longer sets qcom,bdf-addr. 0x4d200000 is now the base of the q6-region memory region, so describe it that way.

Suggested change
* (bdf 0x4d200000 / m3-dump 0x4df00000) and the stock-derived
* (q6-region 0x4d200000 / m3-dump 0x4df00000) and the stock-derived

Generated by Claude Code

@georgemoussalem
georgemoussalem marked this pull request as draft October 8, 2026 13:41
kuncy7 added a commit to kuncy7/openwrt-nss-edma that referenced this pull request Oct 10, 2026
…5393

George Moussalem's PR carries our PR #13 series (911-916, 920-925)
rebased on backports 7.2: the root PD rproc notifier, the m3 firmware,
the bdf/m3-dump addresses from the DTS, the userpd interrupts, SMEM
entries and power sequencing, and the QCN6122 hw params, hal regs, ring
masks and hif ops on top of main's single-PD support. Taken as the PR's
patches/ath11k/ delta against its base (aa77344..0135e61); 912,
913, 915, 916, 920-923, 950, 951 are byte-identical to what we carried,
911 differs by the dev_err_probe() form, 914 by whitespace.

Signed-off-by: Stanislaw Pal <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
kuncy7 added a commit to kuncy7/openwrt-nss-edma that referenced this pull request Oct 14, 2026
OpenWrt main of 2026-10-14 (0eb0873), 168 commits past the base of
this branch. Kernel 6.18.55 and the mac80211 package are unchanged.

Resolved:

- ipq8074-rt-ax89x.dts: main's qca-etype tag for the QCA8337, which
  main now carries itself.
- image/ipq50xx.mk: the TP-Link EX511 v2 of this branch and main's
  Wallys DR5018S, both.

Adapted to this tree:

- 0955/0956, main's qca-etype tagger for qca8k. Protocol value 36
  instead of 33, which is the qca-8021q tagger here (34 and 35 are the
  rtl8365mb-8021q and an8855-8021q ones). qca-etype becomes a case of
  the change_tag_protocol that the qca-8021q tagger brings already,
  instead of a second definition; the HEADER_CTRL write is kept as
  qca8k_set_hdr_etype(), and Ethernet management runs in both header
  modes.
- 0959 (an8855-8021q): enum context after the qca-etype lines.

Left out:

- 0818-remoteproc-qcom_q6v5_mpd-skip-MSA-lock-for-internal-radio: it
  patches qcom_q6v5_mpd.c, which this tree does not build; its IPQ5018
  multi-PD runs on qcom_q6v5_wcss_sec (openwrt#25393). Whether the
  Wallys DR5018S needs the same on that driver is untested.

Signed-off-by: Stanislaw Pal <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@luixo

luixo commented Nov 7, 2026

Copy link
Copy Markdown

@georgemoussalem Is there any plan to get it back to "ready to merge"?
I encountered bugs with MPD loading path while working on a firmware for Xiaomi AX3000, but this PR will supersede it so I do not plan to open fixes for those bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core packages pull request/issue for core (in-tree) packages kernel pull request/issue with Linux kernel related changes target/qualcommax pull request/issue for qualcommax target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants