接触嵌入式开发时间不长,现在想实现 uboot 通过 usb 从 dnw 下载image,输入 dnw后就死循环了,
想知道:
1.6410 OTG 时钟是否只需要 48MHz那个?
时钟配置相关的寄存器 除了S3C_OTG_PHYCTRL (PHYCLK,不明白UBOOT 为什么写成 CTRL),还需要设置其他寄存器么?
2.如何才能正常呢?
3.遇到这种问题怎么去思考解决呢?
[s3c_usb_core_soft_reset:340] the value of HCLK_GATE_REG is 0xFFFFFFFF.
输出如下:
Hit any key to stop autoboot: 0
Aim6410 # dnw c0008000
[s3c_usbctl_init:429] USB Control Init
[s3c_usb_init_phy:324] begin s3c_usb_init_phy
[s3c_usb_init_phy:331] end s3c_usb_init_phy
[s3c_usb_core_soft_reset:336] begin s3c_usb_core_soft_reset
[s3c_usb_core_soft_reset:344] the value of S3C_OTG_GRSTCTL is 0.
[s3c_usb_core_soft_reset:344] the value of S3C_OTG_GRSTCTL is 0.
...
uboot的初始化代码如下:
void s3c_usb_init_phy(void)
{
DBG_SETUP0("begin s3c_usb_init_phy\n");
writel(0x0, S3C_OTG_PHYPWR);
writel(0x00, S3C_OTG_PHYCTRL);
writel(0x1, S3C_OTG_RSTCON);
udelay(10);
writel(0x0, S3C_OTG_RSTCON);
udelay(10);
DBG_SETUP0("end s3c_usb_init_phy\n");
}
void s3c_usb_core_soft_reset(void)
{
DBG_SETUP0("begin s3c_usb_core_soft_reset\n");
u32 tmp;
writel(CORE_SOFT_RESET, S3C_OTG_GRSTCTL);
do
{
tmp = readl(S3C_OTG_GRSTCTL);
DBG_SETUP0("the value of S3C_OTG_GRSTCTL is %d.\n",tmp);
}while(!(tmp & AHB_MASTER_IDLE));
DBG_SETUP0("end s3c_usb_core_soft_reset\n");
}