Commit Graph

1844 Commits

Author SHA1 Message Date
Rosen Penev
8c36040f04 ath79: rb91x-key: replace fwnode with pdev
There's no specific fwnode handling here. Simpler to just use pdev.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16506
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-03 17:16:50 +02:00
Rosen Penev
dedeb28755 ath79: rb91x-key: use more devm
Use devm_gpiochip_add_data to get rid of the remove function. No need
for it.

Also use dev_err_probe to simplify the error path and avoid having to
handle -EPROBE_DEFER manually.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16506
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-03 17:16:50 +02:00
Mieczyslaw Nalewaj
9c413397d9 ath79: Refresh kernel patches
Make the patches apply cleanly again.

Fixes: 774badd8a8 ("kernel: fix crashes after linearizing fraglist GSO skbs")
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16517
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-27 00:01:55 +02:00
Rosen Penev
65ed475450 ath79: gpio-latch-mikrotik: remove fwnode
Not needed. Can just use dev.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16350
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-25 22:56:56 +02:00
Rosen Penev
c4f2626694 ath79: gpio-latch-mikrotik: remove _remove
Not needed with devm.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16350
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-25 22:56:56 +02:00
Rosen Penev
1e8dde776a ath79: gpio-latch-mikrotik: use dev_err_probe
It automatically adds the error code at the end of the message. It also
deals with -EPROBE_DEFER automatically (doesn't output). Simpler code.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16350
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-25 22:56:56 +02:00
Shiji Yang
04bdf9b332 ath79: disable ath79 USB phy drivers by default
We already have an kernel module package "kmod-phy-ath79-usb" to
drive the ath79 USB. It will be selected by the usb base package
"kmod-usb2" and "kmod-usb-ohci".

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16380
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 23:58:47 +02:00
Oskari Lemmela
cf8d32745e ath79: qca955x ag71xx upstream driver fix
Fix mdio probe in qca95xx devices and add mandatory clocks to dtsi

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
Link: https://github.com/openwrt/openwrt/pull/15926
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 18:42:58 +02:00
Oskari Lemmela
b42c7e2410 ath79: rename downstream ag71xx driver
Rename the downstream ag71xx driver to ag71xx-legacy.
It allows both upstream and downstream drivers to be compiled into modules.

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
Link: https://github.com/openwrt/openwrt/pull/15926
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 18:42:34 +02:00
Rosen Penev
8b8ea076d7 ath79: rb91x_nand: use dev_err_probe
Simplifies the error path and avoids having to handle -EPROBE_DEFER
manually.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16416
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-22 18:23:08 +02:00
Ryan Salsbury
2e626ae2d2 ath79: fix I2C pins on GL-AR750
Change I2C pin flags to GPIO_ACTIVE_HIGH and change SDA to GPIO1.

On my late production GL-AR750 (purchased 2024):
SCL = GPIO16
SDA = GPIO1

Bug report:
I2C bus doesn't work in GL-AR750
https://github.com/openwrt/openwrt/issues/16319

Signed-off-by: Ryan Salsbury <ryanrs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16406
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-09-21 18:03:31 +02:00
Hauke Mehrtens
df12b9864c ath79: Refresh kernel patches
Make the patches apply cleanly again.

Fixes: 3660ddb8ab ("generic: ar8216: remove support for Linux before version 6.1")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-21 11:24:40 +02:00
John Audia
93cca95434 kernel: bump 6.6 to 6.6.48
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.48

Removed upstreamed:
	generic/backport-6.6/752-04-v6.6-net-ethernet-mtk_wed-check-update_wo_rx_stats-in-mtk.patch[1]
	generic/pending-6.6/601-udp-fix-receiving-fraglist-GSO_packets.patch[2]
	mediatek/patches-6.6/951-net-ethernet-mtk_wed-fix-use-after-free-panic-in-mtk.patch[3]
	rockchip/patches-6.6/302-mmc-allow-probe-to-defer-if-clock-is-not-ready.patch[4]

Manually rebased:
	bcm27xx/patches-6.6/950-0058-Revert-Bluetooth-Always-request-for-user-confirmatio.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.48&id=7ede6ef04c9ffc466844a297d3d68bea8a06093d
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.48&id=cfa692e7e71b22d35174a796d10b9111bafa0686
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.48&id=326a89321f9d5fe399fe6f9ff7c0fc766582a6a0
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.48&id=7bbf8f8b8861dd2a6215f1aded425c66e6c376a0

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16282
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-31 20:08:13 +02:00
Rosen Penev
c6f04f718e ath79: qihoo,c301: use nvmem
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16244
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-30 14:54:02 +02:00
Rosen Penev
8918d84250 ath79: nec,wg800hp: convert to nvmem
Userspace handling is deprecated.

Unused wan mac added to dts. Requires DSA to implement.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-29 21:23:58 +02:00
Rosen Penev
70e41d0205 ath79: elecom,wab: use nvmem
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16247
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-29 21:14:50 +02:00
Rosen Penev
51f96278ed ath79: nec,wX1200cr: use nvmem
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16245
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-29 21:05:59 +02:00
Goetz Goerisch
3774f3272e treewide: rename ZyXEL to Zyxel
The company Zyxel rebranded some years ago.
Currently the casing is according to the old branding even
for newer devices which already use the new branding.

This commit aligns the casing of Zyxel everywhere.

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15652
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-25 15:08:25 +02:00
Martin Blumenstingl
fc31261c33 ath79: update Sophos AP15 to indicate that it uses an QCA9557 SoC
Device support for Sophos AP15 is based on Sophos AP55(C) and AP100(C).
Those other Sophos access points uss a QCA9558 SoC (some of them with
one of the three chains on the built-in SoC's wifi disabled) while the
AP15 uses a QCA9557 SoC (which only has two chains enabled in the
package or silicon).

This is mostly cosmetic since QCA9558 and QCA9557 are virtually
identical and all differences are automatically detected and/or managed
by the ART calibration.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://github.com/openwrt/openwrt/pull/16187
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-24 14:38:57 +02:00
Martin Blumenstingl
b35bb09175 ath79: remove 5GHz wifi bits from Sophos AP15
Sophos AP15 only uses the SoC's built-in wifi. There's no external PCIe
chipset.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://github.com/openwrt/openwrt/pull/16187
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-24 14:38:57 +02:00
John Audia
3eb08538c4 kernel: bump 6.6 to 6.6.46
This commit makes three changes all needed for the update of the 6.6 kernel.

1. Upstream kernel bump to 6.6.46

	Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.46
	Manually rebased:
        	bcm27xx/patches-6.6/950-0320-spi-spidev-Restore-loading-from-Device-Tree.patch
	All other patches automatically rebased.

2. Adjusted the following for new ksym[1] enabling it:

        armsr/config-6.6
        bcm27xx/bcm2712/config-6.6

3. Added a fix to receiving fraglist GSO packets:

	generic/pending-6.6/601-udp-fix-receiving-fraglist-GSO_packets.patch[2]

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/arch/arm64/Kconfig?id=v6.6.46&id2=v6.6.45
2. https://marc.info/?l=linux-netdev&m=172407994500599&w=2

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16173
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-20 23:41:08 +02:00
John Audia
626fa75526 kernel: bump 6.6 to 6.6.45 and update config-6.6
Build on at leasst x86/64 failed without adding the new ksym:
CONFIG_PCP_BATCH_SCALE_MAX=5

According to www.kernelconfig.io[1], this option seems to apply
to all arches so I placed it in target/linux/generic/config-6.6

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.45

Removed upstreamed:
	generic/backport-6.6/719-v6.11-net-phy-realtek-add-support-for-RTL8366S-Gigabit-PHY.patch[2]

All other patches automatically rebased.

1. https://www.kernelconfig.io/config_pcp_batch_scale_max?q=&kernelversion=6.10.3&arch=x86
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.45&id=b45cbfa204b2a0985eb85dcb33d51714ee089bb9

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16144
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-13 00:34:16 +02:00
John Audia
b733b6acb5 kernel: bump 6.6 to 6.6.44
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.44

Removed upstreamed:
	rockchip/patches-6.6/044-v6.11-arm64-dts-rockchip-Add-sdmmc-related-properties-on-r.patch[1]
	rockchip/patches-6.6/045-v6.11-arm64-dts-rockchip-Add-pinctrl-for-UART0-to-rk3308-r.patch[2]
	rockchip/patches-6.6/046-v6.11-arm64-dts-rockchip-Add-mdio-and-ethernet-phy-nodes-t.patch[3]
	rockchip/patches-6.6/048-v6.11-arm64-dts-rockchip-Update-WIFi-BT-related-nodes-on-r.patch[4]
	rockchip/patches-6.6/310-PCI-dw-rockchip-Fix-initial-PERST-GPIO-value.patch[5]

Manually rebased:
	bcm27xx/patches-6.6/950-0526-mfd-Add-rp1-driver.patch
	ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.44&id=96155dc8c99e76a0e58932ca5f88148a37af3617
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.44&id=30ee9e5ecc5fd6854a1690ab11e6e6b4851ac9ab
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.44&id=0c4c1b7daf23bccf0da5b65b3cd5b32bfa5a5af4
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.44&id=a86a5685675834732789df202e73153db59d8dcc
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.44&id=a30211c6704899de0616ac0f97601122d899c86d

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16061
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-06 00:40:42 +02:00
Mieczyslaw Nalewaj
343f4f3c54 kernel: rtl8367: use realtek,extif property
Use realtek,extif property instead of realtek,extif0 and realtek,extif1
by extending it with the cpu_port parameter.
The extif number is automatically calculated based on cpu_port.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/15749
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-06 00:34:14 +02:00
Joan Moreau
226af7a77c Revert "ath79: remove GPIO driver earlier registration hack"
This reverts commit f444dea428.

It seems that some devices using GPIO WDT have really short WDT timeouts
and when using module_platform_driver registration it happens too late
and thus WDT will timeout and reset the board.

So, for now lets return the postcore_initcall hack for now.

Fixes: f444dea428 ("ath79: remove GPIO driver earlier registration hack")
Signed-off-by: Joan Moreau <jom@grosjo.net>
Link: https://github.com/openwrt/openwrt/pull/16035
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-08-02 19:46:49 +02:00
John Audia
d2626bd2a7 kernel: bump 6.6 to 6.6.42
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.42

Removed upstreamed:
	bcm27xx/patches-6.6/950-0490-input-ads7846-Add-missing-spi_device_id-strings.patch[1]

All patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.42&id=528466f921aa7637bca684ce2d7d62cdb2c34013

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16010
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 19:46:16 +02:00
INAGAKI Hiroshi
ba723a3f6c ath79: add support for NEC Aterm WG600HP
NEC Aterm WG600HP is a 2.4/5 GHz band 11n (Wi-Fi 4) router, based on
AR9344.

Specification:

- SoC             : Atheros AR9344
- RAM             : DDR2 128 MiB (2x Hynix H5PS5162GFR-S6C)
- Flash           : SPI-NOR 8 MiB (Macronix MX25L6406EMI-12G)
- WLAN            : 2.4/5 GHz 2T2R
  - 2.4 GHz       : Atheros AR9344 (SoC)
  - 5 GHz         : Atheros AR9382
- Ethernet        : 5x 10/100/1000 Mbps
  - switch        : Atheros AR8327
- LEDs/Keys (GPIO): 10x/4x
  - note          : all LEDs are controlled by ath9k chip (AR9382)
- UART            : through-hole on PCB
  - assignment    : 3.3V, GND, NC, TX, RX from tri-angle marking
  - settings      : 9600n8
- USB             : 1x USB 2.0 Type-A
  - hub (internal): NEC uPD720114
- Power           : 12 VDC, 1.5 A (Max. 16 W)
- Stock OS        : NetBSD based

Flash instruction using initramfs-factory.bin image (StockFW WebUI):

1. Boot WG600HP with router mode normally
2. Access to the WebUI ("http://aterm.me/" or "http://192.168.0.1/") on
   the device and open firmware update page ("ファームウェア更新")
3. Select the OpenWrt initramfs-factory.bin image and click update
   ("更新") button
4. After updating, the device will be rebooted and booted with OpenWrt
   initramfs image
5. On the initramfs image, upload (or download) uboot.bin and
   sysupgrade.bin image to the device
6. Replace the bootloader with a uboot.bin image

   mtd write <uboot.bin image> bootloader

7. Perform sysupgrade with a sysupgrade.bin image

   sysupgrade <sysupgrade image>

8. Wait ~120 seconds to complete flashing

Flash instruction using initramfs-factory.bin image (bootloader CLI):

 1. Connect and open serial console
 2. Power on WG600HP and interrupt bootloader by ESC key
 3. Login to the bootloader CLI with a password "chiron"
 4. Start TFTP server by "tftpd" command
 5. Upload initramfs-factory.bin via tftp from your computer

   example (Windows): tftp -i 192.168.0.1 PUT initramfs-factory.bin

 6. Boot initramfs image by "boot" command
 7. On the initramfs image, back up the stock bootloader and firmware if
   needed
 8. Upload (or download) uboot.bin and sysupgrade.bin image to the device
 9. Replace the bootloader with a uboot.bin image
10. Perform sysupgrade with a sysupgrade.bin image
11. Wait ~120 seconds to complete flashing

Notes:

- All LEDs are connected to the GPIO controller on the ath9k chip
  (AR9382) and controlled by it. Those LEDs are probed after probing of
  ath9k chip, so they cannot be handled as status LEDs of OpenWrt while
  booting.

- A reset pin of the internal USB hub is connected to the GPIO
  controller of the ath9k chip, like LEDs above. That hub will be
  detected after probing of the ath9k chip.

- The stock bootloader requires an unknown filesystem on firmware area
  in the flash. Booting of OpenWrt from that filesystem cannot be
  handled, so the bootloader needs to be replaced to mainline U-Boot
  before OpenWrt installation.

MAC Addresses:

LAN    : A4:12:42:xx:xx:A0 (config,  0x6 (hex))
WAN    : A4:12:42:xx:xx:A1 (config,  0xc (hex))
2.4 GHz: A4:12:42:xx:xx:A2 (config,  0x0 (hex) / art, 0x1002 (hex))
5 GHz  : A4:12:42:xx:xx:A3 (config, 0x12 (hex) / art, 0x5002 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15432
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 18:47:56 +02:00
INAGAKI Hiroshi
bafd1aa183 ath79: add support for NEC Aterm WR9500N
NEC Aterm WR9500N is a 2.4/5 GHz band 11n (Wi-Fi 4) router, based on
AR9344.

Specification:

- SoC             : Atheros AR9344
- RAM             : DDR2 128 MiB (2x Nanya NT5TU32M16DG-AC)
- Flash           : SPI-NOR 16 MiB (Macronix MX25L12845EMI-10G)
- WLAN            : 2.4/5 GHz
  - 2.4 GHz       : 2T2R, Atheros AR9344 (SoC)
  - 5 GHz         : 3T3R, Atheros AR9380
- Ethernet        : 5x 10/100/1000 Mbps
  - switch        : Atheros AR8327
- LEDs/Keys (GPIO): 12x/4x
  - note          : all LEDs are controlled by ath9k chip (AR9380)
- UART            : pad on PCB (near shielded ath9k chip, white circle)
  - assignment    : 3.3V, GND, TX, RX from AR8327 side
  - settings      : 9600n8
- USB             : 1x USB 2.0 Type-A
  - hub (internal): NEC uPD720114
- Power           : 12 VDC, 1.5 A (Max. 17 W)
- Stock OS        : NetBSD based

Flash instruction using initramfs-factory.bin image (StockFW WebUI):

1. Boot WR9500N with router mode normally
2. Access to the WebUI ("http://aterm.me/" or "http://192.168.0.1/") on
   the device and open firmware update page ("ファームウェア更新")
3. Select the OpenWrt initramfs-factory.bin image and click update
   ("更新") button
4. After updating, the device will be rebooted and booted with OpenWrt
   initramfs image
5. On the initramfs image, upload (or download) uboot.bin and
   sysupgrade.bin image to the device
6. Replace the bootloader with a uboot.bin image

   mtd write <uboot.bin image> bootloader

7. Perform sysupgrade with a sysupgrade.bin image

   sysupgrade <sysupgrade image>

8. Wait ~120 seconds to complete flashing

Flash instruction using initramfs-factory.bin image (bootloader CLI):

 1. Connect and open serial console
 2. Power on WR9500N and interrupt bootloader by ESC key
 3. Login to the bootloader CLI with a password "chiron"
 4. Start TFTP server by "tftpd" command
 5. Upload initramfs-factory.bin via tftp from your computer

   example (Windows): tftp -i 192.168.0.1 PUT initramfs-factory.bin

 6. Boot initramfs image by "boot" command
 7. On the initramfs image, back up the stock bootloader and firmware if
   needed
 8. Upload (or download) uboot.bin and sysupgrade.bin image to the device
 9. Replace the bootloader with a uboot.bin image
10. Perform sysupgrade with a sysupgrade.bin image
11. Wait ~120 seconds to complete flashing

Notes:

- All LEDs are connected to the GPIO controller on the ath9k chip
  (AR9380) and controlled by it. Those LEDs are probed after probing of
  ath9k chip, so they cannot be handled as status LEDs of OpenWrt while
  booting.

- A reset pin of the internal USB hub is connected to the GPIO
  controller of the ath9k chip, like LEDs above. That hub will be
  detected after probing of the ath9k chip.

- The stock bootloader requires an unknown filesystem on firmware area
  in the flash. Booting of OpenWrt from that filesystem cannot be
  handled, so the bootloader needs to be replaced to mainline U-Boot
  before OpenWrt installation.

MAC Addresses:

LAN    : 1C:B1:7F:xx:xx:60 (config,  0x6 (hex))
WAN    : 1C:B1:7F:xx:xx:61 (config,  0xc (hex))
2.4 GHz: 1C:B1:7F:xx:xx:62 (config,  0x0 (hex) / art, 0x1002 (hex))
5 GHz  : 1C:B1:7F:xx:xx:63 (config, 0x12 (hex) / art, 0x5002 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15432
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 18:47:56 +02:00
INAGAKI Hiroshi
7e37a457d4 ath79: add support for NEC Aterm WR8750N
NEC Aterm WR8750N is a 2.4/5 GHz band 11n (Wi-Fi 4) router, based on
AR9344.

Specification:

- SoC             : Atheros AR9344
- RAM             : DDR2 128 MiB (2x Hynix H5PS5162GFR-S6C)
- Flash           : SPI-NOR 8 MiB (Macronix MX25L6406EMI-12G)
- WLAN            : 2.4/5 GHz 2T2R
  - 2.4 GHz       : Atheros AR9344 (SoC)
  - 5 GHz         : Atheros AR9382
- Ethernet        : 5x 10/100/1000 Mbps
  - switch        : Atheros AR8327
- LEDs/Keys (GPIO): 10x/4x
  - note          : all LEDs are controlled by ath9k chip (AR9382)
- UART            : through-hole on PCB
  - assignment    : 3.3V, GND, NC, TX, RX from tri-angle marking
  - settings      : 9600n8
- USB             : 1x USB 2.0 Type-A
  - hub (internal): NEC uPD720114
- Power           : 12 VDC, 1.5 A (Max. 16 W)
- Stock OS        : NetBSD based

Flash instruction using initramfs-factory.bin image (StockFW WebUI):

1. Boot WR8750N with router mode normally
2. Access to the WebUI ("http://aterm.me/" or "http://192.168.0.1/") on
   the device and open firmware update page ("ファームウェア更新")
3. Select the OpenWrt initramfs-factory.bin image and click update
   ("更新") button
4. After updating, the device will be rebooted and booted with OpenWrt
   initramfs image
5. On the initramfs image, upload (or download) uboot.bin and
   sysupgrade.bin image to the device
6. Replace the bootloader with a uboot.bin image

   mtd write <uboot.bin image> bootloader

7. Perform sysupgrade with a sysupgrade.bin image

   sysupgrade <sysupgrade image>

8. Wait ~120 seconds to complete flashing

Flash instruction using initramfs-factory.bin image (bootloader CLI):

 1. Connect and open serial console
 2. Power on WR8750N and interrupt bootloader by ESC key
 3. Login to the bootloader CLI with a password "chiron"
 4. Start TFTP server by "tftpd" command
 5. Upload initramfs-factory.bin via tftp from your computer

   example (Windows): tftp -i 192.168.0.1 PUT initramfs-factory.bin

 6. Boot initramfs image by "boot" command
 7. On the initramfs image, back up the stock bootloader and firmware if
   needed
 8. Upload (or download) uboot.bin and sysupgrade.bin image to the device
 9. Replace the bootloader with a uboot.bin image
10. Perform sysupgrade with a sysupgrade.bin image
11. Wait ~120 seconds to complete flashing

Notes:

- All LEDs are connected to the GPIO controller on the ath9k chip
  (AR9382) and controlled by it. Those LEDs are probed after probing of
  ath9k chip, so they cannot be handled as status LEDs of OpenWrt while
  booting.

- A reset pin of the internal USB hub is connected to the GPIO
  controller of the ath9k chip, like LEDs above. That hub will be
  detected after probing of the ath9k chip.

- The stock bootloader requires an unknown filesystem on firmware area
  in the flash. Booting of OpenWrt from that filesystem cannot be
  handled, so the bootloader needs to be replaced to mainline U-Boot
  before OpenWrt installation.

MAC Addresses:

LAN    : 1C:B1:7F:xx:xx:00 (config,  0x6 (hex))
WAN    : 1C:B1:7F:xx:xx:01 (config,  0xc (hex))
2.4 GHz: 1C:B1:7F:xx:xx:02 (config,  0x0 (hex) / art, 0x1002 (hex))
5 GHz  : 1C:B1:7F:xx:xx:03 (config, 0x12 (hex) / art, 0x5002 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15432
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 18:47:56 +02:00
INAGAKI Hiroshi
09eee2538e ath79: add missing reset de-assertion of PCIe endpoint
Fix PCIe initialization by de-assertion of PCIe endpoint reset.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15432
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 18:47:56 +02:00
INAGAKI Hiroshi
98f73552a7 ath79: fix PCIe initialization on AR934x
Fix PCIe initialization on AR934x by clearing PLL_PWD bit in addition to
PPL(PLL?)_RESET bit of AR724x.

Refresh patches by `make target/linux/refresh`.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15432
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 18:47:56 +02:00
Hauke Mehrtens
f86273e742 ath79: Fix PHY access over ag71xx driver
.ndo_do_ioctl is not called any more. For PHY MII ioctl handling, the
kernel calls .ndo_eth_ioctl now.

The SIOCSIFHWADDR and SIOCGIFHWADDR operation are handled in the generic
code in the same way just with more input validation.

See upstream Linux kernel commit:
https://git.kernel.org/linus/a76053707dbf0dc020a73b4d90cd952409ef3691

Reported-by: Cthulhu88 in https://forum.openwrt.org/t/ethernet-leds-control-for-tp-link-tl-wr1043nd-v2-v3/202378
Link: https://github.com/openwrt/openwrt/pull/16005
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-28 16:12:51 +02:00
Kristian Skramstad
573dd49468 ath79: qca9563: Amplifi Router HD: add DEVICE_VENDOR Ubiquiti
In make menuconfig the name is [Amplifi Router HD], and
is missing Ubiquiti. Lets fix that by adding
DEVICE_VENDOR := Ubiquiti to generic-ubnt.mk so the name is:
[Ubiquiti Amplifi Router HD].

Signed-off-by: Kristian Skramstad <kristian+github@83.no>
Link: https://github.com/openwrt/openwrt/pull/15932
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-21 17:44:36 +02:00
Marco von Rosenberg
f84a9f7dc0 ath79: add support for Huawei AP6010DN
Huawei AP6010DN is a dual-band, dual-radio 802.11a/b/g/n 2x2 MIMO
enterprise access point with one Gigabit Ethernet port and PoE
support.

Hardware highlights:
- CPU: AR9344 SoC at 480MHz
- RAM: 128MB DDR2
- Flash: 32MB SPI-NOR
- Wi-Fi 2.4GHz: AR9344-internal radio
- Wi-Fi 5GHz: AR9580 PCIe WLAN SoC
- Ethernet: 10/100/1000 Mbps Ethernet through Atheros AR8035 PHY
- PoE: yes
- Standalone 12V/2A power input
- Serial console externally available through RJ45 port
- External watchdog: CAT706SVI (1.6s timeout)

Serial console:
  9600n8 (9600 baud, no stop bits, no parity, 8 data bits)

MAC addresses:
  Each device has 32 consecutive MAC addresses allocated by
  the vendor, which don't overlap between devices.
  This was confirmed with multiple devices with consecutive
  serial numbers.
  The MAC address range starts with the address on the label.
  To be able to distinguish between the interfaces,
  the following MAC address scheme is used:
    - eth0 = label MAC
    - radio0 (Wi-Fi 2.4GHz) = label MAC + 1
    - radio1 (Wi-Fi 5GHz) = label MAC + 2

Installation:
0. Connect some sort of RJ45-to-USB adapter to "Console" port of the AP

1. Power up the AP

2. At prompt "Press f or F  to stop Auto-Boot in 3 seconds",
   do what they say.
   Log in with default admin password "admin@huawei.com".

3. Boot the OpenWrt initramfs from TFTP using the hidden script "run ramboot".
   Replace IP address as needed:

   > setenv serverip 192.168.1.10
   > setenv ipaddr 192.168.1.1
   > setenv rambootfile openwrt-ath79-generic-huawei_ap6010dn-initramfs-kernel.bin
   > saveenv
   > run ramboot

4. Optional but recommended as the factory firmware cannot be downloaded publicly:
   Back up contents of "firmware" partition using the web interface or ssh:

   $ ssh root@192.168.1.1 cat /dev/mtd11 > huawei_ap6010dn_fw_backup.bin

5. Run sysupgrade using sysupgrade image. OpenWrt
   shall boot from flash afterwards.

Return to factory firmware (using firmware upgrade package downloaded from non-public Huawei website):
1. Start a TFTP server in the directory where
   the firmware upgrade package is located

2. Boot to u-boot as described above

3. Install firmware upgrade package and format the config partitions:

   > update system FatAP6X10XN_SOMEVERSION.bin
   > format_fs

Return to factory firmware (from previously created backup):
1. Copy over the firmware partition backup to /tmp,
   for example using scp

2. Use sysupgrade with force to restore the backup:
   sysupgrade -F huawei_ap6010dn_fw_backup.bin

3. Boot AP to U-Boot as described above

Quirks and known issues:
- The stock firmware has a semi dual boot concept where the primary
kernel uses a squashfs as root partition and the secondary kernel uses
an initramfs. This dual boot concept is circumvented on purpose to gain
more flash space and since the stock firmware's flash layout isn't
compatible with mtdsplit.
- The external watchdog's timeout of 1.6s is very hard to satisfy
during bootup. This is why the GPIO15 pin connected to the watchdog input
is configured directly in the LZMA loader to output the AHB_CLK/2 signal
which keeps the watchdog happy until the wdt-gpio kernel driver takes
over. Because it would also take too long to read the whole kernel image
from flash, the uImage header only includes the loader which then reads
the kernel image from flash after GPIO15 is configured.

Signed-off-by: Marco von Rosenberg <marcovr@selfnet.de>
Link: https://github.com/openwrt/openwrt/pull/15941
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-21 16:51:52 +02:00
John Audia
66177c081f kernel: bump 6.6 to 6.6.41
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.41

Manually rebased:
	lantiq/patches-6.6/0028-NET-lantiq-various-etop-fixes.patch

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2024-07-19 16:53:24 +02:00
John Audia
69dd5a788f kernel: bump 6.6 to 6.6.37
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.37

Added:
	generic/hack-6.6/900-fix-build-to-handle-return-value.patch[1]

Manually rebased:
	generic/pending-6.6/834-ledtrig-libata.patch

Removed upstreamed:
	bcm27xx/patches-6.6/950-0398-drm-panel-panel-ilitek9881c-Use-cansleep-methods.patch[2]

All other patches automatically rebased.

1. Patch suggested by @DragonBluep to circumvent upstream breakage of kernel 6.6.37 compilation. See comments in https://github.com/openwrt/openwrt/pull/15879 for additional discussion.
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.37&id=1618f7a875ffd916596392fd29880c0429b8af60

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/15879
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:59:37 +02:00
Shiji Yang
ee01666cd3 ath79: suppress GPIO static base allocation warning
Silence ath79 GPIO driver warning by setting GPIO numberspace base
dynamically. This patch also reorganize and fix the GPIO numbers on
6.6 kernel. The new gpio chip base number algorithm:

gpiochip    ath79-SOC    ath9k-0       ath9k-1
base           512      512+ngpios   512+ngpios+10

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/15784
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-07-04 19:30:37 +02:00
Shiji Yang
8895c51d69 ath79: fix 5GHz External Antenna A GPIO for BSAP-1840
Each ath9k device only has 10 gpios. ath9k-0 gpio number range is
502-511, and ath9k-1 gpio number range is 492-501. So "5GHz External
Antenna A" gpio line number should be 492 instead of 489.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/15784
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-07-04 19:30:37 +02:00
Shiji Yang
731318667d ath79: correct dts ngpios properties
SoC Model	GPIO number

ar7100		12
ar7240		18(unknown, default)
ar7241		20
ar7242		18
ar9132		22(unknown, default)
ar9331		30
ar934x		23
qca953x		18
qca955x		24
qca956x		23

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/15784
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-07-04 19:30:37 +02:00
Shiji Yang
354690ebc9 ath79: remove SPI driver link order hack
This hack is used to make sure that the mfd device starts before the
mtd driver[1]. Now the linux driver framework "struct spi_driver {}"
can always ensure this.

[1] 47f8fd1dde ("ar71xx: rewrite SPI drivers for the RB4xx boards")

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-06-23 21:04:20 +02:00
Shiji Yang
f444dea428 ath79: remove GPIO driver earlier registration hack
After porting the ar71xx target to the new ath79 target, we are now
using the device tree instead of the device mach file. And the
platform drivers already support deferred probe. So there is no need
to keep it.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-06-23 21:04:20 +02:00
Robert Marko
73a9f9f857 generic: platform/mikrotik: add NVMEM layout driver
Currently, information from MikroTik hard_config is only available via
sysfs, meaning that we have to rely on userspace to for example setup MACs.

So, lets provide a basic NVMEM layout based driver to expose the same cells
as sysfs driver exposes.

Do note that the we dont extract the WLAN caldata and BDF-s at this point.

Reviewed-by: Thibaut VARÈNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/15665
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-20 15:53:55 +02:00
Shiji Yang
bc56334428 ath79: trim useless package kmod-leds-reset for some devices
Only NETGEAR WNDR3x00 series devices have reset controller LED.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-06-20 14:02:13 +02:00
Shiji Yang
5901598586 ath79: disable unnecessary driver CONFIG_LEDS_RESET
This driver has already been packed as a software package. There is
no need to build it into the kernel.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-06-20 14:02:13 +02:00
Shiji Yang
66b41c4afd ath79: add back usb LED label for NETGEAR WNDR3x00 devices
The "reset-leds" driver does not support parsing color and function
properties.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-06-20 14:02:13 +02:00
Robert Marko
150d0ceab7 ath79: ag71xx: support probe defferal for getting MAC address
Currently, of_get_ethdev_address() return is checked for any return error
code which means that trying to get the MAC from NVMEM cells that is backed
by MTD will fail if it was not probed before ag71xx.

So, lets check the return error code for EPROBE_DEFER and defer the ag71xx
probe in that case until the underlying NVMEM device is live.

Link: https://github.com/openwrt/openwrt/pull/15752
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-20 11:11:36 +02:00
Robert Marko
070b87e7ac ath79: mikrotik: set compat version for NAND devices
Currently, trying to upgrade on a MikroTik NAND device will force you to
use sysupgrade -n due to:
upgrade: The device is supported, but the config is incompatible to the new image (1.0->1.1). Please upgrade without keeping config (sysupgrade -n).
upgrade: NAND images switched to yafut. If running older image, reinstall from initramfs.

So instead of having users manually set the new compat version lets do
what other targets do and set it for all NAND devices after good boot.

Link: https://github.com/openwrt/openwrt/pull/15754
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-06-19 12:26:19 +02:00
Rosen Penev
6ff598306f
treewide: gpio to gpios
gpio is deprecated. Found with dtc's -Wdeprecated_gpio_property

Used git grep -E $'\tgpio = <' to make the changes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15681
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-17 12:57:06 +02:00
Shiji Yang
6fd8cca172 ath79: diable some 6 MiB image size TP-Link devices
The max image sizes are too small to generate images.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-06-16 22:10:37 +02:00
Shiji Yang
4309be6bcb ath79: drop factory image for DIR-825 and TEW-673GRU
The max image sizes are too small to generate factory images.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2024-06-16 22:10:37 +02:00