Coder Social home page Coder Social logo

evilsupau / ufs-utils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from westerndigitalcorporation/ufs-utils

0.0 0.0 0.0 224 KB

The UFS Tool project have been created to allow access UFS device from user space, and perform basic set of UFS operations: Read and write UFS device configuration (flags, attributes, descriptors), FFU, etc... The set of UFS Tool features is co-existing and updated beside BSG and SG infrastructure in Linux Kernel.

License: GNU General Public License v2.0

C 99.54% Makefile 0.46%

ufs-utils's Introduction

UFS Tool

Description:

a) Read/Write device flags, attributes & descriptors by using the BSG infrastructure in linux kernel (applied to 5.1 rc1)
b) Get/Set UNIPRO attributes
c) HMR - Host Manual Refresh functionality
The following options may work with the SCSI BSG device
using sg v4 structure (e.g. /dev/0:0:0:0)
or via a SCSI Generic interface using sg v3 struct (e.g. /dev/block/sda)
d) Error History
e) FFU - Field Firmware Update
f) Send Vendor commands based on SCSI WRITE/READ Buffer commands
g) RPMB functionality

The tool is aligned to the UFS 3.1 spec.

Build:

Set CROSS_COMPILE variable(e.g.):

export CROSS_COMPILE=/XXX/aarch64-linux-gnu-

Build:

"make"

Clean:

"make clean"

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-utils --help
Output: ufs-utils help|--help|-h Show the help.

    ufs-utils -v
            Show the version.

    ufs-utils <desc | attr | fl | err_hist | uic | ffu | vendor | rpmb | hmr | arpmb> --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-utils fl --help
Output: Flags command usage:

    ufs-utils 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-utils fl -t 4 -p /dev/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-only
See COPYING to see the full text.

ufs-utils's People

Contributors

arthur-simchaev-wdc avatar beanhuo avatar kraj avatar alandtse avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.