• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute  it and/or modify it
5  * under  the terms of  the GNU General  Public License as published by the
6  * Free Software Foundation;  either version 2 of the  License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  * Description: scsi header
18  */
19 
20 #ifndef __HISILICON_KIRIN_SCSI_H__
21 #define __HISILICON_KIRIN_SCSI_H__
22 
23 /* Ref [2], Sec 11.3 */
24 #define UFS_OP_FORMAT_UNIT            0x04
25 #define UFS_OP_INQUIRY                0x12
26 #define UFS_OP_MODE_SELECT_10         0x55
27 #define UFS_OP_MODE_SENSE_10          0x5A
28 #define UFS_OP_PRE_FETCH_10           0x34
29 #define UFS_OP_PRE_FETCH_16           0x90
30 #define UFS_OP_READ_6                 0x08
31 #define UFS_OP_READ_10                0x28
32 #define UFS_OP_READ_16                0x88
33 #define UFS_OP_READ_BUFFER            0x3C
34 #define UFS_OP_READ_CAPACITY_10       0x25
35 #define UFS_OP_READ_CAPACITY_16       0x9E
36 #define UFS_OP_REPORT_LUNS            0xA0
37 #define UFS_OP_REQUEST_SENSE          0x03
38 #define UFS_OP_SECURITY_PROTOCOL_IN   0xA2
39 #define UFS_OP_SECURITY_PROTOCOL_OUT  0xB5
40 #define UFS_OP_SEND_DIAGNOSTIC        0x1D
41 #define UFS_OP_START_STOP_UNIT        0x1B
42 #define UFS_OP_SYNCHRONIZE_CACHE_10   0x35
43 #define UFS_OP_SYNCHRONIZE_CACHE_16   0x91
44 #define UFS_OP_TEST_UNIT_READY        0x00
45 #define UFS_OP_UNMAP                  0x42
46 #define UFS_OP_VERIFY_10              0x2F
47 #define UFS_OP_WRITE_6                0x0A
48 #define UFS_OP_WRITE_10               0x2A
49 #define UFS_OP_WRITE_16               0x8A
50 #define UFS_OP_WRITE_BUFFER           0x3B
51 #define SECURITY_PROTOCOL             0xEC
52 
53 /* SCSI Status Macros */
54 #define SAM_STAT_GOOD                 0x00
55 #define SAM_STAT_CHECK_CONDITION      0x02
56 #define SAM_STAT_CONDITION_MET        0x04
57 #define SAM_STAT_BUSY                 0x08
58 #define SAM_STAT_RESERVATION_CONFLICT 0x18
59 #define SAM_STAT_TASK_SET_FULL        0x28
60 #define SAM_STAT_ACA_ACTIVE           0x30
61 #define SAM_STAT_TASK_ABORTED         0x40
62 
63 void get_cmnd(uint32_t opcode, uint32_t lba, uint32_t size, uint8_t *cmd);
64 
65 #endif /*__HISILICON_KIRIN_SCSI_H__*/
66 
67