blob: 797f6d2836a4e99cbb73f2dcc1e96077bc03be39 [file] [log] [blame]
Michael Xie7586cef2008-09-22 13:11:39 +00001/*
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.
Michael Xie7586cef2008-09-22 13:11:39 +000014 */
15
Kyösti Mälkki1fd75082013-06-11 16:32:01 +030016// Use simple device model for this file even in ramstage
17#define __SIMPLE_DEVICE__
18
Uwe Hermanndc3aa7a2010-09-25 23:47:15 +000019#include <stdint.h>
Patrick Georgi5692c572010-10-05 13:40:31 +000020#include <arch/io.h>
Kyösti Mälkkie2227a22014-02-05 13:02:55 +020021#include <device/pci_ehci.h>
Uwe Hermanndc3aa7a2010-09-25 23:47:15 +000022#include <device/pci_def.h>
Patrick Georgi5692c572010-10-05 13:40:31 +000023#include "sb600.h"
Michael Xie7586cef2008-09-22 13:11:39 +000024
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030025pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx)
26{
27 return PCI_DEV(0, 0x13, 5); /* USB EHCI, D19:F5 */
28}
29
Uwe Hermannb015d022010-09-24 18:18:20 +000030/* Required for successful build, but currently empty. */
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030031void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port)
Uwe Hermannb015d022010-09-24 18:18:20 +000032{
Uwe Hermanndc3aa7a2010-09-25 23:47:15 +000033 /* TODO: Allow changing the physical USB port used as Debug Port. */
Uwe Hermannb015d022010-09-24 18:18:20 +000034}
35
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030036void pci_ehci_dbg_enable(pci_devfn_t dev, unsigned long base)
Michael Xie7586cef2008-09-22 13:11:39 +000037{
Uwe Hermanndc3aa7a2010-09-25 23:47:15 +000038 /* Set the EHCI BAR address. */
Kyösti Mälkki8101aa62013-08-15 16:27:06 +030039 pci_write_config32(dev, EHCI_BAR_INDEX, base);
Uwe Hermanndc3aa7a2010-09-25 23:47:15 +000040
41 /* Enable access to the EHCI memory space registers. */
42 pci_write_config8(dev, PCI_COMMAND, PCI_COMMAND_MEMORY);
Michael Xie7586cef2008-09-22 13:11:39 +000043}