summaryrefslogtreecommitdiff
path: root/board/altera
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-06 01:56:59 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-06 01:56:59 +0200
commitd06a5f7ebfdc6c5d27dc0e6acf441c0916eee176 (patch)
tree5dc810aab913b8c7474df77528732f25e192e9e8 /board/altera
parentf901a83b70a586cef89682843e2d16d6c7b2288a (diff)
downloadu-boot-imx-d06a5f7ebfdc6c5d27dc0e6acf441c0916eee176.zip
u-boot-imx-d06a5f7ebfdc6c5d27dc0e6acf441c0916eee176.tar.gz
u-boot-imx-d06a5f7ebfdc6c5d27dc0e6acf441c0916eee176.tar.bz2
Add support for Altera NIOS DK1C20 board
Patch by Shlomo Kut, 13 Dec 2004
Diffstat (limited to 'board/altera')
-rw-r--r--board/altera/dk1c20/dk1c20.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/board/altera/dk1c20/dk1c20.c b/board/altera/dk1c20/dk1c20.c
index fd85706..98ee7a7 100644
--- a/board/altera/dk1c20/dk1c20.c
+++ b/board/altera/dk1c20/dk1c20.c
@@ -2,6 +2,9 @@
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
* Scott McNutt <smcnutt@psyent.com>
*
+ * CompactFlash/IDE:
+ * (C) Copyright 2004, Shlomo Kut <skut@vyyo.com>
+ *
* See file CREDITS for list of people who contributed to this
* project.
*
@@ -22,6 +25,7 @@
*/
#include <common.h>
+#include <nios-io.h>
#if defined(CONFIG_SEVENSEG)
#include "../common/sevenseg.h"
#endif
@@ -50,3 +54,28 @@ long int initdram (int board_type)
{
return (0);
}
+
+#if (CONFIG_COMMANDS & CFG_CMD_IDE)
+int ide_preinit (void)
+{
+ nios_pio_t *present = (nios_pio_t *) CFG_CF_PRESENT;
+ nios_pio_t *power = (nios_pio_t *) CFG_CF_POWER;
+ nios_pio_t *atasel = (nios_pio_t *) CFG_CF_ATASEL;
+
+ /* setup data direction registers */
+ present->direction = NIOS_PIO_IN;
+ power->direction = NIOS_PIO_OUT;
+ atasel->direction = NIOS_PIO_OUT;
+
+ /* Check for presence of card */
+ if (present->data)
+ return 1;
+ printf ("Ok\n");
+
+ /* Finish setup */
+ power->data = 1; /* Turn on power FET */
+ atasel->data = 0; /* Put in ATA mode */
+
+ return 0;
+}
+#endif /* CONFIG_COMMANDS & CFG_CMD_IDE */