Skip to content

t8132: Wi-Fi follows the regulatory country (trivial ccode map) and brcmfmac says which country it runs - #1917

Open
IronsideXXVI wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
IronsideXXVI:j604-t8132-wifi-country
Open

IronsideXXVI wants to merge 2 commits into
aurora-silicon:integration/aurorafrom
IronsideXXVI:j604-t8132-wifi-country

Conversation

@IronsideXXVI

Copy link
Copy Markdown
Contributor

The T8132 laptops' BCM4388 never left its worldwide country default, because the Wi-Fi node lacked brcm,ccode-map-trivial. This series adds the property and makes brcmfmac say which country the firmware runs.

Patch 1: arm64: dts: apple: t8132: Use the trivial country code map for Wi-Fi. Like the chips on every other Apple Silicon machine, the T8132's BCM4388 takes ISO 3166 codes as its own codes, at revision 0. The t8103, t8112, t8122, t600x, t603x and t604x trees already set brcm,ccode-map-trivial; t8132-jxxx.dtsi did not. Without it brcmfmac has no translation for the chip and drops every regulatory hint, whether it comes from the access point's country, iw reg set or wireless-regdom. The firmware therefore stays on its worldwide default. On a J604 (14" MacBook Pro M4), macOS on the same Mac and network runs the access point's country, US.

Patch 2: wifi: brcmfmac: Say which country the firmware runs. brcmfmac registers its own regulatory domain, "99", and keeps it whatever country it then programs into the firmware, so iw reg get shows country 99 for the wiphy on every machine. Whether a hint reached the firmware was only visible at debug level. This patch logs the country and the firmware code and revision at info level when the firmware takes the hint or already has it. It logs once when the driver has no code for the hinted country.

Measured on the J604 (MEASURED 2026-11-14). Our kernel 1.905 carries patch 1, and 1.907 adds patch 2; on 1.907 the log reads brcmfmac: country US set in firmware (US rev 0). Before patch 1 the firmware stayed on the worldwide default.

Checked on top of integration/aurora 7c71d6d:

  • checkpatch --strict: 0/0/0 on both patches
  • brcmfmac builds with W=1 and no warnings (arm64, our J604 kernel config)
  • CHECK_DTBS=y for t8132-j604, -j713 and -j715: the property is in all three DTBs, and the schema output is identical with and without the series (it adds nothing)

Tested on the J604 only. The J713 and J715 share t8132-jxxx.dtsi, so they get the property too, but they have not been run with it.

The BCM4388 on the T8132 laptops takes ISO 3166 country codes as its own
codes (revision 0), as on every other Apple Silicon machine, but its
node lacked brcm,ccode-map-trivial. brcmfmac then has no translation
for the chip and drops every regulatory hint: the country an access
point advertises, iw reg set or wireless-regdom. The firmware stays on
its worldwide default (phy country 99) where macOS on the same Mac runs
the access point's country (US).

Add the property, as the t8103, t8112, t8122, t600x, t603x and t604x
device trees have it.

Assisted-by: LLM
Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
IronsideXXVI added a commit to IronsideXXVI/omarchy-j604 that referenced this pull request Nov 14, 2026
UPSTREAM.md: rows for the three pull requests opened today: the T8132 Wi-Fi
country map and its log line, the T8132 ISP power-down as macOS does it, and
the Apple Silicon CPU profiles in power-profiles-daemon.
brcmfmac registers its own regulatory domain, named "99", and keeps it
whatever country it then programs into the firmware, so "iw reg get"
shows "country 99" for the wiphy on every machine. Whether a country
hint (the access point's country, iw reg set) reached the firmware is
only visible at debug level: the set, the "already set" and the "no
code for it" paths are silent, and only a firmware refusal is logged.

Log the country and the firmware code and revision at info level when
the firmware takes it or already has it, and once when the driver has
no code for the hinted country.

Assisted-by: LLM
Signed-off-by: Dylan Ironside <dylan@dylanironside.io>
@IronsideXXVI

Copy link
Copy Markdown
Contributor Author

The host-tests failure was mine: tools/asahi/brcmf-suspend-tests.py compiles brcmf_cfg80211_update_country() against stubs, and the new log lines use ccreq.ccode, ccreq.rev, brcmf_info() and bphy_info_once(), which the stubs did not have. Patch 2 now adds those stubs (log macros as no-ops, the two struct fields, __le32/le32_to_cpu). The driver change itself is unchanged. run-host-tests.py --only brcmf: 45/45 pass, including all the mutation runs; without the stubs I get the same 7 failures as CI. Force-pushed as d6b2923.

@davishann15-commits

Copy link
Copy Markdown

Tested on a J604 (MacBook Pro 14", M4, Mac16,1; os-fw 26.6.2, system-fw 27.0; aura 1.0.0b13). The kernel was alarm-aurora's pkgrel 38 recipe on integration/aurora 7c71d6d, plus #1543, #1894, #1895, #1917, #1918, #1919 and #1922. It booted on its own J604 tree as an aura-try trial. Userspace: Hyprland 0.57.2, mesa-aurora 26.3.0_devel.202611130318, speakerguardd-v2 1.0.0alpha.1-40.

I tested this PR at 7bba4f4. Its driver and DT hunks are identical to the current d6b2923; only tools/asahi/brcmf-suspend-tests.py changed since. brcm,ccode-map-trivial is in the J604 tree, the log reads brcmfmac: brcmf_cfg80211_update_country: country US set in firmware (US rev 0), and iw reg get reports country US (DFS-FCC). Wi-Fi associated normally. One boot.


Disclosure: an LLM (Claude) ran these tests on my Mac and drafted this. I did the listening and looking, reviewed it, and am responsible for it.

Assisted-by: LLM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants