diff options
author | Wolfgang Denk <wd@denx.de> | 2009-04-07 21:53:07 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-04-07 21:53:07 +0200 |
commit | f75a729b5c1434d5a5bbf453b1b699bf1c3ffbce (patch) | |
tree | 04d91ba56d894c65d30a47cf832838d82cc5ec50 /drivers | |
parent | 3ccbfb25f48af78e7092ac75f3115e924e76c748 (diff) | |
parent | aad4eca4ba8d597747199d8af723426681557dda (diff) | |
download | u-boot-imx-f75a729b5c1434d5a5bbf453b1b699bf1c3ffbce.zip u-boot-imx-f75a729b5c1434d5a5bbf453b1b699bf1c3ffbce.tar.gz u-boot-imx-f75a729b5c1434d5a5bbf453b1b699bf1c3ffbce.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-blackfin
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/bfin_nand.c | 1 | ||||
-rw-r--r-- | drivers/spi/bfin_spi.c | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/drivers/mtd/nand/bfin_nand.c b/drivers/mtd/nand/bfin_nand.c index f6a0835..f134ef1 100644 --- a/drivers/mtd/nand/bfin_nand.c +++ b/drivers/mtd/nand/bfin_nand.c @@ -98,6 +98,7 @@ static void bfin_nfc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) /* Contents do not matter */ bfin_write_NFC_DATA_RD(0x0000); + SSYNC(); while (!(bfin_read_NFC_IRQSTAT() & RD_RDY)) if (ctrlc()) diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c index bc3394a..bc255cc 100644 --- a/drivers/spi/bfin_spi.c +++ b/drivers/spi/bfin_spi.c @@ -52,6 +52,7 @@ void spi_cs_activate(struct spi_slave *slave) (read_SPI_FLG(bss) & ~((!bss->flg << 8) << slave->cs)) | (1 << slave->cs)); + SSYNC(); debug("%s: SPI_FLG:%x\n", __func__, read_SPI_FLG(bss)); } @@ -59,7 +60,20 @@ __attribute__((weak)) void spi_cs_deactivate(struct spi_slave *slave) { struct bfin_spi_slave *bss = to_bfin_spi_slave(slave); - write_SPI_FLG(bss, read_SPI_FLG(bss) & ~(1 << slave->cs)); + u16 flg; + + /* make sure we force the cs to deassert rather than let the + * pin float back up. otherwise, exact timings may not be + * met some of the time leading to random behavior (ugh). + */ + flg = read_SPI_FLG(bss) | ((!bss->flg << 8) << slave->cs); + write_SPI_FLG(bss, flg); + SSYNC(); + debug("%s: SPI_FLG:%x\n", __func__, read_SPI_FLG(bss)); + + flg &= ~(1 << slave->cs); + write_SPI_FLG(bss, flg); + SSYNC(); debug("%s: SPI_FLG:%x\n", __func__, read_SPI_FLG(bss)); } |