hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/ccp/sp-dev.h
....@@ -1,22 +1,18 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * AMD Secure Processor driver
34 *
4
- * Copyright (C) 2017 Advanced Micro Devices, Inc.
5
+ * Copyright (C) 2017-2019 Advanced Micro Devices, Inc.
56 *
67 * Author: Tom Lendacky <thomas.lendacky@amd.com>
78 * Author: Gary R Hook <gary.hook@amd.com>
89 * Author: Brijesh Singh <brijesh.singh@amd.com>
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as
12
- * published by the Free Software Foundation.
1310 */
1411
1512 #ifndef __SP_DEV_H__
1613 #define __SP_DEV_H__
1714
1815 #include <linux/device.h>
19
-#include <linux/pci.h>
2016 #include <linux/spinlock.h>
2117 #include <linux/mutex.h>
2218 #include <linux/list.h>
....@@ -43,10 +39,23 @@
4339 const unsigned int rsamax;
4440 };
4541
46
-struct psp_vdata {
42
+struct sev_vdata {
4743 const unsigned int cmdresp_reg;
4844 const unsigned int cmdbuff_addr_lo_reg;
4945 const unsigned int cmdbuff_addr_hi_reg;
46
+};
47
+
48
+struct tee_vdata {
49
+ const unsigned int cmdresp_reg;
50
+ const unsigned int cmdbuff_addr_lo_reg;
51
+ const unsigned int cmdbuff_addr_hi_reg;
52
+ const unsigned int ring_wptr_reg;
53
+ const unsigned int ring_rptr_reg;
54
+};
55
+
56
+struct psp_vdata {
57
+ const struct sev_vdata *sev;
58
+ const struct tee_vdata *tee;
5059 const unsigned int feature_reg;
5160 const unsigned int inten_reg;
5261 const unsigned int intsts_reg;
....@@ -81,6 +90,7 @@
8190 /* get and set master device */
8291 struct sp_device*(*get_psp_master_device)(void);
8392 void (*set_psp_master_device)(struct sp_device *);
93
+ void (*clear_psp_master_device)(struct sp_device *);
8494
8595 bool irq_registered;
8696 bool use_tasklet;
....@@ -109,7 +119,7 @@
109119 void sp_destroy(struct sp_device *sp);
110120 struct sp_device *sp_get_master(void);
111121
112
-int sp_suspend(struct sp_device *sp, pm_message_t state);
122
+int sp_suspend(struct sp_device *sp);
113123 int sp_resume(struct sp_device *sp);
114124 int sp_request_ccp_irq(struct sp_device *sp, irq_handler_t handler,
115125 const char *name, void *data);
....@@ -124,7 +134,7 @@
124134 int ccp_dev_init(struct sp_device *sp);
125135 void ccp_dev_destroy(struct sp_device *sp);
126136
127
-int ccp_dev_suspend(struct sp_device *sp, pm_message_t state);
137
+int ccp_dev_suspend(struct sp_device *sp);
128138 int ccp_dev_resume(struct sp_device *sp);
129139
130140 #else /* !CONFIG_CRYPTO_DEV_SP_CCP */
....@@ -135,7 +145,7 @@
135145 }
136146 static inline void ccp_dev_destroy(struct sp_device *sp) { }
137147
138
-static inline int ccp_dev_suspend(struct sp_device *sp, pm_message_t state)
148
+static inline int ccp_dev_suspend(struct sp_device *sp)
139149 {
140150 return 0;
141151 }