coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
intel_ddi.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
2 
3 #include <types.h>
4 #include <console/console.h>
6 
7 /* HDMI/DVI modes ignore everything but the last 2 items. So we share
8  * them for both DP and FDI transports, allowing those ports to
9  * automatically adapt to HDMI connections as well.
10  */
12  0x00FFFFFF, 0x0006000E, /* DP parameters */
13  0x00D75FFF, 0x0005000A,
14  0x00C30FFF, 0x00040006,
15  0x80AAAFFF, 0x000B0000,
16  0x00FFFFFF, 0x0005000A,
17  0x00D75FFF, 0x000C0004,
18  0x80C30FFF, 0x000B0000,
19  0x00FFFFFF, 0x00040006,
20  0x80D75FFF, 0x000B0000,
21  0x00FFFFFF, 0x00040006 /* HDMI parameters */
22 };
23 
25  0x00FFFFFF, 0x0007000E, /* FDI parameters */
26  0x00D75FFF, 0x000F000A,
27  0x00C30FFF, 0x00060006,
28  0x00AAAFFF, 0x001E0000,
29  0x00FFFFFF, 0x000F000A,
30  0x00D75FFF, 0x00160004,
31  0x00C30FFF, 0x001E0000,
32  0x00FFFFFF, 0x00060006,
33  0x00D75FFF, 0x001E0000,
34  0x00FFFFFF, 0x00040006 /* HDMI parameters */
35 };
36 
37 /* On Haswell, DDI port buffers must be programmed with correct values
38  * in advance. The buffer values are different for FDI and DP modes,
39  * but the HDMI/DVI fields are shared among those. So we program the DDI
40  * in either FDI or DP modes only, as HDMI connections will work with both
41  * of those.
42  */
43 static void intel_prepare_ddi_buffers(int port, int use_fdi_mode)
44 {
45  u32 reg;
46  int i;
47  u32 *ddi_translations = ((use_fdi_mode) ?
50 
51  printk(BIOS_SPEW, "Initializing DDI buffers for port %d in %s mode\n",
52  port,
53  use_fdi_mode ? "FDI" : "DP");
54 
55  for (i=0,reg=DDI_BUF_TRANS(port);i < ARRAY_SIZE(hsw_ddi_translations_fdi);i++) {
56  gtt_write(reg,ddi_translations[i]);
57  reg += 4;
58  }
59 }
60 
62 {
63  int port;
64  u32 use_fdi = 1;
65 
66  for (port = PORT_A; port < PORT_E; port++)
68 
70 }
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define printk(level,...)
Definition: stdlib.h:16
void gtt_write(u32 reg, u32 data)
Definition: gma.c:27
port
Definition: i915.h:29
@ PORT_E
Definition: i915.h:34
@ PORT_A
Definition: i915.h:30
#define DDI_BUF_TRANS(port)
Definition: i915_reg.h:4256
static void intel_prepare_ddi_buffers(int port, int use_fdi_mode)
Definition: intel_ddi.c:43
static u32 hsw_ddi_translations_dp[]
Definition: intel_ddi.c:11
static u32 hsw_ddi_translations_fdi[]
Definition: intel_ddi.c:24
void intel_prepare_ddi(void)
Definition: intel_ddi.c:61
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
Definition: loglevel.h:142
uint32_t u32
Definition: stdint.h:51