coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gfx.c File Reference
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <drivers/intel/gma/opregion.h>
#include <reg_script.h>
#include <soc/gfx.h>
#include <soc/iosf.h>
#include <soc/pci_devs.h>
#include <soc/ramstage.h>
#include <types.h>
#include "chip.h"
Include dependency graph for gfx.c:

Go to the source code of this file.

Macros

#define GFX_TIMEOUT   100000 /* 100ms */
 

Functions

static void gfx_lock_pcbase (struct device *dev)
 
static void gfx_run_script (struct device *dev, const struct reg_script *ops)
 
static void gfx_pre_vbios_init (struct device *dev)
 
static void gfx_pm_init (struct device *dev)
 
static void gfx_post_vbios_init (struct device *dev)
 
static void set_backlight_pwm (struct device *dev, uint32_t bklt_reg, int req_hz)
 
static void gfx_panel_setup (struct device *dev)
 
static void gfx_init (struct device *dev)
 
static void gma_generate_ssdt (const struct device *dev)
 

Variables

static const struct reg_script gfx_init_script []
 
static const struct reg_script gpu_pre_vbios_script []
 
static const struct reg_script gfx_post_vbios_script []
 
static struct device_operations gfx_device_ops
 
static const struct pci_driver gfx_driver __pci_driver
 

Macro Definition Documentation

◆ GFX_TIMEOUT

#define GFX_TIMEOUT   100000 /* 100ms */

Definition at line 19 of file gfx.c.

Function Documentation

◆ gfx_init()

static void gfx_init ( struct device dev)
static

Definition at line 353 of file gfx.c.

References reg_script::dev, gfx_panel_setup(), gfx_pm_init(), gfx_post_vbios_init(), gfx_pre_vbios_init(), intel_gma_init_igd_opregion(), and pci_dev_init().

Referenced by mainboard_romstage_entry().

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

◆ gfx_lock_pcbase()

static void gfx_lock_pcbase ( struct device dev)
static

Definition at line 25 of file gfx.c.

Referenced by gfx_pm_init().

Here is the caller graph for this function:

◆ gfx_panel_setup()

static void gfx_panel_setup ( struct device dev)
static

◆ gfx_pm_init()

static void gfx_pm_init ( struct device dev)
static

Definition at line 262 of file gfx.c.

References BIOS_INFO, reg_script::dev, gfx_init_script, gfx_lock_pcbase(), gfx_run_script(), and printk.

Referenced by gfx_init().

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

◆ gfx_post_vbios_init()

static void gfx_post_vbios_init ( struct device dev)
static

Definition at line 271 of file gfx.c.

References BIOS_INFO, reg_script::dev, gfx_post_vbios_script, gfx_run_script(), and printk.

Referenced by gfx_init().

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

◆ gfx_pre_vbios_init()

static void gfx_pre_vbios_init ( struct device dev)
static

Definition at line 256 of file gfx.c.

References BIOS_INFO, reg_script::dev, gfx_run_script(), gpu_pre_vbios_script, and printk.

Referenced by gfx_init().

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

◆ gfx_run_script()

static void gfx_run_script ( struct device dev,
const struct reg_script ops 
)
inlinestatic

Definition at line 250 of file gfx.c.

References reg_script::dev, ops, and reg_script_run_on_dev().

Referenced by gfx_pm_init(), gfx_post_vbios_init(), and gfx_pre_vbios_init().

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

◆ gma_generate_ssdt()

static void gma_generate_ssdt ( const struct device dev)
static

Definition at line 372 of file gfx.c.

◆ set_backlight_pwm()

static void set_backlight_pwm ( struct device dev,
uint32_t  bklt_reg,
int  req_hz 
)
static

Definition at line 277 of file gfx.c.

References resource::base, NULL, PCI_BASE_ADDRESS_0, probe_resource(), and write32().

Referenced by gfx_panel_setup().

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

Variable Documentation

◆ __pci_driver

