How can I tell which SATA Revision my Laptop Motherboard Supports?

2

I am planning on installing an SSD in my Acer Aspire E5-511 C7X7 (https://www.acer.com/ac/en/GB/content/model/NX.MPKEK.022) by replacing the 9.5mm optical drive with a hard drive caddy but I am unsure if it will be worth the money since I do not know if the motherboard supports SATA I, II, or III. How can I check this?

I am running Kubuntu 16.10 and hardinfo tells me that my primary HDD that was stock included in the laptop is the Western Digital ATA WDC WD10JPVX-22J 1TB HDD. The HDD itself is specified to have the SATA 6 Gb/s interface, from which I understand to be SATA III.

dmesg in the console tells me that my two SATA controllers link up to 1.5Gbps and 3.0Gbps. I assume the first is my optical drive and the second is my HDD. This is leading me to believe that my HDD is SATA II and my optical drive is SATA I. Is this information correct?

I would assume that Acer wouldn't ship a SATA III HDD on a laptop whose motherboard supports anything less than that. Am I safe on this assumption? And is it possible that my HDD and optical drive use a different SATA interface? I assume they use the same one and I hope it is SATA III compatible, but again, I want to be sure.

Tristan Batchler

Posted 2017-01-10T07:21:25.520

Reputation: 123

What's the chipset? That determines what SATA ports are available. Then it's a matter of which ports the motherboard manufacturer brought to the hard disk bay and optical bay.... some chipsets had exactly one SATA-III port and therefore the optical bay got a slower one. – Ben Voigt – 2017-01-10T07:45:12.673

@BenVoigt I have the Intel® Celeron® Processor N2940 (2M Cache, up to 2.25 GHz) http://ark.intel.com/products/82104/Intel-Celeron-Processor-N2940-2M-Cache-up-to-2_25-GHz , which from what I can tell in the link, has 2 SATA ports. It doesn't say anything about what version they are though.

– Tristan Batchler – 2017-01-10T09:20:24.940

Answers

0

Assuming you have a standard AHCI controller, you can look up the maximum supported speed in a configuration register. It's possible this value is visible somewhere is /sys or /proc, but if this is the case, I'm not aware of it.

This involves fiddling with the I/O space of devices, so be careful to not make a mistake, or you can damage stuff.

Here's how it works for my system:

1) Find your AHCI controller using lspci:

$ lspci
...
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05)

2) Look at the resources, verify it's used by the ahci kernel module:

$ lspci -vk -s 0:1f.2
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller (rev 05) (prog-if 01 [AHCI 1.0])
    Subsystem: ASRock Incorporation 6 Series/C200 Series Chipset Family SATA AHCI Controller
    Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 26
    I/O ports at f0b0 [size=8]
    I/O ports at f0a0 [size=4]
    I/O ports at f090 [size=8]
    I/O ports at f080 [size=4]
    I/O ports at f060 [size=32]
    Memory at f7e06000 (32-bit, non-prefetchable) [size=2K]
    Capabilities: <access denied>
    Kernel driver in use: ahci
    Kernel modules: ahci

3) The PCI BAR regions can now be found in /sys/devices/pci0000:00/0000:00:1f.2/resource* (where you need to replace 0:1f.2 with the address of your controller). My card has 5 regions for I/O ports (number 0-4), and the memory mapped region is number 5. This is the one we need.

4) Download and compile some tool to mmap and read the region, e.g. this one.

5) Read out the first 4-byte word at offset 0 with the tool you have just downloaded (again, replace the PCI address and resource with the ones on your system). You need to be root to do this. Here's the place where funny stuff can happen if you make a mistake, so be sure you didn't make one.

$ sudo ./pcimem /sys/devices/pci0000\:00//0000\:00\:1f.2/resource5  0 w
Target offset is 0x0, page size is 4096
mmap(0, 4096, 0x3, 0x1, 3, 0x0)
PCI Memory mapped to address 0xb778e000.
Value at offset 0x0 (0xb778e000): 0xC330FF45
                                      ^

6) As described in the AHCI specification by Intel, bits 23-20 are called Interface Speed Support and indicate the maximum speed (1 = Gen 1/1.5 Gbps, 2= Gen/3 Gbps, 3 = Gen 3/6 Gbps). These bits are represented by the third hex-digit marked above, in my case 3, so my controller supports 6 Gbps.

dirkt

Posted 2017-01-10T07:21:25.520

Reputation: 11 627

1Thanks for the incredibly detailed reply! This worked like a charm. Turns out my controllers support 6 Gbps! Fantastic news for me! – Tristan Batchler – 2017-01-10T12:38:01.177