bb0e316f60a235a9b30f14eb258bcea24e142b17
[coreboot.git] / src / southbridge / amd / sb600 / enable_usbdebug_direct.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2008 Advanced Micro Devices, Inc.
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 #include <types.h>
20 #include <lib.h>
21 #include <console.h>
22 #include <device/pci.h>
23 #include <msr.h>
24 #include <legacy.h>
25 #include <device/pci.h>
26 #include <statictree.h>
27 #include <config.h>
28 #include <io.h>
29 #define SMBUS_IO_BASE 0x1000    /* Is it a temporary SMBus I/O base address? */
30          /*SIZE 0x40 */
31
32 #ifndef SB600_DEVN_BASE
33
34 #define SB600_DEVN_BASE 0
35
36 #endif
37
38 #define EHCI_BAR_INDEX 0x10
39 #define EHCI_BAR 0xFEF00000
40 #define EHCI_DEBUG_OFFSET 0xE0
41
42 void sb600_enable_usbdebug_direct(u32 port)
43 {
44         set_debug_port(port);
45         pci_conf1_write_config32(PCI_BDF(0, SB600_DEVN_BASE + 0x13, 5),
46                            EHCI_BAR_INDEX, EHCI_BAR);
47         pci_conf1_write_config8(PCI_BDF(0, SB600_DEVN_BASE + 0x13, 5), 0x04, 0x2);      /* mem space enable */
48 }