From a524a0dff80e9bf833ef8c08308923398d3d46a6 Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Fri, 18 Dec 2020 22:26:55 +0100 Subject: [PATCH 1/5] ath79: mikrotik: enable SFP on RB922UAGS-5HPaCD This patch enables the SFP cage on the MikroTik RouterBOARD 922UAGS-5HPacD. GPIO16 (tx-disable-gpios) should be governed by the SFP driver to enable or disable transmission, but no change is observed. Therefore, it is left as output high to ensure the SFP module is forced to transmit. Tested on a RouterBOARD 922UAGS-5HPacD board, with a CISCO GLC-LH-SMD 1310nm module and an unbranded GLC-T RJ45 Gigabit module. PC=>router iperf3 tests deliver 440/300 Mbps up/down, both via regular eth0 port or SFP port with RJ45 module. Bridge between eth0 and eth1 delivers 950 Mbps symmetric. Signed-off-by: Roger Pueyo Centelles (cherry picked from commit 4387fe00cb7536d9d341f6d27e465ff0f0b29b1b) --- ...58_mikrotik_routerboard-922uags-5hpacd.dts | 48 +++++++++++++++++++ target/linux/ath79/image/mikrotik.mk | 3 +- .../base-files/etc/board.d/02_network | 1 - target/linux/ath79/mikrotik/config-default | 1 + 4 files changed, 51 insertions(+), 2 deletions(-) diff --git a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts index 8ad834fe61..36979bbd33 100644 --- a/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts +++ b/target/linux/ath79/dts/qca9558_mikrotik_routerboard-922uags-5hpacd.dts @@ -23,6 +23,27 @@ gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; }; + + i2c: i2c { + compatible = "i2c-gpio"; + + sda-gpios = <&gpio 18 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 19 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <5>; + i2c-gpio,timeout-ms = <1>; + }; + + sfp1: sfp { + compatible = "sff,sfp"; + + i2c-bus = <&i2c>; + maximum-power-milliwatt = <1000>; + los-gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + tx-disable-gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + // Toggling GPIO16 actually enables/disables the transmitter, + // but the SFP driver does not seem to be using it. + }; }; &pcie0 { @@ -55,3 +76,30 @@ &usb_phy1 { status = "okay"; }; + +&mdio1 { + status = "okay"; + + phy_sfp: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + sfp = <&sfp1>; + }; +}; + +ð1 { + status = "okay"; + + phy-handle = <&phy_sfp>; + pll-data = <0x03000000 0x00000101 0x00001616>; + qca955x-sgmii-fixup; + + gmac-config { + device = <&gmac>; + }; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index b7d745bc77..74f8603b5a 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -22,7 +22,8 @@ define Device/mikrotik_routerboard-922uags-5hpacd $(Device/mikrotik_nand) SOC := qca9558 DEVICE_MODEL := RouterBOARD 922UAGS-5HPacD - DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2 \ + kmod-i2c-gpio kmod-sfp SUPPORTED_DEVICES += rb-922uags-5hpacd endef TARGET_DEVICES += mikrotik_routerboard-922uags-5hpacd diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index 584acc0feb..c407da6dcd 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -16,7 +16,6 @@ ath79_setup_interfaces() "0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; mikrotik,routerboard-921gs-5hpacd-15s|\ - mikrotik,routerboard-922uags-5hpacd|\ mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ mikrotik,routerboard-wap-g-5hact2hnd|\ diff --git a/target/linux/ath79/mikrotik/config-default b/target/linux/ath79/mikrotik/config-default index f713fc36cf..8609893f6e 100644 --- a/target/linux/ath79/mikrotik/config-default +++ b/target/linux/ath79/mikrotik/config-default @@ -24,6 +24,7 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_NET_DSA=y CONFIG_NET_SWITCHDEV=y CONFIG_PCI_AR71XX=y CONFIG_PHY_AR7100_USB=y From d57e4803940b97c06cbb8c659dd6de907cdd90ec Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Thu, 29 Apr 2021 11:38:16 +0200 Subject: [PATCH 2/5] ath79: mikrotik: swap RB922UAGS-5HPaCD eth0/1 MACs Since support for SFP on the MikroTik RouterBOARD 922UAGS-5HPacD was added by 4387fe00cb, the MAC addresses for eth0 (Ethernet) and eth1 (SFP) were swapped. This patch fixes the 02_network script to assign MAC addresses correctly, so they match the label and the vendor's OS. Tested on a RouterBOARD 922UAGS-5HPacD board. Signed-off-by: Roger Pueyo Centelles (cherry picked from commit 14a95b36b1ecd038fffc279878c5a4c51043d709) --- .../linux/ath79/mikrotik/base-files/etc/board.d/02_network | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index c407da6dcd..54e7bb20cf 100755 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -45,6 +45,11 @@ ath79_setup_macs() label_mac="$mac_base" lan_mac="$mac_base" ;; + mikrotik,routerboard-922uags-5hpacd) + label_mac="$mac_base" + lan_mac="$mac_base" + wan_mac=$(macaddr_add $mac_base 1) + ;; *) label_mac="$mac_base" wan_mac="$mac_base" From 438718b5fbdb4f597a1f779600aa61417b13f84a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 24 Apr 2021 01:01:21 +0200 Subject: [PATCH 3/5] kernel: bump 5.4 to 5.4.114 Removed because in upstream* mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch Manually rebased* generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch Added new backport* generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch All others updated automatically. The new backport was included based on this[1] upstream commit that will be mainlined soon. This change is needed because Eric Dumazet's check for NET_IP_ALIGN (landed in 5.4.114) causes huge slowdowns on drivers which use napi_gro_frags(). Compile-tested on: x86/64, armvirt/64, ath79/generic Runtime-tested on: x86/64, armvirt/64, ath79/generic Signed-off-by: Hauke Mehrtens --- include/kernel-version.mk | 4 +- .../0036-GPIO-add-named-gpio-exports.patch | 6 +- ..._frags-Fast-GRO-breakage-due-to-IP-a.patch | 75 +++++++++++++++++++ ...ast-GRO-for-skbs-with-Ethernet-heade.patch | 6 +- ...e6xxx-Add-support-for-port-mirroring.patch | 4 +- ...x-fix-broken-if-statement-because-of.patch | 2 +- .../generic/hack-5.4/902-debloat_proc.patch | 2 +- .../600-netfilter_conntrack_flush.patch | 4 +- ...-netfilter_optional_tcp_window_check.patch | 4 +- ...ng-with-source-address-failed-policy.patch | 14 ++-- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +-- ...dd-support-for-threaded-NAPI-polling.patch | 14 ++-- ...equest-assisted-learning-on-CPU-port.patch | 2 +- .../100-GPIO-add-named-gpio-exports.patch | 6 +- .../0030-GPIO-add-named-gpio-exports.patch | 6 +- ...ve-dev_err-usage-after-platform_get_.patch | 2 +- ...e-resolved-link-config-via-mac_link_.patch | 2 +- ...ure-LED-2--INTn-pin-as-interrupt-pin.patch | 64 ---------------- .../0024-GPIO-add-named-gpio-exports.patch | 6 +- 19 files changed, 122 insertions(+), 111 deletions(-) create mode 100644 target/linux/generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch delete mode 100644 target/linux/mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 52e5c11d75..2217d69026 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-5.4 = .111 +LINUX_VERSION-5.4 = .114 -LINUX_KERNEL_HASH-5.4.111 = 21626132658dc34cb41b7aa7b80ecf83751890a71ac1a63d77aea9d488271a03 +LINUX_KERNEL_HASH-5.4.114 = be98f087cb58f23bc5edb8ee80a4794a569d48049d75b1a8eaef9f80fede9557 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/ath79/patches-5.4/0036-GPIO-add-named-gpio-exports.patch b/target/linux/ath79/patches-5.4/0036-GPIO-add-named-gpio-exports.patch index d4ea379159..805836fcca 100644 --- a/target/linux/ath79/patches-5.4/0036-GPIO-add-named-gpio-exports.patch +++ b/target/linux/ath79/patches-5.4/0036-GPIO-add-named-gpio-exports.patch @@ -93,7 +93,7 @@ Signed-off-by: John Crispin +module_platform_driver(gpio_export_driver); --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c -@@ -563,7 +563,7 @@ static struct class gpio_class = { +@@ -571,7 +571,7 @@ static struct class gpio_class = { * * Returns zero on success, else an error. */ @@ -102,7 +102,7 @@ Signed-off-by: John Crispin { struct gpio_chip *chip; struct gpio_device *gdev; -@@ -625,6 +625,8 @@ int gpiod_export(struct gpio_desc *desc, +@@ -633,6 +633,8 @@ int gpiod_export(struct gpio_desc *desc, offset = gpio_chip_hwgpio(desc); if (chip->names && chip->names[offset]) ioname = chip->names[offset]; @@ -111,7 +111,7 @@ Signed-off-by: John Crispin dev = device_create_with_groups(&gpio_class, &gdev->dev, MKDEV(0, 0), data, gpio_groups, -@@ -646,6 +648,12 @@ err_unlock: +@@ -654,6 +656,12 @@ err_unlock: gpiod_dbg(desc, "%s: status %d\n", __func__, status); return status; } diff --git a/target/linux/generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch b/target/linux/generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch new file mode 100644 index 0000000000..17e9e34589 --- /dev/null +++ b/target/linux/generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch @@ -0,0 +1,75 @@ +From 3007b05df4301aad179acc6ca1c3645785576df6 Mon Sep 17 00:00:00 2001 +From: Alexander Lobakin +Date: Mon, 19 Apr 2021 12:53:06 +0000 +Subject: gro: fix napi_gro_frags() Fast GRO breakage due to IP + alignment check + +Commit 7ad18ff6449cbd6beb26b53128ddf56d2685aa93 upstream. + +Commit 38ec4944b593 ("gro: ensure frag0 meets IP header alignment") +did the right thing, but missed the fact that napi_gro_frags() logics +calls for skb_gro_reset_offset() *before* pulling Ethernet header +to the skb linear space. +That said, the introduced check for frag0 address being aligned to 4 +always fails for it as Ethernet header is obviously 14 bytes long, +and in case with NET_IP_ALIGN its start is not aligned to 4. + +Fix this by adding @nhoff argument to skb_gro_reset_offset() which +tells if an IP header is placed right at the start of frag0 or not. +This restores Fast GRO for napi_gro_frags() that became very slow +after the mentioned commit, and preserves the introduced check to +avoid silent unaligned accesses. + +From v1 [0]: + - inline tiny skb_gro_reset_offset() to let the code be optimized + more efficively (esp. for the !NET_IP_ALIGN case) (Eric); + - pull in Reviewed-by from Eric. + +[0] https://lore.kernel.org/netdev/20210418114200.5839-1-alobakin@pm.me + +Fixes: 38ec4944b593 ("gro: ensure frag0 meets IP header alignment") +Reviewed-by: Eric Dumazet +Signed-off-by: Alexander Lobakin +Signed-off-by: David S. Miller +--- + net/core/dev.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -5395,7 +5395,7 @@ static struct list_head *gro_list_prepar + return head; + } + +-static void skb_gro_reset_offset(struct sk_buff *skb) ++static inline void skb_gro_reset_offset(struct sk_buff *skb, u32 nhoff) + { + const struct skb_shared_info *pinfo = skb_shinfo(skb); + const skb_frag_t *frag0 = &pinfo->frags[0]; +@@ -5407,7 +5407,7 @@ static void skb_gro_reset_offset(struct + if (skb_mac_header(skb) == skb_tail_pointer(skb) && + pinfo->nr_frags && + !PageHighMem(skb_frag_page(frag0)) && +- (!NET_IP_ALIGN || !(skb_frag_off(frag0) & 3))) { ++ (!NET_IP_ALIGN || !((skb_frag_off(frag0) + nhoff) & 3))) { + NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0); + NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int, + skb_frag_size(frag0), +@@ -5640,7 +5640,7 @@ gro_result_t napi_gro_receive(struct nap + skb_mark_napi_id(skb, napi); + trace_napi_gro_receive_entry(skb); + +- skb_gro_reset_offset(skb); ++ skb_gro_reset_offset(skb, 0); + + ret = napi_skb_finish(napi, skb, dev_gro_receive(napi, skb)); + trace_napi_gro_receive_exit(ret); +@@ -5733,7 +5733,7 @@ static struct sk_buff *napi_frags_skb(st + napi->skb = NULL; + + skb_reset_mac_header(skb); +- skb_gro_reset_offset(skb); ++ skb_gro_reset_offset(skb, hlen); + + if (unlikely(skb_gro_header_hard(skb, hlen))) { + eth = skb_gro_header_slow(skb, hlen, 0); diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch index a79c860187..a942a53809 100644 --- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch +++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch @@ -66,13 +66,13 @@ Signed-off-by: David S. Miller --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5404,8 +5404,7 @@ static void skb_gro_reset_offset(struct +@@ -5404,8 +5404,7 @@ static inline void skb_gro_reset_offset( NAPI_GRO_CB(skb)->frag0 = NULL; NAPI_GRO_CB(skb)->frag0_len = 0; - if (skb_mac_header(skb) == skb_tail_pointer(skb) && - pinfo->nr_frags && + if (!skb_headlen(skb) && pinfo->nr_frags && - !PageHighMem(skb_frag_page(frag0))) { + !PageHighMem(skb_frag_page(frag0)) && + (!NET_IP_ALIGN || !((skb_frag_off(frag0) + nhoff) & 3))) { NAPI_GRO_CB(skb)->frag0 = skb_frag_address(frag0); - NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int, diff --git a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch index a23f45075f..30ff8aeab6 100644 --- a/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch +++ b/target/linux/generic/backport-5.4/747-v5.5-net-dsa-mv88e6xxx-Add-support-for-port-mirroring.patch @@ -25,7 +25,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4926,6 +4926,80 @@ static int mv88e6xxx_port_mdb_del(struct +@@ -4922,6 +4922,80 @@ static int mv88e6xxx_port_mdb_del(struct return err; } @@ -106,7 +106,7 @@ Signed-off-by: David S. Miller static int mv88e6xxx_port_egress_floods(struct dsa_switch *ds, int port, bool unicast, bool multicast) { -@@ -4980,6 +5054,8 @@ static const struct dsa_switch_ops mv88e +@@ -4976,6 +5050,8 @@ static const struct dsa_switch_ops mv88e .port_mdb_prepare = mv88e6xxx_port_mdb_prepare, .port_mdb_add = mv88e6xxx_port_mdb_add, .port_mdb_del = mv88e6xxx_port_mdb_del, diff --git a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch index 37e7a7f2a9..d8ec1240f7 100644 --- a/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch +++ b/target/linux/generic/backport-5.4/748-v5.5-net-dsa-mv88e6xxx-fix-broken-if-statement-because-of.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -4993,7 +4993,7 @@ static void mv88e6xxx_port_mirror_del(st +@@ -4989,7 +4989,7 @@ static void mv88e6xxx_port_mirror_del(st if (chip->info->ops->set_egress_port(chip, direction, dsa_upstream_port(ds, diff --git a/target/linux/generic/hack-5.4/902-debloat_proc.patch b/target/linux/generic/hack-5.4/902-debloat_proc.patch index d9febbada8..7d6c2b2d6e 100644 --- a/target/linux/generic/hack-5.4/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.4/902-debloat_proc.patch @@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3629,6 +3629,8 @@ static __net_initdata struct pernet_oper +@@ -3623,6 +3623,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-5.4/600-netfilter_conntrack_flush.patch b/target/linux/generic/pending-5.4/600-netfilter_conntrack_flush.patch index 14d3a37a8c..eaf8c78052 100644 --- a/target/linux/generic/pending-5.4/600-netfilter_conntrack_flush.patch +++ b/target/linux/generic/pending-5.4/600-netfilter_conntrack_flush.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau #include #ifdef CONFIG_SYSCTL #include -@@ -454,6 +455,56 @@ static int ct_cpu_seq_show(struct seq_fi +@@ -455,6 +456,56 @@ static int ct_cpu_seq_show(struct seq_fi return 0; } @@ -74,7 +74,7 @@ Signed-off-by: Felix Fietkau static const struct seq_operations ct_cpu_seq_ops = { .start = ct_cpu_seq_start, .next = ct_cpu_seq_next, -@@ -467,8 +518,9 @@ static int nf_conntrack_standalone_init_ +@@ -468,8 +519,9 @@ static int nf_conntrack_standalone_init_ kuid_t root_uid; kgid_t root_gid; diff --git a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch index 2881337724..0735f8d20d 100644 --- a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch +++ b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau static bool enable_hooks __read_mostly; MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks"); module_param(enable_hooks, bool, 0000); -@@ -649,6 +652,7 @@ enum nf_ct_sysctl_index { +@@ -650,6 +653,7 @@ enum nf_ct_sysctl_index { NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM, #endif @@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau __NF_SYSCTL_CT_LAST_SYSCTL, }; -@@ -975,6 +979,13 @@ static struct ctl_table nf_ct_sysctl_tab +@@ -976,6 +980,13 @@ static struct ctl_table nf_ct_sysctl_tab .proc_handler = proc_dointvec_jiffies, }, #endif diff --git a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 3590557a30..90f4199eab 100644 --- a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -6019,6 +6050,8 @@ static int ip6_route_dev_notify(struct n +@@ -6021,6 +6052,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 net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -6030,6 +6063,7 @@ static int ip6_route_dev_notify(struct n +@@ -6032,6 +6065,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 in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -6222,6 +6256,8 @@ static int __net_init ip6_route_net_init +@@ -6224,6 +6258,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 net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template, sizeof(*net->ipv6.ip6_prohibit_entry), GFP_KERNEL); -@@ -6232,11 +6268,21 @@ static int __net_init ip6_route_net_init +@@ -6234,11 +6270,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 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); -@@ -6260,6 +6306,8 @@ out: +@@ -6262,6 +6308,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -6279,6 +6327,7 @@ static void __net_exit ip6_route_net_exi +@@ -6281,6 +6329,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 kfree(net->ipv6.ip6_blk_hole_entry); #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); -@@ -6356,6 +6405,9 @@ void __init ip6_route_init_special_entri +@@ -6358,6 +6407,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); diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index ac7a24a049..d8d993fbd8 100644 --- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5469,6 +5469,9 @@ static enum gro_result dev_gro_receive(s +@@ -5470,6 +5470,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7264,6 +7267,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7265,6 +7268,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7314,6 +7359,7 @@ static int __netdev_upper_dev_link(struc +@@ -7315,6 +7360,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7407,6 +7453,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7408,6 +7454,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -8137,6 +8184,7 @@ int dev_set_mac_address(struct net_devic +@@ -8138,6 +8185,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch index a6ef897869..a3b71b1896 100644 --- a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch +++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau static int netif_rx_internal(struct sk_buff *skb); static int call_netdevice_notifiers_info(unsigned long val, -@@ -5911,6 +5912,11 @@ void __napi_schedule(struct napi_struct +@@ -5912,6 +5913,11 @@ void __napi_schedule(struct napi_struct { unsigned long flags; @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau local_irq_save(flags); ____napi_schedule(this_cpu_ptr(&softnet_data), n); local_irq_restore(flags); -@@ -5958,6 +5964,11 @@ EXPORT_SYMBOL(napi_schedule_prep); +@@ -5959,6 +5965,11 @@ EXPORT_SYMBOL(napi_schedule_prep); */ void __napi_schedule_irqoff(struct napi_struct *n) { @@ -119,7 +119,7 @@ Signed-off-by: Felix Fietkau ____napi_schedule(this_cpu_ptr(&softnet_data), n); } EXPORT_SYMBOL(__napi_schedule_irqoff); -@@ -6219,9 +6230,89 @@ static void init_gro_hash(struct napi_st +@@ -6220,9 +6231,89 @@ static void init_gro_hash(struct napi_st napi->gro_bitmask = 0; } @@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau INIT_LIST_HEAD(&napi->poll_list); hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED); napi->timer.function = napi_watchdog; -@@ -6238,6 +6329,7 @@ void netif_napi_add(struct net_device *d +@@ -6239,6 +6330,7 @@ void netif_napi_add(struct net_device *d #ifdef CONFIG_NETPOLL napi->poll_owner = -1; #endif @@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau set_bit(NAPI_STATE_SCHED, &napi->state); set_bit(NAPI_STATE_NPSVC, &napi->state); list_add_rcu(&napi->dev_list, &dev->napi_list); -@@ -6278,6 +6370,7 @@ static void flush_gro_hash(struct napi_s +@@ -6279,6 +6371,7 @@ static void flush_gro_hash(struct napi_s void netif_napi_del(struct napi_struct *napi) { might_sleep(); @@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau if (napi_hash_del(napi)) synchronize_net(); list_del_init(&napi->dev_list); -@@ -6290,50 +6383,18 @@ EXPORT_SYMBOL(netif_napi_del); +@@ -6291,50 +6384,18 @@ EXPORT_SYMBOL(netif_napi_del); static int napi_poll(struct napi_struct *n, struct list_head *repoll) { @@ -280,7 +280,7 @@ Signed-off-by: Felix Fietkau /* Some drivers may have called napi_schedule * prior to exhausting their budget. -@@ -10313,6 +10374,10 @@ static int __init net_dev_init(void) +@@ -10314,6 +10375,10 @@ static int __init net_dev_init(void) sd->backlog.weight = weight_p; } diff --git a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch index cb421f164b..653a782f52 100644 --- a/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch +++ b/target/linux/generic/pending-5.4/768-net-dsa-mv88e6xxx-Request-assisted-learning-on-CPU-port.patch @@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c -@@ -5080,6 +5080,7 @@ static int mv88e6xxx_register_switch(str +@@ -5076,6 +5076,7 @@ static int mv88e6xxx_register_switch(str ds->ops = &mv88e6xxx_switch_ops; ds->ageing_time_min = chip->info->age_time_coeff; ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX; diff --git a/target/linux/ipq40xx/patches-5.4/100-GPIO-add-named-gpio-exports.patch b/target/linux/ipq40xx/patches-5.4/100-GPIO-add-named-gpio-exports.patch index d4ea379159..805836fcca 100644 --- a/target/linux/ipq40xx/patches-5.4/100-GPIO-add-named-gpio-exports.patch +++ b/target/linux/ipq40xx/patches-5.4/100-GPIO-add-named-gpio-exports.patch @@ -93,7 +93,7 @@ Signed-off-by: John Crispin +module_platform_driver(gpio_export_driver); --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c -@@ -563,7 +563,7 @@ static struct class gpio_class = { +@@ -571,7 +571,7 @@ static struct class gpio_class = { * * Returns zero on success, else an error. */ @@ -102,7 +102,7 @@ Signed-off-by: John Crispin { struct gpio_chip *chip; struct gpio_device *gdev; -@@ -625,6 +625,8 @@ int gpiod_export(struct gpio_desc *desc, +@@ -633,6 +633,8 @@ int gpiod_export(struct gpio_desc *desc, offset = gpio_chip_hwgpio(desc); if (chip->names && chip->names[offset]) ioname = chip->names[offset]; @@ -111,7 +111,7 @@ Signed-off-by: John Crispin dev = device_create_with_groups(&gpio_class, &gdev->dev, MKDEV(0, 0), data, gpio_groups, -@@ -646,6 +648,12 @@ err_unlock: +@@ -654,6 +656,12 @@ err_unlock: gpiod_dbg(desc, "%s: status %d\n", __func__, status); return status; } diff --git a/target/linux/lantiq/patches-5.4/0030-GPIO-add-named-gpio-exports.patch b/target/linux/lantiq/patches-5.4/0030-GPIO-add-named-gpio-exports.patch index 419516978c..cb75acded2 100644 --- a/target/linux/lantiq/patches-5.4/0030-GPIO-add-named-gpio-exports.patch +++ b/target/linux/lantiq/patches-5.4/0030-GPIO-add-named-gpio-exports.patch @@ -136,7 +136,7 @@ Signed-off-by: John Crispin { --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c -@@ -563,7 +563,7 @@ static struct class gpio_class = { +@@ -571,7 +571,7 @@ static struct class gpio_class = { * * Returns zero on success, else an error. */ @@ -145,7 +145,7 @@ Signed-off-by: John Crispin { struct gpio_chip *chip; struct gpio_device *gdev; -@@ -625,6 +625,8 @@ int gpiod_export(struct gpio_desc *desc, +@@ -633,6 +633,8 @@ int gpiod_export(struct gpio_desc *desc, offset = gpio_chip_hwgpio(desc); if (chip->names && chip->names[offset]) ioname = chip->names[offset]; @@ -154,7 +154,7 @@ Signed-off-by: John Crispin dev = device_create_with_groups(&gpio_class, &gdev->dev, MKDEV(0, 0), data, gpio_groups, -@@ -646,6 +648,12 @@ err_unlock: +@@ -654,6 +656,12 @@ err_unlock: gpiod_dbg(desc, "%s: status %d\n", __func__, status); return status; } diff --git a/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch b/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch index 5f056a64e1..9e020c3c61 100644 --- a/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch +++ b/target/linux/layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch @@ -152,7 +152,7 @@ This reverts commit cf9441adb1a35506d7606866c382b9d8614169b5. dev_name(&pdev->dev), asrc_priv); --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c -@@ -977,8 +977,10 @@ static int fsl_esai_probe(struct platfor +@@ -979,8 +979,10 @@ static int fsl_esai_probe(struct platfor PTR_ERR(esai_priv->spbaclk)); irq = platform_get_irq(pdev, 0); diff --git a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch index 4c939e8017..7938751124 100644 --- a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch +++ b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch @@ -51,7 +51,7 @@ Signed-off-by: David S. Miller struct ethtool_eee *p = &priv->dev->ports[port].eee; --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c -@@ -1508,7 +1508,9 @@ static void gswip_phylink_mac_link_down( +@@ -1657,7 +1657,9 @@ static void gswip_phylink_mac_link_down( static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface, diff --git a/target/linux/mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch b/target/linux/mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch deleted file mode 100644 index 1fbbe8b506..0000000000 --- a/target/linux/mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: "Marek Behún" -To: Gregory CLEMENT -Cc: "Marek Behún" , Rui Salvaterra , "Uwe Kleine-König" , linux-arm-kernel@lists.infradead.org, Andrew Lunn , stable@vger.kernel.org -Subject: [PATCH mvebu-dt] ARM: dts: turris-omnia: configure LED[2]/INTn pin as interrupt pin -Date: Sun, 21 Feb 2021 00:11:44 +0100 -Message-Id: <20210220231144.32325-1-kabel@kernel.org> -X-Mailer: git-send-email 2.26.2 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use the `marvell,reg-init` DT property to configure the LED[2]/INTn pin -of the Marvell 88E1514 ethernet PHY on Turris Omnia into interrupt mode. - -Without this the pin is by default in LED[2] mode, and the Marvell PHY -driver configures LED[2] into "On - Link, Blink - Activity" mode. - -This fixes the issue where the pca9538 GPIO/interrupt controller (which -can't mask interrupts in HW) received too many interrupts and after a -time started ignoring the interrupt with error message: - IRQ 71: nobody cared - -There is a work in progress to have the Marvell PHY driver support -parsing PHY LED nodes from OF and registering the LEDs as Linux LED -class devices. Once this is done the PHY driver can also automatically -set the pin into INTn mode if it does not find LED[2] in OF. - -Until then, though, we fix this via `marvell,reg-init` DT property. - -Signed-off-by: Marek Behún -Reported-by: Rui Salvaterra -Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") -Cc: Uwe Kleine-König -Cc: linux-arm-kernel@lists.infradead.org -Cc: Andrew Lunn -Cc: Gregory CLEMENT -Cc: - ---- - -This patch fixes bug introduced with the commit that added Turris -Omnia's DTS (26ca8b52d6e1), but will not apply cleanly because there is -commit 8ee4a5f4f40d which changed node name and node compatible -property and this commit did not go into stable. - -So either commit 8ee4a5f4f40d has also to go into stable before this, or -this patch has to be fixed a little in order to apply to 4.14+. - -Please let me know how should I handle this. - ---- - arch/arm/boot/dts/armada-385-turris-omnia.dts | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm/boot/dts/armada-385-turris-omnia.dts -+++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts -@@ -254,6 +254,7 @@ - status = "okay"; - compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22"; - reg = <1>; -+ marvell,reg-init = <3 18 0 0x4985>; - - /* irq is connected to &pcawan pin 7 */ - }; diff --git a/target/linux/ramips/patches-5.4/0024-GPIO-add-named-gpio-exports.patch b/target/linux/ramips/patches-5.4/0024-GPIO-add-named-gpio-exports.patch index d4ea379159..805836fcca 100644 --- a/target/linux/ramips/patches-5.4/0024-GPIO-add-named-gpio-exports.patch +++ b/target/linux/ramips/patches-5.4/0024-GPIO-add-named-gpio-exports.patch @@ -93,7 +93,7 @@ Signed-off-by: John Crispin +module_platform_driver(gpio_export_driver); --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c -@@ -563,7 +563,7 @@ static struct class gpio_class = { +@@ -571,7 +571,7 @@ static struct class gpio_class = { * * Returns zero on success, else an error. */ @@ -102,7 +102,7 @@ Signed-off-by: John Crispin { struct gpio_chip *chip; struct gpio_device *gdev; -@@ -625,6 +625,8 @@ int gpiod_export(struct gpio_desc *desc, +@@ -633,6 +633,8 @@ int gpiod_export(struct gpio_desc *desc, offset = gpio_chip_hwgpio(desc); if (chip->names && chip->names[offset]) ioname = chip->names[offset]; @@ -111,7 +111,7 @@ Signed-off-by: John Crispin dev = device_create_with_groups(&gpio_class, &gdev->dev, MKDEV(0, 0), data, gpio_groups, -@@ -646,6 +648,12 @@ err_unlock: +@@ -654,6 +656,12 @@ err_unlock: gpiod_dbg(desc, "%s: status %d\n", __func__, status); return status; } From 62099d98e4746d8a4e9ee79360314c1900c8974e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20St=C3=B6veken?= Date: Thu, 25 Feb 2021 19:49:10 +0100 Subject: [PATCH 4/5] ath79: fix USB power on TP-Link TL-WR810N v1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: Kernel reported "usb_vbus: disabling" and the USB was not providing power After: USB power is switched on, peripheral is powered from the device Signed-off-by: Tom Stöveken [squash and tidy up] Signed-off-by: Adrian Schmutzler (cherry picked from commit a6f7268dc7519b57251532fe4239412e8acf4ca7) --- target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts b/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts index 6749479616..227f57b9b4 100644 --- a/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts +++ b/target/linux/ath79/dts/qca9531_tplink_tl-wr810n-v1.dts @@ -13,6 +13,7 @@ regulator-max-microvolt = <5000000>; gpio = <&gpio 11 GPIO_ACTIVE_HIGH>; enable-active-high; + regulator-always-on; }; }; From d7fd690b8c3a08bbd267b551873f64e8f58fb25b Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 1 Apr 2021 01:20:45 +0200 Subject: [PATCH 5/5] ath79: force SGMII SerDes mode to MAC operation The mode on the SGMII SerDes on the QCA9563 is 1000 Base-X by default. This only allows for 1000 Mbit/s links, however when used with an SGMII PHY in 100 Mbit/s link mode, the link remains dead. This strictly has nothing to do with the SerDes calibration, however it is done at the same point in the QCA reference U-Boot which is the blueprint for everything happening here. As the current state is more or less a hack, this should be fine. This fixes the issues outlined above on a TP-Link EAP-225 Outdoor. Reported-by: Tom Herbers Tested-by: Tom Herbers Signed-off-by: David Bauer (cherry picked from commit fbbad9a9a629b388626b477e6cd692c160f63fb3) --- .../drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 5 +++++ .../ath79/patches-5.4/0040-ath79-sgmii-config.patch | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 target/linux/ath79/patches-5.4/0040-ath79-sgmii-config.patch diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 07d9992ca7..84b0f9e4ac 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -602,6 +602,11 @@ static void ag71xx_sgmii_serdes_init_qca956x(struct device_node *np) goto err_iomap; } + t = __raw_readl(gmac_base + QCA956X_GMAC_REG_SGMII_CONFIG); + t &= ~(QCA956X_SGMII_CONFIG_MODE_CTRL_MASK << QCA956X_SGMII_CONFIG_MODE_CTRL_SHIFT); + t |= QCA956X_SGMII_CONFIG_MODE_CTRL_SGMII_MAC; + __raw_writel(t, gmac_base + QCA956X_GMAC_REG_SGMII_CONFIG); + pr_debug("%pOF: fixup SERDES calibration to value %i\n", np_dev, serdes_cal); t = __raw_readl(gmac_base + QCA956X_GMAC_REG_SGMII_SERDES); diff --git a/target/linux/ath79/patches-5.4/0040-ath79-sgmii-config.patch b/target/linux/ath79/patches-5.4/0040-ath79-sgmii-config.patch new file mode 100644 index 0000000000..bf7cbf2716 --- /dev/null +++ b/target/linux/ath79/patches-5.4/0040-ath79-sgmii-config.patch @@ -0,0 +1,9 @@ +--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h ++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h +@@ -1376,5 +1376,6 @@ + + #define QCA956X_SGMII_CONFIG_MODE_CTRL_SHIFT 0 + #define QCA956X_SGMII_CONFIG_MODE_CTRL_MASK 0x7 ++#define QCA956X_SGMII_CONFIG_MODE_CTRL_SGMII_MAC 0x2 + + #endif /* __ASM_MACH_AR71XX_REGS_H */