2020-04-04 18:50:57 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2017-05-05 05:17:45 +02:00
|
|
|
|
|
|
|
// Use simple device model for this file even in ramstage
|
|
|
|
#define __SIMPLE_DEVICE__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2019-03-01 12:43:02 +01:00
|
|
|
#include <device/pci_ops.h>
|
2017-05-05 05:17:45 +02:00
|
|
|
#include <device/pci_ehci.h>
|
|
|
|
#include <device/pci_def.h>
|
2018-10-12 18:22:33 +02:00
|
|
|
#include <soc/pci_devs.h>
|
2017-08-08 03:08:24 +02:00
|
|
|
#include <soc/southbridge.h>
|
2019-11-16 12:53:28 +01:00
|
|
|
#include <amdblocks/acpimmio.h>
|
2017-05-05 05:17:45 +02:00
|
|
|
|
|
|
|
pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx)
|
|
|
|
{
|
2019-05-05 23:39:40 +02:00
|
|
|
pm_io_write8(PM_USB_ENABLE, PM_USB_ALL_CONTROLLERS);
|
2018-10-12 18:22:33 +02:00
|
|
|
return SOC_EHCI1_DEV;
|
2017-05-05 05:17:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port)
|
|
|
|
{
|
2018-08-25 01:48:20 +02:00
|
|
|
u32 reg32, value;
|
2017-05-05 05:17:45 +02:00
|
|
|
|
2018-08-25 01:48:20 +02:00
|
|
|
value = (port & 0x3) << DEBUG_PORT_SELECT_SHIFT;
|
|
|
|
value |= DEBUG_PORT_ENABLE;
|
|
|
|
reg32 = pci_read_config32(SOC_EHCI1_DEV, EHCI_HUB_CONFIG4);
|
|
|
|
reg32 &= ~DEBUG_PORT_MASK;
|
|
|
|
reg32 |= value;
|
|
|
|
pci_write_config32(SOC_EHCI1_DEV, EHCI_HUB_CONFIG4, reg32);
|
2017-05-05 05:17:45 +02:00
|
|
|
}
|