Stefan Reinauer | a8e1168 | 2009-03-11 14:54:18 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2009 coresystems GmbH |
| 5 | * |
| 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. |
| 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 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 |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame^] | 24 | |
| 25 | #define EHCI_CONFIG_FLAG 0x40 |
| 26 | #define EHCI_PORTSC 0x44 |
Stefan Reinauer | a8e1168 | 2009-03-11 14:54:18 +0000 | [diff] [blame] | 27 | #define EHCI_DEBUG_OFFSET 0xA0 |
| 28 | |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame^] | 29 | void set_debug_port(unsigned port) |
Stefan Reinauer | a8e1168 | 2009-03-11 14:54:18 +0000 | [diff] [blame] | 30 | { |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame^] | 31 | u32 dbgctl; |
| 32 | |
| 33 | printk_debug("Enabling OWNER_CNT\n"); |
| 34 | dbgctl = readl(EHCI_BAR + EHCI_DEBUG_OFFSET); |
| 35 | dbgctl |= (1 << 30); |
| 36 | writel(dbgctl, EHCI_BAR + EHCI_DEBUG_OFFSET); |
| 37 | |
Stefan Reinauer | a8e1168 | 2009-03-11 14:54:18 +0000 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | static void i82801gx_enable_usbdebug_direct(unsigned port) |
| 41 | { |
| 42 | pci_write_config32(PCI_DEV(0, 0x1d, 7), EHCI_BAR_INDEX, EHCI_BAR); |
| 43 | pci_write_config8(PCI_DEV(0, 0x1d, 7), 0x04, 0x2); // Memory Space Enable |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame^] | 44 | set_debug_port(port); |
Stefan Reinauer | a8e1168 | 2009-03-11 14:54:18 +0000 | [diff] [blame] | 45 | } |
| 46 | |