vdev virtio-scmi

Updated: April 19, 2023

Implements a vdev that supports the SCMI standard and allows guests running in hypervisor VMs to read sensor data

Synopsis

vdev virtio-scmi
    [num_sensors number]
    [sensor_unit SENSOR_UNIT_X...]
    [type sensor_data_type...]

Options

num_sensors number
The number of sensors, as represented by the SCMI protocol, for which you want to read data. In SCMI, gyroscope and accelerometer devices are considered separate sensors, so you must set this option to 2 to read both kinds of data.
sensor_unit SENSOR_UNIT_X...
Specify the Sensor Framework sensor units to associate with a given sensor. Some sensors can measure multiple types of data. For example, a single IMU sensor can measure both gyroscope and accelerometer data, so you must specify the same sensor unit twice if you want to read both types of data.

The sensor units are specified as a comma-separated list, with the number of entries being equal to num_sensors. Each entry should have the form of SENSOR_UNIT_X, with X being a value between 1 and 64, inclusive.

Further validation will be performed upon initialization to ensure all values are supported by the existing Sensor Framework configuration.

type sensor_data_type...
The types of sensor data that you want to read. The supported values for this release are gyroscope and accelerometer. The data types are specified as a comma-separated list, with the number of entries being equal to num_sensors.
Note: In addition to these options, you can specify options that are supported for all vdevs, such as intr and loc. For more information, see Common vdev options in the QNX Hypervisor User's Guide.

Description

(ARM and x86) The virtio-scmi vdev allows guests to excute SCMI commands on the host. In this release, the vdev supports the sections of the SCMI 3.0 standard related to the retrieval of gyroscope and accelerometer data. When the vdev receives an SCMI request for sensor data, it calls the appropriate Sensor library functions to carry out the request, then passes the result back to the guest, as an SCMI reply, through the driver.

The vdev's configuration associates sensor units in the Sensor Framework with sensors in the SCMI protocol. The use case targeted by this release is a single sensor unit that maps to one or two sensors in SCMI. So if you want to read both gyroscope and accelerometer from one IMU sensor, you would configure the vdev as follows:
vdev virtio-scmi
    num_sensors 2
    type gyroscope, accelerometer
    sensor_unit SENSOR_UNIT_1, SENSOR_UNIT_1
The configuration options are specific to the instance of the driver using the vdev.