Commit Graph

28983 Commits

Author SHA1 Message Date
Christian Marangi
76a981560a
ipq807x: fix typo in WAX630 for switch lan bmp
In fixing ipq8074 WAX630 dts, there was a typo in the switch lan bmp.
Fix it to fix compilarion error.

Fixes: f3cd4bfb7f ("ipq807x: fix multiple error on ESS switch port define")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-15 11:24:52 +01:00
Christian Marangi
f3cd4bfb7f
ipq807x: fix multiple error on ESS switch port define
Fix multiple error on ESS switch port define.
- Fix wrong switch CPU and WAN bmp define. (many times wan port are
  actually set in lan mask and lan port in wan mask)
- Renumber phyinfo port, use port_id instead of phy_address as it
  doesn't make sense using that for port enumeration
- Drop additional port for devices that have them not connected.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-15 11:02:30 +01:00
Rafał Miłecki
c60e9d1839 ath79: use "fixed-layout" for Embedded Wireless devices
Those devices have Ethernet interfaces using base MAC address increased
by 0x40 in the 3rd indexed byte (00:00:00:FF:00:00). To describe that we
were using a custom (downstream) "mac-address-increment-byte" property.

The same result can be achieved by using "mac-base" with a properly
adjusted offset value (0x40 << 16). It may be not pretty but it should
work without custom property or downstream kernel patch to support it.

Cc: Ansuel Smith <ansuelsmth@gmail.com>
Cc: Catrinel Catrinescu <cc@80211.de>
Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rosen Penev <rosenp@gmail.com>
2023-11-15 07:14:32 +01:00
Christian Marangi
4d9108e0bf
ipq806x: fix wrong LEDs mode for non-standard qca8k LEDs
There was a typo in the LED definition for the mode of non-standard
qca8k LEDs. Mode for link speed was wrongly set to link-10 link-100
link-1000 while the real mode in sysfs is link_10 link_100 and
link_1000.

Fix the entry to the correct mode.

Fixes: c707cff6c9 ("ipq806x: add LEDs definition for non-standard qca8k LEDs")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-15 01:23:03 +01:00
Robert Marko
c885169e02
qualcommax: move switch tick mode setting to ESS DTSI
Every board in qualcommax is using the same BM and TM switch tick modes, so
instead of specifying them in each board lets just set them in the ESS DTSI
directly.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-14 05:21:28 +01:00
Robert Marko
cb1702041f
qualcommax: use defines for MAC mode setting
Now that we have the MAC modes defined in DT bindings, lets replace all of
the raw hex values with defines.

While we are here, we can drop the disabled UNIPHY-s as that is the default
value in the ESS DTSI.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-14 05:21:27 +01:00
Robert Marko
8e162868ab
qualcommax: set default switch MAC modes
Every board that has the switch enabled needs to have MAC modes defined for
all 3 UNIPHY instances.

So, instead of having to at least put the disabled MAC mode for UNIPHY-s
let disable them by default and then boards can override it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-14 05:21:27 +01:00
Robert Marko
878ef51b01
qualcommax: add bindings for MAC modes
Since every board needs to define the correct MAC modes, it makes sense
to document the allowed hex values with a humanly readable name.

So, lets document all of the allowed MAC modes from SSDK 12.4 as bindings,
so later we can replace all of the hex values in DTS-es with these.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-14 05:21:24 +01:00
Christian Marangi
e927456ec3
qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp
Commit 947b44d ("ipq807x: fix wrong define for LAN and WAN ess mask")
started fixing wrong switch_lan_bmp that defined lan there weren't
actually present. This displayed a fragility in the malibu phy init code
in qca-ssdk.

Add patch to fix this. Also update each DTS with the new required
property if needed.

The new binding malibu_phy_start_addr is required with devices that
place the malibu first PHY referring port1 on a different PHY addres
than 0. The most common configuration is 0 but some device (for example
Qnap 301W) place the malibu PHY at an offset to address 16.

Refer to ipq8074-ess dtsi for extensive description on how to derive
this value.

Quoting the patch detailed description:

The usage of first_phy_addr is EXTREMELY FRAGILE and results
in dangerous results if the OEM (or anyone that by chance try to
implement things in a logical manner) deviates from the default values
from the "magical template".

To be in more details. With QSDK 12.4, some tweaks were done to improve
autoneg and now on every call of port status, the phydev is tried to
add. This resulted in the call and log spam of an error with ports that
are actually not present on the system with qsdk reporting phydev is
NULL. This itself is not an error and printing the error is correct.

