diff options
Diffstat (limited to 'target/linux/generic/backport-5.10/793-v5.13-r8152-support-new-chips.patch')
-rw-r--r-- | target/linux/generic/backport-5.10/793-v5.13-r8152-support-new-chips.patch | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/target/linux/generic/backport-5.10/793-v5.13-r8152-support-new-chips.patch b/target/linux/generic/backport-5.10/793-v5.13-r8152-support-new-chips.patch index c53315a0df..1533229564 100644 --- a/target/linux/generic/backport-5.10/793-v5.13-r8152-support-new-chips.patch +++ b/target/linux/generic/backport-5.10/793-v5.13-r8152-support-new-chips.patch @@ -379,7 +379,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). * The RTL chips use a 64 element hash table based on the Ethernet CRC. -@@ -2606,7 +2711,7 @@ static netdev_tx_t rtl8152_start_xmit(st +@@ -2608,7 +2713,7 @@ static netdev_tx_t rtl8152_start_xmit(st static void r8152b_reset_packet_filter(struct r8152 *tp) { @@ -388,7 +388,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_FMC); ocp_data &= ~FMC_FCR_MCU_EN; -@@ -2617,14 +2722,47 @@ static void r8152b_reset_packet_filter(s +@@ -2619,14 +2724,47 @@ static void r8152b_reset_packet_filter(s static void rtl8152_nic_reset(struct r8152 *tp) { @@ -442,7 +442,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> } } -@@ -2633,9 +2771,9 @@ static void set_tx_qlen(struct r8152 *tp +@@ -2635,9 +2773,9 @@ static void set_tx_qlen(struct r8152 *tp tp->tx_qlen = agg_buf_sz / (mtu_to_size(tp->netdev->mtu) + sizeof(struct tx_desc)); } @@ -454,7 +454,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> } static void rtl_eee_plus_en(struct r8152 *tp, bool enable) -@@ -2795,6 +2933,7 @@ static int rtl_enable(struct r8152 *tp) +@@ -2797,6 +2935,7 @@ static int rtl_enable(struct r8152 *tp) switch (tp->version) { case RTL_VER_08: case RTL_VER_09: @@ -462,7 +462,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> r8153b_rx_agg_chg_indicate(tp); break; default: -@@ -2832,6 +2971,7 @@ static void r8153_set_rx_early_timeout(s +@@ -2834,6 +2973,7 @@ static void r8153_set_rx_early_timeout(s case RTL_VER_08: case RTL_VER_09: @@ -470,7 +470,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> /* The RTL8153B uses USB_RX_EXTRA_AGGR_TMR for rx timeout * primarily. For USB_RX_EARLY_TIMEOUT, we fix it to 128ns. */ -@@ -2841,6 +2981,18 @@ static void r8153_set_rx_early_timeout(s +@@ -2843,6 +2983,18 @@ static void r8153_set_rx_early_timeout(s ocp_data); break; @@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> default: break; } -@@ -2860,8 +3012,19 @@ static void r8153_set_rx_early_size(stru +@@ -2862,8 +3014,19 @@ static void r8153_set_rx_early_size(stru break; case RTL_VER_08: case RTL_VER_09: @@ -509,7 +509,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> break; default: WARN_ON_ONCE(1); -@@ -2871,6 +3034,8 @@ static void r8153_set_rx_early_size(stru +@@ -2873,6 +3036,8 @@ static void r8153_set_rx_early_size(stru static int rtl8153_enable(struct r8152 *tp) { @@ -518,7 +518,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> if (test_bit(RTL8152_UNPLUG, &tp->flags)) return -ENODEV; -@@ -2881,15 +3046,18 @@ static int rtl8153_enable(struct r8152 * +@@ -2883,15 +3048,18 @@ static int rtl8153_enable(struct r8152 * rtl_set_ifg(tp, rtl8152_get_speed(tp)); @@ -540,7 +540,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> } return rtl_enable(tp); -@@ -2954,12 +3122,40 @@ static void rtl_rx_vlan_en(struct r8152 +@@ -2956,12 +3124,40 @@ static void rtl_rx_vlan_en(struct r8152 { u32 ocp_data; @@ -587,7 +587,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> } static int rtl8152_set_features(struct net_device *dev, -@@ -3052,6 +3248,40 @@ static void __rtl_set_wol(struct r8152 * +@@ -3054,6 +3250,40 @@ static void __rtl_set_wol(struct r8152 * device_set_wakeup_enable(&tp->udev->dev, false); } @@ -628,7 +628,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void r8153_u1u2en(struct r8152 *tp, bool enable) { u8 u1u2[8]; -@@ -3111,6 +3341,9 @@ static void r8153b_ups_flags(struct r815 +@@ -3113,6 +3343,9 @@ static void r8153b_ups_flags(struct r815 if (tp->ups_info.eee_cmod_lv) ups_flags |= UPS_FLAGS_EEE_CMOD_LV_EN; @@ -638,7 +638,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> if (tp->ups_info._10m_ckdiv) ups_flags |= UPS_FLAGS_EN_10M_CKDIV; -@@ -3161,6 +3394,88 @@ static void r8153b_ups_flags(struct r815 +@@ -3163,6 +3396,88 @@ static void r8153b_ups_flags(struct r815 ocp_write_dword(tp, MCU_TYPE_USB, USB_UPS_FLAGS, ups_flags); } @@ -727,7 +727,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void rtl_green_en(struct r8152 *tp, bool enable) { u16 data; -@@ -3224,16 +3539,16 @@ static void r8153b_ups_en(struct r8152 * +@@ -3226,16 +3541,16 @@ static void r8153b_ups_en(struct r8152 * ocp_data |= UPS_EN | USP_PREWAKE | PHASE2_EN; ocp_write_byte(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data); @@ -750,7 +750,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> if (ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0) & PCUT_STATUS) { int i; -@@ -3253,6 +3568,95 @@ static void r8153b_ups_en(struct r8152 * +@@ -3255,6 +3570,95 @@ static void r8153b_ups_en(struct r8152 * } } @@ -846,7 +846,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void r8153_power_cut_en(struct r8152 *tp, bool enable) { u32 ocp_data; -@@ -3382,6 +3786,38 @@ static void rtl8153b_runtime_enable(stru +@@ -3384,6 +3788,38 @@ static void rtl8153b_runtime_enable(stru } } @@ -885,7 +885,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void r8153_teredo_off(struct r8152 *tp) { u32 ocp_data; -@@ -3402,14 +3838,19 @@ static void r8153_teredo_off(struct r815 +@@ -3404,14 +3840,19 @@ static void r8153_teredo_off(struct r815 case RTL_VER_08: case RTL_VER_09: @@ -908,7 +908,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> } ocp_write_word(tp, MCU_TYPE_PLA, PLA_WDT6_CTRL, WDT6_SET_MODE); -@@ -3444,6 +3885,12 @@ static void rtl_clear_bp(struct r8152 *t +@@ -3446,6 +3887,12 @@ static void rtl_clear_bp(struct r8152 *t break; case RTL_VER_08: case RTL_VER_09: @@ -921,7 +921,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> default: if (type == MCU_TYPE_USB) { ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0); -@@ -3653,6 +4100,11 @@ static bool rtl8152_is_fw_mac_ok(struct +@@ -3655,6 +4102,11 @@ static bool rtl8152_is_fw_mac_ok(struct case RTL_VER_06: case RTL_VER_08: case RTL_VER_09: @@ -933,7 +933,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> fw_reg = 0xf800; bp_ba_addr = PLA_BP_BA; bp_en_addr = PLA_BP_EN; -@@ -3676,6 +4128,11 @@ static bool rtl8152_is_fw_mac_ok(struct +@@ -3678,6 +4130,11 @@ static bool rtl8152_is_fw_mac_ok(struct break; case RTL_VER_08: case RTL_VER_09: @@ -945,7 +945,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> fw_reg = 0xe600; bp_ba_addr = USB_BP_BA; bp_en_addr = USB_BP2_EN; -@@ -4215,6 +4672,22 @@ static void r8153_eee_en(struct r8152 *t +@@ -4217,6 +4674,22 @@ static void r8153_eee_en(struct r8152 *t tp->ups_info.eee = enable; } @@ -968,7 +968,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void rtl_eee_enable(struct r8152 *tp, bool enable) { switch (tp->version) { -@@ -4236,6 +4709,7 @@ static void rtl_eee_enable(struct r8152 +@@ -4238,6 +4711,7 @@ static void rtl_eee_enable(struct r8152 case RTL_VER_06: case RTL_VER_08: case RTL_VER_09: @@ -976,7 +976,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> if (enable) { r8153_eee_en(tp, true); ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv); -@@ -4244,6 +4718,19 @@ static void rtl_eee_enable(struct r8152 +@@ -4246,6 +4720,19 @@ static void rtl_eee_enable(struct r8152 ocp_reg_write(tp, OCP_EEE_ADV, 0); } break; @@ -996,7 +996,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> default: break; } -@@ -4290,6 +4777,20 @@ static void wait_oob_link_list_ready(str +@@ -4292,6 +4779,20 @@ static void wait_oob_link_list_ready(str } } @@ -1017,7 +1017,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void r8152b_exit_oob(struct r8152 *tp) { u32 ocp_data; -@@ -4340,7 +4841,7 @@ static void r8152b_exit_oob(struct r8152 +@@ -4342,7 +4843,7 @@ static void r8152b_exit_oob(struct r8152 } /* TX share fifo free credit full threshold */ @@ -1026,7 +1026,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> ocp_write_byte(tp, MCU_TYPE_USB, USB_TX_AGG, TX_AGG_MAX_THRESHOLD); ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, RX_THR_HIGH); -@@ -4517,6 +5018,21 @@ static int r8153b_post_firmware_1(struct +@@ -4519,6 +5020,21 @@ static int r8153b_post_firmware_1(struct return 0; } @@ -1048,7 +1048,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void r8153_aldps_en(struct r8152 *tp, bool enable) { u16 data; -@@ -4719,6 +5235,13 @@ static void r8153b_hw_phy_cfg(struct r81 +@@ -4721,6 +5237,13 @@ static void r8153b_hw_phy_cfg(struct r81 set_bit(PHY_RESET, &tp->flags); } @@ -1062,7 +1062,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static void rtl8153_change_mtu(struct r8152 *tp) { ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, mtu_to_size(tp->netdev->mtu)); -@@ -4806,6 +5329,7 @@ static void r8153_enter_oob(struct r8152 +@@ -4808,6 +5331,7 @@ static void r8153_enter_oob(struct r8152 case RTL_VER_08: case RTL_VER_09: @@ -1070,7 +1070,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> /* Clear teredo wake event. bit[15:8] is the teredo wakeup * type. Set it to zero. bits[7:0] are the W1C bits about * the events. Set them to all 1 to clear them. -@@ -4842,6 +5366,96 @@ static void rtl8153_disable(struct r8152 +@@ -4844,6 +5368,96 @@ static void rtl8153_disable(struct r8152 r8153_aldps_en(tp, true); } @@ -1167,7 +1167,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u32 speed, u8 duplex, u32 advertising) { -@@ -4890,58 +5504,73 @@ static int rtl8152_set_speed(struct r815 +@@ -4892,58 +5506,73 @@ static int rtl8152_set_speed(struct r815 tp->mii.force_media = 1; } else { @@ -1259,7 +1259,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> } bmcr = BMCR_ANENABLE | BMCR_ANRESTART; -@@ -5097,6 +5726,253 @@ static void rtl8153b_down(struct r8152 * +@@ -5099,6 +5728,253 @@ static void rtl8153b_down(struct r8152 * r8153_aldps_en(tp, true); } @@ -1513,7 +1513,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static bool rtl8152_in_nway(struct r8152 *tp) { u16 nway_state; -@@ -5127,7 +6003,7 @@ static void set_carrier(struct r8152 *tp +@@ -5129,7 +6005,7 @@ static void set_carrier(struct r8152 *tp { struct net_device *netdev = tp->netdev; struct napi_struct *napi = &tp->napi; @@ -1522,7 +1522,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> speed = rtl8152_get_speed(tp); -@@ -5140,7 +6016,7 @@ static void set_carrier(struct r8152 *tp +@@ -5142,7 +6018,7 @@ static void set_carrier(struct r8152 *tp rtl_start_rx(tp); clear_bit(RTL8152_SET_RX_MODE, &tp->flags); _rtl8152_set_rx_mode(netdev); @@ -1531,7 +1531,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> netif_wake_queue(netdev); netif_info(tp, link, netdev, "carrier on\n"); } else if (netif_queue_stopped(netdev) && -@@ -5502,14 +6378,9 @@ static void r8153_init(struct r8152 *tp) +@@ -5504,14 +6380,9 @@ static void r8153_init(struct r8152 *tp) ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001); @@ -1547,7 +1547,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> r8153_u1u2en(tp, true); usb_enable_lpm(tp->udev); -@@ -5600,9 +6471,7 @@ static void r8153b_init(struct r8152 *tp +@@ -5602,9 +6473,7 @@ static void r8153b_init(struct r8152 *tp usb_enable_lpm(tp->udev); /* MAC clock speed down */ @@ -1558,7 +1558,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3); ocp_data &= ~PLA_MCU_SPDWN_EN; -@@ -5629,6 +6498,1069 @@ static void r8153b_init(struct r8152 *tp +@@ -5631,6 +6500,1069 @@ static void r8153b_init(struct r8152 *tp tp->coalesce = 15000; /* 15 us */ } @@ -2628,7 +2628,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static int rtl8152_pre_reset(struct usb_interface *intf) { struct r8152 *tp = usb_get_intfdata(intf); -@@ -5992,6 +7924,22 @@ int rtl8152_get_link_ksettings(struct ne +@@ -5994,6 +7926,22 @@ int rtl8152_get_link_ksettings(struct ne mii_ethtool_get_link_ksettings(&tp->mii, cmd); @@ -2651,7 +2651,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> mutex_unlock(&tp->control); usb_autopm_put_interface(tp->intf); -@@ -6035,6 +7983,10 @@ static int rtl8152_set_link_ksettings(st +@@ -6037,6 +7985,10 @@ static int rtl8152_set_link_ksettings(st cmd->link_modes.advertising)) advertising |= RTL_ADVERTISED_1000_FULL; @@ -2662,7 +2662,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> mutex_lock(&tp->control); ret = rtl8152_set_speed(tp, cmd->base.autoneg, cmd->base.speed, -@@ -6624,6 +8576,67 @@ static int rtl_ops_init(struct r8152 *tp +@@ -6626,6 +8578,67 @@ static int rtl_ops_init(struct r8152 *tp tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; break; @@ -2730,7 +2730,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> default: ret = -ENODEV; dev_err(&tp->intf->dev, "Unknown Device\n"); -@@ -6637,11 +8650,13 @@ static int rtl_ops_init(struct r8152 *tp +@@ -6639,11 +8652,13 @@ static int rtl_ops_init(struct r8152 *tp #define FIRMWARE_8153A_3 "rtl_nic/rtl8153a-3.fw" #define FIRMWARE_8153A_4 "rtl_nic/rtl8153a-4.fw" #define FIRMWARE_8153B_2 "rtl_nic/rtl8153b-2.fw" @@ -2744,7 +2744,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> static int rtl_fw_init(struct r8152 *tp) { -@@ -6667,6 +8682,11 @@ static int rtl_fw_init(struct r8152 *tp) +@@ -6669,6 +8684,11 @@ static int rtl_fw_init(struct r8152 *tp) rtl_fw->pre_fw = r8153b_pre_firmware_1; rtl_fw->post_fw = r8153b_post_firmware_1; break; @@ -2756,7 +2756,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> default: break; } -@@ -6722,6 +8742,27 @@ u8 rtl8152_get_version(struct usb_interf +@@ -6724,6 +8744,27 @@ u8 rtl8152_get_version(struct usb_interf case 0x6010: version = RTL_VER_09; break; @@ -2784,7 +2784,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> default: version = RTL_VER_UNKNOWN; dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data); -@@ -6834,12 +8875,29 @@ static int rtl8152_probe(struct usb_inte +@@ -6836,12 +8877,29 @@ static int rtl8152_probe(struct usb_inte /* MTU range: 68 - 1500 or 9194 */ netdev->min_mtu = ETH_MIN_MTU; switch (tp->version) { @@ -2817,7 +2817,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> break; } -@@ -6855,7 +8913,13 @@ static int rtl8152_probe(struct usb_inte +@@ -6857,7 +8915,13 @@ static int rtl8152_probe(struct usb_inte tp->advertising = RTL_ADVERTISED_10_HALF | RTL_ADVERTISED_10_FULL | RTL_ADVERTISED_100_HALF | RTL_ADVERTISED_100_FULL; if (tp->mii.supports_gmii) { @@ -2832,7 +2832,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> tp->advertising |= RTL_ADVERTISED_1000_FULL; } tp->duplex = DUPLEX_FULL; -@@ -6879,7 +8943,11 @@ static int rtl8152_probe(struct usb_inte +@@ -6881,7 +8945,11 @@ static int rtl8152_probe(struct usb_inte set_ethernet_addr(tp); usb_set_intfdata(intf, tp); @@ -2845,7 +2845,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> ret = register_netdev(netdev); if (ret != 0) { -@@ -6915,7 +8983,8 @@ static void rtl8152_disconnect(struct us +@@ -6917,7 +8985,8 @@ static void rtl8152_disconnect(struct us unregister_netdev(tp->netdev); tasklet_kill(&tp->tx_tl); cancel_delayed_work_sync(&tp->hw_phy_work); @@ -2855,7 +2855,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net> rtl8152_release_firmware(tp); free_netdev(tp->netdev); } -@@ -6935,13 +9004,28 @@ static void rtl8152_disconnect(struct us +@@ -6937,13 +9006,28 @@ static void rtl8152_disconnect(struct us .idProduct = (prod), \ .bInterfaceClass = USB_CLASS_COMM, \ .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \ |