mmc-utils: adding support for Android compilation

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Add method for triggering Sanitize command

This patch adds a method to trigger Sanitize command to MMC.
The Sanitize command is used for deleting the unmapped memory region
of the MMC device.

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Acked-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
mmc-utils: small fixes of output

Improve "extcsd read" output of the registers.
Right-shift by 3 of EXT_CSD_BOOT_CFG_EN bits.
Expand the EXT_CSD_BOOT_CFG_ACC bit mask to 0x7.
Add case 3 RPMB partition.

Signed-off-by: Mario Schuknecht <mario.schuknecht@dresearch-fe.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
mmc-utils: Remove dependency on linux/major.h.

We require only MMC_BLOCK_MAJOR which is constant.

Signed-off-by: Oleg Matcovschi <olegm@lab126.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
mmc-utils: Correctly handle CARD_TYPE.

Analysis was based on value of EXT_CSD_BOOT_INFO, not CARD_TYPE.
CARD_TYPE should be handled using bitmask, not values.

Signed-off-by: Oleg Matcovschi <olegm@lab126.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
allow environment and command-line supplied make vars

Most useful when cross-compiling.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
extract definitions for EXT_CSD register EXT_CSD_PARTITIONING_SUPPORT

Signed-off-by: Chris Ball <cjb@laptop.org>
extract definitions for PARTITION_SETTING_COMPLETED and pretty-print

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
Support SEND_STATUS command

mmc status get </path/to/mmcblkX>

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
fix printing ENH_START_ADDR

The enhanced user area start field is 4 bytes long
according to the eMMC 4.41 spec.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
report if card is block-addressed and effect on ENH_START_ADDR

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
print KiB sizes for some fields

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
support setting the OTP enhanced user area parameters

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>