What is actually an error from ages is setting generic bitmap reporting
presence of port that are actually not present. This is very common on
OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap
results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3
PORT4 PORT5). Reality is that many device are used as AP with one LAN
port or one WAN port. (or even exotic configuration with PORT1 not
present and PORT2 PORT3 PORT4 present (Xiaomi 3600)

With this finding one can say... ok nice, then lets update the DT and
set the correct bitmap...

Again world is a bad place and reality is that this cause wonderful
regression in some case of by extreme luck the first ever connected
port working and the rest of the switch dead.

The problem has been bisected to all the device that doesn't have the
PORT1 declared in any of the bitmap.

With this prefaction in mind, on to the REAL problem.

malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr
to the first detected PHY addr that coincidentally is always PORT1.
PORT1 addr is 0x0. The entire code in malibu_phy use this variable to
derive the phy addrs in some function.

Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only
one connected) result in first_phy_addr set to 1 or whatever phy addr is
detected first setting wrong value all over the init stage.

To fix this, introduce a new binding malibu_first_phy_addr to manually
declare the first phy that the malibu PHY driver should use and permit
to detach it from port bmp detection. The legacy detection is kept for
compatibility reason.

Fixes: #13945
Fixes: 947b44d9ae ("ipq807x: fix wrong define for LAN and WAN ess mask")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Robert Marko <robimarko@gmail.com> # Qnap 301W
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-13 14:27:16 +01:00
Petr Štetiar
8fc496be86
treewide: fix shell errors during dump stage
Fixes following issues:

 bash: -c: line 1: `echo 1686820180<LINUX_VERMAGIC> | /staging_dir/host/bin/mkhash md5 | cut -b1-8'
 bash: -c: line 1: `echo 1686820180<LINUX_VERMAGIC> | /staging_dir/host/bin/mkhash md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/''
 bash: -c: line 1: syntax error near unexpected token `|'
 bash: line 1: *1024*1024: syntax error: operand expected (error token is "*1024*1024")
 bash: line 1: (64 + ): syntax error: operand expected (error token is ")")
 expr: syntax error: missing argument after '+'

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-11-13 14:01:25 +01:00
Roland Reinl
44cd32d764 mediatek: Add support for TP-Link EAP225v5
Device specification:
- MT7629 with 16MB NOR flash W25Q128 and 128 MB DDR3 RAM.
- MT7761N and MT7762N wireless chips (currenlty no driver in OpenWrt available)
  - WiFi is NOT working on this device
- Dual core but second CPU doesn't seem to work (Error message during boot: "CPU1: failed to come online")

There are two similar merge requests for similar devices with the same issues:
- https://github.com/openwrt/openwrt/pull/12286
- https://github.com/openwrt/openwrt/pull/5084

UART interface is next to the reset button, pinout:
- 1: TX (the pin with the arrow marker)
- 2: RX
- 3: GND
- 4: VCC

UART settings: 115200,8n1, 3.3V

U-Boot menu can be entered by pressing Ctrl+B during startup.

Booting initramfs:
- Set your computers IP adress to 192.168.1.110
- Run a TFTP server providing the initramfs image
- Power on the AP, press Ctrl+B to get to the U-Boot menu
- Select "1. System Load Linux to SDRAM via TFTP"
- Update kernel file name, input server IP and input device IP (if they deviate from the defaults)
- After booting, create a backup of all partitions, especially for kernel and root_fs. They are required for reverting back to stock firmware
- The sysupgrade image can be flashed now

MAC adresses:
- LAN and 2.4GHz use the same MAC (the one printed on the device)
- 5GHz WiFi MAC is LAN MAC + 1

GPIOs:
- GPIO 21 is the reset pin (low active)
- GPIO 55 is for the green LED (active high)
- GPIO 56 is for the yellow/amber LED (active high)

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
2023-11-12 17:39:52 +01:00
Roland Reinl
e3a6945b58 mediatek: Add support for D-Link EAGLE PRO AI M32
Specification:
 - MT7622BV SoC with 2.4GHz wifi
 - MT7975AN + MT7915AN for 5GHz
 - MT7531BE Switch
 - 512MB RAM
 - 128 MB flash
 - 3 LEDs (red, orange, white)
 - 2 buttons (WPS and Reset)

MAC addresses:
 - WAN MAC is stored in partition "Odm" at offset 0x83
 - LAN (as printed on the device) is WAN MAC + 1
 - WLAN MAC (2.4 GHz) is WAN MAC + 2
 - WLAN MAC (5GHz) is WAN MAC + 3

Disassembly: Remove 4 screws in the bottom and 2 screws in the top (after removing the blue cover on the top), then the board can be pulled out.

The pins for the serial console are already labeled on the board (VCC, TX, RX, GND). Serial settings: 3.3V, 115200,8n1

Flashing via Recovery Web Interface:
- Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
- Press the reset button while powering on the deivce
- Keep the reset button pressed until the status LED blinks fast
- Open a Chromium based and goto http://192.168.0.1
- Download openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-recovery.bin

Flashing via uBoot:
- Open the case, connect to the UART console
- Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-initramfs-kernel.bin. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
- Power on the device and select "1. System Load Linux to SDRAM via TFTP." in the boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
- The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
- Create a backup of the Kernel1 partition, this file is required if a revert to stock should be done later
- Perform a sysupgrade using openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-squashfs-sysupgrade.bin
- Reboot the device. OpenWrt should start from flash now

Revert back to stock using the Recovery Web Interface:
- Set your IP address to 192.168.0.10, subnetmask 255.255.255.25
- Press the reset button while powering on the deivce
- Keep the reset button pressed until the status LED blinks fast
- Open a Chromium based and goto http://192.168.0.1
- Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.

Decrypting a D-Link firmware image:
- Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
- Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
- Run ./m32-firmware-util M32 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
- Example for firmware 1.03.01_HOTFIX: ./m32-firmware-util M32 --DecryptFactoryImage M32-REVA_1.03.01_HOTFIX.enc.bin M32-REVA_1.03.01_HOTFIX.decrypted.bin

Revert back to stock using uBoot:
- Open the case, connect to the UART console
- Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
- Run a tftp server which provides the previously created backup of the Kernel1 partition. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later.
- Power on the device and select "2. System Load Linux Kernel then write to Flash via TFTP." in the boot menu
- Enter image file, tftp server IP and device IP (if they differ from the default).
- TFTP download to FLASH will start. After a few seconds the stock firmware should start again

There is also an image openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-tftp.bin which can directly be flashed via U-Boot and TFTP. It can be used if no backup of the Kernel1 partition is reuqired.

Flahsing via OEM web interface is currently not possible, the OEM images are encrypted and require a specific memory layout which is not compatible to the partition layout of OpenWrt.

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
2023-11-12 17:33:41 +01:00
Szabolcs Hubai
d41b8a570f ramips: mt7621: use lzma-loader for Sercomm NA502
This fixes a well known "LZMA ERROR 1" error on Sercomm NA502,
reported on the OpenWrt forum. [1]

[1]: https://forum.openwrt.org/t/176942

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2023-11-12 15:32:24 +01:00
Alan Luck
4c0dc68f46 ramips: add encrypted SGE factory image for D-Link devices
creates SGE encrypted factory images
to use via the D-Link web interface
rename the old factory unencrypted images to recovery
for use in the recovery console when recovery is needed
DIR-1935-A1 , DIR-853-A1 , DIR-853-A3 , DIR-867-A1 ,
DIR-878-A1 and DIR-882-A1

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
2023-11-12 15:03:05 +01:00
Robert Marko
f74f5b2994 mvebu: fix PXA I2C bus with recovery
Since kernel 5.11, the PXA I2C driver has been converted to generic I2C
recovery, which makes the I2C bus completely lock up if recovery pinctrl
is present in the DT and I2C recovery is enabled.

This effectively completely broke I2C on Methode uDPU and eDPU boards
as both of them rely on I2C recovery.

After a discussion upstream, it was concluded that there is no simple fix
and that the blamed upstream commit:
0b01392c18b9993a584f36ace1d61118772ad0ca ("i2c: pxa: move to generic GPIO
recovery") should be reverted.
I have sent the revert upstream, it should be merged soon so lets "fix"
OpenWrt as well.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2023-11-12 14:28:21 +01:00
Christian Marangi
947b44d9ae
ipq807x: fix wrong define for LAN and WAN ess mask
switch_lan_bmp and switch_wan_bmp have wrong values and now cause
problems with the new version of the qca-ssdk.

Fix the wrong entry and drop the redundant switch_cpu_bmp.

Also introduce some convenient define to better understand values in
this map.

Fixes: eea264fead ("kernel: qca-ssdk: update to 12.4")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Robert Marko <robimarko@gmail.com> # Dynalink AX3600 and Qnap 301W
Reviewed by: Robert Marko <robimarko@gmail.com>
2023-11-10 20:19:45 +01:00
John Audia
4196a4b5ae kernel: bump 6.1 to 6.1.62
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.62

All patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-11-10 17:37:12 +01:00
John Audia
573c8c3d78 kernel: bump 5.15 to 5.15.138
Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.138

Removed upstreamed:
	generic/backport-5.15/819-v6.6-0018-nvmem-imx-correct-nregs-for-i.MX6SLL.patch[1]
	generic/backport-5.15/819-v6.6-0019-nvmem-imx-correct-nregs-for-i.MX6UL.patch[2]
	generic/backport-5.15/819-v6.6-0020-nvmem-imx-correct-nregs-for-i.MX6ULL.patch[3]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.138&id=6e22bf6f00d593b0a7e0b2f418fde89317424671
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.138&id=6efd498009b987a92f57f3bdae476f0503364fb7
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.138&id=6e22bf6f00d593b0a7e0b2f418fde89317424671

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-11-10 17:33:59 +01:00
Christian Marangi
4fdd5530a7
ipq806x: setup DSA port conduit in board.d
Now that netifd and uci-defaults.sh supports a way to setup DSA port
conduit without using iproute2 tool, set DSA port conduit directly in
board.d, that will fill board.d and will instruct netifd to setup the
port.

Drop special init.d qca8k_set_port script and ip-tiny from target dep as
they are not required anymore.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-10 12:30:34 +01:00
Rafał Miłecki
3b63208443 treewide: disable CONFIG_SLUB_DEBUG in target configs
From the symbol help message:
> SLUB has extensive debug support features. Disabling these can result
> in significant savings in code size.

There seems to be no need to enable those debugging features for
standard use.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-11-09 21:23:01 +01:00
Isaev Ruslan
3763a6a075
ipq807x: add support for Yuncore AX880
SPECIFICATION:
    - Chipset:  IPQ8072A +QCN5054+QCN5024+QCA8081*2
    - Flash NOR-8MB AND NAND-128MB
    - RAM 1Gb DDR
    - IEEE 802.11:  802.11ax/ac/b/g/n
    - 4*4 2.4G Wi-Fi standard   802.11b/g/n/ax
    - 4*4 5.8G Wi-Fi Standard   802.11 a/n/ac/ax
    - 2x 1 Gbps Ethernet (QCA8081) with 802.3at PoE input support
    - 1x  Reset
    - 1x  Bluetooth(optional)
    - 1x  DC Port 12V 3A
    - 4x Antenna    IPEX Connector, 3dBi omni antennas
    - Data Rate:    3657Mbps ( 2.4G: 1182Mbps (11ax 4x4); 5.8G: 2475Mbps (11ax 4x4))
    - RF Power: 2.4g ≤ 20dBm; 5.8g ≤ 19dBm
    - LED light:    Sys; 5.8G wifi; 2.4G wifi; WAN; LAN
    - Max Power Consumption:    ≤ 22W
    - Size: 198mm * 198mm * 41.02mm

BACKUP YOUR STOCK FIRMWARE:
```
export device=ax880
mkdir -p /tmp/fw_dump_$device
cd /tmp/fw_dump_$device
dmesg > dmesg_$device.log
dtc -I fs /sys/firmware/devicetree/base > $device.dts
cat /proc/device-tree/model > model
cat /proc/mtd > proc_mtd
while read p; do
mtd_dev=$(echo $p | cut -d: -f1)
echo $mtd_dev
dd if=/dev/$mtd_dev of=$mtd_dev
done < proc_mtd
md5sum * > md5sum.log
tar -cvzf ../$device.tar.gz .
export sum=$(md5sum /tmp/$device.tar.gz | cut -d' ' -f1)
mv ../$device.tar.gz /tmp/${device}_${sum}.tar.gz
echo fw backup saved to: /tmp/${device}_${sum}.tar.gz
```
Upload your backup via tftp to the safe place.

INSTALLATION:
1. stock firmware web ui
Rename factory.bin fw image file to factory.ubin. Flash this image
like ordinary stock fw upgrade.

2. stock firmware telnet method
Enter telnet cli (login: root, password: 476t*_f0%g09y) and upload
 factory.bin fw image and rename it to factory.ubin
`cd /tmp && wget <your_web_server_ip>/factory.ubin`
`sysupgrade factory.ubin

