EDK2 UEFI application to display AArch64 CPU feature information by reading and decoding ARM system registers.
Based on ARM DDI 0487 (ARM Architecture Reference Manual for A-profile).
- Reads all AArch64 ID system registers
- Decodes register fields into human-readable feature descriptions
- YAML-based code generation for easy maintenance
- Python decoder tool for offline testing
Example output:
[..]
------|-------------|-------|-------|----------------------------------------------
MMFR0 | ECV | 63:60 | 0000 | FEAT_ECV not implemented.
MMFR0 | FGT | 59:56 | 0000 | FEAT_FGT not implemented.
MMFR0 | ExS | 47:44 | 0000 | FEAT_ExS not implemented.
MMFR0 | TGran4 | 31:28 | 0000 | 4KB granule supported.
MMFR0 | TGran4_2 | 43:40 | 0000 | 4KB granule support at stage2 as above.
MMFR0 | Tgran16 | 23:20 | 0001 | 16KB granule supported.
MMFR0 | TGran16_2 | 35:32 | 0000 | 16KB granule support at stage2 as above.
MMFR0 | TGran64 | 27:24 | 0000 | 64KB granule supported.
MMFR0 | TGran64_2 | 39:36 | 0000 | 64KB granule support at stage2 as above.
MMFR0 | SNSMem | 15:12 | 0001 | Supports a distinction between Secure and Non-Secure Memory.
MMFR0 | BigEnd | 11:8 | 0001 | Mixed-endian support.
MMFR0 | BigEndEL0 | 19:16 | 0000 | No mixed-endian support at EL0.
MMFR0 | ASIDBits | 7:4 | 0010 | ASID: 16 Bits
MMFR0 | PARange | 3:0 | 0101 | 48 Bits (256TB) of physical address range supported.
------|-------------|-------|-------|----------------------------------------------
[..]
ArmCpuInfo.efi binary can be run on any AArch64 system capable of running EFI binaries:
- EDK2
- U-Boot with EFI support
Application assumes terminal with 100 columns.
qemu-system-aarch64 \
-M virt -cpu max -m 2048 \
-bios QEMU_EFI.fd \
-drive file=fat:rw:Build/ArmVirtQemu-AARCH64/RELEASE_GCC5/AARCH64/
# In UEFI shell:
FS0:
ArmCpuInfo.efi- Copy
ArmCpuInfo.efito EFI partition (or other FAT formatted) - Boot to UEFI shell
- Run
ArmCpuInfo.efi
- clone this repository
- clone edk2 repository
- symlink ArmCpuInfo/ directory into edk2/ArmPkg/Application/ArmCpuInfo
- edit edk2/ArmPkg/ArmPkg.dsc file and add one line into "[Components.AARCH64]"
section:
ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.inf - build using this command:
build -t GCC -a AARCH64 -b RELEASE -m edk2/ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.inf -p edk2/ArmPkg/ArmPkg.dsc - resulting binary will be in "Build/Arm/RELEASE_GCC/AARCH64/" directory
Before building, you may regenerate C code and headers from YAML:
cd ArmCpuInfo
scripts/build_generate.shThis creates:
id_aa64_all_generated.c- Register handler implementationsid_aa64.h- Function declarations