OPAL

From OSDev.wiki
Jump to navigation Jump to search

OPAL (OpenPower Abstraction Layer) is an ongoing project created by IBM in an effort of standardizing the boot environment and low-level services available across POWER systems, it was introduced with POWER8.

These low-level services are meant to be used both in boot and runtime, they consist of a series of calls that can be realized using the two pointers OPAL passes to it's payload (The OPAL base and OPAL entrypoint respectively, passed on R8 and R9).

Calling the functions

To access an OPAL routine, the system is required to be in big endian mode.

Each OPAL routine has a number associated to it, this number is to be loaded in R0, from there only a trampoline has to be calculated using the OPAL base and entrypoint, passed to the loaded payload in R8 and R9 respectively.

The OPAL routines use the SysV ABI.

Function listing

A complete listing can be found here, but this is a list of the most useful functions.

  • OPAL_CEC_POWER_DOWN - Powers down the system.
  • OPAL_CONSOLE_WRITE, OPAL_CONSOLE_READ, OPAL_CONSOLE_FLUSH, OPAL_CONSOLE_WRITE_BUFFER_SPACE - Console management, from printing to reading.
  • OPAL_GET_DEVICE_TREE - Fetching a flattened device tree (FDT) for kernel use.
  • OPAL_START_CPU and OPAL_RETURN_CPU - Secondary CPU management.

See Also

External Links