openwrt/staging/981213.git
15 months agolibtracefs: update to 1.7.0
Nick Hainke [Thu, 20 Jul 2023 16:29:27 +0000 (18:29 +0200)]
libtracefs: update to 1.7.0

ChangeLog:
aebab37 libtracefs: version 1.7
a3237c3 libtracefs: Add initial support for meson
b25019f libtarcefs doc: Add tracefs_kprobe_destroy() to index man page
4c2194f libtracefs doc: State that tracefs_dynevent_create() is needed for tracefs_kprobe_alloc()
df53d43 libtracefs Documentation: Add missing prototypes in top level man page
9a2df4a libtracefs: Update version to 1.7.dev
18ede68 libtracefs: Add tracefs_kprobe_destory() API
309b1ba libtracefs tests: Add helper function to destroy dynamic events
53dce80 tracefs: Add tracefs_time_conversion() API
5ea4128 libtracefs: Add tracefs_find_cid_pid() API
857dd3e libtracefs/utest: Fix crashing of synth test when synths exist
6332309 libtracefs/utest: Do not use synth for test_synth element
25cd206 libtracefs: Clarify the tracefs_synth_create() man page
6b6d43f libtracefs: Do not allow tracefs_synth_set_instance() on created synth
c860f93 libtracefs: Documentation for tracefs_synth_set_instance
0039173 libtracefs: New API to set synthetic event instance
e97c311 libtracefs: Do not segfault in tests if synthetic events are not configured
185019c libtracefs: Add tracefs_instance_tracers() API
6775d23 libtracefs: Do not use hwlat tracer and fdb_delete event for tests
5a1a01e libtracefs: Add stacktrace to tracefs_sql()
b1b234e libtracefs: Unit test for tracefs_instance_reset()
dd620f4 libtracefs: Documentation for tracefs_instance_reset()
789e82d libtracefs: New API to reset ftrace instance

Signed-off-by: Nick Hainke <vincent@systemli.org>
15 months agolibtraceevent: update to 1.7.3
Nick Hainke [Thu, 20 Jul 2023 16:27:04 +0000 (18:27 +0200)]
libtraceevent: update to 1.7.3

ChangeLog:
dd14818 libtraceevent: version 1.7.3
0b9a34e libtraceevent: Handle printf '%+d" case
eba4a41 libtraceevent: Add initial support for meson
1d8ddb9 libtraceevent: Handle %c

Signed-off-by: Nick Hainke <vincent@systemli.org>
15 months agotools/7z: update to 23.01
Nick Hainke [Wed, 19 Jul 2023 13:45:10 +0000 (15:45 +0200)]
tools/7z: update to 23.01

Release Notes:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/3f550826d8/#e950

Manually adjust:
- 7-zip-flags.patch

Automatically refresh:
- 7-zip-musl.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
15 months agonetifd: update to the latest version
Felix Fietkau [Wed, 5 Jul 2023 12:51:19 +0000 (14:51 +0200)]
netifd: update to the latest version

8c2758b4fbbb wireless: add support for replacing data blobs at runtime
0ff22a6a68ce wireless: enable dynamic reconfiguration by default

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agohostapd: add ucode support, use ucode for the main ubus object
Felix Fietkau [Fri, 26 May 2023 08:23:59 +0000 (10:23 +0200)]
hostapd: add ucode support, use ucode for the main ubus object

This implements vastly improved dynamic configuration reload support.
It can handle configuration changes on individual wifi interfaces, as well
as adding/removing interfaces.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agohostapd: switch to using uloop (integrated with built-in eloop)
Felix Fietkau [Wed, 24 May 2023 08:23:13 +0000 (10:23 +0200)]
hostapd: switch to using uloop (integrated with built-in eloop)

Preparation for pulling in more code that uses uloop

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agohostapd: add support for querying assoc/probe IEs
Felix Fietkau [Fri, 21 Jul 2023 11:05:23 +0000 (13:05 +0200)]
hostapd: add support for querying assoc/probe IEs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agohostapd: add experimental radius server
Felix Fietkau [Thu, 16 Mar 2023 10:35:50 +0000 (11:35 +0100)]
hostapd: add experimental radius server

This can be used to run a standalone EAP server that can be used from
other APs. It uses json as user database format and can automatically
handle reload.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
15 months agoath11k-firmware: update to stable WLAN.HK.2.9.0.1-01862
Michał Kwiatek [Fri, 28 Jul 2023 13:59:44 +0000 (15:59 +0200)]
ath11k-firmware: update to stable WLAN.HK.2.9.0.1-01862

Changelog from quic:

Bug fixes, stability improvements from previous releases
are present. There are no backward comatibility issues
with this release.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Michał Kwiatek <michal@kwiatek.it> # Xiaomi AX3600
Signed-off-by: Michał Kwiatek <michal@kwiatek.it>
15 months agouboot-mediatek: fix build for MT7629
Daniel Golle [Mon, 31 Jul 2023 18:47:54 +0000 (19:47 +0100)]
uboot-mediatek: fix build for MT7629

Add patch to fix build failure caused by a missing header which had
previously been implicitely included.

Fixes: 6ddb5f5a65 ("uboot-mediatek: update to version 2023.07.02")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
15 months agomediatek: filogic: enable driver for MediaTek XS-PHY
Daniel Golle [Mon, 31 Jul 2023 17:05:22 +0000 (18:05 +0100)]
mediatek: filogic: enable driver for MediaTek XS-PHY

Enable driver for MediaTek SuperSpeedPlus XS-PHY transceiver for the
USB3.1 GEN2 controllers found in the MT7988 SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
15 months agouboot-mediatek: add missing 'memory' nodes to downstream boards
Daniel Golle [Mon, 31 Jul 2023 16:46:22 +0000 (17:46 +0100)]
uboot-mediatek: add missing 'memory' nodes to downstream boards

Among the patches adding support for MT7988 also came the switch to
use fdtdec_setup_mem_size_base() and no longer rely on CFG_SYS_SDRAM_BASE.
Take care of our downstream boards which did not have a 'memory' node in
their device trees.

Fixes: 572ea68070 ("uboot-mediatek: add patches for MT7988 and builds for RFB")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
15 months agoqualcommax: ipq807x: fix Gen2 PCIe port
Robert Marko [Mon, 31 Jul 2023 10:08:34 +0000 (12:08 +0200)]
qualcommax: ipq807x: fix Gen2 PCIe port

Gen2 PCIe port recently got broken on IPQ807x during update to 6.1.39 as
upstream backported:
("PCI: qcom: Remove PCIE20_ prefix from register definitions") [1]

