diff options
author | Tom Rini <trini@konsulko.com> | 2018-04-07 09:15:50 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-04-07 09:19:00 -0400 |
commit | e80fa2c2c0870f7c17e233ecc07552e1082c1513 (patch) | |
tree | 8274e5382c7b6240899ded2b6c0b3c9440c7d839 /drivers/spi/atmel_spi.h | |
parent | 5270df2836761909864d9b548bf4b7f7f3a51484 (diff) | |
download | u-boot-e80fa2c2c0870f7c17e233ecc07552e1082c1513.tar.gz u-boot-e80fa2c2c0870f7c17e233ecc07552e1082c1513.tar.bz2 u-boot-e80fa2c2c0870f7c17e233ecc07552e1082c1513.zip |
Revert "spi: atmel: Drop non-dm code"
As we aren't quite able to convert some platforms with a very small size
limit in SPL yet, we need to revert this for now.
This reverts commit 7b0947787358c6b277431d6b76ce043d8bec641d.
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/spi/atmel_spi.h')
-rw-r--r-- | drivers/spi/atmel_spi.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/spi/atmel_spi.h b/drivers/spi/atmel_spi.h index 685eeed99e..76b8556c98 100644 --- a/drivers/spi/atmel_spi.h +++ b/drivers/spi/atmel_spi.h @@ -79,6 +79,22 @@ #define ATMEL_SPI_BITS_16 8 struct atmel_spi_slave { + struct spi_slave slave; void *regs; u32 mr; }; + +static inline struct atmel_spi_slave *to_atmel_spi(struct spi_slave *slave) +{ + return container_of(slave, struct atmel_spi_slave, slave); +} + +/* Register access macros */ +#define spi_readl(as, reg) \ + readl(as->regs + ATMEL_SPI_##reg) +#define spi_writel(as, reg, value) \ + writel(value, as->regs + ATMEL_SPI_##reg) + +#if !defined(CONFIG_SYS_SPI_WRITE_TOUT) +#define CONFIG_SYS_SPI_WRITE_TOUT (5 * CONFIG_SYS_HZ) +#endif |