coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gma.c File Reference
#include <commonlib/helpers.h>
#include <arch/io.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <console/console.h>
#include <bootmode.h>
#include <delay.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <drivers/intel/gma/i915_reg.h>
#include <drivers/intel/gma/i915.h>
#include <drivers/intel/gma/libgfxinit.h>
#include <cpu/intel/haswell/haswell.h>
#include <drivers/intel/gma/opregion.h>
#include <southbridge/intel/lynxpoint/pch.h>
#include <types.h>
#include "chip.h"
#include "haswell.h"
Include dependency graph for gma.c:

Go to the source code of this file.

Data Structures

struct  gt_reg
 

Macros

#define GTT_RETRY   1000
 

Functions

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)
 
static void gtt_write_regs (const struct gt_reg *gt)
 
int gtt_poll (u32 reg, u32 mask, u32 value)
 
static void power_well_enable (void)
 
static void gma_pm_init_pre_vbios (struct device *dev)
 
static void init_display_planes (void)
 
static void gma_setup_panel (struct device *dev)
 
static void gma_pm_init_post_vbios (struct device *dev)
 
static void gma_enable_swsci (void)
 
static void gma_func0_init (struct device *dev)
 
static void gma_generate_ssdt (const struct device *dev)
 

Variables

static const struct gt_reg haswell_gt_setup []
 
static const struct gt_reg haswell_gt_lock []
 
static struct resourcegtt_res = NULL
 
static struct device_operations gma_func0_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver pch_lpc __pci_driver
 

Macro Definition Documentation

◆ GTT_RETRY

#define GTT_RETRY   1000

Definition at line 153 of file gma.c.

Function Documentation

◆ gma_enable_swsci()

static void gma_enable_swsci ( void  )
static

Definition at line 404 of file gma.c.

References DMISCI_STS, enable_tco_sci(), get_pmbase(), inw(), outw(), and TCO1_STS.

Referenced by gma_func0_init().

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

◆ gma_func0_init()

◆ gma_generate_ssdt()

static void gma_generate_ssdt ( const struct device dev)
static

Definition at line 457 of file gma.c.

◆ gma_pm_init_post_vbios()

static void gma_pm_init_post_vbios ( struct device dev)
static

Definition at line 367 of file gma.c.

References FORCEWAKE_ACK_HSW, gtt_poll(), gtt_read(), gtt_rmw(), gtt_write(), haswell_is_ult(), PCI_DEVICE_ID, and pci_read_config16().

Referenced by gma_func0_init().

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

◆ gma_pm_init_pre_vbios()

◆ gma_setup_panel()

◆ gtt_poll()

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

Definition at line 154 of file gma.c.

Referenced by gma_pm_init_post_vbios(), gma_pm_init_pre_vbios(), igd_get_cdclk_broadwell(), and power_well_enable().

Here is the caller graph for this function:

◆ gtt_read()

u32 gtt_read ( u32  reg)

Definition at line 122 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 135 of file gma.c.

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

Referenced by gma_pm_init_post_vbios(), and gtt_write_regs().

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 130 of file gma.c.

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

Here is the call graph for this function:

◆ gtt_write_regs()

static void gtt_write_regs ( const struct gt_reg gt)
inlinestatic

Definition at line 143 of file gma.c.

References gt_reg::andmask, gtt_rmw(), gtt_write(), gt_reg::ormask, and gt_reg::reg.

Referenced by gma_pm_init_pre_vbios().

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

◆ init_display_planes()

static void init_display_planes ( void  )
static

Definition at line 224 of file gma.c.

References CPU_VGA_DISABLE, CPU_VGACNTRL, CURBASE_IVB, CURCNTR_IVB, CURSOR_MODE_DISABLE, DISPLAY_PLANE_DISABLE, DSPCNTR, DSPSURF, gtt_write(), PIPE_A, PIPE_C, PLANE_A, and PLANE_C.

Referenced by gma_setup_panel().

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

◆ map_oprom_vendev()

u32 map_oprom_vendev ( u32  vendev)

Definition at line 87 of file gma.c.

◆ power_well_enable()

static void power_well_enable ( void  )
static

Definition at line 171 of file gma.c.

References gtt_poll(), gtt_write(), HSW_PWR_WELL_CTL1, HSW_PWR_WELL_ENABLE, and HSW_PWR_WELL_STATE.

Referenced by gma_pm_init_pre_vbios(), and gma_setup_panel().

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

Variable Documentation

◆ __pci_driver

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

Definition at line 473 of file gma.c.

◆ gma_func0_ops

struct device_operations gma_func0_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = gma_func0_init,
.acpi_fill_ssdt = gma_generate_ssdt,
.ops_pci = &pci_dev_ops_pci,
}
static void gma_func0_init(struct device *dev)
Definition: gma.c:417
static void gma_generate_ssdt(const struct device *dev)
Definition: gma.c:457
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

Definition at line 457 of file gma.c.

◆ gtt_res

struct resource* gtt_res = NULL
static

Definition at line 120 of file gma.c.

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

◆ haswell_gt_lock

const struct gt_reg haswell_gt_lock[]
static
Initial value:
= {
{ 0x0a248, 0xffffffff, 0x80000000 },
{ 0x0a004, 0xffffffff, 0x00000010 },
{ 0x0a080, 0xffffffff, 0x00000004 },
{ 0x0a180, 0xffffffff, 0x80000000 },
{ 0 },
}

Definition at line 1 of file gma.c.

Referenced by gma_pm_init_pre_vbios().

◆ haswell_gt_setup

const struct gt_reg haswell_gt_setup[]
static

Definition at line 1 of file gma.c.

Referenced by gma_pm_init_pre_vbios().

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0x0402,
0x0412,
0x041e,
0x0422,
0x0d22,
0x0406,
0x0416,
0x0426,
0x0d16,
0x0d26,
0x0d36,
0x0a06,
0x0a16,
0x0a26,
0x0a0e,
0x0a1e,
0,
}

Definition at line 473 of file gma.c.