Skip to content

Latest commit

 

History

100 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Arm cpu information command for UEFI Shell

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).

Features

  • 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.
------|-------------|-------|-------|----------------------------------------------
[..]

Usage

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

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

On a real hardware:

  1. Copy ArmCpuInfo.efi to EFI partition (or other FAT formatted)
  2. Boot to UEFI shell
  3. Run ArmCpuInfo.efi

Build instructions

  1. clone this repository
  2. clone edk2 repository
  3. symlink ArmCpuInfo/ directory into edk2/ArmPkg/Application/ArmCpuInfo
  4. edit edk2/ArmPkg/ArmPkg.dsc file and add one line into "[Components.AARCH64]" section:
    ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.inf
    
  5. build using this command:
    build -t GCC -a AARCH64 -b RELEASE -m edk2/ArmPkg/Application/ArmCpuInfo/ArmCpuInfo.inf -p edk2/ArmPkg/ArmPkg.dsc
    
  6. resulting binary will be in "Build/Arm/RELEASE_GCC/AARCH64/" directory

(Re-)Generate Code

Before building, you may regenerate C code and headers from YAML:

cd ArmCpuInfo
scripts/build_generate.sh

This creates:

  • id_aa64_all_generated.c - Register handler implementations
  • id_aa64.h - Function declarations

About

Arm CPU information command for UEFI Shell

Resources

Stars

18 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages