]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/altera/dk1c20/dk1c20.c
rename CFG_ macros to CONFIG_SYS
[karo-tx-uboot.git] / board / altera / dk1c20 / dk1c20.c
index 3954486791a42af9aa0585f5440b19f39fed2e7f..11c19b7eedb252773e9521b8547c136bc9f84350 100644 (file)
@@ -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
@@ -33,8 +37,10 @@ void _default_hdlr (void)
 
 int board_early_init_f (void)
 {
+#if    defined(CONFIG_SEVENSEG)
        /* init seven segment led display and switch off */
        sevenseg_set(SEVENSEG_OFF);
+#endif
        return 0;
 }
 
@@ -44,7 +50,32 @@ int checkboard (void)
        return 0;
 }
 
-long int initdram (int board_type)
+phys_size_t initdram (int board_type)
 {
        return (0);
 }
+
+#if defined(CONFIG_CMD_IDE)
+int ide_preinit (void)
+{
+       nios_pio_t *present = (nios_pio_t *) CONFIG_SYS_CF_PRESENT;
+       nios_pio_t *power = (nios_pio_t *) CONFIG_SYS_CF_POWER;
+       nios_pio_t *atasel = (nios_pio_t *) CONFIG_SYS_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