2 * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 * Function naming determines intended use:
19 * <x>_r(void) : Returns the offset for register <x>.
21 * <x>_o(void) : Returns the offset for element <x>.
23 * <x>_w(void) : Returns the word offset for word (4 byte) element <x>.
25 * <x>_<y>_s(void) : Returns size of field <y> of register <x> in bits.
27 * <x>_<y>_f(u32 v) : Returns a value based on 'v' which has been shifted
28 * and masked to place it at field <y> of register <x>. This value
29 * can be |'d with others to produce a full register value for
32 * <x>_<y>_m(void) : Returns a mask for field <y> of register <x>. This
33 * value can be ~'d and then &'d to clear the value of field <y> for
36 * <x>_<y>_<z>_f(void) : Returns the constant value <z> after being shifted
37 * to place it at field <y> of register <x>. This value can be |'d
38 * with others to produce a full register value for <x>.
40 * <x>_<y>_v(u32 r) : Returns the value of field <y> from a full register
41 * <x> value 'r' after being shifted to place its LSB at bit 0.
42 * This value is suitable for direct comparison with other unshifted
43 * values appropriate for use in field <y> of register <x>.
45 * <x>_<y>_<z>_v(void) : Returns the constant value for <z> defined for
46 * field <y> of register <x>. This value is suitable for direct
47 * comparison with unshifted values appropriate for use in field <y>
50 #ifndef _hw_ctxsw_prog_gk20a_h_
51 #define _hw_ctxsw_prog_gk20a_h_
53 static inline u32 ctxsw_prog_fecs_header_v(void)
57 static inline u32 ctxsw_prog_main_image_num_gpcs_o(void)
61 static inline u32 ctxsw_prog_main_image_patch_count_o(void)
65 static inline u32 ctxsw_prog_main_image_patch_adr_lo_o(void)
69 static inline u32 ctxsw_prog_main_image_patch_adr_hi_o(void)
73 static inline u32 ctxsw_prog_main_image_zcull_o(void)
77 static inline u32 ctxsw_prog_main_image_zcull_mode_no_ctxsw_v(void)
81 static inline u32 ctxsw_prog_main_image_zcull_mode_separate_buffer_v(void)
85 static inline u32 ctxsw_prog_main_image_zcull_ptr_o(void)
89 static inline u32 ctxsw_prog_main_image_pm_o(void)
93 static inline u32 ctxsw_prog_main_image_pm_mode_m(void)
97 static inline u32 ctxsw_prog_main_image_pm_mode_no_ctxsw_f(void)
101 static inline u32 ctxsw_prog_main_image_pm_smpc_mode_m(void)
105 static inline u32 ctxsw_prog_main_image_pm_smpc_mode_ctxsw_f(void)
109 static inline u32 ctxsw_prog_main_image_pm_smpc_mode_no_ctxsw_f(void)
113 static inline u32 ctxsw_prog_main_image_pm_ptr_o(void)
117 static inline u32 ctxsw_prog_main_image_num_save_ops_o(void)
121 static inline u32 ctxsw_prog_main_image_num_restore_ops_o(void)
125 static inline u32 ctxsw_prog_main_image_magic_value_o(void)
129 static inline u32 ctxsw_prog_main_image_magic_value_v_value_v(void)
133 static inline u32 ctxsw_prog_local_priv_register_ctl_o(void)
137 static inline u32 ctxsw_prog_local_priv_register_ctl_offset_v(u32 r)
139 return (r >> 0) & 0xffff;
141 static inline u32 ctxsw_prog_local_image_ppc_info_o(void)
145 static inline u32 ctxsw_prog_local_image_ppc_info_num_ppcs_v(u32 r)
147 return (r >> 0) & 0xffff;
149 static inline u32 ctxsw_prog_local_image_ppc_info_ppc_mask_v(u32 r)
151 return (r >> 16) & 0xffff;
153 static inline u32 ctxsw_prog_local_image_num_tpcs_o(void)
157 static inline u32 ctxsw_prog_local_magic_value_o(void)
161 static inline u32 ctxsw_prog_local_magic_value_v_value_v(void)
165 static inline u32 ctxsw_prog_main_extended_buffer_ctl_o(void)
169 static inline u32 ctxsw_prog_main_extended_buffer_ctl_offset_v(u32 r)
171 return (r >> 0) & 0xffff;
173 static inline u32 ctxsw_prog_main_extended_buffer_ctl_size_v(u32 r)
175 return (r >> 16) & 0xff;
177 static inline u32 ctxsw_prog_extended_buffer_segments_size_in_bytes_v(void)
181 static inline u32 ctxsw_prog_extended_marker_size_in_bytes_v(void)
185 static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_register_stride_v(void)
189 static inline u32 ctxsw_prog_extended_sm_dsm_perf_counter_control_register_stride_v(void)
193 static inline u32 ctxsw_prog_extended_num_smpc_quadrants_v(void)
197 static inline u32 ctxsw_prog_main_image_priv_access_map_config_o(void)
201 static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_s(void)
205 static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_f(u32 v)
207 return (v & 0x3) << 0;
209 static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_m(void)
213 static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_v(u32 r)
215 return (r >> 0) & 0x3;
217 static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_allow_all_f(void)
221 static inline u32 ctxsw_prog_main_image_priv_access_map_config_mode_use_map_f(void)
225 static inline u32 ctxsw_prog_main_image_priv_access_map_addr_lo_o(void)
229 static inline u32 ctxsw_prog_main_image_priv_access_map_addr_hi_o(void)
233 static inline u32 ctxsw_prog_main_image_misc_options_o(void)
237 static inline u32 ctxsw_prog_main_image_misc_options_verif_features_m(void)
241 static inline u32 ctxsw_prog_main_image_misc_options_verif_features_disabled_f(void)