diff options
author | Wolfgang Muees <wolfgang.mues@auerswald.de> | 2009-05-21 21:11:02 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-10-18 02:49:29 -0400 |
commit | bb8beecd98de45f821a3360e0b061fc1f8da947c (patch) | |
tree | bfee407e8753749582c2e656753d18f741ce67e2 /drivers/spi | |
parent | 60d0071b609ecb0aebe12aaedf34fe552da12c5b (diff) |
spi/bfin_spi: force sane master-mode state at boot
We should make sure the SPI controller is in a sane state in case the
boot loader left it in a crappy state. Such as DMA pending which causes
interrupts to fire on us.
When setting a sane initial state, do not default to slave mode. If we
do, then the SPI peripheral may implicitly take over the SPISS pin which
other things might be using.
For example, the BF533-STAMP uses this pin as a GPIO to control switching
between ethernet and flash. If the SPI peripheral controls the output
state instead, the ethernet is no longer accessible.
URL: http://blackfin.uclinux.org/gf/tracker/5630
Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi_bfin5xx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index 61c2ebf9fe18..b8352546c589 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
@@ -1354,6 +1354,12 @@ static int __init bfin_spi_probe(struct platform_device *pdev) | |||
1354 | goto out_error_queue_alloc; | 1354 | goto out_error_queue_alloc; |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | /* Reset SPI registers. If these registers were used by the boot loader, | ||
1358 | * the sky may fall on your head if you enable the dma controller. | ||
1359 | */ | ||
1360 | write_CTRL(drv_data, BIT_CTL_CPHA | BIT_CTL_MASTER); | ||
1361 | write_FLAG(drv_data, 0xFF00); | ||
1362 | |||
1357 | /* Register with the SPI framework */ | 1363 | /* Register with the SPI framework */ |
1358 | platform_set_drvdata(pdev, drv_data); | 1364 | platform_set_drvdata(pdev, drv_data); |
1359 | status = spi_register_master(master); | 1365 | status = spi_register_master(master); |