Hardware
========
SoC: Qualcomm IPQ4018
ETH: Qualcomm QCA8075 (2 x RJ-45)
WDG: OnSemi SCT706
RAM: Micron MT41K128M16JT-125 (256MB)
NOR: Infineon S25FL512S (64MB)
Installation
============
1. Create a ramboot-able image with the command
{ dd if=/dev/zero bs=32 count=1 2>/dev/null; \
cat openwrt-ipq40xx-generic-huawei_ap4050dn-initramfs-uImage.itb; \
} > ramboot.bin`
2. Start a TFTP server in the folder with the ramboot.bin.
3. Plug in a USB-RJ45 serial adapter to the CONSOLE port of the device
and start a serial console session with
9600 baud, no parity, 1 stop bit.
4. Plug in either 12V power or PoE to the device.
5. On the prompt `Press f or F to stop Auto-Boot in 3 seconds`,
press `f` to enter the Huawei U-Boot command line
6. Enter a new password for the u-boot command line
7. In the command line, run these commands to ramboot OpenWrt:
setenv serverip <IPv4 address of TFTP server>
setenv ipaddr <IPv4 address for this AP>
setenv rambootfile ramboot.bin
run ramboot
8. In OpenWrt, set up the network and then `scp` the files
`u-boot-huawei_ap4050dn/uImage` and
`openwrt-ipq40xx-generic-huawei_ap4050dn-squashfs-sysupgrade.bin`
into `/tmp/`
9. To backup the original firmware, run the following:
cat /dev/mtd12 /dev/mtd13 > huawei_ap4050dn_fw_backup.bin.bin
10. Run the following commands to flash u-boot and OpenWrt to the device:
mtd erase uboot
mtd write /tmp/uImage uboot
sysupgrade -n /tmp/openwrt-ipq40xx-generic-huawei_ap4050dn-squashfs-sysupgrade.bin
11. The device should now boot OpenWrt! (sometimes the boot process takes a bit
longer due to the watchdog resetting the device before the watchdog driver runs)
Signed-off-by: Marco von Rosenberg <marcovr@selfnet.de>
Add support for the Huawei AP4050DN. Due to vendor bootloader size
limitations, we require a second-stage U-Boot.
Signed-off-by: Marco von Rosenberg <marcovr@selfnet.de>
memcpy() with overlapping src and dest buffers is an undefined behavior
in C. In the current code, a ConfRej response is generated by copying
input data in-place, where the dest address is lower than the src.
This happens to work in practice because memcpy() forward-copies data,
matching the behavior of memmove() in this case.
However, if FORTIFY_SOURCE or Address Sanitizer is enabled, memcpy()
will detect the overlap at run time and abort the program.
Replace the memcpy() with memmove() to ensure a well-defined behavior.
Reported-by: Filippo Carletti <filippo.carletti@gmail.com>
MRU patch https://github.com/ppp-project/ppp/pull/573
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22286
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
'CONFIG_NET_AIROHA_FLOW_STATS=y' currently breaks NPU
offload for AN7581+MT7996, so disable it for now.
Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Link: https://github.com/openwrt/openwrt/pull/22300
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Introduce the capability to read the firmware binary names from device-tree
using the firmware-name property if available.
This is a preliminary patch to enable NPU offloading for MT7996 (Eagle)
chipset since it requires a different binary with respect to the one
used for MT7992 on the EN7581 SoC.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://github.com/openwrt/openwrt/pull/22289
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Initialize NPU Block Ack memory region if reserved via DTS.
Block Ack memory region is used by NPU MT7996 (Eagle) offloading.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://github.com/openwrt/openwrt/pull/22289
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add pending patch for improving Huawei MA5671a SFP fixup, which allows
communicating with the module even if the fiber isn't connected.
Link: https://github.com/openwrt/openwrt/pull/22283
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Even though these are disabled, dtc still warns on missing reg and
ranges.
Add them. No real difference as it's disabled anyway.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20990
Signed-off-by: Robert Marko <robimarko@gmail.com>
Bump compat version to 3.0 for TP-Link RE355 v1, RE450 v1 and RE450 v2.
Was missed for 25.12; users upgrading from older images need sysupgrade -F.
Signed-off-by: Ivan Diaz <diaz.it@icloud.com>
Link: https://github.com/openwrt/openwrt/pull/22185
Signed-off-by: Robert Marko <robimarko@gmail.com>
Misaligned rootfs_data caused config loss on sysupgrade. Set BLOCKSIZE
:= 4k for proper JFFS2 alignment. Add DEVICE_COMPAT_MESSAGE for
sysupgrade -F requirement.
Signed-off-by: Ivan Diaz <diaz.it@icloud.com>
Link: https://github.com/openwrt/openwrt/pull/22185
Signed-off-by: Robert Marko <robimarko@gmail.com>
Rename Device/tplink_rex5x-v1 to tplink_rex5x. Make RE355 v1, RE450 v1,
and RE450 v2 inherit from it, removing duplicated fields from RE450 v2.
Signed-off-by: Ivan Diaz <diaz.it@icloud.com>
Link: https://github.com/openwrt/openwrt/pull/22185
Signed-off-by: Robert Marko <robimarko@gmail.com>
Embed gpio_led struct in ath_led. Simpler Allocation.
Use a flex array for the name. Allows using a single allocation.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21933
Signed-off-by: Robert Marko <robimarko@gmail.com>
ath79 at this point supports no ath5k devices.
The only targets with ath5k usage are bcm47xx, ixp4xx, and lantiq.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19848
Signed-off-by: Robert Marko <robimarko@gmail.com>
Refresh kernel patches with make target/linux/refresh for each target.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22206
Signed-off-by: Robert Marko <robimarko@gmail.com>
The single user of the downstream gpio-cascade driver has been switched
to use the upstream gpio-line-mux driver. Thus, we can drop the former
now.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22206
Signed-off-by: Robert Marko <robimarko@gmail.com>
The GPIO cascade driver is a downstream-only driver and the Buffalo
WZR-HP-G300NH is its only user for now. Recently, a similar and
independently developed driver 'gpio-line-mux `which serves the same
purpose was accepted upstream and backported here. Use that instead the
downstream driver.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22206
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add the GPIO line mux driver as a kernel module for selected usage by
devices.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22206
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport the upstream 'gpio-line-mux' driver which allows to provide a
1-to-many mapping between one physical GPIO and multiple virtual GPIOs,
based on a multiplexer.
For this purpose, there's been a dedicated downstream driver
'gpio-cascade' which is mostly the same, but wasn't upstreamed in the
end. Independently developed, the 'gpio-line-mux' driver was upstreamed
to solve the exact same problem occuring on Realtek-based Zyxel XS1930
switches. Support for those is being worked on, but the hardware uses a
similar quirk for SFP signals. The signals 'RX_LOS', 'MOD_ABS' and
'TX_FAULT' do not have dedicated GPIOs each but all use a single GPIO
which is multiplexed. Depending on the multiplexer state the GPIO line is
connected to one of the signals.
Since the SFP driver needs single GPIOs for the single signals, this
adapter drivers fills the gap to make both work together.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22206
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support for Richtek RTQ6056 Current and Power Monitor ADC.
RTQ6056 is a high accuracy current-sense monitor with I2C and SMBus
compatible interface, and the device provides full information for
system by reading out the load current and power.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
46f373b47f69 tplink-safeloader: add support for TP-Link Archer AX21 v4.6
7324b0ba8e05 tplink-safeloader: fix segfault when partition name is NULL
7593018845d8 asusuimage: Cleanup code and fix typo
caac8b133aca tplink-safeloader: fix soft_ver for Archer AX21
c0d7de851c9a ptgen: fix bug caused by not completely correct reverts
5b6ef84eaa74 ptgen: allow to specify index of gpt entries to be used
467685270cf0 ptgen: add an option to disable stub partition creation
a2c06c39b41b ptgen: add long option support
6a87eaf434cb ptgen: add support for marking multiple partitions as bootable
Fixes: https://github.com/openwrt/firmware-utils/issues/59
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add ubi nvmem driver, required to load nvmem entries from ubi volumes
Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Enable fitblk driver, required to parse the fit image and set-up the rootfs volume
Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add a label to the spi node to allow device trees to reference it
(i.e. to mark status = "okay").
Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Due to issues surrounding the implementation of the vendor BMT/BBT
on Airoha, upstream ATF + uboot has switched to UBI flash partitions.
However, some devices shipped on this platform are bootloader locked,
and thus it is impossible to replace ATF + uboot.
During testing for the Gemtek W1700K (#17869), sysupgrades from Linux
(which is unaware of the underlying BMT/BBT) would occasionally write
data into blocks which were remapped by the vendor uboot when it was
read on the following reboot, causing a soft brick.
An acceptable workaround [1],[2] was discussed where an intermediate
uboot would be written by the vendor uboot (which is aware of Airoha
BMT/BBT). This chainloader would then ignore the regions of flash
used by the vendor uboot, and store all relevant data inside of UBI.
UBI would then be used to handle bad block management. As the vendor
ATF + uboot do not read or interact with the UBI region, we would avoid
unwanted remaps from BMT/BBT.
This commit introduces support for building such a chainloader, by
packaging u-boot and DTS into a FIT image; to be flashed like a kernel.
Configuration for the Gemtek W1700K is provided as an example of how the
chainloader is used.
[1] https://github.com/openwrt/openwrt/pull/17869#discussion_r2836066746
[2] https://github.com/openwrt/openwrt/pull/17869#discussion_r2838395671
Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
[ move FIP_COMPRESS to Build/Compile, wrap some long lines ]
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
It is more accurate to describe the contents of the FIP as
compressed, instead of the FIP itself becoming compressed.
Update variable naming accordingly.
Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Link: https://github.com/openwrt/openwrt/pull/22151
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
OpenWrt issue:
https://github.com/openwrt/openwrt/issues/16183
Problem summary:
On qualcommax (ipq60xx/ipq807x) with ath11k, monitor-mode captures contain
frames that are consistently longer than expected by 8 bytes.
The symptom is visible in pcap/radiotap captures, and Wireshark parsing
becomes correct after manually cutting these 8 bytes from captured frames.
This patch:
- Remove merge-stage FCS/tail manipulations in ath11k_dp_rx_mon_merg_msdus().
- add length fix in ath11k_dp_rx_mon_deliver(), trim 8 bytes right
before radiotap update and delivery to mac80211.
This targets monitor capture length correctness only and keeps the fix scoped
to the monitor RX delivery path.
Tested-on: ipq8072 yuncore,ax880; ipq6018 yuncore,ax840; yuncore,fap650
Signed-off-by: Ruslan Isaev <legale.legale@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22244
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add a backport patch of realtek ecc driver which has been accepted
upstream. It enables us to make use of devices with NAND that have
OOB size larger than 64 and utilize Realtek ECC engine in OpenWrt.
Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/22243
Signed-off-by: Robert Marko <robimarko@gmail.com>
In order to reduce the need for html scraping, add the imagebuilder,
sdk, build toolchain and llvm-bpf toolchain file names to profiles.json.
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22264
Signed-off-by: Robert Marko <robimarko@gmail.com>
The attributes "is2G5" and "is10G" are set but never used. Drop them.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22255
Signed-off-by: Robert Marko <robimarko@gmail.com>
Adapt the prefix of the port structure.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22255
Signed-off-by: Robert Marko <robimarko@gmail.com>
pcs is currently a standalone array for the pcs of each port.
Convert it to an attribute of the port structure and thus move
it where it belongs.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22255
Signed-off-by: Robert Marko <robimarko@gmail.com>
Enable Kernel Address Space Layout Randomization (KASLR) on the MT7622
platform. Note that this requires the bootloader to provide the kaslr-seed!
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Enable Kernel Address Space Layout Randomization (KASLR) on the MT7622
platform. Note that this requires the bootloader to provide the kaslr-seed!
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Port drivers for the hardware true random number generator found in
MediaTek SoCs and enable them for all boards.
This has the side-effect of U-Boot now providing '/chosen/kaslr-seed'
to Linux which is required to enabled KASLR.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Replace the downstream mtk-rng-v2 driver which was acquires random bytes
from TF-A via SMC. A new approach is needed as TF-A for MT7986 has
changed and now requires to use SMC instead of directly accessing the
TRNG via MMIO. However, we can't know whether we are on old or new TF-A,
many devices (like the BananaPi BPi-R3) allow updating TF-A BL3 in the
field, so it may be of the old or new type, and the RNG driver will have
to figure it out somehow.
This currently means that MT7986 with newer TF-A has broken/non-working
HWRNG in Linux:
root@OpenWrt:~# hexdump -C /dev/hwrng
hexdump: /dev/hwrng: I/O error
Fix this by creating a new combined driver which replaces the previous
mtk-rng-v2 driver, and is able to auto-detect which convention to use
on MT7986.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add support for Airoha EN7581/AN7583 NPU variant firmware present in
linux-firmware. The Airoha EN7581 NPU variant is to support devices
equipped with the MT7996 WiFi chip.
While at it also add an extra new line to follow pattern of double new line to
separate each firmware package.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The fs_wait_for_key function runs multiple background processes that all
try to delete the same temporary file ($keypress_wait) when they exit.
This creates a race condition where one process successfully deletes the
file while others fail with ENOENT.
Busybox rm only suppresses "file not found" errors during the initial lstat()
check, not during the actual unlink() call. This causes error messages in the
boot log even with rm -f:
rm: can't remove '/tmp/tmp.hKjPDH': No such file or directory
Fixed by redirecting stderr to /dev/null for rm calls in concurrent contexts.
This change does not affect functionality and only avoids confusing log
output during boot.
Signed-off-by: Oliver Sedlbauer <os@dev.tdt.de>
Link: https://github.com/openwrt/openwrt/pull/22079
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The MeshPoint.One was disabled during the DSA migration with the
comment "Missing DSA Setup". However, this device inherits its
entire network configuration from 8dev Jalapeno via the
Device/8dev_jalapeno-common template, and shares the same DSA
network setup in 02_network.
The Jalapeno has been working with DSA since the migration. All
MeshPoint.One board support files (DTS, network config, LED config)
are already in place and reference the same QCA8072 switch
configuration as the Jalapeno.
Hardware: Qualcomm IPQ4018, QCA8072 switch, same as 8dev Jalapeno.
Tested: Built firmware from current main branch, boots and network
functions correctly.
Signed-off-by: Valent Turkovic <valent@meshpointone.com>
Link: https://github.com/openwrt/openwrt/pull/22258
Signed-off-by: Robert Marko <robimarko@gmail.com>
Several OpenWrt-related fixes are included in this release.
Drop upstreamed patches and refresh the rest.
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
Link: https://github.com/openwrt/openwrt/pull/22240
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Introduce the devpath option to find the control channel device from a
hardware path for a USB or a WWAN device.
This option is useful when there are multiple modems connected to the
system. The name of the control channel device of a modem can change
depending on which modem initialises first or if it was recently plugged
in. The devpath option allows specifying the hardware path of the modem
where the control channel device will be found using that.
For the USB device hardware path, it is allowed to specify the USB port
number the modem is directly connected to.
If the device and devpath options are both set, devpath takes precedence
over device.
The USB device hardware path of a control channel device can be found by:
readlink -f /sys/class/usbmisc/cdc-wdmX/device
The WWAN device hardware path of a control channel device can be found by:
readlink -f /sys/class/wwan/wwanXqmiX/device
An example uci configuration would be:
config interface 'wwan_usb1'
option proto 'qmi'
option auth 'none'
option devpath '/sys/devices/platform/1e1c0000.xhci/usb1/1-1'
option apn 'internet'
option pdptype 'ipv4v6'
Or:
config interface 'wwan_pcie1'
option proto 'qmi'
option auth 'none'
option devpath '/sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0'
option apn 'internet'
option pdptype 'ipv4v6'
Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
Introduce the devpath option to find the control channel device from a
hardware path for a USB or a WWAN device.
This option is useful when there are multiple modems connected to the
system. The name of the control channel device of a modem can change
depending on which modem initialises first or if it was recently plugged
in. The devpath option allows specifying the hardware path of the modem
where the control channel device will be found using that.
For the USB device hardware path, it is allowed to specify the USB port
number the modem is directly connected to.
If the device and devpath options are both set, devpath takes precedence
over device.
The USB device hardware path of a control channel device can be found by:
readlink -f /sys/class/usbmisc/cdc-wdmX/device
The WWAN device hardware path of a control channel device can be found by:
readlink -f /sys/class/wwan/wwanXmbimX/device
An example uci configuration would be:
config interface 'wwan_usb1'
option proto 'mbim'
option auth 'none'
option devpath '/sys/devices/platform/1e1c0000.xhci/usb1/1-1'
option apn 'internet'
option pdptype 'ipv4v6'
Or:
config interface 'wwan_pcie1'
option proto 'mbim'
option auth 'none'
option devpath '/sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0'
option apn 'internet'
option pdptype 'ipv4v6'
Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
The &pointer + 1 trick is a C89 trick to point to area allocated after
the size of the struct. We have struct_size and flex arrays now.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22170
Signed-off-by: Robert Marko <robimarko@gmail.com>
Some MT7621 devices also have I2C peripherals.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/22213
Signed-off-by: Robert Marko <robimarko@gmail.com>
rtldsa_get_mib_desc() is always well defined and only looks into
the configuration structure. Drop it and use direct data assignment
where needed. While we are here drop all NULL checks because
mib_desc is never unset.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22219
Signed-off-by: Robert Marko <robimarko@gmail.com>
The device specific mib descriptors are located in dsa.c and
rtldsa_get_mib_desc() selects the right decriptor for the caller
based on family_id from the private structure. That makes not
much sense and is not wanted
Move the descriptors into their corresponding files and link
them directly to the config structure. Simplify the selector
by directly returning the linked data.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22219
Signed-off-by: Robert Marko <robimarko@gmail.com>