author | Lei Yang <lei.yang@amlogic.com> | 2019-09-24 12:37:22 (GMT) |
---|---|---|
committer | Tao Zeng <tao.zeng@amlogic.com> | 2019-10-08 10:42:05 (GMT) |
commit | 62ef32feb974c6bcce44ef001f2c8a68bef50135 (patch) | |
tree | 477dea5f010036f852677a84c2936af864048316 | |
parent | 60fba1f6a441dfcae50be2249d0a9e27c138bc7e (diff) | |
download | common-62ef32feb974c6bcce44ef001f2c8a68bef50135.zip common-62ef32feb974c6bcce44ef001f2c8a68bef50135.tar.gz common-62ef32feb974c6bcce44ef001f2c8a68bef50135.tar.bz2 |
hdmirx: add repeater22 [1/1]
PD#SWPL-12503
Problem:
TM2 cannot support repeater22
Solution:
add repreater2.2
Verify:
TM2
Change-Id: Idda626632641939dccab79bf3d958e8f2c462c82
Signed-off-by: Lei Yang <lei.yang@amlogic.com>
-rw-r--r-- | arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts | 27 | ||||
-rw-r--r-- | arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts | 27 | ||||
-rw-r--r-- | arch/arm/boot/dts/amlogic/tm2_t962x3_t312.dts | 27 | ||||
-rw-r--r-- | arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts | 27 | ||||
-rw-r--r-- | arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts | 27 | ||||
-rw-r--r-- | arch/arm64/boot/dts/amlogic/tm2_t962x3_t312.dts | 27 | ||||
-rw-r--r-- | drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c | 6 | ||||
-rw-r--r-- | drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h | 2 | ||||
-rw-r--r-- | drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c | 12 | ||||
-rw-r--r-- | drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h | 2 | ||||
-rw-r--r-- | drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c | 5 | ||||
-rw-r--r-- | drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c | 14 |
12 files changed, 29 insertions, 174 deletions
diff --git a/arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts b/arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts index 628cb1c..985f87a 100644 --- a/arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts +++ b/arch/arm/boot/dts/amlogic/tm2_t962x3_ab301.dts @@ -693,7 +693,7 @@ compatible = "amlogic, unifykey"; status = "okay"; - unifykey-num = <24>; + unifykey-num = <21>; unifykey-index-0 = <&keysn_0>; unifykey-index-1 = <&keysn_1>; unifykey-index-2 = <&keysn_2>; @@ -715,9 +715,6 @@ unifykey-index-18 = <&keysn_18>; unifykey-index-19 = <&keysn_19>; unifykey-index-20 = <&keysn_20>; - unifykey-index-21 = <&keysn_21>; - unifykey-index-22 = <&keysn_22>; - unifykey-index-23 = <&keysn_23>; keysn_0: key_0{ key-name = "usid"; @@ -829,21 +826,6 @@ key-device = "secure"; key-permit = "read","write","del"; }; - keysn_21:key_21{ - key-name = "hdcp22_rprx_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_22:key_22{ - key-name = "hdcp22_rprp_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_23:key_23{ - key-name = "hdcp22_rp_private"; - key-device = "secure"; - key-permit = "read","write","del"; - }; }; /* End unifykey */ amlvideo2_0 { @@ -920,13 +902,6 @@ 0xff610000 0xa000>; }; - amhdmitx: amhdmitx { - compatible = "amlogic, amhdmitx"; - dev_name = "amhdmitx"; - status = "okay"; - repeater_tx = <0x0>; - }; - aocec: aocec { compatible = "amlogic, aocec-tm2"; /*device_name = "aocec";*/ diff --git a/arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts b/arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts index 03a2c91..78d8627 100644 --- a/arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts +++ b/arch/arm/boot/dts/amlogic/tm2_t962x3_ab309.dts @@ -714,7 +714,7 @@ compatible = "amlogic, unifykey"; status = "okay"; - unifykey-num = <24>; + unifykey-num = <21>; unifykey-index-0 = <&keysn_0>; unifykey-index-1 = <&keysn_1>; unifykey-index-2 = <&keysn_2>; @@ -736,9 +736,6 @@ unifykey-index-18 = <&keysn_18>; unifykey-index-19 = <&keysn_19>; unifykey-index-20 = <&keysn_20>; - unifykey-index-21 = <&keysn_21>; - unifykey-index-22 = <&keysn_22>; - unifykey-index-23 = <&keysn_23>; keysn_0: key_0{ key-name = "usid"; @@ -850,21 +847,6 @@ key-device = "secure"; key-permit = "read","write","del"; }; - keysn_21:key_21{ - key-name = "hdcp22_rprx_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_22:key_22{ - key-name = "hdcp22_rprp_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_23:key_23{ - key-name = "hdcp22_rp_private"; - key-device = "secure"; - key-permit = "read","write","del"; - }; }; /* End unifykey */ hdmirx { @@ -925,13 +907,6 @@ 0xff610000 0xa000>; }; - amhdmitx: amhdmitx { - compatible = "amlogic, amhdmitx"; - dev_name = "amhdmitx"; - status = "okay"; - repeater_tx = <0x0>; - }; - aocec: aocec { compatible = "amlogic, aocec-tm2"; /*device_name = "aocec";*/ diff --git a/arch/arm/boot/dts/amlogic/tm2_t962x3_t312.dts b/arch/arm/boot/dts/amlogic/tm2_t962x3_t312.dts index 488b12b..b38f50a 100644 --- a/arch/arm/boot/dts/amlogic/tm2_t962x3_t312.dts +++ b/arch/arm/boot/dts/amlogic/tm2_t962x3_t312.dts @@ -699,7 +699,7 @@ compatible = "amlogic, unifykey"; status = "okay"; - unifykey-num = <24>; + unifykey-num = <21>; unifykey-index-0 = <&keysn_0>; unifykey-index-1 = <&keysn_1>; unifykey-index-2 = <&keysn_2>; @@ -721,9 +721,6 @@ unifykey-index-18 = <&keysn_18>; unifykey-index-19 = <&keysn_19>; unifykey-index-20 = <&keysn_20>; - unifykey-index-21 = <&keysn_21>; - unifykey-index-22 = <&keysn_22>; - unifykey-index-23 = <&keysn_23>; keysn_0: key_0{ key-name = "usid"; @@ -835,21 +832,6 @@ key-device = "secure"; key-permit = "read","write","del"; }; - keysn_21:key_21{ - key-name = "hdcp22_rprx_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_22:key_22{ - key-name = "hdcp22_rprp_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_23:key_23{ - key-name = "hdcp22_rp_private"; - key-device = "secure"; - key-permit = "read","write","del"; - }; }; /* End unifykey */ amlvideo2_0 { @@ -926,13 +908,6 @@ 0xff610000 0xa000>; }; - amhdmitx: amhdmitx { - compatible = "amlogic, amhdmitx"; - dev_name = "amhdmitx"; - status = "okay"; - repeater_tx = <0x0>; - }; - aocec: aocec { compatible = "amlogic, aocec-tm2"; /*device_name = "aocec";*/ diff --git a/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts b/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts index 6b5ca87..717debf 100644 --- a/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts +++ b/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts @@ -691,7 +691,7 @@ compatible = "amlogic, unifykey"; status = "okay"; - unifykey-num = <24>; + unifykey-num = <21>; unifykey-index-0 = <&keysn_0>; unifykey-index-1 = <&keysn_1>; unifykey-index-2 = <&keysn_2>; @@ -713,9 +713,6 @@ unifykey-index-18 = <&keysn_18>; unifykey-index-19 = <&keysn_19>; unifykey-index-20 = <&keysn_20>; - unifykey-index-21 = <&keysn_21>; - unifykey-index-22 = <&keysn_22>; - unifykey-index-23 = <&keysn_23>; keysn_0: key_0{ key-name = "usid"; @@ -827,21 +824,6 @@ key-device = "secure"; key-permit = "read","write","del"; }; - keysn_21:key_21{ - key-name = "hdcp22_rprx_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_22:key_22{ - key-name = "hdcp22_rprp_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_23:key_23{ - key-name = "hdcp22_rp_private"; - key-device = "secure"; - key-permit = "read","write","del"; - }; }; /* End unifykey */ amlvideo2_0 { @@ -918,13 +900,6 @@ 0x0 0xff610000 0x0 0xa000>; }; - amhdmitx: amhdmitx { - compatible = "amlogic, amhdmitx"; - dev_name = "amhdmitx"; - status = "okay"; - repeater_tx = <0x0>; - }; - aocec: aocec { compatible = "amlogic, aocec-tm2"; /*device_name = "aocec";*/ diff --git a/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts b/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts index 00aae2e..0159322 100644 --- a/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts +++ b/arch/arm64/boot/dts/amlogic/tm2_t962x3_ab309.dts @@ -714,7 +714,7 @@ compatible = "amlogic, unifykey"; status = "okay"; - unifykey-num = <24>; + unifykey-num = <21>; unifykey-index-0 = <&keysn_0>; unifykey-index-1 = <&keysn_1>; unifykey-index-2 = <&keysn_2>; @@ -736,9 +736,6 @@ unifykey-index-18 = <&keysn_18>; unifykey-index-19 = <&keysn_19>; unifykey-index-20 = <&keysn_20>; - unifykey-index-21 = <&keysn_21>; - unifykey-index-22 = <&keysn_22>; - unifykey-index-23 = <&keysn_23>; keysn_0: key_0{ key-name = "usid"; @@ -850,21 +847,6 @@ key-device = "secure"; key-permit = "read","write","del"; }; - keysn_21:key_21{ - key-name = "hdcp22_rprx_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_22:key_22{ - key-name = "hdcp22_rprp_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_23:key_23{ - key-name = "hdcp22_rp_private"; - key-device = "secure"; - key-permit = "read","write","del"; - }; }; /* End unifykey */ hdmirx { @@ -925,13 +907,6 @@ 0x0 0xff610000 0x0 0xa000>; }; - amhdmitx: amhdmitx { - compatible = "amlogic, amhdmitx"; - dev_name = "amhdmitx"; - status = "okay"; - repeater_tx = <0x0>; - }; - aocec: aocec { compatible = "amlogic, aocec-tm2"; /*device_name = "aocec";*/ diff --git a/arch/arm64/boot/dts/amlogic/tm2_t962x3_t312.dts b/arch/arm64/boot/dts/amlogic/tm2_t962x3_t312.dts index f449c2b..dbcd7a3 100644 --- a/arch/arm64/boot/dts/amlogic/tm2_t962x3_t312.dts +++ b/arch/arm64/boot/dts/amlogic/tm2_t962x3_t312.dts @@ -702,7 +702,7 @@ compatible = "amlogic, unifykey"; status = "okay"; - unifykey-num = <24>; + unifykey-num = <21>; unifykey-index-0 = <&keysn_0>; unifykey-index-1 = <&keysn_1>; unifykey-index-2 = <&keysn_2>; @@ -724,9 +724,6 @@ unifykey-index-18 = <&keysn_18>; unifykey-index-19 = <&keysn_19>; unifykey-index-20 = <&keysn_20>; - unifykey-index-21 = <&keysn_21>; - unifykey-index-22 = <&keysn_22>; - unifykey-index-23 = <&keysn_23>; keysn_0: key_0{ key-name = "usid"; @@ -838,21 +835,6 @@ key-device = "secure"; key-permit = "read","write","del"; }; - keysn_21:key_21{ - key-name = "hdcp22_rprx_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_22:key_22{ - key-name = "hdcp22_rprp_fw"; - key-device = "normal"; - key-permit = "read","write","del"; - }; - keysn_23:key_23{ - key-name = "hdcp22_rp_private"; - key-device = "secure"; - key-permit = "read","write","del"; - }; }; /* End unifykey */ amlvideo2_0 { @@ -929,13 +911,6 @@ 0x0 0xff610000 0x0 0xa000>; }; - amhdmitx: amhdmitx { - compatible = "amlogic, amhdmitx"; - dev_name = "amhdmitx"; - status = "okay"; - repeater_tx = <0x0>; - }; - aocec: aocec { compatible = "amlogic, aocec-tm2"; /*device_name = "aocec";*/ diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c index e5e82ef..0140204 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.c @@ -1024,18 +1024,18 @@ static long hdmirx_ioctl(struct file *file, unsigned int cmd, } case HDMI_IOC_HDCP_ON: hdcp_enable = 1; - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 4); /*fsm_restart();*/ break; case HDMI_IOC_HDCP_OFF: hdcp_enable = 0; - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 4); hdmirx_hw_config(); /*fsm_restart();*/ break; case HDMI_IOC_EDID_UPDATE: if (rx.open_fg) { - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 4); edid_update_flag = 1; } #if 0 diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h index 6b46639..e6a5d60 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_drv.h @@ -34,7 +34,7 @@ #include "hdmi_rx_edid.h" -#define RX_VER0 "ver.2019-09-02" +#define RX_VER0 "ver.2019-09-26" /* * * diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c index d51a9ef..3afba29 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.c @@ -1602,8 +1602,12 @@ int rx_set_port_hpd(uint8_t port_id, bool val) return 0; } -void rx_set_cur_hpd(uint8_t val) +/* add param to differentiate repeater/main state machine/etc + * 0: main loop; 2: workaround; 3: repeater flow; 4: special use + */ +void rx_set_cur_hpd(u8 val, u8 func) { + rx_pr("func-%d to", func); rx_set_port_hpd(rx.port, val); } @@ -2362,7 +2366,7 @@ void hdmirx_load_firm_reset(int type) rx.firm_change = 1; msleep(20); /*External_Mute(1);rx_aud_pll_ctl(0);*/ - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 4); /*type 2 only pull down hpd*/ if (type == 2) { downstream_hpd_flag = 0; @@ -3035,7 +3039,7 @@ void rx_debug_load22key(void) if (ret) { rx_pr("load 2.2 key\n"); sm_pause = 1; - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 4); hdcp22_on = 1; hdcp22_kill_esm = 1; while (wait_kill_done_cnt++ < 10) { @@ -3061,7 +3065,7 @@ void rx_debug_load22key(void) hdmirx_hw_config(); hpd_to_esm = 1; /* mdelay(900); */ - rx_set_cur_hpd(1); + rx_set_cur_hpd(1, 4); sm_pause = 0; } } diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h index 447d353..18c7047 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_hw.h @@ -1213,7 +1213,7 @@ extern unsigned int rx_hdcp22_rd_reg_bits(unsigned int addr, unsigned int mask); extern int rx_get_aud_pll_err_sts(void); extern void rx_force_hpd_cfg(uint8_t hpd_level); extern int rx_set_port_hpd(uint8_t port_id, bool val); -extern void rx_set_cur_hpd(uint8_t val); +void rx_set_cur_hpd(u8 val, u8 func); extern unsigned int rx_get_hdmi5v_sts(void); extern unsigned int rx_get_hpd_sts(void); diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c index 9e7e8da..d08e723 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_repeater.c @@ -101,7 +101,8 @@ void rx_check_repeat(void) if (rx.hdcp.repeat != repeat_plug) { /*pull down hpd if downstream plug low*/ - rx_set_cur_hpd(0); + /* rx_set_cur_hpd(0, 3); */ + rx_send_hpd_pulse(); rx_pr("firm_change:%d,repeat_plug:%d,repeat:%d\n", rx.firm_change, repeat_plug, rx.hdcp.repeat); rx_set_repeat_signal(repeat_plug); @@ -113,7 +114,7 @@ void rx_check_repeat(void) memset(&receive_edid, 0, sizeof(receive_edid)); up_phy_addr = 0; /*new_edid = true;*/ - /* rx_set_cur_hpd(1); */ + /* rx_set_cur_hpd(1, 3); */ /*rx.firm_change = 0;*/ rx_pr("1firm_change:%d,repeat_plug:%d,repeat:%d\n", rx.firm_change, repeat_plug, rx.hdcp.repeat); diff --git a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c index f999d1a..637afbc 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c +++ b/drivers/amlogic/media/vin/tvin/hdmirx/hdmi_rx_wrapper.c @@ -1906,7 +1906,7 @@ void hdmirx_open_port(enum tvin_port_e port) } if (rx.state > FSM_HPD_LOW) rx.state = FSM_HPD_LOW; - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 0); /* need reset the whole module when switch port */ wait_ddc_idle(); hdmi_rx_top_edid_update(); @@ -2139,7 +2139,7 @@ void rx_main_state_machine(void) fsm_restart(); break; case FSM_HPD_LOW: - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 0); set_scdc_cfg(1, 0); rx.state = FSM_INIT; break; @@ -2160,7 +2160,7 @@ void rx_main_state_machine(void) downstream_hpd_flag = 0; edid_update_flag = 0; pre_port = rx.port; - rx_set_cur_hpd(1); + rx_set_cur_hpd(1, 0); rx.phy.cable_clk = 0; rx.phy.cablesel = 0; set_scdc_cfg(0, 1); @@ -2229,7 +2229,7 @@ void rx_main_state_machine(void) } else rx.err_rec_mode = ERR_REC_HPD_RST; } else if (rx.err_rec_mode == ERR_REC_HPD_RST) { - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 2); rx.phy.cable_clk = 0; rx.state = FSM_INIT; rx.err_rec_mode = ERR_REC_EQ_RETRY; @@ -2323,7 +2323,7 @@ void rx_main_state_machine(void) rx.err_rec_mode = ERR_REC_HPD_RST; rx_set_eq_run_state(E_EQ_START); } else if (rx.err_rec_mode == ERR_REC_HPD_RST) { - rx_set_cur_hpd(0); + rx_set_cur_hpd(0, 2); rx.phy.cable_clk = 0; rx.state = FSM_INIT; rx.err_rec_mode = ERR_REC_EQ_RETRY; @@ -2839,7 +2839,7 @@ int hdmirx_debug(const char *buf, int size) if (strncmp(tmpbuf, "help", 4) == 0) { rx_debug_help(); } else if (strncmp(tmpbuf, "hpd", 3) == 0) - rx_set_cur_hpd(tmpbuf[3] == '0' ? 0 : 1); + rx_set_cur_hpd((tmpbuf[3] == '0' ? 0 : 1), 4); else if (strncmp(tmpbuf, "cable_status", 12) == 0) { size = hdmirx_rd_top(TOP_HPD_PWR5V) >> 20; rx_pr("cable_status = %x\n", size); @@ -2980,7 +2980,7 @@ int hdmirx_debug(const char *buf, int size) void rx_dw_edid_monitor(void) { - if (!hdmi_cec_en) + if ((!hdmi_cec_en) || (hdmirx_repeat_support())) return; if (tx_hpd_event == E_RCV) { if (rx.open_fg) |