dev_err(dev, "no usb2 phy configured\n");
return ret;
}
+ } else {
+ dwc3_set_phydata(dev, dwc->usb2_generic_phy);
}
dwc->usb3_generic_phy = devm_phy_get(dev, "usb3-phy");
dev_err(dev, "no usb3 phy configured\n");
return ret;
}
+ } else {
+ dwc3_set_phydata(dev, dwc->usb3_generic_phy);
}
return 0;
#if IS_ENABLED(CONFIG_USB_DWC3_OF_SIMPLE)
int dwc3_enable_hw_coherency(struct device *dev);
+void dwc3_set_phydata(struct device *dev, struct phy *phy);
#else
static inline int dwc3_enable_hw_coherency(struct device *dev)
{ return 1; }
+static inline void dwc3_set_phydata(struct device *dev, struct phy *phy)
+{ ; }
#endif
#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)\
#include <linux/soc/xilinx/zynqmp/fw.h>
#include <linux/slab.h>
+#include <linux/phy/phy-zynqmp.h>
#include <linux/of_address.h>
#include "core.h"
void __iomem *regs;
};
+void dwc3_set_phydata(struct device *dev, struct phy *phy)
+{
+ struct device_node *node = of_get_parent(dev->of_node);
+ int ret;
+
+ if ((node != NULL) &&
+ of_device_is_compatible(node, "xlnx,zynqmp-dwc3")) {
+ struct platform_device *pdev_parent;
+ struct dwc3_of_simple *simple;
+
+ pdev_parent = of_find_device_by_node(node);
+ simple = platform_get_drvdata(pdev_parent);
+
+ /* assign USB vendor regs to phy lane */
+ ret = xpsgtr_set_protregs(phy, simple->regs);
+ if (ret) {
+ dev_err(&pdev_parent->dev,
+ "Not able to set PHY data\n");
+ }
+ }
+}
+
int dwc3_enable_hw_coherency(struct device *dev)
{
struct device_node *node = of_get_parent(dev->of_node);