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

Go to the source code of this file.

Data Structures

union  gpio_const
 
union  bit_cfg
 
struct  cavium_gpio
 

Functions

static const voidgpio_get_baseaddr (void)
 
gpio_t gpio_pin_count (void)
 
void gpio_input (gpio_t gpio)
 
void gpio_set (gpio_t gpio, int value)
 
void gpio_output (gpio_t gpio, int value)
 
void gpio_invert (gpio_t gpio, int value)
 
int gpio_get (gpio_t gpio)
 
int gpio_strap_value (gpio_t gpio)
 
void gpio_init (void)
 
void gpio_input_pulldown (gpio_t gpio)
 
void gpio_input_pullup (gpio_t gpio)
 

Function Documentation

◆ gpio_get()

int gpio_get ( gpio_t  gpio)

Definition at line 135 of file gpio.c.

References BIOS_SPEW, gpio_get_baseaddr(), gpio_pin_count(), printk, and read64().

Here is the call graph for this function:

◆ gpio_get_baseaddr()

static const void* gpio_get_baseaddr ( void  )
static

Definition at line 47 of file gpio.c.

References GPIO_PF_BAR0.

Referenced by gpio_get(), gpio_init(), gpio_input(), gpio_invert(), gpio_output(), gpio_pin_count(), gpio_set(), and gpio_strap_value().

Here is the caller graph for this function:

◆ gpio_init()

void gpio_init ( void  )

Definition at line 165 of file gpio.c.

References BIOS_DEBUG, gpio_get_baseaddr(), gpio_pin_count(), and printk.

Here is the call graph for this function:

◆ gpio_input()

void gpio_input ( gpio_t  gpio)

Definition at line 66 of file gpio.c.

References BIOS_SPEW, gpio_get_baseaddr(), gpio_pin_count(), bit_cfg::pin_sel, printk, read64(), bit_cfg::s, bit_cfg::tx_oe, bit_cfg::u, and write64().

Here is the call graph for this function:

◆ gpio_input_pulldown()

void gpio_input_pulldown ( gpio_t  gpio)

Definition at line 176 of file gpio.c.

◆ gpio_input_pullup()

void gpio_input_pullup ( gpio_t  gpio)

Definition at line 180 of file gpio.c.

◆ gpio_invert()

void gpio_invert ( gpio_t  gpio,
int  value 
)

Definition at line 119 of file gpio.c.

References BIOS_SPEW, gpio_get_baseaddr(), gpio_pin_count(), printk, read64(), bit_cfg::s, bit_cfg::u, value, write64(), and bit_cfg::xor.

Here is the call graph for this function:

◆ gpio_output()

void gpio_output ( gpio_t  gpio,
int  value 
)

Definition at line 99 of file gpio.c.

References BIOS_SPEW, gpio_get_baseaddr(), gpio_pin_count(), gpio_set(), bit_cfg::pin_sel, printk, read64(), bit_cfg::s, bit_cfg::tx_oe, bit_cfg::u, value, and write64().

Here is the call graph for this function:

◆ gpio_pin_count()

gpio_t gpio_pin_count ( void  )

Definition at line 53 of file gpio.c.

References gpio_get_baseaddr(), gpio_const::gpios, read64(), gpio_const::s, and gpio_const::u.

Referenced by gpio_get(), gpio_init(), gpio_input(), gpio_invert(), gpio_output(), gpio_set(), and gpio_strap_value().

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

◆ gpio_set()

void gpio_set ( gpio_t  gpio,
int  value 
)

Definition at line 83 of file gpio.c.

References BIOS_SPEW, gpio_get_baseaddr(), gpio_pin_count(), printk, value, and write64().

Here is the call graph for this function:

◆ gpio_strap_value()

int gpio_strap_value ( gpio_t  gpio)

Definition at line 150 of file gpio.c.

References BIOS_SPEW, gpio_get_baseaddr(), gpio_pin_count(), printk, and read64().

Referenced by mainboard_print_info().

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