Stefan Reinauer | bb01f60 | 2009-07-21 21:20:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Uwe Hermann | 06694a8 | 2010-09-23 18:16:46 +0000 | [diff] [blame] | 4 | * Copyright (C) 2007 AMD |
| 5 | * Written by Yinghai Lu <yinghai.lu@amd.com> for AMD. |
| 6 | * |
Stefan Reinauer | bb01f60 | 2009-07-21 21:20:45 +0000 | [diff] [blame] | 7 | * 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älkki | e2227a2 | 2014-02-05 13:02:55 +0200 | [diff] [blame] | 21 | #ifndef _PCI_EHCI_H_ |
| 22 | #define _PCI_EHCI_H_ |
| 23 | |
| 24 | #include <arch/io.h> |
| 25 | #include <device/device.h> |
Yinghai Lu | d57241f | 2007-02-28 11:17:02 +0000 | [diff] [blame] | 26 | |
Kyösti Mälkki | fb387df | 2013-06-07 22:16:52 +0300 | [diff] [blame] | 27 | #define EHCI_BAR_INDEX 0x10 |
Kyösti Mälkki | 8101aa6 | 2013-08-15 16:27:06 +0300 | [diff] [blame] | 28 | #define PCI_EHCI_CLASSCODE 0x0c0320 /* USB2.0 with EHCI controller */ |
| 29 | |
Kyösti Mälkki | 8101aa6 | 2013-08-15 16:27:06 +0300 | [diff] [blame] | 30 | pci_devfn_t pci_ehci_dbg_dev(unsigned hcd_idx); |
| 31 | unsigned long pci_ehci_base_regs(pci_devfn_t dev); |
| 32 | void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port); |
| 33 | void pci_ehci_dbg_enable(pci_devfn_t dev, unsigned long base); |
Kyösti Mälkki | fb387df | 2013-06-07 22:16:52 +0300 | [diff] [blame] | 34 | |
| 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 | */ |
| 47 | struct device; |
| 48 | void pci_ehci_read_resources(struct device *dev); |
| 49 | #endif |
| 50 | #endif |
Myles Watson | 127e976 | 2010-08-04 19:29:11 +0000 | [diff] [blame] | 51 | |
Kyösti Mälkki | e2227a2 | 2014-02-05 13:02:55 +0200 | [diff] [blame] | 52 | #endif /* _PCI_EHCI_H_ */ |