i.MX6 无法进入 Fastboot 模式调试

/ 0评 / 0

问题描述,烧录后卡住,并不能进入FB模式.

Reset cause: POR
Model: Freescale i.MX6 UltraLite 14x14 EVK Board
Board: MX6UL 14x14 EVK
DRAM:  512 MiB
; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot:  0

## Checking Image at 86800000 ...
Unknown image format!
Run fastboot ...
No USB device found
USB init failed: -19
=>

UUU检查未进入FB,从U-Boot Log也看到未在FB.

看起来是找不到设备,能下载第一阶段说明电路也没问题,不过这个设计中并没对OTG_ID处理,这也是导致这次错误的原因,不过,我们也不能打开BGA飞线,我们用软件解决.

进入U-Boot的菜单配置,打开调试信息,最啰嗦那种.

CONFIG_LOG_DEFAULT_LEVEL = 7 # 这个打开最高调试级别
CONFIG_LOG_MAX_LEVEL = 7 # 这个允许最高调试级别
CONFIG_LOGF_FILE = y # 调试信息显示文件路径
CONFIG_LOGF_LINE = y # 调试信息显示行号
CONFIG_LOGF_FUNC = y # 调试信息显示函数

当然需要更多调试信息也应该打开,我觉得目前这样就足够了.

Run fastboot ...
drivers/core/uclass.c:330-uclass_find_device_by_seq() 0
drivers/core/uclass.c:338-uclass_find_device_by_seq()    - 0 'usbg1'
drivers/core/uclass.c:341-uclass_find_device_by_seq()    - found
drivers/core/uclass.c:330-uclass_find_device_by_seq() 0
drivers/core/uclass.c:338-uclass_find_device_by_seq()    - 0 'iomuxc@20e0000'
drivers/core/uclass.c:341-uclass_find_device_by_seq()    - found
drivers/pinctrl/pinctrl-uclass.c:300-pinctrl_select_state_simple() ci-udc-otg usbg1: set_state_simple op missing
drivers/core/uclass.c:330-uclass_find_device_by_seq() 0
drivers/core/uclass.c:338-uclass_find_device_by_seq()    - 0 'iomuxc@20e0000'
drivers/core/uclass.c:341-uclass_find_device_by_seq()    - found
drivers/pinctrl/pinctrl-uclass.c:300-pinctrl_select_state_simple() pinconfig usbotg1grp: set_state_simple op missing
drivers/pinctrl/nxp/pinctrl-imx.c:35-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: imx_pinctrl_set_state: usbotg1grp
drivers/pinctrl/nxp/pinctrl-imx.c:102-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: mux_reg 0x5c, conf_reg 0x2e8, input_reg 0x4b8, mux_mode 0x2, input_val 0x0, config_val 0x17059
drivers/pinctrl/nxp/pinctrl-imx.c:122-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: write mux: offset 0x5c val 0x2
drivers/pinctrl/nxp/pinctrl-imx.c:172-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: select_input: offset 0x4b8 val 0x0
drivers/pinctrl/nxp/pinctrl-imx.c:187-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: write config: offset 0x2e8 val 0x17059
drivers/core/uclass.c:330-uclass_find_device_by_seq() 0
drivers/core/uclass.c:338-uclass_find_device_by_seq()    - 0 'iomuxc@20e0000'
drivers/core/uclass.c:341-uclass_find_device_by_seq()    - found
drivers/pinctrl/pinctrl-uclass.c:300-pinctrl_select_state_simple() ci-udc-otg usbg1: set_state_simple op missing
drivers/pinctrl/nxp/pinctrl-imx.c:35-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: imx_pinctrl_set_state: usbotg1grp
drivers/pinctrl/nxp/pinctrl-imx.c:102-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: mux_reg 0x5c, conf_reg 0x2e8, input_reg 0x4b8, mux_mode 0x2, input_val 0x0, config_val 0x17059
drivers/pinctrl/nxp/pinctrl-imx.c:122-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: write mux: offset 0x5c val 0x2
drivers/pinctrl/nxp/pinctrl-imx.c:172-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: select_input: offset 0x4b8 val 0x0
drivers/pinctrl/nxp/pinctrl-imx.c:187-imx_pinctrl_set_state() fsl_imx6q_iomuxc iomuxc@20e0000: write config: offset 0x2e8 val 0x17059
drivers/usb/gadget/udc/udc-uclass.c:30-usb_gadget_initialize() No USB device found
cmd/fastboot.c:70-     do_fastboot_usb() USB init failed: -19
=>

最后看到因为usb_gadget_initialize返回无USB设备,所以最后无法初始化,文件也定位到了,打开他,接下来讲调试思路.

能执行30行,必定27行或者29行为dev为NULL或者ret非0,所以在27行之后打印,发现dev为NULL.

跟进uclass_get_device_by_seq,发现499行返回0即正确,因此问题出在uclass_get_device_tail,也就是设备的实际probe.

可以看到是probe请求了.

跟进函数,发现最后是调用各种驱动probe,那么是哪个驱动呢?

我们可以打印出来.

pr_err(" dev_name = %s,drv_name = %s\n",dev->name,drv->name);

看到具体的调用了.

跟进后在1459行出错.

他实际是读取USBPHY_CTRL,判断USBPHY_CTRL_OTG_ID,他指示的是OTG_ID引脚电压.

我们明确这个USB只用来做Device,因此就不再判断了.

于是顺利完成.

USB部分就算修好了.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注