3. initramfs method
    Put openwrt-ipq807x-generic-yuncore_ax880-initramfs-uImage.itb to your
    TFTP server and rename it to ax880.initram
    Enable serial console and enter to the u-boot cli.
    Exec these commands:
    `tftpboot <your_tftp_server_ip>:ax880.initram`
    `dhcp`

    When downloading is finished:
    `bootm`
    After booting the device, you need to upload to the device factory.ubi fw image.
    ```
    cd /tmp && wget <your_web_server_ip>/factory.ubi`
    export rootfs=$(cat /proc/mtd | grep rootfs | cut -d: -f1)
    export rootfs_1=$(cat /proc/mtd | grep rootfs_1 | cut -d: -f1)
    ubiformat /dev/${rootfs} -y -f factory.ubi
    ubiformat /dev/${rootfs_1} -y -f factory.ubi
    reboot
    ```

4. u-boot factory.ubi image method
    Put openwrt-ipq807x-generic-yuncore_ax880-squashfs-factory.ubi to your
    TFTP server and rename it to ax880.ubi
    Enter u-boot cli and exec these commands:
    `tftpboot <your_tftp_server_ip>:ax880.ubi`
    `dhcp`
    After downloading is finished:
    `flash rootfs`
    `flash rootfs_1`
    `reset`

5. u-boot factory.bin method
    Put openwrt-ipq807x-generic-yuncore_ax880-squashfs-factory.bin to your
    TFTP server and rename it to ax880.bin
    Enter u-boot cli and exec these commands:
    `tftpboot <your_tftp_server_ip>:ax880.bin`
    `dhcp`
    After downloading is finished:
    `imgaddr=$fileaddr && nand device 0`
    Erase rootfs memory:
    `nand erase 0x00000000 0x03400000`
    Write rootfs:
    `nand write $fileaddr 0x00000000 $filesize`
    Erase rootfs_1 memory:
    `nand erase 0x3c00000 0x3400000`
    Write rootfs_1
    `nand write $fileaddr 0x3c00000 $filesize`
    `reset`

STOCK FIRMWARE RECOVERY:
Boot initramfs image.
Upload your rootfs mtd partition to the device using scp or download
it from the device using wget.
Enter device ssh cli and exec:
```
cd /tmp && wget <your_web_server_ip>/mtd21`
export rootfs=$(cat /proc/mtd | grep rootfs | cut -d: -f1)
export rootfs_1=$(cat /proc/mtd | grep rootfs_1 | cut -d: -f1)
ubiformat /dev/${rootfs} -y -f /tmp/mtd21
ubiformat /dev/${rootfs_1} -y -f /tmp/mtd21
reboot
```

