Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Google Inc. |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 5 | * Copyright (C) 2015 Intel Corporation. |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 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. |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Duncan Laurie | 08a6fd3 | 2015-08-19 11:03:59 -0700 | [diff] [blame] | 17 | #include <chip.h> |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 18 | #include <console/console.h> |
| 19 | #include <console/streams.h> |
Duncan Laurie | 08a6fd3 | 2015-08-19 11:03:59 -0700 | [diff] [blame] | 20 | #include <device/device.h> |
| 21 | #include <device/pci_def.h> |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 22 | #include <stdlib.h> |
| 23 | #include <stdint.h> |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 24 | #include <soc/iomap.h> |
Duncan Laurie | 08a6fd3 | 2015-08-19 11:03:59 -0700 | [diff] [blame] | 25 | #include <soc/pci_devs.h> |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 26 | #include <soc/pei_data.h> |
| 27 | #include <soc/pei_wrapper.h> |
| 28 | #include <soc/smm.h> |
| 29 | |
| 30 | static void ABI_X86 send_to_console(unsigned char b) |
| 31 | { |
| 32 | console_tx_byte(b); |
| 33 | } |
| 34 | |
Lee Leahy | 1d14b3e | 2015-05-12 18:23:27 -0700 | [diff] [blame] | 35 | void soc_fill_pei_data(struct pei_data *pei_data) |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 36 | { |
Duncan Laurie | 08a6fd3 | 2015-08-19 11:03:59 -0700 | [diff] [blame] | 37 | const struct device *dev; |
| 38 | const struct soc_intel_skylake_config *config; |
| 39 | |
| 40 | /* Set the parameters for MemoryInit */ |
| 41 | dev = dev_find_slot(0, PCH_DEVFN_LPC); |
| 42 | config = dev->chip_info; |
| 43 | |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 44 | pei_data->pei_version = PEI_VERSION; |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 45 | pei_data->tx_byte = &send_to_console; |
Duncan Laurie | 08a6fd3 | 2015-08-19 11:03:59 -0700 | [diff] [blame] | 46 | |
| 47 | /* Force a full memory train if RMT is enabled */ |
| 48 | pei_data->disable_saved_data = config->Rmt; |
Lee Leahy | b000513 | 2015-05-12 18:19:47 -0700 | [diff] [blame] | 49 | } |