diff options
author | Patrick Oppenlander <patrick.oppenlander@gmail.com> | 2020-04-02 09:14:53 +1100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2021-03-30 15:05:57 +0200 |
commit | 5b3e56f70855e1dde1aaec312014423e0d8069bc (patch) | |
tree | 6e2bd1c157b86ecea1d66d4a9cd1e13dd4c30adb | |
parent | 271bdfc6f288309dc0d6216bfb7eccb44a84593b (diff) | |
download | mmc-utils-5b3e56f70855e1dde1aaec312014423e0d8069bc.tar.gz |
mmc-utils: Fix scaling of cache size
JESD84-B51 7.4.30 CACHE_SIZE [252:249] states that "the size is
indicated as multiple of kilobits". This is also supported by Table 39,
"e.MMC internal sizes and related Units / Granularities" which lists
"32Kb (=4KB)" as the cache size granularity for 4KiB native devices.
Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20200401221453.267360-1-patrick.oppenlander@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | mmc_cmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1419,8 +1419,8 @@ int do_read_extcsd(int nargs, char **argv) printf("Power off notification [POWER_OFF_LONG_TIME: 0x%02x]\n", ext_csd[247]); printf("Cache Size [CACHE_SIZE] is %d KiB\n", - ext_csd[249] << 0 | (ext_csd[250] << 8) | - (ext_csd[251] << 16) | (ext_csd[252] << 24)); + (ext_csd[249] << 0 | (ext_csd[250] << 8) | + (ext_csd[251] << 16) | (ext_csd[252] << 24)) / 8); } /* A441: Reserved [501:247] |