446 Commits

Author SHA1 Message Date
George Oldfort
ce3b36b3d5 mediatek: split Acer/W6 dts into W6 common dtsi and device specific dts
In order to prepare OpenWrt support for other Acer W6 devices, this commit
moves all device tree components that are used by all Acer W6/W6e/W6d/W6m
routers from mt7986a-acer-predator-w6.dts to mt7986a-acer-w6-common.dtsi
(new file) and includes this dtsi file in mt7986a-acer-predator-w6.dts.

Minor changes had to be made to the device tree in order to improve clarity
and – notably – to reduce the number of dtc warnings:
- replace (obviously wrong) led@<N> gpio led entities by led-<N>
- remove unnecessary (default-state = "off") gpio led statements
- rename entity “memory” to “memory@0”
- add missing #address-cells and #address-size in /soc/mmc@11230000
- add missing #address-cells and #address-size in /soc/pcie@11280000
- introduce symbols “nvmem” and “swport0” in dtsi (referenced in dts)

The changes were checked with `diff -BEZbdtwy --suppress-common-lines ...`
(comparing two dts files created using old and new fdt-1 blobs again), see
https://github.com/openwrt/openwrt/pull/16861/#issuecomment-2455680020 .

This is the first of four commits into which the original commit was split
to make reviews easier and more targeted.

Signed-off-by: George Oldfort <openwrt@10099.de>
Link: https://github.com/openwrt/openwrt/pull/16861
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 19:33:42 +01:00
Romanov Danila
d8a9669093 mediatek: change Routerich AX3000 ubi size
All new routers are shipped with ubi size 112MB since early September.
Bootloader update required (ask vendor , see wiki)

These partitions weren't used:
firmware_backup
zrsave
config2

Signed-off-by: Romanov Danila <pervokur@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16686
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 15:42:24 +01:00
Tianling Shen
a0bab0ccc8
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-14 20:04:57 +08:00
Enrico Mioso
b43194e041 mediatek: filogic: add support for GatoNetworks GDSP
The GatoNetworks GDSP is a re-branded version of the R5000 5G Industrial
router from Yinghua Technologies.
The re-branded device comes with OpenWrt preinstalled, and an OpenWrt-based
U-Boot bootloader version. While the flash layout has been kept compatible
with the OpenWrt version found on the stock device (see [5]), the image format
changed, making a bootloader upgrade necessary.

Specifications:
SoC: Mediatek MT7981BA
RAM: 256MB
Flash: SPI-NOR 32 MiB (Winbond W25Q256)
WLAN: MT7976CN DBDC AX Wi-Fi
Switch: MT7531AE (4x LAN Gigabit ports, 1x WAN Gigabit port)
5G: Quectel RM520N modem
Watchdog: an external WDT connected to GPIO 6 is present and always running;
          the built-in Mediatek watchdog is also present and effective, but
          not used at the moment.

This porting has been tested only with 1x 5G modems installed (the device
supports up to two).

Installation:
Installation is possible via sysupgrade both in the stock device and
re-branded version. However, in the former case, updating the bootloader is
required.

OpenWrt-based U-Boot Bootloader installation
--------------------------------------------
The firmware flashed in the re-branded device at manifacturing time will
flash an OpenWrt-based U-Boot bootloader with some extra recovery features
(see [1]) at first boot.
To update the bootloader, you need to install the mtd-rw module and
insmod it:

insmod mtd-rw i_want_a_brick=1

Then update relevant flash partitions:

mtd erase u-boot-env
mtd erase BL2
mtd erase FIP
mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-preloader.bin BL2
mtd write openwrt-mediatek-filogic-gatonetworks_gdsp-bl31-uboot.fip FIP

And reboot, making sure all previous commands ran succesfully.
If something goes wrong, you can recover your device via the mtk_uartboot
tool.
In my testing, it was possible to start the process even without (un)-plugging
the device, may be handy for remote recovery.

Installation from stock device and firmware
-------------------------------------------
To install vanilla OpenWrt in the stock device (R5000 5G Industrial router
from Yinghua Technologies) running the stock vendor firmware, you will need
to update your bootloader as described in previous section. Remember to use
-F (force upgrade) and -n (not keeping settings).

U-Boot Recovery
---------------
This procedure has been tested only with the OpenWrt-based U-boot bootloader.
Assign your system static IP address 192.168.1.1 and start a TFTP server. The
device will look for an initramfs image named
openwrt-mediatek-filogic-gatonetworks_gdsp-initramfs-kernel.bin
(so you may use openwrt/bin/targets/mediatek/filogic as root dir for your
TFTP server).
Power on the device while keeping the reset button pressed, until you see
a TFTP request from 192.168.1.10. Your environment will be restored to it's
default state.

