You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

  1. From 8121cece25da8dad1dc91393f5285195997c71b1 Mon Sep 17 00:00:00 2001
  2. From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
  3. Date: Fri, 14 Feb 2020 09:13:32 +1100
  4. Subject: [PATCH] mmc-utils: Fix scaling of cache size
  5. JESD84-B51 7.4.30 CACHE_SIZE [252:249] states that "the size is
  6. indicated as multiple of kilobits". This is also supported by Table 39,
  7. "e.MMC internal sizes and related Units / Granularities" which lists
  8. "32Kb (=4KB)" as the cache size granularity for 4KiB native devices.
  9. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com>
  10. Reviewed-by: Avri Altman <avri.altman@wdc.com>
  11. ---
  12. mmc_cmds.c | 4 ++--
  13. 1 file changed, 2 insertions(+), 2 deletions(-)
  14. diff --git a/mmc_cmds.c b/mmc_cmds.c
  15. index c006ef2..556c105 100644
  16. --- a/mmc_cmds.c
  17. +++ b/mmc_cmds.c
  18. @@ -1427,8 +1427,8 @@ int do_read_extcsd(int nargs, char **argv)
  19. printf("Power off notification [POWER_OFF_LONG_TIME: 0x%02x]\n",
  20. ext_csd[247]);
  21. printf("Cache Size [CACHE_SIZE] is %d KiB\n",
  22. - ext_csd[249] << 0 | (ext_csd[250] << 8) |
  23. - (ext_csd[251] << 16) | (ext_csd[252] << 24));
  24. + (ext_csd[249] << 0 | (ext_csd[250] << 8) |
  25. + (ext_csd[251] << 16) | (ext_csd[252] << 24)) / 8);
  26. }
  27. /* A441: Reserved [501:247]
  28. --
  29. 2.17.1