adnpesc1.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
  3. * Stephan Linz <linz@li-pro.net>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #include <common.h>
  24. #include <netdev.h>
  25. #include <nios-io.h>
  26. #include <spi.h>
  27. #if defined(CONFIG_HW_WATCHDOG)
  28. extern void ssv_wd_pio_init(void); /* comes from ../common/wd_pio.c
  29. included by ./misc.c */
  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_HW_WATCHDOG)
  38. ssv_wd_pio_init();
  39. #endif
  40. return 0;
  41. }
  42. int checkboard (void)
  43. {
  44. puts ( "Board: SSV DilNetPC ADNP/ESC1"
  45. #if defined(CONFIG_DNPEVA2)
  46. " on DNP/EVA2"
  47. #endif
  48. "\n");
  49. #if defined(CONFIG_NIOS_BASE_32)
  50. puts ("Conf.: SSV Base 32 (nios_32)\n");
  51. #endif
  52. return 0;
  53. }
  54. phys_size_t initdram (int board_type)
  55. {
  56. return (0);
  57. }
  58. /*
  59. * The following are used to control the SPI chip selects for the SPI command.
  60. */
  61. #if defined(CONFIG_CMD_SPI) && CONFIG_NIOS_SPI
  62. #define SPI_RTC_CS_MASK 0x00000001
  63. int spi_cs_is_valid(unsigned int bus, unsigned int cs)
  64. {
  65. return bus == 0 && cs == 0;
  66. }
  67. void spi_cs_activate(struct spi_slave *slave)
  68. {
  69. nios_spi_t *spi = (nios_spi_t *)CONFIG_SYS_NIOS_SPIBASE;
  70. spi->slaveselect = SPI_RTC_CS_MASK; /* activate (1) */
  71. }
  72. void spi_cs_deactivate(struct spi_slave *slave)
  73. {
  74. nios_spi_t *spi = (nios_spi_t *)CONFIG_SYS_NIOS_SPIBASE;
  75. spi->slaveselect = 0; /* deactivate (0) */
  76. }
  77. #endif
  78. #if defined(CONFIG_POST)
  79. /*
  80. * Returns 1 if keys pressed to start the power-on long-running tests
  81. * Called from board_init_f().
  82. */
  83. int post_hotkeys_pressed(void)
  84. {
  85. return 0; /* No hotkeys supported */
  86. }
  87. #endif /* CONFIG_POST */
  88. #ifdef CONFIG_CMD_NET
  89. int board_eth_init(bd_t *bis)
  90. {
  91. int rc = 0;
  92. #ifdef CONFIG_CS8900
  93. rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
  94. #endif
  95. return rc;
  96. }
  97. #endif