xref: /aosp_15_r20/external/coreboot/src/drivers/intel/gma/i915.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef INTEL_I915_H
4 #define INTEL_I915_H 1
5 
6 #include <drivers/intel/gma/i915_reg.h>
7 #include <drivers/intel/gma/gma.h>
8 #include <edid.h>
9 
10 /* port types. We stick with the same defines as the kernel */
11 #define INTEL_OUTPUT_UNUSED 0
12 #define INTEL_OUTPUT_ANALOG 1
13 #define INTEL_OUTPUT_DVO 2
14 #define INTEL_OUTPUT_SDVO 3
15 #define INTEL_OUTPUT_LVDS 4
16 #define INTEL_OUTPUT_TVOUT 5
17 #define INTEL_OUTPUT_HDMI 6
18 #define INTEL_OUTPUT_DISPLAYPORT 7
19 #define INTEL_OUTPUT_EDP 8
20 
21 /* things that are, strangely, not defined anywhere? */
22 #define PCH_PP_UNLOCK	0xabcd0000
23 #define WMx_LP_SR_EN	(1UL<<31)
24 #define PRB0_TAIL	0x02030
25 #define PRB0_HEAD	0x02034
26 #define PRB0_START	0x02038
27 #define PRB0_CTL	0x0203c
28 
29 enum port {
30 	PORT_A = 0,
31 	PORT_B,
32 	PORT_C,
33 #if CONFIG(INTEL_GMA_VERSION_2)
34 	PORT_USB_C1,
35 	PORT_USB_C2,
36 	PORT_USB_C3,
37 	PORT_USB_C4,
38 #endif
39 	PORT_D,
40 	PORT_E,
41 	I915_NUM_PORTS
42 };
43 
44 enum pipe {
45 	PIPE_A = 0,
46 	PIPE_B,
47 	PIPE_C,
48 #if CONFIG(INTEL_GMA_VERSION_2)
49 	PIPE_D,
50 #endif
51 	I915_NUM_PIPES
52 };
53 
54 enum transcoder {
55 	TRANSCODER_A = 0,
56 	TRANSCODER_B,
57 	TRANSCODER_C,
58 	TRANSCODER_EDP = 0xF,
59 };
60 
61 enum plane {
62 	PLANE_A = 0,
63 	PLANE_B,
64 	PLANE_C,
65 };
66 
67 /* debug enums. These are for printks that, due to their place in the
68  * middle of graphics device IO, might change timing.  Use with care
69  * or not at all.
70  */
71 enum {
72 	vio = 2, /* dump every IO */
73 	vspin = 4, /* print # of times we spun on a register value */
74 };
75 
76 /* The mainboard must provide these functions. */
77 unsigned long io_i915_read32(unsigned long addr);
78 void io_i915_write32(unsigned long val, unsigned long addr);
79 
80 void intel_prepare_ddi(void);
81 
82 int gtt_poll(u32 reg, u32 mask, u32 value);
83 void gtt_write(u32 reg, u32 data);
84 u32 gtt_read(u32 reg);
85 
86 /* vbt.c */
87 struct device;
88 void
89 generate_fake_intel_oprom(const struct i915_gpu_controller_info *conf,
90 			  struct device *dev, const char *idstr);
91 
92 #endif
93