From d06a5f7ebfdc6c5d27dc0e6acf441c0916eee176 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sat, 6 Aug 2005 01:56:59 +0200 Subject: Add support for Altera NIOS DK1C20 board Patch by Shlomo Kut, 13 Dec 2004 --- board/altera/dk1c20/dk1c20.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'board') 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 * Scott McNutt * + * CompactFlash/IDE: + * (C) Copyright 2004, Shlomo Kut + * * See file CREDITS for list of people who contributed to this * project. * @@ -22,6 +25,7 @@ */ #include +#include #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 */ -- cgit v1.1