forked from SanDisk-Open-Source/ufs-utils
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
81 lines (64 loc) · 2.76 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
UFS Tool ver 1.1
1) Description:
The tool include the following features:
a) Read/Write device flags, attributes & descriptors by
using the BSG infrastructure in linux kernel (applied to 5.1 rc1)
Due to the issues in UFS BSG driver, the following patch have to be
applied:
https://lore.kernel.org/patchwork/patch/1076796/
https://patchwork.kernel.org/patch/11011891/
b) Error History
The tool is aligned to the UFS 3.0 spec.
2) Build
Set CROSS_COMPILE variable(e.g.): export CROSS_COMPILE=/XXX/aarch64-linux-gnu-
Build the tool using "make"
Clean the tool using "make clean"
3) Usage
Copy the tool into a directory on the device (e.g. /data/local/tmp).
Run the tool without arguments or with -h/--help options in order to list the
supported features:
E.g.
Run: ./ufs-tool --help
Output:
Usage:
ufs-tool help|--help|-h
Show the help.
ufs-tool -v
Show the version.
ufs-tool <desc | attr | fl | err_hist> --help|-h
Show detailed help for a command
Run the tool's help for the ufs configuration features in order to get full information
related to the feature, all options and the examples.
E.g.: getting help for ufs flags
Run: ./ufs-tool fl --help
Output:
Flags command usage:
ufs-tool fl [-t] <flag idn> [-a|-r|-o|-e] [-p] <device_path>
-t Flags type idn
Available flags and its access, based on UFS ver 3.0 :
0 : Reserved
1 : fDeviceInit | Read | SetOnly
2 : fPermanentWPEn | Read | WriteOnce
3 : fPowerOnWPEn | Read | ResetOnPower
4 : fBackgroundOpsEn | Read | Volatile
5 : fDeviceLifeSpanModeEn | Read | Volatile
6 : fPurgeEnable | WriteOnly | Volatile
7 : fRefreshEnable | WriteOnly | Volatile
8 : fPhyResourceRemoval | Read | Persistent
9 : fBusyRTC | ReadOnly
10 : Reserved
11 : fPermanentlyDisableFw | Read | WriteOnce
-a read and print all readable flags for the device
-r read operation (default), for readable flag(s)
-e set flag operation
-c clear/reset flag operation
-o toggle flag operation
-p path to ufs bsg device
Example - Read the bkops operation flag
ufs-tool fl -t 4 -p /dev/block/ufs-bsg
Authors
signed-off-by:Arthur Simchaev ([email protected])
signed-off-by:Avri Altman ([email protected])
License
This project is licensed under the GPL-2.0-or-later
See COPYING to see the full text.