Angel Pons | 963500f | 2018-04-29 19:56:49 +0200 | [diff] [blame] | 1 | /* |
| 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 Heymans | fa5d0f8 | 2019-11-12 19:11:50 +0100 | [diff] [blame^] | 16 | #include <bootblock_common.h> |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 17 | #include <device/pci_ops.h> |
Angel Pons | 963500f | 2018-04-29 19:56:49 +0200 | [diff] [blame] | 18 | #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 Pons | 963500f | 2018-04-29 19:56:49 +0200 | [diff] [blame] | 27 | const 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 Heymans | fa5d0f8 | 2019-11-12 19:11:50 +0100 | [diff] [blame^] | 44 | void bootblock_mainboard_early_init(void) |
Angel Pons | 963500f | 2018-04-29 19:56:49 +0200 | [diff] [blame] | 45 | { |
Angel Pons | c6b44cd | 2019-03-10 13:21:12 +0100 | [diff] [blame] | 46 | if (!CONFIG(NO_UART_ON_SUPERIO)) { |
| 47 | /* Enable serial port */ |
| 48 | ite_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE); |
| 49 | } |
Angel Pons | 963500f | 2018-04-29 19:56:49 +0200 | [diff] [blame] | 50 | |
Angel Pons | 940bb4e | 2018-06-24 12:02:59 +0200 | [diff] [blame] | 51 | /* Disable SIO WDT which kicks in DualBIOS */ |
| 52 | ite_reg_write(SUPERIO_GPIO, 0xEF, 0x7E); |
Angel Pons | 963500f | 2018-04-29 19:56:49 +0200 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | void 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 | } |