|
@@ -10,6 +10,7 @@
|
|
#include <dm.h>
|
|
#include <dm.h>
|
|
#include <fdtdec.h>
|
|
#include <fdtdec.h>
|
|
#include <usb.h>
|
|
#include <usb.h>
|
|
|
|
+#include <power/regulator.h>
|
|
#include <asm/gpio.h>
|
|
#include <asm/gpio.h>
|
|
|
|
|
|
#include "xhci.h"
|
|
#include "xhci.h"
|
|
@@ -44,12 +45,22 @@ static int xhci_usb_probe(struct udevice *dev)
|
|
struct mvebu_xhci_platdata *plat = dev_get_platdata(dev);
|
|
struct mvebu_xhci_platdata *plat = dev_get_platdata(dev);
|
|
struct mvebu_xhci *ctx = dev_get_priv(dev);
|
|
struct mvebu_xhci *ctx = dev_get_priv(dev);
|
|
struct xhci_hcor *hcor;
|
|
struct xhci_hcor *hcor;
|
|
- int len;
|
|
|
|
|
|
+ int len, ret;
|
|
|
|
+ struct udevice *regulator;
|
|
|
|
|
|
ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
|
|
ctx->hcd = (struct xhci_hccr *)plat->hcd_base;
|
|
len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));
|
|
len = HC_LENGTH(xhci_readl(&ctx->hcd->cr_capbase));
|
|
hcor = (struct xhci_hcor *)((uintptr_t)ctx->hcd + len);
|
|
hcor = (struct xhci_hcor *)((uintptr_t)ctx->hcd + len);
|
|
|
|
|
|
|
|
+ ret = device_get_supply_regulator(dev, "vbus-supply", ®ulator);
|
|
|
|
+ if (!ret) {
|
|
|
|
+ ret = regulator_set_enable(regulator, true);
|
|
|
|
+ if (ret) {
|
|
|
|
+ printf("Failed to turn ON the VBUS regulator\n");
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Enable USB xHCI (VBUS, reset etc) in board specific code */
|
|
/* Enable USB xHCI (VBUS, reset etc) in board specific code */
|
|
board_xhci_enable();
|
|
board_xhci_enable();
|
|
|
|
|