wdenk | 4a55170 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2003, Psyent Corporation <www.psyent.com> |
| 3 | * Scott McNutt <smcnutt@psyent.com> |
| 4 | * |
Wolfgang Denk | d06a5f7 | 2005-08-06 01:56:59 +0200 | [diff] [blame] | 5 | * CompactFlash/IDE: |
| 6 | * (C) Copyright 2004, Shlomo Kut <skut@vyyo.com> |
| 7 | * |
wdenk | 4a55170 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 8 | * 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> |
Ben Warren | b1c0eaa | 2009-08-25 13:09:37 -0700 | [diff] [blame] | 28 | #include <netdev.h> |
Wolfgang Denk | d06a5f7 | 2005-08-06 01:56:59 +0200 | [diff] [blame] | 29 | #include <nios-io.h> |
wdenk | c935d3b | 2004-01-03 19:43:48 +0000 | [diff] [blame] | 30 | #if defined(CONFIG_SEVENSEG) |
| 31 | #include "../common/sevenseg.h" |
| 32 | #endif |
wdenk | 4a55170 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 33 | |
| 34 | void _default_hdlr (void) |
| 35 | { |
| 36 | printf ("default_hdlr\n"); |
| 37 | } |
| 38 | |
wdenk | c837dcb | 2004-01-20 23:12:12 +0000 | [diff] [blame] | 39 | int board_early_init_f (void) |
wdenk | 4a55170 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 40 | { |
wdenk | ec4c544 | 2004-02-09 23:12:24 +0000 | [diff] [blame] | 41 | #if defined(CONFIG_SEVENSEG) |
wdenk | c935d3b | 2004-01-03 19:43:48 +0000 | [diff] [blame] | 42 | /* init seven segment led display and switch off */ |
| 43 | sevenseg_set(SEVENSEG_OFF); |
wdenk | ec4c544 | 2004-02-09 23:12:24 +0000 | [diff] [blame] | 44 | #endif |
wdenk | 4a55170 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | int checkboard (void) |
| 49 | { |
| 50 | puts ("Board: Altera Nios 1C20 Development Kit\n"); |
| 51 | return 0; |
| 52 | } |
| 53 | |
Becky Bruce | 9973e3c | 2008-06-09 16:03:40 -0500 | [diff] [blame] | 54 | phys_size_t initdram (int board_type) |
wdenk | 4a55170 | 2003-10-08 23:26:14 +0000 | [diff] [blame] | 55 | { |
| 56 | return (0); |
| 57 | } |
Wolfgang Denk | d06a5f7 | 2005-08-06 01:56:59 +0200 | [diff] [blame] | 58 | |
Jon Loeliger | fcec2eb | 2007-07-09 18:19:09 -0500 | [diff] [blame] | 59 | #if defined(CONFIG_CMD_IDE) |
Wolfgang Denk | d06a5f7 | 2005-08-06 01:56:59 +0200 | [diff] [blame] | 60 | int ide_preinit (void) |
| 61 | { |
Jean-Christophe PLAGNIOL-VILLARD | 6d0f6bc | 2008-10-16 15:01:15 +0200 | [diff] [blame] | 62 | nios_pio_t *present = (nios_pio_t *) CONFIG_SYS_CF_PRESENT; |
| 63 | nios_pio_t *power = (nios_pio_t *) CONFIG_SYS_CF_POWER; |
| 64 | nios_pio_t *atasel = (nios_pio_t *) CONFIG_SYS_CF_ATASEL; |
Wolfgang Denk | d06a5f7 | 2005-08-06 01:56:59 +0200 | [diff] [blame] | 65 | |
| 66 | /* setup data direction registers */ |
| 67 | present->direction = NIOS_PIO_IN; |
| 68 | power->direction = NIOS_PIO_OUT; |
| 69 | atasel->direction = NIOS_PIO_OUT; |
| 70 | |
| 71 | /* Check for presence of card */ |
| 72 | if (present->data) |
| 73 | return 1; |
| 74 | printf ("Ok\n"); |
| 75 | |
| 76 | /* Finish setup */ |
| 77 | power->data = 1; /* Turn on power FET */ |
| 78 | atasel->data = 0; /* Put in ATA mode */ |
| 79 | |
| 80 | return 0; |
| 81 | } |
Jon Loeliger | fcec2eb | 2007-07-09 18:19:09 -0500 | [diff] [blame] | 82 | #endif |
Ben Warren | b1c0eaa | 2009-08-25 13:09:37 -0700 | [diff] [blame] | 83 | |
| 84 | #ifdef CONFIG_CMD_NET |
| 85 | int board_eth_init(bd_t *bis) |
| 86 | { |
| 87 | int rc = 0; |
| 88 | #ifdef CONFIG_CS8900 |
| 89 | rc = cs8900_initialize(0, CONFIG_CS8900_BASE); |
| 90 | #endif |
| 91 | return rc; |
| 92 | } |
| 93 | #endif |