blob: 2b68f7bd19eafe03c23faf0cabfe9b0a612a2c79 [file] [log] [blame]
Michael Trimarchiebc83002008-12-31 10:32:41 +01001/*-
2 * Copyright (c) 2007-2008, Juniper Networks, Inc.
3 * All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation version 2 of
8 * the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
19 */
20
21#include <common.h>
22#include <pci.h>
23#include <usb.h>
Jean-Christophe PLAGNIOL-VILLARD8f6bcf42009-04-03 12:46:58 +020024
25#include "ehci.h"
26#include "ehci-core.h"
Michael Trimarchiebc83002008-12-31 10:32:41 +010027
28#ifdef CONFIG_PCI_EHCI_DEVICE
29static struct pci_device_id ehci_pci_ids[] = {
30 /* Please add supported PCI EHCI controller ids here */
Trübenbach, Ralfd2c91882011-03-31 16:46:47 +000031 {0x1033, 0x00E0}, /* NEC */
32 {0x12D8, 0x400F}, /* Pericom */
Michael Trimarchiebc83002008-12-31 10:32:41 +010033 {0, 0}
34};
35#endif
36
37/*
38 * Create the appropriate control structures to manage
39 * a new EHCI host controller.
40 */
41int ehci_hcd_init(void)
42{
43 pci_dev_t pdev;
44 uint32_t addr;
45
46 pdev = pci_find_devices(ehci_pci_ids, CONFIG_PCI_EHCI_DEVICE);
47 if (pdev == -1) {
48 printf("EHCI host controller not found\n");
49 return -1;
50 }
51
52 pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &addr);
53 hccr = (struct ehci_hccr *)addr;
54 hcor = (struct ehci_hcor *)((uint32_t) hccr +
55 HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
56
Florian Fainelli17e648b2010-10-15 15:53:45 +020057 debug("EHCI-PCI init hccr 0x%x and hcor 0x%x hc_length %d\n",
58 (uint32_t)hccr, (uint32_t)hcor,
59 (uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
60
Michael Trimarchiebc83002008-12-31 10:32:41 +010061 return 0;
62}
63
64/*
65 * Destroy the appropriate control structures corresponding
66 * the the EHCI host controller.
67 */
68int ehci_hcd_stop(void)
69{
70 return 0;
71}