嵌入式爱好者

查看: 76|回复: 1

[Linux] imx6dl在eMMC启动方式启动时uboot阶段卡死问题请教?

[复制链接]

1

主题

1

帖子

8

积分

i.MX6Q通行证

扫一扫,手机访问本帖
发表于 7 天前 | 显示全部楼层 |阅读模式
希望懂uboot的大神们进来看看,指教下我这个问题下面该如何调试。谢谢!
imx6dl在eMMC启动方式启动时uboot阶段卡死时串口输出信息如下:
  1. U-Boot 2009.08 ( 4月 23 2018 - 14:58:15)

  2. CPU: Freescale i.MX6 family TO1.3 at 792 MHz
  3. Temperature:   53 C, calibration data 0x5944f17d
  4. mx6q pll1: 792MHz
  5. mx6q pll2: 528MHz
  6. mx6q pll3: 480MHz
  7. mx6q pll8: 50MHz
  8. ipg clock     : 66000000Hz
  9. ipg per clock : 66000000Hz
  10. uart clock    : 80000000Hz
  11. cspi clock    : 60000000Hz
  12. ahb clock     : 132000000Hz
  13. axi clock   : 198000000Hz
  14. emi_slow clock: 99000000Hz
  15. ddr clock     : 396000000Hz
  16. usdhc1 clock  : 198000000Hz
  17. usdhc2 clock  : 198000000Hz
  18. usdhc3 clock  : 198000000Hz
  19. usdhc4 clock  : 198000000Hz
  20. nfc clock     : 24000000Hz
  21. Board: i.MX6DL/Solo-SABRESD: unknown-board Board: 0x61013 [POR ]
  22. Boot Device: SD
  23. I2C:   ready
  24. DRAM:   2 GB
  25. MMC:   FSL_USDHC: 0,FSL_USDHC: 1,FSL_USDHC: 2,FSL_USDHC: 3
复制代码

板子是自己做的板子,参考的是OKMX6X-S3(imx6dl)的开发板。
eMMC芯片型号是MT29F128G08,eMMC接在SDHC3上。
1、使用mfgtools工具已经将uboot和rootfs烧写成功了,但是在启动的时候卡在了上面输出;
2、经过自己在uboot中添加打印输出信息发现其卡在了eMMC模块处理部分,具体函数流程如下:
mmc_startup->
  init_part->test_part_dos->mmc_bread->mm_send_cmd->esdhc_send_cmd时在while (!(readl(&regs->irqstat) & IRQSTAT_BRR));
  处进入死循环;
说明:eMMC的product已经读取到了,并且跟手册上的描述一致。
3、在while (!(readl(&regs->irqstat) & IRQSTAT_BRR));前打印输出SDHC3相关寄存器如下:
  1. CMD_SEND:17
  2.                 ARG                         0x00000000
  3.                 FLAG                         0
  4. regs->dsaddr = 02198000, value=0x0 -----print_sdhc3_regs--165
  5. regs->blkattr = 02198004, value=0x10200 -----print_sdhc3_regs--166
  6. regs->prsstat = 02198024, value=0xff8d820e -----print_sdhc3_regs--167
  7. regs->proctl = 02198028, value=0x8800024 -----print_sdhc3_regs--168
  8. regs->sysctl = 0219802c, value=0x8e0018 -----print_sdhc3_regs--169
  9. regs->irqstat = 02198030, value=0x0 -----print_sdhc3_regs--170
  10. regs->irqstaten = 02198034, value=0x157f513f -----print_sdhc3_regs--171
  11. regs->irqsigen = 02198038, value=0x0 -----print_sdhc3_regs--172
  12. regs->autoc12err = 0219803c, value=0x0 -----print_sdhc3_regs--173
  13. regs->hostcapblt = 02198040, value=0x7f30000 -----print_sdhc3_regs--174
  14. regs->wml = 02198044, value=0x8000880 -----print_sdhc3_regs--175
  15. regs->mixctrl = 02198048, value=0x18 -----print_sdhc3_regs--176
  16. regs->dllctrl = 02198060, value=0x1000001 -----print_sdhc3_regs--177
  17. regs->dllstatus = 02198064, value=0x3a07 -----print_sdhc3_regs--178
  18. regs->clktunectrlstatus = 02198068, value=0x0 -----print_sdhc3_regs--179
  19. regs->vendorspec = 021980c0, value=0x20007809 -----print_sdhc3_regs--180
  20. regs->mmcboot = 021980c4, value=0x0 -----print_sdhc3_regs--181
  21. regs->hostver = 021980fc, value=0x103 -----print_sdhc3_regs--182
复制代码
开发板在此处寄存器的值如下:
  1. regs->dsaddr = 0219c000, value=0x0 -----print_sdhc3_regs--165
  2. regs->blkattr = 0219c004, value=0x10200 -----print_sdhc3_regs--166
  3. regs->prsstat = 0219c024, value=0xff8d8a8a -----print_sdhc3_regs--167
  4. regs->proctl = 0219c028, value=0x8800024 -----print_sdhc3_regs--168
  5. regs->sysctl = 0219c02c, value=0x8e0018 -----print_sdhc3_regs--169
  6. regs->irqstat = 0219c030, value=0x20 -----print_sdhc3_regs--170
  7. regs->irqstaten = 0219c034, value=0x157f513f -----print_sdhc3_regs--171
  8. regs->irqsigen = 0219c038, value=0x0 -----print_sdhc3_regs--172
  9. regs->autoc12err = 0219c03c, value=0x0 -----print_sdhc3_regs--173
  10. regs->hostcapblt = 0219c040, value=0x7f30000 -----print_sdhc3_regs--174
  11. regs->wml = 0219c044, value=0x8000880 -----print_sdhc3_regs--175
  12. regs->mixctrl = 0219c048, value=0x18 -----print_sdhc3_regs--176
  13. regs->dllctrl = 0219c060, value=0x1000001 -----print_sdhc3_regs--177
  14. regs->dllstatus = 0219c064, value=0x3c07 -----print_sdhc3_regs--178
  15. regs->clktunectrlstatus = 0219c068, value=0x0 -----print_sdhc3_regs--179
  16. regs->vendorspec = 0219c0c0, value=0x20007809 -----print_sdhc3_regs--180
  17. regs->mmcboot = 0219c0c4, value=0x0 -----print_sdhc3_regs--181
  18. regs->hostver = 0219c0fc, value=0x3 -----print_sdhc3_regs--182
复制代码
发现在有如下几个寄存器不同之处:
1)uSDHCx_PRES_STATE
     a)bit[11]
Buffer Read Enable
This status bit is used for non-DMA read transfers. The uSDHC implements an internal buffer to transfer
data efficiently. This read only flag indicates that valid data exists in the host side buffer. If this bit is high,
valid data greater than the watermark level exist in the buffer. A change of this bit from 1 to 0 occurs when
some reads from the buffer(read DATPORT (Base + 0x20)) are made and the buffer hasn't valid data
greater than the watermark level. A change of this bit from 0 to1 occurs when there is enough valid data
ready in the buffer and the Buffer Read Ready interrupt has been generated and enabled.
1 Read enable
0 Read disable

     b)bit[7]
SD Clock Gated Off Internally
This status bit indicates that the SD Clock is internally gated off, because of buffer over / under-run or read
pause without read wait assertion, or the driver set FRC_SDCLK_ON bit is 0 to stop the SD clock in idle
status. Set IPG_PERCLK_SOFT_EN and CARD_CLK_SOFT_EN to 0 also gate off SD clock. This bit is
for the Host Driver to debug data transaction on the SD bus.
1 SD Clock is gated off.
0 SD Clock is active

     c)bit[2]
1 DATA Line Active
0 DATA Line Inacti

2)uSDHCx_INT_STATUS
     a)bit[5]

Buffer Read Ready
This status bit is set if the Buffer Read Enable bit, in the Present State register, changes from 0 to 1. Refer
to the Buffer Read Enable bit in the Present State register for additional information.
1 Ready to read buffer
0 Not ready to read buffer
发现有问题的板子刚好跟开发板在上面的位相反。
故想请教下,mmc_startup->
  init_part->test_part_dos->mmc_bread->mm_send_cmd->esdhc_send_cmd这个函数流程具体作用是干什么的?然后这个问题可通过什么方式来进行下一步的调试。
谢谢!



回复

使用道具 举报

2

主题

3302

帖子

2888

积分

发表于 5 天前 | 显示全部楼层
您好
您对核心板有做过什么改动吗,另外我给您找了一篇有关您咨询函数的文章您可以看一看https://blog.csdn.net/zzobin/article/details/7688705
技术支持电话:0312-3119192
技术支持邮箱:Android@forlinx.com
点评回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|飞凌嵌入式 ( 冀ICP备12004394号-1

GMT+8, 2018-11-15 03:28

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表