Storing the ever changing revision in the GCC binary may result in leakage in
package builds. If two equal GCC versions build the same package version with
different OpenWrt revisions, the package becomes unreproducible.
Solve this by dropping the revision.
Below is an example of the `cni` package:
│ ├── readelf --wide --decompress --string-dump=.comment {}
│ │ @@ -1,4 +1,4 @@
│ │
│ │ String dump of section '.comment':
│ │ - [ 0] GCC: (OpenWrt GCC 14.4.0 r35470-1b2aeb4f8a) 14.4.0
│ │ + [ 0] GCC: (OpenWrt GCC 14.4.0 r35485-0f256a0a7a) 14.4.0
Signed-off-by: Paul Spooren <mail@aparcar.org>
- Manually rebase 830-huawei_e970_support.patch
- Update .remove_new to .remove in 831-old_gpio_wdt.patch, see
commit e70140ba0d2b1a30467d4af6bcfe761327b9ec95
- make target/linux/refresh the rest
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
CONFIG_PAGE_BLOCK_MAX_ORDER was set to the default of 11
Refresh config with make kernel_oldconfig
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This is an automatically generated commit.
When doing `git bisect`, consider `git bisect --skip`.
Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24358
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Account the offset_start in the bounds check of the for loop. This was
previously missing, differing in check and actual read.
Signed-off-by: David Bauer <mail@david-bauer.net>
Attempting to parse the mtdsplit-fit device can lead in a out of bounds
read error, as the driver did not validate a fit was found at all.
This can happen if the fit size in the header at the last scan iteration
is non-zero. In this case, the dmesg reads:
[ 6.563676] Creating 6 MTD partitions on "ec000000.nor":
[ 6.569058] 0x000000000000-0x000003d60000 : "firmware"
[ 6.579192] read error in "firmware" at offset 0x3d60000
[ 6.584534] Failed to parse subpartitions: -22
[ 6.589010] Deleting MTD partitions on "ec000000.nor":
Validate after the scan loop if a fit image was found and abort in this
stage if it is not found.
Signed-off-by: David Bauer <mail@david-bauer.net>
Some contributors still submit patches via the mailing list or are
not using GitHub entirely, so an unlinked commit author email
should not be treated as a hard failure.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24320
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The CPU thermal zone in an7583.dtsi sets the polling-delay-passive to
10000 ms while the polling-delay is 5000 ms. The thermal driver rejects
zones whose passive polling delay is greater than the regular polling
delay, causing thermal_zone0 registration to fail with -EINVAL.
Reduce the passive polling delay to 1000 ms to fix thermal_zone0
registration.
Boot log:
thermal_sys: Failed to register thermal zone cpu-thermal: -22
... register thermal zone sensor failed
... probe with driver airoha-thermal failed with error -22
Signed-off-by: Yubo Zhang <zyb_1998@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/24337
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The ChinaMobile GS3101 has:
256MB RAM
256MB flash (TC58CVG1S3H)
1x MT7603 802.11 b/g/n - DISABLED
1x optical port
On-die MT7530 switch with:
- 1x gigabit ethernet port
- 3x 100Mb ethernet ports
1x USB 2.0 port
1x telephone VoIP port
3 controllable LEDs
1 GPIO button (reset), 1 WPS button (not detected in GPIOs)
UART header inside (solder required) 115200 baud
12v power (5.5mm x 2.1mm barrel connector)
Installation instructions: You will need a USB stick
1. Reformat the USB stick as VFAT with MBR partition table. This is important,
if it is GPT then it will silently fail to load.
2. Download openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx and
store it in the USB stick.
3. Start the device with the vendor OS
4. Connect a cable and request an IP address - it will issue in 192.168.1.0/24
5. Use telnet to connect to the modem on 192.168.1.1
6. Login as root@2024 / system
7. Plugin the USB stick
8. cp /mnt/usb1_1/openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx /tmp/openwrt.trx
9. mtd -r -f write /tmp/openwrt.trx tclinux
10. You will lose your shell, look at the power light on the device, it should
begin blinking and then go back to solid. You should NOT see any red light.
11. re-request an IP address
12. ssh root@192.168.1.1
13. You should be on OpenWrt now
MAC address matches that of vendor OS but it is not the address on the label
of the device. It is in a compressed xml file in the 'romfile' partition.
WAN is this mac, LAN is mac+1 and 2.4Ghz WLAN is mac+2, there is no 5Ghz WLAN.
Wifi Note: Of the devices tested, there were numerous upon which starting the
wlan chip caused the CPU to hang. In the interest of avoiding bricked boards,
the wlan is disabled in the DT.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The EN7526F is a varient of the EN751221 with one USB port and one PCI
port only. Add a dtsi file for this chip varient.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The TRX header contains a checksum of the full kernel and rootfs length. Vendor
OS uses a raw squashfs on the NAND and relies on the BMT to resolve bad block
issues. OpenWrt typically uses UBI on NAND and places the root squashfs inside
of that. Since UBI changes over time, checksumming over it would cause a boot
failure later on. However, vendor TRX installers typically the entire file as
uploaded, without regard for the declared kernel and rootfs lengths.
Make --rootfs optional so that a UBI rootfs can be appended but excluded from
the checksum.
Secondly, this script previously prepended padding to the rootfs in order to
move the beginning of the rootfs 4MB away from the TRX header (the max kernel
size). That prepended padding was included in the rootfs length/checksum.
There is a bug https://econet-linux.pkt.wiki/en/bootloader#a-length-bug in some
versions of the bootloader which causes the bootloader to always use the length
of the first kernel, even if it is booting the second. The impact of this is if
the second slot kernel is larger than the first, it will fail to boot. Smaller
is okay because LZMA will stop when it is done.
Move padding from rootfs to kernel and include it in the length/checksum of the
kernel so that the kernel will always register as being 4MB-minus-TRX-header in
length. Therefore if A/B upgrading is used in the future, this bug will not
occur even if an upgrade with a larger kernel is installed into slot B.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
In prep for more fully supporting EN751221, add GPIO, LED, and
mtd-concat.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Read flow-control state of the fast ethernet as well as gig-e ports.
The fast ethernet ports only read a combined state for TX and RX
flow-control, the gigabit / CPU ports read a per-direction FC state.
Signed-off-by: David Bauer <mail@david-bauer.net>
Switch the GS1900-8HP A1 to the PSE driver that is being upstreamed.
Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Link: https://github.com/openwrt/openwrt/pull/24339
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Do not pull iptables core for kmod-sched-ctinfo, only nf-conntrack,
reflecting kernel config dependencies.
There is no use of this module in openwrt repos, but it is used by
@hudra0 qosmate
and some less popular qos scripts.
Signed-off-by: Andris PE <neandris@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24104
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Upstream prefers more generic fwnode/device handlers as opposed to OF
ones.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24176
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Some issues were noticed with watchdog driver while the work
on bringing regmap API was being done.
The patches have been long accepted and are already in v7.2
of linux kernel.
As a prerequisite to the regmap patch, backport them to OpenWrt.
Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/24169
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The path field of a board.json wlan entry may now be an array of
device paths. ucidef_add_wlan accepts several leading path arguments
and stores them as a JSON array; a single path is still stored as a
plain string for backwards compatibility. A phy is matched if it
corresponds to any of the listed paths, so a radio that enumerates on
a non-deterministic PCI path still resolves to the correct named phy.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Since the jumbo frame preparation the driver can work on fragments
and not only on complete packets in the receive path. This might be
implementet in the transmit patch in the future too. So a chunk of
data is best described as a fragment. Rename all occurrences.
Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The TX path stores the skb information in the coherent part. This
is only needed by the driver. Move it to its proper location.
Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The paged pool handling is only required for the driver and not
for the SOC. Move it into the driver-specific part.
Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
It is easier to work with ring/slot when shifting around variables
in the different structures. Replace packet pointers in existing
function signatures.
Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Remove driver-only data from the coherent transmit structure.
It is not needed to keep this in uncached memory as the SOC
does not need access to it.
Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
In the past the ring handling was split into a coherent (SOC/driver shared)
and a driver-only part. Give the coherent structure a meaningful name.
Link: https://github.com/openwrt/openwrt/pull/24346
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Wire the HS104 controller (0x0d) on the PSE i2c-gpio bus and attach the
four PoE PHYs (lan1-4) via PHY_C45_PSE; lan5 is not PoE. Add the STC8 LED
MCU (0x4d) with per-port PoE LED triggers, and pull the HS104 PSE and STC8
kmods into the image.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Wire the two HS104 controllers (0x0d/0x15) on the i2c_sys bus and attach
the 8 PoE PHYs via PHY_C45_PSE. Add the STC8 LED MCU (0x4d) with per-port
PoE LED triggers, enable LEDS_SYSCON, and pull the PSE and STC8 kmods into
the image.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Wire the two HS104 controllers on the i2c-gpio bus and attach the 8 PoE
PHYs via a new PHY_C45_PSE macro. Add the STC8 syscon with its per-port
PoE LED triggers, enable LEDS_SYSCON, and pull the PSE and STC8 kmods
into the image.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Direct-I2C driver for the HS104 PSE chip (unlike the MCU-fronted
realtek-pse-mcu family). Packaged as kmod-pse-hasivo-hs104.
This driver will be submitted upstream once the pending PSE-core
patches it builds on (above) have landed.
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Backport the pending v6 poll-based event detection (devm_pse_poll_helper)
and per-PI LED triggers via the notification path, plus the
poll-interval-ms binding. Unblocks the hs104 poll path and PoE LED
triggers.
Pending upstream as [PATCH net-next v5 0/2] (reviewed; v6 pending,
merge expected soon).
Link: https://lore.kernel.org/all/20260429213224.1747410-1-github@szelinsky.de/
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
pse_isr() 32-bit OOB bitmap access, disable IRQ before freeing PI data
on unregister, and guard against freed PI data on regulator disable.
Pending upstream in the PSE-core teardown UAF fix series
[PATCH net v2 0/2] (in review; merge expected soon).
Link: https://lore.kernel.org/all/20260711121611.1639086-1-github@szelinsky.de/
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/22245
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Add kmod packages to support accessing the fTPM (in-firmware TPM) which
can be implemented in the boot firmware of most modern platforms.
- kmod-optee: Open Portable Trusted Execution Environment
- kmod-optee-rng: OP-TEE random number generator client
- kmod-rtc-optee: OP-TEE real-time clock client
- kmod-scmi-transport-optee: SCMI OP-TEE transport
- kmod-tee: Generic Trusted Execution Environment
- kmod-tee-stmm-efi: EFI variable service Trusted Application
- kmod-tpm-ftpm-tee: Microsoft fTPM Trusted Application
Using the TPM 2.0 can be useful for various security applications,
such as encrypting on-disk credentials. OP-TEE itself alone is also
useful as it can provide a PKCS#11 token for authentication (eg. to
connect to a VPN) and significantly lower the risk of leaking secrets
used for authentication. Also, on some platforms RNG and RTC can only be
accessed via OP-TEE, and some ARM SystemReady platforms require EFI
variables to be access via a TA.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The driver ring handling consists of two parts:
- rx_data: DMA coherent data shared with the SoC
- rx_qs: driver internal handling data
It is unclear what "qs" stands for. Rename that part to "rx_info".
While we are here:
- relocate slot from rx_data to rx_info as it is only needed by
the driver and not the SoC.
- rename page_pool to pool because there is only this single pool
inside the driver.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The driver uses rx_data_dma and tx_dma although they have an
identical meaning. Align their naming.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The Realtek SoC hardware can split incoming packets over multiple buffers.
This allows to receive packets that are larger than the current 2K page
pool limit without changing the design to higher order pages. Add a logic
to handle these fragments.
As a first proof of concept simulate fragmentation by reducing the buffer
size down to 400 bytes. With the current support for standard MTU (1500)
the packets might consist of up to 4 fragments.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Change device error statistics like normal statistics - under a lock.
Reword associated messages in preparation for fragment handling.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Simplify rteth_hw_receive() by using a separate helper for SKB creation.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Reorder the code around napi_gro_receive() so that it fits nicely
for the upcoming fragment handling. For this relocate the FCS
stripping and eth_type_trans() calls short before the handover
when the packet is fully built.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Add a comment why we are doing this and make use
of a helper variable.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Until now the driver packs each received packet into one ring buffer.
In the future jumbo packets will be split into multiple fragments.
Prepare the ring counters for this:
- Add the more flag to SoC packet header. This denotes if a packet
has more data after the current fragment.
- Ring counters must be handled per packet and not per fragment.
Increase work_done after each packet and not after each fragment.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Testing shows that the existing performance boost by aligning the data
to 2 bytes (NET_IP_ALIGN) breaks fragment handling on RTL838x devices. The
SoC silently drops 2 bytes between each fragment. Use this tricky alignment
only when it is supported. This will bring down performance on RTL838x SoCs
by 30%. All other SoCs are unaffected. This is a legitimate tradeoff for
allowing multiple fragments. While we are here make clearer what the
definies are about and rename them to a SKB_ prefix.
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Add a helper to simplify SKB freeing and rx counter handling. If SKB
is given, it is freed and the pointer is set to zero. The return value
is the number of freed SKBs (0/1). With this the existing cleanup and
error handling can be simplified like
dev->stats.tx_errors += rteth_free_skb(&packet->skb);
Link: https://github.com/openwrt/openwrt/pull/24245
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Free the per-port segment strings on unregister to avoid leaking them
across device rebind. Drop the dead (phys < 0) check and guard the
kstrdup allocation against failure.
Move swconfig_create_led_trigger() before list_add_tail() in
register_switch so a failing registration never publishes the device on
the global swdevs list with dangling portmap/portbuf pointers (a
use-after-free for any swdevs iterator). Route both the LED trigger
failure and the -ENFILE (swdev id exhaustion) failure paths through a
shared cleanup that frees portbuf, portmap, and the per-port segment
strings instead of leaking them.
Reorder the frees in unregister_switch to run after list_del so the
buffers are not freed while the device is still reachable from swdevs.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24246
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Upstream has marked it as BROKEN. Quote:
This driver is harmful:
- It is much slower than the CPU.
- It Has a history of bugs.
- It does not have exclusive access to the hardware, causing races
with the secure world.
- It register its implementations with too low a cra_priority for them
to be actually used.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24326
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The nvmem cell for the MT7663 (5 GHz) radio was too small. The MT7663 EEPROM at
offset 0x8000 requires the full MT7615_EEPROM_FULL_SIZE (0x4da8), but the cell
only declared 0x200 bytes.
The driver always requests the full buffer, also for the MT7663, so the undersized
cell makes the nvmem read fail with -EINVAL. The driver then falls back to default
values, which limits TX power to 3 dBm.
Fix this by enlarging the cell to 0x4da8. The offset 0x8000 was already correct —
offset 0x0 holds the MT7628 (2.4 GHz) calibration data.
Fixes: #23632
Signed-off-by: Frank Lang <Frank_Lang@outlook.de>
Link: https://github.com/openwrt/openwrt/pull/24284
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The eth0 assignment never takes effect. 05_set_preinit_iface brings eth0
up in its default case before 10_fix_eth_mac.sh runs, and the kernel
refuses a MAC change on a running interface, so ip link fails with EBUSY.
This script cannot run any earlier either, since it needs /tmp/tp_data
mounted by 09_mount_cfg_part.
Nothing is lost by dropping it: the DSA user ports carry their own
addresses, which the lan1-3 assignments below already take care of, and
br-lan takes its address from them.
Verified on a BE450 running an image built from main: eth0 comes up with
a different random address on every boot regardless of this line, while
lan1-3 and br-lan keep the label MAC across reboots even with no macaddr
in /etc/config/network.
Fixes: 1513da34bb ("mediatek: filogic: set eth0 and LAN port MACs on TP-Link BE450")
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24325
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>