Commit Graph

27230 Commits

Author SHA1 Message Date
Arne Zachlod
364550f9d9 ramips: fix MAC address assignment for rt1800, e7350
previous commit ffa4b5283b introduced a bug which broke the MAC address
assignment for belkin,rt1800 and linksys,e7350.

Fixes: ffa4b5283b ("ramips: add support for Mikrotik LtAP-2HnD")
Signed-off-by: Arne Zachlod <arne@nerdkeller.org>
2022-11-13 15:17:49 +01:00
Hauke Mehrtens
b97e5ac785 bcm4908: Refresh kernel patches
Refresh the kernel patches for this target. No manual changes.

Fixes: 45ac906c64 ("bcm4908: update DTS files with the latest changes")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-11-12 22:53:04 +01:00
Sven Eckelmann
087a8e39be ipq40xx: utilize nvmem-cells for openmesh,a62
The calibration data and mac addresses on this device are stored in the
0:ART partition. It is therefore possible to move the code to handle them
directly to the devicetree instead of the various scripts.

But the actual relevant information about the partition layout is provided
by the bootloader via bootargs (mtdparts) and not via the devicetree
itself. Instead of using a fixed-partition template, the mtd dynamic
partitions support from the upstream kernel is used.

Reported-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Michaël BILCOT <michael.bilcot@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Sven Eckelmann
2b2f14c959 ipq40xx: utilize nvmem-cells for openmesh,a42
The calibration data and mac addresses on this device are stored in the
0:ART partition. It is therefore possible to move the code to handle them
directly to the devicetree instead of the various scripts.

But the actual relevant information about the partition layout is provided
by the bootloader via bootargs (mtdparts) and not via the devicetree
itself. Instead of using a fixed-partition template, the mtd dynamic
partitions support from the upstream kernel is used.

Reported-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Sven Eckelmann
c6bef1b83a ipq40xx: Convert openmesh,a62 to DSA
* ethernet1:

  - physical port label "Ethernet 1"
  - can be used to power the device
  - its mac address is printed on the device label

* ethernet2:

  - physical port label "Ethernet 2"

Both ports are not marked by there role (because the vendor firmware
automatically detects roles) but the "Ethernet 1" port was used in the past
for "WAN" functionality in OpenWrt.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Michaël BILCOT <michael.bilcot@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Sven Eckelmann
66a3c32b47 ipq40xx: Convert openmesh,a42 to DSA
* ethernet1:

  - physical port label "Ethernet 1"
  - can be used to power the device
  - its mac address is printed on the device label

* ethernet2:

  - physical port label "Ethernet 2"

Both ports are not marked by there role (because the vendor firmware
automatically detects roles) but the "Ethernet 1" port was used in the past
for "WAN" functionality in OpenWrt.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2022-11-12 18:15:55 +01:00
Guillaume Lefebvre
65d9a715fc ipq40xx: D-Link DAP-2610: convert to DSA
Reenable D-Link DAP-2610, convert it to DSA and label port to 'lan', as shown on the case

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Guillaume Lefebvre <guillaume@zelig.ch>
2022-11-12 18:15:55 +01:00
Óscar García Amor
62efb34071 ramips: add support for Cudy WR1300 v2
Specifications:
 - SoC: MediaTek MT7621AT
 - RAM: 128 MB (DDR3)
 - Flash: 16 MB (SPI NOR)
 - WiFi: MediaTek MT7603E, MediaTek MT7613BE
 - Switch: 1 WAN, 4 LAN (Gigabit)
 - Ports: 1 USB 3.0
 - Buttons: Reset, WPS
 - LEDs: System, Wan, Lan 1-4, WiFi 2.4G, WiFi 5G, WPS
 - Power: DC 12V 1A tip positive

Download and flash the manufacturer's built OpenWRT image available at
http://www.cudytech.com/openwrt_software_download
Install the new OpenWRT image via luci (System -> Backup/Flash firmware)
Be sure to NOT keep settings. The force upgrade may need to be checked
due to differences in router naming conventions.

Recovery:
 - Loads only signed manufacture firmware due to bootloader RSA verification
 - serve tftp-recovery image as /recovery.bin on 192.168.1.88/24
 - connect to any lan ethernet port
 - power on the device while holding the reset button
 - wait at least 8 seconds before releasing reset button for image to
   download
 - See http://www.cudytech.com/newsinfo/547425.html

