kernel: Bump to 5.15.156
authorRISCi_ATOM <bob@bobcall.me>
Fri, 19 Apr 2024 21:02:23 +0000 (17:02 -0400)
committerRISCi_ATOM <bob@bobcall.me>
Fri, 19 Apr 2024 21:02:23 +0000 (17:02 -0400)
Patches removed upstream:

* target/linux/generic/backport-5.15/081-v5.17-regmap-allow-to-define-reg_update_bits-for-no-bus.patch

* target/linux/generic/backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch

* target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch

Reworked:

* target/linux/generic/hack-5.15/221-module_exports.patch

150 files changed:
include/kernel-5.15
package/kernel/linux/modules/fs.mk
target/linux/generic/backport-5.15/020-v6.1-05-mm-multi-gen-LRU-groundwork.patch
target/linux/generic/backport-5.15/020-v6.1-06-mm-multi-gen-LRU-minimal-implementation.patch
target/linux/generic/backport-5.15/020-v6.1-08-mm-multi-gen-LRU-support-page-table-walks.patch
target/linux/generic/backport-5.15/020-v6.1-15-mm-multi-gen-LRU-move-lru_gen_add_mm-out-of-IRQ-off-.patch
target/linux/generic/backport-5.15/020-v6.3-26-mm-multi-gen-LRU-per-node-lru_gen_page-lists.patch
target/linux/generic/backport-5.15/081-v5.17-regmap-allow-to-define-reg_update_bits-for-no-bus.patch [deleted file]
target/linux/generic/backport-5.15/350-v5.18-regmap-add-configurable-downshift-for-addresses.patch
target/linux/generic/backport-5.15/351-v5.18-regmap-allow-a-defined-reg_base-to-be-added-to-every.patch
target/linux/generic/backport-5.15/352-v6.3-regmap-apply-reg_base-and-reg_downshift-for-single-r.patch
target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch
target/linux/generic/backport-5.15/702-v5.19-00-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
target/linux/generic/backport-5.15/702-v5.19-02-net-ethernet-mtk_eth_soc-add-support-for-Wireless-Et.patch
target/linux/generic/backport-5.15/702-v5.19-07-net-ethernet-mtk_eth_soc-allocate-struct-mtk_ppe-sep.patch
target/linux/generic/backport-5.15/702-v5.19-08-net-ethernet-mtk_eth_soc-rework-hardware-flow-table-.patch
target/linux/generic/backport-5.15/702-v5.19-13-net-ethernet-mtk_eth_soc-use-standard-property-for-c.patch
target/linux/generic/backport-5.15/702-v5.19-17-net-ethernet-mtk_eth_soc-rely-on-GFP_KERNEL-for-dma_.patch
target/linux/generic/backport-5.15/702-v5.19-18-net-ethernet-mtk_eth_soc-move-tx-dma-desc-configurat.patch
target/linux/generic/backport-5.15/702-v5.19-19-net-ethernet-mtk_eth_soc-add-txd_size-to-mtk_soc_dat.patch
target/linux/generic/backport-5.15/702-v5.19-20-net-ethernet-mtk_eth_soc-rely-on-txd_size-in-mtk_tx_.patch
target/linux/generic/backport-5.15/702-v5.19-21-net-ethernet-mtk_eth_soc-rely-on-txd_size-in-mtk_des.patch
target/linux/generic/backport-5.15/702-v5.19-22-net-ethernet-mtk_eth_soc-rely-on-txd_size-in-txd_to_.patch
target/linux/generic/backport-5.15/702-v5.19-23-net-ethernet-mtk_eth_soc-add-rxd_size-to-mtk_soc_dat.patch
target/linux/generic/backport-5.15/702-v5.19-24-net-ethernet-mtk_eth_soc-rely-on-txd_size-field-in-m.patch
target/linux/generic/backport-5.15/702-v5.19-25-net-ethernet-mtk_eth_soc-rely-on-rxd_size-field-in-m.patch
target/linux/generic/backport-5.15/702-v5.19-26-net-ethernet-mtk_eth_soc-introduce-device-register-m.patch
target/linux/generic/backport-5.15/702-v5.19-27-net-ethernet-mtk_eth_soc-introduce-MTK_NETSYS_V2-sup.patch
target/linux/generic/backport-5.15/702-v5.19-28-net-ethernet-mtk_eth_soc-convert-ring-dma-pointer-to.patch
target/linux/generic/backport-5.15/702-v5.19-29-net-ethernet-mtk_eth_soc-convert-scratch_ring-pointe.patch
target/linux/generic/backport-5.15/702-v5.19-30-net-ethernet-mtk_eth_soc-introduce-support-for-mt798.patch
target/linux/generic/backport-5.15/702-v5.19-33-net-ethernet-mtk_eth_soc-enable-rx-cksum-offload-for.patch
target/linux/generic/backport-5.15/704-01-v5.17-net-mtk_eth_soc-populate-supported_interfaces-member.patch
target/linux/generic/backport-5.15/704-02-v5.17-net-mtk_eth_soc-remove-interface-checks-in-mtk_valid.patch
target/linux/generic/backport-5.15/704-03-v5.17-net-mtk_eth_soc-drop-use-of-phylink_helper_basex_spe.patch
target/linux/generic/backport-5.15/704-04-v5.17-net-mtk_eth_soc-use-phylink_generic_validate.patch
target/linux/generic/backport-5.15/704-05-v5.17-net-mtk_eth_soc-mark-as-a-legacy_pre_march2020-drive.patch
target/linux/generic/backport-5.15/704-06-v5.19-eth-mtk_eth_soc-remove-a-copy-of-the-NAPI_POLL_WEIGH.patch
target/linux/generic/backport-5.15/704-07-v5.19-mtk_eth_soc-remove-unused-mac-mode.patch
target/linux/generic/backport-5.15/704-11-v5.19-net-mtk_eth_soc-correct-802.3z-duplex-setting.patch
target/linux/generic/backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch [deleted file]
target/linux/generic/backport-5.15/704-18-v5.19-net-mtk_eth_soc-partially-convert-to-phylink_pcs.patch
target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch
target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch
target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch
target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch
target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch
target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch
target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch
target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch
target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch
target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch
target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch
target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch
target/linux/generic/backport-5.15/706-00-v6.0-net-ethernet-mtk_eth_soc-rely-on-page_pool-for-singl.patch
target/linux/generic/backport-5.15/706-01-v6.0-net-ethernet-mtk_eth_soc-add-basic-XDP-support.patch
target/linux/generic/backport-5.15/706-02-v6.0-net-ethernet-mtk_eth_soc-introduce-xdp-ethtool-count.patch
target/linux/generic/backport-5.15/706-03-v6.0-net-ethernet-mtk_eth_soc-add-xmit-XDP-support.patch
target/linux/generic/backport-5.15/706-04-v6.0-net-ethernet-mtk_eth_soc-add-support-for-page_pool_g.patch
target/linux/generic/backport-5.15/706-05-v6.0-net-ethernet-mtk_eth_soc-introduce-mtk_xdp_frame_map.patch
target/linux/generic/backport-5.15/706-06-v6.0-net-ethernet-mtk_eth_soc-introduce-xdp-multi-frag-su.patch
target/linux/generic/backport-5.15/707-v6.3-net-pcs-add-driver-for-MediaTek-SGMII-PCS.patch
target/linux/generic/backport-5.15/710-v6.0-net-ethernet-mtk_eth_soc-fix-hw-hash-reporting-for-M.patch
target/linux/generic/backport-5.15/712-v6.0-net-ethernet-mtk_eth_soc-enable-XDP-support-just-for.patch
target/linux/generic/backport-5.15/713-v6.0-net-ethernet-mtk_eth_soc-move-gdma_to_ppe-and-ppe_ba.patch
target/linux/generic/backport-5.15/714-v6.0-net-ethernet-mtk_eth_soc-move-ppe-table-hash-offset-.patch
target/linux/generic/backport-5.15/715-v6.0-net-ethernet-mtk_eth_soc-add-the-capability-to-run-m.patch
target/linux/generic/backport-5.15/716-v6.0-net-ethernet-mtk_eth_soc-move-wdma_base-definitions-.patch
target/linux/generic/backport-5.15/717-v6.0-net-ethernet-mtk_eth_soc-add-foe_entry_size-to-mtk_e.patch
target/linux/generic/backport-5.15/721-v6.0-net-ethernet-mtk_eth_wed-add-wed-support-for-mt7986-.patch
target/linux/generic/backport-5.15/723-v6.0-net-ethernet-mtk_eth_soc-introduce-flow-offloading-s.patch
target/linux/generic/backport-5.15/724-v6.0-net-ethernet-mtk_eth_soc-enable-flow-offloading-supp.patch
target/linux/generic/backport-5.15/728-v6.1-01-net-ethernet-mtk_eth_soc-fix-possible-memory-leak-in.patch
target/linux/generic/backport-5.15/728-v6.1-04-net-ethernet-mtk_eth_soc-fix-resource-leak-in-error-.patch
target/linux/generic/backport-5.15/728-v6.1-05-net-ethernet-mtk_eth_soc-fix-memory-leak-in-error-pa.patch
target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch
target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch
target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch
target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch
target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch
target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch
target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch
target/linux/generic/backport-5.15/730-02-v6.3-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch
target/linux/generic/backport-5.15/730-03-v6.3-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch
target/linux/generic/backport-5.15/730-04-v6.3-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
target/linux/generic/backport-5.15/730-09-v6.3-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
target/linux/generic/backport-5.15/730-10-v6.3-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch
target/linux/generic/backport-5.15/730-12-v6.3-net-ethernet-mtk_eth_soc-disable-hardware-DSA-untagg.patch
target/linux/generic/backport-5.15/730-13-v6.3-net-ethernet-mtk_eth_soc-enable-special-tag-when-any.patch
target/linux/generic/backport-5.15/730-14-v6.3-net-ethernet-mtk_eth_soc-fix-DSA-TX-tag-hwaccel-for-.patch
target/linux/generic/backport-5.15/730-18-v6.3-net-ethernet-mtk_eth_soc-fix-tx-throughput-regressio.patch
target/linux/generic/backport-5.15/733-v6.3-18-net-ethernet-mtk_eth_soc-add-support-for-MT7981.patch
target/linux/generic/backport-5.15/733-v6.3-19-net-ethernet-mtk_eth_soc-set-MDIO-bus-clock-frequenc.patch
target/linux/generic/backport-5.15/733-v6.3-20-net-ethernet-mtk_eth_soc-switch-to-external-PCS-driv.patch
target/linux/generic/backport-5.15/733-v6.4-24-net-ethernet-mtk_eth_soc-ppe-add-support-for-flow-ac.patch
target/linux/generic/backport-5.15/733-v6.4-26-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch
target/linux/generic/backport-5.15/750-v6.5-01-net-ethernet-mtk_ppe-add-MTK_FOE_ENTRY_V-1-2-_SIZE-m.patch
target/linux/generic/backport-5.15/750-v6.5-02-net-ethernet-mtk_eth_soc-remove-incorrect-PLL-config.patch
target/linux/generic/backport-5.15/750-v6.5-03-net-ethernet-mtk_eth_soc-remove-mac_pcs_get_state-an.patch
target/linux/generic/backport-5.15/750-v6.5-05-net-ethernet-mtk_eth_soc-add-version-in-mtk_soc_data.patch
target/linux/generic/backport-5.15/750-v6.5-07-net-ethernet-mtk_eth_soc-rely-on-MTK_MAX_DEVS-and-re.patch
target/linux/generic/backport-5.15/750-v6.5-08-net-ethernet-mtk_eth_soc-add-NETSYS_V3-version-suppo.patch
target/linux/generic/backport-5.15/750-v6.5-11-net-ethernet-mtk_eth_soc-add-basic-support-for-MT798.patch
target/linux/generic/backport-5.15/750-v6.5-12-net-ethernet-mtk_eth_soc-enable-page_pool-support-fo.patch
target/linux/generic/backport-5.15/750-v6.5-13-net-ethernet-mtk_eth_soc-enable-nft-hw-flowtable_off.patch
target/linux/generic/backport-5.15/750-v6.5-14-net-ethernet-mtk_eth_soc-support-per-flow-accounting.patch
target/linux/generic/backport-5.15/750-v6.5-17-net-ethernet-mtk_eth_soc-add-reset-bits-for-MT7988.patch
target/linux/generic/backport-5.15/750-v6.5-18-net-ethernet-mtk_eth_soc-add-support-for-in-SoC-SRAM.patch
target/linux/generic/backport-5.15/750-v6.5-19-net-ethernet-mtk_eth_soc-support-36-bit-DMA-addressi.patch
target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch
target/linux/generic/backport-5.15/788-v6.3-net-dsa-mt7530-use-external-PCS-driver.patch
target/linux/generic/backport-5.15/790-v6.4-0001-net-dsa-mt7530-make-some-noise-if-register-read-fail.patch
target/linux/generic/backport-5.15/790-v6.4-0002-net-dsa-mt7530-refactor-SGMII-PCS-creation.patch
target/linux/generic/backport-5.15/790-v6.4-0003-net-dsa-mt7530-use-unlocked-regmap-accessors.patch
target/linux/generic/backport-5.15/790-v6.4-0004-net-dsa-mt7530-use-regmap-to-access-switch-register-.patch
target/linux/generic/backport-5.15/790-v6.4-0005-net-dsa-mt7530-move-SGMII-PCS-creation-to-mt7530_pro.patch
target/linux/generic/backport-5.15/790-v6.4-0006-net-dsa-mt7530-introduce-mutex-helpers.patch
target/linux/generic/backport-5.15/790-v6.4-0007-net-dsa-mt7530-move-p5_intf_modes-function-to-mt7530.patch
target/linux/generic/backport-5.15/790-v6.4-0008-net-dsa-mt7530-introduce-mt7530_probe_common-helper-.patch
target/linux/generic/backport-5.15/790-v6.4-0009-net-dsa-mt7530-introduce-mt7530_remove_common-helper.patch
target/linux/generic/backport-5.15/790-v6.4-0011-net-dsa-mt7530-introduce-separate-MDIO-driver.patch
target/linux/generic/backport-5.15/790-v6.4-0012-net-dsa-mt7530-skip-locking-if-MDIO-bus-isn-t-presen.patch
target/linux/generic/backport-5.15/790-v6.4-0013-net-dsa-mt7530-introduce-driver-for-MT7988-built-in-.patch
target/linux/generic/backport-5.15/790-v6.4-0014-net-dsa-mt7530-fix-support-for-MT7531BE.patch
target/linux/generic/backport-5.15/791-v6.2-01-net-phy-Add-driver-for-Motorcomm-yt8521-gigabit-ethernet.patch
target/linux/generic/backport-5.15/804-v5.18-0009-nvmem-Add-driver-for-OCOTP-in-Sunplus-SP7021.patch
target/linux/generic/backport-5.15/806-v6.0-0001-nvmem-microchip-otpc-add-support.patch
target/linux/generic/backport-5.15/820-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch
target/linux/generic/hack-5.15/221-module_exports.patch
target/linux/generic/hack-5.15/259-regmap_dynamic.patch
target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch
target/linux/generic/hack-5.15/901-debloat_sock_diag.patch
target/linux/generic/hack-5.15/902-debloat_proc.patch
target/linux/generic/hack-5.15/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch
target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
target/linux/generic/pending-5.15/610-netfilter_match_bypass_default_checks.patch
target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
target/linux/generic/pending-5.15/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch
target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch
target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch
target/linux/generic/pending-5.15/732-01-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch
target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-fix-remaining-throughput-re.patch
target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch [deleted file]
target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch
target/linux/generic/pending-5.15/760-net-core-add-optional-threading-for-backlog-processi.patch
target/linux/generic/pending-5.15/795-mt7530-register-OF-node-for-internal-MDIO-bus.patch
target/linux/generic/pending-5.15/810-pci_disable_common_quirks.patch
target/linux/generic/pending-5.15/920-mangle_bootargs.patch

index e4ba77cdfb37a5837c82842f3e65b347e542328c..f41cda1875086be73ff1eb562704b74c42bf9938 100644 (file)
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.15 = .151
-LINUX_KERNEL_HASH-5.15.151 = 949bf930704cb794e0d282b68cee48e6430a15e865b39a184ce052b3cb1305a9
+LINUX_VERSION-5.15 = .156
+LINUX_KERNEL_HASH-5.15.156 = 9623674a3a866a0d1d81808f973a8528ecdc4d36ec12bcdbe5149bbee51f6390
index 1dddebfed736986363149ba81d6fd3c6c45d91d3..70c99d18f353c434a758260b4c62a30803d78ec9 100644 (file)
@@ -539,6 +539,7 @@ define KernelPackage/fs-nfsd
   DEPENDS:=+kmod-fs-nfs-common +kmod-fs-exportfs +kmod-fs-nfs-common-rpcsec
   KCONFIG:= \
        CONFIG_NFSD \
+       CONFIG_NFSD_V2=n \
        CONFIG_NFSD_V4=y \
        CONFIG_NFSD_V4_SECURITY_LABEL=n \
        CONFIG_NFSD_BLOCKLAYOUT=n \
index 969d721da61523b2a6e9eb0ff85ecb37b290bd8a..85710eb79b8f310e1e3fce67ba417e545ecfcfec 100644 (file)
@@ -552,7 +552,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 --- a/kernel/bounds.c
 +++ b/kernel/bounds.c
 @@ -22,6 +22,11 @@ int main(void)
-       DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
+       DEFINE(NR_CPUS_BITS, bits_per(CONFIG_NR_CPUS));
  #endif
        DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
 +#ifdef CONFIG_LRU_GEN
index f8a7d9bd7f6747bb1c81e3e7eb1b923f4a6147d5..14fc73f84de4c158e07ca9d9d7bf1c26058f6bab 100644 (file)
@@ -1251,7 +1251,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
        get_scan_count(lruvec, sc, nr);
  
        /* Record the original scan target for proportional adjustments later */
-@@ -3372,6 +4142,9 @@ static void snapshot_refaults(struct mem
+@@ -3375,6 +4145,9 @@ static void snapshot_refaults(struct mem
        struct lruvec *target_lruvec;
        unsigned long refaults;
  
@@ -1261,7 +1261,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
        target_lruvec = mem_cgroup_lruvec(target_memcg, pgdat);
        refaults = lruvec_page_state(target_lruvec, WORKINGSET_ACTIVATE_ANON);
        target_lruvec->refaults[0] = refaults;
-@@ -3736,12 +4509,16 @@ unsigned long try_to_free_mem_cgroup_pag
+@@ -3739,12 +4512,16 @@ unsigned long try_to_free_mem_cgroup_pag
  }
  #endif
  
@@ -1280,7 +1280,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
        if (!can_age_anon_pages(pgdat, sc))
                return;
  
-@@ -4058,12 +4835,11 @@ restart:
+@@ -4061,12 +4838,11 @@ restart:
                sc.may_swap = !nr_boost_reclaim;
  
                /*
index 234dfd916f08871578172b452c49001e73e7c6a6..4cfd24717815bc2db9bcf364105379b34e9119e7 100644 (file)
@@ -149,7 +149,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 
 --- a/fs/exec.c
 +++ b/fs/exec.c
-@@ -1013,6 +1013,7 @@ static int exec_mmap(struct mm_struct *m
+@@ -1014,6 +1014,7 @@ static int exec_mmap(struct mm_struct *m
        active_mm = tsk->active_mm;
        tsk->active_mm = mm;
        tsk->mm = mm;
@@ -157,7 +157,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
        /*
         * This prevents preemption while active_mm is being loaded and
         * it and mm are being updated, which could cause problems for
-@@ -1028,6 +1029,7 @@ static int exec_mmap(struct mm_struct *m
+@@ -1029,6 +1030,7 @@ static int exec_mmap(struct mm_struct *m
        tsk->mm->vmacache_seqnum = 0;
        vmacache_flush(tsk);
        task_unlock(tsk);
index 5b1d378504a8002f3cc881a8f1a366b4dd281f06..b1319d98a3cb1fab63353207b6fcc18e37458a64 100644 (file)
@@ -31,7 +31,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 
 --- a/fs/exec.c
 +++ b/fs/exec.c
-@@ -1013,7 +1013,6 @@ static int exec_mmap(struct mm_struct *m
+@@ -1014,7 +1014,6 @@ static int exec_mmap(struct mm_struct *m
        active_mm = tsk->active_mm;
        tsk->active_mm = mm;
        tsk->mm = mm;
@@ -39,7 +39,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
        /*
         * This prevents preemption while active_mm is being loaded and
         * it and mm are being updated, which could cause problems for
-@@ -1028,6 +1027,7 @@ static int exec_mmap(struct mm_struct *m
+@@ -1029,6 +1028,7 @@ static int exec_mmap(struct mm_struct *m
                local_irq_enable();
        tsk->mm->vmacache_seqnum = 0;
        vmacache_flush(tsk);
index 8cc9abd84f09e2ab83160c3bbd4fec6efa777601..cfeeaa662a0b1fc97e3624badc20304229216b73 100644 (file)
@@ -354,7 +354,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  static void mem_cgroup_css_free(struct cgroup_subsys_state *css)
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
-@@ -7661,6 +7661,7 @@ static void __init free_area_init_node(i
+@@ -7663,6 +7663,7 @@ static void __init free_area_init_node(i
        pgdat_set_deferred_range(pgdat);
  
        free_area_init_core(pgdat);
diff --git a/target/linux/generic/backport-5.15/081-v5.17-regmap-allow-to-define-reg_update_bits-for-no-bus.patch b/target/linux/generic/backport-5.15/081-v5.17-regmap-allow-to-define-reg_update_bits-for-no-bus.patch
deleted file mode 100644 (file)
index e4c0833..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-From 02d6fdecb9c38de19065f6bed8d5214556fd061d Mon Sep 17 00:00:00 2001
-From: Ansuel Smith <ansuelsmth@gmail.com>
-Date: Thu, 4 Nov 2021 16:00:40 +0100
-Subject: regmap: allow to define reg_update_bits for no bus configuration
-
-Some device requires a special handling for reg_update_bits and can't use
-the normal regmap read write logic. An example is when locking is
-handled by the device and rmw operations requires to do atomic operations.
-Allow to declare a dedicated function in regmap_config for
-reg_update_bits in no bus configuration.
-
-Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
-Link: https://lore.kernel.org/r/20211104150040.1260-1-ansuelsmth@gmail.com
-Signed-off-by: Mark Brown <broonie@kernel.org>
----
- drivers/base/regmap/regmap.c | 1 +
- include/linux/regmap.h       | 7 +++++++
- 2 files changed, 8 insertions(+)
-
---- a/drivers/base/regmap/regmap.c
-+++ b/drivers/base/regmap/regmap.c
-@@ -877,6 +877,7 @@ struct regmap *__regmap_init(struct devi
-       if (!bus) {
-               map->reg_read  = config->reg_read;
-               map->reg_write = config->reg_write;
-+              map->reg_update_bits = config->reg_update_bits;
-               map->defer_caching = false;
-               goto skip_format_initialization;
---- a/include/linux/regmap.h
-+++ b/include/linux/regmap.h
-@@ -290,6 +290,11 @@ typedef void (*regmap_unlock)(void *);
-  *              read operation on a bus such as SPI, I2C, etc. Most of the
-  *              devices do not need this.
-  * @reg_write:          Same as above for writing.
-+ * @reg_update_bits: Optional callback that if filled will be used to perform
-+ *                 all the update_bits(rmw) operation. Should only be provided
-+ *                 if the function require special handling with lock and reg
-+ *                 handling and the operation cannot be represented as a simple
-+ *                 update_bits operation on a bus such as SPI, I2C, etc.
-  * @fast_io:    Register IO is fast. Use a spinlock instead of a mutex
-  *              to perform locking. This field is ignored if custom lock/unlock
-  *              functions are used (see fields lock/unlock of struct regmap_config).
-@@ -372,6 +377,8 @@ struct regmap_config {
-       int (*reg_read)(void *context, unsigned int reg, unsigned int *val);
-       int (*reg_write)(void *context, unsigned int reg, unsigned int val);
-+      int (*reg_update_bits)(void *context, unsigned int reg,
-+                             unsigned int mask, unsigned int val);
-       bool fast_io;
index 7bb328f3a6de9ad3a48051732a68ce1b811ee5f8..175df150cccdfd7050a41a9a980355902d1bd9f8 100644 (file)
@@ -37,7 +37,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        map->format.val_bytes = DIV_ROUND_UP(config->val_bits, 8);
        map->format.buf_size = DIV_ROUND_UP(config->reg_bits +
                        config->val_bits + config->pad_bits, 8);
-@@ -1737,6 +1738,7 @@ static int _regmap_raw_write_impl(struct
+@@ -1750,6 +1751,7 @@ static int _regmap_raw_write_impl(struct
                        return ret;
        }
  
@@ -45,7 +45,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        map->format.format_reg(map->work_buf, reg, map->reg_shift);
        regmap_set_work_buf_flag_mask(map, map->format.reg_bytes,
                                      map->write_flag_mask);
-@@ -1907,6 +1909,7 @@ static int _regmap_bus_formatted_write(v
+@@ -1920,6 +1922,7 @@ static int _regmap_bus_formatted_write(v
                        return ret;
        }
  
@@ -53,7 +53,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        map->format.format_write(map, reg, val);
  
        trace_regmap_hw_write_start(map, reg, 1);
-@@ -2348,6 +2351,7 @@ static int _regmap_raw_multi_reg_write(s
+@@ -2360,6 +2363,7 @@ static int _regmap_raw_multi_reg_write(s
                unsigned int reg = regs[i].reg;
                unsigned int val = regs[i].def;
                trace_regmap_hw_write_start(map, reg, 1);
@@ -61,7 +61,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
                map->format.format_reg(u8, reg, map->reg_shift);
                u8 += reg_bytes + pad_bytes;
                map->format.format_val(u8, val, 0);
-@@ -2675,6 +2679,7 @@ static int _regmap_raw_read(struct regma
+@@ -2685,6 +2689,7 @@ static int _regmap_raw_read(struct regma
                        return ret;
        }
  
@@ -80,7 +80,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
   * @pad_bits: Number of bits of padding between register and value.
   * @val_bits: Number of bits in a register value, mandatory.
   *
-@@ -360,6 +362,7 @@ struct regmap_config {
+@@ -366,6 +368,7 @@ struct regmap_config {
  
        int reg_bits;
        int reg_stride;
index 841f8d45286fe0aca4f607fcbbb8f401151f91ff..df716c4b651c263d2c87c9140523ec4ad6a4a907 100644 (file)
@@ -42,7 +42,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        map->format.reg_bytes = DIV_ROUND_UP(config->reg_bits, 8);
        map->format.pad_bytes = config->pad_bits / 8;
        map->format.reg_downshift = config->reg_downshift;
-@@ -1738,6 +1740,7 @@ static int _regmap_raw_write_impl(struct
+@@ -1751,6 +1753,7 @@ static int _regmap_raw_write_impl(struct
                        return ret;
        }
  
@@ -50,7 +50,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        reg >>= map->format.reg_downshift;
        map->format.format_reg(map->work_buf, reg, map->reg_shift);
        regmap_set_work_buf_flag_mask(map, map->format.reg_bytes,
-@@ -1909,6 +1912,7 @@ static int _regmap_bus_formatted_write(v
+@@ -1922,6 +1925,7 @@ static int _regmap_bus_formatted_write(v
                        return ret;
        }
  
@@ -58,7 +58,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        reg >>= map->format.reg_downshift;
        map->format.format_write(map, reg, val);
  
-@@ -2351,6 +2355,7 @@ static int _regmap_raw_multi_reg_write(s
+@@ -2363,6 +2367,7 @@ static int _regmap_raw_multi_reg_write(s
                unsigned int reg = regs[i].reg;
                unsigned int val = regs[i].def;
                trace_regmap_hw_write_start(map, reg, 1);
@@ -66,7 +66,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
                reg >>= map->format.reg_downshift;
                map->format.format_reg(u8, reg, map->reg_shift);
                u8 += reg_bytes + pad_bytes;
-@@ -2679,6 +2684,7 @@ static int _regmap_raw_read(struct regma
+@@ -2689,6 +2694,7 @@ static int _regmap_raw_read(struct regma
                        return ret;
        }
  
@@ -85,7 +85,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
   * @pad_bits: Number of bits of padding between register and value.
   * @val_bits: Number of bits in a register value, mandatory.
   *
-@@ -363,6 +365,7 @@ struct regmap_config {
+@@ -369,6 +371,7 @@ struct regmap_config {
        int reg_bits;
        int reg_stride;
        int reg_downshift;
index bc3865c75b92afff02d9c299f46b371eb9f2ef4a..33de94cb17b25e2f3672ca3d1578c24bedfedfcf 100644 (file)
@@ -28,7 +28,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
 
 --- a/drivers/base/regmap/regmap.c
 +++ b/drivers/base/regmap/regmap.c
-@@ -1931,6 +1931,8 @@ static int _regmap_bus_reg_write(void *c
+@@ -1943,6 +1943,8 @@ static int _regmap_bus_reg_write(void *c
  {
        struct regmap *map = context;
  
@@ -37,7 +37,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        return map->bus->reg_write(map->bus_context, reg, val);
  }
  
-@@ -2705,6 +2707,8 @@ static int _regmap_bus_reg_read(void *co
+@@ -2715,6 +2717,8 @@ static int _regmap_bus_reg_read(void *co
  {
        struct regmap *map = context;
  
@@ -46,7 +46,7 @@ Signed-off-by: Mark Brown <broonie@kernel.org>
        return map->bus->reg_read(map->bus_context, reg, val);
  }
  
-@@ -3080,6 +3084,8 @@ static int _regmap_update_bits(struct re
+@@ -3084,6 +3088,8 @@ static int _regmap_update_bits(struct re
                *change = false;
  
        if (regmap_volatile(map, reg) && map->reg_update_bits) {
index e5d02cfa9772641cbd5ed4d2815dc8608b0fc63f..fd583e80f4eb61df9aa336eb6d11dec263822058 100644 (file)
@@ -20,7 +20,7 @@ Link: https://lore.kernel.org/bpf/d5dc039c3d4123426e7023a488c449181a7bc57f.16469
 
 --- a/drivers/net/veth.c
 +++ b/drivers/net/veth.c
-@@ -1457,9 +1457,14 @@ static int veth_xdp_set(struct net_devic
+@@ -1455,9 +1455,14 @@ static int veth_xdp_set(struct net_devic
                        goto err;
                }
  
index 3e7612b0d90c17a9d8e1949a2431f98c6e957f0b..2bace3baac87b3d77a388586f5aadd92ca2659e4 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #include <linux/mfd/syscon.h>
  #include <linux/regmap.h>
  #include <linux/clk.h>
-@@ -840,7 +841,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -850,7 +851,7 @@ static int mtk_init_fq_dma(struct mtk_et
        dma_addr_t dma_addr;
        int i;
  
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                               cnt * sizeof(struct mtk_tx_dma),
                                               &eth->phy_scratch_ring,
                                               GFP_ATOMIC);
-@@ -852,10 +853,10 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -862,10 +863,10 @@ static int mtk_init_fq_dma(struct mtk_et
        if (unlikely(!eth->scratch_head))
                return -ENOMEM;
  
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                return -ENOMEM;
  
        phy_ring_tail = eth->phy_scratch_ring +
-@@ -909,26 +910,26 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -919,26 +920,26 @@ static void mtk_tx_unmap(struct mtk_eth
  {
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
                if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
@@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                       dma_unmap_addr(tx_buf, dma_addr1),
                                       dma_unmap_len(tx_buf, dma_len1),
                                       DMA_TO_DEVICE);
-@@ -1006,9 +1007,9 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1016,9 +1017,9 @@ static int mtk_tx_map(struct sk_buff *sk
        if (skb_vlan_tag_present(skb))
                txd4 |= TX_DMA_INS_VLAN | skb_vlan_tag_get(skb);
  
@@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                return -ENOMEM;
  
        WRITE_ONCE(itxd->txd1, mapped_addr);
-@@ -1047,10 +1048,10 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1057,10 +1058,10 @@ static int mtk_tx_map(struct sk_buff *sk
  
  
                        frag_map_size = min(frag_size, MTK_TX_DMA_BUF_LEN);
@@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                goto err_dma;
  
                        if (i == nr_frags - 1 &&
-@@ -1331,18 +1332,18 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1341,18 +1342,18 @@ static int mtk_poll_rx(struct napi_struc
                        netdev->stats.rx_dropped++;
                        goto release_desc;
                }
@@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                 ring->buf_size, DMA_FROM_DEVICE);
  
                /* receive data */
-@@ -1615,7 +1616,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1625,7 +1626,7 @@ static int mtk_tx_alloc(struct mtk_eth *
        if (!ring->buf)
                goto no_tx_mem;
  
@@ -129,7 +129,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                       &ring->phys, GFP_ATOMIC);
        if (!ring->dma)
                goto no_tx_mem;
-@@ -1633,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1643,7 +1644,7 @@ static int mtk_tx_alloc(struct mtk_eth *
         * descriptors in ring->dma_pdma.
         */
        if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@@ -138,7 +138,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                                    &ring->phys_pdma,
                                                    GFP_ATOMIC);
                if (!ring->dma_pdma)
-@@ -1692,7 +1693,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1702,7 +1703,7 @@ static void mtk_tx_clean(struct mtk_eth
        }
  
        if (ring->dma) {
@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  MTK_DMA_SIZE * sizeof(*ring->dma),
                                  ring->dma,
                                  ring->phys);
-@@ -1700,7 +1701,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1710,7 +1711,7 @@ static void mtk_tx_clean(struct mtk_eth
        }
  
        if (ring->dma_pdma) {
@@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  MTK_DMA_SIZE * sizeof(*ring->dma_pdma),
                                  ring->dma_pdma,
                                  ring->phys_pdma);
-@@ -1748,18 +1749,18 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1758,18 +1759,18 @@ static int mtk_rx_alloc(struct mtk_eth *
                        return -ENOMEM;
        }
  
@@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        return -ENOMEM;
                ring->dma[i].rxd1 = (unsigned int)dma_addr;
  
-@@ -1795,7 +1796,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1805,7 +1806,7 @@ static void mtk_rx_clean(struct mtk_eth
                                continue;
                        if (!ring->dma[i].rxd1)
                                continue;
@@ -187,7 +187,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                         ring->dma[i].rxd1,
                                         ring->buf_size,
                                         DMA_FROM_DEVICE);
-@@ -1806,7 +1807,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1816,7 +1817,7 @@ static void mtk_rx_clean(struct mtk_eth
        }
  
        if (ring->dma) {
@@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  ring->dma_size * sizeof(*ring->dma),
                                  ring->dma,
                                  ring->phys);
-@@ -2165,7 +2166,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -2175,7 +2176,7 @@ static void mtk_dma_free(struct mtk_eth
                if (eth->netdev[i])
                        netdev_reset_queue(eth->netdev[i]);
        if (eth->scratch_ring) {
@@ -205,7 +205,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  MTK_DMA_SIZE * sizeof(struct mtk_tx_dma),
                                  eth->scratch_ring,
                                  eth->phy_scratch_ring);
-@@ -2517,6 +2518,8 @@ static void mtk_dim_tx(struct work_struc
+@@ -2527,6 +2528,8 @@ static void mtk_dim_tx(struct work_struc
  
  static int mtk_hw_init(struct mtk_eth *eth)
  {
@@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        int i, val, ret;
  
        if (test_and_set_bit(MTK_HW_INIT, &eth->state))
-@@ -2529,6 +2532,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2539,6 +2542,10 @@ static int mtk_hw_init(struct mtk_eth *e
        if (ret)
                goto err_disable_pm;
  
@@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
                ret = device_reset(eth->dev);
                if (ret) {
-@@ -3075,6 +3082,35 @@ free_netdev:
+@@ -3085,6 +3092,35 @@ free_netdev:
        return err;
  }
  
@@ -261,7 +261,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static int mtk_probe(struct platform_device *pdev)
  {
        struct device_node *mac_np;
-@@ -3088,6 +3124,7 @@ static int mtk_probe(struct platform_dev
+@@ -3098,6 +3134,7 @@ static int mtk_probe(struct platform_dev
        eth->soc = of_device_get_match_data(&pdev->dev);
  
        eth->dev = &pdev->dev;
@@ -269,7 +269,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        eth->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(eth->base))
                return PTR_ERR(eth->base);
-@@ -3136,6 +3173,16 @@ static int mtk_probe(struct platform_dev
+@@ -3146,6 +3183,16 @@ static int mtk_probe(struct platform_dev
                }
        }
  
index ba72a796ee3f74d9f7e0b87adf51b7b7d80cf3bc..85dc9ad6fc6139bcd6c06ee682a4448d8ba51d53 100644 (file)
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
  static int mtk_msg_level = -1;
  module_param_named(msg_level, mtk_msg_level, int, 0);
-@@ -3205,6 +3206,22 @@ static int mtk_probe(struct platform_dev
+@@ -3215,6 +3216,22 @@ static int mtk_probe(struct platform_dev
                }
        }
  
index 030a3346768afcba600e2870a93e321c7ef9cdc6..488a79924f15e53149c6952df5287dcab90aad0f 100644 (file)
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2338,7 +2338,7 @@ static int mtk_open(struct net_device *d
+@@ -2348,7 +2348,7 @@ static int mtk_open(struct net_device *d
                        return err;
                }
  
@@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        gdm_config = MTK_GDMA_TO_PPE;
  
                mtk_gdm_config(eth, gdm_config);
-@@ -2412,7 +2412,7 @@ static int mtk_stop(struct net_device *d
+@@ -2422,7 +2422,7 @@ static int mtk_stop(struct net_device *d
        mtk_dma_free(eth);
  
        if (eth->soc->offload_version)
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        return 0;
  }
-@@ -3297,10 +3297,11 @@ static int mtk_probe(struct platform_dev
+@@ -3307,10 +3307,11 @@ static int mtk_probe(struct platform_dev
        }
  
        if (eth->soc->offload_version) {
index 0bb3f906accfe5046b86136fa5d1ba11e45038cc..182c6afb78d3a846e7cf440de114ac8593b5abec 100644 (file)
@@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #include <net/dsa.h>
  
  #include "mtk_eth_soc.h"
-@@ -1293,7 +1294,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1303,7 +1304,7 @@ static int mtk_poll_rx(struct napi_struc
                struct net_device *netdev;
                unsigned int pktlen;
                dma_addr_t dma_addr;
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                int mac;
  
                ring = mtk_get_rx_ring(eth);
-@@ -1372,6 +1373,11 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1382,6 +1383,11 @@ static int mtk_poll_rx(struct napi_struc
                        skb_set_hash(skb, hash, PKT_HASH_TYPE_L4);
                }
  
@@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
                    (trxd.rxd2 & RX_DMA_VTAG))
                        __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
-@@ -3297,7 +3303,7 @@ static int mtk_probe(struct platform_dev
+@@ -3307,7 +3313,7 @@ static int mtk_probe(struct platform_dev
        }
  
        if (eth->soc->offload_version) {
index fe5b9263df9a585f506779f447d60c3391bd5cd4..70d46c16cdb7cc4989dd41305e10113f77962262 100644 (file)
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                mediatek,hifsys = <&hifsys>;
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3184,7 +3184,7 @@ static int mtk_probe(struct platform_dev
+@@ -3194,7 +3194,7 @@ static int mtk_probe(struct platform_dev
                struct regmap *cci;
  
                cci = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
index 9b6321f1dafbddca9e23f81f14774ef753cc4dab..268b372388f98e6a1d8d3ea63a98103b2949f134 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -846,7 +846,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -856,7 +856,7 @@ static int mtk_init_fq_dma(struct mtk_et
        eth->scratch_ring = dma_alloc_coherent(eth->dma_dev,
                                               cnt * sizeof(struct mtk_tx_dma),
                                               &eth->phy_scratch_ring,
@@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (unlikely(!eth->scratch_ring))
                return -ENOMEM;
  
-@@ -1624,7 +1624,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1634,7 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
                goto no_tx_mem;
  
        ring->dma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
@@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (!ring->dma)
                goto no_tx_mem;
  
-@@ -1642,8 +1642,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1652,8 +1652,7 @@ static int mtk_tx_alloc(struct mtk_eth *
         */
        if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
                ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                if (!ring->dma_pdma)
                        goto no_tx_mem;
  
-@@ -1758,7 +1757,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1768,7 +1767,7 @@ static int mtk_rx_alloc(struct mtk_eth *
  
        ring->dma = dma_alloc_coherent(eth->dma_dev,
                                       rx_dma_size * sizeof(*ring->dma),
index 8e16ea2556695cbcf856564f3b331b50343ef7d7..dc85786be29470ef54d3f4fbcaf5fa075de0ed4f 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -972,18 +972,51 @@ static void setup_tx_buf(struct mtk_eth
+@@ -982,18 +982,51 @@ static void setup_tx_buf(struct mtk_eth
        }
  }
  
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int k = 0;
  
        itxd = ring->next_free;
-@@ -991,49 +1024,32 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1001,49 +1034,32 @@ static int mtk_tx_map(struct sk_buff *sk
        if (itxd == ring->last_free)
                return -ENOMEM;
  
@@ -126,7 +126,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        bool new_desc = true;
  
                        if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA) ||
-@@ -1048,23 +1064,17 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1058,23 +1074,17 @@ static int mtk_tx_map(struct sk_buff *sk
                                new_desc = false;
                        }
  
@@ -159,7 +159,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                        tx_buf = mtk_desc_to_tx_buf(ring, txd);
                        if (new_desc)
-@@ -1074,20 +1084,17 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1084,20 +1094,17 @@ static int mtk_tx_map(struct sk_buff *sk
                        tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 :
                                         MTK_TX_FLAGS_FPORT1;
  
index cadebbfa7551ecb5174577ed349adf3f17f41ef5..7e05181b5e39e55ef9aa0f6939204da1b4222936 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -838,20 +838,20 @@ static void *mtk_max_lro_buf_alloc(gfp_t
+@@ -848,20 +848,20 @@ static void *mtk_max_lro_buf_alloc(gfp_t
  /* the qdma core needs scratch memory to be setup */
  static int mtk_init_fq_dma(struct mtk_eth *eth)
  {
@@ -38,7 +38,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (unlikely(!eth->scratch_head))
                return -ENOMEM;
  
-@@ -861,16 +861,19 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -871,16 +871,19 @@ static int mtk_init_fq_dma(struct mtk_et
        if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
                return -ENOMEM;
  
@@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        mtk_w32(eth, eth->phy_scratch_ring, MTK_QDMA_FQ_HEAD);
-@@ -2173,6 +2176,7 @@ static int mtk_dma_init(struct mtk_eth *
+@@ -2183,6 +2186,7 @@ static int mtk_dma_init(struct mtk_eth *
  
  static void mtk_dma_free(struct mtk_eth *eth)
  {
@@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int i;
  
        for (i = 0; i < MTK_MAC_COUNT; i++)
-@@ -2180,9 +2184,8 @@ static void mtk_dma_free(struct mtk_eth
+@@ -2190,9 +2194,8 @@ static void mtk_dma_free(struct mtk_eth
                        netdev_reset_queue(eth->netdev[i]);
        if (eth->scratch_ring) {
                dma_free_coherent(eth->dma_dev,
@@ -85,7 +85,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                eth->scratch_ring = NULL;
                eth->phy_scratch_ring = 0;
        }
-@@ -3387,6 +3390,9 @@ static const struct mtk_soc_data mt2701_
+@@ -3397,6 +3400,9 @@ static const struct mtk_soc_data mt2701_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7623_CLKS_BITMAP,
        .required_pctl = true,
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  static const struct mtk_soc_data mt7621_data = {
-@@ -3395,6 +3401,9 @@ static const struct mtk_soc_data mt7621_
+@@ -3405,6 +3411,9 @@ static const struct mtk_soc_data mt7621_
        .required_clks = MT7621_CLKS_BITMAP,
        .required_pctl = false,
        .offload_version = 2,
@@ -105,7 +105,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  static const struct mtk_soc_data mt7622_data = {
-@@ -3404,6 +3413,9 @@ static const struct mtk_soc_data mt7622_
+@@ -3414,6 +3423,9 @@ static const struct mtk_soc_data mt7622_
        .required_clks = MT7622_CLKS_BITMAP,
        .required_pctl = false,
        .offload_version = 2,
@@ -115,7 +115,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  static const struct mtk_soc_data mt7623_data = {
-@@ -3412,6 +3424,9 @@ static const struct mtk_soc_data mt7623_
+@@ -3422,6 +3434,9 @@ static const struct mtk_soc_data mt7623_
        .required_clks = MT7623_CLKS_BITMAP,
        .required_pctl = true,
        .offload_version = 2,
@@ -125,7 +125,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  static const struct mtk_soc_data mt7629_data = {
-@@ -3420,6 +3435,9 @@ static const struct mtk_soc_data mt7629_
+@@ -3430,6 +3445,9 @@ static const struct mtk_soc_data mt7629_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7629_CLKS_BITMAP,
        .required_pctl = false,
@@ -135,7 +135,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  static const struct mtk_soc_data rt5350_data = {
-@@ -3427,6 +3445,9 @@ static const struct mtk_soc_data rt5350_
+@@ -3437,6 +3455,9 @@ static const struct mtk_soc_data rt5350_
        .hw_features = MTK_HW_FEATURES_MT7628,
        .required_clks = MT7628_CLKS_BITMAP,
        .required_pctl = false,
index ebe1ee3d59a45ca0fc10ac9845150a1223122792..0547d7874f3d10eac25ed61b93ac716651e45c3e 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1625,8 +1625,10 @@ static int mtk_napi_rx(struct napi_struc
+@@ -1635,8 +1635,10 @@ static int mtk_napi_rx(struct napi_struc
  
  static int mtk_tx_alloc(struct mtk_eth *eth)
  {
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
                               GFP_KERNEL);
-@@ -1642,8 +1644,10 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1652,8 +1654,10 @@ static int mtk_tx_alloc(struct mtk_eth *
                int next = (i + 1) % MTK_DMA_SIZE;
                u32 next_ptr = ring->phys + next * sz;
  
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        /* On MT7688 (PDMA only) this driver uses the ring->dma structs
-@@ -1665,7 +1669,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1675,7 +1679,7 @@ static int mtk_tx_alloc(struct mtk_eth *
        ring->dma_size = MTK_DMA_SIZE;
        atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
        ring->next_free = &ring->dma[0];
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
        ring->thresh = MAX_SKB_FRAGS;
  
-@@ -1698,6 +1702,7 @@ no_tx_mem:
+@@ -1708,6 +1712,7 @@ no_tx_mem:
  
  static void mtk_tx_clean(struct mtk_eth *eth)
  {
@@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct mtk_tx_ring *ring = &eth->tx_ring;
        int i;
  
-@@ -1710,17 +1715,15 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1720,17 +1725,15 @@ static void mtk_tx_clean(struct mtk_eth
  
        if (ring->dma) {
                dma_free_coherent(eth->dma_dev,
index 053412e7490a7c4964fa380e11b3a3b67f27004d..b76d69c50e4da2e7f2c023296fa42104504d26ca 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -891,10 +891,11 @@ static inline void *mtk_qdma_phys_to_vir
+@@ -901,10 +901,11 @@ static inline void *mtk_qdma_phys_to_vir
        return ret + (desc - ring->phys);
  }
  
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return &ring->buf[idx];
  }
-@@ -1016,6 +1017,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1026,6 +1027,7 @@ static int mtk_tx_map(struct sk_buff *sk
        };
        struct mtk_mac *mac = netdev_priv(dev);
        struct mtk_eth *eth = mac->hw;
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct mtk_tx_dma *itxd, *txd;
        struct mtk_tx_dma *itxd_pdma, *txd_pdma;
        struct mtk_tx_buf *itx_buf, *tx_buf;
-@@ -1027,7 +1029,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1037,7 +1039,7 @@ static int mtk_tx_map(struct sk_buff *sk
        if (itxd == ring->last_free)
                return -ENOMEM;
  
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        memset(itx_buf, 0, sizeof(*itx_buf));
  
        txd_info.addr = dma_map_single(eth->dma_dev, skb->data, txd_info.size,
-@@ -1055,7 +1057,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1065,7 +1067,7 @@ static int mtk_tx_map(struct sk_buff *sk
                while (frag_size) {
                        bool new_desc = true;
  
@@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                            (i & 0x1)) {
                                txd = mtk_qdma_phys_to_virt(ring, txd->txd2);
                                txd_pdma = qdma_to_pdma(ring, txd);
-@@ -1079,7 +1081,8 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1089,7 +1091,8 @@ static int mtk_tx_map(struct sk_buff *sk
  
                        mtk_tx_set_dma_desc(dev, txd, &txd_info);
  
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        if (new_desc)
                                memset(tx_buf, 0, sizeof(*tx_buf));
                        tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC;
-@@ -1098,7 +1101,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1108,7 +1111,7 @@ static int mtk_tx_map(struct sk_buff *sk
        /* store skb to cleanup */
        itx_buf->skb = skb;
  
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                if (k & 0x1)
                        txd_pdma->txd2 |= TX_DMA_LS0;
                else
-@@ -1116,7 +1119,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1126,7 +1129,7 @@ static int mtk_tx_map(struct sk_buff *sk
         */
        wmb();
  
@@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) ||
                    !netdev_xmit_more())
                        mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR);
-@@ -1130,13 +1133,13 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1140,13 +1143,13 @@ static int mtk_tx_map(struct sk_buff *sk
  
  err_dma:
        do {
@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        itxd_pdma->txd2 = TX_DMA_DESP2_DEF;
  
                itxd = mtk_qdma_phys_to_virt(ring, itxd->txd2);
-@@ -1450,7 +1453,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1460,7 +1463,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
                if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0)
                        break;
  
index 251d583f2966e91099ba1b376b27a3384348d0b4..99ee2c5cf913b09d6a92d74b60d1022d015098a5 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -906,9 +906,10 @@ static struct mtk_tx_dma *qdma_to_pdma(s
+@@ -916,9 +916,10 @@ static struct mtk_tx_dma *qdma_to_pdma(s
        return ring->dma_pdma - ring->dma + dma;
  }
  
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
-@@ -1124,8 +1125,10 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1134,8 +1135,10 @@ static int mtk_tx_map(struct sk_buff *sk
                    !netdev_xmit_more())
                        mtk_w32(eth, txd->txd2, MTK_QTX_CTX_PTR);
        } else {
index 525882c956b2df853e1cf9d95a5703744bcfb1c6..27bf69b58c14e14b582143e9a3c53b24de1f33cf 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1776,7 +1776,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1786,7 +1786,7 @@ static int mtk_rx_alloc(struct mtk_eth *
        }
  
        ring->dma = dma_alloc_coherent(eth->dma_dev,
@@ -22,7 +22,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                                       &ring->phys, GFP_KERNEL);
        if (!ring->dma)
                return -ENOMEM;
-@@ -1834,9 +1834,8 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1844,9 +1844,8 @@ static void mtk_rx_clean(struct mtk_eth
  
        if (ring->dma) {
                dma_free_coherent(eth->dma_dev,
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                ring->dma = NULL;
        }
  }
-@@ -3402,6 +3401,7 @@ static const struct mtk_soc_data mt2701_
+@@ -3412,6 +3411,7 @@ static const struct mtk_soc_data mt2701_
        .required_pctl = true,
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3413,6 +3413,7 @@ static const struct mtk_soc_data mt7621_
+@@ -3423,6 +3423,7 @@ static const struct mtk_soc_data mt7621_
        .offload_version = 2,
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
@@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3425,6 +3426,7 @@ static const struct mtk_soc_data mt7622_
+@@ -3435,6 +3436,7 @@ static const struct mtk_soc_data mt7622_
        .offload_version = 2,
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
@@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3436,6 +3438,7 @@ static const struct mtk_soc_data mt7623_
+@@ -3446,6 +3448,7 @@ static const struct mtk_soc_data mt7623_
        .offload_version = 2,
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3447,6 +3450,7 @@ static const struct mtk_soc_data mt7629_
+@@ -3457,6 +3460,7 @@ static const struct mtk_soc_data mt7629_
        .required_pctl = false,
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
@@ -74,7 +74,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3457,6 +3461,7 @@ static const struct mtk_soc_data rt5350_
+@@ -3467,6 +3471,7 @@ static const struct mtk_soc_data rt5350_
        .required_pctl = false,
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
index eb92b8c7a22e8d5186806918064006598a3b00ca..393faf65534583ca86f735c0015c7c387217e7ad 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1265,9 +1265,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri
+@@ -1275,9 +1275,12 @@ static struct mtk_rx_ring *mtk_get_rx_ri
                return &eth->rx_ring[0];
  
        for (i = 0; i < MTK_MAX_RX_RING_NUM; i++) {
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        ring->calc_idx_update = true;
                        return ring;
                }
-@@ -1318,7 +1321,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1328,7 +1331,7 @@ static int mtk_poll_rx(struct napi_struc
                        goto rx_done;
  
                idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                data = ring->data[idx];
  
                if (!mtk_rx_get_desc(&trxd, rxd))
-@@ -1510,7 +1513,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1520,7 +1523,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  
                mtk_tx_unmap(eth, tx_buf, true);
  
index 456eec247c59a4c18d37f73881a5c2932bf04ba3..fdfa8b99c0abbcec714d93a3cbdb3483672851ea 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1785,18 +1785,25 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1795,18 +1795,25 @@ static int mtk_rx_alloc(struct mtk_eth *
                return -ENOMEM;
  
        for (i = 0; i < rx_dma_size; i++) {
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
        ring->dma_size = rx_dma_size;
        ring->calc_idx_update = false;
-@@ -1821,14 +1828,17 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1831,14 +1838,17 @@ static void mtk_rx_clean(struct mtk_eth
  
        if (ring->data && ring->dma) {
                for (i = 0; i < ring->dma_size; i++) {
index 11941d5c37436c1f1bdc076f43b6d0ebf8c271a3..c4c337a3ceb8d93cd26fa90b196c275e4d71ba8f 100644 (file)
@@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  /* strings used by ethtool */
  static const struct mtk_ethtool_stats {
        char str[ETH_GSTRING_LEN];
-@@ -619,8 +672,8 @@ static inline void mtk_tx_irq_disable(st
+@@ -629,8 +682,8 @@ static inline void mtk_tx_irq_disable(st
        u32 val;
  
        spin_lock_irqsave(&eth->tx_irq_lock, flags);
@@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        spin_unlock_irqrestore(&eth->tx_irq_lock, flags);
  }
  
-@@ -630,8 +683,8 @@ static inline void mtk_tx_irq_enable(str
+@@ -640,8 +693,8 @@ static inline void mtk_tx_irq_enable(str
        u32 val;
  
        spin_lock_irqsave(&eth->tx_irq_lock, flags);
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        spin_unlock_irqrestore(&eth->tx_irq_lock, flags);
  }
  
-@@ -641,8 +694,8 @@ static inline void mtk_rx_irq_disable(st
+@@ -651,8 +704,8 @@ static inline void mtk_rx_irq_disable(st
        u32 val;
  
        spin_lock_irqsave(&eth->rx_irq_lock, flags);
@@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        spin_unlock_irqrestore(&eth->rx_irq_lock, flags);
  }
  
-@@ -652,8 +705,8 @@ static inline void mtk_rx_irq_enable(str
+@@ -662,8 +715,8 @@ static inline void mtk_rx_irq_enable(str
        u32 val;
  
        spin_lock_irqsave(&eth->rx_irq_lock, flags);
@@ -117,7 +117,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        spin_unlock_irqrestore(&eth->rx_irq_lock, flags);
  }
  
-@@ -704,39 +757,39 @@ void mtk_stats_update_mac(struct mtk_mac
+@@ -714,39 +767,39 @@ void mtk_stats_update_mac(struct mtk_mac
                hw_stats->rx_checksum_errors +=
                        mtk_r32(mac->hw, MT7628_SDM_CS_ERR);
        } else {
@@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        u64_stats_update_end(&hw_stats->syncp);
-@@ -876,10 +929,10 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -886,10 +939,10 @@ static int mtk_init_fq_dma(struct mtk_et
                txd->txd4 = 0;
        }
  
@@ -187,7 +187,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return 0;
  }
-@@ -1123,7 +1176,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1133,7 +1186,7 @@ static int mtk_tx_map(struct sk_buff *sk
        if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
                if (netif_xmit_stopped(netdev_get_tx_queue(dev, 0)) ||
                    !netdev_xmit_more())
@@ -196,7 +196,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        } else {
                int next_idx;
  
-@@ -1440,6 +1493,7 @@ rx_done:
+@@ -1450,6 +1503,7 @@ rx_done:
  static int mtk_poll_tx_qdma(struct mtk_eth *eth, int budget,
                            unsigned int *done, unsigned int *bytes)
  {
@@ -204,7 +204,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct mtk_tx_ring *ring = &eth->tx_ring;
        struct mtk_tx_dma *desc;
        struct sk_buff *skb;
-@@ -1447,7 +1501,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1457,7 +1511,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
        u32 cpu, dma;
  
        cpu = ring->last_free_ptr;
@@ -213,7 +213,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        desc = mtk_qdma_phys_to_virt(ring, cpu);
  
-@@ -1482,7 +1536,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1492,7 +1546,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
        }
  
        ring->last_free_ptr = cpu;
@@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return budget;
  }
-@@ -1575,24 +1629,25 @@ static void mtk_handle_status_irq(struct
+@@ -1585,24 +1639,25 @@ static void mtk_handle_status_irq(struct
  static int mtk_napi_tx(struct napi_struct *napi, int budget)
  {
        struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi);
@@ -252,7 +252,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                return budget;
  
        if (napi_complete_done(napi, tx_done))
-@@ -1604,6 +1659,7 @@ static int mtk_napi_tx(struct napi_struc
+@@ -1614,6 +1669,7 @@ static int mtk_napi_tx(struct napi_struc
  static int mtk_napi_rx(struct napi_struct *napi, int budget)
  {
        struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
@@ -260,7 +260,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int rx_done_total = 0;
  
        mtk_handle_status_irq(eth);
-@@ -1611,21 +1667,21 @@ static int mtk_napi_rx(struct napi_struc
+@@ -1621,21 +1677,21 @@ static int mtk_napi_rx(struct napi_struc
        do {
                int rx_done;
  
@@ -286,7 +286,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        if (napi_complete_done(napi, rx_done_total))
                mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
-@@ -1688,20 +1744,20 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1698,20 +1754,20 @@ static int mtk_tx_alloc(struct mtk_eth *
         */
        wmb();
  
@@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        return 0;
-@@ -1740,6 +1796,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1750,6 +1806,7 @@ static void mtk_tx_clean(struct mtk_eth
  
  static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag)
  {
@@ -322,7 +322,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct mtk_rx_ring *ring;
        int rx_data_len, rx_dma_size;
        int i;
-@@ -1808,16 +1865,18 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1818,16 +1875,18 @@ static int mtk_rx_alloc(struct mtk_eth *
        ring->dma_size = rx_dma_size;
        ring->calc_idx_update = false;
        ring->calc_idx = rx_dma_size - 1;
@@ -345,7 +345,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return 0;
  }
-@@ -2129,9 +2188,9 @@ static int mtk_dma_busy_wait(struct mtk_
+@@ -2139,9 +2198,9 @@ static int mtk_dma_busy_wait(struct mtk_
        u32 val;
  
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
@@ -357,7 +357,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        ret = readx_poll_timeout_atomic(__raw_readl, eth->base + reg, val,
                                        !(val & (MTK_RX_DMA_BUSY | MTK_TX_DMA_BUSY)),
-@@ -2189,8 +2248,8 @@ static int mtk_dma_init(struct mtk_eth *
+@@ -2199,8 +2258,8 @@ static int mtk_dma_init(struct mtk_eth *
                 * automatically
                 */
                mtk_w32(eth, FC_THRES_DROP_MODE | FC_THRES_DROP_EN |
@@ -368,7 +368,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        return 0;
-@@ -2264,13 +2323,14 @@ static irqreturn_t mtk_handle_irq_tx(int
+@@ -2274,13 +2333,14 @@ static irqreturn_t mtk_handle_irq_tx(int
  static irqreturn_t mtk_handle_irq(int irq, void *_eth)
  {
        struct mtk_eth *eth = _eth;
@@ -387,7 +387,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        mtk_handle_irq_tx(irq, _eth);
        }
  
-@@ -2294,6 +2354,7 @@ static void mtk_poll_controller(struct n
+@@ -2304,6 +2364,7 @@ static void mtk_poll_controller(struct n
  static int mtk_start_dma(struct mtk_eth *eth)
  {
        u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0;
@@ -395,7 +395,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int err;
  
        err = mtk_dma_init(eth);
-@@ -2308,16 +2369,15 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2318,16 +2379,15 @@ static int mtk_start_dma(struct mtk_eth
                        MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
                        MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
                        MTK_RX_BT_32DWORDS,
@@ -415,7 +415,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        return 0;
-@@ -2443,8 +2503,8 @@ static int mtk_stop(struct net_device *d
+@@ -2453,8 +2513,8 @@ static int mtk_stop(struct net_device *d
        cancel_work_sync(&eth->tx_dim.work);
  
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
@@ -426,7 +426,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        mtk_dma_free(eth);
  
-@@ -2498,6 +2558,7 @@ static void mtk_dim_rx(struct work_struc
+@@ -2508,6 +2568,7 @@ static void mtk_dim_rx(struct work_struc
  {
        struct dim *dim = container_of(work, struct dim, work);
        struct mtk_eth *eth = container_of(dim, struct mtk_eth, rx_dim);
@@ -434,7 +434,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct dim_cq_moder cur_profile;
        u32 val, cur;
  
-@@ -2505,7 +2566,7 @@ static void mtk_dim_rx(struct work_struc
+@@ -2515,7 +2576,7 @@ static void mtk_dim_rx(struct work_struc
                                                dim->profile_ix);
        spin_lock_bh(&eth->dim_lock);
  
@@ -443,7 +443,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        val &= MTK_PDMA_DELAY_TX_MASK;
        val |= MTK_PDMA_DELAY_RX_EN;
  
-@@ -2515,9 +2576,9 @@ static void mtk_dim_rx(struct work_struc
+@@ -2525,9 +2586,9 @@ static void mtk_dim_rx(struct work_struc
        cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
        val |= cur << MTK_PDMA_DELAY_RX_PINT_SHIFT;
  
@@ -455,7 +455,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        spin_unlock_bh(&eth->dim_lock);
  
-@@ -2528,6 +2589,7 @@ static void mtk_dim_tx(struct work_struc
+@@ -2538,6 +2599,7 @@ static void mtk_dim_tx(struct work_struc
  {
        struct dim *dim = container_of(work, struct dim, work);
        struct mtk_eth *eth = container_of(dim, struct mtk_eth, tx_dim);
@@ -463,7 +463,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct dim_cq_moder cur_profile;
        u32 val, cur;
  
-@@ -2535,7 +2597,7 @@ static void mtk_dim_tx(struct work_struc
+@@ -2545,7 +2607,7 @@ static void mtk_dim_tx(struct work_struc
                                                dim->profile_ix);
        spin_lock_bh(&eth->dim_lock);
  
@@ -472,7 +472,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        val &= MTK_PDMA_DELAY_RX_MASK;
        val |= MTK_PDMA_DELAY_TX_EN;
  
-@@ -2545,9 +2607,9 @@ static void mtk_dim_tx(struct work_struc
+@@ -2555,9 +2617,9 @@ static void mtk_dim_tx(struct work_struc
        cur = min_t(u32, cur_profile.pkts, MTK_PDMA_DELAY_PINT_MASK);
        val |= cur << MTK_PDMA_DELAY_TX_PINT_SHIFT;
  
@@ -484,7 +484,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        spin_unlock_bh(&eth->dim_lock);
  
-@@ -2558,6 +2620,7 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2568,6 +2630,7 @@ static int mtk_hw_init(struct mtk_eth *e
  {
        u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
                       ETHSYS_DMA_AG_MAP_PPE;
@@ -492,7 +492,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int i, val, ret;
  
        if (test_and_set_bit(MTK_HW_INIT, &eth->state))
-@@ -2632,10 +2695,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2642,10 +2705,10 @@ static int mtk_hw_init(struct mtk_eth *e
        mtk_rx_irq_disable(eth, ~0);
  
        /* FE int grouping */
@@ -507,7 +507,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
        return 0;
-@@ -3167,14 +3230,6 @@ static int mtk_probe(struct platform_dev
+@@ -3177,14 +3240,6 @@ static int mtk_probe(struct platform_dev
        if (IS_ERR(eth->base))
                return PTR_ERR(eth->base);
  
@@ -522,7 +522,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
                eth->rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA;
                eth->ip_align = NET_IP_ALIGN;
-@@ -3408,6 +3463,7 @@ static int mtk_remove(struct platform_de
+@@ -3418,6 +3473,7 @@ static int mtk_remove(struct platform_de
  }
  
  static const struct mtk_soc_data mt2701_data = {
@@ -530,7 +530,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .caps = MT7623_CAPS | MTK_HWLRO,
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7623_CLKS_BITMAP,
-@@ -3419,6 +3475,7 @@ static const struct mtk_soc_data mt2701_
+@@ -3429,6 +3485,7 @@ static const struct mtk_soc_data mt2701_
  };
  
  static const struct mtk_soc_data mt7621_data = {
@@ -538,7 +538,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .caps = MT7621_CAPS,
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7621_CLKS_BITMAP,
-@@ -3431,6 +3488,7 @@ static const struct mtk_soc_data mt7621_
+@@ -3441,6 +3498,7 @@ static const struct mtk_soc_data mt7621_
  };
  
  static const struct mtk_soc_data mt7622_data = {
@@ -546,7 +546,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .ana_rgc3 = 0x2028,
        .caps = MT7622_CAPS | MTK_HWLRO,
        .hw_features = MTK_HW_FEATURES,
-@@ -3444,6 +3502,7 @@ static const struct mtk_soc_data mt7622_
+@@ -3454,6 +3512,7 @@ static const struct mtk_soc_data mt7622_
  };
  
  static const struct mtk_soc_data mt7623_data = {
@@ -554,7 +554,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .caps = MT7623_CAPS | MTK_HWLRO,
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7623_CLKS_BITMAP,
-@@ -3456,6 +3515,7 @@ static const struct mtk_soc_data mt7623_
+@@ -3466,6 +3525,7 @@ static const struct mtk_soc_data mt7623_
  };
  
  static const struct mtk_soc_data mt7629_data = {
@@ -562,7 +562,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .ana_rgc3 = 0x128,
        .caps = MT7629_CAPS | MTK_HWLRO,
        .hw_features = MTK_HW_FEATURES,
-@@ -3468,6 +3528,7 @@ static const struct mtk_soc_data mt7629_
+@@ -3478,6 +3538,7 @@ static const struct mtk_soc_data mt7629_
  };
  
  static const struct mtk_soc_data rt5350_data = {
index 91739ddd34162a256d3327908a0ffbf905ad85a1..d55ab7721190130cb45de6047f70d87ccfbccef1 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -863,8 +863,8 @@ static inline int mtk_max_buf_size(int f
+@@ -873,8 +873,8 @@ static inline int mtk_max_buf_size(int f
        return buf_size;
  }
  
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  {
        rxd->rxd2 = READ_ONCE(dma_rxd->rxd2);
        if (!(rxd->rxd2 & RX_DMA_DONE))
-@@ -873,6 +873,10 @@ static inline bool mtk_rx_get_desc(struc
+@@ -883,6 +883,10 @@ static inline bool mtk_rx_get_desc(struc
        rxd->rxd1 = READ_ONCE(dma_rxd->rxd1);
        rxd->rxd3 = READ_ONCE(dma_rxd->rxd3);
        rxd->rxd4 = READ_ONCE(dma_rxd->rxd4);
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return true;
  }
-@@ -917,7 +921,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -927,7 +931,7 @@ static int mtk_init_fq_dma(struct mtk_et
        phy_ring_tail = eth->phy_scratch_ring + soc->txrx.txd_size * (cnt - 1);
  
        for (i = 0; i < cnt; i++) {
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                txd = (void *)eth->scratch_ring + i * soc->txrx.txd_size;
                txd->txd1 = dma_addr + i * MTK_QDMA_PAGE_SIZE;
-@@ -927,6 +931,12 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -937,6 +941,12 @@ static int mtk_init_fq_dma(struct mtk_et
  
                txd->txd3 = TX_DMA_PLEN0(MTK_QDMA_PAGE_SIZE);
                txd->txd4 = 0;
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        mtk_w32(eth, eth->phy_scratch_ring, soc->reg_map->qdma.fq_head);
-@@ -1030,10 +1040,12 @@ static void setup_tx_buf(struct mtk_eth
+@@ -1040,10 +1050,12 @@ static void setup_tx_buf(struct mtk_eth
        }
  }
  
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        u32 data;
  
        WRITE_ONCE(desc->txd1, info->addr);
-@@ -1057,6 +1069,59 @@ static void mtk_tx_set_dma_desc(struct n
+@@ -1067,6 +1079,59 @@ static void mtk_tx_set_dma_desc(struct n
        WRITE_ONCE(desc->txd4, data);
  }
  
@@ -132,7 +132,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev,
                      int tx_num, struct mtk_tx_ring *ring, bool gso)
  {
-@@ -1065,6 +1130,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1075,6 +1140,7 @@ static int mtk_tx_map(struct sk_buff *sk
                .gso = gso,
                .csum = skb->ip_summed == CHECKSUM_PARTIAL,
                .vlan = skb_vlan_tag_present(skb),
@@ -140,7 +140,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                .vlan_tci = skb_vlan_tag_get(skb),
                .first = true,
                .last = !skb_is_nonlinear(skb),
-@@ -1124,7 +1190,9 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1134,7 +1200,9 @@ static int mtk_tx_map(struct sk_buff *sk
                        }
  
                        memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
@@ -151,7 +151,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
                                        !(frag_size - txd_info.size);
                        txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
-@@ -1205,17 +1273,16 @@ err_dma:
+@@ -1215,17 +1283,16 @@ err_dma:
        return -ENOMEM;
  }
  
@@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                }
        } else {
                nfrags += skb_shinfo(skb)->nr_frags;
-@@ -1267,7 +1334,7 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1277,7 +1344,7 @@ static netdev_tx_t mtk_start_xmit(struct
        if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
                goto drop;
  
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
                netif_stop_queue(dev);
                netif_err(eth, tx_queued, dev,
-@@ -1359,7 +1426,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1369,7 +1436,7 @@ static int mtk_poll_rx(struct napi_struc
        int idx;
        struct sk_buff *skb;
        u8 *data, *new_data;
@@ -190,7 +190,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int done = 0, bytes = 0;
  
        while (done < budget) {
-@@ -1367,7 +1434,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1377,7 +1444,7 @@ static int mtk_poll_rx(struct napi_struc
                unsigned int pktlen;
                dma_addr_t dma_addr;
                u32 hash, reason;
@@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                ring = mtk_get_rx_ring(eth);
                if (unlikely(!ring))
-@@ -1377,16 +1444,15 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1387,16 +1454,15 @@ static int mtk_poll_rx(struct napi_struc
                rxd = (void *)ring->dma + idx * eth->soc->txrx.rxd_size;
                data = ring->data[idx];
  
@@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
                             !eth->netdev[mac]))
-@@ -1432,7 +1498,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1442,7 +1508,7 @@ static int mtk_poll_rx(struct napi_struc
                pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
                skb->dev = netdev;
                skb_put(skb, pktlen);
@@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                else
                        skb_checksum_none_assert(skb);
-@@ -1450,10 +1516,25 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1460,10 +1526,25 @@ static int mtk_poll_rx(struct napi_struc
                        mtk_ppe_check_skb(eth->ppe, skb,
                                          trxd.rxd4 & MTK_RXD4_FOE_ENTRY);
  
@@ -261,7 +261,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                skb_record_rx_queue(skb, 0);
                napi_gro_receive(napi, skb);
  
-@@ -1465,7 +1546,7 @@ release_desc:
+@@ -1475,7 +1556,7 @@ release_desc:
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
                        rxd->rxd2 = RX_DMA_LSO;
                else
@@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                ring->calc_idx = idx;
  
-@@ -1667,7 +1748,8 @@ static int mtk_napi_rx(struct napi_struc
+@@ -1677,7 +1758,8 @@ static int mtk_napi_rx(struct napi_struc
        do {
                int rx_done;
  
@@ -280,7 +280,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                rx_done = mtk_poll_rx(napi, budget - rx_done_total, eth);
                rx_done_total += rx_done;
  
-@@ -1681,10 +1763,11 @@ static int mtk_napi_rx(struct napi_struc
+@@ -1691,10 +1773,11 @@ static int mtk_napi_rx(struct napi_struc
                if (rx_done_total == budget)
                        return budget;
  
@@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return rx_done_total;
  }
-@@ -1694,7 +1777,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1704,7 +1787,7 @@ static int mtk_tx_alloc(struct mtk_eth *
        const struct mtk_soc_data *soc = eth->soc;
        struct mtk_tx_ring *ring = &eth->tx_ring;
        int i, sz = soc->txrx.txd_size;
@@ -303,7 +303,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        ring->buf = kcalloc(MTK_DMA_SIZE, sizeof(*ring->buf),
                               GFP_KERNEL);
-@@ -1714,13 +1797,19 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1724,13 +1807,19 @@ static int mtk_tx_alloc(struct mtk_eth *
                txd->txd2 = next_ptr;
                txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
                txd->txd4 = 0;
@@ -324,7 +324,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                ring->dma_pdma = dma_alloc_coherent(eth->dma_dev, MTK_DMA_SIZE * sz,
                                                    &ring->phys_pdma, GFP_KERNEL);
                if (!ring->dma_pdma)
-@@ -1800,13 +1889,11 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1810,13 +1899,11 @@ static int mtk_rx_alloc(struct mtk_eth *
        struct mtk_rx_ring *ring;
        int rx_data_len, rx_dma_size;
        int i;
@@ -338,7 +338,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        } else {
                ring = &eth->rx_ring[ring_no];
        }
-@@ -1842,7 +1929,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1852,7 +1939,7 @@ static int mtk_rx_alloc(struct mtk_eth *
                return -ENOMEM;
  
        for (i = 0; i < rx_dma_size; i++) {
@@ -347,7 +347,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                dma_addr_t dma_addr = dma_map_single(eth->dma_dev,
                                ring->data[i] + NET_SKB_PAD + eth->ip_align,
-@@ -1857,26 +1944,47 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1867,26 +1954,47 @@ static int mtk_rx_alloc(struct mtk_eth *
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
                        rxd->rxd2 = RX_DMA_LSO;
                else
@@ -403,7 +403,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return 0;
  }
-@@ -2301,7 +2409,7 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -2311,7 +2419,7 @@ static irqreturn_t mtk_handle_irq_rx(int
        eth->rx_events++;
        if (likely(napi_schedule_prep(&eth->rx_napi))) {
                __napi_schedule(&eth->rx_napi);
@@ -412,7 +412,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        return IRQ_HANDLED;
-@@ -2325,8 +2433,10 @@ static irqreturn_t mtk_handle_irq(int ir
+@@ -2335,8 +2443,10 @@ static irqreturn_t mtk_handle_irq(int ir
        struct mtk_eth *eth = _eth;
        const struct mtk_reg_map *reg_map = eth->soc->reg_map;
  
@@ -425,7 +425,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        mtk_handle_irq_rx(irq, _eth);
        }
        if (mtk_r32(eth, reg_map->tx_irq_mask) & MTK_TX_DONE_INT) {
-@@ -2344,16 +2454,16 @@ static void mtk_poll_controller(struct n
+@@ -2354,16 +2464,16 @@ static void mtk_poll_controller(struct n
        struct mtk_eth *eth = mac->hw;
  
        mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
@@ -445,7 +445,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        const struct mtk_reg_map *reg_map = eth->soc->reg_map;
        int err;
  
-@@ -2364,12 +2474,19 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2374,12 +2484,19 @@ static int mtk_start_dma(struct mtk_eth
        }
  
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
@@ -471,7 +471,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                mtk_w32(eth,
                        MTK_RX_DMA_EN | rx_2b_offset |
                        MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
-@@ -2443,7 +2560,7 @@ static int mtk_open(struct net_device *d
+@@ -2453,7 +2570,7 @@ static int mtk_open(struct net_device *d
                napi_enable(&eth->tx_napi);
                napi_enable(&eth->rx_napi);
                mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
@@ -480,7 +480,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                refcount_set(&eth->dma_refcnt, 1);
        }
        else
-@@ -2495,7 +2612,7 @@ static int mtk_stop(struct net_device *d
+@@ -2505,7 +2622,7 @@ static int mtk_stop(struct net_device *d
        mtk_gdm_config(eth, MTK_GDMA_DROP_ALL);
  
        mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
@@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        napi_disable(&eth->tx_napi);
        napi_disable(&eth->rx_napi);
  
-@@ -2655,9 +2772,25 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2665,9 +2782,25 @@ static int mtk_hw_init(struct mtk_eth *e
                return 0;
        }
  
@@ -518,7 +518,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        if (eth->pctl) {
                /* Set GE2 driving and slew rate */
-@@ -2696,11 +2829,47 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2706,11 +2839,47 @@ static int mtk_hw_init(struct mtk_eth *e
  
        /* FE int grouping */
        mtk_w32(eth, MTK_TX_DONE_INT, reg_map->pdma.int_grp);
@@ -568,7 +568,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        return 0;
  
  err_disable_pm:
-@@ -3230,12 +3399,8 @@ static int mtk_probe(struct platform_dev
+@@ -3240,12 +3409,8 @@ static int mtk_probe(struct platform_dev
        if (IS_ERR(eth->base))
                return PTR_ERR(eth->base);
  
@@ -582,7 +582,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        spin_lock_init(&eth->page_lock);
        spin_lock_init(&eth->tx_irq_lock);
-@@ -3471,6 +3636,10 @@ static const struct mtk_soc_data mt2701_
+@@ -3481,6 +3646,10 @@ static const struct mtk_soc_data mt2701_
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
@@ -593,7 +593,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3484,6 +3653,10 @@ static const struct mtk_soc_data mt7621_
+@@ -3494,6 +3663,10 @@ static const struct mtk_soc_data mt7621_
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
@@ -604,7 +604,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3498,6 +3671,10 @@ static const struct mtk_soc_data mt7622_
+@@ -3508,6 +3681,10 @@ static const struct mtk_soc_data mt7622_
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
@@ -615,7 +615,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3511,6 +3688,10 @@ static const struct mtk_soc_data mt7623_
+@@ -3521,6 +3698,10 @@ static const struct mtk_soc_data mt7623_
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
@@ -626,7 +626,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3524,6 +3705,10 @@ static const struct mtk_soc_data mt7629_
+@@ -3534,6 +3715,10 @@ static const struct mtk_soc_data mt7629_
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
@@ -637,7 +637,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        },
  };
  
-@@ -3536,6 +3721,10 @@ static const struct mtk_soc_data rt5350_
+@@ -3546,6 +3731,10 @@ static const struct mtk_soc_data rt5350_
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
index 1ecb5e71b3a700c911f5486c5545dad5c5023d7d..1ee9bb52a77695939c5035ee2e02a2265248662a 100644 (file)
@@ -10,7 +10,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -947,18 +947,15 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -957,18 +957,15 @@ static int mtk_init_fq_dma(struct mtk_et
        return 0;
  }
  
@@ -33,7 +33,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return &ring->buf[idx];
  }
-@@ -966,13 +963,12 @@ static struct mtk_tx_buf *mtk_desc_to_tx
+@@ -976,13 +973,12 @@ static struct mtk_tx_buf *mtk_desc_to_tx
  static struct mtk_tx_dma *qdma_to_pdma(struct mtk_tx_ring *ring,
                                       struct mtk_tx_dma *dma)
  {
@@ -50,7 +50,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
-@@ -1389,7 +1385,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
+@@ -1399,7 +1395,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
  
                ring = &eth->rx_ring[i];
                idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@@ -59,7 +59,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                if (rxd->rxd2 & RX_DMA_DONE) {
                        ring->calc_idx_update = true;
                        return ring;
-@@ -1441,7 +1437,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1451,7 +1447,7 @@ static int mtk_poll_rx(struct napi_struc
                        goto rx_done;
  
                idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                data = ring->data[idx];
  
                if (!mtk_rx_get_desc(eth, &trxd, rxd))
-@@ -1648,7 +1644,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1658,7 +1654,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  
                mtk_tx_unmap(eth, tx_buf, true);
  
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                ring->last_free = desc;
                atomic_inc(&ring->free_count);
  
-@@ -1793,7 +1789,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1803,7 +1799,7 @@ static int mtk_tx_alloc(struct mtk_eth *
                int next = (i + 1) % MTK_DMA_SIZE;
                u32 next_ptr = ring->phys + next * sz;
  
@@ -86,7 +86,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                txd->txd2 = next_ptr;
                txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
                txd->txd4 = 0;
-@@ -1823,7 +1819,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1833,7 +1829,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  
        ring->dma_size = MTK_DMA_SIZE;
        atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        ring->last_free = (void *)txd;
        ring->last_free_ptr = (u32)(ring->phys + ((MTK_DMA_SIZE - 1) * sz));
        ring->thresh = MAX_SKB_FRAGS;
-@@ -1938,7 +1934,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1948,7 +1944,7 @@ static int mtk_rx_alloc(struct mtk_eth *
                if (unlikely(dma_mapping_error(eth->dma_dev, dma_addr)))
                        return -ENOMEM;
  
@@ -104,7 +104,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                rxd->rxd1 = (unsigned int)dma_addr;
  
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
-@@ -2000,7 +1996,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -2010,7 +2006,7 @@ static void mtk_rx_clean(struct mtk_eth
                        if (!ring->data[i])
                                continue;
  
index f7318e68bbdd17517bbceaf2ce544dec39603ca9..af77ee39e1afaa22ffc5310af8fa439317e38eae 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -923,7 +923,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -933,7 +933,7 @@ static int mtk_init_fq_dma(struct mtk_et
        for (i = 0; i < cnt; i++) {
                struct mtk_tx_dma_v2 *txd;
  
index 713d24b3c99108b5f4d34b00b05cc57d170c3b35..cceb79ba27f3ada3053276f52ba9b0cca7f29534 100644 (file)
@@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg)
-@@ -3708,6 +3745,21 @@ static const struct mtk_soc_data mt7629_
+@@ -3718,6 +3755,21 @@ static const struct mtk_soc_data mt7629_
        },
  };
  
@@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static const struct mtk_soc_data rt5350_data = {
        .reg_map = &mt7628_reg_map,
        .caps = MT7628_CAPS,
-@@ -3730,6 +3782,7 @@ const struct of_device_id of_mtk_match[]
+@@ -3740,6 +3792,7 @@ const struct of_device_id of_mtk_match[]
        { .compatible = "mediatek,mt7622-eth", .data = &mt7622_data},
        { .compatible = "mediatek,mt7623-eth", .data = &mt7623_data},
        { .compatible = "mediatek,mt7629-eth", .data = &mt7629_data},
index b05faa9c4b7b958ccd78e27e88085d49b9349380..cfb6ca48661f08c4c747d8fb3abd551d10c42c79 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1463,8 +1463,8 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1473,8 +1473,8 @@ static int mtk_poll_rx(struct napi_struc
        int done = 0, bytes = 0;
  
        while (done < budget) {
@@ -22,7 +22,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                dma_addr_t dma_addr;
                u32 hash, reason;
                int mac = 0;
-@@ -1531,7 +1531,13 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1541,7 +1541,13 @@ static int mtk_poll_rx(struct napi_struc
                pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
                skb->dev = netdev;
                skb_put(skb, pktlen);
@@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                else
                        skb_checksum_none_assert(skb);
-@@ -3755,6 +3761,7 @@ static const struct mtk_soc_data mt7986_
+@@ -3765,6 +3771,7 @@ static const struct mtk_soc_data mt7986_
                .txd_size = sizeof(struct mtk_tx_dma_v2),
                .rxd_size = sizeof(struct mtk_rx_dma_v2),
                .rx_irq_done_mask = MTK_RX_DONE_INT_V2,
index b26b15e60d4af3efdd6703ec4a07dbb2ca7eac23..affb87b47bc2f09907ce402a5561b05595a1dd73 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3351,6 +3351,26 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3361,6 +3361,26 @@ static int mtk_add_mac(struct mtk_eth *e
  
        mac->phylink_config.dev = &eth->netdev[id]->dev;
        mac->phylink_config.type = PHYLINK_NETDEV;
index 0a33ab0093406c4bb4abe2003baebf3b8fd2806a..432e23d0a0c5a016fb14b93a9bc73bd9e7cf2258 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -568,24 +568,8 @@ static void mtk_validate(struct phylink_
+@@ -577,24 +577,8 @@ static void mtk_validate(struct phylink_
                         unsigned long *supported,
                         struct phylink_link_state *state)
  {
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        phylink_set_port_modes(mask);
        phylink_set(mask, Autoneg);
  
-@@ -612,7 +596,6 @@ static void mtk_validate(struct phylink_
+@@ -621,7 +605,6 @@ static void mtk_validate(struct phylink_
        case PHY_INTERFACE_MODE_MII:
        case PHY_INTERFACE_MODE_RMII:
        case PHY_INTERFACE_MODE_REVMII:
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        default:
                phylink_set(mask, 10baseT_Half);
                phylink_set(mask, 10baseT_Full);
-@@ -621,23 +604,6 @@ static void mtk_validate(struct phylink_
+@@ -630,23 +613,6 @@ static void mtk_validate(struct phylink_
                break;
        }
  
index f8cc8105a4c06bdd89d021e207e9cd965d2eefb6..7585f7c1eb8d3ccb10ffaafbd0969f42e4c86bf2 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -578,8 +578,9 @@ static void mtk_validate(struct phylink_
+@@ -587,8 +587,9 @@ static void mtk_validate(struct phylink_
                phylink_set(mask, 1000baseT_Full);
                break;
        case PHY_INTERFACE_MODE_1000BASEX:
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                phylink_set(mask, 2500baseX_Full);
                break;
        case PHY_INTERFACE_MODE_GMII:
-@@ -609,11 +610,6 @@ static void mtk_validate(struct phylink_
+@@ -618,11 +619,6 @@ static void mtk_validate(struct phylink_
  
        linkmode_and(supported, supported, mask);
        linkmode_and(state->advertising, state->advertising, mask);
index 6d52e4e37fec63a8c787eb3a562c344bd17481b8..69b6906b7a5af139ab345e06414d1763eb83ec6b 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -564,56 +564,8 @@ static void mtk_mac_link_up(struct phyli
+@@ -573,56 +573,8 @@ static void mtk_mac_link_up(struct phyli
        mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
  }
  
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .mac_pcs_get_state = mtk_mac_pcs_get_state,
        .mac_an_restart = mtk_mac_an_restart,
        .mac_config = mtk_mac_config,
-@@ -3313,6 +3265,9 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3323,6 +3275,9 @@ static int mtk_add_mac(struct mtk_eth *e
  
        mac->phylink_config.dev = &eth->netdev[id]->dev;
        mac->phylink_config.type = PHYLINK_NETDEV;
index 381c51b81ae3a1c0557d2fc83e6ac7a7ac5b63a3..680d20b9437553005f42ac8f10fabbf22f2c5c61 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3265,6 +3265,10 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3275,6 +3275,10 @@ static int mtk_add_mac(struct mtk_eth *e
  
        mac->phylink_config.dev = &eth->netdev[id]->dev;
        mac->phylink_config.type = PHYLINK_NETDEV;
index 887ff565784a059b76ef4c1c204f7720390d74b3..4cdd03aa0542c322a5ccde066d17c269af0bfbe1 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3564,9 +3564,9 @@ static int mtk_probe(struct platform_dev
+@@ -3574,9 +3574,9 @@ static int mtk_probe(struct platform_dev
         */
        init_dummy_netdev(&eth->dummy_dev);
        netif_napi_add(&eth->dummy_dev, &eth->tx_napi, mtk_napi_tx,
index 58aa54f4e53c9fd9665173ebd6f6120930ee52b5..fd6bd1b87dd85c98e71ad64fb82664455e28c32d 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3260,7 +3260,6 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3270,7 +3270,6 @@ static int mtk_add_mac(struct mtk_eth *e
  
        /* mac config is not set */
        mac->interface = PHY_INTERFACE_MODE_NA;
index 951c8fea84d85c7efbcf55c6fc20fd13bcb4b3b5..93743ad3ffca0201298027e7fa222cc7e6e92ac7 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -533,8 +533,18 @@ static void mtk_mac_link_up(struct phyli
+@@ -542,8 +542,18 @@ static void mtk_mac_link_up(struct phyli
  {
        struct mtk_mac *mac = container_of(config, struct mtk_mac,
                                           phylink_config);
@@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
                 MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
                 MAC_MCR_FORCE_RX_FC);
-@@ -3264,9 +3274,7 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3274,9 +3284,7 @@ static int mtk_add_mac(struct mtk_eth *e
  
        mac->phylink_config.dev = &eth->netdev[id]->dev;
        mac->phylink_config.type = PHYLINK_NETDEV;
diff --git a/target/linux/generic/backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch b/target/linux/generic/backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch
deleted file mode 100644 (file)
index 337c611..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-From 0e37ad71b2ff772009595002da2860999e98e14e Mon Sep 17 00:00:00 2001
-From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
-Date: Wed, 18 May 2022 15:55:12 +0100
-Subject: [PATCH 09/12] net: mtk_eth_soc: move MAC_MCR setting to mac_finish()
-
-Move the setting of the MTK_MAC_MCR register from the end of mac_config
-into the phylink mac_finish() method, to keep it as the very last write
-that is done during configuration.
-
-Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-Signed-off-by: Jakub Kicinski <kuba@kernel.org>
----
- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 33 ++++++++++++++-------
- 1 file changed, 22 insertions(+), 11 deletions(-)
-
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -316,8 +316,8 @@ static void mtk_mac_config(struct phylin
-       struct mtk_mac *mac = container_of(config, struct mtk_mac,
-                                          phylink_config);
-       struct mtk_eth *eth = mac->hw;
--      u32 mcr_cur, mcr_new, sid, i;
-       int val, ge_mode, err = 0;
-+      u32 sid, i;
-       /* MT76x8 has no hardware settings between for the MAC */
-       if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
-@@ -455,6 +455,25 @@ static void mtk_mac_config(struct phylin
-               return;
-       }
-+      return;
-+
-+err_phy:
-+      dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
-+              mac->id, phy_modes(state->interface));
-+      return;
-+
-+init_err:
-+      dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
-+              mac->id, phy_modes(state->interface), err);
-+}
-+
-+static int mtk_mac_finish(struct phylink_config *config, unsigned int mode,
-+                        phy_interface_t interface)
-+{
-+      struct mtk_mac *mac = container_of(config, struct mtk_mac,
-+                                         phylink_config);
-+      u32 mcr_cur, mcr_new;
-+
-       /* Setup gmac */
-       mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
-       mcr_new = mcr_cur;
-@@ -466,16 +485,7 @@ static void mtk_mac_config(struct phylin
-       if (mcr_new != mcr_cur)
-               mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
--      return;
--
--err_phy:
--      dev_err(eth->dev, "%s: GMAC%d mode %s not supported!\n", __func__,
--              mac->id, phy_modes(state->interface));
--      return;
--
--init_err:
--      dev_err(eth->dev, "%s: GMAC%d mode %s err: %d!\n", __func__,
--              mac->id, phy_modes(state->interface), err);
-+      return 0;
- }
- static void mtk_mac_pcs_get_state(struct phylink_config *config,
-@@ -582,6 +592,7 @@ static const struct phylink_mac_ops mtk_
-       .mac_pcs_get_state = mtk_mac_pcs_get_state,
-       .mac_an_restart = mtk_mac_an_restart,
-       .mac_config = mtk_mac_config,
-+      .mac_finish = mtk_mac_finish,
-       .mac_link_down = mtk_mac_link_down,
-       .mac_link_up = mtk_mac_link_up,
- };
index b585867935e324388bc947f6179da7451a2c23eb..0f7e451245907abc9ff8e3a2fc4db42864a96f4e 100644 (file)
@@ -69,7 +69,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                /* Save the syscfg0 value for mac_finish */
                mac->syscfg0 = val;
        } else if (phylink_autoneg_inband(mode)) {
-@@ -527,14 +537,6 @@ static void mtk_mac_pcs_get_state(struct
+@@ -526,14 +536,6 @@ static void mtk_mac_pcs_get_state(struct
                state->pause |= MLO_PAUSE_TX;
  }
  
@@ -84,7 +84,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode,
                              phy_interface_t interface)
  {
-@@ -555,15 +557,6 @@ static void mtk_mac_link_up(struct phyli
+@@ -554,15 +556,6 @@ static void mtk_mac_link_up(struct phyli
                                           phylink_config);
        u32 mcr;
  
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
        mcr &= ~(MAC_MCR_SPEED_100 | MAC_MCR_SPEED_1000 |
                 MAC_MCR_FORCE_DPX | MAC_MCR_FORCE_TX_FC |
-@@ -596,8 +589,8 @@ static void mtk_mac_link_up(struct phyli
+@@ -595,8 +588,8 @@ static void mtk_mac_link_up(struct phyli
  
  static const struct phylink_mac_ops mtk_phylink_ops = {
        .validate = phylink_generic_validate,
index d54819120ea0d542f4855b05d3dccab33dfbe85d..bdb4a8315ac61d497cf9fa417ab1ead7b99e85f2 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1198,27 +1198,31 @@ static int
+@@ -1404,27 +1404,31 @@ static int
  mt7530_port_bridge_join(struct dsa_switch *ds, int port,
                        struct net_device *bridge)
  {
@@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
  
        /* Add the all other ports to this port matrix. */
-@@ -1323,24 +1327,28 @@ static void
+@@ -1529,24 +1533,28 @@ static void
  mt7530_port_bridge_leave(struct dsa_switch *ds, int port,
                         struct net_device *bridge)
  {
index 391934a30af825c42e81b08c5536630809503aee..3f5b953a2a5a87dfe932f300837410a125f6f45c 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2454,6 +2454,32 @@ mt7531_setup(struct dsa_switch *ds)
+@@ -2660,6 +2660,32 @@ mt7531_setup(struct dsa_switch *ds)
        return 0;
  }
  
@@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static bool
  mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
                          const struct phylink_link_state *state)
-@@ -2490,6 +2516,37 @@ static bool mt7531_is_rgmii_port(struct
+@@ -2696,6 +2722,37 @@ static bool mt7531_is_rgmii_port(struct
        return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
  }
  
@@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static bool
  mt7531_phy_mode_supported(struct dsa_switch *ds, int port,
                          const struct phylink_link_state *state)
-@@ -2966,6 +3023,18 @@ mt7531_cpu_port_config(struct dsa_switch
+@@ -3172,6 +3229,18 @@ mt7531_cpu_port_config(struct dsa_switch
        return 0;
  }
  
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static void
  mt7530_mac_port_validate(struct dsa_switch *ds, int port,
                         unsigned long *supported)
-@@ -3201,6 +3270,7 @@ static const struct dsa_switch_ops mt753
+@@ -3407,6 +3476,7 @@ static const struct dsa_switch_ops mt753
        .port_vlan_del          = mt7530_port_vlan_del,
        .port_mirror_add        = mt753x_port_mirror_add,
        .port_mirror_del        = mt753x_port_mirror_del,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        .phylink_validate       = mt753x_phylink_validate,
        .phylink_mac_link_state = mt753x_phylink_mac_link_state,
        .phylink_mac_config     = mt753x_phylink_mac_config,
-@@ -3218,6 +3288,7 @@ static const struct mt753x_info mt753x_t
+@@ -3424,6 +3494,7 @@ static const struct mt753x_info mt753x_t
                .phy_read = mt7530_phy_read,
                .phy_write = mt7530_phy_write,
                .pad_setup = mt7530_pad_clk_setup,
@@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .phy_mode_supported = mt7530_phy_mode_supported,
                .mac_port_validate = mt7530_mac_port_validate,
                .mac_port_get_state = mt7530_phylink_mac_link_state,
-@@ -3229,6 +3300,7 @@ static const struct mt753x_info mt753x_t
+@@ -3435,6 +3506,7 @@ static const struct mt753x_info mt753x_t
                .phy_read = mt7530_phy_read,
                .phy_write = mt7530_phy_write,
                .pad_setup = mt7530_pad_clk_setup,
@@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .phy_mode_supported = mt7530_phy_mode_supported,
                .mac_port_validate = mt7530_mac_port_validate,
                .mac_port_get_state = mt7530_phylink_mac_link_state,
-@@ -3241,6 +3313,7 @@ static const struct mt753x_info mt753x_t
+@@ -3447,6 +3519,7 @@ static const struct mt753x_info mt753x_t
                .phy_write = mt7531_ind_phy_write,
                .pad_setup = mt7531_pad_setup,
                .cpu_port_config = mt7531_cpu_port_config,
@@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .phy_mode_supported = mt7531_phy_mode_supported,
                .mac_port_validate = mt7531_mac_port_validate,
                .mac_port_get_state = mt7531_phylink_mac_link_state,
-@@ -3303,6 +3376,7 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3509,6 +3582,7 @@ mt7530_probe(struct mdio_device *mdiodev
         */
        if (!priv->info->sw_setup || !priv->info->pad_setup ||
            !priv->info->phy_read || !priv->info->phy_write ||
@@ -155,7 +155,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
            !priv->info->mac_port_get_state || !priv->info->mac_port_config)
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -769,6 +769,8 @@ struct mt753x_info {
+@@ -801,6 +801,8 @@ struct mt753x_info {
        int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
        int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface);
        int (*cpu_port_config)(struct dsa_switch *ds, int port);
index ac1916331053df0d381236fc8c5bc22d24d5b10f..60634aa0d9c92e0def2194a7d28bc8a245743400 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2480,37 +2480,6 @@ static void mt7530_mac_port_get_caps(str
+@@ -2686,37 +2686,6 @@ static void mt7530_mac_port_get_caps(str
        }
  }
  
@@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port)
  {
        return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
-@@ -2547,44 +2516,6 @@ static void mt7531_mac_port_get_caps(str
+@@ -2753,44 +2722,6 @@ static void mt7531_mac_port_get_caps(str
        }
  }
  
@@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static int
  mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
  {
-@@ -2839,9 +2770,6 @@ mt753x_phylink_mac_config(struct dsa_swi
+@@ -3045,9 +2976,6 @@ mt753x_phylink_mac_config(struct dsa_swi
        struct mt7530_priv *priv = ds->priv;
        u32 mcr_cur, mcr_new;
  
@@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        switch (port) {
        case 0 ... 4: /* Internal phy */
                if (state->interface != PHY_INTERFACE_MODE_GMII)
-@@ -3057,12 +2985,6 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -3263,12 +3191,6 @@ mt753x_phylink_validate(struct dsa_switc
        __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
        struct mt7530_priv *priv = ds->priv;
  
@@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        phylink_set_port_modes(mask);
  
        if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
-@@ -3289,7 +3211,6 @@ static const struct mt753x_info mt753x_t
+@@ -3495,7 +3417,6 @@ static const struct mt753x_info mt753x_t
                .phy_write = mt7530_phy_write,
                .pad_setup = mt7530_pad_clk_setup,
                .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .mac_port_validate = mt7530_mac_port_validate,
                .mac_port_get_state = mt7530_phylink_mac_link_state,
                .mac_port_config = mt7530_mac_config,
-@@ -3301,7 +3222,6 @@ static const struct mt753x_info mt753x_t
+@@ -3507,7 +3428,6 @@ static const struct mt753x_info mt753x_t
                .phy_write = mt7530_phy_write,
                .pad_setup = mt7530_pad_clk_setup,
                .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .mac_port_validate = mt7530_mac_port_validate,
                .mac_port_get_state = mt7530_phylink_mac_link_state,
                .mac_port_config = mt7530_mac_config,
-@@ -3314,7 +3234,6 @@ static const struct mt753x_info mt753x_t
+@@ -3520,7 +3440,6 @@ static const struct mt753x_info mt753x_t
                .pad_setup = mt7531_pad_setup,
                .cpu_port_config = mt7531_cpu_port_config,
                .mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .mac_port_validate = mt7531_mac_port_validate,
                .mac_port_get_state = mt7531_phylink_mac_link_state,
                .mac_port_config = mt7531_mac_config,
-@@ -3377,7 +3296,6 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3583,7 +3502,6 @@ mt7530_probe(struct mdio_device *mdiodev
        if (!priv->info->sw_setup || !priv->info->pad_setup ||
            !priv->info->phy_read || !priv->info->phy_write ||
            !priv->info->mac_port_get_caps ||
@@ -161,7 +161,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                return -EINVAL;
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -771,8 +771,6 @@ struct mt753x_info {
+@@ -803,8 +803,6 @@ struct mt753x_info {
        int (*cpu_port_config)(struct dsa_switch *ds, int port);
        void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
                                  struct phylink_config *config);
index 63f6e9b9547baf7af55cb7d477fde1b822bc9767..f98cf4c793add5376fefab54c94aa4c62b99ab6c 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -3009,11 +3009,6 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -3215,11 +3215,6 @@ mt753x_phylink_validate(struct dsa_switc
  
        linkmode_and(supported, supported, mask);
        linkmode_and(state->advertising, state->advertising, mask);
index 5a3098ade3ee8e33ea44403bdd0529c4f89b5eb3..a499b8e5b10606a722f55bed306d350ae9efce1b 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2587,12 +2587,13 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2793,12 +2793,13 @@ static int mt7531_rgmii_setup(struct mt7
  }
  
  static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port,
@@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                phylink_set(supported, 2500baseX_Full);
                phylink_set(supported, 2500baseT_Full);
        }
-@@ -2965,16 +2966,18 @@ static void mt753x_phylink_get_caps(stru
+@@ -3171,16 +3172,18 @@ static void mt753x_phylink_get_caps(stru
  
  static void
  mt7530_mac_port_validate(struct dsa_switch *ds, int port,
@@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  }
  
  static void
-@@ -2997,12 +3000,13 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -3203,12 +3206,13 @@ mt753x_phylink_validate(struct dsa_switc
        }
  
        /* This switch only supports 1G full-duplex. */
@@ -76,7 +76,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        phylink_set(mask, Asym_Pause);
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -772,6 +772,7 @@ struct mt753x_info {
+@@ -804,6 +804,7 @@ struct mt753x_info {
        void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
                                  struct phylink_config *config);
        void (*mac_port_validate)(struct dsa_switch *ds, int port,
index c779cb141ef47813d9cde9bd7c45ce06965a1719..b7fc06106038c50b3d980e0f80ad1321102e10e5 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2586,19 +2586,6 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2792,19 +2792,6 @@ static int mt7531_rgmii_setup(struct mt7
        return 0;
  }
  
@@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static void
  mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
                           unsigned int mode, phy_interface_t interface,
-@@ -2965,51 +2952,21 @@ static void mt753x_phylink_get_caps(stru
+@@ -3171,51 +3158,21 @@ static void mt753x_phylink_get_caps(stru
  }
  
  static void
@@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        linkmode_and(supported, supported, mask);
        linkmode_and(state->advertising, state->advertising, mask);
-@@ -3210,7 +3167,6 @@ static const struct mt753x_info mt753x_t
+@@ -3416,7 +3373,6 @@ static const struct mt753x_info mt753x_t
                .phy_write = mt7530_phy_write,
                .pad_setup = mt7530_pad_clk_setup,
                .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .mac_port_get_state = mt7530_phylink_mac_link_state,
                .mac_port_config = mt7530_mac_config,
        },
-@@ -3221,7 +3177,6 @@ static const struct mt753x_info mt753x_t
+@@ -3427,7 +3383,6 @@ static const struct mt753x_info mt753x_t
                .phy_write = mt7530_phy_write,
                .pad_setup = mt7530_pad_clk_setup,
                .mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .mac_port_get_state = mt7530_phylink_mac_link_state,
                .mac_port_config = mt7530_mac_config,
        },
-@@ -3233,7 +3188,6 @@ static const struct mt753x_info mt753x_t
+@@ -3439,7 +3394,6 @@ static const struct mt753x_info mt753x_t
                .pad_setup = mt7531_pad_setup,
                .cpu_port_config = mt7531_cpu_port_config,
                .mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
                .mac_port_get_state = mt7531_phylink_mac_link_state,
                .mac_port_config = mt7531_mac_config,
                .mac_pcs_an_restart = mt7531_sgmii_restart_an,
-@@ -3295,7 +3249,6 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3501,7 +3455,6 @@ mt7530_probe(struct mdio_device *mdiodev
        if (!priv->info->sw_setup || !priv->info->pad_setup ||
            !priv->info->phy_read || !priv->info->phy_write ||
            !priv->info->mac_port_get_caps ||
index 3854d0e6d52cc4449fb94de3eccc356f49e34432..7afa5be3d4e1b05c60fc1ffe0c855725dd7a6ab5 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -24,6 +24,11 @@
+@@ -25,6 +25,11 @@
  
  #include "mt7530.h"
  
@@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  /* String, offset, and register size in bytes if different from 4 bytes */
  static const struct mt7530_mib_desc mt7530_mib[] = {
        MIB_DESC(1, 0x00, "TxDrop"),
-@@ -2586,12 +2591,11 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2792,12 +2797,11 @@ static int mt7531_rgmii_setup(struct mt7
        return 0;
  }
  
@@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        unsigned int val;
  
        /* For adjusting speed and duplex of SGMII force mode. */
-@@ -2617,6 +2621,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
+@@ -2823,6 +2827,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
  
        /* MT7531 SGMII 1G force mode can only work in full duplex mode,
         * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
@@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
         */
        if ((speed == SPEED_10 || speed == SPEED_100) &&
            duplex != DUPLEX_FULL)
-@@ -2692,9 +2699,10 @@ static int mt7531_sgmii_setup_mode_an(st
+@@ -2898,9 +2905,10 @@ static int mt7531_sgmii_setup_mode_an(st
        return 0;
  }
  
@@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        u32 val;
  
        /* Only restart AN when AN is enabled */
-@@ -2751,6 +2759,24 @@ mt753x_mac_config(struct dsa_switch *ds,
+@@ -2957,6 +2965,24 @@ mt753x_mac_config(struct dsa_switch *ds,
        return priv->info->mac_port_config(ds, port, mode, state->interface);
  }
  
@@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static void
  mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
                          const struct phylink_link_state *state)
-@@ -2812,17 +2838,6 @@ unsupported:
+@@ -3018,17 +3044,6 @@ unsupported:
                mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
  }
  
@@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
                                         unsigned int mode,
                                         phy_interface_t interface)
-@@ -2832,16 +2847,13 @@ static void mt753x_phylink_mac_link_down
+@@ -3038,16 +3053,13 @@ static void mt753x_phylink_mac_link_down
        mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
  }
  
@@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  }
  
  static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
-@@ -2854,8 +2866,6 @@ static void mt753x_phylink_mac_link_up(s
+@@ -3060,8 +3072,6 @@ static void mt753x_phylink_mac_link_up(s
        struct mt7530_priv *priv = ds->priv;
        u32 mcr;
  
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
  
        /* MT753x MAC works in 1G full duplex mode for all up-clocked
-@@ -2933,6 +2943,8 @@ mt7531_cpu_port_config(struct dsa_switch
+@@ -3139,6 +3149,8 @@ mt7531_cpu_port_config(struct dsa_switch
                return ret;
        mt7530_write(priv, MT7530_PMCR_P(port),
                     PMCR_CPU_PORT_SETTING(priv->id));
@@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
                                   speed, DUPLEX_FULL, true, true);
  
-@@ -2972,16 +2984,13 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -3178,16 +3190,13 @@ mt753x_phylink_validate(struct dsa_switc
        linkmode_and(state->advertising, state->advertising, mask);
  }
  
@@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
  
        state->link = (pmsr & PMSR_LINK);
-@@ -3008,8 +3017,6 @@ mt7530_phylink_mac_link_state(struct dsa
+@@ -3214,8 +3223,6 @@ mt7530_phylink_mac_link_state(struct dsa
                state->pause |= MLO_PAUSE_RX;
        if (pmsr & PMSR_TX_FC)
                state->pause |= MLO_PAUSE_TX;
@@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  }
  
  static int
-@@ -3051,32 +3058,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
+@@ -3257,32 +3264,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
        return 0;
  }
  
@@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        if (ret)
                return ret;
-@@ -3089,6 +3113,13 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3295,6 +3319,13 @@ mt753x_setup(struct dsa_switch *ds)
        if (ret && priv->irq)
                mt7530_free_irq_common(priv);
  
@@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        return ret;
  }
  
-@@ -3150,9 +3181,8 @@ static const struct dsa_switch_ops mt753
+@@ -3356,9 +3387,8 @@ static const struct dsa_switch_ops mt753
        .port_mirror_del        = mt753x_port_mirror_del,
        .phylink_get_caps       = mt753x_phylink_get_caps,
        .phylink_validate       = mt753x_phylink_validate,
@@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        .phylink_mac_link_down  = mt753x_phylink_mac_link_down,
        .phylink_mac_link_up    = mt753x_phylink_mac_link_up,
        .get_mac_eee            = mt753x_get_mac_eee,
-@@ -3162,36 +3192,34 @@ static const struct dsa_switch_ops mt753
+@@ -3368,36 +3398,34 @@ static const struct dsa_switch_ops mt753
  static const struct mt753x_info mt753x_table[] = {
        [ID_MT7621] = {
                .id = ID_MT7621,
@@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        },
  };
  
-@@ -3249,7 +3277,7 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3455,7 +3483,7 @@ mt7530_probe(struct mdio_device *mdiodev
        if (!priv->info->sw_setup || !priv->info->pad_setup ||
            !priv->info->phy_read || !priv->info->phy_write ||
            !priv->info->mac_port_get_caps ||
@@ -325,7 +325,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        priv->id = priv->info->id;
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -741,6 +741,12 @@ static const char *p5_intf_modes(unsigne
+@@ -773,6 +773,12 @@ static const char *p5_intf_modes(unsigne
  
  struct mt7530_priv;
  
@@ -338,7 +338,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  /* struct mt753x_info -       This is the main data structure for holding the specific
   *                    part for each supported device
   * @sw_setup:         Holding the handler to a device initialization
-@@ -752,18 +758,14 @@ struct mt7530_priv;
+@@ -784,18 +790,14 @@ struct mt7530_priv;
   *                    port
   * @mac_port_validate:        Holding the way to set addition validate type for a
   *                    certan MAC port
@@ -359,7 +359,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        int (*sw_setup)(struct dsa_switch *ds);
        int (*phy_read)(struct mt7530_priv *priv, int port, int regnum);
        int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
-@@ -774,15 +776,9 @@ struct mt753x_info {
+@@ -806,15 +808,9 @@ struct mt753x_info {
        void (*mac_port_validate)(struct dsa_switch *ds, int port,
                                  phy_interface_t interface,
                                  unsigned long *supported);
@@ -375,7 +375,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  };
  
  /* struct mt7530_priv -       This is the main data structure for holding the state
-@@ -824,6 +820,7 @@ struct mt7530_priv {
+@@ -856,6 +852,7 @@ struct mt7530_priv {
        u8                      mirror_tx;
  
        struct mt7530_port      ports[MT7530_NUM_PORTS];
index 220e34d1dfb2c2a385c2a40dfeb13c5e80be82ed..7731c16c96b4b9b8e78050d5405b84ee728d437b 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2963,25 +2963,16 @@ static void mt753x_phylink_get_caps(stru
+@@ -3169,25 +3169,16 @@ static void mt753x_phylink_get_caps(stru
        priv->info->mac_port_get_caps(ds, port, config);
  }
  
@@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  }
  
  static void mt7530_pcs_get_state(struct phylink_pcs *pcs,
-@@ -3083,12 +3074,14 @@ static void mt7530_pcs_an_restart(struct
+@@ -3289,12 +3280,14 @@ static void mt7530_pcs_an_restart(struct
  }
  
  static const struct phylink_pcs_ops mt7530_pcs_ops = {
@@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        .pcs_get_state = mt7531_pcs_get_state,
        .pcs_config = mt753x_pcs_config,
        .pcs_an_restart = mt7531_pcs_an_restart,
-@@ -3180,7 +3173,6 @@ static const struct dsa_switch_ops mt753
+@@ -3386,7 +3379,6 @@ static const struct dsa_switch_ops mt753
        .port_mirror_add        = mt753x_port_mirror_add,
        .port_mirror_del        = mt753x_port_mirror_del,
        .phylink_get_caps       = mt753x_phylink_get_caps,
index 71ececd074bc93aea10635f6518ebd9804b2eec3..bd35cb1043ec2c1b563aa67f3d4504eab6adfb66 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2960,6 +2960,12 @@ static void mt753x_phylink_get_caps(stru
+@@ -3166,6 +3166,12 @@ static void mt753x_phylink_get_caps(stru
        config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
                                   MAC_10 | MAC_100 | MAC_1000FD;
  
index 26c465d67e5749247c84d1657ef7f197603426e1..cff22b5eaca89e7dd90d285e8aa9c10409ab8a37 100644 (file)
@@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -3098,9 +3098,16 @@ static int
+@@ -3304,9 +3304,16 @@ static int
  mt753x_setup(struct dsa_switch *ds)
  {
        struct mt7530_priv *priv = ds->priv;
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        if (ret)
                return ret;
  
-@@ -3112,13 +3119,6 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3318,13 +3325,6 @@ mt753x_setup(struct dsa_switch *ds)
        if (ret && priv->irq)
                mt7530_free_irq_common(priv);
  
index 4adb167199995d22dde7af82db636e0cc3952975..c9f830381e265ba2c8255e6a77c827c0eb539a92 100644 (file)
@@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1544,11 +1544,11 @@ static void
+@@ -1750,11 +1750,11 @@ static void
  mt7530_hw_vlan_add(struct mt7530_priv *priv,
                   struct mt7530_hw_vlan_entry *entry)
  {
@@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
        /* Validate the entry with independent learning, create egress tag per
         * VLAN and joining the port as one of the port members.
-@@ -1559,22 +1559,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
+@@ -1765,22 +1765,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
  
        /* Decide whether adding tag or not for those outgoing packets from the
         * port inside the VLAN.
@@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  }
  
  static void
-@@ -1593,11 +1591,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
+@@ -1799,11 +1797,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
                return;
        }
  
index 276251f509ea73419556ec2e0b859246a9171f6a..bb36302f24e3dfd7fa789d88ccb80fb9b6c33ae5 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1048,6 +1048,7 @@ static int
+@@ -1254,6 +1254,7 @@ static int
  mt7530_port_enable(struct dsa_switch *ds, int port,
                   struct phy_device *phy)
  {
@@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        struct mt7530_priv *priv = ds->priv;
  
        mutex_lock(&priv->reg_mutex);
-@@ -1056,7 +1057,11 @@ mt7530_port_enable(struct dsa_switch *ds
+@@ -1262,7 +1263,11 @@ mt7530_port_enable(struct dsa_switch *ds
         * restore the port matrix if the port is the member of a certain
         * bridge.
         */
@@ -42,7 +42,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        priv->ports[port].enable = true;
        mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
                   priv->ports[port].pm);
-@@ -1204,7 +1209,8 @@ mt7530_port_bridge_join(struct dsa_switc
+@@ -1410,7 +1415,8 @@ mt7530_port_bridge_join(struct dsa_switc
                        struct net_device *bridge)
  {
        struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        struct mt7530_priv *priv = ds->priv;
  
        mutex_lock(&priv->reg_mutex);
-@@ -1281,9 +1287,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
+@@ -1487,9 +1493,12 @@ mt7530_port_set_vlan_unaware(struct dsa_
         * the CPU port get out of VLAN filtering mode.
         */
        if (all_user_ports_removed) {
@@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                             | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
        }
  }
-@@ -1333,6 +1342,7 @@ mt7530_port_bridge_leave(struct dsa_swit
+@@ -1539,6 +1548,7 @@ mt7530_port_bridge_leave(struct dsa_swit
                         struct net_device *bridge)
  {
        struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        struct mt7530_priv *priv = ds->priv;
  
        mutex_lock(&priv->reg_mutex);
-@@ -1361,8 +1371,8 @@ mt7530_port_bridge_leave(struct dsa_swit
+@@ -1567,8 +1577,8 @@ mt7530_port_bridge_leave(struct dsa_swit
         */
        if (priv->ports[port].enable)
                mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
@@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
        /* When a port is removed from the bridge, the port would be set up
         * back to the default as is at initial boot which is a VLAN-unaware
-@@ -1525,6 +1535,9 @@ static int
+@@ -1731,6 +1741,9 @@ static int
  mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
                           struct netlink_ext_ack *extack)
  {
@@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        if (vlan_filtering) {
                /* The port is being kept as VLAN-unaware port when bridge is
                 * set up with vlan_filtering not being set, Otherwise, the
-@@ -1532,7 +1545,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
+@@ -1738,7 +1751,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
                 * for becoming a VLAN-aware port.
                 */
                mt7530_port_set_vlan_aware(ds, port);
index c5501fb04023dac04aee9b28239a4bf730bb4d29..f022f7bf540f57091d94c193493c1e2a4e69b3e2 100644 (file)
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
          MediaTek SoC family.
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1389,6 +1389,68 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1388,6 +1388,68 @@ static void mtk_update_rx_cpu_idx(struct
        }
  }
  
@@ -96,7 +96,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static int mtk_poll_rx(struct napi_struct *napi, int budget,
                       struct mtk_eth *eth)
  {
-@@ -1402,9 +1464,9 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1401,9 +1463,9 @@ static int mtk_poll_rx(struct napi_struc
  
        while (done < budget) {
                unsigned int pktlen, *rxdcsum;
@@ -107,7 +107,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                int mac = 0;
  
                ring = mtk_get_rx_ring(eth);
-@@ -1435,36 +1497,54 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1434,36 +1496,54 @@ static int mtk_poll_rx(struct napi_struc
                        goto release_desc;
  
                /* alloc new buffer */
@@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
                skb->dev = netdev;
-@@ -1518,7 +1598,6 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1517,7 +1597,6 @@ static int mtk_poll_rx(struct napi_struc
  skip_rx:
                ring->data[idx] = new_data;
                rxd->rxd1 = (unsigned int)dma_addr;
@@ -192,7 +192,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  release_desc:
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
                        rxd->rxd2 = RX_DMA_LSO;
-@@ -1526,7 +1605,6 @@ release_desc:
+@@ -1525,7 +1604,6 @@ release_desc:
                        rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
  
                ring->calc_idx = idx;
@@ -200,7 +200,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                done++;
        }
  
-@@ -1890,13 +1968,15 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1889,13 +1967,15 @@ static int mtk_rx_alloc(struct mtk_eth *
        if (!ring->data)
                return -ENOMEM;
  
@@ -223,7 +223,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
  
        ring->dma = dma_alloc_coherent(eth->dma_dev,
-@@ -1907,16 +1987,33 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1906,16 +1986,33 @@ static int mtk_rx_alloc(struct mtk_eth *
  
        for (i = 0; i < rx_dma_size; i++) {
                struct mtk_rx_dma_v2 *rxd;
@@ -264,7 +264,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
                        rxd->rxd2 = RX_DMA_LSO;
-@@ -1932,6 +2029,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1931,6 +2028,7 @@ static int mtk_rx_alloc(struct mtk_eth *
                        rxd->rxd8 = 0;
                }
        }
@@ -272,7 +272,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        ring->dma_size = rx_dma_size;
        ring->calc_idx_update = false;
        ring->calc_idx = rx_dma_size - 1;
-@@ -1983,7 +2081,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1982,7 +2080,7 @@ static void mtk_rx_clean(struct mtk_eth
  
                        dma_unmap_single(eth->dma_dev, rxd->rxd1,
                                         ring->buf_size, DMA_FROM_DEVICE);
@@ -281,7 +281,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                }
                kfree(ring->data);
                ring->data = NULL;
-@@ -1995,6 +2093,13 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -1994,6 +2092,13 @@ static void mtk_rx_clean(struct mtk_eth
                                  ring->dma, ring->phys);
                ring->dma = NULL;
        }
index 49b2355ce408483d8bac23b6f7c103643a51ef92..94efa929860025b89ca6d91e13ea119aba879ad7 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1389,6 +1389,11 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1388,6 +1388,11 @@ static void mtk_update_rx_cpu_idx(struct
        }
  }
  
@@ -30,7 +30,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static struct page_pool *mtk_create_page_pool(struct mtk_eth *eth,
                                              struct xdp_rxq_info *xdp_q,
                                              int id, int size)
-@@ -1451,11 +1456,52 @@ static void mtk_rx_put_buff(struct mtk_r
+@@ -1450,11 +1455,52 @@ static void mtk_rx_put_buff(struct mtk_r
                skb_free_frag(data);
  }
  
@@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int idx;
        struct sk_buff *skb;
        u8 *data, *new_data;
-@@ -1464,9 +1510,9 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1463,9 +1509,9 @@ static int mtk_poll_rx(struct napi_struc
  
        while (done < budget) {
                unsigned int pktlen, *rxdcsum;
@@ -94,7 +94,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                int mac = 0;
  
                ring = mtk_get_rx_ring(eth);
-@@ -1496,8 +1542,14 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1495,8 +1541,14 @@ static int mtk_poll_rx(struct napi_struc
                if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
                        goto release_desc;
  
@@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        new_data = mtk_page_pool_get_buff(ring->page_pool,
                                                          &dma_addr,
                                                          GFP_ATOMIC);
-@@ -1505,6 +1557,34 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1504,6 +1556,34 @@ static int mtk_poll_rx(struct napi_struc
                                netdev->stats.rx_dropped++;
                                goto release_desc;
                        }
@@ -144,7 +144,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                } else {
                        if (ring->frag_size <= PAGE_SIZE)
                                new_data = napi_alloc_frag(ring->frag_size);
-@@ -1528,27 +1608,20 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1527,27 +1607,20 @@ static int mtk_poll_rx(struct napi_struc
  
                        dma_unmap_single(eth->dma_dev, trxd.rxd1,
                                         ring->buf_size, DMA_FROM_DEVICE);
@@ -181,7 +181,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
                        rxdcsum = &trxd.rxd3;
-@@ -1560,7 +1633,6 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1559,7 +1632,6 @@ static int mtk_poll_rx(struct napi_struc
                else
                        skb_checksum_none_assert(skb);
                skb->protocol = eth_type_trans(skb, netdev);
@@ -189,7 +189,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
                hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
                if (hash != MTK_RXD4_FOE_ENTRY) {
-@@ -1623,6 +1695,9 @@ rx_done:
+@@ -1622,6 +1694,9 @@ rx_done:
                          &dim_sample);
        net_dim(&eth->rx_dim, dim_sample);
  
@@ -199,7 +199,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        return done;
  }
  
-@@ -1968,7 +2043,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -1967,7 +2042,7 @@ static int mtk_rx_alloc(struct mtk_eth *
        if (!ring->data)
                return -ENOMEM;
  
@@ -208,7 +208,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                struct page_pool *pp;
  
                pp = mtk_create_page_pool(eth, &ring->xdp_q, ring_no,
-@@ -2713,6 +2788,48 @@ static int mtk_stop(struct net_device *d
+@@ -2712,6 +2787,48 @@ static int mtk_stop(struct net_device *d
        return 0;
  }
  
@@ -257,7 +257,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static void ethsys_reset(struct mtk_eth *eth, u32 reset_bits)
  {
        regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL,
-@@ -2991,6 +3108,12 @@ static int mtk_change_mtu(struct net_dev
+@@ -2990,6 +3107,12 @@ static int mtk_change_mtu(struct net_dev
        struct mtk_eth *eth = mac->hw;
        u32 mcr_cur, mcr_new;
  
@@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
                mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
                mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
-@@ -3317,6 +3440,7 @@ static const struct net_device_ops mtk_n
+@@ -3316,6 +3439,7 @@ static const struct net_device_ops mtk_n
        .ndo_poll_controller    = mtk_poll_controller,
  #endif
        .ndo_setup_tc           = mtk_eth_setup_tc,
index cf4d658684ba82076f7a6f4ccd7ed2b536d26e40..7bb4222fef5413b749adf0dd483e7b2267b6cc02 100644 (file)
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  static const char * const mtk_clks_source_name[] = {
-@@ -1459,6 +1470,9 @@ static void mtk_rx_put_buff(struct mtk_r
+@@ -1458,6 +1469,9 @@ static void mtk_rx_put_buff(struct mtk_r
  static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
                       struct xdp_buff *xdp, struct net_device *dev)
  {
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct bpf_prog *prog;
        u32 act = XDP_PASS;
  
-@@ -1471,13 +1485,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e
+@@ -1470,13 +1484,16 @@ static u32 mtk_xdp_run(struct mtk_eth *e
        act = bpf_prog_run_xdp(prog, xdp);
        switch (act) {
        case XDP_PASS:
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        default:
                bpf_warn_invalid_xdp_action(act);
                fallthrough;
-@@ -1490,6 +1507,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e
+@@ -1489,6 +1506,11 @@ static u32 mtk_xdp_run(struct mtk_eth *e
  
        page_pool_put_full_page(ring->page_pool,
                                virt_to_head_page(xdp->data), true);
index f774f9875d9dead0cc6d0172dec0ab52db6b787f..deb06d489265b42e035ed562d7ad2bd9d4a3b0d0 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -988,15 +988,26 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -987,15 +987,26 @@ static void mtk_tx_unmap(struct mtk_eth
                }
        }
  
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void setup_tx_buf(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
-@@ -1013,7 +1024,7 @@ static void setup_tx_buf(struct mtk_eth
+@@ -1012,7 +1023,7 @@ static void setup_tx_buf(struct mtk_eth
                        dma_unmap_addr_set(tx_buf, dma_addr1, mapped_addr);
                        dma_unmap_len_set(tx_buf, dma_len1, size);
                } else {
@@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        txd->txd1 = mapped_addr;
                        txd->txd2 = TX_DMA_PLEN0(size);
                        dma_unmap_addr_set(tx_buf, dma_addr0, mapped_addr);
-@@ -1189,7 +1200,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1188,7 +1199,7 @@ static int mtk_tx_map(struct sk_buff *sk
                                                    soc->txrx.txd_size);
                        if (new_desc)
                                memset(tx_buf, 0, sizeof(*tx_buf));
@@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        tx_buf->flags |= MTK_TX_FLAGS_PAGE0;
                        tx_buf->flags |= (!mac->id) ? MTK_TX_FLAGS_FPORT0 :
                                         MTK_TX_FLAGS_FPORT1;
-@@ -1203,7 +1214,8 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1202,7 +1213,8 @@ static int mtk_tx_map(struct sk_buff *sk
        }
  
        /* store skb to cleanup */
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
                if (k & 0x1)
-@@ -1415,13 +1427,14 @@ static struct page_pool *mtk_create_page
+@@ -1414,13 +1426,14 @@ static struct page_pool *mtk_create_page
                .pool_size = size,
                .nid = NUMA_NO_NODE,
                .dev = eth->dma_dev,
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        pp = page_pool_create(&pp_params);
        if (IS_ERR(pp))
                return pp;
-@@ -1467,6 +1480,122 @@ static void mtk_rx_put_buff(struct mtk_r
+@@ -1466,6 +1479,122 @@ static void mtk_rx_put_buff(struct mtk_r
                skb_free_frag(data);
  }
  
@@ -216,7 +216,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static u32 mtk_xdp_run(struct mtk_eth *eth, struct mtk_rx_ring *ring,
                       struct xdp_buff *xdp, struct net_device *dev)
  {
-@@ -1495,6 +1624,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
+@@ -1494,6 +1623,18 @@ static u32 mtk_xdp_run(struct mtk_eth *e
  
                count = &hw_stats->xdp_stats.rx_xdp_redirect;
                goto update_stats;
@@ -235,7 +235,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        default:
                bpf_warn_invalid_xdp_action(act);
                fallthrough;
-@@ -1728,9 +1869,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1727,9 +1868,8 @@ static int mtk_poll_tx_qdma(struct mtk_e
  {
        const struct mtk_reg_map *reg_map = eth->soc->reg_map;
        struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -246,7 +246,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        u32 cpu, dma;
  
        cpu = ring->last_free_ptr;
-@@ -1751,15 +1891,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1750,15 +1890,21 @@ static int mtk_poll_tx_qdma(struct mtk_e
                if (tx_buf->flags & MTK_TX_FLAGS_FPORT1)
                        mac = 1;
  
@@ -271,7 +271,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                mtk_tx_unmap(eth, tx_buf, true);
  
                ring->last_free = desc;
-@@ -1778,9 +1924,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1777,9 +1923,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
                            unsigned int *done, unsigned int *bytes)
  {
        struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -282,7 +282,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        u32 cpu, dma;
  
        cpu = ring->cpu_idx;
-@@ -1788,14 +1933,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1787,14 +1932,18 @@ static int mtk_poll_tx_pdma(struct mtk_e
  
        while ((cpu != dma) && budget) {
                tx_buf = &ring->buf[cpu];
@@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                }
  
                mtk_tx_unmap(eth, tx_buf, true);
-@@ -3463,6 +3612,7 @@ static const struct net_device_ops mtk_n
+@@ -3462,6 +3611,7 @@ static const struct net_device_ops mtk_n
  #endif
        .ndo_setup_tc           = mtk_eth_setup_tc,
        .ndo_bpf                = mtk_xdp,
index d3d95a34b80f0d1f8f5ee2defd283dbc2dae4cd4..4707aacd9d3269d916f769845060dc135f606c8d 100644 (file)
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
          MediaTek SoC family.
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3474,11 +3474,18 @@ static void mtk_get_strings(struct net_d
+@@ -3473,11 +3473,18 @@ static void mtk_get_strings(struct net_d
        int i;
  
        switch (stringset) {
@@ -46,7 +46,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                break;
        }
  }
-@@ -3486,13 +3493,35 @@ static void mtk_get_strings(struct net_d
+@@ -3485,13 +3492,35 @@ static void mtk_get_strings(struct net_d
  static int mtk_get_sset_count(struct net_device *dev, int sset)
  {
        switch (sset) {
@@ -84,7 +84,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static void mtk_get_ethtool_stats(struct net_device *dev,
                                  struct ethtool_stats *stats, u64 *data)
  {
-@@ -3520,6 +3549,8 @@ static void mtk_get_ethtool_stats(struct
+@@ -3519,6 +3548,8 @@ static void mtk_get_ethtool_stats(struct
  
                for (i = 0; i < ARRAY_SIZE(mtk_ethtool_stats); i++)
                        *data_dst++ = *(data_src + mtk_ethtool_stats[i].offset);
index 8e6895fe97fcf621e54c94bc86fa0b0c837dde7f..33a76166521af7cab1a38fbfd76324cd26a5dd8f 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1480,6 +1480,41 @@ static void mtk_rx_put_buff(struct mtk_r
+@@ -1479,6 +1479,41 @@ static void mtk_rx_put_buff(struct mtk_r
                skb_free_frag(data);
  }
  
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
                                struct net_device *dev, bool dma_map)
  {
-@@ -1490,9 +1525,8 @@ static int mtk_xdp_submit_frame(struct m
+@@ -1489,9 +1524,8 @@ static int mtk_xdp_submit_frame(struct m
                .first  = true,
                .last   = true,
        };
@@ -68,7 +68,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct mtk_tx_buf *tx_buf;
  
        if (unlikely(test_bit(MTK_RESETTING, &eth->state)))
-@@ -1512,36 +1546,18 @@ static int mtk_xdp_submit_frame(struct m
+@@ -1511,36 +1545,18 @@ static int mtk_xdp_submit_frame(struct m
        tx_buf = mtk_desc_to_tx_buf(ring, txd, soc->txrx.txd_size);
        memset(tx_buf, 0, sizeof(*tx_buf));
  
index 23e4a4dfcbf4122293bc0b5765243304ca9983f2..e75861bc829344f1fecd271e489fb1c06a624634 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -988,23 +988,22 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -987,23 +987,22 @@ static void mtk_tx_unmap(struct mtk_eth
                }
        }
  
@@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        }
        tx_buf->flags = 0;
        tx_buf->data = NULL;
-@@ -1507,6 +1506,8 @@ static int mtk_xdp_frame_map(struct mtk_
+@@ -1506,6 +1505,8 @@ static int mtk_xdp_frame_map(struct mtk_
        mtk_tx_set_dma_desc(dev, txd, txd_info);
  
        tx_buf->flags |= !mac->id ? MTK_TX_FLAGS_FPORT0 : MTK_TX_FLAGS_FPORT1;
@@ -56,7 +56,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        txd_pdma = qdma_to_pdma(ring, txd);
        setup_tx_buf(eth, tx_buf, txd_pdma, txd_info->addr, txd_info->size,
-@@ -1518,43 +1519,69 @@ static int mtk_xdp_frame_map(struct mtk_
+@@ -1517,43 +1518,69 @@ static int mtk_xdp_frame_map(struct mtk_
  static int mtk_xdp_submit_frame(struct mtk_eth *eth, struct xdp_frame *xdpf,
                                struct net_device *dev, bool dma_map)
  {
@@ -140,7 +140,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
                txd_pdma = qdma_to_pdma(ring, txd);
-@@ -1581,7 +1608,24 @@ static int mtk_xdp_submit_frame(struct m
+@@ -1580,7 +1607,24 @@ static int mtk_xdp_submit_frame(struct m
                mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size),
                        MT7628_TX_CTX_IDX0);
        }
@@ -166,7 +166,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        spin_unlock(&eth->page_lock);
  
        return err;
-@@ -1910,18 +1954,15 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1909,18 +1953,15 @@ static int mtk_poll_tx_qdma(struct mtk_e
                if (!tx_buf->data)
                        break;
  
@@ -191,7 +191,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                mtk_tx_unmap(eth, tx_buf, true);
  
                ring->last_free = desc;
-@@ -1952,17 +1993,15 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1951,17 +1992,15 @@ static int mtk_poll_tx_pdma(struct mtk_e
                if (!tx_buf->data)
                        break;
  
index 1cae648358f8efc4e6b049fd45b465e0bded66f7..1f2a3ee140fb85623942d0d8e7153d1c39d212e7 100644 (file)
@@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -11783,6 +11783,14 @@ L:    netdev@vger.kernel.org
+@@ -11790,6 +11790,14 @@ L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/mediatek/
  
index 817b3e10fdf15561531389f887ae6721e450808c..a3842d35f56e95ebc8408e3d4d1c1cabdb9f52e4 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1846,10 +1846,19 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1845,10 +1845,19 @@ static int mtk_poll_rx(struct napi_struc
                skb->dev = netdev;
                bytes += skb->len;
  
@@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
                if (*rxdcsum & eth->soc->txrx.rx_dma_l4_valid)
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
-@@ -1857,16 +1866,9 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1856,16 +1865,9 @@ static int mtk_poll_rx(struct napi_struc
                        skb_checksum_none_assert(skb);
                skb->protocol = eth_type_trans(skb, netdev);
  
index f6fc7340794bcde54285261217fbf526e6491fec..f4eb030ef694626562c2ff45d3fde5bf8acd71d1 100644 (file)
@@ -24,7 +24,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1413,7 +1413,7 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1412,7 +1412,7 @@ static void mtk_update_rx_cpu_idx(struct
  
  static bool mtk_page_pool_enabled(struct mtk_eth *eth)
  {
index 66e2778709dd3062b662d8a4dbb023d395d0e3d8..be6da9b4af0207a188e8584a449ad2a48ad6e593 100644 (file)
@@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
  };
  
  /* strings used by ethtool */
-@@ -2928,6 +2932,7 @@ static int mtk_open(struct net_device *d
+@@ -2927,6 +2931,7 @@ static int mtk_open(struct net_device *d
  
        /* we run 2 netdevs on the same dma ring so we only bring it up once */
        if (!refcount_read(&eth->dma_refcnt)) {
@@ -65,7 +65,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
                u32 gdm_config = MTK_GDMA_TO_PDMA;
                int err;
  
-@@ -2937,15 +2942,15 @@ static int mtk_open(struct net_device *d
+@@ -2936,15 +2941,15 @@ static int mtk_open(struct net_device *d
                        return err;
                }
  
@@ -84,7 +84,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
                refcount_set(&eth->dma_refcnt, 1);
        }
        else
-@@ -4044,7 +4049,9 @@ static int mtk_probe(struct platform_dev
+@@ -4043,7 +4048,9 @@ static int mtk_probe(struct platform_dev
        }
  
        if (eth->soc->offload_version) {
index 1dfcc862d611c48a945a3b341206be233abc14b4..76f954f62664079e44d30418593252361001f185 100644 (file)
@@ -44,7 +44,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4147,6 +4147,7 @@ static const struct mtk_soc_data mt7621_
+@@ -4146,6 +4146,7 @@ static const struct mtk_soc_data mt7621_
        .required_clks = MT7621_CLKS_BITMAP,
        .required_pctl = false,
        .offload_version = 2,
@@ -52,7 +52,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4165,6 +4166,7 @@ static const struct mtk_soc_data mt7622_
+@@ -4164,6 +4165,7 @@ static const struct mtk_soc_data mt7622_
        .required_clks = MT7622_CLKS_BITMAP,
        .required_pctl = false,
        .offload_version = 2,
@@ -60,7 +60,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4182,6 +4184,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4181,6 +4183,7 @@ static const struct mtk_soc_data mt7623_
        .required_clks = MT7623_CLKS_BITMAP,
        .required_pctl = true,
        .offload_version = 2,
@@ -68,7 +68,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4215,6 +4218,7 @@ static const struct mtk_soc_data mt7986_
+@@ -4214,6 +4217,7 @@ static const struct mtk_soc_data mt7986_
        .caps = MT7986_CAPS,
        .required_clks = MT7986_CLKS_BITMAP,
        .required_pctl = false,
index e779d3b344e8f8e6e4cb9dcec6f3075e98aaf321..fb64da3d7a6a40aee72958d8f1eac3db4412aa4f 100644 (file)
@@ -48,7 +48,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1872,7 +1872,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1871,7 +1871,7 @@ static int mtk_poll_rx(struct napi_struc
  
                reason = FIELD_GET(MTK_RXD4_PPE_CPU_REASON, trxd.rxd4);
                if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
@@ -57,7 +57,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
  
                if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
                        if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
-@@ -2933,7 +2933,8 @@ static int mtk_open(struct net_device *d
+@@ -2932,7 +2932,8 @@ static int mtk_open(struct net_device *d
        /* we run 2 netdevs on the same dma ring so we only bring it up once */
        if (!refcount_read(&eth->dma_refcnt)) {
                const struct mtk_soc_data *soc = eth->soc;
@@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
                int err;
  
                err = mtk_start_dma(eth);
-@@ -2942,8 +2943,11 @@ static int mtk_open(struct net_device *d
+@@ -2941,8 +2942,11 @@ static int mtk_open(struct net_device *d
                        return err;
                }
  
@@ -81,7 +81,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
  
                mtk_gdm_config(eth, gdm_config);
  
-@@ -2988,6 +2992,7 @@ static int mtk_stop(struct net_device *d
+@@ -2987,6 +2991,7 @@ static int mtk_stop(struct net_device *d
  {
        struct mtk_mac *mac = netdev_priv(dev);
        struct mtk_eth *eth = mac->hw;
@@ -89,7 +89,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
  
        phylink_stop(mac->phylink);
  
-@@ -3015,8 +3020,8 @@ static int mtk_stop(struct net_device *d
+@@ -3014,8 +3019,8 @@ static int mtk_stop(struct net_device *d
  
        mtk_dma_free(eth);
  
@@ -100,7 +100,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
  
        return 0;
  }
-@@ -4049,12 +4054,19 @@ static int mtk_probe(struct platform_dev
+@@ -4048,12 +4053,19 @@ static int mtk_probe(struct platform_dev
        }
  
        if (eth->soc->offload_version) {
index f93285642d1c597b88d6b21c7e95323b8ae72470..6a58334c328ece304d240b2489f3e181b88ddc3f 100644 (file)
@@ -39,7 +39,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
  };
  
  /* strings used by ethtool */
-@@ -3966,16 +3974,12 @@ static int mtk_probe(struct platform_dev
+@@ -3965,16 +3973,12 @@ static int mtk_probe(struct platform_dev
        for (i = 0;; i++) {
                struct device_node *np = of_parse_phandle(pdev->dev.of_node,
                                                          "mediatek,wed", i);
index 656a60b15a2ed6c27da4effad888ad770b79dc2e..de1f21727204b52016a57bae5d022665505f103e 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4164,6 +4164,7 @@ static const struct mtk_soc_data mt7621_
+@@ -4163,6 +4163,7 @@ static const struct mtk_soc_data mt7621_
        .required_pctl = false,
        .offload_version = 2,
        .hash_offset = 2,
@@ -29,7 +29,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4183,6 +4184,7 @@ static const struct mtk_soc_data mt7622_
+@@ -4182,6 +4183,7 @@ static const struct mtk_soc_data mt7622_
        .required_pctl = false,
        .offload_version = 2,
        .hash_offset = 2,
@@ -37,7 +37,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4201,6 +4203,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4200,6 +4202,7 @@ static const struct mtk_soc_data mt7623_
        .required_pctl = true,
        .offload_version = 2,
        .hash_offset = 2,
index f28997c7b2d5dccf8ab377142516a53918f49c4a..00255cdcf6d7ac36724409d3ad1d6e46cadcc477 100644 (file)
@@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3891,6 +3891,7 @@ void mtk_eth_set_dma_device(struct mtk_e
+@@ -3890,6 +3890,7 @@ void mtk_eth_set_dma_device(struct mtk_e
  
  static int mtk_probe(struct platform_device *pdev)
  {
@@ -34,7 +34,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        struct device_node *mac_np;
        struct mtk_eth *eth;
        int err, i;
-@@ -3971,16 +3972,31 @@ static int mtk_probe(struct platform_dev
+@@ -3970,16 +3971,31 @@ static int mtk_probe(struct platform_dev
                }
        }
  
index f10878da43a856ccc3337d3a21f06df49d6a71d7..56d63b1e3502ae7162297e8d0c70d879de885533 100644 (file)
@@ -26,7 +26,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1859,12 +1859,14 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1858,12 +1858,14 @@ static int mtk_poll_rx(struct napi_struc
                bytes += skb->len;
  
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
@@ -41,7 +41,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
                        hash = trxd.rxd4 & MTK_RXD4_FOE_ENTRY;
                        if (hash != MTK_RXD4_FOE_ENTRY)
                                skb_set_hash(skb, jhash_1word(hash, 0),
-@@ -1878,7 +1880,6 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1877,7 +1879,6 @@ static int mtk_poll_rx(struct napi_struc
                        skb_checksum_none_assert(skb);
                skb->protocol = eth_type_trans(skb, netdev);
  
@@ -49,7 +49,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
                if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
                        mtk_ppe_check_skb(eth->ppe[0], skb, hash);
  
-@@ -4180,7 +4181,7 @@ static const struct mtk_soc_data mt7621_
+@@ -4179,7 +4180,7 @@ static const struct mtk_soc_data mt7621_
        .required_pctl = false,
        .offload_version = 2,
        .hash_offset = 2,
@@ -58,7 +58,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4200,7 +4201,7 @@ static const struct mtk_soc_data mt7622_
+@@ -4199,7 +4200,7 @@ static const struct mtk_soc_data mt7622_
        .required_pctl = false,
        .offload_version = 2,
        .hash_offset = 2,
@@ -67,7 +67,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4219,7 +4220,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4218,7 +4219,7 @@ static const struct mtk_soc_data mt7623_
        .required_pctl = true,
        .offload_version = 2,
        .hash_offset = 2,
@@ -76,7 +76,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4251,9 +4252,11 @@ static const struct mtk_soc_data mt7986_
+@@ -4250,9 +4251,11 @@ static const struct mtk_soc_data mt7986_
        .reg_map = &mt7986_reg_map,
        .ana_rgc3 = 0x128,
        .caps = MT7986_CAPS,
@@ -576,7 +576,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
                                entry->hash = 0xffff;
                        continue;
 @@ -771,6 +805,8 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
-                        MTK_PPE_SCAN_MODE_KEEPALIVE_AGE) |
+                        MTK_PPE_SCAN_MODE_CHECK_AGE) |
              FIELD_PREP(MTK_PPE_TB_CFG_ENTRY_NUM,
                         MTK_PPE_ENTRIES_SHIFT);
 +      if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2))
index aba5673b76d875b903057eea9c694f420e708484..58314a8fc0d214a19f92732caf5f4b6d1fd5c714 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4255,6 +4255,7 @@ static const struct mtk_soc_data mt7986_
+@@ -4254,6 +4254,7 @@ static const struct mtk_soc_data mt7986_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7986_CLKS_BITMAP,
        .required_pctl = false,
index 7ebe8566a041d2330868c1176c347aaf25010fe8..cad32043541ebce2cc3f9c1edb3f8872f5968f1f 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4007,19 +4007,23 @@ static int mtk_probe(struct platform_dev
+@@ -4006,19 +4006,23 @@ static int mtk_probe(struct platform_dev
                        eth->irq[i] = platform_get_irq(pdev, i);
                if (eth->irq[i] < 0) {
                        dev_err(&pdev->dev, "no IRQ%d resource found\n", i);
@@ -45,7 +45,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        }
                        eth->clks[i] = NULL;
                }
-@@ -4030,7 +4034,7 @@ static int mtk_probe(struct platform_dev
+@@ -4029,7 +4033,7 @@ static int mtk_probe(struct platform_dev
  
        err = mtk_hw_init(eth);
        if (err)
@@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        eth->hwlro = MTK_HAS_CAPS(eth->soc->caps, MTK_HWLRO);
  
-@@ -4128,6 +4132,8 @@ err_free_dev:
+@@ -4127,6 +4131,8 @@ err_free_dev:
        mtk_free_dev(eth);
  err_deinit_hw:
        mtk_hw_deinit(eth);
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return err;
  }
-@@ -4147,6 +4153,7 @@ static int mtk_remove(struct platform_de
+@@ -4146,6 +4152,7 @@ static int mtk_remove(struct platform_de
                phylink_disconnect_phy(mac->phylink);
        }
  
index 9c526ecec93ad7f47f9b589d33f8e32108f5a49e..e2a2046442ebc52c728b3b49d76f61abb21afd3f 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4090,13 +4090,13 @@ static int mtk_probe(struct platform_dev
+@@ -4089,13 +4089,13 @@ static int mtk_probe(struct platform_dev
                                                   eth->soc->offload_version, i);
                        if (!eth->ppe[i]) {
                                err = -ENOMEM;
index 55c9b35238b735ad4602b496fd006876b09486aa..13f0ed5a5d99736b555525442e94d213b8457dc5 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4090,13 +4090,13 @@ static int mtk_probe(struct platform_dev
+@@ -4089,13 +4089,13 @@ static int mtk_probe(struct platform_dev
                                                   eth->soc->offload_version, i);
                        if (!eth->ppe[i]) {
                                err = -ENOMEM;
@@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
  
        for (i = 0; i < MTK_MAX_DEVS; i++) {
-@@ -4106,7 +4106,7 @@ static int mtk_probe(struct platform_dev
+@@ -4105,7 +4105,7 @@ static int mtk_probe(struct platform_dev
                err = register_netdev(eth->netdev[i]);
                if (err) {
                        dev_err(eth->dev, "error bringing up device\n");
@@ -46,7 +46,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                } else
                        netif_info(eth, probe, eth->netdev[i],
                                   "mediatek frame engine at 0x%08lx, irq %d\n",
-@@ -4126,7 +4126,8 @@ static int mtk_probe(struct platform_dev
+@@ -4125,7 +4125,8 @@ static int mtk_probe(struct platform_dev
  
        return 0;
  
index 9206be370f818c1bd034308c35d3a89182a5de20..7f76e9b4975cc394e016348846564ae2ce214436 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3179,6 +3179,30 @@ static void mtk_dim_tx(struct work_struc
+@@ -3178,6 +3178,30 @@ static void mtk_dim_tx(struct work_struc
        dim->state = DIM_START_MEASURE;
  }
  
@@ -45,7 +45,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static int mtk_hw_init(struct mtk_eth *eth)
  {
        u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
-@@ -3253,8 +3277,16 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3252,8 +3276,16 @@ static int mtk_hw_init(struct mtk_eth *e
         * up with the more appropriate value when mtk_mac_config call is being
         * invoked.
         */
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        /* Indicates CDM to parse the MTK special tag from CPU
         * which also is working out for untag packets.
-@@ -3353,7 +3385,6 @@ static int mtk_change_mtu(struct net_dev
+@@ -3352,7 +3384,6 @@ static int mtk_change_mtu(struct net_dev
        int length = new_mtu + MTK_RX_ETH_HLEN;
        struct mtk_mac *mac = netdev_priv(dev);
        struct mtk_eth *eth = mac->hw;
@@ -71,7 +71,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        if (rcu_access_pointer(eth->prog) &&
            length > MTK_PP_MAX_BUF_SIZE) {
-@@ -3361,23 +3392,7 @@ static int mtk_change_mtu(struct net_dev
+@@ -3360,23 +3391,7 @@ static int mtk_change_mtu(struct net_dev
                return -EINVAL;
        }
  
index 063415c618195d917ded49e235783751558c7b39..65d9621e2fdfea5434b20e269d7f31151cee5209 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3423,11 +3423,8 @@ static void mtk_pending_work(struct work
+@@ -3422,11 +3422,8 @@ static void mtk_pending_work(struct work
        rtnl_lock();
  
        dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        /* stop all devices to make sure that dma is properly shut down */
        for (i = 0; i < MTK_MAC_COUNT; i++) {
                if (!eth->netdev[i])
-@@ -3461,7 +3458,7 @@ static void mtk_pending_work(struct work
+@@ -3460,7 +3457,7 @@ static void mtk_pending_work(struct work
  
        dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
  
index 30be5b392bf6d3772efb509464ea6e203b03dbdc..4eca30dbfd80c96e657a524a37392ff51967ff3f 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3242,16 +3242,17 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3241,16 +3241,17 @@ static int mtk_hw_init(struct mtk_eth *e
                return 0;
        }
  
index 3ab5dba434ecf08c85a0e9cbe03f5f35a8cd9492..33f2b5b0a5ecb0b0a730377a2ef6029c0c20b683 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3203,6 +3203,27 @@ static void mtk_set_mcr_max_rx(struct mt
+@@ -3202,6 +3202,27 @@ static void mtk_set_mcr_max_rx(struct mt
                mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
  }
  
@@ -44,7 +44,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static int mtk_hw_init(struct mtk_eth *eth)
  {
        u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
-@@ -3242,22 +3263,9 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3241,22 +3262,9 @@ static int mtk_hw_init(struct mtk_eth *e
                return 0;
        }
  
index deb39477ec73fbc5a8759ec5e6ab87945ea50eb5..84209fccd55e0ef16e1a844ab100feb21b217780 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3224,7 +3224,54 @@ static void mtk_hw_reset(struct mtk_eth
+@@ -3223,7 +3223,54 @@ static void mtk_hw_reset(struct mtk_eth
                             0x3ffffff);
  }
  
@@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  {
        u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
                       ETHSYS_DMA_AG_MAP_PPE;
-@@ -3263,7 +3310,12 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3262,7 +3309,12 @@ static int mtk_hw_init(struct mtk_eth *e
                return 0;
        }
  
@@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
                /* Set FE to PDMAv2 if necessary */
-@@ -3451,7 +3503,7 @@ static void mtk_pending_work(struct work
+@@ -3450,7 +3502,7 @@ static void mtk_pending_work(struct work
        if (eth->dev->pins)
                pinctrl_select_state(eth->dev->pins->p,
                                     eth->dev->pins->default_state);
@@ -96,7 +96,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        /* restart DMA and enable IRQs */
        for (i = 0; i < MTK_MAC_COUNT; i++) {
-@@ -4053,7 +4105,7 @@ static int mtk_probe(struct platform_dev
+@@ -4052,7 +4104,7 @@ static int mtk_probe(struct platform_dev
        eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
        INIT_WORK(&eth->pending_work, mtk_pending_work);
  
index b3812cccbbdbde069079da4e0ee25040e93ef57b..e75a4cc0d060e7ac5e4e48c574b7f25478cc2e5a 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2789,14 +2789,29 @@ static void mtk_dma_free(struct mtk_eth
+@@ -2788,14 +2788,29 @@ static void mtk_dma_free(struct mtk_eth
        kfree(eth->scratch_head);
  }
  
@@ -48,7 +48,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        schedule_work(&eth->pending_work);
  }
  
-@@ -3278,15 +3293,17 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3277,15 +3292,17 @@ static int mtk_hw_init(struct mtk_eth *e
        const struct mtk_reg_map *reg_map = eth->soc->reg_map;
        int i, val, ret;
  
@@ -72,7 +72,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        if (eth->ethsys)
                regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask,
-@@ -3412,8 +3429,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3411,8 +3428,10 @@ static int mtk_hw_init(struct mtk_eth *e
        return 0;
  
  err_disable_pm:
@@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        return ret;
  }
-@@ -3475,30 +3494,53 @@ static int mtk_do_ioctl(struct net_devic
+@@ -3474,30 +3493,53 @@ static int mtk_do_ioctl(struct net_devic
        return -EOPNOTSUPP;
  }
  
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        if (eth->dev->pins)
                pinctrl_select_state(eth->dev->pins->p,
-@@ -3509,15 +3551,19 @@ static void mtk_pending_work(struct work
+@@ -3508,15 +3550,19 @@ static void mtk_pending_work(struct work
        for (i = 0; i < MTK_MAC_COUNT; i++) {
                if (!test_bit(i, &restart))
                        continue;
index 633c66f1c2f6c85c790e9163a4dbe2715115207a..898785ece2c7cb90794141f45609bba200451e9c 100644 (file)
@@ -49,7 +49,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  };
  
  /* strings used by ethtool */
-@@ -3286,6 +3292,102 @@ static void mtk_hw_warm_reset(struct mtk
+@@ -3285,6 +3291,102 @@ static void mtk_hw_warm_reset(struct mtk
                        val, rst_mask);
  }
  
@@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static int mtk_hw_init(struct mtk_eth *eth, bool reset)
  {
        u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
-@@ -3601,6 +3703,7 @@ static int mtk_cleanup(struct mtk_eth *e
+@@ -3600,6 +3702,7 @@ static int mtk_cleanup(struct mtk_eth *e
        mtk_unreg_dev(eth);
        mtk_free_dev(eth);
        cancel_work_sync(&eth->pending_work);
@@ -160,7 +160,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        return 0;
  }
-@@ -4038,6 +4141,7 @@ static int mtk_probe(struct platform_dev
+@@ -4037,6 +4140,7 @@ static int mtk_probe(struct platform_dev
  
        eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
        INIT_WORK(&eth->rx_dim.work, mtk_dim_rx);
@@ -168,7 +168,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
        INIT_WORK(&eth->tx_dim.work, mtk_dim_tx);
-@@ -4242,6 +4346,8 @@ static int mtk_probe(struct platform_dev
+@@ -4241,6 +4345,8 @@ static int mtk_probe(struct platform_dev
                       NAPI_POLL_WEIGHT);
  
        platform_set_drvdata(pdev, eth);
index 1f61be0a1fb8a711fe627f60cf3fef393667be92..cc9aaaf0b84142fb6748a1e391c5592e7496e603 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3632,6 +3632,11 @@ static void mtk_pending_work(struct work
+@@ -3631,6 +3631,11 @@ static void mtk_pending_work(struct work
        set_bit(MTK_RESETTING, &eth->state);
  
        mtk_prepare_for_reset(eth);
@@ -26,7 +26,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        /* stop all devices to make sure that dma is properly shut down */
        for (i = 0; i < MTK_MAC_COUNT; i++) {
-@@ -3669,6 +3674,8 @@ static void mtk_pending_work(struct work
+@@ -3668,6 +3673,8 @@ static void mtk_pending_work(struct work
  
        clear_bit(MTK_RESETTING, &eth->state);
  
index 8b6d9e908f2e1af13167ee11703e74c4ac8aaf91..908b2d88f3ca057d9d84292d28c70725e4dca091 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -901,7 +901,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -900,7 +900,7 @@ static int mtk_init_fq_dma(struct mtk_et
  {
        const struct mtk_soc_data *soc = eth->soc;
        dma_addr_t phy_ring_tail;
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        dma_addr_t dma_addr;
        int i;
  
-@@ -2155,19 +2155,25 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2154,19 +2154,25 @@ static int mtk_tx_alloc(struct mtk_eth *
        struct mtk_tx_ring *ring = &eth->tx_ring;
        int i, sz = soc->txrx.txd_size;
        struct mtk_tx_dma_v2 *txd;
@@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                u32 next_ptr = ring->phys + next * sz;
  
                txd = ring->dma + i * sz;
-@@ -2187,22 +2193,22 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2186,22 +2192,22 @@ static int mtk_tx_alloc(struct mtk_eth *
         * descriptors in ring->dma_pdma.
         */
        if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        ring->thresh = MAX_SKB_FRAGS;
  
        /* make sure that all changes to the dma ring are flushed before we
-@@ -2214,14 +2220,14 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2213,14 +2219,14 @@ static int mtk_tx_alloc(struct mtk_eth *
                mtk_w32(eth, ring->phys, soc->reg_map->qdma.ctx_ptr);
                mtk_w32(eth, ring->phys, soc->reg_map->qdma.dtx_ptr);
                mtk_w32(eth,
@@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                mtk_w32(eth, 0, MT7628_TX_CTX_IDX0);
                mtk_w32(eth, MT7628_PST_DTX_IDX0, soc->reg_map->pdma.rst_idx);
        }
-@@ -2239,7 +2245,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -2238,7 +2244,7 @@ static void mtk_tx_clean(struct mtk_eth
        int i;
  
        if (ring->buf) {
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        mtk_tx_unmap(eth, &ring->buf[i], false);
                kfree(ring->buf);
                ring->buf = NULL;
-@@ -2247,14 +2253,14 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -2246,14 +2252,14 @@ static void mtk_tx_clean(struct mtk_eth
  
        if (ring->dma) {
                dma_free_coherent(eth->dma_dev,
@@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  ring->dma_pdma, ring->phys_pdma);
                ring->dma_pdma = NULL;
        }
-@@ -2777,7 +2783,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -2776,7 +2782,7 @@ static void mtk_dma_free(struct mtk_eth
                        netdev_reset_queue(eth->netdev[i]);
        if (eth->scratch_ring) {
                dma_free_coherent(eth->dma_dev,
index 391727b30d3f4d4d6bf6830c50d6c47775fb0b5c..34aa7b14cdf2ef79e50b8f000f429bf6f12972cf 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4425,7 +4425,7 @@ static const struct mtk_soc_data mt7621_
+@@ -4424,7 +4424,7 @@ static const struct mtk_soc_data mt7621_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7621_CLKS_BITMAP,
        .required_pctl = false,
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        .hash_offset = 2,
        .foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
        .txrx = {
-@@ -4464,7 +4464,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4463,7 +4463,7 @@ static const struct mtk_soc_data mt7623_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7623_CLKS_BITMAP,
        .required_pctl = true,
index 8e743dd02a374e2c35a12ed7447361ebfbe20fc4..765666602e4afe338d159f589ef0eecd951c13cd 100644 (file)
@@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        },
        .gdm1_cnt               = 0x1c00,
        .gdma_to_ppe0           = 0x3333,
-@@ -577,6 +581,75 @@ static void mtk_mac_link_down(struct phy
+@@ -576,6 +580,75 @@ static void mtk_mac_link_down(struct phy
        mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
  }
  
@@ -130,7 +130,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static void mtk_mac_link_up(struct phylink_config *config,
                            struct phy_device *phy,
                            unsigned int mode, phy_interface_t interface,
-@@ -602,6 +675,8 @@ static void mtk_mac_link_up(struct phyli
+@@ -601,6 +674,8 @@ static void mtk_mac_link_up(struct phyli
                break;
        }
  
@@ -139,7 +139,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        /* Configure duplex */
        if (duplex == DUPLEX_FULL)
                mcr |= MAC_MCR_FORCE_DPX;
-@@ -1060,7 +1135,8 @@ static void mtk_tx_set_dma_desc_v1(struc
+@@ -1059,7 +1134,8 @@ static void mtk_tx_set_dma_desc_v1(struc
  
        WRITE_ONCE(desc->txd1, info->addr);
  
@@ -149,7 +149,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (info->last)
                data |= TX_DMA_LS0;
        WRITE_ONCE(desc->txd3, data);
-@@ -1094,9 +1170,6 @@ static void mtk_tx_set_dma_desc_v2(struc
+@@ -1093,9 +1169,6 @@ static void mtk_tx_set_dma_desc_v2(struc
                data |= TX_DMA_LS0;
        WRITE_ONCE(desc->txd3, data);
  
@@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        data = (mac->id + 1) << TX_DMA_FPORT_SHIFT_V2; /* forward port */
        data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
        WRITE_ONCE(desc->txd4, data);
-@@ -1140,11 +1213,12 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1139,11 +1212,12 @@ static int mtk_tx_map(struct sk_buff *sk
                .gso = gso,
                .csum = skb->ip_summed == CHECKSUM_PARTIAL,
                .vlan = skb_vlan_tag_present(skb),
@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        struct mtk_mac *mac = netdev_priv(dev);
        struct mtk_eth *eth = mac->hw;
        const struct mtk_soc_data *soc = eth->soc;
-@@ -1152,8 +1226,10 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1151,8 +1225,10 @@ static int mtk_tx_map(struct sk_buff *sk
        struct mtk_tx_dma *itxd_pdma, *txd_pdma;
        struct mtk_tx_buf *itx_buf, *tx_buf;
        int i, n_desc = 1;
@@ -184,7 +184,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        itxd = ring->next_free;
        itxd_pdma = qdma_to_pdma(ring, itxd);
        if (itxd == ring->last_free)
-@@ -1202,7 +1278,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1201,7 +1277,7 @@ static int mtk_tx_map(struct sk_buff *sk
                        memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
                        txd_info.size = min_t(unsigned int, frag_size,
                                              soc->txrx.dma_max_len);
@@ -193,7 +193,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
                                        !(frag_size - txd_info.size);
                        txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
-@@ -1241,7 +1317,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1240,7 +1316,7 @@ static int mtk_tx_map(struct sk_buff *sk
                        txd_pdma->txd2 |= TX_DMA_LS1;
        }
  
@@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        skb_tx_timestamp(skb);
  
        ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2);
-@@ -1253,8 +1329,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1252,8 +1328,7 @@ static int mtk_tx_map(struct sk_buff *sk
        wmb();
  
        if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
@@ -212,7 +212,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        mtk_w32(eth, txd->txd2, soc->reg_map->qdma.ctx_ptr);
        } else {
                int next_idx;
-@@ -1323,7 +1398,7 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1322,7 +1397,7 @@ static void mtk_wake_queue(struct mtk_et
        for (i = 0; i < MTK_MAC_COUNT; i++) {
                if (!eth->netdev[i])
                        continue;
@@ -221,7 +221,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        }
  }
  
-@@ -1347,7 +1422,7 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1346,7 +1421,7 @@ static netdev_tx_t mtk_start_xmit(struct
  
        tx_num = mtk_cal_txd_req(eth, skb);
        if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
@@ -230,7 +230,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                netif_err(eth, tx_queued, dev,
                          "Tx Ring full when queue awake!\n");
                spin_unlock(&eth->page_lock);
-@@ -1373,7 +1448,7 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1372,7 +1447,7 @@ static netdev_tx_t mtk_start_xmit(struct
                goto drop;
  
        if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
@@ -239,7 +239,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        spin_unlock(&eth->page_lock);
  
-@@ -1540,10 +1615,12 @@ static int mtk_xdp_submit_frame(struct m
+@@ -1539,10 +1614,12 @@ static int mtk_xdp_submit_frame(struct m
        struct skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
        const struct mtk_soc_data *soc = eth->soc;
        struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -252,7 +252,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        };
        int err, index = 0, n_desc = 1, nr_frags;
        struct mtk_tx_dma *htxd, *txd, *txd_pdma;
-@@ -1594,6 +1671,7 @@ static int mtk_xdp_submit_frame(struct m
+@@ -1593,6 +1670,7 @@ static int mtk_xdp_submit_frame(struct m
                memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
                txd_info.size = skb_frag_size(&sinfo->frags[index]);
                txd_info.last = index + 1 == nr_frags;
@@ -260,7 +260,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                data = skb_frag_address(&sinfo->frags[index]);
  
                index++;
-@@ -1945,8 +2023,46 @@ rx_done:
+@@ -1944,8 +2022,46 @@ rx_done:
        return done;
  }
  
@@ -308,7 +308,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  {
        const struct mtk_reg_map *reg_map = eth->soc->reg_map;
        struct mtk_tx_ring *ring = &eth->tx_ring;
-@@ -1976,12 +2092,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1975,12 +2091,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
                        break;
  
                if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
@@ -323,7 +323,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        budget--;
                }
                mtk_tx_unmap(eth, tx_buf, true);
-@@ -1999,7 +2112,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1998,7 +2111,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  }
  
  static int mtk_poll_tx_pdma(struct mtk_eth *eth, int budget,
@@ -332,7 +332,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  {
        struct mtk_tx_ring *ring = &eth->tx_ring;
        struct mtk_tx_buf *tx_buf;
-@@ -2015,12 +2128,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -2014,12 +2127,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
                        break;
  
                if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
@@ -347,7 +347,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        budget--;
                }
                mtk_tx_unmap(eth, tx_buf, true);
-@@ -2041,26 +2150,15 @@ static int mtk_poll_tx(struct mtk_eth *e
+@@ -2040,26 +2149,15 @@ static int mtk_poll_tx(struct mtk_eth *e
  {
        struct mtk_tx_ring *ring = &eth->tx_ring;
        struct dim_sample dim_sample = {};
@@ -379,7 +379,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        dim_update_sample(eth->tx_events, eth->tx_packets, eth->tx_bytes,
                          &dim_sample);
-@@ -2070,7 +2168,7 @@ static int mtk_poll_tx(struct mtk_eth *e
+@@ -2069,7 +2167,7 @@ static int mtk_poll_tx(struct mtk_eth *e
            (atomic_read(&ring->free_count) > ring->thresh))
                mtk_wake_queue(eth);
  
@@ -388,7 +388,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
  
  static void mtk_handle_status_irq(struct mtk_eth *eth)
-@@ -2156,6 +2254,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2155,6 +2253,7 @@ static int mtk_tx_alloc(struct mtk_eth *
        int i, sz = soc->txrx.txd_size;
        struct mtk_tx_dma_v2 *txd;
        int ring_size;
@@ -396,7 +396,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        if (MTK_HAS_CAPS(soc->caps, MTK_QDMA))
                ring_size = MTK_QDMA_RING_SIZE;
-@@ -2223,8 +2322,25 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2222,8 +2321,25 @@ static int mtk_tx_alloc(struct mtk_eth *
                        ring->phys + ((ring_size - 1) * sz),
                        soc->reg_map->qdma.crx_ptr);
                mtk_w32(eth, ring->last_free_ptr, soc->reg_map->qdma.drx_ptr);
@@ -424,7 +424,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        } else {
                mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
                mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0);
-@@ -2907,7 +3023,7 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2906,7 +3022,7 @@ static int mtk_start_dma(struct mtk_eth
                if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
                        val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
                               MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
@@ -433,7 +433,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                else
                        val |= MTK_RX_BT_32DWORDS;
                mtk_w32(eth, val, reg_map->qdma.glo_cfg);
-@@ -2953,6 +3069,45 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2952,6 +3068,45 @@ static void mtk_gdm_config(struct mtk_et
        mtk_w32(eth, 0, MTK_RST_GL);
  }
  
@@ -479,7 +479,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static int mtk_open(struct net_device *dev)
  {
        struct mtk_mac *mac = netdev_priv(dev);
-@@ -2997,7 +3152,8 @@ static int mtk_open(struct net_device *d
+@@ -2996,7 +3151,8 @@ static int mtk_open(struct net_device *d
                refcount_inc(&eth->dma_refcnt);
  
        phylink_start(mac->phylink);
@@ -489,7 +489,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        return 0;
  }
  
-@@ -3703,8 +3859,12 @@ static int mtk_unreg_dev(struct mtk_eth
+@@ -3702,8 +3858,12 @@ static int mtk_unreg_dev(struct mtk_eth
        int i;
  
        for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -502,7 +502,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                unregister_netdev(eth->netdev[i]);
        }
  
-@@ -3921,6 +4081,23 @@ static int mtk_set_rxnfc(struct net_devi
+@@ -3920,6 +4080,23 @@ static int mtk_set_rxnfc(struct net_devi
        return ret;
  }
  
@@ -526,7 +526,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static const struct ethtool_ops mtk_ethtool_ops = {
        .get_link_ksettings     = mtk_get_link_ksettings,
        .set_link_ksettings     = mtk_set_link_ksettings,
-@@ -3955,6 +4132,7 @@ static const struct net_device_ops mtk_n
+@@ -3954,6 +4131,7 @@ static const struct net_device_ops mtk_n
        .ndo_setup_tc           = mtk_eth_setup_tc,
        .ndo_bpf                = mtk_xdp,
        .ndo_xdp_xmit           = mtk_xdp_xmit,
@@ -534,7 +534,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  };
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
-@@ -3964,6 +4142,7 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3963,6 +4141,7 @@ static int mtk_add_mac(struct mtk_eth *e
        struct phylink *phylink;
        struct mtk_mac *mac;
        int id, err;
@@ -542,7 +542,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        if (!_id) {
                dev_err(eth->dev, "missing mac id\n");
-@@ -3981,7 +4160,10 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3980,7 +4159,10 @@ static int mtk_add_mac(struct mtk_eth *e
                return -EINVAL;
        }
  
@@ -554,7 +554,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (!eth->netdev[id]) {
                dev_err(eth->dev, "alloc_etherdev failed\n");
                return -ENOMEM;
-@@ -4089,6 +4271,11 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4088,6 +4270,11 @@ static int mtk_add_mac(struct mtk_eth *e
        else
                eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN;
  
index 3733b7279f91b60198e5e5647429e6b03941deb3..b64f434365f68b01a35e8f5120b38d36de0215d4 100644 (file)
@@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
  #include "mtk_eth_soc.h"
  #include "mtk_wed.h"
-@@ -1974,16 +1975,22 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1973,16 +1974,22 @@ static int mtk_poll_rx(struct napi_struc
                                                htons(RX_DMA_VPID(trxd.rxd4)),
                                                RX_DMA_VID(trxd.rxd4));
                        } else if (trxd.rxd2 & RX_DMA_VTAG) {
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                }
  
                skb_record_rx_queue(skb, 0);
-@@ -2803,15 +2810,30 @@ static netdev_features_t mtk_fix_feature
+@@ -2802,15 +2809,30 @@ static netdev_features_t mtk_fix_feature
  
  static int mtk_set_features(struct net_device *dev, netdev_features_t features)
  {
@@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
  
  /* wait for DMA to finish whatever it is doing before we start using it again */
-@@ -3108,11 +3130,45 @@ found:
+@@ -3107,11 +3129,45 @@ found:
        return NOTIFY_DONE;
  }
  
@@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
        if (err) {
-@@ -3635,6 +3691,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3634,6 +3690,10 @@ static int mtk_hw_init(struct mtk_eth *e
         */
        val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
        mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
@@ -146,7 +146,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        /* Enable RX VLan Offloading */
        mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
-@@ -3851,6 +3911,12 @@ static int mtk_free_dev(struct mtk_eth *
+@@ -3850,6 +3910,12 @@ static int mtk_free_dev(struct mtk_eth *
                free_netdev(eth->netdev[i]);
        }
  
index 9c2843a6c9c34d98626b520c86b359b0563a75fc..b8c786505f419a17a5c9dc6b63ab021dd29fa086 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3715,9 +3715,12 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3714,9 +3714,12 @@ static int mtk_hw_init(struct mtk_eth *e
        mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
index 5a4d343a72cf39deed18bd91501189e65bd13c3a..346db89911ec121cbf0188376e615f9cdeecae74 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3146,7 +3146,8 @@ static int mtk_open(struct net_device *d
+@@ -3145,7 +3145,8 @@ static int mtk_open(struct net_device *d
        struct mtk_eth *eth = mac->hw;
        int i, err;
  
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
                        struct metadata_dst *md_dst = eth->dsa_meta[i];
  
-@@ -3163,7 +3164,8 @@ static int mtk_open(struct net_device *d
+@@ -3162,7 +3163,8 @@ static int mtk_open(struct net_device *d
                }
        } else {
                /* Hardware special tag parsing needs to be disabled if at least
index e93e62125d458a611bafe237fb0a498b86a614e9..ec5dc49f5e5fac57359e6d656cf64b9264e3e1e9 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3081,7 +3081,7 @@ static void mtk_gdm_config(struct mtk_et
+@@ -3080,7 +3080,7 @@ static void mtk_gdm_config(struct mtk_et
  
                val |= config;
  
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        val |= MTK_GDMA_SPECIAL_TAG;
  
                mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
-@@ -3146,8 +3146,7 @@ static int mtk_open(struct net_device *d
+@@ -3145,8 +3145,7 @@ static int mtk_open(struct net_device *d
        struct mtk_eth *eth = mac->hw;
        int i, err;
  
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) {
                        struct metadata_dst *md_dst = eth->dsa_meta[i];
  
-@@ -3164,8 +3163,7 @@ static int mtk_open(struct net_device *d
+@@ -3163,8 +3162,7 @@ static int mtk_open(struct net_device *d
                }
        } else {
                /* Hardware special tag parsing needs to be disabled if at least
index c392429b887478ea55131e009782abea10afb758..e75459696b6c9540cb4460aa81f2703965f6eba0 100644 (file)
@@ -77,7 +77,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1830,7 +1830,9 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1829,7 +1829,9 @@ static int mtk_poll_rx(struct napi_struc
  
        while (done < budget) {
                unsigned int pktlen, *rxdcsum;
@@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                dma_addr_t dma_addr;
                u32 hash, reason;
                int mac = 0;
-@@ -1970,27 +1972,29 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1969,27 +1971,29 @@ static int mtk_poll_rx(struct napi_struc
  
                if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) {
                        if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
index e633f6f1fb809a2b36202357962f6bfb0f06fa7f..4ba492014a5f56e57dc3cf9530632617b7b97fb1 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -676,8 +676,6 @@ static void mtk_mac_link_up(struct phyli
+@@ -675,8 +675,6 @@ static void mtk_mac_link_up(struct phyli
                break;
        }
  
index b59638e772b80c3119a1973b96089150e19d4816..741831f6967f8a45d14e6b937e58a0e0a8cd0a8a 100644 (file)
@@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                mtk_eth_path_name(path), __func__, updated);
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4752,6 +4752,26 @@ static const struct mtk_soc_data mt7629_
+@@ -4751,6 +4751,26 @@ static const struct mtk_soc_data mt7629_
        },
  };
  
@@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  static const struct mtk_soc_data mt7986_data = {
        .reg_map = &mt7986_reg_map,
        .ana_rgc3 = 0x128,
-@@ -4794,6 +4814,7 @@ const struct of_device_id of_mtk_match[]
+@@ -4793,6 +4813,7 @@ const struct of_device_id of_mtk_match[]
        { .compatible = "mediatek,mt7622-eth", .data = &mt7622_data},
        { .compatible = "mediatek,mt7623-eth", .data = &mt7623_data},
        { .compatible = "mediatek,mt7629-eth", .data = &mt7629_data},
index 9def19d67eb303aea3261c60baffc7f929fdd6ff..d4c1ecf22cc86a13b569df58d75eef6b1847cf70 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -702,8 +702,10 @@ static const struct phylink_mac_ops mtk_
+@@ -701,8 +701,10 @@ static const struct phylink_mac_ops mtk_
  
  static int mtk_mdio_init(struct mtk_eth *eth)
  {
@@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
        mii_np = of_get_child_by_name(eth->dev->of_node, "mdio-bus");
        if (!mii_np) {
-@@ -729,6 +731,25 @@ static int mtk_mdio_init(struct mtk_eth
+@@ -728,6 +730,25 @@ static int mtk_mdio_init(struct mtk_eth
        eth->mii_bus->parent = eth->dev;
  
        snprintf(eth->mii_bus->id, MII_BUS_ID_SIZE, "%pOFn", mii_np);
index c55d6b6428caf1a897ea6f2dc999d186da36c547..8f7620616756c17b8baa8c7329fa6d72f4e22de3 100644 (file)
@@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
  
        return NULL;
-@@ -3963,8 +3964,17 @@ static int mtk_unreg_dev(struct mtk_eth
+@@ -3962,8 +3963,17 @@ static int mtk_unreg_dev(struct mtk_eth
        return 0;
  }
  
@@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        mtk_unreg_dev(eth);
        mtk_free_dev(eth);
        cancel_work_sync(&eth->pending_work);
-@@ -4404,6 +4414,36 @@ void mtk_eth_set_dma_device(struct mtk_e
+@@ -4403,6 +4413,36 @@ void mtk_eth_set_dma_device(struct mtk_e
        rtnl_unlock();
  }
  
@@ -115,7 +115,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  static int mtk_probe(struct platform_device *pdev)
  {
        struct resource *res = NULL;
-@@ -4467,13 +4507,7 @@ static int mtk_probe(struct platform_dev
+@@ -4466,13 +4506,7 @@ static int mtk_probe(struct platform_dev
        }
  
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_SGMII)) {
@@ -130,7 +130,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
                if (err)
                        return err;
-@@ -4484,14 +4518,17 @@ static int mtk_probe(struct platform_dev
+@@ -4483,14 +4517,17 @@ static int mtk_probe(struct platform_dev
                                                            "mediatek,pctl");
                if (IS_ERR(eth->pctl)) {
                        dev_err(&pdev->dev, "no pctl regmap found\n");
@@ -151,7 +151,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
  
        if (eth->soc->offload_version) {
-@@ -4652,6 +4689,8 @@ err_deinit_hw:
+@@ -4651,6 +4688,8 @@ err_deinit_hw:
        mtk_hw_deinit(eth);
  err_wed_exit:
        mtk_wed_exit();
index 81f9c79655d31ef4b19b29d56f3b0d02975d2a39..7ca2244b33f2dd41df5e5e9e5b33e7f8ebba35a7 100644 (file)
@@ -53,7 +53,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4638,8 +4638,8 @@ static int mtk_probe(struct platform_dev
+@@ -4637,8 +4637,8 @@ static int mtk_probe(struct platform_dev
                for (i = 0; i < num_ppe; i++) {
                        u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
  
@@ -64,7 +64,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
                        if (!eth->ppe[i]) {
                                err = -ENOMEM;
                                goto err_deinit_ppe;
-@@ -4765,6 +4765,7 @@ static const struct mtk_soc_data mt7622_
+@@ -4764,6 +4764,7 @@ static const struct mtk_soc_data mt7622_
        .required_pctl = false,
        .offload_version = 2,
        .hash_offset = 2,
@@ -72,7 +72,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
        .foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
-@@ -4802,6 +4803,7 @@ static const struct mtk_soc_data mt7629_
+@@ -4801,6 +4802,7 @@ static const struct mtk_soc_data mt7629_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7629_CLKS_BITMAP,
        .required_pctl = false,
@@ -80,7 +80,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4822,6 +4824,7 @@ static const struct mtk_soc_data mt7981_
+@@ -4821,6 +4823,7 @@ static const struct mtk_soc_data mt7981_
        .offload_version = 2,
        .hash_offset = 4,
        .foe_entry_size = sizeof(struct mtk_foe_entry),
@@ -88,7 +88,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma_v2),
                .rxd_size = sizeof(struct mtk_rx_dma_v2),
-@@ -4842,6 +4845,7 @@ static const struct mtk_soc_data mt7986_
+@@ -4841,6 +4844,7 @@ static const struct mtk_soc_data mt7986_
        .offload_version = 2,
        .hash_offset = 4,
        .foe_entry_size = sizeof(struct mtk_foe_entry),
index 6126dfeadc2e94a5c273920ab1801f98668b945d..8be6a699214e4b4cf7745eeb32f560a3fd239046 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1850,9 +1850,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1849,9 +1849,7 @@ static int mtk_poll_rx(struct napi_struc
  
        while (done < budget) {
                unsigned int pktlen, *rxdcsum;
@@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                dma_addr_t dma_addr;
                u32 hash, reason;
                int mac = 0;
-@@ -1987,36 +1985,21 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1986,36 +1984,21 @@ static int mtk_poll_rx(struct napi_struc
                        skb_checksum_none_assert(skb);
                skb->protocol = eth_type_trans(skb, netdev);
  
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                skb_record_rx_queue(skb, 0);
                napi_gro_receive(napi, skb);
  
-@@ -2834,29 +2817,11 @@ static netdev_features_t mtk_fix_feature
+@@ -2833,29 +2816,11 @@ static netdev_features_t mtk_fix_feature
  
  static int mtk_set_features(struct net_device *dev, netdev_features_t features)
  {
@@ -100,7 +100,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        return 0;
  }
  
-@@ -3170,30 +3135,6 @@ static int mtk_open(struct net_device *d
+@@ -3169,30 +3134,6 @@ static int mtk_open(struct net_device *d
        struct mtk_eth *eth = mac->hw;
        int i, err;
  
@@ -131,7 +131,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
        if (err) {
                netdev_err(dev, "%s: could not attach PHY: %d\n", __func__,
-@@ -3234,6 +3175,35 @@ static int mtk_open(struct net_device *d
+@@ -3233,6 +3174,35 @@ static int mtk_open(struct net_device *d
        phylink_start(mac->phylink);
        netif_tx_start_all_queues(dev);
  
@@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        return 0;
  }
  
-@@ -3718,10 +3688,9 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3717,10 +3687,9 @@ static int mtk_hw_init(struct mtk_eth *e
        if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
                val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
                mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
@@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        /* set interrupt delays based on current Net DIM sample */
        mtk_dim_rx(&eth->rx_dim.work);
-@@ -4361,7 +4330,7 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4360,7 +4329,7 @@ static int mtk_add_mac(struct mtk_eth *e
                eth->netdev[id]->hw_features |= NETIF_F_LRO;
  
        eth->netdev[id]->vlan_features = eth->soc->hw_features &
index ad63dd61963626dd87520630fb3290c59a21c88d..25ac8db9124494d888fbad03847b5539098858ef 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4714,7 +4714,7 @@ static const struct mtk_soc_data mt7621_
+@@ -4713,7 +4713,7 @@ static const struct mtk_soc_data mt7621_
        .required_pctl = false,
        .offload_version = 1,
        .hash_offset = 2,
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4735,7 +4735,7 @@ static const struct mtk_soc_data mt7622_
+@@ -4734,7 +4734,7 @@ static const struct mtk_soc_data mt7622_
        .offload_version = 2,
        .hash_offset = 2,
        .has_accounting = true,
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4754,7 +4754,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4753,7 +4753,7 @@ static const struct mtk_soc_data mt7623_
        .required_pctl = true,
        .offload_version = 1,
        .hash_offset = 2,
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4792,8 +4792,8 @@ static const struct mtk_soc_data mt7981_
+@@ -4791,8 +4791,8 @@ static const struct mtk_soc_data mt7981_
        .required_pctl = false,
        .offload_version = 2,
        .hash_offset = 4,
@@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma_v2),
                .rxd_size = sizeof(struct mtk_rx_dma_v2),
-@@ -4813,8 +4813,8 @@ static const struct mtk_soc_data mt7986_
+@@ -4812,8 +4812,8 @@ static const struct mtk_soc_data mt7986_
        .required_pctl = false,
        .offload_version = 2,
        .hash_offset = 4,
index c502c4c28c4ac47c7eb81dcce858de4445867fc0..97209958afcdc3ba5a3ae14b58eeb59d8b4e54ab 100644 (file)
@@ -95,7 +95,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
                                /* mt7623_pad_clk_setup */
                                for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
-@@ -4289,13 +4261,19 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4288,13 +4260,19 @@ static int mtk_add_mac(struct mtk_eth *e
        mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
                MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD;
  
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  
        if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_TRGMII) && !mac->id)
                __set_bit(PHY_INTERFACE_MODE_TRGMII,
-@@ -4755,6 +4733,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4754,6 +4732,7 @@ static const struct mtk_soc_data mt7623_
        .offload_version = 1,
        .hash_offset = 2,
        .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
index 21ca0b1c08ca78a2a66f2be98432d38eda2bb82e..e1b12725b50a07675c9d77329eee60f1eeef2b1c 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -512,38 +512,6 @@ static int mtk_mac_finish(struct phylink
+@@ -511,38 +511,6 @@ static int mtk_mac_finish(struct phylink
        return 0;
  }
  
@@ -62,7 +62,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode,
                              phy_interface_t interface)
  {
-@@ -666,7 +634,6 @@ static void mtk_mac_link_up(struct phyli
+@@ -665,7 +633,6 @@ static void mtk_mac_link_up(struct phyli
  static const struct phylink_mac_ops mtk_phylink_ops = {
        .validate = phylink_generic_validate,
        .mac_select_pcs = mtk_mac_select_pcs,
@@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
        .mac_config = mtk_mac_config,
        .mac_finish = mtk_mac_finish,
        .mac_link_down = mtk_mac_link_down,
-@@ -4256,8 +4223,6 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4255,8 +4222,6 @@ static int mtk_add_mac(struct mtk_eth *e
  
        mac->phylink_config.dev = &eth->netdev[id]->dev;
        mac->phylink_config.type = PHYLINK_NETDEV;
index d1d692002d12a4f29fd430efa85ecfb10a57c64d..5875401b42dc8aba70b05cba8b5df94ae39427d2 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -537,7 +537,7 @@ static void mtk_set_queue_speed(struct m
+@@ -536,7 +536,7 @@ static void mtk_set_queue_speed(struct m
              FIELD_PREP(MTK_QTX_SCH_MIN_RATE_MAN, 1) |
              FIELD_PREP(MTK_QTX_SCH_MIN_RATE_EXP, 4) |
              MTK_QTX_SCH_LEAKY_BUCKET_SIZE;
@@ -32,7 +32,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                val |= MTK_QTX_SCH_LEAKY_BUCKET_EN;
  
        if (IS_ENABLED(CONFIG_SOC_MT7621)) {
-@@ -912,7 +912,7 @@ static bool mtk_rx_get_desc(struct mtk_e
+@@ -911,7 +911,7 @@ static bool mtk_rx_get_desc(struct mtk_e
        rxd->rxd1 = READ_ONCE(dma_rxd->rxd1);
        rxd->rxd3 = READ_ONCE(dma_rxd->rxd3);
        rxd->rxd4 = READ_ONCE(dma_rxd->rxd4);
@@ -41,7 +41,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                rxd->rxd5 = READ_ONCE(dma_rxd->rxd5);
                rxd->rxd6 = READ_ONCE(dma_rxd->rxd6);
        }
-@@ -970,7 +970,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -969,7 +969,7 @@ static int mtk_init_fq_dma(struct mtk_et
  
                txd->txd3 = TX_DMA_PLEN0(MTK_QDMA_PAGE_SIZE);
                txd->txd4 = 0;
@@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        txd->txd5 = 0;
                        txd->txd6 = 0;
                        txd->txd7 = 0;
-@@ -1159,7 +1159,7 @@ static void mtk_tx_set_dma_desc(struct n
+@@ -1158,7 +1158,7 @@ static void mtk_tx_set_dma_desc(struct n
        struct mtk_mac *mac = netdev_priv(dev);
        struct mtk_eth *eth = mac->hw;
  
@@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                mtk_tx_set_dma_desc_v2(dev, txd, info);
        else
                mtk_tx_set_dma_desc_v1(dev, txd, info);
-@@ -1466,7 +1466,7 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1465,7 +1465,7 @@ static void mtk_update_rx_cpu_idx(struct
  
  static bool mtk_page_pool_enabled(struct mtk_eth *eth)
  {
@@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  }
  
  static struct page_pool *mtk_create_page_pool(struct mtk_eth *eth,
-@@ -1806,7 +1806,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1805,7 +1805,7 @@ static int mtk_poll_rx(struct napi_struc
                        break;
  
                /* find out which mac the packet come from. values start at 1 */
@@ -77,7 +77,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        mac = RX_DMA_GET_SPORT_V2(trxd.rxd5) - 1;
                else if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) &&
                         !(trxd.rxd4 & RX_DMA_SPECIAL_TAG))
-@@ -1902,7 +1902,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1901,7 +1901,7 @@ static int mtk_poll_rx(struct napi_struc
                skb->dev = netdev;
                bytes += skb->len;
  
@@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        reason = FIELD_GET(MTK_RXD5_PPE_CPU_REASON, trxd.rxd5);
                        hash = trxd.rxd5 & MTK_RXD5_FOE_ENTRY;
                        if (hash != MTK_RXD5_FOE_ENTRY)
-@@ -1927,8 +1927,8 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1926,8 +1926,8 @@ static int mtk_poll_rx(struct napi_struc
                /* When using VLAN untagging in combination with DSA, the
                 * hardware treats the MTK special tag as a VLAN and untags it.
                 */
@@ -97,7 +97,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        unsigned int port = RX_DMA_VPID(trxd.rxd3) & GENMASK(2, 0);
  
                        if (port < ARRAY_SIZE(eth->dsa_meta) &&
-@@ -2232,7 +2232,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2231,7 +2231,7 @@ static int mtk_tx_alloc(struct mtk_eth *
                txd->txd2 = next_ptr;
                txd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
                txd->txd4 = 0;
@@ -106,7 +106,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        txd->txd5 = 0;
                        txd->txd6 = 0;
                        txd->txd7 = 0;
-@@ -2285,14 +2285,14 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2284,14 +2284,14 @@ static int mtk_tx_alloc(struct mtk_eth *
                              FIELD_PREP(MTK_QTX_SCH_MIN_RATE_MAN, 1) |
                              FIELD_PREP(MTK_QTX_SCH_MIN_RATE_EXP, 4) |
                              MTK_QTX_SCH_LEAKY_BUCKET_SIZE;
@@ -123,7 +123,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        mtk_w32(eth, val, soc->reg_map->qdma.tx_sch_rate + 4);
        } else {
                mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
-@@ -2419,7 +2419,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2418,7 +2418,7 @@ static int mtk_rx_alloc(struct mtk_eth *
  
                rxd->rxd3 = 0;
                rxd->rxd4 = 0;
@@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        rxd->rxd5 = 0;
                        rxd->rxd6 = 0;
                        rxd->rxd7 = 0;
-@@ -2970,7 +2970,7 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2969,7 +2969,7 @@ static int mtk_start_dma(struct mtk_eth
                       MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
                       MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE;
  
@@ -141,7 +141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
                               MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
                               MTK_CHK_DDONE_EN | MTK_LEAKY_BUCKET_EN;
-@@ -3114,7 +3114,7 @@ static int mtk_open(struct net_device *d
+@@ -3113,7 +3113,7 @@ static int mtk_open(struct net_device *d
        phylink_start(mac->phylink);
        netif_tx_start_all_queues(dev);
  
@@ -150,7 +150,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                return 0;
  
        if (mtk_uses_dsa(dev) && !eth->prog) {
-@@ -3379,7 +3379,7 @@ static void mtk_hw_reset(struct mtk_eth
+@@ -3378,7 +3378,7 @@ static void mtk_hw_reset(struct mtk_eth
  {
        u32 val;
  
@@ -159,7 +159,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
                val = RSTCTRL_PPE0_V2;
        } else {
-@@ -3391,7 +3391,7 @@ static void mtk_hw_reset(struct mtk_eth
+@@ -3390,7 +3390,7 @@ static void mtk_hw_reset(struct mtk_eth
  
        ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
  
@@ -168,7 +168,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
                             0x3ffffff);
  }
-@@ -3417,7 +3417,7 @@ static void mtk_hw_warm_reset(struct mtk
+@@ -3416,7 +3416,7 @@ static void mtk_hw_warm_reset(struct mtk
                return;
        }
  
@@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0_V2;
        else
                rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0;
-@@ -3587,7 +3587,7 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3586,7 +3586,7 @@ static int mtk_hw_init(struct mtk_eth *e
        else
                mtk_hw_reset(eth);
  
@@ -186,7 +186,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                /* Set FE to PDMAv2 if necessary */
                val = mtk_r32(eth, MTK_FE_GLO_MISC);
                mtk_w32(eth,  val | BIT(4), MTK_FE_GLO_MISC);
-@@ -3624,7 +3624,7 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3623,7 +3623,7 @@ static int mtk_hw_init(struct mtk_eth *e
         */
        val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
        mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
@@ -195,7 +195,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
                mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
  
-@@ -3646,7 +3646,7 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3645,7 +3645,7 @@ static int mtk_hw_init(struct mtk_eth *e
        mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4);
        mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
@@ -204,7 +204,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                /* PSE should not drop port8 and port9 packets from WDMA Tx */
                mtk_w32(eth, 0x00000300, PSE_DROP_CFG);
  
-@@ -4435,7 +4435,7 @@ static int mtk_probe(struct platform_dev
+@@ -4434,7 +4434,7 @@ static int mtk_probe(struct platform_dev
                }
        }
  
@@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
                if (!res) {
                        err = -EINVAL;
-@@ -4543,9 +4543,8 @@ static int mtk_probe(struct platform_dev
+@@ -4542,9 +4542,8 @@ static int mtk_probe(struct platform_dev
        }
  
        if (eth->soc->offload_version) {
@@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                num_ppe = min_t(u32, ARRAY_SIZE(eth->ppe), num_ppe);
                for (i = 0; i < num_ppe; i++) {
                        u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
-@@ -4639,6 +4638,7 @@ static const struct mtk_soc_data mt2701_
+@@ -4638,6 +4637,7 @@ static const struct mtk_soc_data mt2701_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7623_CLKS_BITMAP,
        .required_pctl = true,
@@ -232,7 +232,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4655,6 +4655,7 @@ static const struct mtk_soc_data mt7621_
+@@ -4654,6 +4654,7 @@ static const struct mtk_soc_data mt7621_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7621_CLKS_BITMAP,
        .required_pctl = false,
@@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        .offload_version = 1,
        .hash_offset = 2,
        .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
-@@ -4675,6 +4676,7 @@ static const struct mtk_soc_data mt7622_
+@@ -4674,6 +4675,7 @@ static const struct mtk_soc_data mt7622_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7622_CLKS_BITMAP,
        .required_pctl = false,
@@ -248,7 +248,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        .offload_version = 2,
        .hash_offset = 2,
        .has_accounting = true,
-@@ -4695,6 +4697,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4694,6 +4696,7 @@ static const struct mtk_soc_data mt7623_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7623_CLKS_BITMAP,
        .required_pctl = true,
@@ -256,7 +256,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        .offload_version = 1,
        .hash_offset = 2,
        .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
-@@ -4717,6 +4720,7 @@ static const struct mtk_soc_data mt7629_
+@@ -4716,6 +4719,7 @@ static const struct mtk_soc_data mt7629_
        .required_clks = MT7629_CLKS_BITMAP,
        .required_pctl = false,
        .has_accounting = true,
@@ -264,7 +264,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        .txrx = {
                .txd_size = sizeof(struct mtk_tx_dma),
                .rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4734,6 +4738,7 @@ static const struct mtk_soc_data mt7981_
+@@ -4733,6 +4737,7 @@ static const struct mtk_soc_data mt7981_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7981_CLKS_BITMAP,
        .required_pctl = false,
@@ -272,7 +272,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        .offload_version = 2,
        .hash_offset = 4,
        .has_accounting = true,
-@@ -4755,6 +4760,7 @@ static const struct mtk_soc_data mt7986_
+@@ -4754,6 +4759,7 @@ static const struct mtk_soc_data mt7986_
        .hw_features = MTK_HW_FEATURES,
        .required_clks = MT7986_CLKS_BITMAP,
        .required_pctl = false,
@@ -280,7 +280,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        .offload_version = 2,
        .hash_offset = 4,
        .has_accounting = true,
-@@ -4775,6 +4781,7 @@ static const struct mtk_soc_data rt5350_
+@@ -4774,6 +4780,7 @@ static const struct mtk_soc_data rt5350_
        .hw_features = MTK_HW_FEATURES_MT7628,
        .required_clks = MT7628_CLKS_BITMAP,
        .required_pctl = false,
@@ -491,7 +491,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                else
                        val = MTK_FOE_IB2_MIB_CNT;
 @@ -971,7 +971,7 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
-                        MTK_PPE_SCAN_MODE_KEEPALIVE_AGE) |
+                        MTK_PPE_SCAN_MODE_CHECK_AGE) |
              FIELD_PREP(MTK_PPE_TB_CFG_ENTRY_NUM,
                         MTK_PPE_ENTRIES_SHIFT);
 -      if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2))
index 281291252b45a55383be66ea56f14e230e93b4f0..faa8734c24b4f0bd63e623161b9146fb16c74c26 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -838,7 +838,7 @@ static void mtk_stats_update(struct mtk_
+@@ -837,7 +837,7 @@ static void mtk_stats_update(struct mtk_
  {
        int i;
  
@@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                if (!eth->mac[i] || !eth->mac[i]->hw_stats)
                        continue;
                if (spin_trylock(&eth->mac[i]->hw_stats->stats_lock)) {
-@@ -1341,7 +1341,7 @@ static int mtk_queue_stopped(struct mtk_
+@@ -1340,7 +1340,7 @@ static int mtk_queue_stopped(struct mtk_
  {
        int i;
  
@@ -35,7 +35,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                if (!eth->netdev[i])
                        continue;
                if (netif_queue_stopped(eth->netdev[i]))
-@@ -1355,7 +1355,7 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1354,7 +1354,7 @@ static void mtk_wake_queue(struct mtk_et
  {
        int i;
  
@@ -44,7 +44,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                if (!eth->netdev[i])
                        continue;
                netif_tx_wake_all_queues(eth->netdev[i]);
-@@ -1812,7 +1812,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1811,7 +1811,7 @@ static int mtk_poll_rx(struct napi_struc
                         !(trxd.rxd4 & RX_DMA_SPECIAL_TAG))
                        mac = RX_DMA_GET_SPORT(trxd.rxd4) - 1;
  
@@ -53,7 +53,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                             !eth->netdev[mac]))
                        goto release_desc;
  
-@@ -2844,7 +2844,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -2843,7 +2843,7 @@ static void mtk_dma_free(struct mtk_eth
        const struct mtk_soc_data *soc = eth->soc;
        int i;
  
@@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                if (eth->netdev[i])
                        netdev_reset_queue(eth->netdev[i]);
        if (eth->scratch_ring) {
-@@ -2998,8 +2998,13 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2997,8 +2997,13 @@ static void mtk_gdm_config(struct mtk_et
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
                return;
  
@@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
                /* default setup the forward port to send frame to PDMA */
                val &= ~0xffff;
-@@ -3009,7 +3014,7 @@ static void mtk_gdm_config(struct mtk_et
+@@ -3008,7 +3013,7 @@ static void mtk_gdm_config(struct mtk_et
  
                val |= config;
  
@@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        val |= MTK_GDMA_SPECIAL_TAG;
  
                mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i));
-@@ -3608,15 +3613,15 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3607,15 +3612,15 @@ static int mtk_hw_init(struct mtk_eth *e
         * up with the more appropriate value when mtk_mac_config call is being
         * invoked.
         */
@@ -109,7 +109,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
  
        /* Indicates CDM to parse the MTK special tag from CPU
-@@ -3796,7 +3801,7 @@ static void mtk_pending_work(struct work
+@@ -3795,7 +3800,7 @@ static void mtk_pending_work(struct work
        mtk_prepare_for_reset(eth);
  
        /* stop all devices to make sure that dma is properly shut down */
@@ -118,7 +118,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                if (!eth->netdev[i] || !netif_running(eth->netdev[i]))
                        continue;
  
-@@ -3812,8 +3817,8 @@ static void mtk_pending_work(struct work
+@@ -3811,8 +3816,8 @@ static void mtk_pending_work(struct work
        mtk_hw_init(eth, true);
  
        /* restart DMA and enable IRQs */
@@ -129,7 +129,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                        continue;
  
                if (mtk_open(eth->netdev[i])) {
-@@ -3840,7 +3845,7 @@ static int mtk_free_dev(struct mtk_eth *
+@@ -3839,7 +3844,7 @@ static int mtk_free_dev(struct mtk_eth *
  {
        int i;
  
@@ -138,7 +138,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                if (!eth->netdev[i])
                        continue;
                free_netdev(eth->netdev[i]);
-@@ -3859,7 +3864,7 @@ static int mtk_unreg_dev(struct mtk_eth
+@@ -3858,7 +3863,7 @@ static int mtk_unreg_dev(struct mtk_eth
  {
        int i;
  
@@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                struct mtk_mac *mac;
                if (!eth->netdev[i])
                        continue;
-@@ -4160,7 +4165,7 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4159,7 +4164,7 @@ static int mtk_add_mac(struct mtk_eth *e
        }
  
        id = be32_to_cpup(_id);
@@ -156,7 +156,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                dev_err(eth->dev, "%d is not a valid mac id\n", id);
                return -EINVAL;
        }
-@@ -4305,7 +4310,7 @@ void mtk_eth_set_dma_device(struct mtk_e
+@@ -4304,7 +4309,7 @@ void mtk_eth_set_dma_device(struct mtk_e
  
        rtnl_lock();
  
@@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                dev = eth->netdev[i];
  
                if (!dev || !(dev->flags & IFF_UP))
-@@ -4613,7 +4618,7 @@ static int mtk_remove(struct platform_de
+@@ -4612,7 +4617,7 @@ static int mtk_remove(struct platform_de
        int i;
  
        /* stop all devices to make sure that dma is properly shut down */
index abfda59339a1862c3ad47780947eb330894dc766..c22b55c6f13ddbe6683f61c1cf31a5b88f5149a3 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -818,17 +818,32 @@ void mtk_stats_update_mac(struct mtk_mac
+@@ -817,17 +817,32 @@ void mtk_stats_update_mac(struct mtk_mac
                        mtk_r32(mac->hw, reg_map->gdm1_cnt + 0x20 + offs);
                hw_stats->rx_flow_control_packets +=
                        mtk_r32(mac->hw, reg_map->gdm1_cnt + 0x24 + offs);
@@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
  
        u64_stats_update_end(&hw_stats->syncp);
-@@ -1130,7 +1145,10 @@ static void mtk_tx_set_dma_desc_v2(struc
+@@ -1129,7 +1144,10 @@ static void mtk_tx_set_dma_desc_v2(struc
                data |= TX_DMA_LS0;
        WRITE_ONCE(desc->txd3, data);
  
@@ -74,7 +74,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
        WRITE_ONCE(desc->txd4, data);
  
-@@ -1141,6 +1159,8 @@ static void mtk_tx_set_dma_desc_v2(struc
+@@ -1140,6 +1158,8 @@ static void mtk_tx_set_dma_desc_v2(struc
                /* tx checksum offload */
                if (info->csum)
                        data |= TX_DMA_CHKSUM_V2;
@@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
        WRITE_ONCE(desc->txd5, data);
  
-@@ -1206,8 +1226,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1205,8 +1225,7 @@ static int mtk_tx_map(struct sk_buff *sk
        mtk_tx_set_dma_desc(dev, itxd, &txd_info);
  
        itx_buf->flags |= MTK_TX_FLAGS_SINGLE0;
@@ -93,7 +93,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        setup_tx_buf(eth, itx_buf, itxd_pdma, txd_info.addr, txd_info.size,
                     k++);
  
-@@ -1255,8 +1274,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1254,8 +1273,7 @@ static int mtk_tx_map(struct sk_buff *sk
                                memset(tx_buf, 0, sizeof(*tx_buf));
                        tx_buf->data = (void *)MTK_DMA_DUMMY_DESC;
                        tx_buf->flags |= MTK_TX_FLAGS_PAGE0;
@@ -103,7 +103,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
                        setup_tx_buf(eth, tx_buf, txd_pdma, txd_info.addr,
                                     txd_info.size, k++);
-@@ -1558,7 +1576,7 @@ static int mtk_xdp_frame_map(struct mtk_
+@@ -1557,7 +1575,7 @@ static int mtk_xdp_frame_map(struct mtk_
        }
        mtk_tx_set_dma_desc(dev, txd, txd_info);
  
@@ -112,7 +112,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        tx_buf->type = dma_map ? MTK_TYPE_XDP_NDO : MTK_TYPE_XDP_TX;
        tx_buf->data = (void *)MTK_DMA_DUMMY_DESC;
  
-@@ -1806,11 +1824,24 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1805,11 +1823,24 @@ static int mtk_poll_rx(struct napi_struc
                        break;
  
                /* find out which mac the packet come from. values start at 1 */
@@ -141,7 +141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
                if (unlikely(mac < 0 || mac >= MTK_MAX_DEVS ||
                             !eth->netdev[mac]))
-@@ -2030,7 +2061,6 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -2029,7 +2060,6 @@ static int mtk_poll_tx_qdma(struct mtk_e
  
        while ((cpu != dma) && budget) {
                u32 next_cpu = desc->txd2;
@@ -149,7 +149,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
                desc = mtk_qdma_phys_to_virt(ring, desc->txd2);
                if ((desc->txd3 & TX_DMA_OWNER_CPU) == 0)
-@@ -2038,15 +2068,13 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -2037,15 +2067,13 @@ static int mtk_poll_tx_qdma(struct mtk_e
  
                tx_buf = mtk_desc_to_tx_buf(ring, desc,
                                            eth->soc->txrx.txd_size);
@@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
                        budget--;
                }
-@@ -3651,7 +3679,24 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3650,7 +3678,24 @@ static int mtk_hw_init(struct mtk_eth *e
        mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4);
        mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
@@ -193,7 +193,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                /* PSE should not drop port8 and port9 packets from WDMA Tx */
                mtk_w32(eth, 0x00000300, PSE_DROP_CFG);
  
-@@ -4213,7 +4258,11 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4212,7 +4257,11 @@ static int mtk_add_mac(struct mtk_eth *e
        }
        spin_lock_init(&mac->hw_stats->stats_lock);
        u64_stats_init(&mac->hw_stats->syncp);
index cc08ef133882b503ad5c20d3ab1b33a9654ba83a..58b9cec626a3f5c5a8c862124d20167dfec6d8c8 100644 (file)
@@ -219,7 +219,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        return;
  
  err_phy:
-@@ -682,11 +798,15 @@ static int mtk_mdio_init(struct mtk_eth
+@@ -681,11 +797,15 @@ static int mtk_mdio_init(struct mtk_eth
        }
        divider = min_t(unsigned int, DIV_ROUND_UP(MDC_MAX_FREQ, max_clk), 63);
  
@@ -239,7 +239,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
        dev_dbg(eth->dev, "MDC is running on %d Hz\n", MDC_MAX_FREQ / divider);
  
-@@ -1145,10 +1265,19 @@ static void mtk_tx_set_dma_desc_v2(struc
+@@ -1144,10 +1264,19 @@ static void mtk_tx_set_dma_desc_v2(struc
                data |= TX_DMA_LS0;
        WRITE_ONCE(desc->txd3, data);
  
@@ -263,7 +263,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
        WRITE_ONCE(desc->txd4, data);
  
-@@ -4307,6 +4436,17 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4306,6 +4435,17 @@ static int mtk_add_mac(struct mtk_eth *e
                          mac->phylink_config.supported_interfaces);
        }
  
@@ -281,7 +281,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        phylink = phylink_create(&mac->phylink_config,
                                 of_fwnode_handle(mac->of_node),
                                 phy_mode, &mtk_phylink_ops);
-@@ -4829,6 +4969,24 @@ static const struct mtk_soc_data mt7986_
+@@ -4828,6 +4968,24 @@ static const struct mtk_soc_data mt7986_
        },
  };
  
@@ -306,7 +306,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  static const struct mtk_soc_data rt5350_data = {
        .reg_map = &mt7628_reg_map,
        .caps = MT7628_CAPS,
-@@ -4847,14 +5005,15 @@ static const struct mtk_soc_data rt5350_
+@@ -4846,14 +5004,15 @@ static const struct mtk_soc_data rt5350_
  };
  
  const struct of_device_id of_mtk_match[] = {
index 0a2bc6ae783c65c5d10642bd54ea8984521333ab..95bf60da808f0af6a1393f99a490f5b240179ff9 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1613,7 +1613,7 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1612,7 +1612,7 @@ static void mtk_update_rx_cpu_idx(struct
  
  static bool mtk_page_pool_enabled(struct mtk_eth *eth)
  {
index ebfb1f0c35c45ea16649ec430a40d9e3fe581bb3..5205914c4ff0d7044dc980a44aa4dbd7e3437670 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4977,6 +4977,9 @@ static const struct mtk_soc_data mt7988_
+@@ -4976,6 +4976,9 @@ static const struct mtk_soc_data mt7988_
        .required_clks = MT7988_CLKS_BITMAP,
        .required_pctl = false,
        .version = 3,
index aab3b848a6c7f8e4e3afa63b82cde07ae58524f3..8a48976126a945babcff55583ecbbd27bc5c4772 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4979,6 +4979,7 @@ static const struct mtk_soc_data mt7988_
+@@ -4978,6 +4978,7 @@ static const struct mtk_soc_data mt7988_
        .version = 3,
        .offload_version = 2,
        .hash_offset = 4,
index 2d750abb45ab8573e9948878a4d5457defce398e..963807aa45455c0be80651e40e94b38582502d43 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3541,19 +3541,34 @@ static void mtk_hw_reset(struct mtk_eth
+@@ -3540,19 +3540,34 @@ static void mtk_hw_reset(struct mtk_eth
  {
        u32 val;
  
@@ -56,7 +56,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
                             0x3ffffff);
  }
-@@ -3579,13 +3594,21 @@ static void mtk_hw_warm_reset(struct mtk
+@@ -3578,13 +3593,21 @@ static void mtk_hw_warm_reset(struct mtk
                return;
        }
  
@@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
        regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, rst_mask);
  
-@@ -3937,11 +3960,17 @@ static void mtk_prepare_for_reset(struct
+@@ -3936,11 +3959,17 @@ static void mtk_prepare_for_reset(struct
        u32 val;
        int i;
  
@@ -106,7 +106,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
        /* adjust PPE configurations to prepare for reset */
        for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
-@@ -4002,11 +4031,18 @@ static void mtk_pending_work(struct work
+@@ -4001,11 +4030,18 @@ static void mtk_pending_work(struct work
                }
        }
  
index 52bd017300836bc4236c5474fa33df7f5c289a4a..e224443e43953884ab32a3c0e3d84fcda7bfb46a 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1075,10 +1075,13 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -1074,10 +1074,13 @@ static int mtk_init_fq_dma(struct mtk_et
        dma_addr_t dma_addr;
        int i;
  
@@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        if (unlikely(!eth->scratch_ring))
                return -ENOMEM;
  
-@@ -2376,8 +2379,14 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2375,8 +2378,14 @@ static int mtk_tx_alloc(struct mtk_eth *
        if (!ring->buf)
                goto no_tx_mem;
  
@@ -55,7 +55,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        if (!ring->dma)
                goto no_tx_mem;
  
-@@ -2476,8 +2485,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -2475,8 +2484,7 @@ static void mtk_tx_clean(struct mtk_eth
                kfree(ring->buf);
                ring->buf = NULL;
        }
@@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                dma_free_coherent(eth->dma_dev,
                                  ring->dma_size * soc->txrx.txd_size,
                                  ring->dma, ring->phys);
-@@ -2496,9 +2504,14 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2495,9 +2503,14 @@ static int mtk_rx_alloc(struct mtk_eth *
  {
        const struct mtk_reg_map *reg_map = eth->soc->reg_map;
        struct mtk_rx_ring *ring;
@@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        if (rx_flag == MTK_RX_FLAGS_QDMA) {
                if (ring_no)
                        return -EINVAL;
-@@ -2533,9 +2546,20 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2532,9 +2545,20 @@ static int mtk_rx_alloc(struct mtk_eth *
                ring->page_pool = pp;
        }
  
@@ -105,7 +105,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        if (!ring->dma)
                return -ENOMEM;
  
-@@ -2618,7 +2642,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2617,7 +2641,7 @@ static int mtk_rx_alloc(struct mtk_eth *
        return 0;
  }
  
@@ -114,7 +114,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  {
        int i;
  
-@@ -2641,7 +2665,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -2640,7 +2664,7 @@ static void mtk_rx_clean(struct mtk_eth
                ring->data = NULL;
        }
  
@@ -123,7 +123,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                dma_free_coherent(eth->dma_dev,
                                  ring->dma_size * eth->soc->txrx.rxd_size,
                                  ring->dma, ring->phys);
-@@ -3004,7 +3028,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -3003,7 +3027,7 @@ static void mtk_dma_free(struct mtk_eth
        for (i = 0; i < MTK_MAX_DEVS; i++)
                if (eth->netdev[i])
                        netdev_reset_queue(eth->netdev[i]);
@@ -132,7 +132,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                dma_free_coherent(eth->dma_dev,
                                  MTK_QDMA_RING_SIZE * soc->txrx.txd_size,
                                  eth->scratch_ring, eth->phy_scratch_ring);
-@@ -3012,13 +3036,13 @@ static void mtk_dma_free(struct mtk_eth
+@@ -3011,13 +3035,13 @@ static void mtk_dma_free(struct mtk_eth
                eth->phy_scratch_ring = 0;
        }
        mtk_tx_clean(eth);
@@ -149,7 +149,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        }
  
        kfree(eth->scratch_head);
-@@ -4588,7 +4612,7 @@ static int mtk_sgmii_init(struct mtk_eth
+@@ -4587,7 +4611,7 @@ static int mtk_sgmii_init(struct mtk_eth
  
  static int mtk_probe(struct platform_device *pdev)
  {
@@ -158,7 +158,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        struct device_node *mac_np;
        struct mtk_eth *eth;
        int err, i;
-@@ -4608,6 +4632,20 @@ static int mtk_probe(struct platform_dev
+@@ -4607,6 +4631,20 @@ static int mtk_probe(struct platform_dev
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
                eth->ip_align = NET_IP_ALIGN;
  
@@ -179,7 +179,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        spin_lock_init(&eth->page_lock);
        spin_lock_init(&eth->tx_irq_lock);
        spin_lock_init(&eth->rx_irq_lock);
-@@ -4671,6 +4709,18 @@ static int mtk_probe(struct platform_dev
+@@ -4670,6 +4708,18 @@ static int mtk_probe(struct platform_dev
                        err = -EINVAL;
                        goto err_destroy_sgmii;
                }
index 26c5889545459b9427d202649f7c76408453bab8..528f9a3e5c6ebc2861fe3f5495354b2f9ce47d87 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1266,6 +1266,10 @@ static void mtk_tx_set_dma_desc_v2(struc
+@@ -1265,6 +1265,10 @@ static void mtk_tx_set_dma_desc_v2(struc
        data = TX_DMA_PLEN0(info->size);
        if (info->last)
                data |= TX_DMA_LS0;
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        WRITE_ONCE(desc->txd3, data);
  
         /* set forward port */
-@@ -1933,6 +1937,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1932,6 +1936,7 @@ static int mtk_poll_rx(struct napi_struc
        bool xdp_flush = false;
        int idx;
        struct sk_buff *skb;
@@ -38,7 +38,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        u8 *data, *new_data;
        struct mtk_rx_dma_v2 *rxd, trxd;
        int done = 0, bytes = 0;
-@@ -2048,7 +2053,10 @@ static int mtk_poll_rx(struct napi_struc
+@@ -2047,7 +2052,10 @@ static int mtk_poll_rx(struct napi_struc
                                goto release_desc;
                        }
  
@@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                                         ring->buf_size, DMA_FROM_DEVICE);
  
                        skb = build_skb(data, ring->frag_size);
-@@ -2114,6 +2122,9 @@ release_desc:
+@@ -2113,6 +2121,9 @@ release_desc:
                else
                        rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
  
@@ -60,7 +60,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                ring->calc_idx = idx;
                done++;
        }
-@@ -2598,6 +2609,9 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2597,6 +2608,9 @@ static int mtk_rx_alloc(struct mtk_eth *
                else
                        rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
  
@@ -70,7 +70,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                rxd->rxd3 = 0;
                rxd->rxd4 = 0;
                if (mtk_is_netsys_v2_or_greater(eth)) {
-@@ -2644,6 +2658,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2643,6 +2657,7 @@ static int mtk_rx_alloc(struct mtk_eth *
  
  static void mtk_rx_clean(struct mtk_eth *eth, struct mtk_rx_ring *ring, bool in_sram)
  {
@@ -78,7 +78,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        int i;
  
        if (ring->data && ring->dma) {
-@@ -2657,7 +2672,10 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -2656,7 +2671,10 @@ static void mtk_rx_clean(struct mtk_eth
                        if (!rxd->rxd1)
                                continue;
  
@@ -90,7 +90,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
                                         ring->buf_size, DMA_FROM_DEVICE);
                        mtk_rx_put_buff(ring, ring->data[i], false);
                }
-@@ -4646,6 +4664,14 @@ static int mtk_probe(struct platform_dev
+@@ -4645,6 +4663,14 @@ static int mtk_probe(struct platform_dev
                }
        }
  
index 8d55ffb8b688fb6dda3f22ebfb461b6c60da7637..acb67ab1614be50115902aef25ac4b7dff730d1c 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2746,9 +2746,6 @@ mt7531_mac_config(struct dsa_switch *ds,
+@@ -2952,9 +2952,6 @@ mt7531_mac_config(struct dsa_switch *ds,
        case PHY_INTERFACE_MODE_NA:
        case PHY_INTERFACE_MODE_1000BASEX:
        case PHY_INTERFACE_MODE_2500BASEX:
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                return mt7531_sgmii_setup_mode_force(priv, port, interface);
        default:
                return -EINVAL;
-@@ -2824,13 +2821,6 @@ unsupported:
+@@ -3030,13 +3027,6 @@ unsupported:
                return;
        }
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
        mcr_new = mcr_cur;
        mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
-@@ -2967,6 +2957,9 @@ static void mt753x_phylink_get_caps(stru
+@@ -3173,6 +3163,9 @@ static void mt753x_phylink_get_caps(stru
        config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
                                   MAC_10 | MAC_100 | MAC_1000FD;
  
@@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        /* This driver does not make use of the speed, duplex, pause or the
         * advertisement in its mac_config, so it is safe to mark this driver
         * as non-legacy.
-@@ -3032,6 +3025,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
+@@ -3238,6 +3231,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
  
        status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port));
        state->link = !!(status & MT7531_SGMII_LINK_STATUS);
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (state->interface == PHY_INTERFACE_MODE_SGMII &&
            (status & MT7531_SGMII_AN_ENABLE)) {
                val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port));
-@@ -3062,16 +3056,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
+@@ -3268,16 +3262,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
        return 0;
  }
  
@@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
-@@ -3112,6 +3134,8 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3318,6 +3340,8 @@ mt753x_setup(struct dsa_switch *ds)
                priv->pcs[i].pcs.ops = priv->info->pcs_ops;
                priv->pcs[i].priv = priv;
                priv->pcs[i].port = i;
@@ -120,7 +120,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        ret = priv->info->sw_setup(ds);
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -373,6 +373,7 @@ enum mt7530_vlan_port_acc_frm {
+@@ -405,6 +405,7 @@ enum mt7530_vlan_port_acc_frm {
  #define  MT7531_SGMII_LINK_STATUS     BIT(18)
  #define  MT7531_SGMII_AN_ENABLE               BIT(12)
  #define  MT7531_SGMII_AN_RESTART      BIT(9)
index 2642cd4fafcd15793c2e78d061ca7068c6316197..d8386fc3cbc9bda7aba48f7a59652e86b763fcf3 100644 (file)
@@ -81,7 +81,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
  #include <linux/phylink.h>
  #include <linux/regmap.h>
  #include <linux/regulator/consumer.h>
-@@ -2598,128 +2599,11 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2804,128 +2805,11 @@ static int mt7531_rgmii_setup(struct mt7
        return 0;
  }
  
@@ -210,7 +210,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
  static int
  mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
                  phy_interface_t interface)
-@@ -2742,11 +2626,11 @@ mt7531_mac_config(struct dsa_switch *ds,
+@@ -2948,11 +2832,11 @@ mt7531_mac_config(struct dsa_switch *ds,
                phydev = dp->slave->phydev;
                return mt7531_rgmii_setup(priv, port, interface, phydev);
        case PHY_INTERFACE_MODE_SGMII:
@@ -224,7 +224,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
        default:
                return -EINVAL;
        }
-@@ -2771,11 +2655,11 @@ mt753x_phylink_mac_select_pcs(struct dsa
+@@ -2977,11 +2861,11 @@ mt753x_phylink_mac_select_pcs(struct dsa
  
        switch (interface) {
        case PHY_INTERFACE_MODE_TRGMII:
@@ -238,7 +238,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
        default:
                return NULL;
        }
-@@ -3016,86 +2900,6 @@ static void mt7530_pcs_get_state(struct
+@@ -3222,86 +3106,6 @@ static void mt7530_pcs_get_state(struct
                state->pause |= MLO_PAUSE_TX;
  }
  
@@ -325,7 +325,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
  static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
                             phy_interface_t interface,
                             const unsigned long *advertising,
-@@ -3115,18 +2919,57 @@ static const struct phylink_pcs_ops mt75
+@@ -3321,18 +3125,57 @@ static const struct phylink_pcs_ops mt75
        .pcs_an_restart = mt7530_pcs_an_restart,
  };
  
@@ -389,7 +389,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
        int i, ret;
  
        /* Initialise the PCS devices */
-@@ -3134,8 +2977,6 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3340,8 +3183,6 @@ mt753x_setup(struct dsa_switch *ds)
                priv->pcs[i].pcs.ops = priv->info->pcs_ops;
                priv->pcs[i].priv = priv;
                priv->pcs[i].port = i;
@@ -398,7 +398,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
        }
  
        ret = priv->info->sw_setup(ds);
-@@ -3150,6 +2991,16 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3356,6 +3197,16 @@ mt753x_setup(struct dsa_switch *ds)
        if (ret && priv->irq)
                mt7530_free_irq_common(priv);
  
@@ -415,7 +415,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
        return ret;
  }
  
-@@ -3241,7 +3092,7 @@ static const struct mt753x_info mt753x_t
+@@ -3447,7 +3298,7 @@ static const struct mt753x_info mt753x_t
        },
        [ID_MT7531] = {
                .id = ID_MT7531,
@@ -424,7 +424,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
                .sw_setup = mt7531_setup,
                .phy_read = mt7531_ind_phy_read,
                .phy_write = mt7531_ind_phy_write,
-@@ -3349,7 +3200,7 @@ static void
+@@ -3555,7 +3406,7 @@ static void
  mt7530_remove(struct mdio_device *mdiodev)
  {
        struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
@@ -433,7 +433,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
  
        if (!priv)
                return;
-@@ -3368,6 +3219,10 @@ mt7530_remove(struct mdio_device *mdiode
+@@ -3574,6 +3425,10 @@ mt7530_remove(struct mdio_device *mdiode
                mt7530_free_irq(priv);
  
        dsa_unregister_switch(priv->ds);
@@ -446,7 +446,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
        dev_set_drvdata(&mdiodev->dev, NULL);
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -364,47 +364,8 @@ enum mt7530_vlan_port_acc_frm {
+@@ -396,47 +396,8 @@ enum mt7530_vlan_port_acc_frm {
                                         CCR_TX_OCT_CNT_BAD)
  
  /* MT7531 SGMII register group */
@@ -496,7 +496,7 @@ Tested-by: Frank Wunderlich <frank-w@public-files.de>
  
  /* Register for system reset */
  #define MT7530_SYS_CTRL                       0x7000
-@@ -703,13 +664,13 @@ struct mt7530_fdb {
+@@ -735,13 +696,13 @@ struct mt7530_fdb {
   * @pm:               The matrix used to show all connections with the port.
   * @pvid:     The VLAN specified is to be considered a PVID at ingress.  Any
   *            untagged frames will be assigned to the related VLAN.
index ffbdde5a5772ea89fd9145aa3e839872266755ae..cfd0034ee637d95add81e4b6fb8c856d25fc23a0 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -224,9 +224,10 @@ mt7530_mii_read(struct mt7530_priv *priv
+@@ -225,9 +225,10 @@ mt7530_mii_read(struct mt7530_priv *priv
        /* MT7530 uses 31 as the pseudo port */
        ret = bus->write(bus, 0x1f, 0x1f, page);
        if (ret < 0) {
index 983423aaff6a11dc78febc5d5978e7651f7b4a02..8311aaa0bf7f859690333c10bc5ce436bea877ad 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2951,26 +2951,56 @@ static const struct regmap_bus mt7531_re
+@@ -3157,26 +3157,56 @@ static const struct regmap_bus mt7531_re
        .reg_update_bits = mt7530_regmap_update_bits,
  };
  
@@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int i, ret;
  
        /* Initialise the PCS devices */
-@@ -2992,15 +3022,11 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3198,15 +3228,11 @@ mt753x_setup(struct dsa_switch *ds)
        if (ret && priv->irq)
                mt7530_free_irq_common(priv);
  
index 9d8f67ba957f39a4e55a95625fb91b683649bdca..7271f1023b21affd5851235211947a5fe5756a50 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2924,7 +2924,7 @@ static int mt7530_regmap_read(void *cont
+@@ -3130,7 +3130,7 @@ static int mt7530_regmap_read(void *cont
  {
        struct mt7530_priv *priv = context;
  
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        return 0;
  };
  
-@@ -2932,23 +2932,25 @@ static int mt7530_regmap_write(void *con
+@@ -3138,23 +3138,25 @@ static int mt7530_regmap_write(void *con
  {
        struct mt7530_priv *priv = context;
  
@@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  };
  
  static int
-@@ -2974,6 +2976,9 @@ mt7531_create_sgmii(struct mt7530_priv *
+@@ -3180,6 +3182,9 @@ mt7531_create_sgmii(struct mt7530_priv *
                mt7531_pcs_config[i]->reg_stride = 4;
                mt7531_pcs_config[i]->reg_base = MT7531_SGMII_REG_BASE(5 + i);
                mt7531_pcs_config[i]->max_register = 0x17c;
index bd1d5c98a7ce3c8a231d580dd62674533408426a..2f761c2fad4a24cf0f3a869c898a8fdfe445f70f 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -183,9 +183,9 @@ core_clear(struct mt7530_priv *priv, u32
+@@ -184,9 +184,9 @@ core_clear(struct mt7530_priv *priv, u32
  }
  
  static int
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        u16 page, r, lo, hi;
        int ret;
  
-@@ -197,24 +197,34 @@ mt7530_mii_write(struct mt7530_priv *pri
+@@ -198,24 +198,34 @@ mt7530_mii_write(struct mt7530_priv *pri
        /* MT7530 uses 31 as the pseudo port */
        ret = bus->write(bus, 0x1f, 0x1f, page);
        if (ret < 0)
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        u16 page, r, lo, hi;
        int ret;
  
-@@ -223,17 +233,32 @@ mt7530_mii_read(struct mt7530_priv *priv
+@@ -224,17 +234,32 @@ mt7530_mii_read(struct mt7530_priv *priv
  
        /* MT7530 uses 31 as the pseudo port */
        ret = bus->write(bus, 0x1f, 0x1f, page);
@@ -108,7 +108,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void
-@@ -283,14 +308,10 @@ mt7530_rmw(struct mt7530_priv *priv, u32
+@@ -284,14 +309,10 @@ mt7530_rmw(struct mt7530_priv *priv, u32
           u32 mask, u32 set)
  {
        struct mii_bus *bus = priv->bus;
@@ -124,7 +124,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        mutex_unlock(&bus->mdio_lock);
  }
-@@ -298,7 +319,7 @@ mt7530_rmw(struct mt7530_priv *priv, u32
+@@ -299,7 +320,7 @@ mt7530_rmw(struct mt7530_priv *priv, u32
  static void
  mt7530_set(struct mt7530_priv *priv, u32 reg, u32 val)
  {
@@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void
-@@ -2920,22 +2941,6 @@ static const struct phylink_pcs_ops mt75
+@@ -3126,22 +3147,6 @@ static const struct phylink_pcs_ops mt75
        .pcs_an_restart = mt7530_pcs_an_restart,
  };
  
@@ -156,7 +156,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static void
  mt7530_mdio_regmap_lock(void *mdio_lock)
  {
-@@ -2948,7 +2953,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc
+@@ -3154,7 +3159,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc
        mutex_unlock(mdio_lock);
  }
  
@@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .reg_write = mt7530_regmap_write,
        .reg_read = mt7530_regmap_read,
  };
-@@ -2981,7 +2986,7 @@ mt7531_create_sgmii(struct mt7530_priv *
+@@ -3187,7 +3192,7 @@ mt7531_create_sgmii(struct mt7530_priv *
                mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
  
                regmap = devm_regmap_init(priv->dev,
@@ -174,7 +174,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                                          mt7531_pcs_config[i]);
                if (IS_ERR(regmap)) {
                        ret = PTR_ERR(regmap);
-@@ -3146,6 +3151,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match)
+@@ -3352,6 +3357,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match)
  static int
  mt7530_probe(struct mdio_device *mdiodev)
  {
@@ -182,7 +182,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct mt7530_priv *priv;
        struct device_node *dn;
  
-@@ -3225,6 +3231,21 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3431,6 +3437,21 @@ mt7530_probe(struct mdio_device *mdiodev
        mutex_init(&priv->reg_mutex);
        dev_set_drvdata(&mdiodev->dev, priv);
  
@@ -206,7 +206,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -747,6 +747,7 @@ struct mt753x_info {
+@@ -779,6 +779,7 @@ struct mt753x_info {
   * @dev:              The device pointer
   * @ds:                       The pointer to the dsa core structure
   * @bus:              The bus used for the device and built-in PHY
@@ -214,7 +214,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
   * @rstc:             The pointer to reset control used by MCM
   * @core_pwr:         The power supplied into the core
   * @io_pwr:           The power supplied into the I/O
-@@ -767,6 +768,7 @@ struct mt7530_priv {
+@@ -799,6 +800,7 @@ struct mt7530_priv {
        struct device           *dev;
        struct dsa_switch       *ds;
        struct mii_bus          *bus;
index 8c11bc3733ec578b942009d1aa83d9352753025a..16feba1daff2beeaa6b6cffc142c2dec88e11a2b 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -3032,12 +3032,6 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3238,12 +3238,6 @@ mt753x_setup(struct dsa_switch *ds)
        if (ret && priv->irq)
                mt7530_free_irq_common(priv);
  
@@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        return ret;
  }
  
-@@ -3154,6 +3148,7 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3360,6 +3354,7 @@ mt7530_probe(struct mdio_device *mdiodev
        static struct regmap_config *regmap_config;
        struct mt7530_priv *priv;
        struct device_node *dn;
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        dn = mdiodev->dev.of_node;
  
-@@ -3246,6 +3241,12 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3452,6 +3447,12 @@ mt7530_probe(struct mdio_device *mdiodev
        if (IS_ERR(priv->regmap))
                return PTR_ERR(priv->regmap);
  
index 4d75c55647c150fd90ea985283096910b436f23e..dc4b40b824bd54f5dabfea259f0ce2c235264ab0 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -143,31 +143,40 @@ err:
+@@ -144,31 +144,40 @@ err:
  }
  
  static void
@@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void
-@@ -264,13 +273,11 @@ mt7530_mii_read(struct mt7530_priv *priv
+@@ -265,13 +274,11 @@ mt7530_mii_read(struct mt7530_priv *priv
  static void
  mt7530_write(struct mt7530_priv *priv, u32 reg, u32 val)
  {
@@ -81,7 +81,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static u32
-@@ -282,14 +289,13 @@ _mt7530_unlocked_read(struct mt7530_dumm
+@@ -283,14 +290,13 @@ _mt7530_unlocked_read(struct mt7530_dumm
  static u32
  _mt7530_read(struct mt7530_dummy_poll *p)
  {
@@ -98,7 +98,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return val;
  }
-@@ -307,13 +313,11 @@ static void
+@@ -308,13 +314,11 @@ static void
  mt7530_rmw(struct mt7530_priv *priv, u32 reg,
           u32 mask, u32 set)
  {
@@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void
-@@ -645,14 +649,13 @@ static int
+@@ -646,14 +650,13 @@ static int
  mt7531_ind_c45_phy_read(struct mt7530_priv *priv, int port, int devad,
                        int regnum)
  {
@@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
                                 !(val & MT7531_PHY_ACS_ST), 20, 100000);
-@@ -685,7 +688,7 @@ mt7531_ind_c45_phy_read(struct mt7530_pr
+@@ -686,7 +689,7 @@ mt7531_ind_c45_phy_read(struct mt7530_pr
  
        ret = val & MT7531_MDIO_RW_DATA_MASK;
  out:
@@ -139,7 +139,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return ret;
  }
-@@ -694,14 +697,13 @@ static int
+@@ -695,14 +698,13 @@ static int
  mt7531_ind_c45_phy_write(struct mt7530_priv *priv, int port, int devad,
                         int regnum, u32 data)
  {
@@ -155,7 +155,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
                                 !(val & MT7531_PHY_ACS_ST), 20, 100000);
-@@ -733,7 +735,7 @@ mt7531_ind_c45_phy_write(struct mt7530_p
+@@ -734,7 +736,7 @@ mt7531_ind_c45_phy_write(struct mt7530_p
        }
  
  out:
@@ -164,7 +164,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return ret;
  }
-@@ -741,14 +743,13 @@ out:
+@@ -742,14 +744,13 @@ out:
  static int
  mt7531_ind_c22_phy_read(struct mt7530_priv *priv, int port, int regnum)
  {
@@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        ret = readx_poll_timeout(_mt7530_unlocked_read, &p, val,
                                 !(val & MT7531_PHY_ACS_ST), 20, 100000);
-@@ -771,7 +772,7 @@ mt7531_ind_c22_phy_read(struct mt7530_pr
+@@ -772,7 +773,7 @@ mt7531_ind_c22_phy_read(struct mt7530_pr
  
        ret = val & MT7531_MDIO_RW_DATA_MASK;
  out:
@@ -189,7 +189,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return ret;
  }
-@@ -780,14 +781,13 @@ static int
+@@ -781,14 +782,13 @@ static int
  mt7531_ind_c22_phy_write(struct mt7530_priv *priv, int port, int regnum,
                         u16 data)
  {
@@ -205,7 +205,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        ret = readx_poll_timeout(_mt7530_unlocked_read, &p, reg,
                                 !(reg & MT7531_PHY_ACS_ST), 20, 100000);
-@@ -809,7 +809,7 @@ mt7531_ind_c22_phy_write(struct mt7530_p
+@@ -810,7 +810,7 @@ mt7531_ind_c22_phy_write(struct mt7530_p
        }
  
  out:
@@ -214,7 +214,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return ret;
  }
-@@ -1117,7 +1117,6 @@ static int
+@@ -1323,7 +1323,6 @@ static int
  mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
  {
        struct mt7530_priv *priv = ds->priv;
@@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        int length;
        u32 val;
  
-@@ -1128,7 +1127,7 @@ mt7530_port_change_mtu(struct dsa_switch
+@@ -1334,7 +1333,7 @@ mt7530_port_change_mtu(struct dsa_switch
        if (!dsa_is_cpu_port(ds, port))
                return 0;
  
@@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        val = mt7530_mii_read(priv, MT7530_GMACCR);
        val &= ~MAX_RX_PKT_LEN_MASK;
-@@ -1149,7 +1148,7 @@ mt7530_port_change_mtu(struct dsa_switch
+@@ -1355,7 +1354,7 @@ mt7530_port_change_mtu(struct dsa_switch
  
        mt7530_mii_write(priv, MT7530_GMACCR, val);
  
@@ -240,7 +240,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        return 0;
  }
-@@ -1945,10 +1944,10 @@ mt7530_irq_thread_fn(int irq, void *dev_
+@@ -2151,10 +2150,10 @@ mt7530_irq_thread_fn(int irq, void *dev_
        u32 val;
        int p;
  
@@ -253,7 +253,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  
        for (p = 0; p < MT7530_NUM_PHYS; p++) {
                if (BIT(p) & val) {
-@@ -1984,7 +1983,7 @@ mt7530_irq_bus_lock(struct irq_data *d)
+@@ -2190,7 +2189,7 @@ mt7530_irq_bus_lock(struct irq_data *d)
  {
        struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
  
@@ -262,7 +262,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  }
  
  static void
-@@ -1993,7 +1992,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da
+@@ -2199,7 +2198,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da
        struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
  
        mt7530_mii_write(priv, MT7530_SYS_INT_EN, priv->irq_enable);
index bd7ca33f6eddb2c497ae7e5b717ec21c02604f17..265cf1fdac4b1cbc43942b34c6027a1e7015bd92 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -950,6 +950,24 @@ mt7530_set_ageing_time(struct dsa_switch
+@@ -951,6 +951,24 @@ mt7530_set_ageing_time(struct dsa_switch
        return 0;
  }
  
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        struct mt7530_priv *priv = ds->priv;
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -682,24 +682,6 @@ enum p5_interface_select {
+@@ -714,24 +714,6 @@ enum p5_interface_select {
        P5_INTF_SEL_GMAC5_SGMII,
  };
  
index 00dd91bbc957fb82f6c46812817ab6637665bb16..10e2c6a184f54cea51d65bfbd9e9f0f90cf84884 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -3160,44 +3160,21 @@ static const struct of_device_id mt7530_
+@@ -3366,44 +3366,21 @@ static const struct of_device_id mt7530_
  MODULE_DEVICE_TABLE(of, mt7530_of_match);
  
  static int
@@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (!priv->info)
                return -EINVAL;
  
-@@ -3211,23 +3188,53 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3417,23 +3394,53 @@ mt7530_probe(struct mdio_device *mdiodev
                return -EINVAL;
  
        priv->id = priv->info->id;
@@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset",
                                                      GPIOD_OUT_LOW);
                if (IS_ERR(priv->reset)) {
-@@ -3236,12 +3243,15 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3442,12 +3449,15 @@ mt7530_probe(struct mdio_device *mdiodev
                }
        }
  
index be73b67c948ce574597385bc89d5f57e0d43be0c..4e754b100287e7a80be94147a27f85d9d7a41781 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -3278,6 +3278,17 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3484,6 +3484,17 @@ mt7530_probe(struct mdio_device *mdiodev
  }
  
  static void
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  mt7530_remove(struct mdio_device *mdiodev)
  {
        struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
-@@ -3296,16 +3307,11 @@ mt7530_remove(struct mdio_device *mdiode
+@@ -3502,16 +3513,11 @@ mt7530_remove(struct mdio_device *mdiode
                dev_err(priv->dev, "Failed to disable io pwr: %d\n",
                        ret);
  
index 2cebac1f8c6471b2a5a1ca406864689e08880736..e970ec3804b97a4f14b50f6e1afd387a4eca2bee 100644 (file)
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -11895,6 +11895,7 @@ M:     Landen Chao <Landen.Chao@mediatek.com
+@@ -11902,6 +11902,7 @@ M:     Landen Chao <Landen.Chao@mediatek.com
  M:    DENG Qingfang <dqfext@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
@@ -354,7 +354,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  #include <linux/phylink.h>
  #include <linux/regmap.h>
  #include <linux/regulator/consumer.h>
-@@ -192,31 +191,6 @@ core_clear(struct mt7530_priv *priv, u32
+@@ -193,31 +192,6 @@ core_clear(struct mt7530_priv *priv, u32
  }
  
  static int
@@ -386,7 +386,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  mt7530_mii_write(struct mt7530_priv *priv, u32 reg, u32 val)
  {
        int ret;
-@@ -230,29 +204,6 @@ mt7530_mii_write(struct mt7530_priv *pri
+@@ -231,29 +205,6 @@ mt7530_mii_write(struct mt7530_priv *pri
        return ret;
  }
  
@@ -416,7 +416,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static u32
  mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
  {
-@@ -2958,72 +2909,6 @@ static const struct phylink_pcs_ops mt75
+@@ -3164,72 +3115,6 @@ static const struct phylink_pcs_ops mt75
        .pcs_an_restart = mt7530_pcs_an_restart,
  };
  
@@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static int
  mt753x_setup(struct dsa_switch *ds)
  {
-@@ -3082,7 +2967,7 @@ static int mt753x_set_mac_eee(struct dsa
+@@ -3288,7 +3173,7 @@ static int mt753x_set_mac_eee(struct dsa
        return 0;
  }
  
@@ -498,7 +498,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        .get_tag_protocol       = mtk_get_tag_protocol,
        .setup                  = mt753x_setup,
        .get_strings            = mt7530_get_strings,
-@@ -3116,8 +3001,9 @@ static const struct dsa_switch_ops mt753
+@@ -3322,8 +3207,9 @@ static const struct dsa_switch_ops mt753
        .get_mac_eee            = mt753x_get_mac_eee,
        .set_mac_eee            = mt753x_set_mac_eee,
  };
@@ -509,7 +509,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        [ID_MT7621] = {
                .id = ID_MT7621,
                .pcs_ops = &mt7530_pcs_ops,
-@@ -3150,16 +3036,9 @@ static const struct mt753x_info mt753x_t
+@@ -3356,16 +3242,9 @@ static const struct mt753x_info mt753x_t
                .mac_port_config = mt7531_mac_config,
        },
  };
@@ -528,7 +528,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  mt7530_probe_common(struct mt7530_priv *priv)
  {
        struct device *dev = priv->dev;
-@@ -3196,88 +3075,9 @@ mt7530_probe_common(struct mt7530_priv *
+@@ -3402,88 +3281,9 @@ mt7530_probe_common(struct mt7530_priv *
  
        return 0;
  }
@@ -619,7 +619,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  mt7530_remove_common(struct mt7530_priv *priv)
  {
        if (priv->irq)
-@@ -3288,57 +3088,6 @@ mt7530_remove_common(struct mt7530_priv
+@@ -3494,57 +3294,6 @@ mt7530_remove_common(struct mt7530_priv
        mutex_destroy(&priv->reg_mutex);
  }
  
@@ -679,7 +679,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  MODULE_LICENSE("GPL");
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -807,4 +807,10 @@ static inline void INIT_MT7530_DUMMY_POL
+@@ -839,4 +839,10 @@ static inline void INIT_MT7530_DUMMY_POL
        p->reg = reg;
  }
  
index 95b7cc6afe5112403eda7aa9ecd66744c2b2b186..59e193f9f612246040d7087e6f47557ccb39d1df 100644 (file)
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -144,13 +144,15 @@ err:
+@@ -145,13 +145,15 @@ err:
  static void
  mt7530_mutex_lock(struct mt7530_priv *priv)
  {
index 889a13e0149bb416bcb045b44e738c66f82ee576..3d94295eee3fb75d7769e361d6dc0f0980dbc320 100644 (file)
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -11893,9 +11893,11 @@ MEDIATEK SWITCH DRIVER
+@@ -11900,9 +11900,11 @@ MEDIATEK SWITCH DRIVER
  M:    Sean Wang <sean.wang@mediatek.com>
  M:    Landen Chao <Landen.Chao@mediatek.com>
  M:    DENG Qingfang <dqfext@gmail.com>
@@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 +MODULE_LICENSE("GPL");
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1992,6 +1992,47 @@ static const struct irq_domain_ops mt753
+@@ -2198,6 +2198,47 @@ static const struct irq_domain_ops mt753
  };
  
  static void
@@ -232,7 +232,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  mt7530_setup_mdio_irq(struct mt7530_priv *priv)
  {
        struct dsa_switch *ds = priv->ds;
-@@ -2025,8 +2066,15 @@ mt7530_setup_irq(struct mt7530_priv *pri
+@@ -2231,8 +2272,15 @@ mt7530_setup_irq(struct mt7530_priv *pri
                return priv->irq ? : -EINVAL;
        }
  
@@ -250,7 +250,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
        if (!priv->irq_domain) {
                dev_err(dev, "failed to create IRQ domain\n");
                return -ENOMEM;
-@@ -2521,6 +2569,25 @@ static void mt7531_mac_port_get_caps(str
+@@ -2727,6 +2775,25 @@ static void mt7531_mac_port_get_caps(str
        }
  }
  
@@ -276,7 +276,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static int
  mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
  {
-@@ -2597,6 +2664,17 @@ static bool mt753x_is_mac_port(u32 port)
+@@ -2803,6 +2870,17 @@ static bool mt753x_is_mac_port(u32 port)
  }
  
  static int
@@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
                  phy_interface_t interface)
  {
-@@ -2666,7 +2744,8 @@ mt753x_phylink_mac_config(struct dsa_swi
+@@ -2872,7 +2950,8 @@ mt753x_phylink_mac_config(struct dsa_swi
  
        switch (port) {
        case 0 ... 4: /* Internal phy */
@@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                        goto unsupported;
                break;
        case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */
-@@ -2744,7 +2823,8 @@ static void mt753x_phylink_mac_link_up(s
+@@ -2950,7 +3029,8 @@ static void mt753x_phylink_mac_link_up(s
        /* MT753x MAC works in 1G full duplex mode for all up-clocked
         * variants.
         */
@@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
            (phy_interface_mode_is_8023z(interface))) {
                speed = SPEED_1000;
                duplex = DUPLEX_FULL;
-@@ -2824,6 +2904,21 @@ mt7531_cpu_port_config(struct dsa_switch
+@@ -3030,6 +3110,21 @@ mt7531_cpu_port_config(struct dsa_switch
        return 0;
  }
  
@@ -336,7 +336,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
                                    struct phylink_config *config)
  {
-@@ -2969,6 +3064,27 @@ static int mt753x_set_mac_eee(struct dsa
+@@ -3175,6 +3270,27 @@ static int mt753x_set_mac_eee(struct dsa
        return 0;
  }
  
@@ -364,7 +364,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
  const struct dsa_switch_ops mt7530_switch_ops = {
        .get_tag_protocol       = mtk_get_tag_protocol,
        .setup                  = mt753x_setup,
-@@ -3037,6 +3153,17 @@ const struct mt753x_info mt753x_table[]
+@@ -3243,6 +3359,17 @@ const struct mt753x_info mt753x_table[]
                .mac_port_get_caps = mt7531_mac_port_get_caps,
                .mac_port_config = mt7531_mac_config,
        },
@@ -407,7 +407,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
                                         MT7531_MIRROR_MASK : MIRROR_MASK)
  
  /* Registers for BPDU and PAE frame control*/
-@@ -295,9 +296,8 @@ enum mt7530_vlan_port_acc_frm {
+@@ -327,9 +328,8 @@ enum mt7530_vlan_port_acc_frm {
                                         MT7531_FORCE_DPX | \
                                         MT7531_FORCE_RX_FC | \
                                         MT7531_FORCE_TX_FC)
index 40e18167267d2dbb063e09b07c8d4b085999d72b..49ac8d9780a05a8deb0e2a4bd10ffefcd708e804 100644 (file)
@@ -73,7 +73,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  }
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -3031,6 +3031,12 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3237,6 +3237,12 @@ mt753x_setup(struct dsa_switch *ds)
        if (ret && priv->irq)
                mt7530_free_irq_common(priv);
  
@@ -88,7 +88,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  
 --- a/drivers/net/dsa/mt7530.h
 +++ b/drivers/net/dsa/mt7530.h
-@@ -741,10 +741,10 @@ struct mt753x_info {
+@@ -773,10 +773,10 @@ struct mt753x_info {
   *                    registers
   * @p6_interface      Holding the current port 6 interface
   * @p5_intf_sel:      Holding the current port 5 interface select
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
   */
  struct mt7530_priv {
        struct device           *dev;
-@@ -763,7 +763,6 @@ struct mt7530_priv {
+@@ -795,7 +795,6 @@ struct mt7530_priv {
        unsigned int            p5_intf_sel;
        u8                      mirror_rx;
        u8                      mirror_tx;
@@ -108,7 +108,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
        struct mt7530_port      ports[MT7530_NUM_PORTS];
        struct mt753x_pcs       pcs[MT7530_NUM_PORTS];
        /* protect among processes for registers access*/
-@@ -771,6 +770,7 @@ struct mt7530_priv {
+@@ -803,6 +802,7 @@ struct mt7530_priv {
        int irq;
        struct irq_domain *irq_domain;
        u32 irq_enable;
index 7eb097f86d02126c887cd07c2f6794f1cf5f92b5..57e71bff6b1b94bc0f28102998e22bd9fc5ec109 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -12694,6 +12694,7 @@ F:     include/uapi/linux/meye.h
+@@ -12701,6 +12701,7 @@ F:     include/uapi/linux/meye.h
  
  MOTORCOMM PHY DRIVER
  M:    Peter Geis <pgwipeout@gmail.com>
index 79fd479054ed932cd03185def3537688b8d183a5..ac77fc9b1d2edb8a9fac8fb722d7417144cd66ba 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -17959,6 +17959,11 @@ L:    netdev@vger.kernel.org
+@@ -17966,6 +17966,11 @@ L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/dlink/sundance.c
  
index 24beeda0d2254e3889ede9efd8396b707340c0c7..f54ba7ebee20e8718a642c3aeb5cd07e2dfcd025 100644 (file)
@@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -12358,6 +12358,14 @@ S:    Supported
+@@ -12365,6 +12365,14 @@ S:    Supported
  F:    Documentation/devicetree/bindings/mtd/atmel-nand.txt
  F:    drivers/mtd/nand/raw/atmel/*
  
index d207ea4872811cc502bfffc9e612075f6f15fce9..9ce78e1f09d336ea3a18ff354556d3a02d51f938 100644 (file)
@@ -132,7 +132,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        imx_ocotp_nvmem_config.priv = priv;
 --- a/drivers/nvmem/meson-efuse.c
 +++ b/drivers/nvmem/meson-efuse.c
-@@ -93,6 +93,7 @@ static int meson_efuse_probe(struct plat
+@@ -74,6 +74,7 @@ static int meson_efuse_probe(struct plat
  
        econfig->dev = dev;
        econfig->name = dev_name(dev);
index 87f541b46f2c0c536f4d4644323eca304e4c8142..8db0f7dac78c341ebfdb5b9c143a2bf7100d520b 100644 (file)
@@ -27,8 +27,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +#define SYMTAB_DISCARD_GPL
 +#endif
 +
- /* Align . to a 8 byte boundary equals to maximum function alignment. */
- #define ALIGN_FUNCTION()  . = ALIGN(8)
+ /* Align . function alignment. */
+ #define ALIGN_FUNCTION()  . = ALIGN(CONFIG_FUNCTION_ALIGNMENT)
  
 @@ -485,14 +495,14 @@
        /* Kernel symbol table: Normal symbols */                       \
index e0820ccfc0dbf3107e2fcf8baa7e88f945147a8e..ea06821c4bd6feb73a37a279f037f9bce3e52330 100644 (file)
@@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #include <linux/mutex.h>
  #include <linux/err.h>
  #include <linux/property.h>
-@@ -3360,3 +3361,5 @@ static int __init regmap_initcall(void)
+@@ -3364,3 +3365,5 @@ static int __init regmap_initcall(void)
        return 0;
  }
  postcore_initcall(regmap_initcall);
index c11f8e864b9ca2d407ed69fd7cc2e8ee32654e87..da9b795e18f524c452c584cdce3157be242af30e 100644 (file)
@@ -43,7 +43,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
  
  #define QUECTEL_VENDOR_ID                     0x2c7c
  /* These Quectel products use Quectel's vendor ID */
-@@ -1147,6 +1152,11 @@ static const struct usb_device_id option
+@@ -1152,6 +1157,11 @@ static const struct usb_device_id option
        { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x0023)}, /* ONYX 3G device */
        { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000), /* SIMCom SIM5218 */
          .driver_info = NCTRL(0) | NCTRL(1) | NCTRL(2) | NCTRL(3) | RSVD(4) },
@@ -55,7 +55,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support
        /* Quectel products using Qualcomm vendor ID */
        { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC15)},
        { USB_DEVICE(QUALCOMM_VENDOR_ID, QUECTEL_PRODUCT_UC20),
-@@ -1188,6 +1198,11 @@ static const struct usb_device_id option
+@@ -1193,6 +1203,11 @@ static const struct usb_device_id option
          .driver_info = ZLP },
        { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96),
          .driver_info = RSVD(4) },
index ab4d636956e3dbed6a8979e08687b6af1b262094..cf8ddea255276dfbd10a79d487a65e80163e5dc6 100644 (file)
@@ -77,7 +77,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  INDIRECT_CALLABLE_DECLARE(struct dst_entry *ip6_dst_check(struct dst_entry *,
                                                          u32));
  INDIRECT_CALLABLE_DECLARE(struct dst_entry *ipv4_dst_check(struct dst_entry *,
-@@ -1994,9 +2008,11 @@ static void __sk_free(struct sock *sk)
+@@ -2005,9 +2019,11 @@ static void __sk_free(struct sock *sk)
        if (likely(sk->sk_net_refcnt))
                sock_inuse_add(sock_net(sk), -1);
  
index dcdad4ca695df4669d2b34fc60742db05bfbd225..c7e40dfc6a55cbde5b3b65b5205766af8fb77cb6 100644 (file)
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/fs/locks.c
 +++ b/fs/locks.c
-@@ -2953,6 +2953,8 @@ static const struct seq_operations locks
+@@ -3008,6 +3008,8 @@ static const struct seq_operations locks
  
  static int __init proc_locks_init(void)
  {
@@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/net/core/sock.c
 +++ b/net/core/sock.c
-@@ -3889,6 +3889,8 @@ static __net_initdata struct pernet_oper
+@@ -3900,6 +3900,8 @@ static __net_initdata struct pernet_oper
  
  static int __init proto_init(void)
  {
index 4f4d6c75091af40b71ea228618b90170ad39364a..b4339e82d76e2523cbc5addc62ac134579cf3333 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
 
 --- a/drivers/base/core.c
 +++ b/drivers/base/core.c
-@@ -1562,7 +1562,7 @@ static void device_links_purge(struct de
+@@ -1577,7 +1577,7 @@ static void device_links_purge(struct de
  #define FW_DEVLINK_FLAGS_RPM          (FW_DEVLINK_FLAGS_ON | \
                                         DL_FLAG_PM_RUNTIME)
  
index ac5e3a69b80c65172407df7514c0f32239c78b86..42f5a8c2467c5ad831f6ee5d77fa6aca3524c91f 100644 (file)
@@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
 
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
-@@ -7620,7 +7620,7 @@ static void __init alloc_node_mem_map(st
+@@ -7622,7 +7622,7 @@ static void __init alloc_node_mem_map(st
        if (pgdat == NODE_DATA(0)) {
                mem_map = NODE_DATA(0)->node_mem_map;
                if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
index c1e050e935e6bf8f12f0b50d2174753f79dfbb68..8b1e70bd0edebb1b839ece7e4be288bedafee79d 100644 (file)
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                for (i = sizeof(struct ipt_entry);
                     i < e->target_offset;
                     i += m->u.match_size) {
-@@ -1222,12 +1259,15 @@ compat_copy_entry_to_user(struct ipt_ent
+@@ -1226,12 +1263,15 @@ compat_copy_entry_to_user(struct ipt_ent
        compat_uint_t origsize;
        const struct xt_entry_match *ematch;
        int ret = 0;
index 071a2ed3e5e0132e781189903c350d6ac61b7780..4c97d8b9ec5a02eac6f8d45ba53013c73b38ec16 100644 (file)
@@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
                cfg->fc_flags |= RTF_REJECT;
  
        if (rtm->rtm_type == RTN_LOCAL)
-@@ -6298,6 +6329,8 @@ static int ip6_route_dev_notify(struct n
+@@ -6291,6 +6322,8 @@ static int ip6_route_dev_notify(struct n
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
                net->ipv6.ip6_prohibit_entry->dst.dev = dev;
                net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
@@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
                net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
                net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
  #endif
-@@ -6309,6 +6342,7 @@ static int ip6_route_dev_notify(struct n
+@@ -6302,6 +6335,7 @@ static int ip6_route_dev_notify(struct n
                in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
                in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
@@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
                in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
  #endif
        }
-@@ -6500,6 +6534,8 @@ static int __net_init ip6_route_net_init
+@@ -6493,6 +6527,8 @@ static int __net_init ip6_route_net_init
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
        net->ipv6.fib6_has_custom_rules = false;
@@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
        net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
                                               sizeof(*net->ipv6.ip6_prohibit_entry),
                                               GFP_KERNEL);
-@@ -6510,11 +6546,21 @@ static int __net_init ip6_route_net_init
+@@ -6503,11 +6539,21 @@ static int __net_init ip6_route_net_init
                         ip6_template_metrics, true);
        INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
  
@@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
        net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
        dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
                         ip6_template_metrics, true);
-@@ -6541,6 +6587,8 @@ out:
+@@ -6534,6 +6580,8 @@ out:
        return ret;
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  out_ip6_prohibit_entry:
        kfree(net->ipv6.ip6_prohibit_entry);
  out_ip6_null_entry:
-@@ -6560,6 +6608,7 @@ static void __net_exit ip6_route_net_exi
+@@ -6553,6 +6601,7 @@ static void __net_exit ip6_route_net_exi
        kfree(net->ipv6.ip6_null_entry);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
        kfree(net->ipv6.ip6_prohibit_entry);
@@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo@openwrt.org>
        kfree(net->ipv6.ip6_blk_hole_entry);
  #endif
        dst_entries_destroy(&net->ipv6.ip6_dst_ops);
-@@ -6643,6 +6692,9 @@ void __init ip6_route_init_special_entri
+@@ -6636,6 +6685,9 @@ void __init ip6_route_init_special_entri
        init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
        init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
        init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
index 77d6f84256d6804527a6ed975bb576c371b1ea37..e4946e6e5b426b751ce4c2a82ee3e50f92b25107 100644 (file)
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (netif_elide_gro(skb->dev))
                goto normal;
  
-@@ -8091,6 +8094,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -8094,6 +8097,48 @@ static void __netdev_adjacent_dev_unlink
                                           &upper_dev->adj_list.lower);
  }
  
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static int __netdev_upper_dev_link(struct net_device *dev,
                                   struct net_device *upper_dev, bool master,
                                   void *upper_priv, void *upper_info,
-@@ -8142,6 +8187,7 @@ static int __netdev_upper_dev_link(struc
+@@ -8145,6 +8190,7 @@ static int __netdev_upper_dev_link(struc
        if (ret)
                return ret;
  
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
                                            &changeupper_info.info);
        ret = notifier_to_errno(ret);
-@@ -8238,6 +8284,7 @@ static void __netdev_upper_dev_unlink(st
+@@ -8241,6 +8287,7 @@ static void __netdev_upper_dev_unlink(st
  
        __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
  
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
                                      &changeupper_info.info);
  
-@@ -9057,6 +9104,7 @@ int dev_set_mac_address(struct net_devic
+@@ -9060,6 +9107,7 @@ int dev_set_mac_address(struct net_devic
        if (err)
                return err;
        dev->addr_assign_type = NET_ADDR_SET;
index 70aee30eb68e1c7bd3832ef6199a26962e616bb4..2f1b3ed7931618875ced12c146e16d36847570c7 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/net/netfilter/nf_tables_api.c
 +++ b/net/netfilter/nf_tables_api.c
-@@ -7770,7 +7770,7 @@ static int nft_register_flowtable_net_ho
+@@ -7803,7 +7803,7 @@ static int nft_register_flowtable_net_ho
                err = flowtable->data.type->setup(&flowtable->data,
                                                  hook->ops.dev,
                                                  FLOW_BLOCK_BIND);
index 0580cf1a843c13f20b799e104c6d9175ca71cdca..9b5d9798a68b51217c6d39ba0ff4ecc8032db0f4 100644 (file)
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -3098,8 +3098,8 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -3097,8 +3097,8 @@ static irqreturn_t mtk_handle_irq_rx(int
  
        eth->rx_events++;
        if (likely(napi_schedule_prep(&eth->rx_napi))) {
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        }
  
        return IRQ_HANDLED;
-@@ -3111,8 +3111,8 @@ static irqreturn_t mtk_handle_irq_tx(int
+@@ -3110,8 +3110,8 @@ static irqreturn_t mtk_handle_irq_tx(int
  
        eth->tx_events++;
        if (likely(napi_schedule_prep(&eth->tx_napi))) {
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        }
  
        return IRQ_HANDLED;
-@@ -4886,6 +4886,8 @@ static int mtk_probe(struct platform_dev
+@@ -4885,6 +4885,8 @@ static int mtk_probe(struct platform_dev
         * for NAPI to work
         */
        init_dummy_netdev(&eth->dummy_dev);
index 4ff7f321de93e89c376f9a5cf1c60a19dd45bade..9ae65b8711134687c1e79e099a8ee31db44ddb89 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2422,7 +2422,7 @@ mt7531_setup(struct dsa_switch *ds)
+@@ -2628,7 +2628,7 @@ mt7531_setup(struct dsa_switch *ds)
        struct mt7530_priv *priv = ds->priv;
        struct mt7530_dummy_poll p;
        u32 val, id;
@@ -24,7 +24,7 @@ Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
  
        /* Reset whole chip through gpio pin or memory-mapped registers for
         * different type of hardware
-@@ -2454,6 +2454,10 @@ mt7531_setup(struct dsa_switch *ds)
+@@ -2660,6 +2660,10 @@ mt7531_setup(struct dsa_switch *ds)
                return -ENODEV;
        }
  
index 56edb63234539e02b7f8ea023038811bf0a6b263..9df011fbec814fb7d93782da96a507d77d321440 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1516,12 +1516,28 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1515,12 +1515,28 @@ static void mtk_wake_queue(struct mtk_et
        }
  }
  
@@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        bool gso = false;
        int tx_num;
  
-@@ -1543,6 +1559,18 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1542,6 +1558,18 @@ static netdev_tx_t mtk_start_xmit(struct
                return NETDEV_TX_BUSY;
        }
  
@@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        /* TSO: fill MSS info in tcp checksum field */
        if (skb_is_gso(skb)) {
                if (skb_cow_head(skb, 0)) {
-@@ -1558,8 +1586,14 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1557,8 +1585,14 @@ static netdev_tx_t mtk_start_xmit(struct
                }
        }
  
index 2de28b11dd0913d3ddeb7dfd4936c61472731c16..243e2f9d0e45f68f955a65b2c27323a7e063d582 100644 (file)
@@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -723,6 +723,7 @@ static void mtk_mac_link_up(struct phyli
+@@ -722,6 +722,7 @@ static void mtk_mac_link_up(struct phyli
                 MAC_MCR_FORCE_RX_FC);
  
        /* Configure speed */
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        switch (speed) {
        case SPEED_2500:
        case SPEED_1000:
-@@ -3291,6 +3292,9 @@ found:
+@@ -3290,6 +3291,9 @@ found:
        if (dp->index >= MTK_QDMA_NUM_QUEUES)
                return NOTIFY_DONE;
  
diff --git a/target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch b/target/linux/generic/pending-5.15/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch
deleted file mode 100644 (file)
index 88d1744..0000000
+++ /dev/null
@@ -1,1604 +0,0 @@
-From 1e25ca1147579bda8b941be1b9851f5911d44eb0 Mon Sep 17 00:00:00 2001
-From: Daniel Golle <daniel@makrotopia.org>
-Date: Tue, 22 Aug 2023 19:04:42 +0100
-Subject: [PATCH 098/125] net: ethernet: mtk_eth_soc: add paths and SerDes
- modes for MT7988
-
-MT7988 comes with a built-in 2.5G PHY as well as SerDes lanes to
-connect external PHYs or transceivers in USXGMII, 10GBase-R, 5GBase-R,
-2500Base-X, 1000Base-X and Cisco SGMII interface modes.
-
-Implement support for configuring for the new paths to SerDes interfaces
-and the internal 2.5G PHY.
-
-Add USXGMII PCS driver for 10GBase-R, 5GBase-R and USXGMII mode, and
-setup the new PHYA on MT7988 to access the also still existing old
-LynxI PCS for 1000Base-X, 2500Base-X and Cisco SGMII PCS interface
-modes.
-
-Signed-off-by: Daniel Golle <daniel@makrotopia.org>
----
- drivers/net/ethernet/mediatek/Kconfig        |  16 +
- drivers/net/ethernet/mediatek/Makefile       |   1 +
- drivers/net/ethernet/mediatek/mtk_eth_path.c | 123 +++-
- drivers/net/ethernet/mediatek/mtk_eth_soc.c  | 182 ++++-
- drivers/net/ethernet/mediatek/mtk_eth_soc.h  | 232 ++++++-
- drivers/net/ethernet/mediatek/mtk_usxgmii.c  | 692 +++++++++++++++++++
- 6 files changed, 1215 insertions(+), 31 deletions(-)
- create mode 100644 drivers/net/ethernet/mediatek/mtk_usxgmii.c
-
---- a/drivers/net/ethernet/mediatek/Kconfig
-+++ b/drivers/net/ethernet/mediatek/Kconfig
-@@ -24,6 +24,22 @@ config NET_MEDIATEK_SOC
-         This driver supports the gigabit ethernet MACs in the
-         MediaTek SoC family.
-+config NET_MEDIATEK_SOC_USXGMII
-+      bool "Support USXGMII SerDes on MT7988"
-+      depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST
-+      def_bool NET_MEDIATEK_SOC != n
-+      help
-+        Include support for 10GE SerDes which can be found on MT7988.
-+        If this kernel should run on SoCs with 10 GBit/s Ethernet you
-+        will need to select this option to use GMAC2 and GMAC3 with
-+        external PHYs, SFP(+) cages in 10GBase-R, 5GBase-R or USXGMII
-+        interface modes.
-+
-+        Note that as the 2500Base-X/1000Base-X/Cisco SGMII SerDes PCS
-+        unit (MediaTek LynxI) in MT7988 is connected via the new 10GE
-+        SerDes, you will also need to select this option in case you
-+        want to use any of those SerDes modes.
-+
- config NET_MEDIATEK_STAR_EMAC
-       tristate "MediaTek STAR Ethernet MAC support"
-       select PHYLIB
---- a/drivers/net/ethernet/mediatek/Makefile
-+++ b/drivers/net/ethernet/mediatek/Makefile
-@@ -5,6 +5,7 @@
- obj-$(CONFIG_NET_MEDIATEK_SOC) += mtk_eth.o
- mtk_eth-y := mtk_eth_soc.o mtk_eth_path.o mtk_ppe.o mtk_ppe_debugfs.o mtk_ppe_offload.o
-+mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_USXGMII) += mtk_usxgmii.o
- mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed.o mtk_wed_mcu.o mtk_wed_wo.o
- ifdef CONFIG_DEBUG_FS
- mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_debugfs.o
---- a/drivers/net/ethernet/mediatek/mtk_eth_path.c
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_path.c
-@@ -31,10 +31,20 @@ static const char *mtk_eth_path_name(u64
-               return "gmac2_rgmii";
-       case MTK_ETH_PATH_GMAC2_SGMII:
-               return "gmac2_sgmii";
-+      case MTK_ETH_PATH_GMAC2_2P5GPHY:
-+              return "gmac2_2p5gphy";
-       case MTK_ETH_PATH_GMAC2_GEPHY:
-               return "gmac2_gephy";
-+      case MTK_ETH_PATH_GMAC3_SGMII:
-+              return "gmac3_sgmii";
-       case MTK_ETH_PATH_GDM1_ESW:
-               return "gdm1_esw";
-+      case MTK_ETH_PATH_GMAC1_USXGMII:
-+              return "gmac1_usxgmii";
-+      case MTK_ETH_PATH_GMAC2_USXGMII:
-+              return "gmac2_usxgmii";
-+      case MTK_ETH_PATH_GMAC3_USXGMII:
-+              return "gmac3_usxgmii";
-       default:
-               return "unknown path";
-       }
-@@ -127,6 +137,27 @@ static int set_mux_u3_gmac2_to_qphy(stru
-       return 0;
- }
-+static int set_mux_gmac2_to_2p5gphy(struct mtk_eth *eth, u64 path)
-+{
-+      int ret;
-+
-+      if (path == MTK_ETH_PATH_GMAC2_2P5GPHY) {
-+              ret = regmap_clear_bits(eth->ethsys, ETHSYS_SYSCFG0, SYSCFG0_SGMII_GMAC2_V2);
-+              if (ret)
-+                      return ret;
-+
-+              /* Setup mux to 2p5g PHY */
-+              ret = regmap_clear_bits(eth->infra, TOP_MISC_NETSYS_PCS_MUX, MUX_G2_USXGMII_SEL);
-+              if (ret)
-+                      return ret;
-+
-+              dev_dbg(eth->dev, "path %s in %s updated\n",
-+                      mtk_eth_path_name(path), __func__);
-+      }
-+
-+      return 0;
-+}
-+
- static int set_mux_gmac1_gmac2_to_sgmii_rgmii(struct mtk_eth *eth, u64 path)
- {
-       unsigned int val = 0;
-@@ -165,7 +196,48 @@ static int set_mux_gmac1_gmac2_to_sgmii_
-       return 0;
- }
--static int set_mux_gmac12_to_gephy_sgmii(struct mtk_eth *eth, u64 path)
-+static int set_mux_gmac123_to_usxgmii(struct mtk_eth *eth, u64 path)
-+{
-+      unsigned int val = 0;
-+      bool updated = true;
-+      int mac_id = 0;
-+
-+      /* Disable SYSCFG1 SGMII */
-+      regmap_read(eth->ethsys, ETHSYS_SYSCFG0, &val);
-+
-+      switch (path) {
-+      case MTK_ETH_PATH_GMAC1_USXGMII:
-+              val &= ~(u32)SYSCFG0_SGMII_GMAC1_V2;
-+              mac_id = MTK_GMAC1_ID;
-+              break;
-+      case MTK_ETH_PATH_GMAC2_USXGMII:
-+              val &= ~(u32)SYSCFG0_SGMII_GMAC2_V2;
-+              mac_id = MTK_GMAC2_ID;
-+              break;
-+      case MTK_ETH_PATH_GMAC3_USXGMII:
-+              val &= ~(u32)SYSCFG0_SGMII_GMAC3_V2;
-+              mac_id = MTK_GMAC3_ID;
-+              break;
-+      default:
-+              updated = false;
-+      };
-+
-+      if (updated) {
-+              regmap_update_bits(eth->ethsys, ETHSYS_SYSCFG0,
-+                                 SYSCFG0_SGMII_MASK, val);
-+
-+              if (mac_id == MTK_GMAC2_ID)
-+                      regmap_set_bits(eth->infra, TOP_MISC_NETSYS_PCS_MUX,
-+                                      MUX_G2_USXGMII_SEL);
-+      }
-+
-+      dev_dbg(eth->dev, "path %s in %s updated = %d\n",
-+              mtk_eth_path_name(path), __func__, updated);
-+
-+      return 0;
-+}
-+
-+static int set_mux_gmac123_to_gephy_sgmii(struct mtk_eth *eth, u64 path)
- {
-       unsigned int val = 0;
-       bool updated = true;
-@@ -182,6 +254,9 @@ static int set_mux_gmac12_to_gephy_sgmii
-       case MTK_ETH_PATH_GMAC2_SGMII:
-               val |= SYSCFG0_SGMII_GMAC2_V2;
-               break;
-+      case MTK_ETH_PATH_GMAC3_SGMII:
-+              val |= SYSCFG0_SGMII_GMAC3_V2;
-+              break;
-       default:
-               updated = false;
-       }
-@@ -210,13 +285,25 @@ static const struct mtk_eth_muxc mtk_eth
-               .cap_bit = MTK_ETH_MUX_U3_GMAC2_TO_QPHY,
-               .set_path = set_mux_u3_gmac2_to_qphy,
-       }, {
-+              .name = "mux_gmac2_to_2p5gphy",
-+              .cap_bit = MTK_ETH_MUX_GMAC2_TO_2P5GPHY,
-+              .set_path = set_mux_gmac2_to_2p5gphy,
-+      }, {
-               .name = "mux_gmac1_gmac2_to_sgmii_rgmii",
-               .cap_bit = MTK_ETH_MUX_GMAC1_GMAC2_TO_SGMII_RGMII,
-               .set_path = set_mux_gmac1_gmac2_to_sgmii_rgmii,
-       }, {
-               .name = "mux_gmac12_to_gephy_sgmii",
-               .cap_bit = MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII,
--              .set_path = set_mux_gmac12_to_gephy_sgmii,
-+              .set_path = set_mux_gmac123_to_gephy_sgmii,
-+      }, {
-+              .name = "mux_gmac123_to_gephy_sgmii",
-+              .cap_bit = MTK_ETH_MUX_GMAC123_TO_GEPHY_SGMII,
-+              .set_path = set_mux_gmac123_to_gephy_sgmii,
-+      }, {
-+              .name = "mux_gmac123_to_usxgmii",
-+              .cap_bit = MTK_ETH_MUX_GMAC123_TO_USXGMII,
-+              .set_path = set_mux_gmac123_to_usxgmii,
-       },
- };
-@@ -249,12 +336,39 @@ out:
-       return err;
- }
-+int mtk_gmac_usxgmii_path_setup(struct mtk_eth *eth, int mac_id)
-+{
-+      u64 path;
-+
-+      path = (mac_id == MTK_GMAC1_ID) ?  MTK_ETH_PATH_GMAC1_USXGMII :
-+             (mac_id == MTK_GMAC2_ID) ?  MTK_ETH_PATH_GMAC2_USXGMII :
-+                                         MTK_ETH_PATH_GMAC3_USXGMII;
-+
-+      /* Setup proper MUXes along the path */
-+      return mtk_eth_mux_setup(eth, path);
-+}
-+
- int mtk_gmac_sgmii_path_setup(struct mtk_eth *eth, int mac_id)
- {
-       u64 path;
--      path = (mac_id == 0) ?  MTK_ETH_PATH_GMAC1_SGMII :
--                              MTK_ETH_PATH_GMAC2_SGMII;
-+      path = (mac_id == MTK_GMAC1_ID) ? MTK_ETH_PATH_GMAC1_SGMII :
-+             (mac_id == MTK_GMAC2_ID) ? MTK_ETH_PATH_GMAC2_SGMII :
-+                                        MTK_ETH_PATH_GMAC3_SGMII;
-+
-+      /* Setup proper MUXes along the path */
-+      return mtk_eth_mux_setup(eth, path);
-+}
-+
-+int mtk_gmac_2p5gphy_path_setup(struct mtk_eth *eth, int mac_id)
-+{
-+      u64 path = 0;
-+
-+      if (mac_id == MTK_GMAC2_ID)
-+              path = MTK_ETH_PATH_GMAC2_2P5GPHY;
-+
-+      if (!path)
-+              return -EINVAL;
-       /* Setup proper MUXes along the path */
-       return mtk_eth_mux_setup(eth, path);
-@@ -284,4 +398,3 @@ int mtk_gmac_rgmii_path_setup(struct mtk
-       /* Setup proper MUXes along the path */
-       return mtk_eth_mux_setup(eth, path);
- }
--
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -431,6 +431,30 @@ static void mtk_setup_bridge_switch(stru
-               MTK_GSW_CFG);
- }
-+static bool mtk_check_gmac23_idle(struct mtk_mac *mac)
-+{
-+      u32 mac_fsm, gdm_fsm;
-+
-+      mac_fsm = mtk_r32(mac->hw, MTK_MAC_FSM(mac->id));
-+
-+      switch (mac->id) {
-+      case MTK_GMAC2_ID:
-+              gdm_fsm = mtk_r32(mac->hw, MTK_FE_GDM2_FSM);
-+              break;
-+      case MTK_GMAC3_ID:
-+              gdm_fsm = mtk_r32(mac->hw, MTK_FE_GDM3_FSM);
-+              break;
-+      default:
-+              return true;
-+      };
-+
-+      if ((mac_fsm & 0xFFFF0000) == 0x01010000 &&
-+          (gdm_fsm & 0xFFFF0000) == 0x00000000)
-+              return true;
-+
-+      return false;
-+}
-+
- static struct phylink_pcs *mtk_mac_select_pcs(struct phylink_config *config,
-                                             phy_interface_t interface)
- {
-@@ -439,12 +463,20 @@ static struct phylink_pcs *mtk_mac_selec
-       struct mtk_eth *eth = mac->hw;
-       unsigned int sid;
--      if (interface == PHY_INTERFACE_MODE_SGMII ||
--          phy_interface_mode_is_8023z(interface)) {
--              sid = (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_SGMII)) ?
--                     0 : mac->id;
--
--              return eth->sgmii_pcs[sid];
-+      if ((interface == PHY_INTERFACE_MODE_SGMII ||
-+           phy_interface_mode_is_8023z(interface)) &&
-+          MTK_HAS_CAPS(eth->soc->caps, MTK_SGMII)) {
-+              sid = mtk_mac2xgmii_id(eth, mac->id);
-+              if (MTK_HAS_CAPS(eth->soc->caps, MTK_USXGMII))
-+                      return mtk_sgmii_wrapper_select_pcs(eth, mac->id);
-+              else
-+                      return eth->sgmii_pcs[sid];
-+      } else if ((interface == PHY_INTERFACE_MODE_USXGMII ||
-+                  interface == PHY_INTERFACE_MODE_10GBASER ||
-+                  interface == PHY_INTERFACE_MODE_5GBASER) &&
-+                 MTK_HAS_CAPS(eth->soc->caps, MTK_USXGMII) &&
-+                 mac->id != MTK_GMAC1_ID) {
-+              return mtk_usxgmii_select_pcs(eth, mac->id);
-       }
-       return NULL;
-@@ -500,7 +532,22 @@ static void mtk_mac_config(struct phylin
-                                       goto init_err;
-                       }
-                       break;
-+              case PHY_INTERFACE_MODE_USXGMII:
-+              case PHY_INTERFACE_MODE_10GBASER:
-+              case PHY_INTERFACE_MODE_5GBASER:
-+                      if (MTK_HAS_CAPS(eth->soc->caps, MTK_USXGMII)) {
-+                              err = mtk_gmac_usxgmii_path_setup(eth, mac->id);
-+                              if (err)
-+                                      goto init_err;
-+                      }
-+                      break;
-               case PHY_INTERFACE_MODE_INTERNAL:
-+                      if (mac->id == MTK_GMAC2_ID &&
-+                          MTK_HAS_CAPS(eth->soc->caps, MTK_2P5GPHY)) {
-+                              err = mtk_gmac_2p5gphy_path_setup(eth, mac->id);
-+                              if (err)
-+                                      goto init_err;
-+                      }
-                       break;
-               default:
-                       goto err_phy;
-@@ -555,8 +602,6 @@ static void mtk_mac_config(struct phylin
-               val &= ~SYSCFG0_GE_MODE(SYSCFG0_GE_MASK, mac->id);
-               val |= SYSCFG0_GE_MODE(ge_mode, mac->id);
-               regmap_write(eth->ethsys, ETHSYS_SYSCFG0, val);
--
--              mac->interface = state->interface;
-       }
-       /* SGMII */
-@@ -573,21 +618,40 @@ static void mtk_mac_config(struct phylin
-               /* Save the syscfg0 value for mac_finish */
-               mac->syscfg0 = val;
--      } else if (phylink_autoneg_inband(mode)) {
-+      } else if (state->interface != PHY_INTERFACE_MODE_USXGMII &&
-+                 state->interface != PHY_INTERFACE_MODE_10GBASER &&
-+                 state->interface != PHY_INTERFACE_MODE_5GBASER &&
-+                 phylink_autoneg_inband(mode)) {
-               dev_err(eth->dev,
--                      "In-band mode not supported in non SGMII mode!\n");
-+                      "In-band mode not supported in non-SerDes modes!\n");
-               return;
-       }
-       /* Setup gmac */
--      if (mtk_is_netsys_v3_or_greater(eth) &&
--          mac->interface == PHY_INTERFACE_MODE_INTERNAL) {
--              mtk_w32(mac->hw, MTK_GDMA_XGDM_SEL, MTK_GDMA_EG_CTRL(mac->id));
--              mtk_w32(mac->hw, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(mac->id));
-+      if (mtk_is_netsys_v3_or_greater(eth)) {
-+              if (mtk_interface_mode_is_xgmii(state->interface)) {
-+                      mtk_w32(mac->hw, MTK_GDMA_XGDM_SEL, MTK_GDMA_EG_CTRL(mac->id));
-+                      mtk_w32(mac->hw, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(mac->id));
-+
-+                      if (mac->id == MTK_GMAC1_ID)
-+                              mtk_setup_bridge_switch(eth);
-+              } else {
-+                      mtk_w32(eth, 0, MTK_GDMA_EG_CTRL(mac->id));
--              mtk_setup_bridge_switch(eth);
-+                      /* FIXME: In current hardware design, we have to reset FE
-+                       * when swtiching XGDM to GDM. Therefore, here trigger an SER
-+                       * to let GDM go back to the initial state.
-+                       */
-+                      if ((mtk_interface_mode_is_xgmii(mac->interface) ||
-+                           mac->interface == PHY_INTERFACE_MODE_NA) &&
-+                          !mtk_check_gmac23_idle(mac) &&
-+                          !test_bit(MTK_RESETTING, &eth->state))
-+                              schedule_work(&eth->pending_work);
-+              }
-       }
-+      mac->interface = state->interface;
-+
-       return;
- err_phy:
-@@ -633,10 +697,13 @@ static void mtk_mac_link_down(struct phy
- {
-       struct mtk_mac *mac = container_of(config, struct mtk_mac,
-                                          phylink_config);
--      u32 mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
--      mcr &= ~(MAC_MCR_TX_EN | MAC_MCR_RX_EN);
--      mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
-+      if (!mtk_interface_mode_is_xgmii(interface)) {
-+              mtk_m32(mac->hw, MAC_MCR_TX_EN | MAC_MCR_RX_EN, 0, MTK_MAC_MCR(mac->id));
-+              mtk_m32(mac->hw, MTK_XGMAC_FORCE_LINK(mac->id), 0, MTK_XGMAC_STS(mac->id));
-+      } else if (mac->id != MTK_GMAC1_ID) {
-+              mtk_m32(mac->hw, XMAC_MCR_TRX_DISABLE, XMAC_MCR_TRX_DISABLE, MTK_XMAC_MCR(mac->id));
-+      }
- }
- static void mtk_set_queue_speed(struct mtk_eth *eth, unsigned int idx,
-@@ -708,13 +775,11 @@ static void mtk_set_queue_speed(struct m
-       mtk_w32(eth, val, soc->reg_map->qdma.qtx_sch + ofs);
- }
--static void mtk_mac_link_up(struct phylink_config *config,
--                          struct phy_device *phy,
--                          unsigned int mode, phy_interface_t interface,
--                          int speed, int duplex, bool tx_pause, bool rx_pause)
-+static void mtk_gdm_mac_link_up(struct mtk_mac *mac,
-+                              struct phy_device *phy,
-+                              unsigned int mode, phy_interface_t interface,
-+                              int speed, int duplex, bool tx_pause, bool rx_pause)
- {
--      struct mtk_mac *mac = container_of(config, struct mtk_mac,
--                                         phylink_config);
-       u32 mcr;
-       mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
-@@ -748,6 +813,55 @@ static void mtk_mac_link_up(struct phyli
-       mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
- }
-+static void mtk_xgdm_mac_link_up(struct mtk_mac *mac,
-+                               struct phy_device *phy,
-+                               unsigned int mode, phy_interface_t interface,
-+                               int speed, int duplex, bool tx_pause, bool rx_pause)
-+{
-+      u32 mcr, force_link = 0;
-+
-+      if (mac->id == MTK_GMAC1_ID)
-+              return;
-+
-+      /* Eliminate the interference(before link-up) caused by PHY noise */
-+      mtk_m32(mac->hw, XMAC_LOGIC_RST, 0, MTK_XMAC_LOGIC_RST(mac->id));
-+      mdelay(20);
-+      mtk_m32(mac->hw, XMAC_GLB_CNTCLR, XMAC_GLB_CNTCLR, MTK_XMAC_CNT_CTRL(mac->id));
-+
-+      if (mac->interface == PHY_INTERFACE_MODE_INTERNAL || mac->id == MTK_GMAC3_ID)
-+              force_link = MTK_XGMAC_FORCE_LINK(mac->id);
-+
-+      mtk_m32(mac->hw, MTK_XGMAC_FORCE_LINK(mac->id), force_link, MTK_XGMAC_STS(mac->id));
-+
-+      mcr = mtk_r32(mac->hw, MTK_XMAC_MCR(mac->id));
-+      mcr &= ~(XMAC_MCR_FORCE_TX_FC | XMAC_MCR_FORCE_RX_FC | XMAC_MCR_TRX_DISABLE);
-+      /* Configure pause modes -
-+       * phylink will avoid these for half duplex
-+       */
-+      if (tx_pause)
-+              mcr |= XMAC_MCR_FORCE_TX_FC;
-+      if (rx_pause)
-+              mcr |= XMAC_MCR_FORCE_RX_FC;
-+
-+      mtk_w32(mac->hw, mcr, MTK_XMAC_MCR(mac->id));
-+}
-+
-+static void mtk_mac_link_up(struct phylink_config *config,
-+                          struct phy_device *phy,
-+                          unsigned int mode, phy_interface_t interface,
-+                          int speed, int duplex, bool tx_pause, bool rx_pause)
-+{
-+      struct mtk_mac *mac = container_of(config, struct mtk_mac,
-+                                         phylink_config);
-+
-+      if (mtk_interface_mode_is_xgmii(interface))
-+              mtk_xgdm_mac_link_up(mac, phy, mode, interface, speed, duplex,
-+                                   tx_pause, rx_pause);
-+      else
-+              mtk_gdm_mac_link_up(mac, phy, mode, interface, speed, duplex,
-+                                  tx_pause, rx_pause);
-+}
-+
- static const struct phylink_mac_ops mtk_phylink_ops = {
-       .validate = phylink_generic_validate,
-       .mac_select_pcs = mtk_mac_select_pcs,
-@@ -4561,8 +4675,21 @@ static int mtk_add_mac(struct mtk_eth *e
-               phy_interface_zero(mac->phylink_config.supported_interfaces);
-               __set_bit(PHY_INTERFACE_MODE_INTERNAL,
-                         mac->phylink_config.supported_interfaces);
-+      } else if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_USXGMII)) {
-+              mac->phylink_config.mac_capabilities |= MAC_5000FD | MAC_10000FD;
-+              __set_bit(PHY_INTERFACE_MODE_5GBASER,
-+                        mac->phylink_config.supported_interfaces);
-+              __set_bit(PHY_INTERFACE_MODE_10GBASER,
-+                        mac->phylink_config.supported_interfaces);
-+              __set_bit(PHY_INTERFACE_MODE_USXGMII,
-+                        mac->phylink_config.supported_interfaces);
-       }
-+      if (MTK_HAS_CAPS(mac->hw->soc->caps, MTK_2P5GPHY) &&
-+          id == MTK_GMAC2_ID)
-+              __set_bit(PHY_INTERFACE_MODE_INTERNAL,
-+                        mac->phylink_config.supported_interfaces);
-+
-       phylink = phylink_create(&mac->phylink_config,
-                                of_fwnode_handle(mac->of_node),
-                                phy_mode, &mtk_phylink_ops);
-@@ -4755,6 +4882,13 @@ static int mtk_probe(struct platform_dev
-               if (err)
-                       return err;
-+      }
-+
-+      if (MTK_HAS_CAPS(eth->soc->caps, MTK_USXGMII)) {
-+              err = mtk_usxgmii_init(eth);
-+
-+              if (err)
-+                      return err;
-       }
-       if (eth->soc->required_pctl) {
---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -499,6 +499,21 @@
- #define INTF_MODE_RGMII_1000    (TRGMII_MODE | TRGMII_CENTRAL_ALIGNED)
- #define INTF_MODE_RGMII_10_100  0
-+/* XFI Mac control registers */
-+#define MTK_XMAC_BASE(x)      (0x12000 + (((x) - 1) * 0x1000))
-+#define MTK_XMAC_MCR(x)               (MTK_XMAC_BASE(x))
-+#define XMAC_MCR_TRX_DISABLE  0xf
-+#define XMAC_MCR_FORCE_TX_FC  BIT(5)
-+#define XMAC_MCR_FORCE_RX_FC  BIT(4)
-+
-+/* XFI Mac logic reset registers */
-+#define MTK_XMAC_LOGIC_RST(x) (MTK_XMAC_BASE(x) + 0x10)
-+#define XMAC_LOGIC_RST                BIT(0)
-+
-+/* XFI Mac count global control */
-+#define MTK_XMAC_CNT_CTRL(x)  (MTK_XMAC_BASE(x) + 0x100)
-+#define XMAC_GLB_CNTCLR               BIT(0)
-+
- /* GPIO port control registers for GMAC 2*/
- #define GPIO_OD33_CTRL8               0x4c0
- #define GPIO_BIAS_CTRL                0xed0
-@@ -524,6 +539,7 @@
- #define SYSCFG0_SGMII_GMAC2    ((3 << 8) & SYSCFG0_SGMII_MASK)
- #define SYSCFG0_SGMII_GMAC1_V2 BIT(9)
- #define SYSCFG0_SGMII_GMAC2_V2 BIT(8)
-+#define SYSCFG0_SGMII_GMAC3_V2 BIT(7)
- /* ethernet subsystem clock register */
-@@ -556,12 +572,74 @@
- #define ETHSYS_DMA_AG_MAP_QDMA        BIT(1)
- #define ETHSYS_DMA_AG_MAP_PPE BIT(2)
-+/* USXGMII subsystem config registers */
-+/* Register to control speed */
-+#define RG_PHY_TOP_SPEED_CTRL1        0x80C
-+#define USXGMII_RATE_UPDATE_MODE      BIT(31)
-+#define USXGMII_MAC_CK_GATED  BIT(29)
-+#define USXGMII_IF_FORCE_EN   BIT(28)
-+#define USXGMII_RATE_ADAPT_MODE       GENMASK(10, 8)
-+#define USXGMII_RATE_ADAPT_MODE_X1    0
-+#define USXGMII_RATE_ADAPT_MODE_X2    1
-+#define USXGMII_RATE_ADAPT_MODE_X4    2
-+#define USXGMII_RATE_ADAPT_MODE_X10   3
-+#define USXGMII_RATE_ADAPT_MODE_X100  4
-+#define USXGMII_RATE_ADAPT_MODE_X5    5
-+#define USXGMII_RATE_ADAPT_MODE_X50   6
-+#define USXGMII_XFI_RX_MODE   GENMASK(6, 4)
-+#define USXGMII_XFI_RX_MODE_10G       0
-+#define USXGMII_XFI_RX_MODE_5G        1
-+#define USXGMII_XFI_TX_MODE   GENMASK(2, 0)
-+#define USXGMII_XFI_TX_MODE_10G       0
-+#define USXGMII_XFI_TX_MODE_5G        1
-+
-+/* Register to control PCS AN */
-+#define RG_PCS_AN_CTRL0               0x810
-+#define USXGMII_AN_RESTART    BIT(31)
-+#define USXGMII_AN_SYNC_CNT   GENMASK(30, 11)
-+#define USXGMII_AN_ENABLE     BIT(0)
-+
-+#define RG_PCS_AN_CTRL2               0x818
-+#define USXGMII_LINK_TIMER_IDLE_DETECT        GENMASK(29, 20)
-+#define USXGMII_LINK_TIMER_COMP_ACK_DETECT    GENMASK(19, 10)
-+#define USXGMII_LINK_TIMER_AN_RESTART GENMASK(9, 0)
-+
-+/* Register to read PCS AN status */
-+#define RG_PCS_AN_STS0                0x81c
-+#define USXGMII_PCS_AN_WORD   GENMASK(15, 0)
-+#define USXGMII_LPA_LATCH     BIT(31)
-+
-+/* Register to control USXGMII XFI PLL digital */
-+#define XFI_PLL_DIG_GLB8      0x08
-+#define RG_XFI_PLL_EN         BIT(31)
-+
-+/* Register to control USXGMII XFI PLL analog */
-+#define XFI_PLL_ANA_GLB8      0x108
-+#define RG_XFI_PLL_ANA_SWWA   0x02283248
-+
- /* Infrasys subsystem config registers */
- #define INFRA_MISC2            0x70c
- #define CO_QPHY_SEL            BIT(0)
- #define GEPHY_MAC_SEL          BIT(1)
-+/* Toprgu subsystem config registers */
-+#define TOPRGU_SWSYSRST               0x18
-+#define SWSYSRST_UNLOCK_KEY   GENMASK(31, 24)
-+#define SWSYSRST_XFI_PLL_GRST BIT(16)
-+#define SWSYSRST_XFI_PEXPT1_GRST      BIT(15)
-+#define SWSYSRST_XFI_PEXPT0_GRST      BIT(14)
-+#define SWSYSRST_XFI1_GRST    BIT(13)
-+#define SWSYSRST_XFI0_GRST    BIT(12)
-+#define SWSYSRST_SGMII1_GRST  BIT(2)
-+#define SWSYSRST_SGMII0_GRST  BIT(1)
-+#define TOPRGU_SWSYSRST_EN            0xFC
-+
- /* Top misc registers */
-+#define TOP_MISC_NETSYS_PCS_MUX       0x84
-+#define NETSYS_PCS_MUX_MASK   GENMASK(1, 0)
-+#define       MUX_G2_USXGMII_SEL      BIT(1)
-+#define MUX_HSGMII1_G1_SEL    BIT(0)
-+
- #define USB_PHY_SWITCH_REG    0x218
- #define QPHY_SEL_MASK         GENMASK(1, 0)
- #define SGMII_QPHY_SEL                0x2
-@@ -586,6 +664,8 @@
- #define MT7628_SDM_RBCNT      (MT7628_SDM_OFFSET + 0x10c)
- #define MT7628_SDM_CS_ERR     (MT7628_SDM_OFFSET + 0x110)
-+/* Debug Purpose Register */
-+#define MTK_PSE_FQFC_CFG      0x100
- #define MTK_FE_CDM1_FSM               0x220
- #define MTK_FE_CDM2_FSM               0x224
- #define MTK_FE_CDM3_FSM               0x238
-@@ -594,6 +674,11 @@
- #define MTK_FE_CDM6_FSM               0x328
- #define MTK_FE_GDM1_FSM               0x228
- #define MTK_FE_GDM2_FSM               0x22C
-+#define MTK_FE_GDM3_FSM               0x23C
-+#define MTK_FE_PSE_FREE               0x240
-+#define MTK_FE_DROP_FQ                0x244
-+#define MTK_FE_DROP_FC                0x248
-+#define MTK_FE_DROP_PPE               0x24C
- #define MTK_MAC_FSM(x)                (0x1010C + ((x) * 0x100))
-@@ -940,6 +1025,8 @@ enum mkt_eth_capabilities {
-       MTK_RGMII_BIT = 0,
-       MTK_TRGMII_BIT,
-       MTK_SGMII_BIT,
-+      MTK_USXGMII_BIT,
-+      MTK_2P5GPHY_BIT,
-       MTK_ESW_BIT,
-       MTK_GEPHY_BIT,
-       MTK_MUX_BIT,
-@@ -960,8 +1047,11 @@ enum mkt_eth_capabilities {
-       MTK_ETH_MUX_GDM1_TO_GMAC1_ESW_BIT,
-       MTK_ETH_MUX_GMAC2_GMAC0_TO_GEPHY_BIT,
-       MTK_ETH_MUX_U3_GMAC2_TO_QPHY_BIT,
-+      MTK_ETH_MUX_GMAC2_TO_2P5GPHY_BIT,
-       MTK_ETH_MUX_GMAC1_GMAC2_TO_SGMII_RGMII_BIT,
-       MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII_BIT,
-+      MTK_ETH_MUX_GMAC123_TO_GEPHY_SGMII_BIT,
-+      MTK_ETH_MUX_GMAC123_TO_USXGMII_BIT,
-       /* PATH BITS */
-       MTK_ETH_PATH_GMAC1_RGMII_BIT,
-@@ -969,14 +1059,21 @@ enum mkt_eth_capabilities {
-       MTK_ETH_PATH_GMAC1_SGMII_BIT,
-       MTK_ETH_PATH_GMAC2_RGMII_BIT,
-       MTK_ETH_PATH_GMAC2_SGMII_BIT,
-+      MTK_ETH_PATH_GMAC2_2P5GPHY_BIT,
-       MTK_ETH_PATH_GMAC2_GEPHY_BIT,
-+      MTK_ETH_PATH_GMAC3_SGMII_BIT,
-       MTK_ETH_PATH_GDM1_ESW_BIT,
-+      MTK_ETH_PATH_GMAC1_USXGMII_BIT,
-+      MTK_ETH_PATH_GMAC2_USXGMII_BIT,
-+      MTK_ETH_PATH_GMAC3_USXGMII_BIT,
- };
- /* Supported hardware group on SoCs */
- #define MTK_RGMII             BIT_ULL(MTK_RGMII_BIT)
- #define MTK_TRGMII            BIT_ULL(MTK_TRGMII_BIT)
- #define MTK_SGMII             BIT_ULL(MTK_SGMII_BIT)
-+#define MTK_USXGMII           BIT_ULL(MTK_USXGMII_BIT)
-+#define MTK_2P5GPHY           BIT_ULL(MTK_2P5GPHY_BIT)
- #define MTK_ESW                       BIT_ULL(MTK_ESW_BIT)
- #define MTK_GEPHY             BIT_ULL(MTK_GEPHY_BIT)
- #define MTK_MUX                       BIT_ULL(MTK_MUX_BIT)
-@@ -999,10 +1096,16 @@ enum mkt_eth_capabilities {
-       BIT_ULL(MTK_ETH_MUX_GMAC2_GMAC0_TO_GEPHY_BIT)
- #define MTK_ETH_MUX_U3_GMAC2_TO_QPHY          \
-       BIT_ULL(MTK_ETH_MUX_U3_GMAC2_TO_QPHY_BIT)
-+#define MTK_ETH_MUX_GMAC2_TO_2P5GPHY          \
-+      BIT_ULL(MTK_ETH_MUX_GMAC2_TO_2P5GPHY_BIT)
- #define MTK_ETH_MUX_GMAC1_GMAC2_TO_SGMII_RGMII        \
-       BIT_ULL(MTK_ETH_MUX_GMAC1_GMAC2_TO_SGMII_RGMII_BIT)
- #define MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII     \
-       BIT_ULL(MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII_BIT)
-+#define MTK_ETH_MUX_GMAC123_TO_GEPHY_SGMII    \
-+      BIT_ULL(MTK_ETH_MUX_GMAC123_TO_GEPHY_SGMII_BIT)
-+#define MTK_ETH_MUX_GMAC123_TO_USXGMII        \
-+      BIT_ULL(MTK_ETH_MUX_GMAC123_TO_USXGMII_BIT)
- /* Supported path present on SoCs */
- #define MTK_ETH_PATH_GMAC1_RGMII      BIT_ULL(MTK_ETH_PATH_GMAC1_RGMII_BIT)
-@@ -1010,8 +1113,13 @@ enum mkt_eth_capabilities {
- #define MTK_ETH_PATH_GMAC1_SGMII      BIT_ULL(MTK_ETH_PATH_GMAC1_SGMII_BIT)
- #define MTK_ETH_PATH_GMAC2_RGMII      BIT_ULL(MTK_ETH_PATH_GMAC2_RGMII_BIT)
- #define MTK_ETH_PATH_GMAC2_SGMII      BIT_ULL(MTK_ETH_PATH_GMAC2_SGMII_BIT)
-+#define MTK_ETH_PATH_GMAC2_2P5GPHY    BIT_ULL(MTK_ETH_PATH_GMAC2_2P5GPHY_BIT)
- #define MTK_ETH_PATH_GMAC2_GEPHY      BIT_ULL(MTK_ETH_PATH_GMAC2_GEPHY_BIT)
-+#define MTK_ETH_PATH_GMAC3_SGMII      BIT_ULL(MTK_ETH_PATH_GMAC3_SGMII_BIT)
- #define MTK_ETH_PATH_GDM1_ESW         BIT_ULL(MTK_ETH_PATH_GDM1_ESW_BIT)
-+#define MTK_ETH_PATH_GMAC1_USXGMII    BIT_ULL(MTK_ETH_PATH_GMAC1_USXGMII_BIT)
-+#define MTK_ETH_PATH_GMAC2_USXGMII    BIT_ULL(MTK_ETH_PATH_GMAC2_USXGMII_BIT)
-+#define MTK_ETH_PATH_GMAC3_USXGMII    BIT_ULL(MTK_ETH_PATH_GMAC3_USXGMII_BIT)
- #define MTK_GMAC1_RGMII               (MTK_ETH_PATH_GMAC1_RGMII | MTK_RGMII)
- #define MTK_GMAC1_TRGMII      (MTK_ETH_PATH_GMAC1_TRGMII | MTK_TRGMII)
-@@ -1019,7 +1127,12 @@ enum mkt_eth_capabilities {
- #define MTK_GMAC2_RGMII               (MTK_ETH_PATH_GMAC2_RGMII | MTK_RGMII)
- #define MTK_GMAC2_SGMII               (MTK_ETH_PATH_GMAC2_SGMII | MTK_SGMII)
- #define MTK_GMAC2_GEPHY               (MTK_ETH_PATH_GMAC2_GEPHY | MTK_GEPHY)
-+#define MTK_GMAC2_2P5GPHY     (MTK_ETH_PATH_GMAC2_2P5GPHY | MTK_2P5GPHY)
-+#define MTK_GMAC3_SGMII               (MTK_ETH_PATH_GMAC3_SGMII | MTK_SGMII)
- #define MTK_GDM1_ESW          (MTK_ETH_PATH_GDM1_ESW | MTK_ESW)
-+#define MTK_GMAC1_USXGMII     (MTK_ETH_PATH_GMAC1_USXGMII | MTK_USXGMII)
-+#define MTK_GMAC2_USXGMII     (MTK_ETH_PATH_GMAC2_USXGMII | MTK_USXGMII)
-+#define MTK_GMAC3_USXGMII     (MTK_ETH_PATH_GMAC3_USXGMII | MTK_USXGMII)
- /* MUXes present on SoCs */
- /* 0: GDM1 -> GMAC1, 1: GDM1 -> ESW */
-@@ -1038,10 +1151,20 @@ enum mkt_eth_capabilities {
-       (MTK_ETH_MUX_GMAC1_GMAC2_TO_SGMII_RGMII | MTK_MUX | \
-       MTK_SHARED_SGMII)
-+/* 2: GMAC2 -> XGMII */
-+#define MTK_MUX_GMAC2_TO_2P5GPHY      \
-+      (MTK_ETH_MUX_GMAC2_TO_2P5GPHY | MTK_MUX | MTK_INFRA)
-+
- /* 0: GMACx -> GEPHY, 1: GMACx -> SGMII where x is 1 or 2 */
- #define MTK_MUX_GMAC12_TO_GEPHY_SGMII   \
-       (MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII | MTK_MUX)
-+#define MTK_MUX_GMAC123_TO_GEPHY_SGMII   \
-+      (MTK_ETH_MUX_GMAC123_TO_GEPHY_SGMII | MTK_MUX)
-+
-+#define MTK_MUX_GMAC123_TO_USXGMII   \
-+      (MTK_ETH_MUX_GMAC123_TO_USXGMII | MTK_MUX | MTK_INFRA)
-+
- #define MTK_HAS_CAPS(caps, _x)                (((caps) & (_x)) == (_x))
- #define MT7621_CAPS  (MTK_GMAC1_RGMII | MTK_GMAC1_TRGMII | \
-@@ -1073,8 +1196,12 @@ enum mkt_eth_capabilities {
-                     MTK_MUX_GMAC12_TO_GEPHY_SGMII | MTK_QDMA | \
-                     MTK_RSTCTRL_PPE1 | MTK_SRAM)
--#define MT7988_CAPS  (MTK_36BIT_DMA | MTK_GDM1_ESW | MTK_QDMA | \
--                    MTK_RSTCTRL_PPE1 | MTK_RSTCTRL_PPE2 | MTK_SRAM)
-+#define MT7988_CAPS  (MTK_36BIT_DMA | MTK_GDM1_ESW | MTK_GMAC1_SGMII | \
-+                    MTK_GMAC2_2P5GPHY | MTK_GMAC2_SGMII | MTK_GMAC2_USXGMII | \
-+                    MTK_GMAC3_SGMII | MTK_GMAC3_USXGMII | \
-+                    MTK_MUX_GMAC123_TO_GEPHY_SGMII | \
-+                    MTK_MUX_GMAC123_TO_USXGMII | MTK_MUX_GMAC2_TO_2P5GPHY | \
-+                    MTK_QDMA | MTK_RSTCTRL_PPE1 | MTK_RSTCTRL_PPE2 | MTK_SRAM)
- struct mtk_tx_dma_desc_info {
-       dma_addr_t      addr;
-@@ -1184,6 +1311,24 @@ struct mtk_soc_data {
- /* currently no SoC has more than 3 macs */
- #define MTK_MAX_DEVS  3
-+/* struct mtk_usxgmii_pcs - This structure holds each usxgmii regmap and
-+ *                    associated data
-+ * @regmap:           The register map pointing at the range used to setup
-+ *                    USXGMII modes
-+ * @interface:                Currently selected interface mode
-+ * @id:                       The element is used to record the index of PCS
-+ * @pcs:              Phylink PCS structure
-+ */
-+struct mtk_usxgmii_pcs {
-+      struct mtk_eth          *eth;
-+      struct regmap           *regmap;
-+      struct phylink_pcs      *wrapped_sgmii_pcs;
-+      phy_interface_t         interface;
-+      u8                      id;
-+      unsigned int            mode;
-+      struct phylink_pcs      pcs;
-+};
-+
- /* struct mtk_eth -   This is the main datasructure for holding the state
-  *                    of the driver
-  * @dev:              The device pointer
-@@ -1204,6 +1349,12 @@ struct mtk_soc_data {
-  * @infra:              The register map pointing at the range used to setup
-  *                      SGMII and GePHY path
-  * @sgmii_pcs:                Pointers to mtk-pcs-lynxi phylink_pcs instances
-+ * @sgmii_wrapped_pcs:        Pointers to NETSYSv3 wrapper PCS instances
-+ * @usxgmii_pll:      The register map pointing at the range used to control
-+ *                    the USXGMII SerDes PLL
-+ * @regmap_pextp:     The register map pointing at the range used to setup
-+ *                    PHYA
-+ * @usxgmii_pcs:      Pointer to array of pointers to struct for USXGMII PCS
-  * @pctl:             The register map pointing at the range used to setup
-  *                    GMAC port drive/slew values
-  * @dma_refcnt:               track how many netdevs are using the DMA engine
-@@ -1247,6 +1398,10 @@ struct mtk_eth {
-       struct regmap                   *ethsys;
-       struct regmap                   *infra;
-       struct phylink_pcs              *sgmii_pcs[MTK_MAX_DEVS];
-+      struct regmap                   *toprgu;
-+      struct regmap                   *usxgmii_pll;
-+      struct regmap                   *regmap_pextp[MTK_MAX_DEVS];
-+      struct mtk_usxgmii_pcs          *usxgmii_pcs[MTK_MAX_DEVS];
-       struct regmap                   *pctl;
-       bool                            hwlro;
-       refcount_t                      dma_refcnt;
-@@ -1434,6 +1589,19 @@ static inline u32 mtk_get_ib2_multicast_
-       return MTK_FOE_IB2_MULTICAST;
- }
-+static inline bool mtk_interface_mode_is_xgmii(phy_interface_t interface)
-+{
-+      switch (interface) {
-+      case PHY_INTERFACE_MODE_INTERNAL:
-+      case PHY_INTERFACE_MODE_USXGMII:
-+      case PHY_INTERFACE_MODE_10GBASER:
-+      case PHY_INTERFACE_MODE_5GBASER:
-+              return true;
-+      default:
-+              return false;
-+      }
-+}
-+
- /* read the hardware status register */
- void mtk_stats_update_mac(struct mtk_mac *mac);
-@@ -1442,8 +1610,10 @@ u32 mtk_r32(struct mtk_eth *eth, unsigne
- u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned int reg);
- int mtk_gmac_sgmii_path_setup(struct mtk_eth *eth, int mac_id);
-+int mtk_gmac_2p5gphy_path_setup(struct mtk_eth *eth, int mac_id);
- int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id);
- int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id);
-+int mtk_gmac_usxgmii_path_setup(struct mtk_eth *eth, int mac_id);
- int mtk_eth_offload_init(struct mtk_eth *eth);
- int mtk_eth_setup_tc(struct net_device *dev, enum tc_setup_type type,
-@@ -1453,5 +1623,63 @@ int mtk_flow_offload_cmd(struct mtk_eth
- void mtk_flow_offload_cleanup(struct mtk_eth *eth, struct list_head *list);
- void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev);
-+static inline int mtk_mac2xgmii_id(struct mtk_eth *eth, int mac_id)
-+{
-+      int xgmii_id = mac_id;
-+
-+      if (mtk_is_netsys_v3_or_greater(eth)) {
-+              switch (mac_id) {
-+              case MTK_GMAC1_ID:
-+              case MTK_GMAC2_ID:
-+                      xgmii_id = 1;
-+                      break;
-+              case MTK_GMAC3_ID:
-+                      xgmii_id = 0;
-+                      break;
-+              default:
-+                      xgmii_id = -1;
-+              }
-+      }
-+
-+      return MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_SGMII) ? 0 : xgmii_id;
-+}
-+
-+static inline int mtk_xgmii2mac_id(struct mtk_eth *eth, int xgmii_id)
-+{
-+      int mac_id = xgmii_id;
-+
-+      if (mtk_is_netsys_v3_or_greater(eth)) {
-+              switch (xgmii_id) {
-+              case 0:
-+                      mac_id = 2;
-+                      break;
-+              case 1:
-+                      mac_id = 1;
-+                      break;
-+              default:
-+                      mac_id = -1;
-+              }
-+      }
-+
-+      return mac_id;
-+}
-+
-+#ifdef CONFIG_NET_MEDIATEK_SOC_USXGMII
-+struct phylink_pcs *mtk_sgmii_wrapper_select_pcs(struct mtk_eth *eth, int id);
-+struct phylink_pcs *mtk_usxgmii_select_pcs(struct mtk_eth *eth, int id);
-+int mtk_usxgmii_init(struct mtk_eth *eth);
-+#else
-+static inline struct phylink_pcs *mtk_sgmii_wrapper_select_pcs(struct mtk_eth *eth, int id)
-+{
-+      return NULL;
-+}
-+
-+static inline struct phylink_pcs *mtk_usxgmii_select_pcs(struct mtk_eth *eth, int id)
-+{
-+      return NULL;
-+}
-+
-+static inline int mtk_usxgmii_init(struct mtk_eth *eth) { return 0; }
-+#endif /* NET_MEDIATEK_SOC_USXGMII */
- #endif /* MTK_ETH_H */
---- /dev/null
-+++ b/drivers/net/ethernet/mediatek/mtk_usxgmii.c
-@@ -0,0 +1,690 @@
-+// SPDX-License-Identifier: GPL-2.0
-+/*
-+ * Copyright (c) 2023 MediaTek Inc.
-+ * Author: Henry Yen <henry.yen@mediatek.com>
-+ *         Daniel Golle <daniel@makrotopia.org>
-+ */
-+
-+#include <linux/mfd/syscon.h>
-+#include <linux/of.h>
-+#include <linux/regmap.h>
-+#include "mtk_eth_soc.h"
-+
-+static struct mtk_usxgmii_pcs *pcs_to_mtk_usxgmii_pcs(struct phylink_pcs *pcs)
-+{
-+      return container_of(pcs, struct mtk_usxgmii_pcs, pcs);
-+}
-+
-+static int mtk_xfi_pextp_init(struct mtk_eth *eth)
-+{
-+      struct device *dev = eth->dev;
-+      struct device_node *r = dev->of_node;
-+      struct device_node *np;
-+      int i;
-+
-+      for (i = 0; i < MTK_MAX_DEVS; i++) {
-+              np = of_parse_phandle(r, "mediatek,xfi-pextp", i);
-+              if (!np)
-+                      break;
-+
-+              eth->regmap_pextp[i] = syscon_node_to_regmap(np);
-+              if (IS_ERR(eth->regmap_pextp[i]))
-+                      return PTR_ERR(eth->regmap_pextp[i]);
-+      }
-+
-+      return 0;
-+}
-+
-+static int mtk_xfi_pll_init(struct mtk_eth *eth)
-+{
-+      struct device_node *r = eth->dev->of_node;
-+      struct device_node *np;
-+
-+      np = of_parse_phandle(r, "mediatek,xfi-pll", 0);
-+      if (!np)
-+              return -1;
-+
-+      eth->usxgmii_pll = syscon_node_to_regmap(np);
-+      if (IS_ERR(eth->usxgmii_pll))
-+              return PTR_ERR(eth->usxgmii_pll);
-+
-+      return 0;
-+}
-+
-+static int mtk_toprgu_init(struct mtk_eth *eth)
-+{
-+      struct device_node *r = eth->dev->of_node;
-+      struct device_node *np;
-+
-+      np = of_parse_phandle(r, "mediatek,toprgu", 0);
-+      if (!np)
-+              return -1;
-+
-+      eth->toprgu = syscon_node_to_regmap(np);
-+      if (IS_ERR(eth->toprgu))
-+              return PTR_ERR(eth->toprgu);
-+
-+      return 0;
-+}
-+
-+static int mtk_xfi_pll_enable(struct mtk_eth *eth)
-+{
-+      u32 val = 0;
-+
-+      if (!eth->usxgmii_pll)
-+              return -EINVAL;
-+
-+      /* Add software workaround for USXGMII PLL TCL issue */
-+      regmap_write(eth->usxgmii_pll, XFI_PLL_ANA_GLB8, RG_XFI_PLL_ANA_SWWA);
-+
-+      regmap_read(eth->usxgmii_pll, XFI_PLL_DIG_GLB8, &val);
-+      val |= RG_XFI_PLL_EN;
-+      regmap_write(eth->usxgmii_pll, XFI_PLL_DIG_GLB8, val);
-+
-+      return 0;
-+}
-+
-+static void mtk_usxgmii_setup_phya(struct regmap *pextp, phy_interface_t interface, int id)
-+{
-+      bool is_10g = (interface == PHY_INTERFACE_MODE_10GBASER ||
-+                     interface == PHY_INTERFACE_MODE_USXGMII);
-+      bool is_2p5g = (interface == PHY_INTERFACE_MODE_2500BASEX);
-+      bool is_5g = (interface == PHY_INTERFACE_MODE_5GBASER);
-+
-+      /* Setup operation mode */
-+      if (is_10g)
-+              regmap_write(pextp, 0x9024, 0x00C9071C);
-+      else
-+              regmap_write(pextp, 0x9024, 0x00D9071C);
-+
-+      if (is_5g)
-+              regmap_write(pextp, 0x2020, 0xAAA5A5AA);
-+      else
-+              regmap_write(pextp, 0x2020, 0xAA8585AA);
-+
-+      if (is_2p5g || is_5g || is_10g) {
-+              regmap_write(pextp, 0x2030, 0x0C020707);
-+              regmap_write(pextp, 0x2034, 0x0E050F0F);
-+              regmap_write(pextp, 0x2040, 0x00140032);
-+      } else {
-+              regmap_write(pextp, 0x2030, 0x0C020207);
-+              regmap_write(pextp, 0x2034, 0x0E05050F);
-+              regmap_write(pextp, 0x2040, 0x00200032);
-+      }
-+
-+      if (is_2p5g || is_10g)
-+              regmap_write(pextp, 0x50F0, 0x00C014AA);
-+      else if (is_5g)
-+              regmap_write(pextp, 0x50F0, 0x00C018AA);
-+      else
-+              regmap_write(pextp, 0x50F0, 0x00C014BA);
-+
-+      if (is_5g) {
-+              regmap_write(pextp, 0x50E0, 0x3777812B);
-+              regmap_write(pextp, 0x506C, 0x005C9CFF);
-+              regmap_write(pextp, 0x5070, 0x9DFAFAFA);
-+              regmap_write(pextp, 0x5074, 0x273F3F3F);
-+              regmap_write(pextp, 0x5078, 0xA8883868);
-+              regmap_write(pextp, 0x507C, 0x14661466);
-+      } else {
-+              regmap_write(pextp, 0x50E0, 0x3777C12B);
-+              regmap_write(pextp, 0x506C, 0x005F9CFF);
-+              regmap_write(pextp, 0x5070, 0x9D9DFAFA);
-+              regmap_write(pextp, 0x5074, 0x27273F3F);
-+              regmap_write(pextp, 0x5078, 0xA7883C68);
-+              regmap_write(pextp, 0x507C, 0x11661166);
-+      }
-+
-+      if (is_2p5g || is_10g) {
-+              regmap_write(pextp, 0x5080, 0x0E000AAF);
-+              regmap_write(pextp, 0x5084, 0x08080D0D);
-+              regmap_write(pextp, 0x5088, 0x02030909);
-+      } else if (is_5g) {
-+              regmap_write(pextp, 0x5080, 0x0E001ABF);
-+              regmap_write(pextp, 0x5084, 0x080B0D0D);
-+              regmap_write(pextp, 0x5088, 0x02050909);
-+      } else {
-+              regmap_write(pextp, 0x5080, 0x0E000EAF);
-+              regmap_write(pextp, 0x5084, 0x08080E0D);
-+              regmap_write(pextp, 0x5088, 0x02030B09);
-+      }
-+
-+      if (is_5g) {
-+              regmap_write(pextp, 0x50E4, 0x0C000000);
-+              regmap_write(pextp, 0x50E8, 0x04000000);
-+      } else {
-+              regmap_write(pextp, 0x50E4, 0x0C0C0000);
-+              regmap_write(pextp, 0x50E8, 0x04040000);
-+      }
-+
-+      if (is_2p5g || mtk_interface_mode_is_xgmii(interface))
-+              regmap_write(pextp, 0x50EC, 0x0F0F0C06);
-+      else
-+              regmap_write(pextp, 0x50EC, 0x0F0F0606);
-+
-+      if (is_5g) {
-+              regmap_write(pextp, 0x50A8, 0x50808C8C);
-+              regmap_write(pextp, 0x6004, 0x18000000);
-+      } else {
-+              regmap_write(pextp, 0x50A8, 0x506E8C8C);
-+              regmap_write(pextp, 0x6004, 0x18190000);
-+      }
-+
-+      if (is_10g)
-+              regmap_write(pextp, 0x00F8, 0x01423342);
-+      else if (is_5g)
-+              regmap_write(pextp, 0x00F8, 0x00A132A1);
-+      else if (is_2p5g)
-+              regmap_write(pextp, 0x00F8, 0x009C329C);
-+      else
-+              regmap_write(pextp, 0x00F8, 0x00FA32FA);
-+
-+      /* Force SGDT_OUT off and select PCS */
-+      if (mtk_interface_mode_is_xgmii(interface))
-+              regmap_write(pextp, 0x00F4, 0x80201F20);
-+      else
-+              regmap_write(pextp, 0x00F4, 0x80201F21);
-+
-+      /* Force GLB_CKDET_OUT */
-+      regmap_write(pextp, 0x0030, 0x00050C00);
-+
-+      /* Force AEQ on */
-+      regmap_write(pextp, 0x0070, 0x02002800);
-+      ndelay(1020);
-+
-+      /* Setup DA default value */
-+      regmap_write(pextp, 0x30B0, 0x00000020);
-+      regmap_write(pextp, 0x3028, 0x00008A01);
-+      regmap_write(pextp, 0x302C, 0x0000A884);
-+      regmap_write(pextp, 0x3024, 0x00083002);
-+      if (mtk_interface_mode_is_xgmii(interface)) {
-+              regmap_write(pextp, 0x3010, 0x00022220);
-+              regmap_write(pextp, 0x5064, 0x0F020A01);
-+              regmap_write(pextp, 0x50B4, 0x06100600);
-+              if (interface == PHY_INTERFACE_MODE_USXGMII)
-+                      regmap_write(pextp, 0x3048, 0x40704000);
-+              else
-+                      regmap_write(pextp, 0x3048, 0x47684100);
-+      } else {
-+              regmap_write(pextp, 0x3010, 0x00011110);
-+              regmap_write(pextp, 0x3048, 0x40704000);
-+      }
-+
-+      if (!mtk_interface_mode_is_xgmii(interface) && !is_2p5g)
-+              regmap_write(pextp, 0x3064, 0x0000C000);
-+
-+      if (interface == PHY_INTERFACE_MODE_USXGMII) {
-+              regmap_write(pextp, 0x3050, 0xA8000000);
-+              regmap_write(pextp, 0x3054, 0x000000AA);
-+      } else if (mtk_interface_mode_is_xgmii(interface)) {
-+              regmap_write(pextp, 0x3050, 0x00000000);
-+              regmap_write(pextp, 0x3054, 0x00000000);
-+      } else {
-+              regmap_write(pextp, 0x3050, 0xA8000000);
-+              regmap_write(pextp, 0x3054, 0x000000AA);
-+      }
-+
-+      if (mtk_interface_mode_is_xgmii(interface))
-+              regmap_write(pextp, 0x306C, 0x00000F00);
-+      else if (is_2p5g)
-+              regmap_write(pextp, 0x306C, 0x22000F00);
-+      else
-+              regmap_write(pextp, 0x306C, 0x20200F00);
-+
-+      if (interface == PHY_INTERFACE_MODE_10GBASER && id == 0)
-+              regmap_write(pextp, 0xA008, 0x0007B400);
-+
-+      if (mtk_interface_mode_is_xgmii(interface))
-+              regmap_write(pextp, 0xA060, 0x00040000);
-+      else
-+              regmap_write(pextp, 0xA060, 0x00050000);
-+
-+      if (is_10g)
-+              regmap_write(pextp, 0x90D0, 0x00000001);
-+      else if (is_5g)
-+              regmap_write(pextp, 0x90D0, 0x00000003);
-+      else if (is_2p5g)
-+              regmap_write(pextp, 0x90D0, 0x00000005);
-+      else
-+              regmap_write(pextp, 0x90D0, 0x00000007);
-+
-+      /* Release reset */
-+      regmap_write(pextp, 0x0070, 0x0200E800);
-+      usleep_range(150, 500);
-+
-+      /* Switch to P0 */
-+      regmap_write(pextp, 0x0070, 0x0200C111);
-+      ndelay(1020);
-+      regmap_write(pextp, 0x0070, 0x0200C101);
-+      usleep_range(15, 50);
-+
-+      if (mtk_interface_mode_is_xgmii(interface)) {
-+              /* Switch to Gen3 */
-+              regmap_write(pextp, 0x0070, 0x0202C111);
-+      } else {
-+              /* Switch to Gen2 */
-+              regmap_write(pextp, 0x0070, 0x0201C111);
-+      }
-+      ndelay(1020);
-+      if (mtk_interface_mode_is_xgmii(interface))
-+              regmap_write(pextp, 0x0070, 0x0202C101);
-+      else
-+              regmap_write(pextp, 0x0070, 0x0201C101);
-+      usleep_range(100, 500);
-+      regmap_write(pextp, 0x30B0, 0x00000030);
-+      if (mtk_interface_mode_is_xgmii(interface))
-+              regmap_write(pextp, 0x00F4, 0x80201F00);
-+      else
-+              regmap_write(pextp, 0x00F4, 0x80201F01);
-+
-+      regmap_write(pextp, 0x3040, 0x30000000);
-+      usleep_range(400, 1000);
-+}
-+
-+static void mtk_usxgmii_reset(struct mtk_eth *eth, int id)
-+{
-+      u32 toggle, val;
-+
-+      if (id >= MTK_MAX_DEVS || !eth->toprgu)
-+              return;
-+
-+      switch (id) {
-+      case 0:
-+              toggle = SWSYSRST_XFI_PEXPT0_GRST | SWSYSRST_XFI0_GRST |
-+                       SWSYSRST_SGMII0_GRST;
-+              break;
-+      case 1:
-+              toggle = SWSYSRST_XFI_PEXPT1_GRST | SWSYSRST_XFI1_GRST |
-+                       SWSYSRST_SGMII1_GRST;
-+              break;
-+      default:
-+              return;
-+      }
-+
-+      /* Enable software reset */
-+      regmap_set_bits(eth->toprgu, TOPRGU_SWSYSRST_EN, toggle);
-+
-+      /* Assert USXGMII reset */
-+      regmap_set_bits(eth->toprgu, TOPRGU_SWSYSRST,
-+                      FIELD_PREP(SWSYSRST_UNLOCK_KEY, 0x88) | toggle);
-+
-+      usleep_range(100, 500);
-+
-+      /* De-assert USXGMII reset */
-+      regmap_read(eth->toprgu, TOPRGU_SWSYSRST, &val);
-+      val |= FIELD_PREP(SWSYSRST_UNLOCK_KEY, 0x88);
-+      val &= ~toggle;
-+      regmap_write(eth->toprgu, TOPRGU_SWSYSRST, val);
-+
-+      /* Disable software reset */
-+      regmap_clear_bits(eth->toprgu, TOPRGU_SWSYSRST_EN, toggle);
-+
-+      mdelay(10);
-+}
-+
-+/* As the USXGMII PHYA is shared with the 1000Base-X/2500Base-X/Cisco SGMII unit
-+ * the psc-mtk-lynxi instance needs to be wrapped, so that calls to .pcs_config
-+ * also trigger an initial reset and subsequent configuration of the PHYA.
-+ */
-+struct mtk_sgmii_wrapper_pcs {
-+      struct mtk_eth          *eth;
-+      struct phylink_pcs      *wrapped_pcs;
-+      u8                      id;
-+      struct phylink_pcs      pcs;
-+};
-+
-+static int mtk_sgmii_wrapped_pcs_config(struct phylink_pcs *pcs,
-+                                      unsigned int mode,
-+                                      phy_interface_t interface,
-+                                      const unsigned long *advertising,
-+                                      bool permit_pause_to_mac)
-+{
-+      struct mtk_sgmii_wrapper_pcs *wp = container_of(pcs, struct mtk_sgmii_wrapper_pcs, pcs);
-+      bool full_reconf;
-+      int ret;
-+
-+      full_reconf = interface != wp->eth->usxgmii_pcs[wp->id]->interface;
-+      if (full_reconf) {
-+              mtk_xfi_pll_enable(wp->eth);
-+              mtk_usxgmii_reset(wp->eth, wp->id);
-+      }
-+
-+      ret = wp->wrapped_pcs->ops->pcs_config(wp->wrapped_pcs, mode, interface,
-+                                             advertising, permit_pause_to_mac);
-+
-+      if (full_reconf)
-+              mtk_usxgmii_setup_phya(wp->eth->regmap_pextp[wp->id], interface, wp->id);
-+
-+      wp->eth->usxgmii_pcs[wp->id]->interface = interface;
-+
-+      return ret;
-+}
-+
-+static void mtk_sgmii_wrapped_pcs_get_state(struct phylink_pcs *pcs,
-+                                          struct phylink_link_state *state)
-+{
-+      struct mtk_sgmii_wrapper_pcs *wp = container_of(pcs, struct mtk_sgmii_wrapper_pcs, pcs);
-+
-+      return wp->wrapped_pcs->ops->pcs_get_state(wp->wrapped_pcs, state);
-+}
-+
-+static void mtk_sgmii_wrapped_pcs_an_restart(struct phylink_pcs *pcs)
-+{
-+      struct mtk_sgmii_wrapper_pcs *wp = container_of(pcs, struct mtk_sgmii_wrapper_pcs, pcs);
-+
-+      wp->wrapped_pcs->ops->pcs_an_restart(wp->wrapped_pcs);
-+}
-+
-+static void mtk_sgmii_wrapped_pcs_link_up(struct phylink_pcs *pcs,
-+                                        unsigned int mode,
-+                                        phy_interface_t interface, int speed,
-+                                        int duplex)
-+{
-+      struct mtk_sgmii_wrapper_pcs *wp = container_of(pcs, struct mtk_sgmii_wrapper_pcs, pcs);
-+
-+      wp->wrapped_pcs->ops->pcs_link_up(wp->wrapped_pcs, mode, interface, speed, duplex);
-+}
-+
-+static void mtk_sgmii_wrapped_pcs_disable(struct phylink_pcs *pcs)
-+{
-+      struct mtk_sgmii_wrapper_pcs *wp = container_of(pcs, struct mtk_sgmii_wrapper_pcs, pcs);
-+
-+      wp->wrapped_pcs->ops->pcs_disable(wp->wrapped_pcs);
-+
-+      wp->eth->usxgmii_pcs[wp->id]->interface = PHY_INTERFACE_MODE_NA;
-+}
-+
-+static const struct phylink_pcs_ops mtk_sgmii_wrapped_pcs_ops = {
-+      .pcs_get_state = mtk_sgmii_wrapped_pcs_get_state,
-+      .pcs_config = mtk_sgmii_wrapped_pcs_config,
-+      .pcs_an_restart = mtk_sgmii_wrapped_pcs_an_restart,
-+      .pcs_link_up = mtk_sgmii_wrapped_pcs_link_up,
-+      .pcs_disable = mtk_sgmii_wrapped_pcs_disable,
-+};
-+
-+static int mtk_sgmii_wrapper_init(struct mtk_eth *eth)
-+{
-+      struct mtk_sgmii_wrapper_pcs *wp;
-+      int i;
-+
-+      for (i = 0; i < MTK_MAX_DEVS; i++) {
-+              if (!eth->sgmii_pcs[i])
-+                      continue;
-+
-+              if (!eth->usxgmii_pcs[i])
-+                      continue;
-+
-+              /* Make sure all PCS ops are supported by wrapped PCS */
-+              if (!eth->sgmii_pcs[i]->ops->pcs_get_state ||
-+                  !eth->sgmii_pcs[i]->ops->pcs_config ||
-+                  !eth->sgmii_pcs[i]->ops->pcs_an_restart ||
-+                  !eth->sgmii_pcs[i]->ops->pcs_link_up ||
-+                  !eth->sgmii_pcs[i]->ops->pcs_disable)
-+                      return -EOPNOTSUPP;
-+
-+              wp = devm_kzalloc(eth->dev, sizeof(*wp), GFP_KERNEL);
-+              if (!wp)
-+                      return -ENOMEM;
-+
-+              wp->wrapped_pcs = eth->sgmii_pcs[i];
-+              wp->id = i;
-+              wp->pcs.poll = true;
-+              wp->pcs.ops = &mtk_sgmii_wrapped_pcs_ops;
-+              wp->eth = eth;
-+
-+              eth->usxgmii_pcs[i]->wrapped_sgmii_pcs = &wp->pcs;
-+      }
-+
-+      return 0;
-+}
-+
-+struct phylink_pcs *mtk_sgmii_wrapper_select_pcs(struct mtk_eth *eth, int mac_id)
-+{
-+      u32 xgmii_id = mtk_mac2xgmii_id(eth, mac_id);
-+
-+      if (!eth->usxgmii_pcs[xgmii_id])
-+              return NULL;
-+
-+      return eth->usxgmii_pcs[xgmii_id]->wrapped_sgmii_pcs;
-+}
-+
-+static int mtk_usxgmii_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
-+                                phy_interface_t interface,
-+                                const unsigned long *advertising,
-+                                bool permit_pause_to_mac)
-+{
-+      struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
-+      struct mtk_eth *eth = mpcs->eth;
-+      struct regmap *pextp = eth->regmap_pextp[mpcs->id];
-+      unsigned int an_ctrl = 0, link_timer = 0, xfi_mode = 0, adapt_mode = 0;
-+      bool mode_changed = false;
-+
-+      if (!pextp)
-+              return -ENODEV;
-+
-+      if (interface == PHY_INTERFACE_MODE_USXGMII) {
-+              an_ctrl = FIELD_PREP(USXGMII_AN_SYNC_CNT, 0x1FF) | USXGMII_AN_ENABLE;
-+              link_timer = FIELD_PREP(USXGMII_LINK_TIMER_IDLE_DETECT, 0x7B) |
-+                           FIELD_PREP(USXGMII_LINK_TIMER_COMP_ACK_DETECT, 0x7B) |
-+                           FIELD_PREP(USXGMII_LINK_TIMER_AN_RESTART, 0x7B);
-+              xfi_mode = FIELD_PREP(USXGMII_XFI_RX_MODE, USXGMII_XFI_RX_MODE_10G) |
-+                         FIELD_PREP(USXGMII_XFI_TX_MODE, USXGMII_XFI_TX_MODE_10G);
-+      } else if (interface == PHY_INTERFACE_MODE_10GBASER) {
-+              an_ctrl = FIELD_PREP(USXGMII_AN_SYNC_CNT, 0x1FF);
-+              link_timer = FIELD_PREP(USXGMII_LINK_TIMER_IDLE_DETECT, 0x7B) |
-+                           FIELD_PREP(USXGMII_LINK_TIMER_COMP_ACK_DETECT, 0x7B) |
-+                           FIELD_PREP(USXGMII_LINK_TIMER_AN_RESTART, 0x7B);
-+              xfi_mode = FIELD_PREP(USXGMII_XFI_RX_MODE, USXGMII_XFI_RX_MODE_10G) |
-+                         FIELD_PREP(USXGMII_XFI_TX_MODE, USXGMII_XFI_TX_MODE_10G);
-+              adapt_mode = USXGMII_RATE_UPDATE_MODE;
-+      } else if (interface == PHY_INTERFACE_MODE_5GBASER) {
-+              an_ctrl = FIELD_PREP(USXGMII_AN_SYNC_CNT, 0xFF);
-+              link_timer = FIELD_PREP(USXGMII_LINK_TIMER_IDLE_DETECT, 0x3D) |
-+                           FIELD_PREP(USXGMII_LINK_TIMER_COMP_ACK_DETECT, 0x3D) |
-+                           FIELD_PREP(USXGMII_LINK_TIMER_AN_RESTART, 0x3D);
-+              xfi_mode = FIELD_PREP(USXGMII_XFI_RX_MODE, USXGMII_XFI_RX_MODE_5G) |
-+                         FIELD_PREP(USXGMII_XFI_TX_MODE, USXGMII_XFI_TX_MODE_5G);
-+              adapt_mode = USXGMII_RATE_UPDATE_MODE;
-+      } else {
-+              return -EINVAL;
-+      }
-+
-+      adapt_mode |= FIELD_PREP(USXGMII_RATE_ADAPT_MODE, USXGMII_RATE_ADAPT_MODE_X1);
-+
-+      if (mpcs->interface != interface) {
-+              mpcs->interface = interface;
-+              mode_changed = true;
-+      }
-+
-+      mtk_xfi_pll_enable(eth);
-+      mtk_usxgmii_reset(eth, mpcs->id);
-+
-+      /* Setup USXGMII AN ctrl */
-+      regmap_update_bits(mpcs->regmap, RG_PCS_AN_CTRL0,
-+                         USXGMII_AN_SYNC_CNT | USXGMII_AN_ENABLE,
-+                         an_ctrl);
-+
-+      regmap_update_bits(mpcs->regmap, RG_PCS_AN_CTRL2,
-+                         USXGMII_LINK_TIMER_IDLE_DETECT |
-+                         USXGMII_LINK_TIMER_COMP_ACK_DETECT |
-+                         USXGMII_LINK_TIMER_AN_RESTART,
-+                         link_timer);
-+
-+      mpcs->mode = mode;
-+
-+      /* Gated MAC CK */
-+      regmap_update_bits(mpcs->regmap, RG_PHY_TOP_SPEED_CTRL1,
-+                         USXGMII_MAC_CK_GATED, USXGMII_MAC_CK_GATED);
-+
-+      /* Enable interface force mode */
-+      regmap_update_bits(mpcs->regmap, RG_PHY_TOP_SPEED_CTRL1,
-+                         USXGMII_IF_FORCE_EN, USXGMII_IF_FORCE_EN);
-+
-+      /* Setup USXGMII adapt mode */
-+      regmap_update_bits(mpcs->regmap, RG_PHY_TOP_SPEED_CTRL1,
-+                         USXGMII_RATE_UPDATE_MODE | USXGMII_RATE_ADAPT_MODE,
-+                         adapt_mode);
-+
-+      /* Setup USXGMII speed */
-+      regmap_update_bits(mpcs->regmap, RG_PHY_TOP_SPEED_CTRL1,
-+                         USXGMII_XFI_RX_MODE | USXGMII_XFI_TX_MODE,
-+                         xfi_mode);
-+
-+      usleep_range(1, 10);
-+
-+      /* Un-gated MAC CK */
-+      regmap_update_bits(mpcs->regmap, RG_PHY_TOP_SPEED_CTRL1,
-+                         USXGMII_MAC_CK_GATED, 0);
-+
-+      usleep_range(1, 10);
-+
-+      /* Disable interface force mode for the AN mode */
-+      if (an_ctrl & USXGMII_AN_ENABLE)
-+              regmap_update_bits(mpcs->regmap, RG_PHY_TOP_SPEED_CTRL1,
-+                                 USXGMII_IF_FORCE_EN, 0);
-+
-+      /* Setup USXGMIISYS with the determined property */
-+      mtk_usxgmii_setup_phya(pextp, interface, mpcs->id);
-+
-+      return mode_changed;
-+}
-+
-+static void mtk_usxgmii_pcs_get_state(struct phylink_pcs *pcs,
-+                                    struct phylink_link_state *state)
-+{
-+      struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
-+      struct mtk_eth *eth = mpcs->eth;
-+      struct mtk_mac *mac = eth->mac[mtk_xgmii2mac_id(eth, mpcs->id)];
-+      u32 val = 0;
-+
-+      regmap_read(mpcs->regmap, RG_PCS_AN_CTRL0, &val);
-+      if (FIELD_GET(USXGMII_AN_ENABLE, val)) {
-+              /* Refresh LPA by inverting LPA_LATCH */
-+              regmap_read(mpcs->regmap, RG_PCS_AN_STS0, &val);
-+              regmap_update_bits(mpcs->regmap, RG_PCS_AN_STS0,
-+                                 USXGMII_LPA_LATCH,
-+                                 !(val & USXGMII_LPA_LATCH));
-+
-+              regmap_read(mpcs->regmap, RG_PCS_AN_STS0, &val);
-+
-+              phylink_decode_usxgmii_word(state, FIELD_GET(USXGMII_PCS_AN_WORD,
-+                                                           val));
-+
-+              state->interface = mpcs->interface;
-+      } else {
-+              val = mtk_r32(mac->hw, MTK_XGMAC_STS(mac->id));
-+
-+              if (mac->id == MTK_GMAC2_ID)
-+                      val >>= 16;
-+
-+              switch (FIELD_GET(MTK_USXGMII_PCS_MODE, val)) {
-+              case 0:
-+                      state->speed = SPEED_10000;
-+                      break;
-+              case 1:
-+                      state->speed = SPEED_5000;
-+                      break;
-+              case 2:
-+                      state->speed = SPEED_2500;
-+                      break;
-+              case 3:
-+                      state->speed = SPEED_1000;
-+                      break;
-+              }
-+
-+              state->interface = mpcs->interface;
-+              state->link = FIELD_GET(MTK_USXGMII_PCS_LINK, val);
-+              state->duplex = DUPLEX_FULL;
-+      }
-+
-+      /* Continuously repeat re-configuration sequence until link comes up */
-+      if (state->link == 0)
-+              mtk_usxgmii_pcs_config(pcs, mpcs->mode,
-+                                     state->interface, NULL, false);
-+}
-+
-+static void mtk_usxgmii_pcs_restart_an(struct phylink_pcs *pcs)
-+{
-+      struct mtk_usxgmii_pcs *mpcs = pcs_to_mtk_usxgmii_pcs(pcs);
-+      unsigned int val = 0;
-+
-+      if (!mpcs->regmap)
-+              return;
-+
-+      regmap_read(mpcs->regmap, RG_PCS_AN_CTRL0, &val);
-+      val |= USXGMII_AN_RESTART;
-+      regmap_write(mpcs->regmap, RG_PCS_AN_CTRL0, val);
-+}
-+
-+static void mtk_usxgmii_pcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
-+                                  phy_interface_t interface,
-+                                  int speed, int duplex)
-+{
-+      /* Reconfiguring USXGMII to ensure the quality of the RX signal
-+       * after the line side link up.
-+       */
-+      mtk_usxgmii_pcs_config(pcs, mode,
-+                             interface, NULL, false);
-+}
-+
-+static const struct phylink_pcs_ops mtk_usxgmii_pcs_ops = {
-+      .pcs_config = mtk_usxgmii_pcs_config,
-+      .pcs_get_state = mtk_usxgmii_pcs_get_state,
-+      .pcs_an_restart = mtk_usxgmii_pcs_restart_an,
-+      .pcs_link_up = mtk_usxgmii_pcs_link_up,
-+};
-+
-+int mtk_usxgmii_init(struct mtk_eth *eth)
-+{
-+      struct device_node *r = eth->dev->of_node;
-+      struct device *dev = eth->dev;
-+      struct device_node *np;
-+      int i, ret;
-+
-+      for (i = 0; i < MTK_MAX_DEVS; i++) {
-+              np = of_parse_phandle(r, "mediatek,usxgmiisys", i);
-+              if (!np)
-+                      break;
-+
-+              eth->usxgmii_pcs[i] = devm_kzalloc(dev, sizeof(*eth->usxgmii_pcs[i]), GFP_KERNEL);
-+              if (!eth->usxgmii_pcs[i])
-+                      return -ENOMEM;
-+
-+              eth->usxgmii_pcs[i]->id = i;
-+              eth->usxgmii_pcs[i]->eth = eth;
-+              eth->usxgmii_pcs[i]->regmap = syscon_node_to_regmap(np);
-+              if (IS_ERR(eth->usxgmii_pcs[i]->regmap))
-+                      return PTR_ERR(eth->usxgmii_pcs[i]->regmap);
-+
-+              eth->usxgmii_pcs[i]->pcs.ops = &mtk_usxgmii_pcs_ops;
-+              eth->usxgmii_pcs[i]->pcs.poll = true;
-+              eth->usxgmii_pcs[i]->interface = PHY_INTERFACE_MODE_NA;
-+              eth->usxgmii_pcs[i]->mode = -1;
-+
-+              of_node_put(np);
-+      }
-+
-+      ret = mtk_xfi_pextp_init(eth);
-+      if (ret)
-+              return ret;
-+
-+      ret = mtk_xfi_pll_init(eth);
-+      if (ret)
-+              return ret;
-+
-+      ret = mtk_toprgu_init(eth);
-+      if (ret)
-+              return ret;
-+
-+      return mtk_sgmii_wrapper_init(eth);
-+}
-+
-+struct phylink_pcs *mtk_usxgmii_select_pcs(struct mtk_eth *eth, int mac_id)
-+{
-+      u32 xgmii_id = mtk_mac2xgmii_id(eth, mac_id);
-+
-+      if (!eth->usxgmii_pcs[xgmii_id]->regmap)
-+              return NULL;
-+
-+      return &eth->usxgmii_pcs[xgmii_id]->pcs;
-+}
index 8e2f3a9475d7cb02b8eaeca85bd2bd3363ed7156..54c07f0022ab6472cfc8b1e085d708004dc554fd 100644 (file)
@@ -17,7 +17,7 @@ Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
 
 --- a/net/core/skbuff.c
 +++ b/net/core/skbuff.c
-@@ -4359,6 +4359,15 @@ int skb_gro_receive(struct sk_buff *p, s
+@@ -4360,6 +4360,15 @@ int skb_gro_receive(struct sk_buff *p, s
        if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
                return -E2BIG;
  
index 2f6e96b768752837f1bbd0e395322d6a64e024bc..a8634afba87e6cdfe6e6f954c5ed6b4978b3d7a2 100644 (file)
@@ -162,7 +162,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
                    int (*poll)(struct napi_struct *, int), int weight)
  {
-@@ -11381,6 +11456,9 @@ static int dev_cpu_dead(unsigned int old
+@@ -11384,6 +11459,9 @@ static int dev_cpu_dead(unsigned int old
        raise_softirq_irqoff(NET_TX_SOFTIRQ);
        local_irq_enable();
  
@@ -172,7 +172,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #ifdef CONFIG_RPS
        remsd = oldsd->rps_ipi_list;
        oldsd->rps_ipi_list = NULL;
-@@ -11720,6 +11798,7 @@ static int __init net_dev_init(void)
+@@ -11723,6 +11801,7 @@ static int __init net_dev_init(void)
                sd->cpu = i;
  #endif
  
index 98fd6e9c7a7c1d23d42a82671a5e53d3cbf9cc48..06546b79e3231372821587a8b010c698bdaad54c 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2129,10 +2129,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr
+@@ -2335,10 +2335,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr
  {
        struct dsa_switch *ds = priv->ds;
        struct device *dev = priv->dev;
@@ -30,7 +30,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
        bus = devm_mdiobus_alloc(dev);
        if (!bus)
                return -ENOMEM;
-@@ -2149,7 +2152,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr
+@@ -2355,7 +2358,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr
        if (priv->irq)
                mt7530_setup_mdio_irq(priv);
  
index f7f16ee37d7ed025abcbe8ab710d26fadb63ed5f..302051cc3be8ac2b8ff4ec1a0b39cb91a0452cf5 100644 (file)
@@ -25,7 +25,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  
 --- a/drivers/pci/quirks.c
 +++ b/drivers/pci/quirks.c
-@@ -206,6 +206,7 @@ static void quirk_mmio_always_on(struct
+@@ -207,6 +207,7 @@ static void quirk_mmio_always_on(struct
  DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID,
                                PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on);
  
@@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  /*
   * The Mellanox Tavor device gives false positive parity errors.  Disable
   * parity error reporting.
-@@ -3368,6 +3369,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
+@@ -3369,6 +3370,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata);
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata);
  
@@ -42,7 +42,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  /*
   * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum.
   * To work around this, query the size it should be configured to by the
-@@ -3393,6 +3396,8 @@ static void quirk_intel_ntb(struct pci_d
+@@ -3394,6 +3397,8 @@ static void quirk_intel_ntb(struct pci_d
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e08, quirk_intel_ntb);
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0e0d, quirk_intel_ntb);
  
@@ -51,7 +51,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  /*
   * Some BIOS implementations leave the Intel GPU interrupts enabled, even
   * though no one is handling them (e.g., if the i915 driver is never
-@@ -3431,6 +3436,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
+@@ -3432,6 +3437,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
  
index 2bd7b222968f147789aae9d6fdfeec25d1274f3a..8666c799c41298a206c13cdcec128a9b21f2d3f1 100644 (file)
@@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
        help
 --- a/init/main.c
 +++ b/init/main.c
-@@ -618,6 +618,29 @@ static inline void setup_nr_cpu_ids(void
+@@ -619,6 +619,29 @@ static inline void setup_nr_cpu_ids(void
  static inline void smp_prepare_cpus(unsigned int maxcpus) { }
  #endif
  
@@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
  /*
   * We need to store the untouched command line for future reference.
   * We also need to store the touched command line since the parameter
-@@ -957,6 +980,7 @@ asmlinkage __visible void __init __no_sa
+@@ -958,6 +981,7 @@ asmlinkage __visible void __init __no_sa
        pr_notice("%s", linux_banner);
        early_security_init();
        setup_arch(&command_line);