All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fiona Klute <fiona.klute@gmx.de>
To: linux-wireless@vger.kernel.org, Ping-Ke Shih <pkshih@realtek.com>
Cc: "Fiona Klute" <fiona.klute@gmx.de>,
	"Kalle Valo" <kvalo@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org, "Pavel Machek" <pavel@ucw.cz>,
	"Ondřej Jirman" <megi@xff.cz>
Subject: [PATCH v4 8/9] wifi: rtw88: Reset 8703b firmware before download
Date: Mon, 11 Mar 2024 11:37:12 +0100	[thread overview]
Message-ID: <20240311103735.615541-9-fiona.klute@gmx.de> (raw)
In-Reply-To: <20240311103735.615541-1-fiona.klute@gmx.de>

Sometimes 8703b firmware is still active from previous use when the
driver needs to download the firmware during MAC activation. Reset it
in that case.

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
 drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
index 298663b0358..5fa38b1068e 100644
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -936,6 +936,12 @@ static int __rtw_download_firmware_legacy(struct rtw_dev *rtwdev,
 {
 	int ret = 0;

+	/* reset firmware if still present */
+	if (rtwdev->chip->id == RTW_CHIP_TYPE_8703B &&
+	    rtw_read8_mask(rtwdev, REG_MCUFW_CTRL, BIT_RAM_DL_SEL)) {
+		rtw_write8(rtwdev, REG_MCUFW_CTRL, 0x00);
+	}
+
 	en_download_firmware_legacy(rtwdev, true);
 	ret = download_firmware_legacy(rtwdev, fw->firmware->data, fw->firmware->size);
 	en_download_firmware_legacy(rtwdev, false);
--
2.43.0


  parent reply	other threads:[~2024-03-11 10:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 10:37 [PATCH v4 0/9] rtw88: Add support for RTL8723CS/RTL8703B Fiona Klute
2024-03-11 10:37 ` [PATCH v4 1/9] wifi: rtw88: Shared module for rtw8723x devices Fiona Klute
2024-03-14  9:00   ` Kalle Valo
2024-03-11 10:37 ` [PATCH v4 2/9] wifi: rtw88: Debug output for rtw8723x EFUSE Fiona Klute
2024-03-11 10:37 ` [PATCH v4 3/9] wifi: rtw88: Add definitions for 8703b chip Fiona Klute
2024-03-11 10:37 ` [PATCH v4 4/9] wifi: rtw88: Add rtw8703b.h Fiona Klute
2024-03-11 10:37 ` [PATCH v4 5/9] wifi: rtw88: Add rtw8703b.c Fiona Klute
2024-03-11 10:37 ` [PATCH v4 6/9] wifi: rtw88: Add rtw8703b_tables.h Fiona Klute
2024-03-11 10:37 ` [PATCH v4 7/9] wifi: rtw88: Add rtw8703b_tables.c Fiona Klute
2024-03-11 10:37 ` Fiona Klute [this message]
2024-03-11 10:37 ` [PATCH v4 9/9] wifi: rtw88: SDIO device driver for RTL8723CS Fiona Klute
2024-03-12  2:58 ` [PATCH v4 0/9] rtw88: Add support for RTL8723CS/RTL8703B Ping-Ke Shih
2024-03-12  8:43   ` Pavel Machek
2024-03-12  9:00     ` Ping-Ke Shih
2024-03-12 16:09       ` Larry Finger
2024-03-13 13:15       ` Fiona Klute
2024-03-14  0:18         ` Ping-Ke Shih
2024-03-14  9:02           ` Fiona Klute

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=20240311103735.615541-9-fiona.klute@gmx.de \
    --to=fiona.klute@gmx.de \
    --cc=kvalo@kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=megi@xff.cz \
    --cc=pavel@ucw.cz \
    --cc=pkshih@realtek.com \
    --cc=ulf.hansson@linaro.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.