Angel Pons | 8a3453f | 2020-04-02 23:48:19 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Ronald G. Minnich | 99451b1 | 2013-06-27 10:42:59 -0700 | [diff] [blame] | 2 | |
Vladimir Serbinenko | a71bdc3 | 2014-08-30 00:35:39 +0200 | [diff] [blame] | 3 | #ifndef INTEL_I915_H |
| 4 | #define INTEL_I915_H 1 |
| 5 | |
Ronald G. Minnich | 99451b1 | 2013-06-27 10:42:59 -0700 | [diff] [blame] | 6 | #include <drivers/intel/gma/i915_reg.h> |
Matt DeVillier | 168d8a4 | 2020-04-20 18:50:17 -0500 | [diff] [blame] | 7 | #include <drivers/intel/gma/gma.h> |
Ronald G. Minnich | 99451b1 | 2013-06-27 10:42:59 -0700 | [diff] [blame] | 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 |
Ryan Salsamendi | 5d09d48 | 2017-07-04 13:53:00 -0700 | [diff] [blame] | 23 | #define WMx_LP_SR_EN (1UL<<31) |
Ronald G. Minnich | 99451b1 | 2013-06-27 10:42:59 -0700 | [diff] [blame] | 24 | #define PRB0_TAIL 0x02030 |
| 25 | #define PRB0_HEAD 0x02034 |
| 26 | #define PRB0_START 0x02038 |
| 27 | #define PRB0_CTL 0x0203c |
| 28 | |
Furquan Shaikh | d0a81f7 | 2013-07-30 12:41:08 -0700 | [diff] [blame] | 29 | enum port { |
| 30 | PORT_A = 0, |
| 31 | PORT_B, |
| 32 | PORT_C, |
Subrata Banik | 1858903 | 2023-09-17 18:39:31 +0000 | [diff] [blame^] | 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 |
Furquan Shaikh | d0a81f7 | 2013-07-30 12:41:08 -0700 | [diff] [blame] | 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, |
Subrata Banik | 1858903 | 2023-09-17 18:39:31 +0000 | [diff] [blame^] | 48 | #if CONFIG(INTEL_GMA_VERSION_2) |
| 49 | PIPE_D, |
| 50 | #endif |
Furquan Shaikh | d0a81f7 | 2013-07-30 12:41:08 -0700 | [diff] [blame] | 51 | I915_NUM_PIPES |
| 52 | }; |
| 53 | |
Furquan Shaikh | db3157c | 2013-07-31 16:47:31 -0700 | [diff] [blame] | 54 | enum transcoder { |
Martin Roth | b9810a4 | 2017-07-23 20:00:04 -0600 | [diff] [blame] | 55 | TRANSCODER_A = 0, |
| 56 | TRANSCODER_B, |
| 57 | TRANSCODER_C, |
| 58 | TRANSCODER_EDP = 0xF, |
Furquan Shaikh | db3157c | 2013-07-31 16:47:31 -0700 | [diff] [blame] | 59 | }; |
| 60 | |
Furquan Shaikh | 77f48cd | 2013-08-19 10:16:50 -0700 | [diff] [blame] | 61 | enum plane { |
| 62 | PLANE_A = 0, |
| 63 | PLANE_B, |
| 64 | PLANE_C, |
| 65 | }; |
| 66 | |
Ronald G. Minnich | 99451b1 | 2013-06-27 10:42:59 -0700 | [diff] [blame] | 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 | |
Furquan Shaikh | 77f48cd | 2013-08-19 10:16:50 -0700 | [diff] [blame] | 80 | void intel_prepare_ddi(void); |
Furquan Shaikh | 77f48cd | 2013-08-19 10:16:50 -0700 | [diff] [blame] | 81 | |
Ronald G. Minnich | 9518b56 | 2013-09-19 16:45:22 -0700 | [diff] [blame] | 82 | int gtt_poll(u32 reg, u32 mask, u32 value); |
Furquan Shaikh | 77f48cd | 2013-08-19 10:16:50 -0700 | [diff] [blame] | 83 | void gtt_write(u32 reg, u32 data); |
| 84 | u32 gtt_read(u32 reg); |
| 85 | |
Vladimir Serbinenko | a71bdc3 | 2014-08-30 00:35:39 +0200 | [diff] [blame] | 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 |