Skip to content

kboot: Pass the AOP motion sensor calibration to the OS - #61

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
feat/aop-motion-cal-20261031
Oct 31, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
feat/aop-motion-cal-20261031

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Companion to aurora-silicon/linux#680 (AOP accelerometer and gyroscope). The accelerometer and gyroscope report only once the OS has sent them the machine's calibration. iBoot leaves it in the ADT under /arm-io/aop/iop-aop-nub/accel and gyro.

This copies {accel,gyro}-range-intr-cal, -nominal-extr-cal and -range-extr-cal into the OS AOP node's accel and gyro children, as apple,range-intrinsic-cal, apple,nominal-extrinsic-cal and apple,range-extrinsic-cal. It's the same pattern as the Wi-Fi and multitouch calibration. It runs for T6040, T6041 and T8132, and skips any missing service or property.

Based on Eryk Wieliczko's J713 work (dirtyroom-linux 63e6467a). @erykwieliczko, please review.

Testing

  • make RELEASE=1 builds clean, with no new warnings in kboot.c.
  • git clang-format reports no changes.
  • make RELEASE=1 CHAINLOADING=1 fails at the m1n1-raw.elf link ("File part reaches the DCP log buffer after stage 1!"). That happens on the aurora-wip base without this change too.
  • Not booted yet. On the J616s, expect FDT: /aop@510600000/accel: 3 of 3 calibration properties, and the same for gyro.

Notes

On J713 the kernel gets its tree through U-Boot's importer, so the properties will also need importing there once the J713 nodes exist.

🤖 Generated with Claude Code

The AOP accelerometer and gyroscope report only once the OS has sent them
the machine's calibration, which iBoot leaves in the ADT services
/arm-io/aop/iop-aop-nub/accel and gyro. Copy their range intrinsic,
nominal extrinsic and range extrinsic properties into the accel and gyro
children of the OS AOP node, as apple,range-intrinsic-cal,
apple,nominal-extrinsic-cal and apple,range-extrinsic-cal, on T6040,
T6041 and T8132. A missing service or property is skipped.

Based on Eryk Wieliczko's J713 work (dirtyroom-linux 63e6467a).

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide merged commit b6b4592 into aurora-wip Oct 31, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the feat/aop-motion-cal-20261031 branch October 31, 2026 12:00
dmitzsaz pushed a commit to dmitzsaz/aura that referenced this pull request Nov 6, 2026
The AOP accelerometer and gyroscope take the machine's calibration from
the OS, as three per-sensor packets. Copy the accel and gyro
calibration properties from the ADT AOP services into the matching
children of the OS AOP node, where the OS driver reads them. A missing
service or property is skipped.

Ported from aurora-silicon/m1n1#61.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
rolotrealanis98 added a commit to rolotrealanis98/m1n1 that referenced this pull request Nov 7, 2026
Port Aura's measured T6050 GP-port bring-up (aurora-silicon/aura PR
aurora-silicon#60/aurora-silicon#61, src/pcie_t6050.c, Jeff Queisser) to the J716s N1 on apcie0
port 0: the GP power closure and the shared GP PHY (stages A and S, only
while no GP port has a link), then the port's reset table, config
tunables, reset handshake, Gen3 x1 DBI policy, lane PHY, PERST# and
LTSSM (B-E), the bus numbers and the endpoint's ID (F, 106b:1900 or
1901) and Linux's adoption preconditions (G). Every address comes from
the ADT (apcie0 reg[16..21], pci-bridge0, gpio0, dart-apcie0).

Storage (ANS, NVMe, its SART and power) is compared with a reference
before and after each stage that touches shared state. A failed check
before the training only refuses it; a change after a stage returns
N1_STORAGE_LOST, and kboot_setup_n1() then resets the SoC through the
watchdog after 15 s instead of booting a kernel that may not mount its
root. Any other stop leaves port 0 and its DART disabled, even if the
link came up (a stage G failure).

It only runs when the payload sets chosen.asahi,t6050-n1=1; =2 also
writes the N1's reset release through the SMC first (pci-bridge0
function-reset: pKW4 "gP13", template 0x00800000, written as
template | 1). adt_getprop_copy() returns the copied length, so the
function-reset descriptor is taken only when the whole descriptor was
copied.

Adds pmgr_psreg_by_name(), and makes pmgr_power_is_on() skip virtual
devices: T6050 has a no_ps APCIE_PHY_SW beside the real one. Adds
tunables_check_local_addr() (Aura's read-back with per-record strobe
bits excused) and kboot_get_chosen().

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
Assisted-by: LLM Claude
rolotrealanis98 added a commit to rolotrealanis98/m1n1 that referenced this pull request Nov 8, 2026
Port Aura's measured T6050 GP-port bring-up (aurora-silicon/aura PR
aurora-silicon#60/aurora-silicon#61, src/pcie_t6050.c, Jeff Queisser) to the J716s N1 on apcie0
port 0: the GP power closure and the shared GP PHY (stages A and S, only
while no GP port has a link), then the port's reset table, config
tunables, reset handshake, Gen3 x1 DBI policy, lane PHY, PERST# and
LTSSM (B-E), the bus numbers and the endpoint's ID (F, 106b:1900 or
1901) and Linux's adoption preconditions (G). Every address comes from
the ADT (apcie0 reg[16..21], pci-bridge0, gpio0, dart-apcie0).

Storage (ANS, NVMe, its SART and power) is compared with a reference
before and after each stage that touches shared state. A failed check
before the training only refuses it; a change after a stage, or after
a stage that stopped partway (checked again on every stop once the
reference is taken), returns N1_STORAGE_LOST, and kboot_setup_n1() then resets the SoC through the
watchdog after 15 s instead of booting a kernel that may not mount its
root. Any other stop leaves port 0 and its DART disabled, even if the
link came up (a stage G failure).

It only runs when the payload sets chosen.asahi,t6050-n1=1; =2 also
writes the N1's reset release through the SMC first (pci-bridge0
function-reset: pKW4 "gP13", template 0x00800000, written as
template | 1). adt_getprop_copy() returns the copied length, so the
function-reset descriptor is taken only when the whole descriptor was
copied.

Adds pmgr_psreg_by_name(), and makes pmgr_power_is_on() skip virtual
devices: T6050 has a no_ps APCIE_PHY_SW beside the real one. Adds
tunables_check_local_addr() (Aura's read-back with per-record strobe
bits excused), and kboot_get_chosen(), kboot_chosen_param() for the
other kboot files.

Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
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.

1 participant