summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-04-10 21:06:27 +0200
committerWolfgang Denk <wd@denx.de>2011-04-10 21:06:27 +0200
commita8708a86344794d7d9a25c71d2fe56b36563a0b5 (patch)
treec9b5d8218aec01c2518b544d1bf8a5b0269702ce /drivers
parent6ee1416e8184b4d9ebe6087d396a60bcecf3551c (diff)
parentd1f3ac9ee4dfc1a43fb7a786548bf0b6f2780695 (diff)
downloadu-boot-imx-a8708a86344794d7d9a25c71d2fe56b36563a0b5.zip
u-boot-imx-a8708a86344794d7d9a25c71d2fe56b36563a0b5.tar.gz
u-boot-imx-a8708a86344794d7d9a25c71d2fe56b36563a0b5.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-blackfin
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/bfin_sdh.c13
-rw-r--r--drivers/spi/bfin_spi.c2
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/mmc/bfin_sdh.c b/drivers/mmc/bfin_sdh.c
index 27d9bf6..31b6459 100644
--- a/drivers/mmc/bfin_sdh.c
+++ b/drivers/mmc/bfin_sdh.c
@@ -19,7 +19,7 @@
#include <asm/mach-common/bits/sdh.h>
#include <asm/mach-common/bits/dma.h>
-#if defined(__ADSPBF51x__)
+#if defined(__ADSPBF50x__) || defined(__ADSPBF51x__)
# define bfin_read_SDH_PWR_CTL bfin_read_RSI_PWR_CONTROL
# define bfin_write_SDH_PWR_CTL bfin_write_RSI_PWR_CONTROL
# define bfin_read_SDH_CLK_CTL bfin_read_RSI_CLK_CONTROL
@@ -114,25 +114,26 @@ static int sdh_setup_data(struct mmc *mmc, struct mmc_data *data)
u16 data_ctl = 0;
u16 dma_cfg = 0;
int ret = 0;
+ unsigned long data_size = data->blocksize * data->blocks;
/* Don't support write yet. */
if (data->flags & MMC_DATA_WRITE)
return UNUSABLE_ERR;
- data_ctl |= ((ffs(data->blocksize) - 1) << 4);
+ data_ctl |= ((ffs(data_size) - 1) << 4);
data_ctl |= DTX_DIR;
bfin_write_SDH_DATA_CTL(data_ctl);
dma_cfg = WDSIZE_32 | RESTART | WNR | DMAEN;
- bfin_write_SDH_DATA_TIMER(0xFFFF);
+ bfin_write_SDH_DATA_TIMER(-1);
blackfin_dcache_flush_invalidate_range(data->dest,
- data->dest + data->blocksize);
+ data->dest + data_size);
/* configure DMA */
bfin_write_DMA_START_ADDR(data->dest);
- bfin_write_DMA_X_COUNT(data->blocksize / 4);
+ bfin_write_DMA_X_COUNT(data_size / 4);
bfin_write_DMA_X_MODIFY(4);
bfin_write_DMA_CONFIG(dma_cfg);
- bfin_write_SDH_DATA_LGTH(data->blocksize);
+ bfin_write_SDH_DATA_LGTH(data_size);
/* kick off transfer */
bfin_write_SDH_DATA_CTL(bfin_read_SDH_DATA_CTL() | DTX_DMA_E | DTX_E);
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index d7e1474..e8a4de5 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -248,6 +248,8 @@ void spi_release_bus(struct spi_slave *slave)
#elif defined(__ADSPBF537__) || defined(__ADSPBF536__) || defined(__ADSPBF534__) || \
defined(__ADSPBF52x__) || defined(__ADSPBF51x__)
# define SPI_DMA_BASE DMA7_NEXT_DESC_PTR
+# elif defined(__ADSPBF50x__)
+# define SPI_DMA_BASE DMA6_NEXT_DESC_PTR
#else
# error "Please provide SPI DMA channel defines"
#endif