2 * Copyright (c) 2007-2008, Juniper Networks, Inc.
5 * SPDX-License-Identifier: GPL-2.0
15 #ifdef CONFIG_PCI_EHCI_DEVICE
16 static struct pci_device_id ehci_pci_ids[] = {
17 /* Please add supported PCI EHCI controller ids here */
18 {0x1033, 0x00E0}, /* NEC */
19 {0x10B9, 0x5239}, /* ULI1575 PCI EHCI module ids */
20 {0x12D8, 0x400F}, /* Pericom */
27 * Create the appropriate control structures to manage
28 * a new EHCI host controller.
30 int ehci_hcd_init(int index, enum usb_init_type init,
31 struct ehci_hccr **ret_hccr, struct ehci_hcor **ret_hcor)
35 struct ehci_hccr *hccr;
36 struct ehci_hcor *hcor;
38 #ifdef CONFIG_PCI_EHCI_DEVICE
39 pdev = pci_find_devices(ehci_pci_ids, CONFIG_PCI_EHCI_DEVICE);
41 pdev = pci_find_class(PCI_CLASS_SERIAL_USB_EHCI, index);
44 printf("EHCI host controller not found\n");
48 hccr = (struct ehci_hccr *)pci_map_bar(pdev,
49 PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
50 hcor = (struct ehci_hcor *)((uint32_t) hccr +
51 HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
53 debug("EHCI-PCI init hccr 0x%x and hcor 0x%x hc_length %d\n",
54 (uint32_t)hccr, (uint32_t)hcor,
55 (uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
60 /* enable busmaster */
61 pci_read_config_dword(pdev, PCI_COMMAND, &cmd);
62 cmd |= PCI_COMMAND_MASTER;
63 pci_write_config_dword(pdev, PCI_COMMAND, cmd);
68 * Destroy the appropriate control structures corresponding
69 * the the EHCI host controller.
71 int ehci_hcd_stop(int index)