]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/altera/nios2-generic/nios2-generic.c
gpio: Add driver for Altera's PIO core
[karo-tx-uboot.git] / board / altera / nios2-generic / nios2-generic.c
index 49ef80de96dd36b494b960f8aa7c42908d10c979..0f882756f5ef23b6d23b494e2361f9e5a8da0577 100644 (file)
@@ -26,6 +26,7 @@
 #include <netdev.h>
 #include <mtd/cfi_flash.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 
 void text_base_hook(void); /* nop hook for text_base.S */
 
@@ -43,6 +44,13 @@ void early_flash_cmd_reset(void)
 int board_early_init_f(void)
 {
        text_base_hook();
+#ifdef CONFIG_ALTERA_PIO
+#ifdef LED_PIO_BASE
+       altera_pio_init(LED_PIO_BASE, LED_PIO_WIDTH, 'o',
+                       LED_PIO_RSTVAL, (1 << LED_PIO_WIDTH) - 1,
+                       "led");
+#endif
+#endif
 #if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
        early_flash_cmd_reset();
 #endif