vlock: bring up for tm2 [1/1]
authorYong Qin <yong.qin@amlogic.com>
Mon, 1 Apr 2019 07:45:36 +0000 (15:45 +0800)
committerJianxiong Pan <jianxiong.pan@amlogic.com>
Thu, 11 Apr 2019 07:07:36 +0000 (15:07 +0800)
PD#SWPL-6576

Problem:
bringup for tm2

Solution:
add some chip id for match tm2

Verify:
tm2

Change-Id: I857ec687b7888782efb8875f8edee538dd615947
Signed-off-by: Yong Qin <yong.qin@amlogic.com>
arch/arm/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
arch/arm64/boot/dts/amlogic/tm2_t962e2_ab319.dts
arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts
drivers/amlogic/media/enhancement/amvecm/amvecm.c
drivers/amlogic/media/enhancement/amvecm/vlock.c

index c8d871a..cbd6fb7 100644 (file)
        };
 
        amlvecm {
-               compatible = "amlogic, vecm-tl1";
+               compatible = "amlogic, vecm-tm2";
                dev_name = "aml_vecm";
                status = "okay";
                gamma_en = <1>;/*1:enabel ;0:disable*/
index 789126c..0e16b92 100644 (file)
        };
 
        amlvecm {
-               compatible = "amlogic, vecm-tl1";
+               compatible = "amlogic, vecm-tm2";
                dev_name = "aml_vecm";
                status = "okay";
                gamma_en = <1>;/*1:enabel ;0:disable*/
index 2a9a989..2491c8d 100644 (file)
        };
 
        amlvecm {
-               compatible = "amlogic, vecm-tl1";
+               compatible = "amlogic, vecm-tm2";
                dev_name = "aml_vecm";
                status = "okay";
                gamma_en = <1>;/*1:enabel ;0:disable*/
index e15e272..9491063 100644 (file)
        };
 
        amlvecm {
-               compatible = "amlogic, vecm";
+               compatible = "amlogic, vecm-tm2";
                dev_name = "aml_vecm";
                status = "okay";
                gamma_en = <1>;/*1:enabel ;0:disable*/
index 5890e4d..b3ef11b 100644 (file)
        };
 
        amlvecm {
-               compatible = "amlogic, vecm-tl1";
+               compatible = "amlogic, vecm-tm2";
                dev_name = "aml_vecm";
                status = "okay";
                gamma_en = <1>;/*1:enabel ;0:disable*/
index 8fc28f5..369b63b 100644 (file)
        };
 
        amlvecm {
-               compatible = "amlogic, vecm-tl1";
+               compatible = "amlogic, vecm-tm2";
                dev_name = "aml_vecm";
                status = "okay";
                gamma_en = <1>;/*1:enabel ;0:disable*/
index 894ab4b..c299c52 100644 (file)
@@ -6532,6 +6532,14 @@ static const struct vecm_match_data_s vecm_dt_tl1 = {
        .vlk_phlock_en = false,
 };
 
+static const struct vecm_match_data_s vecm_dt_tm2 = {
+       .vlk_support = true,
+       .vlk_new_fsm = 1,
+       .vlk_hwver = vlock_hw_ver2,
+       .vlk_phlock_en = false,
+};
+
+
 static const struct of_device_id aml_vecm_dt_match[] = {
        {
                .compatible = "amlogic, vecm",
@@ -6541,6 +6549,10 @@ static const struct of_device_id aml_vecm_dt_match[] = {
                .compatible = "amlogic, vecm-tl1",
                .data = &vecm_dt_tl1,
        },
+       {
+               .compatible = "amlogic, vecm-tm2",
+               .data = &vecm_dt_tm2,
+       },
        {},
 };
 
index 9ae7650..c082d90 100644 (file)
@@ -504,7 +504,7 @@ static void vlock_setting(struct vframe_s *vf,
 
                /*enable vlock to adj pll*/
                /* CFG_VID_LOCK_ADJ_EN disable */
-               WRITE_VPP_REG_BITS(ENCL_MAX_LINE_SWITCH_POINT, 0, 13, 1);
+               WRITE_VPP_REG_BITS(enc_max_line_switch_addr, 0, 13, 1);
                /* disable to adjust enc */
                WRITE_VPP_REG_BITS(VPU_VLOCK_CTRL, 0, 30, 1);
                /* VLOCK_CNTL_EN enable */
@@ -1034,7 +1034,7 @@ static void vlock_enable_step3_soft_enc(void)
                WRITE_VPP_REG(ENCL_VIDEO_MAX_LNCNT,
                        pre_enc_max_line + line_adj);
        if (!(vlock_debug & VLOCK_DEBUG_ENC_PIXEL_ADJ_DIS))
-               WRITE_VPP_REG(ENCL_MAX_LINE_SWITCH_POINT,
+               WRITE_VPP_REG(enc_max_line_switch_addr,
                        pre_enc_max_pixel + pixel_adj);
 
        last_i_vsync = READ_VPP_REG(0x3011);
@@ -1494,13 +1494,13 @@ void vlock_status_init(void)
        vlock_mode = VLOCK_MODE_MANUAL_PLL;
        if (is_meson_gxtvbb_cpu() ||
                is_meson_txl_cpu() || is_meson_txlx_cpu()
-               || is_meson_tl1_cpu())
+               || is_meson_tl1_cpu() || is_meson_tm2_cpu())
                vlock_en = 1;
        else
                vlock_en = 0;
 
        /*initial pll register address*/
-       if (is_meson_tl1_cpu()) {
+       if (is_meson_tl1_cpu() || is_meson_tm2_cpu()) {
                hhi_pll_reg_m = HHI_TCON_PLL_CNTL0;
                hhi_pll_reg_frac = HHI_TCON_PLL_CNTL1;
                /*hhi_pll_reg_vlock_ctl = HHI_HDMI_PLL_VLOCK_CNTL;*/