dm writecache: add cond_resched to loop in persistent_memory_claim()
[linux/fpc-iii.git] / drivers / crypto / ccp / psp-dev.h
blobef38e4135d810ff44f4006af8858be16c7aa8e47
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * AMD Platform Security Processor (PSP) interface driver
5 * Copyright (C) 2017-2019 Advanced Micro Devices, Inc.
7 * Author: Brijesh Singh <brijesh.singh@amd.com>
8 */
10 #ifndef __PSP_DEV_H__
11 #define __PSP_DEV_H__
13 #include <linux/device.h>
14 #include <linux/list.h>
15 #include <linux/bits.h>
16 #include <linux/interrupt.h>
18 #include "sp-dev.h"
20 #define PSP_CMDRESP_RESP BIT(31)
21 #define PSP_CMDRESP_ERR_MASK 0xffff
23 #define MAX_PSP_NAME_LEN 16
25 extern struct psp_device *psp_master;
27 typedef void (*psp_irq_handler_t)(int, void *, unsigned int);
29 struct psp_device {
30 struct list_head entry;
32 struct psp_vdata *vdata;
33 char name[MAX_PSP_NAME_LEN];
35 struct device *dev;
36 struct sp_device *sp;
38 void __iomem *io_regs;
40 psp_irq_handler_t sev_irq_handler;
41 void *sev_irq_data;
43 psp_irq_handler_t tee_irq_handler;
44 void *tee_irq_data;
46 void *sev_data;
47 void *tee_data;
50 void psp_set_sev_irq_handler(struct psp_device *psp, psp_irq_handler_t handler,
51 void *data);
52 void psp_clear_sev_irq_handler(struct psp_device *psp);
54 void psp_set_tee_irq_handler(struct psp_device *psp, psp_irq_handler_t handler,
55 void *data);
56 void psp_clear_tee_irq_handler(struct psp_device *psp);
58 struct psp_device *psp_get_master_device(void);
60 #endif /* __PSP_DEV_H */