coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
southcluster.c File Reference
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <acpi/acpi.h>
#include <arch/ioapic.h>
#include <bootstate.h>
#include "chip.h"
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <intelblocks/lpc_lib.h>
#include <pc80/isa-dma.h>
#include <pc80/i8254.h>
#include <pc80/i8259.h>
#include <soc/acpi.h>
#include <soc/iomap.h>
#include <soc/irq.h>
#include <soc/lpc.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/ramstage.h>
#include <soc/spi.h>
#include <spi-generic.h>
#include <stdint.h>
#include <southbridge/intel/common/spi.h>
Include dependency graph for southcluster.c:

Go to the source code of this file.

Macros

#define LPC_DEFAULT_IO_RANGE_LOWER   0
 
#define LPC_DEFAULT_IO_RANGE_UPPER   0x1000
 
#define SET_DIS_MASK(name_)
 
#define SET_DIS_MASK2(name_)
 
#define DEV_CASE(name_)    case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC)
 

Functions

static void sc_set_serial_irqs_mode (struct device *dev, enum serirq_mode mode)
 
static void add_mmio_resource (struct device *dev, int i, unsigned long addr, unsigned long size)
 
static void sc_add_mmio_resources (struct device *dev)
 
static void sc_enable_serial_irqs (struct device *dev)
 
static void write_pci_config_irqs (void)
 
static int io_range_in_default (int base, int size)
 
static void sc_add_io_resource (struct device *dev, int base, int size, int index)
 
static void sc_add_io_resources (struct device *dev)
 
static void sc_read_resources (struct device *dev)
 
static void sc_init (struct device *dev)
 
static void sc_disable_devfn (struct device *dev)
 
static void set_d3hot_bits (struct device *dev, int offset)
 
static void hda_work_around (struct device *dev)
 
static int place_device_in_d3hot (struct device *dev)
 
void southcluster_enable_dev (struct device *dev)
 
static void finalize_chipset (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_POST_DEVICE, BS_ON_EXIT, finalize_chipset, NULL)
 

Variables

static struct device_operations device_ops
 
static const struct pci_driver southcluster __pci_driver
 

Macro Definition Documentation

◆ DEV_CASE

#define DEV_CASE (   name_)     case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC)

◆ LPC_DEFAULT_IO_RANGE_LOWER

#define LPC_DEFAULT_IO_RANGE_LOWER   0

Definition at line 71 of file southcluster.c.

◆ LPC_DEFAULT_IO_RANGE_UPPER

#define LPC_DEFAULT_IO_RANGE_UPPER   0x1000

Definition at line 72 of file southcluster.c.

◆ SET_DIS_MASK

#define SET_DIS_MASK (   name_)
Value:
case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC): \
mask |= name_ ## _DIS
#define PCI_DEVFN(slot, func)
Definition: pci_def.h:548
static const int mask[4]
Definition: gpio.c:308

◆ SET_DIS_MASK2

#define SET_DIS_MASK2 (   name_)
Value:
case PCI_DEVFN(name_ ## _DEV, name_ ## _FUNC): \
mask2 |= name_ ## _DIS

Function Documentation

◆ add_mmio_resource()

static void add_mmio_resource ( struct device dev,
int  i,
unsigned long  addr,
unsigned long  size 
)
inlinestatic

Definition at line 48 of file southcluster.c.

References addr, and mmio_resource.

Referenced by sc_add_mmio_resources().

Here is the caller graph for this function:

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_POST_DEVICE  ,
BS_ON_EXIT  ,
finalize_chipset  ,
NULL   
)

◆ finalize_chipset()

◆ hda_work_around()

static void hda_work_around ( struct device dev)
static

Definition at line 405 of file southcluster.c.

References PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_1, PCI_COMMAND, PCI_COMMAND_MEMORY, pci_write_config16(), pci_write_config32(), pci_write_config8(), read32(), TEMP_BASE_ADDRESS, and write32().

Referenced by place_device_in_d3hot().

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

◆ io_range_in_default()

static int io_range_in_default ( int  base,
int  size 
)
inlinestatic

Definition at line 181 of file southcluster.c.

