phy: rockchip: inno-usb2: set bvalid to high by grf for rv1103

RV1103 doesn't have VBUSDET pin for the usb phy to
detect the USB VBUS, and the default status of bvalid
is inactive(low level), it cause the dwc3 controller
fail to start usb device connection, so it needs to
set bvalid to high by grf for RV1103.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: If63c68270c14ff8fa402805a33ce3061f6f796ab
This commit is contained in:
William Wu
2022-03-11 17:23:34 +08:00
committed by Tao Huang
parent 7598c25d0b
commit f14ef60afd

View File

@@ -2053,9 +2053,22 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
rport->mode == USB_DR_MODE_UNKNOWN)
goto out;
/* Select bvalid of usb phy as bvalid of usb controller */
if (rport->port_cfg->bvalid_grf_sel.enable != 0)
property_enable(base, &rport->port_cfg->bvalid_grf_sel, false);
/*
* Set the utmi bvalid come from the usb phy or grf.
* For most of Rockchip SoCs, them have VBUSDET pin
* for the usb phy to detect the USB VBUS and set
* the bvalid signal, so select the bvalid from the
* usb phy by default. And for those SoCs which don't
* have VBUSDET pin (e.g. RV1103), it needs to select
* the bvaid from the grf and set bvalid to be valid
* (high) by default.
*/
if (rport->port_cfg->bvalid_grf_sel.enable != 0) {
if (of_machine_is_compatible("rockchip,rv1103"))
property_enable(base, &rport->port_cfg->bvalid_grf_sel, true);
else
property_enable(base, &rport->port_cfg->bvalid_grf_sel, false);
}
wake_lock_init(&rport->wakelock, WAKE_LOCK_SUSPEND, "rockchip_otg");
INIT_DELAYED_WORK(&rport->bypass_uart_work,