blob: f92c0a68e0a7883e5ac5057f4fe752952eb392f7 [file] [log] [blame]
Aaron Durbin76c37002012-10-30 09:03:43 -05001/*
2 * coreboot UEFI PEI wrapper
3 *
4 * Copyright (c) 2011, Google Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of Google Inc. nor the
15 * names of its contributors may be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC BE LIABLE FOR ANY DIRECT,
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#ifndef PEI_DATA_H
31#define PEI_DATA_H
32
33typedef void (*tx_byte_func)(unsigned char byte);
Stefan Reinauer190688c2013-08-13 11:18:42 -070034#define PEI_VERSION 15
Aaron Durbinb1c25e72013-05-23 15:57:46 -050035
36#define MAX_USB2_PORTS 16
37#define MAX_USB3_PORTS 16
38#define USB_OC_PIN_SKIP 8
39
Duncan Lauriebcfcfa42013-06-03 10:41:12 -070040enum usb2_port_location {
41 USB_PORT_BACK_PANEL = 0,
42 USB_PORT_FRONT_PANEL,
43 USB_PORT_DOCK,
44 USB_PORT_MINI_PCIE,
45 USB_PORT_FLEX,
46 USB_PORT_INTERNAL,
47 USB_PORT_SKIP
48};
49
50/* Usb Port Length:
51 * [16:4] = length in inches in octal format
52 * [3:0] = decimal point
53 */
Aaron Durbinb1c25e72013-05-23 15:57:46 -050054struct usb2_port_setting {
55 uint16_t length;
56 uint8_t enable;
57 uint8_t over_current_pin;
Duncan Lauriebcfcfa42013-06-03 10:41:12 -070058 uint8_t location;
Aaron Durbinb1c25e72013-05-23 15:57:46 -050059} __attribute__((packed));
60
61struct usb3_port_setting {
62 uint8_t enable;
63 uint8_t over_current_pin;
64} __attribute__((packed));
Aaron Durbin8256a9b2012-11-29 17:18:53 -060065
Aaron Durbin76c37002012-10-30 09:03:43 -050066struct pei_data
67{
68 uint32_t pei_version;
69 uint32_t mchbar;
70 uint32_t dmibar;
71 uint32_t epbar;
72 uint32_t pciexbar;
73 uint16_t smbusbar;
74 uint32_t wdbbar;
75 uint32_t wdbsize;
76 uint32_t hpet_address;
77 uint32_t rcba;
78 uint32_t pmbase;
79 uint32_t gpiobase;
Aaron Durbin8256a9b2012-11-29 17:18:53 -060080 uint32_t temp_mmio_base;
Aaron Durbin76c37002012-10-30 09:03:43 -050081 uint32_t system_type; // 0 Mobile, 1 Desktop/Server
82 uint32_t tseg_size;
83 uint8_t spd_addresses[4];
Aaron Durbin76c37002012-10-30 09:03:43 -050084 int boot_mode;
85 int ec_present;
Stefan Reinauer1cc34162013-06-27 15:59:18 -070086 int gbe_enable;
Aaron Durbin76c37002012-10-30 09:03:43 -050087 // 0 = leave channel enabled
88 // 1 = disable dimm 0 on channel
89 // 2 = disable dimm 1 on channel
90 // 3 = disable dimm 0+1 on channel
91 int dimm_channel0_disabled;
92 int dimm_channel1_disabled;
Duncan Lauriebcfcfa42013-06-03 10:41:12 -070093 /* Enable 2x Refresh Mode */
94 int ddr_refresh_2x;
Stefan Reinauer190688c2013-08-13 11:18:42 -070095 int dq_pins_interleaved;
Aaron Durbin76c37002012-10-30 09:03:43 -050096 /* Data read from flash and passed into MRC */
97 unsigned char *mrc_input;
98 unsigned int mrc_input_len;
99 /* Data from MRC that should be saved to flash */
100 unsigned char *mrc_output;
101 unsigned int mrc_output_len;
102 /*
Aaron Durbinb1c25e72013-05-23 15:57:46 -0500103 * Max frequency DDR3 could be ran at. Could be one of four values: 800,
104 * 1067, 1333, 1600
105 */
Aaron Durbin76c37002012-10-30 09:03:43 -0500106 uint32_t max_ddr3_freq;
Duncan Laurie289bac62013-07-30 15:41:42 -0700107 /* Route all USB ports to XHCI controller in resume path */
108 int usb_xhci_on_resume;
Aaron Durbinb1c25e72013-05-23 15:57:46 -0500109 struct usb2_port_setting usb2_ports[MAX_USB2_PORTS];
110 struct usb3_port_setting usb3_ports[MAX_USB3_PORTS];
Aaron Durbin76c37002012-10-30 09:03:43 -0500111 uint8_t spd_data[4][256];
112 tx_byte_func tx_byte;
Aaron Durbin76c37002012-10-30 09:03:43 -0500113} __attribute__((packed));
114
115#endif