aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
Commit message (Collapse)AuthorAgeFilesLines
* realtek: add support for HPE 1920-8g-poe+ (65W)Kevin Jilissen2023-10-143-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware information: --------------------- - RTL8380 SoC - 8 Gigabit RJ45 PoE ports (built-in RTL8218B) - 2 SFP ports (built-in SerDes) - RJ45 RS232 port on front panel - 32 MiB NOR Flash - 128 MiB DDR3 DRAM - PT7A7514 watchdog - PoE chip - Fanless Known issues: --------------------- - PoE LEDs are uncontrolled. (Manual taken from f2f09bc) Booting initramfs image: ------------------------ - Prepare a FTP or TFTP server serving the OpenWrt initramfs image and connect the server to a switch port. - Connect to the console port of the device and enter the extended boot menu by typing Ctrl+B when prompted. - Choose the menu option "<3> Enter Ethernet SubMenu". - Set network parameters via the option "<5> Modify Ethernet Parameter". Enter the FTP/TFTP filename as "Load File Name" ("Target File Name" can be left blank, it is not required for booting from RAM). Note that the configuration is saved on flash, so it only needs to be done once. - Select "<1> Download Application Program To SDRAM And Run". Initial installation: --------------------- - Boot an initramfs image as described above, then use sysupgrade to install OpenWrt permanently. After initial installation, the bootloader needs to be configured to load the correct image file - Enter the extended boot menu again and choose "<4> File Control", then select "<2> Set Application File type". - Enter the number of the file "openwrt-kernel.bin" (should be 1), and use the option "<1> +Main" to select it as boot image. - Choose "<0> Exit To Main Menu" and then "<1> Boot System". NOTE: The bootloader on these devices can only boot from the VFS filesystem which normally spans most of the flash. With OpenWrt, only the first part of the firmware partition contains a valid filesystem, the rest is used for rootfs. As the bootloader does not know about this, you must not do any file operations in the bootloader, as this may corrupt the OpenWrt installation (selecting the boot image is an exception, as it only stores a flag in the bootloader data, but doesn't write to the filesystem). Example PoE config file (/etc/config/poe): --------------------- config global option budget '65' config port option enable '1' option id '1' option name 'lan8' option poe_plus '1' option priority '2' config port option enable '1' option id '2' option name 'lan7' option poe_plus '1' option priority '2' config port option enable '1' option id '3' option name 'lan6' option poe_plus '1' option priority '2' config port option enable '1' option id '4' option name 'lan5' option poe_plus '1' option priority '2' config port option enable '1' option id '5' option name 'lan4' option poe_plus '1' option priority '2' config port option enable '1' option id '6' option name 'lan3' option poe_plus '1' option priority '2' config port option enable '1' option id '7' option name 'lan2' option poe_plus '1' option priority '2' config port option enable '1' option id '8' option name 'lan1' option poe_plus '1' option priority '2' Signed-off-by: Kevin Jilissen <info@kevinjilissen.nl> (cherry picked from commit f4ee08677cdeefba7cfda40a830b6b747c6ea36e)
* realtek: rename hpe,1920-8g-poe to match hardwareKevin Jilissen2023-10-144-8/+9
| | | | | | | | | | | | | | There are two hardware models of the HPE 1920-8g-poe switch. The version currently in the repository is the model with a PoE budget of 180W. In preparation of the addition of the 65W model, the existing model is renamed to clarify the hardware version it targets. As suggested by Pawel, the 'SUPPORTED_DEVICES' includes the old target name to enable an upgrade path of builds with the old name. Suggested-by: Pawel Dembicki <paweldembicki@gmail.com> Signed-off-by: Kevin Jilissen <info@kevinjilissen.nl> (cherry picked from commit 987c96e88927094ff61e83870f872f0560d8e5c1)
* realtek: 5.15: rtl93xx: support 2500baseT and 5000baseT on USXGMII linksTobias Schramm2023-10-081-1/+4
| | | | | | | | | | | | | | | | | | The USXGMII implementation of Realtek switches can not only support 10GbE but also 2.5Gb and 5Gb on top of the usual data rates. Mark those as supported to allow them to be negotiated. This change has been tested on a ZyXEL XGS1250-12 with the following link partners: - NWA50AX Pro (2.5Gb) - RTL8152 USB NIC (2.5Gb) - AQC111 USB NIC (2.5Gb & 5Gb) Gbit and 10GbE has also been tested to still work fine with a variety of devices. Signed-off-by: Tobias Schramm <tobias@t-sys.eu> (cherry picked from commit cd56a682326f9de4d77ee3afb99d13d25c478c08)
* rtl83xx: fix STP by trapping BPDUsRudolf Vesely2023-10-081-1/+1
| | | | | | | | | | | | Fix Spanning Tree Protocol (STP) by changing COPY2CPU which currently makes switch to ignore Bridge Protocol Data Units (BPDUs). Tested on Zyxel GS1900-8, 24 and 48. Signed-off-by: Rudolf Vesely <i@rudolfvesely.com> [ improve commit description and add new line in different sections ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit 41fcc617f94601072d304f2f68e12cf1dd058707)
* generic: add patch for GPON-ONU-34-20BI quirkChristian Marangi2023-10-052-2/+2
| | | | | | | Backport patch merged upstream adding quirk for SFP GPON-ONU-34-20BI. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit 86dadeba482e2ed41f1ccc95fc7739d85a5709c0)
* rtl93xx: fix condition intended to only select internal serdes portsPeter Körner2023-10-031-1/+1
| | | | | | | | | | | | | | This condition was introduced in commit 51c8f7661244 ("realtek: Improve MAC config handling for all SoCs") to correctly report the speed of the internal serdes ports as 10G, but instead makes all ports read 10G because the or-operator should have been an and-operator. Fixes: #9953 Fixes: 51c8f7661244 ("realtek: Improve MAC config handling for all SoCs") Signed-off-by: Peter Körner <git@mazdermind.de> [ wrap comment to 72 column and improve commit ref ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit 9fb5082e258ac4672dc69636e5eb79f426defac8)
* kernel: bump 5.15 to 5.15.132John Audia2023-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.132 Removed upstreamed: bcm53xx/patches-5.15/037-v6.6-0006-ARM-dts-BCM53573-Add-cells-sizes-to-PCIe-node.patch[1] bcm53xx/patches-5.15/037-v6.6-0007-ARM-dts-BCM53573-Use-updated-spi-gpio-binding-proper.patch[2] bcm53xx/patches-5.15/037-v6.6-0008-ARM-dts-BCM5301X-Extend-RAM-to-full-256MB-for-Linksy.patch[3] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.132&id=b35f3ca1877e024887df205ede952863d65dad36 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.132&id=2840d9b9c8750be270fb1153ccd5b983cbb5d592 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.132&id=f086e859ddc252c32f0438edff241859c0f022ce Build system: x86_64 Build-tested: ramips/tplink_archer-a6-v3 Run-tested: ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me> (cherry picked from commit ac422c9788fbb3510b1fddaefc8816bea6601479) [Refresh on top of OpenWrt 23.05] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* generic: sync MediaTek Ethernet driver with upstreamDaniel Golle2023-09-042-5/+5
| | | | | | | | Import commits from upstream Linux replacing some downstream patches. Move accepted patches from pending-{5.15,6.1} to backport-{5.15,6.1}. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit f631c7bbb16f1d39d59c4cdf3f7189abab4fd9c6)
* generic: backport initial LEDs hw control supportChristian Marangi2023-09-046-13/+13
| | | | | | | | | | | | | | Backport initial LEDs hw control support. Currently this is limited to only rx/tx and link events for the netdev trigger but the API got accepted and the additional modes are working on and will be backported later. Refresh every patch and add the additional config flag for QCA8K new LEDs support. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 0a4b309f41062ef40706162ae53b6428982a0685)
* kernel: bump 5.15 to 5.15.125John Audia2023-08-101-1/+1
| | | | | | | | | | | | | 1. Add new symbols to generic config 2. Bump kernel Changelog: https://lore.kernel.org/stable/2023080818-groin-gradient-a031@gregkh/ All patches automatically rebased. Signed-off-by: John Audia <therealgraysky@proton.me> [Refreshed on top of OpenWrt 23.05] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (cherry picked from commit daed3322d347cae5fa538907b5f1fa5d5cfc08c6)
* kernel: bump 5.15 to 5.15.124John Audia2023-08-101-1/+1
| | | | | | | | | | | | | | | | Changelog: https://lore.kernel.org/stable/2023080341-curliness-salary-4158@gregkh/ 1. Needed to make a change to to package/kernel/linux/modules/netsupport.mk due to upstream moving vxlan to its own directory[1]. @john-tho suggested using the the 6.1 xvlan FILES to circumvent. 2. All patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.124&id=77396fa9096abdbfbb87d63e73ad44d5621cf103 Signed-off-by: John Audia <therealgraysky@proton.me> [Refreshed on top of OpenWrt 23.05] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (cherry picked from commit 81c1172c3626157ff9a146430cd14e32c9c80a5a)
* realtek: add support for HPE 1920-8g-poe+Pawel Dembicki2023-08-096-108/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware information: --------------------- - RTL8380 SoC - 8 Gigabit RJ45 PoE ports (built-in RTL8218B) - 2 SFP ports (built-in SerDes) - RJ45 RS232 port on front panel - 32 MiB NOR Flash - 128 MiB DDR3 DRAM - PT7A7514 watchdog - PoE chips: Nuvoton M0516LDE + BCM59121 Known issues: --------------------- - PoE LEDs are uncontrolled. (Manual taken from f2f09bc00280) Booting initramfs image: ------------------------ - Prepare a FTP or TFTP server serving the OpenWrt initramfs image and connect the server to a switch port. - Connect to the console port of the device and enter the extended boot menu by typing Ctrl+B when prompted. - Choose the menu option "<3> Enter Ethernet SubMenu". - Set network parameters via the option "<5> Modify Ethernet Parameter". Enter the FTP/TFTP filename as "Load File Name" ("Target File Name" can be left blank, it is not required for booting from RAM). Note that the configuration is saved on flash, so it only needs to be done once. - Select "<1> Download Application Program To SDRAM And Run". Initial installation: --------------------- - Boot an initramfs image as described above, then use sysupgrade to install OpenWrt permanently. After initial installation, the bootloader needs to be configured to load the correct image file - Enter the extended boot menu again and choose "<4> File Control", then select "<2> Set Application File type". - Enter the number of the file "openwrt-kernel.bin" (should be 1), and use the option "<1> +Main" to select it as boot image. - Choose "<0> Exit To Main Menu" and then "<1> Boot System". NOTE: The bootloader on these devices can only boot from the VFS filesystem which normally spans most of the flash. With OpenWrt, only the first part of the firmware partition contains a valid filesystem, the rest is used for rootfs. As the bootloader does not know about this, you must not do any file operations in the bootloader, as this may corrupt the OpenWrt installation (selecting the boot image is an exception, as it only stores a flag in the bootloader data, but doesn't write to the filesystem). Example PoE config file (/etc/config/poe): --------------------- config global option budget '180' config port option enable '1' option id '1' option name 'lan8' option poe_plus '1' option priority '2' config port option enable '1' option id '2' option name 'lan7' option poe_plus '1' option priority '2' config port option enable '1' option id '3' option name 'lan6' option poe_plus '1' option priority '2' config port option enable '1' option id '4' option name 'lan5' option poe_plus '1' option priority '2' config port option enable '1' option id '5' option name 'lan4' option poe_plus '1' option priority '2' config port option enable '1' option id '6' option name 'lan3' option poe_plus '1' option priority '2' config port option enable '1' option id '7' option name 'lan2' option poe_plus '1' option priority '2' config port option enable '1' option id '8' option name 'lan1' option poe_plus '1' option priority '2' Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> (cherry picked from commit b370753fc409eb2220af7caed9ffd66beed2d041)
* kernel: bump 5.15 to 5.15.118John Audia2023-06-252-2/+2
| | | | | | | | | | | All patches automatically rebased. Build system: x86_64 Build-tested: ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me> (cherry picked from commit 1f5fce27c195373fedcf233a48470de97752058f)
* realtek: eth: Do not write directly to dev->addrOlliver Schinagl2023-06-121-11/+13
| | | | | | | | | | One is never to write to dev->addr directly. In 6.1 it will be a const and with the newly enabled WERROR, we get a failing grade. Lets fix this ahead of time. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> (cherry picked from commit d881f65da1e6f3bc4237b39cf2373bef51c3828c)
* realtek: Add missing headersOlliver Schinagl2023-06-127-0/+8
| | | | | | | | We are missing a bunch of headers, which trigger errors on 6.1, probably due to changed header-in-header dependencies. Best add them now. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> (cherry picked from commit 9fb1dbb1df35911b407fa0faaa2443fbc0f0ddde)
* kernel: bump 5.15 to 5.15.113John Audia2023-05-291-1/+1
| | | | | | | | | | | All patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me> (cherry picked from commit c815ecdebd77c3484f2cd0ef21e4c69d274ef33a)
* generic: mt7530: backport support for the MT7988 built-in switchDaniel Golle2023-05-242-3/+3
| | | | | | | | | | | | | | | | | Backport commits adding support for the MT7988 built-in switch to the mt7530 driver. This change results in the Kconfig symbol NET_DSA_MT7530 to be extended by NET_DSA_MT7530_MDIO (everything formally covered by NET_DSA_MT7530) and NET_DSA_MT7530_MMIO (a new driver for the MMIO-connected built-in switch of the MT7988 SoC). Select NET_DSA_MT7530_MDIO for all targets previously selecting NET_DSA_MT7530, with the exception of mediatek/filogic which also selects NET_DSA_MT7530_MMIO. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 958fdf36e35c814eb83faf2c39db4ca379c921b5)
* kernel: backport Motorcomm YT8521/YT8531 supportTianling Shen2023-05-181-1/+1
| | | | | | It will be used on NanoPi R2C and OrangePi R1 Plus LTS board. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
* treewide: remove files for building 5.10 kernelNick Hainke2023-05-12140-40059/+0
| | | | | | | | | | | All targets are bumped to 5.15. Remove the old 5.10 patches, configs and files using: find target/linux -iname '*-5.10' -exec rm -r {} \; Further, remove the 5.10 include. Signed-off-by: Nick Hainke <vincent@systemli.org>
* realtek: 5.15: replace fallthrough comment for rtl838x ethernet driverChristian Marangi2023-05-121-1/+1
| | | | | | | | | | | | | | Replace fallthrough comment with fallthrough macro for rtl838x ethernet driver. Fix compilarion warning: drivers/net/ethernet/rtl838x_eth.c: In function 'rtl930x_mdio_reset': drivers/net/ethernet/rtl838x_eth.c:1959:43: error: this statement may fall through [-Werror=implicit-fallthrough=] 1959 | private_poll_mask |= BIT(i); drivers/net/ethernet/rtl838x_eth.c:1961:17: note: here 1961 | case PHY_INTERFACE_MODE_USXGMII: | ^~~~ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* realtek: 5.15: fix uninizialized variable in rtl83xx qos driverChristian Marangi2023-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Fix uninizialized variable in rtl83xx qos driver Fix compilation error: drivers/net/dsa/rtl83xx/qos.c: In function 'rtl838x_setup_prio2queue_matrix': drivers/net/dsa/rtl83xx/qos.c:298:19: error: 'v' is used uninitialized [-Werror=uninitialized] 298 | v |= i << (min_queues[i] * 3); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/dsa/rtl83xx/qos.c:294:13: note: 'v' was declared here 294 | u32 v; | ^ drivers/net/dsa/rtl83xx/qos.c: In function 'rtl83xx_setup_prio2queue_cpu_matrix': drivers/net/dsa/rtl83xx/qos.c:320:19: error: 'v' is used uninitialized [-Werror=uninitialized] 320 | v |= max_queues[i] << (i * 3); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/dsa/rtl83xx/qos.c:316:13: note: 'v' was declared here 316 | u32 v; | ^ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* realtek: 5.15: comment unused part of realtek ethernet driverChristian Marangi2023-05-127-253/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Comment unused part of realtek phy driver. Fix compilation warning: drivers/net/phy/rtl83xx-phy.c: In function 'rtl8380_configure_int_rtl8218b': drivers/net/phy/rtl83xx-phy.c:747:21: error: unused variable 'ipd_flag' [-Werror=unused-variable] 747 | int ipd_flag = 1; | ^~~~~~~~ drivers/net/phy/rtl83xx-phy.c: At top level: drivers/net/phy/rtl83xx-phy.c:3333:13: error: 'rtl931x_sds_disable' defined but not used [-Werror=unused-function] 3333 | static void rtl931x_sds_disable(u32 sds) | ^~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Comment unused part of realtek dsa driver. Fix compilation warning: drivers/net/dsa/rtl83xx/common.c: In function 'rtl83xx_fib_event': drivers/net/dsa/rtl83xx/common.c:1430:58: error: unused variable 'fen6_info' [-Werror=unused-variable] 1430 | struct fib6_entry_notifier_info *fen6_info = ptr; | ^~~~~~~~~ drivers/net/dsa/rtl83xx/common.c: At top level: drivers/net/dsa/rtl83xx/common.c:531:12: error: 'rtl83xx_octet_cntr_alloc' defined but not used [-Werror=unused-function] 531 | static int rtl83xx_octet_cntr_alloc(struct rtl838x_switch_priv *priv) | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Drop unused priv in realtek dsa driver. Fix compilation warning: drivers/net/dsa/rtl83xx/dsa.c: In function 'rtl83xx_port_lag_change': drivers/net/dsa/rtl83xx/dsa.c:2016:37: error: unused variable 'priv' [-Werror=unused-variable] 2016 | struct rtl838x_switch_priv *priv = ds->priv; | ^~~~ cc1: all warnings being treated as errors Comment rtl838x_pie_rule_dump in realtek dsa driver for rtl83xx Fix compilation warning: drivers/net/dsa/rtl83xx/rtl838x.c:1294:13: error: 'rtl838x_pie_rule_dump' defined but not used [-Werror=unused-function] 1294 | static void rtl838x_pie_rule_dump(struct pie_rule *pr) | ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Comment multiple function in realtek dsa driver for rtl930x Fix compilation warning: drivers/net/dsa/rtl83xx/rtl930x.c:1463:12: error: 'rtl930x_l3_intf_add' defined but not used [-Werror=unused-function] 1463 | static int rtl930x_l3_intf_add(struct rtl838x_switch_priv *priv, struct rtl838x_l3_intf *intf) | ^~~~~~~~~~~~~~~~~~~ drivers/net/dsa/rtl83xx/rtl930x.c:1414:12: error: 'rtl930x_l3_mtu_del' defined but not used [-Werror=unused-function] 1414 | static int rtl930x_l3_mtu_del(struct rtl838x_switch_priv *priv, int mtu) | ^~~~~~~~~~~~~~~~~~ drivers/net/dsa/rtl83xx/rtl930x.c:995:12: error: 'rtl930x_l3_hash6' defined but not used [-Werror=unused-function] 995 | static u32 rtl930x_l3_hash6(struct in6_addr *ip6, int algorithm, bool move_dip) | ^~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors drivers/net/dsa/rtl83xx/rtl930x.c:1690:13: error: 'rtl930x_read_pie_fixed_fields' defined but not used [-Werror=unused-function] 1690 | static void rtl930x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/dsa/rtl83xx/rtl930x.c:1432:12: error: 'rtl930x_l3_mtu_add' defined but not used [-Werror=unused-function] 1432 | static int rtl930x_l3_mtu_add(struct rtl838x_switch_priv *priv, int mtu) | ^~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Comment rtl931x_read_pie_fixed_fields in realtek dsa driver for rtl931x Fix compilation warning: drivers/net/dsa/rtl83xx/rtl931x.c:1116:13: error: 'rtl931x_read_pie_fixed_fields' defined but not used [-Werror=unused-function] 1116 | static void rtl931x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Comment rtl93xx_header_vlan_set in realtek ethernet driver for rtl838x Fix compilation warning: drivers/net/ethernet/rtl838x_eth.c: At top level: drivers/net/ethernet/rtl838x_eth.c:164:13: error: 'rtl93xx_header_vlan_set' defined but not used [-Werror=unused-function] 164 | static void rtl93xx_header_vlan_set(struct p_hdr *h, int vlan) | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* realtek: 5.15: fix warning for i2c_mii_valid_phy_id and i2c_mii_phy_addrChristian Marangi2023-05-121-35/+15
| | | | | | | | | | | | | | | | Rework exposing i2c_mii_valid_phy_id and i2c_mii_phy_addr in global include. Fix compilation warning: In file included from drivers/net/phy/sfp.c:11: ./include/linux/mdio/mdio-i2c.h:27:21: error: 'i2c_mii_phy_addr' defined but not used [-Werror=unused-function] 27 | static unsigned int i2c_mii_phy_addr(int phy_id) | ^~~~~~~~~~~~~~~~ ./include/linux/mdio/mdio-i2c.h:22:13: error: 'i2c_mii_valid_phy_id' defined but not used [-Werror=unused-function] 22 | static bool i2c_mii_valid_phy_id(int phy_id) | ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* realtek: 5.15: fix compilation warning with PHY_INTERFACE_MODE_HSGMIIChristian Marangi2023-05-121-1/+20
| | | | | | | | | | | | | PHY_INTERFACE_MODE_HSGMII was not handled in phylink_get_linkmodes and phylink_parse_mode. Fix compilation warning by adding it in the enum: drivers/net/phy/phylink.c: In function 'phylink_get_linkmodes': drivers/net/phy/phylink.c:360:9: error: enumeration value 'PHY_INTERFACE_MODE_HSGMII' not handled in switch [-Werror=switch] 360 | switch (interface) { | ^~~~~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* realtek: remove redundant is_lagmember checksJan Hoffmann2023-05-072-26/+4
| | | | | | | | | | | | | All callers of the rtl83xx_mc_group_* functions already do the same check, so these aren't needed. For rtl83xx_mc_group_alloc, this branch also incorrectly returned 0 instead of a negative value. If the branch wasn't effectively dead code anyway, this could potentially have caused bugs, as 0 is a valid multicast group entry index. Fixes: cde31976e375 ("realtek: Add support for Layer 2 Multicast") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: remove store_mcgroups/load_mcgroupsJan Hoffmann2023-05-074-58/+0
| | | | | | | | | | | | | | | | | | | The current implementation only works when store and load are called for the same port without any other calls in between. This is because the store function only saves a single port number instead of a portmask for each group. It also doesn't take into account that the allocation of multicast group entries might change between store/load calls. As a result, the multicast port mask table gets corrupted. This also includes the reserved entry for unknown multicast, which gets corrupted even when no other mdb entries have been added. Remove the code for storing/loading multicast groups entirely, as the original commit message doesn't offer a convincing reason why this would be necessary in the first place. Fixes: 724e4af530cd ("realtek: Store and Restore MC memberships for port enable/disable") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: don't add CPU port to multicast portmasksJan Hoffmann2023-05-072-10/+4
| | | | | | | | | | | | | There shouldn't be any reason to forward all multicast to the CPU. The original commit message also doesn't provide a reason for this seemingly unrelated change. The current implementation of the delete method is also broken, as it entirely removes any entry when the portmask contains only the CPU port, even if it was explicitly created. Fixes: 724e4af530cd ("realtek: Store and Restore MC memberships for port enable/disable") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: actually remove port from multicast portmaskJan Hoffmann2023-05-072-0/+2
| | | | | Fixes: 724e4af530cd ("realtek: Store and Restore MC memberships for port enable/disable") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: don't treat first multicast portmask entry as reservedJan Hoffmann2023-05-072-2/+0
| | | | | | | | | | | | | | There doesn't appear to be a reason to do this, as only the last entry is actually reserved for unknown multicast. This also fixes two issues: - As the increment happened after the bounds check, the value of the actually reserved last entry could be overwritten. - On deletion of entries, a corresponding decrement was missing, causing the wrong entry to be marked as free. Fixes: cde31976e375 ("realtek: Add support for Layer 2 Multicast") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: fix writing/deletion of CAM entriesJan Hoffmann2023-05-072-8/+8
| | | | | | | Actually use the index returned by rtl83xx_find_l2_cam_entry. Fixes: cde31976e375 ("realtek: Add support for Layer 2 Multicast") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: handle changed flags in VLAN configurationJan Hoffmann2023-05-072-37/+43
| | | | | | | | | | | The port_vlan_add method may be called while a port is already a member of that VLAN, so it needs to be able to handle changed flags. Fix it to properly handle when the PVID or UNTAGGED flag was previously set, but now no longer is. To reduce duplication, move PVID configuration to a separate function. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: fix standalone ports in presence of static fdb entriesJan Hoffmann2023-05-078-0/+100
| | | | | | | | | | | | | | | | | | | | The registers L2_PORT_STATIC_MV_ACT seem to specify the action to take when the source address of a packet exists as a static fdb entry on another port. By default the configured action is to drop such packets. For standalone ports, this behaviour is undesired, as all traffic should be forwarded to the CPU. So change the action to forward on standalone ports. A situation where this issue can occur is when a non-offloaded bond interface is part of a bridge. In that case, the CPU port will have fdb entries for devices connected to the bond interface, which are managed by the assisted learning feature. For now, this is only implemented for RTL838x/RTL839x, as the available set of registers differs for the other devices. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: initialize port masks to match the default stateJan Hoffmann2023-05-072-24/+22
| | | | | | | | | | | | | All ports are disabled by default, so configure the port isolation masks and the pm field accordingly in the setup function. When port_enable is called for a port, the isolation masks will be set up so that traffic can flow between the port and the CPU. While at it, change the code to also use the traffic_set method in rtl83xx_setup, instead of writing to the RTL838x_PORT_ISO_CTRL(i) registers directly. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: properly update port masks when port leaves bridgeJan Hoffmann2023-05-072-10/+10
| | | | | | | | | | | | | | | | | Correctly update the isolation mask of the port being configured. The port_bitmap variable should contain all other bridge members and needs to be actually removed from the isolation mask instead of added to it. Also actually remove the port being configured from the pm field of the other ports, so that any other ports that are currently disabled will be configured correctly when they are enabled. Fixes: df8e6be59a1f ("rtl838x: add new architecture") [fixed updating pm field of other ports] Fixes: 2b88563ee5aa ("realtek: update the tree to the latest refactored version") [reintroduced incorrect pm field update] Fixes: 27029277f98d ("realtek: add switch driver support for the RTL93XX based switches") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: adapt patch description to it's current useNick Hainke2023-05-061-3/+2
| | | | | | The patch is not doing anymore what the descriptions says. Update it. Signed-off-by: Nick Hainke <vincent@systemli.org>
* realtek: hpe_1920-8g: add phy-handle for SFP portsJan Hoffmann2023-04-302-0/+4
| | | | | | | | The switch driver actually expects every port to have a PHY handle, and several branches in the code determine if a port is valid by checking for a non-zero phy field. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* kernel: Deactivate CONFIG_LEGACY_PTYSHauke Mehrtens2023-04-298-16/+0
| | | | | | | | | The legacy (BSD) PTY support could open security problems in a system, We do not need them in OpenWrt, deactivate this option in all targets. Debian also deactivates this option. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: bump 5.10 to 5.10.178John Audia2023-04-222-2/+2
| | | | | | | | | | | Removed upstreamed: backport-5.10/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch[1] 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.178&id=0279e82e148407feec88466990de14bcba9e12c0 All other patches automatically rebased. Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.15 to 5.15.108John Audia2023-04-223-3/+3
| | | | | | | | | | | | | | | | | Removed upstreamed: backport-5.15/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch[1] backport-5.15/612-v6.3-skbuff-Fix-a-race-between-coalescing-and-releasing-S.patch[2] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.108&id=85d7a7044b759d865d10395a357632af00de5867 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.108&id=906a6689bb0191ad2a44131a3377006aa098af59 Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
* realtek: Fix typo for EnGenius EWS2910PRaylynn Knight2023-04-071-1/+1
| | | | | | | | Fix mis-typed DEVICE-MODEL in mk file for EnGenius EWS2910P. Signed-off-by: Raylynn Knight <rayknight@me.com> [ fix wrong SoB format and improve commit title/description ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* realtek: refresh patchesDaniel Golle2023-04-032-2/+2
| | | | | | | | Refresh patches which were no longer applying cleanly after a recently added SFP quirk. Fixes: 658b45ce48 ("generic: add quirk for HG MXPD-483II 2500M fiber SFP") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: net: pcs: add driver for MediaTek SGMII PCSDaniel Golle2023-03-273-5/+5
| | | | | | Backport dedicated PCS driver for MediaTek LynxI SGMII/SerDes unit. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* realtek: switch to Kernel 5.15 by defaultPaul Spooren2023-03-141-2/+1
| | | | | | | | | Getting ready for the next release. Tested-by: Sander Vanheule <sander@svanheule.net> Tested-by: Olliver Schinagl <oliver@schinagl.nl> Tested-by: INAGAKI Hiroshi <musashino.open@gmail.com> Signed-off-by: Paul Spooren <mail@aparcar.org>
* kernel: bump 5.15 to 5.15.96John Audia2023-02-281-1/+1
| | | | | | | | | | All patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.15 to 5.15.94John Audia2023-02-181-3/+3
| | | | | | | | | | Patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
* realtek: add support for APRESIA ApresiaLightGS120GT-SSINAGAKI Hiroshi2023-02-133-0/+556
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | APRESIA ApresiaLightGS120GT-SS (APLGS120GTSS) is a 16 + 4 ports gigabit switch, based on RTL8382M. Specifications: - SoC : Realtek RTL8382M - RAM : DDR3 256 MiB (Nanya NT5CC256M8JQ-EK) - Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G) - Ethernet : 10/100/1000 Mbps x16 + 4 - port 1-8 : RTL8218B - port 9-16 : RTL8382M, TP (SoC, RTL8218B) - port 17-20 : RTL8214FC, TP/SFP (Combo) - LEDs/Keys : 3x/1x - UART : through-hole on PCB - J6: 3.3V, TX, RX, GND from tri-angle marking side - 115200n8 - Power : 100-120/200-240 VAC, 50/60 Hz Max. 16 W, Avg 14 W (100 VAC) - Plug : IEC 60320-C13 Flash instruction using factory image: 1. Boot ApresiaLightGS120GT-SS normally 2. Login to WebUI and open firmware page ("ファームウェア") 3. If the device is booted from image1, set active image for next booting ("起動イメージ選択") to image2("イメージ2"), press apply ("適用") button and reboot the device to make booting from image2 4. On the WebUI, set active image to image1 5. Select the OpenWrt factory image and press update button ("更新") 6. Open reboot page ("再起動") and press reboot button ("再起動実行") Notes: - "ApresiaLightGS120GT-SS" is a model name and "APLGS120GTSS" is a model number - this device has 3x GPIO-controlled LEDs on PCB, but 1x LED ("green:unused") has no hole on the case Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* realtek: add common definition of cameo based firmwareINAGAKI Hiroshi2023-02-132-10/+16
| | | | | | | | | | | | The cameo-related recipes can also be used for APRESIA ApresiaLightGS series devices. So create common definition for the devices manufactured by Cameo. And also, the model name of ApresiaLightGS120GT-SS is too long for cameo header (max: 20 bytes), so use additional variable "CAMEO_BOARD_MODEL" in Build/cameo-headers instead of DEVICE_MODEL to use the custom name. (default of CAMEO_BOARD_MODEL: DEVICE_MODEL) Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* realtek: rename cameo specific names in "Build/*" definitionsINAGAKI Hiroshi2023-02-132-10/+10
| | | | | | | | This patch renames some Cameo specific definitions for image generation. The same format is also used on APRESIA ApresiaLightGS series devices, not D-Link specific. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* realtek: fix memory leak in netevent handlerJan Hoffmann2023-02-132-16/+18
| | | | | | | | | The net_event_work struct is allocated, but only freed in a single case. Move the allocation to the branch where it is actually needed, and free it after the work has been done. Fixes: 03e1d93e0779 ("realtek: add driver support for routing offload") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: fix dts whitespaceFelix Baumann2023-02-094-9/+9
| | | | | | Remove whitespace from otherwise empty lines Signed-off-by: Felix Baumann <felix.bau@gmx.de>