Skip to content

Commit

Permalink
imsm: add print license for VMD
Browse files Browse the repository at this point in the history
Add print IMSM license for VMD controllers in --detail-platform.
The license specifies the scope of RAID support in the platform for
the VMD controller.

Signed-off-by: Blazej Kucman <[email protected]>
  • Loading branch information
bkucman authored and mtkaczyk committed Nov 8, 2024
1 parent 0d28a5d commit f70e08b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
5 changes: 5 additions & 0 deletions platform-intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ struct imsm_orom {
#define IMSM_OROM_CAPABILITIES_ReadPatrol (1 << 6)
#define IMSM_OROM_CAPABILITIES_XorHw (1 << 7)
#define IMSM_OROM_CAPABILITIES_SKUMode ((1 << 8)|(1 << 9))
#define IMSM_OROM_CAPABILITIES_SKUMode_LOW ((1 << 8) | (1 << 9))
#define IMSM_OROM_CAPABILITIES_SKUMode_LOW_SHIFT 8
#define IMSM_OROM_CAPABILITIES_TPV (1 << 10)
#define IMSM_OROM_CAPABILITIES_SKUMode_HIGH ((1 << 11) | (1 << 12))
#define IMSM_OROM_CAPABILITIES_SKUMode_HIGH_SHIFT 9
#define IMSM_OROM_CAPABILITIES_SKUMode_NON_PRODUCTION (1 << 13)
} __attribute__((packed));

/* IMSM metadata requirements for each level */
Expand Down
47 changes: 47 additions & 0 deletions super-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,14 @@ struct imsm_update_rwh_policy {
int dev_idx;
};

enum imsm_sku {
SKU_NO_KEY = 0,
SKU_STANDARD_KEY = 1,
SKU_PREMIUM_KEY = 2,
SKU_INTEL_SSD_ONLY_KEY = 3,
SKU_RAID1_ONLY_KEY = 4
};

static const char *_sys_dev_type[] = {
[SYS_DEV_UNKNOWN] = "Unknown",
[SYS_DEV_SAS] = "SAS",
Expand Down Expand Up @@ -2658,6 +2666,39 @@ static void print_imsm_level_capability(const struct imsm_orom *orom)
printf("%s ", imsm_level_ops[idx].name);
}

static void print_imsm_sku_capability(const struct imsm_orom *orom)
{
int key_val;

key_val = (orom->driver_features & IMSM_OROM_CAPABILITIES_SKUMode_LOW) >>
IMSM_OROM_CAPABILITIES_SKUMode_LOW_SHIFT;
key_val |= (orom->driver_features & IMSM_OROM_CAPABILITIES_SKUMode_HIGH) >>
IMSM_OROM_CAPABILITIES_SKUMode_HIGH_SHIFT;

switch (key_val) {
case SKU_NO_KEY:
printf("Pass-through");
break;
case SKU_STANDARD_KEY:
printf("Standard");
break;
case SKU_PREMIUM_KEY:
printf("Premium");
break;
case SKU_INTEL_SSD_ONLY_KEY:
printf("Intel-SSD-only");
break;
case SKU_RAID1_ONLY_KEY:
printf("RAID1 Only");
break;
default:
printf("Unknown");
}

if (orom->driver_features & IMSM_OROM_CAPABILITIES_SKUMode_NON_PRODUCTION)
printf(" - for evaluation only");
}

static void print_imsm_chunk_size_capability(const struct imsm_orom *orom)
{
int idx;
Expand Down Expand Up @@ -2690,6 +2731,12 @@ static void print_imsm_capability(const struct orom_entry *entry)
orom->hotfix_ver, orom->build);
}

if (entry->type == SYS_DEV_VMD) {
printf(" License : ");
print_imsm_sku_capability(orom);
printf("\n");
}

printf(" RAID Levels : ");
print_imsm_level_capability(orom);
printf("\n");
Expand Down

0 comments on commit f70e08b

Please sign in to comment.