xref: /openbmc/linux/Documentation/ABI/testing/sysfs-ata (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
12e6a0323SMauro Carvalho ChehabWhat:		/sys/class/ata_*
2d9027470SGwendal GrignouDescription:
3b1c7fe26SAishwarya Pant		Provide a place in sysfs for storing the ATA topology of the
4b1c7fe26SAishwarya Pant		system. This allows retrieving various information about ATA
5b1c7fe26SAishwarya Pant		objects.
6d9027470SGwendal Grignou
7d9027470SGwendal GrignouFiles under /sys/class/ata_port
8d9027470SGwendal Grignou-------------------------------
9d9027470SGwendal Grignou
10b1c7fe26SAishwarya PantFor each port, a directory ataX is created where X is the ata_port_id of the
11b1c7fe26SAishwarya Pantport. The device parent is the ata host device.
12d9027470SGwendal Grignou
13d9027470SGwendal Grignou
14b1c7fe26SAishwarya PantWhat:		/sys/class/ata_port/ataX/nr_pmp_links
15b1c7fe26SAishwarya PantWhat:		/sys/class/ata_port/ataX/idle_irq
16b1c7fe26SAishwarya PantDate:		May, 2010
17b1c7fe26SAishwarya PantKernelVersion:	v2.6.37
18b1c7fe26SAishwarya PantContact:	Gwendal Grignou <gwendal@chromium.org>
19b1c7fe26SAishwarya PantDescription:
20b1c7fe26SAishwarya Pant		nr_pmp_links:	(RO) If a SATA Port Multiplier (PM) is
21b1c7fe26SAishwarya Pant				connected, the number of links behind it.
22d9027470SGwendal Grignou
23b1c7fe26SAishwarya Pant		idle_irq:	(RO) Number of IRQ received by the port while
24b1c7fe26SAishwarya Pant				idle [some ata HBA only].
25d9027470SGwendal Grignou
26b1c7fe26SAishwarya Pant
27b1c7fe26SAishwarya PantWhat:		/sys/class/ata_port/ataX/port_no
28b1c7fe26SAishwarya PantDate:		May, 2013
29b1c7fe26SAishwarya PantKernelVersion:	v3.11
30b1c7fe26SAishwarya PantContact:	Gwendal Grignou <gwendal@chromium.org>
31b1c7fe26SAishwarya PantDescription:
32b1c7fe26SAishwarya Pant		(RO) Host local port number. While registering host controller,
33b1c7fe26SAishwarya Pant		port numbers are tracked based upon number of ports available on
34b1c7fe26SAishwarya Pant		the controller. This attribute is needed by udev for composing
35b1c7fe26SAishwarya Pant		persistent links in /dev/disk/by-path.
36d9027470SGwendal Grignou
37d9027470SGwendal GrignouFiles under /sys/class/ata_link
38d9027470SGwendal Grignou-------------------------------
39d9027470SGwendal Grignou
40b1c7fe26SAishwarya PantBehind each port, there is a ata_link. If there is a SATA PM in the topology, 15
41b1c7fe26SAishwarya Pantata_link objects are created.
42d9027470SGwendal Grignou
43b1c7fe26SAishwarya PantIf a link is behind a port, the directory name is linkX, where X is ata_port_id
44b1c7fe26SAishwarya Pantof the port. If a link is behind a PM, its name is linkX.Y where X is
45b1c7fe26SAishwarya Pantata_port_id of the parent port and Y the PM port.
46d9027470SGwendal Grignou
47d9027470SGwendal Grignou
48b1c7fe26SAishwarya PantWhat:		/sys/class/ata_link/linkX[.Y]/hw_sata_spd_limit
49b1c7fe26SAishwarya PantWhat:		/sys/class/ata_link/linkX[.Y]/sata_spd_limit
50b1c7fe26SAishwarya PantWhat:		/sys/class/ata_link/linkX[.Y]/sata_spd
51b1c7fe26SAishwarya PantDate:		May, 2010
52b1c7fe26SAishwarya PantKernelVersion:	v2.6.37
53b1c7fe26SAishwarya PantContact:	Gwendal Grignou <gwendal@chromium.org>
54b1c7fe26SAishwarya PantDescription:
55b1c7fe26SAishwarya Pant		hw_sata_spd_limit:	(RO) Maximum speed supported by the
56b1c7fe26SAishwarya Pant					connected SATA device.
57d9027470SGwendal Grignou
58b1c7fe26SAishwarya Pant		sata_spd_limit:		(RO) Maximum speed imposed by libata.
59d9027470SGwendal Grignou
60b1c7fe26SAishwarya Pant		sata_spd:		(RO) Current speed of the link
61b1c7fe26SAishwarya Pant					eg. 1.5, 3 Gbps etc.
62d9027470SGwendal Grignou
63d9027470SGwendal Grignou
64d9027470SGwendal GrignouFiles under /sys/class/ata_device
65d9027470SGwendal Grignou---------------------------------
66d9027470SGwendal Grignou
67b1c7fe26SAishwarya PantBehind each link, up to two ata devices are created.
68d9027470SGwendal GrignouThe name of the directory is devX[.Y].Z where:
69d9027470SGwendal Grignou- X is ata_port_id of the port where the device is connected,
70d9027470SGwendal Grignou- Y the port of the PM if any, and
71b1c7fe26SAishwarya Pant- Z the device id: for PATA, there is usually 2 devices [0,1], only 1 for SATA.
72d9027470SGwendal Grignou
73d9027470SGwendal Grignou
74b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/spdn_cnt
75b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/gscr
76b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/ering
77b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/id
78b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/pio_mode
79b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/xfer_mode
80b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/dma_mode
81b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/class
82b1c7fe26SAishwarya PantDate:		May, 2010
83b1c7fe26SAishwarya PantKernelVersion:	v2.6.37
84b1c7fe26SAishwarya PantContact:	Gwendal Grignou <gwendal@chromium.org>
85b1c7fe26SAishwarya PantDescription:
86b1c7fe26SAishwarya Pant		spdn_cnt:	(RO) Number of times libata decided to lower the
87b1c7fe26SAishwarya Pant				speed of link due to errors.
88d9027470SGwendal Grignou
89b1c7fe26SAishwarya Pant		gscr:		(RO) Cached result of the dump of PM GSCR
90b1c7fe26SAishwarya Pant				register. Valid registers are:
91d9027470SGwendal Grignou
92d9027470SGwendal Grignou				0:      SATA_PMP_GSCR_PROD_ID,
93d9027470SGwendal Grignou				1:	SATA_PMP_GSCR_REV,
94d9027470SGwendal Grignou				2:      SATA_PMP_GSCR_PORT_INFO,
95d9027470SGwendal Grignou				32:     SATA_PMP_GSCR_ERROR,
96d9027470SGwendal Grignou				33:     SATA_PMP_GSCR_ERROR_EN,
97d9027470SGwendal Grignou				64:     SATA_PMP_GSCR_FEAT,
98d9027470SGwendal Grignou				96:     SATA_PMP_GSCR_FEAT_EN,
99d9027470SGwendal Grignou				130:    SATA_PMP_GSCR_SII_GPIO
100b1c7fe26SAishwarya Pant
101d9027470SGwendal Grignou				Only valid if the device is a PM.
102d9027470SGwendal Grignou
103b1c7fe26SAishwarya Pant		ering:		(RO) Formatted output of the error ring of the
104b1c7fe26SAishwarya Pant				device.
105f3030741SMartin K. Petersen
106b1c7fe26SAishwarya Pant		id:		(RO) Cached result of IDENTIFY command, as
107b1c7fe26SAishwarya Pant				described in ATA8 7.16 and 7.17. Only valid if
108b1c7fe26SAishwarya Pant				the device is not a PM.
109b1c7fe26SAishwarya Pant
110*72aad489SSergey Shtylyov		pio_mode:	(RO) PIO transfer mode used by the device.
111*72aad489SSergey Shtylyov				Mostly used by PATA devices.
112b1c7fe26SAishwarya Pant
113*72aad489SSergey Shtylyov		xfer_mode:	(RO) Current transfer mode. Mostly used by
114*72aad489SSergey Shtylyov				PATA devices.
115b1c7fe26SAishwarya Pant
116*72aad489SSergey Shtylyov		dma_mode:	(RO) DMA transfer mode used by the device.
117*72aad489SSergey Shtylyov				Mostly used by PATA devices.
118b1c7fe26SAishwarya Pant
119b1c7fe26SAishwarya Pant		class:		(RO) Device class. Can be "ata" for disk,
120b1c7fe26SAishwarya Pant				"atapi" for packet device, "pmp" for PM, or
121b1c7fe26SAishwarya Pant				"none" if no device was found behind the link.
122b1c7fe26SAishwarya Pant
123b1c7fe26SAishwarya Pant
124b1c7fe26SAishwarya PantWhat:		/sys/class/ata_device/devX[.Y].Z/trim
125b1c7fe26SAishwarya PantDate:		May, 2015
126b1c7fe26SAishwarya PantKernelVersion:	v4.10
127b1c7fe26SAishwarya PantContact:	Gwendal Grignou <gwendal@chromium.org>
128b1c7fe26SAishwarya PantDescription:
129b1c7fe26SAishwarya Pant		(RO) Shows the DSM TRIM mode currently used by the device. Valid
130f3030741SMartin K. Petersen		values are:
131b1c7fe26SAishwarya Pant
132f3030741SMartin K. Petersen		unsupported:		Drive does not support DSM TRIM
133b1c7fe26SAishwarya Pant
134f3030741SMartin K. Petersen		unqueued:               Drive supports unqueued DSM TRIM only
135b1c7fe26SAishwarya Pant
136f3030741SMartin K. Petersen		queued:                 Drive supports queued DSM TRIM
137b1c7fe26SAishwarya Pant
138b1c7fe26SAishwarya Pant		forced_unqueued:	Drive's queued DSM support is known to
139b1c7fe26SAishwarya Pant					be buggy and only unqueued TRIM commands
140f3030741SMartin K. Petersen					are sent
141