diff options
author | Tom Rini <trini@konsulko.com> | 2017-01-15 13:33:30 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-01-15 13:33:30 -0500 |
commit | 035ebf85b09cf11c820ae9eec414097420741abd (patch) | |
tree | f7d33017f8aa4120ef6943caf5ab39dd41216083 /board | |
parent | cc422dae217924d9fe63258e39d309d84d70d437 (diff) | |
parent | 68e7999ba9de0a15dd3dc99e078b70f41eb98c82 (diff) | |
download | u-boot-035ebf85b09cf11c820ae9eec414097420741abd.tar.gz u-boot-035ebf85b09cf11c820ae9eec414097420741abd.tar.bz2 u-boot-035ebf85b09cf11c820ae9eec414097420741abd.zip |
Merge branch 'master' of git://git.denx.de/u-boot-spi
Diffstat (limited to 'board')
-rw-r--r-- | board/cirrus/edb93xx/edb93xx.c | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/board/cirrus/edb93xx/edb93xx.c b/board/cirrus/edb93xx/edb93xx.c index 8963d3a582..51ff16215e 100644 --- a/board/cirrus/edb93xx/edb93xx.c +++ b/board/cirrus/edb93xx/edb93xx.c @@ -282,101 +282,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(®s->padr) | (1<<num), ®s->padr); - else - writel(readl(®s->pbdr) | (1<<(num-8)), ®s->pbdr); -} - -static void ep93xx_clear_epgio(unsigned num) -{ - struct gpio_regs *regs = (struct gpio_regs *)GPIO_BASE; - if (num < 8) - writel(readl(®s->padr) & (~(1<<num)), ®s->padr); - else - writel(readl(®s->pbdr) & (~(1<<(num-8))), ®s->pbdr); -} - -static void ep93xx_dir_epgio_out(unsigned num) -{ - struct gpio_regs *regs = (struct gpio_regs *)GPIO_BASE; - if (num < 8) - writel(readl(®s->paddr) | (1<<num), ®s->paddr); - else - writel(readl(®s->pbddr) | (1<<(num-8)), ®s->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 */ |