MAC addresses assignment
------------------------
MAC addresses are assigned slightly differently than in stock firmware. In
particular, the 5 GHz Wi-Fi uses 2.4 GHZ MAC + 1, rather than reusing it with
LA bit set as done in stock firmware. This MAC address is allocated to the
device, so it can be used.
The 2.4 GHz Wi-Fi MAC address is the label MAC. LAN MAC is used to set the
special U-Boot environment ethaddr variable.

device					MAC address		U-Boot env variable		factory partition offset
2.4 GHz Wi-Fi		:84						wifi_mac							0x4
5.8 GHz Wi-Fi		:85						not present						not present
WAN							:86						wan_mac								0x24
LAN							:87						lan_mac								0x2A

Notes
-----
[1]: the OpenWrt-based U-Boot bootloader you will find installed in the
re-branded device is configured to request for the initramfs image via
TFTP for $gdsp_tftp_tries times before trying normal boot from NOR flash.
Setting this U-Boot environment variable to 0x0 will disable the feature,
which is not implemented in this patch.
[2]: the exposed UART port is connected to ttyS1; the ttyS0 console port is
not exposed.
[3]: the provided bootloader environment has no provision for operating on
BL2 and the FIP partitions. This is an intentional choice to make it
(slightly) more difficult to brick the device.
[4]: it seems GPIO 6 is used both for the "SYS" LED and external WDT.
[5] BL2 expects to find FIP payload at a fixed offset, so some constraints
apply.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
2024-11-14 04:14:23 +00:00
Tianling Shen
1602dae0fe
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-05 21:39:28 +08:00
John Crispin
6ec1477b4d mediatek: set mac increment to 7 for the 5G radio on OpenWrt One
Mass production units will get 16 assigned MAC addresses. This allows each phy
to spawn up to 7 VAPs which will each have unique MAC without needing the
private bit.

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-05 10:11:44 +01:00
Tianling Shen
033f96a851
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-05 16:01:54 +08:00
Leon M. Busch-George
d64e1ed421 mediatek: YunCore AX835: fix voltage regulator
Specifying GPIO_ACTIVE_HIGH on the GPIO for the voltage regulator doesn't
suffice. The regulator itself requires enable-active-high to be set.

Fixes: #16292
Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/16839
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-03 21:40:53 +01:00
Tianling Shen
29c8bf55f4
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-11-01 16:40:44 +08:00
John Crispin
a85f11f191 mediatek: filogic: add Arcadyan Mozart platform
* Mediatek MT7988A (4x Cortex-A73, up to 1.8 GHz clock speed)
* 8 GiB eMMC
* 4 GiB DDR4 RAM
* 2x 10000M + 1x 1000M  ports
* MT7996 Tri-band (2.4G, 5G, 6G) 4T4R 802.11be Wi-Fi
* 2 buttons (Reset, WPS)
* 2x LED for each GMAC
* USB-C PD power input

Signed-off-by: John Crispin <john@phrozen.org>
2024-11-01 07:43:00 +01:00
Tianling Shen
6085c4917a
mediatek: fix phy led and uart pins for openembed som7981
Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
2024-10-21 15:36:36 +08:00
Tianling Shen
f6d00e7c0d
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-19 15:13:05 +08:00
Daniel Golle
dbc2923cbe mediatek: filogic: convert Acer Predator W6 to use NVMEM framework
Read WiFi calibration data via NVMEM framework. The MAC addresses are
stored inside a file on a filesystem and hence still have to be
extracted in userspace.

