]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
generic: 6.18: manually rebuild pending patches
authorMieczyslaw Nalewaj <namiltd@yahoo.com>
Sat, 27 Dec 2025 13:27:14 +0000 (14:27 +0100)
committerRobert Marko <robimarko@gmail.com>
Sat, 28 Mar 2026 10:51:09 +0000 (11:51 +0100)
Manually rebuild pending patches:
 - 203-kallsyms_uncompressed.patch
 - 417-mtd-spi-nand-macronix-disable-continuous-read-for-MX.patch
 - 487-mtd-spinand-Add-support-for-Etron-EM73D044VCx.patch
 - 530-jffs2_make_lzma_available.patch
 - 681-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch
 - 701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch
 - 710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch
 - 732-03-net-ethernet-mtk_eth_soc-optimize-dma-ring-address-i.patch
 - 737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch
 - 739-03-net-pcs-pcs-mtk-lynxi-add-platform-driver-for-MT7988.patch
 - 739-05-net-pcs-add-driver-for-MediaTek-USXGMII-PCS.patch
 - 802-OPP-Provide-old-opp-to-config_clks-on-_set_opp.patch
 - 812-PCI-sysfs-enforce-single-creation-of-sysfs-entry-for.patch
 - 850-0023-PCI-aardvark-Make-main-irq_chip-structure-a-static-d.patch

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/21078
Signed-off-by: Robert Marko <robimarko@gmail.com>
14 files changed:
target/linux/generic/pending-6.18/203-kallsyms_uncompressed.patch
target/linux/generic/pending-6.18/417-mtd-spi-nand-macronix-disable-continuous-read-for-MX.patch
target/linux/generic/pending-6.18/487-mtd-spinand-Add-support-for-Etron-EM73D044VCx.patch
target/linux/generic/pending-6.18/530-jffs2_make_lzma_available.patch
target/linux/generic/pending-6.18/681-net-remove-NETIF_F_GSO_FRAGLIST-from-NETIF_F_GSO_SOF.patch
target/linux/generic/pending-6.18/701-netfilter-nf_tables-ignore-EOPNOTSUPP-on-flowtable-d.patch
target/linux/generic/pending-6.18/710-bridge-add-knob-for-filtering-rx-tx-BPDU-pack.patch
target/linux/generic/pending-6.18/732-03-net-ethernet-mtk_eth_soc-optimize-dma-ring-address-i.patch
target/linux/generic/pending-6.18/737-net-ethernet-mtk_eth_soc-add-paths-and-SerDes-modes-.patch
target/linux/generic/pending-6.18/739-03-net-pcs-pcs-mtk-lynxi-add-platform-driver-for-MT7988.patch
target/linux/generic/pending-6.18/739-05-net-pcs-add-driver-for-MediaTek-USXGMII-PCS.patch
target/linux/generic/pending-6.18/802-OPP-Provide-old-opp-to-config_clks-on-_set_opp.patch
target/linux/generic/pending-6.18/812-PCI-sysfs-enforce-single-creation-of-sysfs-entry-for.patch
target/linux/generic/pending-6.18/850-0023-PCI-aardvark-Make-main-irq_chip-structure-a-static-d.patch

index 40de8f6072d1aa57ac9eafd20bc06709a2598c1e..9ec3fdeffad0a4d86099dd8fbfbb3375a756a681 100644 (file)
@@ -14,9 +14,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/init/Kconfig
 +++ b/init/Kconfig
-@@ -1534,6 +1534,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
-         the unaligned access emulation.
-         see arch/parisc/kernel/unaligned.c for reference
+@@ -1625,6 +1625,17 @@ config SYSFS_SYSCALL
+         If unsure say N here.
  
 +config KALLSYMS_UNCOMPRESSED
 +      bool "Keep kallsyms uncompressed"
@@ -58,7 +58,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
         * and return the first char from this token. If MSB of length
 --- a/kernel/vmcore_info.c
 +++ b/kernel/vmcore_info.c
-@@ -214,8 +214,10 @@ static int __init crash_save_vmcoreinfo_
+@@ -218,8 +218,10 @@ static int __init crash_save_vmcoreinfo_
  #ifdef CONFIG_KALLSYMS
        VMCOREINFO_SYMBOL(kallsyms_names);
        VMCOREINFO_SYMBOL(kallsyms_num_syms);
@@ -71,15 +71,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #endif /* CONFIG_KALLSYMS */
 --- a/scripts/kallsyms.c
 +++ b/scripts/kallsyms.c
-@@ -62,6 +62,7 @@ static struct addr_range percpu_range =
+@@ -57,6 +57,7 @@ static struct addr_range text_ranges[] =
  static struct sym_entry **table;
  static unsigned int table_size, table_cnt;
  static int all_symbols;
 +static int uncompressed;
- static int absolute_percpu;
  
  static int token_profit[0x10000];
-@@ -412,13 +413,17 @@ static void write_src(void)
+@@ -399,13 +400,17 @@ static void write_src(void)
                for (k = 0; k < table[i]->len; k++)
                        printf(", 0x%02x", table[i]->sym[k]);
  
@@ -104,7 +104,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        }
        printf("\n");
  
-@@ -429,20 +434,22 @@ static void write_src(void)
+@@ -416,20 +421,22 @@ static void write_src(void)
  
        free(markers);
  
@@ -140,7 +140,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        output_label("kallsyms_offsets");
  
-@@ -532,6 +539,9 @@ static unsigned char *find_token(unsigne
+@@ -508,6 +515,9 @@ static unsigned char *find_token(unsigne
  {
        int i;
  
@@ -150,7 +150,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        for (i = 0; i < len - 1; i++) {
                if (str[i] == token[0] && str[i+1] == token[1])
                        return &str[i];
-@@ -604,6 +614,9 @@ static void optimize_result(void)
+@@ -580,6 +590,9 @@ static void optimize_result(void)
  {
        int i, best;
  
@@ -160,18 +160,18 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        /* using the '\0' symbol last allows compress_symbols to use standard
         * fast string functions */
        for (i = 255; i >= 0; i--) {
-@@ -763,6 +776,7 @@ int main(int argc, char **argv)
+@@ -717,6 +730,7 @@ int main(int argc, char **argv)
+       while (1) {
                static const struct option long_options[] = {
                        {"all-symbols",     no_argument, &all_symbols,     1},
-                       {"absolute-percpu", no_argument, &absolute_percpu, 1},
 +                      {"uncompressed",   no_argument, &uncompressed,   1},
                        {},
                };
  
 --- a/scripts/link-vmlinux.sh
 +++ b/scripts/link-vmlinux.sh
-@@ -144,6 +144,10 @@ kallsyms()
-               kallsymopt="${kallsymopt} --absolute-percpu"
+@@ -142,6 +142,10 @@ kallsyms()
+               kallsymopt="${kallsymopt} --all-symbols"
        fi
  
 +      if is_enabled CONFIG_KALLSYMS_UNCOMPRESSED; then
index 65531e099d2bde3e94cdd7f8d33d46aced04d5e7..f85960464f8c913669b9607e95356825fc4cfe1a 100644 (file)
@@ -17,23 +17,19 @@ Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
 
 --- a/drivers/mtd/nand/spi/macronix.c
 +++ b/drivers/mtd/nand/spi/macronix.c
-@@ -167,8 +167,7 @@ static const struct spinand_info macroni
-                                             &update_cache_variants),
+@@ -187,7 +187,6 @@ static const struct spinand_info macroni
                     SPINAND_HAS_QE_BIT,
                     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
--                                   macronix_ecc_get_status),
--                   SPINAND_CONT_READ(macronix_set_cont_read)),
-+                                   macronix_ecc_get_status)),
+                                    macronix_ecc_get_status),
+-                   SPINAND_CONT_READ(macronix_set_cont_read),
+                    SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
+                                       macronix_set_read_retry)),
        SPINAND_INFO("MX35LF4GE4AD",
-                    SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x37, 0x03),
-                    NAND_MEMORG(1, 4096, 128, 64, 2048, 40, 1, 1, 1),
-@@ -178,8 +177,7 @@ static const struct spinand_info macroni
-                                             &update_cache_variants),
+@@ -200,7 +199,6 @@ static const struct spinand_info macroni
                     SPINAND_HAS_QE_BIT,
                     SPINAND_ECCINFO(&mx35lfxge4ab_ooblayout,
--                                   macronix_ecc_get_status),
--                   SPINAND_CONT_READ(macronix_set_cont_read)),
-+                                   macronix_ecc_get_status)),
+                                    macronix_ecc_get_status),
+-                   SPINAND_CONT_READ(macronix_set_cont_read),
+                    SPINAND_READ_RETRY(MACRONIX_NUM_READ_RETRY_MODES,
+                                       macronix_set_read_retry)),
        SPINAND_INFO("MX35LF1G24AD",
-                    SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x14, 0x03),
-                    NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
index 65d838402378961068e557ae1a474feec8a21e6f..486d7a004dc89fdd454406d736f97e35c365b98a 100644 (file)
@@ -40,16 +40,17 @@ Submitted-by: Daniel Danzberger <daniel@dd-wrt.com>
 
 --- a/drivers/mtd/nand/spi/Makefile
 +++ b/drivers/mtd/nand/spi/Makefile
-@@ -1,4 +1,4 @@
+@@ -1,5 +1,5 @@
  # SPDX-License-Identifier: GPL-2.0
--spinand-objs := core.o alliancememory.o ato.o esmt.o fmsh.o foresee.o gigadevice.o macronix.o
+ spinand-objs := core.o otp.o
+-spinand-objs += alliancememory.o ato.o esmt.o fmsh.o foresee.o gigadevice.o macronix.o
 -spinand-objs += micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o
