coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
nc_fpga.c File Reference
#include <types.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#include <device/pci_def.h>
#include <device/mmio.h>
#include <hwilib.h>
#include <bootstate.h>
#include "nc_fpga.h"
Include dependency graph for nc_fpga.c:

Go to the source code of this file.

Macros

#define FPGA_SET_PARAM(src, dst)
 

Functions

static void init_temp_mon (void *base_adr)
 
static void init_fan_ctrl (void *base_adr)
 
static void nc_fpga_init (struct device *dev)
 This function is the driver entry point for the init phase of the PCI bus allocator. More...
 
static void nc_fpga_set_resources (struct device *dev)
 

Variables

static voidnc_fpga_bar0
 
static struct device_operations nc_fpga_ops
 
static const unsigned short nc_fpga_device_ids [] = { 0x4080, 0x4091, 0 }
 
static const struct pci_driver nc_fpga_driver __pci_driver
 

Macro Definition Documentation

◆ FPGA_SET_PARAM

#define FPGA_SET_PARAM (   src,
  dst 
)
Value:
{ \
uint32_t var; \
if (hwilib_get_field(src, (uint8_t *)&var, sizeof(var))) \
dst = ((typeof(dst))var); \
}
unsigned char uint8_t
Definition: stdint.h:8

Definition at line 16 of file nc_fpga.c.

Function Documentation

◆ init_fan_ctrl()

static void init_fan_ctrl ( void base_adr)
static

Definition at line 52 of file nc_fpga.c.

References FPGA_SET_PARAM, and mask.

Referenced by nc_fpga_init().

Here is the caller graph for this function:

◆ init_temp_mon()

static void init_temp_mon ( void base_adr)
static

Definition at line 23 of file nc_fpga.c.

References FPGA_SET_PARAM, and MAX_NUM_SENSORS.

Referenced by nc_fpga_init().

Here is the caller graph for this function:

◆ nc_fpga_init()

static void nc_fpga_init ( struct device dev)
static

This function is the driver entry point for the init phase of the PCI bus allocator.

It will initialize all the needed parts of NC_FPGA.

Parameters
*devPointer to the used PCI device
Returns
void Nothing is given back

Definition at line 87 of file nc_fpga.c.

References CB_SUCCESS, FPGA_SET_PARAM, init_fan_ctrl(), init_temp_mon(), NC_BL_BRIGHTNESS_OFFSET, NC_BL_PWM_OFFSET, NC_CAP1_BL_BRIGHTNESS_CTRL, NC_CAP1_DSAVE_NMI_DELAY, NC_CAP1_FAN_CTRL, NC_CAP1_OFFSET, NC_CAP1_TEMP_MON, NC_DSAVE_OFFSET, NC_FANMON_CTRL_OFFSET, nc_fpga_bar0, NC_FPGA_MAGIC, NC_MAGIC_OFFSET, NULL, PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_MEM_ATTR_MASK, PCI_COMMAND, PCI_COMMAND_MEMORY, pci_read_config32(), pci_read_config8(), and read32().

Here is the call graph for this function:

◆ nc_fpga_set_resources()

static void nc_fpga_set_resources ( struct device dev)
static

Definition at line 145 of file nc_fpga.c.

Variable Documentation

◆ __pci_driver

const struct pci_driver nc_fpga_driver __pci_driver
static
Initial value:
= {
.ops = &nc_fpga_ops,
.vendor = PCI_VID_SIEMENS,
.devices = nc_fpga_device_ids,
}
static const unsigned short nc_fpga_device_ids[]
Definition: nc_fpga.c:164
static struct device_operations nc_fpga_ops
Definition: nc_fpga.c:157
#define PCI_VID_SIEMENS
Definition: pci_ids.h:1491

Definition at line 164 of file nc_fpga.c.

◆ nc_fpga_bar0

void* nc_fpga_bar0
static

Definition at line 14 of file nc_fpga.c.

Referenced by nc_fpga_init().

◆ nc_fpga_device_ids

const unsigned short nc_fpga_device_ids[] = { 0x4080, 0x4091, 0 }
static

Definition at line 164 of file nc_fpga.c.

◆ nc_fpga_ops

struct device_operations nc_fpga_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = nc_fpga_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = nc_fpga_init,
}
static void nc_fpga_set_resources(struct device *dev)
Definition: nc_fpga.c:145
static void nc_fpga_init(struct device *dev)
This function is the driver entry point for the init phase of the PCI bus allocator.
Definition: nc_fpga.c:87
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534

Definition at line 145 of file nc_fpga.c.