2 * Copyright (C) 2014 Panasonic Corporation
3 * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
5 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/ehci-uniphier.h>
14 #ifdef CONFIG_OF_CONTROL
16 DECLARE_GLOBAL_DATA_PTR;
18 #define FDT gd->fdt_blob
19 #define COMPAT "panasonic,uniphier-ehci"
21 static int get_uniphier_ehci_base(int index, struct ehci_hccr **base)
25 for (offset = fdt_node_offset_by_compatible(FDT, 0, COMPAT);
27 offset = fdt_node_offset_by_compatible(FDT, offset, COMPAT)) {
29 *base = (struct ehci_hccr *)
30 fdtdec_get_addr(FDT, offset, "reg");
36 return -ENODEV; /* not found */
39 static int get_uniphier_ehci_base(int index, struct ehci_hccr **base)
41 *base = (struct ehci_hccr *)uniphier_ehci_platdata[index].base;
47 * Create the appropriate control structures to manage
48 * a new EHCI host controller.
50 int ehci_hcd_init(int index, enum usb_init_type init, struct ehci_hccr **hccr,
51 struct ehci_hcor **hcor)
57 uniphier_ehci_reset(index, 0);
59 ret = get_uniphier_ehci_base(index, &cr);
62 or = (void *)cr + HC_LENGTH(ehci_readl(&cr->cr_capbase));
70 int ehci_hcd_stop(int index)
72 uniphier_ehci_reset(index, 1);