WiFI EEPROM extraction has already accidentally been partially removed
by commit 3e6de5d77a ("mediatek: use NVMEM framework on all Adtran
devices").

Fixes: 3e6de5d77a ("mediatek: use NVMEM framework on all Adtran devices")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-18 12:38:21 +01:00
Tianling Shen
e8c765190d
mediatek: fix gbe led gpios for openembed som7981
Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
2024-10-18 15:43:00 +08:00
Tianling Shen
737421d51e
mediatek: fix led register for openembed som7981
Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
2024-10-18 14:55:40 +08:00
Tianling Shen
7fe8ca3317
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-17 14:09:24 +08:00
Tianling Shen
1477aaf4db
mediatek: increase phy assert time for openembed som7981
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-16 16:43:43 +08:00
Daniel Golle
3e6de5d77a mediatek: use NVMEM framework on all Adtran devices
Use NVMEM framework to assign MAC addresses and WiFi EEPROM data on
all Adtran SmartRG devices.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-15 17:56:06 +01:00
Daniel Golle
b6d8297510 mediatek: mt7622: add Adtran SmartRG SDG-841t6 device
Specification
 SoC:   MediaTek MT7622A (2x Cortex-A53)
 RAM:   NANYA NT5CC256M16ER-EK (512 MiB)
 MMC:   Kioxia THGBMNG5D1LBAIT (4 GiB)
 ETH0:  Intel/MaxLinear GPY211 (2500M/1000M/100M/10M)
 ETH1:  Lantiq/Intel/MaxLinear PEF7071/GPY111 (1000M/100M/10M)
 WLAN0: MediaTek MT7915E + MT7975D 2T2R 802.11bgn/ax (2.4G)
                                   2T2R 802.11an/ac/ax (5G L)
 WLAN1: MediaTek MT7915E + MT7975A 4T4R 802.11an/ac/ax (5G H)
 BT:    BT5 provided by MT7915E+MT7975D (missing firmware)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-15 17:55:05 +01:00
Daniel Golle
45bad8ba98 generic: phy: aquantia: correctly describe LED polarity
Backport newly introduced support for 'active-high' property and use
it to correctly implement polarity assignment for Aquantia PHY LEDs.
Previously the 'active-low' property was used to switch a LED PIN to
active-high ("drive VDD" in Aquantia-speak) mode.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-10-15 17:46:14 +01:00
Tianling Shen
c7f1ca5117
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-13 14:17:59 +08:00
Magnus Sandin
c5287069ea mediatek: ASUS TUF-AX6000: Add Green & Red LEDs
Beside the already existing control of the
Blue cover LED, this will also add the
Green and the Red cover LEDS available in the
Asus TUF-AX6000.

Signed-off-by: Magnus Sandin <magnus.sandin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16632
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-12 22:16:28 +02:00
Tianling Shen
5de2e1222d
mediatek: switch to nvmem mac binding for openembed som7981
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-09 13:32:50 +08:00
Tianling Shen
8b3c05f087
mediatek: update openembed som7981 support
The board has been redesigned due to previous hardware bugs
(with other reasons maybe).

Changes in new board:
- Added a gpio beeper
- Added a Atmel i2c eeprom
- Added a Atmel i2c ECC accelerator
- Added a Philips RTC module
- Added two RS485
- Removed WPS button
- Replaced USB3 port with M.2 B-key for LTE modules

Also replace broken 'phy*tpt' trigger with uci netdev configuration.

Keeping compatibility for old version is not necessary here as only
few samples were sent to those interested in it.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-08 18:19:46 +08:00
Tianling Shen
39c6816bde
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-07 20:43:44 +08:00
Chuanhong Guo
9f73519e62
mediatek: add support for TP-Link TL-XDR3230 v1
Specifications:
- SoC: Mediatek MT7622B
- RAM: 256M
- Flash: EN25QH128 16M
- Ethernet: RTL8367S 4xGE
- WiFi: MT7622 2.4G 4x4 + MT7905 5G 4x4
- UART: 3.3v, 115200n8
  --------------------------
  |         Layout         |
  |               ∇        |
  |  -----------------     |
  |  | VCC GND RX TX | JP1 |
  |  -----------------     |
  --------------------------

Flash instruction:
TP-Link locks down their firmware and serial console, so the firmware
must be flashed with mtk_uartboot.

1. Download mtk_uartboot:
   https://github.com/981213/mtk_uartboot/releases
2. Download bootloaders:
   RAM loader for mtk_uartboot: https://drive.wrt.moe/uboot/mediatek/mt7622-bl2-ram-1ddr3.bin
   BL2: https://drive.wrt.moe/uboot/mediatek/mt7622-tplink_tl-xdr3230-v1-bl2.bin
   FIP: https://drive.wrt.moe/uboot/mediatek/mt7622-tplink_tl-xdr3230-v1-fip.bin
3. Open the case, and attach to the UART.
4. Start mtk_uartboot:
   ./mtk_uartboot -a -s /dev/ttyUSB0 -p mt7622-bl2-ram-1ddr3.bin -f \
     mt7622-tplink_tl-xdr3230-v1-fip.bin --brom-load-baudrate 115200 \
     --bl2-load-baudrate 115200
5. Cut off the power and re-engage, wait for UART download to complete.
6. Connect to the UART, write new BL2/FIP/Firmware with TFTP.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
[fixup wifi eeprom and macs, add network configuration, minor fixes]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-07 16:06:36 +08:00
Rosen Penev
3da8e385e0 mediatek: fix wrong compatible string
The u-boot,env driver does not have layout in compatible.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16616
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-10-06 21:56:04 +02:00
Tianling Shen
b8b8ccdf89
mediatek: make use of whole spi nor for konka komi-a31
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-06 16:37:41 +08:00
Tianling Shen
0c41d43988
mediatek: add emmc and snor support for konka komi-a31
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-10-05 18:55:04 +08:00
Tianling Shen
a5003a46f3
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-21 13:58:15 +08:00
Daniel Golle
d0a2b3f824 mediatek: add Adtran SmartRG SDG-8733A
Specification is similar to other devices of the MT Stuart series:
 * Mediatek MT7988D (3x Cortex-A73, up to 1.8 GHz clock speed)
 * 8 GiB eMMC
 * 2 GiB DDR4 RAM
 * 2500M/1000M/100M LAN port
 * 10000M/5000M/2500M/1000M/100M/10M WAN port
 * MT7992 Tri-band (2.4G, 5G, 6G) 2T2R+3T3R+3T3R 802.11be Wi-Fi
 * Renesas DA14531MOD Bluetooth
 * 2 buttons (Reset, Mesh/WPS)
 * uC-controlled RGB LED via I2C
 * 2x LED for the 2.5G port, 3x LED for the 10G port
 * 3.3V-level 115200 baud UART console via 4-pin Dupont connector
   exposed at the bottom of the device
 * USB-C PD power input

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-09-20 22:47:05 +01:00
Tianling Shen
9022262539
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-20 13:06:31 +08:00
Daniel Golle
27be0f8565 mediatek: filogic: openwrt_one: let U-Boot set LAN MAC address
Instead of reading it from flash directly, let U-Boot assign the LAN
MAC address. Set label-mac-device while at it and sort aliases in DT
alphabetically.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2024-09-19 20:33:53 +01:00
Tianling Shen
66e62c0d06
mediatek: migrate imou lc-hx3001 to fit layout
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-16 19:33:27 +08:00
Tianling Shen
4c055c7a97
mediatek: migrate Livinet ZR-3020 ubootmod to fit layout
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-16 19:10:26 +08:00
Tianling Shen
8883319b00
mediatek: convert eeprom to nvmem format for livinet zr3020
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-16 18:28:53 +08:00
Tianling Shen
44b441fab2
mediatek: remove nmbm properties from cmcc a10 dts
Fixes: e611b2d90ce4 ("mediatek: migrate CMCC A10 to fit layout")
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-16 17:38:50 +08:00
Tianling Shen
e611b2d90c
mediatek: migrate CMCC A10 to fit layout
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-16 17:25:19 +08:00
Tianling Shen
ab175b2985
mediatek: convert cmcc a10 eeprom to nvmem format
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-12 21:27:36 +08:00
Tianling Shen
f921d645cc
mediatek: use nvmem to set wifi mac for cetron ct3003
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-12 21:20:23 +08:00
Tianling Shen
60ff3c42d6
mediatek: use nvmem to set wifi mac for konka komi-a31
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-12 21:17:57 +08:00
Tianling Shen
a8fe54372e
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-11 18:09:00 +08:00
Tianling Shen
d4f7910a53
mediatek: migrate cetron ct3003 to openwrt uboot
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-11 13:48:28 +08:00
Tianling Shen
516c0d7b0c
mediatek: convert cetron ct3003 eeprom to nvmem format
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-11 13:17:39 +08:00
Tianling Shen
b09889d87d
mediatek: align cetron ct3003 stock layout with upstream
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-11 13:14:45 +08:00
John Crispin
ee798653f3 mediatek: fix OpenWrt One NAND size
The final version of the PCB has 256MB NAND instead of 128MB.

Signed-off-by: John Crispin <john@phrozen.org>
2024-09-10 17:23:04 +02:00
John Crispin
f5c42670d2 mediatek: fix OpenWrt One MACs
* Ignore the MACs passed by the bootloader.
* fix nvmem-cell-cells warning
* fix the node names
* add dbdc wifi MACs

Signed-off-by: John Crispin <john@phrozen.org>
2024-09-10 17:23:04 +02:00
Tianling Shen
db71ac643d
mediatek: add Konka KOMI A31 support
Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: 128 MB SPI-NAND
  RAM: 256MB
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, Mesh
  Power: DC 12V 1A

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-09 13:47:46 +08:00
Tianling Shen
0a4b5741a0
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-09-07 11:19:20 +08:00
Yan Cangang
3de653a0af filogic: add missing 2.5G PHY LEDs configuration for Zyxel EX5700
configure 2.5G PHY LEDs to:

2500/1000: green with blink on TX/RX
100/10: green+yellow with blink on TX/RX

which is similar to other 1G PHY LEDs, which are:

1000: green with blink on TX/RX
100/10: green+yellow with blink on TX/RX

Fixes: 6cc14bf66aa ("filogic: support Telenor branded ZyXEL EX5700")

Signed-off-by: Yan Cangang <nalanzeyu@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16082
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-06 22:17:45 +02:00