• Ping-Ke Shih's avatar
    wifi: rtw89: fw: parse secure section from firmware file · 12ff5e1c
    Ping-Ke Shih authored
    A firmware file can contains more than one section with secure type, so
    use secure information from efuse to choose the one with matched
    cryptography method. Then choose key data from MSS poll (multiple security
    section pool; see below picture) according to key_index from efuse.
    
    Note that the size of MSS pool isn't included in section size defined
    in firmware header, so we also need to parse header of MSS pool to get
    its size as shift to parse next section.
    
    If secure boot isn't supported by current hardware, the first secure
    section will be adopted, and no need additional process to key data.
    
      +---------------------------+
      |      firmware header      |
      |                           |
      | +-----------------------+ |
      | | section type/size * N-|-|-------+
      | | ...                   | |       |
      | +-----------------------+ |       |
      +---------------------------+       |
      :                           :       |
      +---------------------------+ -\    |
      | secure section type (ID:9)|  |    |
      |                           |  | <--+
      |                           |  |
      +---------------------------+ -/
      |MSS Pool for above section |
      |                           |
      |                           |
      +---------------------------+
    Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
    Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
    Link: https://msgid.link/20240204012627.9647-4-pkshih@realtek.com
    12ff5e1c
fw.h 135 KB