Mistake on this page?
Report an issue in GitHub or email us
Functions
pal_interfaces_ns.h File Reference

Copyright (c) 2018-2019, Arm Limited or its affiliates. More...

#include "val.h"
#include "val_client_defs.h"
#include <stdarg.h>

Go to the source code of this file.

Functions

int pal_spi_read (addr_t addr, uint8_t *data, uint32_t len)
 
  • This function will read peripherals using SPI commands
More...
 
uint32_t pal_ipc_framework_version (void)
 
  • Retrieve the version of the PSA Framework API that is implemented.
More...
 
uint32_t pal_ipc_version (uint32_t sid)
 
  • Retrieve the minor version of a Root of Trust Service by its SID.
More...
 
psa_handle_t pal_ipc_connect (uint32_t sid, uint32_t minor_version)
 
  • Connect to given sid.
More...
 
psa_status_t pal_ipc_call (psa_handle_t handle, const psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len)
 
  • Call a connected Root of Trust Service.
More...
 
void pal_ipc_close (psa_handle_t handle)
 
  • Close a connection to a Root of Trust Service.
More...
 
int pal_uart_init_ns (uint32_t uart_base_addr)
 
  • This function initializes the UART
More...
 
int pal_print_ns (char *str, uint32_t data)
 
  • This function parses the input string and writes bytes into UART TX FIFO
More...
 
int pal_wd_timer_init_ns (addr_t base_addr, uint32_t time_us, uint32_t timer_tick_us)
 
  • Initializes an hardware watchdog timer
More...
 
int pal_wd_timer_enable_ns (addr_t base_addr)
 
  • Enables a hardware watchdog timer
More...
 
int pal_wd_timer_disable_ns (addr_t base_addr)
 
  • Disables a hardware watchdog timer
More...
 
int pal_nvmem_read_ns (addr_t base, uint32_t offset, void *buffer, int size)
 
  • Reads from given non-volatile address.
More...
 
int pal_nvmem_write_ns (addr_t base, uint32_t offset, void *buffer, int size)
 
  • Writes into given non-volatile address.
More...
 
int32_t pal_crypto_function (int type, va_list valist)
 
  • This API will call the requested crypto function
More...
 
uint32_t pal_its_function (int type, va_list valist)
 
  • This API will call the requested internal trusted storage function
More...
 
uint32_t pal_ps_function (int type, va_list valist)
 
  • This API will call the requested protected storage function
More...
 
int32_t pal_attestation_function (int type, va_list valist)
 
  • This API will call the requested attestation function
More...
 
void pal_terminate_simulation (void)
 
  • Terminates the simulation at the end of all tests completion.
More...
 

Detailed Description

Copyright (c) 2018-2019, Arm Limited or its affiliates.

All rights reserved. SPDX-License-Identifier : Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file pal_interfaces_ns.h.

Function Documentation

int32_t pal_attestation_function ( int  type,
va_list  valist 
)

  • This API will call the requested attestation function

Parameters
-type : function code valist : variable argument list
Returns
- error status
int32_t pal_crypto_function ( int  type,
va_list  valist 
)

  • This API will call the requested crypto function

Parameters
-type : function code valist : variable argument list
Returns
- error status
psa_status_t pal_ipc_call ( psa_handle_t  handle,
const psa_invec in_vec,
size_t  in_len,
psa_outvec out_vec,
size_t  out_len 
)

  • Call a connected Root of Trust Service.

This is a wrapper API for the psa_call API. The caller must provide an array of psa_invec_t structures as the input payload.

Parameters
-handle: Handle for the connection.
  • in_vec: Array of psa_invec structures.
  • in_len: Number of psa_invec structures in in_vec.
  • out_vec: Array of psa_outvec structures for optional Root of Trust Service response.
  • out_len: Number of psa_outvec structures in out_vec.
Returns
- psa_status_t
void pal_ipc_close ( psa_handle_t  handle)

  • Close a connection to a Root of Trust Service.

