Skip to content

Conversation

@tabrisnet
Copy link
Contributor

@tabrisnet tabrisnet commented Aug 18, 2025

So I'm not completely convinced about CONFIG_ARM64_ERRATUM_858921, but
when doing my initial changes [enabled a bunch of PHYs, made NFS/SMB etc modules... random stuff], I somehow enabled some errata fixes, and this one showed up in dmesg.

The real star of the show I'm pretty sure is CONFIG_PCS_MTK_USXGMII. Note, it cannot be a module, but on this platform we probably wouldn't want it to be anyway. When I say "it can't", I'm saying it breaks the build during the linker phase for vmlinux. Probably worth fixing, but I'm unclear where to start, other than it's probably a Kconfig dependency problem.

CONFIG_I2C_SLAVE_EEPROM came along for the ride b/c it possibly made sense with SFPs. But I haven't tried a test build without it yet.

For the record: this works with both my AQS-107-B0C2-CX [an 802.3bz SFP+] and my FS.com SFP-10GSR-85 "generic" SFP+.

Description

This is a fix for the second issue found from my forum post. https://forum.armbian.com/topic/54214-bpi-r4-fails-to-build-missing-bl2-firmware/#findComment-223626

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • built, installed linux-{dtb,image}-current-filogic DEBs. reboot. ip link set up dev eth1. ethtool eth1|grep Link
    • may need to wait a hair between ip link set and ethtool
  • tcpdump -vv -i eth2 'ether proto 0x88cc' gives positive results.

Checklist:

Please delete options that are not relevant.

  • I have performed a self-review of my own code
  • [ ? ] My changes generate no new warnings

@github-actions github-actions bot added 08 Milestone: Third quarter release size/small PR with less then 50 lines labels Aug 18, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

Walkthrough

