Skip to content

Commit fb02eb4

Browse files
hayesorzdavem330
authored andcommitted
r8152: support the new RTL8153 chip
Support the new USB gigabit ethernet. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent de18547 commit fb02eb4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/net/usb/r8152.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ enum rtl_version {
622622
RTL_VER_03,
623623
RTL_VER_04,
624624
RTL_VER_05,
625+
RTL_VER_06,
625626
RTL_VER_MAX
626627
};
627628

@@ -2560,7 +2561,10 @@ static void r8153_hw_phy_cfg(struct r8152 *tp)
25602561
u32 ocp_data;
25612562
u16 data;
25622563

2563-
ocp_reg_write(tp, OCP_ADC_CFG, CKADSEL_L | ADC_EN | EN_EMI_L);
2564+
if (tp->version == RTL_VER_03 || tp->version == RTL_VER_04 ||
2565+
tp->version == RTL_VER_05)
2566+
ocp_reg_write(tp, OCP_ADC_CFG, CKADSEL_L | ADC_EN | EN_EMI_L);
2567+
25642568
data = r8152_mdio_read(tp, MII_BMCR);
25652569
if (data & BMCR_PDOWN) {
25662570
data &= ~BMCR_PDOWN;
@@ -3268,6 +3272,13 @@ static void r8153_init(struct r8152 *tp)
32683272
ocp_data &= ~ECM_ALDPS;
32693273
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_DMY_REG0, ocp_data);
32703274

3275+
ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY1);
3276+
if (ocp_read_word(tp, MCU_TYPE_USB, USB_BURST_SIZE) == 0)
3277+
ocp_data &= ~DYNAMIC_BURST;
3278+
else
3279+
ocp_data |= DYNAMIC_BURST;
3280+
ocp_write_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY1, ocp_data);
3281+
} else if (tp->version == RTL_VER_06) {
32713282
ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_CSR_DUMMY1);
32723283
if (ocp_read_word(tp, MCU_TYPE_USB, USB_BURST_SIZE) == 0)
32733284
ocp_data &= ~DYNAMIC_BURST;
@@ -3908,6 +3919,10 @@ static void r8152b_get_version(struct r8152 *tp)
39083919
tp->version = RTL_VER_05;
39093920
tp->mii.supports_gmii = 1;
39103921
break;
3922+
case 0x5c30:
3923+
tp->version = RTL_VER_06;
3924+
tp->mii.supports_gmii = 1;
3925+
break;
39113926
default:
39123927
netif_info(tp, probe, tp->netdev,
39133928
"Unknown version 0x%04x\n", version);
@@ -3953,6 +3968,7 @@ static int rtl_ops_init(struct r8152 *tp)
39533968
case RTL_VER_03:
39543969
case RTL_VER_04:
39553970
case RTL_VER_05:
3971+
case RTL_VER_06:
39563972
ops->init = r8153_init;
39573973
ops->enable = rtl8153_enable;
39583974
ops->disable = rtl8153_disable;

0 commit comments

Comments
 (0)