Signed-off-by: Isaev Ruslan <legale.legale@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
2023-11-09 16:52:10 +01:00
Robert Marko
033c6001c7
qualcommax: backport missing SMEM ID-s for SSDK
SSDK has switched to using the upstream SMEM helper to get the SoC ID and
then look it up in the QCA SMEM ID header, so we need these in order for
SSDK to compile as they are currently undefined.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-09 13:21:52 +01:00
Robert Marko
a78c4e0c57
gemini: usb-fotg210: remove uneeded dependency on @USB_SUPPORT
$(call AddDepends/usb) will add the dependency on @USB_SUPPORT so there
is no need to duplicate it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-08 22:01:44 +01:00
Robert Marko
7e87e2f83d
gemini: usb-fotg210: add missing module name to AutoLoad
AutoLoad expects the module name to be present after the load index.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-08 22:01:44 +01:00
Robert Marko
67c6be5d3b
gemini: dont select USB driver as module via config
The FOTG210 USB driver is currently being selected as a module directly via
the target kernel config which should not be done and via kmod as well.

So, lets drop the driver selection in the target kernel module as kmod is
sufficient.

Fixes: 585360f0c0 ("gemini: refresh kernel config")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-08 22:01:44 +01:00
Robert Marko
4695778865
gemini: usb-fotg210: enable OTG support
The usb-fotg210 does not currently select CONFIG_USB_FOTG210_UDC which
enable OTG support, but it was previously selected directly in the target
kernel config so lets enable it to keep the functionality identical.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-08 22:01:43 +01:00
Robert Marko
2bdec11903
gemini: usb-fotg210: fix FOTG210_HCD setting
CONFIG_USB_FOTG210_HCD is a boolean symbol, so it must be set to "y"
instead of the default which is to set it as "m".