This change updates the Filogic kernel configuration file by enabling MediaTek USXGMII PCS support (CONFIG_PCS_MTK_USXGMII=y) and removing an explicit commented line referencing ARM64 erratum 858921 (# CONFIG_ARM64_ERRATUM_858921 is not set).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

Patches, BSP

Suggested reviewers

  • EvilOlaf
  • igorpecovnik
  • Tonymac32

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Aug 18, 2025
@tabrisnet tabrisnet force-pushed the tabrisnet_bpir4_SFP branch from 1f9894b to 85d9524 Compare August 19, 2025 05:56
@tabrisnet
Copy link
Contributor Author

also works with FS.com DAC

when doing my initial changes [enabled a bunch of PHYs, made NFS/SMB
etc modules... random stuff], I somehow enabled some errata fixes, and
this one showed up in dmesg.

The real star of the show I'm pretty sure is CONFIG_PCS_MTK_USXGMII.
Note, it cannot be a module, but on this platform we probably wouldn't
want it to be anyway. When I say "it can't", I'm saying it breaks the
build during the linker phase for vmlinux. Probably worth fixing, but
I'm unclear where to start, other than it's probably a Kconfig
dependency problem.

CONFIG_I2C_SLAVE_EEPROM came along for the ride b/c it possibly made
sense with SFPs. But I haven't tried a test build without it yet.

For the record: this works with both my AQS-107-B0C2-CX [an 802.3bz
SFP+] and my FS.com SFP-10GSR-85 "generic" SFP+.
@tabrisnet tabrisnet force-pushed the tabrisnet_bpir4_SFP branch from 85d9524 to b3cadb7 Compare August 20, 2025 10:32
@tabrisnet tabrisnet marked this pull request as ready for review August 20, 2025 10:33
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
config/kernel/linux-filogic-current.config (1)

417-419: Drop I2C slave and test/EEPROM emulation; they’re unrelated to SFP and expand attack surface.
SFP cages require an I2C master to read module EEPROM; enabling I2C slave mode and the test/emulation drivers is unnecessary for SFP functionality. These drivers are meant for validation and can expose unintended behaviors on production systems. Also, the SoC’s I2C controller must explicitly support slave role for these to be usable; otherwise they’re dead weight.

Apply this diff to revert them:

-CONFIG_I2C_SLAVE=y
-CONFIG_I2C_SLAVE_EEPROM=m
-CONFIG_I2C_SLAVE_TESTUNIT=m
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_SLAVE_EEPROM is not set
+# CONFIG_I2C_SLAVE_TESTUNIT is not set

If you have evidence that a particular deployment needs host-as-slave behavior, we can reintroduce them per-profile, but it would be better to keep them off by default.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7a02c24 and b3cadb7.

📒 Files selected for processing (1)
  • config/kernel/linux-filogic-current.config (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-26T11:17:56.870Z
Learnt from: pyavitz
PR: armbian/build#8421
File: config/kernel/linux-sunxi64-edge.config:1058-1061
Timestamp: 2025-07-26T11:17:56.870Z
Learning: I2C_DESIGNWARE_SLAVE is a bool configuration option in Linux kernel Kconfig, not tristate. This means it can only be set to 'y' (enabled) or 'n' (disabled), never 'm' (module). When enabled, the slave functionality is compiled into the I2C_DESIGNWARE_CORE driver, regardless of whether the core driver is built-in or as a module.

Applied to files:

  • config/kernel/linux-filogic-current.config
🧬 Code Graph Analysis (1)
config/kernel/linux-filogic-current.config (1)
lib/functions/compilation/armbian-kernel.sh (1)
  • armbian_kernel_config_apply_opts_from_arrays (418-448)
🔇 Additional comments (2)
config/kernel/linux-filogic-current.config (2)

342-342: PCS_MTK_USXGMII built-in is the right move to avoid link-time failures.
Keeping the PCS built-in aligns with a built-in MAC/SoC (NET_MEDIATEK_SOC=y) and prevents unresolved symbol issues during vmlinux link.

Would you mind confirming whether NET_MEDIATEK_SOC and dependent MAC/PHY parts are also built-in on all filogic-current variants? Mixed built-in/module across MAC/PCS often causes the link failure you described. If this turns out to be systemic, a small Kconfig follow-up (e.g., select PCS_MTK_USXGMII when NET_MEDIATEK_SOC=y) in our tree could help prevent regressions.


37-59: Erratum 858921 only affects Cortex-A73
Erratum 858921 is specific to Cortex-A73 cores and does not apply to Cortex-A53. The Kconfig option CONFIG_ARM64_ERRATUM_858921 defaults to y and only enables the workaround at runtime when an A73 is detected.

• If your Filogic platform uses Cortex-A73, explicitly enable it in this config:

 # CONFIG_ARM64_ERRATUM_858921 is not set
+CONFIG_ARM64_ERRATUM_858921=y

• If Filogic uses only Cortex-A53 (or other unaffected cores), you can safely leave it unset.

@tabrisnet
Copy link
Contributor Author

37-59: Erratum 858921 only affects Cortex-A73
Erratum 858921 is specific to Cortex-A73 cores and does not apply to Cortex-A53. The Kconfig option CONFIG_ARM64_ERRATUM_858921 defaults to y and only enables the workaround at runtime when an A73 is detected.
• If your Filogic platform uses Cortex-A73, explicitly enable it in this config:

 # CONFIG_ARM64_ERRATUM_858921 is not set
+CONFIG_ARM64_ERRATUM_858921=y

https://www.mediatek.com/products/broadband-wifi/mediatek-filogic-880

CPU Type - Arm Cortex-A73

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
config/kernel/linux-filogic-current.config (1)

37-59: Erratum 858921: consider explicitly setting =y for Cortex‑A73 SoCs

Given Filogic 880 uses Cortex‑A73, explicitly pinning CONFIG_ARM64_ERRATUM_858921=y would make the intent resilient to Kconfig default changes across kernel bumps. Not required if you prefer defaults, but recommended for reproducibility.

If you choose to make it explicit, add this line near the other errata options:

CONFIG_ARM64_ERRATUM_858921=y
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b3cadb7 and fb3898a.

📒 Files selected for processing (1)
  • config/kernel/linux-filogic-current.config (1 hunks)
🔇 Additional comments (2)
config/kernel/linux-filogic-current.config (2)

330-330: Making CONFIG_PCS_MTK_USXGMII built-in is the right call to avoid link-time issues

Building the PCS as built-in aligns with NET_MEDIATEK_SOC=y and prevents vmlinux link failures you saw with =m. Change looks correct for Filogic/BPI‑R4 SFP bring-up.


330-335: Configuration Sanity Check Complete

The expected options are correctly set in config/kernel/linux-filogic-current.config:

  • Line 329: CONFIG_NET_MEDIATEK_SOC=y
  • Line 330: CONFIG_PCS_MTK_USXGMII=y
  • Line 334: CONFIG_SFP=m

No explicit ARM64 erratum 858921 entry was found (this is optional).

Next steps:

  • At runtime, confirm that the SFP module auto-loads and that dmesg shows no “unresolved symbol” warnings.
  • If you need SFP functionality before module loading (early-boot), consider changing CONFIG_SFP=m → CONFIG_SFP=y.

@igorpecovnik igorpecovnik added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Aug 20, 2025
Copy link
Collaborator

@leggewie leggewie left a comment

Choose a reason for hiding this comment

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

CONFIG_PCS_MTK_USXGMII=y

Just to be sure, this has to be built-in and can't be a module?

@tabrisnet
Copy link
Contributor Author

tabrisnet commented Aug 21, 2025 via email

@tabrisnet
Copy link
Contributor Author

tabrisnet commented Aug 21, 2025

and I forgot to mention we should probably add CONFIG_IFB, as it is often used in traffic-shaping

@tabrisnet
Copy link
Contributor Author

tabrisnet commented Aug 21, 2025

if you're looking for my deleted comment... docker-shell doesn't make make menuconfig think it's on ARM if you're running on AMD64, so that's why I couldn't find NET_MEDIATEK_SOC
may also explain my comment re INTEL_MEI

@tabrisnet
Copy link
Contributor Author

so I just ran a test build [haven't attempted to run this kernel] with among other changes [SMB, NFS etc, as mentioned previously], and changing NET_MEDIATEK_SOC to m does allow CONFIG_PCS_MTK_USXGMII to build as m.
I still don't think this is entirely sane, as regardless of the desire to not use CONFIG_PCS_MTK_USXGMII you will always want NET_MEDIATEK_SOC on the filogic platform.

diff --git a/config/kernel/linux-filogic-current.config b/config/kernel/linux-filogic-current.config
index 671e4a684..a4b62ff0d 100644
--- a/config/kernel/linux-filogic-current.config
+++ b/config/kernel/linux-filogic-current.config
@@ -326,8 +329,8 @@ CONFIG_NET_DSA_MT7530=y
 # CONFIG_NET_VENDOR_FUNGIBLE is not set
 # CONFIG_NET_VENDOR_LITEX is not set
 CONFIG_NET_VENDOR_MEDIATEK=y
-CONFIG_NET_MEDIATEK_SOC=y
-CONFIG_PCS_MTK_USXGMII=y
+CONFIG_NET_MEDIATEK_SOC=m
+CONFIG_NET_MEDIATEK_STAR_EMAC=m
 # CONFIG_NET_VENDOR_MICROSOFT is not set
 # CONFIG_NET_VENDOR_VERTEXCOM is not set
 # CONFIG_NET_VENDOR_WANGXUN is not set
@@ -340,6 +343,7 @@ CONFIG_MAXLINEAR_GPHY=y
 CONFIG_MEDIATEK_2P5GE_PHY=y
 CONFIG_REALTEK_PHY=y
 CONFIG_MDIO_AN8855=y
+CONFIG_PCS_MTK_USXGMII=m

@chainsx
Copy link
Member

chainsx commented Aug 21, 2025

Tested, it works.

@leggewie
Copy link
Collaborator

Thank you for your work, @tabrisnet

I did initially set it as a module, but as I said in the description, the linker phase failed for an unresolved symbol.

Apologies, I missed that part.

If your argument is that you want to support the R3 in the future

No argument ;-) I am just looking at your code, reviewing. I don't have the board or know too much about it.

Meanwhile, IMO there are much more interesting cases to override as modules like SMB/CIFS, NFS [client or server], XFS [ext4 is the base image], BtrFS, F2FS.

Agreed, and please feel free to push more PRs for that, although maybe not for the filesystems (depending how exotic they are and how much they add).

Copy link
Collaborator

@leggewie leggewie left a comment

Choose a reason for hiding this comment

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

good stuff, thank you for your work

LGTM

@leggewie leggewie merged commit 63ef82d into armbian:main Aug 21, 2025
1 check passed
@tabrisnet tabrisnet deleted the tabrisnet_bpir4_SFP branch August 21, 2025 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

4 participants