mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-14 14:36:33 -04:00
add CONFIG_SPI_IDLE_VAL for cf_spi.c to allow use of spi_mmc
This patch adds CONFIG_SPI_IDLE_VAL to cf_spi.c The default setting is 0x0 to behave same as current version, in case CONFIG_SPI_MMC is set, the value is set to 0xFFFF (all ones). In either case, the value can be overwritten by board configuration. Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de> Signed-off-by: Andy Fleming <afleming@freescale.com>
This commit is contained in:
parent
ce0fbcd2e1
commit
b97e0cd788
@ -49,6 +49,14 @@ extern void cfspi_release_bus(uint bus, uint cs);
|
|||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
#ifndef CONFIG_SPI_IDLE_VAL
|
||||||
|
#if defined(CONFIG_SPI_MMC)
|
||||||
|
#define CONFIG_SPI_IDLE_VAL 0xFFFF
|
||||||
|
#else
|
||||||
|
#define CONFIG_SPI_IDLE_VAL 0x0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_CF_DSPI)
|
#if defined(CONFIG_CF_DSPI)
|
||||||
/* DSPI specific mode */
|
/* DSPI specific mode */
|
||||||
#define SPI_MODE_MOD 0x00200000
|
#define SPI_MODE_MOD 0x00200000
|
||||||
@ -145,7 +153,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (din != NULL) {
|
if (din != NULL) {
|
||||||
cfspi_tx(ctrl, 0);
|
cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
|
||||||
if (cfslave->charbit == 16)
|
if (cfslave->charbit == 16)
|
||||||
*spi_rd16++ = cfspi_rx();
|
*spi_rd16++ = cfspi_rx();
|
||||||
else
|
else
|
||||||
@ -169,7 +177,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (din != NULL) {
|
if (din != NULL) {
|
||||||
cfspi_tx(ctrl, 0);
|
cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
|
||||||
if (cfslave->charbit == 16)
|
if (cfslave->charbit == 16)
|
||||||
*spi_rd16 = cfspi_rx();
|
*spi_rd16 = cfspi_rx();
|
||||||
else
|
else
|
||||||
@ -177,7 +185,7 @@ int cfspi_xfer(struct spi_slave *slave, uint bitlen, const void *dout,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* dummy read */
|
/* dummy read */
|
||||||
cfspi_tx(ctrl, 0);
|
cfspi_tx(ctrl, CONFIG_SPI_IDLE_VAL);
|
||||||
cfspi_rx();
|
cfspi_rx();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user