blob: f77b80489b2fec800c557b77f3856d2097260abd [file] [log] [blame]
Simon Glass79248a12014-11-14 18:18:42 -07001/*
2 * From Coreboot
3 * Copyright (C) 2008-2009 coresystems GmbH
4 *
5 * SPDX-License-Identifier: GPL-2.0
6 */
7
8#include <common.h>
9#include <asm/pci.h>
10#include <asm/arch/pch.h>
11
12void bd82x6x_usb_xhci_init(pci_dev_t dev)
13{
14 u32 reg32;
15
16 debug("XHCI: Setting up controller.. ");
17
18 /* lock overcurrent map */
Simon Glass240d06d2015-03-05 12:25:15 -070019 reg32 = x86_pci_read_config32(dev, 0x44);
Simon Glass79248a12014-11-14 18:18:42 -070020 reg32 |= 1;
Simon Glass240d06d2015-03-05 12:25:15 -070021 x86_pci_write_config32(dev, 0x44, reg32);
Simon Glass79248a12014-11-14 18:18:42 -070022
23 /* Enable clock gating */
Simon Glass240d06d2015-03-05 12:25:15 -070024 reg32 = x86_pci_read_config32(dev, 0x40);
Simon Glass79248a12014-11-14 18:18:42 -070025 reg32 &= ~((1 << 20) | (1 << 21));
26 reg32 |= (1 << 19) | (1 << 18) | (1 << 17);
27 reg32 |= (1 << 10) | (1 << 9) | (1 << 8);
28 reg32 |= (1 << 31); /* lock */
Simon Glass240d06d2015-03-05 12:25:15 -070029 x86_pci_write_config32(dev, 0x40, reg32);
Simon Glass79248a12014-11-14 18:18:42 -070030
31 debug("done.\n");
32}