summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-02-25 11:46:18 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-03-01 16:52:43 +0100
commit00a5fd7a31ad0d8c40acaabec2070ff1ac776458 (patch)
treed5f4352ae0e9c8070fe55940596544d9c7bd4a22 /include
parent7b8541cd9be350b97038b560a3fd3f6f8b88b584 (diff)
downloadbarebox-00a5fd7a31ad0d8c40acaabec2070ff1ac776458.tar.gz
barebox-00a5fd7a31ad0d8c40acaabec2070ff1ac776458.tar.xz
usb: storage: add support for drivers larger than 2TiB
Consumer USB disks usually have emulated 512 byte sectors at the USB/SCSI level, which means SCSI Read/Write/Capacity 10 can only handle up to 2TiB USB disks. Add support for the optional 16 byte command variants to handle disks larger than that. Disks smaller than 2 TiB should not be affected. Tested with 2 different 4TiB disks as well as one 2TiB disk. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/scsi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/scsi.h b/include/scsi.h
index e2397489ea..f84513b813 100644
--- a/include/scsi.h
+++ b/include/scsi.h
@@ -109,6 +109,7 @@
#define SCSI_MED_REMOVL 0x1E /* Prevent/Allow medium Removal (O) */
#define SCSI_READ6 0x08 /* Read 6-byte (MANDATORY) */
#define SCSI_READ10 0x28 /* Read 10-byte (MANDATORY) */
+#define SCSI_READ16 0x88 /* Read 16-byte (O) */
#define SCSI_RD_CAPAC 0x25 /* Read Capacity (MANDATORY) */
#define SCSI_RD_DEFECT 0x37 /* Read Defect Data (O) */
#define SCSI_READ_LONG 0x3E /* Read Long (O) */
@@ -128,10 +129,14 @@
#define SCSI_VERIFY 0x2F /* Verify (O) */
#define SCSI_WRITE6 0x0A /* Write 6-Byte (MANDATORY) */
#define SCSI_WRITE10 0x2A /* Write 10-Byte (MANDATORY) */
+#define SCSI_WRITE16 0x8A /* Write 16-Byte (O) */
#define SCSI_WRT_VERIFY 0x2E /* Write and Verify (O) */
#define SCSI_WRITE_LONG 0x3F /* Write Long (O) */
#define SCSI_WRITE_SAME 0x41 /* Write Same (O) */
+#define SERVICE_ACTION_IN_16 0x9e
+/* values for service action in */
+#define SAI_READ_CAPACITY_16 0x10
/****************************************************************************
* decleration of functions which have to reside in the LowLevel Part Driver