Esempio n. 1
0
static int check_ip_clk_status(void)
{
	int u3_port_num;
	u32 check_bits;
	u32 sts1, sts2;
	struct stopwatch sw;

	u3_port_num = CAP_U3_PORT_NUM(read32(&ippc_regs->ip_xhci_cap));

	check_bits = STS1_SYSPLL_STABLE | STS1_REF_RST | STS1_SYS125_RST;
	check_bits = (u3_port_num ? STS1_U3_MAC_RST : 0);

	stopwatch_init_usecs_expire(&sw, 50000);

	do {
		if (stopwatch_expired(&sw)) {
			u3p_err("usb clocks are not stable!!!\n");
			return -1;
		}

		sts1 = read32(&ippc_regs->ip_pw_sts1) & check_bits;
		sts2 = read32(&ippc_regs->ip_pw_sts2) & STS2_U2_MAC_RST;
	} while ((sts1 != check_bits) || !sts2);

	return 0;
}
Esempio n. 2
0
void setup_usb_host(void)
{
	u3p_msg("Setting up USB HOST controller...\n");

	mtk_usb_prepare();
	ssusb_soft_reset();
	if (u3phy_ports_enable()) {
		u3p_err("%s fail to enable ports\n", __func__);
		return;
	}
	u3phy_power_on();
	u3p_msg("phy power-on done.\n");
}
Esempio n. 3
0
void setup_usb_host(void)
{
	int ret;

	u3p_msg("Setting up USB HOST controller...\n");

	mt_pll_enable_ssusb_clk();
	ssusb_soft_reset();
	ret = u3phy_ports_enable();
	if (ret) {
		u3p_err("%s fail to enable ports\n", __func__);
		return;
	}
	u3phy_power_on();
	u3p_msg("phy power-on done.\n");
}