blob: 43409ef8856a602c802eb6e9ecf1dbfb2ab13330 [file] [log] [blame]
Lee Leahyb0005132015-05-12 18:19:47 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 Google Inc.
Lee Leahy1d14b3e2015-05-12 18:23:27 -07005 * Copyright (C) 2015 Intel Corporation.
Lee Leahyb0005132015-05-12 18:19:47 -07006 *
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 Leahyb0005132015-05-12 18:19:47 -070015 */
16
Duncan Laurie08a6fd32015-08-19 11:03:59 -070017#include <chip.h>
Lee Leahy1d14b3e2015-05-12 18:23:27 -070018#include <console/console.h>
19#include <console/streams.h>
Duncan Laurie08a6fd32015-08-19 11:03:59 -070020#include <device/device.h>
21#include <device/pci_def.h>
Lee Leahyb0005132015-05-12 18:19:47 -070022#include <stdlib.h>
23#include <stdint.h>
Lee Leahyb0005132015-05-12 18:19:47 -070024#include <soc/iomap.h>
Duncan Laurie08a6fd32015-08-19 11:03:59 -070025#include <soc/pci_devs.h>
Lee Leahyb0005132015-05-12 18:19:47 -070026#include <soc/pei_data.h>
27#include <soc/pei_wrapper.h>
28#include <soc/smm.h>
29
30static void ABI_X86 send_to_console(unsigned char b)
31{
32 console_tx_byte(b);
33}
34
Lee Leahy1d14b3e2015-05-12 18:23:27 -070035void soc_fill_pei_data(struct pei_data *pei_data)
Lee Leahyb0005132015-05-12 18:19:47 -070036{
Duncan Laurie08a6fd32015-08-19 11:03:59 -070037 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 Leahyb0005132015-05-12 18:19:47 -070044 pei_data->pei_version = PEI_VERSION;
Lee Leahyb0005132015-05-12 18:19:47 -070045 pei_data->tx_byte = &send_to_console;
Duncan Laurie08a6fd32015-08-19 11:03:59 -070046
47 /* Force a full memory train if RMT is enabled */
48 pei_data->disable_saved_data = config->Rmt;
Lee Leahyb0005132015-05-12 18:19:47 -070049}