Otherwise you will get prompted to set the symbol during kernel building.

Fixes: 585360f0c0 ("gemini: refresh kernel config")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-08 22:01:40 +01:00
Filip Milivojevic
168beef1dd
ramips: Cudy WR1300v2 fix mt7613 calibration data length
Since MT7613 is handled by MT7615 driver, and other devices using MT7615
have reg = <0x8000 0x4da8>; this needs updating or eeprom data fails to load.

Signed-off-by: Filip Milivojevic <zekica@gmail.com>
2023-11-08 17:16:18 +01:00
Robert Marko
91169898ce
qualcommax: refresh patches
It seems that patches were not refreshed during last kernel bump, so lets
refresh them.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-08 00:11:05 +01:00
Robert Marko
7deb73e6ed
qualcommax: fixup patch numbering
It seems that I forgot one zero in the patch numbering while marking these
as backports, so lets fix it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-08 00:11:03 +01:00
Rafał Miłecki
7a8424827f rockchip: refresh kernel config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-11-07 13:39:40 +01:00
Rafał Miłecki
585360f0c0 gemini: refresh kernel config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-11-07 13:39:40 +01:00
Rafał Miłecki
f784fe88a6 sifiveu: refresh kernel config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-11-07 13:39:40 +01:00
Rafał Miłecki
34dbd02c12 qoriq: refresh kernel config
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-11-07 13:39:40 +01:00
Rafał Miłecki
f6e35efbfe bcm53xx: refresh kernel config for 6.1
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-11-06 13:25:59 +01:00
David Bauer
ae500e62e2 mediatek: add label-mac for GL.iNet GL-MT3000
The MAC-address of gmac0 matches the one printed on the bottom label.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-11-03 23:06:33 +01:00
Łukasz M
5a603c7a31 mediatek: mt7981: improve fan behaviour
This doubles the number of cooling-levels.
In addition the fan is turned on with a low speed at lower temperatures
and with a higher speed at higher temperatures.
This also attempts to reduce the likelihood of constant start-stop actions.

