Angel Pons | 89ab250 | 2020-04-03 01:22:28 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Vladimir Serbinenko | 94930e2 | 2014-08-24 22:40:33 +0200 | [diff] [blame] | 3 | |
| 4 | #include <stdint.h> |
Vladimir Serbinenko | 94930e2 | 2014-08-24 22:40:33 +0200 | [diff] [blame] | 5 | #include <cpu/x86/lapic.h> |
Vladimir Serbinenko | 94930e2 | 2014-08-24 22:40:33 +0200 | [diff] [blame] | 6 | #include <arch/acpi.h> |
Edward O'Callaghan | 77757c2 | 2015-01-04 21:33:39 +1100 | [diff] [blame] | 7 | #include <northbridge/intel/sandybridge/sandybridge.h> |
Arthur Heymans | 4c81d44 | 2018-01-29 12:14:37 +0100 | [diff] [blame] | 8 | #include <northbridge/intel/sandybridge/raminit.h> |
Edward O'Callaghan | 77757c2 | 2015-01-04 21:33:39 +1100 | [diff] [blame] | 9 | #include <northbridge/intel/sandybridge/raminit_native.h> |
| 10 | #include <southbridge/intel/bd82x6x/pch.h> |
Patrick Rudolph | e8e66f4 | 2016-02-06 17:42:42 +0100 | [diff] [blame] | 11 | #include <southbridge/intel/common/gpio.h> |
Vladimir Serbinenko | 94930e2 | 2014-08-24 22:40:33 +0200 | [diff] [blame] | 12 | #include <cpu/x86/msr.h> |
Vladimir Serbinenko | 94930e2 | 2014-08-24 22:40:33 +0200 | [diff] [blame] | 13 | |
Arthur Heymans | 4c81d44 | 2018-01-29 12:14:37 +0100 | [diff] [blame] | 14 | void mainboard_fill_pei_data(struct pei_data *pei_data) |
| 15 | { |
| 16 | struct pei_data pei_data_template = { |
| 17 | .pei_version = PEI_VERSION, |
| 18 | .mchbar = (uintptr_t)DEFAULT_MCHBAR, |
| 19 | .dmibar = (uintptr_t)DEFAULT_DMIBAR, |
| 20 | .epbar = DEFAULT_EPBAR, |
| 21 | .pciexbar = CONFIG_MMCONF_BASE_ADDRESS, |
| 22 | .smbusbar = SMBUS_IO_BASE, |
| 23 | .wdbbar = 0x4000000, |
| 24 | .wdbsize = 0x1000, |
| 25 | .hpet_address = CONFIG_HPET_ADDRESS, |
| 26 | .rcba = (uintptr_t)DEFAULT_RCBABASE, |
| 27 | .pmbase = DEFAULT_PMBASE, |
| 28 | .gpiobase = DEFAULT_GPIOBASE, |
| 29 | .thermalbase = 0xfed08000, |
| 30 | .system_type = 0, // 0 Mobile, 1 Desktop/Server |
| 31 | .tseg_size = CONFIG_SMM_TSEG_SIZE, |
| 32 | .spd_addresses = { 0xa0, 0x00,0xa2,0x00 }, |
| 33 | .ts_addresses = { 0x00, 0x00, 0x00, 0x00 }, |
| 34 | .ec_present = 1, |
| 35 | .gbe_enable = 1, |
| 36 | // 0 = leave channel enabled |
| 37 | // 1 = disable dimm 0 on channel |
| 38 | // 2 = disable dimm 1 on channel |
| 39 | // 3 = disable dimm 0+1 on channel |
| 40 | .dimm_channel0_disabled = 2, |
| 41 | .dimm_channel1_disabled = 2, |
| 42 | .max_ddr3_freq = 1333, |
| 43 | .usb_port_config = { |
| 44 | { 1, 0, 0x0040 }, |
| 45 | { 1, 1, 0x0080 }, |
| 46 | { 1, 3, 0x0080 }, |
| 47 | { 1, 3, 0x0080 }, |
| 48 | { 1, 0, 0x0080 }, |
| 49 | { 1, 0, 0x0080 }, |
| 50 | { 1, 2, 0x0040 }, |
| 51 | { 1, 2, 0x0040 }, |
| 52 | { 1, 6, 0x0080 }, |
| 53 | { 1, 5, 0x0080 }, |
| 54 | { 1, 6, 0x0080 }, |
| 55 | { 1, 6, 0x0080 }, |
| 56 | { 1, 7, 0x0080 }, |
| 57 | { 1, 6, 0x0080 }, |
| 58 | }, |
| 59 | }; |
| 60 | *pei_data = pei_data_template; |
| 61 | } |
| 62 | |
Kyösti Mälkki | e258b9a | 2016-11-18 19:59:23 +0200 | [diff] [blame] | 63 | void mainboard_get_spd(spd_raw_data *spd, bool id_only) |
Jan Tatje | b874308 | 2016-06-04 19:29:03 +0200 | [diff] [blame] | 64 | { |
Kyösti Mälkki | e258b9a | 2016-11-18 19:59:23 +0200 | [diff] [blame] | 65 | read_spd (&spd[0], 0x50, id_only); |
| 66 | read_spd (&spd[2], 0x51, id_only); |
Vladimir Serbinenko | 94930e2 | 2014-08-24 22:40:33 +0200 | [diff] [blame] | 67 | } |
Vladimir Serbinenko | 609bd94 | 2016-01-31 14:00:54 +0100 | [diff] [blame] | 68 | |
Arthur Heymans | 4c81d44 | 2018-01-29 12:14:37 +0100 | [diff] [blame] | 69 | int mainboard_should_reset_usb(int s3resume) |
| 70 | { |
| 71 | return !s3resume; |
| 72 | } |