UPSTREAM: mmc-utils: Add ability to configure write protect on an eMMC device

Add commands to get and set write protect modes for the specified
areas of the user partition. The ability to set permanent write
protect is #ifdef'd with "DANGEROUS_COMMANDS_ENABLED" because
it has the ability to make the eMMC device and possibly the system
permanently unusable.

  mmc.c: Reorder command list.


Signed-off-by: Al Cooper <>
Signed-off-by: Chris Ball <>
(cherry picked from commit 0ca049f25191c32323ba25a3cfd542b9fdefb473)
Signed-off-by: Gwendal Grignou <>

Change-Id: I8119e279c2f0cea093c7ee65fbe29fb74382e83c
Commit-Ready: Gwendal Grignou <>
Tested-by: Gwendal Grignou <>
Reviewed-by: Julius Werner <>
4 files changed