blob: 72810d036aea9a73e89c9b4e07f5d2a2efcd5677 [file] [log] [blame]
wdenkaaf224a2004-03-14 15:20:55 +00001/*
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
24#include <common.h>
Ben Warrenb1c0eaa2009-08-25 13:09:37 -070025#include <netdev.h>
wdenkaaf224a2004-03-14 15:20:55 +000026#include <nios-io.h>
27#include <spi.h>
28
29#if defined(CONFIG_HW_WATCHDOG)
30extern void ssv_wd_pio_init(void); /* comes from ../common/wd_pio.c
31 included by ./misc.c */
32#endif
33
34void _default_hdlr (void)
35{
36 printf ("default_hdlr\n");
37}
38
39int board_early_init_f (void)
40{
41#if defined(CONFIG_HW_WATCHDOG)
42 ssv_wd_pio_init();
43#endif
44 return 0;
45}
46
47int checkboard (void)
48{
49 puts ( "Board: SSV DilNetPC ADNP/ESC1"
50#if defined(CONFIG_DNPEVA2)
51 " on DNP/EVA2"
52#endif
53 "\n");
54#if defined(CONFIG_NIOS_BASE_32)
55 puts ("Conf.: SSV Base 32 (nios_32)\n");
56#endif
57
58 return 0;
59}
60
Becky Bruce9973e3c2008-06-09 16:03:40 -050061phys_size_t initdram (int board_type)
wdenkaaf224a2004-03-14 15:20:55 +000062{
63 return (0);
64}
65
66/*
67 * The following are used to control the SPI chip selects for the SPI command.
68 */
Jon Loeligerab3abcb2007-07-09 18:45:16 -050069#if defined(CONFIG_CMD_SPI) && CONFIG_NIOS_SPI
wdenkaaf224a2004-03-14 15:20:55 +000070
71#define SPI_RTC_CS_MASK 0x00000001
72
Haavard Skinnemoend255bb02008-05-16 11:10:31 +020073int spi_cs_is_valid(unsigned int bus, unsigned int cs)
74{
75 return bus == 0 && cs == 0;
76}
77
78void spi_cs_activate(struct spi_slave *slave)
wdenkaaf224a2004-03-14 15:20:55 +000079{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020080 nios_spi_t *spi = (nios_spi_t *)CONFIG_SYS_NIOS_SPIBASE;
wdenkaaf224a2004-03-14 15:20:55 +000081
Haavard Skinnemoend255bb02008-05-16 11:10:31 +020082 spi->slaveselect = SPI_RTC_CS_MASK; /* activate (1) */
wdenkaaf224a2004-03-14 15:20:55 +000083}
84
Haavard Skinnemoend255bb02008-05-16 11:10:31 +020085void spi_cs_deactivate(struct spi_slave *slave)
86{
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020087 nios_spi_t *spi = (nios_spi_t *)CONFIG_SYS_NIOS_SPIBASE;
Haavard Skinnemoend255bb02008-05-16 11:10:31 +020088
89 spi->slaveselect = 0; /* deactivate (0) */
90}
wdenkaaf224a2004-03-14 15:20:55 +000091
Jon Loeligerd39b5742007-07-10 10:48:22 -050092#endif
wdenkaaf224a2004-03-14 15:20:55 +000093
94#if defined(CONFIG_POST)
95/*
96 * Returns 1 if keys pressed to start the power-on long-running tests
97 * Called from board_init_f().
98 */
99int post_hotkeys_pressed(void)
100{
101 return 0; /* No hotkeys supported */
102}
103#endif /* CONFIG_POST */
Ben Warrenb1c0eaa2009-08-25 13:09:37 -0700104
105#ifdef CONFIG_CMD_NET
106int board_eth_init(bd_t *bis)
107{
108 int rc = 0;
109#ifdef CONFIG_CS8900
110 rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
111#endif
112 return rc;
113}
114#endif