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

Go to the source code of this file.

Macros

#define MAX_GPIO_NUMBER   75 /* zero based */
 
#define GPIO_BASE   0x48
 

Functions

static u16 get_gpio_base (void)
 
void setup_pch_gpios (const struct pch_gpio_map *gpio)
 
int get_gpio (int gpio_num)
 
unsigned int get_gpios (const int *gpio_num_array)
 
void set_gpio (int gpio_num, int value)
 
int gpio_is_native (int gpio_num)
 

Macro Definition Documentation

◆ GPIO_BASE

#define GPIO_BASE   0x48

Definition at line 14 of file gpio.c.

◆ MAX_GPIO_NUMBER

#define MAX_GPIO_NUMBER   75 /* zero based */

Definition at line 11 of file gpio.c.

Function Documentation

◆ get_gpio()

int get_gpio ( int  gpio_num)

Definition at line 88 of file gpio.c.

References get_gpio_base(), GP_LVL, GP_LVL2, GP_LVL3, inl(), and MAX_GPIO_NUMBER.

Referenced by get_gpios().

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

◆ get_gpio_base()

static u16 get_gpio_base ( void  )
static

Definition at line 16 of file gpio.c.

References GPIO_BASE, PCI_DEV, pci_read_config16(), and pcidev_on_root().

Referenced by get_gpio(), gpio_is_native(), set_gpio(), and setup_pch_gpios().

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

◆ get_gpios()

unsigned int get_gpios ( const int *  gpio_num_array)

Definition at line 107 of file gpio.c.

References get_gpio().

Referenced by dock_present(), locate_spd(), mainboard_get_spd(), and variant_get_spd_index().

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

◆ gpio_is_native()

int gpio_is_native ( int  gpio_num)

Definition at line 147 of file gpio.c.

References config, get_gpio_base(), GPIO_USE_SEL, GPIO_USE_SEL2, GPIO_USE_SEL3, inl(), and MAX_GPIO_NUMBER.

Referenced by pch_enable_mphy(), and pcie_enable_clock_gating().

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

◆ set_gpio()

void set_gpio ( int  gpio_num,
int  value 
)

Definition at line 125 of file gpio.c.

References config, get_gpio_base(), GP_LVL, GP_LVL2, GP_LVL3, inl(), MAX_GPIO_NUMBER, outl(), and value.

Referenced by dock_connect(), dock_disconnect(), early_hybrid_graphics(), mainboard_disable_gpios(), mainboard_post_raminit(), mainboard_smi_sleep(), and mb_post_raminit_setup().

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

◆ setup_pch_gpios()

void setup_pch_gpios ( const struct pch_gpio_map gpio)

Definition at line 33 of file gpio.c.

References get_gpio_base(), GP_IO_SEL, GP_IO_SEL2, GP_IO_SEL3, GP_LVL, GP_LVL2, GP_LVL3, GP_RST_SEL1, GP_RST_SEL2, GP_RST_SEL3, GPI_INV, GPIO_USE_SEL, GPIO_USE_SEL2, GPIO_USE_SEL3, GPO_BLINK, and outl().

Referenced by bootblock_mainboard_early_init(), early_gpio_init(), early_pch_init(), i82801jx_early_init(), and mainboard_romstage_entry().

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