coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
superio.c File Reference
#include <arch/io.h>
#include <device/device.h>
#include <device/pnp.h>
#include <console/console.h>
#include <assert.h>
#include "lpc47n217.h"
Include dependency graph for superio.c:

Go to the source code of this file.

Functions

static void enable_dev (struct device *dev)
 Create device structures and allocate resources to devices specified in the pnp_dev_info array (above). More...
 
static void lpc47n217_pnp_set_resources (struct device *dev)
 Configure the specified Super I/O device with the resources (I/O space, etc.) that have been allocate for it. More...
 
static void lpc47n217_pnp_enable_resources (struct device *dev)
 
static void lpc47n217_pnp_enable (struct device *dev)
 
static void lpc47n217_init (struct device *dev)
 Initialize the specified Super I/O device. More...
 
static void lpc47n217_pnp_set_resource (struct device *dev, struct resource *resource)
 
static void lpc47n217_pnp_set_iobase (struct device *dev, u16 iobase)
 
static void lpc47n217_pnp_set_drq (struct device *dev, u8 drq)
 
static void lpc47n217_pnp_set_irq (struct device *dev, u8 irq)
 
static void lpc47n217_pnp_set_enable (struct device *dev, int enable)
 
static void pnp_enter_conf_state (struct device *dev)
 
static void pnp_exit_conf_state (struct device *dev)
 

Variables

struct chip_operations superio_smsc_lpc47n217_ops
 
static struct device_operations ops
 
static struct pnp_info pnp_dev_info []
 

Function Documentation

◆ enable_dev()

static void enable_dev ( struct device dev)
static

Create device structures and allocate resources to devices specified in the pnp_dev_info array (above).

Parameters
devPointer to structure describing a Super I/O device.

Definition at line 52 of file superio.c.

References ARRAY_SIZE, ops, pnp_dev_info, and pnp_enable_devices().

Here is the call graph for this function:

◆ lpc47n217_init()

static void lpc47n217_init ( struct device dev)
static

Initialize the specified Super I/O device.

Devices other than COM ports are ignored. For COM ports, we configure the baud rate.

Parameters
devPointer to structure describing a Super I/O device.

Definition at line 107 of file superio.c.

References device::enabled.

◆ lpc47n217_pnp_enable()

static void lpc47n217_pnp_enable ( struct device dev)
static

Definition at line 92 of file superio.c.

References device::enabled, lpc47n217_pnp_set_enable(), pnp_enter_conf_state(), and pnp_exit_conf_state().

Here is the call graph for this function:

◆ lpc47n217_pnp_enable_resources()

static void lpc47n217_pnp_enable_resources ( struct device dev)
static

Definition at line 81 of file superio.c.

References lpc47n217_pnp_set_enable(), pnp_enter_conf_state(), and pnp_exit_conf_state().

Here is the call graph for this function:

◆ lpc47n217_pnp_set_drq()

static void lpc47n217_pnp_set_drq ( struct device dev,
u8  drq 
)
static

Definition at line 163 of file superio.c.

References ASSERT, BUG, pnp_path::device, LPC47N217_PP, device::path, device_path::pnp, pnp_read_config(), and pnp_write_config().

Referenced by lpc47n217_pnp_set_resource().

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

◆ lpc47n217_pnp_set_enable()

static void lpc47n217_pnp_set_enable ( struct device dev,
int  enable 
)
static

Definition at line 211 of file superio.c.

References resource::base, BUG, pnp_path::device, find_resource(), lpc47n217_pnp_set_iobase(), LPC47N217_PP, LPC47N217_SP1, LPC47N217_SP2, device::path, device_path::pnp, PNP_IDX_IO0, pnp_read_config(), and pnp_write_config().

Referenced by lpc47n217_pnp_enable(), and lpc47n217_pnp_enable_resources().

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

◆ lpc47n217_pnp_set_iobase()

static void lpc47n217_pnp_set_iobase ( struct device dev,
u16  iobase 
)
static

Definition at line 143 of file superio.c.

