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

Go to the source code of this file.

Functions

void gpio_configure (gpio_t gpio, uint32_t func, uint32_t pull, uint32_t drive_str, uint32_t enable)
 
void gpio_set (gpio_t gpio, int value)
 
int gpio_get (gpio_t gpio)
 
void gpio_input_pulldown (gpio_t gpio)
 
void gpio_input_pullup (gpio_t gpio)
 
void gpio_input (gpio_t gpio)
 
void gpio_output (gpio_t gpio, int value)
 
void gpio_input_irq (gpio_t gpio, enum gpio_irq_type type, uint32_t pull)
 
int gpio_irq_status (gpio_t gpio)
 

Function Documentation

◆ gpio_configure()

◆ gpio_get()

int gpio_get ( gpio_t  gpio)

Definition at line 33 of file gpio.c.

References GPIO_BMSK, GPIO_IO_IN_SHFT, and read32().

Here is the call graph for this function:

◆ gpio_input()

void gpio_input ( gpio_t  gpio)

Definition at line 52 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_FUNC_GPIO, GPIO_INPUT, and GPIO_NO_PULL.

Here is the call graph for this function:

◆ gpio_input_irq()

void gpio_input_irq ( gpio_t  gpio,
enum gpio_irq_type  type,
uint32_t  pull 
)

Definition at line 65 of file gpio.c.

References clrsetbits32, GPIO_2MA, gpio_configure(), GPIO_FUNC_GPIO, GPIO_INPUT, GPIO_INTR_DECT_CTL_MASK, GPIO_INTR_DECT_CTL_SHFT, GPIO_INTR_RAW_STATUS_EN_SHFT, GPIO_INTR_STATUS_ENABLE, pull, and type.

Referenced by configure_tpm(), and setup_chromeos_gpios().

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

◆ gpio_input_pulldown()

void gpio_input_pulldown ( gpio_t  gpio)

Definition at line 40 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_FUNC_GPIO, GPIO_INPUT, and GPIO_PULL_DOWN.

Here is the call graph for this function:

◆ gpio_input_pullup()

void gpio_input_pullup ( gpio_t  gpio)

Definition at line 46 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_FUNC_GPIO, GPIO_INPUT, and GPIO_PULL_UP.

Here is the call graph for this function:

◆ gpio_irq_status()

int gpio_irq_status ( gpio_t  gpio)

Definition at line 79 of file gpio.c.

References GPIO_INTR_STATUS_DISABLE, GPIO_INTR_STATUS_ENABLE, GPIO_INTR_STATUS_MASK, read32(), and write32().

Here is the call graph for this function:

◆ gpio_output()

void gpio_output ( gpio_t  gpio,
int  value 
)

Definition at line 58 of file gpio.c.

References GPIO_2MA, gpio_configure(), GPIO_FUNC_GPIO, GPIO_NO_PULL, GPIO_OUTPUT, gpio_set(), and value.

Here is the call graph for this function:

◆ gpio_set()

void gpio_set ( gpio_t  gpio,
int  value 
)

Definition at line 26 of file gpio.c.

References GPIO_IO_OUT_SHFT, value, and write32().

Here is the call graph for this function: