spd/lp5: Add Hynix memory part
[coreboot.git] / src / soc / amd / stoneyridge / enable_usbdebug.c
blobca02a690dd8777caf7cf6d57a15f7e03e84cdceb
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 // Use simple device model for this file even in ramstage
4 #define __SIMPLE_DEVICE__
6 #include <stdint.h>
7 #include <device/pci_ops.h>
8 #include <device/pci_ehci.h>
9 #include <device/pci_def.h>
10 #include <soc/pci_devs.h>
11 #include <soc/southbridge.h>
12 #include <amdblocks/acpimmio.h>
14 pci_devfn_t pci_ehci_dbg_dev(unsigned int hcd_idx)
16 pm_io_write8(PM_USB_ENABLE, PM_USB_ALL_CONTROLLERS);
17 return SOC_EHCI1_DEV;
20 void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port)
22 u32 reg32, value;
24 value = (port & 0x3) << DEBUG_PORT_SELECT_SHIFT;
25 value |= DEBUG_PORT_ENABLE;
26 reg32 = pci_read_config32(SOC_EHCI1_DEV, EHCI_HUB_CONFIG4);
27 reg32 &= ~DEBUG_PORT_MASK;
28 reg32 |= value;
29 pci_write_config32(SOC_EHCI1_DEV, EHCI_HUB_CONFIG4, reg32);