0001
0002
0003
0004
0005
0006 #ifndef __ALTERA_SGDMAHW_H__
0007 #define __ALTERA_SGDMAHW_H__
0008
0009
0010 struct sgdma_descrip {
0011 u32 raddr;
0012 u32 pad1;
0013 u32 waddr;
0014 u32 pad2;
0015 u32 next;
0016 u32 pad3;
0017 u16 bytes;
0018 u8 rburst;
0019 u8 wburst;
0020 u16 bytes_xferred;
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 u8 status;
0032
0033
0034
0035
0036
0037
0038
0039 u8 control;
0040 } __packed;
0041
0042 #define SGDMA_DESC_LEN sizeof(struct sgdma_descrip)
0043
0044 #define SGDMA_STATUS_ERR BIT(0)
0045 #define SGDMA_STATUS_LENGTH_ERR BIT(1)
0046 #define SGDMA_STATUS_CRC_ERR BIT(2)
0047 #define SGDMA_STATUS_TRUNC_ERR BIT(3)
0048 #define SGDMA_STATUS_PHY_ERR BIT(4)
0049 #define SGDMA_STATUS_COLL_ERR BIT(5)
0050 #define SGDMA_STATUS_EOP BIT(7)
0051
0052 #define SGDMA_CONTROL_EOP BIT(0)
0053 #define SGDMA_CONTROL_RD_FIXED BIT(1)
0054 #define SGDMA_CONTROL_WR_FIXED BIT(2)
0055
0056
0057
0058 #define SGDMA_CONTROL_HW_OWNED BIT(7)
0059
0060
0061 struct sgdma_csr {
0062
0063
0064
0065
0066
0067
0068
0069 u32 status;
0070 u32 pad1[3];
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 u32 control;
0089 u32 pad2[3];
0090 u32 next_descrip;
0091 u32 pad3[3];
0092 };
0093
0094 #define sgdma_csroffs(a) (offsetof(struct sgdma_csr, a))
0095 #define sgdma_descroffs(a) (offsetof(struct sgdma_descrip, a))
0096
0097 #define SGDMA_STSREG_ERR BIT(0)
0098 #define SGDMA_STSREG_EOP BIT(1)
0099 #define SGDMA_STSREG_DESCRIP BIT(2)
0100 #define SGDMA_STSREG_CHAIN BIT(3)
0101 #define SGDMA_STSREG_BUSY BIT(4)
0102
0103 #define SGDMA_CTRLREG_IOE BIT(0)
0104 #define SGDMA_CTRLREG_IOEOP BIT(1)
0105 #define SGDMA_CTRLREG_IDESCRIP BIT(2)
0106 #define SGDMA_CTRLREG_ILASTD BIT(3)
0107 #define SGDMA_CTRLREG_INTEN BIT(4)
0108 #define SGDMA_CTRLREG_START BIT(5)
0109 #define SGDMA_CTRLREG_STOPERR BIT(6)
0110 #define SGDMA_CTRLREG_INTMAX BIT(7)
0111 #define SGDMA_CTRLREG_RESET BIT(16)
0112 #define SGDMA_CTRLREG_COBHW BIT(17)
0113 #define SGDMA_CTRLREG_POLL BIT(18)
0114 #define SGDMA_CTRLREG_CLRINT BIT(31)
0115
0116 #endif