Skip to content

airoha: add support for kernel 6.18#21019

Open
hurrian wants to merge 13 commits intoopenwrt:mainfrom
hurrian:airoha-6.18-work
Open

airoha: add support for kernel 6.18#21019
hurrian wants to merge 13 commits intoopenwrt:mainfrom
hurrian:airoha-6.18-work

Conversation

@hurrian
Copy link
Copy Markdown
Contributor

@hurrian hurrian commented Dec 2, 2025

Enable kernel 6.18 as the testing kernel for airoha.

This kernel bump removes a large amount of pending backported patches, decreasing maintenance load for the target.

All patches refreshed automatically. Patchset is functionally identical to 6.12 at this time.

Run tested on Bell XG-140G-TF (#20486), Gemtek W1700K and XR1710G(#22397).

Compile tested for the an7581 and an7583 RFB.

Signed-off-by: Kenneth Kasilag kenneth@kasilag.me

@github-actions github-actions Bot added kernel pull request/issue with Linux kernel related changes target/airoha pull request/issue for airoha target labels Dec 2, 2025
@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Dec 3, 2025

Bootlog for 6.18 on the XG-140G: (link)

@namiltd namiltd mentioned this pull request Dec 3, 2025
47 tasks
@map-b
Copy link
Copy Markdown
Contributor

map-b commented Dec 4, 2025

I would remove the link to the generic 6.18 PR from the commit message to avoid GitHub polluting that thread with those ugly "hurrian referenced ..." With each force-push.
Edit: I said link but it is the # 20... in the commit what causes that, I think. The PR description was fine.

@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Dec 4, 2025

I would remove the link to the generic 6.18 PR from the commit message to avoid GitHub polluting that thread with those ugly "hurrian referenced ..." With each force-push.

Done, thanks!

@mrkiko
Copy link
Copy Markdown
Contributor

mrkiko commented Jan 15, 2026

Mark.

@namiltd
Copy link
Copy Markdown
Contributor

namiltd commented Jan 25, 2026

What about the crypto-hw-eip93 module? It's not even configured for kernel 6.12, even though there's a patch for it.

@abajk
Copy link
Copy Markdown
Contributor

abajk commented Jan 25, 2026

What about the crypto-hw-eip93 module? It's not even configured for kernel 6.12, even though there's a patch for it.

As far as I remember, the downstream driver panics on startup on AN7581. This could have been caused by some edge cases. When I tested it, I had self-tests compiled in.

@namiltd
Copy link
Copy Markdown
Contributor

namiltd commented Jan 25, 2026

Add patches from crypto: eip93: add pending and hack patches

@abajk
Copy link
Copy Markdown
Contributor

abajk commented Jan 25, 2026

It would be nice to rebase this PR. As far as I can see, some patches have changed the names.

@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Jan 25, 2026

I am currently waiting on a newer version of the airoha_eth driver to land; our current downstream driver has issues due to phylink changes that happened between 6.12 and 6.18. There's a newer driver that does use these features sitting in Patchwork; but it does not yet include AN7583 support.

@namiltd
Copy link
Copy Markdown
Contributor

namiltd commented Jan 25, 2026

However, I think that adding eip93 to airoha should be in a separate PR because it applies to kernel 6.12 (at first).
The changes should also include crypto.mk, as in ea38599

@Cairongzeng
Copy link
Copy Markdown
Contributor

I am currently waiting on a newer version of the driver to land; our current downstream driver has issues due to phylink changes that happened between 6.12 and 6.18. There's a newer driver that does use these features sitting in Patchwork; but it does not yet include AN7583 support.airoha_eth

Is this issue resolved now? Can it be applied to the AN7581 first?

@hurrian hurrian force-pushed the airoha-6.18-work branch from 7214a29 to 78351cb Compare April 2, 2026 10:14
@hurrian hurrian marked this pull request as ready for review April 2, 2026 10:15
@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Apr 2, 2026

Now that the dust has settled on 6.18, I've updated the patch sets for the main branch.

Thanks to the upstreaming efforts, most patches for Airoha have landed in mainline. As time goes on we will have very few out-of-tree patches to maintain.

Looking for feedback on this patch set:

  1. As with @namiltd's suggestion, I have switched on kmod-crypto-hw-eip93 (since it was also backported to 6.12 anyway).
  2. Should we remove the out of tree BMT/BBT patches since moving forward, all devices that haven't been ubinized are advised to use the chainloader?

@hurrian hurrian force-pushed the airoha-6.18-work branch from 78351cb to a54a446 Compare April 2, 2026 10:23
@namiltd
Copy link
Copy Markdown
Contributor

namiltd commented Apr 2, 2026

kmod-crypto-hw-eip93 for kernel 6.12 is backported from the Linux kernel for Airoha, and from the MTK version for Mediatek mt7621. Only for kernel 6.18 there is only one "inside-secure" driver from the Linux kernel.

@hurrian hurrian force-pushed the airoha-6.18-work branch 6 times, most recently from 5201a7e to 0dbb41b Compare April 3, 2026 06:58
@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Apr 16, 2026

Rebased to main branch.

@glassd00r
Copy link
Copy Markdown

glassd00r commented Apr 16, 2026

build error

2026-04-16T14:02:40.4413122Z Applying /home/runner/work/Openwrt_Builder/Openwrt_Builder/target/linux/airoha/patches-6.18/320-11-net-airoha-add-phylink-support-for-GDM2-4.patch using plaintext: 
2026-04-16T14:02:40.4427361Z patching file drivers/net/ethernet/airoha/airoha_eth.c
2026-04-16T14:02:40.4427858Z patch: **** malformed patch at line 81: @@ -2890,6 +2926,99 @@ bool airoha_is_valid_gdm_port(struct air
2026-04-16T14:02:40.4428316Z 
2026-04-16T14:02:40.4429505Z Patch failed!  Please fix /home/runner/work/Openwrt_Builder/Openwrt_Builder/target/linux/airoha/patches-6.18/320-11-net-airoha-add-phylink-support-for-GDM2-4.patch!
2026-04-16T14:02:40.4434314Z make[4]: *** [Makefile:26: /home/runner/work/Openwrt_Builder/Openwrt_Builder/build_dir/target-aarch64_cortex-a53_musl/linux-airoha_an7581/linux-6.18.21/.prepared_1bf5753f97d5ce42c25427b325ae6a24] Error 1

@OpenWRT-fanboy
Copy link
Copy Markdown

320-11 must have gotten corrupted in the rebase. This earlier version compiles cleanly.
320-11-net-airoha-add-phylink-support-for-GDM2-4.patch

@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Apr 22, 2026

FWNODE_PCS just got added to generic in 18cbd83; this patch set will need to be refactored/refreshed

@hurrian hurrian force-pushed the airoha-6.18-work branch 4 times, most recently from 75f98c3 to 74f0c74 Compare April 24, 2026 03:51
@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Apr 24, 2026

Patch set rebased on main and refreshed. FWNODE_PCS has finally landed; so for 6.18 the Airoha target will use it for the airoha_eth driver.

Meanwhile, 6.12 will be temporarily patched for compatibility with the new pcs-handle node so that the same dts can be used on both.

Looking for further testing reports so we can get this merged.

@OpenWRT-fanboy
Copy link
Copy Markdown

tested latest rebase and works well. ready to merge.

@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Apr 25, 2026

Gentle ping to @Ansuel and @hauke

@ajh5408
Copy link
Copy Markdown

ajh5408 commented Apr 25, 2026

Patch set rebased on main and refreshed. FWNODE_PCS has finally landed; so for 6.18 the Airoha target will use it for the airoha_eth driver.

Meanwhile, 6.12 will be temporarily patched for compatibility with the new pcs-handle node so that the same dts can be used on both.

Looking for further testing reports so we can get this merged.

Compiled with 96e03b0, installed, no issues to report. (W1700K HW v1.0)

hurrian added 13 commits April 29, 2026 22:59
During configuration of airoha for 6.18 it was noted that there
were additional missing symbols from the generic config.

Update the missing symbols accordingly.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
This is an automatically generated commit.

When doing `git bisect`, consider `git bisect --skip`.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
This is an automatically generated commit which aids following Kernel patch
history, as git will see the move and copy as a rename thus defeating the
purpose.

For the original discussion see:
https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Update the kernel configuration in for kernel 6.18.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Remove all patches that have already been upstreamed for kernel 6.18.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Fix patch compatibility for kernel 6.18 on airoha.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Due to hardware bugs, the PCIE Gen3 IP in Airoha AN7581 requires a
special reset procedure:
> MAC reset asserted thru the SCU block
> PERST asserted thru the SCU for the desired PCIE lane
> PHY initialization runs, clocks enabled
> MAC reset deasserted
> EQ config (if needed) written
> PERST deasserted

The existing code currently toggles PERST for all three PCIE
ports every time mtk_pcie_en7581_power_up is called, resulting
in PCIE link down issues.

This issue was discovered during porting of the 6.18 kernel to
AN7581. It is not entirely clear how the hardware seemed to
function under kernel 6.12 with similar driver code, it is
presumed that differences in assert/deassert times for PERST in
6.18 changed which exposed the bug.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
The Airoha PCS driver for kernel 6.18 relies on the pending
firmware node PCS accessors, which expect the `pcs-handle` and
`#pcs-cells` properties in device tree.

Rename the cells in DTS for an7581 and an7583 to support this.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
The previous downstream driver for Airoha PCS used the `pcs`
node instead of the `pcs-handle` now used in upstream.

Revise the driver to support the new style node.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
The `config_clks_t` definition changed between 6.12 and 6.18.
Revise the airoha-cpufreq driver with the proper signature.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Patch `600-12-clk-en7523-Add-reset-controller-support-for-EN7523-S.patch`
was accepted in 6.19-rc1 (1c0608d860db973ad09b5a9ccb19b76ae07622a3).

Properly tag the patch for future reference.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Refreshed automatically with `make target/linux/refresh V=s`.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
Add building the 6.18 kernel for airoha as testing.

Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me>
@hurrian
Copy link
Copy Markdown
Contributor Author

hurrian commented Apr 29, 2026

Rebased on main (due to changes in 1b9922d).

@skramstad
Copy link
Copy Markdown
Contributor

Just installed w1700k SNAPSHOT, r34222+14-95fb8e4353. Will report back if there's any issues. I'm also testing the HW offload patches, with changes for 6.18.

Copy link
Copy Markdown
Collaborator

@openwrt-ai openwrt-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • 7eccf34 "generic: add missing config symbols for 6.18" — adds # CONFIG_ARCH_LAN969X is not set at line 297 in target/linux/generic/config-6.18 while the same symbol already appears at line 294 (see inline). The other added symbols (ARM64_GCS, PINCTRL_MT6893/MT7988/MT8189/MT8196) look correct, but this one looks like a copy-paste/sort accident.

Generated by Claude Code

@@ -294,6 +294,7 @@ CONFIG_ARCH_FORCE_MAX_ORDER=11
# CONFIG_ARCH_LAN969X is not set
# CONFIG_ARCH_LAYERSCAPE is not set
# CONFIG_ARCH_LG1K is not set
# CONFIG_ARCH_LAN969X is not set
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate symbol — # CONFIG_ARCH_LAN969X is not set is already present three lines above (line 294, unchanged context). The new entry inserted here in commit 7eccf34 ("generic: add missing config symbols for 6.18") is a verbatim repeat and is also out of alphabetical order between ARCH_LG1K and ARCH_LPC32XX. Drop this line; if there's a different symbol meant here (e.g. ARCH_LAN966X?), correct it instead.

Suggested change
# CONFIG_ARCH_LAN969X is not set

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel pull request/issue with Linux kernel related changes target/airoha pull request/issue for airoha target

Projects

None yet

Development

Successfully merging this pull request may close these issues.