Skip to content

fb, kboot: Faster framebuffer copy and quieter DCP handoff - #60

Merged
RyanTheTide merged 3 commits into
aurora-wipfrom
perf/stage2-fast-handoff
Oct 29, 2026
Merged

RyanTheTide merged 3 commits into
aurora-wipfrom
perf/stage2-fast-handoff

Conversation

@RyanTheTide

Copy link
Copy Markdown
Collaborator

Two changes that shorten the m1n1 part of every boot. Both apply to all SoCs.

Framebuffer copy

  • fb_init() keeps what is on screen by copying the boot framebuffer into its shadow buffer. It mapped the framebuffer non-cacheable first and then read all of it through that mapping. On the J616s panel (3456x2234) that is 30 MB of uncached reads, and it took 1.28 s in Stage 1 and again in the ESP Stage 2.
  • The copy now goes through a short-lived cacheable mapping of the framebuffer. The framebuffer's cache lines are invalidated before and after the copy, and the mapping is then switched to non-cacheable as before, so later writes still go straight to the screen.

DCP handoff output

  • A display handoff that went as expected printed about a hundred lines (every DART stream register, segment and mapping summary). Those details now go through dprintf, so only DEBUG builds print them. Warnings, failures, the power and CPU state lines and the one-line result of each handoff are unchanged.

Testing on the J616s

  • An ESP Stage 2 built from 1bf9ec5 plus these two commits, against the same tree built without them, both timed from a VDM reset with host timestamps on the KIS console.
  • Stage 2's framebuffer init went from 1.28 s to 0.05 s. The DCP handoff output went from 0.58 s to 0.12 s. Stage 2 handed over to U-Boot 1.65 s earlier.
  • The kernel started 2.85 s earlier in that pair of boots. Part of that falls in U-Boot and GRUB, which these images do not log, so treat it as one sample.
  • The panel came up normally (eDP connected, GDM running), and the DCP handoff was published as before.
  • Builds with RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1, with the default flags and with CFG=DEBUG, with no new warnings.
  • Stage 1 gets the same framebuffer saving once it is rebuilt, but that needs a Stage 1 install and has not been tried.

🤖 Generated with Claude Code

RyanTheTide and others added 3 commits October 29, 2026 04:42
fb_init() keeps what is on screen by copying the framebuffer into its
shadow buffer. It mapped the framebuffer non-cacheable first and then
read all of it through that mapping. On a 3456x2234 panel that is 30 MB
of uncached reads, which took 1.28 s on the J616s, once in Stage 1 and
again in the ESP Stage 2.

Map the framebuffer cacheable for the copy, then switch it to
non-cacheable as before. Nothing holds a cached copy of the framebuffer
at this point, and the lines the copy brings in are invalidated before
the mapping changes, so later writes still reach the screen directly.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A display handoff that goes as expected printed every dart-dcp and
dart-disp0 stream register, each firmware segment, each stream's mapping
summary, the __OS_LOG reservations and the firmware image line. That is
about a hundred lines, and on the J616s boot console they took about a
second.

Print those details with dprintf, so they appear in DEBUG builds only.
Warnings, failures, the power and CPU state lines, and the one-line
result of each handoff are printed as before.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The handoff details now go through dprintf, which the host stand-in
utils.h did not define, so the T6041 host test picked up the libc
dprintf(int fd, ...) and failed to build. Define it as src/utils.h
does, and build the T6041 host as DEBUG so the scenarios still see
the details they check, such as an __OS_LOG inside a /memreserve/.

Full pytest: 316 passed, 36 skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide
RyanTheTide merged commit 82d0afb into aurora-wip Oct 29, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the perf/stage2-fast-handoff branch October 29, 2026 23:34
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