blob: 7a19d32e9c67be018f28777ae9786a51911e69aa [file] [log] [blame]
T Michael Turney2c1cdea2018-03-15 13:18:00 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2018, The Linux Foundation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <device/device.h>
17#include <bootblock_common.h>
Julius Werner32912992018-08-01 16:30:42 -070018#include <gpio.h>
Chandana Kishori Chiluveruc0fe0b22018-03-26 15:13:36 -070019#include <soc/usb.h>
20
21static struct usb_board_data usb1_board_data = {
22 .pll_bias_control_2 = 0x28,
23 .imp_ctrl1 = 0x08,
24 .port_tune1 = 0x20,
25};
T Michael Turney2c1cdea2018-03-15 13:18:00 -070026
Julius Werner32912992018-08-01 16:30:42 -070027static void setup_usb(void)
28{
Chandana Kishori Chiluveruc0fe0b22018-03-26 15:13:36 -070029 /*
30 * Primary USB is used only for DP functionality on cheza platform.
31 * Hence Setting up only Secondary USB DWC3 controller.
32 */
33 setup_usb_host1(&usb1_board_data);
34
Julius Werner32912992018-08-01 16:30:42 -070035 gpio_output(GPIO(120), 1); /* Deassert HUB_RST_L to enable hub. */
36}
37
Elyes HAOUASd129d432018-05-04 20:23:33 +020038static void mainboard_init(struct device *dev)
T Michael Turney2c1cdea2018-03-15 13:18:00 -070039{
Julius Werner32912992018-08-01 16:30:42 -070040 setup_usb();
T Michael Turney2c1cdea2018-03-15 13:18:00 -070041}
42
Elyes HAOUASd129d432018-05-04 20:23:33 +020043static void mainboard_enable(struct device *dev)
T Michael Turney2c1cdea2018-03-15 13:18:00 -070044{
45 dev->ops->init = &mainboard_init;
46}
47
48struct chip_operations mainboard_ops = {
49 .name = CONFIG_MAINBOARD_PART_NUMBER,
50 .enable_dev = mainboard_enable,
51};