Appendix E: Bring-up checklists
These checklists condense Part 17 and the sections it builds on into lists you can tick off against a new port, a code review or a failing boot. Each item says what to do, how to confirm it, and what a miss looks like. The reasoning is in the linked sections, and the sequences themselves are in Appendix C. TF-A function names are given as the reference implementation, not as the only correct one.
Conventions: “whole-register write” means a write from a constant built from named fields, with RES1 bits set and RES0 bits clear, before any read-modify-write (17.1). “Per world” means the value is rebuilt for every exception return to that Security state (17.2).
E.1 EL3 initialisation (every core, every reset)
| # | Item | Confirm | Symptom of a miss | See |
|---|---|---|---|---|
| 1 | The core reaches RVBAR_EL3. If it does not, check the reset controller, the clocks, RVBARADDR and the ROM mapping before suspecting firmware | Reset Catch (EDECR.RCE) or a CTI halt; QEMU -d int,cpu_reset,in_asm -S -s | No instruction retires | 17.1 |
| 2 | SCTLR_EL3 whole-register write first: EE explicit, M=C=0, RES1 bits set, and EIS/EOS = 1 (RES1 without FEAT_ExS, real controls with it); ISB | Read back; compare with the RES1 mask | Wrong endianness on the first load; non-synchronizing exception entry/return on FEAT_ExS cores | 17.2, 7.8 |
| 3 | On a fixed reset vector: cold/warm decision (plat_get_my_entrypoint) before touching any shared state, stackless, from a location valid with caches off | Warm-boot a secondary while the primary runs | Warm-booting core corrupts the primary’s .data/.bss | 17.1 |
| 4 | VBAR_EL3 written, then ISB, before anything that can fault | A deliberate BRK reports through your vector | Jump through an UNKNOWN vector on the first UNDEF | 17.1, 3.1 |
| 5 | CPU reset handler selected by MIDR_EL1: errata workarounds for this variant/revision, IMPLEMENTATION DEFINED CPU*CTLR settings, CPUECTLR_EL1.SMPEN=1 on pre-DynamIQ cores | Print MIDR and the applied errata list (TF-A ERRATA_*, errata reporting) | Rare corruption, hangs under load; on pre-DynamIQ cores, incoherent L1 | 1.3, 8.8 |
| 6 | SCR_EL3, CPTR_EL3, MDCR_EL3 whole-register writes from constants. No read-modify-write before that | Run once with debugger-planted non-zero values in these registers; behaviour must not change | Random traps (TWI, EA), FP traps (EC 0x07), debug or PMU leaking into Secure state | 17.1, 17.2 |
| 7 | MDCR_EL3: SDD=1; SPME=0 and SCCD/MCCD where implemented; SPE/TRBE/BRBE ownership fields per world | Count cycles across an SMC: Secure time must not be counted | Secure execution visible to Normal-world perf | 17.2, 16.3 |
| 8 | Only then unmask SError at EL3 (DAIFClr A) and set SCR_EL3.EA per the RAS model | Inject an SError with the RAS error-injection registers, if present | SError through an UNKNOWN vector, or lost | 17.1, 3.4, 16.8 |
| 9 | Secondaries leave (power off or hold pen) before the primary initialises memory | Release order in a trace | Two cores zeroing .bss | 17.4 |
| 10 | C runtime with MMU off: SRAM/DRAM scrubbed if ECC-protected; RW range invalidated by VA (system-cache leftovers); .bss zeroed with aligned stores and no DC ZVA; firmware built with -mstrict-align | Four-state RTL with X-propagation; FVP with cache modelling | SError at “the first memory access”; Alignment faults in memset | 17.1, 6.5 |
| 11 | CNTFRQ_EL0 written on every core (only the highest EL can); system counter enabled once (CNTCR.EN in CNTControlBase) | CNTPCT_EL0 advances; same frequency on all cores | Timeouts that never expire; time running at the wrong rate | 4.6, 17.2 |
| 12 | ICC_SRE_EL3.{SRE,Enable}=1; ISB; read back | SRE reads 1 | Kernel dies in early GIC probe | 4.5 |
| 13 | ACTLR_EL3: grant lower ELs only the IMPLEMENTATION DEFINED register access they need (usually none) | Lower-EL write to ACTLR_EL1 traps | Kernel or guest can change core tuning and errata bits | 17.2 |
| 14 | EL3 MMU and caches on as early as a minimal map exists (E.2) | E.2 | Slow boot; unaligned or DC ZVA faults in C | 17.2 |
| 15 | Feature audit: for every feature the ID registers advertise and the OS will use, the EL3 enable bit is set and its registers are context-switched per world. Build with FEATURE_DETECTION=1 once per new core | Directed test touching one register per advertised feature from Normal-world EL2, with a Secure round trip in between | EC 0x18 trap to EL3, or an injected UNDEF in the kernel (EC 0x00 at EL1); silent state leakage between worlds | 17.3 |
| 16 | First exception return: per-world SCR_EL3 (NS, RW, HCE, routing, feature enables); SPSR_EL3 (M = EL2h 0b1001 or EL1h 0b0101, AArch64, DAIF masked); ELR_EL3; target SCTLR_ELx clean; EL2 controls written if EL2 exists but software starts at EL1; GPRs zeroed except arguments | Halt at el3_exit and read the context | Illegal exception return: the PE stays at EL3 with PSTATE.IL, and the next instruction takes EC 0x0E with ELR_EL3 = intended entry | 17.2, 3.2, 12.2 |
E.2 MMU on (any EL)
| # | Item | Confirm | Symptom of a miss | See |
|---|---|---|---|---|
| 1 | Translation tables built in memory the walker will read coherently. If built with the MMU or D-cache off: DC IVAC the table region to the PoC before and after building | Poison the table lines through a cacheable alias first; boot must still succeed (cache modelling on) | Garbage walks or random faults on silicon only | 9.3 |
| 2 | TCR_ELx: T0SZ and TG0 match the starting level the tables were built for (TG0 and TG1 encodings differ); PS/IPS ≤ ID_AA64MMFR0_EL1.PARange and ≥ the largest output address; IRGN0/ORGN0/SH0 match how the tables are mapped | Recompute the starting level by hand (5.4) | Level-0 (starting-level) Translation fault on the first fetch; Address size fault | 5.2, 5.3 |
| 3 | MAIR_ELx attribute indices agree with every descriptor’s AttrIndx | Decode a few leaf descriptors by hand | Code mapped Device (faults or no speculation); MMIO mapped Normal | 6.5 |
| 4 | Leaf descriptors: AF=1 (unless hardware AF is enabled), blocks aligned to their size, SH consistent across aliases, code not XN, SCTLR.WXN consistent with writable code pages | AT S1ExR + PAR_EL1 after the MMU is on (not before: with M=0, AT reports the flat mapping) | Access flag fault; Permission fault on the first fetch | 5.9, 5.5 |
| 5 | Map only memory that exists and is ready: no PA holes, untrained DDR or Secure carve-outs inside large Normal blocks; MMIO as Device and XN | Review the memory map against the SoC map | Asynchronous SErrors or bus hangs with no instruction to blame | 9.3, 14.2 |
| 6 | The enabling code, the stack and the vectors are mapped at VA = PA (or the code branches to its new VA from an identity-mapped page) | Disassemble the enable routine; check its page in the tables | Recursive exceptions at VBAR right after M=1 | 9.3 |
| 7 | Local TLB invalidate (TLBI ALLE3/ALLE2/VMALLE1) before enabling | In the disassembly | Stale entries from an earlier stage or a warm reset | 9.3 |
| 8 | DSB ISH; ISB between the MAIR/TCR/TTBR writes and the SCTLR write; ISB after it | In the disassembly; compiler-generated MSR needs an explicit isb() | Works single-stepping, fails at speed | 9.3, 7.8 |
| 9 | Data written before the D-cache was enabled and read after: invalidate (not clean) by VA to the PoC before enabling | Checker pattern written with caches off, read with caches on | Data “disappears” after enabling | 9.3, 6.6 |
| 10 | Every later change to a live mapping uses the 9.1 sequence, or break-before-make for OA/type/size changes, and is not done while another PE uses the mapping | Code review of every remap helper | Sporadic Translation faults on secondaries; TLB conflict aborts (DFSC 0b110000) | 9.1, 9.2 |
E.3 GIC on (GICv3)
| # | Item | Confirm | Symptom of a miss | See |
|---|---|---|---|---|
| 1 | Each PE: ICC_SRE_EL3, then ICC_SRE_EL2, then ICC_SRE_EL1, SRE=1 (and Enable=1 at EL3 and EL2), ISB after each | Read back SRE | ICC_* accesses UNDEF or trap | 4.5 |
| 2 | Boot PE, Secure: GICD_CTLR.ARE_S/ARE_NS set while the group enables are clear; DS=0 if there is a Secure world; poll RWP | Read GICD_CTLR | Legacy routing (8-PE limit, no LPIs); Secure registers reachable from Non-secure | 4.5 |
| 3 | Multi-chip GICs (GIC-600/GIC-700, IMPLEMENTATION DEFINED registers): chip routing table (GICD_DCHIPR, GICD_CHIPRn) programmed before any Distributor enable, SPI block ranges disjoint and complete | GICD_CHIPSR.RTS reports consistent | SPIs pending on one chip and invisible on another | 4.5, 17.5 |
| 4 | Every SPI configured while disabled: IGROUPR/IGRPMODR, IPRIORITYR, ICFGR (level vs edge), IROUTER (affinity matching the real MPIDR_EL1 layout) | Dump the registers; compare IROUTER with each target’s MPIDR_EL1 | Interrupt pending forever (no matching Redistributor); level interrupt firing once | 4.5 |
| 5 | GICD_CTLR.EnableGrp0/EnableGrp1NS/EnableGrp1S; poll RWP | Read back | Nothing forwarded, including SGIs/PPIs under affinity routing | 4.5 |
| 6 | Each PE, Secure: power the Redistributor (GICR_PWRR on GIC-600 class, IMPLEMENTATION DEFINED); GICR_WAKER.ProcessorSleep=0; poll ChildrenAsleep==0 | Read GICR_WAKER | Interrupts held back for this PE only | 4.5 |
| 7 | Find this PE’s Redistributor by matching GICR_TYPER.Affinity_Value with MPIDR_EL1; frame stride 128 KB (256 KB with VLPIS); stop at GICR_TYPER.Last | Log the frame index found per PE | Walk runs off the end (looks like an early-boot hang) | 4.5 |
| 8 | SGIs/PPIs in the SGI_base frame: group, priority, ICFGR1, GICR_ISENABLER0 | Timer PPI fires | No timer tick | 4.5 |
| 9 | CPU interface: ICC_PMR_EL1 above the priorities in use (it resets to 0, masking everything), ICC_BPR*, ICC_CTLR_EL1/EL3 (EOImode), ICC_IGRPEN0_EL1/ICC_IGRPEN1_EL1 (or ICC_IGRPEN1_EL3) | ICC_HPPIR*_EL1 shows the pending INTID | Pending but never signalled | 4.5, 4.3 |
| 10 | Routing and masking: SCR_EL3.IRQ/FIQ, HCR_EL2.IMO/FMO, PSTATE.I/F match the intended model; SCR_EL3.FIQ identical on all CPUs | Force pending with GICD_ISPENDR/GICR_ISPENDR0 | FIQ at EL3 instead of IRQ at EL1 (wrong group); nothing taken | 3.3, 4.3 |
| 11 | Handler: acknowledge, clear the source with a read-back, DSB, EOI; deactivate if EOImode=1 | GICD_ISACTIVER not stuck | Delivered once, never again | 4.2, 7.9 |
| 12 | LPIs (if used): property and pending tables allocated and cleaned (or coherent), GICR_CTLR.EnableLPIs last; ITS tables and command queue set up per IHI0069 | INT command delivers an LPI | LPIs silently never arrive | 4.4 |
E.4 Secondary CPU on (PSCI CPU_ON)
| # | Item | Confirm | Symptom of a miss | See |
|---|---|---|---|---|
| 1 | plat_core_pos_by_mpidr() validates every field of the requested MPIDR, for the real affinity layout (MT, Aff0 as thread on DynamIQ) | Fuzz CPU_ON with invalid MPIDRs: expect INVALID_PARAMETERS | Wrong core started; out-of-bounds index at EL3 | 17.4 |
| 2 | Entry point validated (validate_ns_entrypoint) | Pass an address outside Non-secure DRAM | EL3 jumps the core into arbitrary memory | 17.4 |
| 3 | PSCI state the target reads with caches off (ON_PENDING, entry point, context) cleaned to the PoC, unless the platform is hardware-coherent from reset | Cache-modelled FVP or silicon | Target reads stale state and goes back to sleep or uses the wrong entry | 17.4, 8.8 |
| 4 | Cluster power and interconnect membership: if the cluster was off, power it and (older interconnects) add it to the snoop and DVM domains before the core enables caches | Interconnect snoop counters for the cluster | Incoherent caches; TLBI broadcasts not reaching the new core | 17.4, 17.5 |
| 5 | Target reset path runs all of E.1 that is per core: SCTLR_EL3, vectors, reset handler (errata, SMPEN on pre-DynamIQ), CNTFRQ_EL0, ICC_SRE_EL3, EL3 MMU | Errata report on every core, not only the primary | Errata applied only on core 0 | 17.1 |
| 6 | Redistributor wake and CPU interface init on the target (pwr_domain_on_finish) | Send an SGI to the new core | Core runs but receives no interrupts | 4.5 |
| 7 | Target’s Non-secure context (SCR_EL3, SPSR_EL3, ELR_EL3 = entry, x0 = context ID) built by the caller and visible to the target after its MMU is on | Halt the target at el3_exit | Wrong EL or wrong entry on the secondary only | 17.4 |
| 8 | The OS treats CPU_ON success as “request accepted” and runs its own handshake or polls AFFINITY_INFO | OS log | Boot hangs waiting for a core that never came up | 17.4 |
| 9 | Hold-pen platforms only: mailbox write cleaned to the PoC (or Non-cacheable), DSB SY, SEV | Release from a cold pen in RTL | Secondary never leaves the pen | 17.4, 7.10 |
E.5 Caches off before power-down (CPU_OFF, power-down CPU_SUSPEND)
| # | Item | Confirm | Symptom of a miss | See |
|---|---|---|---|---|
| 1 | State coordination done under the power-domain locks; the last core of a cluster (or the OS, in OS-initiated mode) decides the cluster state | PSCI stats (PSCI_STAT_COUNT/RESIDENCY) | Cluster powered off under a running core | 17.4 |
| 2 | SPD/SPMC notified and its state saved; extension state not in the context (for example AMU counters) saved | Resume a core and compare | Secure world loses state; counters reset | 17.4 |
| 3 | Timers: the OS’s next event moved to an always-on timer (broadcast timer, CNTBaseN frame); owners of CNTV_CVAL_EL0, CNTKCTL_EL1, CNTHCTL_EL2, CNTVOFF_EL2 restore them on resume; EL3 rewrites CNTFRQ_EL0 | Wake from a timer-only idle period | Core never wakes; virtual time jumps | 17.4, 4.6 |
| 4 | Pre-DynamIQ: clear SCTLR_EL3.C; ISB; set/way clean+invalidate L1 (and L2 on the last core of the cluster) with levels from CLIDR_EL1; then clear CPUECTLR_EL1.SMPEN; ISB; DSB SY. In that order | Stress with another core writing lines the target holds dirty during power-down | Lost dirty lines; stale data on other cores (SMPEN cleared too early) | 8.8 |
| 5 | DynamIQ: CPUPWRCTLR_EL1.CORE_PWRDN_EN=1; ISB; hardware flushes and leaves coherency. Cluster hints in CLUSTERPWRDN_EL1 are advisory | PMU L1D_CACHE_WB (0x15) on the target before WFI | Core retains power, or the request is ignored | 8.8 |
| 6 | No cacheable writes of data needed later after the flush (stack spills included); data the warm-boot path reads with caches off is clean to the PoC | Checker patterns on the power-down stack survive | Corruption after many suspend cycles | 8.8 |
| 7 | GIC: GICR_WAKER.ProcessorSleep=1, poll ChildrenAsleep==1; CPU interface disabled; SPIs targeted at this core migrated (OS) or 1-of-N participation removed (GICR_CTLR.DPG* where GICR_TYPER.DPGS=1) | Wake by an SPI aimed at the sleeping core | Lost wake-up; SPI pending until the core returns | 17.4, 4.5 |
| 8 | Cache-related errata for this core revision applied (for example clean-as-clean+invalidate workarounds) | SDEN cache, CMO and power-down categories reviewed | Corruption only after thousands of cycles | 8.8, 1.3 |
| 9 | Power controller programmed (often SCMI to an SCP); DSB SY; WFI. A WFI that falls through is handled as an immediate wake-up | Count fall-throughs | Core spins in EL3 or returns with caches off | 17.4, 7.6 |
| 10 | Last cluster or chiplet down: cluster cache flushed (by the last core or by hardware) before the cluster leaves the snoop and DVM domain; on return, invalidate TLBs and caches as from reset | Interconnect counters show snoops stop and restart | Stale TLB entries or lines after cluster power-up | 8.8, 17.5 |
Validation note: Each checklist has a matching stress test in the linked sections. In short: X-propagation RTL runs and planted UNKNOWN values for E.1 (17.1); a poisoned-cache MMU-on test for E.2 (9.3); forced-pending plus real-device tests on every die, before and after a power cycle, for E.3 (4.5); and a randomised PSCI loop with interrupts aimed at sleeping cores and checker patterns for E.4 and E.5 (17.4, 8.8). Run the cache-related tests on silicon or with FVP cache-state modelling enabled; without it, none of the dirty-line failures can occur. For what the kernel expects at handover, see the entry-state table in 17.6.