[U-Boot] [PATCH] add SPI_CS_HIGH option to cf_spi.c

Wolfgang Wegner w.wegner at astro-kom.de
Fri Apr 23 10:47:37 CEST 2010


Signed-off-by: Wolfgang Wegner <w.wegner at astro-kom.de>
---
I tested this patch on a MCF54455. The basic intention was to make using
DSPI for MMC/SD-Card possible.

 drivers/spi/cf_spi.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c
index 722aafc..8cc1d03 100644
--- a/drivers/spi/cf_spi.c
+++ b/drivers/spi/cf_spi.c
@@ -256,6 +256,11 @@ struct spi_slave *cfspi_setup_slave(struct cf_spi_slave *cfslave, uint mode)
 	} else
 		bus_setup |= (dspi->ctar[cfslave->slave.bus] & 0x78FCFFF0);
 
+	if (mode & SPI_CS_HIGH)
+		dspi->mcr &= ~(1 << (16 + cfslave->slave.cs));
+	else
+		dspi->mcr |= (1 << (16 + cfslave->slave.cs));
+
 	cfslave->charbit =
 	    ((dspi->ctar[cfslave->slave.bus] & 0x78000000) ==
 	     0x78000000) ? 16 : 8;
-- 
1.5.6.5



More information about the U-Boot mailing list