diff --git a/sys/dev/mmc/mmcsd.c b/sys/dev/mmc/mmcsd.c --- a/sys/dev/mmc/mmcsd.c +++ b/sys/dev/mmc/mmcsd.c @@ -232,6 +232,7 @@ off_t erase_size, sector_size, size, wp_size; uintmax_t bytes; int err, i; + int ignore_part = 0; uint32_t quirks; uint8_t rev; bool comp, ro; @@ -321,6 +322,10 @@ } } + /* Partitions support might be disabled by user */ + resource_int_value(device_get_name(dev), device_get_unit(dev), + "ignore_part", &ignore_part); + /* * Ignore user-creatable enhanced user data area and general purpose * partitions partitions as long as partitioning hasn't been finished. @@ -341,7 +346,7 @@ size = ext_csd[EXT_CSD_ENH_SIZE_MULT] + (ext_csd[EXT_CSD_ENH_SIZE_MULT + 1] << 8) + (ext_csd[EXT_CSD_ENH_SIZE_MULT + 2] << 16); - if (rev >= 4 && comp == TRUE && size > 0 && + if (ignore_part == 0 && rev >= 4 && comp == TRUE && size > 0 && (ext_csd[EXT_CSD_PART_SUPPORT] & EXT_CSD_PART_SUPPORT_ENH_ATTR_EN) != 0 && (ext_csd[EXT_CSD_PART_ATTR] & (EXT_CSD_PART_ATTR_ENH_USR)) != 0) { @@ -367,7 +372,7 @@ mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_DEFAULT, "mmcsd", device_get_unit(dev), mmc_get_media_size(dev) * sector_size, ro); - if (mmc_get_spec_vers(dev) < 3) + if (mmc_get_spec_vers(dev) < 3 || ignore_part != 0) return (0); /* Belatedly announce enhanced user data slice. */