diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.h | 126 |
1 files changed, 66 insertions, 60 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h index fd94bd6dc264..9f688aa9a655 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.h +++ b/drivers/gpu/drm/nouveau/nouveau_bios.h | |||
@@ -34,9 +34,67 @@ | |||
34 | 34 | ||
35 | #define DCB_LOC_ON_CHIP 0 | 35 | #define DCB_LOC_ON_CHIP 0 |
36 | 36 | ||
37 | struct dcb_i2c_entry { | ||
38 | uint8_t port_type; | ||
39 | uint8_t read, write; | ||
40 | struct nouveau_i2c_chan *chan; | ||
41 | }; | ||
42 | |||
43 | enum dcb_gpio_tag { | ||
44 | DCB_GPIO_TVDAC0 = 0xc, | ||
45 | DCB_GPIO_TVDAC1 = 0x2d, | ||
46 | }; | ||
47 | |||
48 | struct dcb_gpio_entry { | ||
49 | enum dcb_gpio_tag tag; | ||
50 | int line; | ||
51 | bool invert; | ||
52 | }; | ||
53 | |||
54 | struct dcb_gpio_table { | ||
55 | int entries; | ||
56 | struct dcb_gpio_entry entry[DCB_MAX_NUM_GPIO_ENTRIES]; | ||
57 | }; | ||
58 | |||
59 | enum dcb_connector_type { | ||
60 | DCB_CONNECTOR_VGA = 0x00, | ||
61 | DCB_CONNECTOR_TV_0 = 0x10, | ||
62 | DCB_CONNECTOR_TV_1 = 0x11, | ||
63 | DCB_CONNECTOR_TV_3 = 0x13, | ||
64 | DCB_CONNECTOR_DVI_I = 0x30, | ||
65 | DCB_CONNECTOR_DVI_D = 0x31, | ||
66 | DCB_CONNECTOR_LVDS = 0x40, | ||
67 | DCB_CONNECTOR_DP = 0x46, | ||
68 | DCB_CONNECTOR_eDP = 0x47, | ||
69 | DCB_CONNECTOR_HDMI_0 = 0x60, | ||
70 | DCB_CONNECTOR_HDMI_1 = 0x61, | ||
71 | DCB_CONNECTOR_NONE = 0xff | ||
72 | }; | ||
73 | |||
74 | struct dcb_connector_table_entry { | ||
75 | uint32_t entry; | ||
76 | enum dcb_connector_type type; | ||
77 | uint8_t index; | ||
78 | uint8_t gpio_tag; | ||
79 | }; | ||
80 | |||
81 | struct dcb_connector_table { | ||
82 | int entries; | ||
83 | struct dcb_connector_table_entry entry[DCB_MAX_NUM_CONNECTOR_ENTRIES]; | ||
84 | }; | ||
85 | |||
86 | enum dcb_type { | ||
87 | OUTPUT_ANALOG = 0, | ||
88 | OUTPUT_TV = 1, | ||
89 | OUTPUT_TMDS = 2, | ||
90 | OUTPUT_LVDS = 3, | ||
91 | OUTPUT_DP = 6, | ||
92 | OUTPUT_ANY = -1 | ||
93 | }; | ||
94 | |||
37 | struct dcb_entry { | 95 | struct dcb_entry { |
38 | int index; /* may not be raw dcb index if merging has happened */ | 96 | int index; /* may not be raw dcb index if merging has happened */ |
39 | uint8_t type; | 97 | enum dcb_type type; |
40 | uint8_t i2c_index; | 98 | uint8_t i2c_index; |
41 | uint8_t heads; | 99 | uint8_t heads; |
42 | uint8_t connector; | 100 | uint8_t connector; |
@@ -71,69 +129,22 @@ struct dcb_entry { | |||
71 | bool i2c_upper_default; | 129 | bool i2c_upper_default; |
72 | }; | 130 | }; |
73 | 131 | ||
74 | struct dcb_i2c_entry { | 132 | struct dcb_table { |
75 | uint8_t port_type; | 133 | uint8_t version; |
76 | uint8_t read, write; | ||
77 | struct nouveau_i2c_chan *chan; | ||
78 | }; | ||
79 | 134 | ||
80 | struct parsed_dcb { | ||
81 | int entries; | 135 | int entries; |
82 | struct dcb_entry entry[DCB_MAX_NUM_ENTRIES]; | 136 | struct dcb_entry entry[DCB_MAX_NUM_ENTRIES]; |
83 | struct dcb_i2c_entry i2c[DCB_MAX_NUM_I2C_ENTRIES]; | ||
84 | }; | ||
85 | |||
86 | enum dcb_gpio_tag { | ||
87 | DCB_GPIO_TVDAC0 = 0xc, | ||
88 | DCB_GPIO_TVDAC1 = 0x2d, | ||
89 | }; | ||
90 | |||
91 | struct dcb_gpio_entry { | ||
92 | enum dcb_gpio_tag tag; | ||
93 | int line; | ||
94 | bool invert; | ||
95 | }; | ||
96 | |||
97 | struct parsed_dcb_gpio { | ||
98 | int entries; | ||
99 | struct dcb_gpio_entry entry[DCB_MAX_NUM_GPIO_ENTRIES]; | ||
100 | }; | ||
101 | |||
102 | struct dcb_connector_table_entry { | ||
103 | uint32_t entry; | ||
104 | uint8_t type; | ||
105 | uint8_t index; | ||
106 | uint8_t gpio_tag; | ||
107 | }; | ||
108 | |||
109 | struct dcb_connector_table { | ||
110 | int entries; | ||
111 | struct dcb_connector_table_entry entry[DCB_MAX_NUM_CONNECTOR_ENTRIES]; | ||
112 | }; | ||
113 | |||
114 | struct bios_parsed_dcb { | ||
115 | uint8_t version; | ||
116 | |||
117 | struct parsed_dcb dcb; | ||
118 | 137 | ||
119 | uint8_t *i2c_table; | 138 | uint8_t *i2c_table; |
120 | uint8_t i2c_default_indices; | 139 | uint8_t i2c_default_indices; |
140 | struct dcb_i2c_entry i2c[DCB_MAX_NUM_I2C_ENTRIES]; | ||
121 | 141 | ||
122 | uint16_t gpio_table_ptr; | 142 | uint16_t gpio_table_ptr; |
123 | struct parsed_dcb_gpio gpio; | 143 | struct dcb_gpio_table gpio; |
124 | uint16_t connector_table_ptr; | 144 | uint16_t connector_table_ptr; |
125 | struct dcb_connector_table connector; | 145 | struct dcb_connector_table connector; |
126 | }; | 146 | }; |
127 | 147 | ||
128 | enum nouveau_encoder_type { | ||
129 | OUTPUT_ANALOG = 0, | ||
130 | OUTPUT_TV = 1, | ||
131 | OUTPUT_TMDS = 2, | ||
132 | OUTPUT_LVDS = 3, | ||
133 | OUTPUT_DP = 6, | ||
134 | OUTPUT_ANY = -1 | ||
135 | }; | ||
136 | |||
137 | enum nouveau_or { | 148 | enum nouveau_or { |
138 | OUTPUT_A = (1 << 0), | 149 | OUTPUT_A = (1 << 0), |
139 | OUTPUT_B = (1 << 1), | 150 | OUTPUT_B = (1 << 1), |
@@ -190,8 +201,8 @@ struct pll_lims { | |||
190 | int refclk; | 201 | int refclk; |
191 | }; | 202 | }; |
192 | 203 | ||
193 | struct nouveau_bios_info { | 204 | struct nvbios { |
194 | struct parsed_dcb *dcb; | 205 | struct drm_device *dev; |
195 | 206 | ||
196 | uint8_t chip_version; | 207 | uint8_t chip_version; |
197 | 208 | ||
@@ -199,11 +210,6 @@ struct nouveau_bios_info { | |||
199 | uint32_t tvdactestval; | 210 | uint32_t tvdactestval; |
200 | uint8_t digital_min_front_porch; | 211 | uint8_t digital_min_front_porch; |
201 | bool fp_no_ddc; | 212 | bool fp_no_ddc; |
202 | }; | ||
203 | |||
204 | struct nvbios { | ||
205 | struct drm_device *dev; | ||
206 | struct nouveau_bios_info pub; | ||
207 | 213 | ||
208 | struct mutex lock; | 214 | struct mutex lock; |
209 | 215 | ||
@@ -234,7 +240,7 @@ struct nvbios { | |||
234 | uint16_t some_script_ptr; /* BIT I + 14 */ | 240 | uint16_t some_script_ptr; /* BIT I + 14 */ |
235 | uint16_t init96_tbl_ptr; /* BIT I + 16 */ | 241 | uint16_t init96_tbl_ptr; /* BIT I + 16 */ |
236 | 242 | ||
237 | struct bios_parsed_dcb bdcb; | 243 | struct dcb_table dcb; |
238 | 244 | ||
239 | struct { | 245 | struct { |
240 | int crtchead; | 246 | int crtchead; |