aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-09-21 11:29:02 +0900
committerTom Rini <trini@konsulko.com>2016-09-23 22:25:44 -0400
commit8824cfc19a6e4ae23ca8006bb22b7b6f839b09a8 (patch)
tree479f59a0b3d632aa16b0a4ad508422dbb4cc829f /drivers
parent4815db87f518ba6d4f070cfbcb6959ea7720775d (diff)
downloadu-boot-8824cfc19a6e4ae23ca8006bb22b7b6f839b09a8.zip
u-boot-8824cfc19a6e4ae23ca8006bb22b7b6f839b09a8.tar.gz
u-boot-8824cfc19a6e4ae23ca8006bb22b7b6f839b09a8.tar.bz2
usb: ehci-generic: support reset control for generic EHCI
This driver is designed in a generic manner, so resets should be handled generically as well. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-generic.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
index 6291ed2..2190adb 100644
--- a/drivers/usb/host/ehci-generic.c
+++ b/drivers/usb/host/ehci-generic.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <clk.h>
+#include <reset.h>
#include <asm/io.h>
#include <dm.h>
#include "ehci.h"
@@ -37,6 +38,18 @@ static int ehci_usb_probe(struct udevice *dev)
clk_free(&clk);
}
+ for (i = 0; ; i++) {
+ struct reset_ctl reset;
+ int ret;
+
+ ret = reset_get_by_index(dev, i, &reset);
+ if (ret < 0)
+ break;
+ if (reset_deassert(&reset))
+ printf("failed to deassert reset %d\n", i);
+ reset_free(&reset);
+ }
+
hccr = map_physmem(dev_get_addr(dev), 0x100, MAP_NOCACHE);
hcor = (struct ehci_hcor *)((uintptr_t)hccr +
HC_LENGTH(ehci_readl(&hccr->cr_capbase)));