coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pnp.h File Reference
#include <stdint.h>
#include <device/device.h>
#include <device/pnp_def.h>
#include <device/pnp_type.h>
#include <arch/io.h>
Include dependency graph for pnp.h:

Go to the source code of this file.

Data Structures

struct  pnp_info
 
struct  pnp_mode_ops
 

Macros

#define PNP_SKIP_FUNCTION   0xffff
 
#define PNP_IO0   0x0000001
 
#define PNP_IO1   0x0000002
 
#define PNP_IO2   0x0000004
 
#define PNP_IO3   0x0000008
 
#define PNP_IO4   0x0000010
 
#define PNP_IRQ0   0x0000020
 
#define PNP_IRQ1   0x0000040
 
#define PNP_DRQ0   0x0000080
 
#define PNP_DRQ1   0x0000100
 
#define PNP_EN   0x0000200
 
#define PNP_MSC0   0x0000400
 
#define PNP_MSC1   0x0000800
 
#define PNP_MSC2   0x0001000
 
#define PNP_MSC3   0x0002000
 
#define PNP_MSC4   0x0004000
 
#define PNP_MSC5   0x0008000
 
#define PNP_MSC6   0x0010000
 
#define PNP_MSC7   0x0020000
 
#define PNP_MSC8   0x0040000
 
#define PNP_MSC9   0x0080000
 
#define PNP_MSCA   0x0100000
 
#define PNP_MSCB   0x0200000
 
#define PNP_MSCC   0x0400000
 
#define PNP_MSCD   0x0800000
 
#define PNP_MSCE   0x1000000
 

Functions

void pnp_write_config (struct device *dev, u8 reg, u8 value)
 
u8 pnp_read_config (struct device *dev, u8 reg)
 
void pnp_unset_and_set_config (struct device *dev, u8 reg, u8 unset, u8 set)
 
void pnp_set_logical_device (struct device *dev)
 
void pnp_set_enable (struct device *dev, int enable)
 
int pnp_read_enable (struct device *dev)
 
void pnp_set_iobase (struct device *dev, u8 index, u16 iobase)
 
void pnp_set_irq (struct device *dev, u8 index, u8 irq)
 
void pnp_set_drq (struct device *dev, u8 index, u8 drq)
 
void pnp_read_resources (struct device *dev)
 
void pnp_set_resources (struct device *dev)
 
void pnp_enable_resources (struct device *dev)
 
void pnp_enable (struct device *dev)
 
void pnp_alt_enable (struct device *dev)
 
struct resourcepnp_get_resource (struct device *dev, unsigned int index)
 
void pnp_enable_devices (struct device *dev, struct device_operations *ops, unsigned int functions, struct pnp_info *info)
 
void pnp_enter_conf_mode (struct device *dev)
 
void pnp_exit_conf_mode (struct device *dev)
 
static u8 pnp_read_index (u16 port, u8 reg)
 
static void pnp_write_index (u16 port, u8 reg, u8 value)
 
static void pnp_unset_and_set_index (u16 port, u8 reg, u8 unset, u8 set)
 

Variables

struct device_operations pnp_ops
 

Macro Definition Documentation

◆ PNP_DRQ0

#define PNP_DRQ0   0x0000080

Definition at line 49 of file pnp.h.

◆ PNP_DRQ1

#define PNP_DRQ1   0x0000100

Definition at line 50 of file pnp.h.

◆ PNP_EN

#define PNP_EN   0x0000200

Definition at line 51 of file pnp.h.

◆ PNP_IO0

#define PNP_IO0   0x0000001

Definition at line 42 of file pnp.h.

◆ PNP_IO1

#define PNP_IO1   0x0000002

Definition at line 43 of file pnp.h.

◆ PNP_IO2

#define PNP_IO2   0x0000004

Definition at line 44 of file pnp.h.

◆ PNP_IO3

#define PNP_IO3   0x0000008

Definition at line 45 of file pnp.h.

◆ PNP_IO4

#define PNP_IO4   0x0000010

Definition at line 46 of file pnp.h.

◆ PNP_IRQ0

#define PNP_IRQ0   0x0000020

Definition at line 47 of file pnp.h.

◆ PNP_IRQ1

#define PNP_IRQ1   0x0000040

Definition at line 48 of file pnp.h.

◆ PNP_MSC0

#define PNP_MSC0   0x0000400

Definition at line 52 of file pnp.h.

◆ PNP_MSC1

#define PNP_MSC1   0x0000800

Definition at line 53 of file pnp.h.

◆ PNP_MSC2

#define PNP_MSC2   0x0001000

Definition at line 54 of file pnp.h.

◆ PNP_MSC3

#define PNP_MSC3   0x0002000

Definition at line 55 of file pnp.h.

◆ PNP_MSC4

#define PNP_MSC4   0x0004000

Definition at line 56 of file pnp.h.

