Initially, firmware file contains stuff related to WiFi CPU, and normally it contains two firmwares with normal and WoWLAN types. To reduce firmware size, we split debug formatted text into an individual part (*1), and driver can decide to use it optionally. When we want to debug firmware, turn on firmware log via debugfs, and then firmware sends C2H events with log text ID that driver looks up the corresponding format text and print out. Add this by patches 1/8 and 8/2. +===========================================+ <------------------------+ | WiFi CPU multi-firmware header | | +-------------------------------------------+ | | WiFi CPU firmware (normal type *2) --|----------------------+ | +-------------------------------------------+ | | | WiFi CPU firmware (WoWLAN type) | | | +-------------------------------------------+ | | | log formatted text (*1) | | | +===========================================+ | | | | The detail of a Wifi CPU firmware (*2 in above figure) like below. | | The format is also used new hardware component named BB MCU, so we | | need more fields to record the information, and then firmware header | | format v1 is introduced by patches 3/8 and 4/8. | | | | +---------------------------------------+ <---------------------+ | | Header | | +---------------------------------------+ | | Section header 1 | | | Section header 2 | | | Section header 3 | | | ... | | +---------------------------------------+ | | Dynamic header (variable length) | | +---------------------------------------+ | | Data used & pointed by section | | | ... | | +---------------------------------------+ | | In order to move static const tables from driver into firmware file, we | introduce `firmware elements` followed by WiFi CPU multi-firmware. | Since the header of WiFi CPU multi-firmware explicitly points out start | address and length, old driver will still access expected range. | We introduce the infrastructure by patch 6/8. | | +===========================================+ | | WiFi CPU multi-firmware -----------|---------------------------+ | +-------------+ | | padding | +===========================================+ | elm ID 1 | elm size | other header data | +----------+----------+ | | | +-------------------------------------------+ | content (variable length) | | +-------------+ | | padding | +===========================================+ | elm ID 2 | elm size | other header data | +----------+----------+ | | | +-------------------------------------------+ | content (variable length) | | +-----------------------+ | | +===================+ Chin-Yen Lee (2): Wifi: rtw89: recognize log format from firmware file wifi: rtw89: support firmware log with formatted text Ping-Ke Shih (6): wifi: rtw89: introduce v1 format of firmware header wifi: rtw89: add firmware parser for v1 format wifi: rtw89: add firmware suit for BB MCU 0/1 wifi: rtw89: introduce infrastructure of firmware elements wifi: rtw89: add to parse firmware elements of BB and RF tables wifi: rtw89: return failure if needed firmware elements are not recognized drivers/net/wireless/realtek/rtw89/core.c | 8 +- drivers/net/wireless/realtek/rtw89/core.h | 41 +- drivers/net/wireless/realtek/rtw89/debug.c | 14 +- drivers/net/wireless/realtek/rtw89/fw.c | 537 +++++++++++++++++- drivers/net/wireless/realtek/rtw89/fw.h | 121 +++- drivers/net/wireless/realtek/rtw89/mac.c | 3 +- drivers/net/wireless/realtek/rtw89/phy.c | 15 +- drivers/net/wireless/realtek/rtw89/rtw8851b.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852a.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852b.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 1 + 11 files changed, 696 insertions(+), 47 deletions(-) -- 2.25.1