blob: 2e97f314066a9a7f0ab233e7e6aa5c022e6f7178 [file] [log] [blame]
Angel Pons6e5aabd2020-03-23 23:44:42 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Stefan Reinauer00636b02012-04-04 00:08:51 +02003
Iru Caid7ee9dd2016-02-24 15:03:58 +08004#ifndef NORTHBRIDGE_INTEL_SANDYBRIDGE_CHIP_H
5#define NORTHBRIDGE_INTEL_SANDYBRIDGE_CHIP_H
6
Vladimir Serbinenkoa71bdc32014-08-30 00:35:39 +02007#include <drivers/intel/gma/i915.h>
8
Stefan Reinauer00636b02012-04-04 00:08:51 +02009/*
10 * Digital Port Hotplug Enable:
Angel Pons7c49cb82020-03-16 23:17:32 +010011 * 0x04 = Enabled, 2ms short pulse
Stefan Reinauer00636b02012-04-04 00:08:51 +020012 * 0x05 = Enabled, 4.5ms short pulse
Angel Pons7c49cb82020-03-16 23:17:32 +010013 * 0x06 = Enabled, 6ms short pulse
Stefan Reinauer00636b02012-04-04 00:08:51 +020014 * 0x07 = Enabled, 100ms short pulse
15 */
16struct northbridge_intel_sandybridge_config {
17 u8 gpu_dp_b_hotplug; /* Digital Port B Hotplug Config */
18 u8 gpu_dp_c_hotplug; /* Digital Port C Hotplug Config */
19 u8 gpu_dp_d_hotplug; /* Digital Port D Hotplug Config */
20
21 u8 gpu_panel_port_select; /* 0=LVDS 1=DP_B 2=DP_C 3=DP_D */
22 u8 gpu_panel_power_cycle_delay; /* T4 time sequence */
23 u16 gpu_panel_power_up_delay; /* T1+T2 time sequence */
24 u16 gpu_panel_power_down_delay; /* T3 time sequence */
25 u16 gpu_panel_power_backlight_on_delay; /* T5 time sequence */
26 u16 gpu_panel_power_backlight_off_delay; /* Tx time sequence */
Duncan Lauriedd585b82012-04-09 12:05:18 -070027
28 u32 gpu_cpu_backlight; /* CPU Backlight PWM value */
29 u32 gpu_pch_backlight; /* PCH Backlight PWM value */
Vladimir Serbinenko1783a3c2014-02-23 00:10:35 +010030
Alexandru Gagniuc8b2c8f12015-02-17 04:31:01 -060031 /*
32 * Maximum memory clock.
33 * For example 666 for DDR3-1333, or 800 for DDR3-1600
34 */
35 u16 max_mem_clock_mhz;
36
Vladimir Serbinenkoa71bdc32014-08-30 00:35:39 +020037 struct i915_gpu_controller_info gfx;
Patrick Rudolph266a1f72016-06-09 18:13:34 +020038
39 /*
Angel Pons7c49cb82020-03-16 23:17:32 +010040 * Maximum PCI MMIO size in MiB.
Patrick Rudolph266a1f72016-06-09 18:13:34 +020041 */
42 u16 pci_mmio_size;
Patrick Rudolph5709e032019-03-25 10:12:14 +010043
44 /* Data for RAM init */
45
46 /* DIMM SPD address. Use 8bit notation where BIT0 is always zero. */
47 u8 spd_addresses[4];
48
49 /* PEI data for RAM init and early silicon init */
50 u8 ts_addresses[4];
51
52 bool ec_present;
53 bool ddr3lv_support;
54
Angel Pons7c49cb82020-03-16 23:17:32 +010055 /*
56 * N mode functionality. Leave this setting at 0.
Patrick Rudolph5709e032019-03-25 10:12:14 +010057 * 0 Auto
58 * 1 1N
59 * 2 2N
60 */
61 enum {
62 DDR_NMODE_AUTO = 0,
63 DDR_NMODE_1N,
64 DDR_NMODE_2N,
65 } nmode;
66
Angel Pons7c49cb82020-03-16 23:17:32 +010067 /*
68 * DDR refresh rate config. JEDEC Standard No.21-C Annex K allows for DIMM SPD data to
69 * specify whether double-rate is required for extended operating temperature range.
70 *
71 * 0 Enable double rate based upon temperature thresholds
72 * 1 Normal rate
73 * 2 Always enable double rate
Patrick Rudolph5709e032019-03-25 10:12:14 +010074 */
75 enum {
76 DDR_REFRESH_RATE_TEMP_THRES = 0,
77 DDR_REFRESH_REATE_NORMAL,
78 DDR_REFRESH_RATE_DOUBLE,
79 } ddr_refresh_rate_config;
80
81 /*
82 * USB Port Configuration:
83 * [0] = enable
84 * [1] = overcurrent pin
85 * [2] = length
86 *
Angel Pons7c49cb82020-03-16 23:17:32 +010087 * Ports 0-7 can be mapped to OC0-OC3
Patrick Rudolph5709e032019-03-25 10:12:14 +010088 * Ports 8-13 can be mapped to OC4-OC7
89 *
90 * Port Length
91 * MOBILE:
92 * < 0x050 = Setting 1 (back panel, 1-5in, lowest tx amplitude)
93 * < 0x140 = Setting 2 (back panel, 5-14in, highest tx amplitude)
94 * DESKTOP:
95 * < 0x080 = Setting 1 (front/back panel, <8in, lowest tx amplitude)
96 * < 0x130 = Setting 2 (back panel, 8-13in, higher tx amplitude)
97 * < 0x150 = Setting 3 (back panel, 13-15in, highest tx amplitude)
98 */
99 u16 usb_port_config[16][3];
100
101 struct {
102 /* 0: Disable, 1: Enable, 2: Auto, 3: Smart Auto */
103 u8 mode : 2;
104 /* 4 bit mask, 1: switchable, 0: not switchable */
105 u8 hs_port_switch_mask : 4;
106 /* 0: No xHCI preOS driver, 1: xHCI preOS driver */
107 u8 preboot_support : 1;
108 /* 0: Disable, 1: Enable */
109 u8 xhci_streams : 1;
110 } usb3;
Stefan Reinauer00636b02012-04-04 00:08:51 +0200111};
Iru Caid7ee9dd2016-02-24 15:03:58 +0800112
113#endif /* NORTHBRIDGE_INTEL_SANDYBRIDGE_CHIP_H */