blob: 4d3f74671df7dfb01ec41df3981475b2546d63ed [file] [log] [blame]
Stefan Reinauerbb01f602009-07-21 21:20:45 +00001/*
2 * This file is part of the coreboot project.
3 *
Uwe Hermann06694a82010-09-23 18:16:46 +00004 * Copyright (C) 2007 AMD
5 * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD.
6 *
Stefan Reinauerbb01f602009-07-21 21:20:45 +00007 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
19 */
20
Kyösti Mälkkie2227a22014-02-05 13:02:55 +020021#ifndef _PCI_EHCI_H_
22#define _PCI_EHCI_H_
23
24#include <arch/io.h>
25#include <device/device.h>
Yinghai Lud57241f2007-02-28 11:17:02 +000026
Kyösti Mälkkifb387df2013-06-07 22:16:52 +030027#define EHCI_BAR_INDEX 0x10
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030028#define PCI_EHCI_CLASSCODE 0x0c0320 /* USB2.0 with EHCI controller */
29
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030030pci_devfn_t pci_ehci_dbg_dev(unsigned hcd_idx);
31unsigned long pci_ehci_base_regs(pci_devfn_t dev);
32void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port);
33void pci_ehci_dbg_enable(pci_devfn_t dev, unsigned long base);
Kyösti Mälkkifb387df2013-06-07 22:16:52 +030034
35#ifndef __PRE_RAM__
36#if !CONFIG_USBDEBUG
37#define pci_ehci_read_resources pci_dev_read_resources
38#else
39/* Relocation of EHCI Debug Port BAR
40 *
41 * PCI EHCI controller with Debug Port capability shall replace
42 * pci_dev_read_resources() with pci_ehci_read_resources() in its
43 * declaration of device_operations for .read_resources.
44 * This installs a hook to reconfigure usbdebug when resource allocator
45 * assigns a new BAR for the device.
46 */
47struct device;
48void pci_ehci_read_resources(struct device *dev);
49#endif
50#endif
Myles Watson127e9762010-08-04 19:29:11 +000051
Kyösti Mälkkie2227a22014-02-05 13:02:55 +020052#endif /* _PCI_EHCI_H_ */