diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-07-16 16:59:36 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-07-16 17:35:53 -0400 |
commit | 01ec79663d82c31cc3f231a2ce97c46291630b3d (patch) | |
tree | 97a69117a1312c9e7a7914195b65e73bad7a9e7d /firmware/export | |
parent | 942e013eac7859ee1cf823e7b98af163c79b54d5 (diff) | |
download | rockbox-01ec79663d82c31cc3f231a2ce97c46291630b3d.tar.gz rockbox-01ec79663d82c31cc3f231a2ce97c46291630b3d.zip |
ATA: Rework ata_isssd() slightly:
* If CF Timing mode is specified, treat it as SSD
(some SD adapters don't report CFA supported but but report this,
and _all_ microdrives seen do not report this)
* If CFA compliant and CF power level 0, treat as SSD
Change-Id: Ia8c88b4636af9bae75fbd1c253d8b2b01bca6584
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/ata.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/export/ata.h b/firmware/export/ata.h index 62c9467643..e46b0fee71 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h | |||
@@ -191,22 +191,22 @@ static inline int ata_disk_isssd(void) | |||
191 | However microdrives pose a problem as they support CFA but are not | 191 | However microdrives pose a problem as they support CFA but are not |
192 | SSD. | 192 | SSD. |
193 | 193 | ||
194 | Offset 163 shows CF Advanced timing modes; microdrives all seems to | ||
195 | report 0, but all others (including iFlash) report higher! This | ||
196 | is often present even when the "CFA supported" bit is 0. | ||
197 | |||
194 | Offset 160 b15 indicates support for CF+ power level 1, if not set | 198 | Offset 160 b15 indicates support for CF+ power level 1, if not set |
195 | then device is standard flash CF. However this is not foolproof | 199 | then device is standard flash CF. However this is not foolproof |
196 | as newer CF cards may support it for extra performance. | 200 | as newer CF cards (and those CF->SD adapters) may report this. |
197 | |||
198 | Offset 163 shows CF Advanced timing modes; microdrive seems to | ||
199 | report 0, but all others (including iFlash) report higher! | ||
200 | 201 | ||
201 | So if device support CFA _AND_ reports higher speeds modes, it is SSD. | ||
202 | 202 | ||
203 | */ | 203 | */ |
204 | return ( (identify_info[217] == 0x0001 || identify_info[217] == 0x0100) /* "Solid state" rotational rate */ | 204 | return ( (identify_info[217] == 0x0001 || identify_info[217] == 0x0100) /* "Solid state" rotational rate */ |
205 | || ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */ | 205 | || ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */ |
206 | || (identify_info[169] & (1<<0)) /* TRIM supported */ | 206 | || (identify_info[169] & (1<<0)) /* TRIM supported */ |
207 | || (identify_info[163] > 0) /* CF Advanced timing modes */ | ||
207 | || ((identify_info[83] & (1<<2)) && /* CFA compliant */ | 208 | || ((identify_info[83] & (1<<2)) && /* CFA compliant */ |
208 | (((identify_info[160] & (1<<15)) == 0) || /* CF level 0 */ | 209 | ((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */ |
209 | (identify_info[163] > 0))) /* Advanced timing modes */ | ||
210 | ); | 210 | ); |
211 | } | 211 | } |
212 | 212 | ||