Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Bluetooth: btmtk: Add MT7928 support
@ 2026-06-23  3:41 Chris Lu
  2026-06-23  3:41 ` [PATCH v4 1/2] Bluetooth: btmtk: Replace magic numbers with WMT packet flag enum Chris Lu
  2026-06-23  3:41 ` [PATCH v4 2/2] Bluetooth: btmtk: Add MT7928 support Chris Lu
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Lu @ 2026-06-23  3:41 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Von Dentz
  Cc: Sean Wang, Will Lee, SS Wu, Steve Lee, linux-bluetooth,
	linux-kernel, linux-mediatek, Chris Lu

Patch 1 refactors existing firmware download code by replacing magic
numbers with a descriptive BTMTK_WMT_PKT_* enum, making the packet
sequencing logic clearer.

Patch 2 implements MT7928 firmware download flow, which requires loading
CBMCU firmware before Bluetooth firmware. The CBMCU firmware uses a
two-phase download sequence: Phase 1 downloads the section containing
global descriptor and signature data, Phase 2 downloads the remaining
firmware sections. After CBMCU firmware completes, the driver continues
to load the Bluetooth firmware following the standard flow.

Tested on MT7928 hardware with successful firmware loading and
Bluetooth functionality verification.

Changes in v4:
- Split into two patches: refactoring and new feature
- Add BTMTK_WMT_PKT_* enum to improve code readability
- Replace magic numbers (0xF0, 0xF1) with descriptive macros
- Define MTK_SEC_CBMCU_DESC macro for section type
- Add MT7928 marketing name comment
- Include firmware filename in error messages
- Add detailed size information in firmware validation errors
- Use BTMTK_WMT_PKT_* enum in CBMCU download function

Changes in v3:
- Add firmware size validation with bounds checking
- Improve error messages with context information
- Add section offset validation for both phases

Changes in v2:
- Simplified enum usage by consolidating status definitions
- Improved code maintainability

Chris Lu (2):
  Bluetooth: btmtk: Replace magic numbers with WMT packet flag enum
  Bluetooth: btmtk: Add MT7928 support

 drivers/bluetooth/btmtk.c | 358 +++++++++++++++++++++++++++++++++++++-
 drivers/bluetooth/btmtk.h |   9 +
 2 files changed, 363 insertions(+), 4 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-23  7:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23  3:41 [PATCH v4 0/2] Bluetooth: btmtk: Add MT7928 support Chris Lu
2026-06-23  3:41 ` [PATCH v4 1/2] Bluetooth: btmtk: Replace magic numbers with WMT packet flag enum Chris Lu
2026-06-23  6:23   ` Bluetooth: btmtk: Add MT7928 support bluez.test.bot
2026-06-23  7:13   ` [PATCH v4 1/2] Bluetooth: btmtk: Replace magic numbers with WMT packet flag enum Paul Menzel
2026-06-23  3:41 ` [PATCH v4 2/2] Bluetooth: btmtk: Add MT7928 support Chris Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox