Add support for TSW202 PoE switch. This is an RTL8380 based switch
with two SFP slots, and 8 PoE 802.3af one every RJ-45 port.
The max budget is 240W.
The vendor firmware configures the PSE
with a per-port budget of 30.0W.
Specifications:
---------------
* SoC: Realtek RTL8380M
* Flash: 16 MiB SPI NOR W25Q80RV, 8Mb_Serial_Flash, low_power
* RAM: 128 MiB Winbond W631GG8NB 151
* Ethernet: 8x 10/100/1000 Mbps with PoE
2x SFP slots
* Buttons: 1 "Reset" button on front panel
* Power: 48V-54V DC barrel jack
* UART: 1 serial header with terminal on the back side.
With ground, rx, tx, and 3.3V
* PoE: 2 XS2184
* LED: 2 i2c SL74HC164
Works:
------
- (8) RJ-45 ethernet ports
- (2) SFP with ethernet or fiber
- Switch functions
TODO:
------
- LEDs are always on
- Power-over-Ethernet are always on
Install via web interface:
-------------------------
The openwrt firmware will not accept and flash the sysupgrade image.
It is recommended to flash with sysupgrade -n -f over ssh.
Dokumantation, Bootlogs, and Fotos can be found on
https://git.f2a.space/patrick/openwrt-24.10-tsw202/-/wikis/home
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
Link: https://github.com/openwrt/openwrt/pull/21003
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Backport several fixes and enhancements for the rtl8365mb DSA driver
from upstream.
The backport includes the following changes:
- Fix for rtl8_4 tag (from v7.1)
- VLAN and Forwarding offload (from v7.2)
Before this backport, all bridge forwarding was handled by the CPU,
causing a significant performance drop between LAN ports, similar
to standard WAN/LAN routing. Enabling hardware forwarding offload
alleviates CPU overhead and restores line-rate switching performance.
Link: https://patch.msgid.link/20260408-realtek_fixes-v1-0-915ff1404d56@gmail.com
Link: https://patch.msgid.link/20260606-realtek_forward-v13-0-b9e409687cbe@gmail.com
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23738
Signed-off-by: Robert Marko <robimarko@gmail.com>
Since 6.18 RTL8261N support was added to the generic Realtek PHY driver
and was dropped from the downstream driver.
So, fix the missing RTL8261N support by including the Realtek PHY kmod
and the relevant firmware.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Not needed when using nvmem. All others left alone.
Move some swport nvmem definitions to the root gmac to avoid a
randomized MAC address for the GMAC. The former inherits from the latter anyway.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22550
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Userspace handling is deprecated. WAN stuff needs to remain as no DSA
yet.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21119
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Userspace handling was needed before band mac overrides.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22306
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
78110c3 states that the MAC for the WAN interface is LAN + 1.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22306
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
For platform drivers themselves this is not needed. but for gpiochips,
it is to avoid module unload.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Remove the comment since the macro is descriptive enough.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Propagate error code from rb4xx_gpio_cpld_set instead of just returning
0.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Claude seems to get confused by a supposedly NULL of_node. Just use dev.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add an else branch to do so.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23731
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Original ar71xx has this setup:
define WNDAP360_WMAC0_MAC_OFFSET 0x120c
define WNDAP360_WMAC1_MAC_OFFSET 0x520c
/* Reusing wifi MAC with offset of 1 as eth0 MAC */
ath79_init_mac(ath79_eth0_data.mac_addr,
art + WNDAP360_WMAC0_MAC_OFFSET, 1);
ap94_pci_init(art + WNDAP360_CALDATA0_OFFSET,
art + WNDAP360_WMAC0_MAC_OFFSET,
art + WNDAP360_CALDATA1_OFFSET,
art + WNDAP360_WMAC1_MAC_OFFSET);
The ath79 port made a questionable change for eth0 being just art with
no offset. That MAC ends up being the OUI for Atheros.
WNDAP360_WMAC1_MAC_OFFSET is the same as WNDAP360_WMAC0_MAC_OFFSET
except with the first hex value being subtracted by 2, which is not a
valid OUI.
And newer Netgear firmware seems to assign differently as well,
art_120C as a base and the others incremented by 0x8.
Switch the assignment to the latest firmware and add label-mac-device to
document that the first Wi-FI MAC address is printed on the device.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22895
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
of_device.h was used only for of_match_device. That is no longer
used in most places so we can drop the extra header.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23071
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Convert the last remaining userspace eeprom for ath9k to nvmem. Well,
easily converted at least.
wifi MAC has to be handled in userspace as the kernel nvram driver works
on memory mapped addresses, not mtd ones.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14666
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
It appears 683-of_net-add-mac-address-to-of-tree.patch relies on the
mac-address nvmem property being present. These nodes don't need it as
they take it from the eeprom but label-mac-device needs it.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14666
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Selection of Sparx5 hwmon driver for LAN969x was upstreamed, so use that
instead of the downstream patch.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Currently, MDIO driver will print the probe defferal as error.
So, instead of spaming the log, backport the upstream fix for it.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
This commit adds support for the Sirivision SR-ST3408F,
an 8-port 10G switch with 4x RJ45 ports and 4x SFP ports.
SoC: Realtek RTL9303
RAM: 512 MiB DDR3
Flash: SPI-NOR 16 MiB (Winbond)
Ethernet: 4x RJ45 via RTL8261BE PHY (10G/5G/2.5G/1G/100M/10M)
4x SFP+
LEDs: 1x power, 1x system green
2x RJ45 LEDs/port (link/act, 10G)
1x SFP+ LED/port (link/act)
Button: Reset
Console: Cisco-style RJ45, 115200 8n1
Fan: 4040 12V fan (hardwired)
Power: 12V 3A internal PSU
OpenWrt installation
---------------------
1. Attach to serial console using a Cisco cable, 115200 8n1
2. Power on the switch and rapidly press Esc to interrupt U-Boot
3. Initialize the RJ45 ports by running `rtk network on`
4. Serve the initramfs-kernel.bin image on TFTP, IP 192.168.1.111
5. Use any RJ45 port to connect to your TFTP server
6. Run `tftpboot 0x81000000 initramfs-kernel.bin; bootm`
7. Use `mtd dump` or `dd` to backup the original firmware at `mtd5` first
8. Run sysupgrade to flash sysupgrade.bin into the switch and reboot
Restoring original firmware
-----------------------------
Vendor does not provide firmware images, so you should have made a backup.
Use `mtd write` to restore your backed up copy into the `mtd5` partition.
MAC Address
------------
All interfaces are assigned the same MAC address, from the U-Boot env
`ethaddr`. This MAC address is also printed on the device label.
Signed-off-by: Darell Tan <darell.tan@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23686
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This adds STM32 Octo Memory Manager support.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This adds STM32 Camera Serial Interface (CSI) support.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This adds STM32 OCTO and QUAD SPI controller support.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The COMMON_CLK_STM32MP215 option is for clock support on MP215 platforms,
and PINCTRL_STM32_HDP is for Hardware Debug Port pin control. They can be
safely removed.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The stm32 target now supports 6.18 kernel as testing.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Update stm32mp1 kernel config for 6.18.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Patch 700-net-stmmac-dwmac-stm32-add-support-of-phy-supply-pro.patch
introduces phy-supply support in dwmac-stm32 driver. But the phy_power_on()
function always returns 0 even if it failed to drive the regulator. So fix
phy_power_on() to return an error if something wrong happened.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Drop upstreamed patches and refresh remaining ones.
Manually rebased:
- 700-net-stmmac-dwmac-stm32-add-support-of-phy-supply-pro.patch
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This is an automatically generated commit.
When doing `git bisect`, consider `git bisect --skip`.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/22989
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The Extreme Networks AP3935's LAN1 port (gmac0/RGMII to AR8035 at MDIO
addr 1) fails to acquire a link if no Ethernet cable is connected at
power-on; the port stays dead even after a cable is later inserted, and
only a network restart recovers it.
The AR803x family enables hibernation mode by default, this setting
overrides it.
Signed-off-by: Grische <github@grische.xyz>
Link: https://github.com/openwrt/openwrt/pull/23208
Signed-off-by: Robert Marko <robimarko@gmail.com>
Switch to kernel v6.18 and drop v6.12.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22728
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The omap target now supports 6.18 kernel as testing.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22728
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
These were discovered when migrating omap to 6.18.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22728
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This is an automatically generated commit.
When doing `git bisect`, consider `git bisect --skip`.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22728
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Prepare the linux 6.18 update.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22728
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
While still sufficient for the base image, space runs out quickly with
the ~15MiB available in kernel0. The identical space in kernel1 is
unused, and standard installation instructions flash to both areas so it
isn't an easy fallback to stock either.
Merge the regions for kernel0 and kernel1 so there's more space
available to the user to install packages and some data.
Signed-off-by: Fabian Groffen <grobian@bitzolder.nl>
Link: https://github.com/openwrt/openwrt/pull/22316
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Fix label-mac-device alias (from "label-mac") and remove MAC address comments.
Fixes: 1ba7b38cfc ("ramips: add support for Yuncore 1200F")
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/23691
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
A network interface card (NIC) hardware ring of the Realtek Otto switch
SoCs is nothing more than a list of pointers to the ring headers. I.E.
address | content | comment
--------+-----------+------------------------
x + 0 | pointer 0 | points to ring header 0
x + 4 | pointer 1 | points to ring header 1
...
x + 4*n | pointer n | points to ring header n
Headers must be 4 byte aligend. So the lower two bits of the pointers
are unused. Hardware designers desided to give them special meanings.
- Bit 0: Owner of this ring entry, 1 = hardware, 0 = software
- Bit 1: Wrap, 1 = last ring pointer, 0 = normal ring pointer
The driver uses constant defines with slightly confusing naming. Replace
OWN_CPU with OWN_HW to make clear what it is about. Align prefix and
make the defines bitmasks for better readability.
Link: https://github.com/openwrt/openwrt/pull/23676
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Align indentation of defines and move structures to the top of
the source code. This is only cosmetic. No functional changes.
Link: https://github.com/openwrt/openwrt/pull/23676
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>