Access Devices with Libmetal - 2022.1 English

Libmetal and OpenAMP User Guide (UG1186)

Document ID
UG1186
Release Date
2022-06-15
Version
2022.1 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 may have different device abstractions. Following is a table to explain how libmetal manages devices differently:

Table 2-1: Libmetal Devices

Linux

Baremetal and FreeRTOS

1. Devices are described in a device tree.

1. Because there is no device tree abstraction, devices must be defined statically before attempting to open them.

2. “platform” bus definition is in Linux kernel. It is used by Linux to present memory mapped devices.

2. No standard for bus abstraction. Libmetal library defines generic bus structure to manage devices.