The change only affects the GL.iNet MT3000 and has been tested with it.

Signed-off-by: Łukasz M <lukasz1992m@gmail.com>
2023-11-03 23:06:07 +01:00
Lech Perczak
0c47bdb902 ath79: support Fortinet FAP-220-B
Fortinet FAP-220-B is a dual-radio, dual-band 802.11n enterprise managed
access point with PoE input and single gigabit Ethernet interface.

Hardware highlights:
Power: 802.3af PoE input on Ethernet port, +12V input on 5.5/2.1mm DC jack.
SoC: Atheros AR7161 (MIPS 24kc at 680MHz)
RAM: 64MB DDR400
Flash: 16MB SPI-NOR
Wi-Fi 1: Atheros AR9220 2T2R 802.11abgn (dual-band)
Wi-Fi 2: Atheros AR9223 2T2R 802.11bgn (single-band)
Ethernet: Atheros AR8021 single gigabit Phy (RGMII)
Console: External RS232 port using Cisco 8P8C connector (9600-8-N-1)
USB: Single USB 2.0 host port
LEDs: Power (single colour, green), Wi-Fi 1, Wi-Fi 2, Ethernet, Mode, Status
(dual-colour, green and yellow)
Buttons: reset button hidden in bottom grill,
  in the top row, 2nd column from the right.
Label MAC address: eth0

FCC ID: TVE-220102

Serial port pinout:
3 - TxD
4 - GND
6 - RxD

Installation: The same methods apply as for already supported FAP-221-B.

For both methods, a backup of flash partitions is recommended, as stock firmware
is not freely available on the internet.

(a) Using factory image:

1. Connect console cable to the console port
2. Connect Ethernet interface to your PC
3. Start preferred terminal at 9600-8-N-1
4. Have a TFTP server running on the PC.
5. Put the "factory" image in TFTP root
6. Power on the device
7. Break boot sequence by pressing "Ctrl+C"
8. Press "G". The console will ask you for device IP, server IP, and filename.
   Enter them appropriately.
   The defaults are:
   Server IP: 192.168.1.1 # Update accordingly
   Device IP: 192.168.1.2 # Update accordingly
   Image file: image.out # Use for example: openwrt-ath79-generic-fortinet_fap-220-b-squashfs-factory.bin
9. The device will load the firmware over TFTP, and verify it. When
   verification passes, press "D" to continue installation. The device
   will reboot on completion.

(b) Using initramfs + sysupgrade
1. Connect console cable to the console port
2. Connect Ethernet interface to your PC
3. Start preferred terminal at 9600-8-N-1
4. Have a TFTP server running on the PC.
5. Put the "initramfs" image in TFTP root
6. Power on the device.
7. Break boot sequence by pressing "Ctrl+C"
8. Enter hidden U-boot shell by pressing "K". The password is literal "1".
9. Load the initramfs over TFTP:

   > setenv serverip 192.168.1.1 # Your PC IP
   > setenv ipaddr 192.168.1.22 # Device IP, both have to share a subnet.
   > tftpboot 81000000 openwrt-ath79-generic-fortinet_fap-220-b-initramfs-kernel.bin
   > bootm 81000000

10. (Optional) Copy over contents of at least "fwconcat0", "loader", and "fwconcat1"
    partitions, to allow restoring factory firmware in future:

    # cat /dev/mtd1 > /tmp/mtd1_fwconcat0.bin
    # cat /dev/mtd2 > /tmp/mtd2_loader.bin
    # cat /dev/mtd3 > /tmp/mtd3_fwconcat1.bin

    and then SCP them over to safety at your PC.