◆ PNP_MSC5

#define PNP_MSC5   0x0008000

Definition at line 57 of file pnp.h.

◆ PNP_MSC6

#define PNP_MSC6   0x0010000

Definition at line 58 of file pnp.h.

◆ PNP_MSC7

#define PNP_MSC7   0x0020000

Definition at line 59 of file pnp.h.

◆ PNP_MSC8

#define PNP_MSC8   0x0040000

Definition at line 60 of file pnp.h.

◆ PNP_MSC9

#define PNP_MSC9   0x0080000

Definition at line 61 of file pnp.h.

◆ PNP_MSCA

#define PNP_MSCA   0x0100000

Definition at line 62 of file pnp.h.

◆ PNP_MSCB

#define PNP_MSCB   0x0200000

Definition at line 63 of file pnp.h.

◆ PNP_MSCC

#define PNP_MSCC   0x0400000

Definition at line 64 of file pnp.h.

◆ PNP_MSCD

#define PNP_MSCD   0x0800000

Definition at line 65 of file pnp.h.

◆ PNP_MSCE

#define PNP_MSCE   0x1000000

Definition at line 66 of file pnp.h.

◆ PNP_SKIP_FUNCTION

#define PNP_SKIP_FUNCTION   0xffff

Definition at line 39 of file pnp.h.

Function Documentation

◆ pnp_alt_enable()

void pnp_alt_enable ( struct device dev)

Definition at line 191 of file pnp_device.c.

References device::enabled, pnp_enter_conf_mode(), pnp_exit_conf_mode(), pnp_set_enable(), and pnp_set_logical_device().

Here is the call graph for this function:

◆ pnp_enable()

void pnp_enable ( struct device dev)

Definition at line 181 of file pnp_device.c.

References device::enabled, pnp_enter_conf_mode(), pnp_exit_conf_mode(), pnp_set_enable(), and pnp_set_logical_device().

Here is the call graph for this function:

◆ pnp_enable_devices()

void pnp_enable_devices ( struct device dev,
struct device_operations ops,
unsigned int  functions,
struct pnp_info info 
)

Definition at line 371 of file pnp_device.c.

References alloc_find_dev(), device::bus, pnp_path::device, DEVICE_PATH_PNP, get_resources(), info, ops, device::ops, device::path, device_path::pnp, PNP_SKIP_FUNCTION, pnp_path::port, and device_path::type.

Referenced by enable_dev().

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

◆ pnp_enable_resources()

void pnp_enable_resources ( struct device dev)

Definition at line 173 of file pnp_device.c.

References pnp_enter_conf_mode(), pnp_exit_conf_mode(), pnp_set_enable(), and pnp_set_logical_device().

Here is the call graph for this function:

◆ pnp_enter_conf_mode()

◆ pnp_exit_conf_mode()

◆ pnp_get_resource()

struct resource* pnp_get_resource ( struct device dev,
unsigned int  index 
)

◆ pnp_read_config()

◆ pnp_read_enable()

int pnp_read_enable ( struct device dev)

Definition at line 81 of file pnp_device.c.

References pnp_path::device, device::path, device_path::pnp, PNP_IDX_EN, and pnp_read_config().

Here is the call graph for this function:

◆ pnp_read_index()

static u8 pnp_read_index ( u16  port,
u8  reg 
)
inlinestatic

Definition at line 114 of file pnp.h.

References inb(), and outb().

Referenced by ec_get_chip_id(), and pnp_read_hwm5_index().

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

◆ pnp_read_resources()

void pnp_read_resources ( struct device dev)

Definition at line 114 of file pnp_device.c.

◆ pnp_set_drq()

void pnp_set_drq ( struct device dev,
u8  index,
u8  drq 
)

Definition at line 106 of file pnp_device.c.

References pnp_write_config().

Referenced by pilot_early_init(), and pnp_set_resource().

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

◆ pnp_set_enable()

◆ pnp_set_iobase()

◆ pnp_set_irq()

void pnp_set_irq ( struct device dev,
u8  index,
u8  irq 
)

Definition at line 100 of file pnp_device.c.

References pnp_write_config().

Referenced by bootblock_mainboard_early_init(), kbc1100_early_init(), kbc1126_com1_init(), kbc1126_kbc_init(), pilot_early_init(), pnp_set_resource(), and smscsuperio_enable_serial().

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

◆ pnp_set_logical_device()

void pnp_set_logical_device ( struct device dev)

Definition at line 59 of file pnp_device.c.

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

