Repository navigation
Conversation
|
Reproduced on a second J81 (iPad5,3), RAM boot by the palera1n route, 4 Dec 2026. Setup
Results (E)
Build note: 🤖 Generated with Claude Code |
bb3ca6c to
0ea92de
Compare
|
One more datapoint from our J81, with low confidence, so take it as an observation only. We built #165 +
🤖 Generated with Claude Code |
|
Thank you, Martin, this is a big and careful piece of work: the A8X GPU booting its own firmware, with the layout picked by the firmware's hash and the bridge settings from the device tree, is a real step for the iPad Air 2. We'd like to merge it, and a few things need to change first. None of them is a redesign; most are small. Kernel code
Device tree and binding
Firmware and boot loader
Commits
Other GPUs and mesa
When these are in, push to this branch and we'll take it from there. Thanks again! |
The A8 path writes the firmware's boot objects (INIT, PLATFORM, CONTROL) at offsets that were literals in t7000_init_build(). They belong to one firmware build (AGXG4P 133.6 from iOS 12.4); the A8X's AGXG4G from iPadOS 15.8 has the same rings, events, slots and MMU but its INIT, PLATFORM and CONTROL objects are laid out differently. Collect the offsets t7000_init_build() uses into struct t7000_fw_layout, add the one entry the driver has (t7000_fw_g4p_b0, every value the old literal) and point both A8-path variants (A8 and A7) at it. No functional change: every offset written is the value that was there before. Later patches add the A8X's firmware as a second entry. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
Hash the LDR file the user supplied and take the firmware layout of the entry that lists that SHA-256. Orchard's recipes produce four different files for the A8 and the A7 (per device and restore image), all of which run the A8's layout, so the A8 entry lists their hashes. A file nobody listed still gets the A8's layout, with a warning, as every file did before the table; an entry without that default (later entries) refuses the probe with -ENODEV when its file is not the one supplied. DRM_POWERVR_APPLE selects CRYPTO_LIB_SHA256 for sha256(). Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
… on the A9 writers The A8X firmware (AGXG4G, iPadOS 15.8.5 19H394) has the A9 builder's INIT, CONTROL and POLICY offsets; only PLATFORM differs and is shorter (0x318 bytes, no mV table or chip info). Add the 19H394 layout entry (selected by the LDR's SHA-256, no fallback), an A8-shaped PLATFORM hook (t7001_init_chip()), the PLATFORM flag words as a per-layout table, and a provisional A8X variant and SoC entry. Image size, core memory and the ring-lane size are placeholders until the next patch. Compile-checked only; not run on hardware. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
…DR records The load records of the A8X LDR give the four segments, the core memory, the image size and the handover offset (segment = address bits 29-30, laid out in the order 2, 0, 1, 3, then core memory; core-memory ZEROMEMs skipped), as the firmware's own loader computes them. Do it at probe for variants with ldr_layout set instead of keeping a table of numbers. The ring-lane size cannot be derived and stays open. Compile-checked only. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
The A8X's GPU (GXA6850, Apple's G4G) is the A8's family with eight clusters and
a newer firmware. Its node has the A8's four register regions, no power domain (the
driver switches ps_gfx itself after its PMGR stores, as on the A8), five interrupts (AIC 134-138, the last the
firmware's interrupt to the host) and the settings of its two bus bridges as
{offset, value} rows (apple,bridge-settings), so that the driver writes the
values of the device's own firmware and never the A8's. The boot loader adds
the rows from Apple's device tree, so a device tree source does not carry them
and the schema does not require them; the driver refuses to probe without
them. dt_binding_check was not run.
Assisted-by: LLM
Signed-off-by: Martin Puškáč <martin@icebear.sk>
…or the A8X
The A8 path writes one store and a table of 32 words (Apple's values for the A8's
bridges) after every GPU power-on. The A8X's firmware has its own settings, so
for variants with bridges_from_dt the driver writes the node's
apple,bridge-settings {offset, value} rows instead, and refuses a missing,
odd-sized or out-of-region list at probe. The A8's bridge_reg/bridge_val are no
longer set for the A8X. Compile-checked only; not run on hardware.
Assisted-by: LLM
Signed-off-by: Martin Puškáč <martin@icebear.sk>
pvr_apple_chip_t7001 is the A8's chip (the fields are shared through T7000_CHIP_COMMON) with its own firmware file, apple/gfx-t7001.bin, and the A8X variant. The core revision check accepts the A8X's 0x00070500, the chip info comes from the SoC data, the compatible is registered, and BVNC 7.5.8.3 (the J81's GXA6850) is listed as experimental, so the probe needs powervr.exp_hw_support=1 until a hardware run supports promoting it. Compile-checked only; not run on hardware. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
…81 bring-up proved The A8X needs PMGR stores before its GPU power state is switched on: two PLL words, five memory-controller bank enables, the clock gating enable and the SoC voltage manager enable (with its status poll). They run as the last step of the probe (variant hook prepare), after the firmware's hash and layout are accepted and while the GPU is off; a word that is neither the expected old value nor the new one refuses the probe before anything is written. The node has no power-domains (genpd would power the domain on at attach, before the probe), so the driver owns the power state as on the A8: t7000_boot switches it on and t7000_ps_set sets AUTO_PM_EN (bit 28). The A8's performance-record check is gated on a8_globals, which the A8X does not set; the A8X's border file is its own; jobs are refused until the A9-form records exist. Whether each PMGR store is needed was never ablated. Compile-checked only; not run on hardware. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
The A8's boot stream stores 0x200001 in SLC_CTRL_MISC; the A8X's firmware boots only with its own 64-bit word (0x0003550000300001, from the J81's firmware list). Make the word a per-SoC value (slc_misc) instead of a constant. The A8 keeps its value. Compile-checked only; not run on hardware. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
The A8X's GPU (apple,t7001-gpu): the Rogue core, Fender, the power manager and the bridges' register regions (the bridges region is 0xc1000 bytes: the second bridge's table is at +0xc0000), AIC 134-138 and the firmware name. No power-domains, as the A8's GPU: the driver switches ps_gfx itself after its PMGR stores. Disabled in the SoC file and enabled for the iPad Air 2 boards in t7001-air2.dtsi. The bridge settings are the device's: the loader adds apple,bridge-settings from the ADT, and the driver refuses to probe without them. Built with the kernel's dtc. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
…lane 0 only The ring-control lane stride of the A8X firmware (19H394) is unknown: the A9's 0x20 or the A8's 0x30, the stride at which the firmware reads LOG lanes 1-3. Size the control objects with the larger value, so that either fits, and add a per-variant log_lanes count: the A9, A8 and A7 keep 4, the A8X reads and discards lane 0 only, whose indices are at the same place in both layouts (a read of the J81's LOG control after rendering showed lane 0 at +0x00 and +0x10 and nothing in lanes 1-3). Set log_lanes to 4 once the stride is measured. Compile-checked only; not run on hardware. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
…words) The A8X's compute job is the A9's record and microsequence (s8003_submit_compute) with the words the 19H394 firmware ran with on the J81 (cluster mask 0xff at +0x18, terminate descriptor 0x00900004 at +0x244), one record, and the A8's doorbell. The module's microsequence quirk is kept as SoC data: 50 copies of the start timestamp op and a poll of CLK_STATUS before the finish op, because the unpadded sequence cut long kernels off; the longer sequence lives in the page behind the channel's. Jobs are now a per-variant type mask: the A8X takes compute only, geometry and fragment follow with the A9-form TA and 3D records. Compile-checked only; not run on hardware. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
…form TA) The A8X's geometry job is the A9's TA record and microsequence (s8003_fill_ta, s8003_job_write) on the A8's job bookkeeping. The PM set takes the A9's control words and scene record at the A8's per-VM place; its pool is blocks x 8 chunks of 16 KiB, each physically contiguous (alloc_pages, dma_map_page; the kernel's pages may be 4 KiB and a GEM object's pages need not be adjacent), never mapped in a GPU VA, and the free list holds the four 4 KiB frame numbers of each chunk. The region headers are used at rgn_header_dev_addr (no mirrored ring), the pool does not grow, and the render channels publish in the A9's form (host watermark at S8003_CH_CTL, no +12 word). The A8X now takes compute and geometry jobs. Compile-checked only; not run on hardware. Assisted-by: LLM Signed-off-by: Martin Puškáč <martin@icebear.sk>
…A8X words)
The A8X's fragment job is the A9's 3D record, barrier and microsequence
(s8003_fill_3d, s8003_job_write with the CMD_WAIT on the TA's finish stamp) on
the A8's bookkeeping: it follows its scene's geometry job (the data set and
vm->t7000.open), one record per job with two alternating slots. What the
19H394 firmware's 3D needs on the J81:
- the render targets' PBE words from the Rogue command at +0x158
(soc->pbe_3d; the A9 record has none);
- EVENT_PIXEL_PDS_INFO (+0x3bc) with usc_sr_size (bits 9-14) doubled: the
core counts it at twice the unit of Mesa's A8 word (0x202 stalls, 0x402
renders), as Apple's A9 family does;
- RGX 0xfd8 (+0x3c8) at half the A9's count (4 at width 2);
- the A9's partition words (+0x108..+0x150) zero: they land in other
registers of the A8X's loader;
- Apple's op 0xf (the 3D engine object + 0x724) and 0x14 in the 3D wait
list, right after {0x201, 0x138204, 0x10} (the A9's list lacks them); the
finish op's back offset grows by their 12 bytes.
A device-control command that the firmware does not take (a wedged firmware)
now logs the DC ring, the slot's tags, the engines' objects and the hang
report (t7001_dc_report). The A8X takes compute, geometry and fragment jobs.
Compile-checked only; the first render passed on the iPad without the last
two items; not run with them.
Assisted-by: LLM
Signed-off-by: Martin Puškáč <martin@icebear.sk>
The A8X's GPU (apple,t7001-gpu, iPad Air 2) writes its two bus bridges'
register settings after every power-on. They belong to the device:
/arm-io/pmgr has them as bridge-settings-9 and bridge-settings-10, 33
little-endian {offset, value} pairs each, offsets relative to the bridge.
Add them to the GPU node as apple,bridge-settings, big-endian cells
relative to the node's "bridges" region (the second bridge at +0x80000),
which is what the powervr driver's A8X support reads. Without the
property that driver refuses to probe.
Nothing happens on boards without an apple,t7001-gpu node, or where the
ADT lacks the two properties or has them at another length.
Tested on an iPad Air 2 (J81) with the A8X kernel series
(OrchardLinux/linux#165): the property reaches the node and powervr
probes (CORE_REVISION 0x00070500) under Orchard's launcher and Omarchy A.
Assisted-by: LLM
Signed-off-by: Martin Puškáč <martin@icebear.sk>
0ea92de to
364894d
Compare
|
Thank you, and thanks @ricktav for reproducing it on a second J81. I pushed the branch (
Also noted from ricktav: the suspend/resume storage stall. On our J81 the idle suspend/resume on this kernel (Omarchy A, about 640 s asleep) came back cleanly once, so I can't reproduce it yet; I'll try more cycles. 🤖 Generated with Claude Code |
Summary
Brings up the A8X's PowerVR GPU through the existing Apple Imagination driver (
pvr_apple_s8003.c, the "t7000" path) with Apple's own firmware (the 19H394 LDR, SHA-256 55018c7e...2c2f, supplied by the user, never redistributed). Patches 1-4 make the firmware layout data-driven (a table selected by the file's hash, the A8X's image layout derived from the LDR records), 5-7 add the binding, the bridge settings and the chip, 8-11 the A8X's power-up and ring-control differences, 10 the DT node, 12-14 the compute, geometry (with its PM set) and fragment jobs on the A9-form records with the A8X's words.Hardware-verified on a J81 with the rebased series (the project notes (mattonik/ipad-nixos research/); one boot, display DT patch on top, no kernel change outside the series):
Earlier on the pre-rebase base (same code): 20000-frame soak, 6 runtime-suspend cycles, 60 Hz flips; and Orchard's Mesa Vulkan driver with an A8X device entry ran 46 of 47 ladder rungs (research/2026-12-04-j81-mesa-a8-vulkan-results.md). Not re-run after the rebase: suspend cycles.
Commits (base 56c992e)
Rebase notes: the conflicts were in
pvr_apple_s8003.c(per-devices->mhz/s->mv, the shared perf rows,s8003_job_write()'s news/gpu_ticks/op_farguments) and the binding's if/then blocks; resolutions are in REBASE-NOTES-2026-12-04.md. Thes8003_job_write()caller fix is squashed into commit 14. Commits 13 and 14 were not built one by one on their own (the whole series compiles and runs).What is not in the series / limits
The display pipe DT for J81 is a separate follow-up PR (#166).
dtbs_checkwas run on the combined tree (defconfigorchard_apple4k_defconfig): the one warning on our nodes (apple,bridge-settingsrequired, but the bootloader adds it) is fixed in the binding commit; the remaining warnings are on pre-existing nodes.make dt_binding_checkand KUnit have not been run.🤖 Generated with Claude Code