]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/cirrus/edb93xx/edb93xx.c
Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[people/ms/u-boot.git] / board / cirrus / edb93xx / edb93xx.c
index 8963d3a5828dc4a315e2f469b572b779a7b0436e..720b490f2b7ba9e114e8f7a7b0a7d9cc3d0b7b09 100644 (file)
@@ -216,9 +216,11 @@ static unsigned dram_init_banksize_int(int print)
        return dram_total;
 }
 
-void dram_init_banksize(void)
+int dram_init_banksize(void)
 {
        dram_init_banksize_int(0);
+
+       return 0;
 }
 
 /* called in board_init_f (before relocation) */
@@ -282,101 +284,3 @@ int dram_init(void)
        gd->ram_size = dram_init_banksize_int(1);
        return 0;
 }
-
-
-#ifdef CONFIG_EP93XX_SPI
-#include <spi.h>
-
-/*
- * EGIO0-EGIPO7 -> port A
- * EGIO8-EGIP15 -> port B
- */
-
-static void ep93xx_set_epgio(unsigned num)
-{
-       struct gpio_regs *regs = (struct gpio_regs *)GPIO_BASE;
-       if (num < 8)
-               writel(readl(&regs->padr) | (1<<num), &regs->padr);
-       else
-               writel(readl(&regs->pbdr) | (1<<(num-8)), &regs->pbdr);
-}
-
-static void ep93xx_clear_epgio(unsigned num)
-{
-       struct gpio_regs *regs = (struct gpio_regs *)GPIO_BASE;
-       if (num < 8)
-               writel(readl(&regs->padr) & (~(1<<num)), &regs->padr);
-       else
-               writel(readl(&regs->pbdr) & (~(1<<(num-8))), &regs->pbdr);
-}
-
-static void ep93xx_dir_epgio_out(unsigned num)
-{
-       struct gpio_regs *regs = (struct gpio_regs *)GPIO_BASE;
-       if (num < 8)
-               writel(readl(&regs->paddr) | (1<<num), &regs->paddr);
-       else
-               writel(readl(&regs->pbddr) | (1<<(num-8)), &regs->pbddr);
-}
-
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
-       if (bus == 0 && cs < 16)
-               return 1;
-
-       return 0;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
-       ep93xx_clear_epgio(slave->cs);
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
-       ep93xx_set_epgio(slave->cs);
-}
-
-#ifdef CONFIG_MMC_SPI
-#include <mmc.h>
-
-#ifndef CONFIG_MMC_SPI_CS_EPGIO
-# define CONFIG_MMC_SPI_CS_EPGIO       4
-#endif
-
-#ifndef CONFIG_MMC_SPI_SPEED
-# define CONFIG_MMC_SPI_SPEED          25000000
-#endif
-
-#ifndef CONFIG_MMC_SPI_MODE
-# define CONFIG_MMC_SPI_MODE           SPI_MODE_0
-#endif
-
-int board_mmc_init(bd_t *bis)
-{
-       struct gpio_regs *regs = (struct gpio_regs *)GPIO_BASE;
-
-       ep93xx_set_epgio(CONFIG_MMC_SPI_CS_EPGIO);
-       ep93xx_dir_epgio_out(CONFIG_MMC_SPI_CS_EPGIO);
-
-#ifdef CONFIG_MMC_SPI_POWER_EGPIO
-       ep93xx_dir_epgio_out(CONFIG_MMC_SPI_POWER_EGPIO);
-       ep93xx_set_epgio(CONFIG_MMC_SPI_POWER_EGPIO);
-#elif defined(CONFIG_MMC_SPI_NPOWER_EGPIO)
-       ep93xx_dir_epgio_out(CONFIG_MMC_SPI_NPOWER_EGPIO);
-       ep93xx_clear_epgio(CONFIG_MMC_SPI_NPOWER_EGPIO);
-#endif
-       struct mmc *mmc = mmc_spi_init(0, CONFIG_MMC_SPI_CS_EPGIO,
-                               CONFIG_MMC_SPI_SPEED, CONFIG_MMC_SPI_MODE);
-
-       if (!mmc) {
-               printf("Failed to create MMC Device\n");
-               return 1;
-       }
-       mmc_init(mmc);
-       return 0;
-}
-
-
-#endif /* CONFIG_MMC_SPI */
-#endif /* CONFIG_EP93XX_SPI */