rtl8xxxu: rtl8xxxu_download_firmware(): Cosmetic cleanups
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
43154f6fd4
commit
ef1c049931
|
@ -2105,15 +2105,18 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
|
|||
|
||||
/* MCU firmware download enable */
|
||||
val8 = rtl8xxxu_read8(priv, REG_MCU_FW_DL);
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL, val8 | MCU_FW_DL_ENABLE);
|
||||
val8 |= MCU_FW_DL_ENABLE;
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL, val8);
|
||||
|
||||
/* 8051 reset */
|
||||
val32 = rtl8xxxu_read32(priv, REG_MCU_FW_DL);
|
||||
rtl8xxxu_write32(priv, REG_MCU_FW_DL, val32 & ~BIT(19));
|
||||
val32 &= ~BIT(19);
|
||||
rtl8xxxu_write32(priv, REG_MCU_FW_DL, val32);
|
||||
|
||||
/* Reset firmware download checksum */
|
||||
val8 = rtl8xxxu_read8(priv, REG_MCU_FW_DL);
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL, val8 | MCU_FW_DL_CSUM_REPORT);
|
||||
val8 |= MCU_FW_DL_CSUM_REPORT;
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL, val8);
|
||||
|
||||
pages = priv->fw_size / RTL_FW_PAGE_SIZE;
|
||||
remainder = priv->fw_size % RTL_FW_PAGE_SIZE;
|
||||
|
@ -2122,7 +2125,8 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
|
|||
|
||||
for (i = 0; i < pages; i++) {
|
||||
val8 = rtl8xxxu_read8(priv, REG_MCU_FW_DL + 2) & 0xF8;
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL + 2, val8 | i);
|
||||
val8 |= i;
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL + 2, val8);
|
||||
|
||||
ret = rtl8xxxu_writeN(priv, REG_FW_START_ADDRESS,
|
||||
fwptr, RTL_FW_PAGE_SIZE);
|
||||
|
@ -2136,7 +2140,8 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
|
|||
|
||||
if (remainder) {
|
||||
val8 = rtl8xxxu_read8(priv, REG_MCU_FW_DL + 2) & 0xF8;
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL + 2, val8 | i);
|
||||
val8 |= i;
|
||||
rtl8xxxu_write8(priv, REG_MCU_FW_DL + 2, val8);
|
||||
ret = rtl8xxxu_writeN(priv, REG_FW_START_ADDRESS,
|
||||
fwptr, remainder);
|
||||
if (ret != remainder) {
|
||||
|
@ -2149,8 +2154,8 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv)
|
|||
fw_abort:
|
||||
/* MCU firmware download disable */
|
||||
val16 = rtl8xxxu_read16(priv, REG_MCU_FW_DL);
|
||||
rtl8xxxu_write16(priv, REG_MCU_FW_DL,
|
||||
val16 & (~MCU_FW_DL_ENABLE & 0xff));
|
||||
val16 &= ~MCU_FW_DL_ENABLE;
|
||||
rtl8xxxu_write16(priv, REG_MCU_FW_DL, val16);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue