xref: /linux/drivers/media/platform/amphion/vpu_malone.h (revision 52990390f91c1c39ca742fc8f390b29891d95127)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright 2020-2021 NXP
4  */
5 
6 #ifndef _AMPHION_VPU_MALONE_H
7 #define _AMPHION_VPU_MALONE_H
8 
9 u32 vpu_malone_get_data_size(void);
10 void vpu_malone_init_rpc(struct vpu_shared_addr *shared,
11 			 struct vpu_buffer *rpc, dma_addr_t boot_addr);
12 void vpu_malone_set_log_buf(struct vpu_shared_addr *shared,
13 			    struct vpu_buffer *log);
14 void vpu_malone_set_system_cfg(struct vpu_shared_addr *shared,
15 			       u32 regs_base, void __iomem *regs, u32 core_id);
16 u32 vpu_malone_get_version(struct vpu_shared_addr *shared);
17 int vpu_malone_get_stream_buffer_size(struct vpu_shared_addr *shared);
18 int vpu_malone_config_stream_buffer(struct vpu_shared_addr *shared,
19 				    u32 instance, struct vpu_buffer *buf);
20 int vpu_malone_get_stream_buffer_desc(struct vpu_shared_addr *shared,
21 				      u32 instance,
22 				      struct vpu_rpc_buffer_desc *desc);
23 int vpu_malone_update_stream_buffer(struct vpu_shared_addr *shared,
24 				    u32 instance, u32 ptr, bool write);
25 int vpu_malone_set_decode_params(struct vpu_shared_addr *shared,
26 				 u32 instance,
27 				 struct vpu_decode_params *params, u32 update);
28 int vpu_malone_pack_cmd(struct vpu_rpc_event *pkt, u32 index, u32 id, void *data);
29 int vpu_malone_convert_msg_id(u32 msg_id);
30 int vpu_malone_unpack_msg_data(struct vpu_rpc_event *pkt, void *data);
31 int vpu_malone_add_scode(struct vpu_shared_addr *shared,
32 			 u32 instance,
33 			 struct vpu_buffer *stream_buffer,
34 			 u32 pixelformat,
35 			 u32 scode_type);
36 int vpu_malone_input_frame(struct vpu_shared_addr *shared,
37 			   struct vpu_inst *inst, struct vb2_buffer *vb);
38 bool vpu_malone_is_ready(struct vpu_shared_addr *shared, u32 instance);
39 int vpu_malone_pre_cmd(struct vpu_shared_addr *shared, u32 instance);
40 int vpu_malone_post_cmd(struct vpu_shared_addr *shared, u32 instance);
41 int vpu_malone_init_instance(struct vpu_shared_addr *shared, u32 instance);
42 u32 vpu_malone_get_max_instance_count(struct vpu_shared_addr *shared);
43 bool vpu_malone_check_fmt(enum vpu_core_type type, u32 pixelfmt);
44 void vpu_malone_enable_format(u32 pixelformat, int enable);
45 
46 #endif
47