blob: 3e7143cd91dd44e600552d823cb4ec27d964900e [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>
24#include "usb_ehci.h"
25#include "usb_ehci_core.h"
26
27#ifdef CONFIG_PCI_EHCI_DEVICE
28static struct pci_device_id ehci_pci_ids[] = {
29 /* Please add supported PCI EHCI controller ids here */
30 {0, 0}
31};
32#endif
33
34/*
35 * Create the appropriate control structures to manage
36 * a new EHCI host controller.
37 */
38int ehci_hcd_init(void)
39{
40 pci_dev_t pdev;
41 uint32_t addr;
42
43 pdev = pci_find_devices(ehci_pci_ids, CONFIG_PCI_EHCI_DEVICE);
44 if (pdev == -1) {
45 printf("EHCI host controller not found\n");
46 return -1;
47 }
48
49 pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &addr);
50 hccr = (struct ehci_hccr *)addr;
51 hcor = (struct ehci_hcor *)((uint32_t) hccr +
52 HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
53
54 return 0;
55}
56
57/*
58 * Destroy the appropriate control structures corresponding
59 * the the EHCI host controller.
60 */
61int ehci_hcd_stop(void)
62{
63 return 0;
64}