123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- #ifndef _SCSI_H
- #define _SCSI_H
- typedef struct SCSI_cmd_block{
- unsigned char cmd[16];
-
- unsigned char sense_buf[64]
- __attribute__((aligned(ARCH_DMA_MINALIGN)));
- unsigned char status;
- unsigned char target;
- unsigned char lun;
- unsigned char cmdlen;
- unsigned long datalen;
- unsigned char * pdata;
- unsigned char msgout[12];
- unsigned char msgin[12];
- unsigned char sensecmdlen;
- unsigned long sensedatalen;
- unsigned char sensecmd[6];
- unsigned long contr_stat;
- unsigned long trans_bytes;
- unsigned int priv;
- }ccb;
- #define M_COMPLETE (0x00)
- #define M_EXTENDED (0x01)
- #define M_SAVE_DP (0x02)
- #define M_RESTORE_DP (0x03)
- #define M_DISCONNECT (0x04)
- #define M_ID_ERROR (0x05)
- #define M_ABORT (0x06)
- #define M_REJECT (0x07)
- #define M_NOOP (0x08)
- #define M_PARITY (0x09)
- #define M_LCOMPLETE (0x0a)
- #define M_FCOMPLETE (0x0b)
- #define M_RESET (0x0c)
- #define M_ABORT_TAG (0x0d)
- #define M_CLEAR_QUEUE (0x0e)
- #define M_INIT_REC (0x0f)
- #define M_REL_REC (0x10)
- #define M_TERMINATE (0x11)
- #define M_SIMPLE_TAG (0x20)
- #define M_HEAD_TAG (0x21)
- #define M_ORDERED_TAG (0x22)
- #define M_IGN_RESIDUE (0x23)
- #define M_IDENTIFY (0x80)
- #define M_X_MODIFY_DP (0x00)
- #define M_X_SYNC_REQ (0x01)
- #define M_X_WIDE_REQ (0x03)
- #define M_X_PPR_REQ (0x04)
- #define S_GOOD (0x00)
- #define S_CHECK_COND (0x02)
- #define S_COND_MET (0x04)
- #define S_BUSY (0x08)
- #define S_INT (0x10)
- #define S_INT_COND_MET (0x14)
- #define S_CONFLICT (0x18)
- #define S_TERMINATED (0x20)
- #define S_QUEUE_FULL (0x28)
- #define S_ILLEGAL (0xff)
- #define S_SENSE (0x80)
- #define SENSE_NO_SENSE 0x0
- #define SENSE_RECOVERED_ERROR 0x1
- #define SENSE_NOT_READY 0x2
- #define SENSE_MEDIUM_ERROR 0x3
- #define SENSE_HARDWARE_ERROR 0x4
- #define SENSE_ILLEGAL_REQUEST 0x5
- #define SENSE_UNIT_ATTENTION 0x6
- #define SENSE_DATA_PROTECT 0x7
- #define SENSE_BLANK_CHECK 0x8
- #define SENSE_VENDOR_SPECIFIC 0x9
- #define SENSE_COPY_ABORTED 0xA
- #define SENSE_ABORTED_COMMAND 0xB
- #define SENSE_VOLUME_OVERFLOW 0xD
- #define SENSE_MISCOMPARE 0xE
- #define SCSI_CHANGE_DEF 0x40
- #define SCSI_COMPARE 0x39
- #define SCSI_COPY 0x18
- #define SCSI_COP_VERIFY 0x3A
- #define SCSI_INQUIRY 0x12
- #define SCSI_LOG_SELECT 0x4C
- #define SCSI_LOG_SENSE 0x4D
- #define SCSI_MODE_SEL6 0x15
- #define SCSI_MODE_SEL10 0x55
- #define SCSI_MODE_SEN6 0x1A
- #define SCSI_MODE_SEN10 0x5A
- #define SCSI_READ_BUFF 0x3C
- #define SCSI_REQ_SENSE 0x03
- #define SCSI_SEND_DIAG 0x1D
- #define SCSI_TST_U_RDY 0x00
- #define SCSI_WRITE_BUFF 0x3B
- #define SCSI_COMPARE 0x39
- #define SCSI_FORMAT 0x04
- #define SCSI_LCK_UN_CAC 0x36
- #define SCSI_PREFETCH 0x34
- #define SCSI_MED_REMOVL 0x1E
- #define SCSI_READ6 0x08
- #define SCSI_READ10 0x28
- #define SCSI_READ16 0x48
- #define SCSI_RD_CAPAC 0x25
- #define SCSI_RD_CAPAC10 SCSI_RD_CAPAC
- #define SCSI_RD_CAPAC16 0x9e
- #define SCSI_RD_DEFECT 0x37
- #define SCSI_READ_LONG 0x3E
- #define SCSI_REASS_BLK 0x07
- #define SCSI_RCV_DIAG 0x1C
- #define SCSI_RELEASE 0x17
- #define SCSI_REZERO 0x01
- #define SCSI_SRCH_DAT_E 0x31
- #define SCSI_SRCH_DAT_H 0x30
- #define SCSI_SRCH_DAT_L 0x32
- #define SCSI_SEEK6 0x0B
- #define SCSI_SEEK10 0x2B
- #define SCSI_SEND_DIAG 0x1D
- #define SCSI_SET_LIMIT 0x33
- #define SCSI_START_STP 0x1B
- #define SCSI_SYNC_CACHE 0x35
- #define SCSI_VERIFY 0x2F
- #define SCSI_WRITE6 0x0A
- #define SCSI_WRITE10 0x2A
- #define SCSI_WRT_VERIFY 0x2E
- #define SCSI_WRITE_LONG 0x3F
- #define SCSI_WRITE_SAME 0x41
- void scsi_print_error(ccb *pccb);
- int scsi_exec(ccb *pccb);
- void scsi_bus_reset(void);
- #if !defined(CONFIG_DM_SCSI)
- void scsi_low_level_init(int busdevfunc);
- #else
- void scsi_low_level_init(int busdevfunc, struct udevice *dev);
- #endif
- void scsi_init(void);
- int scsi_scan(int mode);
- #if defined(CONFIG_DM_SCSI)
- struct scsi_platdata {
- unsigned long base;
- unsigned long max_lun;
- unsigned long max_id;
- };
- #endif
- #define SCSI_IDENTIFY 0xC0
- #define SCSI_SEL_TIME_OUT 0x00000101
- #define SCSI_HNS_TIME_OUT 0x00000102
- #define SCSI_MA_TIME_OUT 0x00000103
- #define SCSI_UNEXP_DIS 0x00000104
- #define SCSI_INT_STATE 0x00010000
- #endif
|