[msm_shared/mmc]: Add write protection for eMMC partitions.

Enable write protection for eMMC partitions based on the write group
protection availability in the card.

Write group protection availablity is checked by reading CSD.
If it is available, then write protect group size is calculated from
EXT_CSD or CSD based on ERASE_GROUP_DEF.

SET_WRITE_PROT is sent for the number of write protect groups to be
protected. For e.g. if 10MB is to be protected from a starting sector
and if write protect group size is 4MB, then 3 groups of 4MB i.e. 12MB
from the starting sector will be write protected.

For clearing user power-on write protect, CLEAR_WRITE_PROT is sent and
it is similar to SET_WRITE_PROT.Note that the sector to be write and
the size should be specified in sectors.

Change-Id: Ic1e6809d17c2733666140ae793b38bf8d0815664
2 files changed