Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | /* |
Max Shvetsov | 103e056 | 2021-02-04 16:58:31 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2021, Arm Limited. All rights reserved. |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | 1486f3b | 2018-06-26 10:30:10 +0100 | [diff] [blame] | 7 | #ifndef CACTUS_TESTS_H |
| 8 | #define CACTUS_TESTS_H |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 9 | |
Max Shvetsov | 103e056 | 2021-02-04 16:58:31 +0000 | [diff] [blame] | 10 | #include <spm_common.h> |
Max Shvetsov | c32f478 | 2020-06-23 09:41:15 +0100 | [diff] [blame] | 11 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 12 | /* |
| 13 | * Test functions |
| 14 | */ |
| 15 | |
| 16 | /* |
Olivier Deprez | 881b199 | 2020-12-01 15:34:34 +0100 | [diff] [blame^] | 17 | * Alter SIMD vectors to check saving of the context while switching between |
| 18 | * the normal world and the secure world. |
| 19 | */ |
| 20 | void fill_simd_vectors(void); |
| 21 | |
| 22 | /* |
J-Alves | 9f6f014 | 2020-06-17 15:37:59 +0100 | [diff] [blame] | 23 | * Test to FFA interfaces. |
| 24 | */ |
J-Alves | 63cdaa7 | 2020-10-08 17:22:45 +0100 | [diff] [blame] | 25 | void ffa_memory_management_test(struct mailbox_buffers *mb, ffa_vm_id_t vm_id, |
| 26 | ffa_vm_id_t sender, uint32_t mem_func, |
| 27 | uint64_t handle); |
| 28 | |
Max Shvetsov | c32f478 | 2020-06-23 09:41:15 +0100 | [diff] [blame] | 29 | void ffa_tests(struct mailbox_buffers *mb); |
J-Alves | 9f6f014 | 2020-06-17 15:37:59 +0100 | [diff] [blame] | 30 | |
| 31 | /* |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 32 | * Test other things like the version number returned by SPM. |
| 33 | */ |
| 34 | void misc_tests(void); |
| 35 | |
| 36 | /* |
| 37 | * The Arm TF is responsible for setting up system registers on behalf of the |
| 38 | * Secure Partition. For example, TF is supposed to allow Secure Partitions to |
| 39 | * perform cache maintenance operations (by setting the SCTLR_EL1.UCI bit). |
| 40 | * |
| 41 | * This function attempts to verify that we indeed have access to these system |
| 42 | * features from S-EL0. These tests report their results on the UART. They do |
| 43 | * not recover from a failure : when an error is encountered they will most |
| 44 | * likely trigger an exception into S-EL1. |
| 45 | */ |
| 46 | void system_setup_tests(void); |
| 47 | |
| 48 | /* |
| 49 | * Exercise the SP_MEMORY_ATTRIBUTES_SET_AARCH64 SMC interface. A variety of |
| 50 | * valid and invalid requests to change memory attributes are tested. |
| 51 | * |
| 52 | * These tests report their results on the UART. They do not recover from a |
| 53 | * failure : when an error is encountered they endlessly loop. |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 54 | */ |
Antonio Nino Diaz | 1486f3b | 2018-06-26 10:30:10 +0100 | [diff] [blame] | 55 | void mem_attr_changes_tests(void); |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 56 | |
Antonio Nino Diaz | 1486f3b | 2018-06-26 10:30:10 +0100 | [diff] [blame] | 57 | #endif /* CACTUS_TESTS_H */ |