From 01ec79663d82c31cc3f231a2ce97c46291630b3d Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 16 Jul 2024 16:59:36 -0400 Subject: 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 --- firmware/export/ata.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'firmware') 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) However microdrives pose a problem as they support CFA but are not SSD. + Offset 163 shows CF Advanced timing modes; microdrives all seems to + report 0, but all others (including iFlash) report higher! This + is often present even when the "CFA supported" bit is 0. + Offset 160 b15 indicates support for CF+ power level 1, if not set then device is standard flash CF. However this is not foolproof - as newer CF cards may support it for extra performance. - - Offset 163 shows CF Advanced timing modes; microdrive seems to - report 0, but all others (including iFlash) report higher! + as newer CF cards (and those CF->SD adapters) may report this. - So if device support CFA _AND_ reports higher speeds modes, it is SSD. */ return ( (identify_info[217] == 0x0001 || identify_info[217] == 0x0100) /* "Solid state" rotational rate */ || ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */ || (identify_info[169] & (1<<0)) /* TRIM supported */ + || (identify_info[163] > 0) /* CF Advanced timing modes */ || ((identify_info[83] & (1<<2)) && /* CFA compliant */ - (((identify_info[160] & (1<<15)) == 0) || /* CF level 0 */ - (identify_info[163] > 0))) /* Advanced timing modes */ + ((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */ ); } -- cgit v1.2.3