const struct pci_driver gfx_driver __pci_driver
static
Initial value:
= {
.ops = &gfx_device_ops,
.vendor = PCI_VID_INTEL,
.device = GFX_DEVID,
}
static struct device_operations gfx_device_ops
Definition: gfx.c:379
#define GFX_DEVID
Definition: pci_devs.h:11
#define PCI_VID_INTEL
Definition: pci_ids.h:2157

Definition at line 372 of file gfx.c.

◆ gfx_device_ops

struct device_operations gfx_device_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = gfx_init,
.ops_pci = &soc_pci_ops,
.acpi_fill_ssdt = gma_generate_ssdt,
}
static void gma_generate_ssdt(const struct device *dev)
Definition: gfx.c:372
static void gfx_init(struct device *dev)
Definition: gfx.c:353
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
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
struct pci_operations soc_pci_ops
Definition: chip.c:51

Definition at line 372 of file gfx.c.

◆ gfx_init_script

const struct reg_script gfx_init_script[]
static

Definition at line 25 of file gfx.c.

Referenced by gfx_pm_init().

◆ gfx_post_vbios_script

const struct reg_script gfx_post_vbios_script[]
static
Initial value:
= {
REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x1300b0, 0x80000000),
REG_RES_WRITE32(PCI_BASE_ADDRESS_0, 0x1300b8, 0x80000000),
REG_PCI_RMW32(GGC, 0xffffffff, 1),
REG_PCI_RMW32(GSM_BASE, 0xffffffff, 1),
REG_PCI_RMW32(GTT_BASE, 0xffffffff, 1),
}
#define GFX_TIMEOUT
Definition: gfx.c:19
#define GSM_BASE
Definition: gfx.h:35
#define GGC
Definition: host_bridge.h:9
#define GTT_BASE
Definition: host_bridge.h:23
#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_PCI_RMW32(reg_, mask_, value_)
Definition: reg_script.h:175
#define REG_SCRIPT_END
Definition: reg_script.h:427

Definition at line 25 of file gfx.c.

Referenced by gfx_post_vbios_init().

◆ gpu_pre_vbios_script

const struct reg_script gpu_pre_vbios_script[]
static
Initial value:
= {
REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0xc0),
REG_IOSF_POLL(IOSF_PORT_PMC, PUNIT_PWRGT_STATUS, 0xc0, 0xc0,
REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0xfff0c0),
REG_IOSF_POLL(IOSF_PORT_PMC, PUNIT_PWRGT_STATUS, 0xfff0c0, 0xfff0c0,
REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0xfffcc0),
REG_IOSF_POLL(IOSF_PORT_PMC, PUNIT_PWRGT_STATUS, 0xfffcc0, 0xfffcc0,
REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0xf00cc0),
REG_IOSF_POLL(IOSF_PORT_PMC, PUNIT_PWRGT_STATUS, 0xfffcc0, 0xf00cc0,
REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0xf000c0),
REG_IOSF_POLL(IOSF_PORT_PMC, PUNIT_PWRGT_STATUS, 0xffffc0, 0xf000c0,
REG_IOSF_WRITE(IOSF_PORT_PMC, PUNIT_PWRGT_CONTROL, 0xf00000),
REG_IOSF_POLL(IOSF_PORT_PMC, PUNIT_PWRGT_STATUS, 0xfffff0, 0xf00000,
}
#define IOSF_PORT_PMC
Definition: iosf.h:93
#define PUNIT_PWRGT_STATUS
Definition: iosf.h:237
#define PUNIT_PWRGT_CONTROL
Definition: iosf.h:236
#define PCI_COMMAND_MASTER
Definition: pci_def.h:13
#define PCI_COMMAND_MEMORY
Definition: pci_def.h:12
#define PCI_COMMAND
Definition: pci_def.h:10
#define REG_PCI_OR32(reg_, value_)
Definition: reg_script.h:187

Definition at line 25 of file gfx.c.

Referenced by gfx_pre_vbios_init().