1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
| X:\u-boot\drivers\video\drm\zhoujinjian_mipi_rockchip_display.c struct zjj_vop_reg { uint32_t mask; uint32_t offset:12; uint32_t shift:5; uint32_t begin_minor:4; uint32_t end_minor:4; uint32_t major:3; uint32_t write_mask:1; };
struct zjj_vop_reg global_regdone_en = VOP_REG_VER(RK3399_SYS_CTRL, 0x1, 11, 3, 2, -1); struct zjj_vop_reg axi_outstanding_max_num = VOP_REG(RK3399_SYS_CTRL1, 0x1f, 13); struct zjj_vop_reg axi_max_outstanding_en = VOP_REG(RK3399_SYS_CTRL1, 0x1, 12); struct zjj_vop_reg win_gate0 = VOP_REG(RK3399_WIN2_CTRL0, 0x1, 0); struct zjj_vop_reg win_gate1 = VOP_REG(RK3399_WIN3_CTRL0, 0x1, 0); struct zjj_vop_reg dsp_blank = VOP_REG(RK3399_DSP_CTRL0, 0x3, 18); struct zjj_vop_reg mipi_en = VOP_REG(RK3399_SYS_CTRL, 0x1, 15); struct zjj_vop_reg mipi_pin_pol = VOP_REG_VER(RK3399_DSP_CTRL1, 0x7, 28, 3, 2, -1); struct zjj_vop_reg mipi_dclk_pol = VOP_REG_VER(RK3399_DSP_CTRL1, 0x1, 31, 3, 2, -1); struct zjj_vop_reg mipi_dual_channel_en = VOP_REG(RK3399_SYS_CTRL, 0x1, 3); struct zjj_vop_reg data01_swap = VOP_REG_VER(RK3399_SYS_CTRL, 0x1, 17, 3, 5, -1); struct zjj_vop_reg dither_down = VOP_REG(RK3399_DSP_CTRL1, 0xf, 1); struct zjj_vop_reg dclk_ddr = VOP_REG_VER(RK3399_DSP_CTRL0, 0x1, 8, 3, 4, -1); struct zjj_vop_reg dsp_data_swap = VOP_REG(RK3399_DSP_CTRL0, 0x1f, 12); struct zjj_vop_reg out_mode = VOP_REG(RK3399_DSP_CTRL0, 0xf, 0); struct zjj_vop_reg overlay_mode = VOP_REG_VER(RK3399_SYS_CTRL, 0x1, 16, 3, 2, -1); struct zjj_vop_reg dsp_out_yuv = VOP_REG_VER(RK3399_POST_SCL_CTRL, 0x1, 2, 3, 5, -1); struct zjj_vop_reg bcsh_r2y_en = VOP_REG_VER(RK3399_BCSH_CTRL, 0x1, 4, 3, 1, -1); struct zjj_vop_reg bcsh_y2r_en = VOP_REG_VER(RK3399_BCSH_CTRL, 0x1, 0, 3, 1, -1); struct zjj_vop_reg bcsh_r2y_csc_mode = VOP_REG_VER(RK3399_BCSH_CTRL, 0x1, 6, 3, 1, -1); struct zjj_vop_reg bcsh_y2r_csc_mode = VOP_REG_VER(RK3399_BCSH_CTRL, 0x3, 2, 3, 1, -1); struct zjj_vop_reg dsp_background = VOP_REG(RK3399_DSP_BG, 0xffffffff, 0); struct zjj_vop_reg htotal_pw = VOP_REG(RK3399_DSP_HTOTAL_HS_END, 0x1fff1fff, 0); struct zjj_vop_reg hact_st_end = VOP_REG(RK3399_DSP_HACT_ST_END, 0x1fff1fff, 0); struct zjj_vop_reg vact_st_end = VOP_REG(RK3399_DSP_VACT_ST_END, 0x1fff1fff, 0); struct zjj_vop_reg dsp_interlace = VOP_REG(RK3399_DSP_CTRL0, 0x1, 10); struct zjj_vop_reg p2i_en = VOP_REG_VER(RK3399_DSP_CTRL0, 0x1, 5, 3, 4, -1); struct zjj_vop_reg vtotal_pw = VOP_REG(RK3399_DSP_VTOTAL_VS_END, 0x1fff1fff, 0); struct zjj_vop_reg hpost_st_end = VOP_REG(RK3399_POST_DSP_HACT_INFO, 0x1fff1fff, 0); struct zjj_vop_reg vpost_st_end = VOP_REG(RK3399_POST_DSP_VACT_INFO, 0x1fff1fff, 0); struct zjj_vop_reg post_scl_factor = VOP_REG(RK3399_POST_SCL_FACTOR_YRGB, 0xffffffff, 0); struct zjj_vop_reg post_scl_ctrl = VOP_REG(RK3399_POST_SCL_CTRL, 0x3, 0); struct zjj_vop_reg core_dclk_div = VOP_REG_VER(RK3399_DSP_CTRL0, 0x1, 4, 3, 4, -1); struct zjj_vop_reg line_flag_num0 = VOP_REG(RK3399_LINE_FLAG, 0xffff, 0); struct zjj_vop_reg line_flag_num1 = VOP_REG(RK3399_LINE_FLAG, 0xffff, 16); void zjj_rockchip_vop_init(void * reg, u32 * rbak, int len) { printf("zjj.rk3399.uboot %s %s %d \n",__FILE__,__FUNCTION__,__LINE__); regsbak = rbak; regs = reg; vop_mask_write(regs, global_regdone_en.offset, global_regdone_en.mask, global_regdone_en.shift, 1, global_regdone_en.write_mask); vop_mask_write(regs, axi_outstanding_max_num.offset, axi_outstanding_max_num.mask, axi_outstanding_max_num.shift, 30, axi_outstanding_max_num.write_mask); vop_mask_write(regs, axi_max_outstanding_en.offset, axi_max_outstanding_en.mask, axi_max_outstanding_en.shift, 1, axi_max_outstanding_en.write_mask); vop_mask_write(regs, win_gate0.offset, win_gate0.mask, win_gate0.shift, 1, win_gate0.write_mask); vop_mask_write(regs, win_gate1.offset, win_gate1.mask, win_gate1.shift, 1, win_gate0.write_mask); vop_mask_write(regs, dsp_blank.offset, dsp_blank.mask, dsp_blank.shift, 0, dsp_blank.write_mask); vop_mask_write(regs, mipi_en.offset, mipi_en.mask, mipi_en.shift, 1, mipi_en.write_mask); vop_mask_write(regs, mipi_pin_pol.offset, mipi_pin_pol.mask, mipi_pin_pol.shift, 8, mipi_pin_pol.write_mask); vop_mask_write(regs, mipi_dclk_pol.offset, mipi_dclk_pol.mask, mipi_dclk_pol.shift, 1, mipi_dclk_pol.write_mask); vop_mask_write(regs, mipi_dual_channel_en.offset, mipi_dual_channel_en.mask, mipi_dual_channel_en.shift, 0, mipi_dual_channel_en.write_mask); vop_mask_write(regs, data01_swap.offset, data01_swap.mask, data01_swap.shift, 0, data01_swap.write_mask); vop_mask_write(regs, dither_down.offset, dither_down.mask, dither_down.shift, 1, dither_down.write_mask); vop_mask_write(regs, dclk_ddr.offset, dclk_ddr.mask, dclk_ddr.shift, 0, dclk_ddr.write_mask); vop_mask_write(regs, dsp_data_swap.offset, dsp_data_swap.mask, dsp_data_swap.shift, 0, dsp_data_swap.write_mask); vop_mask_write(regs, dsp_data_swap.offset, dsp_data_swap.mask, dsp_data_swap.shift, 0, dsp_data_swap.write_mask); vop_mask_write(regs, out_mode.offset, out_mode.mask, out_mode.shift, 0, out_mode.write_mask); vop_mask_write(regs, overlay_mode.offset, overlay_mode.mask, overlay_mode.shift, 0, overlay_mode.write_mask); vop_mask_write(regs, dsp_out_yuv.offset, dsp_out_yuv.mask, dsp_out_yuv.shift, 0, dsp_out_yuv.write_mask); vop_mask_write(regs, bcsh_r2y_en.offset, bcsh_r2y_en.mask, bcsh_r2y_en.shift, 0, bcsh_r2y_en.write_mask); vop_mask_write(regs, bcsh_y2r_en.offset, bcsh_y2r_en.mask, bcsh_y2r_en.shift, 0, bcsh_y2r_en.write_mask); vop_mask_write(regs, bcsh_r2y_csc_mode.offset, bcsh_r2y_csc_mode.mask, bcsh_r2y_csc_mode.shift, 1, bcsh_r2y_csc_mode.write_mask); vop_mask_write(regs, bcsh_y2r_csc_mode.offset, bcsh_y2r_csc_mode.mask, bcsh_y2r_csc_mode.shift, 1, bcsh_y2r_csc_mode.write_mask); vop_mask_write(regs, htotal_pw.offset, htotal_pw.mask, htotal_pw.shift, 0x52b0004, htotal_pw.write_mask); vop_mask_write(regs, hact_st_end.offset, hact_st_end.mask, hact_st_end.shift, 0x8304c3, hact_st_end.write_mask); vop_mask_write(regs, vact_st_end.offset, vact_st_end.mask, vact_st_end.shift, 0x50785, vact_st_end.write_mask); vop_mask_write(regs, dsp_interlace.offset, dsp_interlace.mask, dsp_interlace.shift, 0, dsp_interlace.write_mask); vop_mask_write(regs, p2i_en.offset, p2i_en.mask, p2i_en.shift, 0, p2i_en.write_mask); vop_mask_write(regs, vtotal_pw.offset, vtotal_pw.mask, vtotal_pw.shift, 0x7890002, vtotal_pw.write_mask); vop_mask_write(regs, hpost_st_end.offset, hpost_st_end.mask, hpost_st_end.shift, 0x8304c3, hpost_st_end.write_mask); vop_mask_write(regs, vpost_st_end.offset, vpost_st_end.mask, vpost_st_end.shift, 0x50785, vpost_st_end.write_mask); vop_mask_write(regs, post_scl_factor.offset, post_scl_factor.mask, post_scl_factor.shift, 0x10001000 , post_scl_factor.write_mask); vop_mask_write(regs, post_scl_ctrl.offset, post_scl_ctrl.mask, post_scl_ctrl.shift, 0 , post_scl_ctrl.write_mask); vop_mask_write(regs, core_dclk_div.offset, core_dclk_div.mask, core_dclk_div.shift, 0 , core_dclk_div.write_mask); vop_mask_write(regs, line_flag_num0.offset, line_flag_num0.mask, line_flag_num0.shift, 0x782 , line_flag_num0.write_mask); vop_mask_write(regs, line_flag_num1.offset, line_flag_num1.mask, line_flag_num1.shift, 0x72b , line_flag_num1.write_mask); vop_mask_write(regs, cfg_done.offset, cfg_done.mask, cfg_done.shift, 1 , cfg_done.write_mask); }
|