1fbb6c848SEzequiel Garcia /* SPDX-License-Identifier: GPL-2.0-only */ 2fbb6c848SEzequiel Garcia /* 3fbb6c848SEzequiel Garcia * Copyright (c) 2021, Collabora 4fbb6c848SEzequiel Garcia * 5fbb6c848SEzequiel Garcia * Author: Benjamin Gaignard <benjamin.gaignard@collabora.com> 6fbb6c848SEzequiel Garcia */ 7fbb6c848SEzequiel Garcia 8fbb6c848SEzequiel Garcia #ifndef HANTRO_G2_REGS_H_ 9fbb6c848SEzequiel Garcia #define HANTRO_G2_REGS_H_ 10fbb6c848SEzequiel Garcia 11fbb6c848SEzequiel Garcia #include "hantro.h" 12fbb6c848SEzequiel Garcia 13fbb6c848SEzequiel Garcia #define G2_SWREG(nr) ((nr) * 4) 14fbb6c848SEzequiel Garcia 15fbb6c848SEzequiel Garcia #define G2_DEC_REG(b, s, m) \ 16fbb6c848SEzequiel Garcia ((const struct hantro_reg) { \ 17fbb6c848SEzequiel Garcia .base = G2_SWREG(b), \ 18fbb6c848SEzequiel Garcia .shift = s, \ 19fbb6c848SEzequiel Garcia .mask = m, \ 20fbb6c848SEzequiel Garcia }) 21fbb6c848SEzequiel Garcia 22fbb6c848SEzequiel Garcia #define G2_REG_VERSION G2_SWREG(0) 23fbb6c848SEzequiel Garcia 24fbb6c848SEzequiel Garcia #define G2_REG_INTERRUPT G2_SWREG(1) 25fbb6c848SEzequiel Garcia #define G2_REG_INTERRUPT_DEC_RDY_INT BIT(12) 26fbb6c848SEzequiel Garcia #define G2_REG_INTERRUPT_DEC_ABORT_E BIT(5) 27fbb6c848SEzequiel Garcia #define G2_REG_INTERRUPT_DEC_IRQ_DIS BIT(4) 28fbb6c848SEzequiel Garcia #define G2_REG_INTERRUPT_DEC_E BIT(0) 29fbb6c848SEzequiel Garcia 30fbb6c848SEzequiel Garcia #define HEVC_DEC_MODE 0xc 31fbb6c848SEzequiel Garcia #define VP9_DEC_MODE 0xd 32fbb6c848SEzequiel Garcia 33fbb6c848SEzequiel Garcia #define BUS_WIDTH_32 0 34fbb6c848SEzequiel Garcia #define BUS_WIDTH_64 1 35fbb6c848SEzequiel Garcia #define BUS_WIDTH_128 2 36fbb6c848SEzequiel Garcia #define BUS_WIDTH_256 3 37fbb6c848SEzequiel Garcia 38fbb6c848SEzequiel Garcia #define g2_strm_swap G2_DEC_REG(2, 28, 0xf) 39fbb6c848SEzequiel Garcia #define g2_strm_swap_old G2_DEC_REG(2, 27, 0x1f) 40fbb6c848SEzequiel Garcia #define g2_pic_swap G2_DEC_REG(2, 22, 0x1f) 41fbb6c848SEzequiel Garcia #define g2_dirmv_swap G2_DEC_REG(2, 20, 0xf) 42fbb6c848SEzequiel Garcia #define g2_dirmv_swap_old G2_DEC_REG(2, 17, 0x1f) 43fbb6c848SEzequiel Garcia #define g2_tab0_swap_old G2_DEC_REG(2, 12, 0x1f) 44fbb6c848SEzequiel Garcia #define g2_tab1_swap_old G2_DEC_REG(2, 7, 0x1f) 45fbb6c848SEzequiel Garcia #define g2_tab2_swap_old G2_DEC_REG(2, 2, 0x1f) 46fbb6c848SEzequiel Garcia 47fbb6c848SEzequiel Garcia #define g2_mode G2_DEC_REG(3, 27, 0x1f) 48fbb6c848SEzequiel Garcia #define g2_compress_swap G2_DEC_REG(3, 20, 0xf) 49fbb6c848SEzequiel Garcia #define g2_ref_compress_bypass G2_DEC_REG(3, 17, 0x1) 50fbb6c848SEzequiel Garcia #define g2_out_rs_e G2_DEC_REG(3, 16, 0x1) 51fbb6c848SEzequiel Garcia #define g2_out_dis G2_DEC_REG(3, 15, 0x1) 52fbb6c848SEzequiel Garcia #define g2_out_filtering_dis G2_DEC_REG(3, 14, 0x1) 53fbb6c848SEzequiel Garcia #define g2_write_mvs_e G2_DEC_REG(3, 12, 0x1) 54fbb6c848SEzequiel Garcia #define g2_tab3_swap_old G2_DEC_REG(3, 7, 0x1f) 55fbb6c848SEzequiel Garcia #define g2_rscan_swap G2_DEC_REG(3, 2, 0x1f) 56fbb6c848SEzequiel Garcia 57fbb6c848SEzequiel Garcia #define g2_pic_width_in_cbs G2_DEC_REG(4, 19, 0x1fff) 58fbb6c848SEzequiel Garcia #define g2_pic_height_in_cbs G2_DEC_REG(4, 6, 0x1fff) 59fbb6c848SEzequiel Garcia #define g2_num_ref_frames G2_DEC_REG(4, 0, 0x1f) 60fbb6c848SEzequiel Garcia 61fbb6c848SEzequiel Garcia #define g2_start_bit G2_DEC_REG(5, 25, 0x7f) 62fbb6c848SEzequiel Garcia #define g2_scaling_list_e G2_DEC_REG(5, 24, 0x1) 63fbb6c848SEzequiel Garcia #define g2_cb_qp_offset G2_DEC_REG(5, 19, 0x1f) 64fbb6c848SEzequiel Garcia #define g2_cr_qp_offset G2_DEC_REG(5, 14, 0x1f) 65fbb6c848SEzequiel Garcia #define g2_sign_data_hide G2_DEC_REG(5, 12, 0x1) 66fbb6c848SEzequiel Garcia #define g2_tempor_mvp_e G2_DEC_REG(5, 11, 0x1) 67fbb6c848SEzequiel Garcia #define g2_max_cu_qpd_depth G2_DEC_REG(5, 5, 0x3f) 68fbb6c848SEzequiel Garcia #define g2_cu_qpd_e G2_DEC_REG(5, 4, 0x1) 69fbb6c848SEzequiel Garcia #define g2_pix_shift G2_DEC_REG(5, 0, 0xf) 70fbb6c848SEzequiel Garcia 71fbb6c848SEzequiel Garcia #define g2_stream_len G2_DEC_REG(6, 0, 0xffffffff) 72fbb6c848SEzequiel Garcia 73fbb6c848SEzequiel Garcia #define g2_cabac_init_present G2_DEC_REG(7, 31, 0x1) 74fbb6c848SEzequiel Garcia #define g2_weight_pred_e G2_DEC_REG(7, 28, 0x1) 75fbb6c848SEzequiel Garcia #define g2_weight_bipr_idc G2_DEC_REG(7, 26, 0x3) 76fbb6c848SEzequiel Garcia #define g2_filter_over_slices G2_DEC_REG(7, 25, 0x1) 77fbb6c848SEzequiel Garcia #define g2_filter_over_tiles G2_DEC_REG(7, 24, 0x1) 78fbb6c848SEzequiel Garcia #define g2_asym_pred_e G2_DEC_REG(7, 23, 0x1) 79fbb6c848SEzequiel Garcia #define g2_sao_e G2_DEC_REG(7, 22, 0x1) 80fbb6c848SEzequiel Garcia #define g2_pcm_filt_d G2_DEC_REG(7, 21, 0x1) 81fbb6c848SEzequiel Garcia #define g2_slice_chqp_present G2_DEC_REG(7, 20, 0x1) 82fbb6c848SEzequiel Garcia #define g2_dependent_slice G2_DEC_REG(7, 19, 0x1) 83fbb6c848SEzequiel Garcia #define g2_filter_override G2_DEC_REG(7, 18, 0x1) 84fbb6c848SEzequiel Garcia #define g2_strong_smooth_e G2_DEC_REG(7, 17, 0x1) 85fbb6c848SEzequiel Garcia #define g2_filt_offset_beta G2_DEC_REG(7, 12, 0x1f) 86fbb6c848SEzequiel Garcia #define g2_filt_offset_tc G2_DEC_REG(7, 7, 0x1f) 87fbb6c848SEzequiel Garcia #define g2_slice_hdr_ext_e G2_DEC_REG(7, 6, 0x1) 88fbb6c848SEzequiel Garcia #define g2_slice_hdr_ext_bits G2_DEC_REG(7, 3, 0x7) 89fbb6c848SEzequiel Garcia 90fbb6c848SEzequiel Garcia #define g2_const_intra_e G2_DEC_REG(8, 31, 0x1) 91fbb6c848SEzequiel Garcia #define g2_filt_ctrl_pres G2_DEC_REG(8, 30, 0x1) 92fbb6c848SEzequiel Garcia #define g2_bit_depth_y G2_DEC_REG(8, 21, 0xf) 93fbb6c848SEzequiel Garcia #define g2_bit_depth_c G2_DEC_REG(8, 17, 0xf) 94fbb6c848SEzequiel Garcia #define g2_idr_pic_e G2_DEC_REG(8, 16, 0x1) 95fbb6c848SEzequiel Garcia #define g2_bit_depth_pcm_y G2_DEC_REG(8, 12, 0xf) 96fbb6c848SEzequiel Garcia #define g2_bit_depth_pcm_c G2_DEC_REG(8, 8, 0xf) 97fbb6c848SEzequiel Garcia #define g2_bit_depth_y_minus8 G2_DEC_REG(8, 6, 0x3) 98fbb6c848SEzequiel Garcia #define g2_bit_depth_c_minus8 G2_DEC_REG(8, 4, 0x3) 99fbb6c848SEzequiel Garcia #define g2_rs_out_bit_depth G2_DEC_REG(8, 4, 0xf) 100fbb6c848SEzequiel Garcia #define g2_output_8_bits G2_DEC_REG(8, 3, 0x1) 101fbb6c848SEzequiel Garcia #define g2_output_format G2_DEC_REG(8, 0, 0x7) 102fbb6c848SEzequiel Garcia #define g2_pp_pix_shift G2_DEC_REG(8, 0, 0xf) 103fbb6c848SEzequiel Garcia 104fbb6c848SEzequiel Garcia #define g2_refidx1_active G2_DEC_REG(9, 19, 0x1f) 105fbb6c848SEzequiel Garcia #define g2_refidx0_active G2_DEC_REG(9, 14, 0x1f) 106fbb6c848SEzequiel Garcia #define g2_hdr_skip_length G2_DEC_REG(9, 0, 0x3fff) 107fbb6c848SEzequiel Garcia 108fbb6c848SEzequiel Garcia #define g2_start_code_e G2_DEC_REG(10, 31, 0x1) 109fbb6c848SEzequiel Garcia #define g2_init_qp_old G2_DEC_REG(10, 25, 0x3f) 110fbb6c848SEzequiel Garcia #define g2_init_qp G2_DEC_REG(10, 24, 0x7f) 111fbb6c848SEzequiel Garcia #define g2_num_tile_cols_old G2_DEC_REG(10, 20, 0x1f) 112fbb6c848SEzequiel Garcia #define g2_num_tile_cols G2_DEC_REG(10, 19, 0x1f) 113fbb6c848SEzequiel Garcia #define g2_num_tile_rows_old G2_DEC_REG(10, 15, 0x1f) 114fbb6c848SEzequiel Garcia #define g2_num_tile_rows G2_DEC_REG(10, 14, 0x1f) 115fbb6c848SEzequiel Garcia #define g2_tile_e G2_DEC_REG(10, 1, 0x1) 116fbb6c848SEzequiel Garcia #define g2_entropy_sync_e G2_DEC_REG(10, 0, 0x1) 117fbb6c848SEzequiel Garcia 118fbb6c848SEzequiel Garcia #define vp9_transform_mode G2_DEC_REG(11, 27, 0x7) 119fbb6c848SEzequiel Garcia #define vp9_filt_sharpness G2_DEC_REG(11, 21, 0x7) 120fbb6c848SEzequiel Garcia #define vp9_mcomp_filt_type G2_DEC_REG(11, 8, 0x7) 121fbb6c848SEzequiel Garcia #define vp9_high_prec_mv_e G2_DEC_REG(11, 7, 0x1) 122fbb6c848SEzequiel Garcia #define vp9_comp_pred_mode G2_DEC_REG(11, 4, 0x3) 123fbb6c848SEzequiel Garcia #define vp9_gref_sign_bias G2_DEC_REG(11, 2, 0x1) 124fbb6c848SEzequiel Garcia #define vp9_aref_sign_bias G2_DEC_REG(11, 0, 0x1) 125fbb6c848SEzequiel Garcia 126fbb6c848SEzequiel Garcia #define g2_refer_lterm_e G2_DEC_REG(12, 16, 0xffff) 127fbb6c848SEzequiel Garcia #define g2_min_cb_size G2_DEC_REG(12, 13, 0x7) 128fbb6c848SEzequiel Garcia #define g2_max_cb_size G2_DEC_REG(12, 10, 0x7) 129fbb6c848SEzequiel Garcia #define g2_min_pcm_size G2_DEC_REG(12, 7, 0x7) 130fbb6c848SEzequiel Garcia #define g2_max_pcm_size G2_DEC_REG(12, 4, 0x7) 131fbb6c848SEzequiel Garcia #define g2_pcm_e G2_DEC_REG(12, 3, 0x1) 132fbb6c848SEzequiel Garcia #define g2_transform_skip G2_DEC_REG(12, 2, 0x1) 133fbb6c848SEzequiel Garcia #define g2_transq_bypass G2_DEC_REG(12, 1, 0x1) 134fbb6c848SEzequiel Garcia #define g2_list_mod_e G2_DEC_REG(12, 0, 0x1) 135fbb6c848SEzequiel Garcia 136fbb6c848SEzequiel Garcia #define hevc_min_trb_size G2_DEC_REG(13, 13, 0x7) 137fbb6c848SEzequiel Garcia #define hevc_max_trb_size G2_DEC_REG(13, 10, 0x7) 138fbb6c848SEzequiel Garcia #define hevc_max_intra_hierdepth G2_DEC_REG(13, 7, 0x7) 139fbb6c848SEzequiel Garcia #define hevc_max_inter_hierdepth G2_DEC_REG(13, 4, 0x7) 140fbb6c848SEzequiel Garcia #define hevc_parallel_merge G2_DEC_REG(13, 0, 0xf) 141fbb6c848SEzequiel Garcia 142fbb6c848SEzequiel Garcia #define hevc_rlist_f0 G2_DEC_REG(14, 0, 0x1f) 143fbb6c848SEzequiel Garcia #define hevc_rlist_f1 G2_DEC_REG(14, 10, 0x1f) 144fbb6c848SEzequiel Garcia #define hevc_rlist_f2 G2_DEC_REG(14, 20, 0x1f) 145fbb6c848SEzequiel Garcia #define hevc_rlist_b0 G2_DEC_REG(14, 5, 0x1f) 146fbb6c848SEzequiel Garcia #define hevc_rlist_b1 G2_DEC_REG(14, 15, 0x1f) 147fbb6c848SEzequiel Garcia #define hevc_rlist_b2 G2_DEC_REG(14, 25, 0x1f) 148fbb6c848SEzequiel Garcia 149fbb6c848SEzequiel Garcia #define hevc_rlist_f3 G2_DEC_REG(15, 0, 0x1f) 150fbb6c848SEzequiel Garcia #define hevc_rlist_f4 G2_DEC_REG(15, 10, 0x1f) 151fbb6c848SEzequiel Garcia #define hevc_rlist_f5 G2_DEC_REG(15, 20, 0x1f) 152fbb6c848SEzequiel Garcia #define hevc_rlist_b3 G2_DEC_REG(15, 5, 0x1f) 153fbb6c848SEzequiel Garcia #define hevc_rlist_b4 G2_DEC_REG(15, 15, 0x1f) 154fbb6c848SEzequiel Garcia #define hevc_rlist_b5 G2_DEC_REG(15, 25, 0x1f) 155fbb6c848SEzequiel Garcia 156fbb6c848SEzequiel Garcia #define hevc_rlist_f6 G2_DEC_REG(16, 0, 0x1f) 157fbb6c848SEzequiel Garcia #define hevc_rlist_f7 G2_DEC_REG(16, 10, 0x1f) 158fbb6c848SEzequiel Garcia #define hevc_rlist_f8 G2_DEC_REG(16, 20, 0x1f) 159fbb6c848SEzequiel Garcia #define hevc_rlist_b6 G2_DEC_REG(16, 5, 0x1f) 160fbb6c848SEzequiel Garcia #define hevc_rlist_b7 G2_DEC_REG(16, 15, 0x1f) 161fbb6c848SEzequiel Garcia #define hevc_rlist_b8 G2_DEC_REG(16, 25, 0x1f) 162fbb6c848SEzequiel Garcia 163fbb6c848SEzequiel Garcia #define hevc_rlist_f9 G2_DEC_REG(17, 0, 0x1f) 164fbb6c848SEzequiel Garcia #define hevc_rlist_f10 G2_DEC_REG(17, 10, 0x1f) 165fbb6c848SEzequiel Garcia #define hevc_rlist_f11 G2_DEC_REG(17, 20, 0x1f) 166fbb6c848SEzequiel Garcia #define hevc_rlist_b9 G2_DEC_REG(17, 5, 0x1f) 167fbb6c848SEzequiel Garcia #define hevc_rlist_b10 G2_DEC_REG(17, 15, 0x1f) 168fbb6c848SEzequiel Garcia #define hevc_rlist_b11 G2_DEC_REG(17, 25, 0x1f) 169fbb6c848SEzequiel Garcia 170fbb6c848SEzequiel Garcia #define hevc_rlist_f12 G2_DEC_REG(18, 0, 0x1f) 171fbb6c848SEzequiel Garcia #define hevc_rlist_f13 G2_DEC_REG(18, 10, 0x1f) 172fbb6c848SEzequiel Garcia #define hevc_rlist_f14 G2_DEC_REG(18, 20, 0x1f) 173fbb6c848SEzequiel Garcia #define hevc_rlist_b12 G2_DEC_REG(18, 5, 0x1f) 174fbb6c848SEzequiel Garcia #define hevc_rlist_b13 G2_DEC_REG(18, 15, 0x1f) 175fbb6c848SEzequiel Garcia #define hevc_rlist_b14 G2_DEC_REG(18, 25, 0x1f) 176fbb6c848SEzequiel Garcia 177fbb6c848SEzequiel Garcia #define hevc_rlist_f15 G2_DEC_REG(19, 0, 0x1f) 178fbb6c848SEzequiel Garcia #define hevc_rlist_b15 G2_DEC_REG(19, 5, 0x1f) 179fbb6c848SEzequiel Garcia 180fbb6c848SEzequiel Garcia #define g2_partial_ctb_x G2_DEC_REG(20, 31, 0x1) 181fbb6c848SEzequiel Garcia #define g2_partial_ctb_y G2_DEC_REG(20, 30, 0x1) 182fbb6c848SEzequiel Garcia #define g2_pic_width_4x4 G2_DEC_REG(20, 16, 0xfff) 183fbb6c848SEzequiel Garcia #define g2_pic_height_4x4 G2_DEC_REG(20, 0, 0xfff) 184fbb6c848SEzequiel Garcia 185fbb6c848SEzequiel Garcia #define vp9_qp_delta_y_dc G2_DEC_REG(13, 23, 0x3f) 186fbb6c848SEzequiel Garcia #define vp9_qp_delta_ch_dc G2_DEC_REG(13, 17, 0x3f) 187fbb6c848SEzequiel Garcia #define vp9_qp_delta_ch_ac G2_DEC_REG(13, 11, 0x3f) 188fbb6c848SEzequiel Garcia #define vp9_last_sign_bias G2_DEC_REG(13, 10, 0x1) 189fbb6c848SEzequiel Garcia #define vp9_lossless_e G2_DEC_REG(13, 9, 0x1) 190fbb6c848SEzequiel Garcia #define vp9_comp_pred_var_ref1 G2_DEC_REG(13, 7, 0x3) 191fbb6c848SEzequiel Garcia #define vp9_comp_pred_var_ref0 G2_DEC_REG(13, 5, 0x3) 192fbb6c848SEzequiel Garcia #define vp9_comp_pred_fixed_ref G2_DEC_REG(13, 3, 0x3) 193fbb6c848SEzequiel Garcia #define vp9_segment_temp_upd_e G2_DEC_REG(13, 2, 0x1) 194fbb6c848SEzequiel Garcia #define vp9_segment_upd_e G2_DEC_REG(13, 1, 0x1) 195fbb6c848SEzequiel Garcia #define vp9_segment_e G2_DEC_REG(13, 0, 0x1) 196fbb6c848SEzequiel Garcia 197fbb6c848SEzequiel Garcia #define vp9_filt_level G2_DEC_REG(14, 18, 0x3f) 198fbb6c848SEzequiel Garcia #define vp9_refpic_seg0 G2_DEC_REG(14, 15, 0x7) 199fbb6c848SEzequiel Garcia #define vp9_skip_seg0 G2_DEC_REG(14, 14, 0x1) 200fbb6c848SEzequiel Garcia #define vp9_filt_level_seg0 G2_DEC_REG(14, 8, 0x3f) 201fbb6c848SEzequiel Garcia #define vp9_quant_seg0 G2_DEC_REG(14, 0, 0xff) 202fbb6c848SEzequiel Garcia 203fbb6c848SEzequiel Garcia #define vp9_refpic_seg1 G2_DEC_REG(15, 15, 0x7) 204fbb6c848SEzequiel Garcia #define vp9_skip_seg1 G2_DEC_REG(15, 14, 0x1) 205fbb6c848SEzequiel Garcia #define vp9_filt_level_seg1 G2_DEC_REG(15, 8, 0x3f) 206fbb6c848SEzequiel Garcia #define vp9_quant_seg1 G2_DEC_REG(15, 0, 0xff) 207fbb6c848SEzequiel Garcia 208fbb6c848SEzequiel Garcia #define vp9_refpic_seg2 G2_DEC_REG(16, 15, 0x7) 209fbb6c848SEzequiel Garcia #define vp9_skip_seg2 G2_DEC_REG(16, 14, 0x1) 210fbb6c848SEzequiel Garcia #define vp9_filt_level_seg2 G2_DEC_REG(16, 8, 0x3f) 211fbb6c848SEzequiel Garcia #define vp9_quant_seg2 G2_DEC_REG(16, 0, 0xff) 212fbb6c848SEzequiel Garcia 213fbb6c848SEzequiel Garcia #define vp9_refpic_seg3 G2_DEC_REG(17, 15, 0x7) 214fbb6c848SEzequiel Garcia #define vp9_skip_seg3 G2_DEC_REG(17, 14, 0x1) 215fbb6c848SEzequiel Garcia #define vp9_filt_level_seg3 G2_DEC_REG(17, 8, 0x3f) 216fbb6c848SEzequiel Garcia #define vp9_quant_seg3 G2_DEC_REG(17, 0, 0xff) 217fbb6c848SEzequiel Garcia 218fbb6c848SEzequiel Garcia #define vp9_refpic_seg4 G2_DEC_REG(18, 15, 0x7) 219fbb6c848SEzequiel Garcia #define vp9_skip_seg4 G2_DEC_REG(18, 14, 0x1) 220fbb6c848SEzequiel Garcia #define vp9_filt_level_seg4 G2_DEC_REG(18, 8, 0x3f) 221fbb6c848SEzequiel Garcia #define vp9_quant_seg4 G2_DEC_REG(18, 0, 0xff) 222fbb6c848SEzequiel Garcia 223fbb6c848SEzequiel Garcia #define vp9_refpic_seg5 G2_DEC_REG(19, 15, 0x7) 224fbb6c848SEzequiel Garcia #define vp9_skip_seg5 G2_DEC_REG(19, 14, 0x1) 225fbb6c848SEzequiel Garcia #define vp9_filt_level_seg5 G2_DEC_REG(19, 8, 0x3f) 226fbb6c848SEzequiel Garcia #define vp9_quant_seg5 G2_DEC_REG(19, 0, 0xff) 227fbb6c848SEzequiel Garcia 228fbb6c848SEzequiel Garcia #define hevc_cur_poc_00 G2_DEC_REG(46, 24, 0xff) 229fbb6c848SEzequiel Garcia #define hevc_cur_poc_01 G2_DEC_REG(46, 16, 0xff) 230fbb6c848SEzequiel Garcia #define hevc_cur_poc_02 G2_DEC_REG(46, 8, 0xff) 231fbb6c848SEzequiel Garcia #define hevc_cur_poc_03 G2_DEC_REG(46, 0, 0xff) 232fbb6c848SEzequiel Garcia 233fbb6c848SEzequiel Garcia #define hevc_cur_poc_04 G2_DEC_REG(47, 24, 0xff) 234fbb6c848SEzequiel Garcia #define hevc_cur_poc_05 G2_DEC_REG(47, 16, 0xff) 235fbb6c848SEzequiel Garcia #define hevc_cur_poc_06 G2_DEC_REG(47, 8, 0xff) 236fbb6c848SEzequiel Garcia #define hevc_cur_poc_07 G2_DEC_REG(47, 0, 0xff) 237fbb6c848SEzequiel Garcia 238fbb6c848SEzequiel Garcia #define hevc_cur_poc_08 G2_DEC_REG(48, 24, 0xff) 239fbb6c848SEzequiel Garcia #define hevc_cur_poc_09 G2_DEC_REG(48, 16, 0xff) 240fbb6c848SEzequiel Garcia #define hevc_cur_poc_10 G2_DEC_REG(48, 8, 0xff) 241fbb6c848SEzequiel Garcia #define hevc_cur_poc_11 G2_DEC_REG(48, 0, 0xff) 242fbb6c848SEzequiel Garcia 243fbb6c848SEzequiel Garcia #define hevc_cur_poc_12 G2_DEC_REG(49, 24, 0xff) 244fbb6c848SEzequiel Garcia #define hevc_cur_poc_13 G2_DEC_REG(49, 16, 0xff) 245fbb6c848SEzequiel Garcia #define hevc_cur_poc_14 G2_DEC_REG(49, 8, 0xff) 246fbb6c848SEzequiel Garcia #define hevc_cur_poc_15 G2_DEC_REG(49, 0, 0xff) 247fbb6c848SEzequiel Garcia 248fbb6c848SEzequiel Garcia #define vp9_refpic_seg6 G2_DEC_REG(31, 15, 0x7) 249fbb6c848SEzequiel Garcia #define vp9_skip_seg6 G2_DEC_REG(31, 14, 0x1) 250fbb6c848SEzequiel Garcia #define vp9_filt_level_seg6 G2_DEC_REG(31, 8, 0x3f) 251fbb6c848SEzequiel Garcia #define vp9_quant_seg6 G2_DEC_REG(31, 0, 0xff) 252fbb6c848SEzequiel Garcia 253fbb6c848SEzequiel Garcia #define vp9_refpic_seg7 G2_DEC_REG(32, 15, 0x7) 254fbb6c848SEzequiel Garcia #define vp9_skip_seg7 G2_DEC_REG(32, 14, 0x1) 255fbb6c848SEzequiel Garcia #define vp9_filt_level_seg7 G2_DEC_REG(32, 8, 0x3f) 256fbb6c848SEzequiel Garcia #define vp9_quant_seg7 G2_DEC_REG(32, 0, 0xff) 257fbb6c848SEzequiel Garcia 258fbb6c848SEzequiel Garcia #define vp9_lref_width G2_DEC_REG(33, 16, 0xffff) 259fbb6c848SEzequiel Garcia #define vp9_lref_height G2_DEC_REG(33, 0, 0xffff) 260fbb6c848SEzequiel Garcia 261fbb6c848SEzequiel Garcia #define vp9_gref_width G2_DEC_REG(34, 16, 0xffff) 262fbb6c848SEzequiel Garcia #define vp9_gref_height G2_DEC_REG(34, 0, 0xffff) 263fbb6c848SEzequiel Garcia 264fbb6c848SEzequiel Garcia #define vp9_aref_width G2_DEC_REG(35, 16, 0xffff) 265fbb6c848SEzequiel Garcia #define vp9_aref_height G2_DEC_REG(35, 0, 0xffff) 266fbb6c848SEzequiel Garcia 267fbb6c848SEzequiel Garcia #define vp9_lref_hor_scale G2_DEC_REG(36, 16, 0xffff) 268fbb6c848SEzequiel Garcia #define vp9_lref_ver_scale G2_DEC_REG(36, 0, 0xffff) 269fbb6c848SEzequiel Garcia 270fbb6c848SEzequiel Garcia #define vp9_gref_hor_scale G2_DEC_REG(37, 16, 0xffff) 271fbb6c848SEzequiel Garcia #define vp9_gref_ver_scale G2_DEC_REG(37, 0, 0xffff) 272fbb6c848SEzequiel Garcia 273fbb6c848SEzequiel Garcia #define vp9_aref_hor_scale G2_DEC_REG(38, 16, 0xffff) 274fbb6c848SEzequiel Garcia #define vp9_aref_ver_scale G2_DEC_REG(38, 0, 0xffff) 275fbb6c848SEzequiel Garcia 276fbb6c848SEzequiel Garcia #define vp9_filt_ref_adj_0 G2_DEC_REG(46, 24, 0x7f) 277fbb6c848SEzequiel Garcia #define vp9_filt_ref_adj_1 G2_DEC_REG(46, 16, 0x7f) 278fbb6c848SEzequiel Garcia #define vp9_filt_ref_adj_2 G2_DEC_REG(46, 8, 0x7f) 279fbb6c848SEzequiel Garcia #define vp9_filt_ref_adj_3 G2_DEC_REG(46, 0, 0x7f) 280fbb6c848SEzequiel Garcia 281fbb6c848SEzequiel Garcia #define vp9_filt_mb_adj_0 G2_DEC_REG(47, 24, 0x7f) 282fbb6c848SEzequiel Garcia #define vp9_filt_mb_adj_1 G2_DEC_REG(47, 16, 0x7f) 283fbb6c848SEzequiel Garcia #define vp9_filt_mb_adj_2 G2_DEC_REG(47, 8, 0x7f) 284fbb6c848SEzequiel Garcia #define vp9_filt_mb_adj_3 G2_DEC_REG(47, 0, 0x7f) 285fbb6c848SEzequiel Garcia 286fbb6c848SEzequiel Garcia #define g2_apf_threshold G2_DEC_REG(55, 0, 0xffff) 287fbb6c848SEzequiel Garcia 288fbb6c848SEzequiel Garcia #define g2_clk_gate_e G2_DEC_REG(58, 16, 0x1) 289fbb6c848SEzequiel Garcia #define g2_double_buffer_e G2_DEC_REG(58, 15, 0x1) 290fbb6c848SEzequiel Garcia #define g2_buswidth G2_DEC_REG(58, 8, 0x7) 291fbb6c848SEzequiel Garcia #define g2_max_burst G2_DEC_REG(58, 0, 0xff) 292fbb6c848SEzequiel Garcia 293fbb6c848SEzequiel Garcia #define g2_down_scale_e G2_DEC_REG(184, 7, 0x1) 294fbb6c848SEzequiel Garcia #define g2_down_scale_y G2_DEC_REG(184, 2, 0x3) 295fbb6c848SEzequiel Garcia #define g2_down_scale_x G2_DEC_REG(184, 0, 0x3) 296fbb6c848SEzequiel Garcia 297fbb6c848SEzequiel Garcia #define G2_REG_CONFIG G2_SWREG(58) 298fbb6c848SEzequiel Garcia #define G2_REG_CONFIG_DEC_CLK_GATE_E BIT(16) 299fbb6c848SEzequiel Garcia #define G2_REG_CONFIG_DEC_CLK_GATE_IDLE_E BIT(17) 300fbb6c848SEzequiel Garcia 301fbb6c848SEzequiel Garcia #define G2_OUT_LUMA_ADDR (G2_SWREG(65)) 302fbb6c848SEzequiel Garcia #define G2_REF_LUMA_ADDR(i) (G2_SWREG(67) + ((i) * 0x8)) 303fbb6c848SEzequiel Garcia #define G2_VP9_SEGMENT_WRITE_ADDR (G2_SWREG(79)) 304fbb6c848SEzequiel Garcia #define G2_VP9_SEGMENT_READ_ADDR (G2_SWREG(81)) 305fbb6c848SEzequiel Garcia #define G2_OUT_CHROMA_ADDR (G2_SWREG(99)) 306fbb6c848SEzequiel Garcia #define G2_REF_CHROMA_ADDR(i) (G2_SWREG(101) + ((i) * 0x8)) 307fbb6c848SEzequiel Garcia #define G2_OUT_MV_ADDR (G2_SWREG(133)) 308fbb6c848SEzequiel Garcia #define G2_REF_MV_ADDR(i) (G2_SWREG(135) + ((i) * 0x8)) 309fbb6c848SEzequiel Garcia #define G2_TILE_SIZES_ADDR (G2_SWREG(167)) 310fbb6c848SEzequiel Garcia #define G2_STREAM_ADDR (G2_SWREG(169)) 311fbb6c848SEzequiel Garcia #define G2_HEVC_SCALING_LIST_ADDR (G2_SWREG(171)) 312fbb6c848SEzequiel Garcia #define G2_VP9_CTX_COUNT_ADDR (G2_SWREG(171)) 313fbb6c848SEzequiel Garcia #define G2_VP9_PROBS_ADDR (G2_SWREG(173)) 314fbb6c848SEzequiel Garcia #define G2_RS_OUT_LUMA_ADDR (G2_SWREG(175)) 315fbb6c848SEzequiel Garcia #define G2_RS_OUT_CHROMA_ADDR (G2_SWREG(177)) 316fbb6c848SEzequiel Garcia #define G2_TILE_FILTER_ADDR (G2_SWREG(179)) 317fbb6c848SEzequiel Garcia #define G2_TILE_SAO_ADDR (G2_SWREG(181)) 318fbb6c848SEzequiel Garcia #define G2_TILE_BSD_ADDR (G2_SWREG(183)) 319fbb6c848SEzequiel Garcia #define G2_DS_DST (G2_SWREG(186)) 320fbb6c848SEzequiel Garcia #define G2_DS_DST_CHR (G2_SWREG(188)) 321*5423e2d2SBenjamin Gaignard #define G2_OUT_COMP_LUMA_ADDR (G2_SWREG(190)) 322*5423e2d2SBenjamin Gaignard #define G2_REF_COMP_LUMA_ADDR(i) (G2_SWREG(192) + ((i) * 0x8)) 323*5423e2d2SBenjamin Gaignard #define G2_OUT_COMP_CHROMA_ADDR (G2_SWREG(224)) 324*5423e2d2SBenjamin Gaignard #define G2_REF_COMP_CHROMA_ADDR(i) (G2_SWREG(226) + ((i) * 0x8)) 325fbb6c848SEzequiel Garcia 326fbb6c848SEzequiel Garcia #define g2_strm_buffer_len G2_DEC_REG(258, 0, 0xffffffff) 327fbb6c848SEzequiel Garcia #define g2_strm_start_offset G2_DEC_REG(259, 0, 0xffffffff) 328fbb6c848SEzequiel Garcia 329fbb6c848SEzequiel Garcia #endif 330