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

Go to the source code of this file.

Functions

static void set_irq_trigger_type (struct device *dev, bool trig_level)
 
static void route_pins_to_uart (struct device *dev, bool to_uart)
 
static void reset_gpio_default_in (struct device *dev)
 
static void reset_gpio_default_od (struct device *dev)
 
static void disable_gpio_io_port (struct device *dev)
 
static void nct5104d_init (struct device *dev)
 
static void enable_dev (struct device *dev)
 

Variables

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

Function Documentation

◆ disable_gpio_io_port()

static void disable_gpio_io_port ( struct device dev)
static

Definition at line 141 of file superio.c.

References BIOS_WARNING, dev_find_slot_pnp(), device::enabled, NCT5104D_GPIO0, NCT5104D_GPIO1, NCT5104D_GPIO6, device::path, device_path::pnp, pnp_path::port, and printk.

Referenced by nct5104d_init().

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

◆ enable_dev()

static void enable_dev ( struct device dev)
static

Definition at line 229 of file superio.c.

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

Here is the call graph for this function:

◆ nct5104d_init()

◆ reset_gpio_default_in()

static void reset_gpio_default_in ( struct device dev)
static

Definition at line 97 of file superio.c.

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

Referenced by nct5104d_init().

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

◆ reset_gpio_default_od()

static void reset_gpio_default_od ( struct device dev)
static

Definition at line 110 of file superio.c.

References dev_find_slot_pnp(), pnp_path::device, device::enabled, NCT5104D_GPIO0, NCT5104D_GPIO0_PP_OD, NCT5104D_GPIO1, NCT5104D_GPIO6, device::path, device_path::pnp, pnp_set_logical_device(), pnp_write_config(), and pnp_path::port.

Referenced by nct5104d_init().

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

◆ route_pins_to_uart()

static void route_pins_to_uart ( struct device dev,
bool  to_uart 
)
static

Definition at line 67 of file superio.c.

References pnp_path::device, NCT5104D_GPIO0, NCT5104D_GPIO1, NCT5104D_SP3, NCT5104D_SP4, device::path, device_path::pnp, pnp_read_config(), and pnp_write_config().

Referenced by nct5104d_init().

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

◆ set_irq_trigger_type()

static void set_irq_trigger_type ( struct device dev,
bool  trig_level 
)
static

Definition at line 11 of file superio.c.

References CR26_LOCK_REG, pnp_path::device, GLOBAL_OPTION_CR26, IRQ_TYPE_SEL_CR10, IRQ_TYPE_SEL_CR11, NCT5104D_SP1, NCT5104D_SP2, NCT5104D_SP3, NCT5104D_SP4, device::path, device_path::pnp, pnp_read_config(), and pnp_write_config().

Referenced by nct5104d_init().

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 = pnp_set_resources,
.enable_resources = pnp_enable_resources,
.enable = pnp_alt_enable,
.init = nct5104d_init,
.ops_pnp_mode = &pnp_conf_mode_8787_aa,
}
const struct pnp_mode_ops pnp_conf_mode_8787_aa
Definition: conf_mode.c:202
static void nct5104d_init(struct device *dev)
Definition: superio.c:164
void pnp_read_resources(struct device *dev)
Definition: pnp_device.c:114
void pnp_set_resources(struct device *dev)
Definition: pnp_device.c:157
void pnp_alt_enable(struct device *dev)
Definition: pnp_device.c:191
void pnp_enable_resources(struct device *dev)
Definition: pnp_device.c:173

Definition at line 164 of file superio.c.

Referenced by enable_dev().

◆ pnp_dev_info

struct pnp_info pnp_dev_info[]
static
Initial value:
= {
{ NULL, NCT5104D_FDC, PNP_IO0 | PNP_IRQ0, 0x07f8, },
{ NULL, NCT5104D_SP1, PNP_IO0 | PNP_IRQ0, 0x07f8, },
{ NULL, NCT5104D_SP2, PNP_IO0 | PNP_IRQ0, 0x07f8, },
{ NULL, NCT5104D_SP3, PNP_IO0 | PNP_IRQ0, 0x07f8, },
{ NULL, NCT5104D_SP4, PNP_IO0 | PNP_IRQ0, 0x07f8, },
{ NULL, NCT5104D_GPIO_IO, PNP_IO0, 0x07f8, },
}
#define NCT5104D_GPIO_WDT
Definition: nct5104d.h:44
#define NCT5104D_FDC
Definition: nct5104d.h:25
#define NCT5104D_SP1
Definition: nct5104d.h:26
#define NCT5104D_PORT80
Definition: nct5104d.h:31
#define NCT5104D_SP3
Definition: nct5104d.h:29
#define NCT5104D_GPIO_PP_OD
Definition: nct5104d.h:28
#define NCT5104D_GPIO0
Definition: nct5104d.h:40
#define NCT5104D_SP4
Definition: nct5104d.h:30
#define NCT5104D_GPIO_IO
Definition: nct5104d.h:45
#define NCT5104D_GPIO1
Definition: nct5104d.h:41
#define NCT5104D_SP2
Definition: nct5104d.h:27
#define NCT5104D_GPIO6
Definition: nct5104d.h:42
#define PNP_IO0
Definition: pnp.h:42
#define PNP_IRQ0
Definition: pnp.h:47
#define NULL
Definition: stddef.h:19

Definition at line 164 of file superio.c.

Referenced by enable_dev().

◆ superio_nuvoton_nct5104d_ops

struct chip_operations superio_nuvoton_nct5104d_ops
Initial value:
= {
.enable_dev = enable_dev,
}
static void enable_dev(struct device *dev)
Definition: superio.c:229

Definition at line 229 of file superio.c.