coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gma.c File Reference
#include <acpi/acpi.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <bootmode.h>
#include <commonlib/helpers.h>
#include <console/console.h>
#include <cpu/intel/haswell/haswell.h>
#include <delay.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <string.h>
#include <reg_script.h>
#include <drivers/intel/gma/i915.h>
#include <drivers/intel/gma/i915_reg.h>
#include <drivers/intel/gma/libgfxinit.h>
#include <drivers/intel/gma/opregion.h>
#include <soc/pm.h>
#include <soc/systemagent.h>
#include <soc/intel/broadwell/chip.h>
#include <security/vboot/vbnv.h>
#include <soc/igd.h>
#include <types.h>
Include dependency graph for gma.c:

Go to the source code of this file.

Macros

#define GT_RETRY   1000
 

Enumerations

enum  {
  GT_CDCLK_DEFAULT = 0 , GT_CDCLK_337 , GT_CDCLK_450 , GT_CDCLK_540 ,
  GT_CDCLK_675
}
 

Functions

u32 igd_get_reg_em4 (void)
 
u32 igd_get_reg_em5 (void)
 
u32 map_oprom_vendev (u32 vendev)
 
u32 gtt_read (u32 reg)
 
void gtt_write (u32 reg, u32 data)
 
static void gtt_rmw (u32 reg, u32 andmask, u32 ormask)
 
int gtt_poll (u32 reg, u32 mask, u32 value)
 
static void gma_setup_panel (struct device *dev)
 
static int igd_get_cdclk_haswell (u32 *const cdsel, int *const inform_pc, struct device *const dev)
 
static int igd_get_cdclk_broadwell (u32 *const cdsel, int *const inform_pc, struct device *const dev)
 
static void igd_cdclk_init (struct device *dev, const int is_broadwell)
 
static void igd_init (struct device *dev)
 
static void gma_generate_ssdt (const struct device *dev)
 

Variables

static u32 reg_em4
 
static u32 reg_em5
 
struct reg_script haswell_early_init_script []
 
static const struct reg_script haswell_late_init_script []
 
static const struct reg_script broadwell_early_init_script []
 
static const struct reg_script broadwell_late_init_script []
 
static struct resourcegtt_res = NULL
 
static struct device_operations igd_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver igd_driver __pci_driver
 

Macro Definition Documentation

◆ GT_RETRY

#define GT_RETRY   1000

Definition at line 27 of file gma.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GT_CDCLK_DEFAULT 
GT_CDCLK_337 
GT_CDCLK_450 
GT_CDCLK_540 
GT_CDCLK_675 

Definition at line 28 of file gma.c.

Function Documentation

◆ gma_generate_ssdt()

static void gma_generate_ssdt ( const struct device dev)
static

Definition at line 575 of file gma.c.

References chip, device::chip_info, and drivers_intel_gma_displays_ssdt_generate().

Here is the call graph for this function:

◆ gma_setup_panel()

◆ gtt_poll()

int gtt_poll ( u32  reg,
u32  mask,
u32  value 
)

Definition at line 269 of file gma.c.

References BIOS_ERR, GT_RETRY, gtt_read(), GTT_RETRY, mask, printk, udelay(), and value.

Here is the call graph for this function:

◆ gtt_read()

u32 gtt_read ( u32  reg)

Definition at line 248 of file gma.c.

References gtt_res, read32(), res2mmio(), and val.

Here is the call graph for this function:

◆ gtt_rmw()

static void gtt_rmw ( u32  reg,
u32  andmask,
u32  ormask 
)
inlinestatic

Definition at line 261 of file gma.c.

References gtt_read(), gtt_write(), and val.

Referenced by igd_cdclk_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gtt_write()

void gtt_write ( u32  reg,
u32  data 
)

Definition at line 256 of file gma.c.

References gtt_res, res2mmio(), and write32().

Referenced by intel_prepare_ddi_buffers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ igd_cdclk_init()

static void igd_cdclk_init ( struct device dev,
const int  is_broadwell 
)
static

Definition at line 443 of file gma.c.

References soc_intel_broadwell_config::cdclk, GT_CDCLK_337, GT_CDCLK_450, GT_CDCLK_540, GT_CDCLK_675, gtt_rmw(), gtt_write(), igd_get_cdclk_broadwell(), igd_get_cdclk_haswell(), reg_em4, and reg_em5.

Referenced by igd_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ igd_get_cdclk_broadwell()

static int igd_get_cdclk_broadwell ( u32 *const  cdsel,
int *const  inform_pc,
struct device *const  dev 
)
static

Definition at line 394 of file gma.c.

References BROADWELL_FAMILY_ULT, soc_intel_broadwell_config::cdclk, config_of(), cpu_family_model(), cpu_is_ult(), GT_CDCLK_337, GT_CDCLK_450, GT_CDCLK_540, GT_CDCLK_675, GT_CDCLK_DEFAULT, gtt_poll(), gtt_read(), gtt_write(), IGD_BROADWELL_Y_GT2, PCI_DEVICE_ID, and pci_read_config16().

Referenced by igd_cdclk_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ igd_get_cdclk_haswell()