References ASSERT, BUG, pnp_path::device, LPC47N217_PP, LPC47N217_SP1, LPC47N217_SP2, device::path, device_path::pnp, and pnp_write_config().

Referenced by lpc47n217_pnp_set_enable(), and lpc47n217_pnp_set_resource().

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

◆ lpc47n217_pnp_set_irq()

static void lpc47n217_pnp_set_irq ( struct device dev,
u8  irq 
)
static

Definition at line 180 of file superio.c.

References ASSERT, BUG, pnp_path::device, LPC47N217_PP, LPC47N217_SP1, LPC47N217_SP2, device::path, device_path::pnp, pnp_read_config(), and pnp_write_config().

Referenced by lpc47n217_pnp_set_resource().

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

◆ lpc47n217_pnp_set_resource()

static void lpc47n217_pnp_set_resource ( struct device dev,
struct resource resource 
)
static

◆ lpc47n217_pnp_set_resources()

static void lpc47n217_pnp_set_resources ( struct device dev)
static

Configure the specified Super I/O device with the resources (I/O space, etc.) that have been allocate for it.

NOTE: Cannot use pnp_set_resources() here because it assumes chip support for logical devices, which the LPC47N217 doesn't have.

Parameters
devPointer to structure describing a Super I/O device.

Definition at line 66 of file superio.c.

References lpc47n217_pnp_set_resource(), resource::next, pnp_enter_conf_state(), pnp_exit_conf_state(), and device::resource_list.

Here is the call graph for this function:

◆ pnp_enter_conf_state()

static void pnp_enter_conf_state ( struct device dev)
static

Definition at line 246 of file superio.c.

References outb(), device::path, device_path::pnp, and pnp_path::port.

Referenced by lpc47n217_pnp_enable(), lpc47n217_pnp_enable_resources(), and lpc47n217_pnp_set_resources().

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

◆ pnp_exit_conf_state()

static void pnp_exit_conf_state ( struct device dev)
static

Definition at line 251 of file superio.c.

References outb(), device::path, device_path::pnp, and pnp_path::port.

Referenced by lpc47n217_pnp_enable(), lpc47n217_pnp_enable_resources(), and lpc47n217_pnp_set_resources().

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

Variable Documentation

◆ ops

struct device_operations ops
static
Initial value:
= {
.read_resources = pnp_read_resources,
.set_resources = lpc47n217_pnp_set_resources,
.enable_resources = lpc47n217_pnp_enable_resources,
.init = lpc47n217_init,
}
void pnp_read_resources(struct device *dev)
Definition: pnp_device.c:114
static void lpc47n217_pnp_enable(struct device *dev)
Definition: superio.c:92
static void lpc47n217_pnp_set_resources(struct device *dev)
Configure the specified Super I/O device with the resources (I/O space, etc.) that have been allocate...
Definition: superio.c:66
static void lpc47n217_init(struct device *dev)
Initialize the specified Super I/O device.
Definition: superio.c:107
static void lpc47n217_pnp_enable_resources(struct device *dev)
Definition: superio.c:81

Definition at line 25 of file superio.c.

Referenced by enable_dev().

◆ pnp_dev_info

struct pnp_info pnp_dev_info[]
static
Initial value:
= {
{ NULL, LPC47N217_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
}
#define LPC47N217_PP
Definition: lpc47n217.h:13
#define LPC47N217_SP2
Definition: lpc47n217.h:15
#define LPC47N217_SP1
Definition: lpc47n217.h:14
#define PNP_DRQ0
Definition: pnp.h:49
#define PNP_IO0
Definition: pnp.h:42
#define PNP_IRQ0
Definition: pnp.h:47
#define NULL
Definition: stddef.h:19

Definition at line 25 of file superio.c.

Referenced by enable_dev().

◆ superio_smsc_lpc47n217_ops

struct chip_operations superio_smsc_lpc47n217_ops
Initial value:
= {
.enable_dev = enable_dev,
}
static void enable_dev(struct device *dev)
Create device structures and allocate resources to devices specified in the pnp_dev_info array (above...
Definition: superio.c:52

Definition at line 25 of file superio.c.