mNAND Health and Status Utility
The mNAND Health and Status utility (mnand_hs) prints the health and status of onboard mNAND.
Additionally, the tool provides details for the Hynix, Samsung and Toshiba eMMC 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
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 mmc 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 |
-d <path> | (Required) Specifies the eMMC device path. For information on supported paths, see Device Paths in this section. |
-h | Shows usage. |
-b | Includes in the displayed results the bad block table. |
-ah | Includes the age per block, hex mode. |
-ac | Includes the age per block. The data is decimal mode and comma-separated. |
-at | Includes age totals that are calculated by the app. |
-as | Includes age summary that are calculated by the part. |
-s | Includes a spare block summary. |
-st | Includes the card status. |
-ext | Includes the ext_csd register data (raw). |
-csd | Includes the csd register data (raw). |
-cid | Includes the cid register data (raw). |
-da | Includes data area information. |
-eol | Includes EOL status. |
-rp | Includes reported or estimated refresh progress if it is available. |
-bkops | Includes the BKOPS_EN status. |
-bsts | Includes the BKOPS_STATUS data. |
-bsta | Executes BKOPS_START. |
-ponen | Enables POWER_OFF notification. |
-ponsta | Sends POWER_OFF notification. |
-cache_en | Enables mNAND cache. |
-cache_flush | Flushes mNAND cache. |
-t | Trims the device. |
-r <count> | Refreshes the <count> blocks. |
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.
./mnand_hs -d /dev/disk/by-path/platform-sdhci-tegra.<ver> -at
Where <ver> is:
• 1 for eMMC on the baseboard.
• 3 for eMMC on the VCM.
Alternate usage:
./mnand_hs -d /dev/mmcblk<id> -at
Where <id> is (by default):
• 1 for eMMC on the baseboard.
• 0 for eMMC on the VCM.
Example Log
Following is the log of a sample run.
# ./mnand_hs -d /dev/disk/by-path/platform-sdhci-tegra.<ver> -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