]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - drivers/usb/host/ehci-uniphier.c
Merge branch 'master' of git://git.denx.de/u-boot-socfpga
[karo-tx-uboot.git] / drivers / usb / host / ehci-uniphier.c
1 /*
2  * Copyright (C) 2014 Panasonic Corporation
3  *   Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #include <common.h>
9 #include <usb.h>
10 #include <asm/arch/ehci-uniphier.h>
11 #include "ehci.h"
12
13 /*
14  * Create the appropriate control structures to manage
15  * a new EHCI host controller.
16  */
17 int ehci_hcd_init(int index, enum usb_init_type init, struct ehci_hccr **hccr,
18                   struct ehci_hcor **hcor)
19 {
20         struct ehci_hccr *cr;
21         struct ehci_hcor *or;
22
23         uniphier_ehci_reset(index, 0);
24
25         cr = (struct ehci_hccr *)(uniphier_ehci_platdata[index].base);
26         or = (void *)cr + HC_LENGTH(ehci_readl(&cr->cr_capbase));
27
28         *hccr = cr;
29         *hcor = or;
30
31         return 0;
32 }
33
34 int ehci_hcd_stop(int index)
35 {
36         uniphier_ehci_reset(index, 1);
37
38         return 0;
39 }