Referenced by aspeed_early_config(), aspeed_enable_serial(), ast2400_init(), bmc_init(), bootblock_mainboard_early_init(), early_superio_config(), f71869ad_hwm_init(), fintek_enable_serial(), gpio_init(), init_acpi(), ite_delay_pwrgd3(), ite_enable_3vsbsw(), ite_enable_serial(), ite_evc_conf(), ite_gpio_conf(), ite_sio_write(), kbc1100_early_init(), kbc1100_early_serial(), kbc1126_com1_init(), kbc1126_ec_init(), kbc1126_kbc_init(), kbc1126_mailbox_init(), kbc1126_pm1_init(), lpc47m10x_enable_serial(), lpc47m15x_enable_serial(), lpc_read(), lpc_write(), mainboard_config_superio(), mainboard_configure_super_io(), nct5572d_init(), nsc_enable_serial(), nuvoton_enable_serial(), pc87382_init(), pc87384_init(), pc87417_disable_dev(), pc87417_enable_dev(), pilot_disable_serial(), pilot_early_init(), pilot_enable_serial(), pnp_alt_enable(), pnp_enable(), pnp_enable_resources(), pnp_set_resources(), power_control_init(), reset_gpio_default_in(), reset_gpio_default_od(), sch5545_early_init(), sch5545_enable_uart(), sch5545_get_gpio(), sch5545_init(), sch5545_read_emi_bar(), sch5545_set_drq(), sch5545_set_iobase(), sch5545_set_irq(), set_uart_clock_source(), setup_sio_gpio(), smscsuperio_enable_serial(), w83627dhg_enable_i2c(), wilco_ec_serial_init(), winbond_enable_serial(), and xbus_cfg().

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

◆ pnp_set_resources()

void pnp_set_resources ( struct device dev)

Definition at line 157 of file pnp_device.c.

References resource::next, pnp_enter_conf_mode(), pnp_exit_conf_mode(), pnp_set_logical_device(), pnp_set_resource(), and device::resource_list.

Here is the call graph for this function:

◆ pnp_unset_and_set_config()

void pnp_unset_and_set_config ( struct device dev,
u8  reg,
u8  unset,
u8  set 
)

Definition at line 50 of file pnp_device.c.

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

Referenced by nuvoton_enable_serial(), and sch5545_init().

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

◆ pnp_unset_and_set_index()

static void pnp_unset_and_set_index ( u16  port,
u8  reg,
u8  unset,
u8  set 
)
inlinestatic

Definition at line 161 of file pnp.h.

References inb(), outb(), and value.

Referenced by pnp_unset_and_set_hwm5_index().

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

◆ pnp_write_config()

void pnp_write_config ( struct device dev,
u8  reg,
u8  value 
)

Definition at line 38 of file pnp_device.c.

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

Referenced by aspeed_early_config(), ast2400_init(), bmc_init(), bootblock_mainboard_early_init(), early_superio_config(), enable_dev(), enable_hwm_smbus(), f71808a_multifunc_init(), f71869ad_multifunc_init(), f81803a_pme_init(), f81866d_uart_init(), gpio_init(), init_acpi(), it8772f_ac_resume_southbridge(), it8772f_exit_conf(), it8772f_gpio_led(), it8772f_gpio_setup(), ite_delay_pwrgd3(), ite_enable_3vsbsw(), ite_evc_conf(), ite_gpio_conf(), ite_sio_write(), lpc47n217_pnp_set_drq(), lpc47n217_pnp_set_enable(), lpc47n217_pnp_set_iobase(), lpc47n217_pnp_set_irq(), lpc47n227_pnp_set_drq(), lpc47n227_pnp_set_enable(), lpc47n227_pnp_set_iobase(), lpc47n227_pnp_set_irq(), lpc_read(), lpc_write(), mainboard_config_superio(), mainboard_configure_super_io(), nct5572d_init(), pc87384_init(), pnp_set_drq(), pnp_set_enable(), pnp_set_iobase(), pnp_set_irq(), pnp_set_logical_device(), poll_clk_stable(), power_control_init(), reset_gpio_default_in(), reset_gpio_default_od(), route_pins_to_uart(), sch5545_early_init(), sch5545_enable_uart(), sch5545_init(), sch5545_set_drq(), sch5545_set_iobase(), sch5545_set_irq(), set_irq(), set_irq_trigger_type(), set_uart_clock_source(), setup_sio_gpio(), sio1036_enable_serial(), superio_init(), w83627dhg_enable_i2c(), w83627dhg_enable_UR2(), w83627dhg_set_clksel_48(), wilco_ec_serial_init(), winbond_set_clksel_48(), winbond_set_pinmux(), and xbus_cfg().

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

◆ pnp_write_index()

static void pnp_write_index ( u16  port,
u8  reg,
u8  value 
)
inlinestatic

Definition at line 132 of file pnp.h.

References outb(), and value.

Referenced by f71808a_hwm_init(), f71869ad_hwm_init(), f81866d_hwm_init(), and pnp_write_hwm5_index().

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

Variable Documentation

◆ pnp_ops

struct device_operations pnp_ops
extern

Definition at line 191 of file pnp_device.c.