Repository navigation
integration/aurora-7.3: sync to v1.0.0b18 and carry aurora-silicon/aura#671 - #52
Merged
Merged
Conversation
aura is built with -Os -mstrict-align, so the byte-at-a-time loops in src/string.c compile to single-byte loads and stores. On J616s (T6040), kboot_prepare_dt() calls libfdt's fdt_splice() / memmove() on a ~192 KiB DTB over 100 times (~607 ms) and fb_init() copies the 30.9 MiB framebuffer (~70 ms) through these byte loops. Use aligned 64-bit (and 32-bit, matching libfdt's 4-byte property alignment) word loops with 4x unrolling for bulk copies, moves, fills, and comparisons while preserving strict alignment on every access. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
…e maintenance Enable SCTLR.I at _start and cpu_reset after invalidating the I-cache with ic iallu; with the MMU off, I-cache requires no page tables and speeds up relocation, apply_rela, pre-MMU page-table setup, and secondary CPU startup. Unroll .Lrun_base_copy to 64 bytes per iteration, skip the line-by-line dc cvac loop when D-cache is already off (stores reach PoC directly), and use ic iallu instead of per-line ic ivau loops in both start.S and chainload_asm.S. In chainload_asm.S, also skip dc cvac when the staged image is already in place (mmu_shutdown() has already cleaned D-cache). Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
During mmu_init() before SCTLR.M is set, mmu_add_mapping() issued a full dsb/tlbi/dsb/isb on every call even though mmu_configure() flushes the TLB once before enabling translation. Additionally, mmu_rm_mapping() allocated and zeroed new L1/L2/L3 page tables for address ranges that were not mapped yet (for example, mcc_unmap_carveouts() unmapping REGION_RWX_EL0/RW_EL0/RX_EL1 before those regions are populated), and mmu_pt_map_l3() performed an uncached read-back check in mmu_write_descriptor() on every 16 KiB page while the MMU was still off. Skip TLBI in mmu_add_mapping() while !mmu_active(), skip allocating empty tables when unmapping invalid entries, and write L3 PTEs directly while !mmu_active(). Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
In mmu_shutdown() and mmu_disable(), disable only SCTLR.{M,C} before
running dcsw_op_all(DCSW_OP_DCCISW) so the set/way flush loop still
executes from the instruction cache, then disable SCTLR.I and invalidate
the instruction cache.
Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
When unmapping an unaligned region (to == 0), mmu_map() incremented to by chunk after the leading L3 prefix. That made to non-zero and unaligned for the subsequent L2/L1 block checks, forcing large unmaps such as MCC carveout region-id-2 (600 MiB) to split every 32 MiB L2 block into L3 page tables uncached before MMU enable. Only advance to when PTE_VALID is set, matching mmu_pt_map_l1/l2/l3. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
…ndoff With I-cache enabled in cpu_reset, secondary CPUs complete early reset in well under 1 ms. Polling spin_table[index].flag every 50 us (keeping the same 100 ms timeout) avoids rounding every secondary core up to a 1 ms boundary. Clear SCTLR.I in smp_s2r_return_to_os() before branching to resume_pa so the S2R OS handoff preserves its documented MMU-and-caches-off contract. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
On high-resolution panels (e.g. 3456x2234 = 30.9 MiB), fb_blit() and fb_fill() copied the entire framebuffer into non-cacheable display RAM even when updating a 256x256 boot logo. Add fb_update_rows() to flush only the affected row range. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
When building for AArch64 with __ARM_FEATURE_CRC32 (guaranteed by -march=armv8.2-a), compute IEEE 802.3 CRC32 using crc32b/h/w/x instructions on general-purpose registers (safe under -mstrict-align and -mgeneral-regs-only). Keeps the portable nibble-table fallback when hardware CRC32 is unavailable. Speeds up tinf_crc32() by ~25x for gzip payload verification and AVE firmware segment checksumming. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
An HDMI laptop's first external display processor is a hybrid pipeline: it keeps the HDMI port's fixed output (its DP PHY, phy-names "dp-phy", and crossbar output, "dp-xbar", as on the M1 Pro/Max and the T6040) and is lent to a Type-C port while HDMI is idle. The route writer refused any node that named PHYs or crossbars, so such an engine could not also ask for its Type-C routes from the ADT. Accept exactly one dp-phy entry and at most one dp-xbar entry (with the PHY) before the routes, and write the typecN entries after them. The route indices (typec-mux-indices, typec-dptx-phys, route@N) still count the Type-C routes only. Anything else in phys or mux-controls is still the tree's own and gets no routes. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
An HDMI port's ATC on T6050 (atc-phy3 on the 14-inch M5 Pro/Max MacBook Pros) has no USB side: the ADT has no usb-drd3, and the tree describes the PHY as apple,t6050-dp-phy, the combo PHY driver's fixed four-lane DP mode. Its probe needs the nine tables the fixed DP sequence applies (AXI2AF, fabric, common config, LIOA, both lanes' RX clock and RX EQ, AUSPLL); only apple,t6050-combo-phy nodes got any. Export those nine for apple,t6050-dp-phy nodes from atc-phyN, all or nothing, by the same register checks; a combo PHY still needs its usb-drdN and takes all fourteen. The port is the node's apple,port-index, so nothing depends on the board. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
…ge2-boot-wdt main: an ESP Stage 2 keeps the boot watchdog until its hand-off
proxyclient: macOS with SPTM under the classic hypervisor on the M1 series
…ase-pstate kboot: gpu: accept T6041 gpu-perf-base-pstate in valid range
…less-dcp-handoff kboot: T6041: hand headless internal DCP over when DT marks a sleep host
kboot: G17: fill the GPU's SRAM voltages from perf-states-sram
…pu-dart-filter dapf: program the M1 encoder's CPU DART filter
Stage 1's .init ended 36 bytes under the 2 KiB step that .text starts on. The fixed DP PHY pass grew t6050_setup_atc() by 92 bytes, which moved .text up a whole step: the gcc stage1-size job dropped from main's 3,696 B of headroom to 1,648 B. Put t6050_setup_atc() and t6050_export_atc() in .rodata.xtext (AURA_XTEXT in types.h, made for code with no room left in .text or .init), as the display route writer already is. No behaviour change. Stage 1 room (tools/stage1_size.sh), stage1 flavour: - gcc (Ubuntu 24.04 cross, as CI): 3,696 B, the same as main ca83398 (1,648 B without this commit); - host clang (USE_CLANG=1 BUILDSTD=1): 5,800 B (main 3,744 B). Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
A TAS5770L group that fails ADT validation was left as it was, so speaker-config rows already present in the DT (from the packaged DTB or an earlier stage) survived next to a rejected group. Linux checks only the rows' shape and range, so those rows could open the speakers with a gain that did not come from this Mac's ADT. Delete apple,speaker-config from every ti,tas5770l node first, then apply the ADT. A rejected or absent group now reaches the kernel with no rows, and the kernel keeps the speakers closed. SN012776 handling is unchanged. The host test gains the rejected-member and no-group cases with pre-populated rows; all 45 scenarios pass.
AURA_S2R_DCP_PKT copies 128 input and 56 output bytes per packet, too few for the swap and EDR calls (the swap record runs past 0x6e0). Add host knobs: AURA_S2R_DCP_PKT_MAX (head bytes per packet), AURA_S2R_DCP_PKT_FULL (up to 4 tags copied whole, input and output), AURA_S2R_DCP_PKT_FULLMAX (bytes each way for those, default 4096) and AURA_S2R_DCP_PKT_EVERY (one in N of each such tag, so a 120 Hz swap does not fill the ring). Defaults keep the old behaviour. tools/auractl/dcp_pkt_decode.py turns the CPKT records of an auractl dump into one line per packet plus per-packet .bin files.
T6050's DCP DARTs have sid-count 32 and the DCP's stream is sid 23
(K114s ADT dart-dcp: sid = 23, pt-region-23). The walk only tried
sids 0-15, so every shared-memory lookup failed ('dcp-pkt dva ...
not found (walkable sids 0x0)' in every K114s guest session) and no
packet was ever copied there. Read sid-count (up to 32) and sid from
the DART node; walk the DCP's own sid first. Others keep 16.
Run the real USB initialization and CDC scheduling functions together so a refused schedule, skipped fallback or missing watchdog fails the host test. Keep the hardware timer and watchdog at the test boundary. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
The M5 Pro driver took every part's GPU voltages from its board's table. They are per part: on the K116s the ADT differs from the J714 table at 13 of 14 main states and 5 CS/AFR states. Where the DT gives the GPU node operating-point tables (operating- points-v2 with one core and one SRAM cell per voltage table, apple,afr-opp, apple,cs-opp, apple,csafr-min-sram-microvolt), fill them in place from sgx perf-states and perf-states-sram (two tables), afr-perf-states and cs-perf-states (one die) and their SRAM floor. Linux keeps its board's states and takes these voltages where every frequency is its own. The shapes of the ADT properties and of every DT table are checked before the first write; anything that does not fit leaves the DT as it is and the driver on its board tables. A DT without the tables is left alone. Linux checks every state and voltage against its board's. It is in Stage 2 only, as the SRAM fill next to it: Stage 1 has little room left with some toolchains, and on these Macs it loads the ESP's Stage 2, which boots Linux. The two T6031 host tests that build kboot_gpu.c now give it an empty build_cfg.h, as the G15 one does. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Upgrade dt_set_gpu_t6041() from handoff version 1 to version 2
(apple,t6041-handoff-version = 2) using the live-verified J616C efuse
layout on 0x508374000, matching the unified T6040/T6041 calibration
contract in Linux:
- Read the six efuse words at 0x508374000 + {0xc10, 0xc14, 0xc1c,
0xc20, 0xc24, 0xc28} via guarded t6040_read32() before powering
/arm-io/sgx: four packed 14-bit cluster core leakage fields across
0xc10..0xc14 (bits 1..56, (raw + 1) * 1.5), shared 10-bit SRAM across
0xc20..0xc24 (bits 24..33, (raw + 1) * 3.0, replicated across all
four clusters), 13-bit CS at 0xc1c (bits 9..21, raw + 1), and 12-bit
AFR at 0xc28 (bits 4..15, (raw + 1) * 1.5).
- Reject efuse faults, unprogrammed zero or saturated all-ones raw
fields, and out-of-range binary32 leakage words before SGX is
powered.
- Generalize t6040_cs_mw() into t604x_cs_mw(..., cs_dyn_bits) and
compute the four-cluster power ladder and relative-A table with the
T6040 cluster power model and T6041 CS dynamic coefficient
(T6041_D_CS_DYN = 11.263f, matching both 40-core J575C 129,702 mW and
32-core J616C 113,169 mW). Enforce monotonicity and the 250,000 mW
T6041 power ceiling, and publish apple,core-leak-coef,
apple,sram-leak-coef, apple,cs-leak-coef, apple,afr-leak-coef,
apple,perf-relative-a, and apple,max-power-mw before writing the six
reserved-memory regions and apple,t6041-handoff-version = 2 last.
- Mark dt_set_gpu_t6041() noinline so its stack frame stays out of
dt_set_gpu() alongside the other per-SoC fill paths.
- Omit the T6041 GPU calibration fill from Stage 1 chainloader builds
(defined(CHAINLOADING) && !defined(ESP_STAGE2), matching G17_FILL_SRAM)
and instead fail closed by stripping any stale handoff version and
leaving an enabled apple,agx-t6041 GPU node disabled. Stage 1 only
chains Stage 2, and keeping the T6041 fill in Stage 2 / standalone
builds preserves >4 KiB Stage 1 headroom below the DCP log buffer.
- Expand tests/python/test_t6041_gpu_fill.py (73 plain + 73 ESP_STAGE2
+ 3 Stage 1 checks) covering the live J616C efuse capture, the
40-core measured leakage reference, efuse fault/zero/saturated
refusal before SGX power, stale version cleanup, non-monotonic /
over-ceiling power refusal, and Stage 1 fail-closed behavior.
Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
The kernel adopts an M4 Mac's external display DARTs when their dcpext node carries apple,t8132-dcpext-firmware-ready, which Stage 2 sets only for a controller it handed over. The internal display DARTs have no such handoff, so the kernel still keys their adoption on the DCP firmware version (26.6.2 only, apple_dart_dcp_firmware()). Once the internal DCP's firmware memory is reserved, mark its dcp node apple,t8132-dcp-firmware-ready = <1>, so the kernel can key the adoption on this handoff instead of on a version. A firmware-27 DCP is marked only when the inherited display maps and apple,clock-ids both went out: without them it faults on its DART. A stale mark is always withdrawn first. A mark that cannot be written leaves the kernel gate closed and does not fail the handoff or the external DCPs that follow it. No kernel reads the property yet, so this changes nothing at runtime until the Linux side (aurora-silicon/linux#2621) consumes it. Closes: aurora-silicon/aura#462 Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On J473 (T8112) every IOMFB shared-memory lookup failed: 'dcp-pkt dva 0x80003c000 not found (walkable sids 0x20)'. dart-dcp's vm-base there is 0x800000000 and the DVA already fits the walk's 36-bit IOVA, but the vm-base was subtracted and 0x3c000 walked. Subtract it only for a DVA past the walk's width (T6050 0x100000xx000, J613 0x1000003c000).
No functional change.
Review of the first version: the firmware-27 mark tested for the presence of apple,clock-ids, so a property the tree already carried (empty or not), or one left behind by a failed publication, could mark a DCP whose clocks this pass never published. A stale marker could also survive an early exit of the handoff. Withdraw the marker right after the target check, before any early exit, and mark only at the end. On firmware 27, count the clocks only when this pass published them: the node had no apple,clock-ids before, the publication returned 0, and the property is there after it. The host test now stubs dt_set_dcp_fw27_clocks() with its real early-return contract and covers stale clocks (pair and empty), failed publications with stale clocks and a stale marker, no maps, early exits, and checks that the clear comes before every early exit of dt_set_m4_dcp_handoff(). Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
K114s (T6050) guest 11-29: sids 23 and 24 walk, yet no IOMFB DVA (0x1000004c000, ...) is found. Print each walkable sid's mapped page count and IOVA range against the IOVA looked for, so the next session shows where the shared memory really sits.
On M1 Mac mini (J274, T8103) running macOS 27.2.1 firmware, /arm-io/dcp
drives HDMI directly (display_is_external = true, display_is_dptx = false)
over an AFKv2 disp0-service iBoot interface. Once the display has been
powered on and modeset, rtkit_sleep() times out waiting for the AP power
transition ("rtkit(dcp): AP power transition timed out"), leaving
dcp_running = true so subsequent handoff fails ("Display handoff failed;
returning to proxy") — the same 27.2 firmware behaviour handled for
AFKv2 dptx-port controllers in AsahiLinux#451.
Without a connected display (headless, connected:0), display_configure()
returns before powering on the display and rtkit_sleep() still succeeds
in <1 ms, so the headless path keeps sleeping the DCP.
Add dcp_ib_is_afkv2() and generalize display_dptx_hands_on() into
display_dcp_hands_on() so a lit external AFKv2 display is handed on
running via dcp_hand_on() and published to Linux through
apple,rtkit-handoff ("dcp-live-v1"). Evaluate display_dcp_hands_on()
before dcp_ib_shutdown() frees iboot.
Tested:
- J274 (M1 Mac mini, T8103, macOS 27.2.1 main OS):
- Cold boot with HDMI (1920x1200@60) plugged in via enrolled Stage 1:
modeset succeeded, "display: handing the DCP on running (external
AFKv2 display)", published live RTKit session v12 (3 buffers,
epmap 0000051f 00821fff), Linux 7.3.0 apple-dcp adopted dcp-live-v1
seamlessly (fb0 appledrmfb, 1920x1200@60, 0 DART faults, 0 failed
units).
- Headless boot (HDMI unplugged) on patched Stage 2: connected:0,
slept DCP cleanly in 0.4 ms ("pmgr: resetting device 0.DISP0_CPU0").
- Host: clang-format clean, Stage 1 builds cleanly (12,296 B headroom,
no __TEXT_BOOT_EXEC), Stage 2 ESP build links cleanly, full pytest
tests/python: 1251 passed, 26 skipped.
Risk: low — only applies to external displays on an AFKv2 iBoot
interface after power-on; headless external boots, AFKv1 (13.5) external
displays, internal panels, and existing AFKv2 dptx-port displays keep
their previous behaviour.
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
K114s (T6050) guest dh2: sid 23's top table holds a single entry at index 16 and the two-level walk read it as IOVA 0x20000000; the shared memory is at DVA 0x1000007c000, whose bits 46:36 are 16. So T6050's dart-dcp (vm-size 3 TB) is a three-level table: 64 GiB top entries, then 32 MiB and 16 KiB. For a DVA at or past 2^36 look each page up through the three levels first, the DCP's own sid first; the two-level walk stays for everything else.
…oard-gate kboot: admit the T6031/T6034/T6040/T6041 display handoff by the ADT, not by board
kboot: hand the M4 panel's PIODMA over where the tree names PIODMA
dcp: dptx: answer link fault reports and tiled hints the same on every chip
j873: key the USB, apcie and N1 setup on the ADT, not the board id
Signed-off-by: Satya Benson <satya@benson.earth>
…ute-adt display: choose the HDMI port's engine from the ADT
…mi-smc dcp: pick the DP-to-HDMI power path from the ADT function encoding
…l-shutdown nvme: post-M4: shut the controller down normally before ANS goes off
…t-route-handoff kboot: test ADT routes through the DCPEXT handoff
kboot: pass the CLPC's Low Power mode power target
…slog rtkit: answer OSLog on the legacy mailbox and echo its channel-zero counter
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On macOS, stdint.h defines uint64_t as unsigned long long, which fails -Werror,-Wformat against src/j873.c printf %lx format specifiers on u64 addresses. Match aura freestanding LP64 and the other host tests (test_dart_tunables.py, rtkit_boot_host/stubs.h) by typedefing u64 as unsigned long in the stub types.h. Signed-off-by: Satya Benson <satya@benson.earth>
…acos-u64 tests: j873: typedef u64 as unsigned long in host stub
The ADT HDMI routing added in AsahiLinux#590 pushed the GCC ESP Stage 2 below the 4096-byte floor on Ubuntu 24.04. GNU ld 2.42 leaves the relative relocations unpacked, so the linked image is particularly tight. Use fat LTO for the ESP Stage 2 Rust build to reduce the amount of linked code. GCC 13 with GNU ld 2.42 on Mini goes from 2712 to 4840 bytes of headroom. The Stage 1 build keeps its existing profile. Signed-off-by: DjDeveloperr <hey@djdev.me>
tests: t6050: drop duplicate check cases and source-text scrapes
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
…headroom build: recover ESP Stage 2 room with Rust fat LTO
…obs-20261201 ci: start fewer jobs per pull request
…oxy-carrier tests: exercise the Neo USB proxy schedule and watchdog
Prepare Aura 1.0.0b18
Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Confidence Score: 5/5
[High impact] No confirmed issue blocks merging this upstream sync and carry-list update. SummaryUpdates the integration branch to
No actionable regression was confirmed. This review used source and history checks; no builds, tests, or hardware boots were run.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Syncs
omacom/m1n1integration/aurora-7.3fromv1.0.0b17(5a244b5bcbaf) tov1.0.0b18(16648d690ed9738673a8fe064a9e188b83fe82bb) and alignscarry.tomlwith the six carries oncarry/edgeB5-7.3(bddf45414bcf6b0245da67db8477ef111ad3df29), including upstream PR aurora-silicon/aura#671.What changes
v1.0.0b18(16648d690ed9738673a8fe064a9e188b83fe82bb) intointegration/aurora-7.3(0 conflicts).carry.toml:[upstream].intaketo16648d690ed9738673a8fe064a9e188b83fe82bb(v1.0.0b18).b18), aurora-silicon/aura#293 (merged as42243c6b8faf, inb18), and aurora-silicon/aura#550 (merged as1f77cab45647, inb18).v1.0.0b18carries fromcarry/edgeB4-7.3(aurora-silicon/aura#6476a55fe50da5f, aurora-silicon/aura#2925e8f191931ab, aurora-silicon/aura#29131a9f79ef045, aurora-silicon/aura#648670378120204,oursm3-max-gpu-defaults3f0fcc9d55cb) plus aurora-silicon/aura#671 (bddf45414bcf, withholding/chosen/aurora,s2r-mailboxand recording/chosen/aurora,s2r-unavailableon raw boots of execute-window chips).carry-input/tags pushed toomacom/m1n1for all six entries (carry-input/aura-647-6a55fe50da5f,carry-input/aura-292-5e8f191931ab,carry-input/aura-291-31a9f79ef045,carry-input/aura-648-670378120204,carry-input/ours-3f0fcc9d55cb,carry-input/aura-671-bddf45414bcf).Packaged in omacom/omarchy-pkgs#4712 (
aura 1.0.0b18.r20261203-2, published toedge/aarch64).Verification
carry/edgeB5-7.3(bddf45414bcf) is the exact 6-commit linear chain on top ofv1.0.0b18(16648d690ed9, tree8e9db5380fb6837ee1734f4cd0f69e2545d65841).carry/edgeB5-7.3(test_s2r_mailbox_gate.py+ctxr_exec/mmu/smptests): 92/92 passed.