phy: rockchip-inno-usb2: open pre-emphasize for rk3308/rk3328

Open pre-emphasize in non-chirp state for rk3308 and
rk3328 usb otg and host ports to increase HS slew rate.

Change-Id: I16435d67b9994cef0fd5e6edbae00c41cc02c48b
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
William Wu
2018-03-26 19:32:37 +08:00
committed by Tao Huang
parent 0f997af5aa
commit e4fe585d6b

View File

@@ -1873,6 +1873,28 @@ static int rk312x_usb2phy_tuning(struct rockchip_usb2phy *rphy)
return 0;
}
static int rk3308_usb2phy_tuning(struct rockchip_usb2phy *rphy)
{
int ret;
/* Open pre-emphasize in non-chirp state for otg port */
ret = regmap_write(rphy->grf, 0x0, 0x00070004);
if (ret)
return ret;
/* Open pre-emphasize in non-chirp state for host port */
ret = regmap_write(rphy->grf, 0x30, 0x00070004);
if (ret)
return ret;
/* Turn off differential receiver in suspend mode */
ret = regmap_write(rphy->grf, 0x18, 0x00040000);
if (ret)
return ret;
return 0;
}
static int rk3328_usb2phy_tuning(struct rockchip_usb2phy *rphy)
{
int ret;
@@ -1882,11 +1904,13 @@ static int rk3328_usb2phy_tuning(struct rockchip_usb2phy *rphy)
if (ret)
return ret;
/*
* Open HS pre-emphasize function to increase
* HS slew rate for host port
*/
ret = regmap_write(rphy->grf, 0x30, 0xffff851d);
/* Open pre-emphasize in non-chirp state for otg port */
ret = regmap_write(rphy->grf, 0x0, 0x00070004);
if (ret)
return ret;
/* Open pre-emphasize in non-chirp state for host port */
ret = regmap_write(rphy->grf, 0x30, 0x00070004);
if (ret)
return ret;
@@ -2211,6 +2235,7 @@ static const struct rockchip_usb2phy_cfg rk3308_phy_cfgs[] = {
{
.reg = 0x100,
.num_ports = 2,
.phy_tuning = rk3308_usb2phy_tuning,
.clkout_ctl = { 0x0108, 4, 4, 1, 0 },
.port_cfgs = {
[USB2PHY_PORT_OTG] = {