![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <device/mmio.h>
#include <console/console.h>
#include <delay.h>
#include <soc/clock.h>
#include <soc/iomap.h>
#include <soc/usb.h>
Go to the source code of this file.
Macros | |
#define | PHY_CTRL0_ADDR 0x000 |
USB Hardware registers. More... | |
#define | PHY_CTRL1_ADDR 0x004 |
#define | PHY_CTRL2_ADDR 0x008 |
#define | PHY_CTRL3_ADDR 0x00C |
#define | PHY_CTRL4_ADDR 0x010 |
#define | PHY_MISC_ADDR 0x024 |
#define | PHY_IPG_ADDR 0x030 |
#define | PHY_CTRL0_VAL 0xA4600015 |
#define | PHY_CTRL1_VAL 0x09500000 |
#define | PHY_CTRL2_VAL 0x00058180 |
#define | PHY_CTRL3_VAL 0x6DB6DCD6 |
#define | PHY_CTRL4_VAL 0x836DB6DB |
#define | PHY_MISC_VAL 0x3803FB0C |
#define | PHY_IPG_VAL 0x47323232 |
#define | USB_HOST3_PHY_BASE ((void *)0x8a00000) |
#define | USB_HOST3_BALDUR_PHY_BASE ((void *)0xa6000) |
#define | GCC_USB3_RST_CTRL ((void *)0x0181E038) |
#define | DWC3_GCTL 0xc110 |
#define | DWC3_GUSB3PIPECTL(n) (0xc2c0 + (n * 0x04)) |
#define | DWC3_GUSB2PHYCFG(n) (0xc200 + (n * 0x04)) |
#define | DWC3_GUSB3PIPECTL_PHYSOFTRST (1 << 31) |
#define | DWC3_GUSB3PIPECTL_SUSPHY (1 << 17) |
#define | DWC3_GCTL_CORESOFTRESET (1 << 11) |
#define | DWC3_GCTL_PRTCAPDIR(n) ((n) << 12) |
#define | DWC3_GCTL_PRTCAP_OTG 3 |
#define | DWC3_DCTL_CSFTRST (1 << 30) |
#define | DWC3_GSNPSID 0xc120 |
#define | DWC3_DCTL 0xc704 |
#define | DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31) |
#define | DWC3_GUSB2PHYCFG_SUSPHY (1 << 6) |
#define | DWC3_GSNPSID_MASK 0xffff0000 |
#define | DWC3_GEVTEN 0xc114 |
#define | DWC3_GCTL_SCALEDOWN(n) ((n) << 4) |
#define | DWC3_GCTL_SCALEDOWN_MASK DWC3_GCTL_SCALEDOWN(3) |
#define | DWC3_GCTL_DISSCRAMBLE (1 << 3) |
#define | DWC3_GCTL_DSBLCLKGTNG (1 << 0) |
#define | DWC3_GCTL_U2RSTECN (1 << 16) |
#define | DWC3_REVISION_190A 0x5533190a |
#define | USB30_HS_PHY_CTRL 0x00000010 |
#define | SW_SESSVLD (0x01 << 0x1C) |
#define | UTMI_OTG_VBUS_VALID (0x01 << 0x14) |
#define | USB30_SS_PHY_CTRL 0x00000030 |
#define | LANE0_PWR_PRESENT (0x01 << 0x18) |
Functions | |
static void | setup_dwc3 (void) |
static void | qscratch_write (void *base, u32 offset, u32 val) |
Write register. More... | |
static void | qscratch_write_readback (void *base, u32 offset, const u32 mask, u32 val) |
Write register and read back masked value to confirm it is written. More... | |
static void | dwc3_ipq40xx_enable_vbus_valid (void) |
static void | qcom_baldur_hs_phy_init (void) |
static void | qcom_uni_ss_phy_init (void) |
void | setup_usb_host1 (void) |
#define DWC3_GCTL_SCALEDOWN_MASK DWC3_GCTL_SCALEDOWN(3) |
Definition at line 109 of file usb.c.
References LANE0_PWR_PRESENT, qscratch_write_readback(), SW_SESSVLD, USB30_HS_PHY_CTRL, USB30_SS_PHY_CTRL, and UTMI_OTG_VBUS_VALID.
Referenced by setup_usb_host1().
Definition at line 122 of file usb.c.
References GCC_USB3_RST_CTRL, mdelay(), PHY_CTRL0_ADDR, PHY_CTRL0_VAL, PHY_CTRL1_ADDR, PHY_CTRL1_VAL, PHY_CTRL2_ADDR, PHY_CTRL2_VAL, PHY_CTRL3_ADDR, PHY_CTRL3_VAL, PHY_CTRL4_ADDR, PHY_CTRL4_VAL, PHY_IPG_ADDR, PHY_IPG_VAL, PHY_MISC_ADDR, PHY_MISC_VAL, read32(), USB_HOST3_BALDUR_PHY_BASE, and write32().
Referenced by setup_dwc3().
Definition at line 162 of file usb.c.
References GCC_USB3_RST_CTRL, mdelay(), read32(), and write32().
Referenced by setup_dwc3().
|
inlinestatic |
Write register and read back masked value to confirm it is written.
base | - base virtual address. |
offset | - register offset. |
mask | - register bitmask specifying what should be updated |
val | - value to write. |
Definition at line 89 of file usb.c.
References base, BIOS_INFO, mask, offset, printk, read32(), val, and write32().
Referenced by dwc3_ipq40xx_enable_vbus_valid().
Definition at line 179 of file usb.c.
References BIOS_INFO, DWC3_DCTL, DWC3_DCTL_CSFTRST, DWC3_GCTL, DWC3_GCTL_CORESOFTRESET, DWC3_GCTL_DISSCRAMBLE, DWC3_GCTL_DSBLCLKGTNG, DWC3_GCTL_PRTCAP_OTG, DWC3_GCTL_PRTCAPDIR, DWC3_GCTL_SCALEDOWN_MASK, DWC3_GCTL_U2RSTECN, DWC3_GSNPSID, DWC3_GSNPSID_MASK, DWC3_GUSB2PHYCFG, DWC3_GUSB2PHYCFG_PHYSOFTRST, DWC3_GUSB2PHYCFG_SUSPHY, DWC3_GUSB3PIPECTL, DWC3_GUSB3PIPECTL_PHYSOFTRST, DWC3_GUSB3PIPECTL_SUSPHY, DWC3_REVISION_190A, mdelay(), printk, qcom_baldur_hs_phy_init(), qcom_uni_ss_phy_init(), read32(), udelay(), USB_HOST3_PHY_BASE, and write32().
Referenced by setup_usb_host1().