dk1c20.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * (C) Copyright 2003, Psyent Corporation <www.psyent.com>
  3. * Scott McNutt <smcnutt@psyent.com>
  4. *
  5. * CompactFlash/IDE:
  6. * (C) Copyright 2004, Shlomo Kut <skut@vyyo.com>
  7. *
  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. #include <common.h>
  27. #include <nios-io.h>
  28. #if defined(CONFIG_SEVENSEG)
  29. #include "../common/sevenseg.h"
  30. #endif
  31. void _default_hdlr (void)
  32. {
  33. printf ("default_hdlr\n");
  34. }
  35. int board_early_init_f (void)
  36. {
  37. #if defined(CONFIG_SEVENSEG)
  38. /* init seven segment led display and switch off */
  39. sevenseg_set(SEVENSEG_OFF);
  40. #endif
  41. return 0;
  42. }
  43. int checkboard (void)
  44. {
  45. puts ("Board: Altera Nios 1C20 Development Kit\n");
  46. return 0;
  47. }
  48. phys_size_t initdram (int board_type)
  49. {
  50. return (0);
  51. }
  52. #if defined(CONFIG_CMD_IDE)
  53. int ide_preinit (void)
  54. {
  55. nios_pio_t *present = (nios_pio_t *) CONFIG_SYS_CF_PRESENT;
  56. nios_pio_t *power = (nios_pio_t *) CONFIG_SYS_CF_POWER;
  57. nios_pio_t *atasel = (nios_pio_t *) CONFIG_SYS_CF_ATASEL;
  58. /* setup data direction registers */
  59. present->direction = NIOS_PIO_IN;
  60. power->direction = NIOS_PIO_OUT;
  61. atasel->direction = NIOS_PIO_OUT;
  62. /* Check for presence of card */
  63. if (present->data)
  64. return 1;
  65. printf ("Ok\n");
  66. /* Finish setup */
  67. power->data = 1; /* Turn on power FET */
  68. atasel->data = 0; /* Put in ATA mode */
  69. return 0;
  70. }
  71. #endif