2 * This file is part of the coreboot project.
4 * Copyright (C) 2009 coresystems GmbH
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 // An arbitrary address for the BAR
21 #define EHCI_BAR 0xFEF00000
22 // These could be read from DEBUG_BASE (0:1d.7 R 0x5A 16bit)
23 #define EHCI_BAR_INDEX 0x10
25 #define EHCI_CONFIG_FLAG 0x40
26 #define EHCI_PORTSC 0x44
27 #define EHCI_DEBUG_OFFSET 0xA0
29 void set_debug_port(unsigned port)
33 printk_debug("Enabling OWNER_CNT\n");
34 dbgctl = read32(EHCI_BAR + EHCI_DEBUG_OFFSET);
36 write32(EHCI_BAR + EHCI_DEBUG_OFFSET, dbgctl);
39 static void i82801gx_enable_usbdebug_direct(unsigned port)
41 pci_write_config32(PCI_DEV(0, 0x1d, 7), EHCI_BAR_INDEX, EHCI_BAR);
42 pci_write_config8(PCI_DEV(0, 0x1d, 7), 0x04, 0x2); // Memory Space Enable