NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux

Developer Guide
5.1.0.2 Release


 
mNAND Health and Status Utility
 
Building
mNAND_hs Commands
Syntax
Options
Device Paths
Example Log
The mNAND Health and Status utility (mnand_hs) prints the health and status of onboard mNAND (eMMC and UFS).
Additionally, the tool provides details for the Hynix, Samsung and Toshiba eMMC parts and Samsung UFS parts.
Note:
Some options are vendor specific. Consequently, some options are valid for Hynix while other eMMC devices report errors. For example, mnand_hs -ah displays age per block for Hynix. However, for a Samsung device or Toshiba device that same option reports a “block data not available” error.
Building
The SDK comes with the source code for the utility and a Makefile.
To build mNAND_hs
1. In a terminal window, navigate to the directory containing the script:
cd <top>/drive-t186ref-linux/samples/tools/mnand_hs
2. Enter the following commands:
make clean
make
To run mNAND_hs
1. Follow the instructions in the Building and Running Samples topic to set up the target to run the mnand_hs utility.
2. On the target, run mnand_hs by entering:
cd /root/samples/tools/mnand_hs
./mnand_hs -d <path> [options]
Where <path> is the enumeration of the mNAND device you want to check.
For information about the supported options, see Options in this topic.
mNAND_hs Commands
This section describes the supported mNAND_hs commands.
Syntax
./mnand_hs -d <path_to_mnand_device> [options]
Options
mNAND_hs supports the following options:
Options
Description
Supported Devices
-d <path>
(Required) Specifies the mNAND device path. For information on supported paths, see Device Paths in this section.
eMMC and UFS
-h
Shows usage.
eMMC and UFS
-b
Includes in the displayed results the bad block table.
eMMC
-ah
Includes the age per block, hex mode.
eMMC
-ac
Includes the age per block. The data is decimal mode and comma-separated.
eMMC
-at
Includes age totals that are calculated by the app.
eMMC
-as
Includes age summary that are calculated by the part.
eMMC and UFS
-s
Includes a spare block summary.
eMMC and UFS
-st
Includes the card status.
eMMC
-ext
Includes the ext_csd register data (raw).
eMMC
-csd
Includes the csd register data (raw).
eMMC
-cid
Includes the cid register data (raw).
eMMC
-da
Includes data area information.
eMMC and UFS
-eol
Includes EOL status.
eMMC and UFS
-rp
Includes reported or estimated refresh progress if it is available.
eMMC
-bkops
Includes the BKOPS_EN status.
eMMC and UFS
-bsts
Includes the BKOPS_STATUS data.
eMMC and UFS
-bsta
Executes BKOPS_START.
eMMC
-bkops_set <0/1>
Set/Clear BKOPS_EN.
eMMC and UFS
-ponen
Enables POWER_OFF notification.
eMMC
-ponsta
Sends POWER_OFF notification.
eMMC and UFS
-cache_en <0/1/2>
Enables mNAND cache.
eMMC and UFS
-cache_flush <0/1/2>
Flushes mNAND cache.
eMMC and UFS
-flag_rd <flag_idn>
Read UFS Flag.
UFS
-flag_wr <flag_idn> <flag_val>
Write UFS Flag.
UFS
-attr_rd <attr_idn>
Read UFS Attribute.
UFS
-attr_wr <attr_idn> <attr_val>
Write UFS Attribute.
UFS
-desc_rd <desc_idn>
Read UFS descriptor.
UFS
-t
Trims the device.
eMMC
-r <count>
Refreshes the <count> blocks.
eMMC
 
Note:
Since per block information is not provided by the Toshiba emmc device, the -b, -ah, -ac, and -at options that depend on per block information give a “Block data not available.” output message.
Device Paths
This topic describes supported device paths for mnand_hs commands.
 
eMMC:
./mnand_hs -d /dev/mmcblk<id> -at
Where <id> is (by default):
0 for eMMC on SDMMC4 controller of Tegra.
1 for eMMC on other SDMMC controllers (assuming only two SDMMC devices are connected in the system).
UFS:
./mnand_hs -d /dev/sd<device number> -as
Where <device number> can be a-z based on the order of the SCSI device enumeration. If no other SCSI device is in the system, UFS will be enumerated in /dev/sda.
Example Log
Following is the log of a sample run for eMMC:
# ./mnand_hs -d /dev/mmcblk0 -at
 
mNAND Health and Status Info
 
mNAND identified: "Hynix F20 (MID=0x90, PRV=0x03)"
MLC Age Totals:
Total number of blocks (9~4180): 4172
Total p/e cycles: 56222
Number of usable blocks: 4170
Number of usable blocks: 4169 (only blocks with age > 0)
Avg p/e cycles: 13.482494
SLC Age Totals:
Total number of blocks (8~8): 1
Total p/e cycles: 13
Number of usable blocks: 1
Number of usable blocks: 1 (only blocks with age > 0)
Avg p/e cycles: 13.000000
 
Following is the log of a sample run for UFS:
#./mnand_hs -d /dev/sda -as

mNAND Health and Status Info
UFS identified: "  SAMSUNG PID: KLUEGAJ1ZD-B0CP  PRL: 5200 "
MLC Minimum erase count: 1
MLC Maximum erase count: 2
MLC Average erase count: 1.970
SLC Minimum erase count: 0
SLC Maximum erase count: 7
SLC Average erase count: 2.280