Mistake on this page?
Report an issue in GitHub or email us
pal_common.h
Go to the documentation of this file.
1 /** @file
2  * Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved.
3  * SPDX-License-Identifier : Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 **/
17 
18 #ifndef _PAL_COMMON_H_
19 #define _PAL_COMMON_H_
20 
21 #include <string.h>
22 #include <stdint.h>
23 #include <stdlib.h>
24 #include <limits.h>
25 #include <stdarg.h>
26 
27 #ifndef PSA_PROTECTED_STORAGE_IMPLEMENTED
28 #define PSA_INTERNAL_TRUSTED_STORAGE_IMPLEMENTED 1 /* Use ITS by default */
29 #define ITS_TEST 1
30 #endif
31 
32 #include "pal_crypto_config.h"
33 #include "internal_trusted_storage.h"
34 
35 /* typedef's */
36 typedef uint8_t bool_t;
37 typedef uint32_t addr_t;
38 typedef uint32_t test_id_t;
39 typedef uint32_t block_id_t;
40 typedef char char8_t;
41 typedef uint32_t cfg_id_t;
42 
43 #define PAL_STATUS_UNSUPPORTED_FUNC 0xFF
44 
45 typedef enum
46 {
47  PAL_STATUS_SUCCESS = 0x0,
48  PAL_STATUS_ERROR = 0x80
49 } pal_status_t;
50 
51 typedef enum {
52  NVMEM_READ = 0x1,
53  NVMEM_WRITE = 0x2,
54 } nvmem_fn_type_t;
55 
56 typedef struct {
57  nvmem_fn_type_t nvmem_fn_type;
58  addr_t base;
59  uint32_t offset;
60  int size;
62 
63 typedef enum {
64  WD_INIT_SEQ = 0x1,
65  WD_ENABLE_SEQ = 0x2,
66  WD_DISABLE_SEQ = 0x3,
67  WD_STATUS_SEQ = 0x4,
68 } wd_fn_type_t;
69 
70 typedef enum {
71  WD_LOW_TIMEOUT = 0x1,
72  WD_MEDIUM_TIMEOUT = 0x2,
73  WD_HIGH_TIMEOUT = 0x3,
74  WD_CRYPTO_TIMEOUT = 0x4,
75 } wd_timeout_type_t;
76 
77 typedef struct {
78  wd_fn_type_t wd_fn_type;
79  addr_t wd_base_addr;
80  uint32_t wd_time_us;
81  uint32_t wd_timer_tick_us;
82 } wd_param_t;
83 
84 typedef enum {
85  UART_INIT = 0x1,
86  UART_PRINT = 0x2,
87 } uart_fn_type_t;
88 
89 /*
90  * Redefining some of the client.h elements for compilation to go through
91  * when PSA IPC APIs are not implemented.
92  */
93 #if (PSA_IPC_IMPLEMENTED == 0)
94 
95 #ifndef PSA_VERSION_NONE
96 #define PSA_VERSION_NONE (0)
97 #endif
98 
99 #ifndef PSA_SUCCESS
100 #define PSA_SUCCESS (0)
101 typedef int32_t psa_status_t;
102 #endif
103 typedef int32_t psa_handle_t;
104 
105 #ifndef PSA_NULL_HANDLE
106 #define PSA_NULL_HANDLE ((psa_handle_t)0)
107 #endif
108 
109 
110 #endif /* PSA_IPC_IMPLEMENTED */
111 
112 #endif /* _PAL_COMMON_H_ */
Copyright (c) 2019, Arm Limited or its affiliates.
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.