omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / aienux / spark / plat_qemu.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note aienux/spark/plat_qemu.om: QEMU virt test profile for spark_main.om (SPARK-QEMU.EFI, gate only; never staged). |
| 3 | note QEMU has no GB20B. The edu device (1234:11e8) stands in for the GPU ONLY as a PCIe endpoint with its own |
| 4 | note SMMUv3 stream + BME; GB20B register access (PMC_BOOT_0 check, IRQ bind) and Stages 4..6 are stubbed. |
| 5 | note A SPARK-QEMU.EFI booted on real Spark finds no 1234:11e8 device and fails closed at stage 2 (code 201). |
| 6 | const SPK_PLAT_QEMU ulong 1 |
| 7 | const SPK_PLAT_NEED_RTL ulong 0 |
| 8 | const SPK_PLAT_GPU_BAR_SZ ulong 1048576 |
| 9 | const SPK_PLAT_GPU_BAR_FALLBACK ulong 0 |
| 10 | |
| 11 | text spk_q_s2 "[SPARK QEMU] stage 2 GPU stand-in edu 1234:11e8: GB20B PMC_BOOT_0 check + IRQ bind STUB\n" |
| 12 | text spk_q_s2b "[SPARK QEMU] stage 2 SMMUv3 streams live: gpu-standin sid=0x" |
| 13 | text spk_q_s2c " nvme sid=0x" |
| 14 | text spk_q_nl "\n" |
| 15 | |
| 16 | fn spk_plat_is_gpu vid ulong did ulong to bool |
| 17 | ret and eq vid 0x1234 eq did 0x11e8 |
| 18 | end |
| 19 | |
| 20 | fn spk_plat_verify_gpu hb long to bool |
| 21 | uart_puts spk_q_s2 |
| 22 | ret gt hb 0 |
| 23 | end |
| 24 | |
| 25 | fn spk_plat_note_stage2 to void |
| 26 | uart_puts spk_q_s2b |
| 27 | uart_puthex get smmu_str_sid 0 |
| 28 | uart_puts spk_q_s2c |
| 29 | uart_puthex get smmu_str_sid 1 |
| 30 | uart_puts spk_q_nl |
| 31 | end |
| 32 | |
| 33 | note QEMU virt iommu=smmuv3: one SMMUv3 at VIRT_SMMU = 0x09050000 (hw/arm/virt.c memmap). |
| 34 | const SPK_PLAT_NSMMU ulong 1 |
| 35 | |
| 36 | fn spk_plat_smmu_base i ulong to ulong |
| 37 | ret 0x09050000 |
| 38 | end |