blob: 42e1d8365f16c972bee620ed2257686ca4ffcf28 [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.
Stefan Reinauerbb01f602009-07-21 21:20:45 +000015 */
16
Kyösti Mälkkie2227a22014-02-05 13:02:55 +020017#ifndef _PCI_EHCI_H_
18#define _PCI_EHCI_H_
19
20#include <arch/io.h>
21#include <device/device.h>
Yinghai Lud57241f2007-02-28 11:17:02 +000022
Kyösti Mälkkifb387df2013-06-07 22:16:52 +030023#define EHCI_BAR_INDEX 0x10
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030024#define PCI_EHCI_CLASSCODE 0x0c0320 /* USB2.0 with EHCI controller */
25
Lee Leahy0ca2a062017-03-06 18:01:04 -080026pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx);
Kevin Paul Herbertbde6d302014-12-24 18:43:20 -080027u8 *pci_ehci_base_regs(pci_devfn_t dev);
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030028void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port);
29void pci_ehci_dbg_enable(pci_devfn_t dev, unsigned long base);
Kyösti Mälkkifb387df2013-06-07 22:16:52 +030030
31#ifndef __PRE_RAM__
32#if !CONFIG_USBDEBUG
33#define pci_ehci_read_resources pci_dev_read_resources
34#else
35/* Relocation of EHCI Debug Port BAR
36 *
37 * PCI EHCI controller with Debug Port capability shall replace
38 * pci_dev_read_resources() with pci_ehci_read_resources() in its
39 * declaration of device_operations for .read_resources.
40 * This installs a hook to reconfigure usbdebug when resource allocator
41 * assigns a new BAR for the device.
42 */
43struct device;
44void pci_ehci_read_resources(struct device *dev);
45#endif
46#endif
Myles Watson127e9762010-08-04 19:29:11 +000047
Kyösti Mälkkie2227a22014-02-05 13:02:55 +020048#endif /* _PCI_EHCI_H_ */