Path: blob/master/arch/blackfin/include/asm/bfin5xx_spi.h
15126 views
/*1* Blackfin On-Chip SPI Driver2*3* Copyright 2004-2008 Analog Devices Inc.4*5* Licensed under the GPL-2 or later.6*/78#ifndef _SPI_CHANNEL_H_9#define _SPI_CHANNEL_H_1011#define MIN_SPI_BAUD_VAL 21213#define BIT_CTL_ENABLE 0x400014#define BIT_CTL_OPENDRAIN 0x200015#define BIT_CTL_MASTER 0x100016#define BIT_CTL_CPOL 0x080017#define BIT_CTL_CPHA 0x040018#define BIT_CTL_LSBF 0x020019#define BIT_CTL_WORDSIZE 0x010020#define BIT_CTL_EMISO 0x002021#define BIT_CTL_PSSE 0x001022#define BIT_CTL_GM 0x000823#define BIT_CTL_SZ 0x000424#define BIT_CTL_RXMOD 0x000025#define BIT_CTL_TXMOD 0x000126#define BIT_CTL_TIMOD_DMA_TX 0x000327#define BIT_CTL_TIMOD_DMA_RX 0x000228#define BIT_CTL_SENDOPT 0x000429#define BIT_CTL_TIMOD 0x00033031#define BIT_STAT_SPIF 0x000132#define BIT_STAT_MODF 0x000233#define BIT_STAT_TXE 0x000434#define BIT_STAT_TXS 0x000835#define BIT_STAT_RBSY 0x001036#define BIT_STAT_RXS 0x002037#define BIT_STAT_TXCOL 0x004038#define BIT_STAT_CLR 0xFFFF3940#define BIT_STU_SENDOVER 0x000141#define BIT_STU_RECVFULL 0x00204243/*44* All Blackfin system MMRs are padded to 32bits even if the register45* itself is only 16bits. So use a helper macro to streamline this.46*/47#define __BFP(m) u16 m; u16 __pad_##m4849/*50* bfin spi registers layout51*/52struct bfin_spi_regs {53__BFP(ctl);54__BFP(flg);55__BFP(stat);56__BFP(tdbr);57__BFP(rdbr);58__BFP(baud);59__BFP(shadow);60};6162#undef __BFP6364#define MAX_CTRL_CS 8 /* cs in spi controller */6566/* device.platform_data for SSP controller devices */67struct bfin5xx_spi_master {68u16 num_chipselect;69u8 enable_dma;70u16 pin_req[7];71};7273/* spi_board_info.controller_data for SPI slave devices,74* copied to spi_device.platform_data ... mostly for dma tuning75*/76struct bfin5xx_spi_chip {77u16 ctl_reg;78u8 enable_dma;79u8 bits_per_word;80u16 cs_chg_udelay; /* Some devices require 16-bit delays */81/* Value to send if no TX value is supplied, usually 0x0 or 0xFFFF */82u16 idle_tx_val;83u8 pio_interrupt; /* Enable spi data irq */84};8586#endif /* _SPI_CHANNEL_H_ */878889