blob: 11c19b7eedb252773e9521b8547c136bc9f84350 [file] [log] [blame]
wdenk4a551702003-10-08 23:26:14 +00001/*
2 * (C) Copyright 2003, Psyent Corporation <www.psyent.com>
3 * Scott McNutt <smcnutt@psyent.com>
4 *
Wolfgang Denkd06a5f72005-08-06 01:56:59 +02005 * CompactFlash/IDE:
6 * (C) Copyright 2004, Shlomo Kut <skut@vyyo.com>
7 *
wdenk4a551702003-10-08 23:26:14 +00008 * See file CREDITS for list of people who contributed to this
9 * project.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 * MA 02111-1307 USA
25 */
26
27#include <common.h>
Wolfgang Denkd06a5f72005-08-06 01:56:59 +020028#include <nios-io.h>
wdenkc935d3b2004-01-03 19:43:48 +000029#if defined(CONFIG_SEVENSEG)
30#include "../common/sevenseg.h"
31#endif
wdenk4a551702003-10-08 23:26:14 +000032
33void _default_hdlr (void)
34{
35 printf ("default_hdlr\n");
36}
37
wdenkc837dcb2004-01-20 23:12:12 +000038int board_early_init_f (void)
wdenk4a551702003-10-08 23:26:14 +000039{
wdenkec4c5442004-02-09 23:12:24 +000040#if defined(CONFIG_SEVENSEG)
wdenkc935d3b2004-01-03 19:43:48 +000041 /* init seven segment led display and switch off */
42 sevenseg_set(SEVENSEG_OFF);
wdenkec4c5442004-02-09 23:12:24 +000043#endif
wdenk4a551702003-10-08 23:26:14 +000044 return 0;
45}
46
47int checkboard (void)
48{
49 puts ("Board: Altera Nios 1C20 Development Kit\n");
50 return 0;
51}
52
Becky Bruce9973e3c2008-06-09 16:03:40 -050053phys_size_t initdram (int board_type)
wdenk4a551702003-10-08 23:26:14 +000054{
55 return (0);
56}
Wolfgang Denkd06a5f72005-08-06 01:56:59 +020057
Jon Loeligerfcec2eb2007-07-09 18:19:09 -050058#if defined(CONFIG_CMD_IDE)
Wolfgang Denkd06a5f72005-08-06 01:56:59 +020059int ide_preinit (void)
60{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020061 nios_pio_t *present = (nios_pio_t *) CONFIG_SYS_CF_PRESENT;
62 nios_pio_t *power = (nios_pio_t *) CONFIG_SYS_CF_POWER;
63 nios_pio_t *atasel = (nios_pio_t *) CONFIG_SYS_CF_ATASEL;
Wolfgang Denkd06a5f72005-08-06 01:56:59 +020064
65 /* setup data direction registers */
66 present->direction = NIOS_PIO_IN;
67 power->direction = NIOS_PIO_OUT;
68 atasel->direction = NIOS_PIO_OUT;
69
70 /* Check for presence of card */
71 if (present->data)
72 return 1;
73 printf ("Ok\n");
74
75 /* Finish setup */
76 power->data = 1; /* Turn on power FET */
77 atasel->data = 0; /* Put in ATA mode */
78
79 return 0;
80}
Jon Loeligerfcec2eb2007-07-09 18:19:09 -050081#endif