mmc: extend mmcinfo output to show partition write reliability settings
authorDiego Santa Cruz <Diego.SantaCruz@spinetix.com>
Tue, 23 Dec 2014 09:50:33 +0000 (10:50 +0100)
committerPantelis Antoniou <pantelis.antoniou@konsulko.com>
Mon, 19 Jan 2015 15:41:51 +0000 (17:41 +0200)
This extends the mmcinfo hardware partition info output to show
partitions with write reliability enabled with the "WRREL" string.
If the partition does not have write reliability enabled the "WRREL"
string is omitted; this is analogous to the ehhanced attribute.

Example output:

Device: OMAP SD/MMC
Manufacturer ID: fe
OEM: 14e
Name: MMC16
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 13.8 GiB
Bus Width: 4-bit
Erase Group Size: 8 MiB
HC WP Group Size: 16 MiB
User Capacity: 13.8 GiB ENH WRREL
User Enhanced Start: 0 Bytes
User Enhanced Size: 512 MiB
Boot Capacity: 16 MiB ENH
RPMB Capacity: 128 KiB ENH
GP1 Capacity: 64 MiB ENH WRREL
GP2 Capacity: 64 MiB ENH WRREL

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
common/cmd_mmc.c
drivers/mmc/mmc.c
include/mmc.h

index 632ddae7a2f78fb9d2a07a9041b1f83d06286556..4e28c9d7a4d6541f0c1633ee494b77e476b5e776 100644 (file)
@@ -106,7 +106,11 @@ static void print_mmcinfo(struct mmc *mmc)
                print_size(((u64)mmc->hc_wp_grp_size) << 9, "\n");
 
                puts("User Capacity: ");
-               print_size(mmc->capacity_user, usr_enh ? " ENH\n" : "\n");
+               print_size(mmc->capacity_user, usr_enh ? " ENH" : "");
+               if (mmc->wr_rel_set & EXT_CSD_WR_DATA_REL_USR)
+                       puts(" WRREL\n");
+               else
+                       putc('\n');
                if (usr_enh) {
                        puts("User Enhanced Start: ");
                        print_size(mmc->enh_user_start, "\n");
@@ -124,7 +128,11 @@ static void print_mmcinfo(struct mmc *mmc)
                        if (mmc->capacity_gp[i]) {
                                printf("GP%i Capacity: ", i+1);
                                print_size(mmc->capacity_gp[i],
-                                          is_enh ? " ENH\n" : "\n");
+                                          is_enh ? " ENH" : "");
+                               if (mmc->wr_rel_set & EXT_CSD_WR_DATA_REL_GP(i))
+                                       puts(" WRREL\n");
+                               else
+                                       putc('\n');
                        }
                }
        }
index 6fa5435000ef5ee7631288b5f0cfd7fa1cfc819a..19ac4c482fa5d72504513f651f92aae73ccd88a3 100644 (file)
@@ -1306,6 +1306,8 @@ static int mmc_startup(struct mmc *mmc)
                mmc->hc_wp_grp_size = 1024
                        * ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]
                        * ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
+
+               mmc->wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET];
        }
 
        err = mmc_set_capacity(mmc, mmc->part_num);
index 8d41234e207599f269236f014dcff04e6d225946..09101e2c87a11cfa76c0412c92dd5e9b6eb5ab00 100644 (file)
@@ -318,6 +318,7 @@ struct mmc {
        ushort rca;
        u8 part_support;
        u8 part_attr;
+       u8 wr_rel_set;
        char part_config;
        char part_num;
        uint tran_speed;