mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
ata: Improve heuristics for detecting SSDs
mSATA devices should be new enough to report their form factor proprerly Change-Id: I2605c8ee0c97432e6e03bd78719e12bb14837f8d
This commit is contained in:
parent
3f4e55a872
commit
0c7394e39a
1 changed files with 16 additions and 13 deletions
|
|
@ -389,25 +389,28 @@ static ICODE_ATTR void copy_write_sectors(const unsigned char* buf,
|
|||
int ata_disk_isssd(void)
|
||||
{
|
||||
/*
|
||||
offset 217 is "Nominal Rotation rate"
|
||||
0x0000 == Not reported
|
||||
0x0001 == Solid State
|
||||
0x0401 -> 0xffe == RPM
|
||||
All others reserved
|
||||
Offset 217 is "Nominal Rotation rate"
|
||||
0x0000 == Not reported
|
||||
0x0001 == Solid State
|
||||
0x0401 -> 0xffe == RPM
|
||||
All others reserved
|
||||
|
||||
Some CF cards return 0x0100 (ie byteswapped 0x0001) so accept either.
|
||||
Some CF cards return 0x0100 (ie byteswapped 0x0001) so accept either.
|
||||
However, this is a relatively recent change, and we can't rely on it,
|
||||
especially for the FC1307A CF->SD adapters!
|
||||
|
||||
However, this is a very recent change, and we can't rely on it,
|
||||
especially for the FC1307A CF->SD adapters.
|
||||
Offset 167 is "Nominal Form Factor"
|
||||
all values >= 0x06 are guaranteed to be solid State.
|
||||
|
||||
So we have to resort to other heuristics.
|
||||
Offset 83 b2 and/or 86 b2 is set to show device implementes CFA commands
|
||||
|
||||
offset 83 b2 is set to show device implementes CFA commands
|
||||
offset 0 is 0x848a for CF, but that's not guaranteed, because reasons.
|
||||
Offset 169 b0 is set to show device implements TRIM.
|
||||
|
||||
These don't guarantee this is an SSD but it's better than nothing.
|
||||
Offset 0 is 0x848a for CF, but that's not guaranteed, because reasons.
|
||||
*/
|
||||
return (identify_info[83] & (1<<2) ||
|
||||
return (identify_info[83] & (1<<2) || identify_info[86] & (1<<2) ||
|
||||
(identify_info[168] & 0x0f) >= 0x06 ||
|
||||
identify_info[169] & (1<<0) ||
|
||||
identify_info[217] == 0x0001 || identify_info[217] == 0x0100);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue