本文主要是介绍emmc 版本号查询 by ext_csd,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
我是在编译了3.0内核后发现eMMC卡怎么也初始化不了,老提示这个错误。但正常的SD卡确可以使用,经过一番研究,在结合网上查找的资料,终于将问题解决了。
在网上搜到的资料,说明了内核对eMMC4.5的支持方法:
- mmc: core: Detect eMMC v4.5 ext_csd entries
- Gitweb: http://git.kernel.org/linus/38ca285044be88a0fb47b6eb91deeeb729435fd0
- Commit: 38ca285044be88a0fb47b6eb91deeeb729435fd0
- Parent: d5a5bd1c3f7e8d010393530d60df8da75218a488
- Author: Kyungmin Park <kyungmin.park <at> samsung.com>
- AuthorDate: Tue Jul 26 17:12:37 2011 +0900
- Committer: Chris Ball <cjb <at> laptop.org>
- CommitDate: Sat Aug 13 14:50:22 2011 -0400
- mmc: core: Detect eMMC v4.5 ext_csd entries
- The eMMC v4.5 Spec is released now:
- EXT_CSD_REV Extended CSD Revision
- 255-7 Reserved
- 6 Revision 1.6 (for MMC v4.5)
- 5 Revision 1.5 (for MMV v4.41)
- ...
- Signed-off-by: Kyungmin Park <kyungmin.park <at> samsung.com>
- Signed-off-by: Chris Ball <cjb <at> laptop.org>
- ---
- drivers/mmc/core/mmc.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
- diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
- index aa7d1d7..5700b1c 100644
- --- a/drivers/mmc/core/mmc.c
- +++ b/drivers/mmc/core/mmc.c
- <at> <at> -259,7 +259,7 <at> <at> static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
- }
- card->ext_csd.rev = ext_csd[EXT_CSD_REV];
- - if (card->ext_csd.rev > 5) {
- + if (card->ext_csd.rev > 6) {
- printk(KERN_ERR "%s: unrecognised EXT_CSD revision %d\n",
- mmc_hostname(card->host), card->ext_csd.rev);
- err = -EINVAL;
- --
- To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
- the body of a message to majordomo <at> vger.kernel.org
- More majordomo info at http://vger.kernel.org/majordomo-info.html
最新的eMMC-v4.5对应的版本好为6,所以程序为报错,提示版本号6不支持。只要将版本号判断修改为6即可。
eMMC-v5.0协议对EXT_CSD_REV定义:
额外的一段资料
- mmc: core: Update the ext-csd.rev check for eMMC5.1 00/55800/5
- authorYuvaraj CD <yuvaraj.cd@gmail.com>
- Tue, 21 May 2013 17:38:43 +0800 (09:38 +0000)
- committerChromeBot <chrome-bot@google.com>
- Thu, 23 May 2013 08:57:28 +0800 (17:57 -0700)
- With the new eMMC5.1 spec,there is a new EXT_CSD register with
- the revision number(EXT_CSD_REV) 7.This patch updates the check
- for ext-csd.rev number as 7.
- This patch was picked from patchwork:
- http://patchwork.kernel.org/patch/2596591/
- BUG=chrome-os-partner:19007
- TEST=Boot kernel on SMDK5420. /wo this patch emmc gives error "mmc0:
- unrecognised EXT_CSD revision 7"
- /w this patch the above error is not seen.
- Change-Id: I08843976eeba6e63adc27c02365f71f8d4dc6fa0
- Signed-off-by: Alim Akhtar <alim.akthar@samsung.com>
- Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
- Signed-off-by: Doug Anderson <dianders@chromium.org>
- Reviewed-on: https://gerrit.chromium.org/gerrit/55800
- drivers/mmc/core/mmc.c
- patch | blob | blame | history
- diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
- index 089e8ea..66b996f 100644 (file)
- --- a/drivers/mmc/core/mmc.c
- +++ b/drivers/mmc/core/mmc.c
- @@ -292,7 +292,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
- }
- card->ext_csd.rev = ext_csd[EXT_CSD_REV];
- - if (card->ext_csd.rev > 6) {
- + if (card->ext_csd.rev > 7) {
- pr_err("%s: unrecognised EXT_CSD revision %d\n",
- mmc_hostname(card->host), card->ext_csd.rev);
- err = -EINVAL;
更是牛人,这个是在chromium.org网站有人提交的补丁,使chromiumos支持eMMC-v5.1。
这篇关于emmc 版本号查询 by ext_csd的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!