Angel Pons | 4b42983 | 2020-04-02 23:48:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 2 | |
| 3 | #ifndef RAMINIT_H |
| 4 | #define RAMINIT_H |
| 5 | |
Angel Pons | d0f971f | 2021-03-12 14:20:05 +0100 | [diff] [blame^] | 6 | #include <types.h> |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 7 | |
Angel Pons | 90ae089 | 2021-03-12 17:00:52 +0100 | [diff] [blame] | 8 | #define SPD_MEMORY_DOWN 0xff |
| 9 | |
| 10 | struct spd_info { |
| 11 | uint8_t addresses[4]; |
| 12 | unsigned int spd_index; |
| 13 | }; |
| 14 | |
Angel Pons | 76def38 | 2021-03-12 18:41:59 +0100 | [diff] [blame] | 15 | #if CONFIG(INTEL_LYNXPOINT_LP) |
| 16 | #define MAX_USB2_PORTS 10 |
| 17 | #define MAX_USB3_PORTS 4 |
| 18 | #else |
| 19 | #define MAX_USB2_PORTS 14 |
| 20 | #define MAX_USB3_PORTS 6 |
| 21 | #endif |
| 22 | |
Angel Pons | d0f971f | 2021-03-12 14:20:05 +0100 | [diff] [blame^] | 23 | /* There are 8 OC pins */ |
| 24 | #define USB_OC_PIN_SKIP 8 |
| 25 | |
| 26 | enum usb2_port_location { |
| 27 | USB_PORT_SKIP = 0, |
| 28 | USB_PORT_BACK_PANEL, |
| 29 | USB_PORT_FRONT_PANEL, |
| 30 | USB_PORT_DOCK, |
| 31 | USB_PORT_MINI_PCIE, |
| 32 | USB_PORT_FLEX, |
| 33 | USB_PORT_INTERNAL, |
| 34 | }; |
| 35 | |
| 36 | /* |
| 37 | * USB port length is in MRC format: binary-coded decimal length in tenths of an inch. |
| 38 | * 4.2 inches -> 0x0042 |
| 39 | * 12.7 inches -> 0x0127 |
| 40 | */ |
| 41 | struct usb2_port_config { |
| 42 | uint16_t length; |
| 43 | bool enable; |
| 44 | unsigned short oc_pin; |
| 45 | enum usb2_port_location location; |
| 46 | }; |
| 47 | |
| 48 | struct usb3_port_config { |
| 49 | bool enable; |
| 50 | unsigned int oc_pin; |
| 51 | }; |
| 52 | |
Angel Pons | 33b59c9 | 2021-02-11 13:42:20 +0100 | [diff] [blame] | 53 | /* Mainboard-specific USB configuration */ |
Angel Pons | d0f971f | 2021-03-12 14:20:05 +0100 | [diff] [blame^] | 54 | extern const struct usb2_port_config mainboard_usb2_ports[MAX_USB2_PORTS]; |
| 55 | extern const struct usb3_port_config mainboard_usb3_ports[MAX_USB3_PORTS]; |
Angel Pons | 33b59c9 | 2021-02-11 13:42:20 +0100 | [diff] [blame] | 56 | |
Angel Pons | c4ee714 | 2021-03-12 20:48:53 +0100 | [diff] [blame] | 57 | /* Mainboard callback to fill in the SPD addresses */ |
Angel Pons | 90ae089 | 2021-03-12 17:00:52 +0100 | [diff] [blame] | 58 | void mb_get_spd_map(struct spd_info *spdi); |
Angel Pons | d37b7d8 | 2020-07-03 23:52:34 +0200 | [diff] [blame] | 59 | |
Angel Pons | d99b693 | 2021-03-12 17:37:42 +0100 | [diff] [blame] | 60 | void perform_raminit(const int s3resume); |
Aaron Durbin | 76c3700 | 2012-10-30 09:03:43 -0500 | [diff] [blame] | 61 | |
| 62 | #endif /* RAMINIT_H */ |