summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/ata.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index ec99239169..910d42d3b5 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -389,25 +389,28 @@ static ICODE_ATTR void copy_write_sectors(const unsigned char* buf,
389int ata_disk_isssd(void) 389int ata_disk_isssd(void)
390{ 390{
391 /* 391 /*
392 offset 217 is "Nominal Rotation rate" 392 Offset 217 is "Nominal Rotation rate"
393 0x0000 == Not reported 393 0x0000 == Not reported
394 0x0001 == Solid State 394 0x0001 == Solid State
395 0x0401 -> 0xffe == RPM 395 0x0401 -> 0xffe == RPM
396 All others reserved 396 All others reserved
397 397
398 Some CF cards return 0x0100 (ie byteswapped 0x0001) so accept either. 398 Some CF cards return 0x0100 (ie byteswapped 0x0001) so accept either.
399 However, this is a relatively recent change, and we can't rely on it,
400 especially for the FC1307A CF->SD adapters!
399 401
400 However, this is a very recent change, and we can't rely on it, 402 Offset 167 is "Nominal Form Factor"
401 especially for the FC1307A CF->SD adapters. 403 all values >= 0x06 are guaranteed to be solid State.
402 404
403 So we have to resort to other heuristics. 405 Offset 83 b2 and/or 86 b2 is set to show device implementes CFA commands
404 406
405 offset 83 b2 is set to show device implementes CFA commands 407 Offset 169 b0 is set to show device implements TRIM.
406 offset 0 is 0x848a for CF, but that's not guaranteed, because reasons.
407 408
408 These don't guarantee this is an SSD but it's better than nothing. 409 Offset 0 is 0x848a for CF, but that's not guaranteed, because reasons.
409 */ 410 */
410 return (identify_info[83] & (1<<2) || 411 return (identify_info[83] & (1<<2) || identify_info[86] & (1<<2) ||
412 (identify_info[168] & 0x0f) >= 0x06 ||
413 identify_info[169] & (1<<0) ||
411 identify_info[217] == 0x0001 || identify_info[217] == 0x0100); 414 identify_info[217] == 0x0001 || identify_info[217] == 0x0100);
412} 415}
413 416