]> git.sur5r.net Git - u-boot/blobdiff - board/ssv/adnpesc1/adnpesc1.c
Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API
[u-boot] / board / ssv / adnpesc1 / adnpesc1.c
index 2ec3a728d74ea5cb0a5ce9c43e60ecf57d48bd53..72810d036aea9a73e89c9b4e07f5d2a2efcd5677 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <common.h>
+#include <netdev.h>
 #include <nios-io.h>
 #include <spi.h>
 
@@ -57,7 +58,7 @@ int checkboard (void)
        return 0;
 }
 
-long int initdram (int board_type)
+phys_size_t initdram (int board_type)
 {
        return (0);
 }
@@ -69,25 +70,24 @@ long int initdram (int board_type)
 
 #define        SPI_RTC_CS_MASK 0x00000001
 
-void spi_rtc_chipsel(int cs)
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {
-       nios_spi_t *spi = (nios_spi_t *)CFG_NIOS_SPIBASE;
+       return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+       nios_spi_t *spi = (nios_spi_t *)CONFIG_SYS_NIOS_SPIBASE;
 
-       if (cs)
-               spi->slaveselect = SPI_RTC_CS_MASK;     /* activate (1) */
-       else
-               spi->slaveselect = 0;                   /* deactivate (0) */
+       spi->slaveselect = SPI_RTC_CS_MASK;     /* activate (1) */
 }
 
-/*
- * The SPI command uses this table of functions for controlling the SPI
- * chip selects: it calls the appropriate function to control the SPI
- * chip selects.
- */
-spi_chipsel_type spi_chipsel[] = {
-       spi_rtc_chipsel
-};
-int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]);
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+       nios_spi_t *spi = (nios_spi_t *)CONFIG_SYS_NIOS_SPIBASE;
+
+       spi->slaveselect = 0;                   /* deactivate (0) */
+}
 
 #endif
 
@@ -101,3 +101,14 @@ int post_hotkeys_pressed(void)
        return 0;       /* No hotkeys supported */
 }
 #endif /* CONFIG_POST */
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+       int rc = 0;
+#ifdef CONFIG_CS8900
+       rc = cs8900_initialize(0, CONFIG_CS8900_BASE);
+#endif
+       return rc;
+}
+#endif