Use SOURCE_DATE_EPOCH for X.509 validity and hash the unsigned
certificate fields to derive stable serial numbers. The hash includes
payload extensions, so changed firmware gets a new serial.
Retain the existing behavior when the variable is unset and reject
invalid values. ECDSA signatures remain nondeterministic.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Use the published P-256 example key from RFC 6979 for all seven
default development signing roles instead of generating new keys.
Keep role-specific filenames so TFA_KEY_DIR can supply distinct keys.
Pass all supplied keys to both regular and FWU cert_create runs.
Certificate times, serials, and ECDSA signatures still vary.
The public demo key must not be provisioned as a production trust root.
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
The LAG code still uses raw switch register accessors despite the
regmap already available in the switch private data.
Replace direct register accesses with regmap operations through
priv->map. Pass priv to the local group, local port and table refresh
callbacks, updating their declarations and callers accordingly.
Use regmap_write_bits() to preserve unconditional masked writes and
include all set bits in the mask to retain sw_w32_mask() semantics.
Convert refresh polling to regmap_read_poll_timeout() while keeping
the existing polling interval and timeout.
Assisted-by: ChatGPT (OpenAI GPT-6 Astra)
Link: https://github.com/openwrt/openwrt/pull/25874
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The factory image of the Dongwon DW02-412H sometimes carries a broken
header CRC, as seen by the rebuilder:
-Header CRC: 0X990A0000
+Header CRC: 0X990A9FB7
The CRC is written with printf piped into dd bs=4 count=1. Bash's printf
writes its output line buffered, so a CRC holding a 0x0a byte is written
in two parts:
write(1, "\231\n", 2) = 2
write(1, "\237\267", 2) = 2
If dd reads the pipe between the two writes, it gets a short block, and
with count=1 it stops there and leaves the rest of the CRC zero. This
depends on the scheduling, so busy builders hit it while idle machines
almost never do. Delaying the writes reproduces it every time:
old: CRC be f8 0a 00
new: CRC be f8 0a 17
Put the header together by concatenation instead, so the image no longer
goes through dd. Without the race, the output is the same as before
(300 random kernels, all identical and with valid CRCs).
Link: https://github.com/openwrt/openwrt/pull/25867
Signed-off-by: Paul Spooren <mail@aparcar.org>
Kernel modules from the packages feed still differ between builds on
targets with Linux 6.12, e.g. kmod-jool-netfilter on tegra:
/builder/shared-workdir/build/build_dir/.../jool-4.1.15/src/mod/common/xlator.c
These packages build through make -C $(LINUX_DIR) M=... without the
OpenWrt prefix maps. On 6.12, kbuild compiles external modules from the
absolute M= path and maps only the kernel tree, so __FILE__ keeps the
absolute path of the module sources. Linux 6.13 maps the module
directory itself, which is why 6.18 only needed the kernel tree mapped
(206-kbuild-map-the-kernel-tree-for-external-modules.patch).
Add a pending patch for 6.12 that maps the directory of external
modules. It comes after the map of the kernel tree and before KCFLAGS,
so modules built through KERNEL_MAKE keep their current output.
On a 6.12 tree, __FILE__ of an external module changes from its
absolute path to the path relative to the module directory.
Link: https://github.com/openwrt/openwrt/pull/25875
Signed-off-by: Paul Spooren <mail@aparcar.org>
Every frame the CPU sends is tagged for queue 0 of its port, so the
priority of a packet from the switch itself has no effect on the way out
and its control traffic waits behind everything else in that queue.
Tag a frame with its priority as the queue, limited to the eight queues
all ports have. The other families keep queue 0.
The switch translates the queue of the tag through a table before it
queues the frame on the port, and the table resets to zero, which is
queue 0 for every frame. Program the identity the vendor SDK programs,
for the ports with eight queues and for the ones with twelve.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25856
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
route_matches() replaced the only use of route_read(), and nothing
calls it any more. RTL930x reads its rows back in its route_matches()
and decodes them for the debugfs dump, and RTL838x, which has no L3
setup, never read one. Drop the member and both readers, with the
"route type not supported" warning in the RTL930x reader, which could
no longer fire.
No functional change. Compile-tested on RTL839x, RTL930x and RTL838x.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25872
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
An RTL839x prefix row move writes the rules of the moving routes again
at their new rows, and returned 0 whatever the writes did. A rule that
was not written left the block half shifted while the list moved on as
if it had moved, and the rows no longer held the routes the list named.
Let route_write() return the error of the write, so the mover writes
with it too, and return -EIO from the move when a rule write fails.
otto_l3_route_place() and otto_l3_route_compact() then mark the rows
stale, as they do on RTL930x: nothing new is placed, what is in the
table keeps routing, and a route is only written or cleared while its
row reads back as it. Any failed write counts, the first one included,
since a rule that was not written may be half written. The RTL838x and
RTL930x writers return an error too, the table write's or -EOPNOTSUPP
for an unsupported type; no caller looks at them yet.
On an HPE 1920-48G (RTL8393), with 10.99.0.0/16 the last of the IPv4
rows, the third rule write of the move that makes room for a new /30
was made to fail on purpose. The move reports it once ("row 5 not
moved, no prefix route will be placed again"), the /30 is not placed,
and traffic to the /16 and to a /24 above it keeps going out in
hardware: 8 of 8 echo requests to each reach their gateway with TTL
63, none reaches the CPU.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25872
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
otto_l3_route_is_at() reads a prefix row back through route_read(),
which RTL839x does not have, and answers yes or no. RTL839x never got
there because its row moves never reported a failure, so its rows never
went stale; once they can, the check would call a NULL pointer. The
answer also cannot tell a row holding another route from a row that
could not be read.
Give the families route_matches(): 1 when the row holds the route, 0
when it holds nothing or another one, negative when it could not be
read. RTL930x keeps its comparison, now on a read that reports its
error. RTL839x reads the PIE rule back and compares what
otto_l3_839x_route_write() wrote: destination, mask, and the next hop's
L2 entry or the CPU port. A removal now checks its row on RTL839x
too, as RTL930x always did, and clears it only while it reads back as
the route.
A row that cannot be read is frozen. otto_l3_route_trap_sw(), which a
device taking another MAC reaches, now leaves a frozen row alone too,
as the other writers do. A removal that cannot read its row marks the
rows stale and leaves the row as it is, as it does when the hardware
lookup times out; on RTL930x it no longer falls back to that lookup.
While the rows are stale, a prefix route that goes keeps everything a
row left in hardware may still route through: its gateway's L2 entry
and its id, and on RTL839x its packet counter, now stay with its
egress interface, DMAC and switch MAC entries, after a failed move as
well as after a lookup timeout.
On an HPE 1920-48G (RTL8393), on a bench image that can make a rule
write or read fail on purpose, an IPv4 and IPv6 test round passes 20
of 20 checks. With the rows made stale by a failed move (next commit),
removing routes still on their rows clears them, a forwarding and a
trapping IPv4 route and a forwarding IPv6 one; removing a route whose
recorded row holds another one leaves that row ("row 12 holds another
route"); and removing a route whose row read fails leaves the row
("row 9 not read: -145"), with its gateway's L2 entry still a next hop
and its traffic still forwarded in hardware. RTL930x is compile-tested
only.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25872
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
rtl839x_pie_rule_read() and rtl839x_pie_rule_write() return 0 whatever
the table access did: a table that could not be taken, or a read or
write that failed, goes unnoticed, also through
rtl839x_pie_l3_rule_write(), which L3 uses for its rules. L3 is about
to need both: to move its rules and to read one back, it has to know
when a rule was not written or not read.
Return the error of the access instead. The rule a failed read hands
back stays cleared, as it is today. The other callers,
rtl839x_pie_rule_add() and the L3 debugfs dump, ignore the value, so
nothing changes for them.
On an HPE 1920-48G (RTL8393), with the rest of this series, the L3
rules of an IPv4 and IPv6 test round are written, moved and read back
as before: 20 of 20 checks pass.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25872
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The switch drops frames to 01-80-C2-00-00-02 (slow protocols). On
RTL839x the RMA action is FORWARD (0) normally and FLOOD (3) with
promisc/allmulti. Neither reaches the CPU. This breaks LACP bonding.
This improved code always sets the action for 01-80-C2-00-00-02 to
TRAP2CPU (2) and always sets the STP and VLAN bypass. So STP and VLAN
filtering do not drop them.
With promisc/allmulti, all RMA addresses are now trapped instead of
flooded, as flooded frames do not reach the CPU either.
The registers are now updated with regmap_update_bits(), so the
reserved bits of RMA_CTRL_0 and the bits above 9 of RMA_CTRL_3 are no
longer cleared. RMA_CTRL_3 is now also set in allmulti mode, so the
promisc bypass bits do not stay set after a change to allmulti.
Authored-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Harm Kroon <hhhkroon@hotmail.com>
Link: https://github.com/openwrt/openwrt/pull/25765
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The switch drops frames to 01-80-C2-00-00-02 (slow protocols). On
RTL839x the RMA action is set in rteth_839x_set_rx_mode() only: FORWARD
(0) normally, FLOOD (3) with promisc/allmulti. Neither reaches the CPU.
This breaks LACP bonding.
This fix always sets the action for 01-80-C2-00-00-02 to TRAP2CPU (2),
bits 5:4 of RMA_CTRL_0 (0x1200).
Signed-off-by: Harm Kroon <hhhkroon@hotmail.com>
Link: https://github.com/openwrt/openwrt/pull/25765
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The SDK's automatic RX calibration paths only run for 10G-class
SerDes modes. The calibration sequence accesses the 10G analog block
and can report spurious failures when used for lower-speed modes.
Restrict post-config RX calibration to 10GBase-R, XSGMII and USXGMII,
skipping the RX-idle wait and calibration checks for all other modes.
Testing on several devices show that links still work flawless and no
errors occur anymore.
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Use DIV_ROUND_CLOSEST for the sampled LEQ average, enable TAP1-4
adaptation with a loop and pass zero coefficients directly when
disabling DFE.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Use named FGCAL result, offset-range and RX-run fields in RTL930x
foreground calibration, checking debug selection and read errors. Drop
the diagnostic-only Gray read and derive the range limit from its field
mask.
Share complete load-in masks between reset and calibration helpers,
preserving the undocumented bits used by the known-good sequences.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Define LEQ manual-mode, hold, offset and initialization fields for
RTL930x and RTL931x. Use the named fields in equalization helpers and
calibration sequences, and give RTL931x VTH initialization separate
masks from debug readback.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Use named debug sources, coefficient selectors and readback masks in the
RTL930x and RTL931x equalization getters. Name the shared selector
RX_COEF_SEL since it also selects calibration results, and use a common
LEQ Gray readback mask.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Select the TAP register explicitly and use the shared initialization
field masks. Update the even and odd coefficients for TAP1-4 in a single
read-modify-write, while retaining the even-only update for TAP0.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Define register addresses and bit fields for RX equalization, TAP
initialization and adaptation control. Use the named masks with
FIELD_GET and FIELD_PREP in the LEQ and VTH helpers, and preserve the
undocumented reset bits.
Assisted-By: ChatGPT (OpenAI GPT-6.1 Sol)
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Those modes were commented out so far and thus not usable at all. While
we still lack the proper mode setup, at least allow those modes to be
selected in case a bootloader before already applied all the needed
setup. Also print a warning for those modes.
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
At this specific location, wrapping the last argument doesn't help. It
rather makes the code harder to read. Fix this.
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
[cid] 7b49c9cf4b77a69f03297f515c89e94f21c9b1c0
ARM: dts: qcom: change labels to lower-case
DTS coding style expects labels to be lowercase. No functional impact.
Verified with comparing decompiled DTB (dtx_diff and fdtdump+diff).
Signed-off-by: Hans Ulli Kroll <linux@ulli-kroll.de>
Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/25854
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The prefix row placement is common to RTL839x and RTL930x, but where an
IPv6 entry sits is not: an RTL839x PIE rule matches a whole IPv6
destination in any row, while an RTL930x entry spans three rows and may
only start on two rows of every eight. otto_l3_v6_row() and
otto_l3_v6_slot() chose between the two layouts through use_l3_tables,
which says how a family routes, not how its table is laid out.
Give the families v6_slot_to_row() and v6_row_to_slot() and move each
layout next to its row mover. Ordering, insertion, compaction and the
capacity and IPv4/IPv6 collision checks stay common, and keep calling
the same two helpers, which now ask the family. The common code calls
them only for a family with a row mover.
The formulas move unchanged. Built on the host from l3.c as it is, the
placement code before and after this change maps every slot and row of
both layouts alike, and runs 160000 random IPv4 and IPv6 insertions and
removals, past a full table on both families, with the same rows and
the same moves; a one-line mutation planted in each of the four
callbacks makes the results differ. On an HPE 1920-48G (RTL8393) an
IPv6 test round passes 20 of 20 checks, among them a /48 and a /64
inserted in both orders and IPv4 and IPv6 routes side by side, the
routes of those checks forwarded in hardware to the right gateway.
RTL930x is compile-tested only.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25868
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Commit 4071398b13 replaced $(VERSION_DIST) in the netgear-dni and
netgear-encrypted-factory recipes with $(shell cat $(VERSION_DIST) | sed
...) to turn whitespace into dashes. VERSION_DIST holds the distribution
name such as "OpenWrt" and not a file name, so cat fails with "No such
file or directory" and the expansion is always empty.
The change was meant to let a distribution name with a space, such as
"ColVisTec AG", pass through the argument parsing of
netgear-encrypted-factory.py as "ColVisTec-AG". What it produced instead
was an empty string for every distribution name, including the one it
was written for. The build error went away only because an empty string
contains no whitespace.
Since then, the DNI header of the Netgear images carries
"version:V.r12345" instead of "version:VOpenWrt.r12345", and the
encrypted factory images get "V1.0.0.0..r12345" with an empty field
between two dots instead of "V1.0.0.0.OpenWrt.r12345".
The distribution name has been part of the Netgear version string since
commit 6d2fa1c896 added the first WNDR3700 factory image in 2009, and
the encrypted factory recipe used it from its introduction in commit
efca76ffce.
Use $(subst $(space),-,$(VERSION_DIST)) instead, which restores the
distribution name and still replaces spaces with dashes as intended.
Fixes: 4071398b13 ("build: escape whitespaces in VERSION_DIST for Netgear images")
Signed-off-by: Grische <github@grische.xyz>
Assisted-by: Claude:claude-opus-5-5
Link: https://github.com/openwrt/openwrt/pull/25674
Signed-off-by: Robert Marko <robimarko@gmail.com>
The Herospeed RV1126 IMX415 "Base" is an IP camera built on a Rockchip
38x38 V10 EMMC DDR3 board, which is also found in cameras of other
makes and is therefore described by a separate dtsi. The stock firmware
identifies itself as ONVIF manufacturer "HeroSpeed", firmware family
RV1126_IMX415_BASE. This adds the 32-bit armv7 subtarget for the
Cortex-A7 based RV11xx SoCs. The camera keeps its stock U-Boot, which
boots an Android boot image from one of two boot/system slots.
Hardware
--------
SoC: Rockchip RV1126, 4x Cortex-A7
RAM: 1 GiB DDR3
Flash: eMMC, 8 GB class, two boot/system slots
Ethernet: 1x 10/100 Mbit/s, JL1101 PHY on RMII
Sensor: Sony IMX415, 4 lane MIPI CSI-2
RTC: PCF8563
LEDs: white illumination LEDs on one PWM output (V4L2 flash)
Buttons: none
UART: 1.8 V TTL on UART2, 1500000 baud 8N1, 90-degree JST-SH connector
at the bottom edge of the board, facing the edge and hidden underneath
the MIPI CSI cable
Power: PoE (IEEE 802.3af) or 12 V 1 A DC through the barrel connector
on the cable whip
Installation
------------
1. Open the web interface of the stock firmware (192.168.1.168 by
default) and log in as admin.
2. Upload openwrt-rockchip-armv7-herospeed_rv1126-imx415-squashfs-
factory-RV1126_IMX415.fls on the firmware upgrade page.
3. The camera reboots into OpenWrt at 192.168.1.1.
Later upgrades use the sysupgrade image, which is written to the
inactive slot. The stock firmware can be restored from OpenWrt with
"sysupgrade -F -n" and the original .FLS file.
MAC address
-----------
eth0 uses the label MAC, stored as MAC=xx:xx:xx:xx:xx:xx in net.conf on
the ext4 "param" partition. U-Boot passes a different, derived address
to Linux, which is replaced by the stored one.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add RV1126 support (USB2 PHY and DWC3, TSADC, clocks, I2C and SPI,
cpufreq, I2S and PDM, VICAP, MIPI CSI-2 D-PHY, VPU, RGA, hwrng) and
describe the SoC in rv1126.dtsi. Import and rewrite the unmerged
crypto driver for RK3568 and RK3588 by Corentin Labbe (AES, hashes);
its RK3568 and RK3588 support is untested. Add a newly written driver
for flash LEDs driven by a PWM channel.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Backport the pixel clock sampling mode defines of the video-interfaces
dt-bindings header, which the rk3568 vicap binding example already
uses. The Rockchip RV1126 capture nodes refer to the same header.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
mkrkboot builds the Android boot image, with the Rockchip resource
image holding the device tree, that the U-Boot of the Rockchip RV11xx
camera SoCs boots.
mkhsfls packs the .FLS container accepted by the web interface of
Herospeed cameras.
Both are used by the image recipes of the rockchip/armv7 subtarget.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The pci and pcie features and the Image kernel target describe the
64-bit RK33xx/RK35xx boards, not the Rockchip family as a whole. Set
them in the armv8 target.mk so that a 32-bit ARM subtarget can build a
zImage and does not advertise PCIe.
The feature set and kernel targets of armv8 stay as they were.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
The use map counts the routes that forward through an L2 unicast entry
in seven bits. At 127 the count stops, and an entry that got there is
never released: when its routes are gone it keeps its next hop flag
until the switch restarts. RTL930x takes 512 prefix and 1536 host
routes, so more than 126 through one gateway is an ordinary table.
Give the count fifteen bits, more than the routes of any family. The
map grows from one to two bytes per entry.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25859
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
A route with no gateway keeps the unspecified address where its gateway
would be, 0.0.0.0 or ::, and so does the route of each address of the
switch. Their rows trap to the CPU. The kernel accepts a neighbour at
that address when one is added by hand, and otto_l3_nexthop_update(),
which matches a neighbour on the gateway and the device recorded for
each route, takes it for the gateway of such routes and can turn their
rows into forwarding ones. Leave such a neighbour alone: it is the
gateway of no route.
HPE 1920-48G (RTL8393), host B on VLAN 3, 10.99.0.0/16 dev switch.3,
and
ip neigh add 0.0.0.0 lladdr <MAC of host B> dev switch.3 nud permanent
Without the change the row of 10.99.0.0/16 forwarded 8 of 8 echo
requests from another VLAN to host B with TTL 63, none reached the CPU,
and the rows of the switch's addresses and on-link prefixes on switch.3
turned to forwarding as well: a host on another VLAN got no answer from
10.91.3.1, 0 of 3. With :: on IPv6 the trap rows of fd00:90:3::1/128,
fd00:90:3::/64 and 2001:db8:99::/48 went through the same update and
took a packet counter each, but kept trapping here.
With the change the neighbour event still arrives and changes nothing:
the rows keep trapping and take no counter, the 8 echo requests reach
the CPU, and the switch answers on 10.91.3.1 and fd00:90:3::1, 3 of 3.
A route through a gateway, measured before the neighbour was added,
forwards in hardware on both, 8 of 8 with TTL and hop limit 63.
RTL930x is compile-tested only; families without an L3 setup never
queue the neighbour event.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Gennaro Cimmino <gcimmino@rayonra.net>
Link: https://github.com/openwrt/openwrt/pull/25863
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Manually adjusted symbols:
- SOC_SAMA7D65: SAMA7D65 family
- PAGE_BLOCK_MAX_ORDER: Page Block Order Upper Limit
- SPI_POLARFIRE_SOC: Microchip FPGA SPI controllers
All other kernel config symbols are automatically refreshed by
`make kernel_oldconfig`.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/25436
Signed-off-by: Robert Marko <robimarko@gmail.com>
Two symbols needed input, the respective default was picked:
- CONFIG_PAGE_BLOCK_MAX_ORDER, default 10
- CONFIG_FRAME_WARN, but was dropped by kernel oldconfig
The other symbol changes are automatic.
Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/25421
Signed-off-by: Robert Marko <robimarko@gmail.com>