This is a wrapper API for the psa_close API. Sends the PSA_IPC_DISCONNECT message to the Root of Trust Service so it can clean up resources.

Parameters
-handle Handle for the connection.
Returns
- void
psa_handle_t pal_ipc_connect ( uint32_t  sid,
uint32_t  minor_version 
)

  • Connect to given sid.

This is a wrapper API for the psa_connect API.

Parameters
-sid : RoT service id
  • minor_version : minor_version of RoT service
Returns
- psa_handle_t : return connection handle Note - Return PSA_NULL_HANDLE if PSA IPC is not implemented.
uint32_t pal_ipc_framework_version ( void  )

  • Retrieve the version of the PSA Framework API that is implemented.

This is a wrapper API for psa_framework_version API.

Parameters
-void
Returns
- The PSA Framework API version. Note - Return PAL_STATUS_ERROR if PSA IPC is not implemented.
uint32_t pal_ipc_version ( uint32_t  sid)

  • Retrieve the minor version of a Root of Trust Service by its SID.

This is a wrapper API for the psa_version API.

Parameters
-sid The Root of Trust Service ID
Returns
- Minor version of Root of Trust Service or PSA_VERSION_NONE if Root of Trust Service not present on the system. Note - Return PAL_STATUS_ERROR if PSA IPC is not implemented.
uint32_t pal_its_function ( int  type,
va_list  valist 
)

  • This API will call the requested internal trusted storage function

Parameters
-type : function code valist : variable argument list
Returns
- error status
int pal_nvmem_read_ns ( addr_t  base,
uint32_t  offset,
void *  buffer,
int  size 
)

  • Reads from given non-volatile address.

Parameters
-base : Base address of nvmem offset : Offset buffer : Pointer to source address size : Number of bytes
Returns
- SUCCESS/FAILURE
int pal_nvmem_write_ns ( addr_t  base,
uint32_t  offset,
void *  buffer,
int  size 
)

  • Writes into given non-volatile address.

Parameters
-base : Base address of nvmem offset : Offset buffer : Pointer to source address size : Number of bytes
Returns
- SUCCESS/FAILURE
int pal_print_ns ( char *  str,
uint32_t  data 
)

  • This function parses the input string and writes bytes into UART TX FIFO

Parameters
-str : Input String
  • data : Value for format specifier
Returns
- SUCCESS/FAILURE
uint32_t pal_ps_function ( int  type,
va_list  valist 
)

  • This API will call the requested protected storage function

Parameters
-type : function code valist : variable argument list
Returns
- error status
int pal_spi_read ( addr_t  addr,
uint8_t *  data,
uint32_t  len 
)

  • This function will read peripherals using SPI commands

Parameters
-addr : address of the peripheral
  • data : read buffer
  • len : length of the read buffer in bytes
Returns
- error status
void pal_terminate_simulation ( void  )

  • Terminates the simulation at the end of all tests completion.

By default, it put cpus into power down mode.

Parameters
-void
Returns
- void
int pal_uart_init_ns ( uint32_t  uart_base_addr)

  • This function initializes the UART

Parameters
-uart base addr
Returns
- SUCCESS/FAILURE
int pal_wd_timer_disable_ns ( addr_t  base_addr)

  • Disables a hardware watchdog timer

Parameters
-base_addr : Base address of the watchdog module
Returns
- SUCCESS/FAILURE
int pal_wd_timer_enable_ns ( addr_t  base_addr)

  • Enables a hardware watchdog timer

Parameters
-base_addr : Base address of the watchdog module
Returns
- SUCCESS/FAILURE
int pal_wd_timer_init_ns ( addr_t  base_addr,
uint32_t  time_us,
uint32_t  timer_tick_us 
)

  • Initializes an hardware watchdog timer

Parameters
-base_addr : Base address of the watchdog module
  • time_us : Time in micro seconds
  • timer_tick_us : Number of ticks per micro second
Returns
- SUCCESS/FAILURE
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.