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>, <leo.li@realtek.com>,
	<hsuan8331@realtek.com>, <yuanhan1020@realtek.com>
Subject: [PATCH 08/11] rtw89: disable FW and H2C function if CPU disabled
Date: Fri, 11 Mar 2022 11:02:58 +0800	[thread overview]
Message-ID: <20220311030301.33921-9-pkshih@realtek.com> (raw)
In-Reply-To: <20220311030301.33921-1-pkshih@realtek.com>

From: Chia-Yuan Li <leo.li@realtek.com>

Initialize FW status and disabled H2C function if CPU disabled. Then, it
can reset to initial state.

Signed-off-by: Chia-Yuan Li <leo.li@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/mac.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 83690656c3e8e..e52b0e7b53829 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -2685,7 +2685,11 @@ static void rtw89_mac_disable_cpu(struct rtw89_dev *rtwdev)
 	clear_bit(RTW89_FLAG_FW_RDY, rtwdev->flags);
 
 	rtw89_write32_clr(rtwdev, R_AX_PLATFORM_ENABLE, B_AX_WCPU_EN);
+	rtw89_write32_clr(rtwdev, R_AX_WCPU_FW_CTRL, B_AX_WCPU_FWDL_EN |
+			  B_AX_H2C_PATH_RDY | B_AX_FWDL_PATH_RDY);
 	rtw89_write32_clr(rtwdev, R_AX_SYS_CLK_CTRL, B_AX_CPU_CLK_EN);
+	rtw89_write32_clr(rtwdev, R_AX_PLATFORM_ENABLE, B_AX_PLATFORM_EN);
+	rtw89_write32_set(rtwdev, R_AX_PLATFORM_ENABLE, B_AX_PLATFORM_EN);
 }
 
 static int rtw89_mac_enable_cpu(struct rtw89_dev *rtwdev, u8 boot_reason,
-- 
2.25.1


  parent reply	other threads:[~2022-03-11  3:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11  3:02 [PATCH 00/11] rtw89: prepare more shared code to work with 8852c Ping-Ke Shih
2022-03-11  3:02 ` [PATCH 01/11] rtw89: modify dcfo_comp to share with chips Ping-Ke Shih
2022-03-11  3:02 ` [PATCH 02/11] rtw89: 8852c: add write/read crystal function in CFO tracking Ping-Ke Shih
2022-03-11  3:02 ` [PATCH 03/11] rtw89: 8852c: add setting of TB UL TX power offset Ping-Ke Shih
2022-03-11  3:02 ` [PATCH 04/11] rtw89: 8852c: add read/write rf register function Ping-Ke Shih
2022-03-11  3:02 ` [PATCH 05/11] rtw89: add config_rf_reg_v1 to configure RF parameter tables Ping-Ke Shih
2022-03-11  3:02 ` [PATCH 06/11] rtw89: modify MAC enable functions Ping-Ke Shih
2022-03-11  3:02 ` [PATCH 07/11] rtw89: initialize preload window of D-MAC Ping-Ke Shih
2022-03-11  3:02 ` Ping-Ke Shih [this message]
2022-03-11  3:02 ` [PATCH 09/11] rtw89: 8852c: add mac_ctrl_path and mac_cfg_gnt APIs Ping-Ke Shih
2022-03-16 15:48   ` Kalle Valo
2022-03-11  3:03 ` [PATCH 10/11] rtw89: extend mac tx_en bits from 16 to 32 Ping-Ke Shih
2022-03-11  3:03 ` [PATCH 11/11] rtw89: implement stop and resume channels transmission v1 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=20220311030301.33921-9-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=hsuan8331@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=leo.li@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=yuanhan1020@realtek.com \
    /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.