| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#define __SIMPLE_DEVICE__ |
| 5 |
|
| 6 |
#include <stdint.h> |
| 7 |
#include <amdblocks/acpimmio.h> |
| 8 |
#include <device/mmio.h> |
| 9 |
#include <device/pci_ehci.h> |
| 10 |
#include <device/pci_def.h> |
| 11 |
#include "hudson.h" |
| 12 |
|
| 13 |
#define DEBUGPORT_MISC_CONTROL 0x80 |
| 14 |
|
| 15 |
pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx) |
| 16 |
{ |
| 17 |
|
| 18 |
pm_io_write8(0xef, 0x7f); |
| 19 |
|
| 20 |
if (hcd_idx == 3) |
| 21 |
return PCI_DEV(0, 0x16, 0); |
| 22 |
else if (hcd_idx == 2) |
| 23 |
return PCI_DEV(0, 0x13, 0); |
| 24 |
else |
| 25 |
return PCI_DEV(0, 0x12, 0); |
| 26 |
} |
| 27 |
|
| 28 |
void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port) |
| 29 |
{ |
| 30 |
u8 *base_regs = pci_ehci_base_regs(dev); |
| 31 |
u32 reg32; |
| 32 |
|
| 33 |
|
| 34 |
reg32 = read32(base_regs + DEBUGPORT_MISC_CONTROL); |
| 35 |
reg32 &= ~(0xf << 28); |
| 36 |
reg32 |= (port << 28); |
| 37 |
reg32 |= (1 << 27); |
| 38 |
write32(base_regs + DEBUGPORT_MISC_CONTROL, reg32); |
| 39 |
} |