2 * Copyright (C) 2015 Alexey Brodkin <abrodkin@synopsys.com>
4 * SPDX-License-Identifier: GPL-2.0+
12 * Even though here we don't explicitly use "struct ehci_ctrl"
13 * ehci_register() expects it to be the first thing that resides in
14 * device's private data.
17 struct ehci_ctrl ctrl;
20 static int ehci_usb_probe(struct udevice *dev)
22 struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
23 struct ehci_hcor *hcor;
25 hcor = (struct ehci_hcor *)((uintptr_t)hccr +
26 HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
28 return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
31 static int ehci_usb_remove(struct udevice *dev)
33 return ehci_deregister(dev);
36 static const struct udevice_id ehci_usb_ids[] = {
37 { .compatible = "generic-ehci" },
41 U_BOOT_DRIVER(ehci_generic) = {
42 .name = "ehci_generic",
44 .of_match = ehci_usb_ids,
45 .probe = ehci_usb_probe,
46 .remove = ehci_usb_remove,
48 .priv_auto_alloc_size = sizeof(struct generic_ehci),
49 .flags = DM_FLAG_ALLOC_PRIV_DMA,