So, fix it by adding a pending upstream fix for it [2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/pci/controller/dwc/pcie-qcom.c?h=v6.1.39&id=db962c7a711c3393a80a18219960cd54fb33c53d
[2] https://patchwork.kernel.org/project/linux-arm-msm/patch/20230724063429.3980462-1-quic_srichara@quicinc.com/

Fixes: fec22f8375b4 ("kernel: bump 6.1 to 6.1.39")
Signed-off-by: Robert Marko <robimarko@gmail.com>
15 months agoarm-trusted-firmware-mediatek: fix PKG_MIRROR_HASH
Daniel Golle [Mon, 31 Jul 2023 00:12:24 +0000 (01:12 +0100)]
arm-trusted-firmware-mediatek: fix PKG_MIRROR_HASH

Instead of using the hash of the Github-generated tarball use the
hash of the tarball generated by the OpenWrt build system (in this
case they are different, unfortunately).

Reported-by: Chen Minqiang <ptpt52@gmail.com>
Fixes: 07dbeb430e ("arm-trusted-firmware-mediatek: update to sources of 2023-07-24")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
15 months agokernel: bump 6.1 to 6.1.42
John Audia [Thu, 27 Jul 2023 09:25:12 +0000 (05:25 -0400)]
kernel: bump 6.1 to 6.1.42

Manually rebased:
generic/pending-6.1/203-kallsyms_uncompressed.patch

All other patches automatically rebased.

Changelog: https://lore.kernel.org/stable/2023072749-gumming-selector-a081@gregkh/

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

Signed-off-by: John Audia <therealgraysky@proton.me>
15 months agokernel: netsupport: Add kmod-sched-skbprio
Alexandru Gagniuc [Thu, 27 Jul 2023 15:51:33 +0000 (10:51 -0500)]
kernel: netsupport: Add kmod-sched-skbprio

Add support for the SKBPRIO queuing discipline. This is subtly
different than prio as it also drops packets from the lower priority
flows.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
15 months agokernel: bump 5.15 to 5.15.123
John Audia [Thu, 27 Jul 2023 13:22:32 +0000 (09:22 -0400)]
kernel: bump 5.15 to 5.15.123

Manually rebased:
bcm4908/patches-5.15/071-v6.1-0001-net-broadcom-bcm4908_enet-handle-EPROBE_DEFER-when-g.patch
bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch[*]

Removed upstreamed:
backport-5.15/735-v6.5-net-bgmac-postpone-turning-IRQs-off-to-avoid-SoC-han.patch[1]
backport-5.15/817-v6.5-01-leds-trigger-netdev-Recheck-NETDEV_LED_MODE_LINKUP-o.patch[2]
pending-5.15/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch[3]
pending-5.15/160-workqueue-fix-enum-type-for-gcc-13.patch[4]
bcm53xx/patches-5.15/036-v6.5-0003-ARM-dts-BCM5301X-Drop-clock-names-from-the-SPI-node.patch[5]
bcm53xx/patches-5.15/036-v6.5-0015-ARM-dts-BCM5301X-fix-duplex-full-full-duplex.patch[6]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=02474292a44205c1eb5a03634ead155a3c9134f4
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=86b93cbfe104e99fd3d25a49748b99fb88101573
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=79b9ab357b6f5675007f4c02ff8765cbd8dc06a2
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=d528faa9e828b9fc46dfb684a2a9fd8c2e860ed8
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=5899bc4058e89d5110a23797ff94439c53b77c25
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=95afd2c7c7d26087730dc938709e025a303e5499

Build system: x86/64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John Audia <therealgraysky@proton.me>
[rebased ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch ]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
15 months agortl8812au-ct: fix even more compilation error with kernel 6.1
Christian Marangi [Sun, 30 Jul 2023 09:30:19 +0000 (11:30 +0200)]
rtl8812au-ct: fix even more compilation error with kernel 6.1

Fix more compilation error with kernel 6.1 and make it possible to
compile.

Multiple fix are done due to kernel bump:
- PDE_DATA (now deprecated) to pde_data
- dev_addr now const and require some cast
- prandom_u32 (now deprecated) to get_random_u32

Also other minor fix for always true condition and tasklet type cast not
compatible.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
15 months agoramips: mt7621-wdt: use phandle to access system controller registers
Shiji Yang [Thu, 22 Jun 2023 13:22:32 +0000 (21:22 +0800)]
ramips: mt7621-wdt: use phandle to access system controller registers

These patches allow the driver to access some watchdog registers via a
phandle to the system controller node[1]. To apply these changes, we
need to add "mediatek,sysctl" to the SoC dtsi. This commit also remove
the redundent clocks, interrupts and resets properties.

[1] https://lore.kernel.org/all/20230214103936.1061078-2-sergio.paracuellos@gmail.com

Tested on Motorola MWR03 (MT7628)

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
15 months agoramips: add proper system clock and reset driver support for legacy SoCs
Shiji Yang [Sat, 17 Jun 2023 11:30:59 +0000 (19:30 +0800)]
ramips: add proper system clock and reset driver support for legacy SoCs

This series of upstream patches properly implement a clock and reset
driver for old ralink SoCs[1]. And it includes some related fixes[2] and
improvements[3][4]. All patches have been merged into linux-next. They
will be part of upcoming Linux 6.5. In order to switch to the new system
controller driver, all clocks and resets properties in SoC dtsi have been
updated, and kernel symbol "CONFIG_CLK_MTMIPS" have been added to the
kernel config files.

[1] https://lore.kernel.org/all/20230619040941.1340372-1-sergio.paracuellos@gmail.com
[2] https://lore.kernel.org/all/20230622-mips-ralink-clk-wuninitialized-v1-1-ea9041240d10@kernel.org
[3] https://lore.kernel.org/all/OSYP286MB03120BABB25900E113ED42B7BC5CA@OSYP286MB0312.JPNP286.PROD.OUTLOOK.COM
[4] https://lore.kernel.org/all/TYAP286MB03151148AF8C054621DD55C3BC23A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM

Tested on Motorola MWR03 (MT7628)
Tested on Haier HW-L1W (MT7620)

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
15 months agoramips: add proper system clock and reset driver support for mt7621
Shiji Yang [Sat, 17 Jun 2023 11:30:59 +0000 (19:30 +0800)]
ramips: add proper system clock and reset driver support for mt7621

This series of upstream patches makes the system controller node as a
reset provider[1][2], and it also includes some clock and reset driver
fixes[3][4]. Meanwhile, all clocks and resets properties in the SoC
device tree have been updated to be compatible with the new driver.

[1] https://lore.kernel.org/r/20220110114930.1406665-2-sergio.paracuellos@gmail.com
[2] https://lore.kernel.org/r/20220210094859.927868-2-sergio.paracuellos@gmail.com
[3] https://lore.kernel.org/r/20221217074806.3225150-1-sergio.paracuellos@gmail.com
[4] https://lore.kernel.org/r/20230206083305.147582-1-sergio.paracuellos@gmail.com

Tested on RAISECOM MSG1500 X.00

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
15 months agotoolchain: gcc: updat to 13.2
Nick Hainke [Sat, 29 Jul 2023 15:58:31 +0000 (17:58 +0200)]
toolchain: gcc: updat to 13.2

Release Notes:
https://gcc.gnu.org/pipermail/gcc/2023-July/242148.html

Remove upstreamed patches:
- patches-13.x/001-rtl-optimization-109585-alias-analysis-typo.patch
- patches-13.x/700-RISCV-Inline-subword-atomic-ops.patch
- patches-13.x/701-riscv-linux-Don-t-add-latomic-with-pthread.patch

Refresh patches:
- patches-13.x/10-mbsd_multi.patch

Signed-off-by: Nick Hainke <vincent@systemli.org>
15 months agourngd: fix archived tar hash
Rafał Miłecki [Sun, 30 Jul 2023 10:40:05 +0000 (12:40 +0200)]
urngd: fix archived tar hash

Due to some hiccup my local urngd-2023-07-25-7aefb47b.tar.xz ended up
being different from archived one. Repackaging it locally confirmed the
previous hash was incorrect.

Fixes: c74b5e09e692 ("urngd: update to the latest master")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agokernel: backport proper fix for mtd preventing devices probing
Rafał Miłecki [Sat, 29 Jul 2023 23:00:09 +0000 (01:00 +0200)]
kernel: backport proper fix for mtd preventing devices probing

Improper of_platform_populate() call caused issue with probing devices
drivers.

Fixes: 41e1e838fbbb ("kernel: backport mtd patch adding of_platform_populate() calls")
Fixes: #10232
Ref: 79af0593a30b ("kernel: switch back 5.15 to fw_devlink=permissive")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agobcm53xx: backport more DT changes queued for v6.6
Rafał Miłecki [Sat, 29 Jul 2023 15:02:28 +0000 (17:02 +0200)]
bcm53xx: backport more DT changes queued for v6.6

Those sort out BCM53573 Ethernet info finally.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agoramips: pinctrl: support requesting different functions for same group
Shiji Yang [Sat, 29 Jul 2023 13:24:10 +0000 (21:24 +0800)]
ramips: pinctrl: support requesting different functions for same group

MT7620 wireless radio needs change the pin group function between
"gpio" and "pa" during the calibration process. However, ralink
pinctrl driver doesn't support requesting different functions for
the same group. This patch enables pinctrl consumers to perform
such operations.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
16 months agomac80211: rework MT7620 PA/LNA RF calibration
Shiji Yang [Sat, 29 Jul 2023 13:24:09 +0000 (21:24 +0800)]
mac80211: rework MT7620 PA/LNA RF calibration

This patch makes some improvements to the MT7620 RF calibration.

1. Move MT7620 PA/LNA calibration code to dedicated functions.
2. Restore RF and BBP registers before R-Calibration.
3. Do Rx DCOC calibration again before RXIQ calibration.
4. Use SoC specific AGC initial LNA value.
5. Correct MAC_RX_EN mask in rt2800_r_calibration()[1].

[1] This change may fix the "BBP/RF register access failed" error:
ieee80211 phy0: rt2800_wait_bbp_rf_ready: Error - BBP/RF register access failed, aborting

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
16 months agouboot-mediatek: add patches for MT7988 and builds for RFB
Daniel Golle [Sat, 22 Jul 2023 17:55:32 +0000 (18:55 +0100)]
uboot-mediatek: add patches for MT7988 and builds for RFB

Import pending patches adding support for MT7988 and provide builds
for the reference board for all possible boot media.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
16 months agouboot-mediatek: update to version 2023.07.02
Daniel Golle [Sat, 22 Jul 2023 14:50:27 +0000 (15:50 +0100)]
uboot-mediatek: update to version 2023.07.02

Release 2023.07 got tagged wrongly and replaced by follow-up release
2023.07.02.

Now using upstream DTS for BPi-R3.
Removed two patches which made it upstream, refreshed the rest.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
16 months agoarm-trusted-firmware-mediatek: update to sources of 2023-07-24
Daniel Golle [Sat, 22 Jul 2023 14:12:27 +0000 (15:12 +0100)]
arm-trusted-firmware-mediatek: update to sources of 2023-07-24

Use updated Trusted Firmware-A sources from MediaTek, now stacked
on top of the ARM Trusted Firmware-A v2.9 release.
Add builds for the newly added MT7988 SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
16 months agoarm-trusted-firmware-tools: update to version 2.9
Daniel Golle [Sat, 22 Jul 2023 14:10:54 +0000 (15:10 +0100)]
arm-trusted-firmware-tools: update to version 2.9

 147f52f3e feat(fiptool): add cca, core_swd, plat cert in FIP
 0aaa382fe fix(sptool): fix concurrency issue for SP packages
 cb666b39d Merge "fix(sptool): fix concurrency issue for SP packages" into integration
 0be2475f6 fix: 'sp_mk_generator.py' reference to undef var
 1a28f290b fix(sptool): operators "is/is not" in sp_mk_gen.py
 cf2dd17dd refactor(security): add OpenSSL 1.x compatibility
 4daeaf341 fix(sptool): add dependency to SP image
 06e69f7c9 feat(fiptool): handle FIP in a disk partition
 5a53c6c66 Merge "feat(fiptool): handle FIP in a disk partition" into integration
 034a2e3ef refactor(fiptool): move plat_fiptool.mk to tools
 0165ddd7c build(fiptool): add object dependency generation
 c89fdb4a5 Merge "refactor(fiptool): move plat_fiptool.mk to tools" into integration
 1b491eead fix(tree): correct some typos

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
16 months agouboot-mvebu: update to version 2023.07.02
Oli Ze [Thu, 27 Jul 2023 05:23:12 +0000 (07:23 +0200)]
uboot-mvebu: update to version 2023.07.02

Since 2021.07 multiple bugs were introduced that made it impossible to
create a bootable target for mvebu. Those issues should be now fixed since
2023.07-rc1.

References: #11661
Signed-off-by: Oli Ze <olze@trustserv.de>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Andre Heider <a.heider@gmail.com> # espressobin-v3-v5-1gb-2cs
Signed-off-by: Petr Štetiar <ynezz@true.cz> [facelift]
16 months agoramips: use NVMEM cells with mt76 EEPROM for Netgear R6220 & WNDR3700 v5
Rafał Miłecki [Fri, 28 Jul 2023 16:53:20 +0000 (18:53 +0200)]
ramips: use NVMEM cells with mt76 EEPROM for Netgear R6220 & WNDR3700 v5

This uses new upstream DT binding. It's more generic (NVMEM) compared to
the old one (MTD).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agoramips: use fixed layout cell "mac-base" for Netgear WNDR3700 v5
Rafał Miłecki [Fri, 28 Jul 2023 16:48:34 +0000 (18:48 +0200)]
ramips: use fixed layout cell "mac-base" for Netgear WNDR3700 v5

This drops a use of downstream "mac-address-increment".

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agoath79: replace "mac-address-ascii" with "mac-base"
Rafał Miłecki [Fri, 21 Jul 2023 05:34:25 +0000 (07:34 +0200)]
ath79: replace "mac-address-ascii" with "mac-base"

With upstream accepted "mac-base" binding there is no need for a
downstream "mac-address-ascii" workaround anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agobuild: make git sub-modules to fetch configurable
Karsten Sperling [Thu, 16 Mar 2023 01:17:26 +0000 (14:17 +1300)]
build: make git sub-modules to fetch configurable

Currently the git protocol downloads all submodules of the target
repository. This can be unwieldy for repositories with a lot of submodules
where only a subset are required in the context of the OpenWrt build.

This change adds a PKG_SOURCE_SUBMODULES variable to configure this
behavior. It takes a space-separated list of submodule paths, or the word
"skip" to disable submodule downloads entirely. The default is to download
all submodules, i.e. preserving current behavior.

Signed-off-by: Karsten Sperling <ksperling@apple.com>
16 months agomediatek: filogic: fix broken sysupgrade script
Petr Štetiar [Fri, 28 Jul 2023 06:20:57 +0000 (08:20 +0200)]
mediatek: filogic: fix broken sysupgrade script

Changes introduced in commit 54dc1cde48a4 ("mediatek: filogic: add
support for Xiaomi WR30U") missed to end the case item with mandatory
`;;` which lead to a broken sysupgrade.

Fixes: 54dc1cde48a4 ("mediatek: filogic: add support for Xiaomi WR30U")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
16 months agotoolchain: kernel-headers: remove debugging env dump
Petr Štetiar [Thu, 20 Jul 2023 06:41:44 +0000 (08:41 +0200)]
toolchain: kernel-headers: remove debugging env dump

Remove debugging `env` dump left over as build environments might
contain some sensitive information, which then might leak into the build
logs.

Fixes: 2105acbe2804 ("kernel-headers: fix compile error caused by wrong host include path when the toolchain is already built")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
16 months agotoolchain: kernel-headers: fix check target for external Git trees
Petr Štetiar [Thu, 20 Jul 2023 13:48:39 +0000 (15:48 +0200)]
toolchain: kernel-headers: fix check target for external Git trees

Executing following command currently fails:

 $ make toolchain/kernel-headers/{download,check} V=sc FIXUP=1
 ...
 include/kernel-version.mk:11: *** Missing kernel version/hash file for . Please create include/kernel-.  Stop.

So lets fix it by adding the necessary missing KERNEL_PATCHVER variable.

That additional kernel-build.mk include is needed to add another set of
missing variables:

 $ make toolchain/kernel-headers/{download,check} V=sc FIXUP=1
 ...
 Makefile:115: *** ERROR: Unknown pack format for file tmp/dl/.  Stop.

Fixes: 0765466a42f4 ("kernel: split kernel version to dedicated files")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
16 months agoipq807x: prpl-haze: fix sysupgrade flashing from bootloader
Petr Štetiar [Thu, 29 Jun 2023 12:29:02 +0000 (14:29 +0200)]
ipq807x: prpl-haze: fix sysupgrade flashing from bootloader

While flashing sysupgrade image from U-Boot, then the rootfs_data
overlay filesystem formatting is left for the fstools during firstboot,
but that wont work as mkfs.f2fs is missing in the sysupgrade image:

 mount_root: overlay filesystem in /dev/loop0 has not been formatted yet
 mount_root: no usable overlay filesystem found, using tmpfs overlay
 sh: mkfs.f2fs: not found

 Filesystem                Size      Used Available Use% Mounted on
 /dev/loop0              139.6M     46.9M     92.6M  34% /overlay

 Number  Start (sector)    End (sector)  Size       Code  Name
  20           98850          406349   150.1 MiB   FFFF  rootfs

So lets fix it by adding f2fs support to the sysupgrade image.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
16 months agomediatek: filogic: add specific layout for WR30U
Hank Moretti [Wed, 26 Jul 2023 14:39:16 +0000 (14:39 +0000)]
mediatek: filogic: add specific layout for WR30U

Because this device enable NMBM by default, most users use custom
U-Boot with NMBM-Enabled in Chinese forums.

This layout is the same as the ubootmod layout but enabling NMBM.

Signed-off-by: Hank Moretti <mchank9999@gmail.com>
16 months agomediatek: filogic: add support for Xiaomi WR30U
Hank Moretti [Fri, 21 Jul 2023 03:54:52 +0000 (03:54 +0000)]
mediatek: filogic: add support for Xiaomi WR30U

Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: ESMT F50L1G41LB 128MB
  RAM: NT52B128M16JR-FL 256MB
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, Mesh
  Power: DC 12V 1A

Flash instructions:

1. Get ssh access
link: https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000ne/153769/22
2. Backup import partitions
   ```
   dev:    size   erasesize  name
   mtd1: 00100000 00020000 "BL2"
   mtd2: 00040000 00020000 "Nvram"
   mtd3: 00040000 00020000 "Bdata"
   mtd4: 00200000 00020000 "Factory"
   mtd5: 00200000 00020000 "FIP"
   mtd8: 02200000 00020000 "ubi"
   mtd9: 02200000 00020000 "ubi1"
   mtd12: 00040000 00020000 "KF"

   ```

   Use these commands blow to backup your stock partitions.
   ```
   nanddump -f /tmp/BL2.bin /dev/mtd1
   nanddump -f /tmp/Nvram.bin /dev/mtd2
   nanddump -f /tmp/Bdata.bin /dev/mtd3
   nanddump -f /tmp/Factory.bin /dev/mtd4
   nanddump -f /tmp/FIP.bin /dev/mtd5
   nanddump -f /tmp/ubi.bin /dev/mtd8
   nanddump -f /tmp/KF.bin /dev/mtd12
   ```
   Then, transfer them to your computer via scp, netcat, tftp
   or others and keep them in a safe place.

3. Setup Nvram
   Get the current stock: `cat /proc/cmdline`

   If you find `firmware=0` or `mtd=ubi`, use these commands:
   ```
   nvram set boot_wait=on
   nvram set uart_en=1
   nvram set flag_boot_rootfs=1
   nvram set flag_last_success=1
   nvram set flag_boot_success=1
   nvram set flag_try_sys1_failed=0
   nvram set flag_try_sys2_failed=0
   nvram commit
   ```

   If you find `firmware=1` or `mtd=ubi1`, use these commands:
   ```
   nvram set boot_wait=on
   nvram set uart_en=1
   nvram set flag_boot_rootfs=0
   nvram set flag_last_success=0
   nvram set flag_boot_success=1
   nvram set flag_try_sys1_failed=0
   nvram set flag_try_sys2_failed=0
   nvram commit
   ```

4. Flash stock-initramfs-factory.ubi
   If you find `firmware=0` or `mtd=ubi`:
   `ubiformat /dev/mtd9 -y -f /tmp/stock-initramfs-factory.ubi`

   If you find `firmware=1` or `mtd=ubi1`:
   `ubiformat /dev/mtd8 -y -f /tmp/stock-initramfs-factory.ubi`

   Then reboot your router, it should boot to the openwrt
   initramfs system now.

5. Setup uboot-env
   Now it will be setup automatically in upgrade process,
   you can skip this step.

   If your `fw_setenv` did not work, you need run this command:
   `echo "/dev/mtd1 0x0 0x10000 0x20000" > /etc/fw_env.config`

   Then setup uboot-env:
   ```
   fw_setenv boot_wait on
   fw_setenv uart_en 1
   fw_setenv flag_boot_rootfs 0
   fw_setenv flag_last_success 1
   fw_setenv flag_boot_success 1
   fw_setenv flag_try_sys1_failed 8
   fw_setenv flag_try_sys2_failed 8
   fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),
   2048k(factory),2048k(fip),256k(crash),256k(crash_log),
   34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
   ```

6. Flash stock-squashfs-sysupgrade.bin
   Use shell command:
   `sysupgrade -n /tmp/stock-squashfs-sysupgrade.bin`
   Or go to luci web.

If you need to change to Openwrt U-Boot layout, do next. If you
do not need, please ignore it.

Change to OpenWrt U-Boot:

1. Flash ubootmod-initramfs-factory.ubi
   Check mtd partitions: `cat /proc/mtd`
   ```
   mtd7: 00040000 00020000 "KF"
   mtd8: 02200000 00020000 "ubi_kernel"
   mtd9: 04e00000 00020000 "ubi"
   ```

   Run following command:
   `ubiformat /dev/mtd8 -y -f /tmp/ubootmod-initramfs-factory.ubi`
   Then reboot your router, it should boot to the openwrt initramfs
   system now.

2. Check mtd again
   ```
   mtd7: 00040000 00020000 "KF"
   mtd8: 07000000 00020000 "ubi"
   ```
   Make sure mtd8 is ubi.

3. Install kmod-mtd-rw
   Run command: `opkg update && opkg install kmod-mtd-rw`
   Or get it in openwrt server, or build it yourself, then install
   it manually

   Then run this command:
   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

4. Clean up pstore
   Run Command: `rm -f /sys/fs/pstore/*`

5. Format ubi and create new ubootenv volume
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
   ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
   ```

6. (Optional) Add recovery boot feature.
   ```
   ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
   ubiupdatevol /dev/ubi0_2 /tmp/ubootmod-initramfs-recovery.itb
   ```

7. Flash Openwrt U-Boot
   ```
   mtd write /tmp/ubootmod-preloader.bin BL2
   mtd write /tmp/ubootmod-bl31-uboot.fip FIP
   ```

6. Flash ubootmod-squashfs-sysupgrade.itb
   Use shell command:
   `sysupgrade -n /tmp/ubootmod-squashfs-sysupgrade.itb`
   Or go to luci web.

Now everything is done, Enjoy!

Go Back to stock from Openwrt U-Boot:

1. Force flash ubootmod-initramfs-recovery.itb
   Use shell command:
   `sysupgrade -F -n /tmp/ubootmod-initramfs-recovery.itb`
   Or go to luci web.
   Then it should boot to the openwrt initramfs system now.

2. Format ubi and Nvram
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   mtd erase Nvram
   ```

3. Install kmod-mtd-rw
   Run command: `opkg update && opkg install kmod-mtd-rw`
   Or get it in openwrt server, or build it yourself, then install
   it manually

   Then run this command:
   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

4. Flash stock U-Boot and ubi
   ```
   mtd write /tmp/BL2.bin BL2
   mtd write /tmp/FIP.bin FIP
   mtd write /tmp/ubi.bin ubi
   ```
   Then reboot your router, waiting it finished rollback in minutes.

Go Back to stock from stock layout Openwrt:
   Just run command: `ubiformat /dev/mtd8 -y -f /tmp/ubi.bin`
   Then reboot your router, waiting it finished rollback in minutes.

Notes:
1. Openwrt U-Boot and ubootmod openwrt did not enable NMBM.
   Please make your backup safe.

Signed-off-by: Hank Moretti <mchank9999@gmail.com>
16 months agouboot-mediatek: add support for Xiaomi WR30U
Hank Moretti [Thu, 20 Jul 2023 17:42:58 +0000 (17:42 +0000)]
uboot-mediatek: add support for Xiaomi WR30U

Add a custom uboot build to support openwrt uboot layout.

Signed-off-by: Hank Moretti <mchank9999@gmail.com>
16 months agoprocd: improve status reporting for partially running services
Jo-Philipp Wich [Thu, 27 Jul 2023 11:31:18 +0000 (13:31 +0200)]
procd: improve status reporting for partially running services

The existing implementation incorrectly reported `running` for services
without any instances or with all instances stopped/terminated.

Improve the default implementation of `/etc/init.d/* status` to properly
report services with not running instances. In case a service exists,
but without running instance, the status call will now report
"not running" with exit code 5. In case some instances are running and
some are stopped/terminated, the call will report "running (X/Y)" where
`X` denoted the amount of running instances and `Y` the amount of total
registered ones.

Ref: https://forum.openwrt.org/t/x/159443
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
16 months agolibnl-tiny: update to latest Git HEAD
Jo-Philipp Wich [Thu, 27 Jul 2023 09:27:46 +0000 (11:27 +0200)]
libnl-tiny: update to latest Git HEAD

8667347 build: allow passing SOVERSION value for dynamic library

Also adjust packaging of the library to only ship the SOVERSION
suffixed library object, to allow for concurrent installation of
ABI-incompible versions in the future.

Fixes: #13082
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
16 months ago.gitignore: ignore link if target is included from feed
Florian Eckert [Wed, 19 Jul 2023 09:54:25 +0000 (11:54 +0200)]
.gitignore: ignore link if target is included from feed

If an out of tree target is included via a feed, then there is a link with
the name 'feed' in the target directory. Do not show this link in git.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
16 months agokernel: bump 6.1 to 6.1.41
John Audia [Mon, 24 Jul 2023 23:03:23 +0000 (19:03 -0400)]
kernel: bump 6.1 to 6.1.41

No patches modified; just refresh checksums.

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

Signed-off-by: John Audia <therealgraysky@proton.me>
16 months agougps: update to latest HEAD, introduce baudrate
Arne Zachlod [Wed, 5 Jul 2023 08:55:44 +0000 (10:55 +0200)]
ugps: update to latest HEAD, introduce baudrate

350b960 add support for multi GNSS solutions
fb87d0f ugps: add baud rate command line option
a8171a0 main.c: -S does not take any options

Build-tested: ramips/ltap-2hnd
Run-tested: ramips/ltap-2hnd

Signed-off-by: Arne Zachlod <arne@nerdkeller.org>
16 months agodropbear: add ed25519 for failsafe key
Etienne Champetier [Mon, 10 Jul 2023 05:56:05 +0000 (07:56 +0200)]
dropbear: add ed25519 for failsafe key

At least Fedora and RHEL 9 set RSAMinSize=2048, so when trying to use
failsafe, we get 'Bad server host key: Invalid key length'
To workaround the issue, we can use: ssh -o RSAMinSize=1024 ...

Generating 2048 bits RSA is extremely slow, so add ed25519.
We keep RSA 1024 to be as compatible as possible.

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
16 months agoipq4019: fix support for AVM FRITZ!Repeater 3000
Alexander Friese [Wed, 12 Jul 2023 14:46:01 +0000 (16:46 +0200)]
ipq4019: fix support for AVM FRITZ!Repeater 3000

new versions of the device have NAND with 8bit ECC
which was not yet supported before. This change removes
ECC restrictions.

Signed-off-by: Alexander Friese <af944580@googlemail.com>
16 months agokernel: Autoload nvme at preinit time
Luca Barbato [Sun, 23 Jul 2023 20:23:40 +0000 (22:23 +0200)]
kernel: Autoload nvme at preinit time

This way is possible to mount nvme extroots.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
16 months agorockchip: enable wifi support for NanoPC T4
Lu jicong [Mon, 24 Jul 2023 08:11:28 +0000 (16:11 +0800)]
rockchip: enable wifi support for NanoPC T4

wifi module: AP6356S (BCM4356) SDIO

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
16 months agolinux-firmware: broadcom: package bcm4356 NVRAM for NanoPC T4
Lu jicong [Mon, 24 Jul 2023 08:03:57 +0000 (16:03 +0800)]
linux-firmware: broadcom: package bcm4356 NVRAM for NanoPC T4

Prepare for NanoPC T4 WIFI support.

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
16 months agorockchip: add FriendlyARM NanoPC T4 support
Lu jicong [Mon, 24 Jul 2023 07:22:42 +0000 (15:22 +0800)]
rockchip: add FriendlyARM NanoPC T4 support

Hardware
--------
RockChip RK3399 ARM64 (6 cores)
4GB LPDDR3 RAM
1x 1000 Base-T
1 GPIO LED (status)
HDMI 2.0
3.5mm TRRS AV jack
Micro-SD slot
16GB eMMC
1x USB 3.0 Port
2x USB 2.0 Port
1x USB Type-C Port
1x M.2 PCI-E Port
AP6356S (BCM4356) SDIO WiFi & Bluetooth adapter
--------
Note: AP6356S is not supported yet due to the lack of firmware and NVRAM

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
16 months agouboot-rockchip: add FriendlyARM NanoPC T4 support
Lu jicong [Mon, 24 Jul 2023 07:22:42 +0000 (15:22 +0800)]
uboot-rockchip: add FriendlyARM NanoPC T4 support

Add support for the FriendlyARM NanoPC T4.
Reduce memory frequency to avoid random crash.

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
16 months agomt76: update to the latest version
Felix Fietkau [Wed, 26 Jul 2023 09:20:58 +0000 (11:20 +0200)]
mt76: update to the latest version

53edfc7aaa34 wifi: mt76: mt7603: fix beacon interval after disabling a single vif
7ef4dd12d982 wifi: mt76: mt7603: fix tx filter/flush function
152608a40aa7 wifi: mt76: mt7615: do not advertise 5 GHz on first phy of MT7615D (DBDC)
cacac3902a63 wifi: mt76: split get_of_eeprom in subfunction
cd3dfe392769 wifi: mt76: add support for providing eeprom in nvmem cells

Signed-off-by: Felix Fietkau <nbd@nbd.name>
16 months agoopenssl: opt-out of lto usage
Christophe Sokol [Sun, 16 Jul 2023 08:01:17 +0000 (08:01 +0000)]
openssl: opt-out of lto usage

This fixes building with USE_LTO enabled:

aarch64-openwrt-linux-musl-gcc -fPIC -pthread -Wa,--noexecstack -Wall -O3 -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/build_dir/target-aarch64_cortex-a53_musl/openssl-3.0.9=openssl-3.0.9 -ffunction-sections -fdata-sections -flto=auto -fno-fat-lto-objects -Wformat -Werror=format-security -DPIC -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DPIC -fPIC -Os -pipe -mcpu=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/build_dir/target-aarch64_cortex-a53_musl/openssl-3.0.9=openssl-3.0.9 -ffunction-sections -fdata-sections -flto=auto -fno-fat-lto-objects -Wformat -Werror=format-security -fPIC -fstack-protector-strong -fPIC -fuse-ld=bfd -flto=auto -fuse-linker-plugin -fPIC -specs=/include/hardened-ld-pie.specs -znow -zrelro -L. -Wl,-z,defs -Wl,-znodelete -shared -Wl,-Bsymbolic  -Wl,-z,now -Wl,-z,relro -L/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.1.0_musl/usr/lib -L/staging_dir/toolchain-aarch64_cortex-a53_gcc-13.1.0_musl/lib -Wl,--gc-sections \
-o providers/legacy.so -Wl,--version-script=providers/legacy.ld \
providers/legacy-dso-legacyprov.o \
providers/liblegacy.a providers/libcommon.a -lcrypto -ldl -pthread
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o: in function `legacy_get_params':
<artificial>:(.text.legacy_get_params+0xd4): undefined reference to `ossl_prov_is_running'
ld.bfd: <artificial>:(.text.legacy_get_params+0xd8): undefined reference to `ossl_prov_is_running'
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o: in function `legacy_teardown':
<artificial>:(.text.legacy_teardown+0x4): undefined reference to `ossl_prov_ctx_get0_libctx'
ld.bfd: <artificial>:(.text.legacy_teardown+0x8): undefined reference to `ossl_prov_ctx_get0_libctx'
ld.bfd: <artificial>:(.text.legacy_teardown+0x34): undefined reference to `ossl_prov_ctx_free'
ld.bfd: <artificial>:(.text.legacy_teardown+0x38): undefined reference to `ossl_prov_ctx_free'
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o: in function `OSSL_provider_init':
<artificial>:(.text.OSSL_provider_init+0x14): undefined reference to `ossl_prov_ctx_new'
ld.bfd: <artificial>:(.text.OSSL_provider_init+0x18): undefined reference to `ossl_prov_ctx_new'
ld.bfd: <artificial>:(.text.OSSL_provider_init+0x84): undefined reference to `ossl_prov_ctx_set0_libctx'
ld.bfd: <artificial>:(.text.OSSL_provider_init+0x88): undefined reference to `ossl_prov_ctx_set0_libctx'
ld.bfd: <artificial>:(.text.OSSL_provider_init+0x98): undefined reference to `ossl_prov_ctx_set0_handle'
ld.bfd: <artificial>:(.text.OSSL_provider_init+0x9c): undefined reference to `ossl_prov_ctx_set0_handle'
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o:(.data.rel.ro.legacy_kdfs+0x10): undefined reference to `ossl_kdf_pbkdf1_functions'
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o:(.data.rel.ro.legacy_ciphers+0x10): undefined reference to `ossl_cast5128ecb_functions'
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o:(.data.rel.ro.legacy_ciphers+0x30): undefined reference to `ossl_cast5128cbc_functions'
[...]
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o:(.data.rel.ro.legacy_digests+0x10): undefined reference to `ossl_md4_functions'
ld.bfd: /tmp/ccdWw6Lo.ltrans0.ltrans.o:(.data.rel.ro.legacy_digests+0x30): undefined reference to `ossl_ripemd160_functions'
collect2: error: ld returned 1 exit status

Signed-off-by: Christophe Sokol <christophe@wk3.org>
16 months agoipq40xx: add support for Teltonika RUTX50
David Bauer [Sat, 6 May 2023 14:57:18 +0000 (16:57 +0200)]
ipq40xx: add support for Teltonika RUTX50

Hardware
--------
CPU:     Qualcomm IPQ4018
RAM:     256M
Flash:   16MB SPI-NOR (W25Q128)
         128MB SPI-NAND (XTX)
WiFi:    2T2R (2GHz 802.11n ; 5 GHz 802.11ac)
ETH:     4x LAN ; 1x WAN (Gigabit)
CELL:    Quectel RG501Q 3G/4G/5G

UART: Available on the goldfinger connector (Pinout silkscreened)
      115200 8N1 3V3 - Only connect RX / TX / GND

Installation
------------

1. Enable SSH in the Teltonika UI
   (System --> Administration --> Access Control)

2. Check from which partition set the device is currently running from.

   $ cat /proc/boot_info/rootfs/primaryboot

   In case this output reads 0, install a Software update from Teltonika
   first. After upgrade completion, check this file now reads 1 before
   continuing.

2. Transfer the OpenWrt factory image to the device using scp. Use the
   same password (user root!) as used for the Web-UI.

   $ scp -O openwrt-factory.bin root@192.168.1.1:/tmp

3. Connect to the device using ssh as the root user.

4. Install OpenWrt by writing the factory image to flash.

   $ ubiformat /dev/mtd16 -y -f /tmp/openwrt-factory.bin

5. Instruct the bootloaer to boot from the first partition set.

   $ echo 0 > /proc/boot_info/rootfs/primaryboot
   $ cat /proc/boot_info/getbinary_bootconfig > /tmp/bootconfig.bin
   $ cat /proc/boot_info/getbinary_bootconfig1 > /tmp/bootconfig1.bin
   $ mtd write /tmp/bootconfig.bin /dev/mtd2
   $ mtd write /tmp/bootconfig1.bin /dev/mtd3

6. Reboot the device.

   $ reboot

Signed-off-by: David Bauer <mail@david-bauer.net>
16 months agoipq40xx: move Teltonika RUT STM32 IO to specific DTS
David Bauer [Sat, 6 May 2023 14:51:18 +0000 (16:51 +0200)]
ipq40xx: move Teltonika RUT STM32 IO to specific DTS

Prepare to re-use the DTS for the RUTX50.

Signed-off-by: David Bauer <mail@david-bauer.net>
16 months agourngd: update to the latest master
Rafał Miłecki [Tue, 25 Jul 2023 07:51:35 +0000 (09:51 +0200)]
urngd: update to the latest master

7aefb47 jitterentropy-rngd: update to the v1.2.0

What's interesting about jitterentropy-rngd v1.2.0 release is that it
bumps its copy of jitterentropy-library from v2.2.0 to the v3.0.0. That
bump includes a relevant commit 3130cd9 ("replace LSFR with SHA-3 256").

When initializing entropy jent calculates time delta. Time values are
obtained using clock_gettime() + CLOCK_REALTIME. There is no guarantee
from CLOCK_REALTIME of unique values and slow devices often return
duplicated ones.

A switch from jent_lfsr_time() to jent_hash_time() resulted in many less
cases of zero delta and avoids ECOARSETIME.

Long story short: on some system this fixes:
[    6.722725] urngd: jent-rng init failed, err: 2

This is important change for BCM53573 which doesn't include hwrng and
seems to have arch_timer running at 36,8 Hz.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agokernel: bump 6.1 to 6.1.40
John Audia [Sun, 23 Jul 2023 15:00:55 +0000 (11:00 -0400)]
kernel: bump 6.1 to 6.1.40

Removed upstreamed:
generic/backport-6.1/701-v6.5-net-bgmac-postpone-turning-IRQs-off-to-avoid-SoC-han.patch[1]
generic/pending-6.1/160-workqueue-fix-enum-type-for-gcc-13.patch[2]
qualcommax/patches-6.1/0022-v6.5-soc-qcom-mdt_loader-Fix-unconditional-call-to-scm_pa.patch[3]

Manually rebased:
bcm27xx/patches-6.1/950-0359-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
bcm27xx/patches-6.1/950-0362-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch
bcm27xx/patches-6.1/950-0390-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch
bcm27xx/patches-6.1/950-0469-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.40&id=685b57a1221c38ec8b456f968264d2496715820c
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.40&id=2d57a1590f4d8c516f5aaf8fd5bb4f52d67275d8
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.40&id=33f8dff6e1cbba5c2ec85fa5649c0a759a7e685c

Build system: x86/64, filogic/xiaomi_redmi-router-ax6000-ubootmod
Build-tested: x86/64, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
16 months agokernel: bump 6.1 to 6.1.39
John Audia [Thu, 20 Jul 2023 09:51:10 +0000 (05:51 -0400)]
kernel: bump 6.1 to 6.1.39

Removed upstreamed:
generic/backport-6.1/803-v6.5-01-leds-trigger-netdev-Recheck-NETDEV_LED_MODE_LINKUP-o.patch[1]
generic/pending-6.1/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch[2]
bcm27xx/patches-6.1/950-0034-drm-bridge-Introduce-pre_enable_upstream_first-to-al.patch[3]
bcm27xx/patches-6.1/950-0439-nvmem-Use-NVMEM_DEVID_AUTO.patch[4]
bcm4908/patches-6.1/040-mtd-parsers-refer-to-ARCH_BCMBCA-instead-of-ARCH_BCM.patch[5]
bcm53xx/patches-6.1/031-v6.5-0003-ARM-dts-BCM5301X-Drop-clock-names-from-the-SPI-node.patch[6]
bcm53xx/patches-6.1/031-v6.5-0015-ARM-dts-BCM5301X-fix-duplex-full-full-duplex.patch[7]
mediatek/patches-6.1/351-cpufreq-mediatek-correct-voltages-for-MT7622-and-MT7.patch[8]
qualcommax/patches-6.1/0008-v6.2-clk-qcom-reset-support-resetting-multiple-bits.patch[9]

Manually rebased:
bcm27xx/patches-6.1/950-0035-drm-panel-Add-prepare_upstream_first-flag-to-drm_pan.patch
bcm27xx/patches-6.1/950-0404-drm-panel-panel-ilitek9881c-Add-prepare_upstream_fir.patch
bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch
mediatek/patches-6.1/350-21-cpufreq-mediatek-Add-support-for-MT7988.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=ab0bd172d6289310a05a0cd15e1432e828d386ae
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=6df680709d901346831ef8f221cc90a42062c526
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=5044e5f2511c9afdf9880d2bb6b9d37dfc345dac
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=e27948f329f7e02591ed1feb9a7710c2ccf89a83
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=ad2928e7f3f6120a0bd18aa1056b3b24068027c5
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=2b55a985727833f37c39911f34096b3fdf2a367d
7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=90d4c487cd658b51212eb65ae804ab11af193672
8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=7e3ee25e8c7c7be1eacdfc6d9f5f0e550a2af241
9. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=b20854ef6c4955be3310975a72f02d92cb01d6d4

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

Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>
Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
[ rebase bcm27xx and mediatek patches, refresh commit description ]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
[ minor fixup to bcm27xx patches, refresh commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agokernel: drop mips highmem offset start overrides
Felix Fietkau [Mon, 24 Jul 2023 12:43:03 +0000 (14:43 +0200)]
kernel: drop mips highmem offset start overrides

The maximum offset that can be supported is 0x20000000
Do not override it to to something bigger than that on MT7621, as that could
cause issues based on the fixed memory mappings. This makes the last 64 MB
RAM unusable on MT7621 devices with 512 MB but avoids incurring a heavy
performance hit

Fixes: cd2b74e01e8d ("ramips: mt7621: disable highmem support and remove highmem offset patch")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
16 months agoramips: mt7621: disable highmem support and remove highmem offset patch
Felix Fietkau [Mon, 24 Jul 2023 11:17:44 +0000 (13:17 +0200)]
ramips: mt7621: disable highmem support and remove highmem offset patch

On MT7621 it was observed, that enabling highmem support causes a significant
performance drop, as documented in: https://github.com/openwrt/openwrt/issues/13151
By adjusting the highmem start offset, we avoid leaving any RAM unaddressable,
even on devices with 512 MB

Fixes: https://github.com/openwrt/openwrt/issues/13151
Signed-off-by: Felix Fietkau <nbd@nbd.name>
16 months agobcm53xx: add BCM53573 Ethernet fix sent upstream for v6.6
Rafał Miłecki [Sun, 23 Jul 2023 20:41:18 +0000 (22:41 +0200)]
bcm53xx: add BCM53573 Ethernet fix sent upstream for v6.6

It seems that DSA-based b53 driver never worked with BCM53573 SoCs and
BCM53125.

In case of swconfig-based b53 this fixes a regression. Switching bgmac
from using mdiobus_register() to of_mdiobus_register() resulted in MDIO
device (BCM53125) having of_node set (see of_mdiobus_register_phy()).
That made downstream b53 driver read invalid data from DT and broke
Ethernet support.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agortl8812au-ct: fix compilation error with kernel 6.1
Christian Marangi [Sun, 23 Jul 2023 12:41:35 +0000 (14:41 +0200)]
rtl8812au-ct: fix compilation error with kernel 6.1

Kernel 6.1 have renamed complete_and_exit to kthread_complete_and_exit.
This was just a rename and nothing is changed implementation wise.

Fix compilation error by using the new symbol name.

Fix compilation error:
In file included from /builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/include/osdep_service.h:41,
                 from /builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/include/drv_types.h:32,
                 from /builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c:22:
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c: In function 'rtw_cmd_thread':
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/include/osdep_service_linux.h:166:23: error: implicit declaration of function 'complete_and_exit' [-Werror=implicit-function-declaration]
  166 | #define thread_exit() complete_and_exit(NULL, 0)
      |                       ^~~~~~~~~~~~~~~~~
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c:706:9: note: in expansion of macro 'thread_exit'
  706 |         thread_exit();
      |         ^~~~~~~~~~~
/builder/shared-workdir/build/sdk/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_bcm2710/rtl8812au-ct-2021-11-07-39df5596/core/rtw_cmd.c:708:1: error: control reaches end of non-void function [-Werror=return-type]
  708 | }
      | ^
cc1: all warnings being treated as errors

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agobcm27xx: update dwc_otc driver with new kthread_complete_and_exit name
Christian Marangi [Sun, 23 Jul 2023 12:26:13 +0000 (14:26 +0200)]
bcm27xx: update dwc_otc driver with new kthread_complete_and_exit name

Kernel 6.1 renamed and moved complete_and_exit to
kthread_complete_and_exit.

This was just a rename and nothing is changed implementation wise.
Update to the new symbol name to fix compilation error.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agomac80211: limit MT7620 TX power based on eeprom calibration
Shiji Yang [Sun, 23 Jul 2023 02:14:54 +0000 (10:14 +0800)]
mac80211: limit MT7620 TX power based on eeprom calibration

This patch adds basic TX power control for the MT7620 and limits its
maximum TX power. This can avoid the link speed decrease caused by
chip overheating.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
16 months agomediatek: add missing SPDX header
David Bauer [Sat, 22 Jul 2023 15:40:56 +0000 (17:40 +0200)]
mediatek: add missing SPDX header

Signed-off-by: David Bauer <mail@david-bauer.net>
16 months agomediatek: filogic: set DEVICE_DTS_LOADADDR for BPi-R3
Daniel Golle [Sat, 22 Jul 2023 11:30:43 +0000 (12:30 +0100)]
mediatek: filogic: set DEVICE_DTS_LOADADDR for BPi-R3

U-Boot complains that the overlayed DT needs relocation, so set
DEVICE_DTS_LOADADDR to have it relocated.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
16 months agomediatek: add support for ZyXEL NWA50AX Pro
David Bauer [Sat, 15 Jul 2023 16:10:31 +0000 (18:10 +0200)]
mediatek: add support for ZyXEL NWA50AX Pro

Hardware
--------
CPU:    Mediatek MT7981
RAM:    512M DDR4
FLASH:  256M NAND
ETH:    MaxLinear GPY211 (2.5GbE N Base-T)
WiFi:   Mediatek MT7981 (2.4GHz 2T2R:2 5GHz 3T3R:2 802.11ax)
BTN:    1x Reset
LED:    1x Multi-Color

UART Console
------------
Available below the rubber cover next to the ethernet port.

Settings: 115200 8N1

Layout:

<12V> <LAN> GND-RX-TX-VCC

Logic-Level is 3V3. Don't connect VCC to your UART adapter!

Installation Web-UI
-------------------
Upload the Factory image using the devices Web-Interface.

As the device uses a dual-image partition layout, OpenWrt can only
installed on Slot A. This requires the current active image prior
flashing the device to be on Slot B.

In case this is not the case, OpenWrt will boot only one time, returning
to the ZyXEL firmware the second boot.

If this happens, first install a ZyXEL firmware upgrade of any version
and install OpenWrt after that.

Installation TFTP / Recovery
----------------------------
This installation routine is especially useful in case of a bricked
device.

Attach to the UART console header of the device. Interrupt the boot
procedure by pressing Enter.

The bootloader has a reduced command-set available from CLI, but more
commands can be executed by abusing the atns command.

Boot a OpenWrt initramfs image available on a TFTP server at
192.168.1.66. Rename the image to nwa50axpro-openwrt-initramfs.bin.

 $ atnf nwa50axpro-openwrt-initramfs.bin
 $ atna 192.168.1.88
 $ atns "192.168.1.66; tftpboot; setenv fdt_high 0xffffffffffffffff;
   bootm"

Upon booting, set the booted image to the correct slot:

 $ zyxel-bootconfig /dev/mtd9 get-status
 $ zyxel-bootconfig /dev/mtd9 set-image-status 0 valid
 $ zyxel-bootconfig /dev/mtd9 set-active-image 0

Copy the OpenWrt sysupgrade image to the device using scp.
Write the sysupgrade image to NAND using sysupgrade.

 $ sysupgrade -n image.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
16 months agoipq806x: reorganize 02_network board.d script
Christian Marangi [Sun, 16 Jul 2023 01:02:15 +0000 (03:02 +0200)]
ipq806x: reorganize 02_network board.d script

Reorganize 02_network board.d script by splitting setup switch and setup
mac address.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agoipq806x: rename kernel files to generic name
Christian Marangi [Tue, 20 Jun 2023 00:00:23 +0000 (02:00 +0200)]
ipq806x: rename kernel files to generic name

Drop 6.1 tag from files directory for ipq806x now that we moved to 6.1
by default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agoipq806x: 5.15: drop useless kernel patches and dts files
Christian Marangi [Mon, 19 Jun 2023 23:58:37 +0000 (01:58 +0200)]
ipq806x: 5.15: drop useless kernel patches and dts files

Drop useless 5.15 kernel patches and files now that we moved to kernel
6.1 by default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agoipq806x: move to kernel 6.1 by default
Christian Marangi [Mon, 19 Jun 2023 23:57:34 +0000 (01:57 +0200)]
ipq806x: move to kernel 6.1 by default

Move to kernel 6.1 by default in preparation for DSA introduction.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agoipq806x: 6.1: backport patch fixing broken hwspinlock
Christian Marangi [Fri, 21 Jul 2023 10:58:30 +0000 (12:58 +0200)]
ipq806x: 6.1: backport patch fixing broken hwspinlock

Backport merged patch fixing broken hwspinlock due to missing regmap
config for SFPB MMIO implementation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agoocteon: use fixed layout cell "mac-base" for Cisco vEdge 1000
Rafał Miłecki [Mon, 17 Jul 2023 06:59:38 +0000 (08:59 +0200)]
octeon: use fixed layout cell "mac-base" for Cisco vEdge 1000

This drops a use of downstream "mac-address-increment".

Cc: Christian Svensson <blue@cmd.nu>
Cc: Tommy Nevtelen <tommy@nevtelen.com>
Cc: Viktor Ekmark <viktor@ekmark.se>
Cc: Daniel Wennberg <github@networkninja.se>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Tested-by: Christian Svensson <blue@cmd.nu>
16 months agoramips: replace "mac-address-ascii" with "mac-base"
Rafał Miłecki [Fri, 14 Jul 2023 13:11:14 +0000 (15:11 +0200)]
ramips: replace "mac-address-ascii" with "mac-base"

With upstream accepted "mac-base" binding there is no need for a
downstream "mac-address-ascii" workaround anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
[TP-Link EC330-G5u v1 - OK]
Tested-by: Mikhail Zhilkin <csharper2005@gmail.com>
16 months agostrace: update to 6.4
Nick Hainke [Wed, 19 Jul 2023 13:32:26 +0000 (15:32 +0200)]
strace: update to 6.4

Release Notes:
https://github.com/strace/strace/releases/tag/v6.4

Signed-off-by: Nick Hainke <vincent@systemli.org>
16 months agoiproute2: update 6.4
Nick Hainke [Wed, 19 Jul 2023 07:22:48 +0000 (09:22 +0200)]
iproute2: update 6.4

Release Notes:
https://lore.kernel.org/lkml/20230626093137.2f302acc@hermes.local/t/

Signed-off-by: Nick Hainke <vincent@systemli.org>
16 months agoethtool: update to 6.4
Nick Hainke [Wed, 19 Jul 2023 07:08:06 +0000 (09:08 +0200)]
ethtool: update to 6.4

ChangeLog:
125b080 Release version 6.4.
5660918 update UAPI header copies
f493e63 netlink: fix duplex setting
b3e341c cmis: report LOL / LOS / Tx Fault
045d8db sff-8636: report LOL / LOS / Tx Fault
a6505f3 drop checks for macros provided in UAPI header copies
86c0c41 do not check for strtol() function
dd8e3ae actually check for C11 compiler
43e4d30 add local copies of macros from autoconf-archive
faa4700 drop check for big endian types
31b7b5e Require a compiler with support for C11 features
946d18b update UAPI header copies
eebf01f ethtool: Add support for configuring tx-push-buf-len
2782ea8 update UAPI header copies

Signed-off-by: Nick Hainke <vincent@systemli.org>
16 months agonettle: update to 3.9.1
Nick Hainke [Wed, 19 Jul 2023 06:33:32 +0000 (08:33 +0200)]
nettle: update to 3.9.1

Announcement:
https://lists.gnu.org/archive/html/info-gnu/2023-06/msg00000.html

Signed-off-by: Nick Hainke <vincent@systemli.org>
16 months agoath79: move ubnt-xm 64M RAM boards back to generic
Felix Baumann [Mon, 3 Jul 2023 23:35:43 +0000 (01:35 +0200)]
ath79: move ubnt-xm 64M RAM boards back to generic

return ubnt_rocket-m and ubnt_powerbridge-m back to ath79-generic
They have enough RAM-ressources to not be considered as tiny.

This reverts the commit f4415f7635164ec07ddc22f56df93555804b5767 partially

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
16 months agolibbpf: Update to v1.2.2
Tony Ambardar [Mon, 17 Jul 2023 01:22:59 +0000 (18:22 -0700)]
libbpf: Update to v1.2.2

Update to the latest upstream release to include recent bugfixes:

Link: https://github.com/libbpf/libbpf/compare/v1.2.0...v1.2.2
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
16 months agonftables: update to 1.0.8
Nick Hainke [Fri, 14 Jul 2023 13:26:06 +0000 (15:26 +0200)]
nftables: update to 1.0.8

ChangeLog:
https://www.netfilter.org/projects/nftables/files/changes-nftables-1.0.8.txt

Signed-off-by: Nick Hainke <vincent@systemli.org>
16 months agolibnftnl: update to 1.2.6
Nick Hainke [Wed, 12 Jul 2023 21:38:51 +0000 (23:38 +0200)]
libnftnl: update to 1.2.6

Release Notes:
https://lists.netfilter.org/pipermail/netfilter-announce/2023/000250.html

Signed-off-by: Nick Hainke <vincent@systemli.org>
16 months agoramips: fix Ubiquiti EdgeRouter X's MAC address for gmac1
Rafał Miłecki [Tue, 18 Jul 2023 09:26:37 +0000 (11:26 +0200)]
ramips: fix Ubiquiti EdgeRouter X's MAC address for gmac1

This fixes:
[    0.586649] OF: /ethernet@1e100000/mac@1: #nvmem-cell-cells = 1 found 0

Fixes: 28b6224104cc ("ramips: use fixed layout cell "mac-base" for Ubiquiti EdgeRouter X")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
16 months agobase-files: fix duplicate wifi radio sections when using phy renaming
Felix Fietkau [Mon, 17 Jul 2023 12:32:21 +0000 (14:32 +0200)]
base-files: fix duplicate wifi radio sections when using phy renaming

The duplicate sections are caused by a race condition at boot, when board.json
is not available. In that case, the final phy name cannot be resolved, and extra
sections referring to the path are created.
Fix this by making sure that wifi config is not being run before board.json
is created.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
16 months agoath11k-firmware: update to stable WLAN.HK.2.9.0.1-01837
Michał Kwiatek [Wed, 12 Jul 2023 19:39:39 +0000 (21:39 +0200)]
ath11k-firmware: update to stable WLAN.HK.2.9.0.1-01837

Changelog from quic:

 Bug fixes, stability improvements from previous releases
  are present. There are no backward comatibility issues
  with this release.

Tested-by: Michał Kwiatek <michal@kwiatek.it> # Xiaomi AX3600
Signed-off-by: Michał Kwiatek <michal@kwiatek.it>
[ improve commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
16 months agosdk: update SDK Makefile
Christian Lamparter [Sat, 15 Jul 2023 18:58:10 +0000 (20:58 +0200)]
sdk: update SDK Makefile

the SDK's Makefile referenced the old file name.
Update it too.

Fixes: 2d5f7035cf45 ("sdk: rename README")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
16 months agorealtek: add support for HPE 1920-8g-poe+
Pawel Dembicki [Fri, 7 Jul 2023 11:51:49 +0000 (13:51 +0200)]
realtek: add support for HPE 1920-8g-poe+

Hardware information:
---------------------

- RTL8380 SoC
- 8 Gigabit RJ45 PoE ports (built-in RTL8218B)
- 2 SFP ports (built-in SerDes)
- RJ45 RS232 port on front panel
- 32 MiB NOR Flash
- 128 MiB DDR3 DRAM
- PT7A7514 watchdog
- PoE chips: Nuvoton M0516LDE + BCM59121

Known issues:
---------------------
- PoE LEDs are uncontrolled.

(Manual taken from f2f09bc00280)
Booting initramfs image:
------------------------

- Prepare a FTP or TFTP server serving the OpenWrt initramfs image and
  connect the server to a switch port.

- Connect to the console port of the device and enter the extended
  boot menu by typing Ctrl+B when prompted.

- Choose the menu option "<3> Enter Ethernet SubMenu".

- Set network parameters via the option "<5> Modify Ethernet Parameter".
  Enter the FTP/TFTP filename as "Load File Name" ("Target File Name"
  can be left blank, it is not required for booting from RAM). Note that
  the configuration is saved on flash, so it only needs to be done once.

- Select "<1> Download Application Program To SDRAM And Run".

Initial installation:
---------------------

- Boot an initramfs image as described above, then use sysupgrade to
  install OpenWrt permanently. After initial installation, the
  bootloader needs to be configured to load the correct image file

- Enter the extended boot menu again and choose "<4> File Control",
  then select "<2> Set Application File type".

- Enter the number of the file "openwrt-kernel.bin" (should be 1), and
  use the option "<1> +Main" to select it as boot image.

- Choose "<0> Exit To Main Menu" and then "<1> Boot System".

NOTE: The bootloader on these devices can only boot from the VFS
filesystem which normally spans most of the flash. With OpenWrt, only
the first part of the firmware partition contains a valid filesystem,
the rest is used for rootfs. As the bootloader does not know about this,
you must not do any file operations in the bootloader, as this may
corrupt the OpenWrt installation (selecting the boot image is an
exception, as it only stores a flag in the bootloader data, but doesn't
write to the filesystem).

Example PoE config file (/etc/config/poe):
---------------------
config global
        option budget   '180'

config port
        option enable   '1'
        option id       '1'
        option name     'lan8'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '2'
        option name     'lan7'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '3'
        option name     'lan6'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '4'
        option name     'lan5'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '5'
        option name     'lan4'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '6'
        option name     'lan3'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '7'
        option name     'lan2'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '8'
        option name     'lan1'
        option poe_plus '1'
        option priority '2'

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
16 months agoocteon: ubnt-edgerouter-4/6p: devicetree cleanup
Carsten Spieß [Wed, 12 Jul 2023 08:24:11 +0000 (10:24 +0200)]
octeon: ubnt-edgerouter-4/6p: devicetree cleanup

removed redundant eeprom partition nodes from
cn7130_ubnt_edgerouter-4.dts and cn7130_ubnt_edgerouter-6p.dts
as they are identically defined in cn7130_ubnt_edgerouter-e300.dtsi.

Signed-off-by: Carsten Spieß <mail@carsten-spiess.de>
(integrated eeprom referenced node in the .dtsi)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
16 months agoocteon: ubnt-edgerouter-e300: fix missing MTD partition
Carsten Spieß [Wed, 12 Jul 2023 08:16:27 +0000 (10:16 +0200)]
octeon: ubnt-edgerouter-e300: fix missing MTD partition

The MAC addresses should be read from 3rd MTD partition,
but only two MTD partitions are populated.

To fix it, a partitions node has to surround the partition
nodes in device tree.

Tested with Edgerouter 6P

Signed-off-by: Carsten Spieß <mail@carsten-spiess.de>
(fixed checkpatch complains)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
16 months agoocteon: ubnt-edgerouter-e300: fix LED settings
Carsten Spieß [Wed, 12 Jul 2023 08:41:25 +0000 (10:41 +0200)]
octeon: ubnt-edgerouter-e300: fix LED settings

LEDs on Edgerouter 6P didn't work correctly:
blue /white LED swapped, on/off state inverted

Fixed in device tree:
swap the GPIO ports for power:blue and power:white LEDs
change LED activity from LOW to HIGH

Tested on Edgerouter 6P

Signed-off-by: Carsten Spieß <mail@carsten-spiess.de>
16 months agoocteon: n821: add Cisco vEdge 1000 base
Christian Svensson [Sun, 2 Jul 2023 22:31:59 +0000 (00:31 +0200)]
octeon: n821: add Cisco vEdge 1000 base

This is the first commit to introduce the base for the N821 board used
in Cisco vEdge 1000.

This commit does not include the custom CPLD drivers but rather
everything else that is already present in the upstream kernel.

This results in an image that boots, but e.g. the SFP ports are not
usable.

Hardware:

  - CPU: Cavium Networks CN6130, 4 cores @ 1.0 GHz
  - Flash:
    - 16 MiB SPI NOR presented as 2x8 MiB for A/B boot recovery
    - 8192 MiB eMMC
  - RAM: 4096 MiB
  - Ethernet 1Gbit ports: 1x
  - Ethernet SFP ports: 8x
  - USB ports: 2x 3.0 Type-A on front panel
  - Serial: Two, one internal and one external
  - JTAG: Yes
  - LED count: 18x
  - Button count: 1x
  - GPIOs: 1x
  - Power: 2x redundant DC 12V barrel plug
  - Extra: Slot for SD card on front

See the OpenWrt wiki for more hardware details.

Installation:

  - Flash squashfs to /dev/sda2 and put kernel on /dev/sda1.
  - Update uboot's bootcmd environment variable to match.

Full installation guide will be added to OpenWrt wiki when sysupgrade
support is added.

Signed-off-by: Christian Svensson <blue@cmd.nu>
Signed-off-by: Tommy Nevtelen <tommy@nevtelen.com>
Tested-by: Viktor Ekmark <viktor@ekmark.se>
Tested-by: Daniel Wennberg <github@networkninja.se>
16 months agoocteon: enable AT24 unconditionally
Christian Svensson [Tue, 4 Jul 2023 22:48:46 +0000 (00:48 +0200)]
octeon: enable AT24 unconditionally

For the N821 platform we need to load the AT24 EEPROM driver before
everything else in order for the MAC address to be available at
driver initialization time.

Signed-off-by: Christian Svensson <blue@cmd.nu>
16 months agobuild: fix generation of large .vdi images
Adones Pitogo [Tue, 11 Jul 2023 05:31:50 +0000 (13:31 +0800)]
build: fix generation of large .vdi images

Instead of loading the whole image into the memory when generating the
sha256 sum, we load the file in chunks and update the hash incrementally
to avoid MemoryError in python. Also remove a stray empty line.

Fixes: #13056
Signed-off-by: Adones Pitogo <pitogo.adones@gmail.com>
(mention empty line removal, adds Fixes from PR)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
16 months agosdk: rename README
Tomasz Maciej Nowak [Tue, 11 Jul 2023 14:09:49 +0000 (16:09 +0200)]
sdk: rename README

'help' target fails not finding a file, so follow up on a change[2] made
as a fix for main README[1].

1. d0113711a31f ("README: port to 21st century")
2. 751486b31fd9 ("build: fix README.md reference after rename")

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
16 months agoib: split out processing user provided packages
Tomasz Maciej Nowak [Tue, 11 Jul 2023 14:06:21 +0000 (16:06 +0200)]
ib: split out processing user provided packages

Some device recipes remove default target packages. If user tries to add
them back they will be ignored, since packages list is processed in one
go. Process the device recipe packages first and do user ones later, so
additions won't get filtered out.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
16 months agoperf: opt-out of lto usage
Javier Marcet [Sun, 9 Jul 2023 15:55:48 +0000 (17:55 +0200)]
perf: opt-out of lto usage

This fixes building with USE_LTO enabled:

mold: error: undefined symbol: __memset
>>> referenced by <artificial>
>>>               ./tmp/ccsgR7G6.ltrans10.ltrans.o
mold: error: undefined symbol: memset_orig
>>> referenced by <artificial>
>>>               ./tmp/ccsgR7G6.ltrans10.ltrans.o
mold: error: undefined symbol: perf_regs_load
>>> referenced by <artificial>
>>>               ./tmp/ccsgR7G6.ltrans15.ltrans.o:(test_dwarf_unwind__thread)
mold: error: undefined symbol: memset_erms
>>> referenced by <artificial>
>>>               ./tmp/ccsgR7G6.ltrans10.ltrans.o
mold: error: undefined symbol: memcpy_orig
>>> referenced by <artificial>
>>>               ./tmp/ccsgR7G6.ltrans10.ltrans.o
mold: error: undefined symbol: memcpy_erms
>>> referenced by <artificial>
>>>               ./tmp/ccsgR7G6.ltrans10.ltrans.o
mold: error: undefined symbol: __memcpy
>>> referenced by <artificial>
>>>               ./tmp/ccsgR7G6.ltrans10.ltrans.o
collect2: error: ld returned 1 exit status
make[5]: *** [Makefile.perf:670: ../openwrt/linux/tools/perf-target-x86_64_musl/perf] Error 1
make[4]: *** [Makefile.perf:238: sub-make] Error 2
make[3]: *** [Makefile:70: all] Error 2
make[2]: *** [Makefile:84: ./build_dir/target-x86_64_musl/linux-x86_64/linux-5.15.120/tools/perf-target-x86_64_musl/.built] Error 2
make[2]: Leaving directory './package/devel/perf'
time: package/devel/perf/compile#55.88#6.78#12.89
    ERROR: package/devel/perf failed to build.

Signed-off-by: Javier Marcet <javier@marcet.info>