References base, LPC_DEFAULT_IO_RANGE_LOWER, and LPC_DEFAULT_IO_RANGE_UPPER.

Referenced by sc_add_io_resource().

Here is the caller graph for this function:

◆ place_device_in_d3hot()

static int place_device_in_d3hot ( struct device dev)
static

◆ sc_add_io_resource()

static void sc_add_io_resource ( struct device dev,
int  base,
int  size,
int  index 
)
static

Definition at line 199 of file southcluster.c.

References resource::base, base, resource::flags, resource::index, io_range_in_default(), IORESOURCE_ASSIGNED, IORESOURCE_FIXED, IORESOURCE_IO, new_resource(), and resource::size.

Referenced by sc_add_io_resources().

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

◆ sc_add_io_resources()

static void sc_add_io_resources ( struct device dev)
static

◆ sc_add_mmio_resources()

static void sc_add_mmio_resources ( struct device dev)
static

◆ sc_disable_devfn()

static void sc_disable_devfn ( struct device dev)
static

Definition at line 305 of file southcluster.c.

References pci_path::devfn, FUNC_DIS, FUNC_DIS2, I2C1, I2C2, I2C3, I2C4, I2C5, I2C6, I2C7, mask, device::path, device_path::pci, PMC_BASE_ADDRESS, read32(), SD, SET_DIS_MASK, SET_DIS_MASK2, SMBUS, USH_SS_PHY_DIS, and write32().

Here is the call graph for this function:

◆ sc_enable_serial_irqs()

static void sc_enable_serial_irqs ( struct device dev)
static

Definition at line 74 of file southcluster.c.

References BIOS_SPEW, IBASE, ILB_OIC, pci_read_config32(), printk, read32(), read8(), SCNT, SCNT_MODE, SIRQEN, write32(), and write8().

Referenced by sc_init().

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

◆ sc_init()

◆ sc_read_resources()

static void sc_read_resources ( struct device dev)
static

Definition at line 229 of file southcluster.c.

References pci_dev_read_resources(), sc_add_io_resources(), and sc_add_mmio_resources().

Here is the call graph for this function:

◆ sc_set_serial_irqs_mode()

static void sc_set_serial_irqs_mode ( struct device dev,
enum serirq_mode  mode 
)
static

Definition at line 29 of file southcluster.c.

References IBASE, ILB_OIC, pci_read_config32(), read32(), read8(), SCNT, SCNT_MODE, SERIRQ_CONTINUOUS, SERIRQ_OFF, SERIRQ_QUIET, SIRQEN, write32(), and write8().

Referenced by sc_init().

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

◆ set_d3hot_bits()

static void set_d3hot_bits ( struct device dev,
int  offset 
)
inlinestatic

Definition at line 392 of file southcluster.c.

References BIOS_DEBUG, offset, pci_read_config8(), pci_write_config8(), and printk.

Referenced by place_device_in_d3hot().

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

◆ southcluster_enable_dev()

void southcluster_enable_dev ( struct device dev)

Definition at line 500 of file southcluster.c.

◆ write_pci_config_irqs()

Variable Documentation

◆ __pci_driver

const struct pci_driver southcluster __pci_driver
static
Initial value:
= {
.ops = &device_ops,
.vendor = PCI_VID_INTEL,
.device = LPC_DEVID,
}
static struct device_operations device_ops
Definition: southcluster.c:530
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
#define LPC_DEVID
Definition: pci_devs.h:141

Definition at line 500 of file southcluster.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = sc_read_resources,
.set_resources = pci_dev_set_resources,
.write_acpi_tables = southcluster_write_acpi_tables,
.init = sc_init,
.scan_bus = scan_static_bus,
.ops_pci = &soc_pci_ops,
}
void southcluster_enable_dev(struct device *dev)
Definition: southcluster.c:452
static void sc_read_resources(struct device *dev)
Definition: southcluster.c:229
static void sc_init(struct device *dev)
Definition: southcluster.c:241
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
void scan_static_bus(struct device *bus)
Definition: root_device.c:89
struct pci_operations soc_pci_ops
Definition: chip.c:51
unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp)
Definition: acpi.c:342

Definition at line 500 of file southcluster.c.