SATA (Linux)
Introduction
SATA, also known as Serial ATA (abbreviated from Serial AT Attachment) is a bus that enables the connection of mass storage devices to the system, such as hard disk drives and solid-state drives. It is available in the Apalis family of Computer on Modules.
See the list of Toradex Computer on Modules that provide the SATA interface. Please check the module datasheet for detailed information:
Toradex SoM | SATA Compatible | Additional Information |
---|---|---|
Apalis iMX8 | Yes | Single Gen 3 SATA link - maximum transfer rate 6Gb/s - backward compatible with Gen 2 and Gen 1 |
Apalis iMX6 | Yes | Single Gen 2 SATA link - maximum transfer rate 3Gb/s - backward compatible with Gen 1 |
Apalis TK1 | Yes | Single Gen 2 SATA link - maximum transfer rate 3Gb/s - backward compatible with Gen 1 |
Apalis T30 | Yes | Single Gen 2 SATA link - maximum transfer rate 3Gb/s |
See the list of Toradex Carrier Boards and the exposed SATA connections. Check the carrier board datasheet and design resources for detailed information:
Toradex Carrier Board | SATA Connectors |
---|---|
Apalis Evaluation Board | mSATA or SATA connector (mutually exlusive) and SATA power connector |
Ixora Carrier Board | mSATA connector |
SATA is a high speed interface that needs special layout requirements to be followed. Please carefully study the Apalis Carrier Board Design Guide for more information.
Test Setup
The following configuration was used:
- Carrier Board: Ixora Carrier Board.
- Linux Image: Embedded Linux BSP 2.8b3 - check Toradex Embedded Linux BSP Support Startegy for more information.
- mSATA device: Phison eSATA 20GB Solid State Drive SSE020GTTC0-S53 (generic OEM mSATA SSD).
- mSATA formatted with a single EXT4 partition filling all device size.
Kernel Boot Messages
Apalis iMX6
[ 1.699472] ahci-imx 2200000.sata: fsl,transmit-level-mV not specified, using 00000024
[ 1.707570] ahci-imx 2200000.sata: fsl,transmit-boost-mdB not specified, using 00000480
[ 1.715742] ahci-imx 2200000.sata: fsl,transmit-atten-16ths not specified, using 00002000
[ 1.724076] ahci-imx 2200000.sata: fsl,receive-eq-mdB not specified, using 05000000
[ 1.735639] ahci-imx 2200000.sata: SSS flag set, parallel bus scan disabled
[ 1.742787] ahci-imx 2200000.sata: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[ 1.751729] ahci-imx 2200000.sata: flags: ncq sntf stag pm led clo only pmp pio slum part ccc apst
[ 1.765882] ata1: SATA max UDMA/133 mmio [mem 0x02200000-0x02203fff] port 0x100 irq 89
[ 2.272645] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 2.290021] ata1.00: ATA-8: SATA SSD, S5FAM018, max UDMA/100
[ 2.398435] ata1.00: 39091248 sectors, multi 16: LBA48 NCQ (depth 31/32)
[ 2.410711] ata1.00: configured for UDMA/100
[ 2.420541] scsi 0:0:0:0: Direct-Access ATA SATA SSD M018 PQ: 0 ANSI: 5
Apalis TK1
[ 4.790842] tegra-sata tegra-sata.0: version 1.0
[ 4.791525] tegra-sata tegra-sata.0: AHCI 0001.0301 32 slots 2 ports 3 Gbps 0x1 impl TEGRA-SATA mode
[ 4.805713] tegra-sata tegra-sata.0: flags: 64bit ncq sntf pm led pmp pio slum part sadm apst
[ 4.820381] scsi0 : tegra-sata
...
[ 4.831915] ata1: SATA max UDMA/133 irq 55
...
[ 5.302464] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[ 5.320359] ata1.00: ATA-8: SATA SSD, S5FAM018, max UDMA/100
[ 5.378240] ata1.00: 39091248 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[ 5.408994] ata1.00: configured for UDMA/100
[ 5.427849] scsi 0:0:0:0: Direct-Access ATA SATA SSD S5FA PQ: 0 ANSI: 5
Apalis T30
[ 4.589972] tegra-sata tegra-sata.0: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl TEGRA-SATA mode
[ 4.599387] tegra-sata tegra-sata.0: flags: 64bit ncq sntf pm led pio slum part apst
[ 4.608496] scsi0 : tegra-sata
[ 4.612050] ata1: SATA max UDMA/133 irq 55
...
[ 4.965401] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
...
[ 4.992911] ata1.00: ATA-8: KINGSTON SMS200S330G, 507KC4, max UDMA/133
Performance
The results in this section are provided as-is. Parameters such as BSP version, SSD model, system workload, and others may influence the final results.
Apalis iMX6
root@apalis-imx6:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 324 MB in 3.01 seconds = 107.58 MB/sec
Apalis TK1
Kernel based in NVIDIA's Linux for Tegra a.k.a L4T R21.7:
root@apalis-tk1:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 722 MB in 3.01 seconds = 240.26 MB/sec
Mainline based kernel:
root@apalis-tk1-mainline:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 810 MB in 3.01 seconds = 269.39 MB/sec
Apalis T30
root@apalis-t30:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 200 MB in 3.01 seconds = 66.34 MB/sec
Speed Limiting
The SATA 2 link can be forced to SATA 1 speeds by adding 'libata.force=1.5Gbps' to the kernel cmdline as follows (altering kernel boot arguments from within U-Boot):
setenv defargs $defargs libata.force=1.5Gbps
Which then looks as follows during boot:
Apalis iMX6
[ 1.701407] ahci-imx 2200000.sata: fsl,transmit-level-mV not specified, using 00000024
[ 1.709509] ahci-imx 2200000.sata: fsl,transmit-boost-mdB not specified, using 00000480
[ 1.717674] ahci-imx 2200000.sata: fsl,transmit-atten-16ths not specified, using 00002000
[ 1.726009] ahci-imx 2200000.sata: fsl,receive-eq-mdB not specified, using 05000000
[ 1.737662] ahci-imx 2200000.sata: SSS flag set, parallel bus scan disabled
[ 1.744807] ahci-imx 2200000.sata: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[ 1.753769] ahci-imx 2200000.sata: flags: ncq sntf stag pm led clo only pmp pio slum part ccc apst
[ 1.767898] ata1: FORCE: PHY spd limit set to 1.5Gbps
[ 1.773079] ata1: SATA max UDMA/133 mmio [mem 0x02200000-0x02203fff] port 0x100 irq 89
[ 2.272670] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 2.295037] ata1.00: ATA-8: SATA SSD, S5FAM018, max UDMA/100
[ 2.305573] ata1.00: 39091248 sectors, multi 16: LBA48 NCQ (depth 31/32)
[ 2.339413] ata1.00: configured for UDMA/100
[ 2.349063] scsi 0:0:0:0: Direct-Access ATA SATA SSD M018 PQ: 0 ANSI: 5
And performs as follows:
root@apalis-imx6:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: [ 84.741838] random: crng init done
304 MB in 3.02 seconds = 100.75 MB/sec
Apalis TK1
[ 1.827851] tegra-ahci 70027000.sata: couldn't get PHY in node sata: -517
[ 2.610933] tegra-ahci 70027000.sata: 70027000.sata supply target-5v not found, using dummy regulator
[ 2.620286] tegra-ahci 70027000.sata: 70027000.sata supply target-12v not found, using dummy regulator
[ 2.644998] tegra-ahci 70027000.sata: AHCI 0001.0301 32 slots 2 ports 3 Gbps 0x1 impl platform mode
[ 2.654094] tegra-ahci 70027000.sata: flags: 64bit ncq sntf pm led pio slum part sadm sds apst
[ 2.683902] ata1: FORCE: PHY spd limit set to 1.5Gbps
[ 2.688961] ata1: SATA max UDMA/133 mmio [mem 0x70027000-0x70028fff] port 0x100 irq 90
...
[ 3.033505] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 3.040313] ata1.00: ATA-8: SATA SSD, S5FAM018, max UDMA/100
[ 3.045984] ata1.00: 39091248 sectors, multi 16: LBA48 NCQ (depth 31/32)
[ 3.053737] ata1.00: configured for UDMA/100
[ 3.068606] scsi 0:0:0:0: Direct-Access ATA SATA SSD M018 PQ: 0 ANSI: 5
And performs as follows:
root@apalis-tk1-mainline:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 408 MB in 3.00 seconds = 135.94 MB/sec
Apalis T30
[ 4.843177] tegra-sata tegra-sata.0: version 1.0
[ 4.856087] tegra-sata tegra-sata.0: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl TEGRA-SATA mode
[ 4.870077] tegra-sata tegra-sata.0: flags: 64bit ncq sntf pm led pio slum part apst
[ 4.883881] scsi0 : tegra-sata
[ 4.889910] ata1: FORCE: PHY spd limit set to 1.5Gbps
[ 4.897456] ata1: SATA max UDMA/133 irq 55
[ 5.250139] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
[ 5.259265] ata1.00: ATA-8: SATA SSD, S5FAM018, max UDMA/100
[ 5.259287] ata1.00: 39091248 sectors, multi 16: LBA48 NCQ (depth 31/32), AA
[ 5.260274] ata1.00: configured for UDMA/100
[ 5.279770] scsi 0:0:0:0: Direct-Access ATA SATA SSD S5FA PQ: 0 ANSI: 5
And performs as follows:
root@apalis-t30:~# hdparm -t /dev/sda
/dev/sda:
Timing buffered disk reads: 160 MB in 3.00 seconds = 53.32 MB/sec