39 #define FB_REG06 0xD0810600
40 #define FB_MIPI_DISABLE (1 << 11)
41 #define FB_REG09 0xD0810900
42 #define FB_REG09 0xD0810900
43 #define FB_SKU_MASK 0x7000
44 #define FB_SKU_SHIFT 12
48 if (pci_root ==
NULL) {
54 pci_write_config_dword(pci_root, 0xD0, FB_REG06);
55 pci_read_config_dword(pci_root, 0xD4, &fuse_value);
61 DRM_INFO(
"internal display is %s\n",
62 dev_priv->
iLVDS_enable ?
"LVDS display" :
"MIPI display");
75 pci_write_config_dword(pci_root, 0xD0, FB_REG09);
76 pci_read_config_dword(pci_root, 0xD4, &fuse_value);
78 dev_dbg(dev->dev,
"SKU values is 0x%x.\n", fuse_value);
79 fuse_value_tmp = (fuse_value &
FB_SKU_MASK) >> FB_SKU_SHIFT;
83 switch (fuse_value_tmp) {
94 dev_warn(dev->dev,
"Invalid SKU values, SKU value = 0x%08x\n",
110 if (pci_gfx_root ==
NULL) {
114 pci_read_config_dword(pci_gfx_root, 0x08, &platform_rev_id);
117 dev_dbg(dev_priv->
dev->dev,
"platform_rev_id is %x\n",
147 vbt_virtual =
ioremap(addr,
sizeof(*vbt));
148 if (vbt_virtual ==
NULL)
161 vbt_virtual =
ioremap(addr,
sizeof(*vbt));
178 if (read_vbt_r0(addr, &vbt))
181 gct_virtual =
ioremap(addr +
sizeof(vbt), vbt.
size -
sizeof(vbt));
187 bpi = gct.PD.BootPanelIndex;
189 dev_priv->
gct_data.pt = gct.PD.PanelType;
190 dev_priv->
gct_data.DTD = gct.panel[bpi].DTD;
191 dev_priv->
gct_data.Panel_Port_Control =
192 gct.panel[bpi].Panel_Port_Control;
193 dev_priv->
gct_data.Panel_MIPI_Display_Descriptor =
194 gct.panel[bpi].Panel_MIPI_Display_Descriptor;
206 if (read_vbt_r0(addr, &vbt))
209 gct_virtual =
ioremap(addr +
sizeof(vbt), vbt.
size -
sizeof(vbt));
215 bpi = gct.PD.BootPanelIndex;
217 dev_priv->
gct_data.pt = gct.PD.PanelType;
218 dev_priv->
gct_data.DTD = gct.panel[bpi].DTD;
219 dev_priv->
gct_data.Panel_Port_Control =
220 gct.panel[bpi].Panel_Port_Control;
221 dev_priv->
gct_data.Panel_MIPI_Display_Descriptor =
222 gct.panel[bpi].Panel_MIPI_Display_Descriptor;
236 if (read_vbt_r10(addr, &vbt))
243 gct_virtual =
ioremap(addr +
sizeof(vbt),
251 dev_priv->
gct_data.Panel_MIPI_Display_Descriptor =
289 pci_read_config_dword(pci_gfx_root, 0xFC, &addr);
292 dev_dbg(dev->dev,
"drm platform config address is %x\n", addr);
312 ret = mid_get_vbt_data_r0(dev_priv, addr);
315 ret = mid_get_vbt_data_r1(dev_priv, addr);
318 ret = mid_get_vbt_data_r10(dev_priv, addr);
321 dev_err(dev->dev,
"Unknown revision of GCT!\n");
326 dev_err(dev->dev,
"Unable to read GCT!");
334 mid_get_fuse_settings(dev);
335 mid_get_vbt_data(dev_priv);
336 mid_get_pci_revID(dev_priv);