config PCIE_ROCKCHIP
bool "Enable Rockchip PCIe driver"
select DM_PCI
+ select PHY_ROCKCHIP_PCIE
default y if ROCKCHIP_RK3399
help
Say Y here if you want to enable PCIe controller support on
static int rockchip_pcie_init_port(struct udevice *dev)
{
struct rockchip_pcie *priv = dev_get_priv(dev);
- struct rockchip_pcie_phy *phy = pcie_get_phy(priv);
- struct rockchip_pcie_phy_ops *ops = phy_get_ops(phy);
u32 cr, val, status;
int ret;
return ret;
}
- ret = ops->init(phy);
+ ret = generic_phy_init(&priv->pcie_phy);
if (ret) {
dev_err(dev, "failed to init phy (ret=%d)\n", ret);
goto err_exit_phy;
cr |= PCIE_CLIENT_CONF_ENABLE | PCIE_CLIENT_MODE_RC;
writel(cr, priv->apb_base + PCIE_CLIENT_CONFIG);
- ret = ops->power_on(phy);
+ ret = generic_phy_power_on(&priv->pcie_phy);
if (ret) {
dev_err(dev, "failed to power on phy (ret=%d)\n", ret);
goto err_power_off_phy;
return 0;
err_power_off_phy:
- ops->power_off(phy);
+ generic_phy_power_off(&priv->pcie_phy);
err_exit_phy:
- ops->exit(phy);
+ generic_phy_exit(&priv->pcie_phy);
return ret;
}
return ret;
}
+ ret = generic_phy_get_by_index(dev, 0, &priv->pcie_phy);
+ if (ret) {
+ dev_err(dev, "failed to get pcie-phy (ret=%d)\n", ret);
+ return ret;
+ }
+
return 0;
}
if (ret)
return ret;
- ret = rockchip_pcie_phy_get(dev);
- if (ret)
- return ret;
-
ret = rockchip_pcie_set_vpcie(dev);
if (ret)
return ret;
*
*/
+#include <generic-phy.h>
+
#define HIWORD_UPDATE(mask, val) (((mask) << 16) | (val))
#define HIWORD_UPDATE_BIT(val) HIWORD_UPDATE(val, val)
struct udevice *vpcie3v3;
struct udevice *vpcie1v8;
struct udevice *vpcie0v9;
+
+ /* phy */
+ struct phy pcie_phy;
};
int rockchip_pcie_phy_get(struct udevice *dev);