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

Go to the source code of this file.

Functions

static void pnp_enter_conf_state (pnp_devfn_t dev)
 
static void pnp_exit_conf_state (pnp_devfn_t dev)
 
static void lpc47n217_pnp_set_iobase (pnp_devfn_t dev, u16 iobase)
 Program the base I/O port for the specified logical device. More...
 
static void lpc47n217_pnp_set_enable (pnp_devfn_t dev, int enable)
 Enable or disable the specified logical device. More...
 
void lpc47n217_enable_serial (pnp_devfn_t dev, u16 iobase)
 Configure the base I/O port of the specified serial device and enable the serial device. More...
 

Function Documentation

◆ lpc47n217_enable_serial()

void lpc47n217_enable_serial ( pnp_devfn_t  dev,
u16  iobase 
)

Configure the base I/O port of the specified serial device and enable the serial device.

Parameters
devHigh 8 bits = Super I/O port, low 8 bits = logical device number.
iobaseProcessor I/O port address to assign to this serial device.

Definition at line 95 of file early_serial.c.

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

Referenced by bootblock_mainboard_early_init().

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 ( pnp_devfn_t  dev,
int  enable 
)
static

Enable or disable the specified logical device.

Technically, a full disable requires setting the device's base I/O port below 0x100. We don't do that here, because we don't have access to a data structure that specifies what the 'real' base port is (when asked to enable the device). Also the function is used only to disable the device while its true base port is programmed (see lpc47n217_enable_serial() below).

Parameters
devHigh 8 bits = Super I/O port, low 8 bits = logical device number.
enable0 to disable, anything else to enable.

Definition at line 60 of file early_serial.c.

References LPC47N217_PP, LPC47N217_SP1, LPC47N217_SP2, pnp_read_config(), and pnp_write_config().

Referenced by lpc47n217_enable_serial().

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 ( pnp_devfn_t  dev,
u16  iobase 
)
static

Program the base I/O port for the specified logical device.

Parameters
devHigh 8 bits = Super I/O port, low 8 bits = logical device number.
iobaseBase I/O port for the logical device.

Definition at line 28 of file early_serial.c.

References ASSERT, LPC47N217_PP, LPC47N217_SP1, LPC47N217_SP2, and pnp_write_config().

Referenced by lpc47n217_enable_serial().

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

◆ pnp_enter_conf_state()

static void pnp_enter_conf_state ( pnp_devfn_t  dev)
static

Definition at line 10 of file early_serial.c.

References outb().

Here is the call graph for this function:

◆ pnp_exit_conf_state()

static void pnp_exit_conf_state ( pnp_devfn_t  dev)
static

Definition at line 16 of file early_serial.c.

References outb().

Here is the call graph for this function: