Tristan Corrick | 3f7de06 | 2018-03-02 03:02:07 +1300 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2017–2018 Tristan Corrick <tristan@corrick.kiwi> |
| 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, either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | */ |
| 16 | |
Arthur Heymans | fa5d0f8 | 2019-11-12 19:11:50 +0100 | [diff] [blame^] | 17 | #include <bootblock_common.h> |
Kyösti Mälkki | 3855c01 | 2019-03-03 08:45:19 +0200 | [diff] [blame] | 18 | #include <device/pnp_ops.h> |
Patrick Rudolph | e56189c | 2018-04-18 10:11:59 +0200 | [diff] [blame] | 19 | #include <device/pci_ops.h> |
Tristan Corrick | 3f7de06 | 2018-03-02 03:02:07 +1300 | [diff] [blame] | 20 | #include <device/dram/ddr3.h> |
| 21 | #include <northbridge/intel/sandybridge/raminit_native.h> |
| 22 | #include <northbridge/intel/sandybridge/sandybridge.h> |
| 23 | #include <southbridge/intel/bd82x6x/pch.h> |
| 24 | #include <superio/nuvoton/common/nuvoton.h> |
| 25 | #include <superio/nuvoton/nct6776/nct6776.h> |
| 26 | |
| 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, 5 }, |
| 39 | { 1, 0, 5 }, |
| 40 | { 1, 0, 6 }, |
| 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) |
Tristan Corrick | 3f7de06 | 2018-03-02 03:02:07 +1300 | [diff] [blame] | 45 | { |
| 46 | static const pnp_devfn_t GLOBAL_PSEUDO_DEV = PNP_DEV(0x2e, 0); |
| 47 | static const pnp_devfn_t ACPI_DEV = PNP_DEV(0x2e, NCT6776_ACPI); |
| 48 | |
| 49 | nuvoton_pnp_enter_conf_state(GLOBAL_PSEUDO_DEV); |
| 50 | |
| 51 | /* Select HWM/LED functions instead of floppy functions. */ |
| 52 | pnp_write_config(GLOBAL_PSEUDO_DEV, 0x1c, 0x03); |
| 53 | pnp_write_config(GLOBAL_PSEUDO_DEV, 0x24, 0x24); |
| 54 | |
| 55 | /* Power RAM in S3. */ |
| 56 | pnp_set_logical_device(ACPI_DEV); |
| 57 | pnp_write_config(ACPI_DEV, 0xe4, 0x10); |
| 58 | |
| 59 | nuvoton_pnp_exit_conf_state(GLOBAL_PSEUDO_DEV); |
| 60 | } |
| 61 | |
| 62 | void mainboard_get_spd(spd_raw_data *spd, bool id_only) |
| 63 | { |
| 64 | read_spd(&spd[0], 0x50, id_only); |
| 65 | read_spd(&spd[1], 0x51, id_only); |
| 66 | read_spd(&spd[2], 0x52, id_only); |
| 67 | read_spd(&spd[3], 0x53, id_only); |
| 68 | } |