coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
southcluster.c File Reference
#include <stdint.h>
#include <arch/io.h>
#include <device/mmio.h>
#include <device/pci_ops.h>
#include <acpi/acpi.h>
#include <bootstate.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <pc80/mc146818rtc.h>
#include <drivers/uart/uart8250reg.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 "chip.h"
#include <acpi/acpigen.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
 

Functions

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 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 com1_configure_resume (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)
 
int __weak mainboard_get_spi_config (struct spi_config *cfg)
 
static void finalize_chipset (void *unused)
 
 BOOT_STATE_INIT_ENTRY (BS_OS_RESUME, BS_ON_ENTRY, finalize_chipset, NULL)
 
 BOOT_STATE_INIT_ENTRY (BS_PAYLOAD_LOAD, BS_ON_EXIT, finalize_chipset, NULL)
 

Variables

static struct device_operations device_ops
 
static const struct pci_driver southcluster __pci_driver
 

Macro Definition Documentation

◆ LPC_DEFAULT_IO_RANGE_LOWER

#define LPC_DEFAULT_IO_RANGE_LOWER   0

Definition at line 45 of file southcluster.c.

◆ LPC_DEFAULT_IO_RANGE_UPPER

#define LPC_DEFAULT_IO_RANGE_UPPER   0x1000

Definition at line 46 of file southcluster.c.

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 26 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() [1/2]

BOOT_STATE_INIT_ENTRY ( BS_OS_RESUME  ,
BS_ON_ENTRY  ,
finalize_chipset  ,
NULL   
)

◆ BOOT_STATE_INIT_ENTRY() [2/2]

BOOT_STATE_INIT_ENTRY ( BS_PAYLOAD_LOAD  ,
BS_ON_EXIT  ,
finalize_chipset  ,
NULL   
)

◆ com1_configure_resume()

static void com1_configure_resume ( struct device dev)
static

Definition at line 116 of file southcluster.c.

References outb(), pci_read_config32(), UART8250_DLL, UART8250_DLM, UART8250_FCR, UART8250_FCR_FIFO_EN, UART8250_IER, UART8250_LCR, UART8250_LCR_DLAB, UART8250_MCR, UART8250_MCR_DTR, UART8250_MCR_RTS, and UART_CONT.

Referenced by sc_init().

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

◆ finalize_chipset()

◆ hda_work_around()

static void hda_work_around ( struct device dev)
static

Definition at line 310 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 48 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:

◆ mainboard_get_spi_config()

int __weak mainboard_get_spi_config ( struct spi_config cfg)

Definition at line 498 of file southcluster.c.

Referenced by finalize_chipset().

Here is the caller graph for this function:

◆ place_device_in_d3hot()

◆ sc_add_io_resource()

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

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

◆ sc_init()

◆ sc_read_resources()

static void sc_read_resources ( struct device dev)
static

Definition at line 96 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:

◆ set_d3hot_bits()

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

Definition at line 297 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 452 of file southcluster.c.

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:482
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
#define LPC_DEVID
Definition: pci_devs.h:141

Definition at line 452 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 = acpi_write_hpet,
.init = sc_init,
.scan_bus = scan_static_bus,
.ops_pci = &soc_pci_ops,
}
unsigned long acpi_write_hpet(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp)
Definition: acpi.c:1141
static void sc_read_resources(struct device *dev)
Definition: southcluster.c:96
void southcluster_enable_dev(struct device *dev)
Definition: southcluster.c:452
static void sc_init(struct device *dev)
Definition: southcluster.c:144
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

Definition at line 452 of file southcluster.c.