Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp683756rdb; Fri, 1 Sep 2023 00:39:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJ8aRVQnRB7SE9WsLBxpVsGFHCyrcC6uwb0XCvQ1LtBK2b2QS6mYOTjCJMjrUZjwrRh9BG X-Received: by 2002:a17:90a:9743:b0:271:df49:2bd9 with SMTP id i3-20020a17090a974300b00271df492bd9mr1599609pjw.23.1693553952840; Fri, 01 Sep 2023 00:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693553952; cv=none; d=google.com; s=arc-20160816; b=zUFwtZVjuAxyBKhyv6V/ICPOLgnD3YJ8/5O5n8sU3WPq9oFqAPXxtCfpKpOLuvDaQR Akp2po7is9Q3vtWCA+NJyboOwyv7pCKj9tel/SQvthobhFjB5zKTEx6B+/ePeTyTutji ChKqwiY+msTQdmlnSFN9B6nbyxCBGWpVActQ7UP0ryvApGLUVttfQhFsWRM9gr9bFres tMEJebLj7TiX1Gfy4iWgVSe2Kp2pxrvd1WmjpB/s1+FAOAEtwKa/kmZWBqOHfml9Vgth pSJ7KH9lWburmrfK0rRfBoKC6xDSV9maBElphVAadx/cdXD/N3xjPuhoe/yde75tKayk QqlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :authenticated-by; bh=D17Z7ECVOYH5IuY34IMQSAGt03lchvm2D19eIOGVa1Q=; fh=119R0DZRwIns1LRpqAK2A6izyPVjL4TEe6VydCwW0T8=; b=J/pdOk5cvdBeAYS5zf+de/APSTw0YRrMcba3C9iI+OiLXOJBWj1nLbJ2GIeaWASHJi iK0426SP+9Ly65vL3++7N5B9ZKmfMDv69prsoh2KMwVQFBv/UH939oquHMDdo/U6BldG T7/ptwUlGb1cPoz1V6iP51URnLWVju9hseZjPjkUsg172+GxPeBzX1BuwTXs9jIBdxuh 834VSC2rN131eibcre5AWRt4JijKTNXyyXpBWYxAUjBHY0aeOhOFN5lKb7pValXj73Uw zJjcAaZbwXAckcxA7YAETG+OkLY+MKEusl0dcLo3VvGMFHd8zgVBOuveZ1JClcMbxVvU i7Rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a17090a9a8300b00268345e910csi2582699pjp.127.2023.09.01.00.38.58; Fri, 01 Sep 2023 00:39:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348367AbjIAGQs (ORCPT + 51 others); Fri, 1 Sep 2023 02:16:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348361AbjIAGQZ (ORCPT ); Fri, 1 Sep 2023 02:16:25 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7AEE410D2 for ; Thu, 31 Aug 2023 23:16:22 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3816Fo8iA007319, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 3816Fo8iA007319 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 1 Sep 2023 14:15:50 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Fri, 1 Sep 2023 14:16:16 +0800 Received: from [127.0.1.1] (172.21.69.25) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 1 Sep 2023 14:16:16 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 8/8] wifi: rtw89: 8922a: set memory heap address for secure firmware Date: Fri, 1 Sep 2023 14:15:07 +0800 Message-ID: <20230901061507.34312-9-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230901061507.34312-1-pkshih@realtek.com> References: <20230901061507.34312-1-pkshih@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.25] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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