b43: N-PHY: fix calibrations on rev7+ (BCM43228)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 3 repliesIn review
- v15 patches 6 repliesSuperseded
Changes in v2 from the cover letter
- Dropped the comments the patches added.
- Patch 2: the changelog said the coefficients match wl's; they are close, not equal.
- Patch 4: replaced. v1 waited for the first RC cal run and explained it wrongly: wl stops that run right away too, just sooner. v2 uses wl's delays throughout the cal instead.
- Linked the mmiotrace excerpts from each changelog.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | b43: N-PHY: fix the TX tone sample tabledrivers/ | +5 | 1 reply | |
| 2/5 | b43: N-PHY: fix TX IQ/LO calibrationdrivers/ | +68 | 0 replies | |
| 3/5 | b43: N-PHY: fix rev3+ RSSI calibrationdrivers/ | +3 | 1 reply | |
| 4/5 | b43: N-PHY: use wl's delays in the 2057 RC calibrationdrivers/ | +13 | 0 replies | |
| 5/5 | b43: N-PHY: add the missing override to the rev7 TX_PU commanddrivers/ | +1 | 0 replies |
Reviews trailers per patch
1 of 5 patches has a Reviewed-by or Acked-by.
| Patch | Alessio Ferri |
|---|---|
| 1/5 | R-b |
| 2/5 | |
| 3/5 | |
| 4/5 | |
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH wireless-next v2 0/5] b43: N-PHY: fix calibrations on rev7+ (BCM43228)
On a BCM43228 (14e4:4359, N-PHY rev 16, radio 2057 rev 9) b43 associates but transmits poorly: high retry counts and low rates. Comparing mmiotraces of b43 and the proprietary wl driver (6.30.223.271) on the same card, together with brcmsmac, turned up several bugs in the N-PHY calibration code:
1. The TX tone sample table was loaded as all zeros, so every tone-based calibration ran without a signal.
2. TX IQ/LO calibration: inverted busy poll, reversed final copy, and missing rev7+ cleanup that left TX dead after a cal.
3. RSSI calibration: wrong VCM written on rev7+, wrong distance formula, wrong rounding of negative offsets.
4. 2057 RC calibration: every delay was about twice wl's, so the first run was stopped while it was running and SCAP read 0 instead of 8, detuning the TX low-pass filter.
5. A missing field in the rev7 TX_PU RF override.
The traces, and excerpts of the operations behind each patch next to the same operations from b43, are at:
https://github.com/Luca00casati/b43patch/blob/755c2d8/traces/README.md
Each changelog links its excerpts.
Patches 4 and 5 and the cleanup parts of patch 2 only affect rev7+. Patch 1, the poll and final-copy fixes in patch 2, and the distance/rounding fixes in patch 3 also change code that runs on older N-PHYs (rev3+); I could only test rev 16, so testing on other N-PHY cards would be welcome.
Tested on the BCM43228 only (2.4 GHz, 11g/HT20), on v7.0; the series also applies to wireless-next. With v1, throughput to the internet went from about 5.7/4.1 to 11.1/5.2 Mbit/s down/up, with fewer TX retries. That number is limited by the line and noisy, so take it as a rough indication; wl reaches 21-32 Mbit/s down on the same setup, so there is more to do (PAPD and TX power control on rev7+).
Changelogs refer to wl where the fix was checked against its register writes. If citing the proprietary driver is not acceptable here, I am happy to reword them.
The bugs were found and the fixes drafted with the help of an AI coding assistant (Claude Opus 5.5), working from the mmiotrace diffs between b43 and wl and from brcmsmac. I reviewed and tested every patch on the hardware above.
Changes in v2:
- Dropped the comments the patches added.
- Patch 2: the changelog said the coefficients match wl's; they are close, not equal.
- Patch 4: replaced. v1 waited for the first RC cal run and explained it wrongly: wl stops that run right away too, just sooner. v2 uses wl's delays throughout the cal instead.
- Linked the mmiotrace excerpts from each changelog.
Luca Casati (5):
b43: N-PHY: fix the TX tone sample table
b43: N-PHY: fix TX IQ/LO calibration
b43: N-PHY: fix rev3+ RSSI calibration
b43: N-PHY: use wl's delays in the 2057 RC calibration
b43: N-PHY: add the missing override to the rev7 TX_PU command
drivers/net/wireless/broadcom/b43/phy_n.c | 115 +++++++++++++++++----- 1 file changed, 90 insertions(+), 25 deletions(-)
base-commit: 028ef9c96e96197026887c0f092424679298aae8
Signature · 1 line
2.43.0