Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 1 | /* |
| 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 | |
| 33 | typedef void (*tx_byte_func)(unsigned char byte); |
Stefan Reinauer | 190688c | 2013-08-13 11:18:42 -0700 | [diff] [blame] | 34 | #define PEI_VERSION 15 |
Aaron Durbin | b1c25e7 | 2013-05-23 15:57:46 -0500 | [diff] [blame] | 35 | |
| 36 | #define MAX_USB2_PORTS 16 |
| 37 | #define MAX_USB3_PORTS 16 |
| 38 | #define USB_OC_PIN_SKIP 8 |
| 39 | |
Duncan Laurie | bcfcfa4 | 2013-06-03 10:41:12 -0700 | [diff] [blame] | 40 | enum 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 Durbin | b1c25e7 | 2013-05-23 15:57:46 -0500 | [diff] [blame] | 54 | struct usb2_port_setting { |
| 55 | uint16_t length; |
| 56 | uint8_t enable; |
| 57 | uint8_t over_current_pin; |
Duncan Laurie | bcfcfa4 | 2013-06-03 10:41:12 -0700 | [diff] [blame] | 58 | uint8_t location; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 59 | } __packed; |
Aaron Durbin | b1c25e7 | 2013-05-23 15:57:46 -0500 | [diff] [blame] | 60 | |
| 61 | struct usb3_port_setting { |
| 62 | uint8_t enable; |
| 63 | uint8_t over_current_pin; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 64 | } __packed; |
Aaron Durbin | 8256a9b | 2012-11-29 17:18:53 -0600 | [diff] [blame] | 65 | |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 66 | struct 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 Durbin | 8256a9b | 2012-11-29 17:18:53 -0600 | [diff] [blame] | 80 | uint32_t temp_mmio_base; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 81 | uint32_t system_type; // 0 Mobile, 1 Desktop/Server |
| 82 | uint32_t tseg_size; |
| 83 | uint8_t spd_addresses[4]; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 84 | int boot_mode; |
| 85 | int ec_present; |
Stefan Reinauer | 1cc3416 | 2013-06-27 15:59:18 -0700 | [diff] [blame] | 86 | int gbe_enable; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 87 | // 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 Laurie | bcfcfa4 | 2013-06-03 10:41:12 -0700 | [diff] [blame] | 93 | /* Enable 2x Refresh Mode */ |
| 94 | int ddr_refresh_2x; |
Stefan Reinauer | 190688c | 2013-08-13 11:18:42 -0700 | [diff] [blame] | 95 | int dq_pins_interleaved; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 96 | /* 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 Durbin | b1c25e7 | 2013-05-23 15:57:46 -0500 | [diff] [blame] | 103 | * Max frequency DDR3 could be ran at. Could be one of four values: 800, |
| 104 | * 1067, 1333, 1600 |
| 105 | */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 106 | uint32_t max_ddr3_freq; |
Duncan Laurie | 289bac6 | 2013-07-30 15:41:42 -0700 | [diff] [blame] | 107 | /* Route all USB ports to XHCI controller in resume path */ |
| 108 | int usb_xhci_on_resume; |
Aaron Durbin | b1c25e7 | 2013-05-23 15:57:46 -0500 | [diff] [blame] | 109 | struct usb2_port_setting usb2_ports[MAX_USB2_PORTS]; |
| 110 | struct usb3_port_setting usb3_ports[MAX_USB3_PORTS]; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 111 | uint8_t spd_data[4][256]; |
| 112 | tx_byte_func tx_byte; |
Stefan Reinauer | 6a00113 | 2017-07-13 02:20:27 +0200 | [diff] [blame] | 113 | } __packed; |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 114 | |
| 115 | #endif |