Page 1 of 1
Detecting and enabling AHCI on older PC's
Posted: Thu Apr 05, 2012 12:06 pm
by IanSeyler
TL;DR - Has anyone run into issues where you enable Native SATA mode in the BIOS but it doesn't seem to work? Can the controller be forced into AHCI mode?
For instance.. A Dell Optiplex 745 has four internal SATA ports. But the controller does not seem to support ACHI. In fact the controllers report the following in Linux:
82801H (ICH8 Family) 4 port SATA Controller [IDE mode]
82801HR/HO/HH (ICH8R/DO/DH) 2 port SATA Controller [IDE mode]
In the BIOS there are two options for the SATA Operation. Normal and Legacy. I would assume that 'Normal' means AHCI but changing it in the BIOS doesn't seem to change what Linux sees. I look for a SATA controller by searching the PCI bus for a device with Device class 1 and Device subclass 6. On the Optiplex no such device exists. In fact I tried this later on with two other systems with the same results.
ICH8 and up support AHCI operation but the BIOS doesn't seem to turn it on with the systems I have tested.
A quick Google search came up with this:
http://lists.freebsd.org/pipermail/free ... 21421.html
The PDF in the FreeBSD post:
http://www.intel.com/content/dam/doc/da ... asheet.pdf
It may be possible to force a controller into AHCI operation if the BIOS doesn't do it.
Page 486:
MAP—Address Map Register (SATA–D31:F2)
Address Offset: 90h Attribute: R/W
Default Value: 00h Size: 8 bits
SATA Mode Select (SMS) — R/W: SW programs these bits to control the mode in which the SATA HBA should operate:
00b = IDE mode
01b = AHCI mode
10b = RAID mode
11b = Reserved
Anyone run into this? I would like to move my software to only AHCI support and dump legacy IDE... but not on the condition that I severely limit the hardware it can be run on.
Thanks,
-Ian
Re: Detecting and enabling AHCI on older PC's
Posted: Thu Apr 05, 2012 1:51 pm
by Cognition
Seems like the specification is pretty clear that the SMS register shouldn't be touched outside of BIOS during POST, no idea what would happen later but it seems ill advised so I'd be careful attempting it. That being said, I've seen other SATA controllers which don't seem to support AHCI as a bios option. I know I've had NVIDIA chipsets which used a sort of extended PCI IDE Bus Master style of interface with no ACHI mode. There's going to be pieces of hardware like that out there, a few generations of NVIDIA chipsets and perhaps even some software based add in raid cards.
Fortunately it does seem that the ICH8 supports the functionality you're looking for however the bios seems to be the big limiter. Sometimes manufacturers will enable certain features in later bios updates, for example the PC I'm typing this on has an ICH10R chipset which supports HPET, but it could not be enabled in the BIOS until almost a year after I bought it. That's probably the safest bet, but in general I wouldn't recommend throwing out PCI IDE Bus Master support altogether, lots of chipsets might have it as a fallback option or have multiple controllers some of which only support an IDE interface. Having both a PCI IDE Bus Master driver and an AHCI driver should allow you to interact with the vast majority of hardware out there.
Re: Detecting and enabling AHCI on older PC's
Posted: Thu Apr 05, 2012 10:58 pm
by Brynet-Inc
The native mode for many SATA controllers isn't AHCI, it can be proprietary or an extension of PCI IDE in "native" PCI mode (..vs legacy/compatibility mode).
Most BIOS's will mention AHCI if it is supported, some only enable AHCI when set to "RAID". I believe Intel likes to add proprietary metadata for their software RAID functionality, other might as well.
It could be worth trying AHCI if the class/subclass is set to RAID...
Re: Detecting and enabling AHCI on older PC's
Posted: Fri Apr 06, 2012 3:16 am
by rdos
ReturnInfinity wrote:TL;DR - Has anyone run into issues where you enable Native SATA mode in the BIOS but it doesn't seem to work? Can the controller be forced into AHCI mode?
Anyone run into this? I would like to move my software to only AHCI support and dump legacy IDE... but not on the condition that I severely limit the hardware it can be run on.
I know at least one chipset where the BIOS uses chipset specific ports in order to switch between IDE and AHCI mode, and on that computer changing from IDE to AHCI in the "documented" way doesn't work. I think it is best to leave this up to the BIOS. If PCI reports IDE mode, use an IDE driver, and if it reports AHCI mode, use an AHCI driver. I see no advantage of AHCI over IDE. In fact, AHCI seems to be more error-prone than IDE. On IDE, I never have to retry disk operations, but until I added this to my AHCI driver, it frequently locked-up on drive errors. It seems to be normal for SATA/AHCI to return errors (or maybe it is my notebook?).
Re: Detecting and enabling AHCI on older PC's
Posted: Fri Apr 06, 2012 6:19 am
by Rudster816
Only supporting AHCI would be a horrendous compatibly problem. A lot of hard drives are still PATA, and will be for quite some time. This is only a fraction of the problem though, the biggest problem is the fact that most SATA controllers run are set to IDE mode by default in the BIOS. This can be trivial to change on some motherboards, but others it can be confusing\impossible.
If you want to support one or the other, support IDE. AHCI might be newer, but there really isn't anything about it that makes it better.
Re: Detecting and enabling AHCI on older PC's
Posted: Fri Apr 06, 2012 5:46 pm
by IanSeyler
I'm not too concerned about legacy systems since the OS only supports 64-bit systems.. however it looks like I will need to keep IDE support it.
So what is the real difference between 'Native' and 'Legacy'?
Re: Detecting and enabling AHCI on older PC's
Posted: Sat Apr 07, 2012 5:22 am
by Rudster816
ReturnInfinity wrote:I'm not too concerned about legacy systems since the OS only supports 64-bit systems.. however it looks like I will need to keep IDE support it.
So what is the real difference between 'Native' and 'Legacy'?
My system is the farthest thing from legacy yet I run my SATA controllers in IDE mode because this is what my BIOS defaults to, and I don't want to have to change it everytime I reset the BIOS. Also Windows requires a registry hack to go from IDE to AHCI, which I'd be too lazy to do anyways.
The difference between Native and Legacy is whatever your BIOS thinks. Maybe it's using SATA I (1.5Gbps) instead of SATA II\III when in legacy mode, I don't know. Although it should be safe to assume Native is AHCI and Legacy is IDE, it very well may not be. Most prebuilt machines have absolutely inadequate BIOS options\documentation. On my laptop, the options for the SATA controller are AHCI or Compatibility, which I can only assume is IDE.