Files
reims-vgpu/firmware/src/OptionRom.S
T
Anees Iqbal 9da252e40b 🔥 Delete apple-gfx's option ROM from firmware and the dist tree
apple-gfx-pci loaded ReimsVgpu.rom, its UEFI driver, as its default romfile;
with apple-gfx gone the driver, its sources and its build go, and cargo xtask
dist installs no ROM and names none in reims-vgpu.pc (QEMU stops reading its
optionrom variable). The firmware builds only the reims-graphics device's ROM,
which reims-ctl carries: OptionRom.S keeps the layout ReimsGraphicsRom.S
includes, with no apple-gfx-pci identity to fall back on.

The prebuilt ROM's bytes are unchanged (sha256 749434f8, rebuilt on the Mac):
only its record moves, for the Makefile and the two assembler files it names.
2026-11-07 18:21:42 -08:00

48 lines
1.8 KiB
ArmAsm

/** @file
PCI option ROM holding the driver's EFI image (PCI Firmware Specification
3.0, UEFI specification 14.4.2): the EFI expansion ROM header, the PCI data
structure, the image itself, and 0xFF padding to a multiple of 512 bytes.
The Makefile assembles it, through ReimsGraphicsRom.S, with EFI_IMAGE set to
the linked image's path and ROM_VENDOR_ID, ROM_DEVICE_ID and ROM_CLASS_CODE
to the device's PCI identity, and flattens the result to raw bytes.
**/
#define ROM_BLOCKS ((RomEnd - RomStart) / 512)
.section .rom, "a"
RomStart:
.short 0xAA55 // Signature
.short ROM_BLOCKS // InitializationSize, in 512-byte units
.long 0x0EF1 // EfiSignature
.short 11 // EfiSubsystem: boot service driver, as linked
.short 0x8664 // EfiMachineType: x64
.short 0 // CompressionType: none
.zero 8 // Reserved
.short EfiImage - RomStart // EfiImageHeaderOffset
.short Pcir - RomStart // PcirOffset
.balign 4, 0
Pcir:
.ascii "PCIR"
.short ROM_VENDOR_ID
.short ROM_DEVICE_ID
.short 0 // DeviceListOffset
.short PcirEnd - Pcir // Length
.byte 3 // Revision
.byte ROM_CLASS_CODE & 0xFF, (ROM_CLASS_CODE >> 8) & 0xFF, ROM_CLASS_CODE >> 16
.short ROM_BLOCKS // ImageLength, in 512-byte units
.short 0 // CodeRevision
.byte 3 // CodeType: EFI image
.byte 0x80 // Indicator: last image in the ROM
.short 0 // MaxRuntimeImageLength
.short 0 // ConfigUtilityCodeHeaderOffset
.short 0 // DMTFCLPEntryPointOffset
PcirEnd:
EfiImage:
.incbin EFI_IMAGE
.balign 512, 0xFF
RomEnd: