1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
3 #include <device/mmio.h>
4 #include <soc/infracfg.h>
8 void mtk_usb_prepare(void)
10 mt_pll_set_usb_clock();
13 void mtk_usb_adjust_phy_shift(void)
15 u32 phy_set_val
, write_val
;
16 struct ssusb_sif_port
*phy
= (void *)(SSUSB_SIF_BASE
);
18 SET32_BITFIELDS(&phy
->u3phyd
.phyd_reserved
,
21 phy_set_val
= read32((void *)USB_PHY_SETTING_REG
);
24 write_val
= (phy_set_val
& TX_IMP_MASK
) >> TX_IMP_SHIFT
;
25 SET32_BITFIELDS(&phy
->u3phyd
.phyd_cal0
,
26 TX_IMP_CAL
, write_val
,
30 write_val
= (phy_set_val
& RX_IMP_MASK
) >> RX_IMP_SHIFT
;
31 SET32_BITFIELDS(&phy
->u3phyd
.phyd_cal1
,
32 RX_IMP_CAL
, write_val
,
36 write_val
= (phy_set_val
& INTR_CAL_MASK
) >> INTR_CAL_SHIFT
;
37 SET32_BITFIELDS(&phy
->u3phya
.phya_reg0
,