[U-Boot] [PATCH 3/6 v3] nios2: add gpio support to nios2-generic board

Thomas Chou
2010-04-30T15:21:24Z

On 04/30/2010 10:24 PM, Scott McNutt wrote:
> Thomas Chou wrote:
>> This patch adds gpio support of Altera PIO component to the
>> nios2-generic board. Though it drives only gpio_led at the
>> moment, it supports bidirectional port to control bit-banging
>> I2C, NAND flash busy status or button switches, etc.
>>
>> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
>> ---
>> v3: split patches for gpio and spi, based gpio on altera pio core.
>> v2: remove mmc_spi_init()
>>
>> board/altera/nios2-generic/Makefile | 1 +
>> board/altera/nios2-generic/gpio.c | 55
>> +++++++++++++++++++++++++++++++++++
>> include/configs/nios2-generic.h | 6 ++--
>> 3 files changed, 59 insertions(+), 3 deletions(-)
>> create mode 100644 board/altera/nios2-generic/gpio.c
>>
>> diff --git a/board/altera/nios2-generic/Makefile
>> b/board/altera/nios2-generic/Makefile
>> index 6780872..d1fca70 100644
>> --- a/board/altera/nios2-generic/Makefile
>> +++ b/board/altera/nios2-generic/Makefile
>> @@ -32,6 +32,7 @@ LIB = $(obj)lib$(BOARD).a
>> COBJS-y := $(BOARD).o
>> COBJS-$(CONFIG_CMD_IDE) += ../common/cfide.o
>> COBJS-$(CONFIG_EPLED) += ../common/epled.o
>> +COBJS-$(CONFIG_GPIO) += gpio.o
>> COBJS-$(CONFIG_SEVENSEG) += ../common/sevenseg.o
>
> This will build a u-boot image that will not work with any
> of the standard configurations ... correct? ... since the
> GPIO component is custom (not supplied by the vendor)?
>
Hi Scott,

The board gpio.c driver works on Altera PIO component. It will behave
exactly the same as the epled driver. I have tested it on EP1C20 an
EP2C35 board with standard configuration. I believe it will work with
the standard configuration on EP1S10 and EP1S40. I don't want to break
anything.

It was actually the first gpio driver I wrote for nios2-linux before the
custom gpio core.

Best regards,
Thomas