Signed-off-by: Óscar García Amor <ogarcia@connectical.com>
2022-11-12 18:15:55 +01:00
Szabolcs Hubai
18801f2648 ramips: mt7621: use seama-lzma-loader for D-Link DIR-860L B1
Fix the LZMA ERROR 1 with a single line of recipe instead of duplicating
"uimage-lzma-loader".

While reviewing my original submission of commit ce19571004 David
suggested to use $(Device/uimage-lzma-loader), but due to the specific
needs of the vendor bootloader that simple oneliner didn't work.

The new $(Device/seama-lzma-loader) is for those SEAMA capable
bootloaders.

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2022-11-12 18:15:55 +01:00
Szabolcs Hubai
c293b492df ramips: rt3883: use seama-lzma-loader for D-Link DIR-645
In the support topic [0] of the GitHub issue #10634 it was found out
(based on boot logs) that the uimage-lzma-loader (commit 09faa73c53)
never worked, as an earlier workaround (commit 6fba88de19) negated
the recipe:

    3: System Boot system code via Flash.
    ## Booting image at bc050000 ...
    raspi_read: from:50000 len:40
    .raspi_read: from:50000 len:c
    .raspi_read: from:50000 len:1fa000
    ................................We have SEAMA, Image Size = 2072512
    Verifying Checksum ...
    Uncompressing SEAMA linux.lzma ... OK
    ## Transferring control to Linux (at address 80000000) ...
    ## Giving linux memsize in MB, 64

    Starting kernel ...

    [    0.000000] Linux version 5.4.188 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16554-1d4dea6d4f)) #0 Sat Apr 16 12:59:34 2022
    [    0.000000] SoC Type: Ralink RT3883 ver:1 eco:5
    [    0.000000] printk: bootconsolde [early0] enabled
    [    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
    [    0.000000] MIPS: machine is D-Link DIR-645
    [    0.000000] Initrd not found or empty - disabling initrd

Using the new seama-lzma-loader it's able to boot OpenWrt 22.03
and OpenWrt SNAPSHOT too:

    3: System Boot system code via Flash.
    ## Booting image at bc050000 ...
    raspi_read: from:50000 len:40
    .raspi_read: from:50000 len:c
    .raspi_read: from:50000 len:48b004
    .........................................................................We have SEAMA, Image Size = 4763588
    Verifying Checksum ...
    Uncompressing SEAMA linux.lzma ... OK
    ## Transferring control to Linux (at address 80000000) ...
    ## Giving linux memsize in MB, 64

    Starting kernel ...

    OpenWrt kernel loader for MIPS based SoC
    Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
    Decompressing kernel... done!
    Starting kernel at 80000000...

    [    0.000000] Linux version 5.10.144 (xabolcs@ut2004) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r20774+2-b71affaf8b) 11.3.0, GNU ld (GNU Binutils) 2.37) #0 Tue Sep 27 23:02:30 2022
    [    0.000000] SoC Type: Ralink RT3883 ver:1 eco:5
    [    0.000000] printk: bootconsole [early0] enabled
    [    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
    [    0.000000] MIPS: machine is D-Link DIR-645
    [    0.000000] Initrd not found or empty - disabling initrd
    [    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
    [    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
    [    0.000000] Zone ranges:
    [    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
    [    0.000000] Movable zone start for each node
    [    0.000000] Early memory node ranges
    [    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
    [    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
    [    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2

The OKLI Loader is unable to read the flash on this SoC:

    Looking for OpenWrt image... not found! ('0xddbaddba' at 0xbc051000)

0: https://forum.openwrt.org/t/136435

Fixes: GitHub issue #10634 ("V22.03.0 release currently does not work on D-Link DIR-645")
Fixes: 09faa73c53 ("ramips: rt3883: use lzma-loader for DIR-645")
Tested-by: Glenn Fowler <gfowler1@outlook.com>
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2022-11-12 18:15:55 +01:00
Szabolcs Hubai
e7ad68d682 ramips: define lzma-loader recipe for SEAMA devices
Define "Device/seama-lzma-loader" recipe for SEAMA devices to help
contributors avoid doing recipe mistakes.

In a forum topic [0] I was under the impression that the good old
uimage-lzma-loader didn't fix the LZMA ERROR 1 for a device.

It was found out, that the uimage-lzma-loader never worked because the
KERNEL variable was overriden earlier (also an LZMA ERROR 1 related
commit, 6fba88de19), and the "use lzma-loader" fix (commit
09faa73c53) didn't catch that to include the "loader-kernel" part.

I contributed an LZMA ERROR 1 fix (commit ce19571004) for the SEAMA
device D-Link DIR-860L B1, where I had to duplicate the whole
uimage-lzma-loader recipe because of the special needs of the vendor
bootloader.

This new recipe reuse most of uimage-lzma-loader's KERNEL definiton to
avoid duplication.

It uses "relocate-kernel" as it needed for D-Link DIR-860L B1 to
boot from flash, and it's compatible with D-Link DIR-645 too.

It repacks lzma-loader with lzma for kernel (without uImage), because
these weird hacked vendor bootloaders accepts only LZMA compressed
kernels from flash:

    We have SEAMA, Image Size = 4759794
    Verifying Checksum ...
    Uncompressing SEAMA linux.lzma ... OK

It uses uImage header for initramfs kernel to be little bit verbose.

0: https://forum.openwrt.org/t/136435/10

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2022-11-12 18:15:55 +01:00
Arne Zachlod
ffa4b5283b ramips: add support for Mikrotik LtAP-2HnD
Mikrotik LtAP-2HnD is a outdoor/automotive WLAN 4 router with integrated GPS
receiver and two mPCIe slots.

Specifications:
* SoC: MT7621A
* RAM: 128 MiB Nanya NT5CC64M16GP-DI
* Flash: 16 MiB winbond W25Q128JV
* WLAN:
  * Atheros AR9382 with power amplifier SKY 85330 (2x2 internal antennas,
    with RF switches for external connectors)
* Ethernet: 1 Gbps, single port
* USB Host: USB 2.0 Speeds
* Serial: 115200 baud
* LEDs: Power, System, GPS, 5* RSSI
*  mPCIe:
   * miniPCIe slot 1: PCIe and USB 2.0 Host (via switch shared with USB Host)
   * miniPCIe slot 2: USB 2.0 and 3.0
* SIM Cards:
  * Slot 1 Connected to mPCIe slot 1
  * Slot 2 and 3 connected to mPCIe slot 2 via switch
* GPS: MTK 3333 on serial port 2 (/dev/ttyS1), 115200 baud and PPS on gpio 14

gpios are exposed to /sys/class/gpio:

* usb-select: swithes USB 2.0 interface between external port and internal
mPCIe slot 1 default is the external USB interface
* gps-reset: resets the GPS interface chip
* sim-select: switches between sim slot 2 and 3 connected to mPCIe slot 2
* gps-ant-select: switches GPS antenna between internal antenna and SMA
connected antenna
* lte-reset: resets mPCIe slot 2

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. Follow common
 MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

Signed-off-by: Arne Zachlod <arne@nerdkeller.org>
2022-11-12 18:15:55 +01:00
Will Moss
5a1af6ed62 ath79: fix MAC address assignment for TP-Link ar7241 devices
On TP-Link ar7241 devices LAN and WAN interfaces are swapped. Keeping
that in mind fix MAC address assignment as used in vendor firmware:
LAN MAC - main MAC stored in u-boot and printed on label
WAN MAC - LAN MAC + 1

Signed-off-by: Will Moss <willormos@gmail.com>
2022-11-12 17:10:12 +01:00
Shiji Yang
4778f6e959 ath79: move usb led trigger node to SoC dtsi
These frequently used usb led triggers are universal. They should be
moved to SoC dtsi.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-11-12 17:10:12 +01:00
John Audia
e7bd3767a9 kernel: bump 5.10 to 5.10.154
All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-11-12 17:05:13 +01:00
John Audia
0252c0b1bc kernel: bump 5.15 to 5.15.78
All patches automatically rebased

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-11-12 17:05:13 +01:00
Quintin Hill
4c3f664c2f kernel: backport some Bluetooth RTL8761 USB IDs
These USB IDs appear in the 5.15 stable kernel series but not the 5.10
stable series.

Signed-off-by: Quintin Hill <stuff@quintin.me.uk>
2022-11-12 17:05:13 +01:00
Quintin Hill
5e6e45b7ff kernel: backport RTL8761B FW name change to v5.10
Make the firmware filenames referenced by the module consistent for
v5.10 and v5.15 kernels.  Backport two upstream patches a cleanup commit
and the commit making the change, the former is required for the latter
to apply cleanly.

Signed-off-by: Quintin Hill <stuff@quintin.me.uk>
2022-11-12 17:05:13 +01:00
Rafał Miłecki
797177ad85 kernel: update U-Boot nvmem driver to v6.2 release version
Backport queued patches that
1. Fix CRC32 calculation for redundant images
2. Fix CRC32 on big-endian
3. Fix parting images with Broadcom header

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-12 11:42:05 +01:00
Rafał Miłecki
ce296b1aeb bcm4908: refresh kernel 5.15 config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-11 17:21:55 +01:00
Rafał Miłecki
66b6414a20 bcm4908: prepare support for kernel 5.15
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-11 17:21:55 +01:00
Rafał Miłecki
45ac906c64 bcm4908: update DTS files with the latest changes
The most affecting change is move of files from bcm4908/ to the bcmbca/.
That required updating few paths.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-11 15:37:57 +01:00
Daniel Golle
e586de8dbf
ath79: add support for Teltonika RUT300
Add support for the Teltonika RUT300 rugged industrial Ethernet router

Hardware
--------
SoC:    Qualcomm Atheros QCA9531
RAM:    64M DDR2 (EtronTech EM68B16CWQK-25IH)
FLASH:  16M SPI-NOR (Winbond W25Q128)
ETH:    4x 100M LAN (QCA9533 internal AR8229 switch, eth0)
        1x 100M WAN (QCA9533 internal PHY, eth1)
UART:   115200 8n1, same debug port as other Teltonika devices
USB:    1 single USB 2.0 host port
BUTTON: Reset
LED:    1x green power LED (always on)
        5x yellow Ethernet port LED (controlled by Linux)
        WAN port LED is used as boot status and upgrade indicator as
        the power LED cannot be controlled in software.

Use the *-factory.bin file to intially flash the device using the
vendor firmware's Web-UI.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-11-10 21:35:34 +00:00
Felix Fietkau
04b8ad60fd kernel: more fixes for mtk_eth_soc performance optimization
- fix features sync between netdevs
- fix crash in dsa_switch_rcv

Fixes: ceb1451c10 ("kernel: add mediatek soc ethernet performance improvements")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-10 22:27:18 +01:00
Felix Fietkau
7bd314a577 kernel: fix vlan parsing issue in mediatek ethernet driver
Check the vlan rx offload flag
Sync features across netdevs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-10 13:20:57 +01:00
Rafał Miłecki
e4770db163 kernel: support "linux,rootfs" DT property for splitting rootfs
OpenWrt's support for splitting rootfs (to create an extra "rootfs_data"
partition) is limited to partitions called "rootfs". Upstream kernel
allows any name partition to be rootfs if it has "linux,rootfs" property
set. Add split support to such partitions in OpenWrt code.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-10 12:47:22 +01:00
Rafał Miłecki
8cdafa149e bcm53xx: update DTS files with the latest changes
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-10 09:51:25 +01:00
Weiping Yang
9945d05171 ipq40xx: add support for GL.iNet GL-A1300
Specifications:
SOC:		Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core
RAM:		256 MiB
FLASH1:		4 MiB NOR
FLASH2:		128 MiB NAND
ETH:		Qualcomm QCA8075
WLAN1:		Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2
WLAN2:		Qualcomm Atheros QCA4018 5G 802.11n/ac W2 2x2
USB:		1 x USB 3.0 port
Button:		1 x Reset button
Switch:		1 x Mode switch
LED:		1 x Blue LED + 1 x White LED

Install via uboot tftp or uboot web failsafe.

By uboot tftp:
(IPQ40xx) # tftpboot 0x84000000 openwrt-ipq40xx-generic-glinet_gl-a1300-squashfs-nand-factory.ubi
(IPQ40xx) # nand erase 0 0x8000000
(IPQ40xx) # nand write 0x84000000 0 $filesize

By uboot web failsafe:
Push the reset button for 10 seconds util the power led flash faster,
then use broswer to access http://192.168.1.1

Afterwards upgrade can use sysupgrade image.

Signed-off-by: Weiping Yang <weiping.yang@gl-inet.com>
2022-11-09 23:34:37 +01:00
Edward Chow
79107116d1 ath79: calibrate TL-WDR4900 v2 with nvmem-cells
Driver for both soc (2.4GHz Wifi) and pci (5 GHz) now pull the calibration
data from the nvmem subsystem.

This allows us to move the userspace caldata extraction for the pci-e ath9k
supported wifi into the device-tree definition of the device.

wmac's nodes are also changed over to use nvmem-cells over OpenWrt's
custom mtd-cal-data property.

Signed-off-by: Edward Chow <equu@openmail.cc>
2022-11-09 22:55:33 +01:00
Shiji Yang
8d4c22a956 ath79: add missing clock name strings in SoC dtsi
For all SoC in the ath79 target, the PLL controller provides 3 main
clocks "cpu", "ddr" and "ahb" through the input clock "ref".

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-11-09 22:55:33 +01:00
Shiji Yang
520c90854c ath79: move reference clock node to SoC dtsi
AR7161, AR724x, AR9132 and QCA95xx only support fixed frequency external
crystal oscillator, so move reference clock node to SoC dtsi files.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-11-09 22:55:33 +01:00
Felix Fietkau
a06e023b4e mac80211: remove old legacy legacy drivers
Get rid of drivers that are either limited to 802.11b/g or don't even support
cfg80211/mac80211. Most of these are either limited to boards that we don't even
support anymore because of firmware size, or were only used for custom hacks by
a really small number of users in the past.
Let's get rid of those to reduce the maintenance effort and the number of useless
packages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-09 20:44:28 +01:00
Felix Fietkau
f753316f4a mediatek: filogic: enable maxlinear PHY support, refresh config
Needed for the 7986 RFB1 board

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-09 20:43:55 +01:00
Felix Fietkau
5faff99c7b mediatek: filogic: fix mt7986a ethernet devicetree entries
Add all ports, rename DSA ports to start at lan1

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-09 20:43:51 +01:00
Felix Fietkau
4f1e54801e mediatek: drop the use of device tree overlays on mt7986a-rfb board
The boot loader does not support it. Instead make NAND the default image for
this board

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-09 20:43:45 +01:00
Felix Fietkau
ceb1451c10 kernel: add mediatek soc ethernet performance improvements
- implement multiqueue via qdma hardware shaper to deal with ports with different speeds
- implement hardware DSA untagging
- add NETIF_F_ALL_TSO to reduce unnecessary segmentation

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-11-09 18:18:27 +01:00
Edward Matijevic
2964e5024c
ipq806x: kernel ramoops storage for C2600/AD7200
Define the kernel crash log storage ramoops/pstore feature
for C2600/AD7200 and add kmod-ramoops to default.

Tested with C2600 only.

Signed-off-by: Edward Matijevic <motolav@gmail.com>
2022-11-09 17:07:15 +01:00
David Bauer
10ba380ec3 ramips: define loadaddr for U6 Lite DTB
The Ubiquiti UniFi 6 Lite does not correctly align the FDT by always
setting fdt_high to 0xffffffff when invoking the bootubnt command.

Work around this issue by loading the DTB to a valid,aligned address, so
the bootloader does not have to relocate the FDT automatically.

Note: The device does read the kernel before invoking bootm on the FIT
image to 0x86000000.

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-11-08 12:16:43 +01:00
Rafał Miłecki
d33e49857e kernel: backport support for "linux,rootfs" in DT
This DT property allows marking flash partition that Linux should use as
a root device. It's useful for devices that don't use U-Boot and cmdline
parser for partitioning. It may be used with "fixed-partitions" or some
dynamic partitioning based on flash content.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-08 09:12:16 +01:00
Rafał Miłecki
6a64eb2664 kernel: split out mtd hack for CONFIG_FIT_PARTITION + rootfs
This is some hack on top of our old hack. Use separated patch for it so
it's easier to understand and actually possible to describe. We should
ideally get rid of this (and we actually did with kernels 5.15+).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-11-08 09:12:05 +01:00
Michael Lyle
961e01fc67 ramips: gl-mt1300: downclock SPI to 50MHz
The SPI max frequency was set to 80MHz, considerably higher than the
vendor clocks it in their firmware (10MHz).  Multiple users reported
jffs2 corruption/instability in GitHub issue #10461.

My unit has a W25Q256; datasheet specifies maximum SPI frequency for
read command of 50MHz.

Thanks to @DragonBlueP for suggesting to eliminate m25p,fast-read;
and @MPannen1979 for identifying the problem.

Fixes: #10461
Signed-off-by: Michael Lyle <mlyle@lyle.org>
2022-11-07 12:54:31 +01:00
Sungbo Eo
02aa7a2bb9 ramips: fix TP-Link RE200 v3/v4 LEDs
Set power LED to gpio 43 instead of 44 for v3 and v4.
Set red wifi LED to gpio 40 (was assigned to `red:wifi5g`).

Tested by the author of the initial v3 and v4 commit.

Reported-by: Richard Fröhning <misanthropos@gmx.de>
Tested-by: Richard Fröhning <misanthropos@gmx.de>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2022-11-07 12:33:42 +01:00
Kuan-Yi Li
f795ecc0dd sdk: use git-src-full to allow Git versioning
$(AUTORELEASE) uses Git log to determine releases and package timestamps.

Base feed is shallow cloned by default in generated SDK, resulting in
an incomplete Git log and therefore different local package versions than
offered upstream.

This patch complements commit 7fae1e5677 by setting the base feed to use
`src-git-full` to solve that.

Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
2022-11-06 17:08:23 +01:00
Alan Luck
aca8bb5cc3 ath79: expand rootfs for DIR-825-B1 with unused space
Expand currently unused flash space to roofs for DIR-825-B1 by using the same
flash space as the old ar71xx big image without moving the caldata.

With some testing this partition is use by the OEM firmware
but if changed is regenerated which allows reverting to OEM firmware

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
2022-11-06 01:03:16 +01:00
Korey Caro
12cee86989 ath79: add support to TrendNet TEW-673GRU
Add support for the TrendNet TEW-673GRU to ath79.
This device was supported in 19.07.9 but was deprecated with ar71xx.
This is mostly a copy of D-Link DIR-825 B1.
Updates have been completed to enable factory.bin and sysupgrade.bin both.
Code improvements to DTS file and makefile.

Architecture   |  MIPS
Vendor         |  Qualcomm Atheros
bootloader     |  U-Boot
System-On-Chip |  AR7161 rev 2 (MIPS 24Kc V7.4)
CPU/Speed      |  24Kc V7.4 680 MHz
Flash-Chip     |  Macronix MX25L6405D
Flash size     |  8192 KiB
RAM Chip:      |  ProMOS V58C2256164SCI5 × 2
RAM size       |  64 MiB
Wireless       |  2 x Atheros AR922X 2.4GHz/5.0GHz 802.11abgn
Ethernet       |  RealTek RTL8366S Gigabit w/ port based vlan support
USB            |  Yes 2 x 2.0

Initial Flashing Process:
	1) Download 22.03 tew-673gru factory bin
	2) Flash 22.03 using TrendNet GUI

OpenWRT Upgrade Process
	3) Download 22.03 tew-673gru sysupgrade.bin
	4) Flash 22.03 using OpenWRT GUI

Signed-off-by: Korey Caro <korey.caro@gmail.com>
2022-11-06 00:51:58 +01:00
Linos Giannopoulos
78110c3b5f ramips: add support for TP-Link MR600 V2(EU)
MR600 V2(EU) is an LTE router that also supports 4G+ band aggregation
etc. and can reportedly achieve higher bandwidth with it.

- Specifications:

* SoC: Mediatek MT7621DAT 880MHz
* RAM: 128MB DDR3
* Flash: 16MB SPI NOR flash (GD25Q128C)
* LTE Modem: Qualcomm MDM9240
* WiFi 5GHz: Mediatek MT7613BEN
* WiFi 2.4GHz: Mediatek MT7603EN
* Ethernet: MT7530, 4x 1000Base-T.
* UART: Serial console (115200 8n1), J1(GND:3)
* Buttons: Reset, WPS.
* LED: Power, WAN, LTE, WiFi 2GHz and 5GHz, LAN, Signal1, Signal2,
  Signal3

- MAC Addresses:

OEM firmware configuration:
54:af:97:xx:xx:7b : 2.4G
54:af:97:xx:xx:7a : 5G
54:af:97:xx:xx:7c : LTE
54:af:97:xx:xx:7b : LAN (label)
54:af:97:xx:xx:7c : WAN

- Installation:

1. Download the OpenWrt initramfs-image.

Place it into a TFTP server root directory and rename it to openwrt.img
Configure the TFTP server to listen at 192.168.0.5/24.

3. Connect to the serial console.

Attach power and interrupt the boot procedure when prompted (type `tpl`).

Credentials are admin / 1234

4. Configure U-Boot for booting OpenWrt from ram

 $ tftpboot
 $ bootm

5. Transfer the OpenWrt sysupgrade image to the device.

- LTE:

In order to setup the wwan0 interface:
1. Add a `qmi` proto interface under `/etc/config/network`, e.g.:
```
config interface 'wwan0'
        option device '/dev/cdc-wdm0'
        option proto 'qmi'
        option pincode 'XXXX'
        option apn 'your_isp_apn'
```

2. Add `wwan0` interface to the `wan` firewall zone
3. `/etc/init.d/network restart`

Signed-off-by: Linos Giannopoulos <linosgian00@gmail.com>
2022-11-05 23:13:16 +01:00
Shiji Yang
f7f9203854 ramips: add support for SIM SIMAX1800T and Haier HAR-20S2U1
SIM AX18T and Haier HAR-20S2U1 Wi-Fi6 AX1800 routers are designed based
on Tenbay WR1800K. They have the same hardware circuits and u-boot.
SIM AX18T has three carrier customized models: SIMAX1800M (China Mobile),
SIMAX1800T (China Telecom) and SIMAX1800U (China Unicom). All of these
models run the same firmware.

Specifications:
 SOC:      MT7621 + MT7905 + MT7975
 ROM:      128 MiB
 RAM:      256 MiB
 LED:      status *3 R/G/B
 Button:   reset *1 + wps/mesh *1
 Ethernet:      lan *3 + wan *1 (10/100/1000Mbps)
 TTL Baudrate:  115200
 TFTP Server:   192.168.1.254
 TFTP IP:       192.168.1.28 or 192.168.1.160 (when envs is broken)

MAC Address:
 use        address               source
 label      30:xx:xx:xx:xx:62     wan
 lan        30:xx:xx:xx:xx:65     factory.0x8004
 wan        30:xx:xx:xx:xx:62     factory.0x8004 -3
 wlan2g     30:xx:xx:xx:xx:64     factory.0x0004
 wlan5g     32:xx:xx:xx:xx:64     factory.0x0004 set 7th bit

TFTP Installation (initramfs image only & recommend):
1. Set local tftp server IP: 192.168.1.254 and NetMask: 255.255.255.0
2. Rename initramfs-kernel.bin to "factory.bin" and put it in the root
   directory of the tftp server. (tftpd64 is a good choice for Windows)
3. Start the TFTP server, plug in the power supply, and wait for the
   system to boot.
4. Backup "firmware" partition and rename it to "firmware.bin", we need
   it to back to stock firmware.
5. Use "fw_printenv" command to list envs.
   If "firmware_select=2" is observed then set u-boot enviroment:
   /# fw_setenv firmware_select 1
6. Apply sysupgrade.bin in OpenWrt LuCI.

Web UI Installation:
1. Apply update by uploading initramfs-factory.bin to the web UI.
2. Use "fw_printenv" command to list envs.
   If "firmware_select=2" is observed then set u-boot enviroment:
   /# fw_setenv firmware_select 1
3. Apply squashfs-sysupgrade.bin in OpenWrt LuCI.

Recovery to stock firmware:
a. Upload "firmware.bin" to OpenWrt /tmp, then execute:
   /# mtd -r write /tmp/firmware.bin firmware
b. We can also write factory image "UploadBrush-bin.img" to firmware
   partition to recovery. Upload image file to /tmp, then execute:
   /# mtd erase firmware
   /# mtd -r write /tmp/UploadBrush-bin.img firmware

How to extract stock firmware image:
  Download stock firmware, then use openssl:
  openssl aes-256-cbc -d -salt -in [Downloaded_Firmware] \
  -out "firmware.tar.tgz" -k QiLunSmartWL

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-11-05 22:38:01 +01:00
Alexander Horner
53f2e438cb ramips: add support for Zbtlink ZBT-WG1602-V04
Description heavily based on commit
7e89421a7c by
Sergey Ryazanov <ryazanov.s.a@gmail.com> Details I cannot confirm have
been removed

Completed with great help from \x on IRC. Thanks, \x!

Zbtlink ZBT-WG1602-V04 is a Wi-Fi router intendend for use with WWAN
(UMTS/LTE/3G/4G) modems. The router board offers a couple of miniPCIe
slots with USB and SIM only and another one which is a pure miniPCIe
slot as well as five Gigabit Ethernet ports (4xLAN + WAN).

Specification:

* SoC: MT7621A
* RAM: 256/512 MiB
* Flash: 16/32 MiB
* Eth: 10/100/1000 Mbps Ethernet x5 ports (4xLAN + WAN)
* WLAN 2GHz: MT7603E (.11bgn, MIMO 2x2)
* WLAN 5GHz: MT7662E (.11nac, MIMO 2x2)
* WLAN Ants: detachable x2, shared by 2GHz & 5GHz radios
* miniPCIe: 2x slots with USB&SIM + 1x slot with regular PCIe bus
* WWAN Ants: detachable x4
* External storage: microSD (SDXC) slot
* USB: 3.0 Type-A port
* LED: 11 (5 per Eth phy, 3 SoC controlled, 2 WLAN 2/5 controlled,
  1 power indicator)
* Button: 1 (reset)
* UART: console (115200 baud)
* Power: DC jack (12 V / 2.5 A)

Additional HW information:

* SoC USB port 1 is shared by internal miniPCIe slot and external
  Type-A USB port, USB D+/D- lines are toggled between ports using a
  GPIO controlled DPDT switch.

Installation:

The kernel image can be installed directly onto the device via a browser
to 192.168.1.1 using the built in firmware recovery Web UI available.
It can be accessed by pushing the reset button in, applying power and
holding the reset button for approximately 10 seconds. When the kernel
image has been flashed, you can access LuCI and upload the sysupgrade
as normal.

Signed-off-by: Alexander Horner <ahorner@programmer.net>
2022-11-05 21:12:25 +01:00
Shiji Yang
7a504c151d ramips: add support for Youku X2
Specifications:
  SOC:      MT7620AN + MT7612EN
  RAM:      128 MiB DDR2
  Flash:    16 MiB (Winbond W25Q28FVFG)
  WLAN:     2.4G + 5G
  LAN:      LAN ports *2
  WAN:      WAN port *1
  USB:      USB2.0 *1
  SD Card:  MicroSD *1
  Buttons:  Reset *1
  LEDs: ethernet *3, system, usb, wlan2g, wlan5g

MAC Address:
  use        address               source
  label      54:36:9b:xx:xx:ac     lan
  lan        54:36:9b:xx:xx:ac     factory.0x0028
  wan        54:36:9b:xx:xx:ad     factory.0x002e
  wlan2g     54:36:9b:xx:xx:ae     factory.0x0004
  wlan5g     54:36:9b:xx:xx:af     factory.0x8004

Installation:
1. Apply initramfs-kernel.bin in stock firmware Web UI.
2. Install sysupgrade.bin on OpenWrt and do not retain any configuration.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-11-05 21:12:24 +01:00
Shiji Yang
eba0a8deb6 ramips: improve compatibility for Youku YK-L2 and YK-L1 series
Add UIMAGE_NAME and UIMAGE_MAGIC to allow users to directly install
initramfs-kernel.bin from the stock firmware Web UI. At the same time,
this change makes it possible to boot OpenWrt with the official u-boot.

Notice:
Since the stock firmware is based on OpenWrt and the configuration
will be retained by default during the upgrade process, so we must use
initramfs-kernel.bin to do a initial installation. After the system
restarts, install sysupgrade.bin and do not retain any configuration.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-11-05 21:12:24 +01:00