1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-26 16:13:55 +01:00

mmc: add support for write protection

Add generic mmc write protection functionality.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
This commit is contained in:
Nikita Kiryanov
2012-12-03 02:19:46 +00:00
committed by Tom Rini
parent 5c1214de8c
commit d23d8d7e06
16 changed files with 39 additions and 0 deletions

View File

@@ -282,6 +282,13 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
mmc_init(mmc);
if ((state == MMC_WRITE || state == MMC_ERASE)) {
if (mmc_getwp(mmc) == 1) {
printf("Error: card is write protected!\n");
return 1;
}
}
switch (state) {
case MMC_READ:
n = mmc->block_dev.block_read(curr_device, blk,