コード例 #1
0
ファイル: exynos5_xhci.c プロジェクト: 2trill2spill/freebsd
static int
dwc3_init(struct exynos_xhci_softc *esc)
{
	int hwparams1;
	int rev;
	int reg;

	rev = READ4(esc, GSNPSID);
	if ((rev & GSNPSID_MASK) != 0x55330000) {
		printf("It is not DWC3 controller\n");
		return (-1);
	}

	/* Reset controller */
	WRITE4(esc, GCTL, GCTL_CORESOFTRESET);
	WRITE4(esc, GUSB3PIPECTL(0), GUSB3PIPECTL_PHYSOFTRST);
	WRITE4(esc, GUSB2PHYCFG(0), GUSB2PHYCFG_PHYSOFTRST);

	DELAY(100000);

	reg = READ4(esc, GUSB3PIPECTL(0));
	reg &= ~(GUSB3PIPECTL_PHYSOFTRST);
	WRITE4(esc, GUSB3PIPECTL(0), reg);

	reg = READ4(esc, GUSB2PHYCFG(0));
	reg &= ~(GUSB2PHYCFG_PHYSOFTRST);
	WRITE4(esc, GUSB2PHYCFG(0), reg);

	reg = READ4(esc, GCTL);
	reg &= ~GCTL_CORESOFTRESET;
	WRITE4(esc, GCTL, reg);

	hwparams1 = READ4(esc, GHWPARAMS1);

	reg = READ4(esc, GCTL);
	reg &= ~(GCTL_SCALEDOWN_MASK << GCTL_SCALEDOWN_SHIFT);
	reg &= ~(GCTL_DISSCRAMBLE);

	if (GHWPARAMS1_EN_PWROPT(hwparams1) == \
	    GHWPARAMS1_EN_PWROPT_CLK)
		reg &= ~(GCTL_DSBLCLKGTNG);

	if ((rev & REVISION_MASK) < 0x190a)
		reg |= (GCTL_U2RSTECN);
	WRITE4(esc, GCTL, reg);

	/* Set host mode */
	reg = READ4(esc, GCTL);
	reg &= ~(GCTL_PRTCAPDIR(GCTL_PRTCAP_OTG));
	reg |= GCTL_PRTCAPDIR(GCTL_PRTCAP_HOST);
	WRITE4(esc, GCTL, reg);

	return (0);
}
コード例 #2
0
	dump_register(GHWPARAMS0),
	dump_register(GHWPARAMS1),
	dump_register(GHWPARAMS2),
	dump_register(GHWPARAMS3),
	dump_register(GHWPARAMS4),
	dump_register(GHWPARAMS5),
	dump_register(GHWPARAMS6),
	dump_register(GHWPARAMS7),
	dump_register(GDBGFIFOSPACE),
	dump_register(GDBGLTSSM),
	dump_register(GPRTBIMAP_HS0),
	dump_register(GPRTBIMAP_HS1),
	dump_register(GPRTBIMAP_FS0),
	dump_register(GPRTBIMAP_FS1),

	dump_register(GUSB2PHYCFG(0)),
	dump_register(GUSB2PHYCFG(1)),
	dump_register(GUSB2PHYCFG(2)),
	dump_register(GUSB2PHYCFG(3)),
	dump_register(GUSB2PHYCFG(4)),
	dump_register(GUSB2PHYCFG(5)),
	dump_register(GUSB2PHYCFG(6)),
	dump_register(GUSB2PHYCFG(7)),
	dump_register(GUSB2PHYCFG(8)),
	dump_register(GUSB2PHYCFG(9)),
	dump_register(GUSB2PHYCFG(10)),
	dump_register(GUSB2PHYCFG(11)),
	dump_register(GUSB2PHYCFG(12)),
	dump_register(GUSB2PHYCFG(13)),
	dump_register(GUSB2PHYCFG(14)),
	dump_register(GUSB2PHYCFG(15)),