Moves common definitions to separate include file.
Signed-off-by: Peter Putzer <openwrt@mundschenk.at>
Link: https://github.com/openwrt/openwrt/pull/24418
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Upstream has implemented MACH_REALTEK_RTL with the MIPS generic
startup framework. Until now OpenWrt disables that with a patch
and instead uses dedicated legacy startup sources.
Convert to upstream startup and take over the missing downstream
bits from the legacy code. Due to the complex nature of this patch
only focus on board-realtek.c for now. Moving other pieces around
(like headers) needs to be done in a separate patch.
Link: https://github.com/openwrt/openwrt/pull/24390
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
This commit adds support for Hasivo S1100WP-8XGT-SE switch. It is
identical to the S1100W-8XGT-SE, except it also has 2x HS104 chips for
PoE delivery.
Device specification
--------------------
SoC Type: RTL9303
RAM: Samsung K4B461646E-BYKO (512MB)
Flash: Fudan FM25Q128A (16 MB)
Ethernet: 8x 10G via 2x RTL8264 PHY
LEDs: 2 LEDs, 1 power green, 1 system green
Button: Reset
USB ports: None
Bootloader: Realtek U-Boot - U-Boot 2011.12.(3.6.6.55087) (Nov 13 2022 - 14:37:31)
Fan: 2 fans controlled by STC8G1K08 TSOP-20 microcontroller
PSE: 2x HS104
Note: The fan appears to operate the same irrespective of the running
firmware. The STC8G1K08 is likely operating independently.
To explore the stock vendor firmware, there are 2 avenues to gain root
access. This is not necessary to install OpenWrt, but is here for
reference.
Root access via serial
----------------------
1. ctrl+t
2. password: switchrtk
3. press 's' for shell
Root access via SSH
-------------------
1. ctrl+t
2. password: switchrtk
3. sys command sh
4. log in with your username+password
5. ctrl+t
6. password: switchrtk
7. press 's' for shell
Credit to https://forum.openwrt.org/t/hasivo-switches/151758/174 for rooting instructions.
Installing OpenWrt
------------------
1. Connect to UART. UART requires soldering an RJ45 connector to the
console footprint on the board. The header is on the top right of
this image: 4d2ab97fad.jpeg
2. Set computer IP to 192.168.0.111.
3. Enter bootloader by pressing esc key during boot.
4. Enter password 'Hs2021cfgmg'.
5. Type 'XXXX'.
6. setenv bootcmd 'rtk network on; bootm 0xb4300000'
7. saveenv
8. rtk network on
9. tftpboot 0x84f00000 <openwrt-initramfs>
10. bootm 0x84f00000
Now you can copy over the sysupgrade image and install.
Credit to
https://forum.openwrt.org/t/hasivo-switches/151758/22?u=andrewjlamarche
for u-boot console access instructions.
Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24349
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Hasivo has two RJ45-only 8-port 10G switches, S1100W-8XGT-SE (non-PoE)
and S1100WP-8XGT-SE (PoE). The boards are both identical, with the
exception that the S1100WP-8XGT-SE has 2x HS104 PoE chips.
Make a shared dtsi to share between both variants.
Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24349
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Since the PCIe controllers gained a full DT description (349/350, commit
24ce1491cc) every controller fails to probe with -EBUSY, and the window
it describes is at the wrong address on most boards.
devm_pci_alloc_host_bridge() parses the DT ranges and requests them, then
pcie-iproc-bcma adds its own window and requests the whole list a second
time, so that second request collides.
The outbound window base is fixed per PCIe core revision. Revision 0x01
uses 0x08000000, 0x40000000 and 0x48000000 for controllers 0 to 2, while
revision 0x07 uses 0x08000000, 0x20000000 and 0x28000000. Broadcom's own
driver branches on the core revision for this reason. 349 carries the
revision 0x07 values, so on revision 0x01 controller 1 points at an
address the hardware does not decode and the first BAR access aborts.
A .dtsi shared by every Northstar SoC cannot express a per-revision
value, but the enumeration ROM reports the right one and bcma already
provides it. Discard any memory window that came from the device tree and
use that instead, requesting only the window this driver owns. The driver
is then correct whether or not the DT describes a window.
Tested on an ASUS RT-N18U (BCM47081) and a Linksys EA9200 (BCM4709), both
core revision 0x01, on kernel 6.18.
Fixes: 24ce1491cc ("bcm53xx: backport pcie patches")
Fixes: https://github.com/openwrt/openwrt/issues/23593
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24415
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
dev_set_threaded() takes an enum netdev_napi_threaded on 6.18; it was a
bool before. Select the argument on LINUX_VERSION_CODE so the driver keeps
building on the 6.12 main kernel and on the 6.18 testing kernel.
Without this, the 6.18 testing-kernel build fails with
-Werror=enum-conversion on the threaded-NAPI enable added in commit
98108710b6 ("qualcommax: qca-edma: enable threaded NAPI by default").
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The patch reverted ath10k/ath11k to iommu_domain_alloc(), which kernel
6.18 removed; iommu_paging_domain_alloc() exists on every kernel this
tree builds. Unnoticed upstream because no 6.18 target builds
ath11k-ahb.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Enable linux 6.18 as the testing kernel; 6.12 stays the main kernel. The
config was created from config-6.12 and refreshed (defaults accepted for
new symbols; QCOM_PPE and PCS_QCOM_IPQ9574 - upstream's IPQ9574-generation
PPE/PCS drivers - stay disabled, this target uses its own EDMA/PPE/UNIPHY-PCS
drivers).
EC_HUAWEI_GAOKUN, EC_LENOVO_THINKPAD_T14S, VIDEO_QCOM_IRIS and QCOMTEE are
new ARCH_QCOM-gated symbols that are only visible in ALL_KMODS builds; answer
them explicitly so syncconfig stays non-interactive. QCOMTEE sits inside the
TEE menu, so it only became reachable once kmod-tee turned CONFIG_TEE on
(0f256a0a7a "kernel: modules: package OP-TEE and fTPM modules").
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The fix_mac_speed() callback takes the speed as an int on 6.18
(SPEED_UNKNOWN is negative); it was unsigned int on 6.12. Select the
prototype on LINUX_VERSION_CODE so the driver keeps building on the 6.12
main kernel and on the 6.18 testing kernel.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
pcs_get_state() gained a neg_mode parameter in 6.18, and the phylink_pcs
neg_mode opt-in field was removed (neg_mode is always passed now). Guard
both on LINUX_VERSION_CODE so the driver keeps building on the 6.12 main
kernel and on the 6.18 testing kernel.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Refresh the remaining patches against 6.18. Most only needed new line
offsets. Seven needed real porting because the code they touch changed
upstream:
- 0113, 0114, 0188, 0805, 0808, 0812: qcom_mdt_load_no_init() no longer
takes a pas_id argument, and qcom_mdt_load_no_init()'s MPD variant in
0812 swaps its pas_init/dma_require/pas_id parameters. 0805 also moves
from the removed platform_driver .remove_new to .remove.
- 0901 (Qualcomm CPR regulators): 6.18 added a cmp_int() macro to
linux/sort.h that collides with the driver's local comparator, which is
renamed cpr3_cmp_int().
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Drop the 34 patches carrying a v6.13..v6.18 version prefix - all part
of kernel 6.18 - and three more whose content reached 6.18 through a
different route:
- 0111 (PCIe msi-parent): superseded, the ipq8074 PCIe nodes use split
msi0..msi7 interrupts upstream now.
- 0760 (Aquantia USXGMII MAC autoneg): generic/715 enables the same
autoneg bit unconditionally at config_init on 6.18.
- 0843 (stmmac get_interfaces): merged upstream.
The patches for later kernel versions are not in 6.18 and stay.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
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: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Drop config and patches for Linux 6.12.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/24404
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Switch to Linux kernel 6.18.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/24404
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Tabs were missing from the default button behavior modification blocks,
breaking the build if they were activated.
Signed-off-by: David Bauer <mail@david-bauer.net>
This is required to add available dns servers in ifstatus output,
required by downstream tools to receive information of the configured
DNS server on the wwan interface.
This has no effect on the dns server selection, as peerdns has the
desired effect within netifd.
Signed-off-by: Florian Maurer <f.maurer@outlook.de>
This is required to add available dns servers in ifstatus output,
required by downstream tools to receive information of the configured
DNS server on the wwan interface.
This has no effect on the dns server selection, as peerdns has the
desired effect within netifd.
Signed-off-by: Florian Maurer <f.maurer@outlook.de>
Remove the 6.12 kernel configuration and patch stack after switching ath79 to 6.18.
Signed-off-by: Leopoldo Pla <leopoldo.pla@treelogic.com>
Link: https://github.com/openwrt/openwrt/pull/23514
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Move ath79 to the 6.18 kernel after testing it as the testing kernel.
Signed-off-by: Leopoldo Pla <leopoldo.pla@treelogic.com>
Link: https://github.com/openwrt/openwrt/pull/23514
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add fan tachometer reading - 2 pulses per revolution, open drain, GPIO pin 4.
Increase PWM period from 10000 ns to 40000 ns (reduce PWM frequency from 100 kHz to 25 kHz) to
reduce audible friction noise.
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/24314
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Reset PKG_RELEASE to 1 since the package has been updated to a newer
upstream version. This reset was missed during update.
Fixes: 345404476a ("hostapd: update to 2026-07-09")
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
From datasheet: "The INA3221 is a three-channel, high-side current and
bus voltage monitor with an I2C- and SMBUS-compatible interface."
Signed-off-by: Steffen Loley <slo-src@web.de>
Link: https://github.com/openwrt/openwrt/pull/24361
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The CPU port between the MT7981 and MT7531 runs at 2.5 Gbps, but the U-Boot
device tree configures it as SGMII at 1 Gbps. This leaves Ethernet unable
to exchange packets despite an active physical link.
Use 2500base-x and a 2500 Mbps fixed link, matching the Linux device tree.
Fixes: a3105d3f95 ("mediatek: filogic: add support for Globitel BT-R320")
Signed-off-by: Bogdan K <zikwarface134@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24372
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add a label to the ATF reserved memory node so it can be referenced
by other device tree nodes or overlays.
No functional change intended.
Signed-off-by: Yalei Zang <yalei.zang@airoha.com>
Link: https://github.com/openwrt/openwrt/pull/24366
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Align OPP node names with their corresponding opp-hz values for AN7581
and AN7583.
This only updates the node names. The actual OPP frequencies and operating
parameters are not changed.
No functional change intended.
Signed-off-by: Yalei Zang <yalei.zang@airoha.com>
Link: https://github.com/openwrt/openwrt/pull/24366
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Upstream prefers fwnode helpers instead of OF ones (already done). This is
important for software nodes, which upstream is migrating to for its non
OF devices.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24348
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Kernel version 6.18 is now the default kernel for the
armsr target.
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Link: https://github.com/openwrt/openwrt/pull/24355
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
6.18 has been enabled as a testing kernel on armsr for
a few months now. It should be OK to switch to 6.18 as
the default kernel for this target.
Signed-off-by: Mathew McBride <matt@traverse.com.au>
Link: https://github.com/openwrt/openwrt/pull/24355
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This rule will break the patch structure.
Fixes: af75e1c527 ("vscode: update editor formatting and line endings settings")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/24411
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Commit ce120be361 ("kernel: disable qualcomm crypto") dropped the
CRYPTO_DEV_QCE kernel configs, so crypto@73a000 and its BAM no longer
have a driver. Unlike ipq8074, mainline ipq9574.dtsi ships both nodes
enabled by default, and gcc-ipq9574 registers its interconnect provider
with icc_sync_state; an enabled consumer that can never probe defers
that callback forever, so every boot logs
sync_state() pending due to 73a000.crypto
and the interconnect bandwidth votes are never allowed to drop from
their boot-time maximum. Disable both nodes explicitly in the board
device tree.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24379
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Commit ce120be361 ("kernel: disable qualcomm crypto") dropped the
CRYPTO_DEV_QCE kernel configs, so crypto@8e3a000 and its BAM no longer
have a driver. The board device trees still override both nodes to
"okay" (two boards also carry BAM channel properties that only exist
to serve the crypto engine), leaving enabled consumers that can never
probe. Drop the overrides and fall back to the SoC dtsi defaults, which
ship both nodes disabled.
Unlike ipq807x, no supplier on ipq4019 registers a sync_state()
callback, so the stale overrides are only dead code here.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24379
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Commit ce120be361 ("kernel: disable qualcomm crypto") dropped the
CRYPTO_DEV_QCE kernel configs, so crypto@73a000 and its BAM no longer
have a driver. The board device trees still override both nodes to
"okay", which leaves an enabled consumer that can never probe. On
ipq807x the GCC clock controller registers the USB GDSC power domains,
the genpd core therefore installs a sync_state() callback on it, and
fw_devlink then defers that callback forever, logging
qcom,gcc-ipq8074 1800000.clock-controller: sync_state() pending due to 73a000.crypto
on every boot and keeping unused power domains from being released.
Drop the overrides and fall back to the SoC dtsi defaults. On ipq8074
mainline ships both nodes disabled and no mainline board enables them;
on ipq5018/ipq6018 they are enabled by default, but the GCC drivers
there register no power domains, so no sync_state() dependency exists.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24379
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2aa1640 block: preen a registered volume before mount on request
d43ffba block: use preen mode for the f2fs filesystem check
a71e97d blockd: do not let a slow startup helper hold back readiness
1c17d24 blockd: expose storage readiness via a queryable status method
f60b3a3 blockd: pass registrant mount options down to block on autofs mount
998f6ab blockd: notify when an idle autofs mount is unmounted
0008996 block: mount ubus-registered devices without an fstab entry
4fd1502 blockd: coldplug block devices
89a6f52 blockd: retry interrupted waitpid() in synchronous block() helper
37cf94d blockd: fix bounds of the ubus event name buffer
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
We also need to refresh the 6.12 kernel patches.
Fixes: 87940bfc69 ("mpc85xx: relocate simpleImage for WS-AP3710i")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Remove the standalone GitHub Actions issue-labeller.yml workflow in favor
of the webhook-based openwrt-bot worker.
Enable issue labeller in formalities.json and add a declarative
.github/issue-labeller.yml configuration file for automated validation
and labelling of bug reports (release, target, image kind, device).
The release rule lists two alternative conditions under a single label
key: concrete releases (x.y.z, x.y.z-rcN) are validated against their
Git tag via exists check, while stable-branch snapshots (x.y-SNAPSHOT)
are format-validated only — OpenWrt does not tag snapshot builds.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24382
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The transmit path frees a TX skb only when its descriptor slot is
reused, RTETH_TX_RING_SIZE transmissions later. Until then the skb
stays charged to the sending socket's send buffer. With standard
frames the pinned amount is negligible, but with jumbo frames a
handful of completed transmissions is enough to exhaust the sender's
budget: eight ~9k echo replies exceed the kernel ICMP socket limit of
2 * SKB_TRUESIZE(64 * 1024), after which the stack drops every further
reply of any size (Icmp OutErrors) until unrelated transmissions
happen to recycle the slots. Observed on the Hasivo S1100W-8XGT-SE
(RTL9303) as a total ICMP blackout setting in after exactly eight
jumbo echo replies, healed by any sixteen device-originated frames.
Track monotonic send/clean counters in the driver-private ring info
(their difference is the number of unreleased skbs, their low bits the
ring slots), and release the contiguous completed run at the start of
the RX poll, before the received packets are processed, so replies
generated while handling the poll always find their send budget
released. The walk runs under the TX queue lock the
transmit path already holds, stops at the first descriptor the
hardware still owns, and is skipped entirely - no lock taken, no
access to the uncached descriptor memory - while nothing is pending.
The transmit path reuses the same walk for the ring-wrap case instead
of its old per-slot cleanup, and stopped or watchdog-frozen queues
are left to the rteth_tx_timeout() recovery, which keeps releasing
every buffer itself.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/24406
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The GS1900-24E B1 is a different hardware revision, not merely a
front-panel relabel as suggested by Zyxel's user guide. Verified
differences vs. A1 (sources: TechInfoDepot for A1 spec data,
https://techinfodepot.shoutwiki.com/wiki/ZyXEL_GS1900-24E):
* PCB: 37ZY-GM2430+212 V1.2 (A1: 37ZY-G724DO+412 V.12)
- different board part number, not a stepping of the same one
* RAM: 128 MiB DDR3, A1: 128 MiB DDR2
* Flash: mx25l12805d, 16 MiB (A1: 16 MiB SPI-NOR)
* External PHYs: RTL8218D (A1: unknown)
* Rear power switch: absent on this B1 unit (inlet only). A1 is
described as having one in the *title* of openwrt/openwrt#18620,
but that issue does not explicitly identify the affected hardware
as "A1" specifically, nor is it confirmed by a spec sheet or photo
* ZYXEL_VERS firmware family unchanged (AAHK)
The existing MDIO bus addressing and switch-port SerDes layout
from -a1.dts work unmodified on B1, since the PHY driver
identifies the external chip by ID registers at runtime rather
than from DT compatible string, regardless of what chip A1
actually uses.
Deliberately omits the gpio0 mdio-reset gpio-hog present in
-a1.dts (ba57225066, #18620) pending confirmation it's needed on
B1's differing reset-line topology. Tagged 802.1Q VLAN traffic
tested clean across software reboot and full AC power-cycle, on
both kernel 6.6/24.10.5 and current master (6.18), with no sign
of the #18620 stuck-RX regression.
Encapsulates the two external RTL8218D PHY packages per the tree-wide
ethernet-phy-package conversion for RTL8218x chips; ports 8-15 use the
SoC-integrated PHY block and aren't part of an external package.
Signed-off-by: Joshua Covington <joshuacov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24377
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The initramfs image for Snapshots exceed the available space when
booting.
Relocate the simpleImage loader to a different offset to fix booting the
initramfs.
Signed-off-by: David Bauer <mail@david-bauer.net>
Commits ab649f19ab and 64315f29c4 moved the GS1900-8HP B1 and A1 to the
in-kernel PSE MCU driver, but overlooked the /etc/board.d/02_network
PoE budget entries. Remove them.
Fixes: ab649f19ab realtek: use Realtek PSE MCU driver for GS1900-8HP B1
Fixes: 64315f29c4 realtek: use Realtek PSE MCU driver for GS1900-8HP A1
Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Link: https://github.com/openwrt/openwrt/pull/24380
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Convert both v1 and v3 to PSE MCU driver. Tested on a v3.
Signed-off-by: Russell Senior <russell@personaltelco.net>
Link: https://github.com/openwrt/openwrt/pull/24383
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The IC maximum operating temperature is 125C. Raise the CPU critical
temperature from 110C to 120C to account for possible temperature sensor
error.
This keeps the trip point below the IC maximum while avoiding premature
critical thermal protection.
Tested on Airoha internal platforms without thermal protection issues.
Signed-off-by: Yalei Zang <yalei.zang@airoha.com>
Link: https://github.com/openwrt/openwrt/pull/24367
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The Airtel AirFiber AAP4221ZY is an ISP-provided router that is part
of the ISP's Fixed Wireless Access (FWA) solution. The FWA system
consists of two units: an outdoor 5G unit and this indoor Wi-Fi router
connected via a PoE ethernet link. This commit adds support for the
indoor unit.
The OEM appears to be Zyxel with model number EX3310-T0, although this
is not printed on any label and only found in the vendor firmware DTS,
bootlog, and other internal references.
Hardware
--------
SOC: MediaTek MT7981B
CPU: 2 core Cortex-A53 (1300MHz)
RAM: 512MB DDR3
FLASH: 512MB SPI-NAND (Micron, 4096 page, 256KiB block)
WIFI: MediaTek MT7976 802.11ax 2x2 2.4GHz + 5GHz
ETH: Airoha AN8855 GbE Switch (2x LAN) + MT7981 internal GbE PHY (WAN)
POE: WAN port provides PoE to the outdoor unit (GPIO 10)
UART: 3V3 115200 8N1
Bootloader
----------
The device uses BL2 -> U-Boot -> Zyxel zloader chain. U-Boot has a
hardcoded command to always launch zloader (similar to the Zyxel
EX5601-T0, see commit 1c05388ab0). zloader is the Zyxel secondary
bootloader which handles dual-boot (ubi/ubi2 A/B scheme), firmware
verification, and PoE port enablement.
zloader requires a UBI volume named "zyfwinfo" containing a 256-byte
metadata structure with a "ZYXE" magic header and a valid checksum.
Without this volume, zloader refuses to boot the firmware. The
zyfwinfo structure also contains a sequence number (range 0-9999,
wraps around) used to select which firmware bank to boot - the bank
with the higher sequence number wins. This OpenWrt image sets it to
5555 to always win over stock firmware starting at 0.
During sysupgrade, platform.sh refreshes the zyfwinfo volume before
writing kernel and rootfs to UBI, as rootfs_data is sized to fill the
remaining space.
Note that OpenWrt can only be flashed to ubi (mtd6). The zloader
appends rootubi=ubi or rootubi=ubi2 to the kernel bootargs based on
which partition it selects, but OpenWrt cannot understand this
parameter, so the firmware must always reside on the first bank (ubi).
UART access
-----------
Serial console output is restricted by the U-Boot environment variable
EngDebugFlag which is 0x00 by default. Users need to first obtain root
access on the vendor firmware and run:
fw_setenv EngDebugFlag 0x01
Then reboot. Connect UART and press Enter to enter the zloader shell
(ZHAL> prompt). Use the ATGU command to switch to the U-Boot shell.
Note: ATGU must be entered twice to get the MT7981> prompt:
ZHAL> ATGU
[zloader reloads]
ZHAL> ATGU
MT7981>
Installation
------------
1. Enable UART access as described above.
2. Enter U-Boot shell (ATGU twice from ZHAL> prompt).
3. Load the initramfs image via TFTP:
MT7981> setenv ipaddr 192.168.1.1
MT7981> setenv serverip 192.168.1.2
MT7981> tftpboot 0x46000000 openwrt-mediatek-filogic-airtel_aap4221zy-initramfs-kernel.bin
MT7981> bootm 0x46000000
4. Once OpenWrt boots from initramfs, transfer and flash the
sysupgrade image:
sysupgrade -n /tmp/openwrt-mediatek-filogic-airtel_aap4221zy-squashfs-sysupgrade.bin
5. The device will reboot and zloader will boot OpenWrt from flash.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22809
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Backport two upstream patches adding SGMII and HSGMII support to the
net/dsa/realtek rtl8365mb driver for the RTL8367S switch:
- 943-01-v7.3-net-dsa-realtek-rtl8365mb-add-SGMII-support.patch
- 943-02-v7.3-net-dsa-realtek-rtl8365mb-add-HSGMII-support.patch
The RTL8367S SerDes can be muxed to external interface 1 (typically
the CPU port). SGMII/HSGMII were already listed as supported modes
in the chip info table, but only RGMII was implemented. This adds a
phylink PCS for the SerDes, with the configuration derived from the
GPL-licensed Realtek rtl8367c vendor driver.
Tested on a Mercusys MR80X v2.20 (RTL8367S over HSGMII).
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/24373
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The rtl826x PHY driver programs the system-side SerDes lane polarity of
the RTL8264 from the "rx-polarity"/"tx-polarity" devicetree properties,
defaulting to normal polarity when they are absent. The Hasivo
S1100W-8XGT-SE routes half of its high-speed lanes with inverted
polarity, which the vendor bootloader compensates for by setting
HSI_INV/HSO_INV (VEND1 0xC1 bits 6/7) per PHY. Without the properties
the driver clears those bits on every PHY (re-)initialization, which
kills the USXGMII link of every port: egress frames never reach the
wire while the port MAC MIB keeps counting them, and ingress dies with
it (issue #24359 for this board).
Declare the polarity for all eight PHYs, matching the values the
bootloader programs (read back on hardware in the U-Boot state:
alternating HSO_INV/HSI_INV per port pair). The already-supported
S1300WP declares these properties the same way.
Verified on hardware: on a pristine build both traffic directions are
dead; with only this devicetree change, ingress runs at full rate,
egress passes traffic, and the link now survives netifd restarts and
renegotiation. 10GBase-T ports also negotiate 10G instead of falling
back to 5G.
Assisted-by: Claude:claude-fable-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/24393
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>