Access Devices with Libmetal - 2024.2 English - 2024.1 English

Libmetal and OpenAMP User Guide (UG1186)

Document ID
UG1186
Release Date
2024-11-13
Version
2024.2 English

Libmetal allows you to access devices similarly across varying operating environments.

The flow for using libmetal is as follows:

  1. Start libmetal environment.
  2. Add devices.
  3. Open the devices.
  4. Register interrupt if required.
  5. Write and read device registers with libmetal API.
  6. Close the device.
  7. Close the libmetal environment.

The above steps are explained in the following subsections.

Different platforms can have different device abstractions. Following is a table to explain how libmetal manages devices differently:

Table 1. Libmetal Devices
Linux Baremetal FreeRTOS
Devices are described in a device tree. Because there is no device tree abstraction, devices must be defined statically before attempting to open them.
"platform" bus definition is in Linux kernel. It is used by Linux to present memory mapped devices. No standard for bus abstraction. Libmetal library defines generic bus structure to manage devices.