11. When the device boots, copy over the sysupgrade image, and execute
    normal upgrade:

    # sysupgrade openwrt-ath79-generic-fortinet_fap-220-b-squashfs-sysupgrade.bin

Return to stock firmware:
1. Boot initramfs image as per initial installation up to point 9
2. Copy over the previously backed up contents over network
3. Write the backed up contents back:

   # mtd write /tmp/mtd1_fwconcat0.bin fwconcat0
   # mtd write /tmp/mtd2_loader.bin loader
   # mtd write /tmp/mtd3_fwconcat1.bin fwconcat1

4. Erase the reserved partition:

   # mtd erase reserved

5. Reboot the device

Quirks and known issues:
- The power LED blinking pattern is disrupted during boot, probably due
  to very slow serial console, which prints a lot during boot compared
  to stock FW.
- "mac-address-ascii" device tree binding cannot yet be used for address
  stored in U-boot partition, because it expects the colons as delimiters,
  which this address lacks. Addresses found in ART partition are used
  instead.
- Due to using kmod-owl-loader, the device will lack wireless interfaces
  while in initramfs, unless you compile it in.
- The device heats up A LOT on the bottom, even when idle. It even
  contains a warning sticker there.
- Stock firmware uses a fully read-write filesystem for its rootfs.
- Stock firmware loads a lot of USB-serial converter drivers for use
  with built-in host, probably meant for hosting modem devices.
- U-boot build of the device is stripped of all branding, despite that
  evidence of it (obviously) being U-boot can be found in the binary.
- The user can break into hidden U-boot shell using key "K" after
  breaking boot sequence. The password is "1" (without quotes).
- Telnet is available by default, with login "admin", without password.
  The same is true for serial console, both drop straight to the Busybox
  shell.
- The web interface drops to the login page again, after successfull
  login.
- Whole image authentication boils down to comparing a device ID against
  one stored in U-boot.
- And this device is apparently made by a security company.

Big thanks for Michael Pratt for providing support for FAP-221-B, which
shares the entirety of image configuration with this device, this saved
me a ton of work.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2023-11-03 23:06:07 +01:00
Lech Perczak
6c12c88d2e ath79: image: extract common part for Fortinet FAP series
In preparation for FAP-220-B support, extract the common part of image
recipe for FAP-221-B.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2023-11-03 23:06:07 +01:00
Lech Perczak
c6a090dbf6 ath79: dts: fortinet_loader: extract common part
In preparation for FAP-220-B support, rename ar934x_fortinet_loader.dtsi
to arxxxx_fortinet_loader.dtsi, to avoid confusion, as FAP-220-B shares
flash layout with FAP-221-B exactly despite different SoC.

While at that, add a label to U-boot partition to allow for nvmem MAC
binding in future.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2023-11-03 23:06:07 +01:00
Mikhail Zhilkin
45a50a06fb treewide: fix MERCUSYS brand spelling
This commit fixes MERCUSYS brand spelling. The proper name is capitalized.

Link: https://www.mercusys.com/
Link: https://github.com/torvalds/linux/blob/master/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c#L7779

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-11-03 23:06:07 +01:00
Patryk Kowalczyk
0c3f4bd85e filogic: fix wifi eeprom filename for tuf-ax6000
The router use mt7986_eeprom_mt7976_dual.bin

Fixes: d522ccecb2 ("filogic: add support for ASUS TUF AX6000")

Signed-off-by: Patryk Kowalczyk <patryk@kowalczyk.ws>
2023-11-03 23:06:07 +01:00
Daniel Golle
bc335f2967 ramips: add support for MeiG SLT866 4G CPE
Hardware:
 - SoC: Mediatek MT7621 (MT7621AT)
 - Flash: 32 MiB SPI-NOR (Macronix MX25L25635E)
 - RAM: 128 MiB
 - Ethernet: Built-in, 2 x 1GbE
 - 3G/4G Modem: MEIG SLM828 (currently only supported with ModemManager)
 - SLIC: Si32185 (unsupported)
 - Power: 12V via barrel connector
 - Wifi 2.4GHz: Mediatek MT7603BE 802.11b/g/b
 - Wifi 5GHz: Mediatek MT7613BE 802.11ac/n/a
 - LEDs: 8x (7 controllable)
 - Buttons: 2x (RESET, WPS)

Installing OpenWrt:
 - sysupgrade image is compatible with vendor firmware.

Recovery:
 - Connect to any of the Ethernet ports, configure local IP:
   10.10.10.3/24 (or 192.168.10.19/24, depending on OEM)
 - Provide firmware file named 'mt7621.img' on TFTP server.
 - Hold down both, RESET and WPS, then power on the board.
 - Watch network traffic using tcpdump or wireshark in realtime to
   observe progress of device requesting firmware. Once download has
   completed, release both buttons and wait until firmware comes up.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-11-03 21:16:29 +00:00
Daniel Golle
7db87d7c68 kernel: support reading hex MAC address from NVMEM
In addition to binary and ASCII-formatted MAC addresses, add support
for processing hexadecimal encoded MAC addresses from NVMEM.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-11-03 21:16:29 +00:00
Daniel Golle
f32baf6a65 kernel: add support MeigLink SLM828 modem
Another Qualcomm-based USB-connected modem, offering endpoints
 0 : rndis_host (link to voip subsystem listening on 169.254.5.100)
 1 : rndis_host (?)
 2 : option (?)
 3 : option (at)
 4 : option (at)
 5 : option (?)
 6 : GobiNet (qmi)
 7 : ?

Add support for this modem in rndis_host, option and qmi_wwan driver
which allows the modem to be used with ModemManager.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-11-03 21:16:29 +00:00
John Audia
7285f7744f kernel: bump 6.1 to 6.1.61
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.61

Removed upstreamed:
  generic/backport-6.1/814-v6.6-0018-nvmem-imx-correct-nregs-for-i.MX6SLL.patch[1]
  generic/backport-6.1/814-v6.6-0019-nvmem-imx-correct-nregs-for-i.MX6UL.patch[2]
  generic/backport-6.1/814-v6.6-0020-nvmem-imx-correct-nregs-for-i.MX6ULL.patch[3]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.61&id=b90b8633ef62314f3a5f5675106e6dcdec981b6f
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.61&id=37495846b1efc23c1767b17ddd6645cc0ccb9946
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.61&id=116671d25915b913374ccdb2956b5fdaff939dc9

Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-11-03 13:02:30 +01:00
Mikhail Zhilkin
1cb85e1251
ramips: fix wrong permissions on dts files
This commit fixes wrong permissions on dts files. Before the commit these
dts files are executable:
   -rwxrwxr-x mt7620a_dlink_dir-806a-b1.dts
   -rwxrwxr-x mt7621_wavlink_wl-wn573hx1.dts

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-11-02 20:42:53 +01:00
Robert Marko
5cdf152b28
qualcommax: ipq807x: move subtarget specific kernel options
Currently, qualcommax target contains the full kernel config for the
ipq807x subtarget, but since I am working on ipq60xx as well it makes
sense to split out the ipq807x specific kernel options to subtarget
config.

ipq60xx will use the same approach and use subtarget config.

Should result in the same end kernel config, verified by comparing the
generated kernel .config.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-11-02 20:25:33 +01:00
Rafał Miłecki
943bd3c9f6 bcm53xx: add the latest fix version of brcm_nvram
It was just sent for upstream.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-11-02 09:23:44 +01:00
Til Kaiser
3004c20614 x86: add support for Mellanox Spectrum SN2000 Switches
The Mellanox Spectrum SN2000 Series Switches are Managed Ethernet
Switches with a maximum speed of 100Gb/s and up to 56 ports.

Tested on a Mellanox Spectrum SN2100 with the following specs:
 - CPU: Intel ATOM x86 dual-core 2.4GHz
 - RAM: 8GB
 - Disk: 16GB SSD
 - Ports: 16x QSFP28 100GbE, 1x 100M Mgmt Port, 1x RJ45 Serial Port
 - USB: 1x mini 2.0
 - Button: 1x (reset)
 - LEDs: 6x

Installation:
 - Create a bootable USB device (either by flashing this image
   onto it or another Linux distribution)
 - Unzip the generic OpenWrt x64 image
   and copy it onto the USB device
 - Plug the USB device into the Mellanox Switch and boot from it
 - Flash the image (e.g., with dd) onto the internal SSD
   of the switch (should be /dev/sda)

To enter the BIOS, reboot the switch and press CTRL+B while you see
the BIOS information text (American Megatrends …). The default password
to enter the BIOS is admin. To boot from the USB device, switch to the
Boot index tab and set your USB device at the top of the boot order
(the internal SSD should be currently there). Don't forget to set
the SSD back at the top after you have flashed the image.

Signed-off-by: Til Kaiser <til.kaiser@gmx.de>
[unify with generic x64 image]
Signed-off-by: David Bauer <mail@david-bauer.net>
2023-10-31 21:12:15 +01:00