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 "internal_trusted_storage.h"
33 
34 /* typedef's */
35 typedef uint8_t bool_t;
36 typedef uint32_t addr_t;
37 typedef uint32_t test_id_t;
38 typedef uint32_t block_id_t;
39 typedef char char8_t;
40 typedef uint32_t cfg_id_t;
41 
42 #define PAL_STATUS_UNSUPPORTED_FUNC 0xFF
43 
44 typedef enum
45 {
46  PAL_STATUS_SUCCESS = 0x0,
47  PAL_STATUS_ERROR = 0x80
48 } pal_status_t;
49 
50 typedef enum {
51  NVMEM_READ = 0x1,
52  NVMEM_WRITE = 0x2,
53 } nvmem_fn_type_t;
54 
55 typedef struct {
56  nvmem_fn_type_t nvmem_fn_type;
57  addr_t base;
58  uint32_t offset;
59  int size;
61 
62 typedef enum {
63  WD_INIT_SEQ = 0x1,
64  WD_ENABLE_SEQ = 0x2,
65  WD_DISABLE_SEQ = 0x3,
66  WD_STATUS_SEQ = 0x4,
67 } wd_fn_type_t;
68 
69 typedef enum {
70  WD_LOW_TIMEOUT = 0x1,
71  WD_MEDIUM_TIMEOUT = 0x2,
72  WD_HIGH_TIMEOUT = 0x3,
73  WD_CRYPTO_TIMEOUT = 0x4,
74 } wd_timeout_type_t;
75 
76 typedef struct {
77  wd_fn_type_t wd_fn_type;
78  addr_t wd_base_addr;
79  uint32_t wd_time_us;
80  uint32_t wd_timer_tick_us;
81 } wd_param_t;
82 
83 typedef enum {
84  UART_INIT = 0x1,
85  UART_PRINT = 0x2,
86 } uart_fn_type_t;
87 
88 /*
89  * Redefining some of the client.h elements for compilation to go through
90  * when PSA IPC APIs are not implemented.
91  */
92 #if (PSA_IPC_IMPLEMENTED == 0)
93 
94 #ifndef PSA_VERSION_NONE
95 #define PSA_VERSION_NONE (0)
96 #endif
97 
98 typedef int32_t psa_handle_t;
99 
100 #ifndef PSA_NULL_HANDLE
101 #define PSA_NULL_HANDLE ((psa_handle_t)0)
102 #endif
103 
104 
105 #endif /* PSA_IPC_IMPLEMENTED */
106 
107 #endif /* _PAL_COMMON_H_ */
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.