wifi: rtw89: fw: download firmware with key data for secure boot
authorPing-Ke Shih <pkshih@realtek.com>
Sun, 4 Feb 2024 01:26:27 +0000 (09:26 +0800)
committerKalle Valo <kvalo@kernel.org>
Tue, 6 Feb 2024 18:06:14 +0000 (20:06 +0200)
commit43f8a4dc40a70b3598dd0aae401dddaf63ca0d5b
treeb0fcf8d38912473afdc2f75a1cb79dfa63a516d0
parent12ff5e1cca33b32fae0b183203f5b58a610e137e
wifi: rtw89: fw: download firmware with key data for secure boot

Since firmware header contains multiple secure sections, we need to trim
ignored sections, and then download firmware header with single one secure
section.

For secure boot, when downloading secure section, copy security key data
from MSS poll by key_idx read from efuse. If non-secure boot, no need this
extra copy.

           +---------------------------+ -\
           |      firmware header      |  |
           |                           |  |
           | +-----------------------+ |  | only preserve single one secure
           | | section type/size * N | |  | section
           | | ...                   | |  |
           | +-----------------------+ |  |
           +---------------------------+ -/
           :                           :
           +---------------------------+ -\
           | secure section type (ID:9)|  |
           |                           |  |
      +----|-> [ security key data ]   |  |
      |    +---------------------------+ -/
      |    |MSS Pool for above section |
      |    |  [ security key data 0 ]  |
      +----|- [ security key data 1 ]  |
by key_idx |  [ security key data 2 ]  |
           |  ...                      |
           +---------------------------+

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240204012627.9647-5-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c
drivers/net/wireless/realtek/rtw89/fw.h