From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Chou Date: Fri, 30 Apr 2010 23:21:24 +0800 Subject: [U-Boot] [PATCH 3/6 v3] nios2: add gpio support to nios2-generic board In-Reply-To: <4BDAE80E.3000601@psyent.com> References: <20100425181430.6CF214C04D@gemini.denx.de> <1272598458-17946-4-git-send-email-thomas@wytron.com.tw> <4BDAE80E.3000601@psyent.com> Message-ID: <4BDAF574.9030402@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >> --- >> 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