blob: 4157b09097fdda451aed6d5fe5fa4f22c7131781 [file] [log] [blame]
Angel Pons963500f2018-04-29 19:56:49 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2018 Angel Pons <th3fanbus@gmail.com>
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 as published by
8 * the Free Software Foundation; version 2 of the License.
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
Arthur Heymansfa5d0f82019-11-12 19:11:50 +010016#include <bootblock_common.h>
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +020017#include <device/pci_ops.h>
Angel Pons963500f2018-04-29 19:56:49 +020018#include <northbridge/intel/sandybridge/raminit_native.h>
19#include <northbridge/intel/sandybridge/sandybridge.h>
20#include <southbridge/intel/bd82x6x/pch.h>
21#include <superio/ite/common/ite.h>
22#include <superio/ite/it8728f/it8728f.h>
23
24#define SUPERIO_GPIO PNP_DEV(0x2e, IT8728F_GPIO)
25#define SERIAL_DEV PNP_DEV(0x2e, 0x01)
26
Angel Pons963500f2018-04-29 19:56:49 +020027const struct southbridge_usb_port mainboard_usb_ports[] = {
28 { 1, 0, 0 },
29 { 1, 0, 0 },
30 { 1, 0, 1 },
31 { 1, 0, 1 },
32 { 1, 0, 2 },
33 { 1, 0, 2 },
34 { 1, 0, 3 },
35 { 1, 0, 3 },
36 { 1, 0, 4 },
37 { 1, 0, 4 },
38 { 1, 0, 6 },
39 { 1, 0, 5 },
40 { 1, 0, 5 },
41 { 1, 0, 6 },
42};
43
Arthur Heymansfa5d0f82019-11-12 19:11:50 +010044void bootblock_mainboard_early_init(void)
Angel Pons963500f2018-04-29 19:56:49 +020045{
Angel Ponsc6b44cd2019-03-10 13:21:12 +010046 if (!CONFIG(NO_UART_ON_SUPERIO)) {
47 /* Enable serial port */
48 ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
49 }
Angel Pons963500f2018-04-29 19:56:49 +020050
Angel Pons940bb4e2018-06-24 12:02:59 +020051 /* Disable SIO WDT which kicks in DualBIOS */
52 ite_reg_write(SUPERIO_GPIO, 0xEF, 0x7E);
Angel Pons963500f2018-04-29 19:56:49 +020053}
54
55void mainboard_get_spd(spd_raw_data *spd, bool id_only)
56{
57 read_spd(&spd[0], 0x50, id_only);
58 read_spd(&spd[2], 0x52, id_only);
59}