Patrick Georgi | 02363b5 | 2020-05-05 20:48:50 +0200 | [diff] [blame] | 1 | /* This file is part of the coreboot project. */ |
Tristan Corrick | 3f7de06 | 2018-03-02 03:02:07 +1300 | [diff] [blame] | 2 | /* |
Tristan Corrick | 3f7de06 | 2018-03-02 03:02:07 +1300 | [diff] [blame] | 3 | * |
| 4 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation, either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | */ |
| 14 | |
Arthur Heymans | fa5d0f8 | 2019-11-12 19:11:50 +0100 | [diff] [blame] | 15 | #include <bootblock_common.h> |
Kyösti Mälkki | 3855c01 | 2019-03-03 08:45:19 +0200 | [diff] [blame] | 16 | #include <device/pnp_ops.h> |
Tristan Corrick | 3f7de06 | 2018-03-02 03:02:07 +1300 | [diff] [blame] | 17 | #include <device/dram/ddr3.h> |
| 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/nuvoton/common/nuvoton.h> |
| 22 | #include <superio/nuvoton/nct6776/nct6776.h> |
| 23 | |
| 24 | const struct southbridge_usb_port mainboard_usb_ports[] = { |
| 25 | { 1, 0, 0 }, |
| 26 | { 1, 0, 0 }, |
| 27 | { 1, 0, 1 }, |
| 28 | { 1, 0, 1 }, |
| 29 | { 1, 0, 2 }, |
| 30 | { 1, 0, 2 }, |
| 31 | { 1, 0, 3 }, |
| 32 | { 1, 0, 3 }, |
| 33 | { 1, 0, 4 }, |
| 34 | { 1, 0, 4 }, |
| 35 | { 1, 0, 5 }, |
| 36 | { 1, 0, 5 }, |
| 37 | { 1, 0, 6 }, |
| 38 | { 1, 0, 6 }, |
| 39 | }; |
| 40 | |
Arthur Heymans | fa5d0f8 | 2019-11-12 19:11:50 +0100 | [diff] [blame] | 41 | void bootblock_mainboard_early_init(void) |
Tristan Corrick | 3f7de06 | 2018-03-02 03:02:07 +1300 | [diff] [blame] | 42 | { |
| 43 | static const pnp_devfn_t GLOBAL_PSEUDO_DEV = PNP_DEV(0x2e, 0); |
| 44 | static const pnp_devfn_t ACPI_DEV = PNP_DEV(0x2e, NCT6776_ACPI); |
| 45 | |
| 46 | nuvoton_pnp_enter_conf_state(GLOBAL_PSEUDO_DEV); |
| 47 | |
| 48 | /* Select HWM/LED functions instead of floppy functions. */ |
| 49 | pnp_write_config(GLOBAL_PSEUDO_DEV, 0x1c, 0x03); |
| 50 | pnp_write_config(GLOBAL_PSEUDO_DEV, 0x24, 0x24); |
| 51 | |
| 52 | /* Power RAM in S3. */ |
| 53 | pnp_set_logical_device(ACPI_DEV); |
| 54 | pnp_write_config(ACPI_DEV, 0xe4, 0x10); |
| 55 | |
| 56 | nuvoton_pnp_exit_conf_state(GLOBAL_PSEUDO_DEV); |
| 57 | } |
| 58 | |
| 59 | void mainboard_get_spd(spd_raw_data *spd, bool id_only) |
| 60 | { |
| 61 | read_spd(&spd[0], 0x50, id_only); |
| 62 | read_spd(&spd[1], 0x51, id_only); |
| 63 | read_spd(&spd[2], 0x52, id_only); |
| 64 | read_spd(&spd[3], 0x53, id_only); |
| 65 | } |