coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
dock.c File Reference
#include <console/console.h>
#include <arch/io.h>
#include <device/pnp_ops.h>
#include <device/device.h>
#include <device/pnp.h>
#include <delay.h>
#include "dock.h"
#include <superio/nsc/pc87382/pc87382.h>
#include <southbridge/intel/i82801ix/i82801ix.h>
#include <ec/lenovo/h8/h8.h>
#include <ec/acpi/ec.h>
#include <superio/nsc/pc87384/pc87384.h>
Include dependency graph for dock.c:

Go to the source code of this file.

Data Structures

struct  pin_config
 

Macros

#define __SIMPLE_DEVICE__
 

Functions

static int poll_clk_stable (pnp_devfn_t dev, int timeout)
 
static int gpio_init (pnp_devfn_t gpio, u16 gpio_base, const struct pin_config pincfg[], int num_cfgs)
 
static int pc87382_init (pnp_devfn_t dlpc, u16 dlpc_base)
 
static void pc87382_close (pnp_devfn_t dlpc)
 
int pc87382_early (void)
 
static int pc87382_connect (void)
 
static void pc87382_disconnect (void)
 
static u8 dock_identify (void)
 
static int pc87384_init (void)
 
void dock_connect (void)
 
void dock_disconnect (void)
 
void dock_info (void)
 

Variables

static const pnp_devfn_t l_dlpc = PNP_DEV(0x164e, PC87382_DOCK)
 
static const pnp_devfn_t l_gpio = PNP_DEV(0x164e, PC87382_GPIO)
 
static const struct pin_config local_gpio []
 
static const pnp_devfn_t r_gpio = PNP_DEV(SUPERIO_DEV, PC87384_GPIO)
 
static const pnp_devfn_t r_serial = PNP_DEV(SUPERIO_DEV, PC87384_SP1)
 
static const struct pin_config remote_gpio []
 

Macro Definition Documentation

◆ __SIMPLE_DEVICE__

#define __SIMPLE_DEVICE__

Definition at line 3 of file dock.c.

Function Documentation

◆ dock_connect()

◆ dock_disconnect()

void dock_disconnect ( void  )

Definition at line 234 of file dock.c.

References ec_write(), H8_LED_CONTROL, H8_LED_CONTROL_DOCK_LED1, H8_LED_CONTROL_DOCK_LED2, H8_LED_CONTROL_OFF, and pc87382_disconnect().

Referenced by mainboard_io_trap_handler(), and mainboard_smi_handle_ec_sci().

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

◆ dock_identify()

static u8 dock_identify ( void  )
static

Definition at line 145 of file dock.c.

References DLPC_GPDI0, DLPC_GPDI2, and inb().

Referenced by dock_connect(), and dock_info().

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

◆ dock_info()

void dock_info ( void  )

Definition at line 244 of file dock.c.

References BIOS_DEBUG, dock_identify(), DOCK_TYPE_NONE, and printk.

Referenced by bootblock_mainboard_init().

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

◆ gpio_init()

static int gpio_init ( pnp_devfn_t  gpio,
u16  gpio_base,
const struct pin_config  pincfg[],
int  num_cfgs 
)
static

Definition at line 34 of file dock.c.

References PNP_IDX_IO0, pnp_set_enable(), pnp_set_iobase(), pnp_set_logical_device(), and pnp_write_config().

Referenced by pc87382_early(), and pc87384_init().

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

◆ pc87382_close()

static void pc87382_close ( pnp_devfn_t  dlpc)
static

Definition at line 76 of file dock.c.

Referenced by pc87382_disconnect().

Here is the caller graph for this function:

◆ pc87382_connect()

static int pc87382_connect ( void  )
static

Definition at line 109 of file dock.c.

References D_LPCPD, D_PLTRST, DLPC_CONTROL, DLPC_GPDO0, inb(), l_dlpc, mdelay(), outb(), pc87382_init(), and udelay().

Referenced by dock_connect().

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

◆ pc87382_disconnect()

static void pc87382_disconnect ( void  )
static

Definition at line 134 of file dock.c.

References D_LPCPD, D_PLTRST, DLPC_GPDO0, inb(), l_dlpc, outb(), and pc87382_close().

Referenced by dock_connect(), and dock_disconnect().

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

◆ pc87382_early()

int pc87382_early ( void  )

Definition at line 94 of file dock.c.

References ARRAY_SIZE, DLPC_GPIO_BASE, gpio_init(), l_gpio, local_gpio, and poll_clk_stable().

Referenced by bootblock_mainboard_early_init().

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

◆ pc87382_init()

static int pc87382_init ( pnp_devfn_t  dlpc,
u16  dlpc_base 
)
static

Definition at line 55 of file dock.c.

References inb(), outb(), PNP_IDX_IO0, pnp_set_enable(), pnp_set_iobase(), pnp_set_logical_device(), and udelay().

Referenced by pc87382_connect().

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

◆ pc87384_init()

static int pc87384_init ( void  )
static

Definition at line 174 of file dock.c.

References ARRAY_SIZE, DOCK_GPIO_BASE, gpio_init(), outb(), PNP_IDX_IO0, pnp_set_enable(), pnp_set_iobase(), pnp_set_logical_device(), pnp_write_config(), poll_clk_stable(), r_gpio, r_serial, and remote_gpio.

Referenced by dock_connect().

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

◆ poll_clk_stable()

static int poll_clk_stable ( pnp_devfn_t  dev,
int  timeout 
)
static

Definition at line 22 of file dock.c.

References pnp_read_config(), pnp_write_config(), and udelay().

Referenced by pc87382_early(), and pc87384_init().

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

Variable Documentation

◆ l_dlpc

const pnp_devfn_t l_dlpc = PNP_DEV(0x164e, PC87382_DOCK)
static

Definition at line 52 of file dock.c.

Referenced by pc87382_connect(), and pc87382_disconnect().

◆ l_gpio

const pnp_devfn_t l_gpio = PNP_DEV(0x164e, PC87382_GPIO)
static

Definition at line 53 of file dock.c.

Referenced by pc87382_early().

◆ local_gpio

const struct pin_config local_gpio[]
static
Initial value:
= {
{0x00, 3}, {0x01, 3}, {0x02, 0}, {0x03, 3},
{0x04, 4}, {0x20, 4}, {0x21, 4}, {0x23, 4},
}

Definition at line 76 of file dock.c.

Referenced by pc87382_early().

◆ r_gpio

const pnp_devfn_t r_gpio = PNP_DEV(SUPERIO_DEV, PC87384_GPIO)
static

Definition at line 160 of file dock.c.

Referenced by pc87384_init().

◆ r_serial

const pnp_devfn_t r_serial = PNP_DEV(SUPERIO_DEV, PC87384_SP1)
static

Definition at line 161 of file dock.c.

Referenced by pc87384_init().

◆ remote_gpio

const struct pin_config remote_gpio[]
static