![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <device/mmio.h>
#include <console/console.h>
#include <soc/ti/am335x/gpio.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
static struct am335x_gpio_regs * | gpio_regs_and_bit (unsigned int gpio, uint32_t *bit) |
void | am335x_disable_gpio_irqs (void) |
int | gpio_direction_input (unsigned int gpio) |
Make a GPIO an input. More... | |
int | gpio_direction_output (unsigned int gpio, int value) |
Make a GPIO an output, and set its value. More... | |
int | gpio_get_value (unsigned int gpio) |
Get a GPIO's value. More... | |
int | gpio_set_value (unsigned int gpio, int value) |
Set an output GPIO's value. More... | |
Definition at line 21 of file gpio.c.
References am335x_gpio_banks, ARRAY_SIZE, am335x_gpio_regs::irqstatus_clr_0, and write32().
Referenced by bootblock_mainboard_early_init().
int gpio_direction_input | ( | unsigned int | gpio | ) |
Make a GPIO an input.
gpio | GPIO number |
Definition at line 29 of file gpio.c.
References gpio_regs_and_bit(), and setbits32.
int gpio_direction_output | ( | unsigned int | gpio, |
int | value | ||
) |
int gpio_get_value | ( | unsigned int | gpio | ) |
Get a GPIO's value.
This will work whether the GPIO is an input or an output.
gpio | GPIO number |
Definition at line 55 of file gpio.c.
References gpio_regs_and_bit(), and read32().
|
static |
Definition at line 8 of file gpio.c.
References am335x_gpio_banks, AM335X_GPIO_BITS_PER_BANK, ARRAY_SIZE, BIOS_ERR, NULL, and printk.
Referenced by gpio_direction_input(), gpio_direction_output(), gpio_get_value(), and gpio_set_value().
int gpio_set_value | ( | unsigned int | gpio, |
int | value | ||
) |
Set an output GPIO's value.
The GPIO must already be an output or this function may have no effect.
gpio | GPIO number |
value | GPIO value (0 for low or 1 for high) |
Definition at line 65 of file gpio.c.
References gpio_regs_and_bit(), value, and write32().