-+spinand-objs := core.o alliancememory.o ato.o esmt.o etron.o fmsh.o foresee.o gigadevice.o
++spinand-objs += alliancememory.o ato.o esmt.o etron.o fmsh.o foresee.o gigadevice.o
 +spinand-objs += macronix.o micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o
  obj-$(CONFIG_MTD_SPI_NAND) += spinand.o
 --- a/drivers/mtd/nand/spi/core.c
 +++ b/drivers/mtd/nand/spi/core.c
-@@ -1186,6 +1186,7 @@ static const struct spinand_manufacturer
+@@ -1237,6 +1237,7 @@ static const struct spinand_manufacturer
        &ato_spinand_manufacturer,
        &esmt_8c_spinand_manufacturer,
        &esmt_c8_spinand_manufacturer,
@@ -70,20 +71,20 @@ Submitted-by: Daniel Danzberger <daniel@dd-wrt.com>
 +
 +
 +static SPINAND_OP_VARIANTS(read_cache_variants,
-+              SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0),
-+              SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
-+              SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0),
-+              SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
-+              SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
-+              SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
++              SPINAND_PAGE_READ_FROM_CACHE_1S_4S_4S_OP(0, 1, NULL, 0, 0),
++              SPINAND_PAGE_READ_FROM_CACHE_1S_1S_4S_OP(0, 1, NULL, 0, 0),
++              SPINAND_PAGE_READ_FROM_CACHE_1S_2S_2S_OP(0, 1, NULL, 0, 0),
++              SPINAND_PAGE_READ_FROM_CACHE_1S_1S_2S_OP(0, 1, NULL, 0, 0),
++              SPINAND_PAGE_READ_FROM_CACHE_FAST_1S_1S_1S_OP(0, 1, NULL, 0, 0),
++              SPINAND_PAGE_READ_FROM_CACHE_1S_1S_1S_OP(0, 1, NULL, 0, 0));
 +
 +static SPINAND_OP_VARIANTS(write_cache_variants,
-+              SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
-+              SPINAND_PROG_LOAD(true, 0, NULL, 0));
++              SPINAND_PROG_LOAD_1S_1S_4S_OP(true, 0, NULL, 0),
++              SPINAND_PROG_LOAD_1S_1S_1S_OP(true, 0, NULL, 0));
 +
 +static SPINAND_OP_VARIANTS(update_cache_variants,
-+              SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
-+              SPINAND_PROG_LOAD(false, 0, NULL, 0));
++              SPINAND_PROG_LOAD_1S_1S_4S_OP(false, 0, NULL, 0),
++              SPINAND_PROG_LOAD_1S_1S_1S_OP(false, 0, NULL, 0));
 +
 +static int etron_ooblayout_ecc(struct mtd_info *mtd, int section,
 +                                      struct mtd_oob_region *oobregion)
@@ -160,7 +161,7 @@ Submitted-by: Daniel Danzberger <daniel@dd-wrt.com>
 +};
 --- a/include/linux/mtd/spinand.h
 +++ b/include/linux/mtd/spinand.h
-@@ -264,6 +264,7 @@ extern const struct spinand_manufacturer
+@@ -356,6 +356,7 @@ extern const struct spinand_manufacturer
  extern const struct spinand_manufacturer ato_spinand_manufacturer;
  extern const struct spinand_manufacturer esmt_8c_spinand_manufacturer;
  extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer;
index 213e6f1f24553b52a07b06cfc379b8d10811b7f5..457c30ea5569abe83a73310b042258854917d721 100644 (file)
@@ -321,7 +321,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +      #include <stdlib.h>
 +      #include <stdio.h>
 +      #include <unistd.h>
-+      #include <string.h>
++      #include <linux/string.h>
 +      #include <asm/types.h>
 +      #include <errno.h>
 +      #include <linux/jffs2.h>
@@ -336,8 +336,8 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +      #define STATIC
 +#endif
 +
-+#include "lzma/LzmaDec.h"
-+#include "lzma/LzmaEnc.h"
++#include <linux/lzma/LzmaDec.h>
++#include <linux/lzma/LzmaEnc.h>
 +
 +#define LZMA_BEST_LEVEL (9)
 +#define LZMA_BEST_LC    (0)
@@ -858,14 +858,15 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +#endif
 --- /dev/null
 +++ b/include/linux/lzma/Types.h
-@@ -0,0 +1,226 @@
+@@ -0,0 +1,227 @@
 +/* Types.h -- Basic types
 +2009-11-23 : Igor Pavlov : Public domain */
 +
 +#ifndef __7Z_TYPES_H
 +#define __7Z_TYPES_H
 +
-+#include <stddef.h>
++#include <linux/types.h>
++#include <linux/stddef.h>
 +
 +#ifdef _WIN32
 +#include <windows.h>
@@ -1097,7 +1098,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
  #define JFFS2_NODE_ACCURATE 0x2000
 --- a/lib/Kconfig
 +++ b/lib/Kconfig
-@@ -353,6 +353,12 @@ config ZSTD_DECOMPRESS
+@@ -216,6 +216,12 @@ config ZSTD_DECOMPRESS
  
  source "lib/xz/Kconfig"
  
@@ -1112,7 +1113,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
  # ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.)
 --- a/lib/Makefile
 +++ b/lib/Makefile
-@@ -126,6 +126,16 @@ CFLAGS_kobject.o += -DDEBUG
+@@ -117,6 +117,16 @@ CFLAGS_kobject.o += -DDEBUG
  CFLAGS_kobject_uevent.o += -DDEBUG
  endif
  
@@ -1129,7 +1130,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
  obj-$(CONFIG_DEBUG_INFO_REDUCED) += debug_info.o
  CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any)
  
-@@ -185,6 +195,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/
+@@ -165,6 +175,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/
  obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd/
  obj-$(CONFIG_XZ_DEC) += xz/
  obj-$(CONFIG_RAID6_PQ) += raid6/
@@ -1144,10 +1145,10 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +/* LzFind.c -- Match finder for LZ algorithms
 +2009-04-22 : Igor Pavlov : Public domain */
 +
-+#include <string.h>
++#include <linux/string.h>
 +
-+#include "LzFind.h"
-+#include "LzHash.h"
++#include <linux/lzma/LzFind.h>
++#include <linux/lzma/LzHash.h>
 +
 +#define kEmptyHashValue 0
 +#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
@@ -1908,9 +1909,9 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +/* LzmaDec.c -- LZMA Decoder
 +2009-09-20 : Igor Pavlov : Public domain */
 +
-+#include "LzmaDec.h"
++#include <linux/lzma/LzmaDec.h>
 +
-+#include <string.h>
++#include <linux/string.h>
 +
 +#define kNumTopBits 24
 +#define kTopValue ((UInt32)1 << kNumTopBits)
@@ -2910,7 +2911,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +/* LzmaEnc.c -- LZMA Encoder
 +2009-11-24 : Igor Pavlov : Public domain */
 +
-+#include <string.h>
++#include <linux/string.h>
 +
 +/* #define SHOW_STAT */
 +/* #define SHOW_STAT2 */
@@ -2919,12 +2920,12 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
 +#include <stdio.h>
 +#endif
 +
-+#include "LzmaEnc.h"
++#include <linux/lzma/LzmaEnc.h>
 +
 +/* disable MT */
 +#define _7ZIP_ST
 +
-+#include "LzFind.h"
++#include <linux/lzma/LzFind.h>
 +#ifndef _7ZIP_ST
 +#include "LzFindMt.h"
 +#endif
index fdfacd8dee979f649c659aad22f1e535df032b0b..be7ebdda68894c3041013181592f67028f2e3492 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/net/dummy.c
 +++ b/drivers/net/dummy.c
-@@ -111,7 +111,7 @@ static void dummy_setup(struct net_devic
+@@ -113,7 +113,7 @@ static void dummy_setup(struct net_devic
        dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
        dev->lltx = true;
        dev->features   |= NETIF_F_SG | NETIF_F_FRAGLIST;
@@ -24,9 +24,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        dev->hw_features |= dev->features;
 --- a/drivers/net/loopback.c
 +++ b/drivers/net/loopback.c
-@@ -174,7 +174,7 @@ static void gen_lo_setup(struct net_devi
+@@ -175,7 +175,7 @@ static void gen_lo_setup(struct net_devi
        dev->lltx               = true;
-       dev->netns_local        = true;
+       dev->netns_immutable    = true;
        netif_keep_dst(dev);
 -      dev->hw_features        = NETIF_F_GSO_SOFTWARE;
 +      dev->hw_features        = NETIF_F_GSO_SOFTWARE_ALL;
@@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                | NETIF_F_HW_CSUM
 --- a/drivers/net/macvlan.c
 +++ b/drivers/net/macvlan.c
-@@ -903,7 +903,7 @@ static int macvlan_hwtstamp_set(struct n
+@@ -904,7 +904,7 @@ static int macvlan_hwtstamp_set(struct n
  static struct lock_class_key macvlan_netdev_addr_lock_key;
  
  #define ALWAYS_ON_OFFLOADS \
@@ -46,10 +46,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #define ALWAYS_ON_FEATURES ALWAYS_ON_OFFLOADS
 --- a/include/linux/netdev_features.h
 +++ b/include/linux/netdev_features.h
-@@ -211,13 +211,14 @@ static inline int find_next_netdev_featu
+@@ -213,13 +213,14 @@ static inline int find_next_netdev_featu
  /* List of features with software fallbacks. */
- #define NETIF_F_GSO_SOFTWARE  (NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP |        \
+ #define NETIF_F_GSO_SOFTWARE  (NETIF_F_ALL_TSO | \
+                                NETIF_F_GSO_ACCECN | NETIF_F_GSO_SCTP | \
 -                               NETIF_F_GSO_UDP_L4 | NETIF_F_GSO_FRAGLIST)
 +                               NETIF_F_GSO_UDP_L4)
 +#define NETIF_F_GSO_SOFTWARE_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_FRAGLIST)
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if ((ret & NETIF_F_GSO_ENCAP_ALL) && (ret & NETIF_F_CSUM_MASK))
 --- a/net/8021q/vlan_dev.c
 +++ b/net/8021q/vlan_dev.c
-@@ -538,7 +538,7 @@ static int vlan_dev_init(struct net_devi
+@@ -537,7 +537,7 @@ static int vlan_dev_init(struct net_devi
                dev->state |= (1 << __LINK_STATE_NOCARRIER);
  
        dev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG |
@@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                           NETIF_F_GSO_ENCAP_ALL |
                           NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC |
                           NETIF_F_FCOE_CRC | NETIF_F_FSO;
-@@ -634,7 +634,7 @@ static netdev_features_t vlan_dev_fix_fe
+@@ -633,7 +633,7 @@ static netdev_features_t vlan_dev_fix_fe
        if (lower_features & (NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM))
                lower_features |= NETIF_F_HW_CSUM;
        features = netdev_intersect_features(features, lower_features);
@@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
 --- a/net/core/sock.c
 +++ b/net/core/sock.c
-@@ -2557,7 +2557,7 @@ void sk_setup_caps(struct sock *sk, stru
+@@ -2620,7 +2620,7 @@ void sk_setup_caps(struct sock *sk, stru
                icsk->icsk_ack.dst_quick_ack = dst_metric(dst, RTAX_QUICKACK);
        }
        if (sk->sk_route_caps & NETIF_F_GSO)
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        if (sk_can_gso(sk)) {
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -2023,7 +2023,7 @@ void ieee80211_color_collision_detection
+@@ -2083,7 +2083,7 @@ void ieee80211_color_collision_detection
  /* interface handling */
  #define MAC80211_SUPPORTED_FEATURES_TX        (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \
                                         NETIF_F_HW_CSUM | NETIF_F_SG | \
index d07b282e25d38a934f711a794b85d0b9594b382d..e583cc5dfa494d5a3d57e9ebd134db219e133a2f 100644 (file)
@@ -18,12 +18,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/net/netfilter/nf_tables_api.c
 +++ b/net/netfilter/nf_tables_api.c
-@@ -8724,7 +8724,7 @@ static int nft_register_flowtable_net_ho
-               err = flowtable->data.type->setup(&flowtable->data,
-                                                 hook->ops.dev,
-                                                 FLOW_BLOCK_BIND);
--              if (err < 0)
-+              if (err < 0 && err != -EOPNOTSUPP)
-                       goto err_unregister_net_hooks;
+@@ -9091,7 +9091,7 @@ static int nft_register_flowtable_ops(st
  
-               err = nf_register_net_hook(net, &hook->ops);
+       err = flowtable->data.type->setup(&flowtable->data,
+                                         ops->dev, FLOW_BLOCK_BIND);
+-      if (err < 0)
++      if (err < 0 && err != -EOPNOTSUPP)
+               return err;
+       err = nf_register_net_hook(net, ops);
index 2f90df60131b71c986a6f058b048d25b18249389..318cbe62629f2d8b8c24e4615fb0127e7a3ec3d4 100644 (file)
@@ -29,10 +29,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
              u16 vid)
  {
 +      const unsigned char *dest = eth_hdr(skb)->h_dest;
+       enum skb_drop_reason reason = SKB_DROP_REASON_NO_TX_TARGET;
        struct net_bridge_port *prev = NULL;
        struct net_bridge_port *p;
-@@ -219,6 +220,10 @@ void br_flood(struct net_bridge *br, str
+@@ -220,6 +221,10 @@ void br_flood(struct net_bridge *br, str
                case BR_PKT_MULTICAST:
                        if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
                                continue;
@@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev)
 --- a/net/bridge/br_input.c
 +++ b/net/bridge/br_input.c
-@@ -368,6 +368,8 @@ static rx_handler_result_t br_handle_fra
+@@ -384,6 +384,8 @@ static rx_handler_result_t br_handle_fra
                fwd_mask |= p->group_fwd_mask;
                switch (dest[5]) {
                case 0x00:      /* Bridge Group Address */
@@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
 --- a/include/uapi/linux/if_link.h
 +++ b/include/uapi/linux/if_link.h
-@@ -1094,6 +1094,7 @@ enum {
+@@ -1098,6 +1098,7 @@ enum {
        IFLA_BRPORT_MCAST_MAX_GROUPS,
        IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
        IFLA_BRPORT_BACKUP_NHID,
@@ -152,7 +152,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
            (!(p->flags & BR_PORT_LOCKED) || !(p->flags & BR_LEARNING))) {
 --- a/net/core/rtnetlink.c
 +++ b/net/core/rtnetlink.c
-@@ -62,7 +62,7 @@
+@@ -63,7 +63,7 @@
  #include "dev.h"
  
  #define RTNL_MAX_TYPE         50
@@ -161,7 +161,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
  struct rtnl_link {
        rtnl_doit_func          doit;
-@@ -5009,7 +5009,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu
+@@ -5295,7 +5295,9 @@ int ndo_dflt_bridge_getlink(struct sk_bu
            brport_nla_put_flag(skb, flags, mask,
                                IFLA_BRPORT_MCAST_FLOOD, BR_MCAST_FLOOD) ||
            brport_nla_put_flag(skb, flags, mask,
index 6a51dbbfb482c746629a46f254e9b170ee59bead..34b4e544a2a348df160f1c6cdfaa5877b6cefeb6 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
-@@ -43,6 +43,11 @@ MODULE_PARM_DESC(msg_level, "Message lev
+@@ -44,6 +44,11 @@ MODULE_PARM_DESC(msg_level, "Message lev
                                  offsetof(struct mtk_hw_stats, xdp_stats.x) / \
                                  sizeof(u64) }
  
@@ -23,14 +23,13 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static const struct mtk_reg_map mtk_reg_map = {
        .tx_irq_mask            = 0x1a1c,
        .tx_irq_status          = 0x1a18,
-@@ -1160,14 +1165,14 @@ static int mtk_init_fq_dma(struct mtk_et
-               eth->scratch_ring = eth->sram_base;
-       else
-               eth->scratch_ring = dma_alloc_coherent(eth->dma_dev,
--                                                     cnt * soc->tx.desc_size,
-+                                                     TX_DESC_OFS(eth, cnt),
-                                                      &eth->phy_scratch_ring,
-                                                      GFP_KERNEL);
+@@ -1306,13 +1311,13 @@ static int mtk_init_fq_dma(struct mtk_et
+       dma_addr_t dma_addr;
+       int i, j, len;
+-      eth->scratch_ring = mtk_dma_ring_alloc(eth, cnt * soc->tx.desc_size,
++      eth->scratch_ring = mtk_dma_ring_alloc(eth, TX_DESC_OFS(eth, cnt),
+                                              &eth->phy_scratch_ring, true);
  
        if (unlikely(!eth->scratch_ring))
                return -ENOMEM;
@@ -40,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        for (j = 0; j < DIV_ROUND_UP(soc->tx.fq_dma_size, MTK_FQ_DMA_LENGTH); j++) {
                len = min_t(int, cnt - j * MTK_FQ_DMA_LENGTH, MTK_FQ_DMA_LENGTH);
-@@ -1186,11 +1191,11 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -1331,11 +1336,11 @@ static int mtk_init_fq_dma(struct mtk_et
                for (i = 0; i < len; i++) {
                        struct mtk_tx_dma_v2 *txd;
  
@@ -54,7 +53,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
                        txd->txd3 = TX_DMA_PLEN0(MTK_QDMA_PAGE_SIZE);
                        if (MTK_HAS_CAPS(soc->caps, MTK_36BIT_DMA))
-@@ -1220,9 +1225,9 @@ static void *mtk_qdma_phys_to_virt(struc
+@@ -1365,9 +1370,9 @@ static void *mtk_qdma_phys_to_virt(struc
  }
  
  static struct mtk_tx_buf *mtk_desc_to_tx_buf(struct mtk_tx_ring *ring,
@@ -66,7 +65,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
        return &ring->buf[idx];
  }
-@@ -1233,9 +1238,9 @@ static struct mtk_tx_dma *qdma_to_pdma(s
+@@ -1378,9 +1383,9 @@ static struct mtk_tx_dma *qdma_to_pdma(s
        return ring->dma_pdma - (struct mtk_tx_dma *)ring->dma + dma;
  }
  
@@ -78,7 +77,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
  
  static void mtk_tx_unmap(struct mtk_eth *eth, struct mtk_tx_buf *tx_buf,
-@@ -1443,7 +1448,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1588,7 +1593,7 @@ static int mtk_tx_map(struct sk_buff *sk
        if (itxd == ring->last_free)
                return -ENOMEM;
  
@@ -87,7 +86,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        memset(itx_buf, 0, sizeof(*itx_buf));
  
        txd_info.addr = dma_map_single(eth->dma_dev, skb->data, txd_info.size,
-@@ -1497,7 +1502,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1642,7 +1647,7 @@ static int mtk_tx_map(struct sk_buff *sk
                        mtk_tx_set_dma_desc(dev, txd, &txd_info);
  
                        tx_buf = mtk_desc_to_tx_buf(ring, txd,
@@ -96,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        if (new_desc)
                                memset(tx_buf, 0, sizeof(*tx_buf));
                        tx_buf->data = (void *)MTK_DMA_DUMMY_DESC;
-@@ -1540,7 +1545,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1685,7 +1690,7 @@ static int mtk_tx_map(struct sk_buff *sk
        } else {
                int next_idx;
  
@@ -105,7 +104,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                         ring->dma_size);
                mtk_w32(eth, next_idx, MT7628_TX_CTX_IDX0);
        }
-@@ -1549,7 +1554,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1694,7 +1699,7 @@ static int mtk_tx_map(struct sk_buff *sk
  
  err_dma:
        do {
@@ -114,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
                /* unmap dma */
                mtk_tx_unmap(eth, tx_buf, NULL, false);
-@@ -1723,7 +1728,7 @@ static struct mtk_rx_ring *mtk_get_rx_ri
+@@ -1868,7 +1873,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);
@@ -123,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                if (rxd->rxd2 & RX_DMA_DONE) {
                        ring->calc_idx_update = true;
                        return ring;
-@@ -1891,7 +1896,7 @@ static int mtk_xdp_submit_frame(struct m
+@@ -2036,7 +2041,7 @@ static int mtk_xdp_submit_frame(struct m
        }
        htxd = txd;
  
@@ -132,7 +131,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        memset(tx_buf, 0, sizeof(*tx_buf));
        htx_buf = tx_buf;
  
-@@ -1910,7 +1915,7 @@ static int mtk_xdp_submit_frame(struct m
+@@ -2055,7 +2060,7 @@ static int mtk_xdp_submit_frame(struct m
                                goto unmap;
  
                        tx_buf = mtk_desc_to_tx_buf(ring, txd,
@@ -141,7 +140,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        memset(tx_buf, 0, sizeof(*tx_buf));
                        n_desc++;
                }
-@@ -1948,7 +1953,7 @@ static int mtk_xdp_submit_frame(struct m
+@@ -2093,7 +2098,7 @@ static int mtk_xdp_submit_frame(struct m
        } else {
                int idx;
  
@@ -150,7 +149,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                mtk_w32(eth, NEXT_DESP_IDX(idx, ring->dma_size),
                        MT7628_TX_CTX_IDX0);
        }
-@@ -1959,7 +1964,7 @@ static int mtk_xdp_submit_frame(struct m
+@@ -2104,7 +2109,7 @@ static int mtk_xdp_submit_frame(struct m
  
  unmap:
        while (htxd != txd) {
@@ -159,7 +158,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                mtk_tx_unmap(eth, tx_buf, NULL, false);
  
                htxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
-@@ -2091,7 +2096,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -2236,7 +2241,7 @@ static int mtk_poll_rx(struct napi_struc
                        goto rx_done;
  
                idx = NEXT_DESP_IDX(ring->calc_idx, ring->dma_size);
@@ -168,7 +167,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                data = ring->data[idx];
  
                if (!mtk_rx_get_desc(eth, &trxd, rxd))
-@@ -2355,7 +2360,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -2503,7 +2508,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
                        break;
  
                tx_buf = mtk_desc_to_tx_buf(ring, desc,
@@ -177,7 +176,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                if (!tx_buf->data)
                        break;
  
-@@ -2406,7 +2411,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -2554,7 +2559,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
                }
                mtk_tx_unmap(eth, tx_buf, &bq, true);
  
@@ -186,7 +185,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                ring->last_free = desc;
                atomic_inc(&ring->free_count);
  
-@@ -2524,7 +2529,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2672,7 +2677,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;
@@ -195,7 +194,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        struct mtk_tx_dma_v2 *txd;
        int ring_size;
        u32 ofs, val;
-@@ -2571,7 +2576,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2712,7 +2717,7 @@ static int mtk_tx_alloc(struct mtk_eth *
         * descriptors in ring->dma_pdma.
         */
        if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
@@ -204,7 +203,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                                    &ring->phys_pdma, GFP_KERNEL);
                if (!ring->dma_pdma)
                        goto no_tx_mem;
-@@ -2586,7 +2591,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2727,7 +2732,7 @@ static int mtk_tx_alloc(struct mtk_eth *
        atomic_set(&ring->free_count, ring_size - 2);
        ring->next_free = ring->dma;
        ring->last_free = (void *)txd;
@@ -213,7 +212,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
-@@ -2598,7 +2603,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2739,7 +2744,7 @@ 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,
@@ -222,13 +221,21 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        soc->reg_map->qdma.crx_ptr);
                mtk_w32(eth, ring->last_free_ptr, soc->reg_map->qdma.drx_ptr);
  
-@@ -2647,14 +2652,14 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -2776,7 +2781,6 @@ no_tx_mem:
+ static void mtk_tx_clean(struct mtk_eth *eth)
+ {
+-      const struct mtk_soc_data *soc = eth->soc;
+       struct mtk_tx_ring *ring = &eth->tx_ring;
+       int i;
+@@ -2788,14 +2792,14 @@ static void mtk_tx_clean(struct mtk_eth
        }
-       if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && ring->dma) {
-               dma_free_coherent(eth->dma_dev,
--                                ring->dma_size * soc->tx.desc_size,
-+                                TX_DESC_OFS(eth, ring->dma_size),
-                                 ring->dma, ring->phys);
+       if (ring->dma) {
+-              mtk_dma_ring_free(eth, ring->dma_size * soc->tx.desc_size,
++              mtk_dma_ring_free(eth, TX_DESC_OFS(eth, ring->dma_size),
+                                 ring->dma, ring->phys, true);
                ring->dma = NULL;
        }
  
@@ -239,26 +246,16 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                                  ring->dma_pdma, ring->phys_pdma);
                ring->dma_pdma = NULL;
        }
-@@ -2710,15 +2715,13 @@ static int mtk_rx_alloc(struct mtk_eth *
-       if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SRAM) ||
-           rx_flag != MTK_RX_FLAGS_NORMAL) {
-               ring->dma = dma_alloc_coherent(eth->dma_dev,
--                              rx_dma_size * eth->soc->rx.desc_size,
-+                              RX_DESC_OFS(eth, rx_dma_size),
-                               &ring->phys, GFP_KERNEL);
-       } else {
-               struct mtk_tx_ring *tx_ring = &eth->tx_ring;
--              ring->dma = tx_ring->dma + tx_ring_size *
--                          eth->soc->tx.desc_size * (ring_no + 1);
--              ring->phys = tx_ring->phys + tx_ring_size *
--                           eth->soc->tx.desc_size * (ring_no + 1);
-+              ring->dma = tx_ring->dma + TX_DESC_OFS(eth, tx_ring_size * (ring_no + 1));
-+              ring->phys = tx_ring->phys + TX_DESC_OFS(eth, tx_ring_size * (ring_no + 1));
+@@ -2844,7 +2848,7 @@ static int mtk_rx_alloc(struct mtk_eth *
        }
  
+       ring->dma = mtk_dma_ring_alloc(eth,
+-                                     rx_dma_size * eth->soc->rx.desc_size,
++                                     RX_DESC_OFS(eth, rx_dma_size),
+                                      &ring->phys,
+                                      rx_flag == MTK_RX_FLAGS_NORMAL);
        if (!ring->dma)
-@@ -2729,7 +2732,7 @@ static int mtk_rx_alloc(struct mtk_eth *
+@@ -2855,7 +2859,7 @@ static int mtk_rx_alloc(struct mtk_eth *
                dma_addr_t dma_addr;
                void *data;
  
@@ -267,7 +264,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                if (ring->page_pool) {
                        data = mtk_page_pool_get_buff(ring->page_pool,
                                                      &dma_addr, GFP_KERNEL);
-@@ -2820,7 +2823,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -2946,7 +2950,7 @@ static void mtk_rx_clean(struct mtk_eth
                        if (!ring->data[i])
                                continue;
  
@@ -276,25 +273,25 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        if (!rxd->rxd1)
                                continue;
  
-@@ -2837,7 +2840,7 @@ static void mtk_rx_clean(struct mtk_eth
+@@ -2962,7 +2966,7 @@ static void mtk_rx_clean(struct mtk_eth
+       }
  
-       if (!in_sram && ring->dma) {
-               dma_free_coherent(eth->dma_dev,
--                                ring->dma_size * eth->soc->rx.desc_size,
-+                                RX_DESC_OFS(eth, ring->dma_size),
-                                 ring->dma, ring->phys);
+       if (ring->dma) {
+-              mtk_dma_ring_free(eth, ring->dma_size * eth->soc->rx.desc_size,
++              mtk_dma_ring_free(eth, RX_DESC_OFS(eth, ring->dma_size),
+                                 ring->dma, ring->phys, in_sram);
                ring->dma = NULL;
        }
-@@ -3208,7 +3211,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -3332,7 +3336,7 @@ static void mtk_dma_free(struct mtk_eth
+       }
  
-       if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) {
-               dma_free_coherent(eth->dma_dev,
--                                MTK_QDMA_RING_SIZE * soc->tx.desc_size,
-+                                TX_DESC_OFS(eth, MTK_QDMA_RING_SIZE),
-                                 eth->scratch_ring, eth->phy_scratch_ring);
+       if (eth->scratch_ring) {
+-              mtk_dma_ring_free(eth, soc->tx.fq_dma_size * soc->tx.desc_size,
++              mtk_dma_ring_free(eth, TX_DESC_OFS(eth, soc->tx.fq_dma_size),
+                                 eth->scratch_ring, eth->phy_scratch_ring,
+                                 true);
                eth->scratch_ring = NULL;
-               eth->phy_scratch_ring = 0;
-@@ -5245,6 +5248,9 @@ static void mtk_remove(struct platform_d
+@@ -5386,6 +5390,9 @@ static void mtk_remove(struct platform_d
        mtk_mdio_cleanup(eth);
  }
  
@@ -304,7 +301,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static const struct mtk_soc_data mt2701_data = {
        .reg_map = &mtk_reg_map,
        .caps = MT7623_CAPS | MTK_HWLRO,
-@@ -5253,14 +5259,14 @@ static const struct mtk_soc_data mt2701_
+@@ -5394,14 +5401,14 @@ static const struct mtk_soc_data mt2701_
        .required_pctl = true,
        .version = 1,
        .tx = {
@@ -321,7 +318,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT,
                .dma_l4_valid = RX_DMA_L4_VALID,
                .dma_size = MTK_DMA_SIZE(2K),
-@@ -5281,14 +5287,14 @@ static const struct mtk_soc_data mt7621_
+@@ -5422,14 +5429,14 @@ static const struct mtk_soc_data mt7621_
        .hash_offset = 2,
        .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
        .tx = {
@@ -338,7 +335,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT,
                .dma_l4_valid = RX_DMA_L4_VALID,
                .dma_size = MTK_DMA_SIZE(2K),
-@@ -5311,14 +5317,14 @@ static const struct mtk_soc_data mt7622_
+@@ -5452,14 +5459,14 @@ static const struct mtk_soc_data mt7622_
        .has_accounting = true,
        .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
        .tx = {
@@ -355,7 +352,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT,
                .dma_l4_valid = RX_DMA_L4_VALID,
                .dma_size = MTK_DMA_SIZE(2K),
-@@ -5340,14 +5346,14 @@ static const struct mtk_soc_data mt7623_
+@@ -5481,14 +5488,14 @@ static const struct mtk_soc_data mt7623_
        .foe_entry_size = MTK_FOE_ENTRY_V1_SIZE,
        .disable_pll_modes = true,
        .tx = {
@@ -372,7 +369,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT,
                .dma_l4_valid = RX_DMA_L4_VALID,
                .dma_size = MTK_DMA_SIZE(2K),
-@@ -5366,14 +5372,14 @@ static const struct mtk_soc_data mt7629_
+@@ -5507,14 +5514,14 @@ static const struct mtk_soc_data mt7629_
        .has_accounting = true,
        .version = 1,
        .tx = {
@@ -389,7 +386,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT,
                .dma_l4_valid = RX_DMA_L4_VALID,
                .dma_size = MTK_DMA_SIZE(2K),
-@@ -5396,14 +5402,14 @@ static const struct mtk_soc_data mt7981_
+@@ -5537,14 +5544,14 @@ static const struct mtk_soc_data mt7981_
        .has_accounting = true,
        .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
        .tx = {
@@ -406,7 +403,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT,
                .dma_l4_valid = RX_DMA_L4_VALID_V2,
                .dma_max_len = MTK_TX_DMA_BUF_LEN,
-@@ -5426,14 +5432,14 @@ static const struct mtk_soc_data mt7986_
+@@ -5567,14 +5574,14 @@ static const struct mtk_soc_data mt7986_
        .has_accounting = true,
        .foe_entry_size = MTK_FOE_ENTRY_V2_SIZE,
        .tx = {
@@ -423,7 +420,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT,
                .dma_l4_valid = RX_DMA_L4_VALID_V2,
                .dma_max_len = MTK_TX_DMA_BUF_LEN,
-@@ -5456,14 +5462,14 @@ static const struct mtk_soc_data mt7988_
+@@ -5597,14 +5604,14 @@ static const struct mtk_soc_data mt7988_
        .has_accounting = true,
        .foe_entry_size = MTK_FOE_ENTRY_V3_SIZE,
        .tx = {
@@ -440,7 +437,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .irq_done_mask = MTK_RX_DONE_INT_V2,
                .dma_l4_valid = RX_DMA_L4_VALID_V2,
                .dma_max_len = MTK_TX_DMA_BUF_LEN_V2,
-@@ -5480,13 +5486,13 @@ static const struct mtk_soc_data rt5350_
+@@ -5621,13 +5628,13 @@ static const struct mtk_soc_data rt5350_
        .required_pctl = false,
        .version = 1,
        .tx = {
@@ -458,7 +455,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                .dma_max_len = MTK_TX_DMA_BUF_LEN,
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -1160,7 +1160,7 @@ struct mtk_reg_map {
+@@ -1200,7 +1200,7 @@ struct mtk_reg_map {
   * @foe_entry_size            Foe table entry size.
   * @has_accounting            Bool indicating support for accounting of
   *                            offloaded flows.
@@ -467,7 +464,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
   * @irq_done_mask             Rx irq done register mask.
   * @dma_l4_valid              Rx DMA valid register mask.
   * @dma_max_len                       Max DMA tx/rx buffer length.
-@@ -1181,14 +1181,14 @@ struct mtk_soc_data {
+@@ -1221,14 +1221,14 @@ struct mtk_soc_data {
        bool            has_accounting;
        bool            disable_pll_modes;
        struct {
index d76797af92ef64d5c45cf0ce33e97f238823a443..b0956d9aab2c5dd677391e38e4026bb3e2d25a5f 100644 (file)
@@ -25,12 +25,8 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 
 --- 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";
+@@ -35,8 +35,16 @@ static const char *mtk_eth_path_name(u64
+               return "gmac2_2p5gphy";
        case MTK_ETH_PATH_GMAC2_GEPHY:
                return "gmac2_gephy";
 +      case MTK_ETH_PATH_GMAC3_SGMII:
@@ -46,35 +42,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        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_
+@@ -190,7 +198,48 @@ static int set_mux_gmac1_gmac2_to_sgmii_
        return 0;
  }
  
@@ -124,7 +92,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  {
        unsigned int val = 0;
        bool updated = true;
-@@ -182,6 +254,9 @@ static int set_mux_gmac12_to_gephy_sgmii
+@@ -207,6 +256,9 @@ static int set_mux_gmac12_to_gephy_sgmii
        case MTK_ETH_PATH_GMAC2_SGMII:
                val |= SYSCFG0_SGMII_GMAC2_V2;
                break;
@@ -134,17 +102,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        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,
+@@ -245,7 +297,15 @@ static const struct mtk_eth_muxc mtk_eth
        }, {
                .name = "mux_gmac12_to_gephy_sgmii",
                .cap_bit = MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII,
@@ -161,7 +119,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        },
  };
  
-@@ -249,12 +336,39 @@ out:
+@@ -278,12 +338,26 @@ out:
        return err;
  }
  
@@ -176,6 +134,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +      /* 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)
  {
@@ -186,20 +145,6 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +      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);
@@ -214,7 +159,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  #include <linux/jhash.h>
  #include <linux/bitfield.h>
  #include <net/dsa.h>
-@@ -522,6 +524,30 @@ static void mtk_setup_bridge_switch(stru
+@@ -523,6 +525,30 @@ static void mtk_setup_bridge_switch(stru
                MTK_GSW_CFG);
  }
  
@@ -245,7 +190,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  static struct phylink_pcs *mtk_mac_select_pcs(struct phylink_config *config,
                                              phy_interface_t interface)
  {
-@@ -530,6 +556,21 @@ static struct phylink_pcs *mtk_mac_selec
+@@ -531,6 +557,21 @@ static struct phylink_pcs *mtk_mac_selec
        struct mtk_eth *eth = mac->hw;
        unsigned int sid;
  
@@ -267,7 +212,32 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        if (interface == PHY_INTERFACE_MODE_SGMII ||
            phy_interface_mode_is_8023z(interface)) {
                sid = (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_SGMII)) ?
-@@ -581,7 +622,22 @@ static void mtk_mac_config(struct phylin
+@@ -543,21 +584,13 @@ static struct phylink_pcs *mtk_mac_selec
+ }
+ static int mtk_mac_prepare(struct phylink_config *config, unsigned int mode,
+-                         phy_interface_t iface)
++                         phy_interface_t interface)
+ {
+       struct mtk_mac *mac = container_of(config, struct mtk_mac,
+                                          phylink_config);
+-      struct mtk_eth *eth = mac->hw;
+-      if (mtk_interface_mode_is_xgmii(eth, iface) &&
+-          mac->id != MTK_GMAC1_ID) {
+-              mtk_m32(mac->hw, XMAC_MCR_TRX_DISABLE,
+-                      XMAC_MCR_TRX_DISABLE, MTK_XMAC_MCR(mac->id));
+-
+-              mtk_m32(mac->hw, MTK_XGMAC_FORCE_MODE(mac->id) |
+-                               MTK_XGMAC_FORCE_LINK(mac->id),
+-                      MTK_XGMAC_FORCE_MODE(mac->id), MTK_XGMAC_STS(mac->id));
+-      }
++      if (mac->pextp && mac->interface != interface)
++              phy_reset(mac->pextp);
+       return 0;
+ }
+@@ -602,6 +635,15 @@ static void mtk_mac_config(struct phylin
                                        goto init_err;
                        }
                        break;
@@ -281,16 +251,9 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +                      }
 +                      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;
-@@ -628,8 +684,6 @@ static void mtk_mac_config(struct phylin
+                       if (mac->id == MTK_GMAC2_ID &&
+                           MTK_HAS_CAPS(eth->soc->caps, MTK_2P5GPHY)) {
+@@ -655,8 +697,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);
@@ -299,7 +262,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        }
  
        /* SGMII */
-@@ -646,21 +700,40 @@ static void mtk_mac_config(struct phylin
+@@ -673,21 +713,40 @@ static void mtk_mac_config(struct phylin
  
                /* Save the syscfg0 value for mac_finish */
                mac->syscfg0 = val;
@@ -315,26 +278,26 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        }
  
        /* Setup gmac */
--      if (mtk_is_netsys_v3_or_greater(eth) &&
--          mac->interface == PHY_INTERFACE_MODE_INTERNAL) {
+-      if (mtk_interface_mode_is_xgmii(eth, 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 (mtk_is_netsys_v3_or_greater(eth)) {
-+              if (mtk_interface_mode_is_xgmii(state->interface)) {
++              if (mtk_interface_mode_is_xgmii(eth, 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);
 +                      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) ||
++                      if ((mtk_interface_mode_is_xgmii(eth, mac->interface) ||
 +                           mac->interface == PHY_INTERFACE_MODE_NA) &&
 +                          !mtk_check_gmac23_idle(mac) &&
 +                          !test_bit(MTK_RESETTING, &eth->state))
@@ -347,26 +310,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        return;
  
  err_phy:
-@@ -673,6 +746,18 @@ init_err:
-               mac->id, phy_modes(state->interface), err);
- }
-+static int mtk_mac_prepare(struct phylink_config *config, unsigned int mode,
-+                         phy_interface_t interface)
-+{
-+      struct mtk_mac *mac = container_of(config, struct mtk_mac,
-+                                         phylink_config);
-+
-+      if (mac->pextp && mac->interface != interface)
-+              phy_reset(mac->pextp);
-+
-+      return 0;
-+}
-+
- static int mtk_mac_finish(struct phylink_config *config, unsigned int mode,
-                         phy_interface_t interface)
- {
-@@ -681,6 +766,10 @@ static int mtk_mac_finish(struct phylink
+@@ -708,6 +767,10 @@ static int mtk_mac_finish(struct phylink
        struct mtk_eth *eth = mac->hw;
        u32 mcr_cur, mcr_new;
  
@@ -377,107 +321,78 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        /* Enable SGMII */
        if (interface == PHY_INTERFACE_MODE_SGMII ||
            phy_interface_mode_is_8023z(interface))
-@@ -705,10 +794,14 @@ static void mtk_mac_link_down(struct phy
- {
-       struct mtk_mac *mac = container_of(config, struct mtk_mac,
+@@ -734,16 +797,11 @@ static void mtk_mac_link_down(struct phy
                                           phylink_config);
--      u32 mcr = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
  
--      mcr &= ~(MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK);
--      mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
-+      if (!mtk_interface_mode_is_xgmii(interface)) {
+       if (!mtk_interface_mode_is_xgmii(mac->hw, interface)) {
+-              /* GMAC modes */
+-              mtk_m32(mac->hw,
+-                      MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK, 0,
+-                      MTK_MAC_MCR(mac->id));
+-      } else if (mac->id != MTK_GMAC1_ID) {
+-              /* XGMAC except for built-in switch */
+-              mtk_m32(mac->hw, XMAC_MCR_TRX_DISABLE, XMAC_MCR_TRX_DISABLE,
+-                      MTK_XMAC_MCR(mac->id));
+-              mtk_m32(mac->hw, MTK_XGMAC_FORCE_LINK(mac->id), 0,
+-                      MTK_XGMAC_STS(mac->id));
 +              mtk_m32(mac->hw, MAC_MCR_TX_EN | MAC_MCR_RX_EN | MAC_MCR_FORCE_LINK, 0, MTK_MAC_MCR(mac->id));
 +              if (mtk_is_netsys_v3_or_greater(mac->hw))
 +                      mtk_m32(mac->hw, MTK_XGMAC_FORCE_LINK(mac->id), 0, MTK_XGMAC_STS(mac->id));
 +      } else if (mtk_is_netsys_v3_or_greater(mac->hw) && 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,
-@@ -780,13 +873,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));
-@@ -830,9 +921,63 @@ 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,
+@@ -858,10 +916,9 @@ static void mtk_gdm_mac_link_up(struct m
+ 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)
 +                               int speed, int duplex, bool tx_pause, bool rx_pause)
-+{
+ {
+-      u32 mcr;
 +      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);
+       if (mac->id == MTK_GMAC1_ID)
+               return;
+@@ -869,15 +926,15 @@ static void mtk_xgdm_mac_link_up(struct
+       /* 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));
 +      mtk_m32(mac->hw, XMAC_GLB_CNTCLR, XMAC_GLB_CNTCLR, MTK_XMAC_CNT_CTRL(mac->id));
-+
+-      mtk_m32(mac->hw, MTK_XGMAC_FORCE_LINK(mac->id),
+-              MTK_XGMAC_FORCE_LINK(mac->id), MTK_XGMAC_STS(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 = mtk_r32(mac->hw, MTK_XMAC_MCR(mac->id));
+-      mcr &= ~(XMAC_MCR_FORCE_TX_FC | XMAC_MCR_FORCE_RX_FC |
+-               XMAC_MCR_TRX_DISABLE);
 +      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_is_netsys_v3_or_greater(mac->hw) && 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);
+       /* Configure pause modes -
+        * phylink will avoid these for half duplex
+        */
+@@ -903,8 +960,13 @@ static void mtk_mac_link_up(struct phyli
+       else
+               mtk_gdm_mac_link_up(mac, phy, mode, interface, speed, duplex,
+                                   tx_pause, rx_pause);
 +
 +      /* Repeat pextp setup to tune link */
 +      if (mac->pextp)
 +              phy_set_mode_ext(mac->pextp, PHY_MODE_ETHERNET, interface);
-+}
+ }
 +
- static const struct phylink_mac_ops mtk_phylink_ops = {
-       .mac_select_pcs = mtk_mac_select_pcs,
-       .mac_config = mtk_mac_config,
-+      .mac_prepare = mtk_mac_prepare,
-       .mac_finish = mtk_mac_finish,
-       .mac_link_down = mtk_mac_link_down,
-       .mac_link_up = mtk_mac_link_up,
-@@ -3591,6 +3736,9 @@ static int mtk_open(struct net_device *d
+ static void mtk_mac_disable_tx_lpi(struct phylink_config *config)
+ {
+       struct mtk_mac *mac = container_of(config, struct mtk_mac,
+@@ -3765,6 +3827,9 @@ static int mtk_open(struct net_device *d
  
        ppe_num = eth->soc->ppe_num;
  
@@ -487,7 +402,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
        if (err) {
                netdev_err(dev, "%s: could not attach PHY: %d\n", __func__,
-@@ -3738,6 +3886,9 @@ static int mtk_stop(struct net_device *d
+@@ -3912,6 +3977,9 @@ static int mtk_stop(struct net_device *d
        for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
                mtk_ppe_stop(eth->ppe[i]);
  
@@ -497,7 +412,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        return 0;
  }
  
-@@ -4837,6 +4988,7 @@ static const struct net_device_ops mtk_n
+@@ -4968,6 +5036,7 @@ static const struct net_device_ops mtk_n
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
  {
        const __be32 *_id = of_get_property(np, "reg", NULL);
@@ -505,7 +420,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        phy_interface_t phy_mode;
        struct phylink *phylink;
        struct mtk_mac *mac;
-@@ -4875,16 +5027,44 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -5004,16 +5073,44 @@ static int mtk_add_mac(struct mtk_eth *e
        mac->id = id;
        mac->hw = eth;
        mac->of_node = np;
@@ -558,7 +473,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        }
  
        memset(mac->hwlro_ip, 0, sizeof(mac->hwlro_ip));
-@@ -4967,8 +5147,21 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -5099,8 +5196,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);
@@ -580,7 +495,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        phylink = phylink_create(&mac->phylink_config,
                                 of_fwnode_handle(mac->of_node),
                                 phy_mode, &mtk_phylink_ops);
-@@ -5019,6 +5212,26 @@ free_netdev:
+@@ -5156,6 +5266,26 @@ free_netdev:
        return err;
  }
  
@@ -607,7 +522,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  void mtk_eth_set_dma_device(struct mtk_eth *eth, struct device *dma_dev)
  {
        struct net_device *dev, *tmp;
-@@ -5165,7 +5378,8 @@ static int mtk_probe(struct platform_dev
+@@ -5309,7 +5439,8 @@ static int mtk_probe(struct platform_dev
                        regmap_write(cci, 0, 3);
        }
  
@@ -617,7 +532,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
                err = mtk_sgmii_init(eth);
  
                if (err)
-@@ -5276,6 +5490,24 @@ static int mtk_probe(struct platform_dev
+@@ -5418,6 +5549,24 @@ static int mtk_probe(struct platform_dev
                }
        }
  
@@ -640,9 +555,9 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +      }
 +
        if (MTK_HAS_CAPS(eth->soc->caps, MTK_SHARED_INT)) {
-               err = devm_request_irq(eth->dev, eth->irq[0],
+               err = devm_request_irq(eth->dev, eth->irq[MTK_FE_IRQ_SHARED],
                                       mtk_handle_irq, 0,
-@@ -5386,6 +5618,11 @@ static void mtk_remove(struct platform_d
+@@ -5528,6 +5677,11 @@ static void mtk_remove(struct platform_d
                mtk_stop(eth->netdev[i]);
                mac = netdev_priv(eth->netdev[i]);
                phylink_disconnect_phy(mac->phylink);
@@ -664,29 +579,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  #include <linux/rhashtable.h>
  #include <linux/dim.h>
  #include <linux/bitfield.h>
-@@ -527,6 +528,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
-@@ -552,6 +568,7 @@
+@@ -570,6 +571,7 @@
  #define SYSCFG0_SGMII_GMAC2    ((3 << 8) & SYSCFG0_SGMII_MASK)
  #define SYSCFG0_SGMII_GMAC1_V2 BIT(9)
  #define SYSCFG0_SGMII_GMAC2_V2 BIT(8)
@@ -694,19 +587,15 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
  
  /* ethernet subsystem clock register */
-@@ -590,6 +607,11 @@
- #define GEPHY_MAC_SEL          BIT(1)
- /* Top misc registers */
-+#define TOP_MISC_NETSYS_PCS_MUX       0x0
-+#define NETSYS_PCS_MUX_MASK   GENMASK(1, 0)
-+#define       MUX_G2_USXGMII_SEL      BIT(1)
+@@ -611,6 +613,7 @@
+ #define TOP_MISC_NETSYS_PCS_MUX       0x0
+ #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
-@@ -614,6 +636,8 @@
+@@ -636,6 +639,8 @@
  #define MT7628_SDM_RBCNT      (MT7628_SDM_OFFSET + 0x10c)
  #define MT7628_SDM_CS_ERR     (MT7628_SDM_OFFSET + 0x110)
  
@@ -715,7 +604,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  #define MTK_FE_CDM1_FSM               0x220
  #define MTK_FE_CDM2_FSM               0x224
  #define MTK_FE_CDM3_FSM               0x238
-@@ -622,6 +646,11 @@
+@@ -644,6 +649,11 @@
  #define MTK_FE_CDM6_FSM               0x328
  #define MTK_FE_GDM1_FSM               0x228
  #define MTK_FE_GDM2_FSM               0x22C
@@ -727,20 +616,16 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
  #define MTK_MAC_FSM(x)                (0x1010C + ((x) * 0x100))
  
-@@ -945,6 +974,8 @@ enum mkt_eth_capabilities {
+@@ -972,6 +982,7 @@ enum mkt_eth_capabilities {
        MTK_RGMII_BIT = 0,
        MTK_TRGMII_BIT,
        MTK_SGMII_BIT,
 +      MTK_USXGMII_BIT,
-+      MTK_2P5GPHY_BIT,
+       MTK_2P5GPHY_BIT,
        MTK_ESW_BIT,
        MTK_GEPHY_BIT,
-       MTK_MUX_BIT,
-@@ -965,8 +996,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,
+@@ -996,6 +1007,8 @@ enum mkt_eth_capabilities {
+       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,
@@ -748,17 +633,15 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
        /* PATH BITS */
        MTK_ETH_PATH_GMAC1_RGMII_BIT,
-@@ -974,14 +1008,21 @@ enum mkt_eth_capabilities {
-       MTK_ETH_PATH_GMAC1_SGMII_BIT,
-       MTK_ETH_PATH_GMAC2_RGMII_BIT,
+@@ -1005,13 +1018,18 @@ enum mkt_eth_capabilities {
        MTK_ETH_PATH_GMAC2_SGMII_BIT,
-+      MTK_ETH_PATH_GMAC2_2P5GPHY_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,
++      MTK_ETH_PATH_GMAC3_USXGMII_BIT
  };
  
  /* Supported hardware group on SoCs */
@@ -766,17 +649,10 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  #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_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)
-@@ -1004,10 +1045,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        \
+@@ -1041,6 +1059,10 @@ enum mkt_eth_capabilities {
        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)
@@ -787,11 +663,9 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
  /* Supported path present on SoCs */
  #define MTK_ETH_PATH_GMAC1_RGMII      BIT_ULL(MTK_ETH_PATH_GMAC1_RGMII_BIT)
-@@ -1015,8 +1062,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)
+@@ -1050,7 +1072,11 @@ enum mkt_eth_capabilities {
  #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_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)
@@ -801,11 +675,10 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
  #define MTK_GMAC1_RGMII               (MTK_ETH_PATH_GMAC1_RGMII | MTK_RGMII)
  #define MTK_GMAC1_TRGMII      (MTK_ETH_PATH_GMAC1_TRGMII | MTK_TRGMII)
-@@ -1024,7 +1076,12 @@ enum mkt_eth_capabilities {
- #define MTK_GMAC2_RGMII               (MTK_ETH_PATH_GMAC2_RGMII | MTK_RGMII)
+@@ -1059,7 +1085,11 @@ enum mkt_eth_capabilities {
  #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_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)
@@ -814,15 +687,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
  /* MUXes present on SoCs */
  /* 0: GDM1 -> GMAC1, 1: GDM1 -> ESW */
-@@ -1043,10 +1100,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 */
+@@ -1086,6 +1116,12 @@ enum mkt_eth_capabilities {
  #define MTK_MUX_GMAC12_TO_GEPHY_SGMII   \
        (MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII | MTK_MUX)
  
@@ -835,12 +700,13 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  #define MTK_HAS_CAPS(caps, _x)                (((caps) & (_x)) == (_x))
  
  #define MT7621_CAPS  (MTK_GMAC1_RGMII | MTK_GMAC1_TRGMII | \
-@@ -1078,8 +1145,12 @@ enum mkt_eth_capabilities {
+@@ -1117,9 +1153,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_GMAC2_2P5GPHY | \
+-                    MTK_MUX_GMAC2_TO_2P5GPHY | 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 | \
@@ -850,7 +716,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
  struct mtk_tx_dma_desc_info {
        dma_addr_t      addr;
-@@ -1327,6 +1398,9 @@ struct mtk_mac {
+@@ -1366,6 +1405,9 @@ struct mtk_mac {
        struct device_node              *of_node;
        struct phylink                  *phylink;
        struct phylink_config           phylink_config;
@@ -860,31 +726,8 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        struct mtk_eth                  *hw;
        struct mtk_hw_stats             *hw_stats;
        __be32                          hwlro_ip[MTK_MAX_LRO_IP_CNT];
-@@ -1450,6 +1524,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);
-@@ -1458,8 +1545,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);
+@@ -1517,6 +1559,7 @@ int mtk_gmac_sgmii_path_setup(struct mtk
+ 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);
index 0e4a63ec7fbe960dbbdcacb56713038447a09ae0..8ac059ef5e5b0eadd6491ec0ccf95c39a644d845 100644 (file)
@@ -79,7 +79,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  static struct mtk_pcs_lynxi *pcs_to_mtk_pcs_lynxi(struct phylink_pcs *pcs)
  {
        return container_of(pcs, struct mtk_pcs_lynxi, pcs);
-@@ -117,6 +139,17 @@ static void mtk_pcs_lynxi_get_state(stru
+@@ -118,6 +140,17 @@ static void mtk_pcs_lynxi_get_state(stru
                                         FIELD_GET(SGMII_LPA, adv));
  }
  
@@ -97,7 +97,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  static int mtk_pcs_lynxi_config(struct phylink_pcs *pcs, unsigned int neg_mode,
                                phy_interface_t interface,
                                const unsigned long *advertising,
-@@ -162,6 +195,7 @@ static int mtk_pcs_lynxi_config(struct p
+@@ -163,6 +196,7 @@ static int mtk_pcs_lynxi_config(struct p
                                SGMII_PHYA_PWD);
  
                /* Reset SGMII PCS state */
@@ -105,7 +105,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
                regmap_set_bits(mpcs->regmap, SGMSYS_RESERVED_0,
                                SGMII_SW_RESET);
  
-@@ -248,10 +282,29 @@ static void mtk_pcs_lynxi_link_up(struct
+@@ -249,10 +283,29 @@ static void mtk_pcs_lynxi_link_up(struct
        }
  }
  
@@ -135,7 +135,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
        mpcs->interface = PHY_INTERFACE_MODE_NA;
  }
  
-@@ -262,11 +315,12 @@ static const struct phylink_pcs_ops mtk_
+@@ -263,11 +316,12 @@ static const struct phylink_pcs_ops mtk_
        .pcs_an_restart = mtk_pcs_lynxi_restart_an,
        .pcs_link_up = mtk_pcs_lynxi_link_up,
        .pcs_disable = mtk_pcs_lynxi_disable,
@@ -151,7 +151,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  {
        struct mtk_pcs_lynxi *mpcs;
        u32 id, ver;
-@@ -274,29 +328,33 @@ struct phylink_pcs *mtk_pcs_lynxi_create
+@@ -275,29 +329,33 @@ struct phylink_pcs *mtk_pcs_lynxi_create
  
        ret = regmap_read(regmap, SGMSYS_PCS_DEVICE_ID, &id);
        if (ret < 0)
@@ -192,8 +192,8 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  
        mpcs->ana_rgc3 = ana_rgc3;
        mpcs->regmap = regmap;
-@@ -307,6 +365,13 @@ struct phylink_pcs *mtk_pcs_lynxi_create
-       mpcs->interface = PHY_INTERFACE_MODE_NA;
+@@ -311,6 +369,13 @@ struct phylink_pcs *mtk_pcs_lynxi_create
+       __set_bit(PHY_INTERFACE_MODE_2500BASEX, mpcs->pcs.supported_interfaces);
  
        return &mpcs->pcs;
 +};
@@ -206,7 +206,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  }
  EXPORT_SYMBOL(mtk_pcs_lynxi_create);
  
-@@ -319,5 +384,142 @@ void mtk_pcs_lynxi_destroy(struct phylin
+@@ -323,5 +388,142 @@ void mtk_pcs_lynxi_destroy(struct phylin
  }
  EXPORT_SYMBOL(mtk_pcs_lynxi_destroy);
  
@@ -342,7 +342,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +              .of_match_table         = mtk_pcs_lynxi_of_match,
 +      },
 +      .probe = mtk_pcs_lynxi_probe,
-+      .remove_new = mtk_pcs_lynxi_remove,
++      .remove = mtk_pcs_lynxi_remove,
 +};
 +module_platform_driver(mtk_pcs_lynxi_driver);
 +
index 04790ce7e7f1b0e9766fa6ab42d03948189513d3..1bd628c333c4c5c7766207ac74fb898787274eac 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -14432,7 +14432,9 @@ M:     Daniel Golle <daniel@makrotopia.org>
+@@ -15790,7 +15790,9 @@ M:     Daniel Golle <daniel@makrotopia.org>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/pcs/pcs-mtk-lynxi.c
@@ -47,8 +47,8 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +        differential pairs via an embedded LynxI PHY.
 +
  config PCS_RZN1_MIIC
-       tristate "Renesas RZ/N1 MII converter"
-       depends on OF && (ARCH_RZN1 || COMPILE_TEST)
+       tristate "Renesas RZ/N1, RZ/N2H, RZ/T2H MII converter"
+       depends on OF
 --- a/drivers/net/pcs/Makefile
 +++ b/drivers/net/pcs/Makefile
 @@ -8,3 +8,4 @@ obj-$(CONFIG_PCS_XPCS)         += pcs_xpcs.o
@@ -506,7 +506,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
 +              .of_match_table         = mtk_usxgmii_of_mtable,
 +      },
 +      .probe = mtk_usxgmii_probe,
-+      .remove_new = mtk_usxgmii_remove,
++      .remove = mtk_usxgmii_remove,
 +};
 +module_platform_driver(mtk_usxgmii_driver);
 +
index 042afdc391b9f7490b905b5c9b6e093210f4eacc..d645c14eaa3b7b18b176d83c6dc206c8506a0cbd 100644 (file)
@@ -33,7 +33,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
        return 0;
 --- a/drivers/opp/core.c
 +++ b/drivers/opp/core.c
-@@ -965,7 +965,8 @@ static int _set_opp_voltage(struct devic
+@@ -1054,7 +1054,8 @@ static int _set_opp_voltage(struct devic
  
  static int
  _opp_config_clk_single(struct device *dev, struct opp_table *opp_table,
@@ -43,7 +43,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  {
        unsigned long *target = data;
        unsigned long freq;
-@@ -997,8 +998,8 @@ _opp_config_clk_single(struct device *de
+@@ -1086,8 +1087,8 @@ _opp_config_clk_single(struct device *de
   * the order in which they are present in the array while scaling up.
   */
  int dev_pm_opp_config_clks_simple(struct device *dev,
@@ -54,7 +54,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  {
        int ret, i;
  
-@@ -1265,7 +1266,7 @@ static int _set_opp(struct device *dev,
+@@ -1353,7 +1354,7 @@ static int _set_opp(struct device *dev,
        }
  
        if (opp_table->config_clks) {
@@ -63,18 +63,18 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
                if (ret)
                        return ret;
        }
-@@ -1344,7 +1345,7 @@ int dev_pm_opp_set_rate(struct device *d
+@@ -1430,7 +1431,7 @@ int dev_pm_opp_set_rate(struct device *d
                 * equivalent to a clk_set_rate()
                 */
                if (!_get_opp_count(opp_table)) {
--                      ret = opp_table->config_clks(dev, opp_table, NULL,
-+                      ret = opp_table->config_clks(dev, opp_table, NULL, NULL,
-                                                    &target_freq, false);
-                       goto put_opp_table;
+-                      return opp_table->config_clks(dev, opp_table, NULL,
++                      return opp_table->config_clks(dev, opp_table, NULL, NULL,
+                                                     &target_freq, false);
                }
 --- a/drivers/ufs/core/ufshcd.c
 +++ b/drivers/ufs/core/ufshcd.c
-@@ -1122,8 +1122,8 @@ out:
+@@ -1149,8 +1149,8 @@ out:
  }
  
  int ufshcd_opp_config_clks(struct device *dev, struct opp_table *opp_table,
@@ -87,7 +87,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
        struct list_head *head = &hba->clk_list_head;
 --- a/include/linux/pm_opp.h
 +++ b/include/linux/pm_opp.h
-@@ -50,7 +50,8 @@ typedef int (*config_regulators_t)(struc
+@@ -51,7 +51,8 @@ typedef int (*config_regulators_t)(struc
                        struct dev_pm_opp *old_opp, struct dev_pm_opp *new_opp,
                        struct regulator **regulators, unsigned int count);
  
@@ -97,7 +97,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
                        struct dev_pm_opp *opp, void *data, bool scaling_down);
  
  /**
-@@ -184,8 +185,8 @@ int dev_pm_opp_set_config(struct device
+@@ -208,8 +209,8 @@ int dev_pm_opp_set_config(struct device
  int devm_pm_opp_set_config(struct device *dev, struct dev_pm_opp_config *config);
  void dev_pm_opp_clear_config(int token);
  int dev_pm_opp_config_clks_simple(struct device *dev,
@@ -108,7 +108,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  
  struct dev_pm_opp *dev_pm_opp_xlate_required_opp(struct opp_table *src_table, struct opp_table *dst_table, struct dev_pm_opp *src_opp);
  int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, struct opp_table *dst_table, unsigned int pstate);
-@@ -395,8 +396,8 @@ static inline int devm_pm_opp_set_config
+@@ -442,8 +443,8 @@ static inline int devm_pm_opp_set_config
  static inline void dev_pm_opp_clear_config(int token) {}
  
  static inline int dev_pm_opp_config_clks_simple(struct device *dev,
@@ -121,7 +121,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  }
 --- a/include/ufs/ufshcd.h
 +++ b/include/ufs/ufshcd.h
-@@ -1333,8 +1333,8 @@ void ufshcd_mcq_enable(struct ufs_hba *h
+@@ -1327,8 +1327,8 @@ void ufshcd_mcq_enable_esi(struct ufs_hb
  void ufshcd_mcq_config_esi(struct ufs_hba *hba, struct msi_msg *msg);
  
  int ufshcd_opp_config_clks(struct device *dev, struct opp_table *opp_table,
index e5f54d7214e47e4b5c677395d7709a3d7533ea6b..311751dd9f64ea94d31d1a2a3754d262161c4296 100644 (file)
@@ -57,10 +57,10 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  
  #include <linux/bitfield.h>
 +#include <linux/completion.h>
+ #include <linux/cleanup.h>
  #include <linux/kernel.h>
  #include <linux/sched.h>
- #include <linux/pci.h>
-@@ -36,6 +37,7 @@
+@@ -38,6 +39,7 @@
  #endif
  
  static int sysfs_initialized; /* = 0 */
@@ -68,7 +68,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  
  /* show configuration fields */
  #define pci_config_attr(field, format_string)                         \
-@@ -1551,12 +1553,32 @@ static const struct attribute_group pci_
+@@ -1701,12 +1703,32 @@ static const struct attribute_group pci_
        .is_visible = resource_resize_is_visible,
  };
  
@@ -102,7 +102,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  }
  
  /**
-@@ -1577,21 +1599,23 @@ static int __init pci_sysfs_init(void)
+@@ -1727,21 +1749,23 @@ static int __init pci_sysfs_init(void)
  {
        struct pci_dev *pdev = NULL;
        struct pci_bus *pbus = NULL;
@@ -132,8 +132,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  
 --- a/include/linux/pci.h
 +++ b/include/linux/pci.h
-@@ -484,6 +484,7 @@ struct pci_dev {
-       unsigned int    rom_attr_enabled:1;     /* Display of ROM attribute enabled? */
+@@ -490,6 +490,7 @@ struct pci_dev {
+       unsigned int    non_mappable_bars:1;    /* BARs can't be mapped to user-space  */
        pci_dev_flags_t dev_flags;
        atomic_t        enable_cnt;     /* pci_enable_device has been called */
 +      bool            sysfs_init;     /* sysfs entry has been created */
index 6a90959f619849d08956a30c13a581195e2247ba..e17745b0580d4b5301462090062b2de732b2f0fe 100644 (file)
@@ -33,15 +33,15 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
 
 --- a/drivers/pci/controller/pci-aardvark.c
 +++ b/drivers/pci/controller/pci-aardvark.c
-@@ -276,7 +276,6 @@ struct advk_pcie {
+@@ -277,7 +277,6 @@ struct advk_pcie {
        u8 wins_count;
        struct irq_domain *rp_irq_domain;
        struct irq_domain *irq_domain;
 -      struct irq_chip irq_chip;
        raw_spinlock_t irq_lock;
-       struct irq_domain *msi_domain;
        struct irq_domain *msi_inner_domain;
-@@ -1418,14 +1417,19 @@ static void advk_pcie_irq_unmask(struct
+       raw_spinlock_t msi_irq_lock;
+@@ -1406,14 +1405,19 @@ static void advk_pcie_irq_unmask(struct
        raw_spin_unlock_irqrestore(&pcie->irq_lock, flags);
  }
  
@@ -63,7 +63,7 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
        irq_set_chip_data(virq, pcie);
  
        return 0;
-@@ -1485,7 +1489,6 @@ static int advk_pcie_init_irq_domain(str
+@@ -1471,7 +1475,6 @@ static int advk_pcie_init_irq_domain(str
        struct device *dev = &pcie->pdev->dev;
        struct device_node *node = dev->of_node;
        struct device_node *pcie_intc_node;
@@ -71,7 +71,7 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
        int ret = 0;
  
        raw_spin_lock_init(&pcie->irq_lock);
-@@ -1496,28 +1499,14 @@ static int advk_pcie_init_irq_domain(str
+@@ -1482,27 +1485,13 @@ static int advk_pcie_init_irq_domain(str
                return -ENODEV;
        }
  
@@ -87,9 +87,8 @@ Signed-off-by: Marek Behún <kabel@kernel.org>
 -      irq_chip->irq_mask = advk_pcie_irq_mask;
 -      irq_chip->irq_unmask = advk_pcie_irq_unmask;
 -
-       pcie->irq_domain =
-               irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX,
-                                     &advk_pcie_irq_domain_ops, pcie);
+       pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(pcie_intc_node), PCI_NUM_INTX,
+                                                   &advk_pcie_irq_domain_ops, pcie);
        if (!pcie->irq_domain) {
                dev_err(dev, "Failed to get a INTx IRQ domain\n");
                ret = -ENOMEM;