mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 13:45:03 -05:00
ATA: Check to see if the ATA device is solid-state (WIP)
Not all devices advertise this flag, unfortunately. Change-Id: I6d666febdfcba7598e4d29df7d05c0a288e15158
This commit is contained in:
parent
8029c89808
commit
066d471ae6
1 changed files with 13 additions and 0 deletions
|
|
@ -332,6 +332,19 @@ static ICODE_ATTR void copy_write_sectors(const unsigned char* buf,
|
|||
}
|
||||
#endif /* !ATA_OPTIMIZED_WRITING */
|
||||
|
||||
static inline int ata_disk_isssd(void)
|
||||
{
|
||||
/* 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
|
||||
*/
|
||||
return (identify_info[217] == 0x0001 || identify_info[217] == 0x0100);
|
||||
}
|
||||
|
||||
static int ata_transfer_sectors(unsigned long start,
|
||||
int incount,
|
||||
void* inbuf,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue