[Wind] MT6750 眼图 host 测试代码修改点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Wind] MT6750 眼图 host 测试代码修改点相关的知识,希望对你有一定的参考价值。

眼图相关知识请查看 https://wenku.baidu.com/view/03272d48cc17552706220820.html

MT6750 平台需要修改两个地方:

1、kernel-3.18/drivers/misc/mediatek/mu3phy/mt6755/mtk-phy-asic.c

PHY_INT32 phy_init_soc(struct u3phy_info *info)
{
        PHY_INT32 ret;
        os_printk(K_INFO, "%s+\n", __func__);
        ... ...
        U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_USBPHYACR1, RG_USB20_VRT_VREF_SEL_OFST, RG_USB20_VRT_VREF_SEL, 7);      // 新加
        U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_USBPHYACR1, RG_USB20_TERM_VREF_SEL_OFST, RG_USB20_TERM_VREF_SEL, 7);    // 新加
        
        /*Wait 800 usec */
        udelay(800);
        
        U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_U2PHYDTM1, FORCE_VBUSVALID_OFST, FORCE_VBUSVALID, 1);
        U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_U2PHYDTM1, FORCE_AVALID_OFST, FORCE_AVALID, 1);
        U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_U2PHYDTM1, FORCE_SESSEND_OFST, FORCE_SESSEND, 1);
        
        /* USB PLL Force settings */
        usb20_pll_settings(false, false);
        os_printk(K_DEBUG, "%s-\n", __func__);
        return PHY_TRUE;
}

2、kernel-3.18/drivers/misc/mediatek/xhci/xhci-mtk-driver.c

void mtk_xhci_mode_switch(struct work_struct *work)
{
        static bool is_load;
        static bool is_pwoff;
        int ret = 0;
        
        mtk_xhci_mtk_printk(K_DEBUG, "mtk_xhci_mode_switch\n");

        if (musb_check_ipo_state() == true)
        {
                enable_irq(mtk_idpin_irqnum); /* prevent from disable irq twice*/
                return;
        }
        if (mtk_idpin_cur_stat == IDPIN_OUT)
        {
                is_load = false;
                /* expect next isr is for id-pin out action */
                mtk_idpin_cur_stat = (mtk_is_charger_4_vol()) ? IDPIN_IN_DEVICE : IDPIN_IN_HOST;
                /* make id pin to detect the plug-out */
                mtk_set_iddig_out_detect();
                if (mtk_idpin_cur_stat == IDPIN_IN_DEVICE)
                        goto done;
                U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_USBPHYACR1, RG_USB20_VRT_VREF_SEL_OFST, RG_USB20_VRT_VREF_SEL, 4);      // 新加
                U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_USBPHYACR1, RG_USB20_TERM_VREF_SEL_OFST, RG_USB20_TERM_VREF_SEL, 4);    // 新加
                ret = mtk_xhci_driver_load();
                if (!ret) 
                {
                        is_load = true;
                        mtk_xhci_wakelock_lock();
#ifndef CONFIG_USBIF_COMPLIANCE
                        switch_set_state(&mtk_otg_state, 1);
#endif
                }
        }
        else 
        {       /* IDPIN_OUT */
                if (is_load) 
                {
                        if (!is_pwoff)
                                mtk_xhci_disPortPower();
                        /* prevent hang here */
                        /* if(mtk_is_hub_active())
                        {
                                is_pwoff = true;
                                schedule_delayed_work_on(0, &mtk_xhci_delaywork, msecs_to_jiffies(mtk_iddig_debounce));
                                mtk_xhci_mtk_printk(K_DEBUG, "wait, hub is still active, ep cnt %d !!!\n", mtk_ep_count);
                                return;
                        } */
                        /* USB PLL Force settings */
#ifdef CONFIG_PROJECT_PHY
                        usb20_pll_settings(true, false);
#endif
                        U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_USBPHYACR1, RG_USB20_VRT_VREF_SEL_OFST, RG_USB20_VRT_VREF_SEL, 7);      // 新加
                        U3PhyWriteField32((phys_addr_t) (uintptr_t) U3D_USBPHYACR1, RG_USB20_TERM_VREF_SEL_OFST, RG_USB20_TERM_VREF_SEL, 7);    // 新加
                        mtk_xhci_driver_unload();
                        is_pwoff = false;
                        is_load = false;
#ifndef CONFIG_USBIF_COMPLIANCE
                        switch_set_state(&mtk_otg_state, 0);
#endif
                        mtk_xhci_wakelock_unlock();
                }
                /* expect next isr is for id-pin in action */
                mtk_idpin_cur_stat = IDPIN_OUT;
                /* make id pin to detect the plug-in */
                mtk_set_iddig_in_detect();
        }
done:
        mtk_xhci_mtk_printk(K_ALET, "current mode is %s, ret(%d), switch(%d)\n", (mtk_idpin_cur_stat == IDPIN_IN_HOST) ? "host" : (mtk_idpin_cur_stat == IDPIN_IN_DEVICE) ? "id_device" : "device", ret, mtk_otg_state.state);
}

 

以上是关于[Wind] MT6750 眼图 host 测试代码修改点的主要内容,如果未能解决你的问题,请参考以下文章

MT6750原理图datasheet资料下载

何为眼图

眼图(Eye Diagram)与数字信号测试

NRZ眼图的消光比(Extinction Ratio)测量测试---陡峭粗线的原因

代做通达信指标公式帮写MT4策略公式

无标题