diff options
author | Hayes Wang <hayeswang@realtek.com> | 2020-12-16 17:03:23 +0800 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2020-12-16 10:27:09 +0100 |
commit | 72294407726e9652f4ab44add3dbd118797683d1 (patch) | |
tree | f26e1a117a80ad113833665ca365fd338d0a7a6a | |
parent | 17d5a461a0da967c511032a160278b0e1d9fd349 (diff) | |
download | u-boot-72294407726e9652f4ab44add3dbd118797683d1.zip u-boot-72294407726e9652f4ab44add3dbd118797683d1.tar.gz u-boot-72294407726e9652f4ab44add3dbd118797683d1.tar.bz2 |
eth/r8152: fix the aggregation issue
Remove the redundant setting for USB_RX_EARLY_SIZE. Besides, for
RTL8153B, it is necessary to notify the hardware of the changes
of the aggregation settings.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
-rw-r--r-- | drivers/usb/eth/r8152.c | 17 | ||||
-rw-r--r-- | drivers/usb/eth/r8152.h | 5 |
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/usb/eth/r8152.c b/drivers/usb/eth/r8152.c index 82a05a9..5f30919 100644 --- a/drivers/usb/eth/r8152.c +++ b/drivers/usb/eth/r8152.c @@ -447,6 +447,12 @@ static void rtl8152_set_rx_mode(struct r8152 *tp) ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); } +static inline void r8153b_rx_agg_chg_indicate(struct r8152 *tp) +{ + ocp_write_byte(tp, MCU_TYPE_USB, USB_UPT_RXDMA_OWN, + OWN_UPDATE | OWN_CLEAR); +} + static int rtl_enable(struct r8152 *tp) { u32 ocp_data; @@ -457,6 +463,15 @@ static int rtl_enable(struct r8152 *tp) ocp_data |= PLA_CR_RE | PLA_CR_TE; ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CR, ocp_data); + switch (tp->version) { + case RTL_VER_08: + case RTL_VER_09: + r8153b_rx_agg_chg_indicate(tp); + break; + default: + break; + } + rxdy_gated_en(tp, false); rtl8152_set_rx_mode(tp); @@ -525,8 +540,6 @@ static void r8153_set_rx_early_size(struct r8152 *tp) debug("** %s Invalid Device\n", __func__); break; } - - ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE, ocp_data); } static int rtl8153_enable(struct r8152 *tp) diff --git a/drivers/usb/eth/r8152.h b/drivers/usb/eth/r8152.h index fa57e42..45172c0 100644 --- a/drivers/usb/eth/r8152.h +++ b/drivers/usb/eth/r8152.h @@ -92,6 +92,7 @@ #define USB_PM_CTRL_STATUS 0xd432 /* RTL8153A */ #define USB_RX_EXTRA_AGGR_TMR 0xd432 /* RTL8153B */ #define USB_TX_DMA 0xd434 +#define USB_UPT_RXDMA_OWN 0xd437 #define USB_TOLERANCE 0xd490 #define USB_LPM_CTRL 0xd41a #define USB_BMU_RESET 0xd4b0 @@ -346,6 +347,10 @@ #define BMU_RESET_EP_IN 0x01 #define BMU_RESET_EP_OUT 0x02 +/* USB_UPT_RXDMA_OWN */ +#define OWN_UPDATE BIT(0) +#define OWN_CLEAR BIT(1) + /* USB_UPS_CTRL */ #define POWER_CUT 0x0100 |