Skip to content

kboot: t6050: check external engine placement before handing it over - #471

Draft
RyanTheTide wants to merge 1 commit into
mainfrom
kboot/t6050-ext-placement
Draft

RyanTheTide wants to merge 1 commit into
mainfrom
kboot/t6050-ext-placement

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

t6050_ext_one() hands an external T6050 display engine over after checking that its DARTs are locked on the ADT's l1-tt roots, but it does not check where the engine's firmware segments and DART page tables lie. The internal display only gets handed over when its segments are outside the RAM the OS receives. The headless path also checks /vram only against existing reservations, not against that RAM range.

Change

  • t6050_check_placement() takes the segment check out of t6050_check_adt(), parameterised by the nub path and a list of DART streams. For each stream it also requires the DART's pt-region-<sid> to be page-aligned, to contain that stream's l1-tt root page and to lie outside [phys_base, +mem_size). The internal display passes no streams, so its behaviour is unchanged.
  • t6050_ext_one() runs it on iop-dcpextN-nub with SID 23 of dart-dcpextN and SID 16 of dart-dispextN before enabling anything. An engine that fails stays with iBoot, like on its other checks; on a headless board the display handoff is refused.
  • t6050_headless_check() also refuses a /vram that overlaps the OS's RAM, as t6050_check_adt() already does for the internal display.

No new options or board conditions; everything is read from the ADT.

Testing

  • kboot_display_handoff.c compiles cleanly with the Makefile's flags under aarch64-linux-gnu-gcc and clang; clang-format clean.
  • tests/run-t8122-display-handoff.sh and the t6041 / t6041-27 / dcp6_max_brightness pytest cases still pass.
  • No host fixture models T6050 yet (tests/t8122_display_host/t6050_unmodelled.h aborts there), so there is no new unit test.

Still to run

  • Boot rows on T6050 boards with external engines (J775D and a J714s-class machine): display comes up as before, and the log shows the placement check passing. Draft until then, because a board whose ADT lacks pt-region-23/-16 on its dcpext DARTs would now keep that engine with iBoot.
  • Full image link (image-size limit) through CI.

The internal DCP is handed over only if its firmware segments (but
__OS_LOG, which is reserved on its own) lie outside the RAM the OS gets
[phys_base, +mem_size). t6050_ext_one() hands an external engine over
after checking that its DARTs are locked on the ADT's l1-tt roots, but
it never checks where the engine's firmware and page tables live, and
the headless path checks /vram only against existing reservations.

Factor the segment check of t6050_check_adt() into
t6050_check_placement(), parameterised by the nub path and a list of
DART streams. For each stream it also requires the DART's ADT
pt-region-<sid> to be page-aligned, to hold the stream's l1-tt root
page and to lie outside the OS's RAM. The internal DCP passes no
streams, so its checks are unchanged.

t6050_ext_one() runs it on iop-dcpextN-nub with SID 23 of
dart-dcpextN and SID 16 of dart-dispextN before it looks at anything
else; an engine that fails stays with iBoot, as on its other checks
(headless: the display handoff is refused). t6050_headless_check() now
also refuses a /vram that overlaps the OS's RAM, as t6050_check_adt()
does for the internal display.

Reported-by: erikwb <169195+erikwb@users.noreply.github.com>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at d753e35 (non-author, draft). No blocker; it waits on the T6050 external-engine boot rows, as listed.

  • The segment check is moved, not changed: the internal display path calls t6050_check_placement(DCP6_NUB, NULL, NULL, 0, ...) with the same bounds on segment-ranges, the same 16K rounding, the same __OS_LOG exception and the same /vram is a DCP segment result.
  • pt-region-<sid> is read as [lo, hi), the same convention dart.c (region[1] - region[0]) and the stream check at line ~2009 (l1 + DART_PAGE > pt_hi) use, so the new "holds the l1-tt root" test agrees with what the lock check later requires. hi <= lo is refused before hi - DART_PAGE, so it cannot wrap.
  • In t6050_ext_one() the check runs on the nub path still in a before a is reused for /arm-io/dcpextN, and before anything is enabled; a failing engine is left disabled, like the other checks there.
  • The headless /vram overlap check matches what the internal path already enforced.
  • Everything is read from the ADT; no new options or board conditions.

Small points, not blocking:

  • l1-tt-<sid> is read as (l1, count) but only the first root page is tested against pt-region. If a stream ever has more than one L1 page, l1 + count * DART_PAGE <= hi would cover all of them.
  • As you note, an ADT without pt-region-23/-16 on a dcpext DART now keeps that engine with iBoot; the boot log line names the DART and property, which is what a row needs to tell that case from a real overlap.

Assisted-by: LLM (Claude:Opus 5.5)

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