Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp726726rdb; Fri, 1 Sep 2023 02:22:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXqWr5jz03YOlSBHTJUZ4envMZ/UUZcm2AGBcydtBA06oRXBM6Pt0P+ux1NQ8Y8yDqEQoK X-Received: by 2002:a05:6402:120c:b0:521:ad49:8493 with SMTP id c12-20020a056402120c00b00521ad498493mr2429908edw.6.1693560129566; Fri, 01 Sep 2023 02:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693560129; cv=none; d=google.com; s=arc-20160816; b=at54QnZCL4SZXxU1pQl7bKps7HddDvAMp30M3ls8rFtlEnBtcLzfsr46MPlK6b3mhF 2Dc27B3mYqoNrP9NAxjann06w/Y2tvzmMFd3ECxGEWWh+45WssZQFMZ1yW/l4w6MRN8u Mr/B8DVltVHs1PZveRzXS4Dre6S5ErHMVbFiE6JWE99+0/BHCKmKSGuJwJYI1Auyeik6 O9GMO8s1+tt0tGBTgJtlUSQxwhg9srAIRNyvJiIwF8GOvNtyeSYo01pErsgDy0vicSlJ hqmNbZmB4Eq3KSnbBrZS4MK9ySJ6mpAGIiPgfRDbIFciB0PmW6zW8AtRVYCggRgn0KEZ YUAg== 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=58+hzGRxMmipkEI0gaj0xzUN2330E6qHHQQAKPVjlT0=; fh=119R0DZRwIns1LRpqAK2A6izyPVjL4TEe6VydCwW0T8=; b=AYgSwk4hpTIZShbaWf+Rg1QRnxryMVjpZbmB5Pxtt0SQd5ilFLObyrC8NMxAgcBL6t JGblb9rxJARwATDWbN7FLIG6od4PJTTezeOyVHb0SRJJUp9PSa99/ivVW3O/ho4TyCLE QspxXWMTNxlLtcv+/Pq9sR6tcz0t4BPh3l94O3DQVYUMwsGAGYCsiDfQqDfU/yK/pZZm CYyVGwACb93pLgpHFbL7Vu0Q5TIT4dZUIYX+nrwlvPiEKNyOA5rEBJc8BJ8A/Rraxt7I w0h113L+EhFe4qnlCRlxMDbtIkIjoe0e+0JQTBadA9XpBgXFtvQ9hA4bcgAT2+oKQzvA wO2w== 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 z13-20020aa7c64d000000b005223fbd4d87si2167417edr.503.2023.09.01.02.21.56; Fri, 01 Sep 2023 02:22:09 -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 S1348524AbjIAHlM (ORCPT + 51 others); Fri, 1 Sep 2023 03:41:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348522AbjIAHlL (ORCPT ); Fri, 1 Sep 2023 03:41:11 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E3366E7F for ; Fri, 1 Sep 2023 00:41:08 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3817eaIgB006924, 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 3817eaIgB006924 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 1 Sep 2023 15:40:36 +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 15:41:02 +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 15:41:02 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH v2 8/8] wifi: rtw89: 8922a: set memory heap address for secure firmware Date: Fri, 1 Sep 2023 15:39:56 +0800 Message-ID: <20230901073956.54203-9-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230901073956.54203-1-pkshih@realtek.com> References: <20230901073956.54203-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 --- v2: no change --- 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