TF-M input/output control (IOCTL)

The TF-M IOTCL library provides an API for platform-specific TF-M services. These services are added by the platform partition. The APIs are available for non-secure applications.

For more information on implementing TF-M in your application, see Running applications with Trusted Firmware-M.

Functionality

Platform-specific services are internally accessed through the tfm_platform_hal_ioctl() function. Wrapper functions for these accesses are defined in tfm_ioctl_ns_api.c and tfm_ioctl_s_api.c.

The supported platform services are defined by fm_platform_ioctl_request_types_t in tfm_ioctl_api.h.

/** @brief Supported request types.
 */
enum tfm_platform_ioctl_reqest_types_t {
	TFM_PLATFORM_IOCTL_READ_SERVICE
};

Set the :option:CONFIG_TFM_PARTITION_PLATFORM Kconfig option to enable the services.

See the TF-M Hello World sample for example usage.

Prerequisites

This library requires that TF-M is installed on the device.

API documentation

Header file: include/tfm/tfm_ioctl_api.h
Source files: modules/tfm/tfm/boards/src/
group tfm_ioctl_api

Enums

enum tfm_platform_ioctl_reqest_types_t

Supported request types.

Values:

enumerator TFM_PLATFORM_IOCTL_READ_SERVICE

Functions

enum tfm_platform_err_t tfm_platform_mem_read(void *destination, uint32_t addr, size_t len, uint32_t *result)

Perform a read operation.

Parameters
  • destination[out] Pointer where read result is stored

  • addr[in] Address to read from

  • len[in] Number of bytes to read

  • result[out] Result of operation

Returns

Returns values as specified by the tfm_platform_err_t

struct tfm_read_service_args_t
#include <tfm_ioctl_api.h>

Argument list for each platform read service.

struct tfm_read_service_out_t
#include <tfm_ioctl_api.h>

Output list for each read platform service.

struct tfm_read_service_range
#include <tfm_ioctl_api.h>

Represents an accepted read range.