xref: /linux/drivers/gpu/drm/xe/xe_pcode.h (revision dd08ebf6c3525a7ea2186e636df064ea47281987)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2022 Intel Corporation
4  */
5 
6 #ifndef _XE_PCODE_H_
7 #define _XE_PCODE_H_
8 
9 #include <linux/types.h>
10 struct xe_gt;
11 
12 int xe_pcode_probe(struct xe_gt *gt);
13 int xe_pcode_init(struct xe_gt *gt);
14 int xe_pcode_init_min_freq_table(struct xe_gt *gt, u32 min_gt_freq,
15 				 u32 max_gt_freq);
16 int xe_pcode_read(struct xe_gt *gt, u32 mbox, u32 *val, u32 *val1);
17 int xe_pcode_write_timeout(struct xe_gt *gt, u32 mbox, u32 val,
18 			   int timeout_ms);
19 #define xe_pcode_write(gt, mbox, val) \
20 	xe_pcode_write_timeout(gt, mbox, val, 1)
21 
22 int xe_pcode_request(struct xe_gt *gt, u32 mbox, u32 request,
23 		     u32 reply_mask, u32 reply, int timeout_ms);
24 
25 #endif
26