|
@@ -157,3 +157,102 @@
|
|
|
#define SPI_IMSK_SET_RSM 0x00000100 /* Receive Start Interrupt Mask */
|
|
|
#define SPI_IMSK_SET_TSM 0x00000200 /* Transmit Start Interrupt Mask */
|
|
|
#define SPI_IMSK_SET_RFM 0x00000400 /* Receive Finish Interrupt Mask */
|
|
|
+#define SPI_IMSK_SET_TFM 0x00000800 /* Transmit Finish Interrupt Mask */
|
|
|
+/* SPI_STATUS */
|
|
|
+#define SPI_STAT_SPIF 0x00000001 /* SPI Finished */
|
|
|
+#define SPI_STAT_RUWM 0x00000002 /* Receive Urgent Water-Mark Breached */
|
|
|
+#define SPI_STAT_TUWM 0x00000004 /* Transmit Urgent Water-Mark Breached */
|
|
|
+#define SPI_STAT_ROE 0x00000010 /* Receive Over-Run Error Indication */
|
|
|
+#define SPI_STAT_TUE 0x00000020 /* Transmit Under-Run Error Indication */
|
|
|
+#define SPI_STAT_TCE 0x00000040 /* Transmit Collision Error Indication */
|
|
|
+#define SPI_STAT_MODF 0x00000080 /* Mode Fault Error Indication */
|
|
|
+#define SPI_STAT_RS 0x00000100 /* Receive Start Indication */
|
|
|
+#define SPI_STAT_TS 0x00000200 /* Transmit Start Indication */
|
|
|
+#define SPI_STAT_RF 0x00000400 /* Receive Finish Indication */
|
|
|
+#define SPI_STAT_TF 0x00000800 /* Transmit Finish Indication */
|
|
|
+#define SPI_STAT_RFS 0x00007000 /* SPI_RFIFO status */
|
|
|
+#define SPI_STAT_RFIFO_EMPTY 0x00000000 /* RFS: RFIFO Empty */
|
|
|
+#define SPI_STAT_RFIFO_25 0x00001000 /* RFS: RFIFO 25% Full */
|
|
|
+#define SPI_STAT_RFIFO_50 0x00002000 /* RFS: RFIFO 50% Full */
|
|
|
+#define SPI_STAT_RFIFO_75 0x00003000 /* RFS: RFIFO 75% Full */
|
|
|
+#define SPI_STAT_RFIFO_FULL 0x00004000 /* RFS: RFIFO Full */
|
|
|
+#define SPI_STAT_TFS 0x00070000 /* SPI_TFIFO status */
|
|
|
+#define SPI_STAT_TFIFO_FULL 0x00000000 /* TFS: TFIFO full */
|
|
|
+#define SPI_STAT_TFIFO_25 0x00010000 /* TFS: TFIFO 25% empty */
|
|
|
+#define SPI_STAT_TFIFO_50 0x00020000 /* TFS: TFIFO 50% empty */
|
|
|
+#define SPI_STAT_TFIFO_75 0x00030000 /* TFS: TFIFO 75% empty */
|
|
|
+#define SPI_STAT_TFIFO_EMPTY 0x00040000 /* TFS: TFIFO empty */
|
|
|
+#define SPI_STAT_FCS 0x00100000 /* Flow-Control Stall Indication */
|
|
|
+#define SPI_STAT_RFE 0x00400000 /* SPI_RFIFO Empty */
|
|
|
+#define SPI_STAT_TFF 0x00800000 /* SPI_TFIFO Full */
|
|
|
+/* SPI_ILAT */
|
|
|
+#define SPI_ILAT_RUWMI 0x00000002 /* Receive Urgent Water Mark Interrupt */
|
|
|
+#define SPI_ILAT_TUWMI 0x00000004 /* Transmit Urgent Water Mark Interrupt */
|
|
|
+#define SPI_ILAT_ROI 0x00000010 /* Receive Over-Run Error Indication */
|
|
|
+#define SPI_ILAT_TUI 0x00000020 /* Transmit Under-Run Error Indication */
|
|
|
+#define SPI_ILAT_TCI 0x00000040 /* Transmit Collision Error Indication */
|
|
|
+#define SPI_ILAT_MFI 0x00000080 /* Mode Fault Error Indication */
|
|
|
+#define SPI_ILAT_RSI 0x00000100 /* Receive Start Indication */
|
|
|
+#define SPI_ILAT_TSI 0x00000200 /* Transmit Start Indication */
|
|
|
+#define SPI_ILAT_RFI 0x00000400 /* Receive Finish Indication */
|
|
|
+#define SPI_ILAT_TFI 0x00000800 /* Transmit Finish Indication */
|
|
|
+/* SPI_ILATCL */
|
|
|
+#define SPI_ILAT_CLR_RUWMI 0x00000002 /* Receive Urgent Water Mark Interrupt */
|
|
|
+#define SPI_ILAT_CLR_TUWMI 0x00000004 /* Transmit Urgent Water Mark Interrupt */
|
|
|
+#define SPI_ILAT_CLR_ROI 0x00000010 /* Receive Over-Run Error Indication */
|
|
|
+#define SPI_ILAT_CLR_TUI 0x00000020 /* Transmit Under-Run Error Indication */
|
|
|
+#define SPI_ILAT_CLR_TCI 0x00000040 /* Transmit Collision Error Indication */
|
|
|
+#define SPI_ILAT_CLR_MFI 0x00000080 /* Mode Fault Error Indication */
|
|
|
+#define SPI_ILAT_CLR_RSI 0x00000100 /* Receive Start Indication */
|
|
|
+#define SPI_ILAT_CLR_TSI 0x00000200 /* Transmit Start Indication */
|
|
|
+#define SPI_ILAT_CLR_RFI 0x00000400 /* Receive Finish Indication */
|
|
|
+#define SPI_ILAT_CLR_TFI 0x00000800 /* Transmit Finish Indication */
|
|
|
+
|
|
|
+/*
|
|
|
+ * bfin spi3 registers layout
|
|
|
+ */
|
|
|
+struct bfin_spi_regs {
|
|
|
+ u32 revid;
|
|
|
+ u32 control;
|
|
|
+ u32 rx_control;
|
|
|
+ u32 tx_control;
|
|
|
+ u32 clock;
|
|
|
+ u32 delay;
|
|
|
+ u32 ssel;
|
|
|
+ u32 rwc;
|
|
|
+ u32 rwcr;
|
|
|
+ u32 twc;
|
|
|
+ u32 twcr;
|
|
|
+ u32 reserved0;
|
|
|
+ u32 emask;
|
|
|
+ u32 emaskcl;
|
|
|
+ u32 emaskst;
|
|
|
+ u32 reserved1;
|
|
|
+ u32 status;
|
|
|
+ u32 elat;
|
|
|
+ u32 elatcl;
|
|
|
+ u32 reserved2;
|
|
|
+ u32 rfifo;
|
|
|
+ u32 reserved3;
|
|
|
+ u32 tfifo;
|
|
|
+};
|
|
|
+
|
|
|
+#define MAX_CTRL_CS 8 /* cs in spi controller */
|
|
|
+
|
|
|
+/* device.platform_data for SSP controller devices */
|
|
|
+struct bfin6xx_spi_master {
|
|
|
+ u16 num_chipselect;
|
|
|
+ u16 pin_req[7];
|
|
|
+};
|
|
|
+
|
|
|
+/* spi_board_info.controller_data for SPI slave devices,
|
|
|
+ * copied to spi_device.platform_data ... mostly for dma tuning
|
|
|
+ */
|
|
|
+struct bfin6xx_spi_chip {
|
|
|
+ u32 control;
|
|
|
+ u16 cs_chg_udelay; /* Some devices require 16-bit delays */
|
|
|
+ u32 tx_dummy_val; /* tx value for rx only transfer */
|
|
|
+ bool enable_dma;
|
|
|
+};
|
|
|
+
|
|
|
+#endif /* _SPI_CHANNEL_H_ */
|