• Ping-Ke Shih's avatar
    wifi: rtw89: add firmware parser for v1 format · 12b1a125
    Ping-Ke Shih authored
    A firmware with v1 format contains many sections to download. Add parser to
    read section type, target address, length, checksum and so on, and then
    download the section to WiFi CPU with proper location.
    
    The additional dynamic header length named dynamic_hdr_len is used to
    skip content of dynamic header containing compiler flags of firmware, which
    can help to determine variant firmware build, but currently rtw89 only
    use single one variant. So, just skip the content.
    
    The layout of a WiFi CPU firmware with v1 format looks like:
    
    +---------------------------------------+
    |      Header (12 words)                |
    +---------------------------------------+
    |      Section header 1 (4 words)       |
    |      Section header 2 (4 words)       |
    |      Section header 3 (4 words)       |
    |      ...                              |
    +---------------------------------------+
    |      Dynamic header (variable length) |
    +---------------------------------------+
    |      Data used & pointed by section   |
    |      ...                              |
    +---------------------------------------+
    Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
    Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20230801021127.15919-5-pkshih@realtek.com
    12b1a125
fw.c 121 KB