imxtools/scsitools: add support for more commands
[maemo-rb.git] / utils / imxtools / scsitools / stmp_scsi.h
blob0b7453e70b6bdeb9c0153dc959c79d9e3744f8f0
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2012 Amaury Pouly
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef __STMP_SCSI__
22 #define __STMP_SCSI__
24 #include <stdint.h>
26 #define SCSI_STMP_READ 0xc0
27 #define SCSI_STMP_WRITE 0xc1
28 /** STMP: Command */
29 #define SCSI_STMP_CMD_GET_PROTOCOL_VERSION 0
30 #define SCSI_STMP_CMD_GET_LOGICAL_MEDIA_INFO 2
31 #define SCSI_STMP_CMD_GET_LOGICAL_TABLE 5
32 #define SCSI_STMP_CMD_GET_LOGICAL_DRIVE_INFO 0x12
33 #define SCSI_STMP_CMD_GET_CHIP_MAJOR_REV_ID 0x30
34 #define SCSI_STMP_CMD_GET_ROM_REV_ID 0x37
36 struct scsi_stmp_protocol_version_t
38 uint8_t major;
39 uint8_t minor;
40 } __attribute__((packed));
42 struct scsi_stmp_rom_rev_id_t
44 uint16_t rev; /* big-endian */
45 } __attribute__((packed));
47 struct scsi_stmp_chip_major_rev_id_t
49 uint16_t rev; /* big-endian */
50 } __attribute__((packed));
52 struct scsi_stmp_logical_table_entry_t
54 uint8_t drive_no;
55 uint8_t type;
56 uint8_t tag;
57 uint64_t size; /* big-endian */
58 } __attribute__((packed));
60 struct scsi_stmp_logical_table_t
62 uint16_t count; /* big-endian */
63 } __attribute__((packed));
65 #define SCSI_STMP_MEDIA_INFO_TYPE 6
66 #define SCSI_STMP_MEDIA_INFO_VENDOR 12
68 #define SCSI_STMP_MEDIA_TYPE_NAND 0
69 #define SCSI_STMP_MEDIA_TYPE_SDMMC 1
70 #define SCSI_STMP_MEDIA_TYPE_HDD 2
71 #define SCSI_STMP_MEDIA_TYPE_RAM 3
72 #define SCSI_STMP_MEDIA_TYPE_iNAND 4
74 #define SCSI_STMP_MEDIA_VENDOR_SAMSUNG 0xEC
75 #define SCSI_STMP_MEDIA_VENDOR_STMICRO 0x20
76 #define SCSI_STMP_MEDIA_VENDOR_HYNIX 0xAD
77 #define SCSI_STMP_MEDIA_VENDOR_MICRON 0x2C
78 #define SCSI_STMP_MEDIA_VENDOR_TOSHIBA 0x98
79 #define SCSI_STMP_MEDIA_VENDOR_RENESAS 0x07
80 #define SCSI_STMP_MEDIA_VENDOR_SANDISK 0x45
81 #define SCSI_STMP_MEDIA_VENDOR_INTEL 0x89
83 struct scsi_stmp_logical_media_info_type_t
85 uint8_t type;
86 } __attribute__((packed));
88 struct scsi_stmp_logical_media_info_manufacturer_t
90 uint32_t type; /* big-endian */
91 } __attribute__((packed));
93 #define SCSI_STMP_DRIVE_INFO_SIZE 2
94 #define SCSI_STMP_DRIVE_INFO_TYPE 5
96 struct scsi_stmp_logical_drive_info_size_t
98 uint64_t size; /* big-endian */
99 } __attribute__((packed));
101 struct scsi_stmp_logical_drive_info_type_t
103 uint8_t type;
104 } __attribute__((packed));
106 #endif /* __STMP_SCSI__ */