Skip to content

kboot: accept the hyphenated usb4-N-pcie alias for PCIe-C tunables - #302

Open
sithglan wants to merge 2 commits into
aurora-silicon:mainfrom
sithglan:thomas/usb4-pcie-alias
Open

sithglan wants to merge 2 commits into
aurora-silicon:mainfrom
sithglan:thomas/usb4-pcie-alias

Conversation

@sithglan

Copy link
Copy Markdown
Contributor

The device tree checks reject aliases containing _. 372e69a ("kboot: Use new ACIO aliases") made the ACIO, PCIe adapter and NHI lookups fall back to the hyphenated names, but dt_set_pcie_tunables() still looks only for usb4_N_pcie. A board that names its PCIe-C node usb4-N-pcie gets no PCIe-C tunables.

This came up on the J813's rear USB4 port, aurora-silicon/linux#2142. Its DT needs the underscored alias for these tunables, and dt-checks fails on it as a new warning. With this change the DT can use usb4-1-pcie.

Change

  • Try usb4_N_pcie first, then usb4-N-pcie, the same way as the other three lookups. Existing device trees with the underscored alias are unaffected.
  • test_usb4_alias_fallback.py gets a second test. It runs the production dt_set_pcie_tunables() against real FDTs with only the hyphenated alias, with both spellings, and with only the underscored one, and records which alias each dt_copy_pciec_tunables() call receives. The test fails on main, at the hyphen-only case, and passes with this change.

Checks

  • Built with clang 22 (USE_CLANG=1 BUILDSTD=1).
  • clang-format --dry-run --Werror src/kboot.c is clean.
  • tools/stage1_size.sh clang: stage1 headroom is 17968 B before and after, and the other flavours are unchanged too.
  • pytest tests/python: 744 passed, 29 skipped, 3 failed. The same 3 fail on main 3d517e6 in this environment: test_dcp_iboot_wire, test_external_dependency_group and test_xnuboot_layout.

cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

The device tree checks reject aliases with '_'. 372e69a ("kboot: Use new
ACIO aliases") let the ACIO, PCIe adapter and NHI lookups fall back to the
hyphenated spelling, but dt_set_pcie_tunables() still looks only for
usb4_N_pcie. A board that names its PCIe-C node usb4-N-pcie, as the J813's
rear USB4 port wants to, gets no PCIe-C tunables.

Fall back to usb4-N-pcie the same way. The underscored alias stays first,
so existing device trees are unaffected. The test runs the production
function against real FDTs with either spelling, both, and the old one.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
sithglan added a commit to sithglan/aurora-linux that referenced this pull request Nov 18, 2026
Describe ACIO1, its mailbox and LSTX pin, and the PCIe-C tunnel.
Populate both DARTs under their powered parents. Use connector port 4 so
the existing DisplayPort alternate-mode route can retain port 3. Name the
PCIe-C tunable alias usb4-1-pcie, as t6040-usb4.dtsi does; aura looks it
up under that spelling since aurora-silicon/aura#302.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan

Copy link
Copy Markdown
Contributor Author

This also affects a board in integration/aurora today: t6040-usb4.dtsi already names its PCIe-C nodes usb4-N-pcie, so aura main copies no PCIe-C tunables for them (dt_copy_pciec_tunables() bails with "Unable to find alias usb4_N_pcie"). With this change they get them. The J813 side is aurora-silicon/linux#2142, now on usb4-1-pcie with dt-checks clean.

@RyanTheTide

Copy link
Copy Markdown
Contributor

J616s (T6040) row with this PR stacked on current main, as an aura-try Stage 2 trial on the production kernel: the production Stage 2 logs FDT: Unable to find alias usb4_{0,1,2}_pcie three times and the DT carries 13 PCIe apple,tunable* properties; with this change those lines are gone and the DT carries 25. Same boot: Enforcing, 0 kernel errors, 14/14 CPUs, s2idle 3/3, encodes identical to production, 0 DART faults, no new kernel error lines.

sithglan added a commit to sithglan/aurora-linux that referenced this pull request Nov 19, 2026
Describe ACIO1, its mailbox and LSTX pin, and the PCIe-C tunnel.
Populate both DARTs under their powered parents. Use connector port 4 so
the existing DisplayPort alternate-mode route can retain port 3. Name the
PCIe-C tunable alias usb4-1-pcie, as t6040-usb4.dtsi does; aura looks it
up under that spelling since aurora-silicon/aura#302.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants