Move conditional compilation of MPC8XXX SPI driver to Makefile
[platform/kernel/u-boot.git] / board / freescale / mpc8349emds / mpc8349emds.c
index 3fb2a45..9a312c3 100644 (file)
 #include <asm/mpc8349_pci.h>
 #include <i2c.h>
 #include <spi.h>
-#include <spd.h>
 #include <miiphy.h>
-#if defined(CONFIG_SPD_EEPROM)
 #include <spd_sdram.h>
-#endif
+
 #if defined(CONFIG_OF_LIBFDT)
 #include <libfdt.h>
 #endif
@@ -61,7 +59,7 @@ int board_early_init_f (void)
 
 #define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
 
-long int initdram (int board_type)
+phys_size_t initdram (int board_type)
 {
        volatile immap_t *im = (immap_t *)CFG_IMMR;
        u32 msize = 0;
@@ -255,29 +253,28 @@ void sdram_init(void)
 /*
  * The following are used to control the SPI chip selects for the SPI command.
  */
-#ifdef CONFIG_HARD_SPI
+#ifdef CONFIG_MPC8XXX_SPI
 
 #define SPI_CS_MASK    0x80000000
 
-void spi_eeprom_chipsel(int cs)
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+       return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
 {
        volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
 
-       if(cs)
-               iopd->dat &= ~SPI_CS_MASK;
-       else
-               iopd->dat |=  SPI_CS_MASK;
+       iopd->dat &= ~SPI_CS_MASK;
 }
 
-/*
- * The SPI command uses this table of functions for controlling the SPI
- * chip selects.
- */
-spi_chipsel_type spi_chipsel[] = {
-       spi_eeprom_chipsel,
-};
-int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]);
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+       volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
 
+       iopd->dat |=  SPI_CS_MASK;
+}
 #endif /* CONFIG_HARD_SPI */
 
 #if defined(CONFIG_OF_BOARD_SETUP)