Message ID | 20240202121050.977223-9-fiona.klute@gmx.de (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Kalle Valo |
Headers | show |
Series | rtw88: Add support for RTL8723CS/RTL8703B | expand |
> -----Original Message----- > From: Fiona Klute <fiona.klute@gmx.de> > Sent: Friday, February 2, 2024 8:11 PM > To: linux-wireless@vger.kernel.org; Ping-Ke Shih <pkshih@realtek.com> > Cc: 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>; Fiona Klute <fiona.klute@gmx.de> > Subject: [PATCH 8/9] wifi: rtw88: Reset 8703b firmware before download > > 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. > > 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 298663b035..b6de097e44 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(rtwdev, REG_MCUFW_CTRL) & BIT_RAM_DL_SEL) { 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 >
diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c index 298663b035..b6de097e44 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(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);
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. Signed-off-by: Fiona Klute <fiona.klute@gmx.de> --- drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.43.0