All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <kvalo@kernel.org>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 8/8] wifi: rtw89: 8922a: set memory heap address for secure firmware
Date: Fri, 1 Sep 2023 14:15:07 +0800	[thread overview]
Message-ID: <20230901061507.34312-9-pkshih@realtek.com> (raw)
In-Reply-To: <20230901061507.34312-1-pkshih@realtek.com>

Secure firmware is protected by public/private key cryptography. To help
firmware self verify integrity, configure a heap address for these
data before downloading firmware.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/fw.c  | 4 ++++
 drivers/net/wireless/realtek/rtw89/reg.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c
index b27d3cb6f1d9..c5dff61c8ebd 100644
--- a/drivers/net/wireless/realtek/rtw89/fw.c
+++ b/drivers/net/wireless/realtek/rtw89/fw.c
@@ -912,6 +912,10 @@ static int rtw89_fw_download_suit(struct rtw89_dev *rtwdev,
 		return ret;
 	}
 
+	if (rtwdev->chip->chip_id == RTL8922A &&
+	    (fw_suit->type == RTW89_FW_NORMAL || fw_suit->type == RTW89_FW_WOWLAN))
+		rtw89_write32(rtwdev, R_BE_SECURE_BOOT_MALLOC_INFO, 0x20248000);
+
 	ret = mac->fwdl_check_path_ready(rtwdev, true);
 	if (ret) {
 		rtw89_err(rtwdev, "[ERR]H2C path ready\n");
diff --git a/drivers/net/wireless/realtek/rtw89/reg.h b/drivers/net/wireless/realtek/rtw89/reg.h
index 7798866d20c6..d37bb8273ff5 100644
--- a/drivers/net/wireless/realtek/rtw89/reg.h
+++ b/drivers/net/wireless/realtek/rtw89/reg.h
@@ -3670,6 +3670,8 @@
 #define B_BE_LPS_STATUS BIT(3)
 #define B_BE_HCI_TXDMA_BUSY BIT(2)
 
+#define R_BE_SECURE_BOOT_MALLOC_INFO 0x0184
+
 #define R_BE_WCPU_FW_CTRL 0x01E0
 #define B_BE_RUN_ENV_MASK GENMASK(31, 30)
 #define B_BE_WCPU_FWDL_STATUS_MASK GENMASK(29, 26)
-- 
2.25.1


  parent reply	other threads:[~2023-09-01  6:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01  6:14 [PATCH 0/8] wifi: rtw89: generalize download firmware flow to support WiFi 7 chips Ping-Ke Shih
2023-09-01  6:15 ` [PATCH 1/8] wifi: rtw89: fw: move polling function of firmware path ready to an individual function Ping-Ke Shih
2023-09-01  6:15 ` [PATCH 2/8] wifi: rtw89: fw: generalize download firmware flow by mac_gen pointers Ping-Ke Shih
2023-09-01  6:15 ` [PATCH 3/8] wifi: rtw89: fw: implement supported functions of download firmware for WiFi 7 chips Ping-Ke Shih
2023-09-01  6:15 ` [PATCH 4/8] wifi: rtw89: fw: add checking type for variant type of firmware Ping-Ke Shih
2023-09-01  6:15 ` [PATCH 5/8] wifi: rtw89: fw: propagate an argument include_bb for BB MCU firmware Ping-Ke Shih
2023-09-01  6:15 ` [PATCH 6/8] wifi: rtw89: 8922a: add chip_ops::bb_preinit to enable BB before downloading firmware Ping-Ke Shih
2023-09-01  6:15 ` [PATCH 7/8] wifi: rtw89: fw: refine download flow to support variant firmware suits Ping-Ke Shih
2023-09-01  6:15 ` Ping-Ke Shih [this message]
2023-09-01  7:42 ` [PATCH 0/8] wifi: rtw89: generalize download firmware flow to support WiFi 7 chips Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230901061507.34312-9-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.