]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_mmc.c
arm: start.S: Fix _TEXT_BASE for SPL
[karo-tx-uboot.git] / common / cmd_mmc.c
index 7dacd5114ce1416bf1cb5c9af5589cd62530becd..8c53a10315ecec188d75d87c15b67a1971e59aa7 100644 (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,