diff options
author | Joachim Foerster <joachim.foerster@missinglinkelectronics.com> | 2011-10-21 13:48:50 (GMT) |
---|---|---|
committer | Thomas Chou <thomas@wytron.com.tw> | 2011-10-28 01:50:49 (GMT) |
commit | 03d67e127685f65513e7b78dacbd4ccaf01053f6 (patch) | |
tree | 689e13ece8dd47b9c03354ac97fcd9d13127c756 /arch/nios2/include | |
parent | f956ad98b2ba10901b6ea04983e679bc5ddc4d7a (diff) | |
download | u-boot-03d67e127685f65513e7b78dacbd4ccaf01053f6.tar.xz |
gpio: Add driver for Altera's PIO core
This driver may handle multiple PIO cores and thus needs to be
setup by calling the altera_pio_init() function within the early
board setup routine.
The driver comes with some extras, see below the copyleft header.
Signed-off-by: Joachim Foerster <joachim.foerster@missinglinkelectronics.com>
Tested-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Diffstat (limited to 'arch/nios2/include')
-rw-r--r-- | arch/nios2/include/asm/gpio.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/nios2/include/asm/gpio.h b/arch/nios2/include/asm/gpio.h index 4b21c8f..908381f 100644 --- a/arch/nios2/include/asm/gpio.h +++ b/arch/nios2/include/asm/gpio.h @@ -5,8 +5,8 @@ * bit[0] data * bit[1] output enable * - * when CONFIG_SYS_GPIO_BASE is not defined, board may provide - * its own driver. + * When CONFIG_SYS_GPIO_BASE is not defined, the board may either + * provide its own driver or the altera_pio driver may be used. * * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw> * @@ -58,6 +58,15 @@ static inline int gpio_is_valid(int number) return ((unsigned)number) < CONFIG_SYS_GPIO_WIDTH; } #else +#ifdef CONFIG_ALTERA_PIO +extern int altera_pio_init(u32 base, u8 width, char iot, + u32 rstval, u32 negmask, + const char *label); + +extern void altera_pio_info(void); +#define gpio_status() altera_pio_info() +#endif + extern int gpio_request(unsigned gpio, const char *label); extern int gpio_free(unsigned gpio); extern int gpio_direction_input(unsigned gpio); |