fix(raspi): the Pi 5's native path turns the MMU and caches on before any C; bounded mailbox; framebuffer address from dma-ranges

boards/BRINGUP.md R2/R3, FABRIC-3 SXXXIX.  The entry stub cleans the cache
over the image, builds an identity map (the image's GiB Normal, the rest
Device) and enables MMU and caches at EL2 (or EL1); rpi5_mmu.c makes the
devicetree's RAM Normal and the framebuffer uncached.  Mailbox waits give
up after one second; the buffer is cleaned around the exchange; the
framebuffer address goes through dma-ranges, not a Pi 4 mask.

New rpi5-rehearsal target runs the native image on QEMU virt at EL2.  It
found three more that would each have stopped the board: the PL011 shift
(mine, c9519173; the host test asserted it), the GIC address not carried
through /soc's ranges (new fdt_reg_address(), checked against the real
Pi 5 DTB), and no timer IRQ at EL2 (HCR_EL2.IMO/FMO/AMO).

Rehearsal: POST 1052 passed, same parity hash as UEFI.  Standard acceptance
on three ISAs: POST 1052, hash 0x82f4ae7cb2e2d424.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-14 12:58:35 -04:00
co-authored by Claude Opus 5.5
parent 4da370f492
commit 0e2c60dac3
23 changed files with 36835 additions and 85 deletions
+10 -3
View File
@@ -174,7 +174,7 @@ int main(int argc, char **argv)
fdt_uart_t u;
const void *b;
if (argc == 6) { /* a real blob, and what it should give */
if (argc == 6 || argc == 9) { /* a real blob, and what it should give */
static unsigned char real[2 * 1024 * 1024];
FILE *f = fopen(argv[1], "rb");
size_t n;
@@ -186,6 +186,13 @@ int main(int argc, char **argv)
CHECK(n > 40 && fdt_console_uart(real, &u) && is(&u, kind, strtoull(argv[3], 0, 0), (uint32_t)strtoul(argv[4], 0, 0), (uint32_t)strtoul(argv[5], 0, 0)),
"%s: %s at 0x%llx, registers %u apart (shift), %u wide", argv[1], SHOW(u));
printf(" %s: %s at 0x%llx, shift %u, width %u\n", argv[1], SHOW(u));
if (argc == 9) { /* and a node's reg, carried through its buses: argv[6] compatible, [7] [8] entries 0 and 1 */
uint64_t a0 = 0, a1 = 0;
CHECK(fdt_reg_address(real, argv[6], 0, &a0) && a0 == strtoull(argv[7], 0, 0) &&
fdt_reg_address(real, argv[6], 1, &a1) && a1 == strtoull(argv[8], 0, 0),
"%s: reg 0 at 0x%llx, reg 1 at 0x%llx", argv[6], (unsigned long long)a0, (unsigned long long)a1);
printf(" %s: reg 0 at 0x%llx, reg 1 at 0x%llx\n", argv[6], (unsigned long long)a0, (unsigned long long)a1);
}
printf(" %d checks, %d failures\n", checks, failures);
return failures != 0;
}
@@ -200,9 +207,9 @@ int main(int argc, char **argv)
CHECK(fdt_console_uart(mars("serial0:115200n8", "okay", 1), &u) && u.kind == FDT_UART_16550, "and with status okay");
memset(&u, 0xAA, sizeof u);
CHECK(fdt_console_uart(pi5("arm,pl011-axi\0arm,pl011\0arm,primecell", 37), &u) && is(&u, FDT_UART_PL011, 0x107d001000ull, 0, 4),
CHECK(fdt_console_uart(pi5("arm,pl011-axi\0arm,pl011\0arm,primecell", 37), &u) && is(&u, FDT_UART_PL011, 0x107d001000ull, 2, 4),
"the Pi 5: serial10, a PL011, its address carried through the bus's ranges to 0x107d001000: %s 0x%llx %u %u", SHOW(u));
CHECK(fdt_console_uart(pi5("arm,pl011-axi", 14), &u) && is(&u, FDT_UART_PL011, 0x107d001000ull, 0, 4), "a node that says only arm,pl011-axi is a PL011 too");
CHECK(fdt_console_uart(pi5("arm,pl011-axi", 14), &u) && is(&u, FDT_UART_PL011, 0x107d001000ull, 2, 4), "a node that says only arm,pl011-axi is a PL011 too");
memset(&u, 0xAA, sizeof u);
CHECK(fdt_console_uart(virt(), &u) && is(&u, FDT_UART_16550, 0x10000000ull, 0, 1),