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

Go to the source code of this file.

Data Structures

struct  gt_powermeter
 

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_write_powermeter (const struct gt_powermeter *pm)
 
int gtt_poll (u32 reg, u32 mask, u32 value)
 
static void gma_pm_init_pre_vbios (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 *device)
 
static const char * gma_acpi_name (const struct device *dev)
 
static void gma_func0_disable (struct device *dev)
 

Variables

static const struct gt_powermeter snb_pm_gt1 []
 
static const struct gt_powermeter snb_pm_gt2 []
 
static const struct gt_powermeter ivb_pm_gt1 []
 
static const struct gt_powermeter ivb_pm_gt2_17w []
 
static const struct gt_powermeter ivb_pm_gt2_35w []
 
static struct resourcegtt_res = NULL
 
static struct device_operations gma_func0_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver gma __pci_driver
 

Macro Definition Documentation

◆ GTT_RETRY

#define GTT_RETRY   1000

Definition at line 286 of file gma.c.

Function Documentation

◆ gma_acpi_name()

static const char* gma_acpi_name ( const struct device dev)
static

Definition at line 629 of file gma.c.

◆ gma_enable_swsci()

static void gma_enable_swsci ( void  )
static

Definition at line 566 of file gma.c.

References DEFAULT_PMBASE, DMISCI_STS, GPE0_EN, GPE0_STS, inw(), outl(), outw(), TCO1_STS, TCOSCI_EN, and TCOSCI_STS.

Referenced by gma_func0_init().

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

◆ gma_func0_disable()

static void gma_func0_disable ( struct device dev)
static

Definition at line 635 of file gma.c.

References device::enabled, GGC, pci_or_config16(), and pcidev_on_root().

Here is the call graph for this function:

◆ gma_func0_init()

◆ gma_generate_ssdt()

static void gma_generate_ssdt ( const struct device device)
static

Definition at line 622 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_pm_init_post_vbios()

◆ gma_pm_init_pre_vbios()

static void gma_pm_init_pre_vbios ( struct device dev)
static

Definition at line 303 of file gma.c.

References resource::base, BIOS_DEBUG, cpu_stepping(), gtt_poll(), gtt_read(), gtt_res, gtt_write(), gtt_write_powermeter(), is_sandybridge(), ivb_pm_gt1, ivb_pm_gt2_17w, ivb_pm_gt2_35w, IVB_STEP_C0, mchbar_read32(), PCI_BASE_ADDRESS_0, printk, probe_resource(), snb_pm_gt1, snb_pm_gt2, SNB_STEP_D1, and SNB_STEP_D2.

Referenced by gma_func0_init().

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

◆ gtt_poll()

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

Definition at line 287 of file gma.c.

References BIOS_ERR, 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 270 of file gma.c.

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

Here is the call graph for this function:

◆ gtt_write()

void gtt_write ( u32  reg,
u32  data 
)

Definition at line 275 of file gma.c.

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

Here is the call graph for this function:

◆ gtt_write_powermeter()

static void gtt_write_powermeter ( const struct gt_powermeter pm)
inlinestatic

Definition at line 280 of file gma.c.

References gtt_write(), gt_powermeter::reg, and gt_powermeter::value.

Referenced by gma_pm_init_pre_vbios().

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

Variable Documentation

◆ __pci_driver

const struct pci_driver gma __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:654
static struct device_operations gma_func0_ops
Definition: gma.c:643
#define PCI_VID_INTEL
Definition: pci_ids.h:2157

Definition at line 654 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,
.acpi_fill_ssdt = gma_generate_ssdt,
.init = gma_func0_init,
.vga_disable = gma_func0_disable,
.ops_pci = &pci_dev_ops_pci,
.acpi_name = gma_acpi_name,
}
static const char * gma_acpi_name(const struct device *dev)
Definition: gma.c:629
static void gma_func0_init(struct device *dev)
Definition: gma.c:584
static void gma_func0_disable(struct device *dev)
Definition: gma.c:635
static void gma_generate_ssdt(const struct device *device)
Definition: gma.c:622
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 635 of file gma.c.

◆ gtt_res

struct resource* gtt_res = NULL
static

Definition at line 268 of file gma.c.

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

◆ ivb_pm_gt1

const struct gt_powermeter ivb_pm_gt1[]
static

Definition at line 1 of file gma.c.

Referenced by gma_pm_init_pre_vbios().

◆ ivb_pm_gt2_17w

const struct gt_powermeter ivb_pm_gt2_17w[]
static

Definition at line 1 of file gma.c.

Referenced by gma_pm_init_pre_vbios().

◆ ivb_pm_gt2_35w

const struct gt_powermeter ivb_pm_gt2_35w[]
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:
= {
0x0102, 0x0106, 0x010a, 0x0112,
0x0116, 0x0122, 0x0126, 0x0156,
0x0166, 0x0162, 0x016a, 0x0152,
0
}

Definition at line 654 of file gma.c.

◆ snb_pm_gt1

const struct gt_powermeter snb_pm_gt1[]
static
Initial value:
= {
{ 0xa200, 0xcc000000 },
{ 0xa204, 0x07000040 },
{ 0xa208, 0x0000fe00 },
{ 0xa20c, 0x00000000 },
{ 0xa210, 0x17000000 },
{ 0xa214, 0x00000021 },
{ 0xa218, 0x0817fe19 },
{ 0xa21c, 0x00000000 },
{ 0xa220, 0x00000000 },
{ 0xa224, 0xcc000000 },
{ 0xa228, 0x07000040 },
{ 0xa22c, 0x0000fe00 },
{ 0xa230, 0x00000000 },
{ 0xa234, 0x17000000 },
{ 0xa238, 0x00000021 },
{ 0xa23c, 0x0817fe19 },
{ 0xa240, 0x00000000 },
{ 0xa244, 0x00000000 },
{ 0xa248, 0x8000421e },
{ 0 },
}

Definition at line 1 of file gma.c.

Referenced by gma_pm_init_pre_vbios().

◆ snb_pm_gt2

const struct gt_powermeter snb_pm_gt2[]
static
Initial value:
= {
{ 0xa200, 0x330000a6 },
{ 0xa204, 0x402d0031 },
{ 0xa208, 0x00165f83 },
{ 0xa20c, 0xf1000000 },
{ 0xa210, 0x00000000 },
{ 0xa214, 0x00160016 },
{ 0xa218, 0x002a002b },
{ 0xa21c, 0x00000000 },
{ 0xa220, 0x00000000 },
{ 0xa224, 0x330000a6 },
{ 0xa228, 0x402d0031 },
{ 0xa22c, 0x00165f83 },
{ 0xa230, 0xf1000000 },
{ 0xa234, 0x00000000 },
{ 0xa238, 0x00160016 },
{ 0xa23c, 0x002a002b },
{ 0xa240, 0x00000000 },
{ 0xa244, 0x00000000 },
{ 0xa248, 0x8000421e },
{ 0 },
}

Definition at line 1 of file gma.c.

Referenced by gma_pm_init_pre_vbios().