1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2010 - 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef _IA_CSS_ISP_PARAM_H_
17 #define _IA_CSS_ISP_PARAM_H_
18 
19 #include <ia_css_err.h>
20 #include "ia_css_isp_param_types.h"
21 
22 /* Set functions for parameter memory descriptors */
23 void
24 ia_css_isp_param_set_mem_init(
25     struct ia_css_isp_param_host_segments *mem_init,
26     enum ia_css_param_class pclass,
27     enum ia_css_isp_memories mem,
28     char *address, size_t size);
29 
30 void
31 ia_css_isp_param_set_css_mem_init(
32     struct ia_css_isp_param_css_segments *mem_init,
33     enum ia_css_param_class pclass,
34     enum ia_css_isp_memories mem,
35     ia_css_ptr address, size_t size);
36 
37 void
38 ia_css_isp_param_set_isp_mem_init(
39     struct ia_css_isp_param_isp_segments *mem_init,
40     enum ia_css_param_class pclass,
41     enum ia_css_isp_memories mem,
42     u32 address, size_t size);
43 
44 /* Get functions for parameter memory descriptors */
45 const struct ia_css_host_data *
46 ia_css_isp_param_get_mem_init(
47     const struct ia_css_isp_param_host_segments *mem_init,
48     enum ia_css_param_class pclass,
49     enum ia_css_isp_memories mem);
50 
51 const struct ia_css_data *
52 ia_css_isp_param_get_css_mem_init(
53     const struct ia_css_isp_param_css_segments *mem_init,
54     enum ia_css_param_class pclass,
55     enum ia_css_isp_memories mem);
56 
57 const struct ia_css_isp_data *
58 ia_css_isp_param_get_isp_mem_init(
59     const struct ia_css_isp_param_isp_segments *mem_init,
60     enum ia_css_param_class pclass,
61     enum ia_css_isp_memories mem);
62 
63 /* Initialize the memory interface sizes and addresses */
64 void
65 ia_css_init_memory_interface(
66     struct ia_css_isp_param_css_segments *isp_mem_if,
67     const struct ia_css_isp_param_host_segments *mem_params,
68     const struct ia_css_isp_param_css_segments *css_params);
69 
70 /* Allocate memory parameters */
71 int
72 ia_css_isp_param_allocate_isp_parameters(
73     struct ia_css_isp_param_host_segments *mem_params,
74     struct ia_css_isp_param_css_segments *css_params,
75     const struct ia_css_isp_param_isp_segments *mem_initializers);
76 
77 /* Destroy memory parameters */
78 void
79 ia_css_isp_param_destroy_isp_parameters(
80     struct ia_css_isp_param_host_segments *mem_params,
81     struct ia_css_isp_param_css_segments *css_params);
82 
83 /* Load fw parameters */
84 void
85 ia_css_isp_param_load_fw_params(
86     const char *fw,
87     union ia_css_all_memory_offsets *mem_offsets,
88     const struct ia_css_isp_param_memory_offsets *memory_offsets,
89     bool init);
90 
91 /* Copy host parameter images to ddr */
92 int
93 ia_css_isp_param_copy_isp_mem_if_to_ddr(
94     struct ia_css_isp_param_css_segments *ddr,
95     const struct ia_css_isp_param_host_segments *host,
96     enum ia_css_param_class pclass);
97 
98 /* Enable a pipeline by setting the control field in the isp dmem parameters */
99 void
100 ia_css_isp_param_enable_pipeline(
101     const struct ia_css_isp_param_host_segments *mem_params);
102 
103 #endif /* _IA_CSS_ISP_PARAM_H_ */
104