summaryrefslogtreecommitdiffstats
path: root/src/soc/amd/mendocino/psp_verstage/svc.h
blob: 941fa763a88e52acffc815254407247beff6a154 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* SPDX-License-Identifier: GPL-2.0-only */

/* TODO: Check if this is still correct */

#ifndef PSP_VERSTAGE_SVC_H
#define PSP_VERSTAGE_SVC_H

#include <bl_uapp/bl_syscall_public.h>
#include <types.h>

#define SVC_CALL4(SVC_ID, R0, R1, R2, R3, Ret) \
	__asm__ __volatile__ ( \
	"mov r0, %[reg0]\n\t" \
	"mov r1, %[reg1]\n\t" \
	"mov r2, %[reg2]\n\t" \
	"mov r3, %[reg3]\n\t" \
	"svc %[id]\n\t" \
	"mov %[result], r0\n\t" \
	: [result] "=r" (Ret) /* output */ \
	: [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2), \
		[reg3] "r" (R3) /* input(s) */ \
	: "r0", "r1", "r2", "r3", "memory", "cc" /* list of clobbered registers */)

#define SVC_CALL3(SVC_ID, R0,  R1, R2, Ret) \
	__asm__ __volatile__ ( \
	"mov r0, %[reg0]\n\t" \
	"mov r1, %[reg1]\n\t" \
	"mov r2, %[reg2]\n\t" \
	"svc %[id]\n\t" \
	"mov %[result], r0\n\t" \
	: [result] "=r" (Ret) /* output */ \
	: [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1), [reg2] "r" (R2) \
	: "r0", "r1", "r2", "memory", "cc" /* list of clobbered registers */)

#define SVC_CALL2(SVC_ID, R0, R1, Ret) \
	__asm__ __volatile__ ( \
	"mov r0, %[reg0]\n\t" \
	"mov r1, %[reg1]\n\t" \
	"svc %[id]\n\t" \
	"mov %[result], r0\n\t" \
	: [result] "=r" (Ret) /* output */ \
	: [id] "i" (SVC_ID), [reg0] "r" (R0), [reg1] "r" (R1)/* input(s) */ \
	: "r0", "r1", "memory", "cc" /* list of clobbered registers */)

#define SVC_CALL1(SVC_ID, R0, Ret) \
	__asm__ __volatile__ ( \
	"mov r0, %[reg0]\n\t" \
	"svc %[id]\n\t" \
	"mov %[result], r0\n\t" \
	: [result] "=r" (Ret) /* output */ \
	: [id] "i" (SVC_ID), [reg0] "r" (R0) /* input(s) */ \
	: "r0", "memory", "cc" /* list of clobbered registers */)

#define SVC_CALL0(SVC_ID, Ret) \
	__asm__ __volatile__ ( \
	"svc %[id]\n\t" \
	"mov %[result], r0\n\t" \
	: [result] "=r" (Ret) /* output */ \
	: [id] "I" (SVC_ID) /* input(s) */ \
	: "memory", "cc" /* list of clobbered registers */)

struct cmd_param_sha {
	struct sha_generic_data *ptr_sha_op;
};

struct cmd_param_debug {
	char *debug_buffer;
	uint32_t debug_buffer_len;
};

struct cmd_param_debug_ex {
	uint32_t word0;
	uint32_t word1;
	uint32_t word2;
	uint32_t word3;
};

struct cmd_param_modexp {
	struct mod_exp_params *ptr_modexp;
};

struct cmd_param_psp_update {
	unsigned int *ptr_psp_dir_addr;
};

struct cmd_param_spirom_info {
	struct spirom_info *ptr_spirom_info;
};

struct cmd_param_map_spirom {
	unsigned int spirom_addr;
	unsigned int size;
	void **ppspirom_addr_axi;
};

struct cmd_param_unmap_spirom {
	void *ptr_spirom_addr_axi;
};

struct cmd_param_read_timer_val {
	enum psp_timer_type timer_type;
	uint64_t *ptr_counter_value;
};

struct cmd_param_delay_in_micro_second {
	uint32_t delay;
};

struct cmd_param_reset_system {
	uint32_t reset_type;
};

struct cmd_param_get_boot_mode {
	unsigned int *ptr_boot_mode;
};

struct cmd_param_copy_data_from_uapp {
	unsigned int address;
	unsigned int size;
};

struct cmd_param_map_fch_io_device {
	enum fch_io_device io_device;
	unsigned int arg1;
	unsigned int arg2;
	void **pptr_io_device_addr_axi;
};

struct cmd_param_unmap_fch_io_device {
	enum fch_io_device io_device;
	void *ptr_io_device_addr_axi;
};

struct cmd_param_ccp_dma {
	uint32_t spi_offset;
	uint32_t dst_addr;
	uint32_t size;
};

struct cmd_param_set_platform_boot_mode {
	uint32_t boot_mode;
};

#endif /* PSP_VERSTAGE_SVC_H */