static int igd_get_cdclk_haswell ( u32 *const  cdsel,
int *const  inform_pc,
struct device *const  dev 
)
static

Definition at line 360 of file gma.c.

References soc_intel_broadwell_config::cdclk, config_of(), cpu_family_model(), cpu_is_ult(), GT_CDCLK_337, GT_CDCLK_450, GT_CDCLK_540, gtt_read(), HASWELL_FAMILY_ULT, IGD_HASWELL_ULX_GT1, IGD_HASWELL_ULX_GT2, PCI_DEVICE_ID, and pci_read_config16().

Referenced by igd_cdclk_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ igd_get_reg_em4()

u32 igd_get_reg_em4 ( void  )

Definition at line 39 of file gma.c.

References reg_em4.

Referenced by minihd_init().

Here is the caller graph for this function:

◆ igd_get_reg_em5()

u32 igd_get_reg_em5 ( void  )

Definition at line 40 of file gma.c.

Referenced by minihd_init().

Here is the caller graph for this function:

◆ igd_init()

◆ map_oprom_vendev()

u32 map_oprom_vendev ( u32  vendev)

Definition at line 241 of file gma.c.

References SA_IGD_OPROM_VENDEV.

Variable Documentation

◆ __pci_driver

const struct pci_driver igd_driver __pci_driver
static
Initial value:
= {
.ops = &igd_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids,
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static struct device_operations igd_ops
Definition: gma.c:582
static const unsigned short pci_device_ids[]
Definition: gma.c:591

Definition at line 591 of file gma.c.

◆ broadwell_early_init_script

const struct reg_script broadwell_early_init_script[]
static

Definition at line 40 of file gma.c.

Referenced by igd_init().

◆ broadwell_late_init_script

const struct reg_script broadwell_late_init_script[]
static
Initial value:
= {
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a248, (1 << 31)),
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a000, (1 << 18)),
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a180, (1 << 31)),
REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00010000),
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x45400, (1 << 31)),
(1 << 30), (1 << 30), GT_RETRY),
}
#define FORCEWAKE_ACK_HSW
Definition: i915_reg.h:3882
#define PCI_BASE_ADDRESS_0
Definition: pci_def.h:63
#define REG_RES_POLL32(bar_, reg_, mask_, value_, timeout_)
Definition: reg_script.h:349
#define REG_RES_WRITE32(bar_, reg_, value_)
Definition: reg_script.h:325
#define REG_RES_OR32(bar_, reg_, value_)
Definition: reg_script.h:343
#define REG_SCRIPT_END
Definition: reg_script.h:427
#define GT_RETRY
Definition: gma.c:27

Definition at line 40 of file gma.c.

Referenced by igd_init().

◆ gtt_res

struct resource* gtt_res = NULL
static

Definition at line 246 of file gma.c.

Referenced by gtt_read(), gtt_write(), and igd_init().

◆ haswell_early_init_script

struct reg_script haswell_early_init_script[]

Definition at line 40 of file gma.c.

Referenced by igd_init().

◆ haswell_late_init_script

const struct reg_script haswell_late_init_script[]
static
Initial value:
= {
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a248, (1 << 31)),
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a004, (1 << 4)),
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a080, (1 << 2)),
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x0a180, (1 << 31)),
REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00010000),
REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0xa188, 0x00000001),
REG_RES_OR32(PCI_BASE_ADDRESS_0, 0x45400, (1 << 31)),
(1 << 30), (1 << 30), GT_RETRY),
}

Definition at line 40 of file gma.c.

Referenced by igd_init().

◆ igd_ops

struct device_operations igd_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = igd_init,
.acpi_fill_ssdt = gma_generate_ssdt,
.ops_pci = &pci_dev_ops_pci,
}
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
static void igd_init(struct device *dev)
Definition: gma.c:501
static void gma_generate_ssdt(const struct device *dev)
Definition: gma.c:575

Definition at line 575 of file gma.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0,
}
#define IGD_BROADWELL_Y_GT2
Definition: systemagent.h:19
#define IGD_BROADWELL_H_GT2
Definition: systemagent.h:20
#define IGD_HASWELL_ULT_GT3
Definition: systemagent.h:12
#define IGD_HASWELL_ULT_GT1
Definition: systemagent.h:10
#define IGD_BROADWELL_U_GT3_15W
Definition: systemagent.h:17
#define IGD_BROADWELL_H_GT3
Definition: systemagent.h:21
#define IGD_HASWELL_ULT_GT2
Definition: systemagent.h:11
#define IGD_BROADWELL_U_GT1
Definition: systemagent.h:15
#define IGD_BROADWELL_U_GT3_28W
Definition: systemagent.h:18
#define IGD_BROADWELL_U_GT2
Definition: systemagent.h:16

Definition at line 591 of file gma.c.

◆ reg_em4

u32 reg_em4
static

Definition at line 36 of file gma.c.

Referenced by igd_cdclk_init(), and igd_get_reg_em4().

◆ reg_em5

u32 reg_em5
static

Definition at line 37 of file gma.c.

Referenced by igd_cdclk_init().